diff --git a/docs/0.0.js b/docs/0.0.js index 934d218d0..e733259ab 100644 --- a/docs/0.0.js +++ b/docs/0.0.js @@ -1,401 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/cpp/cpp.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/cpp/cpp.js ***! - \**********************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - comments: { - lineComment: '//', - blockComment: ['/*', '*/'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '[', close: ']' }, - { open: '{', close: '}' }, - { open: '(', close: ')' }, - { open: "'", close: "'", notIn: ['string', 'comment'] }, - { open: '"', close: '"', notIn: ['string'] } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - folding: { - markers: { - start: new RegExp('^\\s*#pragma\\s+region\\b'), - end: new RegExp('^\\s*#pragma\\s+endregion\\b') - } - } -}; -var language = { - defaultToken: '', - tokenPostfix: '.cpp', - brackets: [ - { token: 'delimiter.curly', open: '{', close: '}' }, - { token: 'delimiter.parenthesis', open: '(', close: ')' }, - { token: 'delimiter.square', open: '[', close: ']' }, - { token: 'delimiter.angle', open: '<', close: '>' } - ], - keywords: [ - 'abstract', - 'amp', - 'array', - 'auto', - 'bool', - 'break', - 'case', - 'catch', - 'char', - 'class', - 'const', - 'constexpr', - 'const_cast', - 'continue', - 'cpu', - 'decltype', - 'default', - 'delegate', - 'delete', - 'do', - 'double', - 'dynamic_cast', - 'each', - 'else', - 'enum', - 'event', - 'explicit', - 'export', - 'extern', - 'false', - 'final', - 'finally', - 'float', - 'for', - 'friend', - 'gcnew', - 'generic', - 'goto', - 'if', - 'in', - 'initonly', - 'inline', - 'int', - 'interface', - 'interior_ptr', - 'internal', - 'literal', - 'long', - 'mutable', - 'namespace', - 'new', - 'noexcept', - 'nullptr', - '__nullptr', - 'operator', - 'override', - 'partial', - 'pascal', - 'pin_ptr', - 'private', - 'property', - 'protected', - 'public', - 'ref', - 'register', - 'reinterpret_cast', - 'restrict', - 'return', - 'safe_cast', - 'sealed', - 'short', - 'signed', - 'sizeof', - 'static', - 'static_assert', - 'static_cast', - 'struct', - 'switch', - 'template', - 'this', - 'thread_local', - 'throw', - 'tile_static', - 'true', - 'try', - 'typedef', - 'typeid', - 'typename', - 'union', - 'unsigned', - 'using', - 'virtual', - 'void', - 'volatile', - 'wchar_t', - 'where', - 'while', - '_asm', - '_based', - '_cdecl', - '_declspec', - '_fastcall', - '_if_exists', - '_if_not_exists', - '_inline', - '_multiple_inheritance', - '_pascal', - '_single_inheritance', - '_stdcall', - '_virtual_inheritance', - '_w64', - '__abstract', - '__alignof', - '__asm', - '__assume', - '__based', - '__box', - '__builtin_alignof', - '__cdecl', - '__clrcall', - '__declspec', - '__delegate', - '__event', - '__except', - '__fastcall', - '__finally', - '__forceinline', - '__gc', - '__hook', - '__identifier', - '__if_exists', - '__if_not_exists', - '__inline', - '__int128', - '__int16', - '__int32', - '__int64', - '__int8', - '__interface', - '__leave', - '__m128', - '__m128d', - '__m128i', - '__m256', - '__m256d', - '__m256i', - '__m64', - '__multiple_inheritance', - '__newslot', - '__nogc', - '__noop', - '__nounwind', - '__novtordisp', - '__pascal', - '__pin', - '__pragma', - '__property', - '__ptr32', - '__ptr64', - '__raise', - '__restrict', - '__resume', - '__sealed', - '__single_inheritance', - '__stdcall', - '__super', - '__thiscall', - '__try', - '__try_cast', - '__typeof', - '__unaligned', - '__unhook', - '__uuidof', - '__value', - '__virtual_inheritance', - '__w64', - '__wchar_t' - ], - operators: [ - '=', - '>', - '<', - '!', - '~', - '?', - ':', - '==', - '<=', - '>=', - '!=', - '&&', - '||', - '++', - '--', - '+', - '-', - '*', - '/', - '&', - '|', - '^', - '%', - '<<', - '>>', - '>>>', - '+=', - '-=', - '*=', - '/=', - '&=', - '|=', - '^=', - '%=', - '<<=', - '>>=', - '>>>=' - ], - // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], - [ - /@symbols/, - { - cases: { - '@operators': 'delimiter', - '@default': '' - } - } - ], - // numbers - [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, 'number.float'], - [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, 'number.float'], - [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, 'number.hex'], - [/0[0-7']*[0-7](@integersuffix)/, 'number.octal'], - [/0[bB][0-1']*[0-1](@integersuffix)/, 'number.binary'], - [/\d[\d']*\d(@integersuffix)/, 'number'], - [/\d(@integersuffix)/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/"/, 'string', '@string'], - // characters - [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], - [/'/, 'string.invalid'] - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/\/\*\*(?!\/)/, 'comment.doc', '@doccomment'], - [/\/\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'] - ], - comment: [ - [/[^\/*]+/, 'comment'], - [/\*\//, 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - //Identical copy of comment above, except for the addition of .doc - doccomment: [ - [/[^\/*]+/, 'comment.doc'], - [/\*\//, 'comment.doc', '@pop'], - [/[\/*]/, 'comment.doc'] - ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, 'string', '@pop'] - ], - raw: [ - [ - /(.*)(\))(?:([^ ()\\\t"]*))(\")/, - { - cases: { - '$3==$S2': [ - 'string.raw', - 'string.raw.end', - 'string.raw.end', - { token: 'string.raw.end', next: '@pop' } - ], - '@default': ['string.raw', 'string.raw', 'string.raw', 'string.raw'] - } - } - ], - [/.*/, 'string.raw'] - ], - include: [ - [ - /(\s*)(<)([^<>]*)(>)/, - [ - '', - 'keyword.directive.include.begin', - 'string.include.identifier', - { token: 'keyword.directive.include.end', next: '@pop' } - ] - ], - [ - /(\s*)(")([^"]*)(")/, - [ - '', - 'keyword.directive.include.begin', - 'string.include.identifier', - { token: 'keyword.directive.include.end', next: '@pop' } - ] - ] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=0.0.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{918:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return i})),t.d(n,"language",(function(){return r}));var i={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#pragma\\s+region\\b"),end:new RegExp("^\\s*#pragma\\s+endregion\\b")}}},r={defaultToken:"",tokenPostfix:".cpp",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],raw:[[/(.*)(\))(?:([^ ()\\\t"]*))(\")/,{cases:{"$3==$S2":["string.raw","string.raw.end","string.raw.end",{token:"string.raw.end",next:"@pop"}],"@default":["string.raw","string.raw","string.raw","string.raw"]}}],[/.*/,"string.raw"]],include:[[/(\s*)(<)([^<>]*)(>)/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]],[/(\s*)(")([^"]*)(")/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]]]}}}}]); \ No newline at end of file diff --git a/docs/1.1.js b/docs/1.1.js index 6ced5b558..351cd24be 100644 --- a/docs/1.1.js +++ b/docs/1.1.js @@ -1,580 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[1],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/systemverilog/systemverilog.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/systemverilog/systemverilog.js ***! - \******************************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - comments: { - lineComment: '//', - blockComment: ['/*', '*/'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'], - ['begin', 'end'], - ['case', 'endcase'], - ['casex', 'endcase'], - ['casez', 'endcase'], - ['checker', 'endchecker'], - ['class', 'endclass'], - ['clocking', 'endclocking'], - ['config', 'endconfig'], - ['function', 'endfunction'], - ['generate', 'endgenerate'], - ['group', 'endgroup'], - ['interface', 'endinterface'], - ['module', 'endmodule'], - ['package', 'endpackage'], - ['primitive', 'endprimitive'], - ['program', 'endprogram'], - ['property', 'endproperty'], - ['specify', 'endspecify'], - ['sequence', 'endsequence'], - ['table', 'endtable'], - ['task', 'endtask'] - ], - autoClosingPairs: [ - { open: '[', close: ']' }, - { open: '{', close: '}' }, - { open: '(', close: ')' }, - { open: "'", close: "'", notIn: ['string', 'comment'] }, - { open: '"', close: '"', notIn: ['string'] } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - folding: { - offSide: false, - markers: { - start: new RegExp('^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:begin|case(x|z)?|class|clocking|config|covergroup|function|generate|interface|module|package|primitive|property|program|sequence|specify|table|task)\\b'), - end: new RegExp('^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:end|endcase|endclass|endclocking|endconfig|endgroup|endfunction|endgenerate|endinterface|endmodule|endpackage|endprimitive|endproperty|endprogram|endsequence|endspecify|endtable|endtask)\\b') - } - } -}; -var language = { - defaultToken: '', - tokenPostfix: '.sv', - brackets: [ - { token: 'delimiter.curly', open: '{', close: '}' }, - { token: 'delimiter.parenthesis', open: '(', close: ')' }, - { token: 'delimiter.square', open: '[', close: ']' }, - { token: 'delimiter.angle', open: '<', close: '>' } - ], - keywords: [ - 'accept_on', - 'alias', - 'always', - 'always_comb', - 'always_ff', - 'always_latch', - 'and', - 'assert', - 'assign', - 'assume', - 'automatic', - 'before', - 'begin', - 'bind', - 'bins', - 'binsof', - 'bit', - 'break', - 'buf', - 'bufif0', - 'bufif1', - 'byte', - 'case', - 'casex', - 'casez', - 'cell', - 'chandle', - 'checker', - 'class', - 'clocking', - 'cmos', - 'config', - 'const', - 'constraint', - 'context', - 'continue', - 'cover', - 'covergroup', - 'coverpoint', - 'cross', - 'deassign', - 'default', - 'defparam', - 'design', - 'disable', - 'dist', - 'do', - 'edge', - 'else', - 'end', - 'endcase', - 'endchecker', - 'endclass', - 'endclocking', - 'endconfig', - 'endfunction', - 'endgenerate', - 'endgroup', - 'endinterface', - 'endmodule', - 'endpackage', - 'endprimitive', - 'endprogram', - 'endproperty', - 'endspecify', - 'endsequence', - 'endtable', - 'endtask', - 'enum', - 'event', - 'eventually', - 'expect', - 'export', - 'extends', - 'extern', - 'final', - 'first_match', - 'for', - 'force', - 'foreach', - 'forever', - 'fork', - 'forkjoin', - 'function', - 'generate', - 'genvar', - 'global', - 'highz0', - 'highz1', - 'if', - 'iff', - 'ifnone', - 'ignore_bins', - 'illegal_bins', - 'implements', - 'implies', - 'import', - 'incdir', - 'include', - 'initial', - 'inout', - 'input', - 'inside', - 'instance', - 'int', - 'integer', - 'interconnect', - 'interface', - 'intersect', - 'join', - 'join_any', - 'join_none', - 'large', - 'let', - 'liblist', - 'library', - 'local', - 'localparam', - 'logic', - 'longint', - 'macromodule', - 'matches', - 'medium', - 'modport', - 'module', - 'nand', - 'negedge', - 'nettype', - 'new', - 'nexttime', - 'nmos', - 'nor', - 'noshowcancelled', - 'not', - 'notif0', - 'notif1', - 'null', - 'or', - 'output', - 'package', - 'packed', - 'parameter', - 'pmos', - 'posedge', - 'primitive', - 'priority', - 'program', - 'property', - 'protected', - 'pull0', - 'pull1', - 'pulldown', - 'pullup', - 'pulsestyle_ondetect', - 'pulsestyle_onevent', - 'pure', - 'rand', - 'randc', - 'randcase', - 'randsequence', - 'rcmos', - 'real', - 'realtime', - 'ref', - 'reg', - 'reject_on', - 'release', - 'repeat', - 'restrict', - 'return', - 'rnmos', - 'rpmos', - 'rtran', - 'rtranif0', - 'rtranif1', - 's_always', - 's_eventually', - 's_nexttime', - 's_until', - 's_until_with', - 'scalared', - 'sequence', - 'shortint', - 'shortreal', - 'showcancelled', - 'signed', - 'small', - 'soft', - 'solve', - 'specify', - 'specparam', - 'static', - 'string', - 'strong', - 'strong0', - 'strong1', - 'struct', - 'super', - 'supply0', - 'supply1', - 'sync_accept_on', - 'sync_reject_on', - 'table', - 'tagged', - 'task', - 'this', - 'throughout', - 'time', - 'timeprecision', - 'timeunit', - 'tran', - 'tranif0', - 'tranif1', - 'tri', - 'tri0', - 'tri1', - 'triand', - 'trior', - 'trireg', - 'type', - 'typedef', - 'union', - 'unique', - 'unique0', - 'unsigned', - 'until', - 'until_with', - 'untyped', - 'use', - 'uwire', - 'var', - 'vectored', - 'virtual', - 'void', - 'wait', - 'wait_order', - 'wand', - 'weak', - 'weak0', - 'weak1', - 'while', - 'wildcard', - 'wire', - 'with', - 'within', - 'wor', - 'xnor', - 'xor' - ], - builtin_gates: [ - 'and', - 'nand', - 'nor', - 'or', - 'xor', - 'xnor', - 'buf', - 'not', - 'bufif0', - 'bufif1', - 'notif1', - 'notif0', - 'cmos', - 'nmos', - 'pmos', - 'rcmos', - 'rnmos', - 'rpmos', - 'tran', - 'tranif1', - 'tranif0', - 'rtran', - 'rtranif1', - 'rtranif0' - ], - operators: [ - // assignment operators - '=', - '+=', - '-=', - '*=', - '/=', - '%=', - '&=', - '|=', - '^=', - '<<=', - '>>+', - '<<<=', - '>>>=', - // conditional expression - '?', - ':', - // Unary operators - '+', - '-', - '!', - '~', - '&', - '~&', - '|', - '~|', - '^', - '~^', - '^~', - //binary operators - '+', - '-', - '*', - '/', - '%', - '==', - '!=', - '===', - '!==', - '==?', - '!=?', - '&&', - '||', - '**', - '<', - '<=', - '>', - '>=', - '&', - '|', - '^', - '>>', - '<<', - '>>>', - '<<<', - // increment or decrement operator - '++', - '--', - //binary logical operator - '->', - '<->', - // binary set membership operator - 'inside', - // binary distrubution operator - 'dist', - '::', - '+:', - '-:', - '*>', - '&&&', - '|->', - '|=>', - '#=#' - ], - // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], - [ - /@symbols/, - { - cases: { - '@operators': 'delimiter', - '@default': '' - } - } - ], - // numbers - { include: '@numbers' }, - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - { include: '@strings' } - ], - identifier_or_keyword: [ - [ - /@identifier/, - { - cases: { - '@keywords': { token: 'keyword.$0' }, - '@default': 'identifier' - } - } - ] - ], - numbers: [ - [/\d+?[\d_]*(?:\.[\d_]+)?[eE][\-+]?\d+/, 'number.float'], - [/\d+?[\d_]*\.[\d_]+(?:\s*@timeunits)?/, 'number.float'], - [/(?:\d+?[\d_]*\s*)?'[sS]?[dD]\s*[0-9xXzZ?]+?[0-9xXzZ?_]*/, 'number'], - [/(?:\d+?[\d_]*\s*)?'[sS]?[bB]\s*[0-1xXzZ?]+?[0-1xXzZ?_]*/, 'number.binary'], - [/(?:\d+?[\d_]*\s*)?'[sS]?[oO]\s*[0-7xXzZ?]+?[0-7xXzZ?_]*/, 'number.octal'], - [/(?:\d+?[\d_]*\s*)?'[sS]?[hH]\s*[0-9a-fA-FxXzZ?]+?[0-9a-fA-FxXzZ?_]*/, 'number.hex'], - [/1step/, 'number'], - [/[\dxXzZ]+?[\dxXzZ_]*(?:\s*@timeunits)?/, 'number'], - [/'[01xXzZ]+/, 'number'] - ], - module_instance: [ - { include: '@whitespace' }, - [/(#?)(\()/, ['', { token: '@brackets', next: '@port_connection' }]], - [/@identifier\s*[;={}\[\],]/, { token: '@rematch', next: '@pop' }], - [/@symbols|[;={}\[\],]/, { token: '@rematch', next: '@pop' }], - [/@identifier/, 'type'], - [/;/, 'delimiter', '@pop'] - ], - port_connection: [ - { include: '@identifier_or_keyword' }, - { include: '@whitespace' }, - [/@systemcall/, 'variable.predefined'], - { include: '@numbers' }, - { include: '@strings' }, - [/[,]/, 'delimiter'], - [/\(/, '@brackets', '@port_connection'], - [/\)/, '@brackets', '@pop'] - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/\/\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'] - ], - comment: [ - [/[^\/*]+/, 'comment'], - [/\*\//, 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - strings: [ - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/"/, 'string', '@string'] - ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, 'string', '@pop'] - ], - include: [ - [ - /(\s*)(")([\w*\/*]*)(.\w*)(")/, - [ - '', - 'string.include.identifier', - 'string.include.identifier', - 'string.include.identifier', - { token: 'string.include.identifier', next: '@pop' } - ] - ], - [ - /(\s*)(<)([\w*\/*]*)(.\w*)(>)/, - [ - '', - 'string.include.identifier', - 'string.include.identifier', - 'string.include.identifier', - { token: 'string.include.identifier', next: '@pop' } - ] - ] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=1.1.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{970:function(e,n,i){"use strict";i.r(n),i.d(n,"conf",(function(){return t})),i.d(n,"language",(function(){return r}));var t={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"],["begin","end"],["case","endcase"],["casex","endcase"],["casez","endcase"],["checker","endchecker"],["class","endclass"],["clocking","endclocking"],["config","endconfig"],["function","endfunction"],["generate","endgenerate"],["group","endgroup"],["interface","endinterface"],["module","endmodule"],["package","endpackage"],["primitive","endprimitive"],["program","endprogram"],["property","endproperty"],["specify","endspecify"],["sequence","endsequence"],["table","endtable"],["task","endtask"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!1,markers:{start:new RegExp("^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:begin|case(x|z)?|class|clocking|config|covergroup|function|generate|interface|module|package|primitive|property|program|sequence|specify|table|task)\\b"),end:new RegExp("^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:end|endcase|endclass|endclocking|endconfig|endgroup|endfunction|endgenerate|endinterface|endmodule|endpackage|endprimitive|endproperty|endprogram|endsequence|endspecify|endtable|endtask)\\b")}}},r={defaultToken:"",tokenPostfix:".sv",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["accept_on","alias","always","always_comb","always_ff","always_latch","and","assert","assign","assume","automatic","before","begin","bind","bins","binsof","bit","break","buf","bufif0","bufif1","byte","case","casex","casez","cell","chandle","checker","class","clocking","cmos","config","const","constraint","context","continue","cover","covergroup","coverpoint","cross","deassign","default","defparam","design","disable","dist","do","edge","else","end","endcase","endchecker","endclass","endclocking","endconfig","endfunction","endgenerate","endgroup","endinterface","endmodule","endpackage","endprimitive","endprogram","endproperty","endspecify","endsequence","endtable","endtask","enum","event","eventually","expect","export","extends","extern","final","first_match","for","force","foreach","forever","fork","forkjoin","function","generate","genvar","global","highz0","highz1","if","iff","ifnone","ignore_bins","illegal_bins","implements","implies","import","incdir","include","initial","inout","input","inside","instance","int","integer","interconnect","interface","intersect","join","join_any","join_none","large","let","liblist","library","local","localparam","logic","longint","macromodule","matches","medium","modport","module","nand","negedge","nettype","new","nexttime","nmos","nor","noshowcancelled","not","notif0","notif1","null","or","output","package","packed","parameter","pmos","posedge","primitive","priority","program","property","protected","pull0","pull1","pulldown","pullup","pulsestyle_ondetect","pulsestyle_onevent","pure","rand","randc","randcase","randsequence","rcmos","real","realtime","ref","reg","reject_on","release","repeat","restrict","return","rnmos","rpmos","rtran","rtranif0","rtranif1","s_always","s_eventually","s_nexttime","s_until","s_until_with","scalared","sequence","shortint","shortreal","showcancelled","signed","small","soft","solve","specify","specparam","static","string","strong","strong0","strong1","struct","super","supply0","supply1","sync_accept_on","sync_reject_on","table","tagged","task","this","throughout","time","timeprecision","timeunit","tran","tranif0","tranif1","tri","tri0","tri1","triand","trior","trireg","type","typedef","union","unique","unique0","unsigned","until","until_with","untyped","use","uwire","var","vectored","virtual","void","wait","wait_order","wand","weak","weak0","weak1","while","wildcard","wire","with","within","wor","xnor","xor"],builtin_gates:["and","nand","nor","or","xor","xnor","buf","not","bufif0","bufif1","notif1","notif0","cmos","nmos","pmos","rcmos","rnmos","rpmos","tran","tranif1","tranif0","rtran","rtranif1","rtranif0"],operators:["=","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>+","<<<=",">>>=","?",":","+","-","!","~","&","~&","|","~|","^","~^","^~","+","-","*","/","%","==","!=","===","!==","==?","!=?","&&","||","**","<","<=",">",">=","&","|","^",">>","<<",">>>","<<<","++","--","->","<->","inside","dist","::","+:","-:","*>","&&&","|->","|=>","#=#"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],{include:"@numbers"},[/[;,.]/,"delimiter"],{include:"@strings"}],identifier_or_keyword:[[/@identifier/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}]],numbers:[[/\d+?[\d_]*(?:\.[\d_]+)?[eE][\-+]?\d+/,"number.float"],[/\d+?[\d_]*\.[\d_]+(?:\s*@timeunits)?/,"number.float"],[/(?:\d+?[\d_]*\s*)?'[sS]?[dD]\s*[0-9xXzZ?]+?[0-9xXzZ?_]*/,"number"],[/(?:\d+?[\d_]*\s*)?'[sS]?[bB]\s*[0-1xXzZ?]+?[0-1xXzZ?_]*/,"number.binary"],[/(?:\d+?[\d_]*\s*)?'[sS]?[oO]\s*[0-7xXzZ?]+?[0-7xXzZ?_]*/,"number.octal"],[/(?:\d+?[\d_]*\s*)?'[sS]?[hH]\s*[0-9a-fA-FxXzZ?]+?[0-9a-fA-FxXzZ?_]*/,"number.hex"],[/1step/,"number"],[/[\dxXzZ]+?[\dxXzZ_]*(?:\s*@timeunits)?/,"number"],[/'[01xXzZ]+/,"number"]],module_instance:[{include:"@whitespace"},[/(#?)(\()/,["",{token:"@brackets",next:"@port_connection"}]],[/@identifier\s*[;={}\[\],]/,{token:"@rematch",next:"@pop"}],[/@symbols|[;={}\[\],]/,{token:"@rematch",next:"@pop"}],[/@identifier/,"type"],[/;/,"delimiter","@pop"]],port_connection:[{include:"@identifier_or_keyword"},{include:"@whitespace"},[/@systemcall/,"variable.predefined"],{include:"@numbers"},{include:"@strings"},[/[,]/,"delimiter"],[/\(/,"@brackets","@port_connection"],[/\)/,"@brackets","@pop"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],strings:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],include:[[/(\s*)(")([\w*\/*]*)(.\w*)(")/,["","string.include.identifier","string.include.identifier","string.include.identifier",{token:"string.include.identifier",next:"@pop"}]],[/(\s*)(<)([\w*\/*]*)(.\w*)(>)/,["","string.include.identifier","string.include.identifier","string.include.identifier",{token:"string.include.identifier",next:"@pop"}]]]}}}}]); \ No newline at end of file diff --git a/docs/10.10.js b/docs/10.10.js index c540ab686..a65070aed 100644 --- a/docs/10.10.js +++ b/docs/10.10.js @@ -1,120 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[10],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/bat/bat.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/bat/bat.js ***! - \**********************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - comments: { - lineComment: 'REM' - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' } - ], - surroundingPairs: [ - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' } - ], - folding: { - markers: { - start: new RegExp('^\\s*(::\\s*|REM\\s+)#region'), - end: new RegExp('^\\s*(::\\s*|REM\\s+)#endregion') - } - } -}; -var language = { - defaultToken: '', - ignoreCase: true, - tokenPostfix: '.bat', - brackets: [ - { token: 'delimiter.bracket', open: '{', close: '}' }, - { token: 'delimiter.parenthesis', open: '(', close: ')' }, - { token: 'delimiter.square', open: '[', close: ']' } - ], - keywords: /call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/, - // we include these common regular expressions - symbols: /[=>'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '<', close: '>' }, - { open: "'", close: "'" } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '<', close: '>' }, - { open: "'", close: "'" } - ] -}; -var language = { - defaultToken: '', - tokenPostfix: '.cameligo', - ignoreCase: true, - brackets: [ - { open: '{', close: '}', token: 'delimiter.curly' }, - { open: '[', close: ']', token: 'delimiter.square' }, - { open: '(', close: ')', token: 'delimiter.parenthesis' }, - { open: '<', close: '>', token: 'delimiter.angle' } - ], - keywords: [ - 'abs', - 'begin', - 'Bytes', - 'Crypto', - 'Current', - 'else', - 'end', - 'failwith', - 'false', - 'fun', - 'if', - 'in', - 'let', - 'let%entry', - 'let%init', - 'List', - 'list', - 'Map', - 'map', - 'match', - 'match%nat', - 'mod', - 'not', - 'operation', - 'Operation', - 'of', - 'Set', - 'set', - 'sender', - 'source', - 'String', - 'then', - 'true', - 'type', - 'with' - ], - typeKeywords: ['int', 'unit', 'string', 'tz'], - operators: [ - '=', - '>', - '<', - '<=', - '>=', - '<>', - ':', - ':=', - 'and', - 'mod', - 'or', - '+', - '-', - '*', - '/', - '@', - '&', - '^', - '%', - '->', - '<-' - ], - // we include these common regular expressions - symbols: /[=><:@\^&|+\-*\/\^%]+/, - // The main tokenizer for our languages - tokenizer: { - root: [ - // identifiers and keywords - [ - /[a-zA-Z_][\w]*/, - { - cases: { - '@keywords': { token: 'keyword.$0' }, - '@default': 'identifier' - } - } - ], - // whitespace - { include: '@whitespace' }, - // delimiters and operators - [/[{}()\[\]]/, '@brackets'], - [/[<>](?!@symbols)/, '@brackets'], - [ - /@symbols/, - { - cases: { - '@operators': 'delimiter', - '@default': '' - } - } - ], - // numbers - [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], - [/\$[0-9a-fA-F]{1,16}/, 'number.hex'], - [/\d+/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/'([^'\\]|\\.)*$/, 'string.invalid'], - [/'/, 'string', '@string'], - // characters - [/'[^\\']'/, 'string'], - [/'/, 'string.invalid'], - [/\#\d+/, 'string'] - ], - /* */ - comment: [ - [/[^\(\*]+/, 'comment'], - //[/\(\*/, 'comment', '@push' ], // nested comment not allowed :-( - [/\*\)/, 'comment', '@pop'], - [/\(\*/, 'comment'] - ], - string: [ - [/[^\\']+/, 'string'], - [/\\./, 'string.escape.invalid'], - [/'/, { token: 'string.quote', bracket: '@close', next: '@pop' }] - ], - whitespace: [ - [/[ \t\r\n]+/, 'white'], - [/\(\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=11.11.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{915:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return o})),t.d(n,"language",(function(){return s}));var o={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"}]},s={defaultToken:"",tokenPostfix:".cameligo",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["abs","begin","Bytes","Crypto","Current","else","end","failwith","false","fun","if","in","let","let%entry","let%init","List","list","Map","map","match","match%nat","mod","not","operation","Operation","of","Set","set","sender","source","String","then","true","type","with"],typeKeywords:["int","unit","string","tz"],operators:["=",">","<","<=",">=","<>",":",":=","and","mod","or","+","-","*","/","@","&","^","%","->","<-"],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\$[0-9a-fA-F]{1,16}/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],[/'[^\\']'/,"string"],[/'/,"string.invalid"],[/\#\d+/,"string"]],comment:[[/[^\(\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\(\*/,"comment"]],string:[[/[^\\']+/,"string"],[/\\./,"string.escape.invalid"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}}}}]); \ No newline at end of file diff --git a/docs/12.12.js b/docs/12.12.js index f0d680059..49955e38a 100644 --- a/docs/12.12.js +++ b/docs/12.12.js @@ -1,780 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[12],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/clojure/clojure.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/clojure/clojure.js ***! - \******************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - comments: { - lineComment: ';;' - }, - brackets: [ - ['[', ']'], - ['(', ')'], - ['{', '}'] - ], - autoClosingPairs: [ - { open: '[', close: ']' }, - { open: '"', close: '"' }, - { open: '(', close: ')' }, - { open: '{', close: '}' } - ], - surroundingPairs: [ - { open: '[', close: ']' }, - { open: '"', close: '"' }, - { open: '(', close: ')' }, - { open: '{', close: '}' } - ] -}; -var language = { - defaultToken: '', - ignoreCase: true, - tokenPostfix: '.clj', - brackets: [ - { open: '[', close: ']', token: 'delimiter.square' }, - { open: '(', close: ')', token: 'delimiter.parenthesis' }, - { open: '{', close: '}', token: 'delimiter.curly' } - ], - constants: ['true', 'false', 'nil'], - // delimiters: /[\\\[\]\s"#'(),;@^`{}~]|$/, - numbers: /^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/, - characters: /^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/, - escapes: /^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/, - // simple-namespace := /^[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*/ - // simple-symbol := /^(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)/ - // qualified-symbol := ((<.>)*)? - qualifiedSymbols: /^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/, - specialForms: [ - '.', - 'catch', - 'def', - 'do', - 'if', - 'monitor-enter', - 'monitor-exit', - 'new', - 'quote', - 'recur', - 'set!', - 'throw', - 'try', - 'var' - ], - coreSymbols: [ - '*', - "*'", - '*1', - '*2', - '*3', - '*agent*', - '*allow-unresolved-vars*', - '*assert*', - '*clojure-version*', - '*command-line-args*', - '*compile-files*', - '*compile-path*', - '*compiler-options*', - '*data-readers*', - '*default-data-reader-fn*', - '*e', - '*err*', - '*file*', - '*flush-on-newline*', - '*fn-loader*', - '*in*', - '*math-context*', - '*ns*', - '*out*', - '*print-dup*', - '*print-length*', - '*print-level*', - '*print-meta*', - '*print-namespace-maps*', - '*print-readably*', - '*read-eval*', - '*reader-resolver*', - '*source-path*', - '*suppress-read*', - '*unchecked-math*', - '*use-context-classloader*', - '*verbose-defrecords*', - '*warn-on-reflection*', - '+', - "+'", - '-', - "-'", - '->', - '->>', - '->ArrayChunk', - '->Eduction', - '->Vec', - '->VecNode', - '->VecSeq', - '-cache-protocol-fn', - '-reset-methods', - '..', - '/', - '<', - '<=', - '=', - '==', - '>', - '>=', - 'EMPTY-NODE', - 'Inst', - 'StackTraceElement->vec', - 'Throwable->map', - 'accessor', - 'aclone', - 'add-classpath', - 'add-watch', - 'agent', - 'agent-error', - 'agent-errors', - 'aget', - 'alength', - 'alias', - 'all-ns', - 'alter', - 'alter-meta!', - 'alter-var-root', - 'amap', - 'ancestors', - 'and', - 'any?', - 'apply', - 'areduce', - 'array-map', - 'as->', - 'aset', - 'aset-boolean', - 'aset-byte', - 'aset-char', - 'aset-double', - 'aset-float', - 'aset-int', - 'aset-long', - 'aset-short', - 'assert', - 'assoc', - 'assoc!', - 'assoc-in', - 'associative?', - 'atom', - 'await', - 'await-for', - 'await1', - 'bases', - 'bean', - 'bigdec', - 'bigint', - 'biginteger', - 'binding', - 'bit-and', - 'bit-and-not', - 'bit-clear', - 'bit-flip', - 'bit-not', - 'bit-or', - 'bit-set', - 'bit-shift-left', - 'bit-shift-right', - 'bit-test', - 'bit-xor', - 'boolean', - 'boolean-array', - 'boolean?', - 'booleans', - 'bound-fn', - 'bound-fn*', - 'bound?', - 'bounded-count', - 'butlast', - 'byte', - 'byte-array', - 'bytes', - 'bytes?', - 'case', - 'cast', - 'cat', - 'char', - 'char-array', - 'char-escape-string', - 'char-name-string', - 'char?', - 'chars', - 'chunk', - 'chunk-append', - 'chunk-buffer', - 'chunk-cons', - 'chunk-first', - 'chunk-next', - 'chunk-rest', - 'chunked-seq?', - 'class', - 'class?', - 'clear-agent-errors', - 'clojure-version', - 'coll?', - 'comment', - 'commute', - 'comp', - 'comparator', - 'compare', - 'compare-and-set!', - 'compile', - 'complement', - 'completing', - 'concat', - 'cond', - 'cond->', - 'cond->>', - 'condp', - 'conj', - 'conj!', - 'cons', - 'constantly', - 'construct-proxy', - 'contains?', - 'count', - 'counted?', - 'create-ns', - 'create-struct', - 'cycle', - 'dec', - "dec'", - 'decimal?', - 'declare', - 'dedupe', - 'default-data-readers', - 'definline', - 'definterface', - 'defmacro', - 'defmethod', - 'defmulti', - 'defn', - 'defn-', - 'defonce', - 'defprotocol', - 'defrecord', - 'defstruct', - 'deftype', - 'delay', - 'delay?', - 'deliver', - 'denominator', - 'deref', - 'derive', - 'descendants', - 'destructure', - 'disj', - 'disj!', - 'dissoc', - 'dissoc!', - 'distinct', - 'distinct?', - 'doall', - 'dorun', - 'doseq', - 'dosync', - 'dotimes', - 'doto', - 'double', - 'double-array', - 'double?', - 'doubles', - 'drop', - 'drop-last', - 'drop-while', - 'eduction', - 'empty', - 'empty?', - 'ensure', - 'ensure-reduced', - 'enumeration-seq', - 'error-handler', - 'error-mode', - 'eval', - 'even?', - 'every-pred', - 'every?', - 'ex-data', - 'ex-info', - 'extend', - 'extend-protocol', - 'extend-type', - 'extenders', - 'extends?', - 'false?', - 'ffirst', - 'file-seq', - 'filter', - 'filterv', - 'find', - 'find-keyword', - 'find-ns', - 'find-protocol-impl', - 'find-protocol-method', - 'find-var', - 'first', - 'flatten', - 'float', - 'float-array', - 'float?', - 'floats', - 'flush', - 'fn', - 'fn?', - 'fnext', - 'fnil', - 'for', - 'force', - 'format', - 'frequencies', - 'future', - 'future-call', - 'future-cancel', - 'future-cancelled?', - 'future-done?', - 'future?', - 'gen-class', - 'gen-interface', - 'gensym', - 'get', - 'get-in', - 'get-method', - 'get-proxy-class', - 'get-thread-bindings', - 'get-validator', - 'group-by', - 'halt-when', - 'hash', - 'hash-combine', - 'hash-map', - 'hash-ordered-coll', - 'hash-set', - 'hash-unordered-coll', - 'ident?', - 'identical?', - 'identity', - 'if-let', - 'if-not', - 'if-some', - 'ifn?', - 'import', - 'in-ns', - 'inc', - "inc'", - 'indexed?', - 'init-proxy', - 'inst-ms', - 'inst-ms*', - 'inst?', - 'instance?', - 'int', - 'int-array', - 'int?', - 'integer?', - 'interleave', - 'intern', - 'interpose', - 'into', - 'into-array', - 'ints', - 'io!', - 'isa?', - 'iterate', - 'iterator-seq', - 'juxt', - 'keep', - 'keep-indexed', - 'key', - 'keys', - 'keyword', - 'keyword?', - 'last', - 'lazy-cat', - 'lazy-seq', - 'let', - 'letfn', - 'line-seq', - 'list', - 'list*', - 'list?', - 'load', - 'load-file', - 'load-reader', - 'load-string', - 'loaded-libs', - 'locking', - 'long', - 'long-array', - 'longs', - 'loop', - 'macroexpand', - 'macroexpand-1', - 'make-array', - 'make-hierarchy', - 'map', - 'map-entry?', - 'map-indexed', - 'map?', - 'mapcat', - 'mapv', - 'max', - 'max-key', - 'memfn', - 'memoize', - 'merge', - 'merge-with', - 'meta', - 'method-sig', - 'methods', - 'min', - 'min-key', - 'mix-collection-hash', - 'mod', - 'munge', - 'name', - 'namespace', - 'namespace-munge', - 'nat-int?', - 'neg-int?', - 'neg?', - 'newline', - 'next', - 'nfirst', - 'nil?', - 'nnext', - 'not', - 'not-any?', - 'not-empty', - 'not-every?', - 'not=', - 'ns', - 'ns-aliases', - 'ns-imports', - 'ns-interns', - 'ns-map', - 'ns-name', - 'ns-publics', - 'ns-refers', - 'ns-resolve', - 'ns-unalias', - 'ns-unmap', - 'nth', - 'nthnext', - 'nthrest', - 'num', - 'number?', - 'numerator', - 'object-array', - 'odd?', - 'or', - 'parents', - 'partial', - 'partition', - 'partition-all', - 'partition-by', - 'pcalls', - 'peek', - 'persistent!', - 'pmap', - 'pop', - 'pop!', - 'pop-thread-bindings', - 'pos-int?', - 'pos?', - 'pr', - 'pr-str', - 'prefer-method', - 'prefers', - 'primitives-classnames', - 'print', - 'print-ctor', - 'print-dup', - 'print-method', - 'print-simple', - 'print-str', - 'printf', - 'println', - 'println-str', - 'prn', - 'prn-str', - 'promise', - 'proxy', - 'proxy-call-with-super', - 'proxy-mappings', - 'proxy-name', - 'proxy-super', - 'push-thread-bindings', - 'pvalues', - 'qualified-ident?', - 'qualified-keyword?', - 'qualified-symbol?', - 'quot', - 'rand', - 'rand-int', - 'rand-nth', - 'random-sample', - 'range', - 'ratio?', - 'rational?', - 'rationalize', - 're-find', - 're-groups', - 're-matcher', - 're-matches', - 're-pattern', - 're-seq', - 'read', - 'read-line', - 'read-string', - 'reader-conditional', - 'reader-conditional?', - 'realized?', - 'record?', - 'reduce', - 'reduce-kv', - 'reduced', - 'reduced?', - 'reductions', - 'ref', - 'ref-history-count', - 'ref-max-history', - 'ref-min-history', - 'ref-set', - 'refer', - 'refer-clojure', - 'reify', - 'release-pending-sends', - 'rem', - 'remove', - 'remove-all-methods', - 'remove-method', - 'remove-ns', - 'remove-watch', - 'repeat', - 'repeatedly', - 'replace', - 'replicate', - 'require', - 'reset!', - 'reset-meta!', - 'reset-vals!', - 'resolve', - 'rest', - 'restart-agent', - 'resultset-seq', - 'reverse', - 'reversible?', - 'rseq', - 'rsubseq', - 'run!', - 'satisfies?', - 'second', - 'select-keys', - 'send', - 'send-off', - 'send-via', - 'seq', - 'seq?', - 'seqable?', - 'seque', - 'sequence', - 'sequential?', - 'set', - 'set-agent-send-executor!', - 'set-agent-send-off-executor!', - 'set-error-handler!', - 'set-error-mode!', - 'set-validator!', - 'set?', - 'short', - 'short-array', - 'shorts', - 'shuffle', - 'shutdown-agents', - 'simple-ident?', - 'simple-keyword?', - 'simple-symbol?', - 'slurp', - 'some', - 'some->', - 'some->>', - 'some-fn', - 'some?', - 'sort', - 'sort-by', - 'sorted-map', - 'sorted-map-by', - 'sorted-set', - 'sorted-set-by', - 'sorted?', - 'special-symbol?', - 'spit', - 'split-at', - 'split-with', - 'str', - 'string?', - 'struct', - 'struct-map', - 'subs', - 'subseq', - 'subvec', - 'supers', - 'swap!', - 'swap-vals!', - 'symbol', - 'symbol?', - 'sync', - 'tagged-literal', - 'tagged-literal?', - 'take', - 'take-last', - 'take-nth', - 'take-while', - 'test', - 'the-ns', - 'thread-bound?', - 'time', - 'to-array', - 'to-array-2d', - 'trampoline', - 'transduce', - 'transient', - 'tree-seq', - 'true?', - 'type', - 'unchecked-add', - 'unchecked-add-int', - 'unchecked-byte', - 'unchecked-char', - 'unchecked-dec', - 'unchecked-dec-int', - 'unchecked-divide-int', - 'unchecked-double', - 'unchecked-float', - 'unchecked-inc', - 'unchecked-inc-int', - 'unchecked-int', - 'unchecked-long', - 'unchecked-multiply', - 'unchecked-multiply-int', - 'unchecked-negate', - 'unchecked-negate-int', - 'unchecked-remainder-int', - 'unchecked-short', - 'unchecked-subtract', - 'unchecked-subtract-int', - 'underive', - 'unquote', - 'unquote-splicing', - 'unreduced', - 'unsigned-bit-shift-right', - 'update', - 'update-in', - 'update-proxy', - 'uri?', - 'use', - 'uuid?', - 'val', - 'vals', - 'var-get', - 'var-set', - 'var?', - 'vary-meta', - 'vec', - 'vector', - 'vector-of', - 'vector?', - 'volatile!', - 'volatile?', - 'vreset!', - 'vswap!', - 'when', - 'when-first', - 'when-let', - 'when-not', - 'when-some', - 'while', - 'with-bindings', - 'with-bindings*', - 'with-in-str', - 'with-loading-context', - 'with-local-vars', - 'with-meta', - 'with-open', - 'with-out-str', - 'with-precision', - 'with-redefs', - 'with-redefs-fn', - 'xml-seq', - 'zero?', - 'zipmap' - ], - tokenizer: { - root: [ - // whitespaces and comments - { include: '@whitespace' }, - // numbers - [/@numbers/, 'number'], - // characters - [/@characters/, 'string'], - // strings - { include: '@string' }, - // brackets - [/[()\[\]{}]/, '@brackets'], - // regular expressions - [/\/#"(?:\.|(?:")|[^"\n])*"\/g/, 'regexp'], - // reader macro characters - [/[#'@^`~]/, 'meta'], - // symbols - [ - /@qualifiedSymbols/, - { - cases: { - '^:.+$': 'constant', - '@specialForms': 'keyword', - '@coreSymbols': 'keyword', - '@constants': 'constant', - '@default': 'identifier' - } - } - ] - ], - whitespace: [ - [/[\s,]+/, 'white'], - [/;.*$/, 'comment'], - [/\(comment\b/, 'comment', '@comment'] - ], - comment: [ - [/\(/, 'comment', '@push'], - [/\)/, 'comment', '@pop'], - [/[^()]/, 'comment'] - ], - string: [[/"/, 'string', '@multiLineString']], - multiLineString: [ - [/"/, 'string', '@popall'], - [/@escapes/, 'string.escape'], - [/./, 'string'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=12.12.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{916:function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return r})),n.d(t,"language",(function(){return s}));var r={comments:{lineComment:";;"},brackets:[["[","]"],["(",")"],["{","}"]],autoClosingPairs:[{open:"[",close:"]"},{open:'"',close:'"'},{open:"(",close:")"},{open:"{",close:"}"}],surroundingPairs:[{open:"[",close:"]"},{open:'"',close:'"'},{open:"(",close:")"},{open:"{",close:"}"}]},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".clj",brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"}],constants:["true","false","nil"],numbers:/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,characters:/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,escapes:/^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,qualifiedSymbols:/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,specialForms:[".","catch","def","do","if","monitor-enter","monitor-exit","new","quote","recur","set!","throw","try","var"],coreSymbols:["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","cast","cat","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","seque","sequence","sequential?","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"],tokenizer:{root:[{include:"@whitespace"},[/@numbers/,"number"],[/@characters/,"string"],{include:"@string"},[/[()\[\]{}]/,"@brackets"],[/\/#"(?:\.|(?:")|[^"\n])*"\/g/,"regexp"],[/[#'@^`~]/,"meta"],[/@qualifiedSymbols/,{cases:{"^:.+$":"constant","@specialForms":"keyword","@coreSymbols":"keyword","@constants":"constant","@default":"identifier"}}]],whitespace:[[/[\s,]+/,"white"],[/;.*$/,"comment"],[/\(comment\b/,"comment","@comment"]],comment:[[/\(/,"comment","@push"],[/\)/,"comment","@pop"],[/[^()]/,"comment"]],string:[[/"/,"string","@multiLineString"]],multiLineString:[[/"/,"string","@popall"],[/@escapes/,"string.escape"],[/./,"string"]]}}}}]); \ No newline at end of file diff --git a/docs/13.13.js b/docs/13.13.js index 0545ccdd7..0d887b6b7 100644 --- a/docs/13.13.js +++ b/docs/13.13.js @@ -1,252 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[13],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/coffee/coffee.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/coffee/coffee.js ***! - \****************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, - comments: { - blockComment: ['###', '###'], - lineComment: '#' - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - folding: { - markers: { - start: new RegExp('^\\s*#region\\b'), - end: new RegExp('^\\s*#endregion\\b') - } - } -}; -var language = { - defaultToken: '', - ignoreCase: true, - tokenPostfix: '.coffee', - brackets: [ - { open: '{', close: '}', token: 'delimiter.curly' }, - { open: '[', close: ']', token: 'delimiter.square' }, - { open: '(', close: ')', token: 'delimiter.parenthesis' } - ], - regEx: /\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/, - keywords: [ - 'and', - 'or', - 'is', - 'isnt', - 'not', - 'on', - 'yes', - '@', - 'no', - 'off', - 'true', - 'false', - 'null', - 'this', - 'new', - 'delete', - 'typeof', - 'in', - 'instanceof', - 'return', - 'throw', - 'break', - 'continue', - 'debugger', - 'if', - 'else', - 'switch', - 'for', - 'while', - 'do', - 'try', - 'catch', - 'finally', - 'class', - 'extends', - 'super', - 'undefined', - 'then', - 'unless', - 'until', - 'loop', - 'of', - 'by', - 'when' - ], - // we include these common regular expressions - symbols: /[=>\/\?\s]+)/g,comments:{blockComment:["###","###"],lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".coffee",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:["and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when"],symbols:/[=>\/\?\s]+)/g, - comments: { - lineComment: '//', - blockComment: ['/*', '*/'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: "'", close: "'", notIn: ['string', 'comment'] }, - { open: '"', close: '"', notIn: ['string', 'comment'] } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '<', close: '>' }, - { open: "'", close: "'" }, - { open: '"', close: '"' } - ], - folding: { - markers: { - start: new RegExp('^\\s*#region\\b'), - end: new RegExp('^\\s*#endregion\\b') - } - } -}; -var language = { - defaultToken: '', - tokenPostfix: '.cs', - brackets: [ - { open: '{', close: '}', token: 'delimiter.curly' }, - { open: '[', close: ']', token: 'delimiter.square' }, - { open: '(', close: ')', token: 'delimiter.parenthesis' }, - { open: '<', close: '>', token: 'delimiter.angle' } - ], - keywords: [ - 'extern', - 'alias', - 'using', - 'bool', - 'decimal', - 'sbyte', - 'byte', - 'short', - 'ushort', - 'int', - 'uint', - 'long', - 'ulong', - 'char', - 'float', - 'double', - 'object', - 'dynamic', - 'string', - 'assembly', - 'is', - 'as', - 'ref', - 'out', - 'this', - 'base', - 'new', - 'typeof', - 'void', - 'checked', - 'unchecked', - 'default', - 'delegate', - 'var', - 'const', - 'if', - 'else', - 'switch', - 'case', - 'while', - 'do', - 'for', - 'foreach', - 'in', - 'break', - 'continue', - 'goto', - 'return', - 'throw', - 'try', - 'catch', - 'finally', - 'lock', - 'yield', - 'from', - 'let', - 'where', - 'join', - 'on', - 'equals', - 'into', - 'orderby', - 'ascending', - 'descending', - 'select', - 'group', - 'by', - 'namespace', - 'partial', - 'class', - 'field', - 'event', - 'method', - 'param', - 'property', - 'public', - 'protected', - 'internal', - 'private', - 'abstract', - 'sealed', - 'static', - 'struct', - 'readonly', - 'volatile', - 'virtual', - 'override', - 'params', - 'get', - 'set', - 'add', - 'remove', - 'operator', - 'true', - 'false', - 'implicit', - 'explicit', - 'interface', - 'enum', - 'null', - 'async', - 'await', - 'fixed', - 'sizeof', - 'stackalloc', - 'unsafe', - 'nameof', - 'when' - ], - namespaceFollows: ['namespace', 'using'], - parenFollows: ['if', 'for', 'while', 'switch', 'foreach', 'using', 'catch', 'when'], - operators: [ - '=', - '??', - '||', - '&&', - '|', - '^', - '&', - '==', - '!=', - '<=', - '>=', - '<<', - '+', - '-', - '*', - '/', - '%', - '!', - '~', - '++', - '--', - '+=', - '-=', - '*=', - '/=', - '%=', - '&=', - '|=', - '^=', - '<<=', - '>>=', - '>>', - '=>' - ], - symbols: /[=>](?!@symbols)/, '@brackets'], - [ - /@symbols/, - { - cases: { - '@operators': 'delimiter', - '@default': '' - } - } - ], - // numbers - [/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/, 'number.float'], - [/0[xX][0-9a-fA-F_]+/, 'number.hex'], - [/0[bB][01_]+/, 'number.hex'], - [/[0-9_]+/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/"/, { token: 'string.quote', next: '@string' }], - [/\$\@"/, { token: 'string.quote', next: '@litinterpstring' }], - [/\@"/, { token: 'string.quote', next: '@litstring' }], - [/\$"/, { token: 'string.quote', next: '@interpolatedstring' }], - // characters - [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], - [/'/, 'string.invalid'] - ], - qualified: [ - [ - /[a-zA-Z_][\w]*/, - { - cases: { - '@keywords': { token: 'keyword.$0' }, - '@default': 'identifier' - } - } - ], - [/\./, 'delimiter'], - ['', '', '@pop'] - ], - namespace: [ - { include: '@whitespace' }, - [/[A-Z]\w*/, 'namespace'], - [/[\.=]/, 'delimiter'], - ['', '', '@pop'] - ], - comment: [ - [/[^\/*]+/, 'comment'], - // [/\/\*/, 'comment', '@push' ], // no nested comments :-( - ['\\*/', 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, { token: 'string.quote', next: '@pop' }] - ], - litstring: [ - [/[^"]+/, 'string'], - [/""/, 'string.escape'], - [/"/, { token: 'string.quote', next: '@pop' }] - ], - litinterpstring: [ - [/[^"{]+/, 'string'], - [/""/, 'string.escape'], - [/{{/, 'string.escape'], - [/}}/, 'string.escape'], - [/{/, { token: 'string.quote', next: 'root.litinterpstring' }], - [/"/, { token: 'string.quote', next: '@pop' }] - ], - interpolatedstring: [ - [/[^\\"{]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/{{/, 'string.escape'], - [/}}/, 'string.escape'], - [/{/, { token: 'string.quote', next: 'root.interpolatedstring' }], - [/"/, { token: 'string.quote', next: '@pop' }] - ], - whitespace: [ - [/^[ \t\v\f]*#((r)|(load))(?=\s)/, 'directive.csx'], - [/^[ \t\v\f]*#\w.*$/, 'namespace.cpp'], - [/[ \t\v\f\r\n]+/, ''], - [/\/\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=14.14.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{919:function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return o})),n.d(t,"language",(function(){return s}));var o={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},s={defaultToken:"",tokenPostfix:".cs",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["extern","alias","using","bool","decimal","sbyte","byte","short","ushort","int","uint","long","ulong","char","float","double","object","dynamic","string","assembly","is","as","ref","out","this","base","new","typeof","void","checked","unchecked","default","delegate","var","const","if","else","switch","case","while","do","for","foreach","in","break","continue","goto","return","throw","try","catch","finally","lock","yield","from","let","where","join","on","equals","into","orderby","ascending","descending","select","group","by","namespace","partial","class","field","event","method","param","property","public","protected","internal","private","abstract","sealed","static","struct","readonly","volatile","virtual","override","params","get","set","add","remove","operator","true","false","implicit","explicit","interface","enum","null","async","await","fixed","sizeof","stackalloc","unsafe","nameof","when"],namespaceFollows:["namespace","using"],parenFollows:["if","for","while","switch","foreach","using","catch","when"],operators:["=","??","||","&&","|","^","&","==","!=","<=",">=","<<","+","-","*","/","%","!","~","++","--","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=",">>","=>"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01_]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",next:"@string"}],[/\$\@"/,{token:"string.quote",next:"@litinterpstring"}],[/\@"/,{token:"string.quote",next:"@litstring"}],[/\$"/,{token:"string.quote",next:"@interpolatedstring"}],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],qualified:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/\./,"delimiter"],["","","@pop"]],namespace:[{include:"@whitespace"},[/[A-Z]\w*/,"namespace"],[/[\.=]/,"delimiter"],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",next:"@pop"}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]],litinterpstring:[[/[^"{]+/,"string"],[/""/,"string.escape"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.litinterpstring"}],[/"/,{token:"string.quote",next:"@pop"}]],interpolatedstring:[[/[^\\"{]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.interpolatedstring"}],[/"/,{token:"string.quote",next:"@pop"}]],whitespace:[[/^[ \t\v\f]*#((r)|(load))(?=\s)/,"directive.csx"],[/^[ \t\v\f]*#\w.*$/,"namespace.cpp"],[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}}}}]); \ No newline at end of file diff --git a/docs/15.15.js b/docs/15.15.js index 335b8b39b..a4c1289a8 100644 --- a/docs/15.15.js +++ b/docs/15.15.js @@ -1,73 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[15],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/csp/csp.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/csp/csp.js ***! - \**********************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - brackets: [], - autoClosingPairs: [], - surroundingPairs: [] -}; -var language = { - // Set defaultToken to invalid to see what you do not tokenize yet - // defaultToken: 'invalid', - keywords: [], - typeKeywords: [], - tokenPostfix: '.csp', - operators: [], - symbols: /[=>', token: 'delimiter.angle' } - ], - tokenizer: { - root: [{ include: '@selector' }], - selector: [ - { include: '@comments' }, - { include: '@import' }, - { include: '@strings' }, - [ - '[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)', - { token: 'keyword', next: '@keyframedeclaration' } - ], - ['[@](page|content|font-face|-moz-document)', { token: 'keyword' }], - ['[@](charset|namespace)', { token: 'keyword', next: '@declarationbody' }], - [ - '(url-prefix)(\\()', - ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }] - ], - [ - '(url)(\\()', - ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }] - ], - { include: '@selectorname' }, - ['[\\*]', 'tag'], - ['[>\\+,]', 'delimiter'], - ['\\[', { token: 'delimiter.bracket', next: '@selectorattribute' }], - ['{', { token: 'delimiter.bracket', next: '@selectorbody' }] - ], - selectorbody: [ - { include: '@comments' }, - ['[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))', 'attribute.name', '@rulevalue'], - ['}', { token: 'delimiter.bracket', next: '@pop' }] - ], - selectorname: [ - ['(\\.|#(?=[^{])|%|(@identifier)|:)+', 'tag'] // selector (.foo, div, ...) - ], - selectorattribute: [ - { include: '@term' }, - [']', { token: 'delimiter.bracket', next: '@pop' }] - ], - term: [ - { include: '@comments' }, - [ - '(url-prefix)(\\()', - ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }] - ], - [ - '(url)(\\()', - ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }] - ], - { include: '@functioninvocation' }, - { include: '@numbers' }, - { include: '@name' }, - ['([<>=\\+\\-\\*\\/\\^\\|\\~,])', 'delimiter'], - [',', 'delimiter'] - ], - rulevalue: [ - { include: '@comments' }, - { include: '@strings' }, - { include: '@term' }, - ['!important', 'keyword'], - [';', 'delimiter', '@pop'], - ['(?=})', { token: '', next: '@pop' }] // missing semicolon - ], - warndebug: [['[@](warn|debug)', { token: 'keyword', next: '@declarationbody' }]], - import: [['[@](import)', { token: 'keyword', next: '@declarationbody' }]], - urldeclaration: [ - { include: '@strings' }, - ['[^)\r\n]+', 'string'], - ['\\)', { token: 'delimiter.parenthesis', next: '@pop' }] - ], - parenthizedterm: [ - { include: '@term' }, - ['\\)', { token: 'delimiter.parenthesis', next: '@pop' }] - ], - declarationbody: [ - { include: '@term' }, - [';', 'delimiter', '@pop'], - ['(?=})', { token: '', next: '@pop' }] // missing semicolon - ], - comments: [ - ['\\/\\*', 'comment', '@comment'], - ['\\/\\/+.*', 'comment'] - ], - comment: [ - ['\\*\\/', 'comment', '@pop'], - [/[^*/]+/, 'comment'], - [/./, 'comment'] - ], - name: [['@identifier', 'attribute.value']], - numbers: [ - [ - '-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?', - { token: 'attribute.value.number', next: '@units' } - ], - ['#[0-9a-fA-F_]+(?!\\w)', 'attribute.value.hex'] - ], - units: [ - [ - '(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?', - 'attribute.value.unit', - '@pop' - ] - ], - keyframedeclaration: [ - ['@identifier', 'attribute.value'], - ['{', { token: 'delimiter.bracket', switchTo: '@keyframebody' }] - ], - keyframebody: [ - { include: '@term' }, - ['{', { token: 'delimiter.bracket', next: '@selectorbody' }], - ['}', { token: 'delimiter.bracket', next: '@pop' }] - ], - functioninvocation: [ - ['@identifier\\(', { token: 'attribute.value', next: '@functionarguments' }] - ], - functionarguments: [ - ['\\$@identifier@ws:', 'attribute.name'], - ['[,]', 'delimiter'], - { include: '@term' }, - ['\\)', { token: 'attribute.value', next: '@pop' }] - ], - strings: [ - ['~?"', { token: 'string', next: '@stringenddoublequote' }], - ["~?'", { token: 'string', next: '@stringendquote' }] - ], - stringenddoublequote: [ - ['\\\\.', 'string'], - ['"', { token: 'string', next: '@pop' }], - [/[^\\"]+/, 'string'], - ['.', 'string'] - ], - stringendquote: [ - ['\\\\.', 'string'], - ["'", { token: 'string', next: '@pop' }], - [/[^\\']+/, 'string'], - ['.', 'string'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=16.16.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{921:function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return r})),n.d(t,"language",(function(){return i}));var r={wordPattern:/(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g,comments:{blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},i={defaultToken:"",tokenPostfix:".css",ws:"[ \t\n\r\f]*",identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.bracket"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},["[^)\r\n]+","string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}}}}]); \ No newline at end of file diff --git a/docs/17.17.js b/docs/17.17.js index e7bc08ea6..e5fe32841 100644 --- a/docs/17.17.js +++ b/docs/17.17.js @@ -1,301 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[17],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/dart/dart.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/dart/dart.js ***! - \************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - comments: { - lineComment: '//', - blockComment: ['/*', '*/'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: "'", close: "'", notIn: ['string', 'comment'] }, - { open: '"', close: '"', notIn: ['string'] }, - { open: '`', close: '`', notIn: ['string', 'comment'] }, - { open: '/**', close: ' */', notIn: ['string'] } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '<', close: '>' }, - { open: "'", close: "'" }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: '`', close: '`' } - ], - folding: { - markers: { - start: /^\s*\s*#?region\b/, - end: /^\s*\s*#?endregion\b/ - } - } -}; -var language = { - defaultToken: 'invalid', - tokenPostfix: '.dart', - keywords: [ - 'abstract', - 'dynamic', - 'implements', - 'show', - 'as', - 'else', - 'import', - 'static', - 'assert', - 'enum', - 'in', - 'super', - 'async', - 'export', - 'interface', - 'switch', - 'await', - 'extends', - 'is', - 'sync', - 'break', - 'external', - 'library', - 'this', - 'case', - 'factory', - 'mixin', - 'throw', - 'catch', - 'false', - 'new', - 'true', - 'class', - 'final', - 'null', - 'try', - 'const', - 'finally', - 'on', - 'typedef', - 'continue', - 'for', - 'operator', - 'var', - 'covariant', - 'Function', - 'part', - 'void', - 'default', - 'get', - 'rethrow', - 'while', - 'deferred', - 'hide', - 'return', - 'with', - 'do', - 'if', - 'set', - 'yield' - ], - typeKeywords: ['int', 'double', 'String', 'bool'], - operators: [ - '+', - '-', - '*', - '/', - '~/', - '%', - '++', - '--', - '==', - '!=', - '>', - '<', - '>=', - '<=', - '=', - '-=', - '/=', - '%=', - '>>=', - '^=', - '+=', - '*=', - '~/=', - '<<=', - '&=', - '!=', - '||', - '&&', - '&', - '|', - '^', - '~', - '<<', - '>>', - '!', - '>>>', - '??', - '?', - ':', - '|=' - ], - // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], - [/!(?=([^=]|$))/, 'delimiter'], - [ - /@symbols/, - { - cases: { - '@operators': 'delimiter', - '@default': '' - } - } - ], - // numbers - [/(@digits)[eE]([\-+]?(@digits))?/, 'number.float'], - [/(@digits)\.(@digits)([eE][\-+]?(@digits))?/, 'number.float'], - [/0[xX](@hexdigits)n?/, 'number.hex'], - [/0[oO]?(@octaldigits)n?/, 'number.octal'], - [/0[bB](@binarydigits)n?/, 'number.binary'], - [/(@digits)n?/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/'([^'\\]|\\.)*$/, 'string.invalid'], - [/"/, 'string', '@string_double'], - [/'/, 'string', '@string_single'] - // [/[a-zA-Z]+/, "variable"] - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/\/\*\*(?!\/)/, 'comment.doc', '@jsdoc'], - [/\/\*/, 'comment', '@comment'], - [/\/\/\/.*$/, 'comment.doc'], - [/\/\/.*$/, 'comment'] - ], - comment: [ - [/[^\/*]+/, 'comment'], - [/\*\//, 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - jsdoc: [ - [/[^\/*]+/, 'comment.doc'], - [/\*\//, 'comment.doc', '@pop'], - [/[\/*]/, 'comment.doc'] - ], - // We match regular expression quite precisely - regexp: [ - [ - /(\{)(\d+(?:,\d*)?)(\})/, - ['regexp.escape.control', 'regexp.escape.control', 'regexp.escape.control'] - ], - [ - /(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/, - ['regexp.escape.control', { token: 'regexp.escape.control', next: '@regexrange' }] - ], - [/(\()(\?:|\?=|\?!)/, ['regexp.escape.control', 'regexp.escape.control']], - [/[()]/, 'regexp.escape.control'], - [/@regexpctl/, 'regexp.escape.control'], - [/[^\\\/]/, 'regexp'], - [/@regexpesc/, 'regexp.escape'], - [/\\\./, 'regexp.invalid'], - [ - /(\/)([gimsuy]*)/, - [{ token: 'regexp', bracket: '@close', next: '@pop' }, 'keyword.other'] - ] - ], - regexrange: [ - [/-/, 'regexp.escape.control'], - [/\^/, 'regexp.invalid'], - [/@regexpesc/, 'regexp.escape'], - [/[^\]]/, 'regexp'], - [ - /\]/, - { - token: 'regexp.escape.control', - next: '@pop', - bracket: '@close' - } - ] - ], - string_double: [ - [/[^\\"\$]+/, 'string'], - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, 'string', '@pop'], - [/\$\w+/, 'identifier'] - ], - string_single: [ - [/[^\\'\$]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/'/, 'string', '@pop'], - [/\$\w+/, 'identifier'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=17.17.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{922:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return o})),t.d(n,"language",(function(){return r}));var o={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:"(",close:")"},{open:'"',close:'"'},{open:"`",close:"`"}],folding:{markers:{start:/^\s*\s*#?region\b/,end:/^\s*\s*#?endregion\b/}}},r={defaultToken:"invalid",tokenPostfix:".dart",keywords:["abstract","dynamic","implements","show","as","else","import","static","assert","enum","in","super","async","export","interface","switch","await","extends","is","sync","break","external","library","this","case","factory","mixin","throw","catch","false","new","true","class","final","null","try","const","finally","on","typedef","continue","for","operator","var","covariant","Function","part","void","default","get","rethrow","while","deferred","hide","return","with","do","if","set","yield"],typeKeywords:["int","double","String","bool"],operators:["+","-","*","/","~/","%","++","--","==","!=",">","<",">=","<=","=","-=","/=","%=",">>=","^=","+=","*=","~/=","<<=","&=","!=","||","&&","&","|","^","~","<<",">>","!",">>>","??","?",":","|="],symbols:/[=>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/\/.*$/,"comment.doc"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"\$]+/,"string"],[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"],[/\$\w+/,"identifier"]],string_single:[[/[^\\'\$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"],[/\$\w+/,"identifier"]]}}}}]); \ No newline at end of file diff --git a/docs/18.18.js b/docs/18.18.js index c539c4339..cc6194b51 100644 --- a/docs/18.18.js +++ b/docs/18.18.js @@ -1,148 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[18],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/dockerfile/dockerfile.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/dockerfile/dockerfile.js ***! - \************************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ] -}; -var language = { - defaultToken: '', - tokenPostfix: '.dockerfile', - variable: /\${?[\w]+}?/, - tokenizer: { - root: [ - { include: '@whitespace' }, - { include: '@comment' }, - [/(ONBUILD)(\s+)/, ['keyword', '']], - [/(ENV)(\s+)([\w]+)/, ['keyword', '', { token: 'variable', next: '@arguments' }]], - [ - /(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/, - { token: 'keyword', next: '@arguments' } - ] - ], - arguments: [ - { include: '@whitespace' }, - { include: '@strings' }, - [ - /(@variable)/, - { - cases: { - '@eos': { token: 'variable', next: '@popall' }, - '@default': 'variable' - } - } - ], - [ - /\\/, - { - cases: { - '@eos': '', - '@default': '' - } - } - ], - [ - /./, - { - cases: { - '@eos': { token: '', next: '@popall' }, - '@default': '' - } - } - ] - ], - // Deal with white space, including comments - whitespace: [ - [ - /\s+/, - { - cases: { - '@eos': { token: '', next: '@popall' }, - '@default': '' - } - } - ] - ], - comment: [[/(^#.*$)/, 'comment', '@popall']], - // Recognize strings, including those broken across lines with \ (but not without) - strings: [ - [/\\'$/, '', '@popall'], - [/\\'/, ''], - [/'$/, 'string', '@popall'], - [/'/, 'string', '@stringBody'], - [/"$/, 'string', '@popall'], - [/"/, 'string', '@dblStringBody'] - ], - stringBody: [ - [ - /[^\\\$']/, - { - cases: { - '@eos': { token: 'string', next: '@popall' }, - '@default': 'string' - } - } - ], - [/\\./, 'string.escape'], - [/'$/, 'string', '@popall'], - [/'/, 'string', '@pop'], - [/(@variable)/, 'variable'], - [/\\$/, 'string'], - [/$/, 'string', '@popall'] - ], - dblStringBody: [ - [ - /[^\\\$"]/, - { - cases: { - '@eos': { token: 'string', next: '@popall' }, - '@default': 'string' - } - } - ], - [/\\./, 'string.escape'], - [/"$/, 'string', '@popall'], - [/"/, 'string', '@pop'], - [/(@variable)/, 'variable'], - [/\\$/, 'string'], - [/$/, 'string', '@popall'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=18.18.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{923:function(e,n,o){"use strict";o.r(n),o.d(n,"conf",(function(){return s})),o.d(n,"language",(function(){return t}));var s={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},t={defaultToken:"",tokenPostfix:".dockerfile",variable:/\${?[\w]+}?/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/(ONBUILD)(\s+)/,["keyword",""]],[/(ENV)(\s+)([\w]+)/,["keyword","",{token:"variable",next:"@arguments"}]],[/(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/,{token:"keyword",next:"@arguments"}]],arguments:[{include:"@whitespace"},{include:"@strings"},[/(@variable)/,{cases:{"@eos":{token:"variable",next:"@popall"},"@default":"variable"}}],[/\\/,{cases:{"@eos":"","@default":""}}],[/./,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],whitespace:[[/\s+/,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],comment:[[/(^#.*$)/,"comment","@popall"]],strings:[[/\\'$/,"","@popall"],[/\\'/,""],[/'$/,"string","@popall"],[/'/,"string","@stringBody"],[/"$/,"string","@popall"],[/"/,"string","@dblStringBody"]],stringBody:[[/[^\\\$']/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/'$/,"string","@popall"],[/'/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]],dblStringBody:[[/[^\\\$"]/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/"$/,"string","@popall"],[/"/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]]}}}}]); \ No newline at end of file diff --git a/docs/19.19.js b/docs/19.19.js index 251d545a1..1e565396b 100644 --- a/docs/19.19.js +++ b/docs/19.19.js @@ -1,236 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[19],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/fsharp/fsharp.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/fsharp/fsharp.js ***! - \****************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - comments: { - lineComment: '//', - blockComment: ['(*', '*)'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - folding: { - markers: { - start: new RegExp('^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)'), - end: new RegExp('^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)') - } - } -}; -var language = { - defaultToken: '', - tokenPostfix: '.fs', - keywords: [ - 'abstract', - 'and', - 'atomic', - 'as', - 'assert', - 'asr', - 'base', - 'begin', - 'break', - 'checked', - 'component', - 'const', - 'constraint', - 'constructor', - 'continue', - 'class', - 'default', - 'delegate', - 'do', - 'done', - 'downcast', - 'downto', - 'elif', - 'else', - 'end', - 'exception', - 'eager', - 'event', - 'external', - 'extern', - 'false', - 'finally', - 'for', - 'fun', - 'function', - 'fixed', - 'functor', - 'global', - 'if', - 'in', - 'include', - 'inherit', - 'inline', - 'interface', - 'internal', - 'land', - 'lor', - 'lsl', - 'lsr', - 'lxor', - 'lazy', - 'let', - 'match', - 'member', - 'mod', - 'module', - 'mutable', - 'namespace', - 'method', - 'mixin', - 'new', - 'not', - 'null', - 'of', - 'open', - 'or', - 'object', - 'override', - 'private', - 'parallel', - 'process', - 'protected', - 'pure', - 'public', - 'rec', - 'return', - 'static', - 'sealed', - 'struct', - 'sig', - 'then', - 'to', - 'true', - 'tailcall', - 'trait', - 'try', - 'type', - 'upcast', - 'use', - 'val', - 'void', - 'virtual', - 'volatile', - 'when', - 'while', - 'with', - 'yield' - ], - // we include these common regular expressions - symbols: /[=>]. - [/\[<.*>\]/, 'annotation'], - // Preprocessor directive - [/^#(if|else|endif)/, 'keyword'], - // delimiters and operators - [/[{}()\[\]]/, '@brackets'], - [/[<>](?!@symbols)/, '@brackets'], - [/@symbols/, 'delimiter'], - // numbers - [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, 'number.float'], - [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, 'number.float'], - [/0x[0-9a-fA-F]+LF/, 'number.float'], - [/0x[0-9a-fA-F]+(@integersuffix)/, 'number.hex'], - [/0b[0-1]+(@integersuffix)/, 'number.bin'], - [/\d+(@integersuffix)/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/"""/, 'string', '@string."""'], - [/"/, 'string', '@string."'], - // literal string - [/\@"/, { token: 'string.quote', next: '@litstring' }], - // characters - [/'[^\\']'B?/, 'string'], - [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], - [/'/, 'string.invalid'] - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/\(\*(?!\))/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'] - ], - comment: [ - [/[^*(]+/, 'comment'], - [/\*\)/, 'comment', '@pop'], - [/\*/, 'comment'], - [/\(\*\)/, 'comment'], - [/\(/, 'comment'] - ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [ - /("""|"B?)/, - { - cases: { - '$#==$S2': { token: 'string', next: '@pop' }, - '@default': 'string' - } - } - ] - ], - litstring: [ - [/[^"]+/, 'string'], - [/""/, 'string.escape'], - [/"/, { token: 'string.quote', next: '@pop' }] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=19.19.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{924:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return s})),t.d(n,"language",(function(){return o}));var s={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)"),end:new RegExp("^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)")}}},o={defaultToken:"",tokenPostfix:".fs",keywords:["abstract","and","atomic","as","assert","asr","base","begin","break","checked","component","const","constraint","constructor","continue","class","default","delegate","do","done","downcast","downto","elif","else","end","exception","eager","event","external","extern","false","finally","for","fun","function","fixed","functor","global","if","in","include","inherit","inline","interface","internal","land","lor","lsl","lsr","lxor","lazy","let","match","member","mod","module","mutable","namespace","method","mixin","new","not","null","of","open","or","object","override","private","parallel","process","protected","pure","public","rec","return","static","sealed","struct","sig","then","to","true","tailcall","trait","try","type","upcast","use","val","void","virtual","volatile","when","while","with","yield"],symbols:/[=>\]/,"annotation"],[/^#(if|else|endif)/,"keyword"],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0x[0-9a-fA-F]+LF/,"number.float"],[/0x[0-9a-fA-F]+(@integersuffix)/,"number.hex"],[/0b[0-1]+(@integersuffix)/,"number.bin"],[/\d+(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"""/,"string",'@string."""'],[/"/,"string",'@string."'],[/\@"/,{token:"string.quote",next:"@litstring"}],[/'[^\\']'B?/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\(\*(?!\))/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^*(]+/,"comment"],[/\*\)/,"comment","@pop"],[/\*/,"comment"],[/\(\*\)/,"comment"],[/\(/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/("""|"B?)/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]]}}}}]); \ No newline at end of file diff --git a/docs/20.20.js b/docs/20.20.js index 6086ee214..2f5026495 100644 --- a/docs/20.20.js +++ b/docs/20.20.js @@ -1,237 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[20],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/go/go.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/go/go.js ***! - \********************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - comments: { - lineComment: '//', - blockComment: ['/*', '*/'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '`', close: '`', notIn: ['string'] }, - { open: '"', close: '"', notIn: ['string'] }, - { open: "'", close: "'", notIn: ['string', 'comment'] } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '`', close: '`' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ] -}; -var language = { - defaultToken: '', - tokenPostfix: '.go', - keywords: [ - 'break', - 'case', - 'chan', - 'const', - 'continue', - 'default', - 'defer', - 'else', - 'fallthrough', - 'for', - 'func', - 'go', - 'goto', - 'if', - 'import', - 'interface', - 'map', - 'package', - 'range', - 'return', - 'select', - 'struct', - 'switch', - 'type', - 'var', - 'bool', - 'true', - 'false', - 'uint8', - 'uint16', - 'uint32', - 'uint64', - 'int8', - 'int16', - 'int32', - 'int64', - 'float32', - 'float64', - 'complex64', - 'complex128', - 'byte', - 'rune', - 'uint', - 'int', - 'uintptr', - 'string', - 'nil' - ], - operators: [ - '+', - '-', - '*', - '/', - '%', - '&', - '|', - '^', - '<<', - '>>', - '&^', - '+=', - '-=', - '*=', - '/=', - '%=', - '&=', - '|=', - '^=', - '<<=', - '>>=', - '&^=', - '&&', - '||', - '<-', - '++', - '--', - '==', - '<', - '>', - '=', - '!', - '!=', - '<=', - '>=', - ':=', - '...', - '(', - ')', - '', - ']', - '{', - '}', - ',', - ';', - '.', - ':' - ], - // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], - [ - /@symbols/, - { - cases: { - '@operators': 'delimiter', - '@default': '' - } - } - ], - // numbers - [/\d*\d+[eE]([\-+]?\d+)?/, 'number.float'], - [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], - [/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, 'number.hex'], - [/0[0-7']*[0-7]/, 'number.octal'], - [/0[bB][0-1']*[0-1]/, 'number.binary'], - [/\d[\d']*/, 'number'], - [/\d/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/"/, 'string', '@string'], - [/`/, 'string', '@rawstring'], - // characters - [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], - [/'/, 'string.invalid'] - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/\/\*\*(?!\/)/, 'comment.doc', '@doccomment'], - [/\/\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'] - ], - comment: [ - [/[^\/*]+/, 'comment'], - // [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-( - // [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/ - [/\*\//, 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - //Identical copy of comment above, except for the addition of .doc - doccomment: [ - [/[^\/*]+/, 'comment.doc'], - // [/\/\*/, 'comment.doc', '@push' ], // nested comment not allowed :-( - [/\/\*/, 'comment.doc.invalid'], - [/\*\//, 'comment.doc', '@pop'], - [/[\/*]/, 'comment.doc'] - ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, 'string', '@pop'] - ], - rawstring: [ - [/[^\`]/, 'string'], - [/`/, 'string', '@pop'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=20.20.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{925:function(e,n,o){"use strict";o.r(n),o.d(n,"conf",(function(){return t})),o.d(n,"language",(function(){return s}));var t={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`"},{open:'"',close:'"'},{open:"'",close:"'"}]},s={defaultToken:"",tokenPostfix:".go",keywords:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var","bool","true","false","uint8","uint16","uint32","uint64","int8","int16","int32","int64","float32","float64","complex64","complex128","byte","rune","uint","int","uintptr","string","nil"],operators:["+","-","*","/","%","&","|","^","<<",">>","&^","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=","&^=","&&","||","<-","++","--","==","<",">","=","!","!=","<=",">=",":=","...","(",")","","]","{","}",",",";",".",":"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex"],[/0[0-7']*[0-7]/,"number.octal"],[/0[bB][0-1']*[0-1]/,"number.binary"],[/\d[\d']*/,"number"],[/\d/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/`/,"string","@rawstring"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],rawstring:[[/[^\`]/,"string"],[/`/,"string","@pop"]]}}}}]); \ No newline at end of file diff --git a/docs/21.21.js b/docs/21.21.js index ae17ca973..43c6ce4bd 100644 --- a/docs/21.21.js +++ b/docs/21.21.js @@ -1,170 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[21],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/graphql/graphql.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/graphql/graphql.js ***! - \******************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - comments: { - lineComment: '#' - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"""', close: '"""', notIn: ['string', 'comment'] }, - { open: '"', close: '"', notIn: ['string', 'comment'] } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"""', close: '"""' }, - { open: '"', close: '"' } - ], - folding: { - offSide: true - } -}; -var language = { - // Set defaultToken to invalid to see what you do not tokenize yet - defaultToken: 'invalid', - tokenPostfix: '.gql', - keywords: [ - 'null', - 'true', - 'false', - 'query', - 'mutation', - 'subscription', - 'extend', - 'schema', - 'directive', - 'scalar', - 'type', - 'interface', - 'union', - 'enum', - 'input', - 'implements', - 'fragment', - 'on' - ], - typeKeywords: ['Int', 'Float', 'String', 'Boolean', 'ID'], - directiveLocations: [ - 'SCHEMA', - 'SCALAR', - 'OBJECT', - 'FIELD_DEFINITION', - 'ARGUMENT_DEFINITION', - 'INTERFACE', - 'UNION', - 'ENUM', - 'ENUM_VALUE', - 'INPUT_OBJECT', - 'INPUT_FIELD_DEFINITION', - 'QUERY', - 'MUTATION', - 'SUBSCRIPTION', - 'FIELD', - 'FRAGMENT_DEFINITION', - 'FRAGMENT_SPREAD', - 'INLINE_FRAGMENT', - 'VARIABLE_DEFINITION' - ], - operators: ['=', '!', '?', ':', '&', '|'], - // we include these common regular expressions - symbols: /[=!?:&|]+/, - // https://facebook.github.io/graphql/draft/#sec-String-Value - escapes: /\\(?:["\\\/bfnrt]|u[0-9A-Fa-f]{4})/, - // The main tokenizer for our languages - tokenizer: { - root: [ - // fields and argument names - [ - /[a-z_][\w$]*/, - { - cases: { - '@keywords': 'keyword', - '@default': 'key.identifier' - } - } - ], - // identify typed input variables - [ - /[$][\w$]*/, - { - cases: { - '@keywords': 'keyword', - '@default': 'argument.identifier' - } - } - ], - // to show class names nicely - [ - /[A-Z][\w\$]*/, - { - cases: { - '@typeKeywords': 'keyword', - '@default': 'type.identifier' - } - } - ], - // whitespace - { include: '@whitespace' }, - // delimiters and operators - [/[{}()\[\]]/, '@brackets'], - [/@symbols/, { cases: { '@operators': 'operator', '@default': '' } }], - // @ annotations. - // As an example, we emit a debugging log message on these tokens. - // Note: message are supressed during the first load -- change some lines to see them. - [/@\s*[a-zA-Z_\$][\w\$]*/, { token: 'annotation', log: 'annotation token: $0' }], - // numbers - [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], - [/0[xX][0-9a-fA-F]+/, 'number.hex'], - [/\d+/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - [/"""/, { token: 'string', next: '@mlstring', nextEmbedded: 'markdown' }], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/"/, { token: 'string.quote', bracket: '@open', next: '@string' }] - ], - mlstring: [ - [/[^"]+/, 'string'], - ['"""', { token: 'string', next: '@pop', nextEmbedded: '@pop' }] - ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, { token: 'string.quote', bracket: '@close', next: '@pop' }] - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/#.*$/, 'comment'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=21.21.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{926:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return o})),t.d(n,"language",(function(){return s}));var o={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"""',close:'"""',notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"""',close:'"""'},{open:'"',close:'"'}],folding:{offSide:!0}},s={defaultToken:"invalid",tokenPostfix:".gql",keywords:["null","true","false","query","mutation","subscription","extend","schema","directive","scalar","type","interface","union","enum","input","implements","fragment","on"],typeKeywords:["Int","Float","String","Boolean","ID"],directiveLocations:["SCHEMA","SCALAR","OBJECT","FIELD_DEFINITION","ARGUMENT_DEFINITION","INTERFACE","UNION","ENUM","ENUM_VALUE","INPUT_OBJECT","INPUT_FIELD_DEFINITION","QUERY","MUTATION","SUBSCRIPTION","FIELD","FRAGMENT_DEFINITION","FRAGMENT_SPREAD","INLINE_FRAGMENT","VARIABLE_DEFINITION"],operators:["=","!","?",":","&","|"],symbols:/[=!?:&|]+/,escapes:/\\(?:["\\\/bfnrt]|u[0-9A-Fa-f]{4})/,tokenizer:{root:[[/[a-z_][\w$]*/,{cases:{"@keywords":"keyword","@default":"key.identifier"}}],[/[$][\w$]*/,{cases:{"@keywords":"keyword","@default":"argument.identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@typeKeywords":"keyword","@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,{token:"annotation",log:"annotation token: $0"}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"""/,{token:"string",next:"@mlstring",nextEmbedded:"markdown"}],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}]],mlstring:[[/[^"]+/,"string"],['"""',{token:"string",next:"@pop",nextEmbedded:"@pop"}]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/#.*$/,"comment"]]}}}}]); \ No newline at end of file diff --git a/docs/22.22.js b/docs/22.22.js index 954a8294f..e15be0d85 100644 --- a/docs/22.22.js +++ b/docs/22.22.js @@ -1,414 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[22],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/handlebars/handlebars.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/handlebars/handlebars.js ***! - \************************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/* harmony import */ var _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../fillers/monaco-editor-core.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/fillers/monaco-editor-core.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var EMPTY_ELEMENTS = [ - 'area', - 'base', - 'br', - 'col', - 'embed', - 'hr', - 'img', - 'input', - 'keygen', - 'link', - 'menuitem', - 'meta', - 'param', - 'source', - 'track', - 'wbr' -]; -var conf = { - wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g, - comments: { - blockComment: ['{{!--', '--}}'] - }, - brackets: [ - [''], - ['<', '>'], - ['{{', '}}'], - ['{', '}'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - surroundingPairs: [ - { open: '<', close: '>' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - onEnterRules: [ - { - beforeText: new RegExp("<(?!(?:" + EMPTY_ELEMENTS.join('|') + "))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$", 'i'), - afterText: /^<\/(\w[\w\d]*)\s*>$/i, - action: { - indentAction: _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__["languages"].IndentAction.IndentOutdent - } - }, - { - beforeText: new RegExp("<(?!(?:" + EMPTY_ELEMENTS.join('|') + "))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$", 'i'), - action: { indentAction: _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__["languages"].IndentAction.Indent } - } - ] -}; -var language = { - defaultToken: '', - tokenPostfix: '', - // ignoreCase: true, - // The main tokenizer for our languages - tokenizer: { - root: [ - [/\{\{!--/, 'comment.block.start.handlebars', '@commentBlock'], - [/\{\{!/, 'comment.start.handlebars', '@comment'], - [/\{\{/, { token: '@rematch', switchTo: '@handlebarsInSimpleState.root' }], - [/)/, ['delimiter.html', 'tag.html', 'delimiter.html']], - [/(<)(script)/, ['delimiter.html', { token: 'tag.html', next: '@script' }]], - [/(<)(style)/, ['delimiter.html', { token: 'tag.html', next: '@style' }]], - [/(<)([:\w]+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]], - [/(<\/)(\w+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]], - [/]+/, 'metatag.content.html'], - [/>/, 'metatag.html', '@pop'] - ], - comment: [ - [/\}\}/, 'comment.end.handlebars', '@pop'], - [/./, 'comment.content.handlebars'] - ], - commentBlock: [ - [/--\}\}/, 'comment.block.end.handlebars', '@pop'], - [/./, 'comment.content.handlebars'] - ], - commentHtml: [ - [ - /\{\{/, - { - token: '@rematch', - switchTo: '@handlebarsInSimpleState.comment' - } - ], - [/-->/, 'comment.html', '@pop'], - [/[^-]+/, 'comment.content.html'], - [/./, 'comment.content.html'] - ], - otherTag: [ - [ - /\{\{/, - { - token: '@rematch', - switchTo: '@handlebarsInSimpleState.otherTag' - } - ], - [/\/?>/, 'delimiter.html', '@pop'], - [/"([^"]*)"/, 'attribute.value'], - [/'([^']*)'/, 'attribute.value'], - [/[\w\-]+/, 'attribute.name'], - [/=/, 'delimiter'], - [/[ \t\r\n]+/] // whitespace - ], - // -- BEGIN -// -// -// -// - - -/***/ }) - -}]); -//# sourceMappingURL=24.24.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{929:function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return o})),n.d(t,"language",(function(){return d}));var i=n(212),r=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],o={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["\x3c!--","--\x3e"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp("<(?!(?:"+r.join("|")+"))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:i.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(?!(?:"+r.join("|")+"))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:i.languages.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#endregion\\b.*--\x3e")}}},d={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}}}}]); \ No newline at end of file diff --git a/docs/25.25.js b/docs/25.25.js index ae1f4b765..a33e07a52 100644 --- a/docs/25.25.js +++ b/docs/25.25.js @@ -1,89 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[25],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/ini/ini.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/ini/ini.js ***! - \**********************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - comments: { - lineComment: '#' - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ] -}; -var language = { - defaultToken: '', - tokenPostfix: '.ini', - // we include these common regular expressions - escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/, - // The main tokenizer for our languages - tokenizer: { - root: [ - // sections - [/^\[[^\]]*\]/, 'metatag'], - // keys - [/(^\w+)(\s*)(\=)/, ['key', '', 'delimiter']], - // whitespace - { include: '@whitespace' }, - // numbers - [/\d+/, 'number'], - // strings: recover on non-terminated strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/'([^'\\]|\\.)*$/, 'string.invalid'], - [/"/, 'string', '@string."'], - [/'/, 'string', "@string.'"] - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/^\s*[#;].*$/, 'comment'] - ], - string: [ - [/[^\\"']+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [ - /["']/, - { - cases: { - '$#==$S2': { token: 'string', next: '@pop' }, - '@default': 'string' - } - } - ] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=25.25.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{930:function(e,n,s){"use strict";s.r(n),s.d(n,"conf",(function(){return o})),s.d(n,"language",(function(){return t}));var o={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},t={defaultToken:"",tokenPostfix:".ini",escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^\[[^\]]*\]/,"metatag"],[/(^\w+)(\s*)(\=)/,["key","","delimiter"]],{include:"@whitespace"},[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,""],[/^\s*[#;].*$/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}}}}]); \ No newline at end of file diff --git a/docs/26.26.js b/docs/26.26.js index 5776544ab..727ca3ef2 100644 --- a/docs/26.26.js +++ b/docs/26.26.js @@ -1,236 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[26],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/java/java.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/java/java.js ***! - \************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - // the default separators except `@$` - wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, - comments: { - lineComment: '//', - blockComment: ['/*', '*/'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" }, - { open: '<', close: '>' } - ], - folding: { - markers: { - start: new RegExp('^\\s*//\\s*(?:(?:#?region\\b)|(?:))') - } - } -}; -var language = { - defaultToken: '', - tokenPostfix: '.java', - keywords: [ - 'abstract', - 'continue', - 'for', - 'new', - 'switch', - 'assert', - 'default', - 'goto', - 'package', - 'synchronized', - 'boolean', - 'do', - 'if', - 'private', - 'this', - 'break', - 'double', - 'implements', - 'protected', - 'throw', - 'byte', - 'else', - 'import', - 'public', - 'throws', - 'case', - 'enum', - 'instanceof', - 'return', - 'transient', - 'catch', - 'extends', - 'int', - 'short', - 'try', - 'char', - 'final', - 'interface', - 'static', - 'void', - 'class', - 'finally', - 'long', - 'strictfp', - 'volatile', - 'const', - 'float', - 'native', - 'super', - 'while', - 'true', - 'false' - ], - operators: [ - '=', - '>', - '<', - '!', - '~', - '?', - ':', - '==', - '<=', - '>=', - '!=', - '&&', - '||', - '++', - '--', - '+', - '-', - '*', - '/', - '&', - '|', - '^', - '%', - '<<', - '>>', - '>>>', - '+=', - '-=', - '*=', - '/=', - '&=', - '|=', - '^=', - '%=', - '<<=', - '>>=', - '>>>=' - ], - // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], - [ - /@symbols/, - { - cases: { - '@operators': 'delimiter', - '@default': '' - } - } - ], - // @ annotations. - [/@\s*[a-zA-Z_\$][\w\$]*/, 'annotation'], - // numbers - [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, 'number.float'], - [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, 'number.float'], - [/0[xX](@hexdigits)[Ll]?/, 'number.hex'], - [/0(@octaldigits)[Ll]?/, 'number.octal'], - [/0[bB](@binarydigits)[Ll]?/, 'number.binary'], - [/(@digits)[fFdD]/, 'number.float'], - [/(@digits)[lL]?/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/"/, 'string', '@string'], - // characters - [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], - [/'/, 'string.invalid'] - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/\/\*\*(?!\/)/, 'comment.doc', '@javadoc'], - [/\/\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'] - ], - comment: [ - [/[^\/*]+/, 'comment'], - // [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-( - // [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/ - [/\*\//, 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - //Identical copy of comment above, except for the addition of .doc - javadoc: [ - [/[^\/*]+/, 'comment.doc'], - // [/\/\*/, 'comment.doc', '@push' ], // nested comment not allowed :-( - [/\/\*/, 'comment.doc.invalid'], - [/\*\//, 'comment.doc', '@pop'], - [/[\/*]/, 'comment.doc'] - ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, 'string', '@pop'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=26.26.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{931:function(e,t,o){"use strict";o.r(t),o.d(t,"conf",(function(){return n})),o.d(t,"language",(function(){return s}));var n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))")}}},s={defaultToken:"",tokenPostfix:".java",keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/0[xX](@hexdigits)[Ll]?/,"number.hex"],[/0(@octaldigits)[Ll]?/,"number.octal"],[/0[bB](@binarydigits)[Ll]?/,"number.binary"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@javadoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],javadoc:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}}}}]); \ No newline at end of file diff --git a/docs/27.27.js b/docs/27.27.js index 6d6eb1a2e..286f930f9 100644 --- a/docs/27.27.js +++ b/docs/27.27.js @@ -1,530 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[27],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/julia/julia.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/julia/julia.js ***! - \**************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ] -}; -var language = { - tokenPostfix: '.julia', - keywords: [ - 'begin', - 'while', - 'if', - 'for', - 'try', - 'return', - 'break', - 'continue', - 'function', - 'macro', - 'quote', - 'let', - 'local', - 'global', - 'const', - 'do', - 'struct', - 'module', - 'baremodule', - 'using', - 'import', - 'export', - 'end', - 'else', - 'elseif', - 'catch', - 'finally', - 'mutable', - 'primitive', - 'abstract', - 'type', - 'in', - 'isa', - 'where', - 'new' - ], - types: [ - 'LinRange', - 'LineNumberNode', - 'LinearIndices', - 'LoadError', - 'MIME', - 'Matrix', - 'Method', - 'MethodError', - 'Missing', - 'MissingException', - 'Module', - 'NTuple', - 'NamedTuple', - 'Nothing', - 'Number', - 'OrdinalRange', - 'OutOfMemoryError', - 'OverflowError', - 'Pair', - 'PartialQuickSort', - 'PermutedDimsArray', - 'Pipe', - 'Ptr', - 'QuoteNode', - 'Rational', - 'RawFD', - 'ReadOnlyMemoryError', - 'Real', - 'ReentrantLock', - 'Ref', - 'Regex', - 'RegexMatch', - 'RoundingMode', - 'SegmentationFault', - 'Set', - 'Signed', - 'Some', - 'StackOverflowError', - 'StepRange', - 'StepRangeLen', - 'StridedArray', - 'StridedMatrix', - 'StridedVecOrMat', - 'StridedVector', - 'String', - 'StringIndexError', - 'SubArray', - 'SubString', - 'SubstitutionString', - 'Symbol', - 'SystemError', - 'Task', - 'Text', - 'TextDisplay', - 'Timer', - 'Tuple', - 'Type', - 'TypeError', - 'TypeVar', - 'UInt', - 'UInt128', - 'UInt16', - 'UInt32', - 'UInt64', - 'UInt8', - 'UndefInitializer', - 'AbstractArray', - 'UndefKeywordError', - 'AbstractChannel', - 'UndefRefError', - 'AbstractChar', - 'UndefVarError', - 'AbstractDict', - 'Union', - 'AbstractDisplay', - 'UnionAll', - 'AbstractFloat', - 'UnitRange', - 'AbstractIrrational', - 'Unsigned', - 'AbstractMatrix', - 'AbstractRange', - 'Val', - 'AbstractSet', - 'Vararg', - 'AbstractString', - 'VecElement', - 'AbstractUnitRange', - 'VecOrMat', - 'AbstractVecOrMat', - 'Vector', - 'AbstractVector', - 'VersionNumber', - 'Any', - 'WeakKeyDict', - 'ArgumentError', - 'WeakRef', - 'Array', - 'AssertionError', - 'BigFloat', - 'BigInt', - 'BitArray', - 'BitMatrix', - 'BitSet', - 'BitVector', - 'Bool', - 'BoundsError', - 'CapturedException', - 'CartesianIndex', - 'CartesianIndices', - 'Cchar', - 'Cdouble', - 'Cfloat', - 'Channel', - 'Char', - 'Cint', - 'Cintmax_t', - 'Clong', - 'Clonglong', - 'Cmd', - 'Colon', - 'Complex', - 'ComplexF16', - 'ComplexF32', - 'ComplexF64', - 'CompositeException', - 'Condition', - 'Cptrdiff_t', - 'Cshort', - 'Csize_t', - 'Cssize_t', - 'Cstring', - 'Cuchar', - 'Cuint', - 'Cuintmax_t', - 'Culong', - 'Culonglong', - 'Cushort', - 'Cvoid', - 'Cwchar_t', - 'Cwstring', - 'DataType', - 'DenseArray', - 'DenseMatrix', - 'DenseVecOrMat', - 'DenseVector', - 'Dict', - 'DimensionMismatch', - 'Dims', - 'DivideError', - 'DomainError', - 'EOFError', - 'Enum', - 'ErrorException', - 'Exception', - 'ExponentialBackOff', - 'Expr', - 'Float16', - 'Float32', - 'Float64', - 'Function', - 'GlobalRef', - 'HTML', - 'IO', - 'IOBuffer', - 'IOContext', - 'IOStream', - 'IdDict', - 'IndexCartesian', - 'IndexLinear', - 'IndexStyle', - 'InexactError', - 'InitError', - 'Int', - 'Int128', - 'Int16', - 'Int32', - 'Int64', - 'Int8', - 'Integer', - 'InterruptException', - 'InvalidStateException', - 'Irrational', - 'KeyError' - ], - keywordops: ['<:', '>:', ':', '=>', '...', '.', '->', '?'], - allops: /[^\w\d\s()\[\]{}"'#]+/, - constants: [ - 'true', - 'false', - 'nothing', - 'missing', - 'undef', - 'Inf', - 'pi', - 'NaN', - 'π', - 'ℯ', - 'ans', - 'PROGRAM_FILE', - 'ARGS', - 'C_NULL', - 'VERSION', - 'DEPOT_PATH', - 'LOAD_PATH' - ], - operators: [ - '!', - '!=', - '!==', - '%', - '&', - '*', - '+', - '-', - '/', - '//', - '<', - '<<', - '<=', - '==', - '===', - '=>', - '>', - '>=', - '>>', - '>>>', - '\\', - '^', - '|', - '|>', - '~', - '÷', - '∈', - '∉', - '∋', - '∌', - '∘', - '√', - '∛', - '∩', - '∪', - '≈', - '≉', - '≠', - '≡', - '≢', - '≤', - '≥', - '⊆', - '⊇', - '⊈', - '⊉', - '⊊', - '⊋', - '⊻' - ], - brackets: [ - { open: '(', close: ')', token: 'delimiter.parenthesis' }, - { open: '{', close: '}', token: 'delimiter.curly' }, - { open: '[', close: ']', token: 'delimiter.square' } - ], - ident: /π|ℯ|\b(?!\d)\w+\b/, - // escape sequences - escape: /(?:[abefnrstv\\"'\n\r]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4})/, - escapes: /\\(?:C\-(@escape|.)|c(@escape|.)|@escape)/, - // The main tokenizer for our languages - tokenizer: { - root: [ - [/(::)\s*|\b(isa)\s+/, 'keyword', '@typeanno'], - [/\b(isa)(\s*\(@ident\s*,\s*)/, ['keyword', { token: '', next: '@typeanno' }]], - [/\b(type|struct)[ \t]+/, 'keyword', '@typeanno'], - // symbols - [/^\s*:@ident[!?]?/, 'metatag'], - [/(return)(\s*:@ident[!?]?)/, ['keyword', 'metatag']], - [/(\(|\[|\{|@allops)(\s*:@ident[!?]?)/, ['', 'metatag']], - [/:\(/, 'metatag', '@quote'], - // regular expressions - [/r"""/, 'regexp.delim', '@tregexp'], - [/r"/, 'regexp.delim', '@sregexp'], - // strings - [/raw"""/, 'string.delim', '@rtstring'], - [/[bv]?"""/, 'string.delim', '@dtstring'], - [/raw"/, 'string.delim', '@rsstring'], - [/[bv]?"/, 'string.delim', '@dsstring'], - [ - /(@ident)\{/, - { - cases: { - '$1@types': { token: 'type', next: '@gen' }, - '@default': { token: 'type', next: '@gen' } - } - } - ], - [ - /@ident[!?'']?(?=\.?\()/, - { - cases: { - '@types': 'type', - '@keywords': 'keyword', - '@constants': 'variable', - '@default': 'keyword.flow' - } - } - ], - [ - /@ident[!?']?/, - { - cases: { - '@types': 'type', - '@keywords': 'keyword', - '@constants': 'variable', - '@default': 'identifier' - } - } - ], - [/\$\w+/, 'key'], - [/\$\(/, 'key', '@paste'], - [/@@ident/, 'annotation'], - // whitespace - { include: '@whitespace' }, - // characters - [/'(?:@escapes|.)'/, 'string.character'], - // delimiters and operators - [/[()\[\]{}]/, '@brackets'], - [ - /@allops/, - { - cases: { - '@keywordops': 'keyword', - '@operators': 'operator' - } - } - ], - [/[;,]/, 'delimiter'], - // numbers - [/0[xX][0-9a-fA-F](_?[0-9a-fA-F])*/, 'number.hex'], - [/0[_oO][0-7](_?[0-7])*/, 'number.octal'], - [/0[bB][01](_?[01])*/, 'number.binary'], - [/[+\-]?\d+(\.\d+)?(im?|[eE][+\-]?\d+(\.\d+)?)?/, 'number'] - ], - // type - typeanno: [ - [/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*\{/, 'type', '@gen'], - [/([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(\s*<:\s*)/, ['type', 'keyword']], - [/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*/, 'type', '@pop'], - ['', '', '@pop'] - ], - // generic type - gen: [ - [/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*\{/, 'type', '@push'], - [/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*/, 'type'], - [/<:/, 'keyword'], - [/(\})(\s*<:\s*)/, ['type', { token: 'keyword', next: '@pop' }]], - [/\}/, 'type', '@pop'], - { include: '@root' } - ], - // $(...) - quote: [ - [/\$\(/, 'key', '@paste'], - [/\(/, '@brackets', '@paren'], - [/\)/, 'metatag', '@pop'], - { include: '@root' } - ], - // :(...) - paste: [ - [/:\(/, 'metatag', '@quote'], - [/\(/, '@brackets', '@paren'], - [/\)/, 'key', '@pop'], - { include: '@root' } - ], - // (...) - paren: [ - [/\$\(/, 'key', '@paste'], - [/:\(/, 'metatag', '@quote'], - [/\(/, '@brackets', '@push'], - [/\)/, '@brackets', '@pop'], - { include: '@root' } - ], - // r"egex string" - sregexp: [ - [/^.*/, 'invalid'], - [/[^\\"()\[\]{}]/, 'regexp'], - [/[()\[\]{}]/, '@brackets'], - [/\\./, 'operator.scss'], - [/"[imsx]*/, 'regexp.delim', '@pop'] - ], - tregexp: [ - [/[^\\"()\[\]{}]/, 'regexp'], - [/[()\[\]{}]/, '@brackets'], - [/\\./, 'operator.scss'], - [/"(?!"")/, 'string'], - [/"""[imsx]*/, 'regexp.delim', '@pop'] - ], - // raw"string" - rsstring: [ - [/^.*/, 'invalid'], - [/[^\\"]/, 'string'], - [/\\./, 'string.escape'], - [/"/, 'string.delim', '@pop'] - ], - rtstring: [ - [/[^\\"]/, 'string'], - [/\\./, 'string.escape'], - [/"(?!"")/, 'string'], - [/"""/, 'string.delim', '@pop'] - ], - // "string". - dsstring: [ - [/^.*/, 'invalid'], - [/[^\\"\$]/, 'string'], - [/\$/, '', '@interpolated'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, 'string.delim', '@pop'] - ], - dtstring: [ - [/[^\\"\$]/, 'string'], - [/\$/, '', '@interpolated'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"(?!"")/, 'string'], - [/"""/, 'string.delim', '@pop'] - ], - // interpolated sequence - interpolated: [ - [/\(/, { token: '', switchTo: '@interpolated_compound' }], - [/[a-zA-Z_]\w*/, 'identifier'], - ['', '', '@pop'] // just a $ is interpreted as a $ - ], - // any code - interpolated_compound: [[/\)/, '', '@pop'], { include: '@root' }], - // whitespace & comments - whitespace: [ - [/[ \t\r\n]+/, ''], - [/#=/, 'comment', '@multi_comment'], - [/#.*$/, 'comment'] - ], - multi_comment: [ - [/#=/, 'comment', '@push'], - [/=#/, 'comment', '@pop'], - [/=(?!#)|#(?!=)/, 'comment'], - [/[^#=]+/, 'comment'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=27.27.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{933:function(e,t,r){"use strict";r.r(t),r.d(t,"conf",(function(){return n})),r.d(t,"language",(function(){return o}));var n={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},o={tokenPostfix:".julia",keywords:["begin","while","if","for","try","return","break","continue","function","macro","quote","let","local","global","const","do","struct","module","baremodule","using","import","export","end","else","elseif","catch","finally","mutable","primitive","abstract","type","in","isa","where","new"],types:["LinRange","LineNumberNode","LinearIndices","LoadError","MIME","Matrix","Method","MethodError","Missing","MissingException","Module","NTuple","NamedTuple","Nothing","Number","OrdinalRange","OutOfMemoryError","OverflowError","Pair","PartialQuickSort","PermutedDimsArray","Pipe","Ptr","QuoteNode","Rational","RawFD","ReadOnlyMemoryError","Real","ReentrantLock","Ref","Regex","RegexMatch","RoundingMode","SegmentationFault","Set","Signed","Some","StackOverflowError","StepRange","StepRangeLen","StridedArray","StridedMatrix","StridedVecOrMat","StridedVector","String","StringIndexError","SubArray","SubString","SubstitutionString","Symbol","SystemError","Task","Text","TextDisplay","Timer","Tuple","Type","TypeError","TypeVar","UInt","UInt128","UInt16","UInt32","UInt64","UInt8","UndefInitializer","AbstractArray","UndefKeywordError","AbstractChannel","UndefRefError","AbstractChar","UndefVarError","AbstractDict","Union","AbstractDisplay","UnionAll","AbstractFloat","UnitRange","AbstractIrrational","Unsigned","AbstractMatrix","AbstractRange","Val","AbstractSet","Vararg","AbstractString","VecElement","AbstractUnitRange","VecOrMat","AbstractVecOrMat","Vector","AbstractVector","VersionNumber","Any","WeakKeyDict","ArgumentError","WeakRef","Array","AssertionError","BigFloat","BigInt","BitArray","BitMatrix","BitSet","BitVector","Bool","BoundsError","CapturedException","CartesianIndex","CartesianIndices","Cchar","Cdouble","Cfloat","Channel","Char","Cint","Cintmax_t","Clong","Clonglong","Cmd","Colon","Complex","ComplexF16","ComplexF32","ComplexF64","CompositeException","Condition","Cptrdiff_t","Cshort","Csize_t","Cssize_t","Cstring","Cuchar","Cuint","Cuintmax_t","Culong","Culonglong","Cushort","Cvoid","Cwchar_t","Cwstring","DataType","DenseArray","DenseMatrix","DenseVecOrMat","DenseVector","Dict","DimensionMismatch","Dims","DivideError","DomainError","EOFError","Enum","ErrorException","Exception","ExponentialBackOff","Expr","Float16","Float32","Float64","Function","GlobalRef","HTML","IO","IOBuffer","IOContext","IOStream","IdDict","IndexCartesian","IndexLinear","IndexStyle","InexactError","InitError","Int","Int128","Int16","Int32","Int64","Int8","Integer","InterruptException","InvalidStateException","Irrational","KeyError"],keywordops:["<:",">:",":","=>","...",".","->","?"],allops:/[^\w\d\s()\[\]{}"'#]+/,constants:["true","false","nothing","missing","undef","Inf","pi","NaN","π","ℯ","ans","PROGRAM_FILE","ARGS","C_NULL","VERSION","DEPOT_PATH","LOAD_PATH"],operators:["!","!=","!==","%","&","*","+","-","/","//","<","<<","<=","==","===","=>",">",">=",">>",">>>","\\","^","|","|>","~","÷","∈","∉","∋","∌","∘","√","∛","∩","∪","≈","≉","≠","≡","≢","≤","≥","⊆","⊇","⊈","⊉","⊊","⊋","⊻"],brackets:[{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"}],ident:/π|ℯ|\b(?!\d)\w+\b/,escape:/(?:[abefnrstv\\"'\n\r]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4})/,escapes:/\\(?:C\-(@escape|.)|c(@escape|.)|@escape)/,tokenizer:{root:[[/(::)\s*|\b(isa)\s+/,"keyword","@typeanno"],[/\b(isa)(\s*\(@ident\s*,\s*)/,["keyword",{token:"",next:"@typeanno"}]],[/\b(type|struct)[ \t]+/,"keyword","@typeanno"],[/^\s*:@ident[!?]?/,"metatag"],[/(return)(\s*:@ident[!?]?)/,["keyword","metatag"]],[/(\(|\[|\{|@allops)(\s*:@ident[!?]?)/,["","metatag"]],[/:\(/,"metatag","@quote"],[/r"""/,"regexp.delim","@tregexp"],[/r"/,"regexp.delim","@sregexp"],[/raw"""/,"string.delim","@rtstring"],[/[bv]?"""/,"string.delim","@dtstring"],[/raw"/,"string.delim","@rsstring"],[/[bv]?"/,"string.delim","@dsstring"],[/(@ident)\{/,{cases:{"$1@types":{token:"type",next:"@gen"},"@default":{token:"type",next:"@gen"}}}],[/@ident[!?'']?(?=\.?\()/,{cases:{"@types":"type","@keywords":"keyword","@constants":"variable","@default":"keyword.flow"}}],[/@ident[!?']?/,{cases:{"@types":"type","@keywords":"keyword","@constants":"variable","@default":"identifier"}}],[/\$\w+/,"key"],[/\$\(/,"key","@paste"],[/@@ident/,"annotation"],{include:"@whitespace"},[/'(?:@escapes|.)'/,"string.character"],[/[()\[\]{}]/,"@brackets"],[/@allops/,{cases:{"@keywordops":"keyword","@operators":"operator"}}],[/[;,]/,"delimiter"],[/0[xX][0-9a-fA-F](_?[0-9a-fA-F])*/,"number.hex"],[/0[_oO][0-7](_?[0-7])*/,"number.octal"],[/0[bB][01](_?[01])*/,"number.binary"],[/[+\-]?\d+(\.\d+)?(im?|[eE][+\-]?\d+(\.\d+)?)?/,"number"]],typeanno:[[/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*\{/,"type","@gen"],[/([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(\s*<:\s*)/,["type","keyword"]],[/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*/,"type","@pop"],["","","@pop"]],gen:[[/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*\{/,"type","@push"],[/[a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*/,"type"],[/<:/,"keyword"],[/(\})(\s*<:\s*)/,["type",{token:"keyword",next:"@pop"}]],[/\}/,"type","@pop"],{include:"@root"}],quote:[[/\$\(/,"key","@paste"],[/\(/,"@brackets","@paren"],[/\)/,"metatag","@pop"],{include:"@root"}],paste:[[/:\(/,"metatag","@quote"],[/\(/,"@brackets","@paren"],[/\)/,"key","@pop"],{include:"@root"}],paren:[[/\$\(/,"key","@paste"],[/:\(/,"metatag","@quote"],[/\(/,"@brackets","@push"],[/\)/,"@brackets","@pop"],{include:"@root"}],sregexp:[[/^.*/,"invalid"],[/[^\\"()\[\]{}]/,"regexp"],[/[()\[\]{}]/,"@brackets"],[/\\./,"operator.scss"],[/"[imsx]*/,"regexp.delim","@pop"]],tregexp:[[/[^\\"()\[\]{}]/,"regexp"],[/[()\[\]{}]/,"@brackets"],[/\\./,"operator.scss"],[/"(?!"")/,"string"],[/"""[imsx]*/,"regexp.delim","@pop"]],rsstring:[[/^.*/,"invalid"],[/[^\\"]/,"string"],[/\\./,"string.escape"],[/"/,"string.delim","@pop"]],rtstring:[[/[^\\"]/,"string"],[/\\./,"string.escape"],[/"(?!"")/,"string"],[/"""/,"string.delim","@pop"]],dsstring:[[/^.*/,"invalid"],[/[^\\"\$]/,"string"],[/\$/,"","@interpolated"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string.delim","@pop"]],dtstring:[[/[^\\"\$]/,"string"],[/\$/,"","@interpolated"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"(?!"")/,"string"],[/"""/,"string.delim","@pop"]],interpolated:[[/\(/,{token:"",switchTo:"@interpolated_compound"}],[/[a-zA-Z_]\w*/,"identifier"],["","","@pop"]],interpolated_compound:[[/\)/,"","@pop"],{include:"@root"}],whitespace:[[/[ \t\r\n]+/,""],[/#=/,"comment","@multi_comment"],[/#.*$/,"comment"]],multi_comment:[[/#=/,"comment","@push"],[/=#/,"comment","@pop"],[/=(?!#)|#(?!=)/,"comment"],[/[^#=]+/,"comment"]]}}}}]); \ No newline at end of file diff --git a/docs/28.28.js b/docs/28.28.js index 314020a0e..214f5ef2d 100644 --- a/docs/28.28.js +++ b/docs/28.28.js @@ -1,272 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[28],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/kotlin/kotlin.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/kotlin/kotlin.js ***! - \****************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - // the default separators except `@$` - wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, - comments: { - lineComment: '//', - blockComment: ['/*', '*/'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" }, - { open: '<', close: '>' } - ], - folding: { - markers: { - start: new RegExp('^\\s*//\\s*(?:(?:#?region\\b)|(?:))') - } - } -}; -var language = { - defaultToken: '', - tokenPostfix: '.kt', - keywords: [ - 'as', - 'as?', - 'break', - 'class', - 'continue', - 'do', - 'else', - 'false', - 'for', - 'fun', - 'if', - 'in', - '!in', - 'interface', - 'is', - '!is', - 'null', - 'object', - 'package', - 'return', - 'super', - 'this', - 'throw', - 'true', - 'try', - 'typealias', - 'val', - 'var', - 'when', - 'while', - 'by', - 'catch', - 'constructor', - 'delegate', - 'dynamic', - 'field', - 'file', - 'finally', - 'get', - 'import', - 'init', - 'param', - 'property', - 'receiver', - 'set', - 'setparam', - 'where', - 'actual', - 'abstract', - 'annotation', - 'companion', - 'const', - 'crossinline', - 'data', - 'enum', - 'expect', - 'external', - 'final', - 'infix', - 'inline', - 'inner', - 'internal', - 'lateinit', - 'noinline', - 'open', - 'operator', - 'out', - 'override', - 'private', - 'protected', - 'public', - 'reified', - 'sealed', - 'suspend', - 'tailrec', - 'vararg', - 'field', - 'it' - ], - operators: [ - '+', - '-', - '*', - '/', - '%', - '=', - '+=', - '-=', - '*=', - '/=', - '%=', - '++', - '--', - '&&', - '||', - '!', - '==', - '!=', - '===', - '!==', - '>', - '<', - '<=', - '>=', - '[', - ']', - '!!', - '?.', - '?:', - '::', - '..', - ':', - '?', - '->', - '@', - ';', - '$', - '_' - ], - // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], - [ - /@symbols/, - { - cases: { - '@operators': 'delimiter', - '@default': '' - } - } - ], - // @ annotations. - [/@\s*[a-zA-Z_\$][\w\$]*/, 'annotation'], - // numbers - [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, 'number.float'], - [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, 'number.float'], - [/0[xX](@hexdigits)[Ll]?/, 'number.hex'], - [/0(@octaldigits)[Ll]?/, 'number.octal'], - [/0[bB](@binarydigits)[Ll]?/, 'number.binary'], - [/(@digits)[fFdD]/, 'number.float'], - [/(@digits)[lL]?/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/"""/, 'string', '@multistring'], - [/"/, 'string', '@string'], - // characters - [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], - [/'/, 'string.invalid'] - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/\/\*\*(?!\/)/, 'comment.doc', '@javadoc'], - [/\/\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'] - ], - comment: [ - [/[^\/*]+/, 'comment'], - [/\/\*/, 'comment', '@comment'], - [/\*\//, 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - //Identical copy of comment above, except for the addition of .doc - javadoc: [ - [/[^\/*]+/, 'comment.doc'], - [/\/\*/, 'comment.doc', '@push'], - [/\/\*/, 'comment.doc.invalid'], - [/\*\//, 'comment.doc', '@pop'], - [/[\/*]/, 'comment.doc'] - ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, 'string', '@pop'] - ], - multistring: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"""/, 'string', '@pop'], - [/./, 'string'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=28.28.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{934:function(e,n,t){"use strict";t.r(n),t.d(n,"conf",(function(){return i})),t.d(n,"language",(function(){return o}));var i={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))")}}},o={defaultToken:"",tokenPostfix:".kt",keywords:["as","as?","break","class","continue","do","else","false","for","fun","if","in","!in","interface","is","!is","null","object","package","return","super","this","throw","true","try","typealias","val","var","when","while","by","catch","constructor","delegate","dynamic","field","file","finally","get","import","init","param","property","receiver","set","setparam","where","actual","abstract","annotation","companion","const","crossinline","data","enum","expect","external","final","infix","inline","inner","internal","lateinit","noinline","open","operator","out","override","private","protected","public","reified","sealed","suspend","tailrec","vararg","field","it"],operators:["+","-","*","/","%","=","+=","-=","*=","/=","%=","++","--","&&","||","!","==","!=","===","!==",">","<","<=",">=","[","]","!!","?.","?:","::","..",":","?","->","@",";","$","_"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/0[xX](@hexdigits)[Ll]?/,"number.hex"],[/0(@octaldigits)[Ll]?/,"number.octal"],[/0[bB](@binarydigits)[Ll]?/,"number.binary"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"""/,"string","@multistring"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@javadoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment","@comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],javadoc:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc","@push"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],multistring:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"""/,"string","@pop"],[/./,"string"]]}}}}]); \ No newline at end of file diff --git a/docs/29.29.js b/docs/29.29.js index 80aac8535..5221f4c1a 100644 --- a/docs/29.29.js +++ b/docs/29.29.js @@ -1,184 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[29],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/less/less.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/less/less.js ***! - \************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - wordPattern: /(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g, - comments: { - blockComment: ['/*', '*/'], - lineComment: '//' - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}', notIn: ['string', 'comment'] }, - { open: '[', close: ']', notIn: ['string', 'comment'] }, - { open: '(', close: ')', notIn: ['string', 'comment'] }, - { open: '"', close: '"', notIn: ['string', 'comment'] }, - { open: "'", close: "'", notIn: ['string', 'comment'] } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - folding: { - markers: { - start: new RegExp('^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/'), - end: new RegExp('^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/') - } - } -}; -var language = { - defaultToken: '', - tokenPostfix: '.less', - identifier: '-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*', - identifierPlus: '-?-?([a-zA-Z:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*', - brackets: [ - { open: '{', close: '}', token: 'delimiter.curly' }, - { open: '[', close: ']', token: 'delimiter.bracket' }, - { open: '(', close: ')', token: 'delimiter.parenthesis' }, - { open: '<', close: '>', token: 'delimiter.angle' } - ], - tokenizer: { - root: [ - { include: '@nestedJSBegin' }, - ['[ \\t\\r\\n]+', ''], - { include: '@comments' }, - { include: '@keyword' }, - { include: '@strings' }, - { include: '@numbers' }, - ['[*_]?[a-zA-Z\\-\\s]+(?=:.*(;|(\\\\$)))', 'attribute.name', '@attribute'], - ['url(\\-prefix)?\\(', { token: 'tag', next: '@urldeclaration' }], - ['[{}()\\[\\]]', '@brackets'], - ['[,:;]', 'delimiter'], - ['#@identifierPlus', 'tag.id'], - ['&', 'tag'], - ['\\.@identifierPlus(?=\\()', 'tag.class', '@attribute'], - ['\\.@identifierPlus', 'tag.class'], - ['@identifierPlus', 'tag'], - { include: '@operators' }, - ['@(@identifier(?=[:,\\)]))', 'variable', '@attribute'], - ['@(@identifier)', 'variable'], - ['@', 'key', '@atRules'] - ], - nestedJSBegin: [ - ['``', 'delimiter.backtick'], - [ - '`', - { - token: 'delimiter.backtick', - next: '@nestedJSEnd', - nextEmbedded: 'text/javascript' - } - ] - ], - nestedJSEnd: [ - [ - '`', - { - token: 'delimiter.backtick', - next: '@pop', - nextEmbedded: '@pop' - } - ] - ], - operators: [['[<>=\\+\\-\\*\\/\\^\\|\\~]', 'operator']], - keyword: [ - [ - '(@[\\s]*import|![\\s]*important|true|false|when|iscolor|isnumber|isstring|iskeyword|isurl|ispixel|ispercentage|isem|hue|saturation|lightness|alpha|lighten|darken|saturate|desaturate|fadein|fadeout|fade|spin|mix|round|ceil|floor|percentage)\\b', - 'keyword' - ] - ], - urldeclaration: [ - { include: '@strings' }, - ['[^)\r\n]+', 'string'], - ['\\)', { token: 'tag', next: '@pop' }] - ], - attribute: [ - { include: '@nestedJSBegin' }, - { include: '@comments' }, - { include: '@strings' }, - { include: '@numbers' }, - { include: '@keyword' }, - ['[a-zA-Z\\-]+(?=\\()', 'attribute.value', '@attribute'], - ['>', 'operator', '@pop'], - ['@identifier', 'attribute.value'], - { include: '@operators' }, - ['@(@identifier)', 'variable'], - ['[)\\}]', '@brackets', '@pop'], - ['[{}()\\[\\]>]', '@brackets'], - ['[;]', 'delimiter', '@pop'], - ['[,=:]', 'delimiter'], - ['\\s', ''], - ['.', 'attribute.value'] - ], - comments: [ - ['\\/\\*', 'comment', '@comment'], - ['\\/\\/+.*', 'comment'] - ], - comment: [ - ['\\*\\/', 'comment', '@pop'], - ['.', 'comment'] - ], - numbers: [ - [ - '(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?', - { token: 'attribute.value.number', next: '@units' } - ], - ['#[0-9a-fA-F_]+(?!\\w)', 'attribute.value.hex'] - ], - units: [ - [ - '(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?', - 'attribute.value.unit', - '@pop' - ] - ], - strings: [ - ['~?"', { token: 'string.delimiter', next: '@stringsEndDoubleQuote' }], - ["~?'", { token: 'string.delimiter', next: '@stringsEndQuote' }] - ], - stringsEndDoubleQuote: [ - ['\\\\"', 'string'], - ['"', { token: 'string.delimiter', next: '@popall' }], - ['.', 'string'] - ], - stringsEndQuote: [ - ["\\\\'", 'string'], - ["'", { token: 'string.delimiter', next: '@popall' }], - ['.', 'string'] - ], - atRules: [ - { include: '@comments' }, - { include: '@strings' }, - ['[()]', 'delimiter'], - ['[\\{;]', 'delimiter', '@pop'], - ['.', 'key'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=29.29.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{935:function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return i})),n.d(t,"language",(function(){return r}));var i={wordPattern:/(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g,comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},r={defaultToken:"",tokenPostfix:".less",identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",identifierPlus:"-?-?([a-zA-Z:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@nestedJSBegin"},["[ \\t\\r\\n]+",""],{include:"@comments"},{include:"@keyword"},{include:"@strings"},{include:"@numbers"},["[*_]?[a-zA-Z\\-\\s]+(?=:.*(;|(\\\\$)))","attribute.name","@attribute"],["url(\\-prefix)?\\(",{token:"tag",next:"@urldeclaration"}],["[{}()\\[\\]]","@brackets"],["[,:;]","delimiter"],["#@identifierPlus","tag.id"],["&","tag"],["\\.@identifierPlus(?=\\()","tag.class","@attribute"],["\\.@identifierPlus","tag.class"],["@identifierPlus","tag"],{include:"@operators"},["@(@identifier(?=[:,\\)]))","variable","@attribute"],["@(@identifier)","variable"],["@","key","@atRules"]],nestedJSBegin:[["``","delimiter.backtick"],["`",{token:"delimiter.backtick",next:"@nestedJSEnd",nextEmbedded:"text/javascript"}]],nestedJSEnd:[["`",{token:"delimiter.backtick",next:"@pop",nextEmbedded:"@pop"}]],operators:[["[<>=\\+\\-\\*\\/\\^\\|\\~]","operator"]],keyword:[["(@[\\s]*import|![\\s]*important|true|false|when|iscolor|isnumber|isstring|iskeyword|isurl|ispixel|ispercentage|isem|hue|saturation|lightness|alpha|lighten|darken|saturate|desaturate|fadein|fadeout|fade|spin|mix|round|ceil|floor|percentage)\\b","keyword"]],urldeclaration:[{include:"@strings"},["[^)\r\n]+","string"],["\\)",{token:"tag",next:"@pop"}]],attribute:[{include:"@nestedJSBegin"},{include:"@comments"},{include:"@strings"},{include:"@numbers"},{include:"@keyword"},["[a-zA-Z\\-]+(?=\\()","attribute.value","@attribute"],[">","operator","@pop"],["@identifier","attribute.value"],{include:"@operators"},["@(@identifier)","variable"],["[)\\}]","@brackets","@pop"],["[{}()\\[\\]>]","@brackets"],["[;]","delimiter","@pop"],["[,=:]","delimiter"],["\\s",""],[".","attribute.value"]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[".","comment"]],numbers:[["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],strings:[['~?"',{token:"string.delimiter",next:"@stringsEndDoubleQuote"}],["~?'",{token:"string.delimiter",next:"@stringsEndQuote"}]],stringsEndDoubleQuote:[['\\\\"',"string"],['"',{token:"string.delimiter",next:"@popall"}],[".","string"]],stringsEndQuote:[["\\\\'","string"],["'",{token:"string.delimiter",next:"@popall"}],[".","string"]],atRules:[{include:"@comments"},{include:"@strings"},["[()]","delimiter"],["[\\{;]","delimiter","@pop"],[".","key"]]}}}}]); \ No newline at end of file diff --git a/docs/3.3.js b/docs/3.3.js index d652a6240..8a4b078ba 100644 --- a/docs/3.3.js +++ b/docs/3.3.js @@ -1,19883 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{ - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/_deps/vscode-languageserver-types/main.js": -/*!*************************************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/_deps/vscode-languageserver-types/main.js ***! - \*************************************************************************************************************************************/ -/*! exports provided: Position, Range, Location, LocationLink, Color, ColorInformation, ColorPresentation, FoldingRangeKind, FoldingRange, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag, DiagnosticCode, Diagnostic, Command, TextEdit, TextDocumentEdit, CreateFile, RenameFile, DeleteFile, WorkspaceEdit, WorkspaceChange, TextDocumentIdentifier, VersionedTextDocumentIdentifier, TextDocumentItem, MarkupKind, MarkupContent, CompletionItemKind, InsertTextFormat, CompletionItemTag, InsertReplaceEdit, CompletionItem, CompletionList, MarkedString, Hover, ParameterInformation, SignatureInformation, DocumentHighlightKind, DocumentHighlight, SymbolKind, SymbolTag, SymbolInformation, DocumentSymbol, CodeActionKind, CodeActionContext, CodeAction, CodeLens, FormattingOptions, DocumentLink, SelectionRange, EOL, TextDocument */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocationLink", function() { return LocationLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return ColorInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return ColorPresentation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return FoldingRangeKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return FoldingRange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticRelatedInformation", function() { return DiagnosticRelatedInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return DiagnosticSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticTag", function() { return DiagnosticTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticCode", function() { return DiagnosticCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return Diagnostic; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return TextEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentEdit", function() { return TextDocumentEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CreateFile", function() { return CreateFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenameFile", function() { return RenameFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteFile", function() { return DeleteFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceEdit", function() { return WorkspaceEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceChange", function() { return WorkspaceChange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentIdentifier", function() { return TextDocumentIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VersionedTextDocumentIdentifier", function() { return VersionedTextDocumentIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentItem", function() { return TextDocumentItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return MarkupKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return MarkupContent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return InsertTextFormat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemTag", function() { return CompletionItemTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertReplaceEdit", function() { return InsertReplaceEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return CompletionItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return CompletionList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return MarkedString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return Hover; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParameterInformation", function() { return ParameterInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureInformation", function() { return SignatureInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlight", function() { return DocumentHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolTag", function() { return SymbolTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return SymbolInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return DocumentSymbol; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return CodeActionKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionContext", function() { return CodeActionContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeAction", function() { return CodeAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLens", function() { return CodeLens; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return FormattingOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentLink", function() { return DocumentLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionRange", function() { return SelectionRange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EOL", function() { return EOL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; }); -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -/** - * The Position namespace provides helper functions to work with - * [Position](#Position) literals. - */ -var Position; -(function (Position) { - /** - * Creates a new Position literal from the given line and character. - * @param line The position's line. - * @param character The position's character. - */ - function create(line, character) { - return { line: line, character: character }; - } - Position.create = create; - /** - * Checks whether the given liternal conforms to the [Position](#Position) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character); - } - Position.is = is; -})(Position || (Position = {})); -/** - * The Range namespace provides helper functions to work with - * [Range](#Range) literals. - */ -var Range; -(function (Range) { - function create(one, two, three, four) { - if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) { - return { start: Position.create(one, two), end: Position.create(three, four) }; - } - else if (Position.is(one) && Position.is(two)) { - return { start: one, end: two }; - } - else { - throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]"); - } - } - Range.create = create; - /** - * Checks whether the given literal conforms to the [Range](#Range) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); - } - Range.is = is; -})(Range || (Range = {})); -/** - * The Location namespace provides helper functions to work with - * [Location](#Location) literals. - */ -var Location; -(function (Location) { - /** - * Creates a Location literal. - * @param uri The location's uri. - * @param range The location's range. - */ - function create(uri, range) { - return { uri: uri, range: range }; - } - Location.create = create; - /** - * Checks whether the given literal conforms to the [Location](#Location) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); - } - Location.is = is; -})(Location || (Location = {})); -/** - * The LocationLink namespace provides helper functions to work with - * [LocationLink](#LocationLink) literals. - */ -var LocationLink; -(function (LocationLink) { - /** - * Creates a LocationLink literal. - * @param targetUri The definition's uri. - * @param targetRange The full range of the definition. - * @param targetSelectionRange The span of the symbol definition at the target. - * @param originSelectionRange The span of the symbol being defined in the originating source file. - */ - function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { - return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange }; - } - LocationLink.create = create; - /** - * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) - && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) - && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); - } - LocationLink.is = is; -})(LocationLink || (LocationLink = {})); -/** - * The Color namespace provides helper functions to work with - * [Color](#Color) literals. - */ -var Color; -(function (Color) { - /** - * Creates a new Color literal. - */ - function create(red, green, blue, alpha) { - return { - red: red, - green: green, - blue: blue, - alpha: alpha, - }; - } - Color.create = create; - /** - * Checks whether the given literal conforms to the [Color](#Color) interface. - */ - function is(value) { - var candidate = value; - return Is.number(candidate.red) - && Is.number(candidate.green) - && Is.number(candidate.blue) - && Is.number(candidate.alpha); - } - Color.is = is; -})(Color || (Color = {})); -/** - * The ColorInformation namespace provides helper functions to work with - * [ColorInformation](#ColorInformation) literals. - */ -var ColorInformation; -(function (ColorInformation) { - /** - * Creates a new ColorInformation literal. - */ - function create(range, color) { - return { - range: range, - color: color, - }; - } - ColorInformation.create = create; - /** - * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. - */ - function is(value) { - var candidate = value; - return Range.is(candidate.range) && Color.is(candidate.color); - } - ColorInformation.is = is; -})(ColorInformation || (ColorInformation = {})); -/** - * The Color namespace provides helper functions to work with - * [ColorPresentation](#ColorPresentation) literals. - */ -var ColorPresentation; -(function (ColorPresentation) { - /** - * Creates a new ColorInformation literal. - */ - function create(label, textEdit, additionalTextEdits) { - return { - label: label, - textEdit: textEdit, - additionalTextEdits: additionalTextEdits, - }; - } - ColorPresentation.create = create; - /** - * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. - */ - function is(value) { - var candidate = value; - return Is.string(candidate.label) - && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) - && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); - } - ColorPresentation.is = is; -})(ColorPresentation || (ColorPresentation = {})); -/** - * Enum of known range kinds - */ -var FoldingRangeKind; -(function (FoldingRangeKind) { - /** - * Folding range for a comment - */ - FoldingRangeKind["Comment"] = "comment"; - /** - * Folding range for a imports or includes - */ - FoldingRangeKind["Imports"] = "imports"; - /** - * Folding range for a region (e.g. `#region`) - */ - FoldingRangeKind["Region"] = "region"; -})(FoldingRangeKind || (FoldingRangeKind = {})); -/** - * The folding range namespace provides helper functions to work with - * [FoldingRange](#FoldingRange) literals. - */ -var FoldingRange; -(function (FoldingRange) { - /** - * Creates a new FoldingRange literal. - */ - function create(startLine, endLine, startCharacter, endCharacter, kind) { - var result = { - startLine: startLine, - endLine: endLine - }; - if (Is.defined(startCharacter)) { - result.startCharacter = startCharacter; - } - if (Is.defined(endCharacter)) { - result.endCharacter = endCharacter; - } - if (Is.defined(kind)) { - result.kind = kind; - } - return result; - } - FoldingRange.create = create; - /** - * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface. - */ - function is(value) { - var candidate = value; - return Is.number(candidate.startLine) && Is.number(candidate.startLine) - && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter)) - && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter)) - && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); - } - FoldingRange.is = is; -})(FoldingRange || (FoldingRange = {})); -/** - * The DiagnosticRelatedInformation namespace provides helper functions to work with - * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals. - */ -var DiagnosticRelatedInformation; -(function (DiagnosticRelatedInformation) { - /** - * Creates a new DiagnosticRelatedInformation literal. - */ - function create(location, message) { - return { - location: location, - message: message - }; - } - DiagnosticRelatedInformation.create = create; - /** - * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); - } - DiagnosticRelatedInformation.is = is; -})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); -/** - * The diagnostic's severity. - */ -var DiagnosticSeverity; -(function (DiagnosticSeverity) { - /** - * Reports an error. - */ - DiagnosticSeverity.Error = 1; - /** - * Reports a warning. - */ - DiagnosticSeverity.Warning = 2; - /** - * Reports an information. - */ - DiagnosticSeverity.Information = 3; - /** - * Reports a hint. - */ - DiagnosticSeverity.Hint = 4; -})(DiagnosticSeverity || (DiagnosticSeverity = {})); -/** - * The diagnostic tags. - * - * @since 3.15.0 - */ -var DiagnosticTag; -(function (DiagnosticTag) { - /** - * Unused or unnecessary code. - * - * Clients are allowed to render diagnostics with this tag faded out instead of having - * an error squiggle. - */ - DiagnosticTag.Unnecessary = 1; - /** - * Deprecated or obsolete code. - * - * Clients are allowed to rendered diagnostics with this tag strike through. - */ - DiagnosticTag.Deprecated = 2; -})(DiagnosticTag || (DiagnosticTag = {})); -/** - * The DiagnosticCode namespace provides functions to deal with complex diagnostic codes. - * - * @since 3.16.0 - Proposed state - */ -var DiagnosticCode; -(function (DiagnosticCode) { - /** - * Checks whether the given liternal conforms to the [DiagnosticCode](#DiagnosticCode) interface. - */ - function is(value) { - var candidate = value; - return candidate !== undefined && candidate !== null && (Is.number(candidate.value) || Is.string(candidate.value)) && Is.string(candidate.target); - } - DiagnosticCode.is = is; -})(DiagnosticCode || (DiagnosticCode = {})); -/** - * The Diagnostic namespace provides helper functions to work with - * [Diagnostic](#Diagnostic) literals. - */ -var Diagnostic; -(function (Diagnostic) { - /** - * Creates a new Diagnostic literal. - */ - function create(range, message, severity, code, source, relatedInformation) { - var result = { range: range, message: message }; - if (Is.defined(severity)) { - result.severity = severity; - } - if (Is.defined(code)) { - result.code = code; - } - if (Is.defined(source)) { - result.source = source; - } - if (Is.defined(relatedInformation)) { - result.relatedInformation = relatedInformation; - } - return result; - } - Diagnostic.create = create; - /** - * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) - && Range.is(candidate.range) - && Is.string(candidate.message) - && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) - && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) - && (Is.string(candidate.source) || Is.undefined(candidate.source)) - && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); - } - Diagnostic.is = is; -})(Diagnostic || (Diagnostic = {})); -/** - * The Command namespace provides helper functions to work with - * [Command](#Command) literals. - */ -var Command; -(function (Command) { - /** - * Creates a new Command literal. - */ - function create(title, command) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - var result = { title: title, command: command }; - if (Is.defined(args) && args.length > 0) { - result.arguments = args; - } - return result; - } - Command.create = create; - /** - * Checks whether the given literal conforms to the [Command](#Command) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); - } - Command.is = is; -})(Command || (Command = {})); -/** - * The TextEdit namespace provides helper function to create replace, - * insert and delete edits more easily. - */ -var TextEdit; -(function (TextEdit) { - /** - * Creates a replace text edit. - * @param range The range of text to be replaced. - * @param newText The new text. - */ - function replace(range, newText) { - return { range: range, newText: newText }; - } - TextEdit.replace = replace; - /** - * Creates a insert text edit. - * @param position The position to insert the text at. - * @param newText The text to be inserted. - */ - function insert(position, newText) { - return { range: { start: position, end: position }, newText: newText }; - } - TextEdit.insert = insert; - /** - * Creates a delete text edit. - * @param range The range of text to be deleted. - */ - function del(range) { - return { range: range, newText: '' }; - } - TextEdit.del = del; - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) - && Is.string(candidate.newText) - && Range.is(candidate.range); - } - TextEdit.is = is; -})(TextEdit || (TextEdit = {})); -/** - * The TextDocumentEdit namespace provides helper function to create - * an edit that manipulates a text document. - */ -var TextDocumentEdit; -(function (TextDocumentEdit) { - /** - * Creates a new `TextDocumentEdit` - */ - function create(textDocument, edits) { - return { textDocument: textDocument, edits: edits }; - } - TextDocumentEdit.create = create; - function is(value) { - var candidate = value; - return Is.defined(candidate) - && VersionedTextDocumentIdentifier.is(candidate.textDocument) - && Array.isArray(candidate.edits); - } - TextDocumentEdit.is = is; -})(TextDocumentEdit || (TextDocumentEdit = {})); -var CreateFile; -(function (CreateFile) { - function create(uri, options) { - var result = { - kind: 'create', - uri: uri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - return result; - } - CreateFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && - (candidate.options === void 0 || - ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); - } - CreateFile.is = is; -})(CreateFile || (CreateFile = {})); -var RenameFile; -(function (RenameFile) { - function create(oldUri, newUri, options) { - var result = { - kind: 'rename', - oldUri: oldUri, - newUri: newUri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - return result; - } - RenameFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && - (candidate.options === void 0 || - ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); - } - RenameFile.is = is; -})(RenameFile || (RenameFile = {})); -var DeleteFile; -(function (DeleteFile) { - function create(uri, options) { - var result = { - kind: 'delete', - uri: uri - }; - if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { - result.options = options; - } - return result; - } - DeleteFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && - (candidate.options === void 0 || - ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists)))); - } - DeleteFile.is = is; -})(DeleteFile || (DeleteFile = {})); -var WorkspaceEdit; -(function (WorkspaceEdit) { - function is(value) { - var candidate = value; - return candidate && - (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && - (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) { - if (Is.string(change.kind)) { - return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); - } - else { - return TextDocumentEdit.is(change); - } - })); - } - WorkspaceEdit.is = is; -})(WorkspaceEdit || (WorkspaceEdit = {})); -var TextEditChangeImpl = /** @class */ (function () { - function TextEditChangeImpl(edits) { - this.edits = edits; - } - TextEditChangeImpl.prototype.insert = function (position, newText) { - this.edits.push(TextEdit.insert(position, newText)); - }; - TextEditChangeImpl.prototype.replace = function (range, newText) { - this.edits.push(TextEdit.replace(range, newText)); - }; - TextEditChangeImpl.prototype.delete = function (range) { - this.edits.push(TextEdit.del(range)); - }; - TextEditChangeImpl.prototype.add = function (edit) { - this.edits.push(edit); - }; - TextEditChangeImpl.prototype.all = function () { - return this.edits; - }; - TextEditChangeImpl.prototype.clear = function () { - this.edits.splice(0, this.edits.length); - }; - return TextEditChangeImpl; -}()); -/** - * A workspace change helps constructing changes to a workspace. - */ -var WorkspaceChange = /** @class */ (function () { - function WorkspaceChange(workspaceEdit) { - var _this = this; - this._textEditChanges = Object.create(null); - if (workspaceEdit) { - this._workspaceEdit = workspaceEdit; - if (workspaceEdit.documentChanges) { - workspaceEdit.documentChanges.forEach(function (change) { - if (TextDocumentEdit.is(change)) { - var textEditChange = new TextEditChangeImpl(change.edits); - _this._textEditChanges[change.textDocument.uri] = textEditChange; - } - }); - } - else if (workspaceEdit.changes) { - Object.keys(workspaceEdit.changes).forEach(function (key) { - var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); - _this._textEditChanges[key] = textEditChange; - }); - } - } - } - Object.defineProperty(WorkspaceChange.prototype, "edit", { - /** - * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal - * use to be returned from a workspace edit operation like rename. - */ - get: function () { - if (this._workspaceEdit === undefined) { - return { documentChanges: [] }; - } - return this._workspaceEdit; - }, - enumerable: true, - configurable: true - }); - WorkspaceChange.prototype.getTextEditChange = function (key) { - if (VersionedTextDocumentIdentifier.is(key)) { - if (!this._workspaceEdit) { - this._workspaceEdit = { - documentChanges: [] - }; - } - if (!this._workspaceEdit.documentChanges) { - throw new Error('Workspace edit is not configured for document changes.'); - } - var textDocument = key; - var result = this._textEditChanges[textDocument.uri]; - if (!result) { - var edits = []; - var textDocumentEdit = { - textDocument: textDocument, - edits: edits - }; - this._workspaceEdit.documentChanges.push(textDocumentEdit); - result = new TextEditChangeImpl(edits); - this._textEditChanges[textDocument.uri] = result; - } - return result; - } - else { - if (!this._workspaceEdit) { - this._workspaceEdit = { - changes: Object.create(null) - }; - } - if (!this._workspaceEdit.changes) { - throw new Error('Workspace edit is not configured for normal text edit changes.'); - } - var result = this._textEditChanges[key]; - if (!result) { - var edits = []; - this._workspaceEdit.changes[key] = edits; - result = new TextEditChangeImpl(edits); - this._textEditChanges[key] = result; - } - return result; - } - }; - WorkspaceChange.prototype.createFile = function (uri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options)); - }; - WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options)); - }; - WorkspaceChange.prototype.deleteFile = function (uri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options)); - }; - WorkspaceChange.prototype.checkDocumentChanges = function () { - if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) { - throw new Error('Workspace edit is not configured for document changes.'); - } - }; - return WorkspaceChange; -}()); - -/** - * The TextDocumentIdentifier namespace provides helper functions to work with - * [TextDocumentIdentifier](#TextDocumentIdentifier) literals. - */ -var TextDocumentIdentifier; -(function (TextDocumentIdentifier) { - /** - * Creates a new TextDocumentIdentifier literal. - * @param uri The document's uri. - */ - function create(uri) { - return { uri: uri }; - } - TextDocumentIdentifier.create = create; - /** - * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri); - } - TextDocumentIdentifier.is = is; -})(TextDocumentIdentifier || (TextDocumentIdentifier = {})); -/** - * The VersionedTextDocumentIdentifier namespace provides helper functions to work with - * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals. - */ -var VersionedTextDocumentIdentifier; -(function (VersionedTextDocumentIdentifier) { - /** - * Creates a new VersionedTextDocumentIdentifier literal. - * @param uri The document's uri. - * @param uri The document's text. - */ - function create(uri, version) { - return { uri: uri, version: version }; - } - VersionedTextDocumentIdentifier.create = create; - /** - * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version)); - } - VersionedTextDocumentIdentifier.is = is; -})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); -/** - * The TextDocumentItem namespace provides helper functions to work with - * [TextDocumentItem](#TextDocumentItem) literals. - */ -var TextDocumentItem; -(function (TextDocumentItem) { - /** - * Creates a new TextDocumentItem literal. - * @param uri The document's uri. - * @param languageId The document's language identifier. - * @param version The document's version number. - * @param text The document's text. - */ - function create(uri, languageId, version, text) { - return { uri: uri, languageId: languageId, version: version, text: text }; - } - TextDocumentItem.create = create; - /** - * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text); - } - TextDocumentItem.is = is; -})(TextDocumentItem || (TextDocumentItem = {})); -/** - * Describes the content type that a client supports in various - * result literals like `Hover`, `ParameterInfo` or `CompletionItem`. - * - * Please note that `MarkupKinds` must not start with a `$`. This kinds - * are reserved for internal usage. - */ -var MarkupKind; -(function (MarkupKind) { - /** - * Plain text is supported as a content format - */ - MarkupKind.PlainText = 'plaintext'; - /** - * Markdown is supported as a content format - */ - MarkupKind.Markdown = 'markdown'; -})(MarkupKind || (MarkupKind = {})); -(function (MarkupKind) { - /** - * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. - */ - function is(value) { - var candidate = value; - return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; - } - MarkupKind.is = is; -})(MarkupKind || (MarkupKind = {})); -var MarkupContent; -(function (MarkupContent) { - /** - * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); - } - MarkupContent.is = is; -})(MarkupContent || (MarkupContent = {})); -/** - * The kind of a completion entry. - */ -var CompletionItemKind; -(function (CompletionItemKind) { - CompletionItemKind.Text = 1; - CompletionItemKind.Method = 2; - CompletionItemKind.Function = 3; - CompletionItemKind.Constructor = 4; - CompletionItemKind.Field = 5; - CompletionItemKind.Variable = 6; - CompletionItemKind.Class = 7; - CompletionItemKind.Interface = 8; - CompletionItemKind.Module = 9; - CompletionItemKind.Property = 10; - CompletionItemKind.Unit = 11; - CompletionItemKind.Value = 12; - CompletionItemKind.Enum = 13; - CompletionItemKind.Keyword = 14; - CompletionItemKind.Snippet = 15; - CompletionItemKind.Color = 16; - CompletionItemKind.File = 17; - CompletionItemKind.Reference = 18; - CompletionItemKind.Folder = 19; - CompletionItemKind.EnumMember = 20; - CompletionItemKind.Constant = 21; - CompletionItemKind.Struct = 22; - CompletionItemKind.Event = 23; - CompletionItemKind.Operator = 24; - CompletionItemKind.TypeParameter = 25; -})(CompletionItemKind || (CompletionItemKind = {})); -/** - * Defines whether the insert text in a completion item should be interpreted as - * plain text or a snippet. - */ -var InsertTextFormat; -(function (InsertTextFormat) { - /** - * The primary text to be inserted is treated as a plain string. - */ - InsertTextFormat.PlainText = 1; - /** - * The primary text to be inserted is treated as a snippet. - * - * A snippet can define tab stops and placeholders with `$1`, `$2` - * and `${3:foo}`. `$0` defines the final tab stop, it defaults to - * the end of the snippet. Placeholders with equal identifiers are linked, - * that is typing in one will update others too. - * - * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax - */ - InsertTextFormat.Snippet = 2; -})(InsertTextFormat || (InsertTextFormat = {})); -/** - * Completion item tags are extra annotations that tweak the rendering of a completion - * item. - * - * @since 3.15.0 - */ -var CompletionItemTag; -(function (CompletionItemTag) { - /** - * Render a completion as obsolete, usually using a strike-out. - */ - CompletionItemTag.Deprecated = 1; -})(CompletionItemTag || (CompletionItemTag = {})); -/** - * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits. - * - * @since 3.16.0 - Proposed state - */ -var InsertReplaceEdit; -(function (InsertReplaceEdit) { - /** - * Creates a new insert / replace edit - */ - function create(newText, insert, replace) { - return { newText: newText, insert: insert, replace: replace }; - } - InsertReplaceEdit.create = create; - /** - * Checks whether the given liternal conforms to the [InsertReplaceEdit](#InsertReplaceEdit) interface. - */ - function is(value) { - var candidate = value; - return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace); - } - InsertReplaceEdit.is = is; -})(InsertReplaceEdit || (InsertReplaceEdit = {})); -/** - * The CompletionItem namespace provides functions to deal with - * completion items. - */ -var CompletionItem; -(function (CompletionItem) { - /** - * Create a completion item and seed it with a label. - * @param label The completion item's label - */ - function create(label) { - return { label: label }; - } - CompletionItem.create = create; -})(CompletionItem || (CompletionItem = {})); -/** - * The CompletionList namespace provides functions to deal with - * completion lists. - */ -var CompletionList; -(function (CompletionList) { - /** - * Creates a new completion list. - * - * @param items The completion items. - * @param isIncomplete The list is not complete. - */ - function create(items, isIncomplete) { - return { items: items ? items : [], isIncomplete: !!isIncomplete }; - } - CompletionList.create = create; -})(CompletionList || (CompletionList = {})); -var MarkedString; -(function (MarkedString) { - /** - * Creates a marked string from plain text. - * - * @param plainText The plain text. - */ - function fromPlainText(plainText) { - return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash - } - MarkedString.fromPlainText = fromPlainText; - /** - * Checks whether the given value conforms to the [MarkedString](#MarkedString) type. - */ - function is(value) { - var candidate = value; - return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value)); - } - MarkedString.is = is; -})(MarkedString || (MarkedString = {})); -var Hover; -(function (Hover) { - /** - * Checks whether the given value conforms to the [Hover](#Hover) interface. - */ - function is(value) { - var candidate = value; - return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || - MarkedString.is(candidate.contents) || - Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); - } - Hover.is = is; -})(Hover || (Hover = {})); -/** - * The ParameterInformation namespace provides helper functions to work with - * [ParameterInformation](#ParameterInformation) literals. - */ -var ParameterInformation; -(function (ParameterInformation) { - /** - * Creates a new parameter information literal. - * - * @param label A label string. - * @param documentation A doc string. - */ - function create(label, documentation) { - return documentation ? { label: label, documentation: documentation } : { label: label }; - } - ParameterInformation.create = create; -})(ParameterInformation || (ParameterInformation = {})); -/** - * The SignatureInformation namespace provides helper functions to work with - * [SignatureInformation](#SignatureInformation) literals. - */ -var SignatureInformation; -(function (SignatureInformation) { - function create(label, documentation) { - var parameters = []; - for (var _i = 2; _i < arguments.length; _i++) { - parameters[_i - 2] = arguments[_i]; - } - var result = { label: label }; - if (Is.defined(documentation)) { - result.documentation = documentation; - } - if (Is.defined(parameters)) { - result.parameters = parameters; - } - else { - result.parameters = []; - } - return result; - } - SignatureInformation.create = create; -})(SignatureInformation || (SignatureInformation = {})); -/** - * A document highlight kind. - */ -var DocumentHighlightKind; -(function (DocumentHighlightKind) { - /** - * A textual occurrence. - */ - DocumentHighlightKind.Text = 1; - /** - * Read-access of a symbol, like reading a variable. - */ - DocumentHighlightKind.Read = 2; - /** - * Write-access of a symbol, like writing to a variable. - */ - DocumentHighlightKind.Write = 3; -})(DocumentHighlightKind || (DocumentHighlightKind = {})); -/** - * DocumentHighlight namespace to provide helper functions to work with - * [DocumentHighlight](#DocumentHighlight) literals. - */ -var DocumentHighlight; -(function (DocumentHighlight) { - /** - * Create a DocumentHighlight object. - * @param range The range the highlight applies to. - */ - function create(range, kind) { - var result = { range: range }; - if (Is.number(kind)) { - result.kind = kind; - } - return result; - } - DocumentHighlight.create = create; -})(DocumentHighlight || (DocumentHighlight = {})); -/** - * A symbol kind. - */ -var SymbolKind; -(function (SymbolKind) { - SymbolKind.File = 1; - SymbolKind.Module = 2; - SymbolKind.Namespace = 3; - SymbolKind.Package = 4; - SymbolKind.Class = 5; - SymbolKind.Method = 6; - SymbolKind.Property = 7; - SymbolKind.Field = 8; - SymbolKind.Constructor = 9; - SymbolKind.Enum = 10; - SymbolKind.Interface = 11; - SymbolKind.Function = 12; - SymbolKind.Variable = 13; - SymbolKind.Constant = 14; - SymbolKind.String = 15; - SymbolKind.Number = 16; - SymbolKind.Boolean = 17; - SymbolKind.Array = 18; - SymbolKind.Object = 19; - SymbolKind.Key = 20; - SymbolKind.Null = 21; - SymbolKind.EnumMember = 22; - SymbolKind.Struct = 23; - SymbolKind.Event = 24; - SymbolKind.Operator = 25; - SymbolKind.TypeParameter = 26; -})(SymbolKind || (SymbolKind = {})); -/** - * Symbol tags are extra annotations that tweak the rendering of a symbol. - * @since 3.15 - */ -var SymbolTag; -(function (SymbolTag) { - /** - * Render a symbol as obsolete, usually using a strike-out. - */ - SymbolTag.Deprecated = 1; -})(SymbolTag || (SymbolTag = {})); -var SymbolInformation; -(function (SymbolInformation) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the location of the symbol. - * @param uri The resource of the location of symbol, defaults to the current document. - * @param containerName The name of the symbol containing the symbol. - */ - function create(name, kind, range, uri, containerName) { - var result = { - name: name, - kind: kind, - location: { uri: uri, range: range } - }; - if (containerName) { - result.containerName = containerName; - } - return result; - } - SymbolInformation.create = create; -})(SymbolInformation || (SymbolInformation = {})); -var DocumentSymbol; -(function (DocumentSymbol) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param detail The detail of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the symbol. - * @param selectionRange The selectionRange of the symbol. - * @param children Children of the symbol. - */ - function create(name, detail, kind, range, selectionRange, children) { - var result = { - name: name, - detail: detail, - kind: kind, - range: range, - selectionRange: selectionRange - }; - if (children !== void 0) { - result.children = children; - } - return result; - } - DocumentSymbol.create = create; - /** - * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface. - */ - function is(value) { - var candidate = value; - return candidate && - Is.string(candidate.name) && Is.number(candidate.kind) && - Range.is(candidate.range) && Range.is(candidate.selectionRange) && - (candidate.detail === void 0 || Is.string(candidate.detail)) && - (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && - (candidate.children === void 0 || Array.isArray(candidate.children)) && - (candidate.tags === void 0 || Array.isArray(candidate.tags)); - } - DocumentSymbol.is = is; -})(DocumentSymbol || (DocumentSymbol = {})); -/** - * A set of predefined code action kinds - */ -var CodeActionKind; -(function (CodeActionKind) { - /** - * Empty kind. - */ - CodeActionKind.Empty = ''; - /** - * Base kind for quickfix actions: 'quickfix' - */ - CodeActionKind.QuickFix = 'quickfix'; - /** - * Base kind for refactoring actions: 'refactor' - */ - CodeActionKind.Refactor = 'refactor'; - /** - * Base kind for refactoring extraction actions: 'refactor.extract' - * - * Example extract actions: - * - * - Extract method - * - Extract function - * - Extract variable - * - Extract interface from class - * - ... - */ - CodeActionKind.RefactorExtract = 'refactor.extract'; - /** - * Base kind for refactoring inline actions: 'refactor.inline' - * - * Example inline actions: - * - * - Inline function - * - Inline variable - * - Inline constant - * - ... - */ - CodeActionKind.RefactorInline = 'refactor.inline'; - /** - * Base kind for refactoring rewrite actions: 'refactor.rewrite' - * - * Example rewrite actions: - * - * - Convert JavaScript function to class - * - Add or remove parameter - * - Encapsulate field - * - Make method static - * - Move method to base class - * - ... - */ - CodeActionKind.RefactorRewrite = 'refactor.rewrite'; - /** - * Base kind for source actions: `source` - * - * Source code actions apply to the entire file. - */ - CodeActionKind.Source = 'source'; - /** - * Base kind for an organize imports source action: `source.organizeImports` - */ - CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; - /** - * Base kind for auto-fix source actions: `source.fixAll`. - * - * Fix all actions automatically fix errors that have a clear fix that do not require user input. - * They should not suppress errors or perform unsafe fixes such as generating new types or classes. - * - * @since 3.15.0 - */ - CodeActionKind.SourceFixAll = 'source.fixAll'; -})(CodeActionKind || (CodeActionKind = {})); -/** - * The CodeActionContext namespace provides helper functions to work with - * [CodeActionContext](#CodeActionContext) literals. - */ -var CodeActionContext; -(function (CodeActionContext) { - /** - * Creates a new CodeActionContext literal. - */ - function create(diagnostics, only) { - var result = { diagnostics: diagnostics }; - if (only !== void 0 && only !== null) { - result.only = only; - } - return result; - } - CodeActionContext.create = create; - /** - * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)); - } - CodeActionContext.is = is; -})(CodeActionContext || (CodeActionContext = {})); -var CodeAction; -(function (CodeAction) { - function create(title, commandOrEdit, kind) { - var result = { title: title }; - if (Command.is(commandOrEdit)) { - result.command = commandOrEdit; - } - else { - result.edit = commandOrEdit; - } - if (kind !== void 0) { - result.kind = kind; - } - return result; - } - CodeAction.create = create; - function is(value) { - var candidate = value; - return candidate && Is.string(candidate.title) && - (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && - (candidate.kind === void 0 || Is.string(candidate.kind)) && - (candidate.edit !== void 0 || candidate.command !== void 0) && - (candidate.command === void 0 || Command.is(candidate.command)) && - (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && - (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); - } - CodeAction.is = is; -})(CodeAction || (CodeAction = {})); -/** - * The CodeLens namespace provides helper functions to work with - * [CodeLens](#CodeLens) literals. - */ -var CodeLens; -(function (CodeLens) { - /** - * Creates a new CodeLens literal. - */ - function create(range, data) { - var result = { range: range }; - if (Is.defined(data)) { - result.data = data; - } - return result; - } - CodeLens.create = create; - /** - * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); - } - CodeLens.is = is; -})(CodeLens || (CodeLens = {})); -/** - * The FormattingOptions namespace provides helper functions to work with - * [FormattingOptions](#FormattingOptions) literals. - */ -var FormattingOptions; -(function (FormattingOptions) { - /** - * Creates a new FormattingOptions literal. - */ - function create(tabSize, insertSpaces) { - return { tabSize: tabSize, insertSpaces: insertSpaces }; - } - FormattingOptions.create = create; - /** - * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces); - } - FormattingOptions.is = is; -})(FormattingOptions || (FormattingOptions = {})); -/** - * The DocumentLink namespace provides helper functions to work with - * [DocumentLink](#DocumentLink) literals. - */ -var DocumentLink; -(function (DocumentLink) { - /** - * Creates a new DocumentLink literal. - */ - function create(range, target, data) { - return { range: range, target: target, data: data }; - } - DocumentLink.create = create; - /** - * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); - } - DocumentLink.is = is; -})(DocumentLink || (DocumentLink = {})); -/** - * The SelectionRange namespace provides helper function to work with - * SelectionRange literals. - */ -var SelectionRange; -(function (SelectionRange) { - /** - * Creates a new SelectionRange - * @param range the range. - * @param parent an optional parent. - */ - function create(range, parent) { - return { range: range, parent: parent }; - } - SelectionRange.create = create; - function is(value) { - var candidate = value; - return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent)); - } - SelectionRange.is = is; -})(SelectionRange || (SelectionRange = {})); -var EOL = ['\n', '\r\n', '\r']; -/** - * @deprecated Use the text document from the new vscode-languageserver-textdocument package. - */ -var TextDocument; -(function (TextDocument) { - /** - * Creates a new ITextDocument literal from the given uri and content. - * @param uri The document's uri. - * @param languageId The document's language Id. - * @param content The document's content. - */ - function create(uri, languageId, version, content) { - return new FullTextDocument(uri, languageId, version, content); - } - TextDocument.create = create; - /** - * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) - && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; - } - TextDocument.is = is; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits, function (a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; - } - return diff; - }); - var lastModifiedOffset = text.length; - for (var i = sortedEdits.length - 1; i >= 0; i--) { - var e = sortedEdits[i]; - var startOffset = document.offsetAt(e.range.start); - var endOffset = document.offsetAt(e.range.end); - if (endOffset <= lastModifiedOffset) { - text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); - } - else { - throw new Error('Overlapping edit'); - } - lastModifiedOffset = startOffset; - } - return text; - } - TextDocument.applyEdits = applyEdits; - function mergeSort(data, compare) { - if (data.length <= 1) { - // sorted - return data; - } - var p = (data.length / 2) | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare); - mergeSort(right, compare); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - // smaller_equal -> take left to preserve order - data[i++] = left[leftIdx++]; - } - else { - // greater -> take right - data[i++] = right[rightIdx++]; - } - } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; - } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; - } -})(TextDocument || (TextDocument = {})); -var FullTextDocument = /** @class */ (function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = undefined; - } - Object.defineProperty(FullTextDocument.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.prototype.getText = function (range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument.prototype.update = function (event, version) { - this._content = event.text; - this._version = version; - this._lineOffsets = undefined; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === undefined) { - var lineOffsets = []; - var text = this._content; - var isLineStart = true; - for (var i = 0; i < text.length; i++) { - if (isLineStart) { - lineOffsets.push(i); - isLineStart = false; - } - var ch = text.charAt(i); - isLineStart = (ch === '\r' || ch === '\n'); - if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { - i++; - } - } - if (isLineStart && text.length > 0) { - lineOffsets.push(text.length); - } - this._lineOffsets = lineOffsets; - } - return this._lineOffsets; - }; - FullTextDocument.prototype.positionAt = function (offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, high = lineOffsets.length; - if (high === 0) { - return Position.create(0, offset); - } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } - else { - low = mid + 1; - } - } - // low is the least x for which the line offset is larger than the current offset - // or array.length if no line offset is larger than the current offset - var line = low - 1; - return Position.create(line, offset - lineOffsets[line]); - }; - FullTextDocument.prototype.offsetAt = function (position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } - else if (position.line < 0) { - return 0; - } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument.prototype, "lineCount", { - get: function () { - return this.getLineOffsets().length; - }, - enumerable: true, - configurable: true - }); - return FullTextDocument; -}()); -var Is; -(function (Is) { - var toString = Object.prototype.toString; - function defined(value) { - return typeof value !== 'undefined'; - } - Is.defined = defined; - function undefined(value) { - return typeof value === 'undefined'; - } - Is.undefined = undefined; - function boolean(value) { - return value === true || value === false; - } - Is.boolean = boolean; - function string(value) { - return toString.call(value) === '[object String]'; - } - Is.string = string; - function number(value) { - return toString.call(value) === '[object Number]'; - } - Is.number = number; - function func(value) { - return toString.call(value) === '[object Function]'; - } - Is.func = func; - function objectLiteral(value) { - // Strictly speaking class instances pass this check as well. Since the LSP - // doesn't use classes we ignore this for now. If we do we need to add something - // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` - return value !== null && typeof value === 'object'; - } - Is.objectLiteral = objectLiteral; - function typedArray(value, check) { - return Array.isArray(value) && value.every(check); - } - Is.typedArray = typedArray; -})(Is || (Is = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/beautify/beautify-css.js": -/*!********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/beautify/beautify-css.js ***! - \********************************************************************************************************************/ -/*! exports provided: css_beautify */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "css_beautify", function() { return css_beautify; }); -// copied from js-beautify/js/lib/beautify-css.js -// version: 1.11.0 -/* AUTO-GENERATED. DO NOT MODIFY. */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - - - CSS Beautifier ---------------- - - Written by Harutyun Amirjanyan, (amirjanyan@gmail.com) - - Based on code initially developed by: Einar Lielmanis, - https://beautifier.io/ - - Usage: - css_beautify(source_text); - css_beautify(source_text, options); - - The options are (default in brackets): - indent_size (4) — indentation size, - indent_char (space) — character to indent with, - selector_separator_newline (true) - separate selectors with newline or - not (e.g. "a,\nbr" or "a, br") - end_with_newline (false) - end with a newline - newline_between_rules (true) - add a new line after every css rule - space_around_selector_separator (false) - ensure space around selector separators: - '>', '+', '~' (e.g. "a>b" -> "a > b") - e.g - - css_beautify(css_source_text, { - 'indent_size': 1, - 'indent_char': '\t', - 'selector_separator': ' ', - 'end_with_newline': false, - 'newline_between_rules': true, - 'space_around_selector_separator': true - }); -*/ - -// http://www.w3.org/TR/CSS21/syndata.html#tokenization -// http://www.w3.org/TR/css3-syntax/ - -var legacy_beautify_css = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 15); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */, -/* 1 */, -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -function OutputLine(parent) { - this.__parent = parent; - this.__character_count = 0; - // use indent_count as a marker for this.__lines that have preserved indentation - this.__indent_count = -1; - this.__alignment_count = 0; - this.__wrap_point_index = 0; - this.__wrap_point_character_count = 0; - this.__wrap_point_indent_count = -1; - this.__wrap_point_alignment_count = 0; - - this.__items = []; -} - -OutputLine.prototype.clone_empty = function() { - var line = new OutputLine(this.__parent); - line.set_indent(this.__indent_count, this.__alignment_count); - return line; -}; - -OutputLine.prototype.item = function(index) { - if (index < 0) { - return this.__items[this.__items.length + index]; - } else { - return this.__items[index]; - } -}; - -OutputLine.prototype.has_match = function(pattern) { - for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) { - if (this.__items[lastCheckedOutput].match(pattern)) { - return true; - } - } - return false; -}; - -OutputLine.prototype.set_indent = function(indent, alignment) { - if (this.is_empty()) { - this.__indent_count = indent || 0; - this.__alignment_count = alignment || 0; - this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count); - } -}; - -OutputLine.prototype._set_wrap_point = function() { - if (this.__parent.wrap_line_length) { - this.__wrap_point_index = this.__items.length; - this.__wrap_point_character_count = this.__character_count; - this.__wrap_point_indent_count = this.__parent.next_line.__indent_count; - this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count; - } -}; - -OutputLine.prototype._should_wrap = function() { - return this.__wrap_point_index && - this.__character_count > this.__parent.wrap_line_length && - this.__wrap_point_character_count > this.__parent.next_line.__character_count; -}; - -OutputLine.prototype._allow_wrap = function() { - if (this._should_wrap()) { - this.__parent.add_new_line(); - var next = this.__parent.current_line; - next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count); - next.__items = this.__items.slice(this.__wrap_point_index); - this.__items = this.__items.slice(0, this.__wrap_point_index); - - next.__character_count += this.__character_count - this.__wrap_point_character_count; - this.__character_count = this.__wrap_point_character_count; - - if (next.__items[0] === " ") { - next.__items.splice(0, 1); - next.__character_count -= 1; - } - return true; - } - return false; -}; - -OutputLine.prototype.is_empty = function() { - return this.__items.length === 0; -}; - -OutputLine.prototype.last = function() { - if (!this.is_empty()) { - return this.__items[this.__items.length - 1]; - } else { - return null; - } -}; - -OutputLine.prototype.push = function(item) { - this.__items.push(item); - var last_newline_index = item.lastIndexOf('\n'); - if (last_newline_index !== -1) { - this.__character_count = item.length - last_newline_index; - } else { - this.__character_count += item.length; - } -}; - -OutputLine.prototype.pop = function() { - var item = null; - if (!this.is_empty()) { - item = this.__items.pop(); - this.__character_count -= item.length; - } - return item; -}; - - -OutputLine.prototype._remove_indent = function() { - if (this.__indent_count > 0) { - this.__indent_count -= 1; - this.__character_count -= this.__parent.indent_size; - } -}; - -OutputLine.prototype._remove_wrap_indent = function() { - if (this.__wrap_point_indent_count > 0) { - this.__wrap_point_indent_count -= 1; - } -}; -OutputLine.prototype.trim = function() { - while (this.last() === ' ') { - this.__items.pop(); - this.__character_count -= 1; - } -}; - -OutputLine.prototype.toString = function() { - var result = ''; - if (this.is_empty()) { - if (this.__parent.indent_empty_lines) { - result = this.__parent.get_indent_string(this.__indent_count); - } - } else { - result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count); - result += this.__items.join(''); - } - return result; -}; - -function IndentStringCache(options, baseIndentString) { - this.__cache = ['']; - this.__indent_size = options.indent_size; - this.__indent_string = options.indent_char; - if (!options.indent_with_tabs) { - this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char); - } - - // Set to null to continue support for auto detection of base indent - baseIndentString = baseIndentString || ''; - if (options.indent_level > 0) { - baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string); - } - - this.__base_string = baseIndentString; - this.__base_string_length = baseIndentString.length; -} - -IndentStringCache.prototype.get_indent_size = function(indent, column) { - var result = this.__base_string_length; - column = column || 0; - if (indent < 0) { - result = 0; - } - result += indent * this.__indent_size; - result += column; - return result; -}; - -IndentStringCache.prototype.get_indent_string = function(indent_level, column) { - var result = this.__base_string; - column = column || 0; - if (indent_level < 0) { - indent_level = 0; - result = ''; - } - column += indent_level * this.__indent_size; - this.__ensure_cache(column); - result += this.__cache[column]; - return result; -}; - -IndentStringCache.prototype.__ensure_cache = function(column) { - while (column >= this.__cache.length) { - this.__add_column(); - } -}; - -IndentStringCache.prototype.__add_column = function() { - var column = this.__cache.length; - var indent = 0; - var result = ''; - if (this.__indent_size && column >= this.__indent_size) { - indent = Math.floor(column / this.__indent_size); - column -= indent * this.__indent_size; - result = new Array(indent + 1).join(this.__indent_string); - } - if (column) { - result += new Array(column + 1).join(' '); - } - - this.__cache.push(result); -}; - -function Output(options, baseIndentString) { - this.__indent_cache = new IndentStringCache(options, baseIndentString); - this.raw = false; - this._end_with_newline = options.end_with_newline; - this.indent_size = options.indent_size; - this.wrap_line_length = options.wrap_line_length; - this.indent_empty_lines = options.indent_empty_lines; - this.__lines = []; - this.previous_line = null; - this.current_line = null; - this.next_line = new OutputLine(this); - this.space_before_token = false; - this.non_breaking_space = false; - this.previous_token_wrapped = false; - // initialize - this.__add_outputline(); -} - -Output.prototype.__add_outputline = function() { - this.previous_line = this.current_line; - this.current_line = this.next_line.clone_empty(); - this.__lines.push(this.current_line); -}; - -Output.prototype.get_line_number = function() { - return this.__lines.length; -}; - -Output.prototype.get_indent_string = function(indent, column) { - return this.__indent_cache.get_indent_string(indent, column); -}; - -Output.prototype.get_indent_size = function(indent, column) { - return this.__indent_cache.get_indent_size(indent, column); -}; - -Output.prototype.is_empty = function() { - return !this.previous_line && this.current_line.is_empty(); -}; - -Output.prototype.add_new_line = function(force_newline) { - // never newline at the start of file - // otherwise, newline only if we didn't just add one or we're forced - if (this.is_empty() || - (!force_newline && this.just_added_newline())) { - return false; - } - - // if raw output is enabled, don't print additional newlines, - // but still return True as though you had - if (!this.raw) { - this.__add_outputline(); - } - return true; -}; - -Output.prototype.get_code = function(eol) { - this.trim(true); - - // handle some edge cases where the last tokens - // has text that ends with newline(s) - var last_item = this.current_line.pop(); - if (last_item) { - if (last_item[last_item.length - 1] === '\n') { - last_item = last_item.replace(/\n+$/g, ''); - } - this.current_line.push(last_item); - } - - if (this._end_with_newline) { - this.__add_outputline(); - } - - var sweet_code = this.__lines.join('\n'); - - if (eol !== '\n') { - sweet_code = sweet_code.replace(/[\n]/g, eol); - } - return sweet_code; -}; - -Output.prototype.set_wrap_point = function() { - this.current_line._set_wrap_point(); -}; - -Output.prototype.set_indent = function(indent, alignment) { - indent = indent || 0; - alignment = alignment || 0; - - // Next line stores alignment values - this.next_line.set_indent(indent, alignment); - - // Never indent your first output indent at the start of the file - if (this.__lines.length > 1) { - this.current_line.set_indent(indent, alignment); - return true; - } - - this.current_line.set_indent(); - return false; -}; - -Output.prototype.add_raw_token = function(token) { - for (var x = 0; x < token.newlines; x++) { - this.__add_outputline(); - } - this.current_line.set_indent(-1); - this.current_line.push(token.whitespace_before); - this.current_line.push(token.text); - this.space_before_token = false; - this.non_breaking_space = false; - this.previous_token_wrapped = false; -}; - -Output.prototype.add_token = function(printable_token) { - this.__add_space_before_token(); - this.current_line.push(printable_token); - this.space_before_token = false; - this.non_breaking_space = false; - this.previous_token_wrapped = this.current_line._allow_wrap(); -}; - -Output.prototype.__add_space_before_token = function() { - if (this.space_before_token && !this.just_added_newline()) { - if (!this.non_breaking_space) { - this.set_wrap_point(); - } - this.current_line.push(' '); - } -}; - -Output.prototype.remove_indent = function(index) { - var output_length = this.__lines.length; - while (index < output_length) { - this.__lines[index]._remove_indent(); - index++; - } - this.current_line._remove_wrap_indent(); -}; - -Output.prototype.trim = function(eat_newlines) { - eat_newlines = (eat_newlines === undefined) ? false : eat_newlines; - - this.current_line.trim(); - - while (eat_newlines && this.__lines.length > 1 && - this.current_line.is_empty()) { - this.__lines.pop(); - this.current_line = this.__lines[this.__lines.length - 1]; - this.current_line.trim(); - } - - this.previous_line = this.__lines.length > 1 ? - this.__lines[this.__lines.length - 2] : null; -}; - -Output.prototype.just_added_newline = function() { - return this.current_line.is_empty(); -}; - -Output.prototype.just_added_blankline = function() { - return this.is_empty() || - (this.current_line.is_empty() && this.previous_line.is_empty()); -}; - -Output.prototype.ensure_empty_line_above = function(starts_with, ends_with) { - var index = this.__lines.length - 2; - while (index >= 0) { - var potentialEmptyLine = this.__lines[index]; - if (potentialEmptyLine.is_empty()) { - break; - } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 && - potentialEmptyLine.item(-1) !== ends_with) { - this.__lines.splice(index + 1, 0, new OutputLine(this)); - this.previous_line = this.__lines[this.__lines.length - 2]; - break; - } - index--; - } -}; - -module.exports.Output = Output; - - -/***/ }), -/* 3 */, -/* 4 */, -/* 5 */, -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -function Options(options, merge_child_field) { - this.raw_options = _mergeOpts(options, merge_child_field); - - // Support passing the source text back with no change - this.disabled = this._get_boolean('disabled'); - - this.eol = this._get_characters('eol', 'auto'); - this.end_with_newline = this._get_boolean('end_with_newline'); - this.indent_size = this._get_number('indent_size', 4); - this.indent_char = this._get_characters('indent_char', ' '); - this.indent_level = this._get_number('indent_level'); - - this.preserve_newlines = this._get_boolean('preserve_newlines', true); - this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786); - if (!this.preserve_newlines) { - this.max_preserve_newlines = 0; - } - - this.indent_with_tabs = this._get_boolean('indent_with_tabs', this.indent_char === '\t'); - if (this.indent_with_tabs) { - this.indent_char = '\t'; - - // indent_size behavior changed after 1.8.6 - // It used to be that indent_size would be - // set to 1 for indent_with_tabs. That is no longer needed and - // actually doesn't make sense - why not use spaces? Further, - // that might produce unexpected behavior - tabs being used - // for single-column alignment. So, when indent_with_tabs is true - // and indent_size is 1, reset indent_size to 4. - if (this.indent_size === 1) { - this.indent_size = 4; - } - } - - // Backwards compat with 1.3.x - this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char')); - - this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - - // valid templating languages ['django', 'erb', 'handlebars', 'php'] - // For now, 'auto' = all off for javascript, all on for html (and inline javascript). - // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']); -} - -Options.prototype._get_array = function(name, default_value) { - var option_value = this.raw_options[name]; - var result = default_value || []; - if (typeof option_value === 'object') { - if (option_value !== null && typeof option_value.concat === 'function') { - result = option_value.concat(); - } - } else if (typeof option_value === 'string') { - result = option_value.split(/[^a-zA-Z0-9_\/\-]+/); - } - return result; -}; - -Options.prototype._get_boolean = function(name, default_value) { - var option_value = this.raw_options[name]; - var result = option_value === undefined ? !!default_value : !!option_value; - return result; -}; - -Options.prototype._get_characters = function(name, default_value) { - var option_value = this.raw_options[name]; - var result = default_value || ''; - if (typeof option_value === 'string') { - result = option_value.replace(/\\r/, '\r').replace(/\\n/, '\n').replace(/\\t/, '\t'); - } - return result; -}; - -Options.prototype._get_number = function(name, default_value) { - var option_value = this.raw_options[name]; - default_value = parseInt(default_value, 10); - if (isNaN(default_value)) { - default_value = 0; - } - var result = parseInt(option_value, 10); - if (isNaN(result)) { - result = default_value; - } - return result; -}; - -Options.prototype._get_selection = function(name, selection_list, default_value) { - var result = this._get_selection_list(name, selection_list, default_value); - if (result.length !== 1) { - throw new Error( - "Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" + - selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); - } - - return result[0]; -}; - - -Options.prototype._get_selection_list = function(name, selection_list, default_value) { - if (!selection_list || selection_list.length === 0) { - throw new Error("Selection list cannot be empty."); - } - - default_value = default_value || [selection_list[0]]; - if (!this._is_valid_selection(default_value, selection_list)) { - throw new Error("Invalid Default Value!"); - } - - var result = this._get_array(name, default_value); - if (!this._is_valid_selection(result, selection_list)) { - throw new Error( - "Invalid Option Value: The option '" + name + "' can contain only the following values:\n" + - selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); - } - - return result; -}; - -Options.prototype._is_valid_selection = function(result, selection_list) { - return result.length && selection_list.length && - !result.some(function(item) { return selection_list.indexOf(item) === -1; }); -}; - - -// merges child options up with the parent options object -// Example: obj = {a: 1, b: {a: 2}} -// mergeOpts(obj, 'b') -// -// Returns: {a: 2} -function _mergeOpts(allOptions, childFieldName) { - var finalOpts = {}; - allOptions = _normalizeOpts(allOptions); - var name; - - for (name in allOptions) { - if (name !== childFieldName) { - finalOpts[name] = allOptions[name]; - } - } - - //merge in the per type settings for the childFieldName - if (childFieldName && allOptions[childFieldName]) { - for (name in allOptions[childFieldName]) { - finalOpts[name] = allOptions[childFieldName][name]; - } - } - return finalOpts; -} - -function _normalizeOpts(options) { - var convertedOpts = {}; - var key; - - for (key in options) { - var newKey = key.replace(/-/g, "_"); - convertedOpts[newKey] = options[key]; - } - return convertedOpts; -} - -module.exports.Options = Options; -module.exports.normalizeOpts = _normalizeOpts; -module.exports.mergeOpts = _mergeOpts; - - -/***/ }), -/* 7 */, -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -var regexp_has_sticky = RegExp.prototype.hasOwnProperty('sticky'); - -function InputScanner(input_string) { - this.__input = input_string || ''; - this.__input_length = this.__input.length; - this.__position = 0; -} - -InputScanner.prototype.restart = function() { - this.__position = 0; -}; - -InputScanner.prototype.back = function() { - if (this.__position > 0) { - this.__position -= 1; - } -}; - -InputScanner.prototype.hasNext = function() { - return this.__position < this.__input_length; -}; - -InputScanner.prototype.next = function() { - var val = null; - if (this.hasNext()) { - val = this.__input.charAt(this.__position); - this.__position += 1; - } - return val; -}; - -InputScanner.prototype.peek = function(index) { - var val = null; - index = index || 0; - index += this.__position; - if (index >= 0 && index < this.__input_length) { - val = this.__input.charAt(index); - } - return val; -}; - -// This is a JavaScript only helper function (not in python) -// Javascript doesn't have a match method -// and not all implementation support "sticky" flag. -// If they do not support sticky then both this.match() and this.test() method -// must get the match and check the index of the match. -// If sticky is supported and set, this method will use it. -// Otherwise it will check that global is set, and fall back to the slower method. -InputScanner.prototype.__match = function(pattern, index) { - pattern.lastIndex = index; - var pattern_match = pattern.exec(this.__input); - - if (pattern_match && !(regexp_has_sticky && pattern.sticky)) { - if (pattern_match.index !== index) { - pattern_match = null; - } - } - - return pattern_match; -}; - -InputScanner.prototype.test = function(pattern, index) { - index = index || 0; - index += this.__position; - - if (index >= 0 && index < this.__input_length) { - return !!this.__match(pattern, index); - } else { - return false; - } -}; - -InputScanner.prototype.testChar = function(pattern, index) { - // test one character regex match - var val = this.peek(index); - pattern.lastIndex = 0; - return val !== null && pattern.test(val); -}; - -InputScanner.prototype.match = function(pattern) { - var pattern_match = this.__match(pattern, this.__position); - if (pattern_match) { - this.__position += pattern_match[0].length; - } else { - pattern_match = null; - } - return pattern_match; -}; - -InputScanner.prototype.read = function(starting_pattern, until_pattern, until_after) { - var val = ''; - var match; - if (starting_pattern) { - match = this.match(starting_pattern); - if (match) { - val += match[0]; - } - } - if (until_pattern && (match || !starting_pattern)) { - val += this.readUntil(until_pattern, until_after); - } - return val; -}; - -InputScanner.prototype.readUntil = function(pattern, until_after) { - var val = ''; - var match_index = this.__position; - pattern.lastIndex = this.__position; - var pattern_match = pattern.exec(this.__input); - if (pattern_match) { - match_index = pattern_match.index; - if (until_after) { - match_index += pattern_match[0].length; - } - } else { - match_index = this.__input_length; - } - - val = this.__input.substring(this.__position, match_index); - this.__position = match_index; - return val; -}; - -InputScanner.prototype.readUntilAfter = function(pattern) { - return this.readUntil(pattern, true); -}; - -InputScanner.prototype.get_regexp = function(pattern, match_from) { - var result = null; - var flags = 'g'; - if (match_from && regexp_has_sticky) { - flags = 'y'; - } - // strings are converted to regexp - if (typeof pattern === "string" && pattern !== '') { - // result = new RegExp(pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), flags); - result = new RegExp(pattern, flags); - } else if (pattern) { - result = new RegExp(pattern.source, flags); - } - return result; -}; - -InputScanner.prototype.get_literal_regexp = function(literal_string) { - return RegExp(literal_string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')); -}; - -/* css beautifier legacy helpers */ -InputScanner.prototype.peekUntilAfter = function(pattern) { - var start = this.__position; - var val = this.readUntilAfter(pattern); - this.__position = start; - return val; -}; - -InputScanner.prototype.lookBack = function(testVal) { - var start = this.__position - 1; - return start >= testVal.length && this.__input.substring(start - testVal.length, start) - .toLowerCase() === testVal; -}; - -module.exports.InputScanner = InputScanner; - - -/***/ }), -/* 9 */, -/* 10 */, -/* 11 */, -/* 12 */, -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -function Directives(start_block_pattern, end_block_pattern) { - start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source; - end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source; - this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \w+[:]\w+)+ /.source + end_block_pattern, 'g'); - this.__directive_pattern = / (\w+)[:](\w+)/g; - - this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\sbeautify\signore:end\s/.source + end_block_pattern, 'g'); -} - -Directives.prototype.get_directives = function(text) { - if (!text.match(this.__directives_block_pattern)) { - return null; - } - - var directives = {}; - this.__directive_pattern.lastIndex = 0; - var directive_match = this.__directive_pattern.exec(text); - - while (directive_match) { - directives[directive_match[1]] = directive_match[2]; - directive_match = this.__directive_pattern.exec(text); - } - - return directives; -}; - -Directives.prototype.readIgnored = function(input) { - return input.readUntilAfter(this.__directives_end_ignore_pattern); -}; - - -module.exports.Directives = Directives; - - -/***/ }), -/* 14 */, -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -var Beautifier = __webpack_require__(16).Beautifier, - Options = __webpack_require__(17).Options; - -function css_beautify(source_text, options) { - var beautifier = new Beautifier(source_text, options); - return beautifier.beautify(); -} - -module.exports = css_beautify; -module.exports.defaultOptions = function() { - return new Options(); -}; - - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -var Options = __webpack_require__(17).Options; -var Output = __webpack_require__(2).Output; -var InputScanner = __webpack_require__(8).InputScanner; -var Directives = __webpack_require__(13).Directives; - -var directives_core = new Directives(/\/\*/, /\*\//); - -var lineBreak = /\r\n|[\r\n]/; -var allLineBreaks = /\r\n|[\r\n]/g; - -// tokenizer -var whitespaceChar = /\s/; -var whitespacePattern = /(?:\s|\n)+/g; -var block_comment_pattern = /\/\*(?:[\s\S]*?)((?:\*\/)|$)/g; -var comment_pattern = /\/\/(?:[^\n\r\u2028\u2029]*)/g; - -function Beautifier(source_text, options) { - this._source_text = source_text || ''; - // Allow the setting of language/file-type specific options - // with inheritance of overall settings - this._options = new Options(options); - this._ch = null; - this._input = null; - - // https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule - this.NESTED_AT_RULE = { - "@page": true, - "@font-face": true, - "@keyframes": true, - // also in CONDITIONAL_GROUP_RULE below - "@media": true, - "@supports": true, - "@document": true - }; - this.CONDITIONAL_GROUP_RULE = { - "@media": true, - "@supports": true, - "@document": true - }; - -} - -Beautifier.prototype.eatString = function(endChars) { - var result = ''; - this._ch = this._input.next(); - while (this._ch) { - result += this._ch; - if (this._ch === "\\") { - result += this._input.next(); - } else if (endChars.indexOf(this._ch) !== -1 || this._ch === "\n") { - break; - } - this._ch = this._input.next(); - } - return result; -}; - -// Skips any white space in the source text from the current position. -// When allowAtLeastOneNewLine is true, will output new lines for each -// newline character found; if the user has preserve_newlines off, only -// the first newline will be output -Beautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) { - var result = whitespaceChar.test(this._input.peek()); - var isFirstNewLine = true; - - while (whitespaceChar.test(this._input.peek())) { - this._ch = this._input.next(); - if (allowAtLeastOneNewLine && this._ch === '\n') { - if (this._options.preserve_newlines || isFirstNewLine) { - isFirstNewLine = false; - this._output.add_new_line(true); - } - } - } - return result; -}; - -// Nested pseudo-class if we are insideRule -// and the next special character found opens -// a new block -Beautifier.prototype.foundNestedPseudoClass = function() { - var openParen = 0; - var i = 1; - var ch = this._input.peek(i); - while (ch) { - if (ch === "{") { - return true; - } else if (ch === '(') { - // pseudoclasses can contain () - openParen += 1; - } else if (ch === ')') { - if (openParen === 0) { - return false; - } - openParen -= 1; - } else if (ch === ";" || ch === "}") { - return false; - } - i++; - ch = this._input.peek(i); - } - return false; -}; - -Beautifier.prototype.print_string = function(output_string) { - this._output.set_indent(this._indentLevel); - this._output.non_breaking_space = true; - this._output.add_token(output_string); -}; - -Beautifier.prototype.preserveSingleSpace = function(isAfterSpace) { - if (isAfterSpace) { - this._output.space_before_token = true; - } -}; - -Beautifier.prototype.indent = function() { - this._indentLevel++; -}; - -Beautifier.prototype.outdent = function() { - if (this._indentLevel > 0) { - this._indentLevel--; - } -}; - -/*_____________________--------------------_____________________*/ - -Beautifier.prototype.beautify = function() { - if (this._options.disabled) { - return this._source_text; - } - - var source_text = this._source_text; - var eol = this._options.eol; - if (eol === 'auto') { - eol = '\n'; - if (source_text && lineBreak.test(source_text || '')) { - eol = source_text.match(lineBreak)[0]; - } - } - - - // HACK: newline parsing inconsistent. This brute force normalizes the this._input. - source_text = source_text.replace(allLineBreaks, '\n'); - - // reset - var baseIndentString = source_text.match(/^[\t ]*/)[0]; - - this._output = new Output(this._options, baseIndentString); - this._input = new InputScanner(source_text); - this._indentLevel = 0; - this._nestedLevel = 0; - - this._ch = null; - var parenLevel = 0; - - var insideRule = false; - // This is the value side of a property value pair (blue in the following ex) - // label { content: blue } - var insidePropertyValue = false; - var enteringConditionalGroup = false; - var insideAtExtend = false; - var insideAtImport = false; - var topCharacter = this._ch; - var whitespace; - var isAfterSpace; - var previous_ch; - - while (true) { - whitespace = this._input.read(whitespacePattern); - isAfterSpace = whitespace !== ''; - previous_ch = topCharacter; - this._ch = this._input.next(); - if (this._ch === '\\' && this._input.hasNext()) { - this._ch += this._input.next(); - } - topCharacter = this._ch; - - if (!this._ch) { - break; - } else if (this._ch === '/' && this._input.peek() === '*') { - // /* css comment */ - // Always start block comments on a new line. - // This handles scenarios where a block comment immediately - // follows a property definition on the same line or where - // minified code is being beautified. - this._output.add_new_line(); - this._input.back(); - - var comment = this._input.read(block_comment_pattern); - - // Handle ignore directive - var directives = directives_core.get_directives(comment); - if (directives && directives.ignore === 'start') { - comment += directives_core.readIgnored(this._input); - } - - this.print_string(comment); - - // Ensures any new lines following the comment are preserved - this.eatWhitespace(true); - - // Block comments are followed by a new line so they don't - // share a line with other properties - this._output.add_new_line(); - } else if (this._ch === '/' && this._input.peek() === '/') { - // // single line comment - // Preserves the space before a comment - // on the same line as a rule - this._output.space_before_token = true; - this._input.back(); - this.print_string(this._input.read(comment_pattern)); - - // Ensures any new lines following the comment are preserved - this.eatWhitespace(true); - } else if (this._ch === '@') { - this.preserveSingleSpace(isAfterSpace); - - // deal with less propery mixins @{...} - if (this._input.peek() === '{') { - this.print_string(this._ch + this.eatString('}')); - } else { - this.print_string(this._ch); - - // strip trailing space, if present, for hash property checks - var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g); - - if (variableOrRule.match(/[ :]$/)) { - // we have a variable or pseudo-class, add it and insert one space before continuing - variableOrRule = this.eatString(": ").replace(/\s$/, ''); - this.print_string(variableOrRule); - this._output.space_before_token = true; - } - - variableOrRule = variableOrRule.replace(/\s$/, ''); - - if (variableOrRule === 'extend') { - insideAtExtend = true; - } else if (variableOrRule === 'import') { - insideAtImport = true; - } - - // might be a nesting at-rule - if (variableOrRule in this.NESTED_AT_RULE) { - this._nestedLevel += 1; - if (variableOrRule in this.CONDITIONAL_GROUP_RULE) { - enteringConditionalGroup = true; - } - // might be less variable - } else if (!insideRule && parenLevel === 0 && variableOrRule.indexOf(':') !== -1) { - insidePropertyValue = true; - this.indent(); - } - } - } else if (this._ch === '#' && this._input.peek() === '{') { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch + this.eatString('}')); - } else if (this._ch === '{') { - if (insidePropertyValue) { - insidePropertyValue = false; - this.outdent(); - } - this.indent(); - this._output.space_before_token = true; - this.print_string(this._ch); - - // when entering conditional groups, only rulesets are allowed - if (enteringConditionalGroup) { - enteringConditionalGroup = false; - insideRule = (this._indentLevel > this._nestedLevel); - } else { - // otherwise, declarations are also allowed - insideRule = (this._indentLevel >= this._nestedLevel); - } - if (this._options.newline_between_rules && insideRule) { - if (this._output.previous_line && this._output.previous_line.item(-1) !== '{') { - this._output.ensure_empty_line_above('/', ','); - } - } - this.eatWhitespace(true); - this._output.add_new_line(); - } else if (this._ch === '}') { - this.outdent(); - this._output.add_new_line(); - if (previous_ch === '{') { - this._output.trim(true); - } - insideAtImport = false; - insideAtExtend = false; - if (insidePropertyValue) { - this.outdent(); - insidePropertyValue = false; - } - this.print_string(this._ch); - insideRule = false; - if (this._nestedLevel) { - this._nestedLevel--; - } - - this.eatWhitespace(true); - this._output.add_new_line(); - - if (this._options.newline_between_rules && !this._output.just_added_blankline()) { - if (this._input.peek() !== '}') { - this._output.add_new_line(true); - } - } - } else if (this._ch === ":") { - if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideAtExtend && parenLevel === 0) { - // 'property: value' delimiter - // which could be in a conditional group query - this.print_string(':'); - if (!insidePropertyValue) { - insidePropertyValue = true; - this._output.space_before_token = true; - this.eatWhitespace(true); - this.indent(); - } - } else { - // sass/less parent reference don't use a space - // sass nested pseudo-class don't use a space - - // preserve space before pseudoclasses/pseudoelements, as it means "in any child" - if (this._input.lookBack(" ")) { - this._output.space_before_token = true; - } - if (this._input.peek() === ":") { - // pseudo-element - this._ch = this._input.next(); - this.print_string("::"); - } else { - // pseudo-class - this.print_string(':'); - } - } - } else if (this._ch === '"' || this._ch === '\'') { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch + this.eatString(this._ch)); - this.eatWhitespace(true); - } else if (this._ch === ';') { - if (parenLevel === 0) { - if (insidePropertyValue) { - this.outdent(); - insidePropertyValue = false; - } - insideAtExtend = false; - insideAtImport = false; - this.print_string(this._ch); - this.eatWhitespace(true); - - // This maintains single line comments on the same - // line. Block comments are also affected, but - // a new line is always output before one inside - // that section - if (this._input.peek() !== '/') { - this._output.add_new_line(); - } - } else { - this.print_string(this._ch); - this.eatWhitespace(true); - this._output.space_before_token = true; - } - } else if (this._ch === '(') { // may be a url - if (this._input.lookBack("url")) { - this.print_string(this._ch); - this.eatWhitespace(); - parenLevel++; - this.indent(); - this._ch = this._input.next(); - if (this._ch === ')' || this._ch === '"' || this._ch === '\'') { - this._input.back(); - } else if (this._ch) { - this.print_string(this._ch + this.eatString(')')); - if (parenLevel) { - parenLevel--; - this.outdent(); - } - } - } else { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch); - this.eatWhitespace(); - parenLevel++; - this.indent(); - } - } else if (this._ch === ')') { - if (parenLevel) { - parenLevel--; - this.outdent(); - } - this.print_string(this._ch); - } else if (this._ch === ',') { - this.print_string(this._ch); - this.eatWhitespace(true); - if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport) { - this._output.add_new_line(); - } else { - this._output.space_before_token = true; - } - } else if ((this._ch === '>' || this._ch === '+' || this._ch === '~') && !insidePropertyValue && parenLevel === 0) { - //handle combinator spacing - if (this._options.space_around_combinator) { - this._output.space_before_token = true; - this.print_string(this._ch); - this._output.space_before_token = true; - } else { - this.print_string(this._ch); - this.eatWhitespace(); - // squash extra whitespace - if (this._ch && whitespaceChar.test(this._ch)) { - this._ch = ''; - } - } - } else if (this._ch === ']') { - this.print_string(this._ch); - } else if (this._ch === '[') { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch); - } else if (this._ch === '=') { // no whitespace before or after - this.eatWhitespace(); - this.print_string('='); - if (whitespaceChar.test(this._ch)) { - this._ch = ''; - } - } else if (this._ch === '!' && !this._input.lookBack("\\")) { // !important - this.print_string(' '); - this.print_string(this._ch); - } else { - this.preserveSingleSpace(isAfterSpace); - this.print_string(this._ch); - } - } - - var sweetCode = this._output.get_code(eol); - - return sweetCode; -}; - -module.exports.Beautifier = Beautifier; - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -var BaseOptions = __webpack_require__(6).Options; - -function Options(options) { - BaseOptions.call(this, options, 'css'); - - this.selector_separator_newline = this._get_boolean('selector_separator_newline', true); - this.newline_between_rules = this._get_boolean('newline_between_rules', true); - var space_around_selector_separator = this._get_boolean('space_around_selector_separator'); - this.space_around_combinator = this._get_boolean('space_around_combinator') || space_around_selector_separator; - -} -Options.prototype = new BaseOptions(); - - - -module.exports.Options = Options; - - -/***/ }) -/******/ ]); - -var css_beautify = legacy_beautify_css; - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/beautify/beautify-html.js": -/*!*********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/beautify/beautify-html.js ***! - \*********************************************************************************************************************/ -/*! exports provided: html_beautify */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "html_beautify", function() { return html_beautify; }); -/* harmony import */ var _beautify_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./beautify.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/beautify/beautify.js"); -/* harmony import */ var _beautify_css_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./beautify-css.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/beautify/beautify-css.js"); -// copied from js-beautify/js/lib/beautify-html.js -// version: 1.11.0 -/* AUTO-GENERATED. DO NOT MODIFY. */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - - - Style HTML ---------------- - - Written by Nochum Sossonko, (nsossonko@hotmail.com) - - Based on code initially developed by: Einar Lielmanis, - https://beautifier.io/ - - Usage: - style_html(html_source); - - style_html(html_source, options); - - The options are: - indent_inner_html (default false) — indent and sections, - indent_size (default 4) — indentation size, - indent_char (default space) — character to indent with, - wrap_line_length (default 250) - maximum amount of characters per line (0 = disable) - brace_style (default "collapse") - "collapse" | "expand" | "end-expand" | "none" - put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are. - inline (defaults to inline tags) - list of tags to be considered inline tags - unformatted (defaults to inline tags) - list of tags, that shouldn't be reformatted - content_unformatted (defaults to ["pre", "textarea"] tags) - list of tags, whose content shouldn't be reformatted - indent_scripts (default normal) - "keep"|"separate"|"normal" - preserve_newlines (default true) - whether existing line breaks before elements should be preserved - Only works before elements, not inside tags or for text. - max_preserve_newlines (default unlimited) - maximum number of line breaks to be preserved in one chunk - indent_handlebars (default false) - format and indent {{#foo}} and {{/foo}} - end_with_newline (false) - end with a newline - extra_liners (default [head,body,/html]) -List of tags that should have an extra newline before them. - - e.g. - - style_html(html_source, { - 'indent_inner_html': false, - 'indent_size': 2, - 'indent_char': ' ', - 'wrap_line_length': 78, - 'brace_style': 'expand', - 'preserve_newlines': true, - 'max_preserve_newlines': 5, - 'indent_handlebars': false, - 'extra_liners': ['/html'] - }); -*/ - - - - -var legacy_beautify_html = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 18); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */, -/* 1 */, -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -function OutputLine(parent) { - this.__parent = parent; - this.__character_count = 0; - // use indent_count as a marker for this.__lines that have preserved indentation - this.__indent_count = -1; - this.__alignment_count = 0; - this.__wrap_point_index = 0; - this.__wrap_point_character_count = 0; - this.__wrap_point_indent_count = -1; - this.__wrap_point_alignment_count = 0; - - this.__items = []; -} - -OutputLine.prototype.clone_empty = function() { - var line = new OutputLine(this.__parent); - line.set_indent(this.__indent_count, this.__alignment_count); - return line; -}; - -OutputLine.prototype.item = function(index) { - if (index < 0) { - return this.__items[this.__items.length + index]; - } else { - return this.__items[index]; - } -}; - -OutputLine.prototype.has_match = function(pattern) { - for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) { - if (this.__items[lastCheckedOutput].match(pattern)) { - return true; - } - } - return false; -}; - -OutputLine.prototype.set_indent = function(indent, alignment) { - if (this.is_empty()) { - this.__indent_count = indent || 0; - this.__alignment_count = alignment || 0; - this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count); - } -}; - -OutputLine.prototype._set_wrap_point = function() { - if (this.__parent.wrap_line_length) { - this.__wrap_point_index = this.__items.length; - this.__wrap_point_character_count = this.__character_count; - this.__wrap_point_indent_count = this.__parent.next_line.__indent_count; - this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count; - } -}; - -OutputLine.prototype._should_wrap = function() { - return this.__wrap_point_index && - this.__character_count > this.__parent.wrap_line_length && - this.__wrap_point_character_count > this.__parent.next_line.__character_count; -}; - -OutputLine.prototype._allow_wrap = function() { - if (this._should_wrap()) { - this.__parent.add_new_line(); - var next = this.__parent.current_line; - next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count); - next.__items = this.__items.slice(this.__wrap_point_index); - this.__items = this.__items.slice(0, this.__wrap_point_index); - - next.__character_count += this.__character_count - this.__wrap_point_character_count; - this.__character_count = this.__wrap_point_character_count; - - if (next.__items[0] === " ") { - next.__items.splice(0, 1); - next.__character_count -= 1; - } - return true; - } - return false; -}; - -OutputLine.prototype.is_empty = function() { - return this.__items.length === 0; -}; - -OutputLine.prototype.last = function() { - if (!this.is_empty()) { - return this.__items[this.__items.length - 1]; - } else { - return null; - } -}; - -OutputLine.prototype.push = function(item) { - this.__items.push(item); - var last_newline_index = item.lastIndexOf('\n'); - if (last_newline_index !== -1) { - this.__character_count = item.length - last_newline_index; - } else { - this.__character_count += item.length; - } -}; - -OutputLine.prototype.pop = function() { - var item = null; - if (!this.is_empty()) { - item = this.__items.pop(); - this.__character_count -= item.length; - } - return item; -}; - - -OutputLine.prototype._remove_indent = function() { - if (this.__indent_count > 0) { - this.__indent_count -= 1; - this.__character_count -= this.__parent.indent_size; - } -}; - -OutputLine.prototype._remove_wrap_indent = function() { - if (this.__wrap_point_indent_count > 0) { - this.__wrap_point_indent_count -= 1; - } -}; -OutputLine.prototype.trim = function() { - while (this.last() === ' ') { - this.__items.pop(); - this.__character_count -= 1; - } -}; - -OutputLine.prototype.toString = function() { - var result = ''; - if (this.is_empty()) { - if (this.__parent.indent_empty_lines) { - result = this.__parent.get_indent_string(this.__indent_count); - } - } else { - result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count); - result += this.__items.join(''); - } - return result; -}; - -function IndentStringCache(options, baseIndentString) { - this.__cache = ['']; - this.__indent_size = options.indent_size; - this.__indent_string = options.indent_char; - if (!options.indent_with_tabs) { - this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char); - } - - // Set to null to continue support for auto detection of base indent - baseIndentString = baseIndentString || ''; - if (options.indent_level > 0) { - baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string); - } - - this.__base_string = baseIndentString; - this.__base_string_length = baseIndentString.length; -} - -IndentStringCache.prototype.get_indent_size = function(indent, column) { - var result = this.__base_string_length; - column = column || 0; - if (indent < 0) { - result = 0; - } - result += indent * this.__indent_size; - result += column; - return result; -}; - -IndentStringCache.prototype.get_indent_string = function(indent_level, column) { - var result = this.__base_string; - column = column || 0; - if (indent_level < 0) { - indent_level = 0; - result = ''; - } - column += indent_level * this.__indent_size; - this.__ensure_cache(column); - result += this.__cache[column]; - return result; -}; - -IndentStringCache.prototype.__ensure_cache = function(column) { - while (column >= this.__cache.length) { - this.__add_column(); - } -}; - -IndentStringCache.prototype.__add_column = function() { - var column = this.__cache.length; - var indent = 0; - var result = ''; - if (this.__indent_size && column >= this.__indent_size) { - indent = Math.floor(column / this.__indent_size); - column -= indent * this.__indent_size; - result = new Array(indent + 1).join(this.__indent_string); - } - if (column) { - result += new Array(column + 1).join(' '); - } - - this.__cache.push(result); -}; - -function Output(options, baseIndentString) { - this.__indent_cache = new IndentStringCache(options, baseIndentString); - this.raw = false; - this._end_with_newline = options.end_with_newline; - this.indent_size = options.indent_size; - this.wrap_line_length = options.wrap_line_length; - this.indent_empty_lines = options.indent_empty_lines; - this.__lines = []; - this.previous_line = null; - this.current_line = null; - this.next_line = new OutputLine(this); - this.space_before_token = false; - this.non_breaking_space = false; - this.previous_token_wrapped = false; - // initialize - this.__add_outputline(); -} - -Output.prototype.__add_outputline = function() { - this.previous_line = this.current_line; - this.current_line = this.next_line.clone_empty(); - this.__lines.push(this.current_line); -}; - -Output.prototype.get_line_number = function() { - return this.__lines.length; -}; - -Output.prototype.get_indent_string = function(indent, column) { - return this.__indent_cache.get_indent_string(indent, column); -}; - -Output.prototype.get_indent_size = function(indent, column) { - return this.__indent_cache.get_indent_size(indent, column); -}; - -Output.prototype.is_empty = function() { - return !this.previous_line && this.current_line.is_empty(); -}; - -Output.prototype.add_new_line = function(force_newline) { - // never newline at the start of file - // otherwise, newline only if we didn't just add one or we're forced - if (this.is_empty() || - (!force_newline && this.just_added_newline())) { - return false; - } - - // if raw output is enabled, don't print additional newlines, - // but still return True as though you had - if (!this.raw) { - this.__add_outputline(); - } - return true; -}; - -Output.prototype.get_code = function(eol) { - this.trim(true); - - // handle some edge cases where the last tokens - // has text that ends with newline(s) - var last_item = this.current_line.pop(); - if (last_item) { - if (last_item[last_item.length - 1] === '\n') { - last_item = last_item.replace(/\n+$/g, ''); - } - this.current_line.push(last_item); - } - - if (this._end_with_newline) { - this.__add_outputline(); - } - - var sweet_code = this.__lines.join('\n'); - - if (eol !== '\n') { - sweet_code = sweet_code.replace(/[\n]/g, eol); - } - return sweet_code; -}; - -Output.prototype.set_wrap_point = function() { - this.current_line._set_wrap_point(); -}; - -Output.prototype.set_indent = function(indent, alignment) { - indent = indent || 0; - alignment = alignment || 0; - - // Next line stores alignment values - this.next_line.set_indent(indent, alignment); - - // Never indent your first output indent at the start of the file - if (this.__lines.length > 1) { - this.current_line.set_indent(indent, alignment); - return true; - } - - this.current_line.set_indent(); - return false; -}; - -Output.prototype.add_raw_token = function(token) { - for (var x = 0; x < token.newlines; x++) { - this.__add_outputline(); - } - this.current_line.set_indent(-1); - this.current_line.push(token.whitespace_before); - this.current_line.push(token.text); - this.space_before_token = false; - this.non_breaking_space = false; - this.previous_token_wrapped = false; -}; - -Output.prototype.add_token = function(printable_token) { - this.__add_space_before_token(); - this.current_line.push(printable_token); - this.space_before_token = false; - this.non_breaking_space = false; - this.previous_token_wrapped = this.current_line._allow_wrap(); -}; - -Output.prototype.__add_space_before_token = function() { - if (this.space_before_token && !this.just_added_newline()) { - if (!this.non_breaking_space) { - this.set_wrap_point(); - } - this.current_line.push(' '); - } -}; - -Output.prototype.remove_indent = function(index) { - var output_length = this.__lines.length; - while (index < output_length) { - this.__lines[index]._remove_indent(); - index++; - } - this.current_line._remove_wrap_indent(); -}; - -Output.prototype.trim = function(eat_newlines) { - eat_newlines = (eat_newlines === undefined) ? false : eat_newlines; - - this.current_line.trim(); - - while (eat_newlines && this.__lines.length > 1 && - this.current_line.is_empty()) { - this.__lines.pop(); - this.current_line = this.__lines[this.__lines.length - 1]; - this.current_line.trim(); - } - - this.previous_line = this.__lines.length > 1 ? - this.__lines[this.__lines.length - 2] : null; -}; - -Output.prototype.just_added_newline = function() { - return this.current_line.is_empty(); -}; - -Output.prototype.just_added_blankline = function() { - return this.is_empty() || - (this.current_line.is_empty() && this.previous_line.is_empty()); -}; - -Output.prototype.ensure_empty_line_above = function(starts_with, ends_with) { - var index = this.__lines.length - 2; - while (index >= 0) { - var potentialEmptyLine = this.__lines[index]; - if (potentialEmptyLine.is_empty()) { - break; - } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 && - potentialEmptyLine.item(-1) !== ends_with) { - this.__lines.splice(index + 1, 0, new OutputLine(this)); - this.previous_line = this.__lines[this.__lines.length - 2]; - break; - } - index--; - } -}; - -module.exports.Output = Output; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -function Token(type, text, newlines, whitespace_before) { - this.type = type; - this.text = text; - - // comments_before are - // comments that have a new line before them - // and may or may not have a newline after - // this is a set of comments before - this.comments_before = null; /* inline comment*/ - - - // this.comments_after = new TokenStream(); // no new line before and newline after - this.newlines = newlines || 0; - this.whitespace_before = whitespace_before || ''; - this.parent = null; - this.next = null; - this.previous = null; - this.opened = null; - this.closed = null; - this.directives = null; -} - - -module.exports.Token = Token; - - -/***/ }), -/* 4 */, -/* 5 */, -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -function Options(options, merge_child_field) { - this.raw_options = _mergeOpts(options, merge_child_field); - - // Support passing the source text back with no change - this.disabled = this._get_boolean('disabled'); - - this.eol = this._get_characters('eol', 'auto'); - this.end_with_newline = this._get_boolean('end_with_newline'); - this.indent_size = this._get_number('indent_size', 4); - this.indent_char = this._get_characters('indent_char', ' '); - this.indent_level = this._get_number('indent_level'); - - this.preserve_newlines = this._get_boolean('preserve_newlines', true); - this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786); - if (!this.preserve_newlines) { - this.max_preserve_newlines = 0; - } - - this.indent_with_tabs = this._get_boolean('indent_with_tabs', this.indent_char === '\t'); - if (this.indent_with_tabs) { - this.indent_char = '\t'; - - // indent_size behavior changed after 1.8.6 - // It used to be that indent_size would be - // set to 1 for indent_with_tabs. That is no longer needed and - // actually doesn't make sense - why not use spaces? Further, - // that might produce unexpected behavior - tabs being used - // for single-column alignment. So, when indent_with_tabs is true - // and indent_size is 1, reset indent_size to 4. - if (this.indent_size === 1) { - this.indent_size = 4; - } - } - - // Backwards compat with 1.3.x - this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char')); - - this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - - // valid templating languages ['django', 'erb', 'handlebars', 'php'] - // For now, 'auto' = all off for javascript, all on for html (and inline javascript). - // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']); -} - -Options.prototype._get_array = function(name, default_value) { - var option_value = this.raw_options[name]; - var result = default_value || []; - if (typeof option_value === 'object') { - if (option_value !== null && typeof option_value.concat === 'function') { - result = option_value.concat(); - } - } else if (typeof option_value === 'string') { - result = option_value.split(/[^a-zA-Z0-9_\/\-]+/); - } - return result; -}; - -Options.prototype._get_boolean = function(name, default_value) { - var option_value = this.raw_options[name]; - var result = option_value === undefined ? !!default_value : !!option_value; - return result; -}; - -Options.prototype._get_characters = function(name, default_value) { - var option_value = this.raw_options[name]; - var result = default_value || ''; - if (typeof option_value === 'string') { - result = option_value.replace(/\\r/, '\r').replace(/\\n/, '\n').replace(/\\t/, '\t'); - } - return result; -}; - -Options.prototype._get_number = function(name, default_value) { - var option_value = this.raw_options[name]; - default_value = parseInt(default_value, 10); - if (isNaN(default_value)) { - default_value = 0; - } - var result = parseInt(option_value, 10); - if (isNaN(result)) { - result = default_value; - } - return result; -}; - -Options.prototype._get_selection = function(name, selection_list, default_value) { - var result = this._get_selection_list(name, selection_list, default_value); - if (result.length !== 1) { - throw new Error( - "Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" + - selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); - } - - return result[0]; -}; - - -Options.prototype._get_selection_list = function(name, selection_list, default_value) { - if (!selection_list || selection_list.length === 0) { - throw new Error("Selection list cannot be empty."); - } - - default_value = default_value || [selection_list[0]]; - if (!this._is_valid_selection(default_value, selection_list)) { - throw new Error("Invalid Default Value!"); - } - - var result = this._get_array(name, default_value); - if (!this._is_valid_selection(result, selection_list)) { - throw new Error( - "Invalid Option Value: The option '" + name + "' can contain only the following values:\n" + - selection_list + "\nYou passed in: '" + this.raw_options[name] + "'"); - } - - return result; -}; - -Options.prototype._is_valid_selection = function(result, selection_list) { - return result.length && selection_list.length && - !result.some(function(item) { return selection_list.indexOf(item) === -1; }); -}; - - -// merges child options up with the parent options object -// Example: obj = {a: 1, b: {a: 2}} -// mergeOpts(obj, 'b') -// -// Returns: {a: 2} -function _mergeOpts(allOptions, childFieldName) { - var finalOpts = {}; - allOptions = _normalizeOpts(allOptions); - var name; - - for (name in allOptions) { - if (name !== childFieldName) { - finalOpts[name] = allOptions[name]; - } - } - - //merge in the per type settings for the childFieldName - if (childFieldName && allOptions[childFieldName]) { - for (name in allOptions[childFieldName]) { - finalOpts[name] = allOptions[childFieldName][name]; - } - } - return finalOpts; -} - -function _normalizeOpts(options) { - var convertedOpts = {}; - var key; - - for (key in options) { - var newKey = key.replace(/-/g, "_"); - convertedOpts[newKey] = options[key]; - } - return convertedOpts; -} - -module.exports.Options = Options; -module.exports.normalizeOpts = _normalizeOpts; -module.exports.mergeOpts = _mergeOpts; - - -/***/ }), -/* 7 */, -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -var regexp_has_sticky = RegExp.prototype.hasOwnProperty('sticky'); - -function InputScanner(input_string) { - this.__input = input_string || ''; - this.__input_length = this.__input.length; - this.__position = 0; -} - -InputScanner.prototype.restart = function() { - this.__position = 0; -}; - -InputScanner.prototype.back = function() { - if (this.__position > 0) { - this.__position -= 1; - } -}; - -InputScanner.prototype.hasNext = function() { - return this.__position < this.__input_length; -}; - -InputScanner.prototype.next = function() { - var val = null; - if (this.hasNext()) { - val = this.__input.charAt(this.__position); - this.__position += 1; - } - return val; -}; - -InputScanner.prototype.peek = function(index) { - var val = null; - index = index || 0; - index += this.__position; - if (index >= 0 && index < this.__input_length) { - val = this.__input.charAt(index); - } - return val; -}; - -// This is a JavaScript only helper function (not in python) -// Javascript doesn't have a match method -// and not all implementation support "sticky" flag. -// If they do not support sticky then both this.match() and this.test() method -// must get the match and check the index of the match. -// If sticky is supported and set, this method will use it. -// Otherwise it will check that global is set, and fall back to the slower method. -InputScanner.prototype.__match = function(pattern, index) { - pattern.lastIndex = index; - var pattern_match = pattern.exec(this.__input); - - if (pattern_match && !(regexp_has_sticky && pattern.sticky)) { - if (pattern_match.index !== index) { - pattern_match = null; - } - } - - return pattern_match; -}; - -InputScanner.prototype.test = function(pattern, index) { - index = index || 0; - index += this.__position; - - if (index >= 0 && index < this.__input_length) { - return !!this.__match(pattern, index); - } else { - return false; - } -}; - -InputScanner.prototype.testChar = function(pattern, index) { - // test one character regex match - var val = this.peek(index); - pattern.lastIndex = 0; - return val !== null && pattern.test(val); -}; - -InputScanner.prototype.match = function(pattern) { - var pattern_match = this.__match(pattern, this.__position); - if (pattern_match) { - this.__position += pattern_match[0].length; - } else { - pattern_match = null; - } - return pattern_match; -}; - -InputScanner.prototype.read = function(starting_pattern, until_pattern, until_after) { - var val = ''; - var match; - if (starting_pattern) { - match = this.match(starting_pattern); - if (match) { - val += match[0]; - } - } - if (until_pattern && (match || !starting_pattern)) { - val += this.readUntil(until_pattern, until_after); - } - return val; -}; - -InputScanner.prototype.readUntil = function(pattern, until_after) { - var val = ''; - var match_index = this.__position; - pattern.lastIndex = this.__position; - var pattern_match = pattern.exec(this.__input); - if (pattern_match) { - match_index = pattern_match.index; - if (until_after) { - match_index += pattern_match[0].length; - } - } else { - match_index = this.__input_length; - } - - val = this.__input.substring(this.__position, match_index); - this.__position = match_index; - return val; -}; - -InputScanner.prototype.readUntilAfter = function(pattern) { - return this.readUntil(pattern, true); -}; - -InputScanner.prototype.get_regexp = function(pattern, match_from) { - var result = null; - var flags = 'g'; - if (match_from && regexp_has_sticky) { - flags = 'y'; - } - // strings are converted to regexp - if (typeof pattern === "string" && pattern !== '') { - // result = new RegExp(pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), flags); - result = new RegExp(pattern, flags); - } else if (pattern) { - result = new RegExp(pattern.source, flags); - } - return result; -}; - -InputScanner.prototype.get_literal_regexp = function(literal_string) { - return RegExp(literal_string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')); -}; - -/* css beautifier legacy helpers */ -InputScanner.prototype.peekUntilAfter = function(pattern) { - var start = this.__position; - var val = this.readUntilAfter(pattern); - this.__position = start; - return val; -}; - -InputScanner.prototype.lookBack = function(testVal) { - var start = this.__position - 1; - return start >= testVal.length && this.__input.substring(start - testVal.length, start) - .toLowerCase() === testVal; -}; - -module.exports.InputScanner = InputScanner; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -var InputScanner = __webpack_require__(8).InputScanner; -var Token = __webpack_require__(3).Token; -var TokenStream = __webpack_require__(10).TokenStream; -var WhitespacePattern = __webpack_require__(11).WhitespacePattern; - -var TOKEN = { - START: 'TK_START', - RAW: 'TK_RAW', - EOF: 'TK_EOF' -}; - -var Tokenizer = function(input_string, options) { - this._input = new InputScanner(input_string); - this._options = options || {}; - this.__tokens = null; - - this._patterns = {}; - this._patterns.whitespace = new WhitespacePattern(this._input); -}; - -Tokenizer.prototype.tokenize = function() { - this._input.restart(); - this.__tokens = new TokenStream(); - - this._reset(); - - var current; - var previous = new Token(TOKEN.START, ''); - var open_token = null; - var open_stack = []; - var comments = new TokenStream(); - - while (previous.type !== TOKEN.EOF) { - current = this._get_next_token(previous, open_token); - while (this._is_comment(current)) { - comments.add(current); - current = this._get_next_token(previous, open_token); - } - - if (!comments.isEmpty()) { - current.comments_before = comments; - comments = new TokenStream(); - } - - current.parent = open_token; - - if (this._is_opening(current)) { - open_stack.push(open_token); - open_token = current; - } else if (open_token && this._is_closing(current, open_token)) { - current.opened = open_token; - open_token.closed = current; - open_token = open_stack.pop(); - current.parent = open_token; - } - - current.previous = previous; - previous.next = current; - - this.__tokens.add(current); - previous = current; - } - - return this.__tokens; -}; - - -Tokenizer.prototype._is_first_token = function() { - return this.__tokens.isEmpty(); -}; - -Tokenizer.prototype._reset = function() {}; - -Tokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false - this._readWhitespace(); - var resulting_string = this._input.read(/.+/g); - if (resulting_string) { - return this._create_token(TOKEN.RAW, resulting_string); - } else { - return this._create_token(TOKEN.EOF, ''); - } -}; - -Tokenizer.prototype._is_comment = function(current_token) { // jshint unused:false - return false; -}; - -Tokenizer.prototype._is_opening = function(current_token) { // jshint unused:false - return false; -}; - -Tokenizer.prototype._is_closing = function(current_token, open_token) { // jshint unused:false - return false; -}; - -Tokenizer.prototype._create_token = function(type, text) { - var token = new Token(type, text, - this._patterns.whitespace.newline_count, - this._patterns.whitespace.whitespace_before_token); - return token; -}; - -Tokenizer.prototype._readWhitespace = function() { - return this._patterns.whitespace.read(); -}; - - - -module.exports.Tokenizer = Tokenizer; -module.exports.TOKEN = TOKEN; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -function TokenStream(parent_token) { - // private - this.__tokens = []; - this.__tokens_length = this.__tokens.length; - this.__position = 0; - this.__parent_token = parent_token; -} - -TokenStream.prototype.restart = function() { - this.__position = 0; -}; - -TokenStream.prototype.isEmpty = function() { - return this.__tokens_length === 0; -}; - -TokenStream.prototype.hasNext = function() { - return this.__position < this.__tokens_length; -}; - -TokenStream.prototype.next = function() { - var val = null; - if (this.hasNext()) { - val = this.__tokens[this.__position]; - this.__position += 1; - } - return val; -}; - -TokenStream.prototype.peek = function(index) { - var val = null; - index = index || 0; - index += this.__position; - if (index >= 0 && index < this.__tokens_length) { - val = this.__tokens[index]; - } - return val; -}; - -TokenStream.prototype.add = function(token) { - if (this.__parent_token) { - token.parent = this.__parent_token; - } - this.__tokens.push(token); - this.__tokens_length += 1; -}; - -module.exports.TokenStream = TokenStream; - - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -var Pattern = __webpack_require__(12).Pattern; - -function WhitespacePattern(input_scanner, parent) { - Pattern.call(this, input_scanner, parent); - if (parent) { - this._line_regexp = this._input.get_regexp(parent._line_regexp); - } else { - this.__set_whitespace_patterns('', ''); - } - - this.newline_count = 0; - this.whitespace_before_token = ''; -} -WhitespacePattern.prototype = new Pattern(); - -WhitespacePattern.prototype.__set_whitespace_patterns = function(whitespace_chars, newline_chars) { - whitespace_chars += '\\t '; - newline_chars += '\\n\\r'; - - this._match_pattern = this._input.get_regexp( - '[' + whitespace_chars + newline_chars + ']+', true); - this._newline_regexp = this._input.get_regexp( - '\\r\\n|[' + newline_chars + ']'); -}; - -WhitespacePattern.prototype.read = function() { - this.newline_count = 0; - this.whitespace_before_token = ''; - - var resulting_string = this._input.read(this._match_pattern); - if (resulting_string === ' ') { - this.whitespace_before_token = ' '; - } else if (resulting_string) { - var matches = this.__split(this._newline_regexp, resulting_string); - this.newline_count = matches.length - 1; - this.whitespace_before_token = matches[this.newline_count]; - } - - return resulting_string; -}; - -WhitespacePattern.prototype.matching = function(whitespace_chars, newline_chars) { - var result = this._create(); - result.__set_whitespace_patterns(whitespace_chars, newline_chars); - result._update(); - return result; -}; - -WhitespacePattern.prototype._create = function() { - return new WhitespacePattern(this._input, this); -}; - -WhitespacePattern.prototype.__split = function(regexp, input_string) { - regexp.lastIndex = 0; - var start_index = 0; - var result = []; - var next_match = regexp.exec(input_string); - while (next_match) { - result.push(input_string.substring(start_index, next_match.index)); - start_index = next_match.index + next_match[0].length; - next_match = regexp.exec(input_string); - } - - if (start_index < input_string.length) { - result.push(input_string.substring(start_index, input_string.length)); - } else { - result.push(''); - } - - return result; -}; - - - -module.exports.WhitespacePattern = WhitespacePattern; - - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -function Pattern(input_scanner, parent) { - this._input = input_scanner; - this._starting_pattern = null; - this._match_pattern = null; - this._until_pattern = null; - this._until_after = false; - - if (parent) { - this._starting_pattern = this._input.get_regexp(parent._starting_pattern, true); - this._match_pattern = this._input.get_regexp(parent._match_pattern, true); - this._until_pattern = this._input.get_regexp(parent._until_pattern); - this._until_after = parent._until_after; - } -} - -Pattern.prototype.read = function() { - var result = this._input.read(this._starting_pattern); - if (!this._starting_pattern || result) { - result += this._input.read(this._match_pattern, this._until_pattern, this._until_after); - } - return result; -}; - -Pattern.prototype.read_match = function() { - return this._input.match(this._match_pattern); -}; - -Pattern.prototype.until_after = function(pattern) { - var result = this._create(); - result._until_after = true; - result._until_pattern = this._input.get_regexp(pattern); - result._update(); - return result; -}; - -Pattern.prototype.until = function(pattern) { - var result = this._create(); - result._until_after = false; - result._until_pattern = this._input.get_regexp(pattern); - result._update(); - return result; -}; - -Pattern.prototype.starting_with = function(pattern) { - var result = this._create(); - result._starting_pattern = this._input.get_regexp(pattern, true); - result._update(); - return result; -}; - -Pattern.prototype.matching = function(pattern) { - var result = this._create(); - result._match_pattern = this._input.get_regexp(pattern, true); - result._update(); - return result; -}; - -Pattern.prototype._create = function() { - return new Pattern(this._input, this); -}; - -Pattern.prototype._update = function() {}; - -module.exports.Pattern = Pattern; - - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -function Directives(start_block_pattern, end_block_pattern) { - start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source; - end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source; - this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \w+[:]\w+)+ /.source + end_block_pattern, 'g'); - this.__directive_pattern = / (\w+)[:](\w+)/g; - - this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\sbeautify\signore:end\s/.source + end_block_pattern, 'g'); -} - -Directives.prototype.get_directives = function(text) { - if (!text.match(this.__directives_block_pattern)) { - return null; - } - - var directives = {}; - this.__directive_pattern.lastIndex = 0; - var directive_match = this.__directive_pattern.exec(text); - - while (directive_match) { - directives[directive_match[1]] = directive_match[2]; - directive_match = this.__directive_pattern.exec(text); - } - - return directives; -}; - -Directives.prototype.readIgnored = function(input) { - return input.readUntilAfter(this.__directives_end_ignore_pattern); -}; - - -module.exports.Directives = Directives; - - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -var Pattern = __webpack_require__(12).Pattern; - - -var template_names = { - django: false, - erb: false, - handlebars: false, - php: false -}; - -// This lets templates appear anywhere we would do a readUntil -// The cost is higher but it is pay to play. -function TemplatablePattern(input_scanner, parent) { - Pattern.call(this, input_scanner, parent); - this.__template_pattern = null; - this._disabled = Object.assign({}, template_names); - this._excluded = Object.assign({}, template_names); - - if (parent) { - this.__template_pattern = this._input.get_regexp(parent.__template_pattern); - this._excluded = Object.assign(this._excluded, parent._excluded); - this._disabled = Object.assign(this._disabled, parent._disabled); - } - var pattern = new Pattern(input_scanner); - this.__patterns = { - handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/), - handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/), - handlebars: pattern.starting_with(/{{/).until_after(/}}/), - php: pattern.starting_with(/<\?(?:[=]|php)/).until_after(/\?>/), - erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/), - // django coflicts with handlebars a bit. - django: pattern.starting_with(/{%/).until_after(/%}/), - django_value: pattern.starting_with(/{{/).until_after(/}}/), - django_comment: pattern.starting_with(/{#/).until_after(/#}/) - }; -} -TemplatablePattern.prototype = new Pattern(); - -TemplatablePattern.prototype._create = function() { - return new TemplatablePattern(this._input, this); -}; - -TemplatablePattern.prototype._update = function() { - this.__set_templated_pattern(); -}; - -TemplatablePattern.prototype.disable = function(language) { - var result = this._create(); - result._disabled[language] = true; - result._update(); - return result; -}; - -TemplatablePattern.prototype.read_options = function(options) { - var result = this._create(); - for (var language in template_names) { - result._disabled[language] = options.templating.indexOf(language) === -1; - } - result._update(); - return result; -}; - -TemplatablePattern.prototype.exclude = function(language) { - var result = this._create(); - result._excluded[language] = true; - result._update(); - return result; -}; - -TemplatablePattern.prototype.read = function() { - var result = ''; - if (this._match_pattern) { - result = this._input.read(this._starting_pattern); - } else { - result = this._input.read(this._starting_pattern, this.__template_pattern); - } - var next = this._read_template(); - while (next) { - if (this._match_pattern) { - next += this._input.read(this._match_pattern); - } else { - next += this._input.readUntil(this.__template_pattern); - } - result += next; - next = this._read_template(); - } - - if (this._until_after) { - result += this._input.readUntilAfter(this._until_pattern); - } - return result; -}; - -TemplatablePattern.prototype.__set_templated_pattern = function() { - var items = []; - - if (!this._disabled.php) { - items.push(this.__patterns.php._starting_pattern.source); - } - if (!this._disabled.handlebars) { - items.push(this.__patterns.handlebars._starting_pattern.source); - } - if (!this._disabled.erb) { - items.push(this.__patterns.erb._starting_pattern.source); - } - if (!this._disabled.django) { - items.push(this.__patterns.django._starting_pattern.source); - items.push(this.__patterns.django_value._starting_pattern.source); - items.push(this.__patterns.django_comment._starting_pattern.source); - } - - if (this._until_pattern) { - items.push(this._until_pattern.source); - } - this.__template_pattern = this._input.get_regexp('(?:' + items.join('|') + ')'); -}; - -TemplatablePattern.prototype._read_template = function() { - var resulting_string = ''; - var c = this._input.peek(); - if (c === '<') { - var peek1 = this._input.peek(1); - //if we're in a comment, do something special - // We treat all comments as literals, even more than preformatted tags - // we just look for the appropriate close tag - if (!this._disabled.php && !this._excluded.php && peek1 === '?') { - resulting_string = resulting_string || - this.__patterns.php.read(); - } - if (!this._disabled.erb && !this._excluded.erb && peek1 === '%') { - resulting_string = resulting_string || - this.__patterns.erb.read(); - } - } else if (c === '{') { - if (!this._disabled.handlebars && !this._excluded.handlebars) { - resulting_string = resulting_string || - this.__patterns.handlebars_comment.read(); - resulting_string = resulting_string || - this.__patterns.handlebars_unescaped.read(); - resulting_string = resulting_string || - this.__patterns.handlebars.read(); - } - if (!this._disabled.django) { - // django coflicts with handlebars a bit. - if (!this._excluded.django && !this._excluded.handlebars) { - resulting_string = resulting_string || - this.__patterns.django_value.read(); - } - if (!this._excluded.django) { - resulting_string = resulting_string || - this.__patterns.django_comment.read(); - resulting_string = resulting_string || - this.__patterns.django.read(); - } - } - } - return resulting_string; -}; - - -module.exports.TemplatablePattern = TemplatablePattern; - - -/***/ }), -/* 15 */, -/* 16 */, -/* 17 */, -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -var Beautifier = __webpack_require__(19).Beautifier, - Options = __webpack_require__(20).Options; - -function style_html(html_source, options, js_beautify, css_beautify) { - var beautifier = new Beautifier(html_source, options, js_beautify, css_beautify); - return beautifier.beautify(); -} - -module.exports = style_html; -module.exports.defaultOptions = function() { - return new Options(); -}; - - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*jshint node:true */ -/* - - The MIT License (MIT) - - Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation files - (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, - publish, distribute, sublicense, and/or sell copies of the Software, - and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - - -var Options = __webpack_require__(20).Options; -var Output = __webpack_require__(2).Output; -var Tokenizer = __webpack_require__(21).Tokenizer; -var TOKEN = __webpack_require__(21).TOKEN; - -var lineBreak = /\r\n|[\r\n]/; -var allLineBreaks = /\r\n|[\r\n]/g; - -var Printer = function(options, base_indent_string) { //handles input/output and some other printing functions - - this.indent_level = 0; - this.alignment_size = 0; - this.max_preserve_newlines = options.max_preserve_newlines; - this.preserve_newlines = options.preserve_newlines; - - this._output = new Output(options, base_indent_string); - -}; - -Printer.prototype.current_line_has_match = function(pattern) { - return this._output.current_line.has_match(pattern); -}; - -Printer.prototype.set_space_before_token = function(value, non_breaking) { - this._output.space_before_token = value; - this._output.non_breaking_space = non_breaking; -}; - -Printer.prototype.set_wrap_point = function() { - this._output.set_indent(this.indent_level, this.alignment_size); - this._output.set_wrap_point(); -}; - - -Printer.prototype.add_raw_token = function(token) { - this._output.add_raw_token(token); -}; - -Printer.prototype.print_preserved_newlines = function(raw_token) { - var newlines = 0; - if (raw_token.type !== TOKEN.TEXT && raw_token.previous.type !== TOKEN.TEXT) { - newlines = raw_token.newlines ? 1 : 0; - } - - if (this.preserve_newlines) { - newlines = raw_token.newlines < this.max_preserve_newlines + 1 ? raw_token.newlines : this.max_preserve_newlines + 1; - } - for (var n = 0; n < newlines; n++) { - this.print_newline(n > 0); - } - - return newlines !== 0; -}; - -Printer.prototype.traverse_whitespace = function(raw_token) { - if (raw_token.whitespace_before || raw_token.newlines) { - if (!this.print_preserved_newlines(raw_token)) { - this._output.space_before_token = true; - } - return true; - } - return false; -}; - -Printer.prototype.previous_token_wrapped = function() { - return this._output.previous_token_wrapped; -}; - -Printer.prototype.print_newline = function(force) { - this._output.add_new_line(force); -}; - -Printer.prototype.print_token = function(token) { - if (token.text) { - this._output.set_indent(this.indent_level, this.alignment_size); - this._output.add_token(token.text); - } -}; - -Printer.prototype.indent = function() { - this.indent_level++; -}; - -Printer.prototype.get_full_indent = function(level) { - level = this.indent_level + (level || 0); - if (level < 1) { - return ''; - } - - return this._output.get_indent_string(level); -}; - -var get_type_attribute = function(start_token) { - var result = null; - var raw_token = start_token.next; - - // Search attributes for a type attribute - while (raw_token.type !== TOKEN.EOF && start_token.closed !== raw_token) { - if (raw_token.type === TOKEN.ATTRIBUTE && raw_token.text === 'type') { - if (raw_token.next && raw_token.next.type === TOKEN.EQUALS && - raw_token.next.next && raw_token.next.next.type === TOKEN.VALUE) { - result = raw_token.next.next.text; - } - break; - } - raw_token = raw_token.next; - } - - return result; -}; - -var get_custom_beautifier_name = function(tag_check, raw_token) { - var typeAttribute = null; - var result = null; - - if (!raw_token.closed) { - return null; - } - - if (tag_check === 'script') { - typeAttribute = 'text/javascript'; - } else if (tag_check === 'style') { - typeAttribute = 'text/css'; - } - - typeAttribute = get_type_attribute(raw_token) || typeAttribute; - - // For script and style tags that have a type attribute, only enable custom beautifiers for matching values - // For those without a type attribute use default; - if (typeAttribute.search('text/css') > -1) { - result = 'css'; - } else if (typeAttribute.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/) > -1) { - result = 'javascript'; - } else if (typeAttribute.search(/(text|application|dojo)\/(x-)?(html)/) > -1) { - result = 'html'; - } else if (typeAttribute.search(/test\/null/) > -1) { - // Test only mime-type for testing the beautifier when null is passed as beautifing function - result = 'null'; - } - - return result; -}; - -function in_array(what, arr) { - return arr.indexOf(what) !== -1; -} - -function TagFrame(parent, parser_token, indent_level) { - this.parent = parent || null; - this.tag = parser_token ? parser_token.tag_name : ''; - this.indent_level = indent_level || 0; - this.parser_token = parser_token || null; -} - -function TagStack(printer) { - this._printer = printer; - this._current_frame = null; -} - -TagStack.prototype.get_parser_token = function() { - return this._current_frame ? this._current_frame.parser_token : null; -}; - -TagStack.prototype.record_tag = function(parser_token) { //function to record a tag and its parent in this.tags Object - var new_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level); - this._current_frame = new_frame; -}; - -TagStack.prototype._try_pop_frame = function(frame) { //function to retrieve the opening tag to the corresponding closer - var parser_token = null; - - if (frame) { - parser_token = frame.parser_token; - this._printer.indent_level = frame.indent_level; - this._current_frame = frame.parent; - } - - return parser_token; -}; - -TagStack.prototype._get_frame = function(tag_list, stop_list) { //function to retrieve the opening tag to the corresponding closer - var frame = this._current_frame; - - while (frame) { //till we reach '' (the initial value); - if (tag_list.indexOf(frame.tag) !== -1) { //if this is it use it - break; - } else if (stop_list && stop_list.indexOf(frame.tag) !== -1) { - frame = null; - break; - } - frame = frame.parent; - } - - return frame; -}; - -TagStack.prototype.try_pop = function(tag, stop_list) { //function to retrieve the opening tag to the corresponding closer - var frame = this._get_frame([tag], stop_list); - return this._try_pop_frame(frame); -}; - -TagStack.prototype.indent_to_tag = function(tag_list) { - var frame = this._get_frame(tag_list); - if (frame) { - this._printer.indent_level = frame.indent_level; - } -}; - -function Beautifier(source_text, options, js_beautify, css_beautify) { - //Wrapper function to invoke all the necessary constructors and deal with the output. - this._source_text = source_text || ''; - options = options || {}; - this._js_beautify = js_beautify; - this._css_beautify = css_beautify; - this._tag_stack = null; - - // Allow the setting of language/file-type specific options - // with inheritance of overall settings - var optionHtml = new Options(options, 'html'); - - this._options = optionHtml; - - this._is_wrap_attributes_force = this._options.wrap_attributes.substr(0, 'force'.length) === 'force'; - this._is_wrap_attributes_force_expand_multiline = (this._options.wrap_attributes === 'force-expand-multiline'); - this._is_wrap_attributes_force_aligned = (this._options.wrap_attributes === 'force-aligned'); - this._is_wrap_attributes_aligned_multiple = (this._options.wrap_attributes === 'aligned-multiple'); - this._is_wrap_attributes_preserve = this._options.wrap_attributes.substr(0, 'preserve'.length) === 'preserve'; - this._is_wrap_attributes_preserve_aligned = (this._options.wrap_attributes === 'preserve-aligned'); -} - -Beautifier.prototype.beautify = function() { - - // if disabled, return the input unchanged. - if (this._options.disabled) { - return this._source_text; - } - - var source_text = this._source_text; - var eol = this._options.eol; - if (this._options.eol === 'auto') { - eol = '\n'; - if (source_text && lineBreak.test(source_text)) { - eol = source_text.match(lineBreak)[0]; - } - } - - // HACK: newline parsing inconsistent. This brute force normalizes the input. - source_text = source_text.replace(allLineBreaks, '\n'); - - var baseIndentString = source_text.match(/^[\t ]*/)[0]; - - var last_token = { - text: '', - type: '' - }; - - var last_tag_token = new TagOpenParserToken(); - - var printer = new Printer(this._options, baseIndentString); - var tokens = new Tokenizer(source_text, this._options).tokenize(); - - this._tag_stack = new TagStack(printer); - - var parser_token = null; - var raw_token = tokens.next(); - while (raw_token.type !== TOKEN.EOF) { - - if (raw_token.type === TOKEN.TAG_OPEN || raw_token.type === TOKEN.COMMENT) { - parser_token = this._handle_tag_open(printer, raw_token, last_tag_token, last_token); - last_tag_token = parser_token; - } else if ((raw_token.type === TOKEN.ATTRIBUTE || raw_token.type === TOKEN.EQUALS || raw_token.type === TOKEN.VALUE) || - (raw_token.type === TOKEN.TEXT && !last_tag_token.tag_complete)) { - parser_token = this._handle_inside_tag(printer, raw_token, last_tag_token, tokens); - } else if (raw_token.type === TOKEN.TAG_CLOSE) { - parser_token = this._handle_tag_close(printer, raw_token, last_tag_token); - } else if (raw_token.type === TOKEN.TEXT) { - parser_token = this._handle_text(printer, raw_token, last_tag_token); - } else { - // This should never happen, but if it does. Print the raw token - printer.add_raw_token(raw_token); - } - - last_token = parser_token; - - raw_token = tokens.next(); - } - var sweet_code = printer._output.get_code(eol); - - return sweet_code; -}; - -Beautifier.prototype._handle_tag_close = function(printer, raw_token, last_tag_token) { - var parser_token = { - text: raw_token.text, - type: raw_token.type - }; - printer.alignment_size = 0; - last_tag_token.tag_complete = true; - - printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true); - if (last_tag_token.is_unformatted) { - printer.add_raw_token(raw_token); - } else { - if (last_tag_token.tag_start_char === '<') { - printer.set_space_before_token(raw_token.text[0] === '/', true); // space before />, no space before > - if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.has_wrapped_attrs) { - printer.print_newline(false); - } - } - printer.print_token(raw_token); - - } - - if (last_tag_token.indent_content && - !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) { - printer.indent(); - - // only indent once per opened tag - last_tag_token.indent_content = false; - } - - if (!last_tag_token.is_inline_element && - !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) { - printer.set_wrap_point(); - } - - return parser_token; -}; - -Beautifier.prototype._handle_inside_tag = function(printer, raw_token, last_tag_token, tokens) { - var wrapped = last_tag_token.has_wrapped_attrs; - var parser_token = { - text: raw_token.text, - type: raw_token.type - }; - - printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true); - if (last_tag_token.is_unformatted) { - printer.add_raw_token(raw_token); - } else if (last_tag_token.tag_start_char === '{' && raw_token.type === TOKEN.TEXT) { - // For the insides of handlebars allow newlines or a single space between open and contents - if (printer.print_preserved_newlines(raw_token)) { - raw_token.newlines = 0; - printer.add_raw_token(raw_token); - } else { - printer.print_token(raw_token); - } - } else { - if (raw_token.type === TOKEN.ATTRIBUTE) { - printer.set_space_before_token(true); - last_tag_token.attr_count += 1; - } else if (raw_token.type === TOKEN.EQUALS) { //no space before = - printer.set_space_before_token(false); - } else if (raw_token.type === TOKEN.VALUE && raw_token.previous.type === TOKEN.EQUALS) { //no space before value - printer.set_space_before_token(false); - } - - if (raw_token.type === TOKEN.ATTRIBUTE && last_tag_token.tag_start_char === '<') { - if (this._is_wrap_attributes_preserve || this._is_wrap_attributes_preserve_aligned) { - printer.traverse_whitespace(raw_token); - wrapped = wrapped || raw_token.newlines !== 0; - } - - - if (this._is_wrap_attributes_force) { - var force_attr_wrap = last_tag_token.attr_count > 1; - if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.attr_count === 1) { - var is_only_attribute = true; - var peek_index = 0; - var peek_token; - do { - peek_token = tokens.peek(peek_index); - if (peek_token.type === TOKEN.ATTRIBUTE) { - is_only_attribute = false; - break; - } - peek_index += 1; - } while (peek_index < 4 && peek_token.type !== TOKEN.EOF && peek_token.type !== TOKEN.TAG_CLOSE); - - force_attr_wrap = !is_only_attribute; - } - - if (force_attr_wrap) { - printer.print_newline(false); - wrapped = true; - } - } - } - printer.print_token(raw_token); - wrapped = wrapped || printer.previous_token_wrapped(); - last_tag_token.has_wrapped_attrs = wrapped; - } - return parser_token; -}; - -Beautifier.prototype._handle_text = function(printer, raw_token, last_tag_token) { - var parser_token = { - text: raw_token.text, - type: 'TK_CONTENT' - }; - if (last_tag_token.custom_beautifier_name) { //check if we need to format javascript - this._print_custom_beatifier_text(printer, raw_token, last_tag_token); - } else if (last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) { - printer.add_raw_token(raw_token); - } else { - printer.traverse_whitespace(raw_token); - printer.print_token(raw_token); - } - return parser_token; -}; - -Beautifier.prototype._print_custom_beatifier_text = function(printer, raw_token, last_tag_token) { - var local = this; - if (raw_token.text !== '') { - - var text = raw_token.text, - _beautifier, - script_indent_level = 1, - pre = '', - post = ''; - if (last_tag_token.custom_beautifier_name === 'javascript' && typeof this._js_beautify === 'function') { - _beautifier = this._js_beautify; - } else if (last_tag_token.custom_beautifier_name === 'css' && typeof this._css_beautify === 'function') { - _beautifier = this._css_beautify; - } else if (last_tag_token.custom_beautifier_name === 'html') { - _beautifier = function(html_source, options) { - var beautifier = new Beautifier(html_source, options, local._js_beautify, local._css_beautify); - return beautifier.beautify(); - }; - } - - if (this._options.indent_scripts === "keep") { - script_indent_level = 0; - } else if (this._options.indent_scripts === "separate") { - script_indent_level = -printer.indent_level; - } - - var indentation = printer.get_full_indent(script_indent_level); - - // if there is at least one empty line at the end of this text, strip it - // we'll be adding one back after the text but before the containing tag. - text = text.replace(/\n[ \t]*$/, ''); - - // Handle the case where content is wrapped in a comment or cdata. - if (last_tag_token.custom_beautifier_name !== 'html' && - text[0] === '<' && text.match(/^(|]]>)$/.exec(text); - - // if we start to wrap but don't finish, print raw - if (!matched) { - printer.add_raw_token(raw_token); - return; - } - - pre = indentation + matched[1] + '\n'; - text = matched[4]; - if (matched[5]) { - post = indentation + matched[5]; - } - - // if there is at least one empty line at the end of this text, strip it - // we'll be adding one back after the text but before the containing tag. - text = text.replace(/\n[ \t]*$/, ''); - - if (matched[2] || matched[3].indexOf('\n') !== -1) { - // if the first line of the non-comment text has spaces - // use that as the basis for indenting in null case. - matched = matched[3].match(/[ \t]+$/); - if (matched) { - raw_token.whitespace_before = matched[0]; - } - } - } - - if (text) { - if (_beautifier) { - - // call the Beautifier if avaliable - var Child_options = function() { - this.eol = '\n'; - }; - Child_options.prototype = this._options.raw_options; - var child_options = new Child_options(); - text = _beautifier(indentation + text, child_options); - } else { - // simply indent the string otherwise - var white = raw_token.whitespace_before; - if (white) { - text = text.replace(new RegExp('\n(' + white + ')?', 'g'), '\n'); - } - - text = indentation + text.replace(/\n/g, '\n' + indentation); - } - } - - if (pre) { - if (!text) { - text = pre + post; - } else { - text = pre + text + '\n' + post; - } - } - - printer.print_newline(false); - if (text) { - raw_token.text = text; - raw_token.whitespace_before = ''; - raw_token.newlines = 0; - printer.add_raw_token(raw_token); - printer.print_newline(true); - } - } -}; - -Beautifier.prototype._handle_tag_open = function(printer, raw_token, last_tag_token, last_token) { - var parser_token = this._get_tag_open_token(raw_token); - - if ((last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) && - raw_token.type === TOKEN.TAG_OPEN && raw_token.text.indexOf(']*)/); - this.tag_check = tag_check_match ? tag_check_match[1] : ''; - } else { - tag_check_match = raw_token.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/); - this.tag_check = tag_check_match ? tag_check_match[1] : ''; - - // handle "{{#> myPartial}} - if (raw_token.text === '{{#>' && this.tag_check === '>' && raw_token.next !== null) { - this.tag_check = raw_token.next.text; - } - } - this.tag_check = this.tag_check.toLowerCase(); - - if (raw_token.type === TOKEN.COMMENT) { - this.tag_complete = true; - } - - this.is_start_tag = this.tag_check.charAt(0) !== '/'; - this.tag_name = !this.is_start_tag ? this.tag_check.substr(1) : this.tag_check; - this.is_end_tag = !this.is_start_tag || - (raw_token.closed && raw_token.closed.text === '/>'); - - // handlebars tags that don't start with # or ^ are single_tags, and so also start and end. - this.is_end_tag = this.is_end_tag || - (this.tag_start_char === '{' && (this.text.length < 3 || (/[^#\^]/.test(this.text.charAt(2))))); - } -}; - -Beautifier.prototype._get_tag_open_token = function(raw_token) { //function to get a full tag and parse its type - var parser_token = new TagOpenParserToken(this._tag_stack.get_parser_token(), raw_token); - - parser_token.alignment_size = this._options.wrap_attributes_indent_size; - - parser_token.is_end_tag = parser_token.is_end_tag || - in_array(parser_token.tag_check, this._options.void_elements); - - parser_token.is_empty_element = parser_token.tag_complete || - (parser_token.is_start_tag && parser_token.is_end_tag); - - parser_token.is_unformatted = !parser_token.tag_complete && in_array(parser_token.tag_check, this._options.unformatted); - parser_token.is_content_unformatted = !parser_token.is_empty_element && in_array(parser_token.tag_check, this._options.content_unformatted); - parser_token.is_inline_element = in_array(parser_token.tag_name, this._options.inline) || parser_token.tag_start_char === '{'; - - return parser_token; -}; - -Beautifier.prototype._set_tag_position = function(printer, raw_token, parser_token, last_tag_token, last_token) { - - if (!parser_token.is_empty_element) { - if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending - parser_token.start_tag_token = this._tag_stack.try_pop(parser_token.tag_name); //remove it and all ancestors - } else { // it's a start-tag - // check if this tag is starting an element that has optional end element - // and do an ending needed - if (this._do_optional_end_element(parser_token)) { - if (!parser_token.is_inline_element) { - if (parser_token.parent) { - parser_token.parent.multiline_content = true; - } - printer.print_newline(false); - } - - } - - this._tag_stack.record_tag(parser_token); //push it on the tag stack - - if ((parser_token.tag_name === 'script' || parser_token.tag_name === 'style') && - !(parser_token.is_unformatted || parser_token.is_content_unformatted)) { - parser_token.custom_beautifier_name = get_custom_beautifier_name(parser_token.tag_check, raw_token); - } - } - } - - if (in_array(parser_token.tag_check, this._options.extra_liners)) { //check if this double needs an extra line - printer.print_newline(false); - if (!printer._output.just_added_blankline()) { - printer.print_newline(true); - } - } - - if (parser_token.is_empty_element) { //if this tag name is a single tag type (either in the list or has a closing /) - - // if you hit an else case, reset the indent level if you are inside an: - // 'if', 'unless', or 'each' block. - if (parser_token.tag_start_char === '{' && parser_token.tag_check === 'else') { - this._tag_stack.indent_to_tag(['if', 'unless', 'each']); - parser_token.indent_content = true; - // Don't add a newline if opening {{#if}} tag is on the current line - var foundIfOnCurrentLine = printer.current_line_has_match(/{{#if/); - if (!foundIfOnCurrentLine) { - printer.print_newline(false); - } - } - - // Don't add a newline before elements that should remain where they are. - if (parser_token.tag_name === '!--' && last_token.type === TOKEN.TAG_CLOSE && - last_tag_token.is_end_tag && parser_token.text.indexOf('\n') === -1) { - //Do nothing. Leave comments on same line. - } else if (!parser_token.is_inline_element && !parser_token.is_unformatted) { - printer.print_newline(false); - } - } else if (parser_token.is_unformatted || parser_token.is_content_unformatted) { - if (!parser_token.is_inline_element && !parser_token.is_unformatted) { - printer.print_newline(false); - } - } else if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending - if ((parser_token.start_tag_token && parser_token.start_tag_token.multiline_content) || - !(parser_token.is_inline_element || - (last_tag_token.is_inline_element) || - (last_token.type === TOKEN.TAG_CLOSE && - parser_token.start_tag_token === last_tag_token) || - (last_token.type === 'TK_CONTENT') - )) { - printer.print_newline(false); - } - } else { // it's a start-tag - parser_token.indent_content = !parser_token.custom_beautifier_name; - - if (parser_token.tag_start_char === '<') { - if (parser_token.tag_name === 'html') { - parser_token.indent_content = this._options.indent_inner_html; - } else if (parser_token.tag_name === 'head') { - parser_token.indent_content = this._options.indent_head_inner_html; - } else if (parser_token.tag_name === 'body') { - parser_token.indent_content = this._options.indent_body_inner_html; - } - } - - if (!parser_token.is_inline_element && last_token.type !== 'TK_CONTENT') { - if (parser_token.parent) { - parser_token.parent.multiline_content = true; - } - printer.print_newline(false); - } - } -}; - -//To be used for

tag special case: -var p_closers = ['address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul']; -var p_parent_excludes = ['a', 'audio', 'del', 'ins', 'map', 'noscript', 'video']; - -Beautifier.prototype._do_optional_end_element = function(parser_token) { - var result = null; - // NOTE: cases of "if there is no more content in the parent element" - // are handled automatically by the beautifier. - // It assumes parent or ancestor close tag closes all children. - // https://www.w3.org/TR/html5/syntax.html#optional-tags - if (parser_token.is_empty_element || !parser_token.is_start_tag || !parser_token.parent) { - return; - - } - - if (parser_token.tag_name === 'body') { - // A head element’s end tag may be omitted if the head element is not immediately followed by a space character or a comment. - result = result || this._tag_stack.try_pop('head'); - - //} else if (parser_token.tag_name === 'body') { - // DONE: A body element’s end tag may be omitted if the body element is not immediately followed by a comment. - - } else if (parser_token.tag_name === 'li') { - // An li element’s end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element. - result = result || this._tag_stack.try_pop('li', ['ol', 'ul']); - - } else if (parser_token.tag_name === 'dd' || parser_token.tag_name === 'dt') { - // A dd element’s end tag may be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element. - // A dt element’s end tag may be omitted if the dt element is immediately followed by another dt element or a dd element. - result = result || this._tag_stack.try_pop('dt', ['dl']); - result = result || this._tag_stack.try_pop('dd', ['dl']); - - - } else if (parser_token.parent.tag_name === 'p' && p_closers.indexOf(parser_token.tag_name) !== -1) { - // IMPORTANT: this else-if works because p_closers has no overlap with any other element we look for in this method - // check for the parent element is an HTML element that is not an ,

-// "); -// // display shuffled cards (EXAMPLE ONLY) -// for ($index = 0; $index < 52; $index++) { -// if ($starting_point == 52) { $starting_point = 0; } -// print("Uncut Point: $deck[$index] "); -// print("Starting Point: $deck[$starting_point]
"); -// $starting_point++; -// } -// ?> -// -// - - -/***/ }) - -}]); -//# sourceMappingURL=41.41.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{947:function(e,t,p){"use strict";p.r(t),p.d(t,"conf",(function(){return n})),p.d(t,"language",(function(){return i}));var n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:"(",close:")",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],folding:{markers:{start:new RegExp("^\\s*(#|//)region\\b"),end:new RegExp("^\\s*(#|//)endregion\\b")}}},i={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.root"}],[/)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\?((php)|=)?/,{token:"@rematch",switchTo:"@phpInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],phpInSimpleState:[[/<\?((php)|=)?/,"metatag.php"],[/\?>/,{token:"metatag.php",switchTo:"@$S2.$S3"}],{include:"phpRoot"}],phpInEmbeddedState:[[/<\?((php)|=)?/,"metatag.php"],[/\?>/,{token:"metatag.php",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"phpRoot"}],phpRoot:[[/[a-zA-Z_]\w*/,{cases:{"@phpKeywords":{token:"keyword.php"},"@phpCompileTimeConstants":{token:"constant.php"},"@default":"identifier.php"}}],[/[$a-zA-Z_]\w*/,{cases:{"@phpPreDefinedVariables":{token:"variable.predefined.php"},"@default":"variable.php"}}],[/[{}]/,"delimiter.bracket.php"],[/[\[\]]/,"delimiter.array.php"],[/[()]/,"delimiter.parenthesis.php"],[/[ \t\r\n]+/],[/(#|\/\/)$/,"comment.php"],[/(#|\/\/)/,"comment.php","@phpLineComment"],[/\/\*/,"comment.php","@phpComment"],[/"/,"string.php","@phpDoubleQuoteString"],[/'/,"string.php","@phpSingleQuoteString"],[/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,\@]/,"delimiter.php"],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float.php"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float.php"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex.php"],[/0[0-7']*[0-7]/,"number.octal.php"],[/0[bB][0-1']*[0-1]/,"number.binary.php"],[/\d[\d']*/,"number.php"],[/\d/,"number.php"]],phpComment:[[/\*\//,"comment.php","@pop"],[/[^*]+/,"comment.php"],[/./,"comment.php"]],phpLineComment:[[/\?>/,{token:"@rematch",next:"@pop"}],[/.$/,"comment.php","@pop"],[/[^?]+$/,"comment.php","@pop"],[/[^?]+/,"comment.php"],[/./,"comment.php"]],phpDoubleQuoteString:[[/[^\\"]+/,"string.php"],[/@escapes/,"string.escape.php"],[/\\./,"string.escape.invalid.php"],[/"/,"string.php","@pop"]],phpSingleQuoteString:[[/[^\\']+/,"string.php"],[/@escapes/,"string.escape.php"],[/\\./,"string.escape.invalid.php"],[/'/,"string.php","@pop"]]},phpKeywords:["abstract","and","array","as","break","callable","case","catch","cfunction","class","clone","const","continue","declare","default","do","else","elseif","enddeclare","endfor","endforeach","endif","endswitch","endwhile","extends","false","final","for","foreach","function","global","goto","if","implements","interface","instanceof","insteadof","namespace","new","null","object","old_function","or","private","protected","public","resource","static","switch","throw","trait","try","true","use","var","while","xor","die","echo","empty","exit","eval","include","include_once","isset","list","require","require_once","return","print","unset","yield","__construct"],phpCompileTimeConstants:["__CLASS__","__DIR__","__FILE__","__LINE__","__NAMESPACE__","__METHOD__","__FUNCTION__","__TRAIT__"],phpPreDefinedVariables:["$GLOBALS","$_SERVER","$_GET","$_POST","$_FILES","$_REQUEST","$_SESSION","$_ENV","$_COOKIE","$php_errormsg","$HTTP_RAW_POST_DATA","$http_response_header","$argc","$argv"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/}}}]); \ No newline at end of file diff --git a/docs/42.42.js b/docs/42.42.js index cc86623db..c0be60fd3 100644 --- a/docs/42.42.js +++ b/docs/42.42.js @@ -1,733 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[42],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/postiats/postiats.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/postiats/postiats.js ***! - \********************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Artyom Shalkhakov. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Based on the ATS/Postiats lexer by Hongwei Xi. - *--------------------------------------------------------------------------------------------*/ -var conf = { - comments: { - lineComment: '//', - blockComment: ['(*', '*)'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'], - ['<', '>'] - ], - autoClosingPairs: [ - { open: '"', close: '"', notIn: ['string', 'comment'] }, - { open: '{', close: '}', notIn: ['string', 'comment'] }, - { open: '[', close: ']', notIn: ['string', 'comment'] }, - { open: '(', close: ')', notIn: ['string', 'comment'] } - ] -}; -var language = { - tokenPostfix: '.pats', - // TODO: staload and dynload are followed by a special kind of string literals - // with {$IDENTIFER} variables, and it also may make sense to highlight - // the punctuation (. and / and \) differently. - // Set defaultToken to invalid to see what you do not tokenize yet - defaultToken: 'invalid', - // keyword reference: https://github.com/githwxi/ATS-Postiats/blob/master/src/pats_lexing_token.dats - keywords: [ - // - 'abstype', - 'abst0ype', - 'absprop', - 'absview', - 'absvtype', - 'absviewtype', - 'absvt0ype', - 'absviewt0ype', - // - 'as', - // - 'and', - // - 'assume', - // - 'begin', - // - /* - "case", // CASE - */ - // - 'classdec', - // - 'datasort', - // - 'datatype', - 'dataprop', - 'dataview', - 'datavtype', - 'dataviewtype', - // - 'do', - // - 'end', - // - 'extern', - 'extype', - 'extvar', - // - 'exception', - // - 'fn', - 'fnx', - 'fun', - // - 'prfn', - 'prfun', - // - 'praxi', - 'castfn', - // - 'if', - 'then', - 'else', - // - 'ifcase', - // - 'in', - // - 'infix', - 'infixl', - 'infixr', - 'prefix', - 'postfix', - // - 'implmnt', - 'implement', - // - 'primplmnt', - 'primplement', - // - 'import', - // - /* - "lam", // LAM - "llam", // LLAM - "fix", // FIX - */ - // - 'let', - // - 'local', - // - 'macdef', - 'macrodef', - // - 'nonfix', - // - 'symelim', - 'symintr', - 'overload', - // - 'of', - 'op', - // - 'rec', - // - 'sif', - 'scase', - // - 'sortdef', - /* - // HX: [sta] is now deprecated - */ - 'sta', - 'stacst', - 'stadef', - 'static', - /* - "stavar", // T_STAVAR - */ - // - 'staload', - 'dynload', - // - 'try', - // - 'tkindef', - // - /* - "type", // TYPE - */ - 'typedef', - 'propdef', - 'viewdef', - 'vtypedef', - 'viewtypedef', - // - /* - "val", // VAL - */ - 'prval', - // - 'var', - 'prvar', - // - 'when', - 'where', - // - /* - "for", // T_FOR - "while", // T_WHILE - */ - // - 'with', - // - 'withtype', - 'withprop', - 'withview', - 'withvtype', - 'withviewtype' // WITHVIEWTYPE - // - ], - keywords_dlr: [ - '$delay', - '$ldelay', - // - '$arrpsz', - '$arrptrsize', - // - '$d2ctype', - // - '$effmask', - '$effmask_ntm', - '$effmask_exn', - '$effmask_ref', - '$effmask_wrt', - '$effmask_all', - // - '$extern', - '$extkind', - '$extype', - '$extype_struct', - // - '$extval', - '$extfcall', - '$extmcall', - // - '$literal', - // - '$myfilename', - '$mylocation', - '$myfunction', - // - '$lst', - '$lst_t', - '$lst_vt', - '$list', - '$list_t', - '$list_vt', - // - '$rec', - '$rec_t', - '$rec_vt', - '$record', - '$record_t', - '$record_vt', - // - '$tup', - '$tup_t', - '$tup_vt', - '$tuple', - '$tuple_t', - '$tuple_vt', - // - '$break', - '$continue', - // - '$raise', - // - '$showtype', - // - '$vcopyenv_v', - '$vcopyenv_vt', - // - '$tempenver', - // - '$solver_assert', - '$solver_verify' // T_DLRSOLVERIFY - ], - keywords_srp: [ - // - '#if', - '#ifdef', - '#ifndef', - // - '#then', - // - '#elif', - '#elifdef', - '#elifndef', - // - '#else', - '#endif', - // - '#error', - // - '#prerr', - '#print', - // - '#assert', - // - '#undef', - '#define', - // - '#include', - '#require', - // - '#pragma', - '#codegen2', - '#codegen3' // T_SRPCODEGEN3 // for level-3 codegen - // - // HX: end of special tokens - // - ], - irregular_keyword_list: [ - 'val+', - 'val-', - 'val', - 'case+', - 'case-', - 'case', - 'addr@', - 'addr', - 'fold@', - 'free@', - 'fix@', - 'fix', - 'lam@', - 'lam', - 'llam@', - 'llam', - 'viewt@ype+', - 'viewt@ype-', - 'viewt@ype', - 'viewtype+', - 'viewtype-', - 'viewtype', - 'view+', - 'view-', - 'view@', - 'view', - 'type+', - 'type-', - 'type', - 'vtype+', - 'vtype-', - 'vtype', - 'vt@ype+', - 'vt@ype-', - 'vt@ype', - 'viewt@ype+', - 'viewt@ype-', - 'viewt@ype', - 'viewtype+', - 'viewtype-', - 'viewtype', - 'prop+', - 'prop-', - 'prop', - 'type+', - 'type-', - 'type', - 't@ype', - 't@ype+', - 't@ype-', - 'abst@ype', - 'abstype', - 'absviewt@ype', - 'absvt@ype', - 'for*', - 'for', - 'while*', - 'while' - ], - keywords_types: [ - 'bool', - 'double', - 'byte', - 'int', - 'short', - 'char', - 'void', - 'unit', - 'long', - 'float', - 'string', - 'strptr' - ], - // TODO: reference for this? - keywords_effects: [ - '0', - 'fun', - 'clo', - 'prf', - 'funclo', - 'cloptr', - 'cloref', - 'ref', - 'ntm', - '1' // all effects - ], - operators: [ - '@', - '!', - '|', - '`', - ':', - '$', - '.', - '=', - '#', - '~', - // - '..', - '...', - // - '=>', - // "=<", // T_EQLT - '=<>', - '=/=>', - '=>>', - '=/=>>', - // - '<', - '>', - // - '><', - // - '.<', - '>.', - // - '.<>.', - // - '->', - //"-<", // T_MINUSLT - '-<>' // T_MINUSLTGT - // - /* - ":<", // T_COLONLT - */ - ], - brackets: [ - { open: ',(', close: ')', token: 'delimiter.parenthesis' }, - { open: '`(', close: ')', token: 'delimiter.parenthesis' }, - { open: '%(', close: ')', token: 'delimiter.parenthesis' }, - { open: "'(", close: ')', token: 'delimiter.parenthesis' }, - { open: "'{", close: '}', token: 'delimiter.parenthesis' }, - { open: '@(', close: ')', token: 'delimiter.parenthesis' }, - { open: '@{', close: '}', token: 'delimiter.brace' }, - { open: '@[', close: ']', token: 'delimiter.square' }, - { open: '#[', close: ']', token: 'delimiter.square' }, - { open: '{', close: '}', token: 'delimiter.curly' }, - { open: '[', close: ']', token: 'delimiter.square' }, - { open: '(', close: ')', token: 'delimiter.parenthesis' }, - { open: '<', close: '>', token: 'delimiter.angle' } - ], - // we include these common regular expressions - symbols: /[=>]/, - digit: /[0-9]/, - digitseq0: /@digit*/, - xdigit: /[0-9A-Za-z]/, - xdigitseq0: /@xdigit*/, - INTSP: /[lLuU]/, - FLOATSP: /[fFlL]/, - fexponent: /[eE][+-]?[0-9]+/, - fexponent_bin: /[pP][+-]?[0-9]+/, - deciexp: /\.[0-9]*@fexponent?/, - hexiexp: /\.[0-9a-zA-Z]*@fexponent_bin?/, - irregular_keywords: /val[+-]?|case[+-]?|addr\@?|fold\@|free\@|fix\@?|lam\@?|llam\@?|prop[+-]?|type[+-]?|view[+-@]?|viewt@?ype[+-]?|t@?ype[+-]?|v(iew)?t@?ype[+-]?|abst@?ype|absv(iew)?t@?ype|for\*?|while\*?/, - ESCHAR: /[ntvbrfa\\\?'"\(\[\{]/, - start: 'root', - // The main tokenizer for ATS/Postiats - // reference: https://github.com/githwxi/ATS-Postiats/blob/master/src/pats_lexing.dats - tokenizer: { - root: [ - // lexing_blankseq0 - { regex: /[ \t\r\n]+/, action: { token: '' } }, - // NOTE: (*) is an invalid ML-like comment! - { regex: /\(\*\)/, action: { token: 'invalid' } }, - { - regex: /\(\*/, - action: { token: 'comment', next: 'lexing_COMMENT_block_ml' } - }, - { - regex: /\(/, - action: '@brackets' /*{ token: 'delimiter.parenthesis' }*/ - }, - { - regex: /\)/, - action: '@brackets' /*{ token: 'delimiter.parenthesis' }*/ - }, - { - regex: /\[/, - action: '@brackets' /*{ token: 'delimiter.bracket' }*/ - }, - { - regex: /\]/, - action: '@brackets' /*{ token: 'delimiter.bracket' }*/ - }, - { - regex: /\{/, - action: '@brackets' /*{ token: 'delimiter.brace' }*/ - }, - { - regex: /\}/, - action: '@brackets' /*{ token: 'delimiter.brace' }*/ - }, - // lexing_COMMA - { - regex: /,\(/, - action: '@brackets' /*{ token: 'delimiter.parenthesis' }*/ - }, - { regex: /,/, action: { token: 'delimiter.comma' } }, - { regex: /;/, action: { token: 'delimiter.semicolon' } }, - // lexing_AT - { - regex: /@\(/, - action: '@brackets' /* { token: 'delimiter.parenthesis' }*/ - }, - { - regex: /@\[/, - action: '@brackets' /* { token: 'delimiter.bracket' }*/ - }, - { - regex: /@\{/, - action: '@brackets' /*{ token: 'delimiter.brace' }*/ - }, - // lexing_COLON - { - regex: /: lexing_IDENT_sym - . FLOATDOT => lexing_FLOAT_deciexp - . DIGIT => T_DOTINT - */ - { regex: /\.@symbolic+/, action: { token: 'identifier.sym' } }, - // FLOATDOT case - { - regex: /\.@digit*@fexponent@FLOATSP*/, - action: { token: 'number.float' } - }, - { regex: /\.@digit+/, action: { token: 'number.float' } }, - // lexing_DOLLAR: - // '$' IDENTFST IDENTRST* => lexing_IDENT_dlr, _ => lexing_IDENT_sym - { - regex: /\$@IDENTFST@IDENTRST*/, - action: { - cases: { - '@keywords_dlr': { token: 'keyword.dlr' }, - '@default': { token: 'namespace' } // most likely a module qualifier - } - } - }, - // lexing_SHARP: - // '#' IDENTFST IDENTRST* => lexing_ident_srp, _ => lexing_IDENT_sym - { - regex: /\#@IDENTFST@IDENTRST*/, - action: { - cases: { - '@keywords_srp': { token: 'keyword.srp' }, - '@default': { token: 'identifier' } - } - } - }, - // lexing_PERCENT: - { regex: /%\(/, action: { token: 'delimiter.parenthesis' } }, - { - regex: /^%{(#|\^|\$)?/, - action: { - token: 'keyword', - next: '@lexing_EXTCODE', - nextEmbedded: 'text/javascript' - } - }, - { regex: /^%}/, action: { token: 'keyword' } }, - // lexing_QUOTE - { regex: /'\(/, action: { token: 'delimiter.parenthesis' } }, - { regex: /'\[/, action: { token: 'delimiter.bracket' } }, - { regex: /'\{/, action: { token: 'delimiter.brace' } }, - [/(')(\\@ESCHAR|\\[xX]@xdigit+|\\@digit+)(')/, ['string', 'string.escape', 'string']], - [/'[^\\']'/, 'string'], - // lexing_DQUOTE - [/"/, 'string.quote', '@lexing_DQUOTE'], - // lexing_BQUOTE - { - regex: /`\(/, - action: '@brackets' /* { token: 'delimiter.parenthesis' }*/ - }, - // TODO: otherwise, try lexing_IDENT_sym - { regex: /\\/, action: { token: 'punctuation' } }, - // lexing_IDENT_alp: - // NOTE: (?!regex) is syntax for "not-followed-by" regex - // to resolve ambiguity such as foreach$fwork being incorrectly lexed as [for] [each$fwork]! - { - regex: /@irregular_keywords(?!@IDENTRST)/, - action: { token: 'keyword' } - }, - { - regex: /@IDENTFST@IDENTRST*[ punctuation - // ({\$)([a-zA-Z_][a-zA-Z_0-9]*)(}) => punctuation,keyword,punctuation - // [^"] => identifier/literal - '@keywords': { token: 'keyword' }, - '@keywords_types': { token: 'type' }, - '@default': { token: 'identifier' } - } - } - }, - // lexing_IDENT_sym: - { - regex: /\/\/\/\//, - action: { token: 'comment', next: '@lexing_COMMENT_rest' } - }, - { regex: /\/\/.*$/, action: { token: 'comment' } }, - { - regex: /\/\*/, - action: { token: 'comment', next: '@lexing_COMMENT_block_c' } - }, - // AS-20160627: specifically for effect annotations - { - regex: /-<|= lexing_FLOAT_hexiexp - // - testing_fexponent_bin => lexing_FLOAT_hexiexp - // - testing_intspseq0 => T_INT_hex - // lexing_INT_hex: - { - regex: /0[xX]@xdigit+(@hexiexp|@fexponent_bin)@FLOATSP*/, - action: { token: 'number.float' } - }, - { regex: /0[xX]@xdigit+@INTSP*/, action: { token: 'number.hex' } }, - { - regex: /0[0-7]+(?![0-9])@INTSP*/, - action: { token: 'number.octal' } - }, - //{regex: /0/, action: { token: 'number' } }, // INTZERO - // lexing_INT_dec: - // - testing_deciexp => lexing_FLOAT_deciexp - // - testing_fexponent => lexing_FLOAT_deciexp - // - otherwise => intspseq0 ([0-9]*[lLuU]?) - { - regex: /@digit+(@fexponent|@deciexp)@FLOATSP*/, - action: { token: 'number.float' } - }, - { - regex: /@digit@digitseq0@INTSP*/, - action: { token: 'number.decimal' } - }, - // DIGIT, if followed by digitseq0, is lexing_INT_dec - { regex: /@digit+@INTSP*/, action: { token: 'number' } } - ], - lexing_COMMENT_block_ml: [ - [/[^\(\*]+/, 'comment'], - [/\(\*/, 'comment', '@push'], - [/\(\*/, 'comment.invalid'], - [/\*\)/, 'comment', '@pop'], - [/\*/, 'comment'] - ], - lexing_COMMENT_block_c: [ - [/[^\/*]+/, 'comment'], - // [/\/\*/, 'comment', '@push' ], // nested C-style block comments not allowed - // [/\/\*/, 'comment.invalid' ], // NOTE: this breaks block comments in the shape of /* //*/ - [/\*\//, 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - lexing_COMMENT_rest: [ - [/$/, 'comment', '@pop'], - [/.*/, 'comment'] - ], - // NOTE: added by AS, specifically for highlighting - lexing_EFFECT_commaseq0: [ - { - regex: /@IDENTFST@IDENTRST+|@digit+/, - action: { - cases: { - '@keywords_effects': { token: 'type.effect' }, - '@default': { token: 'identifier' } - } - } - }, - { regex: /,/, action: { token: 'punctuation' } }, - { regex: />/, action: { token: '@rematch', next: '@pop' } } - ], - lexing_EXTCODE: [ - { - regex: /^%}/, - action: { - token: '@rematch', - next: '@pop', - nextEmbedded: '@pop' - } - }, - { regex: /[^%]+/, action: '' } - ], - lexing_DQUOTE: [ - { regex: /"/, action: { token: 'string.quote', next: '@pop' } }, - // AS-20160628: additional hi-lighting for variables in staload/dynload strings - { - regex: /(\{\$)(@IDENTFST@IDENTRST*)(\})/, - action: [ - { token: 'string.escape' }, - { token: 'identifier' }, - { token: 'string.escape' } - ] - }, - { regex: /\\$/, action: { token: 'string.escape' } }, - { - regex: /\\(@ESCHAR|[xX]@xdigit+|@digit+)/, - action: { token: 'string.escape' } - }, - { regex: /[^\\"]+/, action: { token: 'string' } } - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=42.42.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{948:function(e,t,n){"use strict";n.r(t),n.d(t,"conf",(function(){return i})),n.d(t,"language",(function(){return o}));var i={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]}]},o={tokenPostfix:".pats",defaultToken:"invalid",keywords:["abstype","abst0ype","absprop","absview","absvtype","absviewtype","absvt0ype","absviewt0ype","as","and","assume","begin","classdec","datasort","datatype","dataprop","dataview","datavtype","dataviewtype","do","end","extern","extype","extvar","exception","fn","fnx","fun","prfn","prfun","praxi","castfn","if","then","else","ifcase","in","infix","infixl","infixr","prefix","postfix","implmnt","implement","primplmnt","primplement","import","let","local","macdef","macrodef","nonfix","symelim","symintr","overload","of","op","rec","sif","scase","sortdef","sta","stacst","stadef","static","staload","dynload","try","tkindef","typedef","propdef","viewdef","vtypedef","viewtypedef","prval","var","prvar","when","where","with","withtype","withprop","withview","withvtype","withviewtype"],keywords_dlr:["$delay","$ldelay","$arrpsz","$arrptrsize","$d2ctype","$effmask","$effmask_ntm","$effmask_exn","$effmask_ref","$effmask_wrt","$effmask_all","$extern","$extkind","$extype","$extype_struct","$extval","$extfcall","$extmcall","$literal","$myfilename","$mylocation","$myfunction","$lst","$lst_t","$lst_vt","$list","$list_t","$list_vt","$rec","$rec_t","$rec_vt","$record","$record_t","$record_vt","$tup","$tup_t","$tup_vt","$tuple","$tuple_t","$tuple_vt","$break","$continue","$raise","$showtype","$vcopyenv_v","$vcopyenv_vt","$tempenver","$solver_assert","$solver_verify"],keywords_srp:["#if","#ifdef","#ifndef","#then","#elif","#elifdef","#elifndef","#else","#endif","#error","#prerr","#print","#assert","#undef","#define","#include","#require","#pragma","#codegen2","#codegen3"],irregular_keyword_list:["val+","val-","val","case+","case-","case","addr@","addr","fold@","free@","fix@","fix","lam@","lam","llam@","llam","viewt@ype+","viewt@ype-","viewt@ype","viewtype+","viewtype-","viewtype","view+","view-","view@","view","type+","type-","type","vtype+","vtype-","vtype","vt@ype+","vt@ype-","vt@ype","viewt@ype+","viewt@ype-","viewt@ype","viewtype+","viewtype-","viewtype","prop+","prop-","prop","type+","type-","type","t@ype","t@ype+","t@ype-","abst@ype","abstype","absviewt@ype","absvt@ype","for*","for","while*","while"],keywords_types:["bool","double","byte","int","short","char","void","unit","long","float","string","strptr"],keywords_effects:["0","fun","clo","prf","funclo","cloptr","cloref","ref","ntm","1"],operators:["@","!","|","`",":","$",".","=","#","~","..","...","=>","=<>","=/=>","=>>","=/=>>","<",">","><",".<",">.",".<>.","->","-<>"],brackets:[{open:",(",close:")",token:"delimiter.parenthesis"},{open:"`(",close:")",token:"delimiter.parenthesis"},{open:"%(",close:")",token:"delimiter.parenthesis"},{open:"'(",close:")",token:"delimiter.parenthesis"},{open:"'{",close:"}",token:"delimiter.parenthesis"},{open:"@(",close:")",token:"delimiter.parenthesis"},{open:"@{",close:"}",token:"delimiter.brace"},{open:"@[",close:"]",token:"delimiter.square"},{open:"#[",close:"]",token:"delimiter.square"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],symbols:/[=>]/,digit:/[0-9]/,digitseq0:/@digit*/,xdigit:/[0-9A-Za-z]/,xdigitseq0:/@xdigit*/,INTSP:/[lLuU]/,FLOATSP:/[fFlL]/,fexponent:/[eE][+-]?[0-9]+/,fexponent_bin:/[pP][+-]?[0-9]+/,deciexp:/\.[0-9]*@fexponent?/,hexiexp:/\.[0-9a-zA-Z]*@fexponent_bin?/,irregular_keywords:/val[+-]?|case[+-]?|addr\@?|fold\@|free\@|fix\@?|lam\@?|llam\@?|prop[+-]?|type[+-]?|view[+-@]?|viewt@?ype[+-]?|t@?ype[+-]?|v(iew)?t@?ype[+-]?|abst@?ype|absv(iew)?t@?ype|for\*?|while\*?/,ESCHAR:/[ntvbrfa\\\?'"\(\[\{]/,start:"root",tokenizer:{root:[{regex:/[ \t\r\n]+/,action:{token:""}},{regex:/\(\*\)/,action:{token:"invalid"}},{regex:/\(\*/,action:{token:"comment",next:"lexing_COMMENT_block_ml"}},{regex:/\(/,action:"@brackets"},{regex:/\)/,action:"@brackets"},{regex:/\[/,action:"@brackets"},{regex:/\]/,action:"@brackets"},{regex:/\{/,action:"@brackets"},{regex:/\}/,action:"@brackets"},{regex:/,\(/,action:"@brackets"},{regex:/,/,action:{token:"delimiter.comma"}},{regex:/;/,action:{token:"delimiter.semicolon"}},{regex:/@\(/,action:"@brackets"},{regex:/@\[/,action:"@brackets"},{regex:/@\{/,action:"@brackets"},{regex:/:/,action:{token:"@rematch",next:"@pop"}}],lexing_EXTCODE:[{regex:/^%}/,action:{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}},{regex:/[^%]+/,action:""}],lexing_DQUOTE:[{regex:/"/,action:{token:"string.quote",next:"@pop"}},{regex:/(\{\$)(@IDENTFST@IDENTRST*)(\})/,action:[{token:"string.escape"},{token:"identifier"},{token:"string.escape"}]},{regex:/\\$/,action:{token:"string.escape"}},{regex:/\\(@ESCHAR|[xX]@xdigit+|@digit+)/,action:{token:"string.escape"}},{regex:/[^\\"]+/,action:{token:"string"}}]}}}}]); \ No newline at end of file diff --git a/docs/43.43.js b/docs/43.43.js index 3c2b8aded..4af28bb08 100644 --- a/docs/43.43.js +++ b/docs/43.43.js @@ -1,918 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[43],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/powerquery/powerquery.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/powerquery/powerquery.js ***! - \************************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - comments: { - lineComment: '//', - blockComment: ['/*', '*/'] - }, - brackets: [ - ['[', ']'], - ['(', ')'], - ['{', '}'] - ], - autoClosingPairs: [ - { open: '"', close: '"', notIn: ['string', 'comment', 'identifier'] }, - { open: '[', close: ']', notIn: ['string', 'comment', 'identifier'] }, - { open: '(', close: ')', notIn: ['string', 'comment', 'identifier'] }, - { open: '{', close: '}', notIn: ['string', 'comment', 'identifier'] } - ] -}; -var language = { - defaultToken: '', - tokenPostfix: '.pq', - ignoreCase: false, - brackets: [ - { open: '[', close: ']', token: 'delimiter.square' }, - { open: '{', close: '}', token: 'delimiter.brackets' }, - { open: '(', close: ')', token: 'delimiter.parenthesis' } - ], - operatorKeywords: ['and', 'not', 'or'], - keywords: [ - 'as', - 'each', - 'else', - 'error', - 'false', - 'if', - 'in', - 'is', - 'let', - 'meta', - 'otherwise', - 'section', - 'shared', - 'then', - 'true', - 'try', - 'type' - ], - constructors: [ - '#binary', - '#date', - '#datetime', - '#datetimezone', - '#duration', - '#table', - '#time' - ], - constants: ['#infinity', '#nan', '#sections', '#shared'], - typeKeywords: [ - 'action', - 'any', - 'anynonnull', - 'none', - 'null', - 'logical', - 'number', - 'time', - 'date', - 'datetime', - 'datetimezone', - 'duration', - 'text', - 'binary', - 'list', - 'record', - 'table', - 'function' - ], - builtinFunctions: [ - 'Access.Database', - 'Action.Return', - 'Action.Sequence', - 'Action.Try', - 'ActiveDirectory.Domains', - 'AdoDotNet.DataSource', - 'AdoDotNet.Query', - 'AdobeAnalytics.Cubes', - 'AnalysisServices.Database', - 'AnalysisServices.Databases', - 'AzureStorage.BlobContents', - 'AzureStorage.Blobs', - 'AzureStorage.Tables', - 'Binary.Buffer', - 'Binary.Combine', - 'Binary.Compress', - 'Binary.Decompress', - 'Binary.End', - 'Binary.From', - 'Binary.FromList', - 'Binary.FromText', - 'Binary.InferContentType', - 'Binary.Length', - 'Binary.ToList', - 'Binary.ToText', - 'BinaryFormat.7BitEncodedSignedInteger', - 'BinaryFormat.7BitEncodedUnsignedInteger', - 'BinaryFormat.Binary', - 'BinaryFormat.Byte', - 'BinaryFormat.ByteOrder', - 'BinaryFormat.Choice', - 'BinaryFormat.Decimal', - 'BinaryFormat.Double', - 'BinaryFormat.Group', - 'BinaryFormat.Length', - 'BinaryFormat.List', - 'BinaryFormat.Null', - 'BinaryFormat.Record', - 'BinaryFormat.SignedInteger16', - 'BinaryFormat.SignedInteger32', - 'BinaryFormat.SignedInteger64', - 'BinaryFormat.Single', - 'BinaryFormat.Text', - 'BinaryFormat.Transform', - 'BinaryFormat.UnsignedInteger16', - 'BinaryFormat.UnsignedInteger32', - 'BinaryFormat.UnsignedInteger64', - 'Byte.From', - 'Character.FromNumber', - 'Character.ToNumber', - 'Combiner.CombineTextByDelimiter', - 'Combiner.CombineTextByEachDelimiter', - 'Combiner.CombineTextByLengths', - 'Combiner.CombineTextByPositions', - 'Combiner.CombineTextByRanges', - 'Comparer.Equals', - 'Comparer.FromCulture', - 'Comparer.Ordinal', - 'Comparer.OrdinalIgnoreCase', - 'Csv.Document', - 'Cube.AddAndExpandDimensionColumn', - 'Cube.AddMeasureColumn', - 'Cube.ApplyParameter', - 'Cube.AttributeMemberId', - 'Cube.AttributeMemberProperty', - 'Cube.CollapseAndRemoveColumns', - 'Cube.Dimensions', - 'Cube.DisplayFolders', - 'Cube.Measures', - 'Cube.Parameters', - 'Cube.Properties', - 'Cube.PropertyKey', - 'Cube.ReplaceDimensions', - 'Cube.Transform', - 'Currency.From', - 'DB2.Database', - 'Date.AddDays', - 'Date.AddMonths', - 'Date.AddQuarters', - 'Date.AddWeeks', - 'Date.AddYears', - 'Date.Day', - 'Date.DayOfWeek', - 'Date.DayOfWeekName', - 'Date.DayOfYear', - 'Date.DaysInMonth', - 'Date.EndOfDay', - 'Date.EndOfMonth', - 'Date.EndOfQuarter', - 'Date.EndOfWeek', - 'Date.EndOfYear', - 'Date.From', - 'Date.FromText', - 'Date.IsInCurrentDay', - 'Date.IsInCurrentMonth', - 'Date.IsInCurrentQuarter', - 'Date.IsInCurrentWeek', - 'Date.IsInCurrentYear', - 'Date.IsInNextDay', - 'Date.IsInNextMonth', - 'Date.IsInNextNDays', - 'Date.IsInNextNMonths', - 'Date.IsInNextNQuarters', - 'Date.IsInNextNWeeks', - 'Date.IsInNextNYears', - 'Date.IsInNextQuarter', - 'Date.IsInNextWeek', - 'Date.IsInNextYear', - 'Date.IsInPreviousDay', - 'Date.IsInPreviousMonth', - 'Date.IsInPreviousNDays', - 'Date.IsInPreviousNMonths', - 'Date.IsInPreviousNQuarters', - 'Date.IsInPreviousNWeeks', - 'Date.IsInPreviousNYears', - 'Date.IsInPreviousQuarter', - 'Date.IsInPreviousWeek', - 'Date.IsInPreviousYear', - 'Date.IsInYearToDate', - 'Date.IsLeapYear', - 'Date.Month', - 'Date.MonthName', - 'Date.QuarterOfYear', - 'Date.StartOfDay', - 'Date.StartOfMonth', - 'Date.StartOfQuarter', - 'Date.StartOfWeek', - 'Date.StartOfYear', - 'Date.ToRecord', - 'Date.ToText', - 'Date.WeekOfMonth', - 'Date.WeekOfYear', - 'Date.Year', - 'DateTime.AddZone', - 'DateTime.Date', - 'DateTime.FixedLocalNow', - 'DateTime.From', - 'DateTime.FromFileTime', - 'DateTime.FromText', - 'DateTime.IsInCurrentHour', - 'DateTime.IsInCurrentMinute', - 'DateTime.IsInCurrentSecond', - 'DateTime.IsInNextHour', - 'DateTime.IsInNextMinute', - 'DateTime.IsInNextNHours', - 'DateTime.IsInNextNMinutes', - 'DateTime.IsInNextNSeconds', - 'DateTime.IsInNextSecond', - 'DateTime.IsInPreviousHour', - 'DateTime.IsInPreviousMinute', - 'DateTime.IsInPreviousNHours', - 'DateTime.IsInPreviousNMinutes', - 'DateTime.IsInPreviousNSeconds', - 'DateTime.IsInPreviousSecond', - 'DateTime.LocalNow', - 'DateTime.Time', - 'DateTime.ToRecord', - 'DateTime.ToText', - 'DateTimeZone.FixedLocalNow', - 'DateTimeZone.FixedUtcNow', - 'DateTimeZone.From', - 'DateTimeZone.FromFileTime', - 'DateTimeZone.FromText', - 'DateTimeZone.LocalNow', - 'DateTimeZone.RemoveZone', - 'DateTimeZone.SwitchZone', - 'DateTimeZone.ToLocal', - 'DateTimeZone.ToRecord', - 'DateTimeZone.ToText', - 'DateTimeZone.ToUtc', - 'DateTimeZone.UtcNow', - 'DateTimeZone.ZoneHours', - 'DateTimeZone.ZoneMinutes', - 'Decimal.From', - 'Diagnostics.ActivityId', - 'Diagnostics.Trace', - 'DirectQueryCapabilities.From', - 'Double.From', - 'Duration.Days', - 'Duration.From', - 'Duration.FromText', - 'Duration.Hours', - 'Duration.Minutes', - 'Duration.Seconds', - 'Duration.ToRecord', - 'Duration.ToText', - 'Duration.TotalDays', - 'Duration.TotalHours', - 'Duration.TotalMinutes', - 'Duration.TotalSeconds', - 'Embedded.Value', - 'Error.Record', - 'Excel.CurrentWorkbook', - 'Excel.Workbook', - 'Exchange.Contents', - 'Expression.Constant', - 'Expression.Evaluate', - 'Expression.Identifier', - 'Facebook.Graph', - 'File.Contents', - 'Folder.Contents', - 'Folder.Files', - 'Function.From', - 'Function.Invoke', - 'Function.InvokeAfter', - 'Function.IsDataSource', - 'GoogleAnalytics.Accounts', - 'Guid.From', - 'HdInsight.Containers', - 'HdInsight.Contents', - 'HdInsight.Files', - 'Hdfs.Contents', - 'Hdfs.Files', - 'Informix.Database', - 'Int16.From', - 'Int32.From', - 'Int64.From', - 'Int8.From', - 'ItemExpression.From', - 'Json.Document', - 'Json.FromValue', - 'Lines.FromBinary', - 'Lines.FromText', - 'Lines.ToBinary', - 'Lines.ToText', - 'List.Accumulate', - 'List.AllTrue', - 'List.Alternate', - 'List.AnyTrue', - 'List.Average', - 'List.Buffer', - 'List.Combine', - 'List.Contains', - 'List.ContainsAll', - 'List.ContainsAny', - 'List.Count', - 'List.Covariance', - 'List.DateTimeZones', - 'List.DateTimes', - 'List.Dates', - 'List.Difference', - 'List.Distinct', - 'List.Durations', - 'List.FindText', - 'List.First', - 'List.FirstN', - 'List.Generate', - 'List.InsertRange', - 'List.Intersect', - 'List.IsDistinct', - 'List.IsEmpty', - 'List.Last', - 'List.LastN', - 'List.MatchesAll', - 'List.MatchesAny', - 'List.Max', - 'List.MaxN', - 'List.Median', - 'List.Min', - 'List.MinN', - 'List.Mode', - 'List.Modes', - 'List.NonNullCount', - 'List.Numbers', - 'List.PositionOf', - 'List.PositionOfAny', - 'List.Positions', - 'List.Product', - 'List.Random', - 'List.Range', - 'List.RemoveFirstN', - 'List.RemoveItems', - 'List.RemoveLastN', - 'List.RemoveMatchingItems', - 'List.RemoveNulls', - 'List.RemoveRange', - 'List.Repeat', - 'List.ReplaceMatchingItems', - 'List.ReplaceRange', - 'List.ReplaceValue', - 'List.Reverse', - 'List.Select', - 'List.Single', - 'List.SingleOrDefault', - 'List.Skip', - 'List.Sort', - 'List.StandardDeviation', - 'List.Sum', - 'List.Times', - 'List.Transform', - 'List.TransformMany', - 'List.Union', - 'List.Zip', - 'Logical.From', - 'Logical.FromText', - 'Logical.ToText', - 'MQ.Queue', - 'MySQL.Database', - 'Number.Abs', - 'Number.Acos', - 'Number.Asin', - 'Number.Atan', - 'Number.Atan2', - 'Number.BitwiseAnd', - 'Number.BitwiseNot', - 'Number.BitwiseOr', - 'Number.BitwiseShiftLeft', - 'Number.BitwiseShiftRight', - 'Number.BitwiseXor', - 'Number.Combinations', - 'Number.Cos', - 'Number.Cosh', - 'Number.Exp', - 'Number.Factorial', - 'Number.From', - 'Number.FromText', - 'Number.IntegerDivide', - 'Number.IsEven', - 'Number.IsNaN', - 'Number.IsOdd', - 'Number.Ln', - 'Number.Log', - 'Number.Log10', - 'Number.Mod', - 'Number.Permutations', - 'Number.Power', - 'Number.Random', - 'Number.RandomBetween', - 'Number.Round', - 'Number.RoundAwayFromZero', - 'Number.RoundDown', - 'Number.RoundTowardZero', - 'Number.RoundUp', - 'Number.Sign', - 'Number.Sin', - 'Number.Sinh', - 'Number.Sqrt', - 'Number.Tan', - 'Number.Tanh', - 'Number.ToText', - 'OData.Feed', - 'Odbc.DataSource', - 'Odbc.Query', - 'OleDb.DataSource', - 'OleDb.Query', - 'Oracle.Database', - 'Percentage.From', - 'PostgreSQL.Database', - 'RData.FromBinary', - 'Record.AddField', - 'Record.Combine', - 'Record.Field', - 'Record.FieldCount', - 'Record.FieldNames', - 'Record.FieldOrDefault', - 'Record.FieldValues', - 'Record.FromList', - 'Record.FromTable', - 'Record.HasFields', - 'Record.RemoveFields', - 'Record.RenameFields', - 'Record.ReorderFields', - 'Record.SelectFields', - 'Record.ToList', - 'Record.ToTable', - 'Record.TransformFields', - 'Replacer.ReplaceText', - 'Replacer.ReplaceValue', - 'RowExpression.Column', - 'RowExpression.From', - 'Salesforce.Data', - 'Salesforce.Reports', - 'SapBusinessWarehouse.Cubes', - 'SapHana.Database', - 'SharePoint.Contents', - 'SharePoint.Files', - 'SharePoint.Tables', - 'Single.From', - 'Soda.Feed', - 'Splitter.SplitByNothing', - 'Splitter.SplitTextByAnyDelimiter', - 'Splitter.SplitTextByDelimiter', - 'Splitter.SplitTextByEachDelimiter', - 'Splitter.SplitTextByLengths', - 'Splitter.SplitTextByPositions', - 'Splitter.SplitTextByRanges', - 'Splitter.SplitTextByRepeatedLengths', - 'Splitter.SplitTextByWhitespace', - 'Sql.Database', - 'Sql.Databases', - 'SqlExpression.SchemaFrom', - 'SqlExpression.ToExpression', - 'Sybase.Database', - 'Table.AddColumn', - 'Table.AddIndexColumn', - 'Table.AddJoinColumn', - 'Table.AddKey', - 'Table.AggregateTableColumn', - 'Table.AlternateRows', - 'Table.Buffer', - 'Table.Column', - 'Table.ColumnCount', - 'Table.ColumnNames', - 'Table.ColumnsOfType', - 'Table.Combine', - 'Table.CombineColumns', - 'Table.Contains', - 'Table.ContainsAll', - 'Table.ContainsAny', - 'Table.DemoteHeaders', - 'Table.Distinct', - 'Table.DuplicateColumn', - 'Table.ExpandListColumn', - 'Table.ExpandRecordColumn', - 'Table.ExpandTableColumn', - 'Table.FillDown', - 'Table.FillUp', - 'Table.FilterWithDataTable', - 'Table.FindText', - 'Table.First', - 'Table.FirstN', - 'Table.FirstValue', - 'Table.FromColumns', - 'Table.FromList', - 'Table.FromPartitions', - 'Table.FromRecords', - 'Table.FromRows', - 'Table.FromValue', - 'Table.Group', - 'Table.HasColumns', - 'Table.InsertRows', - 'Table.IsDistinct', - 'Table.IsEmpty', - 'Table.Join', - 'Table.Keys', - 'Table.Last', - 'Table.LastN', - 'Table.MatchesAllRows', - 'Table.MatchesAnyRows', - 'Table.Max', - 'Table.MaxN', - 'Table.Min', - 'Table.MinN', - 'Table.NestedJoin', - 'Table.Partition', - 'Table.PartitionValues', - 'Table.Pivot', - 'Table.PositionOf', - 'Table.PositionOfAny', - 'Table.PrefixColumns', - 'Table.Profile', - 'Table.PromoteHeaders', - 'Table.Range', - 'Table.RemoveColumns', - 'Table.RemoveFirstN', - 'Table.RemoveLastN', - 'Table.RemoveMatchingRows', - 'Table.RemoveRows', - 'Table.RemoveRowsWithErrors', - 'Table.RenameColumns', - 'Table.ReorderColumns', - 'Table.Repeat', - 'Table.ReplaceErrorValues', - 'Table.ReplaceKeys', - 'Table.ReplaceMatchingRows', - 'Table.ReplaceRelationshipIdentity', - 'Table.ReplaceRows', - 'Table.ReplaceValue', - 'Table.ReverseRows', - 'Table.RowCount', - 'Table.Schema', - 'Table.SelectColumns', - 'Table.SelectRows', - 'Table.SelectRowsWithErrors', - 'Table.SingleRow', - 'Table.Skip', - 'Table.Sort', - 'Table.SplitColumn', - 'Table.ToColumns', - 'Table.ToList', - 'Table.ToRecords', - 'Table.ToRows', - 'Table.TransformColumnNames', - 'Table.TransformColumnTypes', - 'Table.TransformColumns', - 'Table.TransformRows', - 'Table.Transpose', - 'Table.Unpivot', - 'Table.UnpivotOtherColumns', - 'Table.View', - 'Table.ViewFunction', - 'TableAction.DeleteRows', - 'TableAction.InsertRows', - 'TableAction.UpdateRows', - 'Tables.GetRelationships', - 'Teradata.Database', - 'Text.AfterDelimiter', - 'Text.At', - 'Text.BeforeDelimiter', - 'Text.BetweenDelimiters', - 'Text.Clean', - 'Text.Combine', - 'Text.Contains', - 'Text.End', - 'Text.EndsWith', - 'Text.Format', - 'Text.From', - 'Text.FromBinary', - 'Text.Insert', - 'Text.Length', - 'Text.Lower', - 'Text.Middle', - 'Text.NewGuid', - 'Text.PadEnd', - 'Text.PadStart', - 'Text.PositionOf', - 'Text.PositionOfAny', - 'Text.Proper', - 'Text.Range', - 'Text.Remove', - 'Text.RemoveRange', - 'Text.Repeat', - 'Text.Replace', - 'Text.ReplaceRange', - 'Text.Select', - 'Text.Split', - 'Text.SplitAny', - 'Text.Start', - 'Text.StartsWith', - 'Text.ToBinary', - 'Text.ToList', - 'Text.Trim', - 'Text.TrimEnd', - 'Text.TrimStart', - 'Text.Upper', - 'Time.EndOfHour', - 'Time.From', - 'Time.FromText', - 'Time.Hour', - 'Time.Minute', - 'Time.Second', - 'Time.StartOfHour', - 'Time.ToRecord', - 'Time.ToText', - 'Type.AddTableKey', - 'Type.ClosedRecord', - 'Type.Facets', - 'Type.ForFunction', - 'Type.ForRecord', - 'Type.FunctionParameters', - 'Type.FunctionRequiredParameters', - 'Type.FunctionReturn', - 'Type.Is', - 'Type.IsNullable', - 'Type.IsOpenRecord', - 'Type.ListItem', - 'Type.NonNullable', - 'Type.OpenRecord', - 'Type.RecordFields', - 'Type.ReplaceFacets', - 'Type.ReplaceTableKeys', - 'Type.TableColumn', - 'Type.TableKeys', - 'Type.TableRow', - 'Type.TableSchema', - 'Type.Union', - 'Uri.BuildQueryString', - 'Uri.Combine', - 'Uri.EscapeDataString', - 'Uri.Parts', - 'Value.Add', - 'Value.As', - 'Value.Compare', - 'Value.Divide', - 'Value.Equals', - 'Value.Firewall', - 'Value.FromText', - 'Value.Is', - 'Value.Metadata', - 'Value.Multiply', - 'Value.NativeQuery', - 'Value.NullableEquals', - 'Value.RemoveMetadata', - 'Value.ReplaceMetadata', - 'Value.ReplaceType', - 'Value.Subtract', - 'Value.Type', - 'ValueAction.NativeStatement', - 'ValueAction.Replace', - 'Variable.Value', - 'Web.Contents', - 'Web.Page', - 'WebAction.Request', - 'Xml.Document', - 'Xml.Tables' - ], - builtinConstants: [ - 'BinaryEncoding.Base64', - 'BinaryEncoding.Hex', - 'BinaryOccurrence.Optional', - 'BinaryOccurrence.Repeating', - 'BinaryOccurrence.Required', - 'ByteOrder.BigEndian', - 'ByteOrder.LittleEndian', - 'Compression.Deflate', - 'Compression.GZip', - 'CsvStyle.QuoteAfterDelimiter', - 'CsvStyle.QuoteAlways', - 'Culture.Current', - 'Day.Friday', - 'Day.Monday', - 'Day.Saturday', - 'Day.Sunday', - 'Day.Thursday', - 'Day.Tuesday', - 'Day.Wednesday', - 'ExtraValues.Error', - 'ExtraValues.Ignore', - 'ExtraValues.List', - 'GroupKind.Global', - 'GroupKind.Local', - 'JoinAlgorithm.Dynamic', - 'JoinAlgorithm.LeftHash', - 'JoinAlgorithm.LeftIndex', - 'JoinAlgorithm.PairwiseHash', - 'JoinAlgorithm.RightHash', - 'JoinAlgorithm.RightIndex', - 'JoinAlgorithm.SortMerge', - 'JoinKind.FullOuter', - 'JoinKind.Inner', - 'JoinKind.LeftAnti', - 'JoinKind.LeftOuter', - 'JoinKind.RightAnti', - 'JoinKind.RightOuter', - 'JoinSide.Left', - 'JoinSide.Right', - 'MissingField.Error', - 'MissingField.Ignore', - 'MissingField.UseNull', - 'Number.E', - 'Number.Epsilon', - 'Number.NaN', - 'Number.NegativeInfinity', - 'Number.PI', - 'Number.PositiveInfinity', - 'Occurrence.All', - 'Occurrence.First', - 'Occurrence.Last', - 'Occurrence.Optional', - 'Occurrence.Repeating', - 'Occurrence.Required', - 'Order.Ascending', - 'Order.Descending', - 'Precision.Decimal', - 'Precision.Double', - 'QuoteStyle.Csv', - 'QuoteStyle.None', - 'RelativePosition.FromEnd', - 'RelativePosition.FromStart', - 'RoundingMode.AwayFromZero', - 'RoundingMode.Down', - 'RoundingMode.ToEven', - 'RoundingMode.TowardZero', - 'RoundingMode.Up', - 'SapHanaDistribution.All', - 'SapHanaDistribution.Connection', - 'SapHanaDistribution.Off', - 'SapHanaDistribution.Statement', - 'SapHanaRangeOperator.Equals', - 'SapHanaRangeOperator.GreaterThan', - 'SapHanaRangeOperator.GreaterThanOrEquals', - 'SapHanaRangeOperator.LessThan', - 'SapHanaRangeOperator.LessThanOrEquals', - 'SapHanaRangeOperator.NotEquals', - 'TextEncoding.Ascii', - 'TextEncoding.BigEndianUnicode', - 'TextEncoding.Unicode', - 'TextEncoding.Utf16', - 'TextEncoding.Utf8', - 'TextEncoding.Windows', - 'TraceLevel.Critical', - 'TraceLevel.Error', - 'TraceLevel.Information', - 'TraceLevel.Verbose', - 'TraceLevel.Warning', - 'WebMethod.Delete', - 'WebMethod.Get', - 'WebMethod.Head', - 'WebMethod.Patch', - 'WebMethod.Post', - 'WebMethod.Put' - ], - builtinTypes: [ - 'Action.Type', - 'Any.Type', - 'Binary.Type', - 'BinaryEncoding.Type', - 'BinaryOccurrence.Type', - 'Byte.Type', - 'ByteOrder.Type', - 'Character.Type', - 'Compression.Type', - 'CsvStyle.Type', - 'Currency.Type', - 'Date.Type', - 'DateTime.Type', - 'DateTimeZone.Type', - 'Day.Type', - 'Decimal.Type', - 'Double.Type', - 'Duration.Type', - 'ExtraValues.Type', - 'Function.Type', - 'GroupKind.Type', - 'Guid.Type', - 'Int16.Type', - 'Int32.Type', - 'Int64.Type', - 'Int8.Type', - 'JoinAlgorithm.Type', - 'JoinKind.Type', - 'JoinSide.Type', - 'List.Type', - 'Logical.Type', - 'MissingField.Type', - 'None.Type', - 'Null.Type', - 'Number.Type', - 'Occurrence.Type', - 'Order.Type', - 'Password.Type', - 'Percentage.Type', - 'Precision.Type', - 'QuoteStyle.Type', - 'Record.Type', - 'RelativePosition.Type', - 'RoundingMode.Type', - 'SapHanaDistribution.Type', - 'SapHanaRangeOperator.Type', - 'Single.Type', - 'Table.Type', - 'Text.Type', - 'TextEncoding.Type', - 'Time.Type', - 'TraceLevel.Type', - 'Type.Type', - 'Uri.Type', - 'WebMethod.Type' - ], - tokenizer: { - root: [ - // quoted identifier - [/#"[\w \.]+"/, 'identifier.quote'], - // numbers - [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], - [/0[xX][0-9a-fA-F]+/, 'number.hex'], - [/\d+([eE][\-+]?\d+)?/, 'number'], - // keywords - [ - /(#?[a-z]+)\b/, - { - cases: { - '@typeKeywords': 'type', - '@keywords': 'keyword', - '@constants': 'constant', - '@constructors': 'constructor', - '@operatorKeywords': 'operators', - '@default': 'identifier' - } - } - ], - // built-in types - [ - /\b([A-Z][a-zA-Z0-9]+\.Type)\b/, - { - cases: { - '@builtinTypes': 'type', - '@default': 'identifier' - } - } - ], - // other built-ins - [ - /\b([A-Z][a-zA-Z0-9]+\.[A-Z][a-zA-Z0-9]+)\b/, - { - cases: { - '@builtinFunctions': 'keyword.function', - '@builtinConstants': 'constant', - '@default': 'identifier' - } - } - ], - // other identifiers - [/\b([a-zA-Z_][\w\.]*)\b/, 'identifier'], - { include: '@whitespace' }, - { include: '@comments' }, - { include: '@strings' }, - [/[{}()\[\]]/, '@brackets'], - [/([=\+<>\-\*&@\?\/!])|([<>]=)|(<>)|(=>)|(\.\.\.)|(\.\.)/, 'operators'], - [/[,;]/, 'delimiter'] - ], - whitespace: [[/\s+/, 'white']], - comments: [ - ['\\/\\*', 'comment', '@comment'], - ['\\/\\/+.*', 'comment'] - ], - comment: [ - ['\\*\\/', 'comment', '@pop'], - ['.', 'comment'] - ], - strings: [['"', 'string', '@string']], - string: [ - ['""', 'string.escape'], - ['"', 'string', '@pop'], - ['.', 'string'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=43.43.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{949:function(e,t,a){"use strict";a.r(t),a.d(t,"conf",(function(){return n})),a.d(t,"language",(function(){return i}));var n={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["[","]"],["(",")"],["{","}"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment","identifier"]},{open:"[",close:"]",notIn:["string","comment","identifier"]},{open:"(",close:")",notIn:["string","comment","identifier"]},{open:"{",close:"}",notIn:["string","comment","identifier"]}]},i={defaultToken:"",tokenPostfix:".pq",ignoreCase:!1,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"{",close:"}",token:"delimiter.brackets"},{open:"(",close:")",token:"delimiter.parenthesis"}],operatorKeywords:["and","not","or"],keywords:["as","each","else","error","false","if","in","is","let","meta","otherwise","section","shared","then","true","try","type"],constructors:["#binary","#date","#datetime","#datetimezone","#duration","#table","#time"],constants:["#infinity","#nan","#sections","#shared"],typeKeywords:["action","any","anynonnull","none","null","logical","number","time","date","datetime","datetimezone","duration","text","binary","list","record","table","function"],builtinFunctions:["Access.Database","Action.Return","Action.Sequence","Action.Try","ActiveDirectory.Domains","AdoDotNet.DataSource","AdoDotNet.Query","AdobeAnalytics.Cubes","AnalysisServices.Database","AnalysisServices.Databases","AzureStorage.BlobContents","AzureStorage.Blobs","AzureStorage.Tables","Binary.Buffer","Binary.Combine","Binary.Compress","Binary.Decompress","Binary.End","Binary.From","Binary.FromList","Binary.FromText","Binary.InferContentType","Binary.Length","Binary.ToList","Binary.ToText","BinaryFormat.7BitEncodedSignedInteger","BinaryFormat.7BitEncodedUnsignedInteger","BinaryFormat.Binary","BinaryFormat.Byte","BinaryFormat.ByteOrder","BinaryFormat.Choice","BinaryFormat.Decimal","BinaryFormat.Double","BinaryFormat.Group","BinaryFormat.Length","BinaryFormat.List","BinaryFormat.Null","BinaryFormat.Record","BinaryFormat.SignedInteger16","BinaryFormat.SignedInteger32","BinaryFormat.SignedInteger64","BinaryFormat.Single","BinaryFormat.Text","BinaryFormat.Transform","BinaryFormat.UnsignedInteger16","BinaryFormat.UnsignedInteger32","BinaryFormat.UnsignedInteger64","Byte.From","Character.FromNumber","Character.ToNumber","Combiner.CombineTextByDelimiter","Combiner.CombineTextByEachDelimiter","Combiner.CombineTextByLengths","Combiner.CombineTextByPositions","Combiner.CombineTextByRanges","Comparer.Equals","Comparer.FromCulture","Comparer.Ordinal","Comparer.OrdinalIgnoreCase","Csv.Document","Cube.AddAndExpandDimensionColumn","Cube.AddMeasureColumn","Cube.ApplyParameter","Cube.AttributeMemberId","Cube.AttributeMemberProperty","Cube.CollapseAndRemoveColumns","Cube.Dimensions","Cube.DisplayFolders","Cube.Measures","Cube.Parameters","Cube.Properties","Cube.PropertyKey","Cube.ReplaceDimensions","Cube.Transform","Currency.From","DB2.Database","Date.AddDays","Date.AddMonths","Date.AddQuarters","Date.AddWeeks","Date.AddYears","Date.Day","Date.DayOfWeek","Date.DayOfWeekName","Date.DayOfYear","Date.DaysInMonth","Date.EndOfDay","Date.EndOfMonth","Date.EndOfQuarter","Date.EndOfWeek","Date.EndOfYear","Date.From","Date.FromText","Date.IsInCurrentDay","Date.IsInCurrentMonth","Date.IsInCurrentQuarter","Date.IsInCurrentWeek","Date.IsInCurrentYear","Date.IsInNextDay","Date.IsInNextMonth","Date.IsInNextNDays","Date.IsInNextNMonths","Date.IsInNextNQuarters","Date.IsInNextNWeeks","Date.IsInNextNYears","Date.IsInNextQuarter","Date.IsInNextWeek","Date.IsInNextYear","Date.IsInPreviousDay","Date.IsInPreviousMonth","Date.IsInPreviousNDays","Date.IsInPreviousNMonths","Date.IsInPreviousNQuarters","Date.IsInPreviousNWeeks","Date.IsInPreviousNYears","Date.IsInPreviousQuarter","Date.IsInPreviousWeek","Date.IsInPreviousYear","Date.IsInYearToDate","Date.IsLeapYear","Date.Month","Date.MonthName","Date.QuarterOfYear","Date.StartOfDay","Date.StartOfMonth","Date.StartOfQuarter","Date.StartOfWeek","Date.StartOfYear","Date.ToRecord","Date.ToText","Date.WeekOfMonth","Date.WeekOfYear","Date.Year","DateTime.AddZone","DateTime.Date","DateTime.FixedLocalNow","DateTime.From","DateTime.FromFileTime","DateTime.FromText","DateTime.IsInCurrentHour","DateTime.IsInCurrentMinute","DateTime.IsInCurrentSecond","DateTime.IsInNextHour","DateTime.IsInNextMinute","DateTime.IsInNextNHours","DateTime.IsInNextNMinutes","DateTime.IsInNextNSeconds","DateTime.IsInNextSecond","DateTime.IsInPreviousHour","DateTime.IsInPreviousMinute","DateTime.IsInPreviousNHours","DateTime.IsInPreviousNMinutes","DateTime.IsInPreviousNSeconds","DateTime.IsInPreviousSecond","DateTime.LocalNow","DateTime.Time","DateTime.ToRecord","DateTime.ToText","DateTimeZone.FixedLocalNow","DateTimeZone.FixedUtcNow","DateTimeZone.From","DateTimeZone.FromFileTime","DateTimeZone.FromText","DateTimeZone.LocalNow","DateTimeZone.RemoveZone","DateTimeZone.SwitchZone","DateTimeZone.ToLocal","DateTimeZone.ToRecord","DateTimeZone.ToText","DateTimeZone.ToUtc","DateTimeZone.UtcNow","DateTimeZone.ZoneHours","DateTimeZone.ZoneMinutes","Decimal.From","Diagnostics.ActivityId","Diagnostics.Trace","DirectQueryCapabilities.From","Double.From","Duration.Days","Duration.From","Duration.FromText","Duration.Hours","Duration.Minutes","Duration.Seconds","Duration.ToRecord","Duration.ToText","Duration.TotalDays","Duration.TotalHours","Duration.TotalMinutes","Duration.TotalSeconds","Embedded.Value","Error.Record","Excel.CurrentWorkbook","Excel.Workbook","Exchange.Contents","Expression.Constant","Expression.Evaluate","Expression.Identifier","Facebook.Graph","File.Contents","Folder.Contents","Folder.Files","Function.From","Function.Invoke","Function.InvokeAfter","Function.IsDataSource","GoogleAnalytics.Accounts","Guid.From","HdInsight.Containers","HdInsight.Contents","HdInsight.Files","Hdfs.Contents","Hdfs.Files","Informix.Database","Int16.From","Int32.From","Int64.From","Int8.From","ItemExpression.From","Json.Document","Json.FromValue","Lines.FromBinary","Lines.FromText","Lines.ToBinary","Lines.ToText","List.Accumulate","List.AllTrue","List.Alternate","List.AnyTrue","List.Average","List.Buffer","List.Combine","List.Contains","List.ContainsAll","List.ContainsAny","List.Count","List.Covariance","List.DateTimeZones","List.DateTimes","List.Dates","List.Difference","List.Distinct","List.Durations","List.FindText","List.First","List.FirstN","List.Generate","List.InsertRange","List.Intersect","List.IsDistinct","List.IsEmpty","List.Last","List.LastN","List.MatchesAll","List.MatchesAny","List.Max","List.MaxN","List.Median","List.Min","List.MinN","List.Mode","List.Modes","List.NonNullCount","List.Numbers","List.PositionOf","List.PositionOfAny","List.Positions","List.Product","List.Random","List.Range","List.RemoveFirstN","List.RemoveItems","List.RemoveLastN","List.RemoveMatchingItems","List.RemoveNulls","List.RemoveRange","List.Repeat","List.ReplaceMatchingItems","List.ReplaceRange","List.ReplaceValue","List.Reverse","List.Select","List.Single","List.SingleOrDefault","List.Skip","List.Sort","List.StandardDeviation","List.Sum","List.Times","List.Transform","List.TransformMany","List.Union","List.Zip","Logical.From","Logical.FromText","Logical.ToText","MQ.Queue","MySQL.Database","Number.Abs","Number.Acos","Number.Asin","Number.Atan","Number.Atan2","Number.BitwiseAnd","Number.BitwiseNot","Number.BitwiseOr","Number.BitwiseShiftLeft","Number.BitwiseShiftRight","Number.BitwiseXor","Number.Combinations","Number.Cos","Number.Cosh","Number.Exp","Number.Factorial","Number.From","Number.FromText","Number.IntegerDivide","Number.IsEven","Number.IsNaN","Number.IsOdd","Number.Ln","Number.Log","Number.Log10","Number.Mod","Number.Permutations","Number.Power","Number.Random","Number.RandomBetween","Number.Round","Number.RoundAwayFromZero","Number.RoundDown","Number.RoundTowardZero","Number.RoundUp","Number.Sign","Number.Sin","Number.Sinh","Number.Sqrt","Number.Tan","Number.Tanh","Number.ToText","OData.Feed","Odbc.DataSource","Odbc.Query","OleDb.DataSource","OleDb.Query","Oracle.Database","Percentage.From","PostgreSQL.Database","RData.FromBinary","Record.AddField","Record.Combine","Record.Field","Record.FieldCount","Record.FieldNames","Record.FieldOrDefault","Record.FieldValues","Record.FromList","Record.FromTable","Record.HasFields","Record.RemoveFields","Record.RenameFields","Record.ReorderFields","Record.SelectFields","Record.ToList","Record.ToTable","Record.TransformFields","Replacer.ReplaceText","Replacer.ReplaceValue","RowExpression.Column","RowExpression.From","Salesforce.Data","Salesforce.Reports","SapBusinessWarehouse.Cubes","SapHana.Database","SharePoint.Contents","SharePoint.Files","SharePoint.Tables","Single.From","Soda.Feed","Splitter.SplitByNothing","Splitter.SplitTextByAnyDelimiter","Splitter.SplitTextByDelimiter","Splitter.SplitTextByEachDelimiter","Splitter.SplitTextByLengths","Splitter.SplitTextByPositions","Splitter.SplitTextByRanges","Splitter.SplitTextByRepeatedLengths","Splitter.SplitTextByWhitespace","Sql.Database","Sql.Databases","SqlExpression.SchemaFrom","SqlExpression.ToExpression","Sybase.Database","Table.AddColumn","Table.AddIndexColumn","Table.AddJoinColumn","Table.AddKey","Table.AggregateTableColumn","Table.AlternateRows","Table.Buffer","Table.Column","Table.ColumnCount","Table.ColumnNames","Table.ColumnsOfType","Table.Combine","Table.CombineColumns","Table.Contains","Table.ContainsAll","Table.ContainsAny","Table.DemoteHeaders","Table.Distinct","Table.DuplicateColumn","Table.ExpandListColumn","Table.ExpandRecordColumn","Table.ExpandTableColumn","Table.FillDown","Table.FillUp","Table.FilterWithDataTable","Table.FindText","Table.First","Table.FirstN","Table.FirstValue","Table.FromColumns","Table.FromList","Table.FromPartitions","Table.FromRecords","Table.FromRows","Table.FromValue","Table.Group","Table.HasColumns","Table.InsertRows","Table.IsDistinct","Table.IsEmpty","Table.Join","Table.Keys","Table.Last","Table.LastN","Table.MatchesAllRows","Table.MatchesAnyRows","Table.Max","Table.MaxN","Table.Min","Table.MinN","Table.NestedJoin","Table.Partition","Table.PartitionValues","Table.Pivot","Table.PositionOf","Table.PositionOfAny","Table.PrefixColumns","Table.Profile","Table.PromoteHeaders","Table.Range","Table.RemoveColumns","Table.RemoveFirstN","Table.RemoveLastN","Table.RemoveMatchingRows","Table.RemoveRows","Table.RemoveRowsWithErrors","Table.RenameColumns","Table.ReorderColumns","Table.Repeat","Table.ReplaceErrorValues","Table.ReplaceKeys","Table.ReplaceMatchingRows","Table.ReplaceRelationshipIdentity","Table.ReplaceRows","Table.ReplaceValue","Table.ReverseRows","Table.RowCount","Table.Schema","Table.SelectColumns","Table.SelectRows","Table.SelectRowsWithErrors","Table.SingleRow","Table.Skip","Table.Sort","Table.SplitColumn","Table.ToColumns","Table.ToList","Table.ToRecords","Table.ToRows","Table.TransformColumnNames","Table.TransformColumnTypes","Table.TransformColumns","Table.TransformRows","Table.Transpose","Table.Unpivot","Table.UnpivotOtherColumns","Table.View","Table.ViewFunction","TableAction.DeleteRows","TableAction.InsertRows","TableAction.UpdateRows","Tables.GetRelationships","Teradata.Database","Text.AfterDelimiter","Text.At","Text.BeforeDelimiter","Text.BetweenDelimiters","Text.Clean","Text.Combine","Text.Contains","Text.End","Text.EndsWith","Text.Format","Text.From","Text.FromBinary","Text.Insert","Text.Length","Text.Lower","Text.Middle","Text.NewGuid","Text.PadEnd","Text.PadStart","Text.PositionOf","Text.PositionOfAny","Text.Proper","Text.Range","Text.Remove","Text.RemoveRange","Text.Repeat","Text.Replace","Text.ReplaceRange","Text.Select","Text.Split","Text.SplitAny","Text.Start","Text.StartsWith","Text.ToBinary","Text.ToList","Text.Trim","Text.TrimEnd","Text.TrimStart","Text.Upper","Time.EndOfHour","Time.From","Time.FromText","Time.Hour","Time.Minute","Time.Second","Time.StartOfHour","Time.ToRecord","Time.ToText","Type.AddTableKey","Type.ClosedRecord","Type.Facets","Type.ForFunction","Type.ForRecord","Type.FunctionParameters","Type.FunctionRequiredParameters","Type.FunctionReturn","Type.Is","Type.IsNullable","Type.IsOpenRecord","Type.ListItem","Type.NonNullable","Type.OpenRecord","Type.RecordFields","Type.ReplaceFacets","Type.ReplaceTableKeys","Type.TableColumn","Type.TableKeys","Type.TableRow","Type.TableSchema","Type.Union","Uri.BuildQueryString","Uri.Combine","Uri.EscapeDataString","Uri.Parts","Value.Add","Value.As","Value.Compare","Value.Divide","Value.Equals","Value.Firewall","Value.FromText","Value.Is","Value.Metadata","Value.Multiply","Value.NativeQuery","Value.NullableEquals","Value.RemoveMetadata","Value.ReplaceMetadata","Value.ReplaceType","Value.Subtract","Value.Type","ValueAction.NativeStatement","ValueAction.Replace","Variable.Value","Web.Contents","Web.Page","WebAction.Request","Xml.Document","Xml.Tables"],builtinConstants:["BinaryEncoding.Base64","BinaryEncoding.Hex","BinaryOccurrence.Optional","BinaryOccurrence.Repeating","BinaryOccurrence.Required","ByteOrder.BigEndian","ByteOrder.LittleEndian","Compression.Deflate","Compression.GZip","CsvStyle.QuoteAfterDelimiter","CsvStyle.QuoteAlways","Culture.Current","Day.Friday","Day.Monday","Day.Saturday","Day.Sunday","Day.Thursday","Day.Tuesday","Day.Wednesday","ExtraValues.Error","ExtraValues.Ignore","ExtraValues.List","GroupKind.Global","GroupKind.Local","JoinAlgorithm.Dynamic","JoinAlgorithm.LeftHash","JoinAlgorithm.LeftIndex","JoinAlgorithm.PairwiseHash","JoinAlgorithm.RightHash","JoinAlgorithm.RightIndex","JoinAlgorithm.SortMerge","JoinKind.FullOuter","JoinKind.Inner","JoinKind.LeftAnti","JoinKind.LeftOuter","JoinKind.RightAnti","JoinKind.RightOuter","JoinSide.Left","JoinSide.Right","MissingField.Error","MissingField.Ignore","MissingField.UseNull","Number.E","Number.Epsilon","Number.NaN","Number.NegativeInfinity","Number.PI","Number.PositiveInfinity","Occurrence.All","Occurrence.First","Occurrence.Last","Occurrence.Optional","Occurrence.Repeating","Occurrence.Required","Order.Ascending","Order.Descending","Precision.Decimal","Precision.Double","QuoteStyle.Csv","QuoteStyle.None","RelativePosition.FromEnd","RelativePosition.FromStart","RoundingMode.AwayFromZero","RoundingMode.Down","RoundingMode.ToEven","RoundingMode.TowardZero","RoundingMode.Up","SapHanaDistribution.All","SapHanaDistribution.Connection","SapHanaDistribution.Off","SapHanaDistribution.Statement","SapHanaRangeOperator.Equals","SapHanaRangeOperator.GreaterThan","SapHanaRangeOperator.GreaterThanOrEquals","SapHanaRangeOperator.LessThan","SapHanaRangeOperator.LessThanOrEquals","SapHanaRangeOperator.NotEquals","TextEncoding.Ascii","TextEncoding.BigEndianUnicode","TextEncoding.Unicode","TextEncoding.Utf16","TextEncoding.Utf8","TextEncoding.Windows","TraceLevel.Critical","TraceLevel.Error","TraceLevel.Information","TraceLevel.Verbose","TraceLevel.Warning","WebMethod.Delete","WebMethod.Get","WebMethod.Head","WebMethod.Patch","WebMethod.Post","WebMethod.Put"],builtinTypes:["Action.Type","Any.Type","Binary.Type","BinaryEncoding.Type","BinaryOccurrence.Type","Byte.Type","ByteOrder.Type","Character.Type","Compression.Type","CsvStyle.Type","Currency.Type","Date.Type","DateTime.Type","DateTimeZone.Type","Day.Type","Decimal.Type","Double.Type","Duration.Type","ExtraValues.Type","Function.Type","GroupKind.Type","Guid.Type","Int16.Type","Int32.Type","Int64.Type","Int8.Type","JoinAlgorithm.Type","JoinKind.Type","JoinSide.Type","List.Type","Logical.Type","MissingField.Type","None.Type","Null.Type","Number.Type","Occurrence.Type","Order.Type","Password.Type","Percentage.Type","Precision.Type","QuoteStyle.Type","Record.Type","RelativePosition.Type","RoundingMode.Type","SapHanaDistribution.Type","SapHanaRangeOperator.Type","Single.Type","Table.Type","Text.Type","TextEncoding.Type","Time.Type","TraceLevel.Type","Type.Type","Uri.Type","WebMethod.Type"],tokenizer:{root:[[/#"[\w \.]+"/,"identifier.quote"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/\d+([eE][\-+]?\d+)?/,"number"],[/(#?[a-z]+)\b/,{cases:{"@typeKeywords":"type","@keywords":"keyword","@constants":"constant","@constructors":"constructor","@operatorKeywords":"operators","@default":"identifier"}}],[/\b([A-Z][a-zA-Z0-9]+\.Type)\b/,{cases:{"@builtinTypes":"type","@default":"identifier"}}],[/\b([A-Z][a-zA-Z0-9]+\.[A-Z][a-zA-Z0-9]+)\b/,{cases:{"@builtinFunctions":"keyword.function","@builtinConstants":"constant","@default":"identifier"}}],[/\b([a-zA-Z_][\w\.]*)\b/,"identifier"],{include:"@whitespace"},{include:"@comments"},{include:"@strings"},[/[{}()\[\]]/,"@brackets"],[/([=\+<>\-\*&@\?\/!])|([<>]=)|(<>)|(=>)|(\.\.\.)|(\.\.)/,"operators"],[/[,;]/,"delimiter"]],whitespace:[[/\s+/,"white"]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[".","comment"]],strings:[['"',"string","@string"]],string:[['""',"string.escape"],['"',"string","@pop"],[".","string"]]}}}}]); \ No newline at end of file diff --git a/docs/44.44.js b/docs/44.44.js index 57c343fea..3f60c2598 100644 --- a/docs/44.44.js +++ b/docs/44.44.js @@ -1,259 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[44],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/powershell/powershell.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/powershell/powershell.js ***! - \************************************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - // the default separators except `$-` - wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, - comments: { - lineComment: '#', - blockComment: ['<#', '#>'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"', notIn: ['string'] }, - { open: "'", close: "'", notIn: ['string', 'comment'] } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - folding: { - markers: { - start: new RegExp('^\\s*#region\\b'), - end: new RegExp('^\\s*#endregion\\b') - } - } -}; -var language = { - defaultToken: '', - ignoreCase: true, - tokenPostfix: '.ps1', - brackets: [ - { token: 'delimiter.curly', open: '{', close: '}' }, - { token: 'delimiter.square', open: '[', close: ']' }, - { token: 'delimiter.parenthesis', open: '(', close: ')' } - ], - keywords: [ - 'begin', - 'break', - 'catch', - 'class', - 'continue', - 'data', - 'define', - 'do', - 'dynamicparam', - 'else', - 'elseif', - 'end', - 'exit', - 'filter', - 'finally', - 'for', - 'foreach', - 'from', - 'function', - 'if', - 'in', - 'param', - 'process', - 'return', - 'switch', - 'throw', - 'trap', - 'try', - 'until', - 'using', - 'var', - 'while', - 'workflow', - 'parallel', - 'sequence', - 'inlinescript', - 'configuration' - ], - helpKeywords: /SYNOPSIS|DESCRIPTION|PARAMETER|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|ROLE|FUNCTIONALITY|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP/, - // we include these common regular expressions - symbols: /[=>/, 'comment', '@pop'], - [/(\.)(@helpKeywords)(?!\w)/, { token: 'comment.keyword.$2' }], - [/[\.#]/, 'comment'] - ] - } -}; - - -/***/ }) - -}]); -//# sourceMappingURL=44.44.js.map \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{950:function(e,n,s){"use strict";s.r(n),s.d(n,"conf",(function(){return t})),s.d(n,"language",(function(){return o}));var t={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"#",blockComment:["<#","#>"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},o={defaultToken:"",ignoreCase:!0,tokenPostfix:".ps1",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"}],keywords:["begin","break","catch","class","continue","data","define","do","dynamicparam","else","elseif","end","exit","filter","finally","for","foreach","from","function","if","in","param","process","return","switch","throw","trap","try","until","using","var","while","workflow","parallel","sequence","inlinescript","configuration"],helpKeywords:/SYNOPSIS|DESCRIPTION|PARAMETER|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|ROLE|FUNCTIONALITY|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP/,symbols:/[=>/,"comment","@pop"],[/(\.)(@helpKeywords)(?!\w)/,{token:"comment.keyword.$2"}],[/[\.#]/,"comment"]]}}}}]); \ No newline at end of file diff --git a/docs/45.45.js b/docs/45.45.js index cdbab77dd..718a19e45 100644 --- a/docs/45.45.js +++ b/docs/45.45.js @@ -1,429 +1 @@ -(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[45],{ - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/pug/pug.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/pug/pug.js ***! - \**********************************************************************/ -/*! exports provided: conf, language */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var conf = { - comments: { - lineComment: '//' - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '"', close: '"', notIn: ['string', 'comment'] }, - { open: "'", close: "'", notIn: ['string', 'comment'] }, - { open: '{', close: '}', notIn: ['string', 'comment'] }, - { open: '[', close: ']', notIn: ['string', 'comment'] }, - { open: '(', close: ')', notIn: ['string', 'comment'] } - ], - folding: { - offSide: true - } -}; -var language = { - defaultToken: '', - tokenPostfix: '.pug', - ignoreCase: true, - brackets: [ - { token: 'delimiter.curly', open: '{', close: '}' }, - { token: 'delimiter.array', open: '[', close: ']' }, - { token: 'delimiter.parenthesis', open: '(', close: ')' } - ], - keywords: [ - 'append', - 'block', - 'case', - 'default', - 'doctype', - 'each', - 'else', - 'extends', - 'for', - 'if', - 'in', - 'include', - 'mixin', - 'typeof', - 'unless', - 'var', - 'when' - ], - tags: [ - 'a', - 'abbr', - 'acronym', - 'address', - 'area', - 'article', - 'aside', - 'audio', - 'b', - 'base', - 'basefont', - 'bdi', - 'bdo', - 'blockquote', - 'body', - 'br', - 'button', - 'canvas', - 'caption', - 'center', - 'cite', - 'code', - 'col', - 'colgroup', - 'command', - 'datalist', - 'dd', - 'del', - 'details', - 'dfn', - 'div', - 'dl', - 'dt', - 'em', - 'embed', - 'fieldset', - 'figcaption', - 'figure', - 'font', - 'footer', - 'form', - 'frame', - 'frameset', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'head', - 'header', - 'hgroup', - 'hr', - 'html', - 'i', - 'iframe', - 'img', - 'input', - 'ins', - 'keygen', - 'kbd', - 'label', - 'li', - 'link', - 'map', - 'mark', - 'menu', - 'meta', - 'meter', - 'nav', - 'noframes', - 'noscript', - 'object', - 'ol', - 'optgroup', - 'option', - 'output', - 'p', - 'param', - 'pre', - 'progress', - 'q', - 'rp', - 'rt', - 'ruby', - 's', - 'samp', - 'script', - 'section', - 'select', - 'small', - 'source', - 'span', - 'strike', - 'strong', - 'style', - 'sub', - 'summary', - 'sup', - 'table', - 'tbody', - 'td', - 'textarea', - 'tfoot', - 'th', - 'thead', - 'time', - 'title', - 'tr', - 'tracks', - 'tt', - 'u', - 'ul', - 'video', - 'wbr' - ], - // we include these common regular expressions - symbols: /[\+\-\*\%\&\|\!\=\/\.\,\:]+/, - escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/, - tokenizer: { - root: [ - // Tag or a keyword at start - [ - /^(\s*)([a-zA-Z_-][\w-]*)/, - { - cases: { - '$2@tags': { - cases: { - '@eos': ['', 'tag'], - '@default': ['', { token: 'tag', next: '@tag.$1' }] - } - }, - '$2@keywords': ['', { token: 'keyword.$2' }], - '@default': ['', ''] - } - } - ], - // id - [ - /^(\s*)(#[a-zA-Z_-][\w-]*)/, - { - cases: { - '@eos': ['', 'tag.id'], - '@default': ['', { token: 'tag.id', next: '@tag.$1' }] - } - } - ], - // class - [ - /^(\s*)(\.[a-zA-Z_-][\w-]*)/, - { - cases: { - '@eos': ['', 'tag.class'], - '@default': ['', { token: 'tag.class', next: '@tag.$1' }] - } - } - ], - // plain text with pipe - [/^(\s*)(\|.*)$/, ''], - { include: '@whitespace' }, - // keywords - [ - /[a-zA-Z_$][\w$]*/, - { - cases: { - '@keywords': { token: 'keyword.$0' }, - '@default': '' - } - } - ], - // delimiters and operators - [/[{}()\[\]]/, '@brackets'], - [/@symbols/, 'delimiter'], - // numbers - [/\d+\.\d+([eE][\-+]?\d+)?/, 'number.float'], - [/\d+/, 'number'], - // strings: - [/"/, 'string', '@string."'], - [/'/, 'string', "@string.'"] - ], - tag: [ - [/(\.)(\s*$)/, [{ token: 'delimiter', next: '@blockText.$S2.' }, '']], - [/\s+/, { token: '', next: '@simpleText' }], - // id - [ - /#[a-zA-Z_-][\w-]*/, - { - cases: { - '@eos': { token: 'tag.id', next: '@pop' }, - '@default': 'tag.id' - } - } - ], - // class - [ - /\.[a-zA-Z_-][\w-]*/, - { - cases: { - '@eos': { token: 'tag.class', next: '@pop' }, - '@default': 'tag.class' - } - } - ], - // attributes - [/\(/, { token: 'delimiter.parenthesis', next: '@attributeList' }] - ], - simpleText: [ - [/[^#]+$/, { token: '', next: '@popall' }], - [/[^#]+/, { token: '' }], - // interpolation - [ - /(#{)([^}]*)(})/, - { - cases: { - '@eos': [ - 'interpolation.delimiter', - 'interpolation', - { - token: 'interpolation.delimiter', - next: '@popall' - } - ], - '@default': [ - 'interpolation.delimiter', - 'interpolation', - 'interpolation.delimiter' - ] - } - } - ], - [/#$/, { token: '', next: '@popall' }], - [/#/, ''] - ], - attributeList: [ - [/\s+/, ''], - [ - /(\w+)(\s*=\s*)("|')/, - ['attribute.name', 'delimiter', { token: 'attribute.value', next: '@value.$3' }] - ], - [/\w+/, 'attribute.name'], - [ - /,/, - { - cases: { - '@eos': { - token: 'attribute.delimiter', - next: '@popall' - }, - '@default': 'attribute.delimiter' - } - } - ], - [/\)$/, { token: 'delimiter.parenthesis', next: '@popall' }], - [/\)/, { token: 'delimiter.parenthesis', next: '@pop' }] - ], - whitespace: [ - [/^(\s*)(\/\/.*)$/, { token: 'comment', next: '@blockText.$1.comment' }], - [/[ \t\r\n]+/, ''], - [//, { token: 'comment', next: '@pop' }], - [//,{token:"comment",next:"@pop"}],[/'] - }, - brackets: [ - [''], - ['<', '>'], - ['{', '}'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: "'", close: "'" } - ], - surroundingPairs: [ - { open: '"', close: '"' }, - { open: "'", close: "'" }, - { open: '<', close: '>' } - ], - onEnterRules: [ - { - beforeText: new RegExp("<(?!(?:" + EMPTY_ELEMENTS.join('|') + "))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$", 'i'), - afterText: /^<\/(\w[\w\d]*)\s*>$/i, - action: { - indentAction: _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__["languages"].IndentAction.IndentOutdent - } - }, - { - beforeText: new RegExp("<(?!(?:" + EMPTY_ELEMENTS.join('|') + "))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$", 'i'), - action: { indentAction: _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__["languages"].IndentAction.Indent } - } - ] -}; -var language = { - defaultToken: '', - tokenPostfix: '', - // ignoreCase: true, - // The main tokenizer for our languages - tokenizer: { - root: [ - [/@@/], - [/@[^@]/, { token: '@rematch', switchTo: '@razorInSimpleState.root' }], - [/)/, ['delimiter.html', 'tag.html', 'delimiter.html']], - [/(<)(script)/, ['delimiter.html', { token: 'tag.html', next: '@script' }]], - [/(<)(style)/, ['delimiter.html', { token: 'tag.html', next: '@style' }]], - [/(<)([:\w]+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]], - [/(<\/)(\w+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]], - [/]+/, 'metatag.content.html'], - [/>/, 'metatag.html', '@pop'] - ], - comment: [ - [/@[^@]/, { token: '@rematch', switchTo: '@razorInSimpleState.comment' }], - [/-->/, 'comment.html', '@pop'], - [/[^-]+/, 'comment.content.html'], - [/./, 'comment.content.html'] - ], - otherTag: [ - [/@[^@]/, { token: '@rematch', switchTo: '@razorInSimpleState.otherTag' }], - [/\/?>/, 'delimiter.html', '@pop'], - [/"([^"]*)"/, 'attribute.value'], - [/'([^']*)'/, 'attribute.value'], - [/[\w\-]+/, 'attribute.name'], - [/=/, 'delimiter'], - [/[ \t\r\n]+/] // whitespace - ], - // -- BEGIN '); - - if (idx >= 0) { - idx += 9; - txt = txt.substr(idx); - } - } else { - rs += txt; - idx = -1; - break; - } - } - - return rs; -}; -var sanitizeText = function sanitizeText(text, config) { - var txt = text; - var htmlLabels = true; - - if (config.flowchart && (config.flowchart.htmlLabels === false || config.flowchart.htmlLabels === 'false')) { - htmlLabels = false; - } - - if (htmlLabels) { - var level = config.securityLevel; - - if (level === 'antiscript') { - txt = removeScript(txt); - } else if (level !== 'loose') { - // eslint-disable-line - txt = breakToPlaceholder(txt); - txt = txt.replace(//g, '>'); - txt = txt.replace(/=/g, '='); - txt = placeholderToBreak(txt); - } - } - - return txt; -}; -var lineBreakRegex = //gi; -var hasBreaks = function hasBreaks(text) { - return //gi.test(text); -}; -var splitBreaks = function splitBreaks(text) { - return text.split(//gi); -}; - -var breakToPlaceholder = function breakToPlaceholder(s) { - return s.replace(lineBreakRegex, '#br#'); -}; - -var placeholderToBreak = function placeholderToBreak(s) { - return s.replace(/#br#/g, '
'); -}; - -/* harmony default export */ __webpack_exports__["default"] = ({ - getRows: getRows, - sanitizeText: sanitizeText, - hasBreaks: hasBreaks, - splitBreaks: splitBreaks, - lineBreakRegex: lineBreakRegex, - removeScript: removeScript -}); - -/***/ }), - -/***/ "./src/diagrams/er/erDb.js": -/*!*********************************!*\ - !*** ./src/diagrams/er/erDb.js ***! - \*********************************/ -/*! exports provided: parseDirective, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDirective", function() { return parseDirective; }); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/** - * - */ - - - -var entities = {}; -var relationships = []; -var title = ''; -var Cardinality = { - ZERO_OR_ONE: 'ZERO_OR_ONE', - ZERO_OR_MORE: 'ZERO_OR_MORE', - ONE_OR_MORE: 'ONE_OR_MORE', - ONLY_ONE: 'ONLY_ONE' -}; -var Identification = { - NON_IDENTIFYING: 'NON_IDENTIFYING', - IDENTIFYING: 'IDENTIFYING' -}; -var parseDirective = function parseDirective(statement, context, type) { - _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].parseDirective(this, statement, context, type); -}; - -var addEntity = function addEntity(name) { - if (typeof entities[name] === 'undefined') { - entities[name] = { - attributes: [] - }; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Added new entity :', name); - } - - return entities[name]; -}; - -var getEntities = function getEntities() { - return entities; -}; - -var addAttributes = function addAttributes(entityName, attribs) { - var entity = addEntity(entityName); // May do nothing (if entity has already been added) - // Process attribs in reverse order due to effect of recursive construction (last attribute is first) - - var i; - - for (i = attribs.length - 1; i >= 0; i--) { - entity.attributes.push(attribs[i]); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Added attribute ', attribs[i].attributeName); - } -}; -/** - * Add a relationship - * @param entA The first entity in the relationship - * @param rolA The role played by the first entity in relation to the second - * @param entB The second entity in the relationship - * @param rSpec The details of the relationship between the two entities - */ - - -var addRelationship = function addRelationship(entA, rolA, entB, rSpec) { - var rel = { - entityA: entA, - roleA: rolA, - entityB: entB, - relSpec: rSpec - }; - relationships.push(rel); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Added new relationship :', rel); -}; - -var getRelationships = function getRelationships() { - return relationships; -}; // Keep this - TODO: revisit...allow the diagram to have a title - - -var setTitle = function setTitle(txt) { - title = txt; -}; - -var getTitle = function getTitle() { - return title; -}; - -var clear = function clear() { - entities = {}; - relationships = []; - title = ''; -}; - -/* harmony default export */ __webpack_exports__["default"] = ({ - Cardinality: Cardinality, - Identification: Identification, - parseDirective: parseDirective, - getConfig: function getConfig() { - return _config__WEBPACK_IMPORTED_MODULE_2__["getConfig"]().er; - }, - addEntity: addEntity, - addAttributes: addAttributes, - getEntities: getEntities, - addRelationship: addRelationship, - getRelationships: getRelationships, - clear: clear, - setTitle: setTitle, - getTitle: getTitle -}); - -/***/ }), - -/***/ "./src/diagrams/er/erMarkers.js": -/*!**************************************!*\ - !*** ./src/diagrams/er/erMarkers.js ***! - \**************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -var ERMarkers = { - ONLY_ONE_START: 'ONLY_ONE_START', - ONLY_ONE_END: 'ONLY_ONE_END', - ZERO_OR_ONE_START: 'ZERO_OR_ONE_START', - ZERO_OR_ONE_END: 'ZERO_OR_ONE_END', - ONE_OR_MORE_START: 'ONE_OR_MORE_START', - ONE_OR_MORE_END: 'ONE_OR_MORE_END', - ZERO_OR_MORE_START: 'ZERO_OR_MORE_START', - ZERO_OR_MORE_END: 'ZERO_OR_MORE_END' -}; -/** - * Put the markers into the svg DOM for later use with edge paths - */ - -var insertMarkers = function insertMarkers(elem, conf) { - var marker; - elem.append('defs').append('marker').attr('id', ERMarkers.ONLY_ONE_START).attr('refX', 0).attr('refY', 9).attr('markerWidth', 18).attr('markerHeight', 18).attr('orient', 'auto').append('path').attr('stroke', conf.stroke).attr('fill', 'none').attr('d', 'M9,0 L9,18 M15,0 L15,18'); - elem.append('defs').append('marker').attr('id', ERMarkers.ONLY_ONE_END).attr('refX', 18).attr('refY', 9).attr('markerWidth', 18).attr('markerHeight', 18).attr('orient', 'auto').append('path').attr('stroke', conf.stroke).attr('fill', 'none').attr('d', 'M3,0 L3,18 M9,0 L9,18'); - marker = elem.append('defs').append('marker').attr('id', ERMarkers.ZERO_OR_ONE_START).attr('refX', 0).attr('refY', 9).attr('markerWidth', 30).attr('markerHeight', 18).attr('orient', 'auto'); - marker.append('circle').attr('stroke', conf.stroke).attr('fill', 'white').attr('cx', 21).attr('cy', 9).attr('r', 6); - marker.append('path').attr('stroke', conf.stroke).attr('fill', 'none').attr('d', 'M9,0 L9,18'); - marker = elem.append('defs').append('marker').attr('id', ERMarkers.ZERO_OR_ONE_END).attr('refX', 30).attr('refY', 9).attr('markerWidth', 30).attr('markerHeight', 18).attr('orient', 'auto'); - marker.append('circle').attr('stroke', conf.stroke).attr('fill', 'white').attr('cx', 9).attr('cy', 9).attr('r', 6); - marker.append('path').attr('stroke', conf.stroke).attr('fill', 'none').attr('d', 'M21,0 L21,18'); - elem.append('defs').append('marker').attr('id', ERMarkers.ONE_OR_MORE_START).attr('refX', 18).attr('refY', 18).attr('markerWidth', 45).attr('markerHeight', 36).attr('orient', 'auto').append('path').attr('stroke', conf.stroke).attr('fill', 'none').attr('d', 'M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27'); - elem.append('defs').append('marker').attr('id', ERMarkers.ONE_OR_MORE_END).attr('refX', 27).attr('refY', 18).attr('markerWidth', 45).attr('markerHeight', 36).attr('orient', 'auto').append('path').attr('stroke', conf.stroke).attr('fill', 'none').attr('d', 'M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18'); - marker = elem.append('defs').append('marker').attr('id', ERMarkers.ZERO_OR_MORE_START).attr('refX', 18).attr('refY', 18).attr('markerWidth', 57).attr('markerHeight', 36).attr('orient', 'auto'); - marker.append('circle').attr('stroke', conf.stroke).attr('fill', 'white').attr('cx', 48).attr('cy', 18).attr('r', 6); - marker.append('path').attr('stroke', conf.stroke).attr('fill', 'none').attr('d', 'M0,18 Q18,0 36,18 Q18,36 0,18'); - marker = elem.append('defs').append('marker').attr('id', ERMarkers.ZERO_OR_MORE_END).attr('refX', 39).attr('refY', 18).attr('markerWidth', 57).attr('markerHeight', 36).attr('orient', 'auto'); - marker.append('circle').attr('stroke', conf.stroke).attr('fill', 'white').attr('cx', 9).attr('cy', 18).attr('r', 6); - marker.append('path').attr('stroke', conf.stroke).attr('fill', 'none').attr('d', 'M21,18 Q39,0 57,18 Q39,36 21,18'); - return; -}; - -/* harmony default export */ __webpack_exports__["default"] = ({ - ERMarkers: ERMarkers, - insertMarkers: insertMarkers -}); - -/***/ }), - -/***/ "./src/diagrams/er/erRenderer.js": -/*!***************************************!*\ - !*** ./src/diagrams/er/erRenderer.js ***! - \***************************************/ -/*! exports provided: setConf, draw, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! graphlib */ "graphlib"); -/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _erDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./erDb */ "./src/diagrams/er/erDb.js"); -/* harmony import */ var _parser_erDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/erDiagram */ "./src/diagrams/er/parser/erDiagram.jison"); -/* harmony import */ var _parser_erDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_erDiagram__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! dagre */ "dagre"); -/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_4__); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _erMarkers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./erMarkers */ "./src/diagrams/er/erMarkers.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); - - - - - - - - - -var conf = {}; -/** - * Allows the top-level API module to inject config specific to this renderer, - * storing it in the local conf object. Note that generic config still needs to be - * retrieved using getConfig() imported from the config module - */ - -var setConf = function setConf(cnf) { - var keys = Object.keys(cnf); - - for (var i = 0; i < keys.length; i++) { - conf[keys[i]] = cnf[keys[i]]; - } -}; -/** - * Draw attributes for an entity - * @param groupNode the svg group node for the entity - * @param entityTextNode the svg node for the entity label text - * @param attributes an array of attributes defined for the entity (each attribute has a type and a name) - * @return the bounding box of the entity, after attributes have been added - */ - -var drawAttributes = function drawAttributes(groupNode, entityTextNode, attributes) { - var heightPadding = conf.entityPadding / 3; // Padding internal to attribute boxes - - var widthPadding = conf.entityPadding / 3; // Ditto - - var attrFontSize = conf.fontSize * 0.85; - var labelBBox = entityTextNode.node().getBBox(); - var attributeNodes = []; // Intermediate storage for attribute nodes created so that we can do a second pass - - var maxTypeWidth = 0; - var maxNameWidth = 0; - var cumulativeHeight = labelBBox.height + heightPadding * 2; - var attrNum = 1; - attributes.forEach(function (item) { - var attrPrefix = "".concat(entityTextNode.node().id, "-attr-").concat(attrNum); // Add a text node for the attribute type - - var typeNode = groupNode.append('text').attr('class', 'er entityLabel').attr('id', "".concat(attrPrefix, "-type")).attr('x', 0).attr('y', 0).attr('dominant-baseline', 'middle').attr('text-anchor', 'left').attr('style', 'font-family: ' + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().fontFamily + '; font-size: ' + attrFontSize + 'px').text(item.attributeType); // Add a text node for the attribute name - - var nameNode = groupNode.append('text').attr('class', 'er entityLabel').attr('id', "".concat(attrPrefix, "-name")).attr('x', 0).attr('y', 0).attr('dominant-baseline', 'middle').attr('text-anchor', 'left').attr('style', 'font-family: ' + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().fontFamily + '; font-size: ' + attrFontSize + 'px').text(item.attributeName); // Keep a reference to the nodes so that we can iterate through them later - - attributeNodes.push({ - tn: typeNode, - nn: nameNode - }); - var typeBBox = typeNode.node().getBBox(); - var nameBBox = nameNode.node().getBBox(); - maxTypeWidth = Math.max(maxTypeWidth, typeBBox.width); - maxNameWidth = Math.max(maxNameWidth, nameBBox.width); - cumulativeHeight += Math.max(typeBBox.height, nameBBox.height) + heightPadding * 2; - attrNum += 1; - }); // Calculate the new bounding box of the overall entity, now that attributes have been added - - var bBox = { - width: Math.max(conf.minEntityWidth, Math.max(labelBBox.width + conf.entityPadding * 2, maxTypeWidth + maxNameWidth + widthPadding * 4)), - height: attributes.length > 0 ? cumulativeHeight : Math.max(conf.minEntityHeight, labelBBox.height + conf.entityPadding * 2) - }; // There might be some spare width for padding out attributes if the entity name is very long - - var spareWidth = Math.max(0, bBox.width - (maxTypeWidth + maxNameWidth) - widthPadding * 4); - - if (attributes.length > 0) { - // Position the entity label near the top of the entity bounding box - entityTextNode.attr('transform', 'translate(' + bBox.width / 2 + ',' + (heightPadding + labelBBox.height / 2) + ')'); // Add rectangular boxes for the attribute types/names - - var heightOffset = labelBBox.height + heightPadding * 2; // Start at the bottom of the entity label - - var attribStyle = 'attributeBoxOdd'; // We will flip the style on alternate rows to achieve a banded effect - - attributeNodes.forEach(function (nodePair) { - // Calculate the alignment y co-ordinate for the type/name of the attribute - var alignY = heightOffset + heightPadding + Math.max(nodePair.tn.node().getBBox().height, nodePair.nn.node().getBBox().height) / 2; // Position the type of the attribute - - nodePair.tn.attr('transform', 'translate(' + widthPadding + ',' + alignY + ')'); // Insert a rectangle for the type - - var typeRect = groupNode.insert('rect', '#' + nodePair.tn.node().id).attr('class', "er ".concat(attribStyle)).attr('fill', conf.fill).attr('fill-opacity', '100%').attr('stroke', conf.stroke).attr('x', 0).attr('y', heightOffset).attr('width', maxTypeWidth + widthPadding * 2 + spareWidth / 2).attr('height', nodePair.tn.node().getBBox().height + heightPadding * 2); // Position the name of the attribute - - nodePair.nn.attr('transform', 'translate(' + (parseFloat(typeRect.attr('width')) + widthPadding) + ',' + alignY + ')'); // Insert a rectangle for the name - - groupNode.insert('rect', '#' + nodePair.nn.node().id).attr('class', "er ".concat(attribStyle)).attr('fill', conf.fill).attr('fill-opacity', '100%').attr('stroke', conf.stroke).attr('x', "".concat(typeRect.attr('x') + typeRect.attr('width'))) //.attr('x', maxTypeWidth + (widthPadding * 2)) - .attr('y', heightOffset).attr('width', maxNameWidth + widthPadding * 2 + spareWidth / 2).attr('height', nodePair.nn.node().getBBox().height + heightPadding * 2); // Increment the height offset to move to the next row - - heightOffset += Math.max(nodePair.tn.node().getBBox().height, nodePair.nn.node().getBBox().height) + heightPadding * 2; // Flip the attribute style for row banding - - attribStyle = attribStyle == 'attributeBoxOdd' ? 'attributeBoxEven' : 'attributeBoxOdd'; - }); - } else { - // Ensure the entity box is a decent size without any attributes - bBox.height = Math.max(conf.minEntityHeight, cumulativeHeight); // Position the entity label in the middle of the box - - entityTextNode.attr('transform', 'translate(' + bBox.width / 2 + ',' + bBox.height / 2 + ')'); - } - - return bBox; -}; -/** - * Use D3 to construct the svg elements for the entities - * @param svgNode the svg node that contains the diagram - * @param entities The entities to be drawn - * @param graph The graph that contains the vertex and edge definitions post-layout - * @return The first entity that was inserted - */ - - -var drawEntities = function drawEntities(svgNode, entities, graph) { - var keys = Object.keys(entities); - var firstOne; - keys.forEach(function (id) { - // Create a group for each entity - var groupNode = svgNode.append('g').attr('id', id); - firstOne = firstOne === undefined ? id : firstOne; // Label the entity - this is done first so that we can get the bounding box - // which then determines the size of the rectangle - - var textId = 'entity-' + id; - var textNode = groupNode.append('text').attr('class', 'er entityLabel').attr('id', textId).attr('x', 0).attr('y', 0).attr('dominant-baseline', 'middle').attr('text-anchor', 'middle').attr('style', 'font-family: ' + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().fontFamily + '; font-size: ' + conf.fontSize + 'px').text(id); - - var _drawAttributes = drawAttributes(groupNode, textNode, entities[id].attributes), - entityWidth = _drawAttributes.width, - entityHeight = _drawAttributes.height; // Draw the rectangle - insert it before the text so that the text is not obscured - - - var rectNode = groupNode.insert('rect', '#' + textId).attr('class', 'er entityBox').attr('fill', conf.fill).attr('fill-opacity', '100%').attr('stroke', conf.stroke).attr('x', 0).attr('y', 0).attr('width', entityWidth).attr('height', entityHeight); - var rectBBox = rectNode.node().getBBox(); // Add the entity to the graph - - graph.setNode(id, { - width: rectBBox.width, - height: rectBBox.height, - shape: 'rect', - id: id - }); - }); - return firstOne; -}; // drawEntities - - -var adjustEntities = function adjustEntities(svgNode, graph) { - graph.nodes().forEach(function (v) { - if (typeof v !== 'undefined' && typeof graph.node(v) !== 'undefined') { - svgNode.select('#' + v).attr('transform', 'translate(' + (graph.node(v).x - graph.node(v).width / 2) + ',' + (graph.node(v).y - graph.node(v).height / 2) + ' )'); - } - }); - return; -}; - -var getEdgeName = function getEdgeName(rel) { - return (rel.entityA + rel.roleA + rel.entityB).replace(/\s/g, ''); -}; -/** - * Add each relationship to the graph - * @param relationships the relationships to be added - * @param g the graph - * @return {Array} The array of relationships - */ - - -var addRelationships = function addRelationships(relationships, g) { - relationships.forEach(function (r) { - g.setEdge(r.entityA, r.entityB, { - relationship: r - }, getEdgeName(r)); - }); - return relationships; -}; // addRelationships - - -var relCnt = 0; -/** - * Draw a relationship using edge information from the graph - * @param svg the svg node - * @param rel the relationship to draw in the svg - * @param g the graph containing the edge information - * @param insert the insertion point in the svg DOM (because relationships have markers that need to sit 'behind' opaque entity boxes) - */ - -var drawRelationshipFromLayout = function drawRelationshipFromLayout(svg, rel, g, insert) { - relCnt++; // Find the edge relating to this relationship - - var edge = g.edge(rel.entityA, rel.entityB, getEdgeName(rel)); // Get a function that will generate the line path - - var lineFunction = Object(d3__WEBPACK_IMPORTED_MODULE_1__["line"])().x(function (d) { - return d.x; - }).y(function (d) { - return d.y; - }).curve(d3__WEBPACK_IMPORTED_MODULE_1__["curveBasis"]); // Insert the line at the right place - - var svgPath = svg.insert('path', '#' + insert).attr('class', 'er relationshipLine').attr('d', lineFunction(edge.points)).attr('stroke', conf.stroke).attr('fill', 'none'); // ...and with dashes if necessary - - if (rel.relSpec.relType === _erDb__WEBPACK_IMPORTED_MODULE_2__["default"].Identification.NON_IDENTIFYING) { - svgPath.attr('stroke-dasharray', '8,8'); - } // TODO: Understand this better - - - var url = ''; - - if (conf.arrowMarkerAbsolute) { - url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search; - url = url.replace(/\(/g, '\\('); - url = url.replace(/\)/g, '\\)'); - } // Decide which start and end markers it needs. It may be possible to be more concise here - // by reversing a start marker to make an end marker...but this will do for now - // Note that the 'A' entity's marker is at the end of the relationship and the 'B' entity's marker is at the start - - - switch (rel.relSpec.cardA) { - case _erDb__WEBPACK_IMPORTED_MODULE_2__["default"].Cardinality.ZERO_OR_ONE: - svgPath.attr('marker-end', 'url(' + url + '#' + _erMarkers__WEBPACK_IMPORTED_MODULE_7__["default"].ERMarkers.ZERO_OR_ONE_END + ')'); - break; - - case _erDb__WEBPACK_IMPORTED_MODULE_2__["default"].Cardinality.ZERO_OR_MORE: - svgPath.attr('marker-end', 'url(' + url + '#' + _erMarkers__WEBPACK_IMPORTED_MODULE_7__["default"].ERMarkers.ZERO_OR_MORE_END + ')'); - break; - - case _erDb__WEBPACK_IMPORTED_MODULE_2__["default"].Cardinality.ONE_OR_MORE: - svgPath.attr('marker-end', 'url(' + url + '#' + _erMarkers__WEBPACK_IMPORTED_MODULE_7__["default"].ERMarkers.ONE_OR_MORE_END + ')'); - break; - - case _erDb__WEBPACK_IMPORTED_MODULE_2__["default"].Cardinality.ONLY_ONE: - svgPath.attr('marker-end', 'url(' + url + '#' + _erMarkers__WEBPACK_IMPORTED_MODULE_7__["default"].ERMarkers.ONLY_ONE_END + ')'); - break; - } - - switch (rel.relSpec.cardB) { - case _erDb__WEBPACK_IMPORTED_MODULE_2__["default"].Cardinality.ZERO_OR_ONE: - svgPath.attr('marker-start', 'url(' + url + '#' + _erMarkers__WEBPACK_IMPORTED_MODULE_7__["default"].ERMarkers.ZERO_OR_ONE_START + ')'); - break; - - case _erDb__WEBPACK_IMPORTED_MODULE_2__["default"].Cardinality.ZERO_OR_MORE: - svgPath.attr('marker-start', 'url(' + url + '#' + _erMarkers__WEBPACK_IMPORTED_MODULE_7__["default"].ERMarkers.ZERO_OR_MORE_START + ')'); - break; - - case _erDb__WEBPACK_IMPORTED_MODULE_2__["default"].Cardinality.ONE_OR_MORE: - svgPath.attr('marker-start', 'url(' + url + '#' + _erMarkers__WEBPACK_IMPORTED_MODULE_7__["default"].ERMarkers.ONE_OR_MORE_START + ')'); - break; - - case _erDb__WEBPACK_IMPORTED_MODULE_2__["default"].Cardinality.ONLY_ONE: - svgPath.attr('marker-start', 'url(' + url + '#' + _erMarkers__WEBPACK_IMPORTED_MODULE_7__["default"].ERMarkers.ONLY_ONE_START + ')'); - break; - } // Now label the relationship - // Find the half-way point - - - var len = svgPath.node().getTotalLength(); - var labelPoint = svgPath.node().getPointAtLength(len * 0.5); // Append a text node containing the label - - var labelId = 'rel' + relCnt; - var labelNode = svg.append('text').attr('class', 'er relationshipLabel').attr('id', labelId).attr('x', labelPoint.x).attr('y', labelPoint.y).attr('text-anchor', 'middle').attr('dominant-baseline', 'middle').attr('style', 'font-family: ' + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().fontFamily + '; font-size: ' + conf.fontSize + 'px').text(rel.roleA); // Figure out how big the opaque 'container' rectangle needs to be - - var labelBBox = labelNode.node().getBBox(); // Insert the opaque rectangle before the text label - - svg.insert('rect', '#' + labelId).attr('class', 'er relationshipLabelBox').attr('x', labelPoint.x - labelBBox.width / 2).attr('y', labelPoint.y - labelBBox.height / 2).attr('width', labelBBox.width).attr('height', labelBBox.height).attr('fill', 'white').attr('fill-opacity', '85%'); - return; -}; -/** - * Draw en E-R diagram in the tag with id: id based on the text definition of the diagram - * @param text the text of the diagram - * @param id the unique id of the DOM node that contains the diagram - */ - - -var draw = function draw(text, id) { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Drawing ER diagram'); - _erDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); - var parser = _parser_erDiagram__WEBPACK_IMPORTED_MODULE_3___default.a.parser; - parser.yy = _erDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the text to populate erDb - - try { - parser.parse(text); - } catch (err) { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].debug('Parsing failed'); - } // Get a reference to the svg node that contains the text - - - var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id='".concat(id, "']")); // Add cardinality marker definitions to the svg - - _erMarkers__WEBPACK_IMPORTED_MODULE_7__["default"].insertMarkers(svg, conf); // Now we have to construct the diagram in a specific way: - // --- - // 1. Create all the entities in the svg node at 0,0, but with the correct dimensions (allowing for text content) - // 2. Make sure they are all added to the graph - // 3. Add all the edges (relationships) to the graph aswell - // 4. Let dagre do its magic to layout the graph. This assigns: - // - the centre co-ordinates for each node, bearing in mind the dimensions and edge relationships - // - the path co-ordinates for each edge - // But it has no impact on the svg child nodes - the diagram remains with every entity rooted at 0,0 - // 5. Now assign a transform to each entity in the svg node so that it gets drawn in the correct place, as determined by - // its centre point, which is obtained from the graph, and it's width and height - // 6. And finally, create all the edges in the svg node using information from the graph - // --- - // Create the graph - - var g; // TODO: Explore directed vs undirected graphs, and how the layout is affected - // An E-R diagram could be said to be undirected, but there is merit in setting - // the direction from parent to child in a one-to-many as this influences graphlib to - // put the parent above the child (does it?), which is intuitive. Most relationships - // in ER diagrams are one-to-many. - - g = new graphlib__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({ - multigraph: true, - directed: true, - compound: false - }).setGraph({ - rankdir: conf.layoutDirection, - marginx: 20, - marginy: 20, - nodesep: 100, - edgesep: 100, - ranksep: 100 - }).setDefaultEdgeLabel(function () { - return {}; - }); // Draw the entities (at 0,0), returning the first svg node that got - // inserted - this represents the insertion point for relationship paths - - var firstEntity = drawEntities(svg, _erDb__WEBPACK_IMPORTED_MODULE_2__["default"].getEntities(), g); // TODO: externalise the addition of entities to the graph - it's a bit 'buried' in the above - // Add all the relationships to the graph - - var relationships = addRelationships(_erDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRelationships(), g); - dagre__WEBPACK_IMPORTED_MODULE_4___default.a.layout(g); // Node and edge positions will be updated - // Adjust the positions of the entities so that they adhere to the layout - - adjustEntities(svg, g); // Draw the relationships - - relationships.forEach(function (rel) { - drawRelationshipFromLayout(svg, rel, g, firstEntity); - }); - var padding = conf.diagramPadding; - var svgBounds = svg.node().getBBox(); - var width = svgBounds.width + padding * 2; - var height = svgBounds.height + padding * 2; - Object(_utils__WEBPACK_IMPORTED_MODULE_8__["configureSvgSize"])(svg, height, width, conf.useMaxWidth); - svg.attr('viewBox', "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height)); -}; // draw - -/* harmony default export */ __webpack_exports__["default"] = ({ - setConf: setConf, - draw: draw -}); - -/***/ }), - -/***/ "./src/diagrams/er/parser/erDiagram.jison": -/*!************************************************!*\ - !*** ./src/diagrams/er/parser/erDiagram.jison ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,5],$V2=[6,9,11,23,37],$V3=[1,17],$V4=[1,20],$V5=[1,25],$V6=[1,26],$V7=[1,27],$V8=[1,28],$V9=[1,37],$Va=[23,34,35],$Vb=[4,6,9,11,23,37],$Vc=[30,31,32,33],$Vd=[22,27]; -var parser = {trace: function trace () { }, -yy: {}, -symbols_: {"error":2,"start":3,"ER_DIAGRAM":4,"document":5,"EOF":6,"directive":7,"line":8,"SPACE":9,"statement":10,"NEWLINE":11,"openDirective":12,"typeDirective":13,"closeDirective":14,":":15,"argDirective":16,"entityName":17,"relSpec":18,"role":19,"BLOCK_START":20,"attributes":21,"BLOCK_STOP":22,"ALPHANUM":23,"attribute":24,"attributeType":25,"attributeName":26,"ATTRIBUTE_WORD":27,"cardinality":28,"relType":29,"ZERO_OR_ONE":30,"ZERO_OR_MORE":31,"ONE_OR_MORE":32,"ONLY_ONE":33,"NON_IDENTIFYING":34,"IDENTIFYING":35,"WORD":36,"open_directive":37,"type_directive":38,"arg_directive":39,"close_directive":40,"$accept":0,"$end":1}, -terminals_: {2:"error",4:"ER_DIAGRAM",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",20:"BLOCK_START",22:"BLOCK_STOP",23:"ALPHANUM",27:"ATTRIBUTE_WORD",30:"ZERO_OR_ONE",31:"ZERO_OR_MORE",32:"ONE_OR_MORE",33:"ONLY_ONE",34:"NON_IDENTIFYING",35:"IDENTIFYING",36:"WORD",37:"open_directive",38:"type_directive",39:"arg_directive",40:"close_directive"}, -productions_: [0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,5],[10,4],[10,3],[10,1],[17,1],[21,1],[21,2],[24,2],[25,1],[26,1],[18,3],[28,1],[28,1],[28,1],[28,1],[29,1],[29,1],[19,1],[19,1],[12,1],[13,1],[16,1],[14,1]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 1: - /*console.log('finished parsing');*/ -break; -case 3: - this.$ = [] -break; -case 4: -$$[$0-1].push($$[$0]);this.$ = $$[$0-1] -break; -case 5: case 6: - this.$ = $$[$0] -break; -case 7: case 8: - this.$=[]; -break; -case 12: - - yy.addEntity($$[$0-4]); - yy.addEntity($$[$0-2]); - yy.addRelationship($$[$0-4], $$[$0], $$[$0-2], $$[$0-3]); - /*console.log($$[$0-4] + $$[$0-3] + $$[$0-2] + ':' + $$[$0]);*/ - -break; -case 13: - - /* console.log('detected block'); */ - yy.addEntity($$[$0-3]); - yy.addAttributes($$[$0-3], $$[$0-1]); - /* console.log('handled block'); */ - -break; -case 14: - yy.addEntity($$[$0-2]); -break; -case 15: - yy.addEntity($$[$0]); -break; -case 16: - this.$ = $$[$0]; /*console.log('Entity: ' + $$[$0]);*/ -break; -case 17: - this.$ = [$$[$0]]; -break; -case 18: - $$[$0].push($$[$0-1]); this.$=$$[$0]; -break; -case 19: - this.$ = { attributeType: $$[$0-1], attributeName: $$[$0] }; -break; -case 20: case 21: - this.$=$$[$0]; -break; -case 22: - - this.$ = { cardA: $$[$0], relType: $$[$0-1], cardB: $$[$0-2] }; - /*console.log('relSpec: ' + $$[$0] + $$[$0-1] + $$[$0-2]);*/ - -break; -case 23: - this.$ = yy.Cardinality.ZERO_OR_ONE; -break; -case 24: - this.$ = yy.Cardinality.ZERO_OR_MORE; -break; -case 25: - this.$ = yy.Cardinality.ONE_OR_MORE; -break; -case 26: - this.$ = yy.Cardinality.ONLY_ONE; -break; -case 27: - this.$ = yy.Identification.NON_IDENTIFYING; -break; -case 28: - this.$ = yy.Identification.IDENTIFYING; -break; -case 29: - this.$ = $$[$0].replace(/"/g, ''); -break; -case 30: - this.$ = $$[$0]; -break; -case 31: - yy.parseDirective('%%{', 'open_directive'); -break; -case 32: - yy.parseDirective($$[$0], 'type_directive'); -break; -case 33: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); -break; -case 34: - yy.parseDirective('}%%', 'close_directive', 'er'); -break; -} -}, -table: [{3:1,4:$V0,7:3,12:4,37:$V1},{1:[3]},o($V2,[2,3],{5:6}),{3:7,4:$V0,7:3,12:4,37:$V1},{13:8,38:[1,9]},{38:[2,31]},{6:[1,10],7:15,8:11,9:[1,12],10:13,11:[1,14],12:4,17:16,23:$V3,37:$V1},{1:[2,2]},{14:18,15:[1,19],40:$V4},o([15,40],[2,32]),o($V2,[2,8],{1:[2,1]}),o($V2,[2,4]),{7:15,10:21,12:4,17:16,23:$V3,37:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,11]),o($V2,[2,15],{18:22,28:24,20:[1,23],30:$V5,31:$V6,32:$V7,33:$V8}),o([6,9,11,15,20,23,30,31,32,33,37],[2,16]),{11:[1,29]},{16:30,39:[1,31]},{11:[2,34]},o($V2,[2,5]),{17:32,23:$V3},{21:33,22:[1,34],24:35,25:36,27:$V9},{29:38,34:[1,39],35:[1,40]},o($Va,[2,23]),o($Va,[2,24]),o($Va,[2,25]),o($Va,[2,26]),o($Vb,[2,9]),{14:41,40:$V4},{40:[2,33]},{15:[1,42]},{22:[1,43]},o($V2,[2,14]),{21:44,22:[2,17],24:35,25:36,27:$V9},{26:45,27:[1,46]},{27:[2,20]},{28:47,30:$V5,31:$V6,32:$V7,33:$V8},o($Vc,[2,27]),o($Vc,[2,28]),{11:[1,48]},{19:49,23:[1,51],36:[1,50]},o($V2,[2,13]),{22:[2,18]},o($Vd,[2,19]),o($Vd,[2,21]),{23:[2,22]},o($Vb,[2,10]),o($V2,[2,12]),o($V2,[2,29]),o($V2,[2,30])], -defaultActions: {5:[2,31],7:[2,2],20:[2,34],31:[2,33],37:[2,20],44:[2,18],47:[2,22]}, -parseError: function parseError (str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - var error = new Error(str); - error.hash = hash; - throw error; - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = tstack.pop() || lexer.lex() || EOF; - if (typeof token !== 'number') { - if (token instanceof Array) { - tstack = token; - token = tstack.pop(); - } - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; - -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function(match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex () { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin (condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState () { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules () { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState (n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState (condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {"case-insensitive":true}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0: this.begin('open_directive'); return 37; -break; -case 1: this.begin('type_directive'); return 38; -break; -case 2: this.popState(); this.begin('arg_directive'); return 15; -break; -case 3: this.popState(); this.popState(); return 40; -break; -case 4:return 39; -break; -case 5:/* skip comments */ -break; -case 6:/* skip comments */ -break; -case 7:return 11; -break; -case 8:/* skip whitespace */ -break; -case 9:return 9; -break; -case 10:return 36; -break; -case 11:return 4; -break; -case 12: this.begin("block"); return 20; -break; -case 13:/* skip whitespace in block */ -break; -case 14: return 27; -break; -case 15:/* nothing */ -break; -case 16: this.popState(); return 22; -break; -case 17:return yy_.yytext[0]; -break; -case 18:return 30; -break; -case 19:return 31; -break; -case 20:return 32; -break; -case 21:return 33; -break; -case 22:return 30; -break; -case 23:return 31; -break; -case 24:return 32; -break; -case 25:return 34; -break; -case 26:return 35; -break; -case 27:return 34; -break; -case 28:return 34; -break; -case 29:return 23; -break; -case 30:return yy_.yytext[0]; -break; -case 31:return 6; -break; -} -}, -rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:\s+)/i,/^(?:[A-Za-z][A-Za-z0-9\-_]*)/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\|o\b)/i,/^(?:\}o\b)/i,/^(?:\}\|)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:[A-Za-z][A-Za-z0-9\-_]*)/i,/^(?:.)/i,/^(?:$)/i], -conditions: {"open_directive":{"rules":[1],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"block":{"rules":[13,14,15,16,17],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,12,18,19,20,21,22,23,24,25,26,27,28,29,30,31],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (true) { -exports.parser = parser; -exports.Parser = parser.Parser; -exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain (args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if ( true && __webpack_require__.c[__webpack_require__.s] === module) { - exports.main(process.argv.slice(1)); -} -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./src/diagrams/er/styles.js": -/*!***********************************!*\ - !*** ./src/diagrams/er/styles.js ***! - \***********************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -var getStyles = function getStyles(options) { - return "\n .entityBox {\n fill: ".concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n }\n\n .attributeBoxOdd {\n fill: #ffffff;\n stroke: ").concat(options.nodeBorder, ";\n }\n\n .attributeBoxEven {\n fill: #f2f2f2;\n stroke: ").concat(options.nodeBorder, ";\n }\n\n .relationshipLabelBox {\n fill: ").concat(options.tertiaryColor, ";\n opacity: 0.7;\n background-color: ").concat(options.tertiaryColor, ";\n rect {\n opacity: 0.5;\n }\n }\n\n .relationshipLine {\n stroke: ").concat(options.lineColor, ";\n }\n"); -}; - -/* harmony default export */ __webpack_exports__["default"] = (getStyles); - -/***/ }), - -/***/ "./src/diagrams/flowchart/flowChartShapes.js": -/*!***************************************************!*\ - !*** ./src/diagrams/flowchart/flowChartShapes.js ***! - \***************************************************/ -/*! exports provided: addToRender, addToRenderV2, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addToRender", function() { return addToRender; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addToRenderV2", function() { return addToRenderV2; }); -/* harmony import */ var dagre_d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dagre-d3 */ "dagre-d3"); -/* harmony import */ var dagre_d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dagre_d3__WEBPACK_IMPORTED_MODULE_0__); - - -function question(parent, bbox, node) { - var w = bbox.width; - var h = bbox.height; - var s = (w + h) * 0.9; - var points = [{ - x: s / 2, - y: 0 - }, { - x: s, - y: -s / 2 - }, { - x: s / 2, - y: -s - }, { - x: 0, - y: -s / 2 - }]; - var shapeSvg = insertPolygonShape(parent, s, s, points); - - node.intersect = function (point) { - return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point); - }; - - return shapeSvg; -} - -function hexagon(parent, bbox, node) { - var f = 4; - var h = bbox.height; - var m = h / f; - var w = bbox.width + 2 * m; - var points = [{ - x: m, - y: 0 - }, { - x: w - m, - y: 0 - }, { - x: w, - y: -h / 2 - }, { - x: w - m, - y: -h - }, { - x: m, - y: -h - }, { - x: 0, - y: -h / 2 - }]; - var shapeSvg = insertPolygonShape(parent, w, h, points); - - node.intersect = function (point) { - return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point); - }; - - return shapeSvg; -} - -function rect_left_inv_arrow(parent, bbox, node) { - var w = bbox.width; - var h = bbox.height; - var points = [{ - x: -h / 2, - y: 0 - }, { - x: w, - y: 0 - }, { - x: w, - y: -h - }, { - x: -h / 2, - y: -h - }, { - x: 0, - y: -h / 2 - }]; - var shapeSvg = insertPolygonShape(parent, w, h, points); - - node.intersect = function (point) { - return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point); - }; - - return shapeSvg; -} - -function lean_right(parent, bbox, node) { - var w = bbox.width; - var h = bbox.height; - var points = [{ - x: -2 * h / 6, - y: 0 - }, { - x: w - h / 6, - y: 0 - }, { - x: w + 2 * h / 6, - y: -h - }, { - x: h / 6, - y: -h - }]; - var shapeSvg = insertPolygonShape(parent, w, h, points); - - node.intersect = function (point) { - return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point); - }; - - return shapeSvg; -} - -function lean_left(parent, bbox, node) { - var w = bbox.width; - var h = bbox.height; - var points = [{ - x: 2 * h / 6, - y: 0 - }, { - x: w + h / 6, - y: 0 - }, { - x: w - 2 * h / 6, - y: -h - }, { - x: -h / 6, - y: -h - }]; - var shapeSvg = insertPolygonShape(parent, w, h, points); - - node.intersect = function (point) { - return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point); - }; - - return shapeSvg; -} - -function trapezoid(parent, bbox, node) { - var w = bbox.width; - var h = bbox.height; - var points = [{ - x: -2 * h / 6, - y: 0 - }, { - x: w + 2 * h / 6, - y: 0 - }, { - x: w - h / 6, - y: -h - }, { - x: h / 6, - y: -h - }]; - var shapeSvg = insertPolygonShape(parent, w, h, points); - - node.intersect = function (point) { - return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point); - }; - - return shapeSvg; -} - -function inv_trapezoid(parent, bbox, node) { - var w = bbox.width; - var h = bbox.height; - var points = [{ - x: h / 6, - y: 0 - }, { - x: w - h / 6, - y: 0 - }, { - x: w + 2 * h / 6, - y: -h - }, { - x: -2 * h / 6, - y: -h - }]; - var shapeSvg = insertPolygonShape(parent, w, h, points); - - node.intersect = function (point) { - return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point); - }; - - return shapeSvg; -} - -function rect_right_inv_arrow(parent, bbox, node) { - var w = bbox.width; - var h = bbox.height; - var points = [{ - x: 0, - y: 0 - }, { - x: w + h / 2, - y: 0 - }, { - x: w, - y: -h / 2 - }, { - x: w + h / 2, - y: -h - }, { - x: 0, - y: -h - }]; - var shapeSvg = insertPolygonShape(parent, w, h, points); - - node.intersect = function (point) { - return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point); - }; - - return shapeSvg; -} - -function stadium(parent, bbox, node) { - var h = bbox.height; - var w = bbox.width + h / 4; - var shapeSvg = parent.insert('rect', ':first-child').attr('rx', h / 2).attr('ry', h / 2).attr('x', -w / 2).attr('y', -h / 2).attr('width', w).attr('height', h); - - node.intersect = function (point) { - return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.rect(node, point); - }; - - return shapeSvg; -} - -function subroutine(parent, bbox, node) { - var w = bbox.width; - var h = bbox.height; - var points = [{ - x: 0, - y: 0 - }, { - x: w, - y: 0 - }, { - x: w, - y: -h - }, { - x: 0, - y: -h - }, { - x: 0, - y: 0 - }, { - x: -8, - y: 0 - }, { - x: w + 8, - y: 0 - }, { - x: w + 8, - y: -h - }, { - x: -8, - y: -h - }, { - x: -8, - y: 0 - }]; - var shapeSvg = insertPolygonShape(parent, w, h, points); - - node.intersect = function (point) { - return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point); - }; - - return shapeSvg; -} - -function cylinder(parent, bbox, node) { - var w = bbox.width; - var rx = w / 2; - var ry = rx / (2.5 + w / 50); - var h = bbox.height + ry; - var shape = 'M 0,' + ry + ' a ' + rx + ',' + ry + ' 0,0,0 ' + w + ' 0 a ' + rx + ',' + ry + ' 0,0,0 ' + -w + ' 0 l 0,' + h + ' a ' + rx + ',' + ry + ' 0,0,0 ' + w + ' 0 l 0,' + -h; - var shapeSvg = parent.attr('label-offset-y', ry).insert('path', ':first-child').attr('d', shape).attr('transform', 'translate(' + -w / 2 + ',' + -(h / 2 + ry) + ')'); - - node.intersect = function (point) { - var pos = dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.rect(node, point); - var x = pos.x - node.x; - - if (rx != 0 && (Math.abs(x) < node.width / 2 || Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry)) { - // ellipsis equation: x*x / a*a + y*y / b*b = 1 - // solve for y to get adjustion value for pos.y - var y = ry * ry * (1 - x * x / (rx * rx)); - if (y != 0) y = Math.sqrt(y); - y = ry - y; - if (point.y - node.y > 0) y = -y; - pos.y += y; - } - - return pos; - }; - - return shapeSvg; -} - -function addToRender(render) { - render.shapes().question = question; - render.shapes().hexagon = hexagon; - render.shapes().stadium = stadium; - render.shapes().subroutine = subroutine; - render.shapes().cylinder = cylinder; // Add custom shape for box with inverted arrow on left side - - render.shapes().rect_left_inv_arrow = rect_left_inv_arrow; // Add custom shape for box with inverted arrow on left side - - render.shapes().lean_right = lean_right; // Add custom shape for box with inverted arrow on left side - - render.shapes().lean_left = lean_left; // Add custom shape for box with inverted arrow on left side - - render.shapes().trapezoid = trapezoid; // Add custom shape for box with inverted arrow on left side - - render.shapes().inv_trapezoid = inv_trapezoid; // Add custom shape for box with inverted arrow on right side - - render.shapes().rect_right_inv_arrow = rect_right_inv_arrow; -} -function addToRenderV2(addShape) { - addShape({ - question: question - }); - addShape({ - hexagon: hexagon - }); - addShape({ - stadium: stadium - }); - addShape({ - subroutine: subroutine - }); - addShape({ - cylinder: cylinder - }); // Add custom shape for box with inverted arrow on left side - - addShape({ - rect_left_inv_arrow: rect_left_inv_arrow - }); // Add custom shape for box with inverted arrow on left side - - addShape({ - lean_right: lean_right - }); // Add custom shape for box with inverted arrow on left side - - addShape({ - lean_left: lean_left - }); // Add custom shape for box with inverted arrow on left side - - addShape({ - trapezoid: trapezoid - }); // Add custom shape for box with inverted arrow on left side - - addShape({ - inv_trapezoid: inv_trapezoid - }); // Add custom shape for box with inverted arrow on right side - - addShape({ - rect_right_inv_arrow: rect_right_inv_arrow - }); -} - -function insertPolygonShape(parent, w, h, points) { - return parent.insert('polygon', ':first-child').attr('points', points.map(function (d) { - return d.x + ',' + d.y; - }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')'); -} - -/* harmony default export */ __webpack_exports__["default"] = ({ - addToRender: addToRender, - addToRenderV2: addToRenderV2 -}); - -/***/ }), - -/***/ "./src/diagrams/flowchart/flowDb.js": -/*!******************************************!*\ - !*** ./src/diagrams/flowchart/flowDb.js ***! - \******************************************/ -/*! exports provided: parseDirective, lookUpDomId, addVertex, addSingleLink, addLink, updateLinkInterpolate, updateLink, addClass, setDirection, setClass, setLink, getTooltip, setClickEvent, bindFunctions, getDirection, getVertices, getEdges, getClasses, clear, setGen, defaultStyle, addSubGraph, getDepthFirstPos, indexNodes, getSubGraphs, firstGraph, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDirective", function() { return parseDirective; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lookUpDomId", function() { return lookUpDomId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVertex", function() { return addVertex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSingleLink", function() { return addSingleLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addLink", function() { return addLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateLinkInterpolate", function() { return updateLinkInterpolate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateLink", function() { return updateLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDirection", function() { return setDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClass", function() { return setClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLink", function() { return setLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTooltip", function() { return getTooltip; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClickEvent", function() { return setClickEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindFunctions", function() { return bindFunctions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDirection", function() { return getDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVertices", function() { return getVertices; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEdges", function() { return getEdges; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setGen", function() { return setGen; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultStyle", function() { return defaultStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSubGraph", function() { return addSubGraph; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDepthFirstPos", function() { return getDepthFirstPos; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "indexNodes", function() { return indexNodes; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSubGraphs", function() { return getSubGraphs; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstGraph", function() { return firstGraph; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); -/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - - - - - - - -var MERMAID_DOM_ID_PREFIX = 'flowchart-'; -var vertexCounter = 0; -var config = _config__WEBPACK_IMPORTED_MODULE_2__["getConfig"](); -var vertices = {}; -var edges = []; -var classes = []; -var subGraphs = []; -var subGraphLookup = {}; -var tooltips = {}; -var subCount = 0; -var firstGraphFlag = true; -var direction; -var version; // As in graph -// Functions to be run after graph rendering - -var funs = []; -var parseDirective = function parseDirective(statement, context, type) { - _mermaidAPI__WEBPACK_IMPORTED_MODULE_4__["default"].parseDirective(this, statement, context, type); -}; -/** - * Function to lookup domId from id in the graph definition. - * @param id - * @public - */ - -var lookUpDomId = function lookUpDomId(id) { - var veritceKeys = Object.keys(vertices); - - for (var i = 0; i < veritceKeys.length; i++) { - if (vertices[veritceKeys[i]].id === id) { - return vertices[veritceKeys[i]].domId; - } - } - - return id; -}; -/** - * Function called by parser when a node definition has been found - * @param id - * @param text - * @param type - * @param style - * @param classes - */ - -var addVertex = function addVertex(_id, text, type, style, classes) { - var txt; - var id = _id; - - if (typeof id === 'undefined') { - return; - } - - if (id.trim().length === 0) { - return; - } // if (id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id; - - - if (typeof vertices[id] === 'undefined') { - vertices[id] = { - id: id, - domId: MERMAID_DOM_ID_PREFIX + id + '-' + vertexCounter, - styles: [], - classes: [] - }; - } - - vertexCounter++; - - if (typeof text !== 'undefined') { - config = _config__WEBPACK_IMPORTED_MODULE_2__["getConfig"](); - txt = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(text.trim(), config); // strip quotes if string starts and ends with a quote - - if (txt[0] === '"' && txt[txt.length - 1] === '"') { - txt = txt.substring(1, txt.length - 1); - } - - vertices[id].text = txt; - } else { - if (typeof vertices[id].text === 'undefined') { - vertices[id].text = _id; - } - } - - if (typeof type !== 'undefined') { - vertices[id].type = type; - } - - if (typeof style !== 'undefined') { - if (style !== null) { - style.forEach(function (s) { - vertices[id].styles.push(s); - }); - } - } - - if (typeof classes !== 'undefined') { - if (classes !== null) { - classes.forEach(function (s) { - vertices[id].classes.push(s); - }); - } - } -}; -/** - * Function called by parser when a link/edge definition has been found - * @param start - * @param end - * @param type - * @param linktext - */ - -var addSingleLink = function addSingleLink(_start, _end, type, linktext) { - var start = _start; - var end = _end; // if (start[0].match(/\d/)) start = MERMAID_DOM_ID_PREFIX + start; - // if (end[0].match(/\d/)) end = MERMAID_DOM_ID_PREFIX + end; - // log.info('Got edge...', start, end); - - var edge = { - start: start, - end: end, - type: undefined, - text: '' - }; - linktext = type.text; - - if (typeof linktext !== 'undefined') { - edge.text = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(linktext.trim(), config); // strip quotes if string starts and exnds with a quote - - if (edge.text[0] === '"' && edge.text[edge.text.length - 1] === '"') { - edge.text = edge.text.substring(1, edge.text.length - 1); - } - } - - if (typeof type !== 'undefined') { - edge.type = type.type; - edge.stroke = type.stroke; - edge.length = type.length; - } - - edges.push(edge); -}; -var addLink = function addLink(_start, _end, type, linktext) { - var i, j; - - for (i = 0; i < _start.length; i++) { - for (j = 0; j < _end.length; j++) { - addSingleLink(_start[i], _end[j], type, linktext); - } - } -}; -/** - * Updates a link's line interpolation algorithm - * @param pos - * @param interpolate - */ - -var updateLinkInterpolate = function updateLinkInterpolate(positions, interp) { - positions.forEach(function (pos) { - if (pos === 'default') { - edges.defaultInterpolate = interp; - } else { - edges[pos].interpolate = interp; - } - }); -}; -/** - * Updates a link with a style - * @param pos - * @param style - */ - -var updateLink = function updateLink(positions, style) { - positions.forEach(function (pos) { - if (pos === 'default') { - edges.defaultStyle = style; - } else { - if (_utils__WEBPACK_IMPORTED_MODULE_1__["default"].isSubstringInArray('fill', style) === -1) { - style.push('fill:none'); - } - - edges[pos].style = style; - } - }); -}; -var addClass = function addClass(id, style) { - if (typeof classes[id] === 'undefined') { - classes[id] = { - id: id, - styles: [], - textStyles: [] - }; - } - - if (typeof style !== 'undefined') { - if (style !== null) { - style.forEach(function (s) { - if (s.match('color')) { - var newStyle1 = s.replace('fill', 'bgFill'); - var newStyle2 = newStyle1.replace('color', 'fill'); - classes[id].textStyles.push(newStyle2); - } - - classes[id].styles.push(s); - }); - } - } -}; -/** - * Called by parser when a graph definition is found, stores the direction of the chart. - * @param dir - */ - -var setDirection = function setDirection(dir) { - direction = dir; - - if (direction.match(/.*/)) { - direction = 'LR'; - } - - if (direction.match(/.*v/)) { - direction = 'TB'; - } -}; -/** - * Called by parser when a special node is found, e.g. a clickable element. - * @param ids Comma separated list of ids - * @param className Class to add - */ - -var setClass = function setClass(ids, className) { - ids.split(',').forEach(function (_id) { - // let id = version === 'gen-2' ? lookUpDomId(_id) : _id; - var id = _id; // if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id; - - if (typeof vertices[id] !== 'undefined') { - vertices[id].classes.push(className); - } - - if (typeof subGraphLookup[id] !== 'undefined') { - subGraphLookup[id].classes.push(className); - } - }); -}; - -var setTooltip = function setTooltip(ids, tooltip) { - ids.split(',').forEach(function (id) { - if (typeof tooltip !== 'undefined') { - tooltips[version === 'gen-1' ? lookUpDomId(id) : id] = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(tooltip, config); - } - }); -}; - -var setClickFun = function setClickFun(id, functionName, functionArgs) { - var domId = lookUpDomId(id); // if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id; - - if (_config__WEBPACK_IMPORTED_MODULE_2__["getConfig"]().securityLevel !== 'loose') { - return; - } - - if (typeof functionName === 'undefined') { - return; - } - - var argList = []; - - if (typeof functionArgs === 'string') { - /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */ - argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); - - for (var i = 0; i < argList.length; i++) { - var item = argList[i].trim(); - /* Removes all double quotes at the start and end of an argument */ - - /* This preserves all starting and ending whitespace inside */ - - if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') { - item = item.substr(1, item.length - 2); - } - - argList[i] = item; - } - } - /* if no arguments passed into callback, default to passing in id */ - - - if (argList.length === 0) { - argList.push(id); - } - - if (typeof vertices[id] !== 'undefined') { - vertices[id].haveCallback = true; - funs.push(function () { - var elem = document.querySelector("[id=\"".concat(domId, "\"]")); - - if (elem !== null) { - elem.addEventListener('click', function () { - _utils__WEBPACK_IMPORTED_MODULE_1__["default"].runFunc.apply(_utils__WEBPACK_IMPORTED_MODULE_1__["default"], [functionName].concat(_toConsumableArray(argList))); - }, false); - } - }); - } -}; -/** - * Called by parser when a link is found. Adds the URL to the vertex data. - * @param ids Comma separated list of ids - * @param linkStr URL to create a link for - */ - - -var setLink = function setLink(ids, linkStr, target) { - ids.split(',').forEach(function (id) { - if (typeof vertices[id] !== 'undefined') { - vertices[id].link = _utils__WEBPACK_IMPORTED_MODULE_1__["default"].formatUrl(linkStr, config); - vertices[id].linkTarget = target; - } - }); - setClass(ids, 'clickable'); -}; -var getTooltip = function getTooltip(id) { - return tooltips[id]; -}; -/** - * Called by parser when a click definition is found. Registers an event handler. - * @param ids Comma separated list of ids - * @param functionName Function to be called on click - * @param tooltip Tooltip for the clickable element - */ - -var setClickEvent = function setClickEvent(ids, functionName, functionArgs) { - ids.split(',').forEach(function (id) { - setClickFun(id, functionName, functionArgs); - }); - setClass(ids, 'clickable'); -}; -var bindFunctions = function bindFunctions(element) { - funs.forEach(function (fun) { - fun(element); - }); -}; -var getDirection = function getDirection() { - return direction.trim(); -}; -/** - * Retrieval function for fetching the found nodes after parsing has completed. - * @returns {{}|*|vertices} - */ - -var getVertices = function getVertices() { - return vertices; -}; -/** - * Retrieval function for fetching the found links after parsing has completed. - * @returns {{}|*|edges} - */ - -var getEdges = function getEdges() { - return edges; -}; -/** - * Retrieval function for fetching the found class definitions after parsing has completed. - * @returns {{}|*|classes} - */ - -var getClasses = function getClasses() { - return classes; -}; - -var setupToolTips = function setupToolTips(element) { - var tooltipElem = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('.mermaidTooltip'); - - if ((tooltipElem._groups || tooltipElem)[0][0] === null) { - tooltipElem = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0); - } - - var svg = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])(element).select('svg'); - var nodes = svg.selectAll('g.node'); - nodes.on('mouseover', function () { - var el = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])(this); - var title = el.attr('title'); // Dont try to draw a tooltip if no data is provided - - if (title === null) { - return; - } - - var rect = this.getBoundingClientRect(); - tooltipElem.transition().duration(200).style('opacity', '.9'); - tooltipElem.html(el.attr('title')).style('left', window.scrollX + rect.left + (rect.right - rect.left) / 2 + 'px').style('top', window.scrollY + rect.top - 14 + document.body.scrollTop + 'px'); - el.classed('hover', true); - }).on('mouseout', function () { - tooltipElem.transition().duration(500).style('opacity', 0); - var el = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])(this); - el.classed('hover', false); - }); -}; - -funs.push(setupToolTips); -/** - * Clears the internal graph db so that a new graph can be parsed. - */ - -var clear = function clear(ver) { - vertices = {}; - classes = {}; - edges = []; - funs = []; - funs.push(setupToolTips); - subGraphs = []; - subGraphLookup = {}; - subCount = 0; - tooltips = []; - firstGraphFlag = true; - version = ver || 'gen-1'; -}; -var setGen = function setGen(ver) { - version = ver || 'gen-1'; -}; -/** - * - * @returns {string} - */ - -var defaultStyle = function defaultStyle() { - return 'fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;'; -}; -/** - * Clears the internal graph db so that a new graph can be parsed. - */ - -var addSubGraph = function addSubGraph(_id, list, _title) { - var id = _id.trim(); - - var title = _title; - - if (_id === _title && _title.match(/\s/)) { - id = undefined; - } - - function uniq(a) { - var prims = { - boolean: {}, - number: {}, - string: {} - }; - var objs = []; - return a.filter(function (item) { - var type = _typeof(item); - - if (item.trim() === '') { - return false; - } - - if (type in prims) { - return prims[type].hasOwnProperty(item) ? false : prims[type][item] = true; // eslint-disable-line - } else { - return objs.indexOf(item) >= 0 ? false : objs.push(item); - } - }); - } - - var nodeList = []; - nodeList = uniq(nodeList.concat.apply(nodeList, list)); - - if (version === 'gen-1') { - _logger__WEBPACK_IMPORTED_MODULE_5__["log"].warn('LOOKING UP'); - - for (var i = 0; i < nodeList.length; i++) { - nodeList[i] = lookUpDomId(nodeList[i]); - } - } - - id = id || 'subGraph' + subCount; // if (id[0].match(/\d/)) id = lookUpDomId(id); - - title = title || ''; - title = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(title, config); - subCount = subCount + 1; - var subGraph = { - id: id, - nodes: nodeList, - title: title.trim(), - classes: [] - }; - _logger__WEBPACK_IMPORTED_MODULE_5__["log"].info('Adding', subGraph.id, subGraph.nodes); - /** - * Deletes an id from all subgraphs - */ - // const del = _id => { - // subGraphs.forEach(sg => { - // const pos = sg.nodes.indexOf(_id); - // if (pos >= 0) { - // sg.nodes.splice(pos, 1); - // } - // }); - // }; - // // Removes the members of this subgraph from any other subgraphs, a node only belong to one subgraph - // subGraph.nodes.forEach(_id => del(_id)); - // Remove the members in the new subgraph if they already belong to another subgraph - - subGraph.nodes = makeUniq(subGraph, subGraphs).nodes; - subGraphs.push(subGraph); - subGraphLookup[id] = subGraph; - return id; -}; - -var getPosForId = function getPosForId(id) { - for (var i = 0; i < subGraphs.length; i++) { - if (subGraphs[i].id === id) { - return i; - } - } - - return -1; -}; - -var secCount = -1; -var posCrossRef = []; - -var indexNodes2 = function indexNodes2(id, pos) { - var nodes = subGraphs[pos].nodes; - secCount = secCount + 1; - - if (secCount > 2000) { - return; - } - - posCrossRef[secCount] = pos; // Check if match - - if (subGraphs[pos].id === id) { - return { - result: true, - count: 0 - }; - } - - var count = 0; - var posCount = 1; - - while (count < nodes.length) { - var childPos = getPosForId(nodes[count]); // Ignore regular nodes (pos will be -1) - - if (childPos >= 0) { - var res = indexNodes2(id, childPos); - - if (res.result) { - return { - result: true, - count: posCount + res.count - }; - } else { - posCount = posCount + res.count; - } - } - - count = count + 1; - } - - return { - result: false, - count: posCount - }; -}; - -var getDepthFirstPos = function getDepthFirstPos(pos) { - return posCrossRef[pos]; -}; -var indexNodes = function indexNodes() { - secCount = -1; - - if (subGraphs.length > 0) { - indexNodes2('none', subGraphs.length - 1, 0); - } -}; -var getSubGraphs = function getSubGraphs() { - return subGraphs; -}; -var firstGraph = function firstGraph() { - if (firstGraphFlag) { - firstGraphFlag = false; - return true; - } - - return false; -}; - -var destructStartLink = function destructStartLink(_str) { - var str = _str.trim(); - - var type = 'arrow_open'; - - switch (str[0]) { - case '<': - type = 'arrow_point'; - str = str.slice(1); - break; - - case 'x': - type = 'arrow_cross'; - str = str.slice(1); - break; - - case 'o': - type = 'arrow_circle'; - str = str.slice(1); - break; - } - - var stroke = 'normal'; - - if (str.indexOf('=') !== -1) { - stroke = 'thick'; - } - - if (str.indexOf('.') !== -1) { - stroke = 'dotted'; - } - - return { - type: type, - stroke: stroke - }; -}; - -var countChar = function countChar(char, str) { - var length = str.length; - var count = 0; - - for (var i = 0; i < length; ++i) { - if (str[i] === char) { - ++count; - } - } - - return count; -}; - -var destructEndLink = function destructEndLink(_str) { - var str = _str.trim(); - - var line = str.slice(0, -1); - var type = 'arrow_open'; - - switch (str.slice(-1)) { - case 'x': - type = 'arrow_cross'; - - if (str[0] === 'x') { - type = 'double_' + type; - line = line.slice(1); - } - - break; - - case '>': - type = 'arrow_point'; - - if (str[0] === '<') { - type = 'double_' + type; - line = line.slice(1); - } - - break; - - case 'o': - type = 'arrow_circle'; - - if (str[0] === 'o') { - type = 'double_' + type; - line = line.slice(1); - } - - break; - } - - var stroke = 'normal'; - var length = line.length - 1; - - if (line[0] === '=') { - stroke = 'thick'; - } - - var dots = countChar('.', line); - - if (dots) { - stroke = 'dotted'; - length = dots; - } - - return { - type: type, - stroke: stroke, - length: length - }; -}; - -var destructLink = function destructLink(_str, _startStr) { - var info = destructEndLink(_str); - var startInfo; - - if (_startStr) { - startInfo = destructStartLink(_startStr); - - if (startInfo.stroke !== info.stroke) { - return { - type: 'INVALID', - stroke: 'INVALID' - }; - } - - if (startInfo.type === 'arrow_open') { - // -- xyz --> - take arrow type from ending - startInfo.type = info.type; - } else { - // x-- xyz --> - not supported - if (startInfo.type !== info.type) return { - type: 'INVALID', - stroke: 'INVALID' - }; - startInfo.type = 'double_' + startInfo.type; - } - - if (startInfo.type === 'double_arrow') { - startInfo.type = 'double_arrow_point'; - } - - startInfo.length = info.length; - return startInfo; - } - - return info; -}; // Todo optimizer this by caching existing nodes - - -var exists = function exists(allSgs, _id) { - var res = false; - allSgs.forEach(function (sg) { - var pos = sg.nodes.indexOf(_id); - - if (pos >= 0) { - res = true; - } - }); - return res; -}; -/** - * Deletes an id from all subgraphs - */ - - -var makeUniq = function makeUniq(sg, allSubgraphs) { - var res = []; - sg.nodes.forEach(function (_id, pos) { - if (!exists(allSubgraphs, _id)) { - res.push(sg.nodes[pos]); - } - }); - return { - nodes: res - }; -}; - -/* harmony default export */ __webpack_exports__["default"] = ({ - parseDirective: parseDirective, - defaultConfig: function defaultConfig() { - return _config__WEBPACK_IMPORTED_MODULE_2__["defaultConfig"].flowchart; - }, - addVertex: addVertex, - lookUpDomId: lookUpDomId, - addLink: addLink, - updateLinkInterpolate: updateLinkInterpolate, - updateLink: updateLink, - addClass: addClass, - setDirection: setDirection, - setClass: setClass, - setTooltip: setTooltip, - getTooltip: getTooltip, - setClickEvent: setClickEvent, - setLink: setLink, - bindFunctions: bindFunctions, - getDirection: getDirection, - getVertices: getVertices, - getEdges: getEdges, - getClasses: getClasses, - clear: clear, - setGen: setGen, - defaultStyle: defaultStyle, - addSubGraph: addSubGraph, - getDepthFirstPos: getDepthFirstPos, - indexNodes: indexNodes, - getSubGraphs: getSubGraphs, - destructLink: destructLink, - lex: { - firstGraph: firstGraph - }, - exists: exists, - makeUniq: makeUniq -}); - -/***/ }), - -/***/ "./src/diagrams/flowchart/flowRenderer-v2.js": -/*!***************************************************!*\ - !*** ./src/diagrams/flowchart/flowRenderer-v2.js ***! - \***************************************************/ -/*! exports provided: setConf, addVertices, addEdges, getClasses, draw, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVertices", function() { return addVertices; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEdges", function() { return addEdges; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! graphlib */ "graphlib"); -/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _flowDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flowDb */ "./src/diagrams/flowchart/flowDb.js"); -/* harmony import */ var _parser_flow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/flow */ "./src/diagrams/flowchart/parser/flow.jison"); -/* harmony import */ var _parser_flow__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_flow__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _dagre_wrapper_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../dagre-wrapper/index.js */ "./src/dagre-wrapper/index.js"); -/* harmony import */ var dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! dagre-d3/lib/label/add-html-label.js */ "dagre-d3/lib/label/add-html-label.js"); -/* harmony import */ var dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); - - - - - - - - - - -var conf = {}; -var setConf = function setConf(cnf) { - var keys = Object.keys(cnf); - - for (var i = 0; i < keys.length; i++) { - conf[keys[i]] = cnf[keys[i]]; - } -}; -/** - * Function that adds the vertices found during parsing to the graph to be rendered. - * @param vert Object containing the vertices. - * @param g The graph that is to be drawn. - */ - -var addVertices = function addVertices(vert, g, svgId) { - var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(svgId, "\"]")); - var keys = Object.keys(vert); // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition - - keys.forEach(function (id) { - var vertex = vert[id]; - /** - * Variable for storing the classes for the vertex - * @type {string} - */ - - var classStr = 'default'; - - if (vertex.classes.length > 0) { - classStr = vertex.classes.join(' '); - } - - var styles = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["getStylesFromArray"])(vertex.styles); // Use vertex id as text in the box if no text is provided by the graph definition - - var vertexText = vertex.text !== undefined ? vertex.text : vertex.id; // We create a SVG label, either by delegating to addHtmlLabel or manually - - var vertexNode; - - if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) { - // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that? - var node = { - label: vertexText.replace(/fa[lrsb]?:fa-[\w-]+/g, function (s) { - return ""); - }) - }; - vertexNode = dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6___default()(svg, node).node(); - vertexNode.parentNode.removeChild(vertexNode); - } else { - var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text'); - svgLabel.setAttribute('style', styles.labelStyle.replace('color:', 'fill:')); - var rows = vertexText.split(_common_common__WEBPACK_IMPORTED_MODULE_8__["default"].lineBreakRegex); - - for (var j = 0; j < rows.length; j++) { - var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); - tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve'); - tspan.setAttribute('dy', '1em'); - tspan.setAttribute('x', '1'); - tspan.textContent = rows[j]; - svgLabel.appendChild(tspan); - } - - vertexNode = svgLabel; - } - - var radious = 0; - var _shape = ''; // Set the shape based parameters - - switch (vertex.type) { - case 'round': - radious = 5; - _shape = 'rect'; - break; - - case 'square': - _shape = 'rect'; - break; - - case 'diamond': - _shape = 'question'; - break; - - case 'hexagon': - _shape = 'hexagon'; - break; - - case 'odd': - _shape = 'rect_left_inv_arrow'; - break; - - case 'lean_right': - _shape = 'lean_right'; - break; - - case 'lean_left': - _shape = 'lean_left'; - break; - - case 'trapezoid': - _shape = 'trapezoid'; - break; - - case 'inv_trapezoid': - _shape = 'inv_trapezoid'; - break; - - case 'odd_right': - _shape = 'rect_left_inv_arrow'; - break; - - case 'circle': - _shape = 'circle'; - break; - - case 'ellipse': - _shape = 'ellipse'; - break; - - case 'stadium': - _shape = 'stadium'; - break; - - case 'subroutine': - _shape = 'subroutine'; - break; - - case 'cylinder': - _shape = 'cylinder'; - break; - - case 'group': - _shape = 'rect'; - break; - - default: - _shape = 'rect'; - } // Add the node - - - g.setNode(vertex.id, { - labelStyle: styles.labelStyle, - shape: _shape, - labelText: vertexText, - rx: radious, - ry: radious, - class: classStr, - style: styles.style, - id: vertex.id, - link: vertex.link, - linkTarget: vertex.linkTarget, - tooltip: _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getTooltip(vertex.id) || '', - domId: _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(vertex.id), - haveCallback: vertex.haveCallback, - width: vertex.type === 'group' ? 500 : undefined, - type: vertex.type, - padding: Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.padding - }); - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('setNode', { - labelStyle: styles.labelStyle, - shape: _shape, - labelText: vertexText, - rx: radious, - ry: radious, - class: classStr, - style: styles.style, - id: vertex.id, - domId: _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(vertex.id), - width: vertex.type === 'group' ? 500 : undefined, - type: vertex.type, - padding: Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.padding - }); - }); -}; -/** - * Add edges to graph based on parsed graph defninition - * @param {Object} edges The edges to add to the graph - * @param {Object} g The graph object - */ - -var addEdges = function addEdges(edges, g) { - var cnt = 0; - var defaultStyle; - var defaultLabelStyle; - - if (typeof edges.defaultStyle !== 'undefined') { - var defaultStyles = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["getStylesFromArray"])(edges.defaultStyle); - defaultStyle = defaultStyles.style; - defaultLabelStyle = defaultStyles.labelStyle; - } - - edges.forEach(function (edge) { - cnt++; // Identify Link - - var linkId = 'L-' + edge.start + '-' + edge.end; - var linkNameStart = 'LS-' + edge.start; - var linkNameEnd = 'LE-' + edge.end; - var edgeData = { - style: '', - labelStyle: '' - }; - edgeData.minlen = edge.length || 1; //edgeData.id = 'id' + cnt; - // Set link type for rendering - - if (edge.type === 'arrow_open') { - edgeData.arrowhead = 'none'; - } else { - edgeData.arrowhead = 'normal'; - } // Check of arrow types, placed here in order not to break old rendering - - - edgeData.arrowTypeStart = 'arrow_open'; - edgeData.arrowTypeEnd = 'arrow_open'; - /* eslint-disable no-fallthrough */ - - switch (edge.type) { - case 'double_arrow_cross': - edgeData.arrowTypeStart = 'arrow_cross'; - - case 'arrow_cross': - edgeData.arrowTypeEnd = 'arrow_cross'; - break; - - case 'double_arrow_point': - edgeData.arrowTypeStart = 'arrow_point'; - - case 'arrow_point': - edgeData.arrowTypeEnd = 'arrow_point'; - break; - - case 'double_arrow_circle': - edgeData.arrowTypeStart = 'arrow_circle'; - - case 'arrow_circle': - edgeData.arrowTypeEnd = 'arrow_circle'; - break; - } - - var style = ''; - var labelStyle = ''; - - switch (edge.stroke) { - case 'normal': - style = 'fill:none;'; - - if (typeof defaultStyle !== 'undefined') { - style = defaultStyle; - } - - if (typeof defaultLabelStyle !== 'undefined') { - labelStyle = defaultLabelStyle; - } - - edgeData.thickness = 'normal'; - edgeData.pattern = 'solid'; - break; - - case 'dotted': - edgeData.thickness = 'normal'; - edgeData.pattern = 'dotted'; - edgeData.style = 'fill:none;stroke-width:2px;stroke-dasharray:3;'; - break; - - case 'thick': - edgeData.thickness = 'thick'; - edgeData.pattern = 'solid'; - edgeData.style = 'stroke-width: 3.5px;fill:none;'; - break; - } - - if (typeof edge.style !== 'undefined') { - var styles = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["getStylesFromArray"])(edge.style); - style = styles.style; - labelStyle = styles.labelStyle; - } - - edgeData.style = edgeData.style += style; - edgeData.labelStyle = edgeData.labelStyle += labelStyle; - - if (typeof edge.interpolate !== 'undefined') { - edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["interpolateToCurve"])(edge.interpolate, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]); - } else if (typeof edges.defaultInterpolate !== 'undefined') { - edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["interpolateToCurve"])(edges.defaultInterpolate, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]); - } else { - edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["interpolateToCurve"])(conf.curve, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]); - } - - if (typeof edge.text === 'undefined') { - if (typeof edge.style !== 'undefined') { - edgeData.arrowheadStyle = 'fill: #333'; - } - } else { - edgeData.arrowheadStyle = 'fill: #333'; - edgeData.labelpos = 'c'; - } // if (getConfig().flowchart.htmlLabels && false) { - // // eslint-disable-line - // edgeData.labelType = 'html'; - // edgeData.label = `${edge.text}`; - // } else { - - - edgeData.labelType = 'text'; - edgeData.label = edge.text.replace(_common_common__WEBPACK_IMPORTED_MODULE_8__["default"].lineBreakRegex, '\n'); - - if (typeof edge.style === 'undefined') { - edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none;'; - } - - edgeData.labelStyle = edgeData.labelStyle.replace('color:', 'fill:'); // } - - edgeData.id = linkId; - edgeData.classes = 'flowchart-link ' + linkNameStart + ' ' + linkNameEnd; // Add the edge to the graph - - g.setEdge(edge.start, edge.end, edgeData, cnt); - }); -}; -/** - * Returns the all the styles from classDef statements in the graph definition. - * @returns {object} classDef styles - */ - -var getClasses = function getClasses(text) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Extracting classes'); - _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); - var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser; - parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; - - try { - // Parse the graph definition - parser.parse(text); - } catch (e) { - return; - } - - return _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getClasses(); -}; -/** - * Draws a flowchart in the tag with id: id based on the graph definition in text. - * @param text - * @param id - */ - -var draw = function draw(text, id) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Drawing flowchart'); - _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); - _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].setGen('gen-2'); - var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser; - parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition - // try { - - parser.parse(text); // } catch (err) { - // log.debug('Parsing failed'); - // } - // Fetch the default direction, use TD if none was found - - var dir = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getDirection(); - - if (typeof dir === 'undefined') { - dir = 'TD'; - } - - var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart; - var nodeSpacing = conf.nodeSpacing || 50; - var rankSpacing = conf.rankSpacing || 50; // Create the input mermaid.graph - - var g = new graphlib__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({ - multigraph: true, - compound: true - }).setGraph({ - rankdir: dir, - nodesep: nodeSpacing, - ranksep: rankSpacing, - marginx: 8, - marginy: 8 - }).setDefaultEdgeLabel(function () { - return {}; - }); - var subG; - var subGraphs = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getSubGraphs(); - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Subgraphs - ', subGraphs); - - for (var _i = subGraphs.length - 1; _i >= 0; _i--) { - subG = subGraphs[_i]; - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Subgraph - ', subG); - _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].addVertex(subG.id, subG.title, 'group', undefined, subG.classes); - } // Fetch the verices/nodes and edges/links from the parsed graph definition - - - var vert = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getVertices(); - var edges = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getEdges(); - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info(edges); - var i = 0; - - for (i = subGraphs.length - 1; i >= 0; i--) { - // for (let i = 0; i < subGraphs.length; i++) { - subG = subGraphs[i]; - Object(d3__WEBPACK_IMPORTED_MODULE_1__["selectAll"])('cluster').append('text'); - - for (var j = 0; j < subG.nodes.length; j++) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Setting up subgraphs', subG.nodes[j], subG.id); - g.setParent(subG.nodes[j], subG.id); - } - } - - addVertices(vert, g, id); - addEdges(edges, g); // Add custom shapes - // flowChartShapes.addToRenderV2(addShape); - // Set up an SVG group so that we can translate the final graph. - - var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(id, "\"]")); - svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink'); // Run the renderer. This is what draws the final graph. - - var element = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#' + id + ' g'); - Object(_dagre_wrapper_index_js__WEBPACK_IMPORTED_MODULE_5__["render"])(element, g, ['point', 'circle', 'cross'], 'flowchart', id); - var padding = conf.diagramPadding; - var svgBounds = svg.node().getBBox(); - var width = svgBounds.width + padding * 2; - var height = svgBounds.height + padding * 2; - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].debug("new ViewBox 0 0 ".concat(width, " ").concat(height), "translate(".concat(padding - g._label.marginx, ", ").concat(padding - g._label.marginy, ")")); - Object(_utils__WEBPACK_IMPORTED_MODULE_9__["configureSvgSize"])(svg, height, width, conf.useMaxWidth); - svg.attr('viewBox', "0 0 ".concat(width, " ").concat(height)); - svg.select('g').attr('transform', "translate(".concat(padding - g._label.marginx, ", ").concat(padding - svgBounds.y, ")")); // Index nodes - - _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].indexNodes('subGraph' + i); // Add label rects for non html labels - - if (!conf.htmlLabels) { - var labels = document.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); - - for (var k = 0; k < labels.length; k++) { - var label = labels[k]; // Get dimensions of label - - var dim = label.getBBox(); - var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); - rect.setAttribute('rx', 0); - rect.setAttribute('ry', 0); - rect.setAttribute('width', dim.width); - rect.setAttribute('height', dim.height); // rect.setAttribute('style', 'fill:#e8e8e8;'); - - label.insertBefore(rect, label.firstChild); - } - } // If node has a link, wrap it in an anchor SVG object. - - - var keys = Object.keys(vert); - keys.forEach(function (key) { - var vertex = vert[key]; - - if (vertex.link) { - var node = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#' + id + ' [id="' + key + '"]'); - - if (node) { - var link = document.createElementNS('http://www.w3.org/2000/svg', 'a'); - link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' ')); - link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link); - link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener'); - - if (vertex.linkTarget) { - link.setAttributeNS('http://www.w3.org/2000/svg', 'target', vertex.linkTarget); - } - - var linkNode = node.insert(function () { - return link; - }, ':first-child'); - var shape = node.select('.label-container'); - - if (shape) { - linkNode.append(function () { - return shape.node(); - }); - } - - var _label = node.select('.label'); - - if (_label) { - linkNode.append(function () { - return _label.node(); - }); - } - } - } - }); -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - setConf: setConf, - addVertices: addVertices, - addEdges: addEdges, - getClasses: getClasses, - draw: draw -}); - -/***/ }), - -/***/ "./src/diagrams/flowchart/flowRenderer.js": -/*!************************************************!*\ - !*** ./src/diagrams/flowchart/flowRenderer.js ***! - \************************************************/ -/*! exports provided: setConf, addVertices, addEdges, getClasses, draw, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVertices", function() { return addVertices; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEdges", function() { return addEdges; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! graphlib */ "graphlib"); -/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _flowDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flowDb */ "./src/diagrams/flowchart/flowDb.js"); -/* harmony import */ var _parser_flow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/flow */ "./src/diagrams/flowchart/parser/flow.jison"); -/* harmony import */ var _parser_flow__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_flow__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var dagre_d3__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dagre-d3 */ "dagre-d3"); -/* harmony import */ var dagre_d3__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dagre_d3__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! dagre-d3/lib/label/add-html-label.js */ "dagre-d3/lib/label/add-html-label.js"); -/* harmony import */ var dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); -/* harmony import */ var _flowChartShapes__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flowChartShapes */ "./src/diagrams/flowchart/flowChartShapes.js"); - - - - - - - - - - - -var conf = {}; -var setConf = function setConf(cnf) { - var keys = Object.keys(cnf); - - for (var i = 0; i < keys.length; i++) { - conf[keys[i]] = cnf[keys[i]]; - } -}; -/** - * Function that adds the vertices found in the graph definition to the graph to be rendered. - * @param vert Object containing the vertices. - * @param g The graph that is to be drawn. - */ - -var addVertices = function addVertices(vert, g, svgId) { - var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(svgId, "\"]")); - var keys = Object.keys(vert); // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition - - keys.forEach(function (id) { - var vertex = vert[id]; - /** - * Variable for storing the classes for the vertex - * @type {string} - */ - - var classStr = 'default'; - - if (vertex.classes.length > 0) { - classStr = vertex.classes.join(' '); - } - - var styles = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["getStylesFromArray"])(vertex.styles); // Use vertex id as text in the box if no text is provided by the graph definition - - var vertexText = vertex.text !== undefined ? vertex.text : vertex.id; // We create a SVG label, either by delegating to addHtmlLabel or manually - - var vertexNode; - - if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) { - // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that? - var node = { - label: vertexText.replace(/fa[lrsb]?:fa-[\w-]+/g, function (s) { - return ""); - }) - }; - vertexNode = dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6___default()(svg, node).node(); - vertexNode.parentNode.removeChild(vertexNode); - } else { - var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text'); - svgLabel.setAttribute('style', styles.labelStyle.replace('color:', 'fill:')); - var rows = vertexText.split(_common_common__WEBPACK_IMPORTED_MODULE_8__["default"].lineBreakRegex); - - for (var j = 0; j < rows.length; j++) { - var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); - tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve'); - tspan.setAttribute('dy', '1em'); - tspan.setAttribute('x', '1'); - tspan.textContent = rows[j]; - svgLabel.appendChild(tspan); - } - - vertexNode = svgLabel; - } - - var radious = 0; - var _shape = ''; // Set the shape based parameters - - switch (vertex.type) { - case 'round': - radious = 5; - _shape = 'rect'; - break; - - case 'square': - _shape = 'rect'; - break; - - case 'diamond': - _shape = 'question'; - break; - - case 'hexagon': - _shape = 'hexagon'; - break; - - case 'odd': - _shape = 'rect_left_inv_arrow'; - break; - - case 'lean_right': - _shape = 'lean_right'; - break; - - case 'lean_left': - _shape = 'lean_left'; - break; - - case 'trapezoid': - _shape = 'trapezoid'; - break; - - case 'inv_trapezoid': - _shape = 'inv_trapezoid'; - break; - - case 'odd_right': - _shape = 'rect_left_inv_arrow'; - break; - - case 'circle': - _shape = 'circle'; - break; - - case 'ellipse': - _shape = 'ellipse'; - break; - - case 'stadium': - _shape = 'stadium'; - break; - - case 'subroutine': - _shape = 'subroutine'; - break; - - case 'cylinder': - _shape = 'cylinder'; - break; - - case 'group': - _shape = 'rect'; - break; - - default: - _shape = 'rect'; - } // Add the node - - - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].warn('Adding node', vertex.id, vertex.domId); - g.setNode(_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(vertex.id), { - labelType: 'svg', - labelStyle: styles.labelStyle, - shape: _shape, - label: vertexNode, - rx: radious, - ry: radious, - class: classStr, - style: styles.style, - id: _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(vertex.id) - }); - }); -}; -/** - * Add edges to graph based on parsed graph defninition - * @param {Object} edges The edges to add to the graph - * @param {Object} g The graph object - */ - -var addEdges = function addEdges(edges, g) { - var cnt = 0; - var defaultStyle; - var defaultLabelStyle; - - if (typeof edges.defaultStyle !== 'undefined') { - var defaultStyles = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["getStylesFromArray"])(edges.defaultStyle); - defaultStyle = defaultStyles.style; - defaultLabelStyle = defaultStyles.labelStyle; - } - - edges.forEach(function (edge) { - cnt++; // Identify Link - - var linkId = 'L-' + edge.start + '-' + edge.end; - var linkNameStart = 'LS-' + edge.start; - var linkNameEnd = 'LE-' + edge.end; - var edgeData = {}; // Set link type for rendering - - if (edge.type === 'arrow_open') { - edgeData.arrowhead = 'none'; - } else { - edgeData.arrowhead = 'normal'; - } - - var style = ''; - var labelStyle = ''; - - if (typeof edge.style !== 'undefined') { - var styles = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["getStylesFromArray"])(edge.style); - style = styles.style; - labelStyle = styles.labelStyle; - } else { - switch (edge.stroke) { - case 'normal': - style = 'fill:none'; - - if (typeof defaultStyle !== 'undefined') { - style = defaultStyle; - } - - if (typeof defaultLabelStyle !== 'undefined') { - labelStyle = defaultLabelStyle; - } - - break; - - case 'dotted': - style = 'fill:none;stroke-width:2px;stroke-dasharray:3;'; - break; - - case 'thick': - style = ' stroke-width: 3.5px;fill:none'; - break; - } - } - - edgeData.style = style; - edgeData.labelStyle = labelStyle; - - if (typeof edge.interpolate !== 'undefined') { - edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["interpolateToCurve"])(edge.interpolate, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]); - } else if (typeof edges.defaultInterpolate !== 'undefined') { - edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["interpolateToCurve"])(edges.defaultInterpolate, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]); - } else { - edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["interpolateToCurve"])(conf.curve, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]); - } - - if (typeof edge.text === 'undefined') { - if (typeof edge.style !== 'undefined') { - edgeData.arrowheadStyle = 'fill: #333'; - } - } else { - edgeData.arrowheadStyle = 'fill: #333'; - edgeData.labelpos = 'c'; - - if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) { - edgeData.labelType = 'html'; - edgeData.label = "").concat(edge.text.replace(/fa[lrsb]?:fa-[\w-]+/g, function (s) { - return ""); - }), ""); - } else { - edgeData.labelType = 'text'; - edgeData.label = edge.text.replace(_common_common__WEBPACK_IMPORTED_MODULE_8__["default"].lineBreakRegex, '\n'); - - if (typeof edge.style === 'undefined') { - edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none'; - } - - edgeData.labelStyle = edgeData.labelStyle.replace('color:', 'fill:'); - } - } - - edgeData.id = linkId; - edgeData.class = linkNameStart + ' ' + linkNameEnd; - edgeData.minlen = edge.length || 1; // Add the edge to the graph - - g.setEdge(_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(edge.start), _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(edge.end), edgeData, cnt); - }); -}; -/** - * Returns the all the styles from classDef statements in the graph definition. - * @returns {object} classDef styles - */ - -var getClasses = function getClasses(text) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Extracting classes'); - _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); - - try { - var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser; - parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition - - parser.parse(text); - return _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getClasses(); - } catch (e) { - return; - } -}; -/** - * Draws a flowchart in the tag with id: id based on the graph definition in text. - * @param text - * @param id - */ - -var draw = function draw(text, id) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Drawing flowchart'); - _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); - _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].setGen('gen-1'); - var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser; - parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition - // try { - - parser.parse(text); // } catch (err) { - // log.debug('Parsing failed'); - // } - // Fetch the default direction, use TD if none was found - - var dir = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getDirection(); - - if (typeof dir === 'undefined') { - dir = 'TD'; - } - - var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart; - var nodeSpacing = conf.nodeSpacing || 50; - var rankSpacing = conf.rankSpacing || 50; // Create the input mermaid.graph - - var g = new graphlib__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({ - multigraph: true, - compound: true - }).setGraph({ - rankdir: dir, - nodesep: nodeSpacing, - ranksep: rankSpacing, - marginx: 8, - marginy: 8 - }).setDefaultEdgeLabel(function () { - return {}; - }); - var subG; - var subGraphs = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getSubGraphs(); - - for (var _i = subGraphs.length - 1; _i >= 0; _i--) { - subG = subGraphs[_i]; - _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].addVertex(subG.id, subG.title, 'group', undefined, subG.classes); - } // Fetch the verices/nodes and edges/links from the parsed graph definition - - - var vert = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getVertices(); - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].warn('Get vertices', vert); - var edges = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getEdges(); - var i = 0; - - for (i = subGraphs.length - 1; i >= 0; i--) { - subG = subGraphs[i]; - Object(d3__WEBPACK_IMPORTED_MODULE_1__["selectAll"])('cluster').append('text'); - - for (var j = 0; j < subG.nodes.length; j++) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].warn('Setting subgraph', subG.nodes[j], _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.nodes[j]), _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id)); - g.setParent(_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.nodes[j]), _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id)); - } - } - - addVertices(vert, g, id); - addEdges(edges, g); // Create the renderer - - var Render = dagre_d3__WEBPACK_IMPORTED_MODULE_5___default.a.render; - var render = new Render(); // Add custom shapes - - _flowChartShapes__WEBPACK_IMPORTED_MODULE_10__["default"].addToRender(render); // Add our custom arrow - an empty arrowhead - - render.arrows().none = function normal(parent, id, edge, type) { - var marker = parent.append('marker').attr('id', id).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'strokeWidth').attr('markerWidth', 8).attr('markerHeight', 6).attr('orient', 'auto'); - var path = marker.append('path').attr('d', 'M 0 0 L 0 0 L 0 0 z'); - dagre_d3__WEBPACK_IMPORTED_MODULE_5___default.a.util.applyStyle(path, edge[type + 'Style']); - }; // Override normal arrowhead defined in d3. Remove style & add class to allow css styling. - - - render.arrows().normal = function normal(parent, id) { - var marker = parent.append('marker').attr('id', id).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'strokeWidth').attr('markerWidth', 8).attr('markerHeight', 6).attr('orient', 'auto'); - marker.append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z').attr('class', 'arrowheadPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); - }; // Set up an SVG group so that we can translate the final graph. - - - var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(id, "\"]")); - svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink'); - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].warn(g); // Run the renderer. This is what draws the final graph. - - var element = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#' + id + ' g'); - render(element, g); - element.selectAll('g.node').attr('title', function () { - return _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getTooltip(this.id); - }); - var padding = conf.diagramPadding; - var svgBounds = svg.node().getBBox(); - var width = svgBounds.width + padding * 2; - var height = svgBounds.height + padding * 2; - Object(_utils__WEBPACK_IMPORTED_MODULE_9__["configureSvgSize"])(svg, height, width, conf.useMaxWidth); // Ensure the viewBox includes the whole svgBounds area with extra space for padding - - var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height); - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].debug("viewBox ".concat(vBox)); - svg.attr('viewBox', vBox); // Index nodes - - _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].indexNodes('subGraph' + i); // reposition labels - - for (i = 0; i < subGraphs.length; i++) { - subG = subGraphs[i]; - - if (subG.title !== 'undefined') { - var clusterRects = document.querySelectorAll('#' + id + ' [id="' + _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id) + '"] rect'); - var clusterEl = document.querySelectorAll('#' + id + ' [id="' + _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id) + '"]'); - var xPos = clusterRects[0].x.baseVal.value; - var yPos = clusterRects[0].y.baseVal.value; - var _width = clusterRects[0].width.baseVal.value; - var cluster = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])(clusterEl[0]); - var te = cluster.select('.label'); - te.attr('transform', "translate(".concat(xPos + _width / 2, ", ").concat(yPos + 14, ")")); - te.attr('id', id + 'Text'); - - for (var _j = 0; _j < subG.classes.length; _j++) { - clusterEl[0].classList.add(subG.classes[_j]); - } - } - } // Add label rects for non html labels - - - if (!conf.htmlLabels || true) { - // eslint-disable-line - var labels = document.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); - - for (var k = 0; k < labels.length; k++) { - var label = labels[k]; // Get dimensions of label - - var dim = label.getBBox(); - var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); - rect.setAttribute('rx', 0); - rect.setAttribute('ry', 0); - rect.setAttribute('width', dim.width); - rect.setAttribute('height', dim.height); // rect.setAttribute('style', 'fill:#e8e8e8;'); - - label.insertBefore(rect, label.firstChild); - } - } // If node has a link, wrap it in an anchor SVG object. - - - var keys = Object.keys(vert); - keys.forEach(function (key) { - var vertex = vert[key]; - - if (vertex.link) { - var node = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#' + id + ' [id="' + _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(key) + '"]'); - - if (node) { - var link = document.createElementNS('http://www.w3.org/2000/svg', 'a'); - link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' ')); - link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link); - link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener'); - - if (vertex.linkTarget) { - link.setAttributeNS('http://www.w3.org/2000/svg', 'target', vertex.linkTarget); - } - - var linkNode = node.insert(function () { - return link; - }, ':first-child'); - var shape = node.select('.label-container'); - - if (shape) { - linkNode.append(function () { - return shape.node(); - }); - } - - var _label = node.select('.label'); - - if (_label) { - linkNode.append(function () { - return _label.node(); - }); - } - } - } - }); -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - setConf: setConf, - addVertices: addVertices, - addEdges: addEdges, - getClasses: getClasses, - draw: draw -}); - -/***/ }), - -/***/ "./src/diagrams/flowchart/parser/flow.jison": -/*!**************************************************!*\ - !*** ./src/diagrams/flowchart/parser/flow.jison ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9],$V1=[1,7],$V2=[1,6],$V3=[1,8],$V4=[1,20,21,22,23,38,46,75,76,77,78,79,80,94,95,98,99,100,102,103,109,110,111,112,113,114],$V5=[2,10],$V6=[1,20],$V7=[1,21],$V8=[1,22],$V9=[1,23],$Va=[1,30],$Vb=[1,54],$Vc=[1,32],$Vd=[1,33],$Ve=[1,34],$Vf=[1,35],$Vg=[1,36],$Vh=[1,48],$Vi=[1,43],$Vj=[1,45],$Vk=[1,40],$Vl=[1,44],$Vm=[1,47],$Vn=[1,51],$Vo=[1,52],$Vp=[1,53],$Vq=[1,42],$Vr=[1,46],$Vs=[1,49],$Vt=[1,50],$Vu=[1,41],$Vv=[1,57],$Vw=[1,62],$Vx=[1,20,21,22,23,38,42,46,75,76,77,78,79,80,94,95,98,99,100,102,103,109,110,111,112,113,114],$Vy=[1,66],$Vz=[1,65],$VA=[1,67],$VB=[20,21,23,69,70],$VC=[1,88],$VD=[1,93],$VE=[1,90],$VF=[1,95],$VG=[1,98],$VH=[1,96],$VI=[1,97],$VJ=[1,91],$VK=[1,103],$VL=[1,102],$VM=[1,92],$VN=[1,94],$VO=[1,99],$VP=[1,100],$VQ=[1,101],$VR=[1,104],$VS=[20,21,22,23,69,70],$VT=[20,21,22,23,47,69,70],$VU=[20,21,22,23,40,46,47,49,51,53,55,57,59,61,62,64,69,70,80,94,95,98,99,100,102,103,109,110,111,112,113,114],$VV=[20,21,23],$VW=[20,21,23,46,69,70,80,94,95,98,99,100,102,103,109,110,111,112,113,114],$VX=[1,12,20,21,22,23,24,38,42,46,75,76,77,78,79,80,94,95,98,99,100,102,103,109,110,111,112,113,114],$VY=[46,80,94,95,98,99,100,102,103,109,110,111,112,113,114],$VZ=[1,136],$V_=[1,144],$V$=[1,145],$V01=[1,146],$V11=[1,147],$V21=[1,131],$V31=[1,132],$V41=[1,128],$V51=[1,139],$V61=[1,140],$V71=[1,141],$V81=[1,142],$V91=[1,143],$Va1=[1,148],$Vb1=[1,149],$Vc1=[1,134],$Vd1=[1,137],$Ve1=[1,133],$Vf1=[1,130],$Vg1=[20,21,22,23,38,42,46,75,76,77,78,79,80,94,95,98,99,100,102,103,109,110,111,112,113,114],$Vh1=[1,152],$Vi1=[20,21,22,23,26,46,80,94,95,98,99,100,102,103,109,110,111,112,113,114],$Vj1=[20,21,22,23,24,26,38,40,41,42,46,50,52,54,56,58,60,61,63,65,69,70,71,75,76,77,78,79,80,81,84,94,95,98,99,100,102,103,104,105,109,110,111,112,113,114],$Vk1=[12,21,22,24],$Vl1=[22,95],$Vm1=[1,233],$Vn1=[1,237],$Vo1=[1,234],$Vp1=[1,231],$Vq1=[1,228],$Vr1=[1,229],$Vs1=[1,230],$Vt1=[1,232],$Vu1=[1,235],$Vv1=[1,236],$Vw1=[1,238],$Vx1=[1,255],$Vy1=[20,21,23,95],$Vz1=[20,21,22,23,75,91,94,95,98,99,100,101,102,103,104]; -var parser = {trace: function trace () { }, -yy: {}, -symbols_: {"error":2,"start":3,"mermaidDoc":4,"directive":5,"openDirective":6,"typeDirective":7,"closeDirective":8,"separator":9,":":10,"argDirective":11,"open_directive":12,"type_directive":13,"arg_directive":14,"close_directive":15,"graphConfig":16,"document":17,"line":18,"statement":19,"SEMI":20,"NEWLINE":21,"SPACE":22,"EOF":23,"GRAPH":24,"NODIR":25,"DIR":26,"FirstStmtSeperator":27,"ending":28,"endToken":29,"spaceList":30,"spaceListNewline":31,"verticeStatement":32,"styleStatement":33,"linkStyleStatement":34,"classDefStatement":35,"classStatement":36,"clickStatement":37,"subgraph":38,"text":39,"SQS":40,"SQE":41,"end":42,"link":43,"node":44,"vertex":45,"AMP":46,"STYLE_SEPARATOR":47,"idString":48,"PS":49,"PE":50,"(-":51,"-)":52,"STADIUMSTART":53,"STADIUMEND":54,"SUBROUTINESTART":55,"SUBROUTINEEND":56,"CYLINDERSTART":57,"CYLINDEREND":58,"DIAMOND_START":59,"DIAMOND_STOP":60,"TAGEND":61,"TRAPSTART":62,"TRAPEND":63,"INVTRAPSTART":64,"INVTRAPEND":65,"linkStatement":66,"arrowText":67,"TESTSTR":68,"START_LINK":69,"LINK":70,"PIPE":71,"textToken":72,"STR":73,"keywords":74,"STYLE":75,"LINKSTYLE":76,"CLASSDEF":77,"CLASS":78,"CLICK":79,"DOWN":80,"UP":81,"textNoTags":82,"textNoTagsToken":83,"DEFAULT":84,"stylesOpt":85,"alphaNum":86,"CALLBACKNAME":87,"CALLBACKARGS":88,"HREF":89,"LINK_TARGET":90,"HEX":91,"numList":92,"INTERPOLATE":93,"NUM":94,"COMMA":95,"style":96,"styleComponent":97,"ALPHA":98,"COLON":99,"MINUS":100,"UNIT":101,"BRKT":102,"DOT":103,"PCT":104,"TAGSTART":105,"alphaNumToken":106,"idStringToken":107,"alphaNumStatement":108,"PUNCTUATION":109,"UNICODE_TEXT":110,"PLUS":111,"EQUALS":112,"MULT":113,"UNDERSCORE":114,"graphCodeTokens":115,"ARROW_CROSS":116,"ARROW_POINT":117,"ARROW_CIRCLE":118,"ARROW_OPEN":119,"QUOTE":120,"$accept":0,"$end":1}, -terminals_: {2:"error",10:":",12:"open_directive",13:"type_directive",14:"arg_directive",15:"close_directive",20:"SEMI",21:"NEWLINE",22:"SPACE",23:"EOF",24:"GRAPH",25:"NODIR",26:"DIR",38:"subgraph",40:"SQS",41:"SQE",42:"end",46:"AMP",47:"STYLE_SEPARATOR",49:"PS",50:"PE",51:"(-",52:"-)",53:"STADIUMSTART",54:"STADIUMEND",55:"SUBROUTINESTART",56:"SUBROUTINEEND",57:"CYLINDERSTART",58:"CYLINDEREND",59:"DIAMOND_START",60:"DIAMOND_STOP",61:"TAGEND",62:"TRAPSTART",63:"TRAPEND",64:"INVTRAPSTART",65:"INVTRAPEND",68:"TESTSTR",69:"START_LINK",70:"LINK",71:"PIPE",73:"STR",75:"STYLE",76:"LINKSTYLE",77:"CLASSDEF",78:"CLASS",79:"CLICK",80:"DOWN",81:"UP",84:"DEFAULT",87:"CALLBACKNAME",88:"CALLBACKARGS",89:"HREF",90:"LINK_TARGET",91:"HEX",93:"INTERPOLATE",94:"NUM",95:"COMMA",98:"ALPHA",99:"COLON",100:"MINUS",101:"UNIT",102:"BRKT",103:"DOT",104:"PCT",105:"TAGSTART",109:"PUNCTUATION",110:"UNICODE_TEXT",111:"PLUS",112:"EQUALS",113:"MULT",114:"UNDERSCORE",116:"ARROW_CROSS",117:"ARROW_POINT",118:"ARROW_CIRCLE",119:"ARROW_OPEN",120:"QUOTE"}, -productions_: [0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[44,1],[44,5],[44,3],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[43,2],[43,3],[43,3],[43,1],[43,3],[66,1],[67,3],[39,1],[39,2],[39,1],[74,1],[74,1],[74,1],[74,1],[74,1],[74,1],[74,1],[74,1],[74,1],[74,1],[74,1],[82,1],[82,2],[35,5],[35,5],[36,5],[37,2],[37,4],[37,3],[37,5],[37,2],[37,4],[37,4],[37,6],[37,2],[37,4],[37,2],[37,4],[37,4],[37,6],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[92,1],[92,3],[85,1],[85,3],[96,1],[96,2],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[72,1],[72,1],[72,1],[72,1],[72,1],[72,1],[83,1],[83,1],[83,1],[83,1],[48,1],[48,2],[86,1],[86,2],[108,1],[108,1],[108,1],[108,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[106,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 5: - yy.parseDirective('%%{', 'open_directive'); -break; -case 6: - yy.parseDirective($$[$0], 'type_directive'); -break; -case 7: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); -break; -case 8: - yy.parseDirective('}%%', 'close_directive', 'flowchart'); -break; -case 10: - this.$ = []; -break; -case 11: - - if($$[$0] !== []){ - $$[$0-1].push($$[$0]); - } - this.$=$$[$0-1]; -break; -case 12: case 76: case 78: case 90: case 146: case 148: case 149: -this.$=$$[$0]; -break; -case 19: - yy.setDirection('TB');this.$ = 'TB'; -break; -case 20: - yy.setDirection($$[$0-1]);this.$ = $$[$0-1]; -break; -case 35: - /* console.warn('finat vs', $$[$0-1].nodes); */ this.$=$$[$0-1].nodes -break; -case 36: case 37: case 38: case 39: case 40: -this.$=[]; -break; -case 41: -this.$=yy.addSubGraph($$[$0-6],$$[$0-1],$$[$0-4]); -break; -case 42: -this.$=yy.addSubGraph($$[$0-3],$$[$0-1],$$[$0-3]); -break; -case 43: -this.$=yy.addSubGraph(undefined,$$[$0-1],undefined); -break; -case 47: - /* console.warn('vs',$$[$0-2].stmt,$$[$0]); */ yy.addLink($$[$0-2].stmt,$$[$0],$$[$0-1]); this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0-2].nodes) } -break; -case 48: - /* console.warn('vs',$$[$0-3].stmt,$$[$0-1]); */ yy.addLink($$[$0-3].stmt,$$[$0-1],$$[$0-2]); this.$ = { stmt: $$[$0-1], nodes: $$[$0-1].concat($$[$0-3].nodes) } -break; -case 49: -/*console.warn('noda', $$[$0-1]);*/ this.$ = {stmt: $$[$0-1], nodes:$$[$0-1] } -break; -case 50: - /*console.warn('noda', $$[$0]);*/ this.$ = {stmt: $$[$0], nodes:$$[$0] } -break; -case 51: - /* console.warn('nod', $$[$0]); */ this.$ = [$$[$0]]; -break; -case 52: - this.$ = $$[$0-4].concat($$[$0]); /* console.warn('pip', $$[$0-4][0], $$[$0], this.$); */ -break; -case 53: -this.$ = [$$[$0-2]];yy.setClass($$[$0-2],$$[$0]) -break; -case 54: -this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'square'); -break; -case 55: -this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'circle'); -break; -case 56: -this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'ellipse'); -break; -case 57: -this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'stadium'); -break; -case 58: -this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'subroutine'); -break; -case 59: -this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'cylinder'); -break; -case 60: -this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'round'); -break; -case 61: -this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'diamond'); -break; -case 62: -this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'hexagon'); -break; -case 63: -this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'odd'); -break; -case 64: -this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'trapezoid'); -break; -case 65: -this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'inv_trapezoid'); -break; -case 66: -this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_right'); -break; -case 67: -this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_left'); -break; -case 68: - /*console.warn('h: ', $$[$0]);*/this.$ = $$[$0];yy.addVertex($$[$0]); -break; -case 69: -$$[$0-1].text = $$[$0];this.$ = $$[$0-1]; -break; -case 70: case 71: -$$[$0-2].text = $$[$0-1];this.$ = $$[$0-2]; -break; -case 72: -this.$ = $$[$0]; -break; -case 73: -var inf = yy.destructLink($$[$0], $$[$0-2]); this.$ = {"type":inf.type,"stroke":inf.stroke,"length":inf.length,"text":$$[$0-1]}; -break; -case 74: -var inf = yy.destructLink($$[$0]);this.$ = {"type":inf.type,"stroke":inf.stroke,"length":inf.length}; -break; -case 75: -this.$ = $$[$0-1]; -break; -case 77: case 91: case 147: -this.$=$$[$0-1]+''+$$[$0]; -break; -case 92: case 93: -this.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]); -break; -case 94: -this.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]); -break; -case 95: case 103: -this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0]); -break; -case 96: case 104: -this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]); -break; -case 97: -this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); -break; -case 98: -this.$ = $$[$0-4];yy.setClickEvent($$[$0-4], $$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-4], $$[$0]); -break; -case 99: case 105: -this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]); -break; -case 100: case 106: -this.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]); -break; -case 101: case 107: -this.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2], $$[$0]); -break; -case 102: case 108: -this.$ = $$[$0-5];yy.setLink($$[$0-5], $$[$0-4], $$[$0]);yy.setTooltip($$[$0-5], $$[$0-2]); -break; -case 109: -this.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]); -break; -case 110: case 112: -this.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]); -break; -case 111: -this.$ = $$[$0-4];yy.updateLink([$$[$0-2]],$$[$0]); -break; -case 113: -this.$ = $$[$0-8];yy.updateLinkInterpolate([$$[$0-6]],$$[$0-2]);yy.updateLink([$$[$0-6]],$$[$0]); -break; -case 114: -this.$ = $$[$0-8];yy.updateLinkInterpolate($$[$0-6],$$[$0-2]);yy.updateLink($$[$0-6],$$[$0]); -break; -case 115: -this.$ = $$[$0-6];yy.updateLinkInterpolate([$$[$0-4]],$$[$0]); -break; -case 116: -this.$ = $$[$0-6];yy.updateLinkInterpolate($$[$0-4],$$[$0]); -break; -case 117: case 119: -this.$ = [$$[$0]] -break; -case 118: case 120: -$$[$0-2].push($$[$0]);this.$ = $$[$0-2]; -break; -case 122: -this.$ = $$[$0-1] + $$[$0]; -break; -case 144: -this.$=$$[$0] -break; -case 145: -this.$=$$[$0-1]+''+$$[$0] -break; -case 150: -this.$='v'; -break; -case 151: -this.$='-'; -break; -} -}, -table: [{3:1,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},o($V4,$V5,{17:11}),{7:12,13:[1,13]},{16:14,21:$V1,22:$V2,24:$V3},{16:15,21:$V1,22:$V2,24:$V3},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,44:31,45:37,46:$Vb,48:38,75:$Vc,76:$Vd,77:$Ve,78:$Vf,79:$Vg,80:$Vh,94:$Vi,95:$Vj,98:$Vk,99:$Vl,100:$Vm,102:$Vn,103:$Vo,107:39,109:$Vp,110:$Vq,111:$Vr,112:$Vs,113:$Vt,114:$Vu},{8:55,10:[1,56],15:$Vv},o([10,15],[2,6]),o($V4,[2,17]),o($V4,[2,18]),o($V4,[2,19]),{20:[1,59],21:[1,60],22:$Vw,27:58,30:61},o($Vx,[2,11]),o($Vx,[2,12]),o($Vx,[2,13]),o($Vx,[2,14]),o($Vx,[2,15]),o($Vx,[2,16]),{9:63,20:$Vy,21:$Vz,23:$VA,43:64,66:68,69:[1,69],70:[1,70]},{9:71,20:$Vy,21:$Vz,23:$VA},{9:72,20:$Vy,21:$Vz,23:$VA},{9:73,20:$Vy,21:$Vz,23:$VA},{9:74,20:$Vy,21:$Vz,23:$VA},{9:75,20:$Vy,21:$Vz,23:$VA},{9:77,20:$Vy,21:$Vz,22:[1,76],23:$VA},o($VB,[2,50],{30:78,22:$Vw}),{22:[1,79]},{22:[1,80]},{22:[1,81]},{22:[1,82]},{26:$VC,46:$VD,73:[1,86],80:$VE,86:85,87:[1,83],89:[1,84],94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,106:89,108:87,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},o($VS,[2,51],{47:[1,105]}),o($VT,[2,68],{107:116,40:[1,106],46:$Vb,49:[1,107],51:[1,108],53:[1,109],55:[1,110],57:[1,111],59:[1,112],61:[1,113],62:[1,114],64:[1,115],80:$Vh,94:$Vi,95:$Vj,98:$Vk,99:$Vl,100:$Vm,102:$Vn,103:$Vo,109:$Vp,110:$Vq,111:$Vr,112:$Vs,113:$Vt,114:$Vu}),o($VU,[2,144]),o($VU,[2,165]),o($VU,[2,166]),o($VU,[2,167]),o($VU,[2,168]),o($VU,[2,169]),o($VU,[2,170]),o($VU,[2,171]),o($VU,[2,172]),o($VU,[2,173]),o($VU,[2,174]),o($VU,[2,175]),o($VU,[2,176]),o($VU,[2,177]),o($VU,[2,178]),o($VU,[2,179]),{9:117,20:$Vy,21:$Vz,23:$VA},{11:118,14:[1,119]},o($VV,[2,8]),o($V4,[2,20]),o($V4,[2,26]),o($V4,[2,27]),{21:[1,120]},o($VW,[2,34],{30:121,22:$Vw}),o($Vx,[2,35]),{44:122,45:37,46:$Vb,48:38,80:$Vh,94:$Vi,95:$Vj,98:$Vk,99:$Vl,100:$Vm,102:$Vn,103:$Vo,107:39,109:$Vp,110:$Vq,111:$Vr,112:$Vs,113:$Vt,114:$Vu},o($VX,[2,44]),o($VX,[2,45]),o($VX,[2,46]),o($VY,[2,72],{67:123,68:[1,124],71:[1,125]}),{22:$VZ,24:$V_,26:$V$,38:$V01,39:126,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},o([46,68,71,80,94,95,98,99,100,102,103,109,110,111,112,113,114],[2,74]),o($Vx,[2,36]),o($Vx,[2,37]),o($Vx,[2,38]),o($Vx,[2,39]),o($Vx,[2,40]),{22:$VZ,24:$V_,26:$V$,38:$V01,39:150,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},o($Vg1,$V5,{17:151}),o($VB,[2,49],{46:$Vh1}),{26:$VC,46:$VD,80:$VE,86:153,91:[1,154],94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,106:89,108:87,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{84:[1,155],92:156,94:[1,157]},{26:$VC,46:$VD,80:$VE,84:[1,158],86:159,94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,106:89,108:87,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{26:$VC,46:$VD,80:$VE,86:160,94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,106:89,108:87,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},o($VV,[2,95],{22:[1,161],88:[1,162]}),o($VV,[2,99],{22:[1,163]}),o($VV,[2,103],{106:89,108:165,22:[1,164],26:$VC,46:$VD,80:$VE,94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR}),o($VV,[2,105],{22:[1,166]}),o($Vi1,[2,146]),o($Vi1,[2,148]),o($Vi1,[2,149]),o($Vi1,[2,150]),o($Vi1,[2,151]),o($Vj1,[2,152]),o($Vj1,[2,153]),o($Vj1,[2,154]),o($Vj1,[2,155]),o($Vj1,[2,156]),o($Vj1,[2,157]),o($Vj1,[2,158]),o($Vj1,[2,159]),o($Vj1,[2,160]),o($Vj1,[2,161]),o($Vj1,[2,162]),o($Vj1,[2,163]),o($Vj1,[2,164]),{46:$Vb,48:167,80:$Vh,94:$Vi,95:$Vj,98:$Vk,99:$Vl,100:$Vm,102:$Vn,103:$Vo,107:39,109:$Vp,110:$Vq,111:$Vr,112:$Vs,113:$Vt,114:$Vu},{22:$VZ,24:$V_,26:$V$,38:$V01,39:168,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,39:170,42:$V11,46:$VD,49:[1,169],61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,39:171,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,39:172,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,39:173,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,39:174,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,39:175,42:$V11,46:$VD,59:[1,176],61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,39:177,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,39:178,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,39:179,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},o($VU,[2,145]),o($Vk1,[2,3]),{8:180,15:$Vv},{15:[2,7]},o($V4,[2,28]),o($VW,[2,33]),o($VB,[2,47],{30:181,22:$Vw}),o($VY,[2,69],{22:[1,182]}),{22:[1,183]},{22:$VZ,24:$V_,26:$V$,38:$V01,39:184,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,42:$V11,46:$VD,61:$V21,69:$V31,70:[1,185],72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},o($Vj1,[2,76]),o($Vj1,[2,78]),o($Vj1,[2,134]),o($Vj1,[2,135]),o($Vj1,[2,136]),o($Vj1,[2,137]),o($Vj1,[2,138]),o($Vj1,[2,139]),o($Vj1,[2,140]),o($Vj1,[2,141]),o($Vj1,[2,142]),o($Vj1,[2,143]),o($Vj1,[2,79]),o($Vj1,[2,80]),o($Vj1,[2,81]),o($Vj1,[2,82]),o($Vj1,[2,83]),o($Vj1,[2,84]),o($Vj1,[2,85]),o($Vj1,[2,86]),o($Vj1,[2,87]),o($Vj1,[2,88]),o($Vj1,[2,89]),{9:188,20:$Vy,21:$Vz,22:$VZ,23:$VA,24:$V_,26:$V$,38:$V01,40:[1,187],42:$V11,46:$VD,61:$V21,69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,189],44:31,45:37,46:$Vb,48:38,75:$Vc,76:$Vd,77:$Ve,78:$Vf,79:$Vg,80:$Vh,94:$Vi,95:$Vj,98:$Vk,99:$Vl,100:$Vm,102:$Vn,103:$Vo,107:39,109:$Vp,110:$Vq,111:$Vr,112:$Vs,113:$Vt,114:$Vu},{22:$Vw,30:190},{22:[1,191],26:$VC,46:$VD,80:$VE,94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,106:89,108:165,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:[1,192]},{22:[1,193]},{22:[1,194],95:[1,195]},o($Vl1,[2,117]),{22:[1,196]},{22:[1,197],26:$VC,46:$VD,80:$VE,94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,106:89,108:165,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:[1,198],26:$VC,46:$VD,80:$VE,94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,106:89,108:165,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{73:[1,199]},o($VV,[2,97],{22:[1,200]}),{73:[1,201],90:[1,202]},{73:[1,203]},o($Vi1,[2,147]),{73:[1,204],90:[1,205]},o($VS,[2,53],{107:116,46:$Vb,80:$Vh,94:$Vi,95:$Vj,98:$Vk,99:$Vl,100:$Vm,102:$Vn,103:$Vo,109:$Vp,110:$Vq,111:$Vr,112:$Vs,113:$Vt,114:$Vu}),{22:$VZ,24:$V_,26:$V$,38:$V01,41:[1,206],42:$V11,46:$VD,61:$V21,69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,39:207,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,42:$V11,46:$VD,50:[1,208],61:$V21,69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,42:$V11,46:$VD,52:[1,209],61:$V21,69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,42:$V11,46:$VD,54:[1,210],61:$V21,69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,42:$V11,46:$VD,56:[1,211],61:$V21,69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,42:$V11,46:$VD,58:[1,212],61:$V21,69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,42:$V11,46:$VD,60:[1,213],61:$V21,69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,39:214,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,41:[1,215],42:$V11,46:$VD,61:$V21,69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,42:$V11,46:$VD,61:$V21,63:[1,216],65:[1,217],69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{22:$VZ,24:$V_,26:$V$,38:$V01,42:$V11,46:$VD,61:$V21,63:[1,219],65:[1,218],69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{9:220,20:$Vy,21:$Vz,23:$VA},o($VB,[2,48],{46:$Vh1}),o($VY,[2,71]),o($VY,[2,70]),{22:$VZ,24:$V_,26:$V$,38:$V01,42:$V11,46:$VD,61:$V21,69:$V31,71:[1,221],72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},o($VY,[2,73]),o($Vj1,[2,77]),{22:$VZ,24:$V_,26:$V$,38:$V01,39:222,42:$V11,46:$VD,61:$V21,69:$V31,72:127,73:$V41,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},o($Vg1,$V5,{17:223}),o($Vx,[2,43]),{45:224,46:$Vb,48:38,80:$Vh,94:$Vi,95:$Vj,98:$Vk,99:$Vl,100:$Vm,102:$Vn,103:$Vo,107:39,109:$Vp,110:$Vq,111:$Vr,112:$Vs,113:$Vt,114:$Vu},{22:$Vm1,75:$Vn1,85:225,91:$Vo1,94:$Vp1,96:226,97:227,98:$Vq1,99:$Vr1,100:$Vs1,101:$Vt1,102:$Vu1,103:$Vv1,104:$Vw1},{22:$Vm1,75:$Vn1,85:239,91:$Vo1,94:$Vp1,96:226,97:227,98:$Vq1,99:$Vr1,100:$Vs1,101:$Vt1,102:$Vu1,103:$Vv1,104:$Vw1},{22:$Vm1,75:$Vn1,85:240,91:$Vo1,93:[1,241],94:$Vp1,96:226,97:227,98:$Vq1,99:$Vr1,100:$Vs1,101:$Vt1,102:$Vu1,103:$Vv1,104:$Vw1},{22:$Vm1,75:$Vn1,85:242,91:$Vo1,93:[1,243],94:$Vp1,96:226,97:227,98:$Vq1,99:$Vr1,100:$Vs1,101:$Vt1,102:$Vu1,103:$Vv1,104:$Vw1},{94:[1,244]},{22:$Vm1,75:$Vn1,85:245,91:$Vo1,94:$Vp1,96:226,97:227,98:$Vq1,99:$Vr1,100:$Vs1,101:$Vt1,102:$Vu1,103:$Vv1,104:$Vw1},{22:$Vm1,75:$Vn1,85:246,91:$Vo1,94:$Vp1,96:226,97:227,98:$Vq1,99:$Vr1,100:$Vs1,101:$Vt1,102:$Vu1,103:$Vv1,104:$Vw1},{26:$VC,46:$VD,80:$VE,86:247,94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,106:89,108:87,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},o($VV,[2,96]),{73:[1,248]},o($VV,[2,100],{22:[1,249]}),o($VV,[2,101]),o($VV,[2,104]),o($VV,[2,106],{22:[1,250]}),o($VV,[2,107]),o($VT,[2,54]),{22:$VZ,24:$V_,26:$V$,38:$V01,42:$V11,46:$VD,50:[1,251],61:$V21,69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},o($VT,[2,60]),o($VT,[2,56]),o($VT,[2,57]),o($VT,[2,58]),o($VT,[2,59]),o($VT,[2,61]),{22:$VZ,24:$V_,26:$V$,38:$V01,42:$V11,46:$VD,60:[1,252],61:$V21,69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},o($VT,[2,63]),o($VT,[2,64]),o($VT,[2,66]),o($VT,[2,65]),o($VT,[2,67]),o($Vk1,[2,4]),o([22,46,80,94,95,98,99,100,102,103,109,110,111,112,113,114],[2,75]),{22:$VZ,24:$V_,26:$V$,38:$V01,41:[1,253],42:$V11,46:$VD,61:$V21,69:$V31,72:186,74:138,75:$V51,76:$V61,77:$V71,78:$V81,79:$V91,80:$Va1,81:$Vb1,83:129,84:$Vc1,94:$VF,95:$VG,98:$VH,99:$VI,100:$Vd1,102:$VK,103:$VL,104:$Ve1,105:$Vf1,106:135,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,254],44:31,45:37,46:$Vb,48:38,75:$Vc,76:$Vd,77:$Ve,78:$Vf,79:$Vg,80:$Vh,94:$Vi,95:$Vj,98:$Vk,99:$Vl,100:$Vm,102:$Vn,103:$Vo,107:39,109:$Vp,110:$Vq,111:$Vr,112:$Vs,113:$Vt,114:$Vu},o($VS,[2,52]),o($VV,[2,109],{95:$Vx1}),o($Vy1,[2,119],{97:256,22:$Vm1,75:$Vn1,91:$Vo1,94:$Vp1,98:$Vq1,99:$Vr1,100:$Vs1,101:$Vt1,102:$Vu1,103:$Vv1,104:$Vw1}),o($Vz1,[2,121]),o($Vz1,[2,123]),o($Vz1,[2,124]),o($Vz1,[2,125]),o($Vz1,[2,126]),o($Vz1,[2,127]),o($Vz1,[2,128]),o($Vz1,[2,129]),o($Vz1,[2,130]),o($Vz1,[2,131]),o($Vz1,[2,132]),o($Vz1,[2,133]),o($VV,[2,110],{95:$Vx1}),o($VV,[2,111],{95:$Vx1}),{22:[1,257]},o($VV,[2,112],{95:$Vx1}),{22:[1,258]},o($Vl1,[2,118]),o($VV,[2,92],{95:$Vx1}),o($VV,[2,93],{95:$Vx1}),o($VV,[2,94],{106:89,108:165,26:$VC,46:$VD,80:$VE,94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR}),o($VV,[2,98]),{90:[1,259]},{90:[1,260]},{50:[1,261]},{60:[1,262]},{9:263,20:$Vy,21:$Vz,23:$VA},o($Vx,[2,42]),{22:$Vm1,75:$Vn1,91:$Vo1,94:$Vp1,96:264,97:227,98:$Vq1,99:$Vr1,100:$Vs1,101:$Vt1,102:$Vu1,103:$Vv1,104:$Vw1},o($Vz1,[2,122]),{26:$VC,46:$VD,80:$VE,86:265,94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,106:89,108:87,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},{26:$VC,46:$VD,80:$VE,86:266,94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,106:89,108:87,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR},o($VV,[2,102]),o($VV,[2,108]),o($VT,[2,55]),o($VT,[2,62]),o($Vg1,$V5,{17:267}),o($Vy1,[2,120],{97:256,22:$Vm1,75:$Vn1,91:$Vo1,94:$Vp1,98:$Vq1,99:$Vr1,100:$Vs1,101:$Vt1,102:$Vu1,103:$Vv1,104:$Vw1}),o($VV,[2,115],{106:89,108:165,22:[1,268],26:$VC,46:$VD,80:$VE,94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR}),o($VV,[2,116],{106:89,108:165,22:[1,269],26:$VC,46:$VD,80:$VE,94:$VF,95:$VG,98:$VH,99:$VI,100:$VJ,102:$VK,103:$VL,109:$VM,110:$VN,111:$VO,112:$VP,113:$VQ,114:$VR}),{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,270],44:31,45:37,46:$Vb,48:38,75:$Vc,76:$Vd,77:$Ve,78:$Vf,79:$Vg,80:$Vh,94:$Vi,95:$Vj,98:$Vk,99:$Vl,100:$Vm,102:$Vn,103:$Vo,107:39,109:$Vp,110:$Vq,111:$Vr,112:$Vs,113:$Vt,114:$Vu},{22:$Vm1,75:$Vn1,85:271,91:$Vo1,94:$Vp1,96:226,97:227,98:$Vq1,99:$Vr1,100:$Vs1,101:$Vt1,102:$Vu1,103:$Vv1,104:$Vw1},{22:$Vm1,75:$Vn1,85:272,91:$Vo1,94:$Vp1,96:226,97:227,98:$Vq1,99:$Vr1,100:$Vs1,101:$Vt1,102:$Vu1,103:$Vv1,104:$Vw1},o($Vx,[2,41]),o($VV,[2,113],{95:$Vx1}),o($VV,[2,114],{95:$Vx1})], -defaultActions: {2:[2,1],9:[2,5],10:[2,2],119:[2,7]}, -parseError: function parseError (str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - var error = new Error(str); - error.hash = hash; - throw error; - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = tstack.pop() || lexer.lex() || EOF; - if (typeof token !== 'number') { - if (token instanceof Array) { - tstack = token; - token = tstack.pop(); - } - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; - -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function(match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex () { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin (condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState () { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules () { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState (n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState (condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0: this.begin('open_directive'); return 12; -break; -case 1: this.begin('type_directive'); return 13; -break; -case 2: this.popState(); this.begin('arg_directive'); return 10; -break; -case 3: this.popState(); this.popState(); return 15; -break; -case 4:return 14; -break; -case 5:/* skip comments */ -break; -case 6:/* skip comments */ -break; -case 7:this.begin("string"); -break; -case 8:this.popState(); -break; -case 9:return "STR"; -break; -case 10:return 75; -break; -case 11:return 84; -break; -case 12:return 76; -break; -case 13:return 93; -break; -case 14:return 77; -break; -case 15:return 78; -break; -case 16:this.begin("href"); -break; -case 17:this.popState(); -break; -case 18:return 89; -break; -case 19:this.begin("callbackname"); -break; -case 20:this.popState(); -break; -case 21:this.popState(); this.begin("callbackargs"); -break; -case 22:return 87; -break; -case 23:this.popState(); -break; -case 24:return 88; -break; -case 25:this.begin("click"); -break; -case 26:this.popState(); -break; -case 27:return 79; -break; -case 28:if(yy.lex.firstGraph()){this.begin("dir");} return 24; -break; -case 29:if(yy.lex.firstGraph()){this.begin("dir");} return 24; -break; -case 30:return 38; -break; -case 31:return 42; -break; -case 32:return 90; -break; -case 33:return 90; -break; -case 34:return 90; -break; -case 35:return 90; -break; -case 36: this.popState(); return 25; -break; -case 37: this.popState(); return 26; -break; -case 38: this.popState(); return 26; -break; -case 39: this.popState(); return 26; -break; -case 40: this.popState(); return 26; -break; -case 41: this.popState(); return 26; -break; -case 42: this.popState(); return 26; -break; -case 43: this.popState(); return 26; -break; -case 44: this.popState(); return 26; -break; -case 45: this.popState(); return 26; -break; -case 46: this.popState(); return 26; -break; -case 47: return 94; -break; -case 48:return 102; -break; -case 49:return 47; -break; -case 50:return 99; -break; -case 51:return 46; -break; -case 52:return 20; -break; -case 53:return 95; -break; -case 54:return 113; -break; -case 55:return 70; -break; -case 56:return 70; -break; -case 57:return 70; -break; -case 58:return 69; -break; -case 59:return 69; -break; -case 60:return 69; -break; -case 61:return 51; -break; -case 62:return 52; -break; -case 63:return 53; -break; -case 64:return 54; -break; -case 65:return 55; -break; -case 66:return 56; -break; -case 67:return 57; -break; -case 68:return 58; -break; -case 69:return 100; -break; -case 70:return 103; -break; -case 71:return 114; -break; -case 72:return 111; -break; -case 73:return 104; -break; -case 74:return 112; -break; -case 75:return 112; -break; -case 76:return 105; -break; -case 77:return 61; -break; -case 78:return 81; -break; -case 79:return 'SEP'; -break; -case 80:return 80; -break; -case 81:return 98; -break; -case 82:return 63; -break; -case 83:return 62; -break; -case 84:return 65; -break; -case 85:return 64; -break; -case 86:return 109; -break; -case 87:return 110; -break; -case 88:return 71; -break; -case 89:return 49; -break; -case 90:return 50; -break; -case 91:return 40; -break; -case 92:return 41; -break; -case 93:return 59 -break; -case 94:return 60 -break; -case 95:return 120; -break; -case 96:return 21; -break; -case 97:return 22; -break; -case 98:return 23; -break; -} -}, -rules: [/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[^\}]%%[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\[)/,/^(?:\]\))/,/^(?:\[\[)/,/^(?:\]\])/,/^(?:\[\()/,/^(?:\)\])/,/^(?:-)/,/^(?:\.)/,/^(?:[\_])/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/], -conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"callbackargs":{"rules":[23,24],"inclusive":false},"callbackname":{"rules":[20,21,22],"inclusive":false},"href":{"rules":[17,18],"inclusive":false},"click":{"rules":[26,27],"inclusive":false},"vertex":{"rules":[],"inclusive":false},"dir":{"rules":[36,37,38,39,40,41,42,43,44,45,46],"inclusive":false},"string":{"rules":[8,9],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,10,11,12,13,14,15,16,19,25,28,29,30,31,32,33,34,35,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (true) { -exports.parser = parser; -exports.Parser = parser.Parser; -exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain (args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if ( true && __webpack_require__.c[__webpack_require__.s] === module) { - exports.main(process.argv.slice(1)); -} -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./src/diagrams/flowchart/styles.js": -/*!******************************************!*\ - !*** ./src/diagrams/flowchart/styles.js ***! - \******************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -var getStyles = function getStyles(options) { - return ".label {\n font-family: ".concat(options.fontFamily, ";\n color: ").concat(options.nodeTextColor || options.textColor, ";\n }\n .cluster-label text {\n fill: ").concat(options.titleColor, ";\n }\n .cluster-label span {\n color: ").concat(options.titleColor, ";\n }\n\n .label text,span {\n fill: ").concat(options.nodeTextColor || options.textColor, ";\n color: ").concat(options.nodeTextColor || options.textColor, ";\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ").concat(options.arrowheadColor, ";\n }\n\n .edgePath .path {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ").concat(options.lineColor, ";\n fill: none;\n }\n\n .edgeLabel {\n background-color: ").concat(options.edgeLabelBackground, ";\n rect {\n opacity: 0.5;\n background-color: ").concat(options.edgeLabelBackground, ";\n fill: ").concat(options.edgeLabelBackground, ";\n }\n text-align: center;\n }\n\n .cluster rect {\n fill: ").concat(options.clusterBkg, ";\n stroke: ").concat(options.clusterBorder, ";\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ").concat(options.titleColor, ";\n }\n\n .cluster span {\n color: ").concat(options.titleColor, ";\n }\n // .cluster div {\n // color: ").concat(options.titleColor, ";\n // }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ").concat(options.fontFamily, ";\n font-size: 12px;\n background: ").concat(options.tertiaryColor, ";\n border: 1px solid ").concat(options.border2, ";\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n"); -}; - -/* harmony default export */ __webpack_exports__["default"] = (getStyles); - -/***/ }), - -/***/ "./src/diagrams/gantt/ganttDb.js": -/*!***************************************!*\ - !*** ./src/diagrams/gantt/ganttDb.js ***! - \***************************************/ -/*! exports provided: parseDirective, clear, setAxisFormat, getAxisFormat, setTodayMarker, getTodayMarker, setDateFormat, enableInclusiveEndDates, endDatesAreInclusive, getDateFormat, setExcludes, getExcludes, setTitle, getTitle, addSection, getSections, getTasks, addTask, findTaskById, addTaskOrg, setLink, setClass, setClickEvent, bindFunctions, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDirective", function() { return parseDirective; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAxisFormat", function() { return setAxisFormat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAxisFormat", function() { return getAxisFormat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTodayMarker", function() { return setTodayMarker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTodayMarker", function() { return getTodayMarker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDateFormat", function() { return setDateFormat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableInclusiveEndDates", function() { return enableInclusiveEndDates; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endDatesAreInclusive", function() { return endDatesAreInclusive; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDateFormat", function() { return getDateFormat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setExcludes", function() { return setExcludes; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getExcludes", function() { return getExcludes; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTitle", function() { return setTitle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTitle", function() { return getTitle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSection", function() { return addSection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSections", function() { return getSections; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTasks", function() { return getTasks; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTask", function() { return addTask; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findTaskById", function() { return findTaskById; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTaskOrg", function() { return addTaskOrg; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLink", function() { return setLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClass", function() { return setClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClickEvent", function() { return setClickEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindFunctions", function() { return bindFunctions; }); -/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment-mini */ "moment-mini"); -/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_mini__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @braintree/sanitize-url */ "@braintree/sanitize-url"); -/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); -/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - - - - - - - -var dateFormat = ''; -var axisFormat = ''; -var todayMarker = ''; -var excludes = []; -var title = ''; -var sections = []; -var tasks = []; -var currentSection = ''; -var tags = ['active', 'done', 'crit', 'milestone']; -var funs = []; -var inclusiveEndDates = false; // The serial order of the task in the script - -var lastOrder = 0; -var parseDirective = function parseDirective(statement, context, type) { - _mermaidAPI__WEBPACK_IMPORTED_MODULE_5__["default"].parseDirective(this, statement, context, type); -}; -var clear = function clear() { - sections = []; - tasks = []; - currentSection = ''; - funs = []; - title = ''; - taskCnt = 0; - lastTask = undefined; - lastTaskID = undefined; - rawTasks = []; - dateFormat = ''; - axisFormat = ''; - todayMarker = ''; - excludes = []; - inclusiveEndDates = false; - lastOrder = 0; -}; -var setAxisFormat = function setAxisFormat(txt) { - axisFormat = txt; -}; -var getAxisFormat = function getAxisFormat() { - return axisFormat; -}; -var setTodayMarker = function setTodayMarker(txt) { - todayMarker = txt; -}; -var getTodayMarker = function getTodayMarker() { - return todayMarker; -}; -var setDateFormat = function setDateFormat(txt) { - dateFormat = txt; -}; -var enableInclusiveEndDates = function enableInclusiveEndDates() { - inclusiveEndDates = true; -}; -var endDatesAreInclusive = function endDatesAreInclusive() { - return inclusiveEndDates; -}; -var getDateFormat = function getDateFormat() { - return dateFormat; -}; -var setExcludes = function setExcludes(txt) { - excludes = txt.toLowerCase().split(/[\s,]+/); -}; -var getExcludes = function getExcludes() { - return excludes; -}; -var setTitle = function setTitle(txt) { - title = txt; -}; -var getTitle = function getTitle() { - return title; -}; -var addSection = function addSection(txt) { - currentSection = txt; - sections.push(txt); -}; -var getSections = function getSections() { - return sections; -}; -var getTasks = function getTasks() { - var allItemsPricessed = compileTasks(); - var maxDepth = 10; - var iterationCount = 0; - - while (!allItemsPricessed && iterationCount < maxDepth) { - allItemsPricessed = compileTasks(); - iterationCount++; - } - - tasks = rawTasks; - return tasks; -}; - -var isInvalidDate = function isInvalidDate(date, dateFormat, excludes) { - if (date.isoWeekday() >= 6 && excludes.indexOf('weekends') >= 0) { - return true; - } - - if (excludes.indexOf(date.format('dddd').toLowerCase()) >= 0) { - return true; - } - - return excludes.indexOf(date.format(dateFormat.trim())) >= 0; -}; - -var checkTaskDates = function checkTaskDates(task, dateFormat, excludes) { - if (!excludes.length || task.manualEndTime) return; - var startTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(task.startTime, dateFormat, true); - startTime.add(1, 'd'); - var endTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(task.endTime, dateFormat, true); - var renderEndTime = fixTaskDates(startTime, endTime, dateFormat, excludes); - task.endTime = endTime.toDate(); - task.renderEndTime = renderEndTime; -}; - -var fixTaskDates = function fixTaskDates(startTime, endTime, dateFormat, excludes) { - var invalid = false; - var renderEndTime = null; - - while (startTime <= endTime) { - if (!invalid) { - renderEndTime = endTime.toDate(); - } - - invalid = isInvalidDate(startTime, dateFormat, excludes); - - if (invalid) { - endTime.add(1, 'd'); - } - - startTime.add(1, 'd'); - } - - return renderEndTime; -}; - -var getStartDate = function getStartDate(prevTime, dateFormat, str) { - str = str.trim(); // Test for after - - var re = /^after\s+([\d\w- ]+)/; - var afterStatement = re.exec(str.trim()); - - if (afterStatement !== null) { - // check all after ids and take the latest - var latestEndingTask = null; - afterStatement[1].split(' ').forEach(function (id) { - var task = findTaskById(id); - - if (typeof task !== 'undefined') { - if (!latestEndingTask) { - latestEndingTask = task; - } else { - if (task.endTime > latestEndingTask.endTime) { - latestEndingTask = task; - } - } - } - }); - - if (!latestEndingTask) { - var dt = new Date(); - dt.setHours(0, 0, 0, 0); - return dt; - } else { - return latestEndingTask.endTime; - } - } // Check for actual date set - - - var mDate = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(str, dateFormat.trim(), true); - - if (mDate.isValid()) { - return mDate.toDate(); - } else { - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug('Invalid date:' + str); - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug('With date format:' + dateFormat.trim()); - } // Default date - now - - - return new Date(); -}; - -var durationToDate = function durationToDate(durationStatement, relativeTime) { - if (durationStatement !== null) { - switch (durationStatement[2]) { - case 's': - relativeTime.add(durationStatement[1], 'seconds'); - break; - - case 'm': - relativeTime.add(durationStatement[1], 'minutes'); - break; - - case 'h': - relativeTime.add(durationStatement[1], 'hours'); - break; - - case 'd': - relativeTime.add(durationStatement[1], 'days'); - break; - - case 'w': - relativeTime.add(durationStatement[1], 'weeks'); - break; - } - } // Default date - now - - - return relativeTime.toDate(); -}; - -var getEndDate = function getEndDate(prevTime, dateFormat, str, inclusive) { - inclusive = inclusive || false; - str = str.trim(); // Check for actual date - - var mDate = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(str, dateFormat.trim(), true); - - if (mDate.isValid()) { - if (inclusive) { - mDate.add(1, 'd'); - } - - return mDate.toDate(); - } - - return durationToDate(/^([\d]+)([wdhms])/.exec(str.trim()), moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(prevTime)); -}; - -var taskCnt = 0; - -var parseId = function parseId(idStr) { - if (typeof idStr === 'undefined') { - taskCnt = taskCnt + 1; - return 'task' + taskCnt; - } - - return idStr; -}; // id, startDate, endDate -// id, startDate, length -// id, after x, endDate -// id, after x, length -// startDate, endDate -// startDate, length -// after x, endDate -// after x, length -// endDate -// length - - -var compileData = function compileData(prevTask, dataStr) { - var ds; - - if (dataStr.substr(0, 1) === ':') { - ds = dataStr.substr(1, dataStr.length); - } else { - ds = dataStr; - } - - var data = ds.split(','); - var task = {}; // Get tags like active, done, crit and milestone - - getTaskTags(data, task, tags); - - for (var i = 0; i < data.length; i++) { - data[i] = data[i].trim(); - } - - var endTimeData = ''; - - switch (data.length) { - case 1: - task.id = parseId(); - task.startTime = prevTask.endTime; - endTimeData = data[0]; - break; - - case 2: - task.id = parseId(); - task.startTime = getStartDate(undefined, dateFormat, data[0]); - endTimeData = data[1]; - break; - - case 3: - task.id = parseId(data[0]); - task.startTime = getStartDate(undefined, dateFormat, data[1]); - endTimeData = data[2]; - break; - - default: - } - - if (endTimeData) { - task.endTime = getEndDate(task.startTime, dateFormat, endTimeData, inclusiveEndDates); - task.manualEndTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(endTimeData, 'YYYY-MM-DD', true).isValid(); - checkTaskDates(task, dateFormat, excludes); - } - - return task; -}; - -var parseData = function parseData(prevTaskId, dataStr) { - var ds; - - if (dataStr.substr(0, 1) === ':') { - ds = dataStr.substr(1, dataStr.length); - } else { - ds = dataStr; - } - - var data = ds.split(','); - var task = {}; // Get tags like active, done, crit and milestone - - getTaskTags(data, task, tags); - - for (var i = 0; i < data.length; i++) { - data[i] = data[i].trim(); - } - - switch (data.length) { - case 1: - task.id = parseId(); - task.startTime = { - type: 'prevTaskEnd', - id: prevTaskId - }; - task.endTime = { - data: data[0] - }; - break; - - case 2: - task.id = parseId(); - task.startTime = { - type: 'getStartDate', - startData: data[0] - }; - task.endTime = { - data: data[1] - }; - break; - - case 3: - task.id = parseId(data[0]); - task.startTime = { - type: 'getStartDate', - startData: data[1] - }; - task.endTime = { - data: data[2] - }; - break; - - default: - } - - return task; -}; - -var lastTask; -var lastTaskID; -var rawTasks = []; -var taskDb = {}; -var addTask = function addTask(descr, data) { - var rawTask = { - section: currentSection, - type: currentSection, - processed: false, - manualEndTime: false, - renderEndTime: null, - raw: { - data: data - }, - task: descr, - classes: [] - }; - var taskInfo = parseData(lastTaskID, data); - rawTask.raw.startTime = taskInfo.startTime; - rawTask.raw.endTime = taskInfo.endTime; - rawTask.id = taskInfo.id; - rawTask.prevTaskId = lastTaskID; - rawTask.active = taskInfo.active; - rawTask.done = taskInfo.done; - rawTask.crit = taskInfo.crit; - rawTask.milestone = taskInfo.milestone; - rawTask.order = lastOrder; - lastOrder++; - var pos = rawTasks.push(rawTask); - lastTaskID = rawTask.id; // Store cross ref - - taskDb[rawTask.id] = pos - 1; -}; -var findTaskById = function findTaskById(id) { - var pos = taskDb[id]; - return rawTasks[pos]; -}; -var addTaskOrg = function addTaskOrg(descr, data) { - var newTask = { - section: currentSection, - type: currentSection, - description: descr, - task: descr, - classes: [] - }; - var taskInfo = compileData(lastTask, data); - newTask.startTime = taskInfo.startTime; - newTask.endTime = taskInfo.endTime; - newTask.id = taskInfo.id; - newTask.active = taskInfo.active; - newTask.done = taskInfo.done; - newTask.crit = taskInfo.crit; - newTask.milestone = taskInfo.milestone; - lastTask = newTask; - tasks.push(newTask); -}; - -var compileTasks = function compileTasks() { - var compileTask = function compileTask(pos) { - var task = rawTasks[pos]; - var startTime = ''; - - switch (rawTasks[pos].raw.startTime.type) { - case 'prevTaskEnd': - { - var prevTask = findTaskById(task.prevTaskId); - task.startTime = prevTask.endTime; - break; - } - - case 'getStartDate': - startTime = getStartDate(undefined, dateFormat, rawTasks[pos].raw.startTime.startData); - - if (startTime) { - rawTasks[pos].startTime = startTime; - } - - break; - } - - if (rawTasks[pos].startTime) { - rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, dateFormat, rawTasks[pos].raw.endTime.data, inclusiveEndDates); - - if (rawTasks[pos].endTime) { - rawTasks[pos].processed = true; - rawTasks[pos].manualEndTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(rawTasks[pos].raw.endTime.data, 'YYYY-MM-DD', true).isValid(); - checkTaskDates(rawTasks[pos], dateFormat, excludes); - } - } - - return rawTasks[pos].processed; - }; - - var allProcessed = true; - - for (var i = 0; i < rawTasks.length; i++) { - compileTask(i); - allProcessed = allProcessed && rawTasks[i].processed; - } - - return allProcessed; -}; -/** - * Called by parser when a link is found. Adds the URL to the vertex data. - * @param ids Comma separated list of ids - * @param linkStr URL to create a link for - */ - - -var setLink = function setLink(ids, _linkStr) { - var linkStr = _linkStr; - - if (_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"]().securityLevel !== 'loose') { - linkStr = Object(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__["sanitizeUrl"])(_linkStr); - } - - ids.split(',').forEach(function (id) { - var rawTask = findTaskById(id); - - if (typeof rawTask !== 'undefined') { - pushFun(id, function () { - window.open(linkStr, '_self'); - }); - } - }); - setClass(ids, 'clickable'); -}; -/** - * Called by parser when a special node is found, e.g. a clickable element. - * @param ids Comma separated list of ids - * @param className Class to add - */ - -var setClass = function setClass(ids, className) { - ids.split(',').forEach(function (id) { - var rawTask = findTaskById(id); - - if (typeof rawTask !== 'undefined') { - rawTask.classes.push(className); - } - }); -}; - -var setClickFun = function setClickFun(id, functionName, functionArgs) { - if (_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"]().securityLevel !== 'loose') { - return; - } - - if (typeof functionName === 'undefined') { - return; - } - - var argList = []; - - if (typeof functionArgs === 'string') { - /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */ - argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); - - for (var i = 0; i < argList.length; i++) { - var item = argList[i].trim(); - /* Removes all double quotes at the start and end of an argument */ - - /* This preserves all starting and ending whitespace inside */ - - if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') { - item = item.substr(1, item.length - 2); - } - - argList[i] = item; - } - } - /* if no arguments passed into callback, default to passing in id */ - - - if (argList.length === 0) { - argList.push(id); - } - - var rawTask = findTaskById(id); - - if (typeof rawTask !== 'undefined') { - pushFun(id, function () { - _utils__WEBPACK_IMPORTED_MODULE_4__["default"].runFunc.apply(_utils__WEBPACK_IMPORTED_MODULE_4__["default"], [functionName].concat(_toConsumableArray(argList))); - }); - } -}; -/** - * The callbackFunction is executed in a click event bound to the task with the specified id or the task's assigned text - * @param id The task's id - * @param callbackFunction A function to be executed when clicked on the task or the task's text - */ - - -var pushFun = function pushFun(id, callbackFunction) { - funs.push(function () { - // const elem = d3.select(element).select(`[id="${id}"]`) - var elem = document.querySelector("[id=\"".concat(id, "\"]")); - - if (elem !== null) { - elem.addEventListener('click', function () { - callbackFunction(); - }); - } - }); - funs.push(function () { - // const elem = d3.select(element).select(`[id="${id}-text"]`) - var elem = document.querySelector("[id=\"".concat(id, "-text\"]")); - - if (elem !== null) { - elem.addEventListener('click', function () { - callbackFunction(); - }); - } - }); -}; -/** - * Called by parser when a click definition is found. Registers an event handler. - * @param ids Comma separated list of ids - * @param functionName Function to be called on click - * @param functionArgs Function args the function should be called with - */ - - -var setClickEvent = function setClickEvent(ids, functionName, functionArgs) { - ids.split(',').forEach(function (id) { - setClickFun(id, functionName, functionArgs); - }); - setClass(ids, 'clickable'); -}; -/** - * Binds all functions previously added to fun (specified through click) to the element - * @param element - */ - -var bindFunctions = function bindFunctions(element) { - funs.forEach(function (fun) { - fun(element); - }); -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - parseDirective: parseDirective, - getConfig: function getConfig() { - return _config__WEBPACK_IMPORTED_MODULE_3__["getConfig"]().gantt; - }, - clear: clear, - setDateFormat: setDateFormat, - getDateFormat: getDateFormat, - enableInclusiveEndDates: enableInclusiveEndDates, - endDatesAreInclusive: endDatesAreInclusive, - setAxisFormat: setAxisFormat, - getAxisFormat: getAxisFormat, - setTodayMarker: setTodayMarker, - getTodayMarker: getTodayMarker, - setTitle: setTitle, - getTitle: getTitle, - addSection: addSection, - getSections: getSections, - getTasks: getTasks, - addTask: addTask, - findTaskById: findTaskById, - addTaskOrg: addTaskOrg, - setExcludes: setExcludes, - getExcludes: getExcludes, - setClickEvent: setClickEvent, - setLink: setLink, - bindFunctions: bindFunctions, - durationToDate: durationToDate -}); - -function getTaskTags(data, task, tags) { - var matchFound = true; - - while (matchFound) { - matchFound = false; - tags.forEach(function (t) { - var pattern = '^\\s*' + t + '\\s*$'; - var regex = new RegExp(pattern); - - if (data[0].match(regex)) { - task[t] = true; - data.shift(1); - matchFound = true; - } - }); - } -} - -/***/ }), - -/***/ "./src/diagrams/gantt/ganttRenderer.js": -/*!*********************************************!*\ - !*** ./src/diagrams/gantt/ganttRenderer.js ***! - \*********************************************/ -/*! exports provided: setConf, draw, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _parser_gantt__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser/gantt */ "./src/diagrams/gantt/parser/gantt.jison"); -/* harmony import */ var _parser_gantt__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); -/* harmony import */ var _ganttDb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ganttDb */ "./src/diagrams/gantt/ganttDb.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); - - - - - -_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy = _ganttDb__WEBPACK_IMPORTED_MODULE_3__["default"]; -var conf = { - titleTopMargin: 25, - barHeight: 20, - barGap: 4, - topPadding: 50, - rightPadding: 75, - leftPadding: 75, - gridLineStartPadding: 35, - fontSize: 11, - fontFamily: '"Open-Sans", "sans-serif"' -}; -var setConf = function setConf(cnf) { - var keys = Object.keys(cnf); - keys.forEach(function (key) { - conf[key] = cnf[key]; - }); -}; -var w; -var draw = function draw(text, id) { - _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.clear(); - _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].parse(text); - var elem = document.getElementById(id); - w = elem.parentElement.offsetWidth; - - if (typeof w === 'undefined') { - w = 1200; - } - - if (typeof conf.useWidth !== 'undefined') { - w = conf.useWidth; - } - - var taskArray = _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getTasks(); // Set height based on number of tasks - - var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding; // Set viewBox - - elem.setAttribute('viewBox', '0 0 ' + w + ' ' + h); - var svg = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])("[id=\"".concat(id, "\"]")); // Set timescale - - var timeScale = Object(d3__WEBPACK_IMPORTED_MODULE_0__["scaleTime"])().domain([Object(d3__WEBPACK_IMPORTED_MODULE_0__["min"])(taskArray, function (d) { - return d.startTime; - }), Object(d3__WEBPACK_IMPORTED_MODULE_0__["max"])(taskArray, function (d) { - return d.endTime; - })]).rangeRound([0, w - conf.leftPadding - conf.rightPadding]); - var categories = []; - - for (var i = 0; i < taskArray.length; i++) { - categories.push(taskArray[i].type); - } - - var catsUnfiltered = categories; // for vert labels - - categories = checkUnique(categories); - - function taskCompare(a, b) { - var taskA = a.startTime; - var taskB = b.startTime; - var result = 0; - - if (taskA > taskB) { - result = 1; - } else if (taskA < taskB) { - result = -1; - } - - return result; - } // Sort the task array using the above taskCompare() so that - // tasks are created based on their order of startTime - - - taskArray.sort(taskCompare); - makeGant(taskArray, w, h); - Object(_utils__WEBPACK_IMPORTED_MODULE_4__["configureSvgSize"])(svg, h, w, conf.useMaxWidth); - svg.append('text').text(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getTitle()).attr('x', w / 2).attr('y', conf.titleTopMargin).attr('class', 'titleText'); - - function makeGant(tasks, pageWidth, pageHeight) { - var barHeight = conf.barHeight; - var gap = barHeight + conf.barGap; - var topPadding = conf.topPadding; - var leftPadding = conf.leftPadding; - var colorScale = Object(d3__WEBPACK_IMPORTED_MODULE_0__["scaleLinear"])().domain([0, categories.length]).range(['#00B9FA', '#F95002']).interpolate(d3__WEBPACK_IMPORTED_MODULE_0__["interpolateHcl"]); - makeGrid(leftPadding, topPadding, pageWidth, pageHeight); - drawRects(tasks, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth, pageHeight); - vertLabels(gap, topPadding, leftPadding, barHeight, colorScale); - drawToday(leftPadding, topPadding, pageWidth, pageHeight); - } - - function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w) { - // Draw background rects covering the entire width of the graph, these form the section rows. - svg.append('g').selectAll('rect').data(theArray).enter().append('rect').attr('x', 0).attr('y', function (d, i) { - // Ignore the incoming i value and use our order instead - i = d.order; - return i * theGap + theTopPad - 2; - }).attr('width', function () { - return w - conf.rightPadding / 2; - }).attr('height', theGap).attr('class', function (d) { - for (var _i = 0; _i < categories.length; _i++) { - if (d.type === categories[_i]) { - return 'section section' + _i % conf.numberSectionStyles; - } - } - - return 'section section0'; - }); // Draw the rects representing the tasks - - var rectangles = svg.append('g').selectAll('rect').data(theArray).enter(); - rectangles.append('rect').attr('id', function (d) { - return d.id; - }).attr('rx', 3).attr('ry', 3).attr('x', function (d) { - if (d.milestone) { - return timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight; - } - - return timeScale(d.startTime) + theSidePad; - }).attr('y', function (d, i) { - // Ignore the incoming i value and use our order instead - i = d.order; - return i * theGap + theTopPad; - }).attr('width', function (d) { - if (d.milestone) { - return theBarHeight; - } - - return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime); - }).attr('height', theBarHeight).attr('transform-origin', function (d, i) { - return (timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime))).toString() + 'px ' + (i * theGap + theTopPad + 0.5 * theBarHeight).toString() + 'px'; - }).attr('class', function (d) { - var res = 'task'; - var classStr = ''; - - if (d.classes.length > 0) { - classStr = d.classes.join(' '); - } - - var secNum = 0; - - for (var _i2 = 0; _i2 < categories.length; _i2++) { - if (d.type === categories[_i2]) { - secNum = _i2 % conf.numberSectionStyles; - } - } - - var taskClass = ''; - - if (d.active) { - if (d.crit) { - taskClass += ' activeCrit'; - } else { - taskClass = ' active'; - } - } else if (d.done) { - if (d.crit) { - taskClass = ' doneCrit'; - } else { - taskClass = ' done'; - } - } else { - if (d.crit) { - taskClass += ' crit'; - } - } - - if (taskClass.length === 0) { - taskClass = ' task'; - } - - if (d.milestone) { - taskClass = ' milestone ' + taskClass; - } - - taskClass += secNum; - taskClass += ' ' + classStr; - return res + taskClass; - }); // Append task labels - - rectangles.append('text').attr('id', function (d) { - return d.id + '-text'; - }).text(function (d) { - return d.task; - }).attr('font-size', conf.fontSize).attr('x', function (d) { - var startX = timeScale(d.startTime); - var endX = timeScale(d.renderEndTime || d.endTime); - - if (d.milestone) { - startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight; - } - - if (d.milestone) { - endX = startX + theBarHeight; - } - - var textWidth = this.getBBox().width; // Check id text width > width of rectangle - - if (textWidth > endX - startX) { - if (endX + textWidth + 1.5 * conf.leftPadding > w) { - return startX + theSidePad - 5; - } else { - return endX + theSidePad + 5; - } - } else { - return (endX - startX) / 2 + startX + theSidePad; - } - }).attr('y', function (d, i) { - // Ignore the incoming i value and use our order instead - i = d.order; - return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad; - }).attr('text-height', theBarHeight).attr('class', function (d) { - var startX = timeScale(d.startTime); - var endX = timeScale(d.endTime); - - if (d.milestone) { - endX = startX + theBarHeight; - } - - var textWidth = this.getBBox().width; - var classStr = ''; - - if (d.classes.length > 0) { - classStr = d.classes.join(' '); - } - - var secNum = 0; - - for (var _i3 = 0; _i3 < categories.length; _i3++) { - if (d.type === categories[_i3]) { - secNum = _i3 % conf.numberSectionStyles; - } - } - - var taskType = ''; - - if (d.active) { - if (d.crit) { - taskType = 'activeCritText' + secNum; - } else { - taskType = 'activeText' + secNum; - } - } - - if (d.done) { - if (d.crit) { - taskType = taskType + ' doneCritText' + secNum; - } else { - taskType = taskType + ' doneText' + secNum; - } - } else { - if (d.crit) { - taskType = taskType + ' critText' + secNum; - } - } - - if (d.milestone) { - taskType += ' milestoneText'; - } // Check id text width > width of rectangle - - - if (textWidth > endX - startX) { - if (endX + textWidth + 1.5 * conf.leftPadding > w) { - return classStr + ' taskTextOutsideLeft taskTextOutside' + secNum + ' ' + taskType; - } else { - return classStr + ' taskTextOutsideRight taskTextOutside' + secNum + ' ' + taskType + ' width-' + textWidth; - } - } else { - return classStr + ' taskText taskText' + secNum + ' ' + taskType + ' width-' + textWidth; - } - }); - } - - function makeGrid(theSidePad, theTopPad, w, h) { - var xAxis = Object(d3__WEBPACK_IMPORTED_MODULE_0__["axisBottom"])(timeScale).tickSize(-h + theTopPad + conf.gridLineStartPadding).tickFormat(Object(d3__WEBPACK_IMPORTED_MODULE_0__["timeFormat"])(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d')); - svg.append('g').attr('class', 'grid').attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')').call(xAxis).selectAll('text').style('text-anchor', 'middle').attr('fill', '#000').attr('stroke', 'none').attr('font-size', 10).attr('dy', '1em'); - } - - function vertLabels(theGap, theTopPad) { - var numOccurances = []; - var prevGap = 0; - - for (var _i4 = 0; _i4 < categories.length; _i4++) { - numOccurances[_i4] = [categories[_i4], getCount(categories[_i4], catsUnfiltered)]; - } - - svg.append('g') // without doing this, impossible to put grid lines behind text - .selectAll('text').data(numOccurances).enter().append(function (d) { - var rows = d[0].split(_common_common__WEBPACK_IMPORTED_MODULE_2__["default"].lineBreakRegex); - var dy = -(rows.length - 1) / 2; - var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text'); - svgLabel.setAttribute('dy', dy + 'em'); - - for (var j = 0; j < rows.length; j++) { - var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); - tspan.setAttribute('alignment-baseline', 'central'); - tspan.setAttribute('x', '10'); - if (j > 0) tspan.setAttribute('dy', '1em'); - tspan.textContent = rows[j]; - svgLabel.appendChild(tspan); - } - - return svgLabel; - }).attr('x', 10).attr('y', function (d, i) { - if (i > 0) { - for (var j = 0; j < i; j++) { - prevGap += numOccurances[i - 1][1]; - return d[1] * theGap / 2 + prevGap * theGap + theTopPad; - } - } else { - return d[1] * theGap / 2 + theTopPad; - } - }).attr('class', function (d) { - for (var _i5 = 0; _i5 < categories.length; _i5++) { - if (d[0] === categories[_i5]) { - return 'sectionTitle sectionTitle' + _i5 % conf.numberSectionStyles; - } - } - - return 'sectionTitle'; - }); - } - - function drawToday(theSidePad, theTopPad, w, h) { - var todayMarker = _ganttDb__WEBPACK_IMPORTED_MODULE_3__["default"].getTodayMarker(); - - if (todayMarker === 'off') { - return; - } - - var todayG = svg.append('g').attr('class', 'today'); - var today = new Date(); - var todayLine = todayG.append('line'); - todayLine.attr('x1', timeScale(today) + theSidePad).attr('x2', timeScale(today) + theSidePad).attr('y1', conf.titleTopMargin).attr('y2', h - conf.titleTopMargin).attr('class', 'today'); - - if (todayMarker !== '') { - todayLine.attr('style', todayMarker.replace(/,/g, ';')); - } - } // from this stackexchange question: http://stackoverflow.com/questions/1890203/unique-for-arrays-in-javascript - - - function checkUnique(arr) { - var hash = {}; - var result = []; - - for (var _i6 = 0, l = arr.length; _i6 < l; ++_i6) { - if (!hash.hasOwnProperty(arr[_i6])) { - // eslint-disable-line - // it works with objects! in FF, at least - hash[arr[_i6]] = true; - result.push(arr[_i6]); - } - } - - return result; - } // from this stackexchange question: http://stackoverflow.com/questions/14227981/count-how-many-strings-in-an-array-have-duplicates-in-the-same-array - - - function getCounts(arr) { - var i = arr.length; // const to loop over - - var obj = {}; // obj to store results - - while (i) { - obj[arr[--i]] = (obj[arr[i]] || 0) + 1; // count occurrences - } - - return obj; - } // get specific from everything - - - function getCount(word, arr) { - return getCounts(arr)[word] || 0; - } -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - setConf: setConf, - draw: draw -}); - -/***/ }), - -/***/ "./src/diagrams/gantt/parser/gantt.jison": -/*!***********************************************!*\ - !*** ./src/diagrams/gantt/parser/gantt.jison ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[7,9,11,12,13,14,15,16,17,18,20,27,32],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,18],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,23],$Vb=[1,25],$Vc=[1,28],$Vd=[5,7,9,11,12,13,14,15,16,17,18,20,27,32]; -var parser = {trace: function trace () { }, -yy: {}, -symbols_: {"error":2,"start":3,"directive":4,"gantt":5,"document":6,"EOF":7,"line":8,"SPACE":9,"statement":10,"NL":11,"dateFormat":12,"inclusiveEndDates":13,"axisFormat":14,"excludes":15,"todayMarker":16,"title":17,"section":18,"clickStatement":19,"taskTxt":20,"taskData":21,"openDirective":22,"typeDirective":23,"closeDirective":24,":":25,"argDirective":26,"click":27,"callbackname":28,"callbackargs":29,"href":30,"clickStatementDebug":31,"open_directive":32,"type_directive":33,"arg_directive":34,"close_directive":35,"$accept":0,"$end":1}, -terminals_: {2:"error",5:"gantt",7:"EOF",9:"SPACE",11:"NL",12:"dateFormat",13:"inclusiveEndDates",14:"axisFormat",15:"excludes",16:"todayMarker",17:"title",18:"section",20:"taskTxt",21:"taskData",25:":",27:"click",28:"callbackname",29:"callbackargs",30:"href",32:"open_directive",33:"type_directive",34:"arg_directive",35:"close_directive"}, -productions_: [0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[19,2],[19,3],[19,3],[19,4],[19,3],[19,4],[19,2],[31,2],[31,3],[31,3],[31,4],[31,3],[31,4],[31,2],[22,1],[23,1],[26,1],[24,1]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 2: - return $$[$0-1]; -break; -case 3: - this.$ = [] -break; -case 4: -$$[$0-1].push($$[$0]);this.$ = $$[$0-1] -break; -case 5: case 6: - this.$ = $$[$0] -break; -case 7: case 8: - this.$=[]; -break; -case 9: -yy.setDateFormat($$[$0].substr(11));this.$=$$[$0].substr(11); -break; -case 10: -yy.enableInclusiveEndDates();this.$=$$[$0].substr(18); -break; -case 11: -yy.setAxisFormat($$[$0].substr(11));this.$=$$[$0].substr(11); -break; -case 12: -yy.setExcludes($$[$0].substr(9));this.$=$$[$0].substr(9); -break; -case 13: -yy.setTodayMarker($$[$0].substr(12));this.$=$$[$0].substr(12); -break; -case 14: -yy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6); -break; -case 15: -yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); -break; -case 17: -yy.addTask($$[$0-1],$$[$0]);this.$='task'; -break; -case 21: -this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0], null); -break; -case 22: -this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); -break; -case 23: -this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], null);yy.setLink($$[$0-2],$$[$0]); -break; -case 24: -this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setLink($$[$0-3],$$[$0]); -break; -case 25: -this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0], null);yy.setLink($$[$0-2],$$[$0-1]); -break; -case 26: -this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-1], $$[$0]);yy.setLink($$[$0-3],$$[$0-2]); -break; -case 27: -this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]); -break; -case 28: case 34: -this.$=$$[$0-1] + ' ' + $$[$0]; -break; -case 29: case 30: case 32: -this.$=$$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0]; -break; -case 31: case 33: -this.$=$$[$0-3] + ' ' + $$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0]; -break; -case 35: - yy.parseDirective('%%{', 'open_directive'); -break; -case 36: - yy.parseDirective($$[$0], 'type_directive'); -break; -case 37: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); -break; -case 38: - yy.parseDirective('}%%', 'close_directive', 'gantt'); -break; -} -}, -table: [{3:1,4:2,5:$V0,22:4,32:$V1},{1:[3]},{3:6,4:2,5:$V0,22:4,32:$V1},o($V2,[2,3],{6:7}),{23:8,33:[1,9]},{33:[2,35]},{1:[2,1]},{4:24,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:22,20:$Va,22:4,27:$Vb,32:$V1},{24:26,25:[1,27],35:$Vc},o([25,35],[2,36]),o($V2,[2,8],{1:[2,2]}),o($V2,[2,4]),{4:24,10:29,12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:22,20:$Va,22:4,27:$Vb,32:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,9]),o($V2,[2,10]),o($V2,[2,11]),o($V2,[2,12]),o($V2,[2,13]),o($V2,[2,14]),o($V2,[2,15]),o($V2,[2,16]),{21:[1,30]},o($V2,[2,18]),{28:[1,31],30:[1,32]},{11:[1,33]},{26:34,34:[1,35]},{11:[2,38]},o($V2,[2,5]),o($V2,[2,17]),o($V2,[2,21],{29:[1,36],30:[1,37]}),o($V2,[2,27],{28:[1,38]}),o($Vd,[2,19]),{24:39,35:$Vc},{35:[2,37]},o($V2,[2,22],{30:[1,40]}),o($V2,[2,23]),o($V2,[2,25],{29:[1,41]}),{11:[1,42]},o($V2,[2,24]),o($V2,[2,26]),o($Vd,[2,20])], -defaultActions: {5:[2,35],6:[2,1],28:[2,38],35:[2,37]}, -parseError: function parseError (str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - var error = new Error(str); - error.hash = hash; - throw error; - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = tstack.pop() || lexer.lex() || EOF; - if (typeof token !== 'number') { - if (token instanceof Array) { - tstack = token; - token = tstack.pop(); - } - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; - -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function(match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex () { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin (condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState () { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules () { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState (n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState (condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {"case-insensitive":true}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0: this.begin('open_directive'); return 32; -break; -case 1: this.begin('type_directive'); return 33; -break; -case 2: this.popState(); this.begin('arg_directive'); return 25; -break; -case 3: this.popState(); this.popState(); return 35; -break; -case 4:return 34; -break; -case 5:/* skip comments */ -break; -case 6:/* skip comments */ -break; -case 7:/* do nothing */ -break; -case 8:return 11; -break; -case 9:/* skip whitespace */ -break; -case 10:/* skip comments */ -break; -case 11:/* skip comments */ -break; -case 12:this.begin("href"); -break; -case 13:this.popState(); -break; -case 14:return 30; -break; -case 15:this.begin("callbackname"); -break; -case 16:this.popState(); -break; -case 17:this.popState(); this.begin("callbackargs"); -break; -case 18:return 28; -break; -case 19:this.popState(); -break; -case 20:return 29; -break; -case 21:this.begin("click"); -break; -case 22:this.popState(); -break; -case 23:return 27; -break; -case 24:return 5; -break; -case 25:return 12; -break; -case 26:return 13; -break; -case 27:return 14; -break; -case 28:return 15; -break; -case 29:return 16; -break; -case 30:return 'date'; -break; -case 31:return 17; -break; -case 32:return 18; -break; -case 33:return 20; -break; -case 34:return 21; -break; -case 35:return 25; -break; -case 36:return 7; -break; -case 37:return 'INVALID'; -break; -} -}, -rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i], -conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"callbackargs":{"rules":[19,20],"inclusive":false},"callbackname":{"rules":[16,17,18],"inclusive":false},"href":{"rules":[13,14],"inclusive":false},"click":{"rules":[22,23],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,12,15,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (true) { -exports.parser = parser; -exports.Parser = parser.Parser; -exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain (args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if ( true && __webpack_require__.c[__webpack_require__.s] === module) { - exports.main(process.argv.slice(1)); -} -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./src/diagrams/gantt/styles.js": -/*!**************************************!*\ - !*** ./src/diagrams/gantt/styles.js ***! - \**************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -var getStyles = function getStyles(options) { - return "\n .mermaid-main-font {\n font-family: \"trebuchet ms\", verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ".concat(options.sectionBkgColor, ";\n }\n\n .section2 {\n fill: ").concat(options.sectionBkgColor2, ";\n }\n\n .section1,\n .section3 {\n fill: ").concat(options.altSectionBkgColor, ";\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ").concat(options.titleColor, ";\n }\n\n .sectionTitle1 {\n fill: ").concat(options.titleColor, ";\n }\n\n .sectionTitle2 {\n fill: ").concat(options.titleColor, ";\n }\n\n .sectionTitle3 {\n fill: ").concat(options.titleColor, ";\n }\n\n .sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ").concat(options.gridColor, ";\n opacity: 0.8;\n shape-rendering: crispEdges;\n text {\n font-family: ").concat(options.fontFamily, ";\n fill: ").concat(options.textColor, ";\n }\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ").concat(options.todayLineColor, ";\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n\n .taskText:not([font-size]) {\n font-size: 11px;\n }\n\n .taskTextOutsideRight {\n fill: ").concat(options.taskTextDarkColor, ";\n text-anchor: start;\n font-size: 11px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n .taskTextOutsideLeft {\n fill: ").concat(options.taskTextDarkColor, ";\n text-anchor: end;\n font-size: 11px;\n }\n\n /* Special case clickable */\n .task.clickable {\n cursor: pointer;\n }\n .taskText.clickable {\n cursor: pointer;\n fill: ").concat(options.taskTextClickableColor, " !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ").concat(options.taskTextClickableColor, " !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ").concat(options.taskTextClickableColor, " !important;\n font-weight: bold;\n }\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ").concat(options.taskTextColor, ";\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ").concat(options.taskBkgColor, ";\n stroke: ").concat(options.taskBorderColor, ";\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ").concat(options.taskTextOutsideColor, ";\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ").concat(options.taskTextOutsideColor, ";\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ").concat(options.activeTaskBkgColor, ";\n stroke: ").concat(options.activeTaskBorderColor, ";\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ").concat(options.taskTextDarkColor, " !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ").concat(options.doneTaskBorderColor, ";\n fill: ").concat(options.doneTaskBkgColor, ";\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ").concat(options.taskTextDarkColor, " !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ").concat(options.critBorderColor, ";\n fill: ").concat(options.critBkgColor, ";\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ").concat(options.critBorderColor, ";\n fill: ").concat(options.activeTaskBkgColor, ";\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ").concat(options.critBorderColor, ";\n fill: ").concat(options.doneTaskBkgColor, ";\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ").concat(options.taskTextDarkColor, " !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ").concat(options.taskTextDarkColor, " !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ").concat(options.textColor, " ;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n"); -}; - -/* harmony default export */ __webpack_exports__["default"] = (getStyles); - -/***/ }), - -/***/ "./src/diagrams/git/gitGraphAst.js": -/*!*****************************************!*\ - !*** ./src/diagrams/git/gitGraphAst.js ***! - \*****************************************/ -/*! exports provided: setDirection, setOptions, getOptions, commit, branch, merge, checkout, reset, prettyPrint, clear, getBranchesAsObjArray, getBranches, getCommits, getCommitsArray, getCurrentBranch, getDirection, getHead, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDirection", function() { return setDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setOptions", function() { return setOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOptions", function() { return getOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commit", function() { return commit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "branch", function() { return branch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkout", function() { return checkout; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reset", function() { return reset; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prettyPrint", function() { return prettyPrint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBranchesAsObjArray", function() { return getBranchesAsObjArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBranches", function() { return getBranches; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCommits", function() { return getCommits; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCommitsArray", function() { return getCommitsArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrentBranch", function() { return getCurrentBranch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDirection", function() { return getDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHead", function() { return getHead; }); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); - - -var commits = {}; -var head = null; -var branches = { - master: head -}; -var curBranch = 'master'; -var direction = 'LR'; -var seq = 0; - -function getId() { - return Object(_utils__WEBPACK_IMPORTED_MODULE_1__["random"])({ - length: 7 - }); -} - -function isfastforwardable(currentCommit, otherCommit) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Entering isfastforwardable:', currentCommit.id, otherCommit.id); - - while (currentCommit.seq <= otherCommit.seq && currentCommit !== otherCommit) { - // only if other branch has more commits - if (otherCommit.parent == null) break; - - if (Array.isArray(otherCommit.parent)) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('In merge commit:', otherCommit.parent); - return isfastforwardable(currentCommit, commits[otherCommit.parent[0]]) || isfastforwardable(currentCommit, commits[otherCommit.parent[1]]); - } else { - otherCommit = commits[otherCommit.parent]; - } - } - - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(currentCommit.id, otherCommit.id); - return currentCommit.id === otherCommit.id; -} - -function isReachableFrom(currentCommit, otherCommit) { - var currentSeq = currentCommit.seq; - var otherSeq = otherCommit.seq; - if (currentSeq > otherSeq) return isfastforwardable(otherCommit, currentCommit); - return false; -} - -function uniqBy(list, fn) { - var recordMap = Object.create(null); - return list.reduce(function (out, item) { - var key = fn(item); - - if (!recordMap[key]) { - recordMap[key] = true; - out.push(item); - } - - return out; - }, []); -} - -var setDirection = function setDirection(dir) { - direction = dir; -}; -var options = {}; -var setOptions = function setOptions(rawOptString) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('options str', rawOptString); - rawOptString = rawOptString && rawOptString.trim(); - rawOptString = rawOptString || '{}'; - - try { - options = JSON.parse(rawOptString); - } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].error('error while parsing gitGraph options', e.message); - } -}; -var getOptions = function getOptions() { - return options; -}; -var commit = function commit(msg) { - var commit = { - id: getId(), - message: msg, - seq: seq++, - parent: head == null ? null : head.id - }; - head = commit; - commits[commit.id] = commit; - branches[curBranch] = commit.id; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('in pushCommit ' + commit.id); -}; -var branch = function branch(name) { - branches[name] = head != null ? head.id : null; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('in createBranch'); -}; -var merge = function merge(otherBranch) { - var currentCommit = commits[branches[curBranch]]; - var otherCommit = commits[branches[otherBranch]]; - - if (isReachableFrom(currentCommit, otherCommit)) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Already merged'); - return; - } - - if (isfastforwardable(currentCommit, otherCommit)) { - branches[curBranch] = branches[otherBranch]; - head = commits[branches[curBranch]]; - } else { - // create merge commit - var _commit = { - id: getId(), - message: 'merged branch ' + otherBranch + ' into ' + curBranch, - seq: seq++, - parent: [head == null ? null : head.id, branches[otherBranch]] - }; - head = _commit; - commits[_commit.id] = _commit; - branches[curBranch] = _commit.id; - } - - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(branches); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('in mergeBranch'); -}; -var checkout = function checkout(branch) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('in checkout'); - curBranch = branch; - var id = branches[curBranch]; - head = commits[id]; -}; -var reset = function reset(commitRef) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('in reset', commitRef); - var ref = commitRef.split(':')[0]; - var parentCount = parseInt(commitRef.split(':')[1]); - var commit = ref === 'HEAD' ? head : commits[branches[ref]]; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(commit, parentCount); - - while (parentCount > 0) { - commit = commits[commit.parent]; - parentCount--; - - if (!commit) { - var err = 'Critical error - unique parent commit not found during reset'; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].error(err); - throw err; - } - } - - head = commit; - branches[curBranch] = commit.id; -}; - -function upsert(arr, key, newval) { - var index = arr.indexOf(key); - - if (index === -1) { - arr.push(newval); - } else { - arr.splice(index, 1, newval); - } -} - -function prettyPrintCommitHistory(commitArr) { - var commit = commitArr.reduce(function (out, commit) { - if (out.seq > commit.seq) return out; - return commit; - }, commitArr[0]); - var line = ''; - commitArr.forEach(function (c) { - if (c === commit) { - line += '\t*'; - } else { - line += '\t|'; - } - }); - var label = [line, commit.id, commit.seq]; - - for (var _branch in branches) { - if (branches[_branch] === commit.id) label.push(_branch); - } - - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(label.join(' ')); - - if (Array.isArray(commit.parent)) { - var newCommit = commits[commit.parent[0]]; - upsert(commitArr, commit, newCommit); - commitArr.push(commits[commit.parent[1]]); - } else if (commit.parent == null) { - return; - } else { - var nextCommit = commits[commit.parent]; - upsert(commitArr, commit, nextCommit); - } - - commitArr = uniqBy(commitArr, function (c) { - return c.id; - }); - prettyPrintCommitHistory(commitArr); -} - -var prettyPrint = function prettyPrint() { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(commits); - var node = getCommitsArray()[0]; - prettyPrintCommitHistory([node]); -}; -var clear = function clear() { - commits = {}; - head = null; - branches = { - master: head - }; - curBranch = 'master'; - seq = 0; -}; -var getBranchesAsObjArray = function getBranchesAsObjArray() { - var branchArr = []; - - for (var _branch2 in branches) { - branchArr.push({ - name: _branch2, - commit: commits[branches[_branch2]] - }); - } - - return branchArr; -}; -var getBranches = function getBranches() { - return branches; -}; -var getCommits = function getCommits() { - return commits; -}; -var getCommitsArray = function getCommitsArray() { - var commitArr = Object.keys(commits).map(function (key) { - return commits[key]; - }); - commitArr.forEach(function (o) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(o.id); - }); - commitArr.sort(function (a, b) { - return b.seq - a.seq; - }); - return commitArr; -}; -var getCurrentBranch = function getCurrentBranch() { - return curBranch; -}; -var getDirection = function getDirection() { - return direction; -}; -var getHead = function getHead() { - return head; -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - setDirection: setDirection, - setOptions: setOptions, - getOptions: getOptions, - commit: commit, - branch: branch, - merge: merge, - checkout: checkout, - reset: reset, - prettyPrint: prettyPrint, - clear: clear, - getBranchesAsObjArray: getBranchesAsObjArray, - getBranches: getBranches, - getCommits: getCommits, - getCommitsArray: getCommitsArray, - getCurrentBranch: getCurrentBranch, - getDirection: getDirection, - getHead: getHead -}); - -/***/ }), - -/***/ "./src/diagrams/git/gitGraphRenderer.js": -/*!**********************************************!*\ - !*** ./src/diagrams/git/gitGraphRenderer.js ***! - \**********************************************/ -/*! exports provided: setConf, draw, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _gitGraphAst__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./gitGraphAst */ "./src/diagrams/git/gitGraphAst.js"); -/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison"); -/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_parser_gitGraph__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); - - - - - -var allCommitsDict = {}; -var branchNum; -var config = { - nodeSpacing: 150, - nodeFillColor: 'yellow', - nodeStrokeWidth: 2, - nodeStrokeColor: 'grey', - lineStrokeWidth: 4, - branchOffset: 50, - lineColor: 'grey', - leftMargin: 50, - branchColors: ['#442f74', '#983351', '#609732', '#AA9A39'], - nodeRadius: 10, - nodeLabel: { - width: 75, - height: 100, - x: -25, - y: 0 - } -}; -var apiConfig = {}; -var setConf = function setConf(c) { - apiConfig = c; -}; - -function svgCreateDefs(svg) { - svg.append('defs').append('g').attr('id', 'def-commit').append('circle').attr('r', config.nodeRadius).attr('cx', 0).attr('cy', 0); - svg.select('#def-commit').append('foreignObject').attr('width', config.nodeLabel.width).attr('height', config.nodeLabel.height).attr('x', config.nodeLabel.x).attr('y', config.nodeLabel.y).attr('class', 'node-label').attr('requiredFeatures', 'http://www.w3.org/TR/SVG11/feature#Extensibility').append('p').html(''); -} - -function svgDrawLine(svg, points, colorIdx, interpolate) { - var curve = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["interpolateToCurve"])(interpolate, d3__WEBPACK_IMPORTED_MODULE_0__["curveBasis"]); - var color = config.branchColors[colorIdx % config.branchColors.length]; - var lineGen = Object(d3__WEBPACK_IMPORTED_MODULE_0__["line"])().x(function (d) { - return Math.round(d.x); - }).y(function (d) { - return Math.round(d.y); - }).curve(curve); - svg.append('svg:path').attr('d', lineGen(points)).style('stroke', color).style('stroke-width', config.lineStrokeWidth).style('fill', 'none'); -} // Pass in the element and its pre-transform coords - - -function getElementCoords(element, coords) { - coords = coords || element.node().getBBox(); - var ctm = element.node().getCTM(); - var xn = ctm.e + coords.x * ctm.a; - var yn = ctm.f + coords.y * ctm.d; - return { - left: xn, - top: yn, - width: coords.width, - height: coords.height - }; -} - -function svgDrawLineForCommits(svg, fromId, toId, direction, color) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('svgDrawLineForCommits: ', fromId, toId); - var fromBbox = getElementCoords(svg.select('#node-' + fromId + ' circle')); - var toBbox = getElementCoords(svg.select('#node-' + toId + ' circle')); - - switch (direction) { - case 'LR': - // (toBbox) - // +-------- - // + (fromBbox) - if (fromBbox.left - toBbox.left > config.nodeSpacing) { - var lineStart = { - x: fromBbox.left - config.nodeSpacing, - y: toBbox.top + toBbox.height / 2 - }; - var lineEnd = { - x: toBbox.left + toBbox.width, - y: toBbox.top + toBbox.height / 2 - }; - svgDrawLine(svg, [lineStart, lineEnd], color, 'linear'); - svgDrawLine(svg, [{ - x: fromBbox.left, - y: fromBbox.top + fromBbox.height / 2 - }, { - x: fromBbox.left - config.nodeSpacing / 2, - y: fromBbox.top + fromBbox.height / 2 - }, { - x: fromBbox.left - config.nodeSpacing / 2, - y: lineStart.y - }, lineStart], color); - } else { - svgDrawLine(svg, [{ - x: fromBbox.left, - y: fromBbox.top + fromBbox.height / 2 - }, { - x: fromBbox.left - config.nodeSpacing / 2, - y: fromBbox.top + fromBbox.height / 2 - }, { - x: fromBbox.left - config.nodeSpacing / 2, - y: toBbox.top + toBbox.height / 2 - }, { - x: toBbox.left + toBbox.width, - y: toBbox.top + toBbox.height / 2 - }], color); - } - - break; - - case 'BT': - // + (fromBbox) - // | - // | - // + (toBbox) - if (toBbox.top - fromBbox.top > config.nodeSpacing) { - var _lineStart = { - x: toBbox.left + toBbox.width / 2, - y: fromBbox.top + fromBbox.height + config.nodeSpacing - }; - var _lineEnd = { - x: toBbox.left + toBbox.width / 2, - y: toBbox.top - }; - svgDrawLine(svg, [_lineStart, _lineEnd], color, 'linear'); - svgDrawLine(svg, [{ - x: fromBbox.left + fromBbox.width / 2, - y: fromBbox.top + fromBbox.height - }, { - x: fromBbox.left + fromBbox.width / 2, - y: fromBbox.top + fromBbox.height + config.nodeSpacing / 2 - }, { - x: toBbox.left + toBbox.width / 2, - y: _lineStart.y - config.nodeSpacing / 2 - }, _lineStart], color); - } else { - svgDrawLine(svg, [{ - x: fromBbox.left + fromBbox.width / 2, - y: fromBbox.top + fromBbox.height - }, { - x: fromBbox.left + fromBbox.width / 2, - y: fromBbox.top + config.nodeSpacing / 2 - }, { - x: toBbox.left + toBbox.width / 2, - y: toBbox.top - config.nodeSpacing / 2 - }, { - x: toBbox.left + toBbox.width / 2, - y: toBbox.top - }], color); - } - - break; - } -} - -function cloneNode(svg, selector) { - return svg.select(selector).node().cloneNode(true); -} - -function renderCommitHistory(svg, commitid, branches, direction) { - var commit; - var numCommits = Object.keys(allCommitsDict).length; - - if (typeof commitid === 'string') { - do { - commit = allCommitsDict[commitid]; - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('in renderCommitHistory', commit.id, commit.seq); - - if (svg.select('#node-' + commitid).size() > 0) { - return; - } - - svg.append(function () { - return cloneNode(svg, '#def-commit'); - }).attr('class', 'commit').attr('id', function () { - return 'node-' + commit.id; - }).attr('transform', function () { - switch (direction) { - case 'LR': - return 'translate(' + (commit.seq * config.nodeSpacing + config.leftMargin) + ', ' + branchNum * config.branchOffset + ')'; - - case 'BT': - return 'translate(' + (branchNum * config.branchOffset + config.leftMargin) + ', ' + (numCommits - commit.seq) * config.nodeSpacing + ')'; - } - }).attr('fill', config.nodeFillColor).attr('stroke', config.nodeStrokeColor).attr('stroke-width', config.nodeStrokeWidth); - var branch = void 0; - - for (var branchName in branches) { - if (branches[branchName].commit === commit) { - branch = branches[branchName]; - break; - } - } - - if (branch) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('found branch ', branch.name); - svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'branch-label').text(branch.name + ', '); - } - - svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-id').text(commit.id); - - if (commit.message !== '' && direction === 'BT') { - svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-msg').text(', ' + commit.message); - } - - commitid = commit.parent; - } while (commitid && allCommitsDict[commitid]); - } - - if (Array.isArray(commitid)) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('found merge commmit', commitid); - renderCommitHistory(svg, commitid[0], branches, direction); - branchNum++; - renderCommitHistory(svg, commitid[1], branches, direction); - branchNum--; - } -} - -function renderLines(svg, commit, direction, branchColor) { - branchColor = branchColor || 0; - - while (commit.seq > 0 && !commit.lineDrawn) { - if (typeof commit.parent === 'string') { - svgDrawLineForCommits(svg, commit.id, commit.parent, direction, branchColor); - commit.lineDrawn = true; - commit = allCommitsDict[commit.parent]; - } else if (Array.isArray(commit.parent)) { - svgDrawLineForCommits(svg, commit.id, commit.parent[0], direction, branchColor); - svgDrawLineForCommits(svg, commit.id, commit.parent[1], direction, branchColor + 1); - renderLines(svg, allCommitsDict[commit.parent[1]], direction, branchColor + 1); - commit.lineDrawn = true; - commit = allCommitsDict[commit.parent[0]]; - } - } -} - -var draw = function draw(txt, id, ver) { - try { - var parser = _parser_gitGraph__WEBPACK_IMPORTED_MODULE_2___default.a.parser; - parser.yy = _gitGraphAst__WEBPACK_IMPORTED_MODULE_1__["default"]; - parser.yy.clear(); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('in gitgraph renderer', txt + '\n', 'id:', id, ver); // Parse the graph definition - - parser.parse(txt + '\n'); - config = Object.assign(config, apiConfig, _gitGraphAst__WEBPACK_IMPORTED_MODULE_1__["default"].getOptions()); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('effective options', config); - var direction = _gitGraphAst__WEBPACK_IMPORTED_MODULE_1__["default"].getDirection(); - allCommitsDict = _gitGraphAst__WEBPACK_IMPORTED_MODULE_1__["default"].getCommits(); - var branches = _gitGraphAst__WEBPACK_IMPORTED_MODULE_1__["default"].getBranchesAsObjArray(); - - if (direction === 'BT') { - config.nodeLabel.x = branches.length * config.branchOffset; - config.nodeLabel.width = '100%'; - config.nodeLabel.y = -1 * 2 * config.nodeRadius; - } - - var svg = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])("[id=\"".concat(id, "\"]")); - svgCreateDefs(svg); - branchNum = 1; - - for (var branch in branches) { - var v = branches[branch]; - renderCommitHistory(svg, v.commit.id, branches, direction); - renderLines(svg, v.commit, direction); - branchNum++; - } - - svg.attr('height', function () { - if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing; - return (branches.length + 1) * config.branchOffset; - }); - } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error('Error while rendering gitgraph'); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error(e.message); - } -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - setConf: setConf, - draw: draw -}); - -/***/ }), - -/***/ "./src/diagrams/git/parser/gitGraph.jison": -/*!************************************************!*\ - !*** ./src/diagrams/git/parser/gitGraph.jison ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[2,3],$V1=[1,7],$V2=[7,12,15,17,19,20,21],$V3=[7,11,12,15,17,19,20,21],$V4=[2,20],$V5=[1,32]; -var parser = {trace: function trace () { }, -yy: {}, -symbols_: {"error":2,"start":3,"GG":4,":":5,"document":6,"EOF":7,"DIR":8,"options":9,"body":10,"OPT":11,"NL":12,"line":13,"statement":14,"COMMIT":15,"commit_arg":16,"BRANCH":17,"ID":18,"CHECKOUT":19,"MERGE":20,"RESET":21,"reset_arg":22,"STR":23,"HEAD":24,"reset_parents":25,"CARET":26,"$accept":0,"$end":1}, -terminals_: {2:"error",4:"GG",5:":",7:"EOF",8:"DIR",11:"OPT",12:"NL",15:"COMMIT",17:"BRANCH",18:"ID",19:"CHECKOUT",20:"MERGE",21:"RESET",23:"STR",24:"HEAD",26:"CARET"}, -productions_: [0,[3,4],[3,5],[6,0],[6,2],[9,2],[9,1],[10,0],[10,2],[13,2],[13,1],[14,2],[14,2],[14,2],[14,2],[14,2],[16,0],[16,1],[22,2],[22,2],[25,0],[25,2]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 1: - return $$[$0-1]; -break; -case 2: -yy.setDirection($$[$0-3]); return $$[$0-1]; -break; -case 4: - yy.setOptions($$[$0-1]); this.$ = $$[$0] -break; -case 5: -$$[$0-1] +=$$[$0]; this.$=$$[$0-1] -break; -case 7: -this.$ = [] -break; -case 8: -$$[$0-1].push($$[$0]); this.$=$$[$0-1]; -break; -case 9: -this.$ =$$[$0-1] -break; -case 11: -yy.commit($$[$0]) -break; -case 12: -yy.branch($$[$0]) -break; -case 13: -yy.checkout($$[$0]) -break; -case 14: -yy.merge($$[$0]) -break; -case 15: -yy.reset($$[$0]) -break; -case 16: -this.$ = "" -break; -case 17: -this.$=$$[$0] -break; -case 18: -this.$ = $$[$0-1]+ ":" + $$[$0] -break; -case 19: -this.$ = $$[$0-1]+ ":" + yy.count; yy.count = 0 -break; -case 20: -yy.count = 0 -break; -case 21: - yy.count += 1 -break; -} -}, -table: [{3:1,4:[1,2]},{1:[3]},{5:[1,3],8:[1,4]},{6:5,7:$V0,9:6,12:$V1},{5:[1,8]},{7:[1,9]},o($V2,[2,7],{10:10,11:[1,11]}),o($V3,[2,6]),{6:12,7:$V0,9:6,12:$V1},{1:[2,1]},{7:[2,4],12:[1,15],13:13,14:14,15:[1,16],17:[1,17],19:[1,18],20:[1,19],21:[1,20]},o($V3,[2,5]),{7:[1,21]},o($V2,[2,8]),{12:[1,22]},o($V2,[2,10]),{12:[2,16],16:23,23:[1,24]},{18:[1,25]},{18:[1,26]},{18:[1,27]},{18:[1,30],22:28,24:[1,29]},{1:[2,2]},o($V2,[2,9]),{12:[2,11]},{12:[2,17]},{12:[2,12]},{12:[2,13]},{12:[2,14]},{12:[2,15]},{12:$V4,25:31,26:$V5},{12:$V4,25:33,26:$V5},{12:[2,18]},{12:$V4,25:34,26:$V5},{12:[2,19]},{12:[2,21]}], -defaultActions: {9:[2,1],21:[2,2],23:[2,11],24:[2,17],25:[2,12],26:[2,13],27:[2,14],28:[2,15],31:[2,18],33:[2,19],34:[2,21]}, -parseError: function parseError (str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - var error = new Error(str); - error.hash = hash; - throw error; - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = tstack.pop() || lexer.lex() || EOF; - if (typeof token !== 'number') { - if (token instanceof Array) { - tstack = token; - token = tstack.pop(); - } - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function(match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex () { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin (condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState () { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules () { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState (n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState (condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {"case-insensitive":true}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0:return 12; -break; -case 1:/* skip all whitespace */ -break; -case 2:/* skip comments */ -break; -case 3:/* skip comments */ -break; -case 4:return 4; -break; -case 5:return 15; -break; -case 6:return 17; -break; -case 7:return 20; -break; -case 8:return 21; -break; -case 9:return 19; -break; -case 10:return 8; -break; -case 11:return 8; -break; -case 12:return 5; -break; -case 13:return 26 -break; -case 14:this.begin("options"); -break; -case 15:this.popState(); -break; -case 16:return 11; -break; -case 17:this.begin("string"); -break; -case 18:this.popState(); -break; -case 19:return 23; -break; -case 20:return 18; -break; -case 21:return 7; -break; -} -}, -rules: [/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit\b)/i,/^(?:branch\b)/i,/^(?:merge\b)/i,/^(?:reset\b)/i,/^(?:checkout\b)/i,/^(?:LR\b)/i,/^(?:BT\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:end\r?\n)/i,/^(?:[^\n]+\r?\n)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[a-zA-Z][-_\.a-zA-Z0-9]*[-_a-zA-Z0-9])/i,/^(?:$)/i], -conditions: {"options":{"rules":[15,16],"inclusive":false},"string":{"rules":[18,19],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,20,21],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (true) { -exports.parser = parser; -exports.Parser = parser.Parser; -exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain (args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if ( true && __webpack_require__.c[__webpack_require__.s] === module) { - exports.main(process.argv.slice(1)); -} -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./src/diagrams/git/styles.js": -/*!************************************!*\ - !*** ./src/diagrams/git/styles.js ***! - \************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -var getStyles = function getStyles() { - return "\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n"; -}; - -/* harmony default export */ __webpack_exports__["default"] = (getStyles); - -/***/ }), - -/***/ "./src/diagrams/info/infoDb.js": -/*!*************************************!*\ - !*** ./src/diagrams/info/infoDb.js ***! - \*************************************/ -/*! exports provided: setMessage, getMessage, setInfo, getInfo, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMessage", function() { return setMessage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMessage", function() { return getMessage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setInfo", function() { return setInfo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInfo", function() { return getInfo; }); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/** - * Created by knut on 15-01-14. - */ - -var message = ''; -var info = false; -var setMessage = function setMessage(txt) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Setting message to: ' + txt); - message = txt; -}; -var getMessage = function getMessage() { - return message; -}; -var setInfo = function setInfo(inf) { - info = inf; -}; -var getInfo = function getInfo() { - return info; -}; // export const parseError = (err, hash) => { -// global.mermaidAPI.parseError(err, hash) -// } - -/* harmony default export */ __webpack_exports__["default"] = ({ - setMessage: setMessage, - getMessage: getMessage, - setInfo: setInfo, - getInfo: getInfo // parseError - -}); - -/***/ }), - -/***/ "./src/diagrams/info/infoRenderer.js": -/*!*******************************************!*\ - !*** ./src/diagrams/info/infoRenderer.js ***! - \*******************************************/ -/*! exports provided: setConf, draw, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _infoDb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./infoDb */ "./src/diagrams/info/infoDb.js"); -/* harmony import */ var _parser_info__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parser/info */ "./src/diagrams/info/parser/info.jison"); -/* harmony import */ var _parser_info__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_parser_info__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/** - * Created by knut on 14-12-11. - */ - - - - -var conf = {}; -var setConf = function setConf(cnf) { - var keys = Object.keys(cnf); - keys.forEach(function (key) { - conf[key] = cnf[key]; - }); -}; -/** - * Draws a an info picture in the tag with id: id based on the graph definition in text. - * @param text - * @param id - */ - -var draw = function draw(txt, id, ver) { - try { - var parser = _parser_info__WEBPACK_IMPORTED_MODULE_2___default.a.parser; - parser.yy = _infoDb__WEBPACK_IMPORTED_MODULE_1__["default"]; - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Renering info diagram\n' + txt); // Parse the graph definition - - parser.parse(txt); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Parsed info diagram'); // Fetch the default direction, use TD if none was found - - var svg = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + id); - var g = svg.append('g'); - g.append('text') // text label for the x axis - .attr('x', 100).attr('y', 40).attr('class', 'version').attr('font-size', '32px').style('text-anchor', 'middle').text('v ' + ver); - svg.attr('height', 100); - svg.attr('width', 400); // svg.attr('viewBox', '0 0 300 150'); - } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error('Error while rendering info diagram'); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error(e.message); - } -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - setConf: setConf, - draw: draw -}); - -/***/ }), - -/***/ "./src/diagrams/info/parser/info.jison": -/*!*********************************************!*\ - !*** ./src/diagrams/info/parser/info.jison ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10]; -var parser = {trace: function trace () { }, -yy: {}, -symbols_: {"error":2,"start":3,"info":4,"document":5,"EOF":6,"line":7,"statement":8,"NL":9,"showInfo":10,"$accept":0,"$end":1}, -terminals_: {2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"}, -productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 1: - return yy; -break; -case 4: - -break; -case 6: - yy.setInfo(true); -break; -} -}, -table: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),o($V0,[2,6])], -defaultActions: {4:[2,1]}, -parseError: function parseError (str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - var error = new Error(str); - error.hash = hash; - throw error; - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = tstack.pop() || lexer.lex() || EOF; - if (typeof token !== 'number') { - if (token instanceof Array) { - tstack = token; - token = tstack.pop(); - } - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; - -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function(match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex () { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin (condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState () { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules () { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState (n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState (condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {"case-insensitive":true}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { - // Pre-lexer code can go here - -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0:return 4 ; -break; -case 1:return 9 ; -break; -case 2:return 'space'; -break; -case 3:return 10; -break; -case 4:return 6 ; -break; -case 5:return 'TXT' ; -break; -} -}, -rules: [/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i], -conditions: {"INITIAL":{"rules":[0,1,2,3,4,5],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (true) { -exports.parser = parser; -exports.Parser = parser.Parser; -exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain (args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if ( true && __webpack_require__.c[__webpack_require__.s] === module) { - exports.main(process.argv.slice(1)); -} -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./src/diagrams/info/styles.js": -/*!*************************************!*\ - !*** ./src/diagrams/info/styles.js ***! - \*************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -var getStyles = function getStyles() { - return ""; -}; - -/* harmony default export */ __webpack_exports__["default"] = (getStyles); - -/***/ }), - -/***/ "./src/diagrams/pie/parser/pie.jison": -/*!*******************************************!*\ - !*** ./src/diagrams/pie/parser/pie.jison ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,10,12,19,20,21,22],$V6=[1,6,10,12,19,20,21,22],$V7=[19,20,21],$V8=[1,22],$V9=[6,19,20,21,22]; -var parser = {trace: function trace () { }, -yy: {}, -symbols_: {"error":2,"start":3,"eol":4,"directive":5,"PIE":6,"document":7,"line":8,"statement":9,"txt":10,"value":11,"title":12,"title_value":13,"openDirective":14,"typeDirective":15,"closeDirective":16,":":17,"argDirective":18,"NEWLINE":19,";":20,"EOF":21,"open_directive":22,"type_directive":23,"arg_directive":24,"close_directive":25,"$accept":0,"$end":1}, -terminals_: {2:"error",6:"PIE",10:"txt",11:"value",12:"title",13:"title_value",17:":",19:"NEWLINE",20:";",21:"EOF",22:"open_directive",23:"type_directive",24:"arg_directive",25:"close_directive"}, -productions_: [0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[9,0],[9,2],[9,2],[9,1],[5,3],[5,5],[4,1],[4,1],[4,1],[14,1],[15,1],[18,1],[16,1]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 6: - this.$ = $$[$0-1] -break; -case 8: - yy.addSection($$[$0-1],yy.cleanupValue($$[$0])); -break; -case 9: - this.$=$$[$0].trim();yy.setTitle(this.$); -break; -case 16: - yy.parseDirective('%%{', 'open_directive'); -break; -case 17: - yy.parseDirective($$[$0], 'type_directive'); -break; -case 18: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); -break; -case 19: - yy.parseDirective('}%%', 'close_directive', 'pie'); -break; -} -}, -table: [{3:1,4:2,5:3,6:$V0,14:8,19:$V1,20:$V2,21:$V3,22:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,14:8,19:$V1,20:$V2,21:$V3,22:$V4},{3:11,4:2,5:3,6:$V0,14:8,19:$V1,20:$V2,21:$V3,22:$V4},o($V5,[2,4],{7:12}),o($V6,[2,13]),o($V6,[2,14]),o($V6,[2,15]),{15:13,23:[1,14]},{23:[2,16]},{1:[2,1]},{1:[2,2]},o($V7,[2,7],{14:8,8:15,9:16,5:19,1:[2,3],10:[1,17],12:[1,18],22:$V4}),{16:20,17:[1,21],25:$V8},o([17,25],[2,17]),o($V5,[2,5]),{4:23,19:$V1,20:$V2,21:$V3},{11:[1,24]},{13:[1,25]},o($V7,[2,10]),o($V9,[2,11]),{18:26,24:[1,27]},o($V9,[2,19]),o($V5,[2,6]),o($V7,[2,8]),o($V7,[2,9]),{16:28,25:$V8},{25:[2,18]},o($V9,[2,12])], -defaultActions: {9:[2,16],10:[2,1],11:[2,2],27:[2,18]}, -parseError: function parseError (str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - var error = new Error(str); - error.hash = hash; - throw error; - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = tstack.pop() || lexer.lex() || EOF; - if (typeof token !== 'number') { - if (token instanceof Array) { - tstack = token; - token = tstack.pop(); - } - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; - -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function(match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex () { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin (condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState () { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules () { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState (n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState (condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {"case-insensitive":true}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0: this.begin('open_directive'); return 22; -break; -case 1: this.begin('type_directive'); return 23; -break; -case 2: this.popState(); this.begin('arg_directive'); return 17; -break; -case 3: this.popState(); this.popState(); return 25; -break; -case 4:return 24; -break; -case 5:/* skip comments */ -break; -case 6:/* skip comments */{ /*console.log('');*/ } -break; -case 7:return 19; -break; -case 8:/* do nothing */ -break; -case 9:/* ignore */ -break; -case 10: this.begin("title");return 12; -break; -case 11: this.popState(); return "title_value"; -break; -case 12: this.begin("string"); -break; -case 13: this.popState(); -break; -case 14: return "txt"; -break; -case 15:return 6; -break; -case 16:return "value"; -break; -case 17:return 21; -break; -} -}, -rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i], -conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"title":{"rules":[11],"inclusive":false},"string":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,12,15,16,17],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (true) { -exports.parser = parser; -exports.Parser = parser.Parser; -exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain (args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if ( true && __webpack_require__.c[__webpack_require__.s] === module) { - exports.main(process.argv.slice(1)); -} -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./src/diagrams/pie/pieDb.js": -/*!***********************************!*\ - !*** ./src/diagrams/pie/pieDb.js ***! - \***********************************/ -/*! exports provided: parseDirective, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDirective", function() { return parseDirective; }); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/** - * - */ - - - -var sections = {}; -var title = ''; -var parseDirective = function parseDirective(statement, context, type) { - _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].parseDirective(this, statement, context, type); -}; - -var addSection = function addSection(id, value) { - if (typeof sections[id] === 'undefined') { - sections[id] = value; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Added new section :', id); - } -}; - -var getSections = function getSections() { - return sections; -}; - -var setTitle = function setTitle(txt) { - title = txt; -}; - -var getTitle = function getTitle() { - return title; -}; - -var cleanupValue = function cleanupValue(value) { - if (value.substring(0, 1) === ':') { - value = value.substring(1).trim(); - return Number(value.trim()); - } else { - return Number(value.trim()); - } -}; - -var clear = function clear() { - sections = {}; - title = ''; -}; // export const parseError = (err, hash) => { -// global.mermaidAPI.parseError(err, hash) -// } - - -/* harmony default export */ __webpack_exports__["default"] = ({ - parseDirective: parseDirective, - getConfig: function getConfig() { - return _config__WEBPACK_IMPORTED_MODULE_2__["getConfig"]().pie; - }, - addSection: addSection, - getSections: getSections, - cleanupValue: cleanupValue, - clear: clear, - setTitle: setTitle, - getTitle: getTitle // parseError - -}); - -/***/ }), - -/***/ "./src/diagrams/pie/pieRenderer.js": -/*!*****************************************!*\ - !*** ./src/diagrams/pie/pieRenderer.js ***! - \*****************************************/ -/*! exports provided: setConf, draw, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _pieDb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pieDb */ "./src/diagrams/pie/pieDb.js"); -/* harmony import */ var _parser_pie__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parser/pie */ "./src/diagrams/pie/parser/pie.jison"); -/* harmony import */ var _parser_pie__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_parser_pie__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); -/** - * Created by AshishJ on 11-09-2019. - */ - - - - - -var conf = {}; -var setConf = function setConf(cnf) { - var keys = Object.keys(cnf); - keys.forEach(function (key) { - conf[key] = cnf[key]; - }); -}; -/** - * Draws a Pie Chart with the data given in text. - * @param text - * @param id - */ - -var width; -var height = 450; -var draw = function draw(txt, id) { - try { - var parser = _parser_pie__WEBPACK_IMPORTED_MODULE_2___default.a.parser; - parser.yy = _pieDb__WEBPACK_IMPORTED_MODULE_1__["default"]; - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Rendering info diagram\n' + txt); // Parse the Pie Chart definition - - parser.yy.clear(); - parser.parse(txt); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Parsed info diagram'); - var elem = document.getElementById(id); - width = elem.parentElement.offsetWidth; - - if (typeof width === 'undefined') { - width = 1200; - } - - if (typeof conf.useWidth !== 'undefined') { - width = conf.useWidth; - } - - var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + id); - Object(_utils__WEBPACK_IMPORTED_MODULE_4__["configureSvgSize"])(diagram, height, width, conf.useMaxWidth); // Set viewBox - - elem.setAttribute('viewBox', '0 0 ' + width + ' ' + height); // Fetch the default direction, use TD if none was found - - var margin = 40; - var legendRectSize = 18; - var legendSpacing = 4; - var radius = Math.min(width, height) / 2 - margin; - var svg = diagram.append('g').attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')'); - var data = _pieDb__WEBPACK_IMPORTED_MODULE_1__["default"].getSections(); - var sum = 0; - Object.keys(data).forEach(function (key) { - sum += data[key]; - }); // Set the color scale - - var color = Object(d3__WEBPACK_IMPORTED_MODULE_0__["scaleOrdinal"])().domain(data).range(d3__WEBPACK_IMPORTED_MODULE_0__["schemeSet2"]); // Compute the position of each group on the pie: - - var pie = Object(d3__WEBPACK_IMPORTED_MODULE_0__["pie"])().value(function (d) { - return d.value; - }); - var dataReady = pie(Object(d3__WEBPACK_IMPORTED_MODULE_0__["entries"])(data)); // Shape helper to build arcs: - - var arcGenerator = Object(d3__WEBPACK_IMPORTED_MODULE_0__["arc"])().innerRadius(0).outerRadius(radius); // Build the pie chart: each part of the pie is a path that we build using the arc function. - - svg.selectAll('mySlices').data(dataReady).enter().append('path').attr('d', arcGenerator).attr('fill', function (d) { - return color(d.data.key); - }).attr('stroke', 'black').style('stroke-width', '2px').style('opacity', 0.7); // Now add the percentage. - // Use the centroid method to get the best coordinates. - - svg.selectAll('mySlices').data(dataReady.filter(function (value) { - return value.data.value !== 0; - })).enter().append('text').text(function (d) { - return (d.data.value / sum * 100).toFixed(0) + '%'; - }).attr('transform', function (d) { - return 'translate(' + arcGenerator.centroid(d) + ')'; - }).style('text-anchor', 'middle').attr('class', 'slice').style('font-size', 17); - svg.append('text').text(parser.yy.getTitle()).attr('x', 0).attr('y', -(height - 50) / 2).attr('class', 'pieTitleText'); // Add the legends/annotations for each section - - var legend = svg.selectAll('.legend').data(color.domain()).enter().append('g').attr('class', 'legend').attr('transform', function (d, i) { - var height = legendRectSize + legendSpacing; - var offset = height * color.domain().length / 2; - var horz = 12 * legendRectSize; - var vert = i * height - offset; - return 'translate(' + horz + ',' + vert + ')'; - }); - legend.append('rect').attr('width', legendRectSize).attr('height', legendRectSize).style('fill', color).style('stroke', color); - legend.append('text').attr('x', legendRectSize + legendSpacing).attr('y', legendRectSize - legendSpacing).text(function (d) { - return d; - }); - } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error('Error while rendering info diagram'); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error(e); - } -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - setConf: setConf, - draw: draw -}); - -/***/ }), - -/***/ "./src/diagrams/pie/styles.js": -/*!************************************!*\ - !*** ./src/diagrams/pie/styles.js ***! - \************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -var getStyles = function getStyles(options) { - return ".pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: ".concat(options.taskTextDarkColor, ";\n font-family: ").concat(options.fontFamily, ";\n }\n .slice {\n font-family: ").concat(options.fontFamily, ";\n fill: ").concat(options.textColor, ";\n // fill: white;\n }\n .legend text {\n fill: ").concat(options.taskTextDarkColor, ";\n font-family: ").concat(options.fontFamily, ";\n font-size: 17px;\n }\n"); -}; - -/* harmony default export */ __webpack_exports__["default"] = (getStyles); - -/***/ }), - -/***/ "./src/diagrams/sequence/parser/sequenceDiagram.jison": -/*!************************************************************!*\ - !*** ./src/diagrams/sequence/parser/sequenceDiagram.jison ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,18],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,24],$Vc=[1,25],$Vd=[1,26],$Ve=[1,27],$Vf=[1,28],$Vg=[1,29],$Vh=[1,32],$Vi=[1,33],$Vj=[1,36],$Vk=[1,4,5,16,21,22,23,25,27,28,29,30,31,33,35,36,37,48,58],$Vl=[1,44],$Vm=[4,5,16,21,22,23,25,27,28,29,30,31,33,37,48,58],$Vn=[4,5,16,21,22,23,25,27,28,29,30,31,33,36,37,48,58],$Vo=[4,5,16,21,22,23,25,27,28,29,30,31,33,35,37,48,58],$Vp=[46,47,48],$Vq=[1,4,5,7,16,21,22,23,25,27,28,29,30,31,33,35,36,37,48,58]; -var parser = {trace: function trace () { }, -yy: {}, -symbols_: {"error":2,"start":3,"SPACE":4,"NEWLINE":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"openDirective":11,"typeDirective":12,"closeDirective":13,":":14,"argDirective":15,"participant":16,"actor":17,"AS":18,"restOfLine":19,"signal":20,"autonumber":21,"activate":22,"deactivate":23,"note_statement":24,"title":25,"text2":26,"loop":27,"end":28,"rect":29,"opt":30,"alt":31,"else_sections":32,"par":33,"par_sections":34,"and":35,"else":36,"note":37,"placement":38,"over":39,"actor_pair":40,"spaceList":41,",":42,"left_of":43,"right_of":44,"signaltype":45,"+":46,"-":47,"ACTOR":48,"SOLID_OPEN_ARROW":49,"DOTTED_OPEN_ARROW":50,"SOLID_ARROW":51,"DOTTED_ARROW":52,"SOLID_CROSS":53,"DOTTED_CROSS":54,"SOLID_POINT":55,"DOTTED_POINT":56,"TXT":57,"open_directive":58,"type_directive":59,"arg_directive":60,"close_directive":61,"$accept":0,"$end":1}, -terminals_: {2:"error",4:"SPACE",5:"NEWLINE",7:"SD",14:":",16:"participant",18:"AS",19:"restOfLine",21:"autonumber",22:"activate",23:"deactivate",25:"title",27:"loop",28:"end",29:"rect",30:"opt",31:"alt",33:"par",35:"and",36:"else",37:"note",39:"over",42:",",43:"left_of",44:"right_of",46:"+",47:"-",48:"ACTOR",49:"SOLID_OPEN_ARROW",50:"DOTTED_OPEN_ARROW",51:"SOLID_ARROW",52:"DOTTED_ARROW",53:"SOLID_CROSS",54:"DOTTED_CROSS",55:"SOLID_POINT",56:"DOTTED_POINT",57:"TXT",58:"open_directive",59:"type_directive",60:"arg_directive",61:"close_directive"}, -productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[6,4],[6,6],[10,5],[10,3],[10,2],[10,1],[10,3],[10,3],[10,2],[10,3],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[34,1],[34,4],[32,1],[32,4],[24,4],[24,4],[41,2],[41,1],[40,3],[40,1],[38,1],[38,1],[20,5],[20,5],[20,4],[17,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[26,1],[11,1],[12,1],[15,1],[13,1]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 4: - yy.apply($$[$0]);return $$[$0]; -break; -case 5: - this.$ = [] -break; -case 6: -$$[$0-1].push($$[$0]);this.$ = $$[$0-1] -break; -case 7: case 8: - this.$ = $$[$0] -break; -case 9: - this.$=[]; -break; -case 12: -$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3]; -break; -case 13: -this.$=$$[$0-1]; -break; -case 15: -yy.enableSequenceNumbers() -break; -case 16: -this.$={type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]}; -break; -case 17: -this.$={type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-1]}; -break; -case 19: -this.$=[{type:'setTitle', text:$$[$0-1]}] -break; -case 20: - - $$[$0-1].unshift({type: 'loopStart', loopText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.LOOP_START}); - $$[$0-1].push({type: 'loopEnd', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_END}); - this.$=$$[$0-1]; -break; -case 21: - - $$[$0-1].unshift({type: 'rectStart', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_START }); - $$[$0-1].push({type: 'rectEnd', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_END }); - this.$=$$[$0-1]; -break; -case 22: - - $$[$0-1].unshift({type: 'optStart', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_START}); - $$[$0-1].push({type: 'optEnd', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_END}); - this.$=$$[$0-1]; -break; -case 23: - - // Alt start - $$[$0-1].unshift({type: 'altStart', altText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.ALT_START}); - // Content in alt is already in $$[$0-1] - // End - $$[$0-1].push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END}); - this.$=$$[$0-1]; -break; -case 24: - - // Parallel start - $$[$0-1].unshift({type: 'parStart', parText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.PAR_START}); - // Content in par is already in $$[$0-1] - // End - $$[$0-1].push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END}); - this.$=$$[$0-1]; -break; -case 27: - this.$ = $$[$0-3].concat([{type: 'and', parText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.PAR_AND}, $$[$0]]); -break; -case 29: - this.$ = $$[$0-3].concat([{type: 'else', altText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.ALT_ELSE}, $$[$0]]); -break; -case 30: - - this.$ = [$$[$0-1], {type:'addNote', placement:$$[$0-2], actor:$$[$0-1].actor, text:$$[$0]}]; -break; -case 31: - - // Coerce actor_pair into a [to, from, ...] array - $$[$0-2] = [].concat($$[$0-1], $$[$0-1]).slice(0, 2); - $$[$0-2][0] = $$[$0-2][0].actor; - $$[$0-2][1] = $$[$0-2][1].actor; - this.$ = [$$[$0-1], {type:'addNote', placement:yy.PLACEMENT.OVER, actor:$$[$0-2].slice(0, 2), text:$$[$0]}]; -break; -case 34: - this.$ = [$$[$0-2], $$[$0]]; -break; -case 35: - this.$ = $$[$0]; -break; -case 36: - this.$ = yy.PLACEMENT.LEFTOF; -break; -case 37: - this.$ = yy.PLACEMENT.RIGHTOF; -break; -case 38: - this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]}, - {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]} - ] -break; -case 39: - this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]}, - {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-4]} - ] -break; -case 40: - this.$ = [$$[$0-3],$$[$0-1],{type: 'addMessage', from:$$[$0-3].actor, to:$$[$0-1].actor, signalType:$$[$0-2], msg:$$[$0]}] -break; -case 41: -this.$={type: 'addActor', actor:$$[$0]} -break; -case 42: - this.$ = yy.LINETYPE.SOLID_OPEN; -break; -case 43: - this.$ = yy.LINETYPE.DOTTED_OPEN; -break; -case 44: - this.$ = yy.LINETYPE.SOLID; -break; -case 45: - this.$ = yy.LINETYPE.DOTTED; -break; -case 46: - this.$ = yy.LINETYPE.SOLID_CROSS; -break; -case 47: - this.$ = yy.LINETYPE.DOTTED_CROSS; -break; -case 48: - this.$ = yy.LINETYPE.SOLID_POINT; -break; -case 49: - this.$ = yy.LINETYPE.DOTTED_POINT; -break; -case 50: -this.$ = yy.parseMessage($$[$0].trim().substring(1)) -break; -case 51: - yy.parseDirective('%%{', 'open_directive'); -break; -case 52: - yy.parseDirective($$[$0], 'type_directive'); -break; -case 53: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); -break; -case 54: - yy.parseDirective('}%%', 'close_directive', 'sequence'); -break; -} -}, -table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,11:6,58:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,11:6,58:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,11:6,58:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,11:6,58:$V3},o([1,4,5,16,21,22,23,25,27,29,30,31,33,37,48,58],$V4,{8:11}),{12:12,59:[1,13]},{59:[2,51]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,58:$V3},{13:34,14:[1,35],61:$Vj},o([14,61],[2,52]),o($Vk,[2,6]),{6:30,10:37,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,58:$V3},o($Vk,[2,8]),o($Vk,[2,9]),{17:38,48:$Vi},{5:[1,39]},o($Vk,[2,15]),{17:40,48:$Vi},{17:41,48:$Vi},{5:[1,42]},{26:43,57:$Vl},{19:[1,45]},{19:[1,46]},{19:[1,47]},{19:[1,48]},{19:[1,49]},o($Vk,[2,25]),{45:50,49:[1,51],50:[1,52],51:[1,53],52:[1,54],53:[1,55],54:[1,56],55:[1,57],56:[1,58]},{38:59,39:[1,60],43:[1,61],44:[1,62]},o([5,18,42,49,50,51,52,53,54,55,56,57],[2,41]),{5:[1,63]},{15:64,60:[1,65]},{5:[2,54]},o($Vk,[2,7]),{5:[1,67],18:[1,66]},o($Vk,[2,14]),{5:[1,68]},{5:[1,69]},o($Vk,[2,18]),{5:[1,70]},{5:[2,50]},o($Vm,$V4,{8:71}),o($Vm,$V4,{8:72}),o($Vm,$V4,{8:73}),o($Vn,$V4,{32:74,8:75}),o($Vo,$V4,{34:76,8:77}),{17:80,46:[1,78],47:[1,79],48:$Vi},o($Vp,[2,42]),o($Vp,[2,43]),o($Vp,[2,44]),o($Vp,[2,45]),o($Vp,[2,46]),o($Vp,[2,47]),o($Vp,[2,48]),o($Vp,[2,49]),{17:81,48:$Vi},{17:83,40:82,48:$Vi},{48:[2,36]},{48:[2,37]},o($Vq,[2,10]),{13:84,61:$Vj},{61:[2,53]},{19:[1,85]},o($Vk,[2,13]),o($Vk,[2,16]),o($Vk,[2,17]),o($Vk,[2,19]),{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[1,86],29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,58:$V3},{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[1,87],29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,58:$V3},{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[1,88],29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,58:$V3},{28:[1,89]},{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[2,28],29:$Vd,30:$Ve,31:$Vf,33:$Vg,36:[1,90],37:$Vh,48:$Vi,58:$V3},{28:[1,91]},{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[2,26],29:$Vd,30:$Ve,31:$Vf,33:$Vg,35:[1,92],37:$Vh,48:$Vi,58:$V3},{17:93,48:$Vi},{17:94,48:$Vi},{26:95,57:$Vl},{26:96,57:$Vl},{26:97,57:$Vl},{42:[1,98],57:[2,35]},{5:[1,99]},{5:[1,100]},o($Vk,[2,20]),o($Vk,[2,21]),o($Vk,[2,22]),o($Vk,[2,23]),{19:[1,101]},o($Vk,[2,24]),{19:[1,102]},{26:103,57:$Vl},{26:104,57:$Vl},{5:[2,40]},{5:[2,30]},{5:[2,31]},{17:105,48:$Vi},o($Vq,[2,11]),o($Vk,[2,12]),o($Vn,$V4,{8:75,32:106}),o($Vo,$V4,{8:77,34:107}),{5:[2,38]},{5:[2,39]},{57:[2,34]},{28:[2,29]},{28:[2,27]}], -defaultActions: {7:[2,51],8:[2,1],9:[2,2],10:[2,3],36:[2,54],44:[2,50],61:[2,36],62:[2,37],65:[2,53],95:[2,40],96:[2,30],97:[2,31],103:[2,38],104:[2,39],105:[2,34],106:[2,29],107:[2,27]}, -parseError: function parseError (str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - var error = new Error(str); - error.hash = hash; - throw error; - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = tstack.pop() || lexer.lex() || EOF; - if (typeof token !== 'number') { - if (token instanceof Array) { - tstack = token; - token = tstack.pop(); - } - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; - -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function(match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex () { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin (condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState () { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules () { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState (n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState (condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {"case-insensitive":true}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0: this.begin('open_directive'); return 58; -break; -case 1: this.begin('type_directive'); return 59; -break; -case 2: this.popState(); this.begin('arg_directive'); return 14; -break; -case 3: this.popState(); this.popState(); return 61; -break; -case 4:return 60; -break; -case 5:return 5; -break; -case 6:/* skip all whitespace */ -break; -case 7:/* skip same-line whitespace */ -break; -case 8:/* skip comments */ -break; -case 9:/* skip comments */ -break; -case 10:/* skip comments */ -break; -case 11: this.begin('ID'); return 16; -break; -case 12: yy_.yytext = yy_.yytext.trim(); this.begin('ALIAS'); return 48; -break; -case 13: this.popState(); this.popState(); this.begin('LINE'); return 18; -break; -case 14: this.popState(); this.popState(); return 5; -break; -case 15: this.begin('LINE'); return 27; -break; -case 16: this.begin('LINE'); return 29; -break; -case 17: this.begin('LINE'); return 30; -break; -case 18: this.begin('LINE'); return 31; -break; -case 19: this.begin('LINE'); return 36; -break; -case 20: this.begin('LINE'); return 33; -break; -case 21: this.begin('LINE'); return 35; -break; -case 22: this.popState(); return 19; -break; -case 23:return 28; -break; -case 24:return 43; -break; -case 25:return 44; -break; -case 26:return 39; -break; -case 27:return 37; -break; -case 28: this.begin('ID'); return 22; -break; -case 29: this.begin('ID'); return 23; -break; -case 30:return 25; -break; -case 31:return 7; -break; -case 32:return 21; -break; -case 33:return 42; -break; -case 34:return 5; -break; -case 35: yy_.yytext = yy_.yytext.trim(); return 48; -break; -case 36:return 51; -break; -case 37:return 52; -break; -case 38:return 49; -break; -case 39:return 50; -break; -case 40:return 53; -break; -case 41:return 54; -break; -case 42:return 55; -break; -case 43:return 56; -break; -case 44:return 57; -break; -case 45:return 46; -break; -case 46:return 47; -break; -case 47:return 5; -break; -case 48:return 'INVALID'; -break; -} -}, -rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:participant\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i], -conditions: {"open_directive":{"rules":[1,8],"inclusive":false},"type_directive":{"rules":[2,3,8],"inclusive":false},"arg_directive":{"rules":[3,4,8],"inclusive":false},"ID":{"rules":[7,8,12],"inclusive":false},"ALIAS":{"rules":[7,8,13,14],"inclusive":false},"LINE":{"rules":[7,8,22],"inclusive":false},"INITIAL":{"rules":[0,5,6,8,9,10,11,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (true) { -exports.parser = parser; -exports.Parser = parser.Parser; -exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain (args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if ( true && __webpack_require__.c[__webpack_require__.s] === module) { - exports.main(process.argv.slice(1)); -} -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./src/diagrams/sequence/sequenceDb.js": -/*!*********************************************!*\ - !*** ./src/diagrams/sequence/sequenceDb.js ***! - \*********************************************/ -/*! exports provided: parseDirective, addActor, addMessage, addSignal, getMessages, getActors, getActor, getActorKeys, getTitle, getTitleWrapped, enableSequenceNumbers, showSequenceNumbers, setWrap, autoWrap, clear, parseMessage, LINETYPE, ARROWTYPE, PLACEMENT, addNote, setTitle, apply, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDirective", function() { return parseDirective; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addActor", function() { return addActor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMessage", function() { return addMessage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSignal", function() { return addSignal; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMessages", function() { return getMessages; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActors", function() { return getActors; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActor", function() { return getActor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActorKeys", function() { return getActorKeys; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTitle", function() { return getTitle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTitleWrapped", function() { return getTitleWrapped; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableSequenceNumbers", function() { return enableSequenceNumbers; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showSequenceNumbers", function() { return showSequenceNumbers; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setWrap", function() { return setWrap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoWrap", function() { return autoWrap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseMessage", function() { return parseMessage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LINETYPE", function() { return LINETYPE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARROWTYPE", function() { return ARROWTYPE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLACEMENT", function() { return PLACEMENT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addNote", function() { return addNote; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTitle", function() { return setTitle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "apply", function() { return apply; }); -/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); - - - -var prevActor = undefined; -var actors = {}; -var messages = []; -var notes = []; -var title = ''; -var titleWrapped = false; -var sequenceNumbersEnabled = false; -var wrapEnabled = false; -var parseDirective = function parseDirective(statement, context, type) { - _mermaidAPI__WEBPACK_IMPORTED_MODULE_0__["default"].parseDirective(this, statement, context, type); -}; -var addActor = function addActor(id, name, description) { - // Don't allow description nulling - var old = actors[id]; - if (old && name === old.name && description == null) return; // Don't allow null descriptions, either - - if (description == null || description.text == null) { - description = { - text: name, - wrap: null - }; - } - - actors[id] = { - name: name, - description: description.text, - wrap: description.wrap === undefined && autoWrap() || !!description.wrap, - prevActor: prevActor - }; - - if (prevActor && actors[prevActor]) { - actors[prevActor].nextActor = id; - } - - prevActor = id; -}; - -var activationCount = function activationCount(part) { - var i; - var count = 0; - - for (i = 0; i < messages.length; i++) { - if (messages[i].type === LINETYPE.ACTIVE_START) { - if (messages[i].from.actor === part) { - count++; - } - } - - if (messages[i].type === LINETYPE.ACTIVE_END) { - if (messages[i].from.actor === part) { - count--; - } - } - } - - return count; -}; - -var addMessage = function addMessage(idFrom, idTo, message, answer) { - messages.push({ - from: idFrom, - to: idTo, - message: message.text, - wrap: message.wrap === undefined && autoWrap() || !!message.wrap, - answer: answer - }); -}; -var addSignal = function addSignal(idFrom, idTo) { - var message = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { - text: undefined, - wrap: undefined - }; - var messageType = arguments.length > 3 ? arguments[3] : undefined; - - if (messageType === LINETYPE.ACTIVE_END) { - var cnt = activationCount(idFrom.actor); - - if (cnt < 1) { - // Bail out as there is an activation signal from an inactive participant - var error = new Error('Trying to inactivate an inactive participant (' + idFrom.actor + ')'); - error.hash = { - text: '->>-', - token: '->>-', - line: '1', - loc: { - first_line: 1, - last_line: 1, - first_column: 1, - last_column: 1 - }, - expected: ["'ACTIVE_PARTICIPANT'"] - }; - throw error; - } - } - - messages.push({ - from: idFrom, - to: idTo, - message: message.text, - wrap: message.wrap === undefined && autoWrap() || !!message.wrap, - type: messageType - }); - return true; -}; -var getMessages = function getMessages() { - return messages; -}; -var getActors = function getActors() { - return actors; -}; -var getActor = function getActor(id) { - return actors[id]; -}; -var getActorKeys = function getActorKeys() { - return Object.keys(actors); -}; -var getTitle = function getTitle() { - return title; -}; -var getTitleWrapped = function getTitleWrapped() { - return titleWrapped; -}; -var enableSequenceNumbers = function enableSequenceNumbers() { - sequenceNumbersEnabled = true; -}; -var showSequenceNumbers = function showSequenceNumbers() { - return sequenceNumbersEnabled; -}; -var setWrap = function setWrap(wrapSetting) { - wrapEnabled = wrapSetting; -}; -var autoWrap = function autoWrap() { - return wrapEnabled; -}; -var clear = function clear() { - actors = {}; - messages = []; -}; -var parseMessage = function parseMessage(str) { - var _str = str.trim(); - - var message = { - text: _str.replace(/^[:]?(?:no)?wrap:/, '').trim(), - wrap: _str.match(/^[:]?wrap:/) !== null ? true : _str.match(/^[:]?nowrap:/) !== null ? false : undefined - }; - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug('parseMessage:', message); - return message; -}; -var LINETYPE = { - SOLID: 0, - DOTTED: 1, - NOTE: 2, - SOLID_CROSS: 3, - DOTTED_CROSS: 4, - SOLID_OPEN: 5, - DOTTED_OPEN: 6, - LOOP_START: 10, - LOOP_END: 11, - ALT_START: 12, - ALT_ELSE: 13, - ALT_END: 14, - OPT_START: 15, - OPT_END: 16, - ACTIVE_START: 17, - ACTIVE_END: 18, - PAR_START: 19, - PAR_AND: 20, - PAR_END: 21, - RECT_START: 22, - RECT_END: 23, - SOLID_POINT: 24, - DOTTED_POINT: 25 -}; -var ARROWTYPE = { - FILLED: 0, - OPEN: 1 -}; -var PLACEMENT = { - LEFTOF: 0, - RIGHTOF: 1, - OVER: 2 -}; -var addNote = function addNote(actor, placement, message) { - var note = { - actor: actor, - placement: placement, - message: message.text, - wrap: message.wrap === undefined && autoWrap() || !!message.wrap - }; // Coerce actor into a [to, from, ...] array - - var actors = [].concat(actor, actor); - notes.push(note); - messages.push({ - from: actors[0], - to: actors[1], - message: message.text, - wrap: message.wrap === undefined && autoWrap() || !!message.wrap, - type: LINETYPE.NOTE, - placement: placement - }); -}; -var setTitle = function setTitle(titleWrap) { - title = titleWrap.text; - titleWrapped = titleWrap.wrap === undefined && autoWrap() || !!titleWrap.wrap; -}; -var apply = function apply(param) { - if (param instanceof Array) { - param.forEach(function (item) { - apply(item); - }); - } else { - switch (param.type) { - case 'addActor': - addActor(param.actor, param.actor, param.description); - break; - - case 'activeStart': - addSignal(param.actor, undefined, undefined, param.signalType); - break; - - case 'activeEnd': - addSignal(param.actor, undefined, undefined, param.signalType); - break; - - case 'addNote': - addNote(param.actor, param.placement, param.text); - break; - - case 'addMessage': - addSignal(param.from, param.to, param.msg, param.signalType); - break; - - case 'loopStart': - addSignal(undefined, undefined, param.loopText, param.signalType); - break; - - case 'loopEnd': - addSignal(undefined, undefined, undefined, param.signalType); - break; - - case 'rectStart': - addSignal(undefined, undefined, param.color, param.signalType); - break; - - case 'rectEnd': - addSignal(undefined, undefined, undefined, param.signalType); - break; - - case 'optStart': - addSignal(undefined, undefined, param.optText, param.signalType); - break; - - case 'optEnd': - addSignal(undefined, undefined, undefined, param.signalType); - break; - - case 'altStart': - addSignal(undefined, undefined, param.altText, param.signalType); - break; - - case 'else': - addSignal(undefined, undefined, param.altText, param.signalType); - break; - - case 'altEnd': - addSignal(undefined, undefined, undefined, param.signalType); - break; - - case 'setTitle': - setTitle(param.text); - break; - - case 'parStart': - addSignal(undefined, undefined, param.parText, param.signalType); - break; - - case 'and': - addSignal(undefined, undefined, param.parText, param.signalType); - break; - - case 'parEnd': - addSignal(undefined, undefined, undefined, param.signalType); - break; - } - } -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - addActor: addActor, - addMessage: addMessage, - addSignal: addSignal, - autoWrap: autoWrap, - setWrap: setWrap, - enableSequenceNumbers: enableSequenceNumbers, - showSequenceNumbers: showSequenceNumbers, - getMessages: getMessages, - getActors: getActors, - getActor: getActor, - getActorKeys: getActorKeys, - getTitle: getTitle, - parseDirective: parseDirective, - getConfig: function getConfig() { - return _config__WEBPACK_IMPORTED_MODULE_1__["getConfig"]().sequence; - }, - getTitleWrapped: getTitleWrapped, - clear: clear, - parseMessage: parseMessage, - LINETYPE: LINETYPE, - ARROWTYPE: ARROWTYPE, - PLACEMENT: PLACEMENT, - addNote: addNote, - setTitle: setTitle, - apply: apply -}); - -/***/ }), - -/***/ "./src/diagrams/sequence/sequenceRenderer.js": -/*!***************************************************!*\ - !*** ./src/diagrams/sequence/sequenceRenderer.js ***! - \***************************************************/ -/*! exports provided: bounds, drawActors, setConf, draw, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounds", function() { return bounds; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawActors", function() { return drawActors; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _svgDraw__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./svgDraw */ "./src/diagrams/sequence/svgDraw.js"); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/sequenceDiagram */ "./src/diagrams/sequence/parser/sequenceDiagram.jison"); -/* harmony import */ var _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); -/* harmony import */ var _sequenceDb__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./sequenceDb */ "./src/diagrams/sequence/sequenceDb.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); - - - - - - - - -_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy = _sequenceDb__WEBPACK_IMPORTED_MODULE_5__["default"]; -var conf = {}; -var bounds = { - data: { - startx: undefined, - stopx: undefined, - starty: undefined, - stopy: undefined - }, - verticalPos: 0, - sequenceItems: [], - activations: [], - models: { - getHeight: function getHeight() { - return Math.max.apply(null, this.actors.length === 0 ? [0] : this.actors.map(function (actor) { - return actor.height || 0; - })) + (this.loops.length === 0 ? 0 : this.loops.map(function (it) { - return it.height || 0; - }).reduce(function (acc, h) { - return acc + h; - })) + (this.messages.length === 0 ? 0 : this.messages.map(function (it) { - return it.height || 0; - }).reduce(function (acc, h) { - return acc + h; - })) + (this.notes.length === 0 ? 0 : this.notes.map(function (it) { - return it.height || 0; - }).reduce(function (acc, h) { - return acc + h; - })); - }, - clear: function clear() { - this.actors = []; - this.loops = []; - this.messages = []; - this.notes = []; - }, - addActor: function addActor(actorModel) { - this.actors.push(actorModel); - }, - addLoop: function addLoop(loopModel) { - this.loops.push(loopModel); - }, - addMessage: function addMessage(msgModel) { - this.messages.push(msgModel); - }, - addNote: function addNote(noteModel) { - this.notes.push(noteModel); - }, - lastActor: function lastActor() { - return this.actors[this.actors.length - 1]; - }, - lastLoop: function lastLoop() { - return this.loops[this.loops.length - 1]; - }, - lastMessage: function lastMessage() { - return this.messages[this.messages.length - 1]; - }, - lastNote: function lastNote() { - return this.notes[this.notes.length - 1]; - }, - actors: [], - loops: [], - messages: [], - notes: [] - }, - init: function init() { - this.sequenceItems = []; - this.activations = []; - this.models.clear(); - this.data = { - startx: undefined, - stopx: undefined, - starty: undefined, - stopy: undefined - }; - this.verticalPos = 0; - setConf(_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getConfig()); - }, - updateVal: function updateVal(obj, key, val, fun) { - if (typeof obj[key] === 'undefined') { - obj[key] = val; - } else { - obj[key] = fun(val, obj[key]); - } - }, - updateBounds: function updateBounds(startx, starty, stopx, stopy) { - var _self = this; - - var cnt = 0; - - function updateFn(type) { - return function updateItemBounds(item) { - cnt++; // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems - - var n = _self.sequenceItems.length - cnt + 1; - - _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min); - - _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max); - - _self.updateVal(bounds.data, 'startx', startx - n * conf.boxMargin, Math.min); - - _self.updateVal(bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max); - - if (!(type === 'activation')) { - _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min); - - _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max); - - _self.updateVal(bounds.data, 'starty', starty - n * conf.boxMargin, Math.min); - - _self.updateVal(bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max); - } - }; - } - - this.sequenceItems.forEach(updateFn()); - this.activations.forEach(updateFn('activation')); - }, - insert: function insert(startx, starty, stopx, stopy) { - var _startx = Math.min(startx, stopx); - - var _stopx = Math.max(startx, stopx); - - var _starty = Math.min(starty, stopy); - - var _stopy = Math.max(starty, stopy); - - this.updateVal(bounds.data, 'startx', _startx, Math.min); - this.updateVal(bounds.data, 'starty', _starty, Math.min); - this.updateVal(bounds.data, 'stopx', _stopx, Math.max); - this.updateVal(bounds.data, 'stopy', _stopy, Math.max); - this.updateBounds(_startx, _starty, _stopx, _stopy); - }, - newActivation: function newActivation(message, diagram, actors) { - var actorRect = actors[message.from.actor]; - var stackedSize = actorActivations(message.from.actor).length || 0; - var x = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf.activationWidth / 2; - this.activations.push({ - startx: x, - starty: this.verticalPos + 2, - stopx: x + conf.activationWidth, - stopy: undefined, - actor: message.from.actor, - anchored: _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].anchorElement(diagram) - }); - }, - endActivation: function endActivation(message) { - // find most recent activation for given actor - var lastActorActivationIdx = this.activations.map(function (activation) { - return activation.actor; - }).lastIndexOf(message.from.actor); - return this.activations.splice(lastActorActivationIdx, 1)[0]; - }, - createLoop: function createLoop() { - var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - message: undefined, - wrap: false, - width: undefined - }; - var fill = arguments.length > 1 ? arguments[1] : undefined; - return { - startx: undefined, - starty: this.verticalPos, - stopx: undefined, - stopy: undefined, - title: title.message, - wrap: title.wrap, - width: title.width, - height: 0, - fill: fill - }; - }, - newLoop: function newLoop() { - var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - message: undefined, - wrap: false, - width: undefined - }; - var fill = arguments.length > 1 ? arguments[1] : undefined; - this.sequenceItems.push(this.createLoop(title, fill)); - }, - endLoop: function endLoop() { - return this.sequenceItems.pop(); - }, - addSectionToLoop: function addSectionToLoop(message) { - var loop = this.sequenceItems.pop(); - loop.sections = loop.sections || []; - loop.sectionTitles = loop.sectionTitles || []; - loop.sections.push({ - y: bounds.getVerticalPos(), - height: 0 - }); - loop.sectionTitles.push(message); - this.sequenceItems.push(loop); - }, - bumpVerticalPos: function bumpVerticalPos(bump) { - this.verticalPos = this.verticalPos + bump; - this.data.stopy = this.verticalPos; - }, - getVerticalPos: function getVerticalPos() { - return this.verticalPos; - }, - getBounds: function getBounds() { - return { - bounds: this.data, - models: this.models - }; - } -}; -/** - * Draws an note in the diagram with the attached line - * @param elem - The diagram to draw to. - * @param noteModel:{x: number, y: number, message: string, width: number} - startx: x axis start position, verticalPos: y axis position, messsage: the message to be shown, width: Set this with a custom width to override the default configured width. - */ - -var drawNote = function drawNote(elem, noteModel) { - bounds.bumpVerticalPos(conf.boxMargin); - noteModel.height = conf.boxMargin; - noteModel.starty = bounds.getVerticalPos(); - var rect = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].getNoteRect(); - rect.x = noteModel.startx; - rect.y = noteModel.starty; - rect.width = noteModel.width || conf.width; - rect.class = 'note'; - var g = elem.append('g'); - var rectElem = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawRect(g, rect); - var textObj = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].getTextObj(); - textObj.x = noteModel.startx; - textObj.y = noteModel.starty; - textObj.width = rect.width; - textObj.dy = '1em'; - textObj.text = noteModel.message; - textObj.class = 'noteText'; - textObj.fontFamily = conf.noteFontFamily; - textObj.fontSize = conf.noteFontSize; - textObj.fontWeight = conf.noteFontWeight; - textObj.anchor = conf.noteAlign; - textObj.textMargin = conf.noteMargin; - textObj.valign = conf.noteAlign; - var textElem = Object(_svgDraw__WEBPACK_IMPORTED_MODULE_1__["drawText"])(g, textObj); - var textHeight = Math.round(textElem.map(function (te) { - return (te._groups || te)[0][0].getBBox().height; - }).reduce(function (acc, curr) { - return acc + curr; - })); - rectElem.attr('height', textHeight + 2 * conf.noteMargin); - noteModel.height += textHeight + 2 * conf.noteMargin; - bounds.bumpVerticalPos(textHeight + 2 * conf.noteMargin); - noteModel.stopy = noteModel.starty + textHeight + 2 * conf.noteMargin; - noteModel.stopx = noteModel.startx + rect.width; - bounds.insert(noteModel.startx, noteModel.starty, noteModel.stopx, noteModel.stopy); - bounds.models.addNote(noteModel); -}; - -var messageFont = function messageFont(cnf) { - return { - fontFamily: cnf.messageFontFamily, - fontSize: cnf.messageFontSize, - fontWeight: cnf.messageFontWeight - }; -}; - -var noteFont = function noteFont(cnf) { - return { - fontFamily: cnf.noteFontFamily, - fontSize: cnf.noteFontSize, - fontWeight: cnf.noteFontWeight - }; -}; - -var actorFont = function actorFont(cnf) { - return { - fontFamily: cnf.actorFontFamily, - fontSize: cnf.actorFontSize, - fontWeight: cnf.actorFontWeight - }; -}; -/** - * Draws a message - * @param g - the parent of the message element - * @param msgModel - the model containing fields describing a message - */ - - -var drawMessage = function drawMessage(g, msgModel) { - bounds.bumpVerticalPos(10); - var startx = msgModel.startx, - stopx = msgModel.stopx, - starty = msgModel.starty, - message = msgModel.message, - type = msgModel.type, - sequenceIndex = msgModel.sequenceIndex; - var lines = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].splitBreaks(message).length; - var textDims = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].calculateTextDimensions(message, messageFont(conf)); - var lineHeight = textDims.height / lines; - msgModel.height += lineHeight; - bounds.bumpVerticalPos(lineHeight); - var textObj = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].getTextObj(); - textObj.x = startx; - textObj.y = starty + 10; - textObj.width = stopx - startx; - textObj.class = 'messageText'; - textObj.dy = '1em'; - textObj.text = message; - textObj.fontFamily = conf.messageFontFamily; - textObj.fontSize = conf.messageFontSize; - textObj.fontWeight = conf.messageFontWeight; - textObj.anchor = conf.messageAlign; - textObj.valign = conf.messageAlign; - textObj.textMargin = conf.wrapPadding; - textObj.tspan = false; - Object(_svgDraw__WEBPACK_IMPORTED_MODULE_1__["drawText"])(g, textObj); - var totalOffset = textDims.height - 10; - var textWidth = textDims.width; - var line, lineStarty; - - if (startx === stopx) { - lineStarty = bounds.getVerticalPos() + totalOffset; - - if (conf.rightAngles) { - line = g.append('path').attr('d', "M ".concat(startx, ",").concat(lineStarty, " H ").concat(startx + Math.max(conf.width / 2, textWidth / 2), " V ").concat(lineStarty + 25, " H ").concat(startx)); - } else { - totalOffset += conf.boxMargin; - lineStarty = bounds.getVerticalPos() + totalOffset; - line = g.append('path').attr('d', 'M ' + startx + ',' + lineStarty + ' C ' + (startx + 60) + ',' + (lineStarty - 10) + ' ' + (startx + 60) + ',' + (lineStarty + 30) + ' ' + startx + ',' + (lineStarty + 20)); - } - - totalOffset += 30; - var dx = Math.max(textWidth / 2, conf.width / 2); - bounds.insert(startx - dx, bounds.getVerticalPos() - 10 + totalOffset, stopx + dx, bounds.getVerticalPos() + 30 + totalOffset); - } else { - totalOffset += conf.boxMargin; - lineStarty = bounds.getVerticalPos() + totalOffset; - line = g.append('line'); - line.attr('x1', startx); - line.attr('y1', lineStarty); - line.attr('x2', stopx); - line.attr('y2', lineStarty); - bounds.insert(startx, lineStarty - 10, stopx, lineStarty); - } // Make an SVG Container - // Draw the line - - - if (type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_POINT || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN) { - line.style('stroke-dasharray', '3, 3'); - line.attr('class', 'messageLine1'); - } else { - line.attr('class', 'messageLine0'); - } - - var url = ''; - - if (conf.arrowMarkerAbsolute) { - url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search; - url = url.replace(/\(/g, '\\('); - url = url.replace(/\)/g, '\\)'); - } - - line.attr('stroke-width', 2); - line.attr('stroke', 'none'); // handled by theme/css anyway - - line.style('fill', 'none'); // remove any fill colour - - if (type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED) { - line.attr('marker-end', 'url(' + url + '#arrowhead)'); - } - - if (type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_POINT || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_POINT) { - line.attr('marker-end', 'url(' + url + '#filled-head)'); - } - - if (type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_CROSS || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS) { - line.attr('marker-end', 'url(' + url + '#crosshead)'); - } // add node number - - - if (_sequenceDb__WEBPACK_IMPORTED_MODULE_5__["default"].showSequenceNumbers() || conf.showSequenceNumbers) { - line.attr('marker-start', 'url(' + url + '#sequencenumber)'); - g.append('text').attr('x', startx).attr('y', lineStarty + 4).attr('font-family', 'sans-serif').attr('font-size', '12px').attr('text-anchor', 'middle').attr('textLength', '16px').attr('class', 'sequenceNumber').text(sequenceIndex); - } - - bounds.bumpVerticalPos(totalOffset); - msgModel.height += totalOffset; - msgModel.stopy = msgModel.starty + msgModel.height; - bounds.insert(msgModel.fromBounds, msgModel.starty, msgModel.toBounds, msgModel.stopy); -}; - -var drawActors = function drawActors(diagram, actors, actorKeys, verticalPos) { - // Draw the actors - var prevWidth = 0; - var prevMargin = 0; - - for (var i = 0; i < actorKeys.length; i++) { - var actor = actors[actorKeys[i]]; // Add some rendering data to the object - - actor.width = actor.width || conf.width; - actor.height = Math.max(actor.height || conf.height, conf.height); - actor.margin = actor.margin || conf.actorMargin; - actor.x = prevWidth + prevMargin; - actor.y = verticalPos; // Draw the box with the attached line - - _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawActor(diagram, actor, conf); - bounds.insert(actor.x, verticalPos, actor.x + actor.width, actor.height); - prevWidth += actor.width; - prevMargin += actor.margin; - bounds.models.addActor(actor); - } // Add a margin between the actor boxes and the first arrow - - - bounds.bumpVerticalPos(conf.height); -}; -var setConf = function setConf(cnf) { - Object(_utils__WEBPACK_IMPORTED_MODULE_7__["assignWithDepth"])(conf, cnf); - - if (cnf.fontFamily) { - conf.actorFontFamily = conf.noteFontFamily = conf.messageFontFamily = cnf.fontFamily; - } - - if (cnf.fontSize) { - conf.actorFontSize = conf.noteFontSize = conf.messageFontSize = cnf.fontSize; - } - - if (cnf.fontWeight) { - conf.actorFontWeight = conf.noteFontWeight = conf.messageFontWeight = cnf.fontWeight; - } -}; - -var actorActivations = function actorActivations(actor) { - return bounds.activations.filter(function (activation) { - return activation.actor === actor; - }); -}; - -var activationBounds = function activationBounds(actor, actors) { - // handle multiple stacked activations for same actor - var actorObj = actors[actor]; - var activations = actorActivations(actor); - var left = activations.reduce(function (acc, activation) { - return Math.min(acc, activation.startx); - }, actorObj.x + actorObj.width / 2); - var right = activations.reduce(function (acc, activation) { - return Math.max(acc, activation.stopx); - }, actorObj.x + actorObj.width / 2); - return [left, right]; -}; - -function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoopFn) { - bounds.bumpVerticalPos(preMargin); - var heightAdjust = postMargin; - - if (msg.id && msg.message && loopWidths[msg.id]) { - var loopWidth = loopWidths[msg.id].width; - var textConf = messageFont(conf); - msg.message = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].wrapLabel("[".concat(msg.message, "]"), loopWidth - 2 * conf.wrapPadding, textConf); - msg.width = loopWidth; - msg.wrap = true; // const lines = common.splitBreaks(msg.message).length; - - var textDims = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].calculateTextDimensions(msg.message, textConf); - var totalOffset = Math.max(textDims.height, conf.labelBoxHeight); - heightAdjust = postMargin + totalOffset; - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug("".concat(totalOffset, " - ").concat(msg.message)); - } - - addLoopFn(msg); - bounds.bumpVerticalPos(heightAdjust); -} -/** - * Draws a sequenceDiagram in the tag with id: id based on the graph definition in text. - * @param text - * @param id - */ - - -var draw = function draw(text, id) { - conf = _config__WEBPACK_IMPORTED_MODULE_6__["getConfig"]().sequence; - _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.clear(); - _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.setWrap(conf.wrap); - _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].parse(text + '\n'); - bounds.init(); - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug("C:".concat(JSON.stringify(conf, null, 2))); - var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])("[id=\"".concat(id, "\"]")); // Fetch data from the parsing - - var actors = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActors(); - var actorKeys = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActorKeys(); - var messages = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getMessages(); - var title = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getTitle(); - var maxMessageWidthPerActor = getMaxMessageWidthPerActor(actors, messages); - conf.height = calculateActorMargins(actors, maxMessageWidthPerActor); - drawActors(diagram, actors, actorKeys, 0); - var loopWidths = calculateLoopBounds(messages, actors, maxMessageWidthPerActor); // The arrow head definition is attached to the svg once - - _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertArrowHead(diagram); - _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertArrowCrossHead(diagram); - _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertArrowFilledHead(diagram); - _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertSequenceNumber(diagram); - - function activeEnd(msg, verticalPos) { - var activationData = bounds.endActivation(msg); - - if (activationData.starty + 18 > verticalPos) { - activationData.starty = verticalPos - 6; - verticalPos += 12; - } - - _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawActivation(diagram, activationData, verticalPos, conf, actorActivations(msg.from.actor).length); - bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos); - } // Draw the messages/signals - - - var sequenceIndex = 1; - messages.forEach(function (msg) { - var loopModel, noteModel, msgModel; - - switch (msg.type) { - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.NOTE: - noteModel = msg.noteModel; - drawNote(diagram, noteModel); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ACTIVE_START: - bounds.newActivation(msg, diagram, actors); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ACTIVE_END: - activeEnd(msg, bounds.getVerticalPos()); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.LOOP_START: - adjustLoopHeightForWrap(loopWidths, msg, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, function (message) { - return bounds.newLoop(message); - }); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.LOOP_END: - loopModel = bounds.endLoop(); - _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopModel, 'loop', conf); - bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); - bounds.models.addLoop(loopModel); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.RECT_START: - adjustLoopHeightForWrap(loopWidths, msg, conf.boxMargin, conf.boxMargin, function (message) { - return bounds.newLoop(undefined, message.message); - }); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.RECT_END: - loopModel = bounds.endLoop(); - _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawBackgroundRect(diagram, loopModel); - bounds.models.addLoop(loopModel); - bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.OPT_START: - adjustLoopHeightForWrap(loopWidths, msg, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, function (message) { - return bounds.newLoop(message); - }); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.OPT_END: - loopModel = bounds.endLoop(); - _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopModel, 'opt', conf); - bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); - bounds.models.addLoop(loopModel); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_START: - adjustLoopHeightForWrap(loopWidths, msg, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, function (message) { - return bounds.newLoop(message); - }); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_ELSE: - adjustLoopHeightForWrap(loopWidths, msg, conf.boxMargin + conf.boxTextMargin, conf.boxMargin, function (message) { - return bounds.addSectionToLoop(message); - }); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_END: - loopModel = bounds.endLoop(); - _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopModel, 'alt', conf); - bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); - bounds.models.addLoop(loopModel); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_START: - adjustLoopHeightForWrap(loopWidths, msg, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, function (message) { - return bounds.newLoop(message); - }); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_AND: - adjustLoopHeightForWrap(loopWidths, msg, conf.boxMargin + conf.boxTextMargin, conf.boxMargin, function (message) { - return bounds.addSectionToLoop(message); - }); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_END: - loopModel = bounds.endLoop(); - _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopModel, 'par', conf); - bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); - bounds.models.addLoop(loopModel); - break; - - default: - try { - // lastMsg = msg - msgModel = msg.msgModel; - msgModel.starty = bounds.getVerticalPos(); - msgModel.sequenceIndex = sequenceIndex; - drawMessage(diagram, msgModel); - bounds.models.addMessage(msgModel); - } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].error('error while drawing message', e); - } - - } // Increment sequence counter if msg.type is a line (and not another event like activation or note, etc) - - - if ([_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_CROSS, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_POINT, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_POINT].includes(msg.type)) { - sequenceIndex++; - } - }); - - if (conf.mirrorActors) { - // Draw actors below diagram - bounds.bumpVerticalPos(conf.boxMargin * 2); - drawActors(diagram, actors, actorKeys, bounds.getVerticalPos()); - } - - var _bounds$getBounds = bounds.getBounds(), - box = _bounds$getBounds.bounds; // Adjust line height of actor lines now that the height of the diagram is known - - - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug('For line height fix Querying: #' + id + ' .actor-line'); - var actorLines = Object(d3__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('#' + id + ' .actor-line'); - actorLines.attr('y2', box.stopy); - var height = box.stopy - box.starty + 2 * conf.diagramMarginY; - - if (conf.mirrorActors) { - height = height - conf.boxMargin + conf.bottomMarginAdj; - } - - var width = box.stopx - box.startx + 2 * conf.diagramMarginX; - - if (title) { - diagram.append('text').text(title).attr('x', (box.stopx - box.startx) / 2 - 2 * conf.diagramMarginX).attr('y', -25); - } - - Object(_utils__WEBPACK_IMPORTED_MODULE_7__["configureSvgSize"])(diagram, height, width, conf.useMaxWidth); - var extraVertForTitle = title ? 40 : 0; - diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + (conf.diagramMarginY + extraVertForTitle) + ' ' + width + ' ' + (height + extraVertForTitle)); - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug("models:", bounds.models); -}; -/** - * Retrieves the max message width of each actor, supports signals (messages, loops) - * and notes. - * - * It will enumerate each given message, and will determine its text width, in relation - * to the actor it originates from, and destined to. - * - * @param actors - The actors map - * @param messages - A list of message objects to iterate - */ - -var getMaxMessageWidthPerActor = function getMaxMessageWidthPerActor(actors, messages) { - var maxMessageWidthPerActor = {}; - messages.forEach(function (msg) { - if (actors[msg.to] && actors[msg.from]) { - var actor = actors[msg.to]; // If this is the first actor, and the message is left of it, no need to calculate the margin - - if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.LEFTOF && !actor.prevActor) { - return; - } // If this is the last actor, and the message is right of it, no need to calculate the margin - - - if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.RIGHTOF && !actor.nextActor) { - return; - } - - var isNote = msg.placement !== undefined; - var isMessage = !isNote; - var textFont = isNote ? noteFont(conf) : messageFont(conf); - var wrappedMessage = msg.wrap ? _utils__WEBPACK_IMPORTED_MODULE_7__["default"].wrapLabel(msg.message, conf.width - 2 * conf.wrapPadding, textFont) : msg.message; - var messageDimensions = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].calculateTextDimensions(wrappedMessage, textFont); - var messageWidth = messageDimensions.width + 2 * conf.wrapPadding; - /* - * The following scenarios should be supported: - * - * - There's a message (non-note) between fromActor and toActor - * - If fromActor is on the right and toActor is on the left, we should - * define the toActor's margin - * - If fromActor is on the left and toActor is on the right, we should - * define the fromActor's margin - * - There's a note, in which case fromActor == toActor - * - If the note is to the left of the actor, we should define the previous actor - * margin - * - If the note is on the actor, we should define both the previous and next actor - * margins, each being the half of the note size - * - If the note is on the right of the actor, we should define the current actor - * margin - */ - - if (isMessage && msg.from === actor.nextActor) { - maxMessageWidthPerActor[msg.to] = Math.max(maxMessageWidthPerActor[msg.to] || 0, messageWidth); - } else if (isMessage && msg.from === actor.prevActor) { - maxMessageWidthPerActor[msg.from] = Math.max(maxMessageWidthPerActor[msg.from] || 0, messageWidth); - } else if (isMessage && msg.from === msg.to) { - maxMessageWidthPerActor[msg.from] = Math.max(maxMessageWidthPerActor[msg.from] || 0, messageWidth / 2); - maxMessageWidthPerActor[msg.to] = Math.max(maxMessageWidthPerActor[msg.to] || 0, messageWidth / 2); - } else if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.RIGHTOF) { - maxMessageWidthPerActor[msg.from] = Math.max(maxMessageWidthPerActor[msg.from] || 0, messageWidth); - } else if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.LEFTOF) { - maxMessageWidthPerActor[actor.prevActor] = Math.max(maxMessageWidthPerActor[actor.prevActor] || 0, messageWidth); - } else if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.OVER) { - if (actor.prevActor) { - maxMessageWidthPerActor[actor.prevActor] = Math.max(maxMessageWidthPerActor[actor.prevActor] || 0, messageWidth / 2); - } - - if (actor.nextActor) { - maxMessageWidthPerActor[msg.from] = Math.max(maxMessageWidthPerActor[msg.from] || 0, messageWidth / 2); - } - } - } - }); - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug('maxMessageWidthPerActor:', maxMessageWidthPerActor); - return maxMessageWidthPerActor; -}; -/** - * This will calculate the optimal margin for each given actor, for a given - * actor->messageWidth map. - * - * An actor's margin is determined by the width of the actor, the width of the - * largest message that originates from it, and the configured conf.actorMargin. - * - * @param actors - The actors map to calculate margins for - * @param actorToMessageWidth - A map of actor key -> max message width it holds - */ - - -var calculateActorMargins = function calculateActorMargins(actors, actorToMessageWidth) { - var maxHeight = 0; - Object.keys(actors).forEach(function (prop) { - var actor = actors[prop]; - - if (actor.wrap) { - actor.description = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].wrapLabel(actor.description, conf.width - 2 * conf.wrapPadding, actorFont(conf)); - } - - var actDims = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].calculateTextDimensions(actor.description, actorFont(conf)); - actor.width = actor.wrap ? conf.width : Math.max(conf.width, actDims.width + 2 * conf.wrapPadding); - actor.height = actor.wrap ? Math.max(actDims.height, conf.height) : conf.height; - maxHeight = Math.max(maxHeight, actor.height); - }); - - for (var actorKey in actorToMessageWidth) { - var actor = actors[actorKey]; - - if (!actor) { - continue; - } - - var nextActor = actors[actor.nextActor]; // No need to space out an actor that doesn't have a next link - - if (!nextActor) { - continue; - } - - var messageWidth = actorToMessageWidth[actorKey]; - var actorWidth = messageWidth + conf.actorMargin - actor.width / 2 - nextActor.width / 2; - actor.margin = Math.max(actorWidth, conf.actorMargin); - } - - return Math.max(maxHeight, conf.height); -}; - -var buildNoteModel = function buildNoteModel(msg, actors) { - var startx = actors[msg.from].x; - var stopx = actors[msg.to].x; - var shouldWrap = msg.wrap && msg.message; - var textDimensions = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].calculateTextDimensions(shouldWrap ? _utils__WEBPACK_IMPORTED_MODULE_7__["default"].wrapLabel(msg.message, conf.width, noteFont(conf)) : msg.message, noteFont(conf)); - var noteModel = { - width: shouldWrap ? conf.width : Math.max(conf.width, textDimensions.width + 2 * conf.noteMargin), - height: 0, - startx: actors[msg.from].x, - stopx: 0, - starty: 0, - stopy: 0, - message: msg.message - }; - - if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.RIGHTOF) { - noteModel.width = shouldWrap ? Math.max(conf.width, textDimensions.width) : Math.max(actors[msg.from].width / 2 + actors[msg.to].width / 2, textDimensions.width + 2 * conf.noteMargin); - noteModel.startx = startx + (actors[msg.from].width + conf.actorMargin) / 2; - } else if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.LEFTOF) { - noteModel.width = shouldWrap ? Math.max(conf.width, textDimensions.width + 2 * conf.noteMargin) : Math.max(actors[msg.from].width / 2 + actors[msg.to].width / 2, textDimensions.width + 2 * conf.noteMargin); - noteModel.startx = startx - noteModel.width + (actors[msg.from].width - conf.actorMargin) / 2; - } else if (msg.to === msg.from) { - textDimensions = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].calculateTextDimensions(shouldWrap ? _utils__WEBPACK_IMPORTED_MODULE_7__["default"].wrapLabel(msg.message, Math.max(conf.width, actors[msg.from].width), noteFont(conf)) : msg.message, noteFont(conf)); - noteModel.width = shouldWrap ? Math.max(conf.width, actors[msg.from].width) : Math.max(actors[msg.from].width, conf.width, textDimensions.width + 2 * conf.noteMargin); - noteModel.startx = startx + (actors[msg.from].width - noteModel.width) / 2; - } else { - noteModel.width = Math.abs(startx + actors[msg.from].width / 2 - (stopx + actors[msg.to].width / 2)) + conf.actorMargin; - noteModel.startx = startx < stopx ? startx + actors[msg.from].width / 2 - conf.actorMargin / 2 : stopx + actors[msg.to].width / 2 - conf.actorMargin / 2; - } - - if (shouldWrap) { - noteModel.message = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].wrapLabel(msg.message, noteModel.width - 2 * conf.wrapPadding, noteFont(conf)); - } - - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug("NM:[".concat(noteModel.startx, ",").concat(noteModel.stopx, ",").concat(noteModel.starty, ",").concat(noteModel.stopy, ":").concat(noteModel.width, ",").concat(noteModel.height, "=").concat(msg.message, "]")); - return noteModel; -}; - -var buildMessageModel = function buildMessageModel(msg, actors) { - var process = false; - - if ([_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_CROSS, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_POINT, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_POINT].includes(msg.type)) { - process = true; - } - - if (!process) { - return {}; - } - - var fromBounds = activationBounds(msg.from, actors); - var toBounds = activationBounds(msg.to, actors); - var fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0; - var toIdx = fromBounds[0] < toBounds[0] ? 0 : 1; - var allBounds = fromBounds.concat(toBounds); - var boundedWidth = Math.abs(toBounds[toIdx] - fromBounds[fromIdx]); - - if (msg.wrap && msg.message) { - msg.message = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].wrapLabel(msg.message, Math.max(boundedWidth + 2 * conf.wrapPadding, conf.width), messageFont(conf)); - } - - var msgDims = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].calculateTextDimensions(msg.message, messageFont(conf)); - return { - width: Math.max(msg.wrap ? 0 : msgDims.width + 2 * conf.wrapPadding, boundedWidth + 2 * conf.wrapPadding, conf.width), - height: 0, - startx: fromBounds[fromIdx], - stopx: toBounds[toIdx], - starty: 0, - stopy: 0, - message: msg.message, - type: msg.type, - wrap: msg.wrap, - fromBounds: Math.min.apply(null, allBounds), - toBounds: Math.max.apply(null, allBounds) - }; -}; - -var calculateLoopBounds = function calculateLoopBounds(messages, actors) { - var loops = {}; - var stack = []; - var current, noteModel, msgModel; - messages.forEach(function (msg) { - msg.id = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].random({ - length: 10 - }); - - switch (msg.type) { - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.LOOP_START: - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_START: - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.OPT_START: - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_START: - stack.push({ - id: msg.id, - msg: msg.message, - from: Number.MAX_SAFE_INTEGER, - to: Number.MIN_SAFE_INTEGER, - width: 0 - }); - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_ELSE: - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_AND: - if (msg.message) { - current = stack.pop(); - loops[current.id] = current; - loops[msg.id] = current; - stack.push(current); - } - - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.LOOP_END: - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_END: - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.OPT_END: - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_END: - current = stack.pop(); - loops[current.id] = current; - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ACTIVE_START: - { - var actorRect = actors[msg.from ? msg.from.actor : msg.to.actor]; - var stackedSize = actorActivations(msg.from ? msg.from.actor : msg.to.actor).length; - var x = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf.activationWidth / 2; - var toAdd = { - startx: x, - stopx: x + conf.activationWidth, - actor: msg.from.actor, - enabled: true - }; - bounds.activations.push(toAdd); - } - break; - - case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ACTIVE_END: - { - var lastActorActivationIdx = bounds.activations.map(function (a) { - return a.actor; - }).lastIndexOf(msg.from.actor); - delete bounds.activations.splice(lastActorActivationIdx, 1)[0]; - } - break; - } - - var isNote = msg.placement !== undefined; - - if (isNote) { - noteModel = buildNoteModel(msg, actors); - msg.noteModel = noteModel; - stack.forEach(function (stk) { - current = stk; - current.from = Math.min(current.from, noteModel.startx); - current.to = Math.max(current.to, noteModel.startx + noteModel.width); - current.width = Math.max(current.width, Math.abs(current.from - current.to)) - conf.labelBoxWidth; - }); - } else { - msgModel = buildMessageModel(msg, actors); - msg.msgModel = msgModel; - - if (msgModel.startx && msgModel.stopx && stack.length > 0) { - stack.forEach(function (stk) { - current = stk; - - if (msgModel.startx === msgModel.stopx) { - var from = actors[msg.from]; - var to = actors[msg.to]; - current.from = Math.min(from.x - msgModel.width / 2, from.x - from.width / 2, current.from); - current.to = Math.max(to.x + msgModel.width / 2, to.x + from.width / 2, current.to); - current.width = Math.max(current.width, Math.abs(current.to - current.from)) - conf.labelBoxWidth; - } else { - current.from = Math.min(msgModel.startx, current.from); - current.to = Math.max(msgModel.stopx, current.to); - current.width = Math.max(current.width, msgModel.width) - conf.labelBoxWidth; - } - }); - } - } - }); - bounds.activations = []; - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug('Loop type widths:', loops); - return loops; -}; - -/* harmony default export */ __webpack_exports__["default"] = ({ - bounds: bounds, - drawActors: drawActors, - setConf: setConf, - draw: draw -}); - -/***/ }), - -/***/ "./src/diagrams/sequence/styles.js": -/*!*****************************************!*\ - !*** ./src/diagrams/sequence/styles.js ***! - \*****************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -var getStyles = function getStyles(options) { - return ".actor {\n stroke: ".concat(options.actorBorder, ";\n fill: ").concat(options.actorBkg, ";\n }\n\n text.actor > tspan {\n fill: ").concat(options.actorTextColor, ";\n stroke: none;\n }\n\n .actor-line {\n stroke: ").concat(options.actorLineColor, ";\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ").concat(options.signalColor, ";\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ").concat(options.signalColor, ";\n }\n\n #arrowhead path {\n fill: ").concat(options.signalColor, ";\n stroke: ").concat(options.signalColor, ";\n }\n\n .sequenceNumber {\n fill: ").concat(options.sequenceNumberColor, ";\n }\n\n #sequencenumber {\n fill: ").concat(options.signalColor, ";\n }\n\n #crosshead path {\n fill: ").concat(options.signalColor, ";\n stroke: ").concat(options.signalColor, ";\n }\n\n .messageText {\n fill: ").concat(options.signalTextColor, ";\n stroke: ").concat(options.signalTextColor, ";\n }\n\n .labelBox {\n stroke: ").concat(options.labelBoxBorderColor, ";\n fill: ").concat(options.labelBoxBkgColor, ";\n }\n\n .labelText, .labelText > tspan {\n fill: ").concat(options.labelTextColor, ";\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ").concat(options.loopTextColor, ";\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ").concat(options.labelBoxBorderColor, ";\n fill: ").concat(options.labelBoxBorderColor, ";\n }\n\n .note {\n //stroke: #decc93;\n stroke: ").concat(options.noteBorderColor, ";\n fill: ").concat(options.noteBkgColor, ";\n }\n\n .noteText, .noteText > tspan {\n fill: ").concat(options.noteTextColor, ";\n stroke: none;\n }\n\n .activation0 {\n fill: ").concat(options.activationBkgColor, ";\n stroke: ").concat(options.activationBorderColor, ";\n }\n\n .activation1 {\n fill: ").concat(options.activationBkgColor, ";\n stroke: ").concat(options.activationBorderColor, ";\n }\n\n .activation2 {\n fill: ").concat(options.activationBkgColor, ";\n stroke: ").concat(options.activationBorderColor, ";\n }\n"); -}; - -/* harmony default export */ __webpack_exports__["default"] = (getStyles); - -/***/ }), - -/***/ "./src/diagrams/sequence/svgDraw.js": -/*!******************************************!*\ - !*** ./src/diagrams/sequence/svgDraw.js ***! - \******************************************/ -/*! exports provided: drawRect, drawText, drawLabel, drawActor, anchorElement, drawActivation, drawLoop, drawBackgroundRect, insertArrowHead, insertArrowFilledHead, insertSequenceNumber, insertArrowCrossHead, getTextObj, getNoteRect, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawRect", function() { return drawRect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawText", function() { return drawText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawLabel", function() { return drawLabel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawActor", function() { return drawActor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "anchorElement", function() { return anchorElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawActivation", function() { return drawActivation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawLoop", function() { return drawLoop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawBackgroundRect", function() { return drawBackgroundRect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrowHead", function() { return insertArrowHead; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrowFilledHead", function() { return insertArrowFilledHead; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertSequenceNumber", function() { return insertSequenceNumber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrowCrossHead", function() { return insertArrowCrossHead; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextObj", function() { return getTextObj; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNoteRect", function() { return getNoteRect; }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); - -var drawRect = function drawRect(elem, rectData) { - var rectElem = elem.append('rect'); - rectElem.attr('x', rectData.x); - rectElem.attr('y', rectData.y); - rectElem.attr('fill', rectData.fill); - rectElem.attr('stroke', rectData.stroke); - rectElem.attr('width', rectData.width); - rectElem.attr('height', rectData.height); - rectElem.attr('rx', rectData.rx); - rectElem.attr('ry', rectData.ry); - - if (typeof rectData.class !== 'undefined') { - rectElem.attr('class', rectData.class); - } - - return rectElem; -}; -var drawText = function drawText(elem, textData) { - var prevTextHeight = 0, - textHeight = 0; - var lines = textData.text.split(_common_common__WEBPACK_IMPORTED_MODULE_0__["default"].lineBreakRegex); - var textElems = []; - var dy = 0; - - var yfunc = function yfunc() { - return textData.y; - }; - - if (typeof textData.valign !== 'undefined' && typeof textData.textMargin !== 'undefined' && textData.textMargin > 0) { - switch (textData.valign) { - case 'top': - case 'start': - yfunc = function yfunc() { - return Math.round(textData.y + textData.textMargin); - }; - - break; - - case 'middle': - case 'center': - yfunc = function yfunc() { - return Math.round(textData.y + (prevTextHeight + textHeight + textData.textMargin) / 2); - }; - - break; - - case 'bottom': - case 'end': - yfunc = function yfunc() { - return Math.round(textData.y + (prevTextHeight + textHeight + 2 * textData.textMargin) - textData.textMargin); - }; - - break; - } - } - - if (typeof textData.anchor !== 'undefined' && typeof textData.textMargin !== 'undefined' && typeof textData.width !== 'undefined') { - switch (textData.anchor) { - case 'left': - case 'start': - textData.x = Math.round(textData.x + textData.textMargin); - textData.anchor = 'start'; - textData.dominantBaseline = 'text-after-edge'; - textData.alignmentBaseline = 'middle'; - break; - - case 'middle': - case 'center': - textData.x = Math.round(textData.x + textData.width / 2); - textData.anchor = 'middle'; - textData.dominantBaseline = 'middle'; - textData.alignmentBaseline = 'middle'; - break; - - case 'right': - case 'end': - textData.x = Math.round(textData.x + textData.width - textData.textMargin); - textData.anchor = 'end'; - textData.dominantBaseline = 'text-before-edge'; - textData.alignmentBaseline = 'middle'; - break; - } - } - - for (var i = 0; i < lines.length; i++) { - var line = lines[i]; - - if (typeof textData.textMargin !== 'undefined' && textData.textMargin === 0 && typeof textData.fontSize !== 'undefined') { - dy = i * textData.fontSize; - } - - var textElem = elem.append('text'); - textElem.attr('x', textData.x); - textElem.attr('y', yfunc()); - - if (typeof textData.anchor !== 'undefined') { - textElem.attr('text-anchor', textData.anchor).attr('dominant-baseline', textData.dominantBaseline).attr('alignment-baseline', textData.alignmentBaseline); - } - - if (typeof textData.fontFamily !== 'undefined') { - textElem.style('font-family', textData.fontFamily); - } - - if (typeof textData.fontSize !== 'undefined') { - textElem.style('font-size', textData.fontSize); - } - - if (typeof textData.fontWeight !== 'undefined') { - textElem.style('font-weight', textData.fontWeight); - } - - if (typeof textData.fill !== 'undefined') { - textElem.attr('fill', textData.fill); - } - - if (typeof textData.class !== 'undefined') { - textElem.attr('class', textData.class); - } - - if (typeof textData.dy !== 'undefined') { - textElem.attr('dy', textData.dy); - } else if (dy !== 0) { - textElem.attr('dy', dy); - } - - if (textData.tspan) { - var span = textElem.append('tspan'); - span.attr('x', textData.x); - - if (typeof textData.fill !== 'undefined') { - span.attr('fill', textData.fill); - } - - span.text(line); - } else { - textElem.text(line); - } - - if (typeof textData.valign !== 'undefined' && typeof textData.textMargin !== 'undefined' && textData.textMargin > 0) { - textHeight += (textElem._groups || textElem)[0][0].getBBox().height; - prevTextHeight = textHeight; - } - - textElems.push(textElem); - } - - return textElems; -}; -var drawLabel = function drawLabel(elem, txtObject) { - function genPoints(x, y, width, height, cut) { - return x + ',' + y + ' ' + (x + width) + ',' + y + ' ' + (x + width) + ',' + (y + height - cut) + ' ' + (x + width - cut * 1.2) + ',' + (y + height) + ' ' + x + ',' + (y + height); - } - - var polygon = elem.append('polygon'); - polygon.attr('points', genPoints(txtObject.x, txtObject.y, txtObject.width, txtObject.height, 7)); - polygon.attr('class', 'labelBox'); - txtObject.y = txtObject.y + txtObject.height / 2; - drawText(elem, txtObject); - return polygon; -}; -var actorCnt = -1; -/** - * Draws an actor in the diagram with the attached line - * @param elem - The diagram we'll draw to. - * @param actor - The actor to draw. - * @param conf - drawText implementation discriminator object - */ - -var drawActor = function drawActor(elem, actor, conf) { - var center = actor.x + actor.width / 2; - var g = elem.append('g'); - - if (actor.y === 0) { - actorCnt++; - g.append('line').attr('id', 'actor' + actorCnt).attr('x1', center).attr('y1', 5).attr('x2', center).attr('y2', 2000).attr('class', 'actor-line').attr('stroke-width', '0.5px').attr('stroke', '#999'); - } - - var rect = getNoteRect(); - rect.x = actor.x; - rect.y = actor.y; - rect.fill = '#eaeaea'; - rect.width = actor.width; - rect.height = actor.height; - rect.class = 'actor'; - rect.rx = 3; - rect.ry = 3; - drawRect(g, rect); - - _drawTextCandidateFunc(conf)(actor.description, g, rect.x, rect.y, rect.width, rect.height, { - class: 'actor' - }, conf); -}; -var anchorElement = function anchorElement(elem) { - return elem.append('g'); -}; -/** - * Draws an activation in the diagram - * @param elem - element to append activation rect. - * @param bounds - activation box bounds. - * @param verticalPos - precise y cooridnate of bottom activation box edge. - * @param conf - sequence diagram config object. - * @param actorActivations - number of activations on the actor. - */ - -var drawActivation = function drawActivation(elem, bounds, verticalPos, conf, actorActivations) { - var rect = getNoteRect(); - var g = bounds.anchored; - rect.x = bounds.startx; - rect.y = bounds.starty; - rect.class = 'activation' + actorActivations % 3; // Will evaluate to 0, 1 or 2 - - rect.width = bounds.stopx - bounds.startx; - rect.height = verticalPos - bounds.starty; - drawRect(g, rect); -}; -/** - * Draws a loop in the diagram - * @param elem - elemenet to append the loop to. - * @param loopModel - loopModel of the given loop. - * @param labelText - Text within the loop. - * @param conf - diagrom configuration - */ - -var drawLoop = function drawLoop(elem, loopModel, labelText, conf) { - var boxMargin = conf.boxMargin, - boxTextMargin = conf.boxTextMargin, - labelBoxHeight = conf.labelBoxHeight, - labelBoxWidth = conf.labelBoxWidth, - fontFamily = conf.messageFontFamily, - fontSize = conf.messageFontSize, - fontWeight = conf.messageFontWeight; - var g = elem.append('g'); - - var drawLoopLine = function drawLoopLine(startx, starty, stopx, stopy) { - return g.append('line').attr('x1', startx).attr('y1', starty).attr('x2', stopx).attr('y2', stopy).attr('class', 'loopLine'); - }; - - drawLoopLine(loopModel.startx, loopModel.starty, loopModel.stopx, loopModel.starty); - drawLoopLine(loopModel.stopx, loopModel.starty, loopModel.stopx, loopModel.stopy); - drawLoopLine(loopModel.startx, loopModel.stopy, loopModel.stopx, loopModel.stopy); - drawLoopLine(loopModel.startx, loopModel.starty, loopModel.startx, loopModel.stopy); - - if (typeof loopModel.sections !== 'undefined') { - loopModel.sections.forEach(function (item) { - drawLoopLine(loopModel.startx, item.y, loopModel.stopx, item.y).style('stroke-dasharray', '3, 3'); - }); - } - - var txt = getTextObj(); - txt.text = labelText; - txt.x = loopModel.startx; - txt.y = loopModel.starty; - txt.fontFamily = fontFamily; - txt.fontSize = fontSize; - txt.fontWeight = fontWeight; - txt.anchor = 'middle'; - txt.valign = 'middle'; - txt.tspan = false; - txt.width = labelBoxWidth || 50; - txt.height = labelBoxHeight || 20; - txt.textMargin = boxTextMargin; - txt.class = 'labelText'; - drawLabel(g, txt); - txt = getTextObj(); - txt.text = loopModel.title; - txt.x = loopModel.startx + labelBoxWidth / 2 + (loopModel.stopx - loopModel.startx) / 2; - txt.y = loopModel.starty + boxMargin + boxTextMargin; - txt.anchor = 'middle'; - txt.valign = 'middle'; - txt.textMargin = boxTextMargin; - txt.class = 'loopText'; - txt.fontFamily = fontFamily; - txt.fontSize = fontSize; - txt.fontWeight = fontWeight; - txt.wrap = true; - var textElem = drawText(g, txt); - - if (typeof loopModel.sectionTitles !== 'undefined') { - loopModel.sectionTitles.forEach(function (item, idx) { - if (item.message) { - txt.text = item.message; - txt.x = loopModel.startx + (loopModel.stopx - loopModel.startx) / 2; - txt.y = loopModel.sections[idx].y + boxMargin + boxTextMargin; - txt.class = 'loopText'; - txt.anchor = 'middle'; - txt.valign = 'middle'; - txt.tspan = false; - txt.fontFamily = fontFamily; - txt.fontSize = fontSize; - txt.fontWeight = fontWeight; - txt.wrap = loopModel.wrap; - textElem = drawText(g, txt); - var sectionHeight = Math.round(textElem.map(function (te) { - return (te._groups || te)[0][0].getBBox().height; - }).reduce(function (acc, curr) { - return acc + curr; - })); - loopModel.sections[idx].height += sectionHeight - (boxMargin + boxTextMargin); - } - }); - } - - loopModel.height = Math.round(loopModel.stopy - loopModel.starty); - return g; -}; -/** - * Draws a background rectangle - * @param elem diagram (reference for bounds) - * @param bounds shape of the rectangle - */ - -var drawBackgroundRect = function drawBackgroundRect(elem, bounds) { - var rectElem = drawRect(elem, { - x: bounds.startx, - y: bounds.starty, - width: bounds.stopx - bounds.startx, - height: bounds.stopy - bounds.starty, - fill: bounds.fill, - class: 'rect' - }); - rectElem.lower(); -}; -/** - * Setup arrow head and define the marker. The result is appended to the svg. - */ - -var insertArrowHead = function insertArrowHead(elem) { - elem.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 12).attr('markerHeight', 12).attr('orient', 'auto').append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z'); // this is actual shape for arrowhead -}; -/** - * Setup arrow head and define the marker. The result is appended to the svg. - */ - -var insertArrowFilledHead = function insertArrowFilledHead(elem) { - elem.append('defs').append('marker').attr('id', 'filled-head').attr('refX', 18).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z'); -}; -/** - * Setup node number. The result is appended to the svg. - */ - -var insertSequenceNumber = function insertSequenceNumber(elem) { - elem.append('defs').append('marker').attr('id', 'sequencenumber').attr('refX', 15).attr('refY', 15).attr('markerWidth', 60).attr('markerHeight', 40).attr('orient', 'auto').append('circle').attr('cx', 15).attr('cy', 15).attr('r', 6); // .style("fill", '#f00'); -}; -/** - * Setup arrow head and define the marker. The result is appended to the svg. - */ - -var insertArrowCrossHead = function insertArrowCrossHead(elem) { - var defs = elem.append('defs'); - var marker = defs.append('marker').attr('id', 'crosshead').attr('markerWidth', 15).attr('markerHeight', 8).attr('orient', 'auto').attr('refX', 16).attr('refY', 4); // The arrow - - marker.append('path').attr('fill', 'black').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 9,2 V 6 L16,4 Z'); // The cross - - marker.append('path').attr('fill', 'none').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 0,1 L 6,7 M 6,1 L 0,7'); // this is actual shape for arrowhead -}; -var getTextObj = function getTextObj() { - return { - x: 0, - y: 0, - fill: undefined, - anchor: undefined, - style: '#666', - width: undefined, - height: undefined, - textMargin: 0, - rx: 0, - ry: 0, - tspan: true, - valign: undefined - }; -}; -var getNoteRect = function getNoteRect() { - return { - x: 0, - y: 0, - fill: '#EDF2AE', - stroke: '#666', - width: 100, - anchor: 'start', - height: 100, - rx: 0, - ry: 0 - }; -}; - -var _drawTextCandidateFunc = function () { - function byText(content, g, x, y, width, height, textAttrs) { - var text = g.append('text').attr('x', x + width / 2).attr('y', y + height / 2 + 5).style('text-anchor', 'middle').text(content); - - _setTextAttrs(text, textAttrs); - } - - function byTspan(content, g, x, y, width, height, textAttrs, conf) { - var actorFontSize = conf.actorFontSize, - actorFontFamily = conf.actorFontFamily, - actorFontWeight = conf.actorFontWeight; - var lines = content.split(_common_common__WEBPACK_IMPORTED_MODULE_0__["default"].lineBreakRegex); - - for (var i = 0; i < lines.length; i++) { - var dy = i * actorFontSize - actorFontSize * (lines.length - 1) / 2; - var text = g.append('text').attr('x', x + width / 2).attr('y', y).style('text-anchor', 'middle').style('font-size', actorFontSize).style('font-weight', actorFontWeight).style('font-family', actorFontFamily); - text.append('tspan').attr('x', x + width / 2).attr('dy', dy).text(lines[i]); - text.attr('y', y + height / 2.0).attr('dominant-baseline', 'central').attr('alignment-baseline', 'central'); - - _setTextAttrs(text, textAttrs); - } - } - - function byFo(content, g, x, y, width, height, textAttrs, conf) { - var s = g.append('switch'); - var f = s.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height); - var text = f.append('div').style('display', 'table').style('height', '100%').style('width', '100%'); - text.append('div').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle').text(content); - byTspan(content, s, x, y, width, height, textAttrs, conf); - - _setTextAttrs(text, textAttrs); - } - - function _setTextAttrs(toText, fromTextAttrsDict) { - for (var key in fromTextAttrsDict) { - if (fromTextAttrsDict.hasOwnProperty(key)) { - // eslint-disable-line - toText.attr(key, fromTextAttrsDict[key]); - } - } - } - - return function (conf) { - return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan; - }; -}(); - -/* harmony default export */ __webpack_exports__["default"] = ({ - drawRect: drawRect, - drawText: drawText, - drawLabel: drawLabel, - drawActor: drawActor, - anchorElement: anchorElement, - drawActivation: drawActivation, - drawLoop: drawLoop, - drawBackgroundRect: drawBackgroundRect, - insertArrowHead: insertArrowHead, - insertArrowFilledHead: insertArrowFilledHead, - insertSequenceNumber: insertSequenceNumber, - insertArrowCrossHead: insertArrowCrossHead, - getTextObj: getTextObj, - getNoteRect: getNoteRect -}); - -/***/ }), - -/***/ "./src/diagrams/state/id-cache.js": -/*!****************************************!*\ - !*** ./src/diagrams/state/id-cache.js ***! - \****************************************/ -/*! exports provided: set, get, keys, size, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return get; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return keys; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "size", function() { return size; }); -var idCache = {}; -var set = function set(key, val) { - idCache[key] = val; -}; -var get = function get(k) { - return idCache[k]; -}; -var keys = function keys() { - return Object.keys(idCache); -}; -var size = function size() { - return keys().length; -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - get: get, - set: set, - keys: keys, - size: size -}); - -/***/ }), - -/***/ "./src/diagrams/state/parser/stateDiagram.jison": -/*!******************************************************!*\ - !*** ./src/diagrams/state/parser/stateDiagram.jison ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,28],$Vc=[1,23],$Vd=[1,24],$Ve=[1,25],$Vf=[1,26],$Vg=[1,29],$Vh=[1,32],$Vi=[1,4,5,14,15,17,19,20,22,23,24,25,26,36,39],$Vj=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,36,39],$Vk=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,36,39],$Vl=[4,5,14,15,17,19,20,22,23,24,25,26,36,39]; -var parser = {trace: function trace () { }, -yy: {}, -symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"idStatement":11,"DESCR":12,"-->":13,"HIDE_EMPTY":14,"scale":15,"WIDTH":16,"COMPOSIT_STATE":17,"STRUCT_START":18,"STRUCT_STOP":19,"STATE_DESCR":20,"AS":21,"ID":22,"FORK":23,"JOIN":24,"CONCURRENT":25,"note":26,"notePosition":27,"NOTE_TEXT":28,"openDirective":29,"typeDirective":30,"closeDirective":31,":":32,"argDirective":33,"eol":34,";":35,"EDGE_STATE":36,"left_of":37,"right_of":38,"open_directive":39,"type_directive":40,"arg_directive":41,"close_directive":42,"$accept":0,"$end":1}, -terminals_: {2:"error",4:"SPACE",5:"NL",7:"SD",12:"DESCR",13:"-->",14:"HIDE_EMPTY",15:"scale",16:"WIDTH",17:"COMPOSIT_STATE",18:"STRUCT_START",19:"STRUCT_STOP",20:"STATE_DESCR",21:"AS",22:"ID",23:"FORK",24:"JOIN",25:"CONCURRENT",26:"note",28:"NOTE_TEXT",32:":",35:";",36:"EDGE_STATE",37:"left_of",38:"right_of",39:"open_directive",40:"type_directive",41:"arg_directive",42:"close_directive"}, -productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[6,3],[6,5],[34,1],[34,1],[11,1],[11,1],[27,1],[27,1],[29,1],[30,1],[33,1],[31,1]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 4: - /*console.warn('Root document', $$[$0]);*/ yy.setRootDoc($$[$0]);return $$[$0]; -break; -case 5: - this.$ = [] -break; -case 6: - - if($$[$0]!='nl'){ - $$[$0-1].push($$[$0]);this.$ = $$[$0-1] - } - // console.warn('Got document',$$[$0-1], $$[$0]); - -break; -case 7: case 8: - this.$ = $$[$0] -break; -case 9: - this.$='nl'; -break; -case 10: - /*console.warn('got id and descr', $$[$0]);*/this.$={ stmt: 'state', id: $$[$0], type: 'default', description: ''}; -break; -case 11: - /*console.warn('got id and descr', $$[$0-1], $$[$0].trim());*/this.$={ stmt: 'state', id: $$[$0-1], type: 'default', description: yy.trimColon($$[$0])}; -break; -case 12: - - /*console.warn('got id', $$[$0-2]);yy.addRelation($$[$0-2], $$[$0]);*/ - this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-2], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0] ,type: 'default', description: ''}}; - -break; -case 13: - - /*yy.addRelation($$[$0-3], $$[$0-1], $$[$0].substr(1).trim());*/ - this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-3], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0-1] ,type: 'default', description: ''}, description: $$[$0].substr(1).trim()}; - -break; -case 17: - - - /* console.warn('Adding document for state without id ', $$[$0-3]);*/ - this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: '', doc: $$[$0-1] } - -break; -case 18: - - var id=$$[$0]; - var description = $$[$0-2].trim(); - if($$[$0].match(':')){ - var parts = $$[$0].split(':'); - id=parts[0]; - description = [description, parts[1]]; - } - this.$={stmt: 'state', id: id, type: 'default', description: description}; - - -break; -case 19: - - //console.warn('Adding document for state with id ', $$[$0-3], $$[$0-2]); yy.addDocument($$[$0-3]); - this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: $$[$0-5], doc: $$[$0-1] } - -break; -case 20: - - this.$={ stmt: 'state', id: $$[$0], type: 'fork' } - -break; -case 21: - - this.$={ stmt: 'state', id: $$[$0], type: 'join' } - -break; -case 22: - - this.$={ stmt: 'state', id: yy.getDividerId(), type: 'divider' } - -break; -case 23: - - /*console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/ - this.$={ stmt: 'state', id: $$[$0-1].trim(), note:{position: $$[$0-2].trim(), text: $$[$0].trim()}}; - -break; -case 30: case 31: -this.$=$$[$0]; -break; -case 34: - yy.parseDirective('%%{', 'open_directive'); -break; -case 35: - yy.parseDirective($$[$0], 'type_directive'); -break; -case 36: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); -break; -case 37: - yy.parseDirective('}%%', 'close_directive', 'state'); -break; -} -}, -table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,29:6,39:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,29:6,39:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,29:6,39:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,29:6,39:$V3},o([1,4,5,14,15,17,20,22,23,24,25,26,36,39],$V4,{8:11}),{30:12,40:[1,13]},{40:[2,34]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:27,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,29:6,36:$Vg,39:$V3},{31:30,32:[1,31],42:$Vh},o([32,42],[2,35]),o($Vi,[2,6]),{6:27,10:33,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,29:6,36:$Vg,39:$V3},o($Vi,[2,8]),o($Vi,[2,9]),o($Vi,[2,10],{12:[1,34],13:[1,35]}),o($Vi,[2,14]),{16:[1,36]},o($Vi,[2,16],{18:[1,37]}),{21:[1,38]},o($Vi,[2,20]),o($Vi,[2,21]),o($Vi,[2,22]),{27:39,28:[1,40],37:[1,41],38:[1,42]},o($Vi,[2,25]),o($Vj,[2,30]),o($Vj,[2,31]),o($Vk,[2,26]),{33:43,41:[1,44]},o($Vk,[2,37]),o($Vi,[2,7]),o($Vi,[2,11]),{11:45,22:$Vb,36:$Vg},o($Vi,[2,15]),o($Vl,$V4,{8:46}),{22:[1,47]},{22:[1,48]},{21:[1,49]},{22:[2,32]},{22:[2,33]},{31:50,42:$Vh},{42:[2,36]},o($Vi,[2,12],{12:[1,51]}),{4:$V5,5:$V6,6:27,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,52],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,29:6,36:$Vg,39:$V3},o($Vi,[2,18],{18:[1,53]}),{28:[1,54]},{22:[1,55]},o($Vk,[2,27]),o($Vi,[2,13]),o($Vi,[2,17]),o($Vl,$V4,{8:56}),o($Vi,[2,23]),o($Vi,[2,24]),{4:$V5,5:$V6,6:27,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,57],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,29:6,36:$Vg,39:$V3},o($Vi,[2,19])], -defaultActions: {7:[2,34],8:[2,1],9:[2,2],10:[2,3],41:[2,32],42:[2,33],44:[2,36]}, -parseError: function parseError (str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - var error = new Error(str); - error.hash = hash; - throw error; - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = tstack.pop() || lexer.lex() || EOF; - if (typeof token !== 'number') { - if (token instanceof Array) { - tstack = token; - token = tstack.pop(); - } - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; - -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function(match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex () { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin (condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState () { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules () { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState (n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState (condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {"case-insensitive":true}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0: this.begin('open_directive'); return 39; -break; -case 1: this.begin('type_directive'); return 40; -break; -case 2: this.popState(); this.begin('arg_directive'); return 32; -break; -case 3: this.popState(); this.popState(); return 42; -break; -case 4:return 41; -break; -case 5:/* skip comments */ -break; -case 6:/* skip comments */{ console.log('Crap after close'); } -break; -case 7:return 5; -break; -case 8:/* skip all whitespace */ -break; -case 9:/* skip same-line whitespace */ -break; -case 10:/* skip comments */ -break; -case 11:/* skip comments */ -break; -case 12: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 15; -break; -case 13:return 16; -break; -case 14:this.popState(); -break; -case 15: this.pushState('STATE'); -break; -case 16:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 23; -break; -case 17:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24; -break; -case 18:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 23; -break; -case 19:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24; -break; -case 20:this.begin("STATE_STRING"); -break; -case 21:this.popState();this.pushState('STATE_ID');return "AS"; -break; -case 22:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return "ID"; -break; -case 23:this.popState(); -break; -case 24: /*console.log('Long description:', yy_.yytext);*/return "STATE_DESCR"; -break; -case 25:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 17; -break; -case 26:this.popState(); -break; -case 27:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 18; -break; -case 28: /*console.log('Ending struct');*/ this.popState(); return 19; -break; -case 29:/* nothing */ -break; -case 30: this.begin('NOTE'); return 26; -break; -case 31: this.popState();this.pushState('NOTE_ID');return 37; -break; -case 32: this.popState();this.pushState('NOTE_ID');return 38; -break; -case 33: this.popState();this.pushState('FLOATING_NOTE'); -break; -case 34:this.popState();this.pushState('FLOATING_NOTE_ID');return "AS"; -break; -case 35:/**/ -break; -case 36: /*console.log('Floating note text: ', yy_.yytext);*/return "NOTE_TEXT"; -break; -case 37:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return "ID"; -break; -case 38: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 22; -break; -case 39: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 28; -break; -case 40: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 28; -break; -case 41: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; -break; -case 42: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; -break; -case 43: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 14; -break; -case 44: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 36; -break; -case 45: /*console.log('=>ID=',yy_.yytext);*/ return 22; -break; -case 46: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 12; -break; -case 47:return 13; -break; -case 48:return 25; -break; -case 49:return 5; -break; -case 50:return 'INVALID'; -break; -} -}, -rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i], -conditions: {"LINE":{"rules":[9,10],"inclusive":false},"close_directive":{"rules":[9,10],"inclusive":false},"arg_directive":{"rules":[3,4,9,10],"inclusive":false},"type_directive":{"rules":[2,3,9,10],"inclusive":false},"open_directive":{"rules":[1,9,10],"inclusive":false},"struct":{"rules":[9,10,15,28,29,30,44,45,46,47,48],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[37],"inclusive":false},"FLOATING_NOTE":{"rules":[34,35,36],"inclusive":false},"NOTE_TEXT":{"rules":[39,40],"inclusive":false},"NOTE_ID":{"rules":[38],"inclusive":false},"NOTE":{"rules":[31,32,33],"inclusive":false},"SCALE":{"rules":[13,14],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[22],"inclusive":false},"STATE_STRING":{"rules":[23,24],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[9,10,16,17,18,19,20,21,25,26,27],"inclusive":false},"ID":{"rules":[9,10],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,10,11,12,15,27,30,41,42,43,44,45,46,47,49,50],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (true) { -exports.parser = parser; -exports.Parser = parser.Parser; -exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain (args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if ( true && __webpack_require__.c[__webpack_require__.s] === module) { - exports.main(process.argv.slice(1)); -} -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./src/diagrams/state/shapes.js": -/*!**************************************!*\ - !*** ./src/diagrams/state/shapes.js ***! - \**************************************/ -/*! exports provided: drawStartState, drawDivider, drawSimpleState, drawDescrState, addTitleAndBox, drawText, drawNote, drawState, drawEdge */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawStartState", function() { return drawStartState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawDivider", function() { return drawDivider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawSimpleState", function() { return drawSimpleState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawDescrState", function() { return drawDescrState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTitleAndBox", function() { return addTitleAndBox; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawText", function() { return drawText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawNote", function() { return drawNote; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawState", function() { return drawState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawEdge", function() { return drawEdge; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _id_cache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./id-cache.js */ "./src/diagrams/state/id-cache.js"); -/* harmony import */ var _stateDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stateDb */ "./src/diagrams/state/stateDb.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); - - - - - - - // let conf; - -/** - * Draws a start state as a black circle - */ - -var drawStartState = function drawStartState(g) { - return g.append('circle') // .style('stroke', 'black') - // .style('fill', 'black') - .attr('class', 'start-state').attr('r', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.sizeUnit).attr('cx', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.sizeUnit).attr('cy', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.sizeUnit); -}; -/** - * Draws a start state as a black circle - */ - -var drawDivider = function drawDivider(g) { - return g.append('line').style('stroke', 'grey').style('stroke-dasharray', '3').attr('x1', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.textHeight).attr('class', 'divider').attr('x2', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.textHeight * 2).attr('y1', 0).attr('y2', 0); -}; -/** - * Draws a an end state as a black circle - */ - -var drawSimpleState = function drawSimpleState(g, stateDef) { - var state = g.append('text').attr('x', 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.textHeight + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('font-size', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.fontSize).attr('class', 'state-title').text(stateDef.id); - var classBox = state.node().getBBox(); - g.insert('rect', ':first-child').attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('width', classBox.width + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('height', classBox.height + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.radius); - return state; -}; -/** - * Draws a state with descriptions - * @param {*} g - * @param {*} stateDef - */ - -var drawDescrState = function drawDescrState(g, stateDef) { - var addTspan = function addTspan(textEl, txt, isFirst) { - var tSpan = textEl.append('tspan').attr('x', 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).text(txt); - - if (!isFirst) { - tSpan.attr('dy', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.textHeight); - } - }; - - var title = g.append('text').attr('x', 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.textHeight + 1.3 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('font-size', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.fontSize).attr('class', 'state-title').text(stateDef.descriptions[0]); - var titleBox = title.node().getBBox(); - var titleHeight = titleBox.height; - var description = g.append('text') // text label for the x axis - .attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('y', titleHeight + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding * 0.4 + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.dividerMargin + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.textHeight).attr('class', 'state-description'); - var isFirst = true; - var isSecond = true; - stateDef.descriptions.forEach(function (descr) { - if (!isFirst) { - addTspan(description, descr, isSecond); - isSecond = false; - } - - isFirst = false; - }); - var descrLine = g.append('line') // text label for the x axis - .attr('x1', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('y1', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding + titleHeight + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.dividerMargin / 2).attr('y2', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding + titleHeight + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.dividerMargin / 2).attr('class', 'descr-divider'); - var descrBox = description.node().getBBox(); - var width = Math.max(descrBox.width, titleBox.width); - descrLine.attr('x2', width + 3 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding); // const classBox = title.node().getBBox(); - - g.insert('rect', ':first-child').attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('width', width + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('height', descrBox.height + titleHeight + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.radius); - return g; -}; -/** - * Adds the creates a box around the existing content and adds a - * panel for the id on top of the content. - */ - -/** - * Function that creates an title row and a frame around a substate for a composit state diagram. - * The function returns a new d3 svg object with updated width and height properties; - * @param {*} g The d3 svg object for the substate to framed - * @param {*} stateDef The info about the - */ - -var addTitleAndBox = function addTitleAndBox(g, stateDef, altBkg) { - var pad = Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding; - var dblPad = 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding; - var orgBox = g.node().getBBox(); - var orgWidth = orgBox.width; - var orgX = orgBox.x; - var title = g.append('text').attr('x', 0).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.titleShift).attr('font-size', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.fontSize).attr('class', 'state-title').text(stateDef.id); - var titleBox = title.node().getBBox(); - var titleWidth = titleBox.width + dblPad; - var width = Math.max(titleWidth, orgWidth); // + dblPad; - - if (width === orgWidth) { - width = width + dblPad; - } - - var startX; // const lineY = 1 - getConfig().state.textHeight; - // const descrLine = g - // .append('line') // text label for the x axis - // .attr('x1', 0) - // .attr('y1', lineY) - // .attr('y2', lineY) - // .attr('class', 'descr-divider'); - - var graphBox = g.node().getBBox(); // descrLine.attr('x2', graphBox.width + getConfig().state.padding); - - if (stateDef.doc) {// cnsole.warn( - // stateDef.id, - // 'orgX: ', - // orgX, - // 'width: ', - // width, - // 'titleWidth: ', - // titleWidth, - // 'orgWidth: ', - // orgWidth, - // 'width', - // width - // ); - } - - startX = orgX - pad; - - if (titleWidth > orgWidth) { - startX = (orgWidth - width) / 2 + pad; - } - - if (Math.abs(orgX - graphBox.x) < pad) { - if (titleWidth > orgWidth) { - startX = orgX - (titleWidth - orgWidth) / 2; - } - } - - var lineY = 1 - Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.textHeight; // White color - - g.insert('rect', ':first-child').attr('x', startX).attr('y', lineY).attr('class', altBkg ? 'alt-composit' : 'composit').attr('width', width).attr('height', graphBox.height + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.textHeight + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.titleShift + 1).attr('rx', '0'); - title.attr('x', startX + pad); - if (titleWidth <= orgWidth) title.attr('x', orgX + (width - dblPad) / 2 - titleWidth / 2 + pad); // Title background - - g.insert('rect', ':first-child').attr('x', startX).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.titleShift - Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.textHeight - Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('width', width) // Just needs to be higher then the descr line, will be clipped by the white color box - .attr('height', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.textHeight * 3).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.radius); // Full background - - g.insert('rect', ':first-child').attr('x', startX).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.titleShift - Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.textHeight - Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('width', width).attr('height', graphBox.height + 3 + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.textHeight).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.radius); - return g; -}; - -var drawEndState = function drawEndState(g) { - g.append('circle') // .style('stroke', 'black') - // .style('fill', 'white') - .attr('class', 'end-state-outer').attr('r', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.sizeUnit + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.miniPadding).attr('cx', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.sizeUnit + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.miniPadding).attr('cy', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.sizeUnit + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.miniPadding); - return g.append('circle') // .style('stroke', 'black') - // .style('fill', 'black') - .attr('class', 'end-state-inner').attr('r', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.sizeUnit).attr('cx', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.sizeUnit + 2).attr('cy', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.sizeUnit + 2); -}; - -var drawForkJoinState = function drawForkJoinState(g, stateDef) { - var width = Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.forkWidth; - var height = Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.forkHeight; - - if (stateDef.parentId) { - var tmp = width; - width = height; - height = tmp; - } - - return g.append('rect').style('stroke', 'black').style('fill', 'black').attr('width', width).attr('height', height).attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding); -}; - -var drawText = function drawText(elem, textData) { - // Remove and ignore br:s - var nText = textData.text.replace(_common_common__WEBPACK_IMPORTED_MODULE_4__["default"].lineBreakRegex, ' '); - var textElem = elem.append('text'); - textElem.attr('x', textData.x); - textElem.attr('y', textData.y); - textElem.style('text-anchor', textData.anchor); - textElem.attr('fill', textData.fill); - - if (typeof textData.class !== 'undefined') { - textElem.attr('class', textData.class); - } - - var span = textElem.append('tspan'); - span.attr('x', textData.x + textData.textMargin * 2); - span.attr('fill', textData.fill); - span.text(nText); - return textElem; -}; - -var _drawLongText = function _drawLongText(_text, x, y, g) { - var textHeight = 0; - var textElem = g.append('text'); - textElem.style('text-anchor', 'start'); - textElem.attr('class', 'noteText'); - - var text = _text.replace(/\r\n/g, '
'); - - text = text.replace(/\n/g, '
'); - var lines = text.split(_common_common__WEBPACK_IMPORTED_MODULE_4__["default"].lineBreakRegex); - var tHeight = 1.25 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.noteMargin; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _line = _step.value; - - var txt = _line.trim(); - - if (txt.length > 0) { - var span = textElem.append('tspan'); - span.text(txt); - - if (tHeight === 0) { - var textBounds = span.node().getBBox(); - tHeight += textBounds.height; - } - - textHeight += tHeight; - span.attr('x', x + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.noteMargin); - span.attr('y', y + textHeight + 1.25 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.noteMargin); - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return { - textWidth: textElem.node().getBBox().width, - textHeight: textHeight - }; -}; -/** - * Draws a note to the diagram - * @param text - The text of the given note. - * @param g - The element the note is attached to. - */ - - -var drawNote = function drawNote(text, g) { - g.attr('class', 'state-note'); - var note = g.append('rect').attr('x', 0).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding); - var rectElem = g.append('g'); - - var _drawLongText2 = _drawLongText(text, 0, 0, rectElem), - textWidth = _drawLongText2.textWidth, - textHeight = _drawLongText2.textHeight; - - note.attr('height', textHeight + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.noteMargin); - note.attr('width', textWidth + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.noteMargin * 2); - return note; -}; -/** - * Starting point for drawing a state. The function finds out the specifics - * about the state and renders with approprtiate function. - * @param {*} elem - * @param {*} stateDef - */ - -var drawState = function drawState(elem, stateDef) { - var id = stateDef.id; - var stateInfo = { - id: id, - label: stateDef.id, - width: 0, - height: 0 - }; - var g = elem.append('g').attr('id', id).attr('class', 'stateGroup'); - if (stateDef.type === 'start') drawStartState(g); - if (stateDef.type === 'end') drawEndState(g); - if (stateDef.type === 'fork' || stateDef.type === 'join') drawForkJoinState(g, stateDef); - if (stateDef.type === 'note') drawNote(stateDef.note.text, g); - if (stateDef.type === 'divider') drawDivider(g); - if (stateDef.type === 'default' && stateDef.descriptions.length === 0) drawSimpleState(g, stateDef); - if (stateDef.type === 'default' && stateDef.descriptions.length > 0) drawDescrState(g, stateDef); - var stateBox = g.node().getBBox(); - stateInfo.width = stateBox.width + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding; - stateInfo.height = stateBox.height + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding; - _id_cache_js__WEBPACK_IMPORTED_MODULE_1__["default"].set(id, stateInfo); // stateCnt++; - - return stateInfo; -}; -var edgeCount = 0; -var drawEdge = function drawEdge(elem, path, relation) { - var getRelationType = function getRelationType(type) { - switch (type) { - case _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.AGGREGATION: - return 'aggregation'; - - case _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.EXTENSION: - return 'extension'; - - case _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.COMPOSITION: - return 'composition'; - - case _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.DEPENDENCY: - return 'dependency'; - } - }; - - path.points = path.points.filter(function (p) { - return !Number.isNaN(p.y); - }); // The data for our line - - var lineData = path.points; // This is the accessor function we talked about above - - var lineFunction = Object(d3__WEBPACK_IMPORTED_MODULE_0__["line"])().x(function (d) { - return d.x; - }).y(function (d) { - return d.y; - }).curve(d3__WEBPACK_IMPORTED_MODULE_0__["curveBasis"]); - var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'transition'); - var url = ''; - - if (Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.arrowMarkerAbsolute) { - url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search; - url = url.replace(/\(/g, '\\('); - url = url.replace(/\)/g, '\\)'); - } - - svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.DEPENDENCY) + 'End' + ')'); - - if (typeof relation.title !== 'undefined') { - var label = elem.append('g').attr('class', 'stateLabel'); - - var _utils$calcLabelPosit = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].calcLabelPosition(path.points), - x = _utils$calcLabelPosit.x, - y = _utils$calcLabelPosit.y; - - var rows = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].getRows(relation.title); - var titleHeight = 0; - var titleRows = []; - var maxWidth = 0; - var minX = 0; - - for (var i = 0; i <= rows.length; i++) { - var title = label.append('text').attr('text-anchor', 'middle').text(rows[i]).attr('x', x).attr('y', y + titleHeight); - var boundstmp = title.node().getBBox(); - maxWidth = Math.max(maxWidth, boundstmp.width); - minX = Math.min(minX, boundstmp.x); - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(boundstmp.x, x, y + titleHeight); - - if (titleHeight === 0) { - var titleBox = title.node().getBBox(); - titleHeight = titleBox.height; - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Title height', titleHeight, y); - } - - titleRows.push(title); - } - - var boxHeight = titleHeight * rows.length; - - if (rows.length > 1) { - var heightAdj = (rows.length - 1) * titleHeight * 0.5; - titleRows.forEach(function (title, i) { - return title.attr('y', y + i * titleHeight - heightAdj); - }); - boxHeight = titleHeight * rows.length; - } - - var bounds = label.node().getBBox(); - label.insert('rect', ':first-child').attr('class', 'box').attr('x', x - maxWidth / 2 - Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding / 2).attr('y', y - boxHeight / 2 - Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding / 2 - 3.5).attr('width', maxWidth + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('height', boxHeight + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding); - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(bounds); //label.attr('transform', '0 -' + (bounds.y / 2)); - // Debug points - // path.points.forEach(point => { - // g.append('circle') - // .style('stroke', 'red') - // .style('fill', 'red') - // .attr('r', 1) - // .attr('cx', point.x) - // .attr('cy', point.y); - // }); - // g.append('circle') - // .style('stroke', 'blue') - // .style('fill', 'blue') - // .attr('r', 1) - // .attr('cx', x) - // .attr('cy', y); - } - - edgeCount++; -}; - -/***/ }), - -/***/ "./src/diagrams/state/stateDb.js": -/*!***************************************!*\ - !*** ./src/diagrams/state/stateDb.js ***! - \***************************************/ -/*! exports provided: parseDirective, addState, clear, getState, getStates, logDocuments, getRelations, addRelation, cleanupLabel, lineType, relationType, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDirective", function() { return parseDirective; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addState", function() { return addState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getState", function() { return getState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStates", function() { return getStates; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logDocuments", function() { return logDocuments; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRelations", function() { return getRelations; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addRelation", function() { return addRelation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanupLabel", function() { return cleanupLabel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineType", function() { return lineType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relationType", function() { return relationType; }); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); -/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - - - - - - -var clone = function clone(o) { - return JSON.parse(JSON.stringify(o)); -}; - -var rootDoc = []; -var parseDirective = function parseDirective(statement, context, type) { - _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].parseDirective(this, statement, context, type); -}; - -var setRootDoc = function setRootDoc(o) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Setting root doc', o); // rootDoc = { id: 'root', doc: o }; - - rootDoc = o; -}; - -var getRootDoc = function getRootDoc() { - return rootDoc; -}; - -var docTranslator = function docTranslator(parent, node, first) { - if (node.stmt === 'relation') { - docTranslator(parent, node.state1, true); - docTranslator(parent, node.state2, false); - } else { - if (node.stmt === 'state') { - if (node.id === '[*]') { - node.id = first ? parent.id + '_start' : parent.id + '_end'; - node.start = first; - } - } - - if (node.doc) { - var doc = []; // Check for concurrency - - var i = 0; - var currentDoc = []; - - for (i = 0; i < node.doc.length; i++) { - if (node.doc[i].type === 'divider') { - // debugger; - var newNode = clone(node.doc[i]); - newNode.doc = clone(currentDoc); - doc.push(newNode); - currentDoc = []; - } else { - currentDoc.push(node.doc[i]); - } - } // If any divider was encountered - - - if (doc.length > 0 && currentDoc.length > 0) { - var _newNode = { - stmt: 'state', - id: Object(_utils__WEBPACK_IMPORTED_MODULE_1__["generateId"])(), - type: 'divider', - doc: clone(currentDoc) - }; - doc.push(clone(_newNode)); - node.doc = doc; - } - - node.doc.forEach(function (docNode) { - return docTranslator(node, docNode, true); - }); - } - } -}; - -var getRootDocV2 = function getRootDocV2() { - docTranslator({ - id: 'root' - }, { - id: 'root', - doc: rootDoc - }, true); - return { - id: 'root', - doc: rootDoc - }; -}; - -var extract = function extract(_doc) { - // const res = { states: [], relations: [] }; - var doc; - - if (_doc.doc) { - doc = _doc.doc; - } else { - doc = _doc; - } // let doc = root.doc; - // if (!doc) { - // doc = root; - // } - - - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info(doc); - clear(); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Extract', doc); - doc.forEach(function (item) { - if (item.stmt === 'state') { - addState(item.id, item.type, item.doc, item.description, item.note); - } - - if (item.stmt === 'relation') { - addRelation(item.state1.id, item.state2.id, item.description); - } - }); -}; - -var newDoc = function newDoc() { - return { - relations: [], - states: {}, - documents: {} - }; -}; - -var documents = { - root: newDoc() -}; -var currentDocument = documents.root; -var startCnt = 0; -var endCnt = 0; // eslint-disable-line -// let stateCnt = 0; - -/** - * Function called by parser when a node definition has been found. - * @param id - * @param text - * @param type - * @param style - */ - -var addState = function addState(id, type, doc, descr, note) { - if (typeof currentDocument.states[id] === 'undefined') { - currentDocument.states[id] = { - id: id, - descriptions: [], - type: type, - doc: doc, - note: note - }; - } else { - if (!currentDocument.states[id].doc) { - currentDocument.states[id].doc = doc; - } - - if (!currentDocument.states[id].type) { - currentDocument.states[id].type = type; - } - } - - if (descr) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Adding state ', id, descr); - if (typeof descr === 'string') addDescription(id, descr.trim()); - - if (_typeof(descr) === 'object') { - descr.forEach(function (des) { - return addDescription(id, des.trim()); - }); - } - } - - if (note) currentDocument.states[id].note = note; -}; -var clear = function clear() { - documents = { - root: newDoc() - }; - currentDocument = documents.root; - currentDocument = documents.root; - startCnt = 0; - endCnt = 0; // eslint-disable-line - - classes = []; -}; -var getState = function getState(id) { - return currentDocument.states[id]; -}; -var getStates = function getStates() { - return currentDocument.states; -}; -var logDocuments = function logDocuments() { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Documents = ', documents); -}; -var getRelations = function getRelations() { - return currentDocument.relations; -}; -var addRelation = function addRelation(_id1, _id2, title) { - var id1 = _id1; - var id2 = _id2; - var type1 = 'default'; - var type2 = 'default'; - - if (_id1 === '[*]') { - startCnt++; - id1 = 'start' + startCnt; - type1 = 'start'; - } - - if (_id2 === '[*]') { - endCnt++; - id2 = 'end' + startCnt; - type2 = 'end'; - } - - addState(id1, type1); - addState(id2, type2); - currentDocument.relations.push({ - id1: id1, - id2: id2, - title: title - }); -}; - -var addDescription = function addDescription(id, _descr) { - var theState = currentDocument.states[id]; - var descr = _descr; - - if (descr[0] === ':') { - descr = descr.substr(1).trim(); - } - - theState.descriptions.push(descr); -}; - -var cleanupLabel = function cleanupLabel(label) { - if (label.substring(0, 1) === ':') { - return label.substr(2).trim(); - } else { - return label.trim(); - } -}; -var lineType = { - LINE: 0, - DOTTED_LINE: 1 -}; -var dividerCnt = 0; - -var getDividerId = function getDividerId() { - dividerCnt++; - return 'divider-id-' + dividerCnt; -}; - -var classes = []; - -var getClasses = function getClasses() { - return classes; -}; - -var getDirection = function getDirection() { - return 'TB'; -}; - -var relationType = { - AGGREGATION: 0, - EXTENSION: 1, - COMPOSITION: 2, - DEPENDENCY: 3 -}; - -var trimColon = function trimColon(str) { - return str && str[0] === ':' ? str.substr(1).trim() : str.trim(); -}; - -/* harmony default export */ __webpack_exports__["default"] = ({ - parseDirective: parseDirective, - getConfig: function getConfig() { - return _config__WEBPACK_IMPORTED_MODULE_3__["getConfig"]().state; - }, - addState: addState, - clear: clear, - getState: getState, - getStates: getStates, - getRelations: getRelations, - getClasses: getClasses, - getDirection: getDirection, - addRelation: addRelation, - getDividerId: getDividerId, - // addDescription, - cleanupLabel: cleanupLabel, - lineType: lineType, - relationType: relationType, - logDocuments: logDocuments, - getRootDoc: getRootDoc, - setRootDoc: setRootDoc, - getRootDocV2: getRootDocV2, - extract: extract, - trimColon: trimColon -}); - -/***/ }), - -/***/ "./src/diagrams/state/stateRenderer-v2.js": -/*!************************************************!*\ - !*** ./src/diagrams/state/stateRenderer-v2.js ***! - \************************************************/ -/*! exports provided: setConf, getClasses, draw, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! graphlib */ "graphlib"); -/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _stateDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stateDb */ "./src/diagrams/state/stateDb.js"); -/* harmony import */ var _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/stateDiagram */ "./src/diagrams/state/parser/stateDiagram.jison"); -/* harmony import */ var _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _dagre_wrapper_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../dagre-wrapper/index.js */ "./src/dagre-wrapper/index.js"); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); - - - - - - - - -var conf = {}; -var setConf = function setConf(cnf) { - var keys = Object.keys(cnf); - - for (var i = 0; i < keys.length; i++) { - conf[keys[i]] = cnf[keys[i]]; - } -}; -var nodeDb = {}; -/** - * Returns the all the styles from classDef statements in the graph definition. - * @returns {object} classDef styles - */ - -var getClasses = function getClasses(text) { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].trace('Extracting classes'); - _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); - var parser = _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_3___default.a.parser; - parser.yy = _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition - - parser.parse(text); - return _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getClasses(); -}; - -var setupNode = function setupNode(g, parent, node, altFlag) { - // Add the node - if (node.id !== 'root') { - var shape = 'rect'; - - if (node.start === true) { - shape = 'start'; - } - - if (node.start === false) { - shape = 'end'; - } - - if (node.type !== 'default') { - shape = node.type; - } - - if (!nodeDb[node.id]) { - nodeDb[node.id] = { - id: node.id, - shape: shape, - description: node.id, - classes: 'statediagram-state' - }; - } // Build of the array of description strings accordinging - - - if (node.description) { - if (Array.isArray(nodeDb[node.id].description)) { - // There already is an array of strings,add to it - nodeDb[node.id].shape = 'rectWithTitle'; - nodeDb[node.id].description.push(node.description); - } else { - if (nodeDb[node.id].description.length > 0) { - // if there is a description already transformit to an array - nodeDb[node.id].shape = 'rectWithTitle'; - - if (nodeDb[node.id].description === node.id) { - // If the previous description was the is, remove it - nodeDb[node.id].description = [node.description]; - } else { - nodeDb[node.id].description = [nodeDb[node.id].description, node.description]; - } - } else { - nodeDb[node.id].shape = 'rect'; - nodeDb[node.id].description = node.description; - } - } - } // Save data for description and group so that for instance a statement without description overwrites - // one with description - // group - - - if (!nodeDb[node.id].type && node.doc) { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Setting cluser for ', node.id); - nodeDb[node.id].type = 'group'; - nodeDb[node.id].shape = node.type === 'divider' ? 'divider' : 'roundedWithTitle'; - nodeDb[node.id].classes = nodeDb[node.id].classes + ' ' + (altFlag ? 'statediagram-cluster statediagram-cluster-alt' : 'statediagram-cluster'); - } - - var nodeData = { - labelStyle: '', - shape: nodeDb[node.id].shape, - labelText: nodeDb[node.id].description, - classes: nodeDb[node.id].classes, - //classStr, - style: '', - //styles.style, - id: node.id, - domId: 'state-' + node.id + '-' + cnt, - type: nodeDb[node.id].type, - padding: 15 //getConfig().flowchart.padding - - }; - - if (node.note) { - // Todo: set random id - var noteData = { - labelStyle: '', - shape: 'note', - labelText: node.note.text, - classes: 'statediagram-note', - //classStr, - style: '', - //styles.style, - id: node.id + '----note', - domId: 'state-' + node.id + '----note-' + cnt, - type: nodeDb[node.id].type, - padding: 15 //getConfig().flowchart.padding - - }; - var groupData = { - labelStyle: '', - shape: 'noteGroup', - labelText: node.note.text, - classes: nodeDb[node.id].classes, - //classStr, - style: '', - //styles.style, - id: node.id + '----parent', - domId: 'state-' + node.id + '----parent-' + cnt, - type: 'group', - padding: 0 //getConfig().flowchart.padding - - }; - cnt++; - g.setNode(node.id + '----parent', groupData); - g.setNode(noteData.id, noteData); - g.setNode(node.id, nodeData); - g.setParent(node.id, node.id + '----parent'); - g.setParent(noteData.id, node.id + '----parent'); - var from = node.id; - var to = noteData.id; - - if (node.note.position === 'left of') { - from = noteData.id; - to = node.id; - } - - g.setEdge(from, to, { - arrowhead: 'none', - arrowType: '', - style: 'fill:none', - labelStyle: '', - classes: 'transition note-edge', - arrowheadStyle: 'fill: #333', - labelpos: 'c', - labelType: 'text', - thickness: 'normal' - }); - } else { - g.setNode(node.id, nodeData); - } - } - - if (parent) { - if (parent.id !== 'root') { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Setting node ', node.id, ' to be child of its parent ', parent.id); - g.setParent(node.id, parent.id); - } - } - - if (node.doc) { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Adding nodes children '); - setupDoc(g, node, node.doc, !altFlag); - } -}; - -var cnt = 0; - -var setupDoc = function setupDoc(g, parent, doc, altFlag) { - cnt = 0; - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].trace('items', doc); - doc.forEach(function (item) { - if (item.stmt === 'state' || item.stmt === 'default') { - setupNode(g, parent, item, altFlag); - } else if (item.stmt === 'relation') { - setupNode(g, parent, item.state1, altFlag); - setupNode(g, parent, item.state2, altFlag); - var edgeData = { - id: 'edge' + cnt, - arrowhead: 'normal', - arrowTypeEnd: 'arrow_barb', - style: 'fill:none', - labelStyle: '', - label: item.description, - arrowheadStyle: 'fill: #333', - labelpos: 'c', - labelType: 'text', - thickness: 'normal', - classes: 'transition' - }; - var startId = item.state1.id; - var endId = item.state2.id; - g.setEdge(startId, endId, edgeData, cnt); - cnt++; - } - }); -}; -/** - * Draws a flowchart in the tag with id: id based on the graph definition in text. - * @param text - * @param id - */ - - -var draw = function draw(text, id) { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Drawing state diagram (v2)', id); - _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); - nodeDb = {}; - var parser = _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_3___default.a.parser; - parser.yy = _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition - - parser.parse(text); // Fetch the default direction, use TD if none was found - - var dir = _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getDirection(); - - if (typeof dir === 'undefined') { - dir = 'LR'; - } - - var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state; - var nodeSpacing = conf.nodeSpacing || 50; - var rankSpacing = conf.rankSpacing || 50; // Create the input mermaid.graph - - var g = new graphlib__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({ - multigraph: true, - compound: true - }).setGraph({ - rankdir: 'TB', - nodesep: nodeSpacing, - ranksep: rankSpacing, - marginx: 8, - marginy: 8 - }).setDefaultEdgeLabel(function () { - return {}; - }); - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()); - _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].extract(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()); - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()); - setupNode(g, undefined, _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2(), true); // Set up an SVG group so that we can translate the final graph. - - var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(id, "\"]")); // Run the renderer. This is what draws the final graph. - - var element = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#' + id + ' g'); - Object(_dagre_wrapper_index_js__WEBPACK_IMPORTED_MODULE_5__["render"])(element, g, ['barb'], 'statediagram', id); - var padding = 8; - var bounds = svg.node().getBBox(); - var width = bounds.width + padding * 2; - var height = bounds.height + padding * 2; // Zoom in a bit - - svg.attr('class', 'statediagram'); - var svgBounds = svg.node().getBBox(); - Object(_utils__WEBPACK_IMPORTED_MODULE_7__["configureSvgSize"])(svg, height, width * 1.75, conf.useMaxWidth); // Ensure the viewBox includes the whole svgBounds area with extra space for padding - - var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height); - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].debug("viewBox ".concat(vBox)); - svg.attr('viewBox', vBox); // Add label rects for non html labels - - if (!conf.htmlLabels) { - var labels = document.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); - - for (var k = 0; k < labels.length; k++) { - var label = labels[k]; // Get dimensions of label - - var dim = label.getBBox(); - var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); - rect.setAttribute('rx', 0); - rect.setAttribute('ry', 0); - rect.setAttribute('width', dim.width); - rect.setAttribute('height', dim.height); - label.insertBefore(rect, label.firstChild); - } - } -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - setConf: setConf, - getClasses: getClasses, - draw: draw -}); - -/***/ }), - -/***/ "./src/diagrams/state/stateRenderer.js": -/*!*********************************************!*\ - !*** ./src/diagrams/state/stateRenderer.js ***! - \*********************************************/ -/*! exports provided: setConf, draw, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre */ "dagre"); -/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlib */ "graphlib"); -/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _stateDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stateDb */ "./src/diagrams/state/stateDb.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); -/* harmony import */ var _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parser/stateDiagram */ "./src/diagrams/state/parser/stateDiagram.jison"); -/* harmony import */ var _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6__); -/* harmony import */ var _shapes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./shapes */ "./src/diagrams/state/shapes.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); - - - - - - - // import idCache from './id-cache'; - - - - -_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"]; // TODO Move conf object to main conf in mermaidAPI - -var conf; -var transformationLog = {}; -var setConf = function setConf() {}; // Todo optimize - -/** - * Setup arrow head and define the marker. The result is appended to the svg. - */ - -var insertMarkers = function insertMarkers(elem) { - elem.append('defs').append('marker').attr('id', 'dependencyEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z'); -}; -/** - * Draws a flowchart in the tag with id: id based on the graph definition in text. - * @param text - * @param id - */ - - -var draw = function draw(text, id) { - conf = Object(_config__WEBPACK_IMPORTED_MODULE_8__["getConfig"])().state; - _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy.clear(); - _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].parse(text); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Rendering diagram ' + text); // Fetch the default direction, use TD if none was found - - var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])("[id='".concat(id, "']")); - insertMarkers(diagram); // Layout graph, Create a new directed graph - - var graph = new graphlib__WEBPACK_IMPORTED_MODULE_2___default.a.Graph({ - multigraph: true, - compound: true, - // acyclicer: 'greedy', - rankdir: 'RL' // ranksep: '20' - - }); // Default to assigning a new object as a label for each new edge. - - graph.setDefaultEdgeLabel(function () { - return {}; - }); - var rootDoc = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRootDoc(); - renderDoc(rootDoc, diagram, undefined, false); - var padding = conf.padding; - var bounds = diagram.node().getBBox(); - var width = bounds.width + padding * 2; - var height = bounds.height + padding * 2; // zoom in a bit - - var svgWidth = width * 1.75; - Object(_utils__WEBPACK_IMPORTED_MODULE_9__["configureSvgSize"])(diagram, height, svgWidth, conf.useMaxWidth); - diagram.attr('viewBox', "".concat(bounds.x - conf.padding, " ").concat(bounds.y - conf.padding, " ") + width + ' ' + height); -}; - -var getLabelWidth = function getLabelWidth(text) { - return text ? text.length * conf.fontSizeFactor : 1; -}; - -var renderDoc = function renderDoc(doc, diagram, parentId, altBkg) { - // // Layout graph, Create a new directed graph - var graph = new graphlib__WEBPACK_IMPORTED_MODULE_2___default.a.Graph({ - compound: true, - multigraph: true - }); - var i; - var edgeFreeDoc = true; - - for (i = 0; i < doc.length; i++) { - if (doc[i].stmt === 'relation') { - edgeFreeDoc = false; - break; - } - } // Set an object for the graph label - - - if (parentId) graph.setGraph({ - rankdir: 'LR', - multigraph: true, - compound: true, - // acyclicer: 'greedy', - ranker: 'tight-tree', - ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor, - nodeSep: edgeFreeDoc ? 1 : 50, - isMultiGraph: true // ranksep: 5, - // nodesep: 1 - - });else { - graph.setGraph({ - rankdir: 'TB', - multigraph: true, - compound: true, - // isCompound: true, - // acyclicer: 'greedy', - // ranker: 'longest-path' - ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor, - nodeSep: edgeFreeDoc ? 1 : 50, - ranker: 'tight-tree', - // ranker: 'network-simplex' - isMultiGraph: true - }); - } // Default to assigning a new object as a label for each new edge. - - graph.setDefaultEdgeLabel(function () { - return {}; - }); - _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].extract(doc); - var states = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].getStates(); - var relations = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations(); - var keys = Object.keys(states); - var first = true; - - for (var _i = 0; _i < keys.length; _i++) { - var stateDef = states[keys[_i]]; - - if (parentId) { - stateDef.parentId = parentId; - } - - var node = void 0; - - if (stateDef.doc) { - var sub = diagram.append('g').attr('id', stateDef.id).attr('class', 'stateGroup'); - node = renderDoc(stateDef.doc, sub, stateDef.id, !altBkg); - - if (first) { - // first = false; - sub = Object(_shapes__WEBPACK_IMPORTED_MODULE_7__["addTitleAndBox"])(sub, stateDef, altBkg); - var boxBounds = sub.node().getBBox(); - node.width = boxBounds.width; - node.height = boxBounds.height + conf.padding / 2; - transformationLog[stateDef.id] = { - y: conf.compositTitleSize - }; - } else { - // sub = addIdAndBox(sub, stateDef); - var _boxBounds = sub.node().getBBox(); - - node.width = _boxBounds.width; - node.height = _boxBounds.height; // transformationLog[stateDef.id] = { y: conf.compositTitleSize }; - } - } else { - node = Object(_shapes__WEBPACK_IMPORTED_MODULE_7__["drawState"])(diagram, stateDef, graph); - } - - if (stateDef.note) { - // Draw note note - var noteDef = { - descriptions: [], - id: stateDef.id + '-note', - note: stateDef.note, - type: 'note' - }; - var note = Object(_shapes__WEBPACK_IMPORTED_MODULE_7__["drawState"])(diagram, noteDef, graph); // graph.setNode(node.id, node); - - if (stateDef.note.position === 'left of') { - graph.setNode(node.id + '-note', note); - graph.setNode(node.id, node); - } else { - graph.setNode(node.id, node); - graph.setNode(node.id + '-note', note); - } // graph.setNode(node.id); - - - graph.setParent(node.id, node.id + '-group'); - graph.setParent(node.id + '-note', node.id + '-group'); - } else { - // Add nodes to the graph. The first argument is the node id. The second is - // metadata about the node. In this case we're going to add labels to each of - // our nodes. - graph.setNode(node.id, node); - } - } - - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Count=', graph.nodeCount(), graph); - var cnt = 0; - relations.forEach(function (relation) { - cnt++; - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Setting edge', relation); - graph.setEdge(relation.id1, relation.id2, { - relation: relation, - width: getLabelWidth(relation.title), - height: conf.labelHeight * _common_common__WEBPACK_IMPORTED_MODULE_5__["default"].getRows(relation.title).length, - labelpos: 'c' - }, 'id' + cnt); - }); - dagre__WEBPACK_IMPORTED_MODULE_1___default.a.layout(graph); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Graph after layout', graph.nodes()); - var svgElem = diagram.node(); - graph.nodes().forEach(function (v) { - if (typeof v !== 'undefined' && typeof graph.node(v) !== 'undefined') { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].warn('Node ' + v + ': ' + JSON.stringify(graph.node(v))); - Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + svgElem.id + ' #' + v).attr('transform', 'translate(' + (graph.node(v).x - graph.node(v).width / 2) + ',' + (graph.node(v).y + (transformationLog[v] ? transformationLog[v].y : 0) - graph.node(v).height / 2) + ' )'); - Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + svgElem.id + ' #' + v).attr('data-x-shift', graph.node(v).x - graph.node(v).width / 2); - var dividers = document.querySelectorAll('#' + svgElem.id + ' #' + v + ' .divider'); - dividers.forEach(function (divider) { - var parent = divider.parentElement; - var pWidth = 0; - var pShift = 0; - - if (parent) { - if (parent.parentElement) pWidth = parent.parentElement.getBBox().width; - pShift = parseInt(parent.getAttribute('data-x-shift'), 10); - - if (Number.isNaN(pShift)) { - pShift = 0; - } - } - - divider.setAttribute('x1', 0 - pShift + 8); - divider.setAttribute('x2', pWidth - pShift - 8); - }); - } else { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('No Node ' + v + ': ' + JSON.stringify(graph.node(v))); - } - }); - var stateBox = svgElem.getBBox(); - graph.edges().forEach(function (e) { - if (typeof e !== 'undefined' && typeof graph.edge(e) !== 'undefined') { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e))); - Object(_shapes__WEBPACK_IMPORTED_MODULE_7__["drawEdge"])(diagram, graph.edge(e), graph.edge(e).relation); - } - }); - stateBox = svgElem.getBBox(); - var stateInfo = { - id: parentId ? parentId : 'root', - label: parentId ? parentId : 'root', - width: 0, - height: 0 - }; - stateInfo.width = stateBox.width + 2 * conf.padding; - stateInfo.height = stateBox.height + 2 * conf.padding; - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Doc rendered', stateInfo, graph); - return stateInfo; -}; - -/* harmony default export */ __webpack_exports__["default"] = ({ - setConf: setConf, - draw: draw -}); - -/***/ }), - -/***/ "./src/diagrams/state/styles.js": -/*!**************************************!*\ - !*** ./src/diagrams/state/styles.js ***! - \**************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -var getStyles = function getStyles(options) { - return "g.stateGroup text {\n fill: ".concat(options.nodeBorder, ";\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ").concat(options.textColor, ";\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ").concat(options.labelColor, ";\n}\n\ng.stateGroup rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n}\n\ng.stateGroup line {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n\n.transition {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ").concat(options.background, ";\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ").concat(options.noteBorderColor, ";\n fill: ").concat(options.noteBkgColor, ";\n\n text {\n fill: black;\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ").concat(options.mainBkg, ";\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ").concat(options.tertiaryColor, ";\n opacity: 0.5;\n}\n.edgeLabel .label text {\n fill: ").concat(options.tertiaryTextColor, ";\n}\n.label div .edgeLabel {\n color: ").concat(options.tertiaryTextColor, ";\n}\n\n.stateLabel text {\n fill: ").concat(options.labelColor, ";\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ").concat(options.lineColor, ";\n stroke: black;\n}\n.node circle.state-end {\n fill: ").concat(options.primaryBorderColor, ";\n stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ").concat(options.background, ";\n // stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ").concat(options.lineColor, ";\n}\n\n.statediagram-cluster rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ").concat(options.textColor, ";\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ").concat(options.nodeBorder, ";\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ").concat(options.background, ";\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: #e0e0e0;\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ").concat(options.altBackground ? options.altBackground : '#efefef', ";\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ").concat(options.noteTextColor, ";\n}\n\n.statediagram-note .nodeLabel {\n color: ").concat(options.noteTextColor, ";\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ").concat(options.lineColor, ";\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n"); -}; - -/* harmony default export */ __webpack_exports__["default"] = (getStyles); - -/***/ }), - -/***/ "./src/diagrams/user-journey/journeyDb.js": -/*!************************************************!*\ - !*** ./src/diagrams/user-journey/journeyDb.js ***! - \************************************************/ -/*! exports provided: parseDirective, clear, setTitle, getTitle, addSection, getSections, getTasks, addTask, addTaskOrg, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDirective", function() { return parseDirective; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTitle", function() { return setTitle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTitle", function() { return getTitle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSection", function() { return addSection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSections", function() { return getSections; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTasks", function() { return getTasks; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTask", function() { return addTask; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTaskOrg", function() { return addTaskOrg; }); -/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - - - -var title = ''; -var currentSection = ''; -var sections = []; -var tasks = []; -var rawTasks = []; -var parseDirective = function parseDirective(statement, context, type) { - _mermaidAPI__WEBPACK_IMPORTED_MODULE_0__["default"].parseDirective(this, statement, context, type); -}; -var clear = function clear() { - sections.length = 0; - tasks.length = 0; - currentSection = ''; - title = ''; - rawTasks.length = 0; -}; -var setTitle = function setTitle(txt) { - title = txt; -}; -var getTitle = function getTitle() { - return title; -}; -var addSection = function addSection(txt) { - currentSection = txt; - sections.push(txt); -}; -var getSections = function getSections() { - return sections; -}; -var getTasks = function getTasks() { - var allItemsProcessed = compileTasks(); - var maxDepth = 100; - var iterationCount = 0; - - while (!allItemsProcessed && iterationCount < maxDepth) { - allItemsProcessed = compileTasks(); - iterationCount++; - } - - tasks.push.apply(tasks, rawTasks); - return tasks; -}; - -var updateActors = function updateActors() { - var tempActors = []; - tasks.forEach(function (task) { - if (task.people) { - tempActors.push.apply(tempActors, _toConsumableArray(task.people)); - } - }); - var unique = new Set(tempActors); - return _toConsumableArray(unique).sort(); -}; - -var addTask = function addTask(descr, taskData) { - var pieces = taskData.substr(1).split(':'); - var score = 0; - var peeps = []; - - if (pieces.length === 1) { - score = Number(pieces[0]); - peeps = []; - } else { - score = Number(pieces[0]); - peeps = pieces[1].split(','); - } - - var peopleList = peeps.map(function (s) { - return s.trim(); - }); - var rawTask = { - section: currentSection, - type: currentSection, - people: peopleList, - task: descr, - score: score - }; - rawTasks.push(rawTask); -}; -var addTaskOrg = function addTaskOrg(descr) { - var newTask = { - section: currentSection, - type: currentSection, - description: descr, - task: descr, - classes: [] - }; - tasks.push(newTask); -}; - -var compileTasks = function compileTasks() { - var compileTask = function compileTask(pos) { - return rawTasks[pos].processed; - }; - - var allProcessed = true; - - for (var i = 0; i < rawTasks.length; i++) { - compileTask(i); - allProcessed = allProcessed && rawTasks[i].processed; - } - - return allProcessed; -}; - -var getActors = function getActors() { - return updateActors(); -}; - -/* harmony default export */ __webpack_exports__["default"] = ({ - parseDirective: parseDirective, - getConfig: function getConfig() { - return _config__WEBPACK_IMPORTED_MODULE_1__["getConfig"]().journey; - }, - clear: clear, - setTitle: setTitle, - getTitle: getTitle, - addSection: addSection, - getSections: getSections, - getTasks: getTasks, - addTask: addTask, - addTaskOrg: addTaskOrg, - getActors: getActors -}); - -/***/ }), - -/***/ "./src/diagrams/user-journey/journeyRenderer.js": -/*!******************************************************!*\ - !*** ./src/diagrams/user-journey/journeyRenderer.js ***! - \******************************************************/ -/*! exports provided: setConf, draw, bounds, drawTasks, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounds", function() { return bounds; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawTasks", function() { return drawTasks; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _parser_journey__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser/journey */ "./src/diagrams/user-journey/parser/journey.jison"); -/* harmony import */ var _parser_journey__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_parser_journey__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _journeyDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./journeyDb */ "./src/diagrams/user-journey/journeyDb.js"); -/* harmony import */ var _svgDraw__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./svgDraw */ "./src/diagrams/user-journey/svgDraw.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); - - - - - -_parser_journey__WEBPACK_IMPORTED_MODULE_1__["parser"].yy = _journeyDb__WEBPACK_IMPORTED_MODULE_2__["default"]; -var conf = { - leftMargin: 150, - diagramMarginX: 50, - diagramMarginY: 20, - // Margin between tasks - taskMargin: 50, - // Width of task boxes - width: 150, - // Height of task boxes - height: 50, - taskFontSize: 14, - taskFontFamily: '"Open-Sans", "sans-serif"', - // Margin around loop boxes - boxMargin: 10, - boxTextMargin: 5, - noteMargin: 10, - // Space between messages - messageMargin: 35, - // Multiline message alignment - messageAlign: 'center', - // Depending on css styling this might need adjustment - // Projects the edge of the diagram downwards - bottomMarginAdj: 1, - // width of activation box - activationWidth: 10, - // text placement as: tspan | fo | old only text as before - textPlacement: 'fo', - actorColours: ['#8FBC8F', '#7CFC00', '#00FFFF', '#20B2AA', '#B0E0E6', '#FFFFE0'], - sectionFills: ['#191970', '#8B008B', '#4B0082', '#2F4F4F', '#800000', '#8B4513', '#00008B'], - sectionColours: ['#fff'] -}; -var setConf = function setConf(cnf) { - var keys = Object.keys(cnf); - keys.forEach(function (key) { - conf[key] = cnf[key]; - }); -}; -var actors = {}; - -function drawActorLegend(diagram) { - // Draw the actors - var yPos = 60; - Object.keys(actors).forEach(function (person) { - var colour = actors[person]; - var circleData = { - cx: 20, - cy: yPos, - r: 7, - fill: colour, - stroke: '#000' - }; - _svgDraw__WEBPACK_IMPORTED_MODULE_3__["default"].drawCircle(diagram, circleData); - var labelData = { - x: 40, - y: yPos + 7, - fill: '#666', - text: person, - textMargin: conf.boxTextMargin | 5 - }; - _svgDraw__WEBPACK_IMPORTED_MODULE_3__["default"].drawText(diagram, labelData); - yPos += 20; - }); -} - -var LEFT_MARGIN = conf.leftMargin; -var draw = function draw(text, id) { - _parser_journey__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.clear(); - _parser_journey__WEBPACK_IMPORTED_MODULE_1__["parser"].parse(text + '\n'); - bounds.init(); - var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + id); - diagram.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink'); - _svgDraw__WEBPACK_IMPORTED_MODULE_3__["default"].initGraphics(diagram); - var tasks = _parser_journey__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getTasks(); - var title = _parser_journey__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getTitle(); - var actorNames = _parser_journey__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getActors(); - - for (var member in actors) { - delete actors[member]; - } - - var actorPos = 0; - actorNames.forEach(function (actorName) { - actors[actorName] = conf.actorColours[actorPos % conf.actorColours.length]; - actorPos++; - }); - drawActorLegend(diagram); - bounds.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50); - drawTasks(diagram, tasks, 0); - var box = bounds.getBounds(); - - if (title) { - diagram.append('text').text(title).attr('x', LEFT_MARGIN).attr('font-size', '4ex').attr('font-weight', 'bold').attr('y', 25); - } - - var height = box.stopy - box.starty + 2 * conf.diagramMarginY; - var width = LEFT_MARGIN + box.stopx + 2 * conf.diagramMarginX; - Object(_utils__WEBPACK_IMPORTED_MODULE_4__["configureSvgSize"])(diagram, height, width, conf.useMaxWidth); // Draw activity line - - diagram.append('line').attr('x1', LEFT_MARGIN).attr('y1', conf.height * 4) // One section head + one task + margins - .attr('x2', width - LEFT_MARGIN - 4) // Subtract stroke width so arrow point is retained - .attr('y2', conf.height * 4).attr('stroke-width', 4).attr('stroke', 'black').attr('marker-end', 'url(#arrowhead)'); - var extraVertForTitle = title ? 70 : 0; - diagram.attr('viewBox', "".concat(box.startx, " -25 ").concat(width, " ").concat(height + extraVertForTitle)); - diagram.attr('preserveAspectRatio', 'xMinYMin meet'); -}; -var bounds = { - data: { - startx: undefined, - stopx: undefined, - starty: undefined, - stopy: undefined - }, - verticalPos: 0, - sequenceItems: [], - init: function init() { - this.sequenceItems = []; - this.data = { - startx: undefined, - stopx: undefined, - starty: undefined, - stopy: undefined - }; - this.verticalPos = 0; - }, - updateVal: function updateVal(obj, key, val, fun) { - if (typeof obj[key] === 'undefined') { - obj[key] = val; - } else { - obj[key] = fun(val, obj[key]); - } - }, - updateBounds: function updateBounds(startx, starty, stopx, stopy) { - var _self = this; - - var cnt = 0; - - function updateFn(type) { - return function updateItemBounds(item) { - cnt++; // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems - - var n = _self.sequenceItems.length - cnt + 1; - - _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min); - - _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max); - - _self.updateVal(bounds.data, 'startx', startx - n * conf.boxMargin, Math.min); - - _self.updateVal(bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max); - - if (!(type === 'activation')) { - _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min); - - _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max); - - _self.updateVal(bounds.data, 'starty', starty - n * conf.boxMargin, Math.min); - - _self.updateVal(bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max); - } - }; - } - - this.sequenceItems.forEach(updateFn()); - }, - insert: function insert(startx, starty, stopx, stopy) { - var _startx = Math.min(startx, stopx); - - var _stopx = Math.max(startx, stopx); - - var _starty = Math.min(starty, stopy); - - var _stopy = Math.max(starty, stopy); - - this.updateVal(bounds.data, 'startx', _startx, Math.min); - this.updateVal(bounds.data, 'starty', _starty, Math.min); - this.updateVal(bounds.data, 'stopx', _stopx, Math.max); - this.updateVal(bounds.data, 'stopy', _stopy, Math.max); - this.updateBounds(_startx, _starty, _stopx, _stopy); - }, - bumpVerticalPos: function bumpVerticalPos(bump) { - this.verticalPos = this.verticalPos + bump; - this.data.stopy = this.verticalPos; - }, - getVerticalPos: function getVerticalPos() { - return this.verticalPos; - }, - getBounds: function getBounds() { - return this.data; - } -}; -var fills = conf.sectionFills; -var textColours = conf.sectionColours; -var drawTasks = function drawTasks(diagram, tasks, verticalPos) { - var lastSection = ''; - var sectionVHeight = conf.height * 2 + conf.diagramMarginY; - var taskPos = verticalPos + sectionVHeight; - var sectionNumber = 0; - var fill = '#CCC'; - var colour = 'black'; - var num = 0; // Draw the tasks - - for (var i = 0; i < tasks.length; i++) { - var task = tasks[i]; - - if (lastSection !== task.section) { - fill = fills[sectionNumber % fills.length]; - num = sectionNumber % fills.length; - colour = textColours[sectionNumber % textColours.length]; - var section = { - x: i * conf.taskMargin + i * conf.width + LEFT_MARGIN, - y: 50, - text: task.section, - fill: fill, - num: num, - colour: colour - }; - _svgDraw__WEBPACK_IMPORTED_MODULE_3__["default"].drawSection(diagram, section, conf); - lastSection = task.section; - sectionNumber++; - } // Collect the actors involved in the task - - - var taskActors = task.people.reduce(function (acc, actorName) { - if (actors[actorName]) { - acc[actorName] = actors[actorName]; - } - - return acc; - }, {}); // Add some rendering data to the object - - task.x = i * conf.taskMargin + i * conf.width + LEFT_MARGIN; - task.y = taskPos; - task.width = conf.diagramMarginX; - task.height = conf.diagramMarginY; - task.colour = colour; - task.fill = fill; - task.num = num; - task.actors = taskActors; // Draw the box with the attached line - - _svgDraw__WEBPACK_IMPORTED_MODULE_3__["default"].drawTask(diagram, task, conf); - bounds.insert(task.x, task.y, task.x + task.width + conf.taskMargin, 300 + 5 * 30); // stopy is the length of the descenders. - } -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - setConf: setConf, - draw: draw -}); - -/***/ }), - -/***/ "./src/diagrams/user-journey/parser/journey.jison": -/*!********************************************************!*\ - !*** ./src/diagrams/user-journey/parser/journey.jison ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,5],$V2=[6,9,11,17,18,19,21],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,21],$V7=[4,6,9,11,17,18,19,21]; -var parser = {trace: function trace () { }, -yy: {}, -symbols_: {"error":2,"start":3,"journey":4,"document":5,"EOF":6,"directive":7,"line":8,"SPACE":9,"statement":10,"NEWLINE":11,"openDirective":12,"typeDirective":13,"closeDirective":14,":":15,"argDirective":16,"title":17,"section":18,"taskName":19,"taskData":20,"open_directive":21,"type_directive":22,"arg_directive":23,"close_directive":24,"$accept":0,"$end":1}, -terminals_: {2:"error",4:"journey",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"section",19:"taskName",20:"taskData",21:"open_directive",22:"type_directive",23:"arg_directive",24:"close_directive"}, -productions_: [0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,1],[10,2],[10,1],[12,1],[13,1],[16,1],[14,1]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 1: - return $$[$0-1]; -break; -case 3: - this.$ = [] -break; -case 4: -$$[$0-1].push($$[$0]);this.$ = $$[$0-1] -break; -case 5: case 6: - this.$ = $$[$0] -break; -case 7: case 8: - this.$=[]; -break; -case 11: -yy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6); -break; -case 12: -yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); -break; -case 13: -yy.addTask($$[$0-1], $$[$0]);this.$='task'; -break; -case 15: - yy.parseDirective('%%{', 'open_directive'); -break; -case 16: - yy.parseDirective($$[$0], 'type_directive'); -break; -case 17: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); -break; -case 18: - yy.parseDirective('}%%', 'close_directive', 'journey'); -break; -} -}, -table: [{3:1,4:$V0,7:3,12:4,21:$V1},{1:[3]},o($V2,[2,3],{5:6}),{3:7,4:$V0,7:3,12:4,21:$V1},{13:8,22:[1,9]},{22:[2,15]},{6:[1,10],7:18,8:11,9:[1,12],10:13,11:[1,14],12:4,17:$V3,18:$V4,19:$V5,21:$V1},{1:[2,2]},{14:19,15:[1,20],24:$V6},o([15,24],[2,16]),o($V2,[2,8],{1:[2,1]}),o($V2,[2,4]),{7:18,10:22,12:4,17:$V3,18:$V4,19:$V5,21:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,11]),o($V2,[2,12]),{20:[1,23]},o($V2,[2,14]),{11:[1,24]},{16:25,23:[1,26]},{11:[2,18]},o($V2,[2,5]),o($V2,[2,13]),o($V7,[2,9]),{14:27,24:$V6},{24:[2,17]},{11:[1,28]},o($V7,[2,10])], -defaultActions: {5:[2,15],7:[2,2],21:[2,18],26:[2,17]}, -parseError: function parseError (str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - var error = new Error(str); - error.hash = hash; - throw error; - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = tstack.pop() || lexer.lex() || EOF; - if (typeof token !== 'number') { - if (token instanceof Array) { - tstack = token; - token = tstack.pop(); - } - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; - -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function(match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex () { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin (condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState () { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules () { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState (n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState (condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {"case-insensitive":true}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0: this.begin('open_directive'); return 21; -break; -case 1: this.begin('type_directive'); return 22; -break; -case 2: this.popState(); this.begin('arg_directive'); return 15; -break; -case 3: this.popState(); this.popState(); return 24; -break; -case 4:return 23; -break; -case 5:/* skip comments */ -break; -case 6:/* skip comments */ -break; -case 7:return 11; -break; -case 8:/* skip whitespace */ -break; -case 9:/* skip comments */ -break; -case 10:return 4; -break; -case 11:return 17; -break; -case 12:return 18; -break; -case 13:return 19; -break; -case 14:return 20; -break; -case 15:return 15; -break; -case 16:return 6; -break; -case 17:return 'INVALID'; -break; -} -}, -rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i], -conditions: {"open_directive":{"rules":[1],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,12,13,14,15,16,17],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (true) { -exports.parser = parser; -exports.Parser = parser.Parser; -exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain (args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if ( true && __webpack_require__.c[__webpack_require__.s] === module) { - exports.main(process.argv.slice(1)); -} -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./src/diagrams/user-journey/styles.js": -/*!*********************************************!*\ - !*** ./src/diagrams/user-journey/styles.js ***! - \*********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -var getStyles = function getStyles(options) { - return ".label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ".concat(options.textColor, ";\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ").concat(options.textColor, "\n }\n\n .legend {\n fill: ").concat(options.textColor, ";\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ").concat(options.textColor, "\n }\n\n .face {\n fill: #FFF8DC;\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ").concat(options.arrowheadColor, ";\n }\n\n .edgePath .path {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ").concat(options.lineColor, ";\n fill: none;\n }\n\n .edgeLabel {\n background-color: ").concat(options.edgeLabelBackground, ";\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ").concat(options.titleColor, ";\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ").concat(options.tertiaryColor, ";\n border: 1px solid ").concat(options.border2, ";\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType0) : '', ";\n }\n .task-type-1, .section-type-1 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType1) : '', ";\n }\n .task-type-2, .section-type-2 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType2) : '', ";\n }\n .task-type-3, .section-type-3 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType3) : '', ";\n }\n .task-type-4, .section-type-4 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType4) : '', ";\n }\n .task-type-5, .section-type-5 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType5) : '', ";\n }\n .task-type-6, .section-type-6 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType6) : '', ";\n }\n .task-type-7, .section-type-7 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType7) : '', ";\n }\n"); -}; - -/* harmony default export */ __webpack_exports__["default"] = (getStyles); - -/***/ }), - -/***/ "./src/diagrams/user-journey/svgDraw.js": -/*!**********************************************!*\ - !*** ./src/diagrams/user-journey/svgDraw.js ***! - \**********************************************/ -/*! exports provided: drawRect, drawFace, drawCircle, drawText, drawLabel, drawSection, drawTask, drawBackgroundRect, getTextObj, getNoteRect, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawRect", function() { return drawRect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawFace", function() { return drawFace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawCircle", function() { return drawCircle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawText", function() { return drawText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawLabel", function() { return drawLabel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawSection", function() { return drawSection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawTask", function() { return drawTask; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawBackgroundRect", function() { return drawBackgroundRect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextObj", function() { return getTextObj; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNoteRect", function() { return getNoteRect; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); - -var drawRect = function drawRect(elem, rectData) { - var rectElem = elem.append('rect'); - rectElem.attr('x', rectData.x); - rectElem.attr('y', rectData.y); - rectElem.attr('fill', rectData.fill); - rectElem.attr('stroke', rectData.stroke); - rectElem.attr('width', rectData.width); - rectElem.attr('height', rectData.height); - rectElem.attr('rx', rectData.rx); - rectElem.attr('ry', rectData.ry); - - if (typeof rectData.class !== 'undefined') { - rectElem.attr('class', rectData.class); - } - - return rectElem; -}; -var drawFace = function drawFace(element, faceData) { - var radius = 15; - var circleElement = element.append('circle').attr('cx', faceData.cx).attr('cy', faceData.cy).attr('class', 'face').attr('r', radius).attr('stroke-width', 2).attr('overflow', 'visible'); - var face = element.append('g'); //left eye - - face.append('circle').attr('cx', faceData.cx - radius / 3).attr('cy', faceData.cy - radius / 3).attr('r', 1.5).attr('stroke-width', 2).attr('fill', '#666').attr('stroke', '#666'); //right eye - - face.append('circle').attr('cx', faceData.cx + radius / 3).attr('cy', faceData.cy - radius / 3).attr('r', 1.5).attr('stroke-width', 2).attr('fill', '#666').attr('stroke', '#666'); - - function smile(face) { - var arc = Object(d3__WEBPACK_IMPORTED_MODULE_0__["arc"])().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2); //mouth - - face.append('path').attr('class', 'mouth').attr('d', arc).attr('transform', 'translate(' + faceData.cx + ',' + (faceData.cy + 2) + ')'); - } - - function sad(face) { - var arc = Object(d3__WEBPACK_IMPORTED_MODULE_0__["arc"])().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2); //mouth - - face.append('path').attr('class', 'mouth').attr('d', arc).attr('transform', 'translate(' + faceData.cx + ',' + (faceData.cy + 7) + ')'); - } - - function ambivalent(face) { - face.append('line').attr('class', 'mouth').attr('stroke', 2).attr('x1', faceData.cx - 5).attr('y1', faceData.cy + 7).attr('x2', faceData.cx + 5).attr('y2', faceData.cy + 7).attr('class', 'mouth').attr('stroke-width', '1px').attr('stroke', '#666'); - } - - if (faceData.score > 3) { - smile(face); - } else if (faceData.score < 3) { - sad(face); - } else { - ambivalent(face); - } - - return circleElement; -}; -var drawCircle = function drawCircle(element, circleData) { - var circleElement = element.append('circle'); - circleElement.attr('cx', circleData.cx); - circleElement.attr('cy', circleData.cy); - circleElement.attr('fill', circleData.fill); - circleElement.attr('stroke', circleData.stroke); - circleElement.attr('r', circleData.r); - - if (typeof circleElement.class !== 'undefined') { - circleElement.attr('class', circleElement.class); - } - - if (typeof circleData.title !== 'undefined') { - circleElement.append('title').text(circleData.title); - } - - return circleElement; -}; -var drawText = function drawText(elem, textData) { - // Remove and ignore br:s - var nText = textData.text.replace(//gi, ' '); - var textElem = elem.append('text'); - textElem.attr('x', textData.x); - textElem.attr('y', textData.y); - textElem.attr('class', 'legend'); - textElem.style('text-anchor', textData.anchor); - - if (typeof textData.class !== 'undefined') { - textElem.attr('class', textData.class); - } - - var span = textElem.append('tspan'); - span.attr('x', textData.x + textData.textMargin * 2); - span.text(nText); - return textElem; -}; -var drawLabel = function drawLabel(elem, txtObject) { - function genPoints(x, y, width, height, cut) { - return x + ',' + y + ' ' + (x + width) + ',' + y + ' ' + (x + width) + ',' + (y + height - cut) + ' ' + (x + width - cut * 1.2) + ',' + (y + height) + ' ' + x + ',' + (y + height); - } - - var polygon = elem.append('polygon'); - polygon.attr('points', genPoints(txtObject.x, txtObject.y, 50, 20, 7)); - polygon.attr('class', 'labelBox'); - txtObject.y = txtObject.y + txtObject.labelMargin; - txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin; - drawText(elem, txtObject); -}; -var drawSection = function drawSection(elem, section, conf) { - var g = elem.append('g'); - var rect = getNoteRect(); - rect.x = section.x; - rect.y = section.y; - rect.fill = section.fill; - rect.width = conf.width; - rect.height = conf.height; - rect.class = 'journey-section section-type-' + section.num; - rect.rx = 3; - rect.ry = 3; - drawRect(g, rect); - - _drawTextCandidateFunc(conf)(section.text, g, rect.x, rect.y, rect.width, rect.height, { - class: 'journey-section section-type-' + section.num - }, conf, section.colour); -}; -var taskCount = -1; -/** - * Draws an actor in the diagram with the attaced line - * @param elem The HTML element - * @param task The task to render - * @param conf The global configuration - */ - -var drawTask = function drawTask(elem, task, conf) { - var center = task.x + conf.width / 2; - var g = elem.append('g'); - taskCount++; - var maxHeight = 300 + 5 * 30; - g.append('line').attr('id', 'task' + taskCount).attr('x1', center).attr('y1', task.y).attr('x2', center).attr('y2', maxHeight).attr('class', 'task-line').attr('stroke-width', '1px').attr('stroke-dasharray', '4 2').attr('stroke', '#666'); - drawFace(g, { - cx: center, - cy: 300 + (5 - task.score) * 30, - score: task.score - }); - var rect = getNoteRect(); - rect.x = task.x; - rect.y = task.y; - rect.fill = task.fill; - rect.width = conf.width; - rect.height = conf.height; - rect.class = 'task task-type-' + task.num; - rect.rx = 3; - rect.ry = 3; - drawRect(g, rect); - var xPos = task.x + 14; - task.people.forEach(function (person) { - var colour = task.actors[person]; - var circle = { - cx: xPos, - cy: task.y, - r: 7, - fill: colour, - stroke: '#000', - title: person - }; - drawCircle(g, circle); - xPos += 10; - }); - - _drawTextCandidateFunc(conf)(task.task, g, rect.x, rect.y, rect.width, rect.height, { - class: 'task' - }, conf, task.colour); -}; -/** - * Draws a background rectangle - * @param elem The html element - * @param bounds The bounds of the drawing - */ - -var drawBackgroundRect = function drawBackgroundRect(elem, bounds) { - var rectElem = drawRect(elem, { - x: bounds.startx, - y: bounds.starty, - width: bounds.stopx - bounds.startx, - height: bounds.stopy - bounds.starty, - fill: bounds.fill, - class: 'rect' - }); - rectElem.lower(); -}; -var getTextObj = function getTextObj() { - return { - x: 0, - y: 0, - fill: undefined, - 'text-anchor': 'start', - width: 100, - height: 100, - textMargin: 0, - rx: 0, - ry: 0 - }; -}; -var getNoteRect = function getNoteRect() { - return { - x: 0, - y: 0, - width: 100, - anchor: 'start', - height: 100, - rx: 0, - ry: 0 - }; -}; - -var _drawTextCandidateFunc = function () { - function byText(content, g, x, y, width, height, textAttrs, colour) { - var text = g.append('text').attr('x', x + width / 2).attr('y', y + height / 2 + 5).style('font-color', colour).style('text-anchor', 'middle').text(content); - - _setTextAttrs(text, textAttrs); - } - - function byTspan(content, g, x, y, width, height, textAttrs, conf, colour) { - var taskFontSize = conf.taskFontSize, - taskFontFamily = conf.taskFontFamily; - var lines = content.split(//gi); - - for (var i = 0; i < lines.length; i++) { - var dy = i * taskFontSize - taskFontSize * (lines.length - 1) / 2; - var text = g.append('text').attr('x', x + width / 2).attr('y', y).attr('fill', colour).style('text-anchor', 'middle').style('font-size', taskFontSize).style('font-family', taskFontFamily); - text.append('tspan').attr('x', x + width / 2).attr('dy', dy).text(lines[i]); - text.attr('y', y + height / 2.0).attr('dominant-baseline', 'central').attr('alignment-baseline', 'central'); - - _setTextAttrs(text, textAttrs); - } - } - - function byFo(content, g, x, y, width, height, textAttrs, conf) { - var body = g.append('switch'); - var f = body.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height).attr('position', 'fixed'); - var text = f.append('div').style('display', 'table').style('height', '100%').style('width', '100%'); - text.append('div').attr('class', 'label').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle') // .style('color', colour) - .text(content); - byTspan(content, body, x, y, width, height, textAttrs, conf); - - _setTextAttrs(text, textAttrs); - } - - function _setTextAttrs(toText, fromTextAttrsDict) { - for (var key in fromTextAttrsDict) { - if (key in fromTextAttrsDict) { - // eslint-disable-line - // noinspection JSUnfilteredForInLoop - toText.attr(key, fromTextAttrsDict[key]); - } - } - } - - return function (conf) { - return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan; - }; -}(); - -var initGraphics = function initGraphics(graphics) { - graphics.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 5).attr('refY', 2).attr('markerWidth', 6).attr('markerHeight', 4).attr('orient', 'auto').append('path').attr('d', 'M 0,0 V 4 L6,2 Z'); // this is actual shape for arrowhead -}; - -/* harmony default export */ __webpack_exports__["default"] = ({ - drawRect: drawRect, - drawCircle: drawCircle, - drawSection: drawSection, - drawText: drawText, - drawLabel: drawLabel, - drawTask: drawTask, - drawBackgroundRect: drawBackgroundRect, - getTextObj: getTextObj, - getNoteRect: getNoteRect, - initGraphics: initGraphics -}); - -/***/ }), - -/***/ "./src/errorRenderer.js": -/*!******************************!*\ - !*** ./src/errorRenderer.js ***! - \******************************/ -/*! exports provided: setConf, draw, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); -/** - * Created by knut on 14-12-11. - */ - - -var conf = {}; -var setConf = function setConf(cnf) { - var keys = Object.keys(cnf); - keys.forEach(function (key) { - conf[key] = cnf[key]; - }); -}; -/** - * Draws a an info picture in the tag with id: id based on the graph definition in text. - * @param text - * @param id - */ - -var draw = function draw(id, ver) { - try { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Renering svg for syntax error\n'); - var svg = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + id); - var g = svg.append('g'); - g.append('path').attr('class', 'error-icon').attr('d', 'm411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z'); - g.append('path').attr('class', 'error-icon').attr('d', 'm459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z'); - g.append('path').attr('class', 'error-icon').attr('d', 'm340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z'); - g.append('path').attr('class', 'error-icon').attr('d', 'm400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z'); - g.append('path').attr('class', 'error-icon').attr('d', 'm496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z'); - g.append('path').attr('class', 'error-icon').attr('d', 'm436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z'); - g.append('text') // text label for the x axis - .attr('class', 'error-text').attr('x', 1240).attr('y', 250).attr('font-size', '150px').style('text-anchor', 'middle').text('Syntax error in graph'); - g.append('text') // text label for the x axis - .attr('class', 'error-text').attr('x', 1050).attr('y', 400).attr('font-size', '100px').style('text-anchor', 'middle').text('mermaid version ' + ver); - svg.attr('height', 100); - svg.attr('width', 400); - svg.attr('viewBox', '768 0 512 512'); - } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].error('Error while rendering info diagram'); - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].error(e.message); - } -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - setConf: setConf, - draw: draw -}); - -/***/ }), - -/***/ "./src/logger.js": -/*!***********************!*\ - !*** ./src/logger.js ***! - \***********************/ -/*! exports provided: LEVELS, log, setLogLevel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LEVELS", function() { return LEVELS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "log", function() { return log; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLogLevel", function() { return setLogLevel; }); -/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment-mini */ "moment-mini"); -/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_mini__WEBPACK_IMPORTED_MODULE_0__); - -var LEVELS = { - debug: 1, - info: 2, - warn: 3, - error: 4, - fatal: 5 -}; -var log = { - debug: function debug() {}, - info: function info() {}, - warn: function warn() {}, - error: function error() {}, - fatal: function fatal() {} -}; -var setLogLevel = function setLogLevel() { - var level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fatal'; - - if (isNaN(level)) { - level = level.toLowerCase(); - - if (LEVELS[level] !== undefined) { - level = LEVELS[level]; - } - } - - log.trace = function () {}; - - log.debug = function () {}; - - log.info = function () {}; - - log.warn = function () {}; - - log.error = function () {}; - - log.fatal = function () {}; - - if (level <= LEVELS.fatal) { - log.fatal = console.error ? console.error.bind(console, format('FATAL'), 'color: orange') : console.log.bind(console, '\x1b[35m', format('FATAL')); - } - - if (level <= LEVELS.error) { - log.error = console.error ? console.error.bind(console, format('ERROR'), 'color: orange') : console.log.bind(console, '\x1b[31m', format('ERROR')); - } - - if (level <= LEVELS.warn) { - log.warn = console.warn ? console.warn.bind(console, format('WARN'), 'color: orange') : console.log.bind(console, "\x1B[33m", format('WARN')); - } - - if (level <= LEVELS.info) { - log.info = console.info // ? console.info.bind(console, '\x1b[34m', format('INFO'), 'color: blue') - ? console.info.bind(console, format('INFO'), 'color: lightblue') : console.log.bind(console, '\x1b[34m', format('INFO')); - } - - if (level <= LEVELS.debug) { - log.debug = console.debug ? console.debug.bind(console, format('DEBUG'), 'color: lightgreen') : console.log.bind(console, '\x1b[32m', format('DEBUG')); - } -}; - -var format = function format(level) { - var time = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()().format('ss.SSS'); - return "%c".concat(time, " : ").concat(level, " : "); -}; - -/***/ }), - -/***/ "./src/mermaid.js": -/*!************************!*\ - !*** ./src/mermaid.js ***! - \************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var entity_decode_browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! entity-decode/browser */ "entity-decode/browser"); -/* harmony import */ var entity_decode_browser__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(entity_decode_browser__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); -/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mermaidAPI */ "./src/mermaidAPI.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./src/utils.js"); -/** - * Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid functionality and to render - * the diagrams to svg code. - */ -// import { decode } from 'he'; - - - - -/** - * ## init - * Function that goes through the document to find the chart definitions in there and render them. - * - * The function tags the processed attributes with the attribute data-processed and ignores found elements with the - * attribute already set. This way the init function can be triggered several times. - * - * Optionally, `init` can accept in the second argument one of the following: - * - a DOM Node - * - an array of DOM nodes (as would come from a jQuery selector) - * - a W3C selector, a la `.mermaid` - * - * ```mermaid - * graph LR; - * a(Find elements)-->b{Processed} - * b-->|Yes|c(Leave element) - * b-->|No |d(Transform) - * ``` - * Renders the mermaid diagrams - * @param nodes a css selector or an array of nodes - */ - -var init = function init() { - var _this = this; - - var conf = _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].getConfig(); // console.log('Starting rendering diagrams (init) - mermaid.init', conf); - - var nodes; - - if (arguments.length >= 2) { - /*! sequence config was passed as #1 */ - if (typeof arguments[0] !== 'undefined') { - mermaid.sequenceConfig = arguments[0]; - } - - nodes = arguments[1]; - } else { - nodes = arguments[0]; - } // if last argument is a function this is the callback function - - - var callback; - - if (typeof arguments[arguments.length - 1] === 'function') { - callback = arguments[arguments.length - 1]; - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Callback function found'); - } else { - if (typeof conf.mermaid !== 'undefined') { - if (typeof conf.mermaid.callback === 'function') { - callback = conf.mermaid.callback; - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Callback function found'); - } else { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('No Callback function found'); - } - } - } - - nodes = nodes === undefined ? document.querySelectorAll('.mermaid') : typeof nodes === 'string' ? document.querySelectorAll(nodes) : nodes instanceof window.Node ? [nodes] : nodes; // Last case - sequence config was passed pick next - - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Start On Load before: ' + mermaid.startOnLoad); - - if (typeof mermaid.startOnLoad !== 'undefined') { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Start On Load inner: ' + mermaid.startOnLoad); - _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].updateSiteConfig({ - startOnLoad: mermaid.startOnLoad - }); - } - - if (typeof mermaid.ganttConfig !== 'undefined') { - _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].updateSiteConfig({ - gantt: mermaid.ganttConfig - }); - } - - var nextId = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].initIdGeneratior(conf.deterministicIds, conf.deterministicIDSeed).next; - var txt; - - var _loop = function _loop(i) { - var element = nodes[i]; - /*! Check if previously processed */ - - if (!element.getAttribute('data-processed')) { - element.setAttribute('data-processed', true); - } else { - return "continue"; - } - - var id = "mermaid-".concat(nextId()); // Fetch the graph definition including tags - - txt = element.innerHTML; // transforms the html to pure text - - txt = entity_decode_browser__WEBPACK_IMPORTED_MODULE_0___default()(txt).trim().replace(//gi, '
'); - var init = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].detectInit(txt); - - if (init) { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Detected early reinit: ', init); - } - - try { - _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].render(id, txt, function (svgCode, bindFunctions) { - element.innerHTML = svgCode; - - if (typeof callback !== 'undefined') { - callback(id); - } - - if (bindFunctions) bindFunctions(element); - }, element); - } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].warn('Syntax Error rendering'); - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].warn(e); - - if (_this.parseError) { - _this.parseError(e); - } - } - }; - - for (var i = 0; i < nodes.length; i++) { - var _ret = _loop(i); - - if (_ret === "continue") continue; - } -}; - -var initialize = function initialize(config) { - // mermaidAPI.reset(); - if (typeof config.mermaid !== 'undefined') { - if (typeof config.mermaid.startOnLoad !== 'undefined') { - mermaid.startOnLoad = config.mermaid.startOnLoad; - } - - if (typeof config.mermaid.htmlLabels !== 'undefined') { - mermaid.htmlLabels = config.mermaid.htmlLabels; - } - } - - _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].initialize(config); // mermaidAPI.reset(); -}; -/** - * ##contentLoaded - * Callback function that is called when page is loaded. This functions fetches configuration for mermaid rendering and - * calls init for rendering the mermaid diagrams on the page. - */ - - -var contentLoaded = function contentLoaded() { - var config; - - if (mermaid.startOnLoad) { - // No config found, do check API config - config = _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].getConfig(); - - if (config.startOnLoad) { - mermaid.init(); - } - } else { - if (typeof mermaid.startOnLoad === 'undefined') { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('In start, no config'); - config = _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].getConfig(); - - if (config.startOnLoad) { - mermaid.init(); - } - } - } -}; - -if (typeof document !== 'undefined') { - /*! - * Wait for document loaded before starting the execution - */ - window.addEventListener('load', function () { - contentLoaded(); - }, false); -} - -var mermaid = { - startOnLoad: true, - htmlLabels: true, - mermaidAPI: _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"], - parse: _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].parse, - render: _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].render, - init: init, - initialize: initialize, - contentLoaded: contentLoaded -}; -/* harmony default export */ __webpack_exports__["default"] = (mermaid); - -/***/ }), - -/***/ "./src/mermaidAPI.js": -/*!***************************!*\ - !*** ./src/mermaidAPI.js ***! - \***************************/ -/*! exports provided: encodeEntities, decodeEntities, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encodeEntities", function() { return encodeEntities; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeEntities", function() { return decodeEntities; }); -/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stylis */ "stylis"); -/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stylis__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../package.json */ "./package.json"); -var _package_json__WEBPACK_IMPORTED_MODULE_2___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../package.json */ "./package.json", 1); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./src/utils.js"); -/* harmony import */ var _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./diagrams/flowchart/flowRenderer */ "./src/diagrams/flowchart/flowRenderer.js"); -/* harmony import */ var _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./diagrams/flowchart/flowRenderer-v2 */ "./src/diagrams/flowchart/flowRenderer-v2.js"); -/* harmony import */ var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./diagrams/flowchart/parser/flow */ "./src/diagrams/flowchart/parser/flow.jison"); -/* harmony import */ var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagrams/flowchart/flowDb */ "./src/diagrams/flowchart/flowDb.js"); -/* harmony import */ var _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./diagrams/sequence/sequenceRenderer */ "./src/diagrams/sequence/sequenceRenderer.js"); -/* harmony import */ var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./diagrams/sequence/parser/sequenceDiagram */ "./src/diagrams/sequence/parser/sequenceDiagram.jison"); -/* harmony import */ var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10__); -/* harmony import */ var _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./diagrams/sequence/sequenceDb */ "./src/diagrams/sequence/sequenceDb.js"); -/* harmony import */ var _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./diagrams/gantt/ganttRenderer */ "./src/diagrams/gantt/ganttRenderer.js"); -/* harmony import */ var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./diagrams/gantt/parser/gantt */ "./src/diagrams/gantt/parser/gantt.jison"); -/* harmony import */ var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13__); -/* harmony import */ var _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./diagrams/gantt/ganttDb */ "./src/diagrams/gantt/ganttDb.js"); -/* harmony import */ var _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./diagrams/class/classRenderer */ "./src/diagrams/class/classRenderer.js"); -/* harmony import */ var _diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./diagrams/class/classRenderer-v2 */ "./src/diagrams/class/classRenderer-v2.js"); -/* harmony import */ var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./diagrams/class/parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison"); -/* harmony import */ var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17__); -/* harmony import */ var _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./diagrams/class/classDb */ "./src/diagrams/class/classDb.js"); -/* harmony import */ var _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./diagrams/state/stateRenderer */ "./src/diagrams/state/stateRenderer.js"); -/* harmony import */ var _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./diagrams/state/stateRenderer-v2 */ "./src/diagrams/state/stateRenderer-v2.js"); -/* harmony import */ var _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./diagrams/state/parser/stateDiagram */ "./src/diagrams/state/parser/stateDiagram.jison"); -/* harmony import */ var _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21__); -/* harmony import */ var _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./diagrams/state/stateDb */ "./src/diagrams/state/stateDb.js"); -/* harmony import */ var _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./diagrams/git/gitGraphRenderer */ "./src/diagrams/git/gitGraphRenderer.js"); -/* harmony import */ var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./diagrams/git/parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison"); -/* harmony import */ var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_24__); -/* harmony import */ var _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./diagrams/git/gitGraphAst */ "./src/diagrams/git/gitGraphAst.js"); -/* harmony import */ var _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./diagrams/info/infoRenderer */ "./src/diagrams/info/infoRenderer.js"); -/* harmony import */ var _errorRenderer__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./errorRenderer */ "./src/errorRenderer.js"); -/* harmony import */ var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./diagrams/info/parser/info */ "./src/diagrams/info/parser/info.jison"); -/* harmony import */ var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(_diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_28__); -/* harmony import */ var _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./diagrams/info/infoDb */ "./src/diagrams/info/infoDb.js"); -/* harmony import */ var _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./diagrams/pie/pieRenderer */ "./src/diagrams/pie/pieRenderer.js"); -/* harmony import */ var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./diagrams/pie/parser/pie */ "./src/diagrams/pie/parser/pie.jison"); -/* harmony import */ var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_31___default = /*#__PURE__*/__webpack_require__.n(_diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_31__); -/* harmony import */ var _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./diagrams/pie/pieDb */ "./src/diagrams/pie/pieDb.js"); -/* harmony import */ var _diagrams_er_erDb__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./diagrams/er/erDb */ "./src/diagrams/er/erDb.js"); -/* harmony import */ var _diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./diagrams/er/parser/erDiagram */ "./src/diagrams/er/parser/erDiagram.jison"); -/* harmony import */ var _diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_34___default = /*#__PURE__*/__webpack_require__.n(_diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_34__); -/* harmony import */ var _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./diagrams/er/erRenderer */ "./src/diagrams/er/erRenderer.js"); -/* harmony import */ var _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./diagrams/user-journey/parser/journey */ "./src/diagrams/user-journey/parser/journey.jison"); -/* harmony import */ var _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_36___default = /*#__PURE__*/__webpack_require__.n(_diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_36__); -/* harmony import */ var _diagrams_user_journey_journeyDb__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./diagrams/user-journey/journeyDb */ "./src/diagrams/user-journey/journeyDb.js"); -/* harmony import */ var _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./diagrams/user-journey/journeyRenderer */ "./src/diagrams/user-journey/journeyRenderer.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./config */ "./src/config.js"); -/* harmony import */ var _styles__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./styles */ "./src/styles.js"); -/* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./themes */ "./src/themes/index.js"); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/** - *Edit this Page[![N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/src/mermaidAPI.js) - * - *This is the API to be used when optionally handling the integration with the web page, instead of using the default integration provided by mermaid.js. - * - * - * The core of this api is the [**render**](Setup.md?id=render) function which, given a graph - * definition as text, renders the graph/diagram and returns an svg element for the graph. - * - * It is is then up to the user of the API to make use of the svg, either insert it somewhere in the page or do something completely different. - * - * In addition to the render function, a number of behavioral configuration options are available. - * - * @name mermaidAPI - */ - - - // import * as configApi from './config'; -// // , { -// // setConfig, -// // configApi.getConfig, -// // configApi.updateSiteConfig, -// // configApi.setSiteConfig, -// // configApi.getSiteConfig, -// // configApi.defaultConfig -// // } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function parse(text) { - var graphInit = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].detectInit(text); - - if (graphInit) { - reinitialize(graphInit); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('reinit ', graphInit); - } - - var graphType = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].detectType(text); - var parser; - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Type ' + graphType); - - switch (graphType) { - case 'git': - parser = _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_24___default.a; - parser.parser.yy = _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_25__["default"]; - break; - - case 'flowchart': - _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].clear(); - parser = _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default.a; - parser.parser.yy = _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"]; - break; - - case 'flowchart-v2': - _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].clear(); - parser = _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default.a; - parser.parser.yy = _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"]; - break; - - case 'sequence': - parser = _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10___default.a; - parser.parser.yy = _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_11__["default"]; - break; - - case 'gantt': - parser = _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13___default.a; - parser.parser.yy = _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__["default"]; - break; - - case 'class': - parser = _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17___default.a; - parser.parser.yy = _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_18__["default"]; - break; - - case 'classDiagram': - parser = _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17___default.a; - parser.parser.yy = _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_18__["default"]; - break; - - case 'state': - parser = _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21___default.a; - parser.parser.yy = _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_22__["default"]; - break; - - case 'stateDiagram': - parser = _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21___default.a; - parser.parser.yy = _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_22__["default"]; - break; - - case 'info': - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('info info info'); - parser = _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_28___default.a; - parser.parser.yy = _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_29__["default"]; - break; - - case 'pie': - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('pie'); - parser = _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_31___default.a; - parser.parser.yy = _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_32__["default"]; - break; - - case 'er': - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('er'); - parser = _diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_34___default.a; - parser.parser.yy = _diagrams_er_erDb__WEBPACK_IMPORTED_MODULE_33__["default"]; - break; - - case 'journey': - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Journey'); - parser = _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_36___default.a; - parser.parser.yy = _diagrams_user_journey_journeyDb__WEBPACK_IMPORTED_MODULE_37__["default"]; - break; - } - - parser.parser.yy.graphType = graphType; - - parser.parser.yy.parseError = function (str, hash) { - var error = { - str: str, - hash: hash - }; - throw error; - }; - - parser.parse(text); - return parser; -} - -var encodeEntities = function encodeEntities(text) { - var txt = text; - txt = txt.replace(/style.*:\S*#.*;/g, function (s) { - var innerTxt = s.substring(0, s.length - 1); - return innerTxt; - }); - txt = txt.replace(/classDef.*:\S*#.*;/g, function (s) { - var innerTxt = s.substring(0, s.length - 1); - return innerTxt; - }); - txt = txt.replace(/#\w+;/g, function (s) { - var innerTxt = s.substring(1, s.length - 1); - var isInt = /^\+?\d+$/.test(innerTxt); - - if (isInt) { - return 'fl°°' + innerTxt + '¶ß'; - } else { - return 'fl°' + innerTxt + '¶ß'; - } - }); - return txt; -}; -var decodeEntities = function decodeEntities(text) { - var txt = text; - txt = txt.replace(/fl°°/g, function () { - return '&#'; - }); - txt = txt.replace(/fl°/g, function () { - return '&'; - }); - txt = txt.replace(/¶ß/g, function () { - return ';'; - }); - return txt; -}; -/** - * Function that renders an svg with a graph from a chart definition. Usage example below. - * - * ```js - * mermaidAPI.initialize({ - * startOnLoad:true - * }); - * $(function(){ - * const graphDefinition = 'graph TB\na-->b'; - * const cb = function(svgGraph){ - * console.log(svgGraph); - * }; - * mermaidAPI.render('id1',graphDefinition,cb); - * }); - *``` - * @param id the id of the element to be rendered - * @param _txt the graph definition - * @param cb callback which is called after rendering is finished with the svg code as inparam. - * @param container selector to element in which a div with the graph temporarily will be inserted. In one is - * provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is - * completed. - */ - -var render = function render(id, _txt, cb, container) { - _config__WEBPACK_IMPORTED_MODULE_39__["reset"](); - var txt = _txt; - var graphInit = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].detectInit(txt); - - if (graphInit) { - _config__WEBPACK_IMPORTED_MODULE_39__["addDirective"](graphInit); - } // else { - // configApi.reset(); - // const siteConfig = configApi.getSiteConfig(); - // configApi.addDirective(siteConfig); - // } - // console.warn('Render fetching config'); - - - var cnf = _config__WEBPACK_IMPORTED_MODULE_39__["getConfig"](); // Check the maximum allowed text size - - if (_txt.length > cnf.maxTextSize) { - txt = 'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa'; - } - - if (typeof container !== 'undefined') { - container.innerHTML = ''; - Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])(container).append('div').attr('id', 'd' + id).attr('style', 'font-family: ' + cnf.fontFamily).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g'); - } else { - var existingSvg = document.getElementById(id); - - if (existingSvg) { - existingSvg.remove(); - } - - var _element = document.querySelector('#' + 'd' + id); - - if (_element) { - _element.remove(); - } - - Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('body').append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g'); - } - - window.txt = txt; - txt = encodeEntities(txt); - var element = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#d' + id).node(); - var graphType = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].detectType(txt); // insert inline style into svg - - var svg = element.firstChild; - var firstChild = svg.firstChild; - var userStyles = ''; // user provided theme CSS - - if (cnf.themeCSS !== undefined) { - userStyles += "\n".concat(cnf.themeCSS); - } // user provided theme CSS - - - if (cnf.fontFamily !== undefined) { - userStyles += "\n:root { --mermaid-font-family: ".concat(cnf.fontFamily, "}"); - } // user provided theme CSS - - - if (cnf.altFontFamily !== undefined) { - userStyles += "\n:root { --mermaid-alt-font-family: ".concat(cnf.altFontFamily, "}"); - } // classDef - - - if (graphType === 'flowchart' || graphType === 'flowchart-v2' || graphType === 'graph') { - var classes = _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__["default"].getClasses(txt); - - for (var className in classes) { - userStyles += "\n.".concat(className, " > * { ").concat(classes[className].styles.join(' !important; '), " !important; }"); - - if (classes[className].textStyles) { - userStyles += "\n.".concat(className, " tspan { ").concat(classes[className].textStyles.join(' !important; '), " !important; }"); - } - } - } // log.warn(cnf.themeVariables); - - - var stylis = new stylis__WEBPACK_IMPORTED_MODULE_0___default.a(); - var rules = stylis("#".concat(id), Object(_styles__WEBPACK_IMPORTED_MODULE_40__["default"])(graphType, userStyles, cnf.themeVariables)); - var style1 = document.createElement('style'); - style1.innerHTML = rules; - svg.insertBefore(style1, firstChild); // Verify that the generated svgs are ok before removing this - // const style2 = document.createElement('style'); - // const cs = window.getComputedStyle(svg); - // style2.innerHTML = `#d${id} * { - // color: ${cs.color}; - // // font: ${cs.font}; - // // font-family: Arial; - // // font-size: 24px; - // }`; - // svg.insertBefore(style2, firstChild); - - try { - switch (graphType) { - case 'git': - cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_23__["default"].setConf(cnf.git); - _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_23__["default"].draw(txt, id, false); - break; - - case 'flowchart': - cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__["default"].setConf(cnf.flowchart); - _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__["default"].draw(txt, id, false); - break; - - case 'flowchart-v2': - cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_6__["default"].setConf(cnf.flowchart); - _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_6__["default"].draw(txt, id, false); - break; - - case 'sequence': - cnf.sequence.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - - if (cnf.sequenceDiagram) { - // backwards compatibility - _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(Object.assign(cnf.sequence, cnf.sequenceDiagram)); - console.error('`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.'); - } else { - _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(cnf.sequence); - } - - _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].draw(txt, id); - break; - - case 'gantt': - cnf.gantt.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].setConf(cnf.gantt); - _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].draw(txt, id); - break; - - case 'class': - cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__["default"].setConf(cnf.class); - _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__["default"].draw(txt, id); - break; - - case 'classDiagram': - cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_16__["default"].setConf(cnf.class); - _diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_16__["default"].draw(txt, id); - break; - - case 'state': - cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_19__["default"].setConf(cnf.state); - _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_19__["default"].draw(txt, id); - break; - - case 'stateDiagram': - cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_20__["default"].setConf(cnf.state); - _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_20__["default"].draw(txt, id); - break; - - case 'info': - cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_26__["default"].setConf(cnf.class); - _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_26__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); - break; - - case 'pie': - cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_30__["default"].setConf(cnf.pie); - _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_30__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); - break; - - case 'er': - _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_35__["default"].setConf(cnf.er); - _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_35__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); - break; - - case 'journey': - _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_38__["default"].setConf(cnf.journey); - _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_38__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); - break; - } - } catch (e) { - // errorRenderer.setConf(cnf.class); - _errorRenderer__WEBPACK_IMPORTED_MODULE_27__["default"].draw(id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); - throw e; - } - - Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(id, "\"]")).selectAll('foreignobject > *').attr('xmlns', 'http://www.w3.org/1999/xhtml'); // if (cnf.arrowMarkerAbsolute) { - // url = - // window.location.protocol + - // '//' + - // window.location.host + - // window.location.pathname + - // window.location.search; - // url = url.replace(/\(/g, '\\('); - // url = url.replace(/\)/g, '\\)'); - // } - // Fix for when the base tag is used - - var svgCode = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#d' + id).node().innerHTML; - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('cnf.arrowMarkerAbsolute', cnf.arrowMarkerAbsolute); - - if (!cnf.arrowMarkerAbsolute || cnf.arrowMarkerAbsolute === 'false') { - svgCode = svgCode.replace(/marker-end="url\(.*?#/g, 'marker-end="url(#', 'g'); - } - - svgCode = decodeEntities(svgCode); // Fix for when the br tag is used - - svgCode = svgCode.replace(/
/g, '
'); - - if (typeof cb !== 'undefined') { - switch (graphType) { - case 'flowchart': - case 'flowchart-v2': - cb(svgCode, _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].bindFunctions); - break; - - case 'gantt': - cb(svgCode, _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__["default"].bindFunctions); - break; - - case 'class': - case 'classDiagram': - cb(svgCode, _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_18__["default"].bindFunctions); - break; - - default: - cb(svgCode); - } - } else { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('CB = undefined!'); - } - - var node = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#d' + id).node(); - - if (node !== null && typeof node.remove === 'function') { - Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#d' + id).node().remove(); - } - - return svgCode; -}; - -var currentDirective = {}; - -var parseDirective = function parseDirective(p, statement, context, type) { - try { - if (statement !== undefined) { - statement = statement.trim(); - - switch (context) { - case 'open_directive': - currentDirective = {}; - break; - - case 'type_directive': - currentDirective.type = statement.toLowerCase(); - break; - - case 'arg_directive': - currentDirective.args = JSON.parse(statement); - break; - - case 'close_directive': - handleDirective(p, currentDirective, type); - currentDirective = null; - break; - } - } - } catch (error) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error("Error while rendering sequenceDiagram directive: ".concat(statement, " jison context: ").concat(context)); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error(error.message); - } -}; - -var handleDirective = function handleDirective(p, directive, type) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug("Directive type=".concat(directive.type, " with args:"), directive.args); - - switch (directive.type) { - case 'init': - case 'initialize': - { - ['config'].forEach(function (prop) { - if (typeof directive.args[prop] !== 'undefined') { - if (type === 'flowchart-v2') { - type = 'flowchart'; - } - - directive.args[type] = directive.args[prop]; - delete directive.args[prop]; - } - }); - reinitialize(directive.args); - _config__WEBPACK_IMPORTED_MODULE_39__["addDirective"](directive.args); - break; - } - - case 'wrap': - case 'nowrap': - if (p && p['setWrap']) { - p.setWrap(directive.type === 'wrap'); - } - - break; - - default: - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].warn("Unhandled directive: source: '%%{".concat(directive.type, ": ").concat(JSON.stringify(directive.args ? directive.args : {}), "}%%"), directive); - break; - } -}; - -function updateRendererConfigs(conf) { - _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_23__["default"].setConf(conf.git); - _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__["default"].setConf(conf.flowchart); - _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_6__["default"].setConf(conf.flowchart); - - if (typeof conf['sequenceDiagram'] !== 'undefined') { - _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(Object(_utils__WEBPACK_IMPORTED_MODULE_4__["assignWithDepth"])(conf.sequence, conf['sequenceDiagram'])); - } - - _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(conf.sequence); - _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].setConf(conf.gantt); - _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__["default"].setConf(conf.class); - _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_19__["default"].setConf(conf.state); - _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_20__["default"].setConf(conf.state); - _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_26__["default"].setConf(conf.class); - _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_30__["default"].setConf(conf.class); - _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_35__["default"].setConf(conf.er); - _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_38__["default"].setConf(conf.journey); - _errorRenderer__WEBPACK_IMPORTED_MODULE_27__["default"].setConf(conf.class); -} - -function reinitialize() {// `mermaidAPI.reinitialize: v${pkg.version}`, - // JSON.stringify(options), - // options.themeVariables.primaryColor; - // // if (options.theme && theme[options.theme]) { - // // options.themeVariables = theme[options.theme].getThemeVariables(options.themeVariables); - // // } - // // Set default options - // const config = - // typeof options === 'object' ? configApi.setConfig(options) : configApi.getSiteConfig(); - // updateRendererConfigs(config); - // setLogLevel(config.logLevel); - // log.debug('mermaidAPI.reinitialize: ', config); -} - -function initialize(options) { - // console.warn(`mermaidAPI.initialize: v${pkg.version} `, options); - // Handle legacy location of font-family configuration - if (options && options.fontFamily) { - if (!options.themeVariables) { - options.themeVariables = { - fontFamily: options.fontFamily - }; - } else { - if (!options.themeVariables.fontFamily) { - options.themeVariables = { - fontFamily: options.fontFamily - }; - } - } - } // Set default options - - - _config__WEBPACK_IMPORTED_MODULE_39__["saveConfigFromInitilize"](options); - - if (options && options.theme && _themes__WEBPACK_IMPORTED_MODULE_41__["default"][options.theme]) { - // Todo merge with user options - options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_41__["default"][options.theme].getThemeVariables(options.themeVariables); - } else { - if (options) options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_41__["default"].default.getThemeVariables(options.themeVariables); - } - - var config = _typeof(options) === 'object' ? _config__WEBPACK_IMPORTED_MODULE_39__["setSiteConfig"](options) : _config__WEBPACK_IMPORTED_MODULE_39__["getSiteConfig"](); - updateRendererConfigs(config); - Object(_logger__WEBPACK_IMPORTED_MODULE_3__["setLogLevel"])(config.logLevel); // log.debug('mermaidAPI.initialize: ', config); -} - -var mermaidAPI = Object.freeze({ - render: render, - parse: parse, - parseDirective: parseDirective, - initialize: initialize, - reinitialize: reinitialize, - getConfig: _config__WEBPACK_IMPORTED_MODULE_39__["getConfig"], - setConfig: _config__WEBPACK_IMPORTED_MODULE_39__["setConfig"], - getSiteConfig: _config__WEBPACK_IMPORTED_MODULE_39__["getSiteConfig"], - updateSiteConfig: _config__WEBPACK_IMPORTED_MODULE_39__["updateSiteConfig"], - reset: function reset() { - // console.warn('reset'); - _config__WEBPACK_IMPORTED_MODULE_39__["reset"](); // const siteConfig = configApi.getSiteConfig(); - // updateRendererConfigs(siteConfig); - }, - globalReset: function globalReset() { - _config__WEBPACK_IMPORTED_MODULE_39__["reset"](_config__WEBPACK_IMPORTED_MODULE_39__["defaultConfig"]); - updateRendererConfigs(_config__WEBPACK_IMPORTED_MODULE_39__["getConfig"]()); - }, - defaultConfig: _config__WEBPACK_IMPORTED_MODULE_39__["defaultConfig"] -}); -Object(_logger__WEBPACK_IMPORTED_MODULE_3__["setLogLevel"])(_config__WEBPACK_IMPORTED_MODULE_39__["getConfig"]().logLevel); -_config__WEBPACK_IMPORTED_MODULE_39__["reset"](_config__WEBPACK_IMPORTED_MODULE_39__["getConfig"]()); -/* harmony default export */ __webpack_exports__["default"] = (mermaidAPI); -/** - * ## mermaidAPI configuration defaults - * - * ```html - * - * ``` - */ - -/***/ }), - -/***/ "./src/styles.js": -/*!***********************!*\ - !*** ./src/styles.js ***! - \***********************/ -/*! exports provided: calcThemeVariables, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calcThemeVariables", function() { return calcThemeVariables; }); -/* harmony import */ var _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diagrams/class/styles */ "./src/diagrams/class/styles.js"); -/* harmony import */ var _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./diagrams/er/styles */ "./src/diagrams/er/styles.js"); -/* harmony import */ var _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./diagrams/flowchart/styles */ "./src/diagrams/flowchart/styles.js"); -/* harmony import */ var _diagrams_gantt_styles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./diagrams/gantt/styles */ "./src/diagrams/gantt/styles.js"); -/* harmony import */ var _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./diagrams/git/styles */ "./src/diagrams/git/styles.js"); -/* harmony import */ var _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./diagrams/info/styles */ "./src/diagrams/info/styles.js"); -/* harmony import */ var _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./diagrams/pie/styles */ "./src/diagrams/pie/styles.js"); -/* harmony import */ var _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./diagrams/sequence/styles */ "./src/diagrams/sequence/styles.js"); -/* harmony import */ var _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagrams/state/styles */ "./src/diagrams/state/styles.js"); -/* harmony import */ var _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./diagrams/user-journey/styles */ "./src/diagrams/user-journey/styles.js"); - - - - - - - - - - -var themes = { - flowchart: _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_2__["default"], - 'flowchart-v2': _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_2__["default"], - sequence: _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_7__["default"], - gantt: _diagrams_gantt_styles__WEBPACK_IMPORTED_MODULE_3__["default"], - classDiagram: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_0__["default"], - 'classDiagram-v2': _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_0__["default"], - class: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_0__["default"], - stateDiagram: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_8__["default"], - state: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_8__["default"], - git: _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_4__["default"], - info: _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_5__["default"], - pie: _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_6__["default"], - er: _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_1__["default"], - journey: _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_9__["default"] -}; -var calcThemeVariables = function calcThemeVariables(theme, userOverRides) { - return theme.calcColors(userOverRides); -}; - -var getStyles = function getStyles(type, userStyles, options) { - //console.warn('options in styles: ', options); - return " {\n font-family: ".concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n fill: ").concat(options.textColor, "\n }\n\n /* Classes common for multiple diagrams */\n\n .error-icon {\n fill: ").concat(options.errorBkgColor, ";\n }\n .error-text {\n fill: ").concat(options.errorTextColor, ";\n stroke: ").concat(options.errorTextColor, ";\n }\n\n .edge-thickness-normal {\n stroke-width: 2px;\n }\n .edge-thickness-thick {\n stroke-width: 3.5px\n }\n .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n\n .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n .marker {\n fill: ").concat(options.lineColor, ";\n stroke: ").concat(options.lineColor, ";\n }\n .marker.cross {\n stroke: ").concat(options.lineColor, ";\n }\n\n svg {\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n }\n\n ").concat(themes[type](options), "\n\n ").concat(userStyles, "\n\n ").concat(type, " { fill: apa;}\n"); -}; - -/* harmony default export */ __webpack_exports__["default"] = (getStyles); - -/***/ }), - -/***/ "./src/themes/index.js": -/*!*****************************!*\ - !*** ./src/themes/index.js ***! - \*****************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _theme_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./theme-base */ "./src/themes/theme-base.js"); -/* harmony import */ var _theme_dark__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-dark */ "./src/themes/theme-dark.js"); -/* harmony import */ var _theme_default__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./theme-default */ "./src/themes/theme-default.js"); -/* harmony import */ var _theme_forest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./theme-forest */ "./src/themes/theme-forest.js"); -/* harmony import */ var _theme_neutral__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./theme-neutral */ "./src/themes/theme-neutral.js"); - - - - - -/* harmony default export */ __webpack_exports__["default"] = ({ - base: { - getThemeVariables: _theme_base__WEBPACK_IMPORTED_MODULE_0__["getThemeVariables"] - }, - dark: { - getThemeVariables: _theme_dark__WEBPACK_IMPORTED_MODULE_1__["getThemeVariables"] - }, - default: { - getThemeVariables: _theme_default__WEBPACK_IMPORTED_MODULE_2__["getThemeVariables"] - }, - forest: { - getThemeVariables: _theme_forest__WEBPACK_IMPORTED_MODULE_3__["getThemeVariables"] - }, - neutral: { - getThemeVariables: _theme_neutral__WEBPACK_IMPORTED_MODULE_4__["getThemeVariables"] - } -}); - -/***/ }), - -/***/ "./src/themes/theme-base.js": -/*!**********************************!*\ - !*** ./src/themes/theme-base.js ***! - \**********************************/ -/*! exports provided: getThemeVariables */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getThemeVariables", function() { return getThemeVariables; }); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - - - - -var Theme = -/*#__PURE__*/ -function () { - function Theme() { - _classCallCheck(this, Theme); - - /** # Base variables */ - - /** * background - used to know what the background color is of the diagram. This is used for deducing colors for istance line color. Defaulr value is #f4f4f4. */ - this.background = '#f4f4f4'; - this.darkMode = false; // this.background = '#0c0c0c'; - // this.darkMode = true; - - this.primaryColor = '#fff4dd'; // this.background = '#0c0c0c'; - // this.primaryColor = '#1f1f00'; - - this.noteBkgColor = '#fff5ad'; - this.noteTextColor = '#333'; // dark - // this.primaryColor = '#034694'; - // this.primaryColor = '#f2ee7e'; - // this.primaryColor = '#9f33be'; - // this.primaryColor = '#f0fff0'; - // this.primaryColor = '#fa255e'; - // this.primaryColor = '#ECECFF'; - // this.secondaryColor = '#c39ea0'; - // this.tertiaryColor = '#f8e5e5'; - // this.secondaryColor = '#dfdfde'; - // this.tertiaryColor = '#CCCCFF'; - - this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; - this.fontSize = '16px'; // this.updateColors(); - } - - _createClass(Theme, [{ - key: "updateColors", - value: function updateColors() { - // The || is to make sure that if the variable has been defiend by a user override that value is to be used - - /* Main */ - this.primaryTextColor = this.primaryTextColor || (this.darkMode ? '#ddd' : '#333'); // invert(this.primaryColor); - - this.secondaryColor = this.secondaryColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -120 - }); - this.tertiaryColor = this.tertiaryColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 180, - l: 5 - }); - this.primaryBorderColor = this.primaryBorderColor || Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.primaryColor, this.darkMode); - this.secondaryBorderColor = this.secondaryBorderColor || Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.secondaryColor, this.darkMode); - this.tertiaryBorderColor = this.tertiaryBorderColor || Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.tertiaryColor, this.darkMode); - this.noteBorderColor = this.noteBorderColor || Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.noteBkgColor, this.darkMode); - this.secondaryTextColor = this.secondaryTextColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.secondaryColor); - this.tertiaryTextColor = this.tertiaryTextColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.tertiaryColor); - this.lineColor = this.lineColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); - this.textColor = this.textColor || this.primaryTextColor; - /* Flowchart variables */ - - this.nodeBkg = this.nodeBkg || this.primaryColor; - this.mainBkg = this.mainBkg || this.primaryColor; - this.nodeBorder = this.nodeBorder || this.primaryBorderColor; - this.clusterBkg = this.clusterBkg || this.tertiaryColor; - this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor; - this.defaultLinkColor = this.defaultLinkColor || this.lineColor; - this.titleColor = this.titleColor || this.tertiaryTextColor; - this.edgeLabelBackground = this.edgeLabelBackground || (this.darkMode ? Object(khroma__WEBPACK_IMPORTED_MODULE_0__["darken"])(this.secondaryColor, 30) : this.secondaryColor); - this.nodeTextColor = this.nodeTextColor || this.primaryTextColor; - /* Sequence Diagram variables */ - // this.actorBorder = lighten(this.border1, 0.5); - - this.actorBorder = this.actorBorder || this.primaryBorderColor; - this.actorBkg = this.actorBkg || this.mainBkg; - this.actorTextColor = this.actorTextColor || this.primaryTextColor; - this.actorLineColor = this.actorLineColor || 'grey'; - this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg; - this.signalColor = this.signalColor || this.textColor; - this.signalTextColor = this.signalTextColor || this.textColor; - this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder; - this.labelTextColor = this.labelTextColor || this.actorTextColor; - this.loopTextColor = this.loopTextColor || this.actorTextColor; - this.activationBorderColor = this.activationBorderColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["darken"])(this.secondaryColor, 10); - this.activationBkgColor = this.activationBkgColor || this.secondaryColor; - this.sequenceNumberColor = this.sequenceNumberColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.lineColor); - /* Gantt chart variables */ - - this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor; - this.altSectionBkgColor = this.altSectionBkgColor || 'white'; - this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor; - this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor; - this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor; - this.taskBkgColor = this.taskBkgColor || this.primaryColor; - this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor; - this.activeTaskBkgColor = this.activeTaskBkgColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.primaryColor, 23); - this.gridColor = this.gridColor || 'lightgrey'; - this.doneTaskBkgColor = this.doneTaskBkgColor || 'lightgrey'; - this.doneTaskBorderColor = this.doneTaskBorderColor || 'grey'; - this.critBorderColor = this.critBorderColor || '#ff8888'; - this.critBkgColor = this.critBkgColor || 'red'; - this.todayLineColor = this.todayLineColor || 'red'; - this.taskTextColor = this.taskTextColor || this.textColor; - this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor; - this.taskTextLightColor = this.taskTextLightColor || this.textColor; - this.taskTextColor = this.taskTextColor || this.primaryTextColor; - this.taskTextDarkColor = this.taskTextDarkColor || this.textColor; - this.taskTextClickableColor = this.taskTextClickableColor || '#003163'; - /* state colors */ - - this.labelColor = this.labelColor || this.primaryTextColor; - this.altBackground = this.altBackground || this.tertiaryColor; - this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; - this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; - /* class */ - - this.classText = this.classText || this.textColor; - /* user-journey */ - - this.fillType0 = this.fillType0 || this.primaryColor; - this.fillType1 = this.fillType1 || this.secondaryColor; - this.fillType2 = this.fillType2 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 64 - }); - this.fillType3 = this.fillType3 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: 64 - }); - this.fillType4 = this.fillType4 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -64 - }); - this.fillType5 = this.fillType5 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: -64 - }); - this.fillType6 = this.fillType6 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 128 - }); - this.fillType7 = this.fillType7 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: 128 - }); - } - }, { - key: "calculate", - value: function calculate(overrides) { - var _this = this; - - if (_typeof(overrides) !== 'object') { - // Calculate colors form base colors - this.updateColors(); - return; - } - - var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors - - keys.forEach(function (k) { - _this[k] = overrides[k]; - }); // Calculate colors form base colors - - this.updateColors(); // Copy values from overrides again in case of an override of derived value - - keys.forEach(function (k) { - _this[k] = overrides[k]; - }); - } - }]); - - return Theme; -}(); - -var getThemeVariables = function getThemeVariables(userOverrides) { - var theme = new Theme(); - theme.calculate(userOverrides); - return theme; -}; - -/***/ }), - -/***/ "./src/themes/theme-dark.js": -/*!**********************************!*\ - !*** ./src/themes/theme-dark.js ***! - \**********************************/ -/*! exports provided: getThemeVariables */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getThemeVariables", function() { return getThemeVariables; }); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - - - - -var Theme = -/*#__PURE__*/ -function () { - function Theme() { - _classCallCheck(this, Theme); - - this.background = '#333'; - this.primaryColor = '#1f2020'; - this.secondaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.primaryColor, 16); - this.tertiaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -160 - }); - this.primaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.primaryColor, this.darkMode); - this.secondaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.secondaryColor, this.darkMode); - this.tertiaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.tertiaryColor, this.darkMode); - this.primaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.primaryColor); - this.secondaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.secondaryColor); - this.tertiaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.tertiaryColor); - this.lineColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); - this.textColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); - this.mainBkg = '#1f2020'; - this.secondBkg = 'calculated'; - this.mainContrastColor = 'lightgrey'; - this.darkTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])('#323D47'), 10); - this.lineColor = 'calculated'; - this.border1 = '#81B1DB'; - this.border2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["rgba"])(255, 255, 255, 0.25); - this.arrowheadColor = 'calculated'; - this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; - this.fontSize = '16px'; - this.labelBackground = '#181818'; - this.textColor = '#ccc'; - /* Flowchart variables */ - - this.nodeBkg = 'calculated'; - this.nodeBorder = 'calculated'; - this.clusterBkg = 'calculated'; - this.clusterBorder = 'calculated'; - this.defaultLinkColor = 'calculated'; - this.titleColor = '#F9FFFE'; - this.edgeLabelBackground = 'calculated'; - /* Sequence Diagram variables */ - - this.actorBorder = 'calculated'; - this.actorBkg = 'calculated'; - this.actorTextColor = 'calculated'; - this.actorLineColor = 'calculated'; - this.signalColor = 'calculated'; - this.signalTextColor = 'calculated'; - this.labelBoxBkgColor = 'calculated'; - this.labelBoxBorderColor = 'calculated'; - this.labelTextColor = 'calculated'; - this.loopTextColor = 'calculated'; - this.noteBorderColor = 'calculated'; - this.noteBkgColor = '#fff5ad'; - this.noteTextColor = 'calculated'; - this.activationBorderColor = 'calculated'; - this.activationBkgColor = 'calculated'; - this.sequenceNumberColor = 'black'; - /* Gantt chart variables */ - - this.sectionBkgColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["darken"])('#EAE8D9', 30); - this.altSectionBkgColor = 'calculated'; - this.sectionBkgColor2 = '#EAE8D9'; - this.taskBorderColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["rgba"])(255, 255, 255, 70); - this.taskBkgColor = 'calculated'; - this.taskTextColor = 'calculated'; - this.taskTextLightColor = 'calculated'; - this.taskTextOutsideColor = 'calculated'; - this.taskTextClickableColor = '#003163'; - this.activeTaskBorderColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["rgba"])(255, 255, 255, 50); - this.activeTaskBkgColor = '#81B1DB'; - this.gridColor = 'calculated'; - this.doneTaskBkgColor = 'calculated'; - this.doneTaskBorderColor = 'grey'; - this.critBorderColor = '#E83737'; - this.critBkgColor = '#E83737'; - this.taskTextDarkColor = 'calculated'; - this.todayLineColor = '#DB5757'; - /* state colors */ - - this.labelColor = 'calculated'; - this.errorBkgColor = '#a44141'; - this.errorTextColor = '#ddd'; - } - - _createClass(Theme, [{ - key: "updateColors", - value: function updateColors() { - this.secondBkg = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.mainBkg, 16); - this.lineColor = this.mainContrastColor; - this.arrowheadColor = this.mainContrastColor; - /* Flowchart variables */ - - this.nodeBkg = this.mainBkg; - this.nodeBorder = this.border1; - this.clusterBkg = this.secondBkg; - this.clusterBorder = this.border2; - this.defaultLinkColor = this.lineColor; - this.edgeLabelBackground = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.labelBackground, 25); - /* Sequence Diagram variables */ - - this.actorBorder = this.border1; - this.actorBkg = this.mainBkg; - this.actorTextColor = this.mainContrastColor; - this.actorLineColor = this.mainContrastColor; - this.signalColor = this.mainContrastColor; - this.signalTextColor = this.mainContrastColor; - this.labelBoxBkgColor = this.actorBkg; - this.labelBoxBorderColor = this.actorBorder; - this.labelTextColor = this.mainContrastColor; - this.loopTextColor = this.mainContrastColor; - this.noteBorderColor = this.border2; - this.noteTextColor = this.mainBkg; - this.activationBorderColor = this.border1; - this.activationBkgColor = this.secondBkg; - /* Gantt chart variables */ - - this.altSectionBkgColor = this.background; - this.taskBkgColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.mainBkg, 23); - this.taskTextColor = this.darkTextColor; - this.taskTextLightColor = this.mainContrastColor; - this.taskTextOutsideColor = this.taskTextLightColor; - this.gridColor = this.mainContrastColor; - this.doneTaskBkgColor = this.mainContrastColor; - this.taskTextDarkColor = this.darkTextColor; - /* state colors */ - - this.labelColor = this.textColor; - this.altBackground = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.background, 20); - this.fillType0 = this.primaryColor; - this.fillType1 = this.secondaryColor; - this.fillType2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 64 - }); - this.fillType3 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: 64 - }); - this.fillType4 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -64 - }); - this.fillType5 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: -64 - }); - this.fillType6 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 128 - }); - this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: 128 - }); - /* class */ - - this.classText = this.primaryTextColor; - } - }, { - key: "calculate", - value: function calculate(overrides) { - var _this = this; - - if (_typeof(overrides) !== 'object') { - // Calculate colors form base colors - this.updateColors(); - return; - } - - var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors - - keys.forEach(function (k) { - _this[k] = overrides[k]; - }); // Calculate colors form base colors - - this.updateColors(); // Copy values from overrides again in case of an override of derived value - - keys.forEach(function (k) { - _this[k] = overrides[k]; - }); - } - }]); - - return Theme; -}(); - -var getThemeVariables = function getThemeVariables(userOverrides) { - var theme = new Theme(); - theme.calculate(userOverrides); - return theme; -}; - -/***/ }), - -/***/ "./src/themes/theme-default.js": -/*!*************************************!*\ - !*** ./src/themes/theme-default.js ***! - \*************************************/ -/*! exports provided: getThemeVariables */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getThemeVariables", function() { return getThemeVariables; }); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - - - - -var Theme = -/*#__PURE__*/ -function () { - function Theme() { - _classCallCheck(this, Theme); - - /* Base variables */ - this.background = '#f4f4f4'; - this.primaryColor = '#ECECFF'; - this.secondaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 120 - }); - this.secondaryColor = '#ffffde'; - this.tertiaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -160 - }); - this.primaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.primaryColor, this.darkMode); - this.secondaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.secondaryColor, this.darkMode); - this.tertiaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode); - - this.primaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.primaryColor); - this.secondaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.secondaryColor); - this.tertiaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.tertiaryColor); - this.lineColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); - this.textColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); - this.background = 'white'; - this.mainBkg = '#ECECFF'; - this.secondBkg = '#ffffde'; - this.lineColor = '#333333'; - this.border1 = '#9370DB'; - this.border2 = '#aaaa33'; - this.arrowheadColor = '#333333'; - this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; - this.fontSize = '16px'; - this.labelBackground = '#e8e8e8'; - this.textColor = '#333'; - /* Flowchart variables */ - - this.nodeBkg = 'calculated'; - this.nodeBorder = 'calculated'; - this.clusterBkg = 'calculated'; - this.clusterBorder = 'calculated'; - this.defaultLinkColor = 'calculated'; - this.titleColor = 'calculated'; - this.edgeLabelBackground = 'calculated'; - /* Sequence Diagram variables */ - - this.actorBorder = 'calculated'; - this.actorBkg = 'calculated'; - this.actorTextColor = 'black'; - this.actorLineColor = 'grey'; - this.signalColor = 'calculated'; - this.signalTextColor = 'calculated'; - this.labelBoxBkgColor = 'calculated'; - this.labelBoxBorderColor = 'calculated'; - this.labelTextColor = 'calculated'; - this.loopTextColor = 'calculated'; - this.noteBorderColor = 'calculated'; - this.noteBkgColor = '#fff5ad'; - this.noteTextColor = 'calculated'; - this.activationBorderColor = '#666'; - this.activationBkgColor = '#f4f4f4'; - this.sequenceNumberColor = 'white'; - /* Gantt chart variables */ - - this.sectionBkgColor = 'calculated'; - this.altSectionBkgColor = 'calculated'; - this.sectionBkgColor2 = 'calculated'; - this.taskBorderColor = 'calculated'; - this.taskBkgColor = 'calculated'; - this.taskTextLightColor = 'calculated'; - this.taskTextColor = this.taskTextLightColor; - this.taskTextDarkColor = 'calculated'; - this.taskTextOutsideColor = this.taskTextDarkColor; - this.taskTextClickableColor = 'calculated'; - this.activeTaskBorderColor = 'calculated'; - this.activeTaskBkgColor = 'calculated'; - this.gridColor = 'calculated'; - this.doneTaskBkgColor = 'calculated'; - this.doneTaskBorderColor = 'calculated'; - this.critBorderColor = 'calculated'; - this.critBkgColor = 'calculated'; - this.todayLineColor = 'calculated'; - this.sectionBkgColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["rgba"])(102, 102, 255, 0.49); - this.altSectionBkgColor = 'white'; - this.sectionBkgColor2 = '#fff400'; - this.taskBorderColor = '#534fbc'; - this.taskBkgColor = '#8a90dd'; - this.taskTextLightColor = 'white'; - this.taskTextColor = 'calculated'; - this.taskTextDarkColor = 'black'; - this.taskTextOutsideColor = 'calculated'; - this.taskTextClickableColor = '#003163'; - this.activeTaskBorderColor = '#534fbc'; - this.activeTaskBkgColor = '#bfc7ff'; - this.gridColor = 'lightgrey'; - this.doneTaskBkgColor = 'lightgrey'; - this.doneTaskBorderColor = 'grey'; - this.critBorderColor = '#ff8888'; - this.critBkgColor = 'red'; - this.todayLineColor = 'red'; - /* state colors */ - - this.labelColor = 'black'; - this.errorBkgColor = '#552222'; - this.errorTextColor = '#552222'; - this.updateColors(); - } - - _createClass(Theme, [{ - key: "updateColors", - value: function updateColors() { - /* Flowchart variables */ - this.nodeBkg = this.mainBkg; - this.nodeBorder = this.border1; // border 1 - - this.clusterBkg = this.secondBkg; - this.clusterBorder = this.border2; - this.defaultLinkColor = this.lineColor; - this.titleColor = this.textColor; - this.edgeLabelBackground = this.labelBackground; - /* Sequence Diagram variables */ - // this.actorBorder = lighten(this.border1, 0.5); - - this.actorBorder = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.border1, 23); - this.actorBkg = this.mainBkg; - this.labelBoxBkgColor = this.actorBkg; - this.signalColor = this.textColor; - this.signalTextColor = this.textColor; - this.labelBoxBorderColor = this.actorBorder; - this.labelTextColor = this.actorTextColor; - this.loopTextColor = this.actorTextColor; - this.noteBorderColor = this.border2; - this.noteTextColor = this.actorTextColor; - /* Gantt chart variables */ - - this.taskTextColor = this.taskTextLightColor; - this.taskTextOutsideColor = this.taskTextDarkColor; - /* state colors */ - - /* class */ - - this.classText = this.primaryTextColor; - /* journey */ - - this.fillType0 = this.primaryColor; - this.fillType1 = this.secondaryColor; - this.fillType2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 64 - }); - this.fillType3 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: 64 - }); - this.fillType4 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -64 - }); - this.fillType5 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: -64 - }); - this.fillType6 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 128 - }); - this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: 128 - }); - } - }, { - key: "calculate", - value: function calculate(overrides) { - var _this = this; - - if (_typeof(overrides) !== 'object') { - // Calculate colors form base colors - this.updateColors(); - return; - } - - var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors - - keys.forEach(function (k) { - _this[k] = overrides[k]; - }); // Calculate colors form base colors - - this.updateColors(); // Copy values from overrides again in case of an override of derived value - - keys.forEach(function (k) { - _this[k] = overrides[k]; - }); - } - }]); - - return Theme; -}(); - -var getThemeVariables = function getThemeVariables(userOverrides) { - var theme = new Theme(); - theme.calculate(userOverrides); - return theme; -}; - -/***/ }), - -/***/ "./src/themes/theme-forest.js": -/*!************************************!*\ - !*** ./src/themes/theme-forest.js ***! - \************************************/ -/*! exports provided: getThemeVariables */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getThemeVariables", function() { return getThemeVariables; }); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - - - - -var Theme = -/*#__PURE__*/ -function () { - function Theme() { - _classCallCheck(this, Theme); - - /* Base vales */ - this.background = '#f4f4f4'; - this.primaryColor = '#cde498'; - this.secondaryColor = '#cdffb2'; - this.background = 'white'; - this.mainBkg = '#cde498'; - this.secondBkg = '#cdffb2'; - this.lineColor = 'green'; - this.border1 = '#13540c'; - this.border2 = '#6eaa49'; - this.arrowheadColor = 'green'; - this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; - this.fontSize = '16px'; - this.tertiaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])('#cde498', 10); - this.primaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.primaryColor, this.darkMode); - this.secondaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.secondaryColor, this.darkMode); - this.tertiaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.tertiaryColor, this.darkMode); - this.primaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.primaryColor); - this.secondaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.secondaryColor); - this.tertiaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.primaryColor); - this.lineColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); - this.textColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); - /* Flowchart variables */ - - this.nodeBkg = 'calculated'; - this.nodeBorder = 'calculated'; - this.clusterBkg = 'calculated'; - this.clusterBorder = 'calculated'; - this.defaultLinkColor = 'calculated'; - this.titleColor = '#333'; - this.edgeLabelBackground = '#e8e8e8'; - /* Sequence Diagram variables */ - - this.actorBorder = 'calculated'; - this.actorBkg = 'calculated'; - this.actorTextColor = 'black'; - this.actorLineColor = 'grey'; - this.signalColor = '#333'; - this.signalTextColor = '#333'; - this.labelBoxBkgColor = 'calculated'; - this.labelBoxBorderColor = '#326932'; - this.labelTextColor = 'calculated'; - this.loopTextColor = 'calculated'; - this.noteBorderColor = 'calculated'; - this.noteBkgColor = '#fff5ad'; - this.noteTextColor = 'calculated'; - this.activationBorderColor = '#666'; - this.activationBkgColor = '#f4f4f4'; - this.sequenceNumberColor = 'white'; - /* Gantt chart variables */ - - this.sectionBkgColor = '#6eaa49'; - this.altSectionBkgColor = 'white'; - this.sectionBkgColor2 = '#6eaa49'; - this.taskBorderColor = 'calculated'; - this.taskBkgColor = '#487e3a'; - this.taskTextLightColor = 'white'; - this.taskTextColor = 'calculated'; - this.taskTextDarkColor = 'black'; - this.taskTextOutsideColor = 'calculated'; - this.taskTextClickableColor = '#003163'; - this.activeTaskBorderColor = 'calculated'; - this.activeTaskBkgColor = 'calculated'; - this.gridColor = 'lightgrey'; - this.doneTaskBkgColor = 'lightgrey'; - this.doneTaskBorderColor = 'grey'; - this.critBorderColor = '#ff8888'; - this.critBkgColor = 'red'; - this.todayLineColor = 'red'; - /* state colors */ - - this.labelColor = 'black'; - this.errorBkgColor = '#552222'; - this.errorTextColor = '#552222'; - } - - _createClass(Theme, [{ - key: "updateColors", - value: function updateColors() { - /* Flowchart variables */ - this.nodeBkg = this.mainBkg; - this.nodeBorder = this.border1; - this.clusterBkg = this.secondBkg; - this.clusterBorder = this.border2; - this.defaultLinkColor = this.lineColor; - /* Sequence Diagram variables */ - - this.actorBorder = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["darken"])(this.mainBkg, 20); - this.actorBkg = this.mainBkg; - this.labelBoxBkgColor = this.actorBkg; - this.labelTextColor = this.actorTextColor; - this.loopTextColor = this.actorTextColor; - this.noteBorderColor = this.border2; - this.noteTextColor = this.actorTextColor; - /* Gantt chart variables */ - - this.taskBorderColor = this.border1; - this.taskTextColor = this.taskTextLightColor; - this.taskTextOutsideColor = this.taskTextDarkColor; - this.activeTaskBorderColor = this.taskBorderColor; - this.activeTaskBkgColor = this.mainBkg; - /* state colors */ - - /* class */ - - this.classText = this.primaryTextColor; - /* journey */ - - this.fillType0 = this.primaryColor; - this.fillType1 = this.secondaryColor; - this.fillType2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 64 - }); - this.fillType3 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: 64 - }); - this.fillType4 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -64 - }); - this.fillType5 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: -64 - }); - this.fillType6 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 128 - }); - this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: 128 - }); - } - }, { - key: "calculate", - value: function calculate(overrides) { - var _this = this; - - if (_typeof(overrides) !== 'object') { - // Calculate colors form base colors - this.updateColors(); - return; - } - - var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors - - keys.forEach(function (k) { - _this[k] = overrides[k]; - }); // Calculate colors form base colors - - this.updateColors(); // Copy values from overrides again in case of an override of derived value - - keys.forEach(function (k) { - _this[k] = overrides[k]; - }); - } - }]); - - return Theme; -}(); - -var getThemeVariables = function getThemeVariables(userOverrides) { - var theme = new Theme(); - theme.calculate(userOverrides); - return theme; -}; - -/***/ }), - -/***/ "./src/themes/theme-helpers.js": -/*!*************************************!*\ - !*** ./src/themes/theme-helpers.js ***! - \*************************************/ -/*! exports provided: mkBorder */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mkBorder", function() { return mkBorder; }); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); - -var mkBorder = function mkBorder(col, darkMode) { - return darkMode ? Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(col, { - s: -40, - l: 10 - }) : Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(col, { - s: -40, - l: -10 - }); -}; - -/***/ }), - -/***/ "./src/themes/theme-neutral.js": -/*!*************************************!*\ - !*** ./src/themes/theme-neutral.js ***! - \*************************************/ -/*! exports provided: getThemeVariables */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getThemeVariables", function() { return getThemeVariables; }); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - - - // const Color = require ( 'khroma/dist/color' ).default -// Color.format.hex.stringify(Color.parse('hsl(210, 66.6666666667%, 95%)')); // => "#EAF2FB" - -var Theme = -/*#__PURE__*/ -function () { - function Theme() { - _classCallCheck(this, Theme); - - this.primaryColor = '#eee'; - this.contrast = '#26a'; - this.secondaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.contrast, 55); - this.background = '#ffffff'; // this.secondaryColor = adjust(this.primaryColor, { h: 120 }); - - this.tertiaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -160 - }); - this.primaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.primaryColor, this.darkMode); - this.secondaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.secondaryColor, this.darkMode); - this.tertiaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode); - - this.primaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.primaryColor); - this.secondaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.secondaryColor); - this.tertiaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.tertiaryColor); - this.lineColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); - this.textColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); - this.altBackground = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.contrast, 55); - this.mainBkg = '#eee'; - this.secondBkg = 'calculated'; - this.lineColor = '#666'; - this.border1 = '#999'; - this.border2 = 'calculated'; - this.note = '#ffa'; - this.text = '#333'; - this.critical = '#d42'; - this.done = '#bbb'; - this.arrowheadColor = '#333333'; - this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; - this.fontSize = '16px'; - /* Flowchart variables */ - - this.nodeBkg = 'calculated'; - this.nodeBorder = 'calculated'; - this.clusterBkg = 'calculated'; - this.clusterBorder = 'calculated'; - this.defaultLinkColor = 'calculated'; - this.titleColor = 'calculated'; - this.edgeLabelBackground = 'white'; - /* Sequence Diagram variables */ - - this.actorBorder = 'calculated'; - this.actorBkg = 'calculated'; - this.actorTextColor = 'calculated'; - this.actorLineColor = 'calculated'; - this.signalColor = 'calculated'; - this.signalTextColor = 'calculated'; - this.labelBoxBkgColor = 'calculated'; - this.labelBoxBorderColor = 'calculated'; - this.labelTextColor = 'calculated'; - this.loopTextColor = 'calculated'; - this.noteBorderColor = 'calculated'; - this.noteBkgColor = 'calculated'; - this.noteTextColor = 'calculated'; - this.activationBorderColor = '#666'; - this.activationBkgColor = '#f4f4f4'; - this.sequenceNumberColor = 'white'; - /* Gantt chart variables */ - - this.sectionBkgColor = 'calculated'; - this.altSectionBkgColor = 'white'; - this.sectionBkgColor2 = 'calculated'; - this.taskBorderColor = 'calculated'; - this.taskBkgColor = 'calculated'; - this.taskTextLightColor = 'white'; - this.taskTextColor = 'calculated'; - this.taskTextDarkColor = 'calculated'; - this.taskTextOutsideColor = 'calculated'; - this.taskTextClickableColor = '#003163'; - this.activeTaskBorderColor = 'calculated'; - this.activeTaskBkgColor = 'calculated'; - this.gridColor = 'calculated'; - this.doneTaskBkgColor = 'calculated'; - this.doneTaskBorderColor = 'calculated'; - this.critBkgColor = 'calculated'; - this.critBorderColor = 'calculated'; - this.todayLineColor = 'calculated'; - /* state colors */ - - this.labelColor = 'black'; - this.errorBkgColor = '#552222'; - this.errorTextColor = '#552222'; - } - - _createClass(Theme, [{ - key: "updateColors", - value: function updateColors() { - this.secondBkg = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.contrast, 55); - this.border2 = this.contrast; - /* Flowchart variables */ - - this.nodeBkg = this.mainBkg; - this.nodeBorder = this.border1; - this.clusterBkg = this.secondBkg; - this.clusterBorder = this.border2; - this.defaultLinkColor = this.lineColor; - this.titleColor = this.text; - /* Sequence Diagram variables */ - - this.actorBorder = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.border1, 23); - this.actorBkg = this.mainBkg; - this.actorTextColor = this.text; - this.actorLineColor = this.lineColor; - this.signalColor = this.text; - this.signalTextColor = this.text; - this.labelBoxBkgColor = this.actorBkg; - this.labelBoxBorderColor = this.actorBorder; - this.labelTextColor = this.text; - this.loopTextColor = this.text; - this.noteBorderColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["darken"])(this.note, 60); - this.noteBkgColor = this.note; - this.noteTextColor = this.actorTextColor; - /* Gantt chart variables */ - - this.sectionBkgColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.contrast, 30); - this.sectionBkgColor2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.contrast, 30); - this.taskBorderColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["darken"])(this.contrast, 10); - this.taskBkgColor = this.contrast; - this.taskTextColor = this.taskTextLightColor; - this.taskTextDarkColor = this.text; - this.taskTextOutsideColor = this.taskTextDarkColor; - this.activeTaskBorderColor = this.taskBorderColor; - this.activeTaskBkgColor = this.mainBkg; - this.gridColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.border1, 30); - this.doneTaskBkgColor = this.done; - this.doneTaskBorderColor = this.lineColor; - this.critBkgColor = this.critical; - this.critBorderColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["darken"])(this.critBkgColor, 10); - this.todayLineColor = this.critBkgColor; - /* state colors */ - - /* class */ - - this.classText = this.primaryTextColor; - /* journey */ - - this.fillType0 = this.primaryColor; - this.fillType1 = this.secondaryColor; - this.fillType2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 64 - }); - this.fillType3 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: 64 - }); - this.fillType4 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -64 - }); - this.fillType5 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: -64 - }); - this.fillType6 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 128 - }); - this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: 128 - }); - } - }, { - key: "calculate", - value: function calculate(overrides) { - var _this = this; - - if (_typeof(overrides) !== 'object') { - // Calculate colors form base colors - this.updateColors(); - return; - } - - var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors - - keys.forEach(function (k) { - _this[k] = overrides[k]; - }); // Calculate colors form base colors - - this.updateColors(); // Copy values from overrides again in case of an override of derived value - - keys.forEach(function (k) { - _this[k] = overrides[k]; - }); - } - }]); - - return Theme; -}(); - -var getThemeVariables = function getThemeVariables(userOverrides) { - var theme = new Theme(); - theme.calculate(userOverrides); - return theme; -}; - -/***/ }), - -/***/ "./src/utils.js": -/*!**********************!*\ - !*** ./src/utils.js ***! - \**********************/ -/*! exports provided: detectInit, detectDirective, detectType, isSubstringInArray, interpolateToCurve, formatUrl, runFunc, getStylesFromArray, generateId, random, assignWithDepth, getTextObj, drawSimpleText, wrapLabel, calculateTextHeight, calculateTextWidth, calculateTextDimensions, calculateSvgSizeAttrs, configureSvgSize, initIdGeneratior, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectInit", function() { return detectInit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectDirective", function() { return detectDirective; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectType", function() { return detectType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSubstringInArray", function() { return isSubstringInArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interpolateToCurve", function() { return interpolateToCurve; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatUrl", function() { return formatUrl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runFunc", function() { return runFunc; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStylesFromArray", function() { return getStylesFromArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generateId", function() { return generateId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return random; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assignWithDepth", function() { return assignWithDepth; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextObj", function() { return getTextObj; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawSimpleText", function() { return drawSimpleText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapLabel", function() { return wrapLabel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateTextHeight", function() { return calculateTextHeight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateTextWidth", function() { return calculateTextWidth; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateTextDimensions", function() { return calculateTextDimensions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateSvgSizeAttrs", function() { return calculateSvgSizeAttrs; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "configureSvgSize", function() { return configureSvgSize; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initIdGeneratior", function() { return initIdGeneratior; }); -/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @braintree/sanitize-url */ "@braintree/sanitize-url"); -/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./diagrams/common/common */ "./src/diagrams/common/common.js"); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); -var _this = undefined; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - - - - - // import cryptoRandomString from 'crypto-random-string'; -// Effectively an enum of the supported curve types, accessible by name - -var d3CurveTypes = { - curveBasis: d3__WEBPACK_IMPORTED_MODULE_1__["curveBasis"], - curveBasisClosed: d3__WEBPACK_IMPORTED_MODULE_1__["curveBasisClosed"], - curveBasisOpen: d3__WEBPACK_IMPORTED_MODULE_1__["curveBasisOpen"], - curveLinear: d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"], - curveLinearClosed: d3__WEBPACK_IMPORTED_MODULE_1__["curveLinearClosed"], - curveMonotoneX: d3__WEBPACK_IMPORTED_MODULE_1__["curveMonotoneX"], - curveMonotoneY: d3__WEBPACK_IMPORTED_MODULE_1__["curveMonotoneY"], - curveNatural: d3__WEBPACK_IMPORTED_MODULE_1__["curveNatural"], - curveStep: d3__WEBPACK_IMPORTED_MODULE_1__["curveStep"], - curveStepAfter: d3__WEBPACK_IMPORTED_MODULE_1__["curveStepAfter"], - curveStepBefore: d3__WEBPACK_IMPORTED_MODULE_1__["curveStepBefore"] -}; -var directive = /[%]{2}[{]\s*(?:(?:(\w+)\s*:|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; -var directiveWithoutOpen = /\s*(?:(?:(\w+)(?=:):|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; -var anyComment = /\s*%%.*\n/gm; -/** - * @function detectInit - * Detects the init config object from the text - * ```mermaid - * %%{init: {"theme": "debug", "logLevel": 1 }}%% - * graph LR - * a-->b - * b-->c - * c-->d - * d-->e - * e-->f - * f-->g - * g-->h - * ``` - * or - * ```mermaid - * %%{initialize: {"theme": "dark", logLevel: "debug" }}%% - * graph LR - * a-->b - * b-->c - * c-->d - * d-->e - * e-->f - * f-->g - * g-->h - * ``` - * - * @param {string} text The text defining the graph - * @returns {object} the json object representing the init passed to mermaid.initialize() - */ - -var detectInit = function detectInit(text) { - var inits = detectDirective(text, /(?:init\b)|(?:initialize\b)/); - var results = {}; - - if (Array.isArray(inits)) { - var args = inits.map(function (init) { - return init.args; - }); - results = assignWithDepth(results, _toConsumableArray(args)); - } else { - results = inits.args; - } - - if (results) { - var type = detectType(text); - ['config'].forEach(function (prop) { - if (typeof results[prop] !== 'undefined') { - if (type === 'flowchart-v2') { - type = 'flowchart'; - } - - results[type] = results[prop]; - delete results[prop]; - } - }); - } - - return results; -}; -/** - * @function detectDirective - * Detects the directive from the text. Text can be single line or multiline. If type is null or omitted - * the first directive encountered in text will be returned - * ```mermaid - * graph LR - * %%{somedirective}%% - * a-->b - * b-->c - * c-->d - * d-->e - * e-->f - * f-->g - * g-->h - * ``` - * - * @param {string} text The text defining the graph - * @param {string|RegExp} type The directive to return (default: null) - * @returns {object | Array} An object or Array representing the directive(s): { type: string, args: object|null } matched by the input type - * if a single directive was found, that directive object will be returned. - */ - -var detectDirective = function detectDirective(text) { - var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - try { - var commentWithoutDirectives = new RegExp("[%]{2}(?![{]".concat(directiveWithoutOpen.source, ")(?=[}][%]{2}).*\n"), 'ig'); - text = text.trim().replace(commentWithoutDirectives, '').replace(/'/gm, '"'); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug("Detecting diagram directive".concat(type !== null ? ' type:' + type : '', " based on the text:").concat(text)); - var match, - result = []; - - while ((match = directive.exec(text)) !== null) { - // This is necessary to avoid infinite loops with zero-width matches - if (match.index === directive.lastIndex) { - directive.lastIndex++; - } - - if (match && !type || type && match[1] && match[1].match(type) || type && match[2] && match[2].match(type)) { - var _type = match[1] ? match[1] : match[2]; - - var args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null; - result.push({ - type: _type, - args: args - }); - } - } - - if (result.length === 0) { - result.push({ - type: text, - args: null - }); - } - - return result.length === 1 ? result[0] : result; - } catch (error) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error("ERROR: ".concat(error.message, " - Unable to parse directive").concat(type !== null ? ' type:' + type : '', " based on the text:").concat(text)); - return { - type: null, - args: null - }; - } -}; -/** - * @function detectType - * Detects the type of the graph text. Takes into consideration the possible existence of an %%init - * directive - * ```mermaid - * %%{initialize: {"startOnLoad": true, logLevel: "fatal" }}%% - * graph LR - * a-->b - * b-->c - * c-->d - * d-->e - * e-->f - * f-->g - * g-->h - * ``` - * - * @param {string} text The text defining the graph - * @returns {string} A graph definition key - */ - -var detectType = function detectType(text) { - text = text.replace(directive, '').replace(anyComment, '\n'); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Detecting diagram type based on the text ' + text); - - if (text.match(/^\s*sequenceDiagram/)) { - return 'sequence'; - } - - if (text.match(/^\s*gantt/)) { - return 'gantt'; - } - - if (text.match(/^\s*classDiagram-v2/)) { - return 'classDiagram'; - } - - if (text.match(/^\s*classDiagram/)) { - return 'class'; - } - - if (text.match(/^\s*stateDiagram-v2/)) { - return 'stateDiagram'; - } - - if (text.match(/^\s*stateDiagram/)) { - return 'state'; - } - - if (text.match(/^\s*gitGraph/)) { - return 'git'; - } - - if (text.match(/^\s*flowchart/)) { - return 'flowchart-v2'; - } - - if (text.match(/^\s*info/)) { - return 'info'; - } - - if (text.match(/^\s*pie/)) { - return 'pie'; - } - - if (text.match(/^\s*erDiagram/)) { - return 'er'; - } - - if (text.match(/^\s*journey/)) { - return 'journey'; - } - - return 'flowchart'; -}; - -var memoize = function memoize(fn, resolver) { - var cache = {}; - return function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var n = resolver ? resolver.apply(_this, args) : args[0]; - - if (n in cache) { - return cache[n]; - } else { - var result = fn.apply(void 0, args); - cache[n] = result; - return result; - } - }; -}; -/** - * @function isSubstringInArray - * Detects whether a substring in present in a given array - * @param {string} str The substring to detect - * @param {array} arr The array to search - * @returns {number} the array index containing the substring or -1 if not present - **/ - - -var isSubstringInArray = function isSubstringInArray(str, arr) { - for (var i = 0; i < arr.length; i++) { - if (arr[i].match(str)) return i; - } - - return -1; -}; -var interpolateToCurve = function interpolateToCurve(interpolate, defaultCurve) { - if (!interpolate) { - return defaultCurve; - } - - var curveName = "curve".concat(interpolate.charAt(0).toUpperCase() + interpolate.slice(1)); - return d3CurveTypes[curveName] || defaultCurve; -}; -var formatUrl = function formatUrl(linkStr, config) { - var url = linkStr.trim(); - - if (url) { - if (config.securityLevel !== 'loose') { - return Object(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__["sanitizeUrl"])(url); - } - - return url; - } -}; -var runFunc = function runFunc(functionName) { - var _obj; - - var arrPaths = functionName.split('.'); - var len = arrPaths.length - 1; - var fnName = arrPaths[len]; - var obj = window; - - for (var i = 0; i < len; i++) { - obj = obj[arrPaths[i]]; - if (!obj) return; - } - - for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - params[_key2 - 1] = arguments[_key2]; - } - - (_obj = obj)[fnName].apply(_obj, params); -}; - -var distance = function distance(p1, p2) { - return p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0; -}; - -var traverseEdge = function traverseEdge(points) { - var prevPoint; - var totalDistance = 0; - points.forEach(function (point) { - totalDistance += distance(point, prevPoint); - prevPoint = point; - }); // Traverse half of total distance along points - - var remainingDistance = totalDistance / 2; - var center = undefined; - prevPoint = undefined; - points.forEach(function (point) { - if (prevPoint && !center) { - var vectorDistance = distance(point, prevPoint); - - if (vectorDistance < remainingDistance) { - remainingDistance -= vectorDistance; - } else { - // The point is remainingDistance from prevPoint in the vector between prevPoint and point - // Calculate the coordinates - var distanceRatio = remainingDistance / vectorDistance; - if (distanceRatio <= 0) center = prevPoint; - if (distanceRatio >= 1) center = { - x: point.x, - y: point.y - }; - - if (distanceRatio > 0 && distanceRatio < 1) { - center = { - x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, - y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y - }; - } - } - } - - prevPoint = point; - }); - return center; -}; - -var calcLabelPosition = function calcLabelPosition(points) { - return traverseEdge(points); -}; - -var calcCardinalityPosition = function calcCardinalityPosition(isRelationTypePresent, points, initialPosition) { - var prevPoint; - var totalDistance = 0; // eslint-disable-line - - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('our points', points); - - if (points[0] !== initialPosition) { - points = points.reverse(); - } - - points.forEach(function (point) { - totalDistance += distance(point, prevPoint); - prevPoint = point; - }); // Traverse only 25 total distance along points to find cardinality point - - var distanceToCardinalityPoint = 25; - var remainingDistance = distanceToCardinalityPoint; - var center; - prevPoint = undefined; - points.forEach(function (point) { - if (prevPoint && !center) { - var vectorDistance = distance(point, prevPoint); - - if (vectorDistance < remainingDistance) { - remainingDistance -= vectorDistance; - } else { - // The point is remainingDistance from prevPoint in the vector between prevPoint and point - // Calculate the coordinates - var distanceRatio = remainingDistance / vectorDistance; - if (distanceRatio <= 0) center = prevPoint; - if (distanceRatio >= 1) center = { - x: point.x, - y: point.y - }; - - if (distanceRatio > 0 && distanceRatio < 1) { - center = { - x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, - y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y - }; - } - } - } - - prevPoint = point; - }); // if relation is present (Arrows will be added), change cardinality point off-set distance (d) - - var d = isRelationTypePresent ? 10 : 5; //Calculate Angle for x and y axis - - var angle = Math.atan2(points[0].y - center.y, points[0].x - center.x); - var cardinalityPosition = { - x: 0, - y: 0 - }; //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance - - cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2; - cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2; - return cardinalityPosition; -}; -/** - * position ['start_left', 'start_right', 'end_left', 'end_right'] - */ - - -var calcTerminalLabelPosition = function calcTerminalLabelPosition(terminalMarkerSize, position, _points) { - // Todo looking to faster cloning method - var points = JSON.parse(JSON.stringify(_points)); - var prevPoint; - var totalDistance = 0; // eslint-disable-line - - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('our points', points); - - if (position !== 'start_left' && position !== 'start_right') { - points = points.reverse(); - } - - points.forEach(function (point) { - totalDistance += distance(point, prevPoint); - prevPoint = point; - }); // Traverse only 25 total distance along points to find cardinality point - - var distanceToCardinalityPoint = 25; - var remainingDistance = distanceToCardinalityPoint; - var center; - prevPoint = undefined; - points.forEach(function (point) { - if (prevPoint && !center) { - var vectorDistance = distance(point, prevPoint); - - if (vectorDistance < remainingDistance) { - remainingDistance -= vectorDistance; - } else { - // The point is remainingDistance from prevPoint in the vector between prevPoint and point - // Calculate the coordinates - var distanceRatio = remainingDistance / vectorDistance; - if (distanceRatio <= 0) center = prevPoint; - if (distanceRatio >= 1) center = { - x: point.x, - y: point.y - }; - - if (distanceRatio > 0 && distanceRatio < 1) { - center = { - x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, - y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y - }; - } - } - } - - prevPoint = point; - }); // if relation is present (Arrows will be added), change cardinality point off-set distance (d) - - var d = 10; //Calculate Angle for x and y axis - - var angle = Math.atan2(points[0].y - center.y, points[0].x - center.x); - var cardinalityPosition = { - x: 0, - y: 0 - }; //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance - - cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2; - cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2; - - if (position === 'start_left') { - cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center.x) / 2; - cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center.y) / 2; - } - - if (position === 'end_right') { - cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center.x) / 2 - 5; - cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center.y) / 2 - 5; - } - - if (position === 'end_left') { - cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2 - 5; - cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5; - } - - return cardinalityPosition; -}; - -var getStylesFromArray = function getStylesFromArray(arr) { - var style = ''; - var labelStyle = ''; - - for (var i = 0; i < arr.length; i++) { - if (typeof arr[i] !== 'undefined') { - // add text properties to label style definition - if (arr[i].startsWith('color:') || arr[i].startsWith('text-align:')) { - labelStyle = labelStyle + arr[i] + ';'; - } else { - style = style + arr[i] + ';'; - } - } - } - - return { - style: style, - labelStyle: labelStyle - }; -}; -var cnt = 0; -var generateId = function generateId() { - cnt++; - return 'id-' + Math.random().toString(36).substr(2, 12) + '-' + cnt; -}; - -function makeid(length) { - var result = ''; - var characters = '0123456789abcdef'; - var charactersLength = characters.length; - - for (var i = 0; i < length; i++) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - } - - return result; -} - -var random = function random(options) { - return makeid(options.length); -}; -/** - * @function assignWithDepth - * Extends the functionality of {@link ObjectConstructor.assign} with the ability to merge arbitrary-depth objects - * For each key in src with path `k` (recursively) performs an Object.assign(dst[`k`], src[`k`]) with - * a slight change from the typical handling of undefined for dst[`k`]: instead of raising an error, - * dst[`k`] is auto-initialized to {} and effectively merged with src[`k`] - *

- * Additionally, dissimilar types will not clobber unless the config.clobber parameter === true. Example: - * ``` - * let config_0 = { foo: { bar: 'bar' }, bar: 'foo' }; - * let config_1 = { foo: 'foo', bar: 'bar' }; - * let result = assignWithDepth(config_0, config_1); - * console.log(result); - * //-> result: { foo: { bar: 'bar' }, bar: 'bar' } - * ``` - *

- * Traditional Object.assign would have clobbered foo in config_0 with foo in config_1. - *

- * If src is a destructured array of objects and dst is not an array, assignWithDepth will apply each element of src to dst - * in order. - * @param dst:any - the destination of the merge - * @param src:any - the source object(s) to merge into destination - * @param config:{ depth: number, clobber: boolean } - depth: depth to traverse within src and dst for merging - - * clobber: should dissimilar types clobber (default: { depth: 2, clobber: false }) - * @returns {*} - */ - -var assignWithDepth = function assignWithDepth(dst, src, config) { - var _Object$assign = Object.assign({ - depth: 2, - clobber: false - }, config), - depth = _Object$assign.depth, - clobber = _Object$assign.clobber; - - if (Array.isArray(src) && !Array.isArray(dst)) { - src.forEach(function (s) { - return assignWithDepth(dst, s, config); - }); - return dst; - } else if (Array.isArray(src) && Array.isArray(dst)) { - src.forEach(function (s) { - if (dst.indexOf(s) === -1) { - dst.push(s); - } - }); - return dst; - } - - if (typeof dst === 'undefined' || depth <= 0) { - if (dst !== undefined && dst !== null && _typeof(dst) === 'object' && _typeof(src) === 'object') { - return Object.assign(dst, src); - } else { - return src; - } - } - - if (typeof src !== 'undefined' && _typeof(dst) === 'object' && _typeof(src) === 'object') { - Object.keys(src).forEach(function (key) { - if (_typeof(src[key]) === 'object' && (dst[key] === undefined || _typeof(dst[key]) === 'object')) { - if (dst[key] === undefined) { - dst[key] = Array.isArray(src[key]) ? [] : {}; - } - - dst[key] = assignWithDepth(dst[key], src[key], { - depth: depth - 1, - clobber: clobber - }); - } else if (clobber || _typeof(dst[key]) !== 'object' && _typeof(src[key]) !== 'object') { - dst[key] = src[key]; - } - }); - } - - return dst; -}; -var getTextObj = function getTextObj() { - return { - x: 0, - y: 0, - fill: undefined, - anchor: 'start', - style: '#666', - width: 100, - height: 100, - textMargin: 0, - rx: 0, - ry: 0, - valign: undefined - }; -}; -var drawSimpleText = function drawSimpleText(elem, textData) { - // Remove and ignore br:s - var nText = textData.text.replace(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__["default"].lineBreakRegex, ' '); - var textElem = elem.append('text'); - textElem.attr('x', textData.x); - textElem.attr('y', textData.y); - textElem.style('text-anchor', textData.anchor); - textElem.style('font-family', textData.fontFamily); - textElem.style('font-size', textData.fontSize); - textElem.style('font-weight', textData.fontWeight); - textElem.attr('fill', textData.fill); - - if (typeof textData.class !== 'undefined') { - textElem.attr('class', textData.class); - } - - var span = textElem.append('tspan'); - span.attr('x', textData.x + textData.textMargin * 2); - span.attr('fill', textData.fill); - span.text(nText); - return textElem; -}; -var wrapLabel = memoize(function (label, maxWidth, config) { - if (!label) { - return label; - } - - config = Object.assign({ - fontSize: 12, - fontWeight: 400, - fontFamily: 'Arial', - joinWith: '
' - }, config); - - if (_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__["default"].lineBreakRegex.test(label)) { - return label; - } - - var words = label.split(' '); - var completedLines = []; - var nextLine = ''; - words.forEach(function (word, index) { - var wordLength = calculateTextWidth("".concat(word, " "), config); - var nextLineLength = calculateTextWidth(nextLine, config); - - if (wordLength > maxWidth) { - var _breakString = breakString(word, maxWidth, '-', config), - hyphenatedStrings = _breakString.hyphenatedStrings, - remainingWord = _breakString.remainingWord; - - completedLines.push.apply(completedLines, [nextLine].concat(_toConsumableArray(hyphenatedStrings))); - nextLine = remainingWord; - } else if (nextLineLength + wordLength >= maxWidth) { - completedLines.push(nextLine); - nextLine = word; - } else { - nextLine = [nextLine, word].filter(Boolean).join(' '); - } - - var currentWord = index + 1; - var isLastWord = currentWord === words.length; - - if (isLastWord) { - completedLines.push(nextLine); - } - }); - return completedLines.filter(function (line) { - return line !== ''; - }).join(config.joinWith); -}, function (label, maxWidth, config) { - return "".concat(label, "-").concat(maxWidth, "-").concat(config.fontSize, "-").concat(config.fontWeight, "-").concat(config.fontFamily, "-").concat(config.joinWith); -}); -var breakString = memoize(function (word, maxWidth) { - var hyphenCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '-'; - var config = arguments.length > 3 ? arguments[3] : undefined; - config = Object.assign({ - fontSize: 12, - fontWeight: 400, - fontFamily: 'Arial', - margin: 0 - }, config); - var characters = word.split(''); - var lines = []; - var currentLine = ''; - characters.forEach(function (character, index) { - var nextLine = "".concat(currentLine).concat(character); - var lineWidth = calculateTextWidth(nextLine, config); - - if (lineWidth >= maxWidth) { - var currentCharacter = index + 1; - var isLastLine = characters.length === currentCharacter; - var hyphenatedNextLine = "".concat(nextLine).concat(hyphenCharacter); - lines.push(isLastLine ? nextLine : hyphenatedNextLine); - currentLine = ''; - } else { - currentLine = nextLine; - } - }); - return { - hyphenatedStrings: lines, - remainingWord: currentLine - }; -}, function (word, maxWidth) { - var hyphenCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '-'; - var config = arguments.length > 3 ? arguments[3] : undefined; - return "".concat(word, "-").concat(maxWidth, "-").concat(hyphenCharacter, "-").concat(config.fontSize, "-").concat(config.fontWeight, "-").concat(config.fontFamily); -}); -/** - * This calculates the text's height, taking into account the wrap breaks and - * both the statically configured height, width, and the length of the text (in pixels). - * - * If the wrapped text text has greater height, we extend the height, so it's - * value won't overflow. - * - * @return - The height for the given text - * @param text the text to measure - * @param config - the config for fontSize, fontFamily, and fontWeight all impacting the resulting size - */ - -var calculateTextHeight = function calculateTextHeight(text, config) { - config = Object.assign({ - fontSize: 12, - fontWeight: 400, - fontFamily: 'Arial', - margin: 15 - }, config); - return calculateTextDimensions(text, config).height; -}; -/** - * This calculates the width of the given text, font size and family. - * - * @return - The width for the given text - * @param text - The text to calculate the width of - * @param config - the config for fontSize, fontFamily, and fontWeight all impacting the resulting size - */ - -var calculateTextWidth = function calculateTextWidth(text, config) { - config = Object.assign({ - fontSize: 12, - fontWeight: 400, - fontFamily: 'Arial' - }, config); - return calculateTextDimensions(text, config).width; -}; -/** - * This calculates the dimensions of the given text, font size, font family, font weight, and margins. - * - * @return - The width for the given text - * @param text - The text to calculate the width of - * @param config - the config for fontSize, fontFamily, fontWeight, and margin all impacting the resulting size - */ - -var calculateTextDimensions = memoize(function (text, config) { - config = Object.assign({ - fontSize: 12, - fontWeight: 400, - fontFamily: 'Arial' - }, config); - var _config = config, - fontSize = _config.fontSize, - fontFamily = _config.fontFamily, - fontWeight = _config.fontWeight; - - if (!text) { - return { - width: 0, - height: 0 - }; - } // We can't really know if the user supplied font family will render on the user agent; - // thus, we'll take the max width between the user supplied font family, and a default - // of sans-serif. - - - var fontFamilies = ['sans-serif', fontFamily]; - var lines = text.split(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__["default"].lineBreakRegex); - var dims = []; - var body = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('body'); // We don't want to leak DOM elements - if a removal operation isn't available - // for any reason, do not continue. - - if (!body.remove) { - return { - width: 0, - height: 0, - lineHeight: 0 - }; - } - - var g = body.append('svg'); - - for (var _i = 0, _fontFamilies = fontFamilies; _i < _fontFamilies.length; _i++) { - var _fontFamily = _fontFamilies[_i]; - var cheight = 0; - var dim = { - width: 0, - height: 0, - lineHeight: 0 - }; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var line = _step.value; - var textObj = getTextObj(); - textObj.text = line; - var textElem = drawSimpleText(g, textObj).style('font-size', fontSize).style('font-weight', fontWeight).style('font-family', _fontFamily); - var bBox = (textElem._groups || textElem)[0][0].getBBox(); - dim.width = Math.round(Math.max(dim.width, bBox.width)); - cheight = Math.round(bBox.height); - dim.height += cheight; - dim.lineHeight = Math.round(Math.max(dim.lineHeight, cheight)); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - dims.push(dim); - } - - g.remove(); - var index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1; - return dims[index]; -}, function (text, config) { - return "".concat(text, "-").concat(config.fontSize, "-").concat(config.fontWeight, "-").concat(config.fontFamily); -}); - -var d3Attrs = function d3Attrs(d3Elem, attrs) { - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; - - try { - for (var _iterator2 = attrs[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var attr = _step2.value; - d3Elem.attr(attr[0], attr[1]); - } - } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; - } finally { - try { - if (!_iteratorNormalCompletion2 && _iterator2.return != null) { - _iterator2.return(); - } - } finally { - if (_didIteratorError2) { - throw _iteratorError2; - } - } - } -}; - -var calculateSvgSizeAttrs = function calculateSvgSizeAttrs(height, width, useMaxWidth) { - var attrs = new Map(); - attrs.set('height', height); - - if (useMaxWidth) { - attrs.set('width', '100%'); - attrs.set('style', "max-width: ".concat(width, "px;")); - } else { - attrs.set('width', width); - } - - return attrs; -}; -var configureSvgSize = function configureSvgSize(svgElem, height, width, useMaxWidth) { - var attrs = calculateSvgSizeAttrs(height, width, useMaxWidth); - d3Attrs(svgElem, attrs); -}; -var initIdGeneratior = function initIdGeneratior(deterministic, seed) { - if (!deterministic) return { - next: function next() { - return Date.now(); - } - }; - - var iterator = - /*#__PURE__*/ - function () { - function iterator() { - _classCallCheck(this, iterator); - - return this.count = seed ? seed.length : 0; - } - - _createClass(iterator, [{ - key: "next", - value: function next() { - return this.count++; - } - }]); - - return iterator; - }(); - - return new iterator(); -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - assignWithDepth: assignWithDepth, - wrapLabel: wrapLabel, - calculateTextHeight: calculateTextHeight, - calculateTextWidth: calculateTextWidth, - calculateTextDimensions: calculateTextDimensions, - calculateSvgSizeAttrs: calculateSvgSizeAttrs, - configureSvgSize: configureSvgSize, - detectInit: detectInit, - detectDirective: detectDirective, - detectType: detectType, - isSubstringInArray: isSubstringInArray, - interpolateToCurve: interpolateToCurve, - calcLabelPosition: calcLabelPosition, - calcCardinalityPosition: calcCardinalityPosition, - calcTerminalLabelPosition: calcTerminalLabelPosition, - formatUrl: formatUrl, - getStylesFromArray: getStylesFromArray, - generateId: generateId, - random: random, - memoize: memoize, - runFunc: runFunc, - initIdGeneratior: initIdGeneratior -}); - -/***/ }), - -/***/ "@braintree/sanitize-url": -/*!******************************************!*\ - !*** external "@braintree/sanitize-url" ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __webpack_require__(/*! @braintree/sanitize-url */ "./node_modules/@braintree/sanitize-url/index.js"); - -/***/ }), - -/***/ "d3": -/*!*********************!*\ - !*** external "d3" ***! - \*********************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __webpack_require__(/*! d3 */ "./node_modules/d3/index.js"); - -/***/ }), - -/***/ "dagre": -/*!************************!*\ - !*** external "dagre" ***! - \************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __webpack_require__(/*! dagre */ "./node_modules/dagre/index.js"); - -/***/ }), - -/***/ "dagre-d3": -/*!***************************!*\ - !*** external "dagre-d3" ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __webpack_require__(/*! dagre-d3 */ "./node_modules/dagre-d3/index.js"); - -/***/ }), - -/***/ "dagre-d3/lib/label/add-html-label.js": -/*!*******************************************************!*\ - !*** external "dagre-d3/lib/label/add-html-label.js" ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __webpack_require__(/*! dagre-d3/lib/label/add-html-label.js */ "./node_modules/dagre-d3/lib/label/add-html-label.js"); - -/***/ }), - -/***/ "entity-decode/browser": -/*!****************************************!*\ - !*** external "entity-decode/browser" ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __webpack_require__(/*! entity-decode/browser */ "./node_modules/entity-decode/browser.js"); - -/***/ }), - -/***/ "graphlib": -/*!***************************!*\ - !*** external "graphlib" ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __webpack_require__(/*! graphlib */ "./node_modules/graphlib/index.js"); - -/***/ }), - -/***/ "khroma": -/*!*************************!*\ - !*** external "khroma" ***! - \*************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/index.js"); - -/***/ }), - -/***/ "moment-mini": -/*!******************************!*\ - !*** external "moment-mini" ***! - \******************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __webpack_require__(/*! moment-mini */ "./node_modules/moment-mini/moment.min.js"); - -/***/ }), - -/***/ "stylis": -/*!*************************!*\ - !*** external "stylis" ***! - \*************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = __webpack_require__(/*! stylis */ "./node_modules/stylis/stylis.js"); - -/***/ }) - -/******/ })["default"]; -}); -//# sourceMappingURL=mermaid.core.js.map - -/***/ }), - -/***/ "./node_modules/mermaid/package.json": -/*!*******************************************!*\ - !*** ./node_modules/mermaid/package.json ***! - \*******************************************/ -/*! exports provided: name, version, description, main, keywords, scripts, repository, author, license, standard, dependencies, devDependencies, files, yarn-upgrade-all, sideEffects, husky, default */ -/***/ (function(module) { - -module.exports = JSON.parse("{\"name\":\"mermaid\",\"version\":\"8.9.1\",\"description\":\"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.\",\"main\":\"dist/mermaid.core.js\",\"keywords\":[\"diagram\",\"markdown\",\"flowchart\",\"sequence diagram\",\"gantt\",\"class diagram\",\"git graph\"],\"scripts\":{\"build:development\":\"webpack --progress --colors\",\"build:production\":\"yarn build:development -p --config webpack.config.prod.babel.js\",\"build\":\"yarn build:development && yarn build:production\",\"postbuild\":\"documentation build src/mermaidAPI.js src/config.js src/defaultConfig.js --shallow -f md --markdown-toc false > docs/Setup.md\",\"build:watch\":\"yarn build --watch\",\"minify\":\"minify ./dist/mermaid.js > ./dist/mermaid.min.js\",\"release\":\"yarn build\",\"lint\":\"eslint src\",\"e2e:depr\":\"yarn lint && jest e2e --config e2e/jest.config.js\",\"cypress\":\"percy exec -- cypress run\",\"e2e\":\"start-server-and-test dev http://localhost:9000/ cypress\",\"e2e-upd\":\"yarn lint && jest e2e -u --config e2e/jest.config.js\",\"dev\":\"webpack-dev-server --config webpack.config.e2e.js\",\"test\":\"yarn lint && jest src/.*\",\"test:watch\":\"jest --watch src\",\"prepublishOnly\":\"yarn build && yarn test\",\"prepare\":\"yarn build\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/knsv/mermaid\"},\"author\":\"Knut Sveidqvist\",\"license\":\"MIT\",\"standard\":{\"ignore\":[\"**/parser/*.js\",\"dist/**/*.js\",\"cypress/**/*.js\"],\"globals\":[\"page\"]},\"dependencies\":{\"@braintree/sanitize-url\":\"^3.1.0\",\"d3\":\"^5.7.0\",\"dagre\":\"^0.8.4\",\"dagre-d3\":\"^0.6.4\",\"entity-decode\":\"^2.0.2\",\"graphlib\":\"^2.1.7\",\"he\":\"^1.2.0\",\"khroma\":\"^1.1.0\",\"minify\":\"^4.1.1\",\"moment-mini\":\"^2.22.1\",\"stylis\":\"^3.5.2\"},\"devDependencies\":{\"@babel/core\":\"^7.2.2\",\"@babel/preset-env\":\"^7.8.4\",\"@babel/register\":\"^7.0.0\",\"@percy/cypress\":\"*\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-eslint\":\"^10.1.0\",\"babel-jest\":\"^24.9.0\",\"babel-loader\":\"^8.0.4\",\"coveralls\":\"^3.0.2\",\"css-loader\":\"^2.0.1\",\"css-to-string-loader\":\"^0.1.3\",\"cypress\":\"4.0.1\",\"documentation\":\"^12.0.1\",\"eslint\":\"^6.3.0\",\"eslint-config-prettier\":\"^6.3.0\",\"eslint-plugin-prettier\":\"^3.1.0\",\"husky\":\"^1.2.1\",\"identity-obj-proxy\":\"^3.0.0\",\"jest\":\"^24.9.0\",\"jison\":\"^0.4.18\",\"moment\":\"^2.23.0\",\"node-sass\":\"^5.0.0\",\"prettier\":\"^1.18.2\",\"puppeteer\":\"^1.17.0\",\"sass-loader\":\"^7.1.0\",\"start-server-and-test\":\"^1.10.6\",\"terser-webpack-plugin\":\"^2.2.2\",\"webpack\":\"^4.41.2\",\"webpack-bundle-analyzer\":\"^3.7.0\",\"webpack-cli\":\"^3.1.2\",\"webpack-dev-server\":\"^3.4.1\",\"webpack-node-externals\":\"^1.7.2\",\"yarn-upgrade-all\":\"^0.5.0\"},\"files\":[\"dist\"],\"yarn-upgrade-all\":{\"ignore\":[\"babel-core\"]},\"sideEffects\":[\"**/*.css\",\"**/*.scss\"],\"husky\":{\"hooks\":{\"pre-push\":\"yarn test\"}}}"); - -/***/ }), - -/***/ "./node_modules/moment-mini/locale sync recursive ^\\.\\/.*$": -/*!*******************************************************!*\ - !*** ./node_modules/moment-mini/locale sync ^\.\/.*$ ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var map = { - "./locale": "./node_modules/moment-mini/locale/locale.js", - "./locale.js": "./node_modules/moment-mini/locale/locale.js" -}; - - -function webpackContext(req) { - var id = webpackContextResolve(req); - return __webpack_require__(id); -} -function webpackContextResolve(req) { - if(!__webpack_require__.o(map, req)) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; - } - return map[req]; -} -webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); -}; -webpackContext.resolve = webpackContextResolve; -module.exports = webpackContext; -webpackContext.id = "./node_modules/moment-mini/locale sync recursive ^\\.\\/.*$"; - -/***/ }), - -/***/ "./node_modules/moment-mini/locale/locale.js": -/*!***************************************************!*\ - !*** ./node_modules/moment-mini/locale/locale.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - - - -/***/ }), - -/***/ "./node_modules/moment-mini/moment.min.js": -/*!************************************************!*\ - !*** ./node_modules/moment-mini/moment.min.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {!function(e,t){ true?module.exports=t():undefined}(this,function(){"use strict";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n>>0,s=0;sDe(e)?(r=e+1,a=o-De(e)):(r=e,a=o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(De(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),H("week","w"),H("isoWeek","W"),L("week",5),L("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=k(e)});I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),H("day","d"),H("weekday","e"),H("isoWeekday","E"),L("day",11),L("weekday",11),L("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=k(e)});var je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var $e=ae;var qe=ae;var Je=ae;function Be(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=de(o[t]),u[t]=de(u[t]),l[t]=de(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Xe(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ke(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Qe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+U(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Xe("a",!0),Xe("A",!1),H("hour","h"),L("hour",13),ue("a",Ke),ue("A",Ke),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=k(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=k(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i))});var et,tt=Te("Hours",!0),nt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:He,monthsShort:Re,week:{dow:0,doy:6},weekdays:je,weekdaysMin:ze,weekdaysShort:Ze,meridiemParse:/[ap]\.?m?\.?/i},st={},it={};function rt(e){return e?e.toLowerCase().replace("_","-"):e}function at(e){var t=null;if(!st[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=et._abbr,__webpack_require__("./node_modules/moment-mini/locale sync recursive ^\\.\\/.*$")("./"+e),ot(t)}catch(e){}return st[e]}function ot(e,t){var n;return e&&((n=l(t)?lt(e):ut(e,t))?et=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),et._abbr}function ut(e,t){if(null!==t){var n,s=nt;if(t.abbr=e,null!=st[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=st[e]._config;else if(null!=t.parentLocale)if(null!=st[t.parentLocale])s=st[t.parentLocale]._config;else{if(null==(n=at(t.parentLocale)))return it[t.parentLocale]||(it[t.parentLocale]=[]),it[t.parentLocale].push({name:e,config:t}),null;s=n._config}return st[e]=new P(b(s,t)),it[e]&&it[e].forEach(function(e){ut(e.name,e.config)}),ot(e),st[e]}return delete st[e],null}function lt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return et;if(!o(e)){if(t=at(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r=t&&a(i,n,!0)>=t-1)break;t--}r++}return et}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11Pe(n[me],n[_e])?ye:n[ge]<0||24Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ht(e._a[me],s[me]),(e._dayOfYear>De(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[pe]&&0===e._a[ve]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&0<=e&&isFinite(o.getFullYear())&&o.setFullYear(e),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var ft=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,mt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],gt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pt=/^\/?Date\((\-?\d+)/i;function vt(e){var t,n,s,i,r,a,o=e._i,u=ft.exec(o)||mt.exec(o);if(u){for(g(e).iso=!0,t=0,n=yt.length;tn.valueOf():n.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Vt,ln.isUTC=Vt,ln.zoneAbbr=function(){return this._isUTC?"UTC":""},ln.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ln.dates=n("dates accessor is deprecated. Use date instead.",nn),ln.months=n("months accessor is deprecated. Use month instead",Fe),ln.years=n("years accessor is deprecated. Use year instead",Oe),ln.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),ln.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Yt(e))._a){var t=e._isUTC?y(e._a):Tt(e._a);this._isDSTShifted=this.isValid()&&0= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter - }, - week : { - dow : 1, // Maandag is die eerste dag van die week. - doy : 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar. - } - }); - - return af; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ar-dz.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/ar-dz.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var arDz = moment.defineLocale('ar-dz', { - months : 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), - monthsShort : 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), - weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), - weekdaysShort : 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'), - weekdaysMin : 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[اليوم على الساعة] LT', - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'في %s', - past : 'منذ %s', - s : 'ثوان', - ss : '%d ثانية', - m : 'دقيقة', - mm : '%d دقائق', - h : 'ساعة', - hh : '%d ساعات', - d : 'يوم', - dd : '%d أيام', - M : 'شهر', - MM : '%d أشهر', - y : 'سنة', - yy : '%d سنوات' - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return arDz; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ar-kw.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/ar-kw.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var arKw = moment.defineLocale('ar-kw', { - months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), - monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), - weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), - weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'), - weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[اليوم على الساعة] LT', - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'في %s', - past : 'منذ %s', - s : 'ثوان', - ss : '%d ثانية', - m : 'دقيقة', - mm : '%d دقائق', - h : 'ساعة', - hh : '%d ساعات', - d : 'يوم', - dd : '%d أيام', - M : 'شهر', - MM : '%d أشهر', - y : 'سنة', - yy : '%d سنوات' - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 12 // The week that contains Jan 12th is the first week of the year. - } - }); - - return arKw; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ar-ly.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/ar-ly.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '1', - '2': '2', - '3': '3', - '4': '4', - '5': '5', - '6': '6', - '7': '7', - '8': '8', - '9': '9', - '0': '0' - }, pluralForm = function (n) { - return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5; - }, plurals = { - s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'], - m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'], - h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'], - d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'], - M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'], - y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام'] - }, pluralize = function (u) { - return function (number, withoutSuffix, string, isFuture) { - var f = pluralForm(number), - str = plurals[u][pluralForm(number)]; - if (f === 2) { - str = str[withoutSuffix ? 0 : 1]; - } - return str.replace(/%d/i, number); - }; - }, months = [ - 'يناير', - 'فبراير', - 'مارس', - 'أبريل', - 'مايو', - 'يونيو', - 'يوليو', - 'أغسطس', - 'سبتمبر', - 'أكتوبر', - 'نوفمبر', - 'ديسمبر' - ]; - - var arLy = moment.defineLocale('ar-ly', { - months : months, - monthsShort : months, - weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), - weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), - weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'D/\u200FM/\u200FYYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - meridiemParse: /ص|م/, - isPM : function (input) { - return 'م' === input; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'ص'; - } else { - return 'م'; - } - }, - calendar : { - sameDay: '[اليوم عند الساعة] LT', - nextDay: '[غدًا عند الساعة] LT', - nextWeek: 'dddd [عند الساعة] LT', - lastDay: '[أمس عند الساعة] LT', - lastWeek: 'dddd [عند الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'بعد %s', - past : 'منذ %s', - s : pluralize('s'), - ss : pluralize('s'), - m : pluralize('m'), - mm : pluralize('m'), - h : pluralize('h'), - hh : pluralize('h'), - d : pluralize('d'), - dd : pluralize('d'), - M : pluralize('M'), - MM : pluralize('M'), - y : pluralize('y'), - yy : pluralize('y') - }, - preparse: function (string) { - return string.replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }).replace(/,/g, '،'); - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 12th is the first week of the year. - } - }); - - return arLy; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ar-ma.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/ar-ma.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var arMa = moment.defineLocale('ar-ma', { - months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), - monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), - weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), - weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'), - weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[اليوم على الساعة] LT', - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'في %s', - past : 'منذ %s', - s : 'ثوان', - ss : '%d ثانية', - m : 'دقيقة', - mm : '%d دقائق', - h : 'ساعة', - hh : '%d ساعات', - d : 'يوم', - dd : '%d أيام', - M : 'شهر', - MM : '%d أشهر', - y : 'سنة', - yy : '%d سنوات' - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 12th is the first week of the year. - } - }); - - return arMa; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ar-sa.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/ar-sa.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠' - }, numberMap = { - '١': '1', - '٢': '2', - '٣': '3', - '٤': '4', - '٥': '5', - '٦': '6', - '٧': '7', - '٨': '8', - '٩': '9', - '٠': '0' - }; - - var arSa = moment.defineLocale('ar-sa', { - months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), - monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), - weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), - weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), - weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - meridiemParse: /ص|م/, - isPM : function (input) { - return 'م' === input; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'ص'; - } else { - return 'م'; - } - }, - calendar : { - sameDay: '[اليوم على الساعة] LT', - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'في %s', - past : 'منذ %s', - s : 'ثوان', - ss : '%d ثانية', - m : 'دقيقة', - mm : '%d دقائق', - h : 'ساعة', - hh : '%d ساعات', - d : 'يوم', - dd : '%d أيام', - M : 'شهر', - MM : '%d أشهر', - y : 'سنة', - yy : '%d سنوات' - }, - preparse: function (string) { - return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { - return numberMap[match]; - }).replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }).replace(/,/g, '،'); - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 6th is the first week of the year. - } - }); - - return arSa; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ar-tn.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/ar-tn.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var arTn = moment.defineLocale('ar-tn', { - months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), - monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), - weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), - weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), - weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), - weekdaysParseExact : true, - longDateFormat: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'DD/MM/YYYY', - LL: 'D MMMM YYYY', - LLL: 'D MMMM YYYY HH:mm', - LLLL: 'dddd D MMMM YYYY HH:mm' - }, - calendar: { - sameDay: '[اليوم على الساعة] LT', - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime: { - future: 'في %s', - past: 'منذ %s', - s: 'ثوان', - ss : '%d ثانية', - m: 'دقيقة', - mm: '%d دقائق', - h: 'ساعة', - hh: '%d ساعات', - d: 'يوم', - dd: '%d أيام', - M: 'شهر', - MM: '%d أشهر', - y: 'سنة', - yy: '%d سنوات' - }, - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return arTn; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ar.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ar.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠' - }, numberMap = { - '١': '1', - '٢': '2', - '٣': '3', - '٤': '4', - '٥': '5', - '٦': '6', - '٧': '7', - '٨': '8', - '٩': '9', - '٠': '0' - }, pluralForm = function (n) { - return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5; - }, plurals = { - s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'], - m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'], - h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'], - d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'], - M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'], - y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام'] - }, pluralize = function (u) { - return function (number, withoutSuffix, string, isFuture) { - var f = pluralForm(number), - str = plurals[u][pluralForm(number)]; - if (f === 2) { - str = str[withoutSuffix ? 0 : 1]; - } - return str.replace(/%d/i, number); - }; - }, months = [ - 'يناير', - 'فبراير', - 'مارس', - 'أبريل', - 'مايو', - 'يونيو', - 'يوليو', - 'أغسطس', - 'سبتمبر', - 'أكتوبر', - 'نوفمبر', - 'ديسمبر' - ]; - - var ar = moment.defineLocale('ar', { - months : months, - monthsShort : months, - weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), - weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), - weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'D/\u200FM/\u200FYYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - meridiemParse: /ص|م/, - isPM : function (input) { - return 'م' === input; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'ص'; - } else { - return 'م'; - } - }, - calendar : { - sameDay: '[اليوم عند الساعة] LT', - nextDay: '[غدًا عند الساعة] LT', - nextWeek: 'dddd [عند الساعة] LT', - lastDay: '[أمس عند الساعة] LT', - lastWeek: 'dddd [عند الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'بعد %s', - past : 'منذ %s', - s : pluralize('s'), - ss : pluralize('s'), - m : pluralize('m'), - mm : pluralize('m'), - h : pluralize('h'), - hh : pluralize('h'), - d : pluralize('d'), - dd : pluralize('d'), - M : pluralize('M'), - MM : pluralize('M'), - y : pluralize('y'), - yy : pluralize('y') - }, - preparse: function (string) { - return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { - return numberMap[match]; - }).replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }).replace(/,/g, '،'); - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 12th is the first week of the year. - } - }); - - return ar; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/az.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/az.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var suffixes = { - 1: '-inci', - 5: '-inci', - 8: '-inci', - 70: '-inci', - 80: '-inci', - 2: '-nci', - 7: '-nci', - 20: '-nci', - 50: '-nci', - 3: '-üncü', - 4: '-üncü', - 100: '-üncü', - 6: '-ncı', - 9: '-uncu', - 10: '-uncu', - 30: '-uncu', - 60: '-ıncı', - 90: '-ıncı' - }; - - var az = moment.defineLocale('az', { - months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'), - monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'), - weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'), - weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'), - weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[bugün saat] LT', - nextDay : '[sabah saat] LT', - nextWeek : '[gələn həftə] dddd [saat] LT', - lastDay : '[dünən] LT', - lastWeek : '[keçən həftə] dddd [saat] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s sonra', - past : '%s əvvəl', - s : 'birneçə saniyə', - ss : '%d saniyə', - m : 'bir dəqiqə', - mm : '%d dəqiqə', - h : 'bir saat', - hh : '%d saat', - d : 'bir gün', - dd : '%d gün', - M : 'bir ay', - MM : '%d ay', - y : 'bir il', - yy : '%d il' - }, - meridiemParse: /gecə|səhər|gündüz|axşam/, - isPM : function (input) { - return /^(gündüz|axşam)$/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'gecə'; - } else if (hour < 12) { - return 'səhər'; - } else if (hour < 17) { - return 'gündüz'; - } else { - return 'axşam'; - } - }, - dayOfMonthOrdinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/, - ordinal : function (number) { - if (number === 0) { // special case for zero - return number + '-ıncı'; - } - var a = number % 10, - b = number % 100 - a, - c = number >= 100 ? 100 : null; - return number + (suffixes[a] || suffixes[b] || suffixes[c]); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return az; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/be.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/be.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'ss': withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд', - 'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін', - 'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін', - 'dd': 'дзень_дні_дзён', - 'MM': 'месяц_месяцы_месяцаў', - 'yy': 'год_гады_гадоў' - }; - if (key === 'm') { - return withoutSuffix ? 'хвіліна' : 'хвіліну'; - } - else if (key === 'h') { - return withoutSuffix ? 'гадзіна' : 'гадзіну'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - - var be = moment.defineLocale('be', { - months : { - format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'), - standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_') - }, - monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'), - weekdays : { - format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'), - standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'), - isFormat: /\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/ - }, - weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), - weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY г.', - LLL : 'D MMMM YYYY г., HH:mm', - LLLL : 'dddd, D MMMM YYYY г., HH:mm' - }, - calendar : { - sameDay: '[Сёння ў] LT', - nextDay: '[Заўтра ў] LT', - lastDay: '[Учора ў] LT', - nextWeek: function () { - return '[У] dddd [ў] LT'; - }, - lastWeek: function () { - switch (this.day()) { - case 0: - case 3: - case 5: - case 6: - return '[У мінулую] dddd [ў] LT'; - case 1: - case 2: - case 4: - return '[У мінулы] dddd [ў] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : 'праз %s', - past : '%s таму', - s : 'некалькі секунд', - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : relativeTimeWithPlural, - hh : relativeTimeWithPlural, - d : 'дзень', - dd : relativeTimeWithPlural, - M : 'месяц', - MM : relativeTimeWithPlural, - y : 'год', - yy : relativeTimeWithPlural - }, - meridiemParse: /ночы|раніцы|дня|вечара/, - isPM : function (input) { - return /^(дня|вечара)$/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'ночы'; - } else if (hour < 12) { - return 'раніцы'; - } else if (hour < 17) { - return 'дня'; - } else { - return 'вечара'; - } - }, - dayOfMonthOrdinalParse: /\d{1,2}-(і|ы|га)/, - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - case 'w': - case 'W': - return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы'; - case 'D': - return number + '-га'; - default: - return number; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return be; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/bg.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/bg.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var bg = moment.defineLocale('bg', { - months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'), - monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'), - weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'), - weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'), - weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'D.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY H:mm', - LLLL : 'dddd, D MMMM YYYY H:mm' - }, - calendar : { - sameDay : '[Днес в] LT', - nextDay : '[Утре в] LT', - nextWeek : 'dddd [в] LT', - lastDay : '[Вчера в] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[В изминалата] dddd [в] LT'; - case 1: - case 2: - case 4: - case 5: - return '[В изминалия] dddd [в] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : 'след %s', - past : 'преди %s', - s : 'няколко секунди', - ss : '%d секунди', - m : 'минута', - mm : '%d минути', - h : 'час', - hh : '%d часа', - d : 'ден', - dd : '%d дни', - M : 'месец', - MM : '%d месеца', - y : 'година', - yy : '%d години' - }, - dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/, - ordinal : function (number) { - var lastDigit = number % 10, - last2Digits = number % 100; - if (number === 0) { - return number + '-ев'; - } else if (last2Digits === 0) { - return number + '-ен'; - } else if (last2Digits > 10 && last2Digits < 20) { - return number + '-ти'; - } else if (lastDigit === 1) { - return number + '-ви'; - } else if (lastDigit === 2) { - return number + '-ри'; - } else if (lastDigit === 7 || lastDigit === 8) { - return number + '-ми'; - } else { - return number + '-ти'; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return bg; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/bm.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/bm.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var bm = moment.defineLocale('bm', { - months : 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split('_'), - monthsShort : 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'), - weekdays : 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'), - weekdaysShort : 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'), - weekdaysMin : 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'MMMM [tile] D [san] YYYY', - LLL : 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm', - LLLL : 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm' - }, - calendar : { - sameDay : '[Bi lɛrɛ] LT', - nextDay : '[Sini lɛrɛ] LT', - nextWeek : 'dddd [don lɛrɛ] LT', - lastDay : '[Kunu lɛrɛ] LT', - lastWeek : 'dddd [tɛmɛnen lɛrɛ] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s kɔnɔ', - past : 'a bɛ %s bɔ', - s : 'sanga dama dama', - ss : 'sekondi %d', - m : 'miniti kelen', - mm : 'miniti %d', - h : 'lɛrɛ kelen', - hh : 'lɛrɛ %d', - d : 'tile kelen', - dd : 'tile %d', - M : 'kalo kelen', - MM : 'kalo %d', - y : 'san kelen', - yy : 'san %d' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return bm; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/bn.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/bn.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '১', - '2': '২', - '3': '৩', - '4': '৪', - '5': '৫', - '6': '৬', - '7': '৭', - '8': '৮', - '9': '৯', - '0': '০' - }, - numberMap = { - '১': '1', - '২': '2', - '৩': '3', - '৪': '4', - '৫': '5', - '৬': '6', - '৭': '7', - '৮': '8', - '৯': '9', - '০': '0' - }; - - var bn = moment.defineLocale('bn', { - months : 'জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'), - monthsShort : 'জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে'.split('_'), - weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split('_'), - weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'), - weekdaysMin : 'রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি'.split('_'), - longDateFormat : { - LT : 'A h:mm সময়', - LTS : 'A h:mm:ss সময়', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm সময়', - LLLL : 'dddd, D MMMM YYYY, A h:mm সময়' - }, - calendar : { - sameDay : '[আজ] LT', - nextDay : '[আগামীকাল] LT', - nextWeek : 'dddd, LT', - lastDay : '[গতকাল] LT', - lastWeek : '[গত] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s পরে', - past : '%s আগে', - s : 'কয়েক সেকেন্ড', - ss : '%d সেকেন্ড', - m : 'এক মিনিট', - mm : '%d মিনিট', - h : 'এক ঘন্টা', - hh : '%d ঘন্টা', - d : 'এক দিন', - dd : '%d দিন', - M : 'এক মাস', - MM : '%d মাস', - y : 'এক বছর', - yy : '%d বছর' - }, - preparse: function (string) { - return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if ((meridiem === 'রাত' && hour >= 4) || - (meridiem === 'দুপুর' && hour < 5) || - meridiem === 'বিকাল') { - return hour + 12; - } else { - return hour; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'রাত'; - } else if (hour < 10) { - return 'সকাল'; - } else if (hour < 17) { - return 'দুপুর'; - } else if (hour < 20) { - return 'বিকাল'; - } else { - return 'রাত'; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 6th is the first week of the year. - } - }); - - return bn; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/bo.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/bo.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '༡', - '2': '༢', - '3': '༣', - '4': '༤', - '5': '༥', - '6': '༦', - '7': '༧', - '8': '༨', - '9': '༩', - '0': '༠' - }, - numberMap = { - '༡': '1', - '༢': '2', - '༣': '3', - '༤': '4', - '༥': '5', - '༦': '6', - '༧': '7', - '༨': '8', - '༩': '9', - '༠': '0' - }; - - var bo = moment.defineLocale('bo', { - months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'), - monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'), - weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'), - weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'), - weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'), - longDateFormat : { - LT : 'A h:mm', - LTS : 'A h:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm', - LLLL : 'dddd, D MMMM YYYY, A h:mm' - }, - calendar : { - sameDay : '[དི་རིང] LT', - nextDay : '[སང་ཉིན] LT', - nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT', - lastDay : '[ཁ་སང] LT', - lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s ལ་', - past : '%s སྔན་ལ', - s : 'ལམ་སང', - ss : '%d སྐར་ཆ།', - m : 'སྐར་མ་གཅིག', - mm : '%d སྐར་མ', - h : 'ཆུ་ཚོད་གཅིག', - hh : '%d ཆུ་ཚོད', - d : 'ཉིན་གཅིག', - dd : '%d ཉིན་', - M : 'ཟླ་བ་གཅིག', - MM : '%d ཟླ་བ', - y : 'ལོ་གཅིག', - yy : '%d ལོ' - }, - preparse: function (string) { - return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if ((meridiem === 'མཚན་མོ' && hour >= 4) || - (meridiem === 'ཉིན་གུང' && hour < 5) || - meridiem === 'དགོང་དག') { - return hour + 12; - } else { - return hour; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'མཚན་མོ'; - } else if (hour < 10) { - return 'ཞོགས་ཀས'; - } else if (hour < 17) { - return 'ཉིན་གུང'; - } else if (hour < 20) { - return 'དགོང་དག'; - } else { - return 'མཚན་མོ'; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 6th is the first week of the year. - } - }); - - return bo; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/br.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/br.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function relativeTimeWithMutation(number, withoutSuffix, key) { - var format = { - 'mm': 'munutenn', - 'MM': 'miz', - 'dd': 'devezh' - }; - return number + ' ' + mutation(format[key], number); - } - function specialMutationForYears(number) { - switch (lastNumber(number)) { - case 1: - case 3: - case 4: - case 5: - case 9: - return number + ' bloaz'; - default: - return number + ' vloaz'; - } - } - function lastNumber(number) { - if (number > 9) { - return lastNumber(number % 10); - } - return number; - } - function mutation(text, number) { - if (number === 2) { - return softMutation(text); - } - return text; - } - function softMutation(text) { - var mutationTable = { - 'm': 'v', - 'b': 'v', - 'd': 'z' - }; - if (mutationTable[text.charAt(0)] === undefined) { - return text; - } - return mutationTable[text.charAt(0)] + text.substring(1); - } - - var br = moment.defineLocale('br', { - months : 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'), - monthsShort : 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'), - weekdays : 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'), - weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'), - weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'h[e]mm A', - LTS : 'h[e]mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D [a viz] MMMM YYYY', - LLL : 'D [a viz] MMMM YYYY h[e]mm A', - LLLL : 'dddd, D [a viz] MMMM YYYY h[e]mm A' - }, - calendar : { - sameDay : '[Hiziv da] LT', - nextDay : '[Warc\'hoazh da] LT', - nextWeek : 'dddd [da] LT', - lastDay : '[Dec\'h da] LT', - lastWeek : 'dddd [paset da] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'a-benn %s', - past : '%s \'zo', - s : 'un nebeud segondennoù', - ss : '%d eilenn', - m : 'ur vunutenn', - mm : relativeTimeWithMutation, - h : 'un eur', - hh : '%d eur', - d : 'un devezh', - dd : relativeTimeWithMutation, - M : 'ur miz', - MM : relativeTimeWithMutation, - y : 'ur bloaz', - yy : specialMutationForYears - }, - dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/, - ordinal : function (number) { - var output = (number === 1) ? 'añ' : 'vet'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return br; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/bs.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/bs.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function translate(number, withoutSuffix, key) { - var result = number + ' '; - switch (key) { - case 'ss': - if (number === 1) { - result += 'sekunda'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sekunde'; - } else { - result += 'sekundi'; - } - return result; - case 'm': - return withoutSuffix ? 'jedna minuta' : 'jedne minute'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minuta'; - } - return result; - case 'h': - return withoutSuffix ? 'jedan sat' : 'jednog sata'; - case 'hh': - if (number === 1) { - result += 'sat'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sata'; - } else { - result += 'sati'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dana'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mjesec'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'mjeseca'; - } else { - result += 'mjeseci'; - } - return result; - case 'yy': - if (number === 1) { - result += 'godina'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'godine'; - } else { - result += 'godina'; - } - return result; - } - } - - var bs = moment.defineLocale('bs', { - months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'), - monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'), - monthsParseExact: true, - weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), - weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), - weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd, D. MMMM YYYY H:mm' - }, - calendar : { - sameDay : '[danas u] LT', - nextDay : '[sutra u] LT', - nextWeek : function () { - switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[jučer u] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : 'za %s', - past : 'prije %s', - s : 'par sekundi', - ss : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : 'dan', - dd : translate, - M : 'mjesec', - MM : translate, - y : 'godinu', - yy : translate - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return bs; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ca.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ca.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var ca = moment.defineLocale('ca', { - months : { - standalone: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'), - format: 'de gener_de febrer_de març_d\'abril_de maig_de juny_de juliol_d\'agost_de setembre_d\'octubre_de novembre_de desembre'.split('_'), - isFormat: /D[oD]?(\s)+MMMM/ - }, - monthsShort : 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split('_'), - monthsParseExact : true, - weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'), - weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'), - weekdaysMin : 'dg_dl_dt_dc_dj_dv_ds'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM [de] YYYY', - ll : 'D MMM YYYY', - LLL : 'D MMMM [de] YYYY [a les] H:mm', - lll : 'D MMM YYYY, H:mm', - LLLL : 'dddd D MMMM [de] YYYY [a les] H:mm', - llll : 'ddd D MMM YYYY, H:mm' - }, - calendar : { - sameDay : function () { - return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - nextDay : function () { - return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - lastDay : function () { - return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'd\'aquí %s', - past : 'fa %s', - s : 'uns segons', - ss : '%d segons', - m : 'un minut', - mm : '%d minuts', - h : 'una hora', - hh : '%d hores', - d : 'un dia', - dd : '%d dies', - M : 'un mes', - MM : '%d mesos', - y : 'un any', - yy : '%d anys' - }, - dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/, - ordinal : function (number, period) { - var output = (number === 1) ? 'r' : - (number === 2) ? 'n' : - (number === 3) ? 'r' : - (number === 4) ? 't' : 'è'; - if (period === 'w' || period === 'W') { - output = 'a'; - } - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return ca; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/cs.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/cs.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'), - monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'); - - var monthsParse = [/^led/i, /^úno/i, /^bře/i, /^dub/i, /^kvě/i, /^(čvn|červen$|června)/i, /^(čvc|červenec|července)/i, /^srp/i, /^zář/i, /^říj/i, /^lis/i, /^pro/i]; - // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched. - // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'. - var monthsRegex = /^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i; - - function plural(n) { - return (n > 1) && (n < 5) && (~~(n / 10) !== 1); - } - function translate(number, withoutSuffix, key, isFuture) { - var result = number + ' '; - switch (key) { - case 's': // a few seconds / in a few seconds / a few seconds ago - return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami'; - case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'sekundy' : 'sekund'); - } else { - return result + 'sekundami'; - } - break; - case 'm': // a minute / in a minute / a minute ago - return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou'); - case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'minuty' : 'minut'); - } else { - return result + 'minutami'; - } - break; - case 'h': // an hour / in an hour / an hour ago - return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); - case 'hh': // 9 hours / in 9 hours / 9 hours ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'hodiny' : 'hodin'); - } else { - return result + 'hodinami'; - } - break; - case 'd': // a day / in a day / a day ago - return (withoutSuffix || isFuture) ? 'den' : 'dnem'; - case 'dd': // 9 days / in 9 days / 9 days ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'dny' : 'dní'); - } else { - return result + 'dny'; - } - break; - case 'M': // a month / in a month / a month ago - return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem'; - case 'MM': // 9 months / in 9 months / 9 months ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'měsíce' : 'měsíců'); - } else { - return result + 'měsíci'; - } - break; - case 'y': // a year / in a year / a year ago - return (withoutSuffix || isFuture) ? 'rok' : 'rokem'; - case 'yy': // 9 years / in 9 years / 9 years ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'roky' : 'let'); - } else { - return result + 'lety'; - } - break; - } - } - - var cs = moment.defineLocale('cs', { - months : months, - monthsShort : monthsShort, - monthsRegex : monthsRegex, - monthsShortRegex : monthsRegex, - // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched. - // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'. - monthsStrictRegex : /^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i, - monthsShortStrictRegex : /^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i, - monthsParse : monthsParse, - longMonthsParse : monthsParse, - shortMonthsParse : monthsParse, - weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'), - weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'), - weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'), - longDateFormat : { - LT: 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd D. MMMM YYYY H:mm', - l : 'D. M. YYYY' - }, - calendar : { - sameDay: '[dnes v] LT', - nextDay: '[zítra v] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[v neděli v] LT'; - case 1: - case 2: - return '[v] dddd [v] LT'; - case 3: - return '[ve středu v] LT'; - case 4: - return '[ve čtvrtek v] LT'; - case 5: - return '[v pátek v] LT'; - case 6: - return '[v sobotu v] LT'; - } - }, - lastDay: '[včera v] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[minulou neděli v] LT'; - case 1: - case 2: - return '[minulé] dddd [v] LT'; - case 3: - return '[minulou středu v] LT'; - case 4: - case 5: - return '[minulý] dddd [v] LT'; - case 6: - return '[minulou sobotu v] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : 'za %s', - past : 'před %s', - s : translate, - ss : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - dayOfMonthOrdinalParse : /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return cs; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/cv.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/cv.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var cv = moment.defineLocale('cv', { - months : 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'), - monthsShort : 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'), - weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'), - weekdaysShort : 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'), - weekdaysMin : 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD-MM-YYYY', - LL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]', - LLL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', - LLLL : 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm' - }, - calendar : { - sameDay: '[Паян] LT [сехетре]', - nextDay: '[Ыран] LT [сехетре]', - lastDay: '[Ӗнер] LT [сехетре]', - nextWeek: '[Ҫитес] dddd LT [сехетре]', - lastWeek: '[Иртнӗ] dddd LT [сехетре]', - sameElse: 'L' - }, - relativeTime : { - future : function (output) { - var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран'; - return output + affix; - }, - past : '%s каялла', - s : 'пӗр-ик ҫеккунт', - ss : '%d ҫеккунт', - m : 'пӗр минут', - mm : '%d минут', - h : 'пӗр сехет', - hh : '%d сехет', - d : 'пӗр кун', - dd : '%d кун', - M : 'пӗр уйӑх', - MM : '%d уйӑх', - y : 'пӗр ҫул', - yy : '%d ҫул' - }, - dayOfMonthOrdinalParse: /\d{1,2}-мӗш/, - ordinal : '%d-мӗш', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return cv; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/cy.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/cy.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var cy = moment.defineLocale('cy', { - months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'), - monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'), - weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'), - weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'), - weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'), - weekdaysParseExact : true, - // time formats are the same as en-gb - longDateFormat: { - LT: 'HH:mm', - LTS : 'HH:mm:ss', - L: 'DD/MM/YYYY', - LL: 'D MMMM YYYY', - LLL: 'D MMMM YYYY HH:mm', - LLLL: 'dddd, D MMMM YYYY HH:mm' - }, - calendar: { - sameDay: '[Heddiw am] LT', - nextDay: '[Yfory am] LT', - nextWeek: 'dddd [am] LT', - lastDay: '[Ddoe am] LT', - lastWeek: 'dddd [diwethaf am] LT', - sameElse: 'L' - }, - relativeTime: { - future: 'mewn %s', - past: '%s yn ôl', - s: 'ychydig eiliadau', - ss: '%d eiliad', - m: 'munud', - mm: '%d munud', - h: 'awr', - hh: '%d awr', - d: 'diwrnod', - dd: '%d diwrnod', - M: 'mis', - MM: '%d mis', - y: 'blwyddyn', - yy: '%d flynedd' - }, - dayOfMonthOrdinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/, - // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh - ordinal: function (number) { - var b = number, - output = '', - lookup = [ - '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed - 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed - ]; - if (b > 20) { - if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) { - output = 'fed'; // not 30ain, 70ain or 90ain - } else { - output = 'ain'; - } - } else if (b > 0) { - output = lookup[b]; - } - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return cy; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/da.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/da.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var da = moment.defineLocale('da', { - months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'), - monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), - weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), - weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'), - weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY HH:mm', - LLLL : 'dddd [d.] D. MMMM YYYY [kl.] HH:mm' - }, - calendar : { - sameDay : '[i dag kl.] LT', - nextDay : '[i morgen kl.] LT', - nextWeek : 'på dddd [kl.] LT', - lastDay : '[i går kl.] LT', - lastWeek : '[i] dddd[s kl.] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'om %s', - past : '%s siden', - s : 'få sekunder', - ss : '%d sekunder', - m : 'et minut', - mm : '%d minutter', - h : 'en time', - hh : '%d timer', - d : 'en dag', - dd : '%d dage', - M : 'en måned', - MM : '%d måneder', - y : 'et år', - yy : '%d år' - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return da; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/de-at.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/de-at.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eine Minute', 'einer Minute'], - 'h': ['eine Stunde', 'einer Stunde'], - 'd': ['ein Tag', 'einem Tag'], - 'dd': [number + ' Tage', number + ' Tagen'], - 'M': ['ein Monat', 'einem Monat'], - 'MM': [number + ' Monate', number + ' Monaten'], - 'y': ['ein Jahr', 'einem Jahr'], - 'yy': [number + ' Jahre', number + ' Jahren'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - - var deAt = moment.defineLocale('de-at', { - months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), - monthsShort : 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'), - monthsParseExact : true, - weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), - weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), - weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY HH:mm', - LLLL : 'dddd, D. MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[heute um] LT [Uhr]', - sameElse: 'L', - nextDay: '[morgen um] LT [Uhr]', - nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[gestern um] LT [Uhr]', - lastWeek: '[letzten] dddd [um] LT [Uhr]' - }, - relativeTime : { - future : 'in %s', - past : 'vor %s', - s : 'ein paar Sekunden', - ss : '%d Sekunden', - m : processRelativeTime, - mm : '%d Minuten', - h : processRelativeTime, - hh : '%d Stunden', - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return deAt; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/de-ch.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/de-ch.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eine Minute', 'einer Minute'], - 'h': ['eine Stunde', 'einer Stunde'], - 'd': ['ein Tag', 'einem Tag'], - 'dd': [number + ' Tage', number + ' Tagen'], - 'M': ['ein Monat', 'einem Monat'], - 'MM': [number + ' Monate', number + ' Monaten'], - 'y': ['ein Jahr', 'einem Jahr'], - 'yy': [number + ' Jahre', number + ' Jahren'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - - var deCh = moment.defineLocale('de-ch', { - months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), - monthsShort : 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'), - monthsParseExact : true, - weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), - weekdaysShort : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), - weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY HH:mm', - LLLL : 'dddd, D. MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[heute um] LT [Uhr]', - sameElse: 'L', - nextDay: '[morgen um] LT [Uhr]', - nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[gestern um] LT [Uhr]', - lastWeek: '[letzten] dddd [um] LT [Uhr]' - }, - relativeTime : { - future : 'in %s', - past : 'vor %s', - s : 'ein paar Sekunden', - ss : '%d Sekunden', - m : processRelativeTime, - mm : '%d Minuten', - h : processRelativeTime, - hh : '%d Stunden', - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return deCh; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/de.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/de.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eine Minute', 'einer Minute'], - 'h': ['eine Stunde', 'einer Stunde'], - 'd': ['ein Tag', 'einem Tag'], - 'dd': [number + ' Tage', number + ' Tagen'], - 'M': ['ein Monat', 'einem Monat'], - 'MM': [number + ' Monate', number + ' Monaten'], - 'y': ['ein Jahr', 'einem Jahr'], - 'yy': [number + ' Jahre', number + ' Jahren'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - - var de = moment.defineLocale('de', { - months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), - monthsShort : 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'), - monthsParseExact : true, - weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), - weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), - weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY HH:mm', - LLLL : 'dddd, D. MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[heute um] LT [Uhr]', - sameElse: 'L', - nextDay: '[morgen um] LT [Uhr]', - nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[gestern um] LT [Uhr]', - lastWeek: '[letzten] dddd [um] LT [Uhr]' - }, - relativeTime : { - future : 'in %s', - past : 'vor %s', - s : 'ein paar Sekunden', - ss : '%d Sekunden', - m : processRelativeTime, - mm : '%d Minuten', - h : processRelativeTime, - hh : '%d Stunden', - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return de; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/dv.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/dv.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var months = [ - 'ޖެނުއަރީ', - 'ފެބްރުއަރީ', - 'މާރިޗު', - 'އޭޕްރީލު', - 'މޭ', - 'ޖޫން', - 'ޖުލައި', - 'އޯގަސްޓު', - 'ސެޕްޓެމްބަރު', - 'އޮކްޓޯބަރު', - 'ނޮވެމްބަރު', - 'ޑިސެމްބަރު' - ], weekdays = [ - 'އާދިއްތަ', - 'ހޯމަ', - 'އަންގާރަ', - 'ބުދަ', - 'ބުރާސްފަތި', - 'ހުކުރު', - 'ހޮނިހިރު' - ]; - - var dv = moment.defineLocale('dv', { - months : months, - monthsShort : months, - weekdays : weekdays, - weekdaysShort : weekdays, - weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'), - longDateFormat : { - - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'D/M/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - meridiemParse: /މކ|މފ/, - isPM : function (input) { - return 'މފ' === input; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'މކ'; - } else { - return 'މފ'; - } - }, - calendar : { - sameDay : '[މިއަދު] LT', - nextDay : '[މާދަމާ] LT', - nextWeek : 'dddd LT', - lastDay : '[އިއްޔެ] LT', - lastWeek : '[ފާއިތުވި] dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : 'ތެރޭގައި %s', - past : 'ކުރިން %s', - s : 'ސިކުންތުކޮޅެއް', - ss : 'd% ސިކުންތު', - m : 'މިނިޓެއް', - mm : 'މިނިޓު %d', - h : 'ގަޑިއިރެއް', - hh : 'ގަޑިއިރު %d', - d : 'ދުވަހެއް', - dd : 'ދުވަސް %d', - M : 'މަހެއް', - MM : 'މަސް %d', - y : 'އަހަރެއް', - yy : 'އަހަރު %d' - }, - preparse: function (string) { - return string.replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/,/g, '،'); - }, - week : { - dow : 7, // Sunday is the first day of the week. - doy : 12 // The week that contains Jan 12th is the first week of the year. - } - }); - - return dv; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/el.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/el.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - function isFunction(input) { - return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; - } - - - var el = moment.defineLocale('el', { - monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'), - monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'), - months : function (momentToFormat, format) { - if (!momentToFormat) { - return this._monthsNominativeEl; - } else if (typeof format === 'string' && /D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM' - return this._monthsGenitiveEl[momentToFormat.month()]; - } else { - return this._monthsNominativeEl[momentToFormat.month()]; - } - }, - monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'), - weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'), - weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'), - weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'), - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'μμ' : 'ΜΜ'; - } else { - return isLower ? 'πμ' : 'ΠΜ'; - } - }, - isPM : function (input) { - return ((input + '').toLowerCase()[0] === 'μ'); - }, - meridiemParse : /[ΠΜ]\.?Μ?\.?/i, - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY h:mm A', - LLLL : 'dddd, D MMMM YYYY h:mm A' - }, - calendarEl : { - sameDay : '[Σήμερα {}] LT', - nextDay : '[Αύριο {}] LT', - nextWeek : 'dddd [{}] LT', - lastDay : '[Χθες {}] LT', - lastWeek : function () { - switch (this.day()) { - case 6: - return '[το προηγούμενο] dddd [{}] LT'; - default: - return '[την προηγούμενη] dddd [{}] LT'; - } - }, - sameElse : 'L' - }, - calendar : function (key, mom) { - var output = this._calendarEl[key], - hours = mom && mom.hours(); - if (isFunction(output)) { - output = output.apply(mom); - } - return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις')); - }, - relativeTime : { - future : 'σε %s', - past : '%s πριν', - s : 'λίγα δευτερόλεπτα', - ss : '%d δευτερόλεπτα', - m : 'ένα λεπτό', - mm : '%d λεπτά', - h : 'μία ώρα', - hh : '%d ώρες', - d : 'μία μέρα', - dd : '%d μέρες', - M : 'ένας μήνας', - MM : '%d μήνες', - y : 'ένας χρόνος', - yy : '%d χρόνια' - }, - dayOfMonthOrdinalParse: /\d{1,2}η/, - ordinal: '%dη', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4st is the first week of the year. - } - }); - - return el; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/en-SG.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/en-SG.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var enSG = moment.defineLocale('en-SG', { - months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - ss : '%d seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return enSG; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/en-au.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/en-au.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var enAu = moment.defineLocale('en-au', { - months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY h:mm A', - LLLL : 'dddd, D MMMM YYYY h:mm A' - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - ss : '%d seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return enAu; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/en-ca.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/en-ca.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var enCa = moment.defineLocale('en-ca', { - months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'YYYY-MM-DD', - LL : 'MMMM D, YYYY', - LLL : 'MMMM D, YYYY h:mm A', - LLLL : 'dddd, MMMM D, YYYY h:mm A' - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - ss : '%d seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); - - return enCa; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/en-gb.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/en-gb.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var enGb = moment.defineLocale('en-gb', { - months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - ss : '%d seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return enGb; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/en-ie.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/en-ie.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var enIe = moment.defineLocale('en-ie', { - months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - ss : '%d seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return enIe; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/en-il.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/en-il.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var enIl = moment.defineLocale('en-il', { - months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); - - return enIl; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/en-nz.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/en-nz.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var enNz = moment.defineLocale('en-nz', { - months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY h:mm A', - LLLL : 'dddd, D MMMM YYYY h:mm A' - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - ss : '%d seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return enNz; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/eo.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/eo.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var eo = moment.defineLocale('eo', { - months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'), - monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'), - weekdays : 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'), - weekdaysShort : 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'), - weekdaysMin : 'di_lu_ma_me_ĵa_ve_sa'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY-MM-DD', - LL : 'D[-a de] MMMM, YYYY', - LLL : 'D[-a de] MMMM, YYYY HH:mm', - LLLL : 'dddd, [la] D[-a de] MMMM, YYYY HH:mm' - }, - meridiemParse: /[ap]\.t\.m/i, - isPM: function (input) { - return input.charAt(0).toLowerCase() === 'p'; - }, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'p.t.m.' : 'P.T.M.'; - } else { - return isLower ? 'a.t.m.' : 'A.T.M.'; - } - }, - calendar : { - sameDay : '[Hodiaŭ je] LT', - nextDay : '[Morgaŭ je] LT', - nextWeek : 'dddd [je] LT', - lastDay : '[Hieraŭ je] LT', - lastWeek : '[pasinta] dddd [je] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'post %s', - past : 'antaŭ %s', - s : 'sekundoj', - ss : '%d sekundoj', - m : 'minuto', - mm : '%d minutoj', - h : 'horo', - hh : '%d horoj', - d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo - dd : '%d tagoj', - M : 'monato', - MM : '%d monatoj', - y : 'jaro', - yy : '%d jaroj' - }, - dayOfMonthOrdinalParse: /\d{1,2}a/, - ordinal : '%da', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return eo; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/es-do.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/es-do.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), - monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); - - var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i]; - var monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; - - var esDo = moment.defineLocale('es-do', { - months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), - monthsShort : function (m, format) { - if (!m) { - return monthsShortDot; - } else if (/-MMM-/.test(format)) { - return monthsShort[m.month()]; - } else { - return monthsShortDot[m.month()]; - } - }, - monthsRegex: monthsRegex, - monthsShortRegex: monthsRegex, - monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, - monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, - monthsParse: monthsParse, - longMonthsParse: monthsParse, - shortMonthsParse: monthsParse, - weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), - weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), - weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D [de] MMMM [de] YYYY', - LLL : 'D [de] MMMM [de] YYYY h:mm A', - LLLL : 'dddd, D [de] MMMM [de] YYYY h:mm A' - }, - calendar : { - sameDay : function () { - return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextDay : function () { - return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastDay : function () { - return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'en %s', - past : 'hace %s', - s : 'unos segundos', - ss : '%d segundos', - m : 'un minuto', - mm : '%d minutos', - h : 'una hora', - hh : '%d horas', - d : 'un día', - dd : '%d días', - M : 'un mes', - MM : '%d meses', - y : 'un año', - yy : '%d años' - }, - dayOfMonthOrdinalParse : /\d{1,2}º/, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return esDo; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/es-us.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/es-us.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), - monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); - - var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i]; - var monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; - - var esUs = moment.defineLocale('es-us', { - months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), - monthsShort : function (m, format) { - if (!m) { - return monthsShortDot; - } else if (/-MMM-/.test(format)) { - return monthsShort[m.month()]; - } else { - return monthsShortDot[m.month()]; - } - }, - monthsRegex: monthsRegex, - monthsShortRegex: monthsRegex, - monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, - monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, - monthsParse: monthsParse, - longMonthsParse: monthsParse, - shortMonthsParse: monthsParse, - weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), - weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), - weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'MM/DD/YYYY', - LL : 'D [de] MMMM [de] YYYY', - LLL : 'D [de] MMMM [de] YYYY h:mm A', - LLLL : 'dddd, D [de] MMMM [de] YYYY h:mm A' - }, - calendar : { - sameDay : function () { - return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextDay : function () { - return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastDay : function () { - return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'en %s', - past : 'hace %s', - s : 'unos segundos', - ss : '%d segundos', - m : 'un minuto', - mm : '%d minutos', - h : 'una hora', - hh : '%d horas', - d : 'un día', - dd : '%d días', - M : 'un mes', - MM : '%d meses', - y : 'un año', - yy : '%d años' - }, - dayOfMonthOrdinalParse : /\d{1,2}º/, - ordinal : '%dº', - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 6th is the first week of the year. - } - }); - - return esUs; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/es.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/es.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), - monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); - - var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i]; - var monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; - - var es = moment.defineLocale('es', { - months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), - monthsShort : function (m, format) { - if (!m) { - return monthsShortDot; - } else if (/-MMM-/.test(format)) { - return monthsShort[m.month()]; - } else { - return monthsShortDot[m.month()]; - } - }, - monthsRegex : monthsRegex, - monthsShortRegex : monthsRegex, - monthsStrictRegex : /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, - monthsShortStrictRegex : /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, - monthsParse : monthsParse, - longMonthsParse : monthsParse, - shortMonthsParse : monthsParse, - weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), - weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), - weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D [de] MMMM [de] YYYY', - LLL : 'D [de] MMMM [de] YYYY H:mm', - LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm' - }, - calendar : { - sameDay : function () { - return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextDay : function () { - return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastDay : function () { - return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'en %s', - past : 'hace %s', - s : 'unos segundos', - ss : '%d segundos', - m : 'un minuto', - mm : '%d minutos', - h : 'una hora', - hh : '%d horas', - d : 'un día', - dd : '%d días', - M : 'un mes', - MM : '%d meses', - y : 'un año', - yy : '%d años' - }, - dayOfMonthOrdinalParse : /\d{1,2}º/, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return es; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/et.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/et.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'], - 'ss': [number + 'sekundi', number + 'sekundit'], - 'm' : ['ühe minuti', 'üks minut'], - 'mm': [number + ' minuti', number + ' minutit'], - 'h' : ['ühe tunni', 'tund aega', 'üks tund'], - 'hh': [number + ' tunni', number + ' tundi'], - 'd' : ['ühe päeva', 'üks päev'], - 'M' : ['kuu aja', 'kuu aega', 'üks kuu'], - 'MM': [number + ' kuu', number + ' kuud'], - 'y' : ['ühe aasta', 'aasta', 'üks aasta'], - 'yy': [number + ' aasta', number + ' aastat'] - }; - if (withoutSuffix) { - return format[key][2] ? format[key][2] : format[key][1]; - } - return isFuture ? format[key][0] : format[key][1]; - } - - var et = moment.defineLocale('et', { - months : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'), - monthsShort : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'), - weekdays : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'), - weekdaysShort : 'P_E_T_K_N_R_L'.split('_'), - weekdaysMin : 'P_E_T_K_N_R_L'.split('_'), - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd, D. MMMM YYYY H:mm' - }, - calendar : { - sameDay : '[Täna,] LT', - nextDay : '[Homme,] LT', - nextWeek : '[Järgmine] dddd LT', - lastDay : '[Eile,] LT', - lastWeek : '[Eelmine] dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s pärast', - past : '%s tagasi', - s : processRelativeTime, - ss : processRelativeTime, - m : processRelativeTime, - mm : processRelativeTime, - h : processRelativeTime, - hh : processRelativeTime, - d : processRelativeTime, - dd : '%d päeva', - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return et; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/eu.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/eu.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var eu = moment.defineLocale('eu', { - months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'), - monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'), - monthsParseExact : true, - weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'), - weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'), - weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY-MM-DD', - LL : 'YYYY[ko] MMMM[ren] D[a]', - LLL : 'YYYY[ko] MMMM[ren] D[a] HH:mm', - LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm', - l : 'YYYY-M-D', - ll : 'YYYY[ko] MMM D[a]', - lll : 'YYYY[ko] MMM D[a] HH:mm', - llll : 'ddd, YYYY[ko] MMM D[a] HH:mm' - }, - calendar : { - sameDay : '[gaur] LT[etan]', - nextDay : '[bihar] LT[etan]', - nextWeek : 'dddd LT[etan]', - lastDay : '[atzo] LT[etan]', - lastWeek : '[aurreko] dddd LT[etan]', - sameElse : 'L' - }, - relativeTime : { - future : '%s barru', - past : 'duela %s', - s : 'segundo batzuk', - ss : '%d segundo', - m : 'minutu bat', - mm : '%d minutu', - h : 'ordu bat', - hh : '%d ordu', - d : 'egun bat', - dd : '%d egun', - M : 'hilabete bat', - MM : '%d hilabete', - y : 'urte bat', - yy : '%d urte' - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return eu; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/fa.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/fa.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '۱', - '2': '۲', - '3': '۳', - '4': '۴', - '5': '۵', - '6': '۶', - '7': '۷', - '8': '۸', - '9': '۹', - '0': '۰' - }, numberMap = { - '۱': '1', - '۲': '2', - '۳': '3', - '۴': '4', - '۵': '5', - '۶': '6', - '۷': '7', - '۸': '8', - '۹': '9', - '۰': '0' - }; - - var fa = moment.defineLocale('fa', { - months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), - monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), - weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), - weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), - weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - meridiemParse: /قبل از ظهر|بعد از ظهر/, - isPM: function (input) { - return /بعد از ظهر/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'قبل از ظهر'; - } else { - return 'بعد از ظهر'; - } - }, - calendar : { - sameDay : '[امروز ساعت] LT', - nextDay : '[فردا ساعت] LT', - nextWeek : 'dddd [ساعت] LT', - lastDay : '[دیروز ساعت] LT', - lastWeek : 'dddd [پیش] [ساعت] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'در %s', - past : '%s پیش', - s : 'چند ثانیه', - ss : 'ثانیه d%', - m : 'یک دقیقه', - mm : '%d دقیقه', - h : 'یک ساعت', - hh : '%d ساعت', - d : 'یک روز', - dd : '%d روز', - M : 'یک ماه', - MM : '%d ماه', - y : 'یک سال', - yy : '%d سال' - }, - preparse: function (string) { - return string.replace(/[۰-۹]/g, function (match) { - return numberMap[match]; - }).replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }).replace(/,/g, '،'); - }, - dayOfMonthOrdinalParse: /\d{1,2}م/, - ordinal : '%dم', - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 12th is the first week of the year. - } - }); - - return fa; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/fi.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/fi.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '), - numbersFuture = [ - 'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden', - numbersPast[7], numbersPast[8], numbersPast[9] - ]; - function translate(number, withoutSuffix, key, isFuture) { - var result = ''; - switch (key) { - case 's': - return isFuture ? 'muutaman sekunnin' : 'muutama sekunti'; - case 'ss': - return isFuture ? 'sekunnin' : 'sekuntia'; - case 'm': - return isFuture ? 'minuutin' : 'minuutti'; - case 'mm': - result = isFuture ? 'minuutin' : 'minuuttia'; - break; - case 'h': - return isFuture ? 'tunnin' : 'tunti'; - case 'hh': - result = isFuture ? 'tunnin' : 'tuntia'; - break; - case 'd': - return isFuture ? 'päivän' : 'päivä'; - case 'dd': - result = isFuture ? 'päivän' : 'päivää'; - break; - case 'M': - return isFuture ? 'kuukauden' : 'kuukausi'; - case 'MM': - result = isFuture ? 'kuukauden' : 'kuukautta'; - break; - case 'y': - return isFuture ? 'vuoden' : 'vuosi'; - case 'yy': - result = isFuture ? 'vuoden' : 'vuotta'; - break; - } - result = verbalNumber(number, isFuture) + ' ' + result; - return result; - } - function verbalNumber(number, isFuture) { - return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number; - } - - var fi = moment.defineLocale('fi', { - months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'), - monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'), - weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'), - weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'), - weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'), - longDateFormat : { - LT : 'HH.mm', - LTS : 'HH.mm.ss', - L : 'DD.MM.YYYY', - LL : 'Do MMMM[ta] YYYY', - LLL : 'Do MMMM[ta] YYYY, [klo] HH.mm', - LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm', - l : 'D.M.YYYY', - ll : 'Do MMM YYYY', - lll : 'Do MMM YYYY, [klo] HH.mm', - llll : 'ddd, Do MMM YYYY, [klo] HH.mm' - }, - calendar : { - sameDay : '[tänään] [klo] LT', - nextDay : '[huomenna] [klo] LT', - nextWeek : 'dddd [klo] LT', - lastDay : '[eilen] [klo] LT', - lastWeek : '[viime] dddd[na] [klo] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s päästä', - past : '%s sitten', - s : translate, - ss : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return fi; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/fo.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/fo.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var fo = moment.defineLocale('fo', { - months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'), - monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), - weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'), - weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'), - weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D. MMMM, YYYY HH:mm' - }, - calendar : { - sameDay : '[Í dag kl.] LT', - nextDay : '[Í morgin kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[Í gjár kl.] LT', - lastWeek : '[síðstu] dddd [kl] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'um %s', - past : '%s síðani', - s : 'fá sekund', - ss : '%d sekundir', - m : 'ein minuttur', - mm : '%d minuttir', - h : 'ein tími', - hh : '%d tímar', - d : 'ein dagur', - dd : '%d dagar', - M : 'ein mánaður', - MM : '%d mánaðir', - y : 'eitt ár', - yy : '%d ár' - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return fo; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/fr-ca.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/fr-ca.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var frCa = moment.defineLocale('fr-ca', { - months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), - monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), - monthsParseExact : true, - weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), - weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), - weekdaysMin : 'di_lu_ma_me_je_ve_sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY-MM-DD', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Aujourd’hui à] LT', - nextDay : '[Demain à] LT', - nextWeek : 'dddd [à] LT', - lastDay : '[Hier à] LT', - lastWeek : 'dddd [dernier à] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'dans %s', - past : 'il y a %s', - s : 'quelques secondes', - ss : '%d secondes', - m : 'une minute', - mm : '%d minutes', - h : 'une heure', - hh : '%d heures', - d : 'un jour', - dd : '%d jours', - M : 'un mois', - MM : '%d mois', - y : 'un an', - yy : '%d ans' - }, - dayOfMonthOrdinalParse: /\d{1,2}(er|e)/, - ordinal : function (number, period) { - switch (period) { - // Words with masculine grammatical gender: mois, trimestre, jour - default: - case 'M': - case 'Q': - case 'D': - case 'DDD': - case 'd': - return number + (number === 1 ? 'er' : 'e'); - - // Words with feminine grammatical gender: semaine - case 'w': - case 'W': - return number + (number === 1 ? 're' : 'e'); - } - } - }); - - return frCa; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/fr-ch.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/fr-ch.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var frCh = moment.defineLocale('fr-ch', { - months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), - monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), - monthsParseExact : true, - weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), - weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), - weekdaysMin : 'di_lu_ma_me_je_ve_sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Aujourd’hui à] LT', - nextDay : '[Demain à] LT', - nextWeek : 'dddd [à] LT', - lastDay : '[Hier à] LT', - lastWeek : 'dddd [dernier à] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'dans %s', - past : 'il y a %s', - s : 'quelques secondes', - ss : '%d secondes', - m : 'une minute', - mm : '%d minutes', - h : 'une heure', - hh : '%d heures', - d : 'un jour', - dd : '%d jours', - M : 'un mois', - MM : '%d mois', - y : 'un an', - yy : '%d ans' - }, - dayOfMonthOrdinalParse: /\d{1,2}(er|e)/, - ordinal : function (number, period) { - switch (period) { - // Words with masculine grammatical gender: mois, trimestre, jour - default: - case 'M': - case 'Q': - case 'D': - case 'DDD': - case 'd': - return number + (number === 1 ? 'er' : 'e'); - - // Words with feminine grammatical gender: semaine - case 'w': - case 'W': - return number + (number === 1 ? 're' : 'e'); - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return frCh; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/fr.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/fr.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var fr = moment.defineLocale('fr', { - months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), - monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), - monthsParseExact : true, - weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), - weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), - weekdaysMin : 'di_lu_ma_me_je_ve_sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Aujourd’hui à] LT', - nextDay : '[Demain à] LT', - nextWeek : 'dddd [à] LT', - lastDay : '[Hier à] LT', - lastWeek : 'dddd [dernier à] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'dans %s', - past : 'il y a %s', - s : 'quelques secondes', - ss : '%d secondes', - m : 'une minute', - mm : '%d minutes', - h : 'une heure', - hh : '%d heures', - d : 'un jour', - dd : '%d jours', - M : 'un mois', - MM : '%d mois', - y : 'un an', - yy : '%d ans' - }, - dayOfMonthOrdinalParse: /\d{1,2}(er|)/, - ordinal : function (number, period) { - switch (period) { - // TODO: Return 'e' when day of month > 1. Move this case inside - // block for masculine words below. - // See https://github.com/moment/moment/issues/3375 - case 'D': - return number + (number === 1 ? 'er' : ''); - - // Words with masculine grammatical gender: mois, trimestre, jour - default: - case 'M': - case 'Q': - case 'DDD': - case 'd': - return number + (number === 1 ? 'er' : 'e'); - - // Words with feminine grammatical gender: semaine - case 'w': - case 'W': - return number + (number === 1 ? 're' : 'e'); - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return fr; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/fy.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/fy.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'), - monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'); - - var fy = moment.defineLocale('fy', { - months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'), - monthsShort : function (m, format) { - if (!m) { - return monthsShortWithDots; - } else if (/-MMM-/.test(format)) { - return monthsShortWithoutDots[m.month()]; - } else { - return monthsShortWithDots[m.month()]; - } - }, - monthsParseExact : true, - weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'), - weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'), - weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD-MM-YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[hjoed om] LT', - nextDay: '[moarn om] LT', - nextWeek: 'dddd [om] LT', - lastDay: '[juster om] LT', - lastWeek: '[ôfrûne] dddd [om] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'oer %s', - past : '%s lyn', - s : 'in pear sekonden', - ss : '%d sekonden', - m : 'ien minút', - mm : '%d minuten', - h : 'ien oere', - hh : '%d oeren', - d : 'ien dei', - dd : '%d dagen', - M : 'ien moanne', - MM : '%d moannen', - y : 'ien jier', - yy : '%d jierren' - }, - dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/, - ordinal : function (number) { - return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return fy; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ga.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ga.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - - var months = [ - 'Eanáir', 'Feabhra', 'Márta', 'Aibreán', 'Bealtaine', 'Méitheamh', 'Iúil', 'Lúnasa', 'Meán Fómhair', 'Deaireadh Fómhair', 'Samhain', 'Nollaig' - ]; - - var monthsShort = ['Eaná', 'Feab', 'Márt', 'Aibr', 'Beal', 'Méit', 'Iúil', 'Lúna', 'Meán', 'Deai', 'Samh', 'Noll']; - - var weekdays = ['Dé Domhnaigh', 'Dé Luain', 'Dé Máirt', 'Dé Céadaoin', 'Déardaoin', 'Dé hAoine', 'Dé Satharn']; - - var weekdaysShort = ['Dom', 'Lua', 'Mái', 'Céa', 'Déa', 'hAo', 'Sat']; - - var weekdaysMin = ['Do', 'Lu', 'Má', 'Ce', 'Dé', 'hA', 'Sa']; - - var ga = moment.defineLocale('ga', { - months: months, - monthsShort: monthsShort, - monthsParseExact: true, - weekdays: weekdays, - weekdaysShort: weekdaysShort, - weekdaysMin: weekdaysMin, - longDateFormat: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'DD/MM/YYYY', - LL: 'D MMMM YYYY', - LLL: 'D MMMM YYYY HH:mm', - LLLL: 'dddd, D MMMM YYYY HH:mm' - }, - calendar: { - sameDay: '[Inniu ag] LT', - nextDay: '[Amárach ag] LT', - nextWeek: 'dddd [ag] LT', - lastDay: '[Inné aig] LT', - lastWeek: 'dddd [seo caite] [ag] LT', - sameElse: 'L' - }, - relativeTime: { - future: 'i %s', - past: '%s ó shin', - s: 'cúpla soicind', - ss: '%d soicind', - m: 'nóiméad', - mm: '%d nóiméad', - h: 'uair an chloig', - hh: '%d uair an chloig', - d: 'lá', - dd: '%d lá', - M: 'mí', - MM: '%d mí', - y: 'bliain', - yy: '%d bliain' - }, - dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/, - ordinal: function (number) { - var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh'; - return number + output; - }, - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return ga; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/gd.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/gd.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var months = [ - 'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd' - ]; - - var monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh']; - - var weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne']; - - var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis']; - - var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa']; - - var gd = moment.defineLocale('gd', { - months : months, - monthsShort : monthsShort, - monthsParseExact : true, - weekdays : weekdays, - weekdaysShort : weekdaysShort, - weekdaysMin : weekdaysMin, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[An-diugh aig] LT', - nextDay : '[A-màireach aig] LT', - nextWeek : 'dddd [aig] LT', - lastDay : '[An-dè aig] LT', - lastWeek : 'dddd [seo chaidh] [aig] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'ann an %s', - past : 'bho chionn %s', - s : 'beagan diogan', - ss : '%d diogan', - m : 'mionaid', - mm : '%d mionaidean', - h : 'uair', - hh : '%d uairean', - d : 'latha', - dd : '%d latha', - M : 'mìos', - MM : '%d mìosan', - y : 'bliadhna', - yy : '%d bliadhna' - }, - dayOfMonthOrdinalParse : /\d{1,2}(d|na|mh)/, - ordinal : function (number) { - var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return gd; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/gl.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/gl.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var gl = moment.defineLocale('gl', { - months : 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split('_'), - monthsShort : 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_'), - monthsParseExact: true, - weekdays : 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'), - weekdaysShort : 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'), - weekdaysMin : 'do_lu_ma_mé_xo_ve_sá'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D [de] MMMM [de] YYYY', - LLL : 'D [de] MMMM [de] YYYY H:mm', - LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm' - }, - calendar : { - sameDay : function () { - return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT'; - }, - nextDay : function () { - return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT'; - }, - nextWeek : function () { - return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT'; - }, - lastDay : function () { - return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT'; - }, - lastWeek : function () { - return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : function (str) { - if (str.indexOf('un') === 0) { - return 'n' + str; - } - return 'en ' + str; - }, - past : 'hai %s', - s : 'uns segundos', - ss : '%d segundos', - m : 'un minuto', - mm : '%d minutos', - h : 'unha hora', - hh : '%d horas', - d : 'un día', - dd : '%d días', - M : 'un mes', - MM : '%d meses', - y : 'un ano', - yy : '%d anos' - }, - dayOfMonthOrdinalParse : /\d{1,2}º/, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return gl; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/gom-latn.js": -/*!************************************************!*\ - !*** ./node_modules/moment/locale/gom-latn.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 's': ['thodde secondanim', 'thodde second'], - 'ss': [number + ' secondanim', number + ' second'], - 'm': ['eka mintan', 'ek minute'], - 'mm': [number + ' mintanim', number + ' mintam'], - 'h': ['eka voran', 'ek vor'], - 'hh': [number + ' voranim', number + ' voram'], - 'd': ['eka disan', 'ek dis'], - 'dd': [number + ' disanim', number + ' dis'], - 'M': ['eka mhoinean', 'ek mhoino'], - 'MM': [number + ' mhoineanim', number + ' mhoine'], - 'y': ['eka vorsan', 'ek voros'], - 'yy': [number + ' vorsanim', number + ' vorsam'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - - var gomLatn = moment.defineLocale('gom-latn', { - months : 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split('_'), - monthsShort : 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split('_'), - monthsParseExact : true, - weekdays : 'Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son\'var'.split('_'), - weekdaysShort : 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'), - weekdaysMin : 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'A h:mm [vazta]', - LTS : 'A h:mm:ss [vazta]', - L : 'DD-MM-YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY A h:mm [vazta]', - LLLL : 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]', - llll: 'ddd, D MMM YYYY, A h:mm [vazta]' - }, - calendar : { - sameDay: '[Aiz] LT', - nextDay: '[Faleam] LT', - nextWeek: '[Ieta to] dddd[,] LT', - lastDay: '[Kal] LT', - lastWeek: '[Fatlo] dddd[,] LT', - sameElse: 'L' - }, - relativeTime : { - future : '%s', - past : '%s adim', - s : processRelativeTime, - ss : processRelativeTime, - m : processRelativeTime, - mm : processRelativeTime, - h : processRelativeTime, - hh : processRelativeTime, - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - dayOfMonthOrdinalParse : /\d{1,2}(er)/, - ordinal : function (number, period) { - switch (period) { - // the ordinal 'er' only applies to day of the month - case 'D': - return number + 'er'; - default: - case 'M': - case 'Q': - case 'DDD': - case 'd': - case 'w': - case 'W': - return number; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - }, - meridiemParse: /rati|sokalli|donparam|sanje/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'rati') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'sokalli') { - return hour; - } else if (meridiem === 'donparam') { - return hour > 12 ? hour : hour + 12; - } else if (meridiem === 'sanje') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'rati'; - } else if (hour < 12) { - return 'sokalli'; - } else if (hour < 16) { - return 'donparam'; - } else if (hour < 20) { - return 'sanje'; - } else { - return 'rati'; - } - } - }); - - return gomLatn; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/gu.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/gu.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '૧', - '2': '૨', - '3': '૩', - '4': '૪', - '5': '૫', - '6': '૬', - '7': '૭', - '8': '૮', - '9': '૯', - '0': '૦' - }, - numberMap = { - '૧': '1', - '૨': '2', - '૩': '3', - '૪': '4', - '૫': '5', - '૬': '6', - '૭': '7', - '૮': '8', - '૯': '9', - '૦': '0' - }; - - var gu = moment.defineLocale('gu', { - months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split('_'), - monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split('_'), - monthsParseExact: true, - weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split('_'), - weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'), - weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'), - longDateFormat: { - LT: 'A h:mm વાગ્યે', - LTS: 'A h:mm:ss વાગ્યે', - L: 'DD/MM/YYYY', - LL: 'D MMMM YYYY', - LLL: 'D MMMM YYYY, A h:mm વાગ્યે', - LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે' - }, - calendar: { - sameDay: '[આજ] LT', - nextDay: '[કાલે] LT', - nextWeek: 'dddd, LT', - lastDay: '[ગઇકાલે] LT', - lastWeek: '[પાછલા] dddd, LT', - sameElse: 'L' - }, - relativeTime: { - future: '%s મા', - past: '%s પેહલા', - s: 'અમુક પળો', - ss: '%d સેકંડ', - m: 'એક મિનિટ', - mm: '%d મિનિટ', - h: 'એક કલાક', - hh: '%d કલાક', - d: 'એક દિવસ', - dd: '%d દિવસ', - M: 'એક મહિનો', - MM: '%d મહિનો', - y: 'એક વર્ષ', - yy: '%d વર્ષ' - }, - preparse: function (string) { - return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - // Gujarati notation for meridiems are quite fuzzy in practice. While there exists - // a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati. - meridiemParse: /રાત|બપોર|સવાર|સાંજ/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'રાત') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'સવાર') { - return hour; - } else if (meridiem === 'બપોર') { - return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'સાંજ') { - return hour + 12; - } - }, - meridiem: function (hour, minute, isLower) { - if (hour < 4) { - return 'રાત'; - } else if (hour < 10) { - return 'સવાર'; - } else if (hour < 17) { - return 'બપોર'; - } else if (hour < 20) { - return 'સાંજ'; - } else { - return 'રાત'; - } - }, - week: { - dow: 0, // Sunday is the first day of the week. - doy: 6 // The week that contains Jan 6th is the first week of the year. - } - }); - - return gu; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/he.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/he.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var he = moment.defineLocale('he', { - months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'), - monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'), - weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'), - weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'), - weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D [ב]MMMM YYYY', - LLL : 'D [ב]MMMM YYYY HH:mm', - LLLL : 'dddd, D [ב]MMMM YYYY HH:mm', - l : 'D/M/YYYY', - ll : 'D MMM YYYY', - lll : 'D MMM YYYY HH:mm', - llll : 'ddd, D MMM YYYY HH:mm' - }, - calendar : { - sameDay : '[היום ב־]LT', - nextDay : '[מחר ב־]LT', - nextWeek : 'dddd [בשעה] LT', - lastDay : '[אתמול ב־]LT', - lastWeek : '[ביום] dddd [האחרון בשעה] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'בעוד %s', - past : 'לפני %s', - s : 'מספר שניות', - ss : '%d שניות', - m : 'דקה', - mm : '%d דקות', - h : 'שעה', - hh : function (number) { - if (number === 2) { - return 'שעתיים'; - } - return number + ' שעות'; - }, - d : 'יום', - dd : function (number) { - if (number === 2) { - return 'יומיים'; - } - return number + ' ימים'; - }, - M : 'חודש', - MM : function (number) { - if (number === 2) { - return 'חודשיים'; - } - return number + ' חודשים'; - }, - y : 'שנה', - yy : function (number) { - if (number === 2) { - return 'שנתיים'; - } else if (number % 10 === 0 && number !== 10) { - return number + ' שנה'; - } - return number + ' שנים'; - } - }, - meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i, - isPM : function (input) { - return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 5) { - return 'לפנות בוקר'; - } else if (hour < 10) { - return 'בבוקר'; - } else if (hour < 12) { - return isLower ? 'לפנה"צ' : 'לפני הצהריים'; - } else if (hour < 18) { - return isLower ? 'אחה"צ' : 'אחרי הצהריים'; - } else { - return 'בערב'; - } - } - }); - - return he; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/hi.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/hi.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - var hi = moment.defineLocale('hi', { - months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'), - monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'), - monthsParseExact: true, - weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), - weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'), - weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'), - longDateFormat : { - LT : 'A h:mm बजे', - LTS : 'A h:mm:ss बजे', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm बजे', - LLLL : 'dddd, D MMMM YYYY, A h:mm बजे' - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[कल] LT', - nextWeek : 'dddd, LT', - lastDay : '[कल] LT', - lastWeek : '[पिछले] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s में', - past : '%s पहले', - s : 'कुछ ही क्षण', - ss : '%d सेकंड', - m : 'एक मिनट', - mm : '%d मिनट', - h : 'एक घंटा', - hh : '%d घंटे', - d : 'एक दिन', - dd : '%d दिन', - M : 'एक महीने', - MM : '%d महीने', - y : 'एक वर्ष', - yy : '%d वर्ष' - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - // Hindi notation for meridiems are quite fuzzy in practice. While there exists - // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi. - meridiemParse: /रात|सुबह|दोपहर|शाम/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'रात') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'सुबह') { - return hour; - } else if (meridiem === 'दोपहर') { - return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'शाम') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'रात'; - } else if (hour < 10) { - return 'सुबह'; - } else if (hour < 17) { - return 'दोपहर'; - } else if (hour < 20) { - return 'शाम'; - } else { - return 'रात'; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 6th is the first week of the year. - } - }); - - return hi; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/hr.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/hr.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function translate(number, withoutSuffix, key) { - var result = number + ' '; - switch (key) { - case 'ss': - if (number === 1) { - result += 'sekunda'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sekunde'; - } else { - result += 'sekundi'; - } - return result; - case 'm': - return withoutSuffix ? 'jedna minuta' : 'jedne minute'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minuta'; - } - return result; - case 'h': - return withoutSuffix ? 'jedan sat' : 'jednog sata'; - case 'hh': - if (number === 1) { - result += 'sat'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sata'; - } else { - result += 'sati'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dana'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mjesec'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'mjeseca'; - } else { - result += 'mjeseci'; - } - return result; - case 'yy': - if (number === 1) { - result += 'godina'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'godine'; - } else { - result += 'godina'; - } - return result; - } - } - - var hr = moment.defineLocale('hr', { - months : { - format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'), - standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_') - }, - monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'), - monthsParseExact: true, - weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), - weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), - weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd, D. MMMM YYYY H:mm' - }, - calendar : { - sameDay : '[danas u] LT', - nextDay : '[sutra u] LT', - nextWeek : function () { - switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[jučer u] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : 'za %s', - past : 'prije %s', - s : 'par sekundi', - ss : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : 'dan', - dd : translate, - M : 'mjesec', - MM : translate, - y : 'godinu', - yy : translate - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return hr; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/hu.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/hu.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' '); - function translate(number, withoutSuffix, key, isFuture) { - var num = number; - switch (key) { - case 's': - return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce'; - case 'ss': - return num + (isFuture || withoutSuffix) ? ' másodperc' : ' másodperce'; - case 'm': - return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce'); - case 'mm': - return num + (isFuture || withoutSuffix ? ' perc' : ' perce'); - case 'h': - return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája'); - case 'hh': - return num + (isFuture || withoutSuffix ? ' óra' : ' órája'); - case 'd': - return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja'); - case 'dd': - return num + (isFuture || withoutSuffix ? ' nap' : ' napja'); - case 'M': - return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); - case 'MM': - return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); - case 'y': - return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve'); - case 'yy': - return num + (isFuture || withoutSuffix ? ' év' : ' éve'); - } - return ''; - } - function week(isFuture) { - return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]'; - } - - var hu = moment.defineLocale('hu', { - months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'), - monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'), - weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'), - weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'), - weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'), - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'YYYY.MM.DD.', - LL : 'YYYY. MMMM D.', - LLL : 'YYYY. MMMM D. H:mm', - LLLL : 'YYYY. MMMM D., dddd H:mm' - }, - meridiemParse: /de|du/i, - isPM: function (input) { - return input.charAt(1).toLowerCase() === 'u'; - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 12) { - return isLower === true ? 'de' : 'DE'; - } else { - return isLower === true ? 'du' : 'DU'; - } - }, - calendar : { - sameDay : '[ma] LT[-kor]', - nextDay : '[holnap] LT[-kor]', - nextWeek : function () { - return week.call(this, true); - }, - lastDay : '[tegnap] LT[-kor]', - lastWeek : function () { - return week.call(this, false); - }, - sameElse : 'L' - }, - relativeTime : { - future : '%s múlva', - past : '%s', - s : translate, - ss : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return hu; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/hy-am.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/hy-am.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var hyAm = moment.defineLocale('hy-am', { - months : { - format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'), - standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_') - }, - monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), - weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'), - weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), - weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY թ.', - LLL : 'D MMMM YYYY թ., HH:mm', - LLLL : 'dddd, D MMMM YYYY թ., HH:mm' - }, - calendar : { - sameDay: '[այսօր] LT', - nextDay: '[վաղը] LT', - lastDay: '[երեկ] LT', - nextWeek: function () { - return 'dddd [օրը ժամը] LT'; - }, - lastWeek: function () { - return '[անցած] dddd [օրը ժամը] LT'; - }, - sameElse: 'L' - }, - relativeTime : { - future : '%s հետո', - past : '%s առաջ', - s : 'մի քանի վայրկյան', - ss : '%d վայրկյան', - m : 'րոպե', - mm : '%d րոպե', - h : 'ժամ', - hh : '%d ժամ', - d : 'օր', - dd : '%d օր', - M : 'ամիս', - MM : '%d ամիս', - y : 'տարի', - yy : '%d տարի' - }, - meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/, - isPM: function (input) { - return /^(ցերեկվա|երեկոյան)$/.test(input); - }, - meridiem : function (hour) { - if (hour < 4) { - return 'գիշերվա'; - } else if (hour < 12) { - return 'առավոտվա'; - } else if (hour < 17) { - return 'ցերեկվա'; - } else { - return 'երեկոյան'; - } - }, - dayOfMonthOrdinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/, - ordinal: function (number, period) { - switch (period) { - case 'DDD': - case 'w': - case 'W': - case 'DDDo': - if (number === 1) { - return number + '-ին'; - } - return number + '-րդ'; - default: - return number; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return hyAm; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/id.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/id.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var id = moment.defineLocale('id', { - months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'), - weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'), - weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'), - weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'), - longDateFormat : { - LT : 'HH.mm', - LTS : 'HH.mm.ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY [pukul] HH.mm', - LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm' - }, - meridiemParse: /pagi|siang|sore|malam/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'pagi') { - return hour; - } else if (meridiem === 'siang') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === 'sore' || meridiem === 'malam') { - return hour + 12; - } - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'pagi'; - } else if (hours < 15) { - return 'siang'; - } else if (hours < 19) { - return 'sore'; - } else { - return 'malam'; - } - }, - calendar : { - sameDay : '[Hari ini pukul] LT', - nextDay : '[Besok pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kemarin pukul] LT', - lastWeek : 'dddd [lalu pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'dalam %s', - past : '%s yang lalu', - s : 'beberapa detik', - ss : '%d detik', - m : 'semenit', - mm : '%d menit', - h : 'sejam', - hh : '%d jam', - d : 'sehari', - dd : '%d hari', - M : 'sebulan', - MM : '%d bulan', - y : 'setahun', - yy : '%d tahun' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return id; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/is.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/is.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function plural(n) { - if (n % 100 === 11) { - return true; - } else if (n % 10 === 1) { - return false; - } - return true; - } - function translate(number, withoutSuffix, key, isFuture) { - var result = number + ' '; - switch (key) { - case 's': - return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum'; - case 'ss': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum'); - } - return result + 'sekúnda'; - case 'm': - return withoutSuffix ? 'mínúta' : 'mínútu'; - case 'mm': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum'); - } else if (withoutSuffix) { - return result + 'mínúta'; - } - return result + 'mínútu'; - case 'hh': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum'); - } - return result + 'klukkustund'; - case 'd': - if (withoutSuffix) { - return 'dagur'; - } - return isFuture ? 'dag' : 'degi'; - case 'dd': - if (plural(number)) { - if (withoutSuffix) { - return result + 'dagar'; - } - return result + (isFuture ? 'daga' : 'dögum'); - } else if (withoutSuffix) { - return result + 'dagur'; - } - return result + (isFuture ? 'dag' : 'degi'); - case 'M': - if (withoutSuffix) { - return 'mánuður'; - } - return isFuture ? 'mánuð' : 'mánuði'; - case 'MM': - if (plural(number)) { - if (withoutSuffix) { - return result + 'mánuðir'; - } - return result + (isFuture ? 'mánuði' : 'mánuðum'); - } else if (withoutSuffix) { - return result + 'mánuður'; - } - return result + (isFuture ? 'mánuð' : 'mánuði'); - case 'y': - return withoutSuffix || isFuture ? 'ár' : 'ári'; - case 'yy': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'ár' : 'árum'); - } - return result + (withoutSuffix || isFuture ? 'ár' : 'ári'); - } - } - - var is = moment.defineLocale('is', { - months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'), - monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'), - weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'), - weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'), - weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'), - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY [kl.] H:mm', - LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm' - }, - calendar : { - sameDay : '[í dag kl.] LT', - nextDay : '[á morgun kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[í gær kl.] LT', - lastWeek : '[síðasta] dddd [kl.] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'eftir %s', - past : 'fyrir %s síðan', - s : translate, - ss : translate, - m : translate, - mm : translate, - h : 'klukkustund', - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return is; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/it-ch.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/it-ch.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var itCh = moment.defineLocale('it-ch', { - months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'), - monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), - weekdays : 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'), - weekdaysShort : 'dom_lun_mar_mer_gio_ven_sab'.split('_'), - weekdaysMin : 'do_lu_ma_me_gi_ve_sa'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Oggi alle] LT', - nextDay: '[Domani alle] LT', - nextWeek: 'dddd [alle] LT', - lastDay: '[Ieri alle] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[la scorsa] dddd [alle] LT'; - default: - return '[lo scorso] dddd [alle] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : function (s) { - return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s; - }, - past : '%s fa', - s : 'alcuni secondi', - ss : '%d secondi', - m : 'un minuto', - mm : '%d minuti', - h : 'un\'ora', - hh : '%d ore', - d : 'un giorno', - dd : '%d giorni', - M : 'un mese', - MM : '%d mesi', - y : 'un anno', - yy : '%d anni' - }, - dayOfMonthOrdinalParse : /\d{1,2}º/, - ordinal: '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return itCh; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/it.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/it.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var it = moment.defineLocale('it', { - months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'), - monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), - weekdays : 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'), - weekdaysShort : 'dom_lun_mar_mer_gio_ven_sab'.split('_'), - weekdaysMin : 'do_lu_ma_me_gi_ve_sa'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Oggi alle] LT', - nextDay: '[Domani alle] LT', - nextWeek: 'dddd [alle] LT', - lastDay: '[Ieri alle] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[la scorsa] dddd [alle] LT'; - default: - return '[lo scorso] dddd [alle] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : function (s) { - return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s; - }, - past : '%s fa', - s : 'alcuni secondi', - ss : '%d secondi', - m : 'un minuto', - mm : '%d minuti', - h : 'un\'ora', - hh : '%d ore', - d : 'un giorno', - dd : '%d giorni', - M : 'un mese', - MM : '%d mesi', - y : 'un anno', - yy : '%d anni' - }, - dayOfMonthOrdinalParse : /\d{1,2}º/, - ordinal: '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return it; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ja.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ja.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var ja = moment.defineLocale('ja', { - months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), - monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), - weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'), - weekdaysShort : '日_月_火_水_木_金_土'.split('_'), - weekdaysMin : '日_月_火_水_木_金_土'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY/MM/DD', - LL : 'YYYY年M月D日', - LLL : 'YYYY年M月D日 HH:mm', - LLLL : 'YYYY年M月D日 dddd HH:mm', - l : 'YYYY/MM/DD', - ll : 'YYYY年M月D日', - lll : 'YYYY年M月D日 HH:mm', - llll : 'YYYY年M月D日(ddd) HH:mm' - }, - meridiemParse: /午前|午後/i, - isPM : function (input) { - return input === '午後'; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return '午前'; - } else { - return '午後'; - } - }, - calendar : { - sameDay : '[今日] LT', - nextDay : '[明日] LT', - nextWeek : function (now) { - if (now.week() < this.week()) { - return '[来週]dddd LT'; - } else { - return 'dddd LT'; - } - }, - lastDay : '[昨日] LT', - lastWeek : function (now) { - if (this.week() < now.week()) { - return '[先週]dddd LT'; - } else { - return 'dddd LT'; - } - }, - sameElse : 'L' - }, - dayOfMonthOrdinalParse : /\d{1,2}日/, - ordinal : function (number, period) { - switch (period) { - case 'd': - case 'D': - case 'DDD': - return number + '日'; - default: - return number; - } - }, - relativeTime : { - future : '%s後', - past : '%s前', - s : '数秒', - ss : '%d秒', - m : '1分', - mm : '%d分', - h : '1時間', - hh : '%d時間', - d : '1日', - dd : '%d日', - M : '1ヶ月', - MM : '%dヶ月', - y : '1年', - yy : '%d年' - } - }); - - return ja; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/jv.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/jv.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var jv = moment.defineLocale('jv', { - months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'), - weekdays : 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'), - weekdaysShort : 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'), - weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'), - longDateFormat : { - LT : 'HH.mm', - LTS : 'HH.mm.ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY [pukul] HH.mm', - LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm' - }, - meridiemParse: /enjing|siyang|sonten|ndalu/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'enjing') { - return hour; - } else if (meridiem === 'siyang') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === 'sonten' || meridiem === 'ndalu') { - return hour + 12; - } - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'enjing'; - } else if (hours < 15) { - return 'siyang'; - } else if (hours < 19) { - return 'sonten'; - } else { - return 'ndalu'; - } - }, - calendar : { - sameDay : '[Dinten puniko pukul] LT', - nextDay : '[Mbenjang pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kala wingi pukul] LT', - lastWeek : 'dddd [kepengker pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'wonten ing %s', - past : '%s ingkang kepengker', - s : 'sawetawis detik', - ss : '%d detik', - m : 'setunggal menit', - mm : '%d menit', - h : 'setunggal jam', - hh : '%d jam', - d : 'sedinten', - dd : '%d dinten', - M : 'sewulan', - MM : '%d wulan', - y : 'setaun', - yy : '%d taun' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return jv; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ka.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ka.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var ka = moment.defineLocale('ka', { - months : { - standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), - format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') - }, - monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'), - weekdays : { - standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), - format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'), - isFormat: /(წინა|შემდეგ)/ - }, - weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'), - weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'), - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY h:mm A', - LLLL : 'dddd, D MMMM YYYY h:mm A' - }, - calendar : { - sameDay : '[დღეს] LT[-ზე]', - nextDay : '[ხვალ] LT[-ზე]', - lastDay : '[გუშინ] LT[-ზე]', - nextWeek : '[შემდეგ] dddd LT[-ზე]', - lastWeek : '[წინა] dddd LT-ზე', - sameElse : 'L' - }, - relativeTime : { - future : function (s) { - return (/(წამი|წუთი|საათი|წელი)/).test(s) ? - s.replace(/ი$/, 'ში') : - s + 'ში'; - }, - past : function (s) { - if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) { - return s.replace(/(ი|ე)$/, 'ის წინ'); - } - if ((/წელი/).test(s)) { - return s.replace(/წელი$/, 'წლის წინ'); - } - }, - s : 'რამდენიმე წამი', - ss : '%d წამი', - m : 'წუთი', - mm : '%d წუთი', - h : 'საათი', - hh : '%d საათი', - d : 'დღე', - dd : '%d დღე', - M : 'თვე', - MM : '%d თვე', - y : 'წელი', - yy : '%d წელი' - }, - dayOfMonthOrdinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/, - ordinal : function (number) { - if (number === 0) { - return number; - } - if (number === 1) { - return number + '-ლი'; - } - if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) { - return 'მე-' + number; - } - return number + '-ე'; - }, - week : { - dow : 1, - doy : 7 - } - }); - - return ka; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/kk.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/kk.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var suffixes = { - 0: '-ші', - 1: '-ші', - 2: '-ші', - 3: '-ші', - 4: '-ші', - 5: '-ші', - 6: '-шы', - 7: '-ші', - 8: '-ші', - 9: '-шы', - 10: '-шы', - 20: '-шы', - 30: '-шы', - 40: '-шы', - 50: '-ші', - 60: '-шы', - 70: '-ші', - 80: '-ші', - 90: '-шы', - 100: '-ші' - }; - - var kk = moment.defineLocale('kk', { - months : 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split('_'), - monthsShort : 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'), - weekdays : 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split('_'), - weekdaysShort : 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'), - weekdaysMin : 'жк_дй_сй_ср_бй_жм_сн'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Бүгін сағат] LT', - nextDay : '[Ертең сағат] LT', - nextWeek : 'dddd [сағат] LT', - lastDay : '[Кеше сағат] LT', - lastWeek : '[Өткен аптаның] dddd [сағат] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s ішінде', - past : '%s бұрын', - s : 'бірнеше секунд', - ss : '%d секунд', - m : 'бір минут', - mm : '%d минут', - h : 'бір сағат', - hh : '%d сағат', - d : 'бір күн', - dd : '%d күн', - M : 'бір ай', - MM : '%d ай', - y : 'бір жыл', - yy : '%d жыл' - }, - dayOfMonthOrdinalParse: /\d{1,2}-(ші|шы)/, - ordinal : function (number) { - var a = number % 10, - b = number >= 100 ? 100 : null; - return number + (suffixes[number] || suffixes[a] || suffixes[b]); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return kk; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/km.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/km.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '១', - '2': '២', - '3': '៣', - '4': '៤', - '5': '៥', - '6': '៦', - '7': '៧', - '8': '៨', - '9': '៩', - '0': '០' - }, numberMap = { - '១': '1', - '២': '2', - '៣': '3', - '៤': '4', - '៥': '5', - '៦': '6', - '៧': '7', - '៨': '8', - '៩': '9', - '០': '0' - }; - - var km = moment.defineLocale('km', { - months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split( - '_' - ), - monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split( - '_' - ), - weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'), - weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'), - weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'), - weekdaysParseExact: true, - longDateFormat: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'DD/MM/YYYY', - LL: 'D MMMM YYYY', - LLL: 'D MMMM YYYY HH:mm', - LLLL: 'dddd, D MMMM YYYY HH:mm' - }, - meridiemParse: /ព្រឹក|ល្ងាច/, - isPM: function (input) { - return input === 'ល្ងាច'; - }, - meridiem: function (hour, minute, isLower) { - if (hour < 12) { - return 'ព្រឹក'; - } else { - return 'ល្ងាច'; - } - }, - calendar: { - sameDay: '[ថ្ងៃនេះ ម៉ោង] LT', - nextDay: '[ស្អែក ម៉ោង] LT', - nextWeek: 'dddd [ម៉ោង] LT', - lastDay: '[ម្សិលមិញ ម៉ោង] LT', - lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT', - sameElse: 'L' - }, - relativeTime: { - future: '%sទៀត', - past: '%sមុន', - s: 'ប៉ុន្មានវិនាទី', - ss: '%d វិនាទី', - m: 'មួយនាទី', - mm: '%d នាទី', - h: 'មួយម៉ោង', - hh: '%d ម៉ោង', - d: 'មួយថ្ងៃ', - dd: '%d ថ្ងៃ', - M: 'មួយខែ', - MM: '%d ខែ', - y: 'មួយឆ្នាំ', - yy: '%d ឆ្នាំ' - }, - dayOfMonthOrdinalParse : /ទី\d{1,2}/, - ordinal : 'ទី%d', - preparse: function (string) { - return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return km; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/kn.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/kn.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '೧', - '2': '೨', - '3': '೩', - '4': '೪', - '5': '೫', - '6': '೬', - '7': '೭', - '8': '೮', - '9': '೯', - '0': '೦' - }, - numberMap = { - '೧': '1', - '೨': '2', - '೩': '3', - '೪': '4', - '೫': '5', - '೬': '6', - '೭': '7', - '೮': '8', - '೯': '9', - '೦': '0' - }; - - var kn = moment.defineLocale('kn', { - months : 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split('_'), - monthsShort : 'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split('_'), - monthsParseExact: true, - weekdays : 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split('_'), - weekdaysShort : 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'), - weekdaysMin : 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'), - longDateFormat : { - LT : 'A h:mm', - LTS : 'A h:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm', - LLLL : 'dddd, D MMMM YYYY, A h:mm' - }, - calendar : { - sameDay : '[ಇಂದು] LT', - nextDay : '[ನಾಳೆ] LT', - nextWeek : 'dddd, LT', - lastDay : '[ನಿನ್ನೆ] LT', - lastWeek : '[ಕೊನೆಯ] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s ನಂತರ', - past : '%s ಹಿಂದೆ', - s : 'ಕೆಲವು ಕ್ಷಣಗಳು', - ss : '%d ಸೆಕೆಂಡುಗಳು', - m : 'ಒಂದು ನಿಮಿಷ', - mm : '%d ನಿಮಿಷ', - h : 'ಒಂದು ಗಂಟೆ', - hh : '%d ಗಂಟೆ', - d : 'ಒಂದು ದಿನ', - dd : '%d ದಿನ', - M : 'ಒಂದು ತಿಂಗಳು', - MM : '%d ತಿಂಗಳು', - y : 'ಒಂದು ವರ್ಷ', - yy : '%d ವರ್ಷ' - }, - preparse: function (string) { - return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'ರಾತ್ರಿ') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'ಬೆಳಿಗ್ಗೆ') { - return hour; - } else if (meridiem === 'ಮಧ್ಯಾಹ್ನ') { - return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'ಸಂಜೆ') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'ರಾತ್ರಿ'; - } else if (hour < 10) { - return 'ಬೆಳಿಗ್ಗೆ'; - } else if (hour < 17) { - return 'ಮಧ್ಯಾಹ್ನ'; - } else if (hour < 20) { - return 'ಸಂಜೆ'; - } else { - return 'ರಾತ್ರಿ'; - } - }, - dayOfMonthOrdinalParse: /\d{1,2}(ನೇ)/, - ordinal : function (number) { - return number + 'ನೇ'; - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 6th is the first week of the year. - } - }); - - return kn; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ko.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ko.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var ko = moment.defineLocale('ko', { - months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'), - monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'), - weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'), - weekdaysShort : '일_월_화_수_목_금_토'.split('_'), - weekdaysMin : '일_월_화_수_목_금_토'.split('_'), - longDateFormat : { - LT : 'A h:mm', - LTS : 'A h:mm:ss', - L : 'YYYY.MM.DD.', - LL : 'YYYY년 MMMM D일', - LLL : 'YYYY년 MMMM D일 A h:mm', - LLLL : 'YYYY년 MMMM D일 dddd A h:mm', - l : 'YYYY.MM.DD.', - ll : 'YYYY년 MMMM D일', - lll : 'YYYY년 MMMM D일 A h:mm', - llll : 'YYYY년 MMMM D일 dddd A h:mm' - }, - calendar : { - sameDay : '오늘 LT', - nextDay : '내일 LT', - nextWeek : 'dddd LT', - lastDay : '어제 LT', - lastWeek : '지난주 dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s 후', - past : '%s 전', - s : '몇 초', - ss : '%d초', - m : '1분', - mm : '%d분', - h : '한 시간', - hh : '%d시간', - d : '하루', - dd : '%d일', - M : '한 달', - MM : '%d달', - y : '일 년', - yy : '%d년' - }, - dayOfMonthOrdinalParse : /\d{1,2}(일|월|주)/, - ordinal : function (number, period) { - switch (period) { - case 'd': - case 'D': - case 'DDD': - return number + '일'; - case 'M': - return number + '월'; - case 'w': - case 'W': - return number + '주'; - default: - return number; - } - }, - meridiemParse : /오전|오후/, - isPM : function (token) { - return token === '오후'; - }, - meridiem : function (hour, minute, isUpper) { - return hour < 12 ? '오전' : '오후'; - } - }); - - return ko; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ku.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ku.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠' - }, numberMap = { - '١': '1', - '٢': '2', - '٣': '3', - '٤': '4', - '٥': '5', - '٦': '6', - '٧': '7', - '٨': '8', - '٩': '9', - '٠': '0' - }, - months = [ - 'کانونی دووەم', - 'شوبات', - 'ئازار', - 'نیسان', - 'ئایار', - 'حوزەیران', - 'تەمموز', - 'ئاب', - 'ئەیلوول', - 'تشرینی یەكەم', - 'تشرینی دووەم', - 'كانونی یەکەم' - ]; - - - var ku = moment.defineLocale('ku', { - months : months, - monthsShort : months, - weekdays : 'یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌'.split('_'), - weekdaysShort : 'یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌'.split('_'), - weekdaysMin : 'ی_د_س_چ_پ_ه_ش'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - meridiemParse: /ئێواره‌|به‌یانی/, - isPM: function (input) { - return /ئێواره‌/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'به‌یانی'; - } else { - return 'ئێواره‌'; - } - }, - calendar : { - sameDay : '[ئه‌مرۆ كاتژمێر] LT', - nextDay : '[به‌یانی كاتژمێر] LT', - nextWeek : 'dddd [كاتژمێر] LT', - lastDay : '[دوێنێ كاتژمێر] LT', - lastWeek : 'dddd [كاتژمێر] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'له‌ %s', - past : '%s', - s : 'چه‌ند چركه‌یه‌ك', - ss : 'چركه‌ %d', - m : 'یه‌ك خوله‌ك', - mm : '%d خوله‌ك', - h : 'یه‌ك كاتژمێر', - hh : '%d كاتژمێر', - d : 'یه‌ك ڕۆژ', - dd : '%d ڕۆژ', - M : 'یه‌ك مانگ', - MM : '%d مانگ', - y : 'یه‌ك ساڵ', - yy : '%d ساڵ' - }, - preparse: function (string) { - return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { - return numberMap[match]; - }).replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }).replace(/,/g, '،'); - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 12th is the first week of the year. - } - }); - - return ku; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ky.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ky.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var suffixes = { - 0: '-чү', - 1: '-чи', - 2: '-чи', - 3: '-чү', - 4: '-чү', - 5: '-чи', - 6: '-чы', - 7: '-чи', - 8: '-чи', - 9: '-чу', - 10: '-чу', - 20: '-чы', - 30: '-чу', - 40: '-чы', - 50: '-чү', - 60: '-чы', - 70: '-чи', - 80: '-чи', - 90: '-чу', - 100: '-чү' - }; - - var ky = moment.defineLocale('ky', { - months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), - monthsShort : 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), - weekdays : 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split('_'), - weekdaysShort : 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'), - weekdaysMin : 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Бүгүн саат] LT', - nextDay : '[Эртең саат] LT', - nextWeek : 'dddd [саат] LT', - lastDay : '[Кечээ саат] LT', - lastWeek : '[Өткөн аптанын] dddd [күнү] [саат] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s ичинде', - past : '%s мурун', - s : 'бирнече секунд', - ss : '%d секунд', - m : 'бир мүнөт', - mm : '%d мүнөт', - h : 'бир саат', - hh : '%d саат', - d : 'бир күн', - dd : '%d күн', - M : 'бир ай', - MM : '%d ай', - y : 'бир жыл', - yy : '%d жыл' - }, - dayOfMonthOrdinalParse: /\d{1,2}-(чи|чы|чү|чу)/, - ordinal : function (number) { - var a = number % 10, - b = number >= 100 ? 100 : null; - return number + (suffixes[number] || suffixes[a] || suffixes[b]); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return ky; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/lb.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/lb.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eng Minutt', 'enger Minutt'], - 'h': ['eng Stonn', 'enger Stonn'], - 'd': ['een Dag', 'engem Dag'], - 'M': ['ee Mount', 'engem Mount'], - 'y': ['ee Joer', 'engem Joer'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - function processFutureTime(string) { - var number = string.substr(0, string.indexOf(' ')); - if (eifelerRegelAppliesToNumber(number)) { - return 'a ' + string; - } - return 'an ' + string; - } - function processPastTime(string) { - var number = string.substr(0, string.indexOf(' ')); - if (eifelerRegelAppliesToNumber(number)) { - return 'viru ' + string; - } - return 'virun ' + string; - } - /** - * Returns true if the word before the given number loses the '-n' ending. - * e.g. 'an 10 Deeg' but 'a 5 Deeg' - * - * @param number {integer} - * @returns {boolean} - */ - function eifelerRegelAppliesToNumber(number) { - number = parseInt(number, 10); - if (isNaN(number)) { - return false; - } - if (number < 0) { - // Negative Number --> always true - return true; - } else if (number < 10) { - // Only 1 digit - if (4 <= number && number <= 7) { - return true; - } - return false; - } else if (number < 100) { - // 2 digits - var lastDigit = number % 10, firstDigit = number / 10; - if (lastDigit === 0) { - return eifelerRegelAppliesToNumber(firstDigit); - } - return eifelerRegelAppliesToNumber(lastDigit); - } else if (number < 10000) { - // 3 or 4 digits --> recursively check first digit - while (number >= 10) { - number = number / 10; - } - return eifelerRegelAppliesToNumber(number); - } else { - // Anything larger than 4 digits: recursively check first n-3 digits - number = number / 1000; - return eifelerRegelAppliesToNumber(number); - } - } - - var lb = moment.defineLocale('lb', { - months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), - monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'), - monthsParseExact : true, - weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'), - weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'), - weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'), - weekdaysParseExact : true, - longDateFormat: { - LT: 'H:mm [Auer]', - LTS: 'H:mm:ss [Auer]', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm [Auer]', - LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]' - }, - calendar: { - sameDay: '[Haut um] LT', - sameElse: 'L', - nextDay: '[Muer um] LT', - nextWeek: 'dddd [um] LT', - lastDay: '[Gëschter um] LT', - lastWeek: function () { - // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule - switch (this.day()) { - case 2: - case 4: - return '[Leschten] dddd [um] LT'; - default: - return '[Leschte] dddd [um] LT'; - } - } - }, - relativeTime : { - future : processFutureTime, - past : processPastTime, - s : 'e puer Sekonnen', - ss : '%d Sekonnen', - m : processRelativeTime, - mm : '%d Minutten', - h : processRelativeTime, - hh : '%d Stonnen', - d : processRelativeTime, - dd : '%d Deeg', - M : processRelativeTime, - MM : '%d Méint', - y : processRelativeTime, - yy : '%d Joer' - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal: '%d.', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return lb; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/lo.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/lo.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var lo = moment.defineLocale('lo', { - months : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), - monthsShort : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), - weekdays : 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), - weekdaysShort : 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), - weekdaysMin : 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'ວັນdddd D MMMM YYYY HH:mm' - }, - meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/, - isPM: function (input) { - return input === 'ຕອນແລງ'; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'ຕອນເຊົ້າ'; - } else { - return 'ຕອນແລງ'; - } - }, - calendar : { - sameDay : '[ມື້ນີ້ເວລາ] LT', - nextDay : '[ມື້ອື່ນເວລາ] LT', - nextWeek : '[ວັນ]dddd[ໜ້າເວລາ] LT', - lastDay : '[ມື້ວານນີ້ເວລາ] LT', - lastWeek : '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'ອີກ %s', - past : '%sຜ່ານມາ', - s : 'ບໍ່ເທົ່າໃດວິນາທີ', - ss : '%d ວິນາທີ' , - m : '1 ນາທີ', - mm : '%d ນາທີ', - h : '1 ຊົ່ວໂມງ', - hh : '%d ຊົ່ວໂມງ', - d : '1 ມື້', - dd : '%d ມື້', - M : '1 ເດືອນ', - MM : '%d ເດືອນ', - y : '1 ປີ', - yy : '%d ປີ' - }, - dayOfMonthOrdinalParse: /(ທີ່)\d{1,2}/, - ordinal : function (number) { - return 'ທີ່' + number; - } - }); - - return lo; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/lt.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/lt.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var units = { - 'ss' : 'sekundė_sekundžių_sekundes', - 'm' : 'minutė_minutės_minutę', - 'mm': 'minutės_minučių_minutes', - 'h' : 'valanda_valandos_valandą', - 'hh': 'valandos_valandų_valandas', - 'd' : 'diena_dienos_dieną', - 'dd': 'dienos_dienų_dienas', - 'M' : 'mėnuo_mėnesio_mėnesį', - 'MM': 'mėnesiai_mėnesių_mėnesius', - 'y' : 'metai_metų_metus', - 'yy': 'metai_metų_metus' - }; - function translateSeconds(number, withoutSuffix, key, isFuture) { - if (withoutSuffix) { - return 'kelios sekundės'; - } else { - return isFuture ? 'kelių sekundžių' : 'kelias sekundes'; - } - } - function translateSingular(number, withoutSuffix, key, isFuture) { - return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]); - } - function special(number) { - return number % 10 === 0 || (number > 10 && number < 20); - } - function forms(key) { - return units[key].split('_'); - } - function translate(number, withoutSuffix, key, isFuture) { - var result = number + ' '; - if (number === 1) { - return result + translateSingular(number, withoutSuffix, key[0], isFuture); - } else if (withoutSuffix) { - return result + (special(number) ? forms(key)[1] : forms(key)[0]); - } else { - if (isFuture) { - return result + forms(key)[1]; - } else { - return result + (special(number) ? forms(key)[1] : forms(key)[2]); - } - } - } - var lt = moment.defineLocale('lt', { - months : { - format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'), - standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'), - isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/ - }, - monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'), - weekdays : { - format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'), - standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'), - isFormat: /dddd HH:mm/ - }, - weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'), - weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY-MM-DD', - LL : 'YYYY [m.] MMMM D [d.]', - LLL : 'YYYY [m.] MMMM D [d.], HH:mm [val.]', - LLLL : 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]', - l : 'YYYY-MM-DD', - ll : 'YYYY [m.] MMMM D [d.]', - lll : 'YYYY [m.] MMMM D [d.], HH:mm [val.]', - llll : 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]' - }, - calendar : { - sameDay : '[Šiandien] LT', - nextDay : '[Rytoj] LT', - nextWeek : 'dddd LT', - lastDay : '[Vakar] LT', - lastWeek : '[Praėjusį] dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : 'po %s', - past : 'prieš %s', - s : translateSeconds, - ss : translate, - m : translateSingular, - mm : translate, - h : translateSingular, - hh : translate, - d : translateSingular, - dd : translate, - M : translateSingular, - MM : translate, - y : translateSingular, - yy : translate - }, - dayOfMonthOrdinalParse: /\d{1,2}-oji/, - ordinal : function (number) { - return number + '-oji'; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return lt; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/lv.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/lv.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var units = { - 'ss': 'sekundes_sekundēm_sekunde_sekundes'.split('_'), - 'm': 'minūtes_minūtēm_minūte_minūtes'.split('_'), - 'mm': 'minūtes_minūtēm_minūte_minūtes'.split('_'), - 'h': 'stundas_stundām_stunda_stundas'.split('_'), - 'hh': 'stundas_stundām_stunda_stundas'.split('_'), - 'd': 'dienas_dienām_diena_dienas'.split('_'), - 'dd': 'dienas_dienām_diena_dienas'.split('_'), - 'M': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'), - 'MM': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'), - 'y': 'gada_gadiem_gads_gadi'.split('_'), - 'yy': 'gada_gadiem_gads_gadi'.split('_') - }; - /** - * @param withoutSuffix boolean true = a length of time; false = before/after a period of time. - */ - function format(forms, number, withoutSuffix) { - if (withoutSuffix) { - // E.g. "21 minūte", "3 minūtes". - return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3]; - } else { - // E.g. "21 minūtes" as in "pēc 21 minūtes". - // E.g. "3 minūtēm" as in "pēc 3 minūtēm". - return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1]; - } - } - function relativeTimeWithPlural(number, withoutSuffix, key) { - return number + ' ' + format(units[key], number, withoutSuffix); - } - function relativeTimeWithSingular(number, withoutSuffix, key) { - return format(units[key], number, withoutSuffix); - } - function relativeSeconds(number, withoutSuffix) { - return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm'; - } - - var lv = moment.defineLocale('lv', { - months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'), - monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'), - weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'), - weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'), - weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY.', - LL : 'YYYY. [gada] D. MMMM', - LLL : 'YYYY. [gada] D. MMMM, HH:mm', - LLLL : 'YYYY. [gada] D. MMMM, dddd, HH:mm' - }, - calendar : { - sameDay : '[Šodien pulksten] LT', - nextDay : '[Rīt pulksten] LT', - nextWeek : 'dddd [pulksten] LT', - lastDay : '[Vakar pulksten] LT', - lastWeek : '[Pagājušā] dddd [pulksten] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'pēc %s', - past : 'pirms %s', - s : relativeSeconds, - ss : relativeTimeWithPlural, - m : relativeTimeWithSingular, - mm : relativeTimeWithPlural, - h : relativeTimeWithSingular, - hh : relativeTimeWithPlural, - d : relativeTimeWithSingular, - dd : relativeTimeWithPlural, - M : relativeTimeWithSingular, - MM : relativeTimeWithPlural, - y : relativeTimeWithSingular, - yy : relativeTimeWithPlural - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return lv; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/me.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/me.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var translator = { - words: { //Different grammatical cases - ss: ['sekund', 'sekunda', 'sekundi'], - m: ['jedan minut', 'jednog minuta'], - mm: ['minut', 'minuta', 'minuta'], - h: ['jedan sat', 'jednog sata'], - hh: ['sat', 'sata', 'sati'], - dd: ['dan', 'dana', 'dana'], - MM: ['mjesec', 'mjeseca', 'mjeseci'], - yy: ['godina', 'godine', 'godina'] - }, - correctGrammaticalCase: function (number, wordKey) { - return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]); - }, - translate: function (number, withoutSuffix, key) { - var wordKey = translator.words[key]; - if (key.length === 1) { - return withoutSuffix ? wordKey[0] : wordKey[1]; - } else { - return number + ' ' + translator.correctGrammaticalCase(number, wordKey); - } - } - }; - - var me = moment.defineLocale('me', { - months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'), - monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'), - monthsParseExact : true, - weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), - weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), - weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), - weekdaysParseExact : true, - longDateFormat: { - LT: 'H:mm', - LTS : 'H:mm:ss', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm' - }, - calendar: { - sameDay: '[danas u] LT', - nextDay: '[sjutra u] LT', - - nextWeek: function () { - switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[juče u] LT', - lastWeek : function () { - var lastWeekDays = [ - '[prošle] [nedjelje] [u] LT', - '[prošlog] [ponedjeljka] [u] LT', - '[prošlog] [utorka] [u] LT', - '[prošle] [srijede] [u] LT', - '[prošlog] [četvrtka] [u] LT', - '[prošlog] [petka] [u] LT', - '[prošle] [subote] [u] LT' - ]; - return lastWeekDays[this.day()]; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'za %s', - past : 'prije %s', - s : 'nekoliko sekundi', - ss : translator.translate, - m : translator.translate, - mm : translator.translate, - h : translator.translate, - hh : translator.translate, - d : 'dan', - dd : translator.translate, - M : 'mjesec', - MM : translator.translate, - y : 'godinu', - yy : translator.translate - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return me; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/mi.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/mi.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var mi = moment.defineLocale('mi', { - months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split('_'), - monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split('_'), - monthsRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i, - monthsStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i, - monthsShortRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i, - monthsShortStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i, - weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'), - weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'), - weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'), - longDateFormat: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'DD/MM/YYYY', - LL: 'D MMMM YYYY', - LLL: 'D MMMM YYYY [i] HH:mm', - LLLL: 'dddd, D MMMM YYYY [i] HH:mm' - }, - calendar: { - sameDay: '[i teie mahana, i] LT', - nextDay: '[apopo i] LT', - nextWeek: 'dddd [i] LT', - lastDay: '[inanahi i] LT', - lastWeek: 'dddd [whakamutunga i] LT', - sameElse: 'L' - }, - relativeTime: { - future: 'i roto i %s', - past: '%s i mua', - s: 'te hēkona ruarua', - ss: '%d hēkona', - m: 'he meneti', - mm: '%d meneti', - h: 'te haora', - hh: '%d haora', - d: 'he ra', - dd: '%d ra', - M: 'he marama', - MM: '%d marama', - y: 'he tau', - yy: '%d tau' - }, - dayOfMonthOrdinalParse: /\d{1,2}º/, - ordinal: '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return mi; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/mk.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/mk.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var mk = moment.defineLocale('mk', { - months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'), - monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'), - weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'), - weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'), - weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'), - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'D.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY H:mm', - LLLL : 'dddd, D MMMM YYYY H:mm' - }, - calendar : { - sameDay : '[Денес во] LT', - nextDay : '[Утре во] LT', - nextWeek : '[Во] dddd [во] LT', - lastDay : '[Вчера во] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[Изминатата] dddd [во] LT'; - case 1: - case 2: - case 4: - case 5: - return '[Изминатиот] dddd [во] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : 'после %s', - past : 'пред %s', - s : 'неколку секунди', - ss : '%d секунди', - m : 'минута', - mm : '%d минути', - h : 'час', - hh : '%d часа', - d : 'ден', - dd : '%d дена', - M : 'месец', - MM : '%d месеци', - y : 'година', - yy : '%d години' - }, - dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/, - ordinal : function (number) { - var lastDigit = number % 10, - last2Digits = number % 100; - if (number === 0) { - return number + '-ев'; - } else if (last2Digits === 0) { - return number + '-ен'; - } else if (last2Digits > 10 && last2Digits < 20) { - return number + '-ти'; - } else if (lastDigit === 1) { - return number + '-ви'; - } else if (lastDigit === 2) { - return number + '-ри'; - } else if (lastDigit === 7 || lastDigit === 8) { - return number + '-ми'; - } else { - return number + '-ти'; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return mk; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ml.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ml.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var ml = moment.defineLocale('ml', { - months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'), - monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'), - monthsParseExact : true, - weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'), - weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'), - weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'), - longDateFormat : { - LT : 'A h:mm -നു', - LTS : 'A h:mm:ss -നു', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm -നു', - LLLL : 'dddd, D MMMM YYYY, A h:mm -നു' - }, - calendar : { - sameDay : '[ഇന്ന്] LT', - nextDay : '[നാളെ] LT', - nextWeek : 'dddd, LT', - lastDay : '[ഇന്നലെ] LT', - lastWeek : '[കഴിഞ്ഞ] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s കഴിഞ്ഞ്', - past : '%s മുൻപ്', - s : 'അൽപ നിമിഷങ്ങൾ', - ss : '%d സെക്കൻഡ്', - m : 'ഒരു മിനിറ്റ്', - mm : '%d മിനിറ്റ്', - h : 'ഒരു മണിക്കൂർ', - hh : '%d മണിക്കൂർ', - d : 'ഒരു ദിവസം', - dd : '%d ദിവസം', - M : 'ഒരു മാസം', - MM : '%d മാസം', - y : 'ഒരു വർഷം', - yy : '%d വർഷം' - }, - meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if ((meridiem === 'രാത്രി' && hour >= 4) || - meridiem === 'ഉച്ച കഴിഞ്ഞ്' || - meridiem === 'വൈകുന്നേരം') { - return hour + 12; - } else { - return hour; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'രാത്രി'; - } else if (hour < 12) { - return 'രാവിലെ'; - } else if (hour < 17) { - return 'ഉച്ച കഴിഞ്ഞ്'; - } else if (hour < 20) { - return 'വൈകുന്നേരം'; - } else { - return 'രാത്രി'; - } - } - }); - - return ml; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/mn.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/mn.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function translate(number, withoutSuffix, key, isFuture) { - switch (key) { - case 's': - return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын'; - case 'ss': - return number + (withoutSuffix ? ' секунд' : ' секундын'); - case 'm': - case 'mm': - return number + (withoutSuffix ? ' минут' : ' минутын'); - case 'h': - case 'hh': - return number + (withoutSuffix ? ' цаг' : ' цагийн'); - case 'd': - case 'dd': - return number + (withoutSuffix ? ' өдөр' : ' өдрийн'); - case 'M': - case 'MM': - return number + (withoutSuffix ? ' сар' : ' сарын'); - case 'y': - case 'yy': - return number + (withoutSuffix ? ' жил' : ' жилийн'); - default: - return number; - } - } - - var mn = moment.defineLocale('mn', { - months : 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split('_'), - monthsShort : '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split('_'), - monthsParseExact : true, - weekdays : 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'), - weekdaysShort : 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'), - weekdaysMin : 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY-MM-DD', - LL : 'YYYY оны MMMMын D', - LLL : 'YYYY оны MMMMын D HH:mm', - LLLL : 'dddd, YYYY оны MMMMын D HH:mm' - }, - meridiemParse: /ҮӨ|ҮХ/i, - isPM : function (input) { - return input === 'ҮХ'; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'ҮӨ'; - } else { - return 'ҮХ'; - } - }, - calendar : { - sameDay : '[Өнөөдөр] LT', - nextDay : '[Маргааш] LT', - nextWeek : '[Ирэх] dddd LT', - lastDay : '[Өчигдөр] LT', - lastWeek : '[Өнгөрсөн] dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s дараа', - past : '%s өмнө', - s : translate, - ss : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - dayOfMonthOrdinalParse: /\d{1,2} өдөр/, - ordinal : function (number, period) { - switch (period) { - case 'd': - case 'D': - case 'DDD': - return number + ' өдөр'; - default: - return number; - } - } - }); - - return mn; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/mr.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/mr.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - function relativeTimeMr(number, withoutSuffix, string, isFuture) - { - var output = ''; - if (withoutSuffix) { - switch (string) { - case 's': output = 'काही सेकंद'; break; - case 'ss': output = '%d सेकंद'; break; - case 'm': output = 'एक मिनिट'; break; - case 'mm': output = '%d मिनिटे'; break; - case 'h': output = 'एक तास'; break; - case 'hh': output = '%d तास'; break; - case 'd': output = 'एक दिवस'; break; - case 'dd': output = '%d दिवस'; break; - case 'M': output = 'एक महिना'; break; - case 'MM': output = '%d महिने'; break; - case 'y': output = 'एक वर्ष'; break; - case 'yy': output = '%d वर्षे'; break; - } - } - else { - switch (string) { - case 's': output = 'काही सेकंदां'; break; - case 'ss': output = '%d सेकंदां'; break; - case 'm': output = 'एका मिनिटा'; break; - case 'mm': output = '%d मिनिटां'; break; - case 'h': output = 'एका तासा'; break; - case 'hh': output = '%d तासां'; break; - case 'd': output = 'एका दिवसा'; break; - case 'dd': output = '%d दिवसां'; break; - case 'M': output = 'एका महिन्या'; break; - case 'MM': output = '%d महिन्यां'; break; - case 'y': output = 'एका वर्षा'; break; - case 'yy': output = '%d वर्षां'; break; - } - } - return output.replace(/%d/i, number); - } - - var mr = moment.defineLocale('mr', { - months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'), - monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'), - monthsParseExact : true, - weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), - weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'), - weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'), - longDateFormat : { - LT : 'A h:mm वाजता', - LTS : 'A h:mm:ss वाजता', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm वाजता', - LLLL : 'dddd, D MMMM YYYY, A h:mm वाजता' - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[उद्या] LT', - nextWeek : 'dddd, LT', - lastDay : '[काल] LT', - lastWeek: '[मागील] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future: '%sमध्ये', - past: '%sपूर्वी', - s: relativeTimeMr, - ss: relativeTimeMr, - m: relativeTimeMr, - mm: relativeTimeMr, - h: relativeTimeMr, - hh: relativeTimeMr, - d: relativeTimeMr, - dd: relativeTimeMr, - M: relativeTimeMr, - MM: relativeTimeMr, - y: relativeTimeMr, - yy: relativeTimeMr - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'रात्री') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'सकाळी') { - return hour; - } else if (meridiem === 'दुपारी') { - return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'सायंकाळी') { - return hour + 12; - } - }, - meridiem: function (hour, minute, isLower) { - if (hour < 4) { - return 'रात्री'; - } else if (hour < 10) { - return 'सकाळी'; - } else if (hour < 17) { - return 'दुपारी'; - } else if (hour < 20) { - return 'सायंकाळी'; - } else { - return 'रात्री'; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 6th is the first week of the year. - } - }); - - return mr; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ms-my.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/ms-my.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var msMy = moment.defineLocale('ms-my', { - months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'), - monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'), - weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'), - weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'), - weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'), - longDateFormat : { - LT : 'HH.mm', - LTS : 'HH.mm.ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY [pukul] HH.mm', - LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm' - }, - meridiemParse: /pagi|tengahari|petang|malam/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'pagi') { - return hour; - } else if (meridiem === 'tengahari') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === 'petang' || meridiem === 'malam') { - return hour + 12; - } - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'pagi'; - } else if (hours < 15) { - return 'tengahari'; - } else if (hours < 19) { - return 'petang'; - } else { - return 'malam'; - } - }, - calendar : { - sameDay : '[Hari ini pukul] LT', - nextDay : '[Esok pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kelmarin pukul] LT', - lastWeek : 'dddd [lepas pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'dalam %s', - past : '%s yang lepas', - s : 'beberapa saat', - ss : '%d saat', - m : 'seminit', - mm : '%d minit', - h : 'sejam', - hh : '%d jam', - d : 'sehari', - dd : '%d hari', - M : 'sebulan', - MM : '%d bulan', - y : 'setahun', - yy : '%d tahun' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return msMy; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ms.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ms.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var ms = moment.defineLocale('ms', { - months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'), - monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'), - weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'), - weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'), - weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'), - longDateFormat : { - LT : 'HH.mm', - LTS : 'HH.mm.ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY [pukul] HH.mm', - LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm' - }, - meridiemParse: /pagi|tengahari|petang|malam/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'pagi') { - return hour; - } else if (meridiem === 'tengahari') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === 'petang' || meridiem === 'malam') { - return hour + 12; - } - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'pagi'; - } else if (hours < 15) { - return 'tengahari'; - } else if (hours < 19) { - return 'petang'; - } else { - return 'malam'; - } - }, - calendar : { - sameDay : '[Hari ini pukul] LT', - nextDay : '[Esok pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kelmarin pukul] LT', - lastWeek : 'dddd [lepas pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'dalam %s', - past : '%s yang lepas', - s : 'beberapa saat', - ss : '%d saat', - m : 'seminit', - mm : '%d minit', - h : 'sejam', - hh : '%d jam', - d : 'sehari', - dd : '%d hari', - M : 'sebulan', - MM : '%d bulan', - y : 'setahun', - yy : '%d tahun' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return ms; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/mt.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/mt.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var mt = moment.defineLocale('mt', { - months : 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split('_'), - monthsShort : 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'), - weekdays : 'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split('_'), - weekdaysShort : 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'), - weekdaysMin : 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Illum fil-]LT', - nextDay : '[Għada fil-]LT', - nextWeek : 'dddd [fil-]LT', - lastDay : '[Il-bieraħ fil-]LT', - lastWeek : 'dddd [li għadda] [fil-]LT', - sameElse : 'L' - }, - relativeTime : { - future : 'f’ %s', - past : '%s ilu', - s : 'ftit sekondi', - ss : '%d sekondi', - m : 'minuta', - mm : '%d minuti', - h : 'siegħa', - hh : '%d siegħat', - d : 'ġurnata', - dd : '%d ġranet', - M : 'xahar', - MM : '%d xhur', - y : 'sena', - yy : '%d sni' - }, - dayOfMonthOrdinalParse : /\d{1,2}º/, - ordinal: '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return mt; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/my.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/my.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '၁', - '2': '၂', - '3': '၃', - '4': '၄', - '5': '၅', - '6': '၆', - '7': '၇', - '8': '၈', - '9': '၉', - '0': '၀' - }, numberMap = { - '၁': '1', - '၂': '2', - '၃': '3', - '၄': '4', - '၅': '5', - '၆': '6', - '၇': '7', - '၈': '8', - '၉': '9', - '၀': '0' - }; - - var my = moment.defineLocale('my', { - months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'), - monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'), - weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'), - weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'), - weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'), - - longDateFormat: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'DD/MM/YYYY', - LL: 'D MMMM YYYY', - LLL: 'D MMMM YYYY HH:mm', - LLLL: 'dddd D MMMM YYYY HH:mm' - }, - calendar: { - sameDay: '[ယနေ.] LT [မှာ]', - nextDay: '[မနက်ဖြန်] LT [မှာ]', - nextWeek: 'dddd LT [မှာ]', - lastDay: '[မနေ.က] LT [မှာ]', - lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]', - sameElse: 'L' - }, - relativeTime: { - future: 'လာမည့် %s မှာ', - past: 'လွန်ခဲ့သော %s က', - s: 'စက္ကန်.အနည်းငယ်', - ss : '%d စက္ကန့်', - m: 'တစ်မိနစ်', - mm: '%d မိနစ်', - h: 'တစ်နာရီ', - hh: '%d နာရီ', - d: 'တစ်ရက်', - dd: '%d ရက်', - M: 'တစ်လ', - MM: '%d လ', - y: 'တစ်နှစ်', - yy: '%d နှစ်' - }, - preparse: function (string) { - return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return my; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/nb.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/nb.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var nb = moment.defineLocale('nb', { - months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), - monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'), - monthsParseExact : true, - weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), - weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'), - weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY [kl.] HH:mm', - LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' - }, - calendar : { - sameDay: '[i dag kl.] LT', - nextDay: '[i morgen kl.] LT', - nextWeek: 'dddd [kl.] LT', - lastDay: '[i går kl.] LT', - lastWeek: '[forrige] dddd [kl.] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'om %s', - past : '%s siden', - s : 'noen sekunder', - ss : '%d sekunder', - m : 'ett minutt', - mm : '%d minutter', - h : 'en time', - hh : '%d timer', - d : 'en dag', - dd : '%d dager', - M : 'en måned', - MM : '%d måneder', - y : 'ett år', - yy : '%d år' - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return nb; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ne.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ne.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - var ne = moment.defineLocale('ne', { - months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'), - monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'), - monthsParseExact : true, - weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'), - weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'), - weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'Aको h:mm बजे', - LTS : 'Aको h:mm:ss बजे', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, Aको h:mm बजे', - LLLL : 'dddd, D MMMM YYYY, Aको h:mm बजे' - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiemParse: /राति|बिहान|दिउँसो|साँझ/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'राति') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'बिहान') { - return hour; - } else if (meridiem === 'दिउँसो') { - return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'साँझ') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 3) { - return 'राति'; - } else if (hour < 12) { - return 'बिहान'; - } else if (hour < 16) { - return 'दिउँसो'; - } else if (hour < 20) { - return 'साँझ'; - } else { - return 'राति'; - } - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[भोलि] LT', - nextWeek : '[आउँदो] dddd[,] LT', - lastDay : '[हिजो] LT', - lastWeek : '[गएको] dddd[,] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%sमा', - past : '%s अगाडि', - s : 'केही क्षण', - ss : '%d सेकेण्ड', - m : 'एक मिनेट', - mm : '%d मिनेट', - h : 'एक घण्टा', - hh : '%d घण्टा', - d : 'एक दिन', - dd : '%d दिन', - M : 'एक महिना', - MM : '%d महिना', - y : 'एक बर्ष', - yy : '%d बर्ष' - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 6th is the first week of the year. - } - }); - - return ne; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/nl-be.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/nl-be.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'), - monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'); - - var monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i]; - var monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; - - var nlBe = moment.defineLocale('nl-be', { - months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'), - monthsShort : function (m, format) { - if (!m) { - return monthsShortWithDots; - } else if (/-MMM-/.test(format)) { - return monthsShortWithoutDots[m.month()]; - } else { - return monthsShortWithDots[m.month()]; - } - }, - - monthsRegex: monthsRegex, - monthsShortRegex: monthsRegex, - monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i, - monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i, - - monthsParse : monthsParse, - longMonthsParse : monthsParse, - shortMonthsParse : monthsParse, - - weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'), - weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'), - weekdaysMin : 'zo_ma_di_wo_do_vr_za'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[vandaag om] LT', - nextDay: '[morgen om] LT', - nextWeek: 'dddd [om] LT', - lastDay: '[gisteren om] LT', - lastWeek: '[afgelopen] dddd [om] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'over %s', - past : '%s geleden', - s : 'een paar seconden', - ss : '%d seconden', - m : 'één minuut', - mm : '%d minuten', - h : 'één uur', - hh : '%d uur', - d : 'één dag', - dd : '%d dagen', - M : 'één maand', - MM : '%d maanden', - y : 'één jaar', - yy : '%d jaar' - }, - dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/, - ordinal : function (number) { - return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return nlBe; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/nl.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/nl.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'), - monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'); - - var monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i]; - var monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; - - var nl = moment.defineLocale('nl', { - months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'), - monthsShort : function (m, format) { - if (!m) { - return monthsShortWithDots; - } else if (/-MMM-/.test(format)) { - return monthsShortWithoutDots[m.month()]; - } else { - return monthsShortWithDots[m.month()]; - } - }, - - monthsRegex: monthsRegex, - monthsShortRegex: monthsRegex, - monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i, - monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i, - - monthsParse : monthsParse, - longMonthsParse : monthsParse, - shortMonthsParse : monthsParse, - - weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'), - weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'), - weekdaysMin : 'zo_ma_di_wo_do_vr_za'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD-MM-YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[vandaag om] LT', - nextDay: '[morgen om] LT', - nextWeek: 'dddd [om] LT', - lastDay: '[gisteren om] LT', - lastWeek: '[afgelopen] dddd [om] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'over %s', - past : '%s geleden', - s : 'een paar seconden', - ss : '%d seconden', - m : 'één minuut', - mm : '%d minuten', - h : 'één uur', - hh : '%d uur', - d : 'één dag', - dd : '%d dagen', - M : 'één maand', - MM : '%d maanden', - y : 'één jaar', - yy : '%d jaar' - }, - dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/, - ordinal : function (number) { - return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return nl; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/nn.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/nn.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var nn = moment.defineLocale('nn', { - months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), - monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), - weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'), - weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'), - weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY [kl.] H:mm', - LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' - }, - calendar : { - sameDay: '[I dag klokka] LT', - nextDay: '[I morgon klokka] LT', - nextWeek: 'dddd [klokka] LT', - lastDay: '[I går klokka] LT', - lastWeek: '[Føregåande] dddd [klokka] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'om %s', - past : '%s sidan', - s : 'nokre sekund', - ss : '%d sekund', - m : 'eit minutt', - mm : '%d minutt', - h : 'ein time', - hh : '%d timar', - d : 'ein dag', - dd : '%d dagar', - M : 'ein månad', - MM : '%d månader', - y : 'eit år', - yy : '%d år' - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return nn; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/pa-in.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/pa-in.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '੧', - '2': '੨', - '3': '੩', - '4': '੪', - '5': '੫', - '6': '੬', - '7': '੭', - '8': '੮', - '9': '੯', - '0': '੦' - }, - numberMap = { - '੧': '1', - '੨': '2', - '੩': '3', - '੪': '4', - '੫': '5', - '੬': '6', - '੭': '7', - '੮': '8', - '੯': '9', - '੦': '0' - }; - - var paIn = moment.defineLocale('pa-in', { - // There are months name as per Nanakshahi Calendar but they are not used as rigidly in modern Punjabi. - months : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), - monthsShort : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), - weekdays : 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'), - weekdaysShort : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), - weekdaysMin : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), - longDateFormat : { - LT : 'A h:mm ਵਜੇ', - LTS : 'A h:mm:ss ਵਜੇ', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm ਵਜੇ', - LLLL : 'dddd, D MMMM YYYY, A h:mm ਵਜੇ' - }, - calendar : { - sameDay : '[ਅਜ] LT', - nextDay : '[ਕਲ] LT', - nextWeek : '[ਅਗਲਾ] dddd, LT', - lastDay : '[ਕਲ] LT', - lastWeek : '[ਪਿਛਲੇ] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s ਵਿੱਚ', - past : '%s ਪਿਛਲੇ', - s : 'ਕੁਝ ਸਕਿੰਟ', - ss : '%d ਸਕਿੰਟ', - m : 'ਇਕ ਮਿੰਟ', - mm : '%d ਮਿੰਟ', - h : 'ਇੱਕ ਘੰਟਾ', - hh : '%d ਘੰਟੇ', - d : 'ਇੱਕ ਦਿਨ', - dd : '%d ਦਿਨ', - M : 'ਇੱਕ ਮਹੀਨਾ', - MM : '%d ਮਹੀਨੇ', - y : 'ਇੱਕ ਸਾਲ', - yy : '%d ਸਾਲ' - }, - preparse: function (string) { - return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - // Punjabi notation for meridiems are quite fuzzy in practice. While there exists - // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi. - meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'ਰਾਤ') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'ਸਵੇਰ') { - return hour; - } else if (meridiem === 'ਦੁਪਹਿਰ') { - return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'ਸ਼ਾਮ') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'ਰਾਤ'; - } else if (hour < 10) { - return 'ਸਵੇਰ'; - } else if (hour < 17) { - return 'ਦੁਪਹਿਰ'; - } else if (hour < 20) { - return 'ਸ਼ਾਮ'; - } else { - return 'ਰਾਤ'; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 6th is the first week of the year. - } - }); - - return paIn; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/pl.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/pl.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'), - monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_'); - function plural(n) { - return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1); - } - function translate(number, withoutSuffix, key) { - var result = number + ' '; - switch (key) { - case 'ss': - return result + (plural(number) ? 'sekundy' : 'sekund'); - case 'm': - return withoutSuffix ? 'minuta' : 'minutę'; - case 'mm': - return result + (plural(number) ? 'minuty' : 'minut'); - case 'h': - return withoutSuffix ? 'godzina' : 'godzinę'; - case 'hh': - return result + (plural(number) ? 'godziny' : 'godzin'); - case 'MM': - return result + (plural(number) ? 'miesiące' : 'miesięcy'); - case 'yy': - return result + (plural(number) ? 'lata' : 'lat'); - } - } - - var pl = moment.defineLocale('pl', { - months : function (momentToFormat, format) { - if (!momentToFormat) { - return monthsNominative; - } else if (format === '') { - // Hack: if format empty we know this is used to generate - // RegExp by moment. Give then back both valid forms of months - // in RegExp ready format. - return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')'; - } else if (/D MMMM/.test(format)) { - return monthsSubjective[momentToFormat.month()]; - } else { - return monthsNominative[momentToFormat.month()]; - } - }, - monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), - weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'), - weekdaysShort : 'ndz_pon_wt_śr_czw_pt_sob'.split('_'), - weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Dziś o] LT', - nextDay: '[Jutro o] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[W niedzielę o] LT'; - - case 2: - return '[We wtorek o] LT'; - - case 3: - return '[W środę o] LT'; - - case 6: - return '[W sobotę o] LT'; - - default: - return '[W] dddd [o] LT'; - } - }, - lastDay: '[Wczoraj o] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[W zeszłą niedzielę o] LT'; - case 3: - return '[W zeszłą środę o] LT'; - case 6: - return '[W zeszłą sobotę o] LT'; - default: - return '[W zeszły] dddd [o] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : 'za %s', - past : '%s temu', - s : 'kilka sekund', - ss : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : '1 dzień', - dd : '%d dni', - M : 'miesiąc', - MM : translate, - y : 'rok', - yy : translate - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return pl; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/pt-br.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/pt-br.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var ptBr = moment.defineLocale('pt-br', { - months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'), - monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), - weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'), - weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), - weekdaysMin : 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D [de] MMMM [de] YYYY', - LLL : 'D [de] MMMM [de] YYYY [às] HH:mm', - LLLL : 'dddd, D [de] MMMM [de] YYYY [às] HH:mm' - }, - calendar : { - sameDay: '[Hoje às] LT', - nextDay: '[Amanhã às] LT', - nextWeek: 'dddd [às] LT', - lastDay: '[Ontem às] LT', - lastWeek: function () { - return (this.day() === 0 || this.day() === 6) ? - '[Último] dddd [às] LT' : // Saturday + Sunday - '[Última] dddd [às] LT'; // Monday - Friday - }, - sameElse: 'L' - }, - relativeTime : { - future : 'em %s', - past : 'há %s', - s : 'poucos segundos', - ss : '%d segundos', - m : 'um minuto', - mm : '%d minutos', - h : 'uma hora', - hh : '%d horas', - d : 'um dia', - dd : '%d dias', - M : 'um mês', - MM : '%d meses', - y : 'um ano', - yy : '%d anos' - }, - dayOfMonthOrdinalParse: /\d{1,2}º/, - ordinal : '%dº' - }); - - return ptBr; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/pt.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/pt.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var pt = moment.defineLocale('pt', { - months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'), - monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), - weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'), - weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), - weekdaysMin : 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D [de] MMMM [de] YYYY', - LLL : 'D [de] MMMM [de] YYYY HH:mm', - LLLL : 'dddd, D [de] MMMM [de] YYYY HH:mm' - }, - calendar : { - sameDay: '[Hoje às] LT', - nextDay: '[Amanhã às] LT', - nextWeek: 'dddd [às] LT', - lastDay: '[Ontem às] LT', - lastWeek: function () { - return (this.day() === 0 || this.day() === 6) ? - '[Último] dddd [às] LT' : // Saturday + Sunday - '[Última] dddd [às] LT'; // Monday - Friday - }, - sameElse: 'L' - }, - relativeTime : { - future : 'em %s', - past : 'há %s', - s : 'segundos', - ss : '%d segundos', - m : 'um minuto', - mm : '%d minutos', - h : 'uma hora', - hh : '%d horas', - d : 'um dia', - dd : '%d dias', - M : 'um mês', - MM : '%d meses', - y : 'um ano', - yy : '%d anos' - }, - dayOfMonthOrdinalParse: /\d{1,2}º/, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return pt; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ro.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ro.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'ss': 'secunde', - 'mm': 'minute', - 'hh': 'ore', - 'dd': 'zile', - 'MM': 'luni', - 'yy': 'ani' - }, - separator = ' '; - if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) { - separator = ' de '; - } - return number + separator + format[key]; - } - - var ro = moment.defineLocale('ro', { - months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'), - monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'), - monthsParseExact: true, - weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'), - weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'), - weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'), - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY H:mm', - LLLL : 'dddd, D MMMM YYYY H:mm' - }, - calendar : { - sameDay: '[azi la] LT', - nextDay: '[mâine la] LT', - nextWeek: 'dddd [la] LT', - lastDay: '[ieri la] LT', - lastWeek: '[fosta] dddd [la] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'peste %s', - past : '%s în urmă', - s : 'câteva secunde', - ss : relativeTimeWithPlural, - m : 'un minut', - mm : relativeTimeWithPlural, - h : 'o oră', - hh : relativeTimeWithPlural, - d : 'o zi', - dd : relativeTimeWithPlural, - M : 'o lună', - MM : relativeTimeWithPlural, - y : 'un an', - yy : relativeTimeWithPlural - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return ro; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ru.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ru.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'ss': withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд', - 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', - 'hh': 'час_часа_часов', - 'dd': 'день_дня_дней', - 'MM': 'месяц_месяца_месяцев', - 'yy': 'год_года_лет' - }; - if (key === 'm') { - return withoutSuffix ? 'минута' : 'минуту'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; - - // http://new.gramota.ru/spravka/rules/139-prop : § 103 - // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637 - // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753 - var ru = moment.defineLocale('ru', { - months : { - format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'), - standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_') - }, - monthsShort : { - // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ? - format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'), - standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_') - }, - weekdays : { - standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), - format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'), - isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/ - }, - weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - monthsParse : monthsParse, - longMonthsParse : monthsParse, - shortMonthsParse : monthsParse, - - // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки - monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i, - - // копия предыдущего - monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i, - - // полные названия с падежами - monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i, - - // Выражение, которое соотвествует только сокращённым формам - monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY г.', - LLL : 'D MMMM YYYY г., H:mm', - LLLL : 'dddd, D MMMM YYYY г., H:mm' - }, - calendar : { - sameDay: '[Сегодня, в] LT', - nextDay: '[Завтра, в] LT', - lastDay: '[Вчера, в] LT', - nextWeek: function (now) { - if (now.week() !== this.week()) { - switch (this.day()) { - case 0: - return '[В следующее] dddd, [в] LT'; - case 1: - case 2: - case 4: - return '[В следующий] dddd, [в] LT'; - case 3: - case 5: - case 6: - return '[В следующую] dddd, [в] LT'; - } - } else { - if (this.day() === 2) { - return '[Во] dddd, [в] LT'; - } else { - return '[В] dddd, [в] LT'; - } - } - }, - lastWeek: function (now) { - if (now.week() !== this.week()) { - switch (this.day()) { - case 0: - return '[В прошлое] dddd, [в] LT'; - case 1: - case 2: - case 4: - return '[В прошлый] dddd, [в] LT'; - case 3: - case 5: - case 6: - return '[В прошлую] dddd, [в] LT'; - } - } else { - if (this.day() === 2) { - return '[Во] dddd, [в] LT'; - } else { - return '[В] dddd, [в] LT'; - } - } - }, - sameElse: 'L' - }, - relativeTime : { - future : 'через %s', - past : '%s назад', - s : 'несколько секунд', - ss : relativeTimeWithPlural, - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : 'час', - hh : relativeTimeWithPlural, - d : 'день', - dd : relativeTimeWithPlural, - M : 'месяц', - MM : relativeTimeWithPlural, - y : 'год', - yy : relativeTimeWithPlural - }, - meridiemParse: /ночи|утра|дня|вечера/i, - isPM : function (input) { - return /^(дня|вечера)$/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'ночи'; - } else if (hour < 12) { - return 'утра'; - } else if (hour < 17) { - return 'дня'; - } else { - return 'вечера'; - } - }, - dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/, - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - return number + '-й'; - case 'D': - return number + '-го'; - case 'w': - case 'W': - return number + '-я'; - default: - return number; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return ru; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/sd.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/sd.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var months = [ - 'جنوري', - 'فيبروري', - 'مارچ', - 'اپريل', - 'مئي', - 'جون', - 'جولاءِ', - 'آگسٽ', - 'سيپٽمبر', - 'آڪٽوبر', - 'نومبر', - 'ڊسمبر' - ]; - var days = [ - 'آچر', - 'سومر', - 'اڱارو', - 'اربع', - 'خميس', - 'جمع', - 'ڇنڇر' - ]; - - var sd = moment.defineLocale('sd', { - months : months, - monthsShort : months, - weekdays : days, - weekdaysShort : days, - weekdaysMin : days, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd، D MMMM YYYY HH:mm' - }, - meridiemParse: /صبح|شام/, - isPM : function (input) { - return 'شام' === input; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'صبح'; - } - return 'شام'; - }, - calendar : { - sameDay : '[اڄ] LT', - nextDay : '[سڀاڻي] LT', - nextWeek : 'dddd [اڳين هفتي تي] LT', - lastDay : '[ڪالهه] LT', - lastWeek : '[گزريل هفتي] dddd [تي] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s پوء', - past : '%s اڳ', - s : 'چند سيڪنڊ', - ss : '%d سيڪنڊ', - m : 'هڪ منٽ', - mm : '%d منٽ', - h : 'هڪ ڪلاڪ', - hh : '%d ڪلاڪ', - d : 'هڪ ڏينهن', - dd : '%d ڏينهن', - M : 'هڪ مهينو', - MM : '%d مهينا', - y : 'هڪ سال', - yy : '%d سال' - }, - preparse: function (string) { - return string.replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/,/g, '،'); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return sd; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/se.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/se.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var se = moment.defineLocale('se', { - months : 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'), - monthsShort : 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'), - weekdays : 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'), - weekdaysShort : 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'), - weekdaysMin : 's_v_m_g_d_b_L'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'MMMM D. [b.] YYYY', - LLL : 'MMMM D. [b.] YYYY [ti.] HH:mm', - LLLL : 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm' - }, - calendar : { - sameDay: '[otne ti] LT', - nextDay: '[ihttin ti] LT', - nextWeek: 'dddd [ti] LT', - lastDay: '[ikte ti] LT', - lastWeek: '[ovddit] dddd [ti] LT', - sameElse: 'L' - }, - relativeTime : { - future : '%s geažes', - past : 'maŋit %s', - s : 'moadde sekunddat', - ss: '%d sekunddat', - m : 'okta minuhta', - mm : '%d minuhtat', - h : 'okta diimmu', - hh : '%d diimmut', - d : 'okta beaivi', - dd : '%d beaivvit', - M : 'okta mánnu', - MM : '%d mánut', - y : 'okta jahki', - yy : '%d jagit' - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return se; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/si.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/si.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - /*jshint -W100*/ - var si = moment.defineLocale('si', { - months : 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'), - monthsShort : 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'), - weekdays : 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'), - weekdaysShort : 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'), - weekdaysMin : 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'a h:mm', - LTS : 'a h:mm:ss', - L : 'YYYY/MM/DD', - LL : 'YYYY MMMM D', - LLL : 'YYYY MMMM D, a h:mm', - LLLL : 'YYYY MMMM D [වැනි] dddd, a h:mm:ss' - }, - calendar : { - sameDay : '[අද] LT[ට]', - nextDay : '[හෙට] LT[ට]', - nextWeek : 'dddd LT[ට]', - lastDay : '[ඊයේ] LT[ට]', - lastWeek : '[පසුගිය] dddd LT[ට]', - sameElse : 'L' - }, - relativeTime : { - future : '%sකින්', - past : '%sකට පෙර', - s : 'තත්පර කිහිපය', - ss : 'තත්පර %d', - m : 'මිනිත්තුව', - mm : 'මිනිත්තු %d', - h : 'පැය', - hh : 'පැය %d', - d : 'දිනය', - dd : 'දින %d', - M : 'මාසය', - MM : 'මාස %d', - y : 'වසර', - yy : 'වසර %d' - }, - dayOfMonthOrdinalParse: /\d{1,2} වැනි/, - ordinal : function (number) { - return number + ' වැනි'; - }, - meridiemParse : /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./, - isPM : function (input) { - return input === 'ප.ව.' || input === 'පස් වරු'; - }, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'ප.ව.' : 'පස් වරු'; - } else { - return isLower ? 'පෙ.ව.' : 'පෙර වරු'; - } - } - }); - - return si; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/sk.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/sk.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'), - monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_'); - function plural(n) { - return (n > 1) && (n < 5); - } - function translate(number, withoutSuffix, key, isFuture) { - var result = number + ' '; - switch (key) { - case 's': // a few seconds / in a few seconds / a few seconds ago - return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami'; - case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'sekundy' : 'sekúnd'); - } else { - return result + 'sekundami'; - } - break; - case 'm': // a minute / in a minute / a minute ago - return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou'); - case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'minúty' : 'minút'); - } else { - return result + 'minútami'; - } - break; - case 'h': // an hour / in an hour / an hour ago - return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); - case 'hh': // 9 hours / in 9 hours / 9 hours ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'hodiny' : 'hodín'); - } else { - return result + 'hodinami'; - } - break; - case 'd': // a day / in a day / a day ago - return (withoutSuffix || isFuture) ? 'deň' : 'dňom'; - case 'dd': // 9 days / in 9 days / 9 days ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'dni' : 'dní'); - } else { - return result + 'dňami'; - } - break; - case 'M': // a month / in a month / a month ago - return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom'; - case 'MM': // 9 months / in 9 months / 9 months ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'mesiace' : 'mesiacov'); - } else { - return result + 'mesiacmi'; - } - break; - case 'y': // a year / in a year / a year ago - return (withoutSuffix || isFuture) ? 'rok' : 'rokom'; - case 'yy': // 9 years / in 9 years / 9 years ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'roky' : 'rokov'); - } else { - return result + 'rokmi'; - } - break; - } - } - - var sk = moment.defineLocale('sk', { - months : months, - monthsShort : monthsShort, - weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'), - weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'), - weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'), - longDateFormat : { - LT: 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd D. MMMM YYYY H:mm' - }, - calendar : { - sameDay: '[dnes o] LT', - nextDay: '[zajtra o] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[v nedeľu o] LT'; - case 1: - case 2: - return '[v] dddd [o] LT'; - case 3: - return '[v stredu o] LT'; - case 4: - return '[vo štvrtok o] LT'; - case 5: - return '[v piatok o] LT'; - case 6: - return '[v sobotu o] LT'; - } - }, - lastDay: '[včera o] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[minulú nedeľu o] LT'; - case 1: - case 2: - return '[minulý] dddd [o] LT'; - case 3: - return '[minulú stredu o] LT'; - case 4: - case 5: - return '[minulý] dddd [o] LT'; - case 6: - return '[minulú sobotu o] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : 'za %s', - past : 'pred %s', - s : translate, - ss : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return sk; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/sl.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/sl.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var result = number + ' '; - switch (key) { - case 's': - return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami'; - case 'ss': - if (number === 1) { - result += withoutSuffix ? 'sekundo' : 'sekundi'; - } else if (number === 2) { - result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah'; - } else if (number < 5) { - result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah'; - } else { - result += 'sekund'; - } - return result; - case 'm': - return withoutSuffix ? 'ena minuta' : 'eno minuto'; - case 'mm': - if (number === 1) { - result += withoutSuffix ? 'minuta' : 'minuto'; - } else if (number === 2) { - result += withoutSuffix || isFuture ? 'minuti' : 'minutama'; - } else if (number < 5) { - result += withoutSuffix || isFuture ? 'minute' : 'minutami'; - } else { - result += withoutSuffix || isFuture ? 'minut' : 'minutami'; - } - return result; - case 'h': - return withoutSuffix ? 'ena ura' : 'eno uro'; - case 'hh': - if (number === 1) { - result += withoutSuffix ? 'ura' : 'uro'; - } else if (number === 2) { - result += withoutSuffix || isFuture ? 'uri' : 'urama'; - } else if (number < 5) { - result += withoutSuffix || isFuture ? 'ure' : 'urami'; - } else { - result += withoutSuffix || isFuture ? 'ur' : 'urami'; - } - return result; - case 'd': - return withoutSuffix || isFuture ? 'en dan' : 'enim dnem'; - case 'dd': - if (number === 1) { - result += withoutSuffix || isFuture ? 'dan' : 'dnem'; - } else if (number === 2) { - result += withoutSuffix || isFuture ? 'dni' : 'dnevoma'; - } else { - result += withoutSuffix || isFuture ? 'dni' : 'dnevi'; - } - return result; - case 'M': - return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem'; - case 'MM': - if (number === 1) { - result += withoutSuffix || isFuture ? 'mesec' : 'mesecem'; - } else if (number === 2) { - result += withoutSuffix || isFuture ? 'meseca' : 'mesecema'; - } else if (number < 5) { - result += withoutSuffix || isFuture ? 'mesece' : 'meseci'; - } else { - result += withoutSuffix || isFuture ? 'mesecev' : 'meseci'; - } - return result; - case 'y': - return withoutSuffix || isFuture ? 'eno leto' : 'enim letom'; - case 'yy': - if (number === 1) { - result += withoutSuffix || isFuture ? 'leto' : 'letom'; - } else if (number === 2) { - result += withoutSuffix || isFuture ? 'leti' : 'letoma'; - } else if (number < 5) { - result += withoutSuffix || isFuture ? 'leta' : 'leti'; - } else { - result += withoutSuffix || isFuture ? 'let' : 'leti'; - } - return result; - } - } - - var sl = moment.defineLocale('sl', { - months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'), - monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'), - monthsParseExact: true, - weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'), - weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'), - weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd, D. MMMM YYYY H:mm' - }, - calendar : { - sameDay : '[danes ob] LT', - nextDay : '[jutri ob] LT', - - nextWeek : function () { - switch (this.day()) { - case 0: - return '[v] [nedeljo] [ob] LT'; - case 3: - return '[v] [sredo] [ob] LT'; - case 6: - return '[v] [soboto] [ob] LT'; - case 1: - case 2: - case 4: - case 5: - return '[v] dddd [ob] LT'; - } - }, - lastDay : '[včeraj ob] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - return '[prejšnjo] [nedeljo] [ob] LT'; - case 3: - return '[prejšnjo] [sredo] [ob] LT'; - case 6: - return '[prejšnjo] [soboto] [ob] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prejšnji] dddd [ob] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : 'čez %s', - past : 'pred %s', - s : processRelativeTime, - ss : processRelativeTime, - m : processRelativeTime, - mm : processRelativeTime, - h : processRelativeTime, - hh : processRelativeTime, - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return sl; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/sq.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/sq.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var sq = moment.defineLocale('sq', { - months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'), - monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'), - weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'), - weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'), - weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'), - weekdaysParseExact : true, - meridiemParse: /PD|MD/, - isPM: function (input) { - return input.charAt(0) === 'M'; - }, - meridiem : function (hours, minutes, isLower) { - return hours < 12 ? 'PD' : 'MD'; - }, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Sot në] LT', - nextDay : '[Nesër në] LT', - nextWeek : 'dddd [në] LT', - lastDay : '[Dje në] LT', - lastWeek : 'dddd [e kaluar në] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'në %s', - past : '%s më parë', - s : 'disa sekonda', - ss : '%d sekonda', - m : 'një minutë', - mm : '%d minuta', - h : 'një orë', - hh : '%d orë', - d : 'një ditë', - dd : '%d ditë', - M : 'një muaj', - MM : '%d muaj', - y : 'një vit', - yy : '%d vite' - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return sq; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/sr-cyrl.js": -/*!***********************************************!*\ - !*** ./node_modules/moment/locale/sr-cyrl.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var translator = { - words: { //Different grammatical cases - ss: ['секунда', 'секунде', 'секунди'], - m: ['један минут', 'једне минуте'], - mm: ['минут', 'минуте', 'минута'], - h: ['један сат', 'једног сата'], - hh: ['сат', 'сата', 'сати'], - dd: ['дан', 'дана', 'дана'], - MM: ['месец', 'месеца', 'месеци'], - yy: ['година', 'године', 'година'] - }, - correctGrammaticalCase: function (number, wordKey) { - return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]); - }, - translate: function (number, withoutSuffix, key) { - var wordKey = translator.words[key]; - if (key.length === 1) { - return withoutSuffix ? wordKey[0] : wordKey[1]; - } else { - return number + ' ' + translator.correctGrammaticalCase(number, wordKey); - } - } - }; - - var srCyrl = moment.defineLocale('sr-cyrl', { - months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split('_'), - monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'), - monthsParseExact: true, - weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'), - weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'), - weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'), - weekdaysParseExact : true, - longDateFormat: { - LT: 'H:mm', - LTS : 'H:mm:ss', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm' - }, - calendar: { - sameDay: '[данас у] LT', - nextDay: '[сутра у] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[у] [недељу] [у] LT'; - case 3: - return '[у] [среду] [у] LT'; - case 6: - return '[у] [суботу] [у] LT'; - case 1: - case 2: - case 4: - case 5: - return '[у] dddd [у] LT'; - } - }, - lastDay : '[јуче у] LT', - lastWeek : function () { - var lastWeekDays = [ - '[прошле] [недеље] [у] LT', - '[прошлог] [понедељка] [у] LT', - '[прошлог] [уторка] [у] LT', - '[прошле] [среде] [у] LT', - '[прошлог] [четвртка] [у] LT', - '[прошлог] [петка] [у] LT', - '[прошле] [суботе] [у] LT' - ]; - return lastWeekDays[this.day()]; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'за %s', - past : 'пре %s', - s : 'неколико секунди', - ss : translator.translate, - m : translator.translate, - mm : translator.translate, - h : translator.translate, - hh : translator.translate, - d : 'дан', - dd : translator.translate, - M : 'месец', - MM : translator.translate, - y : 'годину', - yy : translator.translate - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return srCyrl; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/sr.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/sr.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var translator = { - words: { //Different grammatical cases - ss: ['sekunda', 'sekunde', 'sekundi'], - m: ['jedan minut', 'jedne minute'], - mm: ['minut', 'minute', 'minuta'], - h: ['jedan sat', 'jednog sata'], - hh: ['sat', 'sata', 'sati'], - dd: ['dan', 'dana', 'dana'], - MM: ['mesec', 'meseca', 'meseci'], - yy: ['godina', 'godine', 'godina'] - }, - correctGrammaticalCase: function (number, wordKey) { - return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]); - }, - translate: function (number, withoutSuffix, key) { - var wordKey = translator.words[key]; - if (key.length === 1) { - return withoutSuffix ? wordKey[0] : wordKey[1]; - } else { - return number + ' ' + translator.correctGrammaticalCase(number, wordKey); - } - } - }; - - var sr = moment.defineLocale('sr', { - months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'), - monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'), - monthsParseExact: true, - weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split('_'), - weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'), - weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), - weekdaysParseExact : true, - longDateFormat: { - LT: 'H:mm', - LTS : 'H:mm:ss', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm' - }, - calendar: { - sameDay: '[danas u] LT', - nextDay: '[sutra u] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[u] [nedelju] [u] LT'; - case 3: - return '[u] [sredu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[juče u] LT', - lastWeek : function () { - var lastWeekDays = [ - '[prošle] [nedelje] [u] LT', - '[prošlog] [ponedeljka] [u] LT', - '[prošlog] [utorka] [u] LT', - '[prošle] [srede] [u] LT', - '[prošlog] [četvrtka] [u] LT', - '[prošlog] [petka] [u] LT', - '[prošle] [subote] [u] LT' - ]; - return lastWeekDays[this.day()]; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'za %s', - past : 'pre %s', - s : 'nekoliko sekundi', - ss : translator.translate, - m : translator.translate, - mm : translator.translate, - h : translator.translate, - hh : translator.translate, - d : 'dan', - dd : translator.translate, - M : 'mesec', - MM : translator.translate, - y : 'godinu', - yy : translator.translate - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return sr; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ss.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ss.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var ss = moment.defineLocale('ss', { - months : "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split('_'), - monthsShort : 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'), - weekdays : 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split('_'), - weekdaysShort : 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'), - weekdaysMin : 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY h:mm A', - LLLL : 'dddd, D MMMM YYYY h:mm A' - }, - calendar : { - sameDay : '[Namuhla nga] LT', - nextDay : '[Kusasa nga] LT', - nextWeek : 'dddd [nga] LT', - lastDay : '[Itolo nga] LT', - lastWeek : 'dddd [leliphelile] [nga] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'nga %s', - past : 'wenteka nga %s', - s : 'emizuzwana lomcane', - ss : '%d mzuzwana', - m : 'umzuzu', - mm : '%d emizuzu', - h : 'lihora', - hh : '%d emahora', - d : 'lilanga', - dd : '%d emalanga', - M : 'inyanga', - MM : '%d tinyanga', - y : 'umnyaka', - yy : '%d iminyaka' - }, - meridiemParse: /ekuseni|emini|entsambama|ebusuku/, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'ekuseni'; - } else if (hours < 15) { - return 'emini'; - } else if (hours < 19) { - return 'entsambama'; - } else { - return 'ebusuku'; - } - }, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'ekuseni') { - return hour; - } else if (meridiem === 'emini') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') { - if (hour === 0) { - return 0; - } - return hour + 12; - } - }, - dayOfMonthOrdinalParse: /\d{1,2}/, - ordinal : '%d', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return ss; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/sv.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/sv.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var sv = moment.defineLocale('sv', { - months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'), - monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), - weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'), - weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'), - weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY-MM-DD', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY [kl.] HH:mm', - LLLL : 'dddd D MMMM YYYY [kl.] HH:mm', - lll : 'D MMM YYYY HH:mm', - llll : 'ddd D MMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Idag] LT', - nextDay: '[Imorgon] LT', - lastDay: '[Igår] LT', - nextWeek: '[På] dddd LT', - lastWeek: '[I] dddd[s] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'om %s', - past : 'för %s sedan', - s : 'några sekunder', - ss : '%d sekunder', - m : 'en minut', - mm : '%d minuter', - h : 'en timme', - hh : '%d timmar', - d : 'en dag', - dd : '%d dagar', - M : 'en månad', - MM : '%d månader', - y : 'ett år', - yy : '%d år' - }, - dayOfMonthOrdinalParse: /\d{1,2}(e|a)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'e' : - (b === 1) ? 'a' : - (b === 2) ? 'a' : - (b === 3) ? 'e' : 'e'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return sv; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/sw.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/sw.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var sw = moment.defineLocale('sw', { - months : 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'), - monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'), - weekdays : 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'), - weekdaysShort : 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'), - weekdaysMin : 'J2_J3_J4_J5_Al_Ij_J1'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[leo saa] LT', - nextDay : '[kesho saa] LT', - nextWeek : '[wiki ijayo] dddd [saat] LT', - lastDay : '[jana] LT', - lastWeek : '[wiki iliyopita] dddd [saat] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s baadaye', - past : 'tokea %s', - s : 'hivi punde', - ss : 'sekunde %d', - m : 'dakika moja', - mm : 'dakika %d', - h : 'saa limoja', - hh : 'masaa %d', - d : 'siku moja', - dd : 'masiku %d', - M : 'mwezi mmoja', - MM : 'miezi %d', - y : 'mwaka mmoja', - yy : 'miaka %d' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return sw; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ta.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ta.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var symbolMap = { - '1': '௧', - '2': '௨', - '3': '௩', - '4': '௪', - '5': '௫', - '6': '௬', - '7': '௭', - '8': '௮', - '9': '௯', - '0': '௦' - }, numberMap = { - '௧': '1', - '௨': '2', - '௩': '3', - '௪': '4', - '௫': '5', - '௬': '6', - '௭': '7', - '௮': '8', - '௯': '9', - '௦': '0' - }; - - var ta = moment.defineLocale('ta', { - months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), - monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), - weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'), - weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'), - weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, HH:mm', - LLLL : 'dddd, D MMMM YYYY, HH:mm' - }, - calendar : { - sameDay : '[இன்று] LT', - nextDay : '[நாளை] LT', - nextWeek : 'dddd, LT', - lastDay : '[நேற்று] LT', - lastWeek : '[கடந்த வாரம்] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s இல்', - past : '%s முன்', - s : 'ஒரு சில விநாடிகள்', - ss : '%d விநாடிகள்', - m : 'ஒரு நிமிடம்', - mm : '%d நிமிடங்கள்', - h : 'ஒரு மணி நேரம்', - hh : '%d மணி நேரம்', - d : 'ஒரு நாள்', - dd : '%d நாட்கள்', - M : 'ஒரு மாதம்', - MM : '%d மாதங்கள்', - y : 'ஒரு வருடம்', - yy : '%d ஆண்டுகள்' - }, - dayOfMonthOrdinalParse: /\d{1,2}வது/, - ordinal : function (number) { - return number + 'வது'; - }, - preparse: function (string) { - return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - // refer http://ta.wikipedia.org/s/1er1 - meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/, - meridiem : function (hour, minute, isLower) { - if (hour < 2) { - return ' யாமம்'; - } else if (hour < 6) { - return ' வைகறை'; // வைகறை - } else if (hour < 10) { - return ' காலை'; // காலை - } else if (hour < 14) { - return ' நண்பகல்'; // நண்பகல் - } else if (hour < 18) { - return ' எற்பாடு'; // எற்பாடு - } else if (hour < 22) { - return ' மாலை'; // மாலை - } else { - return ' யாமம்'; - } - }, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'யாமம்') { - return hour < 2 ? hour : hour + 12; - } else if (meridiem === 'வைகறை' || meridiem === 'காலை') { - return hour; - } else if (meridiem === 'நண்பகல்') { - return hour >= 10 ? hour : hour + 12; - } else { - return hour + 12; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 6th is the first week of the year. - } - }); - - return ta; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/te.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/te.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var te = moment.defineLocale('te', { - months : 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'), - monthsShort : 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'), - monthsParseExact : true, - weekdays : 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'), - weekdaysShort : 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'), - weekdaysMin : 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'), - longDateFormat : { - LT : 'A h:mm', - LTS : 'A h:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm', - LLLL : 'dddd, D MMMM YYYY, A h:mm' - }, - calendar : { - sameDay : '[నేడు] LT', - nextDay : '[రేపు] LT', - nextWeek : 'dddd, LT', - lastDay : '[నిన్న] LT', - lastWeek : '[గత] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s లో', - past : '%s క్రితం', - s : 'కొన్ని క్షణాలు', - ss : '%d సెకన్లు', - m : 'ఒక నిమిషం', - mm : '%d నిమిషాలు', - h : 'ఒక గంట', - hh : '%d గంటలు', - d : 'ఒక రోజు', - dd : '%d రోజులు', - M : 'ఒక నెల', - MM : '%d నెలలు', - y : 'ఒక సంవత్సరం', - yy : '%d సంవత్సరాలు' - }, - dayOfMonthOrdinalParse : /\d{1,2}వ/, - ordinal : '%dవ', - meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'రాత్రి') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'ఉదయం') { - return hour; - } else if (meridiem === 'మధ్యాహ్నం') { - return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'సాయంత్రం') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'రాత్రి'; - } else if (hour < 10) { - return 'ఉదయం'; - } else if (hour < 17) { - return 'మధ్యాహ్నం'; - } else if (hour < 20) { - return 'సాయంత్రం'; - } else { - return 'రాత్రి'; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 6th is the first week of the year. - } - }); - - return te; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/tet.js": -/*!*******************************************!*\ - !*** ./node_modules/moment/locale/tet.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var tet = moment.defineLocale('tet', { - months : 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split('_'), - monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), - weekdays : 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'), - weekdaysShort : 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'), - weekdaysMin : 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Ohin iha] LT', - nextDay: '[Aban iha] LT', - nextWeek: 'dddd [iha] LT', - lastDay: '[Horiseik iha] LT', - lastWeek: 'dddd [semana kotuk] [iha] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'iha %s', - past : '%s liuba', - s : 'minutu balun', - ss : 'minutu %d', - m : 'minutu ida', - mm : 'minutu %d', - h : 'oras ida', - hh : 'oras %d', - d : 'loron ida', - dd : 'loron %d', - M : 'fulan ida', - MM : 'fulan %d', - y : 'tinan ida', - yy : 'tinan %d' - }, - dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return tet; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/tg.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/tg.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var suffixes = { - 0: '-ум', - 1: '-ум', - 2: '-юм', - 3: '-юм', - 4: '-ум', - 5: '-ум', - 6: '-ум', - 7: '-ум', - 8: '-ум', - 9: '-ум', - 10: '-ум', - 12: '-ум', - 13: '-ум', - 20: '-ум', - 30: '-юм', - 40: '-ум', - 50: '-ум', - 60: '-ум', - 70: '-ум', - 80: '-ум', - 90: '-ум', - 100: '-ум' - }; - - var tg = moment.defineLocale('tg', { - months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'), - monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), - weekdays : 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split('_'), - weekdaysShort : 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'), - weekdaysMin : 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Имрӯз соати] LT', - nextDay : '[Пагоҳ соати] LT', - lastDay : '[Дирӯз соати] LT', - nextWeek : 'dddd[и] [ҳафтаи оянда соати] LT', - lastWeek : 'dddd[и] [ҳафтаи гузашта соати] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'баъди %s', - past : '%s пеш', - s : 'якчанд сония', - m : 'як дақиқа', - mm : '%d дақиқа', - h : 'як соат', - hh : '%d соат', - d : 'як рӯз', - dd : '%d рӯз', - M : 'як моҳ', - MM : '%d моҳ', - y : 'як сол', - yy : '%d сол' - }, - meridiemParse: /шаб|субҳ|рӯз|бегоҳ/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'шаб') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'субҳ') { - return hour; - } else if (meridiem === 'рӯз') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === 'бегоҳ') { - return hour + 12; - } - }, - meridiem: function (hour, minute, isLower) { - if (hour < 4) { - return 'шаб'; - } else if (hour < 11) { - return 'субҳ'; - } else if (hour < 16) { - return 'рӯз'; - } else if (hour < 19) { - return 'бегоҳ'; - } else { - return 'шаб'; - } - }, - dayOfMonthOrdinalParse: /\d{1,2}-(ум|юм)/, - ordinal: function (number) { - var a = number % 10, - b = number >= 100 ? 100 : null; - return number + (suffixes[number] || suffixes[a] || suffixes[b]); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1th is the first week of the year. - } - }); - - return tg; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/th.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/th.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var th = moment.defineLocale('th', { - months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'), - monthsShort : 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'), - monthsParseExact: true, - weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'), - weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference - weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY เวลา H:mm', - LLLL : 'วันddddที่ D MMMM YYYY เวลา H:mm' - }, - meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/, - isPM: function (input) { - return input === 'หลังเที่ยง'; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'ก่อนเที่ยง'; - } else { - return 'หลังเที่ยง'; - } - }, - calendar : { - sameDay : '[วันนี้ เวลา] LT', - nextDay : '[พรุ่งนี้ เวลา] LT', - nextWeek : 'dddd[หน้า เวลา] LT', - lastDay : '[เมื่อวานนี้ เวลา] LT', - lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'อีก %s', - past : '%sที่แล้ว', - s : 'ไม่กี่วินาที', - ss : '%d วินาที', - m : '1 นาที', - mm : '%d นาที', - h : '1 ชั่วโมง', - hh : '%d ชั่วโมง', - d : '1 วัน', - dd : '%d วัน', - M : '1 เดือน', - MM : '%d เดือน', - y : '1 ปี', - yy : '%d ปี' - } - }); - - return th; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/tl-ph.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/tl-ph.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var tlPh = moment.defineLocale('tl-ph', { - months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'), - monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'), - weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'), - weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'), - weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'MM/D/YYYY', - LL : 'MMMM D, YYYY', - LLL : 'MMMM D, YYYY HH:mm', - LLLL : 'dddd, MMMM DD, YYYY HH:mm' - }, - calendar : { - sameDay: 'LT [ngayong araw]', - nextDay: '[Bukas ng] LT', - nextWeek: 'LT [sa susunod na] dddd', - lastDay: 'LT [kahapon]', - lastWeek: 'LT [noong nakaraang] dddd', - sameElse: 'L' - }, - relativeTime : { - future : 'sa loob ng %s', - past : '%s ang nakalipas', - s : 'ilang segundo', - ss : '%d segundo', - m : 'isang minuto', - mm : '%d minuto', - h : 'isang oras', - hh : '%d oras', - d : 'isang araw', - dd : '%d araw', - M : 'isang buwan', - MM : '%d buwan', - y : 'isang taon', - yy : '%d taon' - }, - dayOfMonthOrdinalParse: /\d{1,2}/, - ordinal : function (number) { - return number; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return tlPh; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/tlh.js": -/*!*******************************************!*\ - !*** ./node_modules/moment/locale/tlh.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_'); - - function translateFuture(output) { - var time = output; - time = (output.indexOf('jaj') !== -1) ? - time.slice(0, -3) + 'leS' : - (output.indexOf('jar') !== -1) ? - time.slice(0, -3) + 'waQ' : - (output.indexOf('DIS') !== -1) ? - time.slice(0, -3) + 'nem' : - time + ' pIq'; - return time; - } - - function translatePast(output) { - var time = output; - time = (output.indexOf('jaj') !== -1) ? - time.slice(0, -3) + 'Hu’' : - (output.indexOf('jar') !== -1) ? - time.slice(0, -3) + 'wen' : - (output.indexOf('DIS') !== -1) ? - time.slice(0, -3) + 'ben' : - time + ' ret'; - return time; - } - - function translate(number, withoutSuffix, string, isFuture) { - var numberNoun = numberAsNoun(number); - switch (string) { - case 'ss': - return numberNoun + ' lup'; - case 'mm': - return numberNoun + ' tup'; - case 'hh': - return numberNoun + ' rep'; - case 'dd': - return numberNoun + ' jaj'; - case 'MM': - return numberNoun + ' jar'; - case 'yy': - return numberNoun + ' DIS'; - } - } - - function numberAsNoun(number) { - var hundred = Math.floor((number % 1000) / 100), - ten = Math.floor((number % 100) / 10), - one = number % 10, - word = ''; - if (hundred > 0) { - word += numbersNouns[hundred] + 'vatlh'; - } - if (ten > 0) { - word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH'; - } - if (one > 0) { - word += ((word !== '') ? ' ' : '') + numbersNouns[one]; - } - return (word === '') ? 'pagh' : word; - } - - var tlh = moment.defineLocale('tlh', { - months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'), - monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'), - monthsParseExact : true, - weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), - weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), - weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[DaHjaj] LT', - nextDay: '[wa’leS] LT', - nextWeek: 'LLL', - lastDay: '[wa’Hu’] LT', - lastWeek: 'LLL', - sameElse: 'L' - }, - relativeTime : { - future : translateFuture, - past : translatePast, - s : 'puS lup', - ss : translate, - m : 'wa’ tup', - mm : translate, - h : 'wa’ rep', - hh : translate, - d : 'wa’ jaj', - dd : translate, - M : 'wa’ jar', - MM : translate, - y : 'wa’ DIS', - yy : translate - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return tlh; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/tr.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/tr.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - var suffixes = { - 1: '\'inci', - 5: '\'inci', - 8: '\'inci', - 70: '\'inci', - 80: '\'inci', - 2: '\'nci', - 7: '\'nci', - 20: '\'nci', - 50: '\'nci', - 3: '\'üncü', - 4: '\'üncü', - 100: '\'üncü', - 6: '\'ncı', - 9: '\'uncu', - 10: '\'uncu', - 30: '\'uncu', - 60: '\'ıncı', - 90: '\'ıncı' - }; - - var tr = moment.defineLocale('tr', { - months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'), - monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'), - weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'), - weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'), - weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[bugün saat] LT', - nextDay : '[yarın saat] LT', - nextWeek : '[gelecek] dddd [saat] LT', - lastDay : '[dün] LT', - lastWeek : '[geçen] dddd [saat] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s sonra', - past : '%s önce', - s : 'birkaç saniye', - ss : '%d saniye', - m : 'bir dakika', - mm : '%d dakika', - h : 'bir saat', - hh : '%d saat', - d : 'bir gün', - dd : '%d gün', - M : 'bir ay', - MM : '%d ay', - y : 'bir yıl', - yy : '%d yıl' - }, - ordinal: function (number, period) { - switch (period) { - case 'd': - case 'D': - case 'Do': - case 'DD': - return number; - default: - if (number === 0) { // special case for zero - return number + '\'ıncı'; - } - var a = number % 10, - b = number % 100 - a, - c = number >= 100 ? 100 : null; - return number + (suffixes[a] || suffixes[b] || suffixes[c]); - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return tr; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/tzl.js": -/*!*******************************************!*\ - !*** ./node_modules/moment/locale/tzl.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals. - // This is currently too difficult (maybe even impossible) to add. - var tzl = moment.defineLocale('tzl', { - months : 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'), - monthsShort : 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'), - weekdays : 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'), - weekdaysShort : 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'), - weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'), - longDateFormat : { - LT : 'HH.mm', - LTS : 'HH.mm.ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM [dallas] YYYY', - LLL : 'D. MMMM [dallas] YYYY HH.mm', - LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm' - }, - meridiemParse: /d\'o|d\'a/i, - isPM : function (input) { - return 'd\'o' === input.toLowerCase(); - }, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'd\'o' : 'D\'O'; - } else { - return isLower ? 'd\'a' : 'D\'A'; - } - }, - calendar : { - sameDay : '[oxhi à] LT', - nextDay : '[demà à] LT', - nextWeek : 'dddd [à] LT', - lastDay : '[ieiri à] LT', - lastWeek : '[sür el] dddd [lasteu à] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'osprei %s', - past : 'ja%s', - s : processRelativeTime, - ss : processRelativeTime, - m : processRelativeTime, - mm : processRelativeTime, - h : processRelativeTime, - hh : processRelativeTime, - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - dayOfMonthOrdinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 's': ['viensas secunds', '\'iensas secunds'], - 'ss': [number + ' secunds', '' + number + ' secunds'], - 'm': ['\'n míut', '\'iens míut'], - 'mm': [number + ' míuts', '' + number + ' míuts'], - 'h': ['\'n þora', '\'iensa þora'], - 'hh': [number + ' þoras', '' + number + ' þoras'], - 'd': ['\'n ziua', '\'iensa ziua'], - 'dd': [number + ' ziuas', '' + number + ' ziuas'], - 'M': ['\'n mes', '\'iens mes'], - 'MM': [number + ' mesen', '' + number + ' mesen'], - 'y': ['\'n ar', '\'iens ar'], - 'yy': [number + ' ars', '' + number + ' ars'] - }; - return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1]); - } - - return tzl; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/tzm-latn.js": -/*!************************************************!*\ - !*** ./node_modules/moment/locale/tzm-latn.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var tzmLatn = moment.defineLocale('tzm-latn', { - months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'), - monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'), - weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), - weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), - weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[asdkh g] LT', - nextDay: '[aska g] LT', - nextWeek: 'dddd [g] LT', - lastDay: '[assant g] LT', - lastWeek: 'dddd [g] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'dadkh s yan %s', - past : 'yan %s', - s : 'imik', - ss : '%d imik', - m : 'minuḍ', - mm : '%d minuḍ', - h : 'saɛa', - hh : '%d tassaɛin', - d : 'ass', - dd : '%d ossan', - M : 'ayowr', - MM : '%d iyyirn', - y : 'asgas', - yy : '%d isgasn' - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 12th is the first week of the year. - } - }); - - return tzmLatn; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/tzm.js": -/*!*******************************************!*\ - !*** ./node_modules/moment/locale/tzm.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var tzm = moment.defineLocale('tzm', { - months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), - monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), - weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), - weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), - weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS: 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[ⴰⵙⴷⵅ ⴴ] LT', - nextDay: '[ⴰⵙⴽⴰ ⴴ] LT', - nextWeek: 'dddd [ⴴ] LT', - lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT', - lastWeek: 'dddd [ⴴ] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s', - past : 'ⵢⴰⵏ %s', - s : 'ⵉⵎⵉⴽ', - ss : '%d ⵉⵎⵉⴽ', - m : 'ⵎⵉⵏⵓⴺ', - mm : '%d ⵎⵉⵏⵓⴺ', - h : 'ⵙⴰⵄⴰ', - hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ', - d : 'ⴰⵙⵙ', - dd : '%d oⵙⵙⴰⵏ', - M : 'ⴰⵢoⵓⵔ', - MM : '%d ⵉⵢⵢⵉⵔⵏ', - y : 'ⴰⵙⴳⴰⵙ', - yy : '%d ⵉⵙⴳⴰⵙⵏ' - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 12th is the first week of the year. - } - }); - - return tzm; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ug-cn.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/ug-cn.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js language configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var ugCn = moment.defineLocale('ug-cn', { - months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split( - '_' - ), - monthsShort: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split( - '_' - ), - weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split( - '_' - ), - weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'), - weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'), - longDateFormat: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'YYYY-MM-DD', - LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى', - LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm', - LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm' - }, - meridiemParse: /يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if ( - meridiem === 'يېرىم كېچە' || - meridiem === 'سەھەر' || - meridiem === 'چۈشتىن بۇرۇن' - ) { - return hour; - } else if (meridiem === 'چۈشتىن كېيىن' || meridiem === 'كەچ') { - return hour + 12; - } else { - return hour >= 11 ? hour : hour + 12; - } - }, - meridiem: function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return 'يېرىم كېچە'; - } else if (hm < 900) { - return 'سەھەر'; - } else if (hm < 1130) { - return 'چۈشتىن بۇرۇن'; - } else if (hm < 1230) { - return 'چۈش'; - } else if (hm < 1800) { - return 'چۈشتىن كېيىن'; - } else { - return 'كەچ'; - } - }, - calendar: { - sameDay: '[بۈگۈن سائەت] LT', - nextDay: '[ئەتە سائەت] LT', - nextWeek: '[كېلەركى] dddd [سائەت] LT', - lastDay: '[تۆنۈگۈن] LT', - lastWeek: '[ئالدىنقى] dddd [سائەت] LT', - sameElse: 'L' - }, - relativeTime: { - future: '%s كېيىن', - past: '%s بۇرۇن', - s: 'نەچچە سېكونت', - ss: '%d سېكونت', - m: 'بىر مىنۇت', - mm: '%d مىنۇت', - h: 'بىر سائەت', - hh: '%d سائەت', - d: 'بىر كۈن', - dd: '%d كۈن', - M: 'بىر ئاي', - MM: '%d ئاي', - y: 'بىر يىل', - yy: '%d يىل' - }, - - dayOfMonthOrdinalParse: /\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/, - ordinal: function (number, period) { - switch (period) { - case 'd': - case 'D': - case 'DDD': - return number + '-كۈنى'; - case 'w': - case 'W': - return number + '-ھەپتە'; - default: - return number; - } - }, - preparse: function (string) { - return string.replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/,/g, '،'); - }, - week: { - // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 - dow: 1, // Monday is the first day of the week. - doy: 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return ugCn; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/uk.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/uk.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'ss': withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд', - 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин', - 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин', - 'dd': 'день_дні_днів', - 'MM': 'місяць_місяці_місяців', - 'yy': 'рік_роки_років' - }; - if (key === 'm') { - return withoutSuffix ? 'хвилина' : 'хвилину'; - } - else if (key === 'h') { - return withoutSuffix ? 'година' : 'годину'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'), - 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'), - 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_') - }; - - if (m === true) { - return weekdays['nominative'].slice(1, 7).concat(weekdays['nominative'].slice(0, 1)); - } - if (!m) { - return weekdays['nominative']; - } - - var nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ? - 'accusative' : - ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ? - 'genitive' : - 'nominative'); - return weekdays[nounCase][m.day()]; - } - function processHoursFunction(str) { - return function () { - return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT'; - }; - } - - var uk = moment.defineLocale('uk', { - months : { - 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'), - 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_') - }, - monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'), - weekdays : weekdaysCaseReplace, - weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), - weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY р.', - LLL : 'D MMMM YYYY р., HH:mm', - LLLL : 'dddd, D MMMM YYYY р., HH:mm' - }, - calendar : { - sameDay: processHoursFunction('[Сьогодні '), - nextDay: processHoursFunction('[Завтра '), - lastDay: processHoursFunction('[Вчора '), - nextWeek: processHoursFunction('[У] dddd ['), - lastWeek: function () { - switch (this.day()) { - case 0: - case 3: - case 5: - case 6: - return processHoursFunction('[Минулої] dddd [').call(this); - case 1: - case 2: - case 4: - return processHoursFunction('[Минулого] dddd [').call(this); - } - }, - sameElse: 'L' - }, - relativeTime : { - future : 'за %s', - past : '%s тому', - s : 'декілька секунд', - ss : relativeTimeWithPlural, - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : 'годину', - hh : relativeTimeWithPlural, - d : 'день', - dd : relativeTimeWithPlural, - M : 'місяць', - MM : relativeTimeWithPlural, - y : 'рік', - yy : relativeTimeWithPlural - }, - // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason - meridiemParse: /ночі|ранку|дня|вечора/, - isPM: function (input) { - return /^(дня|вечора)$/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'ночі'; - } else if (hour < 12) { - return 'ранку'; - } else if (hour < 17) { - return 'дня'; - } else { - return 'вечора'; - } - }, - dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/, - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - case 'w': - case 'W': - return number + '-й'; - case 'D': - return number + '-го'; - default: - return number; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return uk; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/ur.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/ur.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var months = [ - 'جنوری', - 'فروری', - 'مارچ', - 'اپریل', - 'مئی', - 'جون', - 'جولائی', - 'اگست', - 'ستمبر', - 'اکتوبر', - 'نومبر', - 'دسمبر' - ]; - var days = [ - 'اتوار', - 'پیر', - 'منگل', - 'بدھ', - 'جمعرات', - 'جمعہ', - 'ہفتہ' - ]; - - var ur = moment.defineLocale('ur', { - months : months, - monthsShort : months, - weekdays : days, - weekdaysShort : days, - weekdaysMin : days, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd، D MMMM YYYY HH:mm' - }, - meridiemParse: /صبح|شام/, - isPM : function (input) { - return 'شام' === input; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'صبح'; - } - return 'شام'; - }, - calendar : { - sameDay : '[آج بوقت] LT', - nextDay : '[کل بوقت] LT', - nextWeek : 'dddd [بوقت] LT', - lastDay : '[گذشتہ روز بوقت] LT', - lastWeek : '[گذشتہ] dddd [بوقت] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s بعد', - past : '%s قبل', - s : 'چند سیکنڈ', - ss : '%d سیکنڈ', - m : 'ایک منٹ', - mm : '%d منٹ', - h : 'ایک گھنٹہ', - hh : '%d گھنٹے', - d : 'ایک دن', - dd : '%d دن', - M : 'ایک ماہ', - MM : '%d ماہ', - y : 'ایک سال', - yy : '%d سال' - }, - preparse: function (string) { - return string.replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/,/g, '،'); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return ur; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/uz-latn.js": -/*!***********************************************!*\ - !*** ./node_modules/moment/locale/uz-latn.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var uzLatn = moment.defineLocale('uz-latn', { - months : 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split('_'), - monthsShort : 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'), - weekdays : 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split('_'), - weekdaysShort : 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'), - weekdaysMin : 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'D MMMM YYYY, dddd HH:mm' - }, - calendar : { - sameDay : '[Bugun soat] LT [da]', - nextDay : '[Ertaga] LT [da]', - nextWeek : 'dddd [kuni soat] LT [da]', - lastDay : '[Kecha soat] LT [da]', - lastWeek : '[O\'tgan] dddd [kuni soat] LT [da]', - sameElse : 'L' - }, - relativeTime : { - future : 'Yaqin %s ichida', - past : 'Bir necha %s oldin', - s : 'soniya', - ss : '%d soniya', - m : 'bir daqiqa', - mm : '%d daqiqa', - h : 'bir soat', - hh : '%d soat', - d : 'bir kun', - dd : '%d kun', - M : 'bir oy', - MM : '%d oy', - y : 'bir yil', - yy : '%d yil' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 7th is the first week of the year. - } - }); - - return uzLatn; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/uz.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/uz.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var uz = moment.defineLocale('uz', { - months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'), - monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), - weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'), - weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'), - weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'D MMMM YYYY, dddd HH:mm' - }, - calendar : { - sameDay : '[Бугун соат] LT [да]', - nextDay : '[Эртага] LT [да]', - nextWeek : 'dddd [куни соат] LT [да]', - lastDay : '[Кеча соат] LT [да]', - lastWeek : '[Утган] dddd [куни соат] LT [да]', - sameElse : 'L' - }, - relativeTime : { - future : 'Якин %s ичида', - past : 'Бир неча %s олдин', - s : 'фурсат', - ss : '%d фурсат', - m : 'бир дакика', - mm : '%d дакика', - h : 'бир соат', - hh : '%d соат', - d : 'бир кун', - dd : '%d кун', - M : 'бир ой', - MM : '%d ой', - y : 'бир йил', - yy : '%d йил' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 4th is the first week of the year. - } - }); - - return uz; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/vi.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/vi.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var vi = moment.defineLocale('vi', { - months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'), - monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'), - monthsParseExact : true, - weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'), - weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), - weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), - weekdaysParseExact : true, - meridiemParse: /sa|ch/i, - isPM : function (input) { - return /^ch$/i.test(input); - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 12) { - return isLower ? 'sa' : 'SA'; - } else { - return isLower ? 'ch' : 'CH'; - } - }, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM [năm] YYYY', - LLL : 'D MMMM [năm] YYYY HH:mm', - LLLL : 'dddd, D MMMM [năm] YYYY HH:mm', - l : 'DD/M/YYYY', - ll : 'D MMM YYYY', - lll : 'D MMM YYYY HH:mm', - llll : 'ddd, D MMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Hôm nay lúc] LT', - nextDay: '[Ngày mai lúc] LT', - nextWeek: 'dddd [tuần tới lúc] LT', - lastDay: '[Hôm qua lúc] LT', - lastWeek: 'dddd [tuần rồi lúc] LT', - sameElse: 'L' - }, - relativeTime : { - future : '%s tới', - past : '%s trước', - s : 'vài giây', - ss : '%d giây' , - m : 'một phút', - mm : '%d phút', - h : 'một giờ', - hh : '%d giờ', - d : 'một ngày', - dd : '%d ngày', - M : 'một tháng', - MM : '%d tháng', - y : 'một năm', - yy : '%d năm' - }, - dayOfMonthOrdinalParse: /\d{1,2}/, - ordinal : function (number) { - return number; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return vi; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/x-pseudo.js": -/*!************************************************!*\ - !*** ./node_modules/moment/locale/x-pseudo.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var xPseudo = moment.defineLocale('x-pseudo', { - months : 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split('_'), - monthsShort : 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split('_'), - monthsParseExact : true, - weekdays : 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split('_'), - weekdaysShort : 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'), - weekdaysMin : 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[T~ódá~ý át] LT', - nextDay : '[T~ómó~rró~w át] LT', - nextWeek : 'dddd [át] LT', - lastDay : '[Ý~ést~érdá~ý át] LT', - lastWeek : '[L~ást] dddd [át] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'í~ñ %s', - past : '%s á~gó', - s : 'á ~féw ~sécó~ñds', - ss : '%d s~écóñ~ds', - m : 'á ~míñ~úté', - mm : '%d m~íñú~tés', - h : 'á~ñ hó~úr', - hh : '%d h~óúrs', - d : 'á ~dáý', - dd : '%d d~áýs', - M : 'á ~móñ~th', - MM : '%d m~óñt~hs', - y : 'á ~ýéár', - yy : '%d ý~éárs' - }, - dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return xPseudo; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/yo.js": -/*!******************************************!*\ - !*** ./node_modules/moment/locale/yo.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var yo = moment.defineLocale('yo', { - months : 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split('_'), - monthsShort : 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'), - weekdays : 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'), - weekdaysShort : 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'), - weekdaysMin : 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'), - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY h:mm A', - LLLL : 'dddd, D MMMM YYYY h:mm A' - }, - calendar : { - sameDay : '[Ònì ni] LT', - nextDay : '[Ọ̀la ni] LT', - nextWeek : 'dddd [Ọsẹ̀ tón\'bọ] [ni] LT', - lastDay : '[Àna ni] LT', - lastWeek : 'dddd [Ọsẹ̀ tólọ́] [ni] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'ní %s', - past : '%s kọjá', - s : 'ìsẹjú aayá die', - ss :'aayá %d', - m : 'ìsẹjú kan', - mm : 'ìsẹjú %d', - h : 'wákati kan', - hh : 'wákati %d', - d : 'ọjọ́ kan', - dd : 'ọjọ́ %d', - M : 'osù kan', - MM : 'osù %d', - y : 'ọdún kan', - yy : 'ọdún %d' - }, - dayOfMonthOrdinalParse : /ọjọ́\s\d{1,2}/, - ordinal : 'ọjọ́ %d', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return yo; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/zh-cn.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/zh-cn.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var zhCn = moment.defineLocale('zh-cn', { - months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), - monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), - weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), - weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'), - weekdaysMin : '日_一_二_三_四_五_六'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY/MM/DD', - LL : 'YYYY年M月D日', - LLL : 'YYYY年M月D日Ah点mm分', - LLLL : 'YYYY年M月D日ddddAh点mm分', - l : 'YYYY/M/D', - ll : 'YYYY年M月D日', - lll : 'YYYY年M月D日 HH:mm', - llll : 'YYYY年M月D日dddd HH:mm' - }, - meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === '凌晨' || meridiem === '早上' || - meridiem === '上午') { - return hour; - } else if (meridiem === '下午' || meridiem === '晚上') { - return hour + 12; - } else { - // '中午' - return hour >= 11 ? hour : hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return '凌晨'; - } else if (hm < 900) { - return '早上'; - } else if (hm < 1130) { - return '上午'; - } else if (hm < 1230) { - return '中午'; - } else if (hm < 1800) { - return '下午'; - } else { - return '晚上'; - } - }, - calendar : { - sameDay : '[今天]LT', - nextDay : '[明天]LT', - nextWeek : '[下]ddddLT', - lastDay : '[昨天]LT', - lastWeek : '[上]ddddLT', - sameElse : 'L' - }, - dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/, - ordinal : function (number, period) { - switch (period) { - case 'd': - case 'D': - case 'DDD': - return number + '日'; - case 'M': - return number + '月'; - case 'w': - case 'W': - return number + '周'; - default: - return number; - } - }, - relativeTime : { - future : '%s内', - past : '%s前', - s : '几秒', - ss : '%d 秒', - m : '1 分钟', - mm : '%d 分钟', - h : '1 小时', - hh : '%d 小时', - d : '1 天', - dd : '%d 天', - M : '1 个月', - MM : '%d 个月', - y : '1 年', - yy : '%d 年' - }, - week : { - // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return zhCn; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/zh-hk.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/zh-hk.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var zhHk = moment.defineLocale('zh-hk', { - months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), - monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), - weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), - weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'), - weekdaysMin : '日_一_二_三_四_五_六'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY/MM/DD', - LL : 'YYYY年M月D日', - LLL : 'YYYY年M月D日 HH:mm', - LLLL : 'YYYY年M月D日dddd HH:mm', - l : 'YYYY/M/D', - ll : 'YYYY年M月D日', - lll : 'YYYY年M月D日 HH:mm', - llll : 'YYYY年M月D日dddd HH:mm' - }, - meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') { - return hour; - } else if (meridiem === '中午') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === '下午' || meridiem === '晚上') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return '凌晨'; - } else if (hm < 900) { - return '早上'; - } else if (hm < 1130) { - return '上午'; - } else if (hm < 1230) { - return '中午'; - } else if (hm < 1800) { - return '下午'; - } else { - return '晚上'; - } - }, - calendar : { - sameDay : '[今天]LT', - nextDay : '[明天]LT', - nextWeek : '[下]ddddLT', - lastDay : '[昨天]LT', - lastWeek : '[上]ddddLT', - sameElse : 'L' - }, - dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/, - ordinal : function (number, period) { - switch (period) { - case 'd' : - case 'D' : - case 'DDD' : - return number + '日'; - case 'M' : - return number + '月'; - case 'w' : - case 'W' : - return number + '週'; - default : - return number; - } - }, - relativeTime : { - future : '%s內', - past : '%s前', - s : '幾秒', - ss : '%d 秒', - m : '1 分鐘', - mm : '%d 分鐘', - h : '1 小時', - hh : '%d 小時', - d : '1 天', - dd : '%d 天', - M : '1 個月', - MM : '%d 個月', - y : '1 年', - yy : '%d 年' - } - }); - - return zhHk; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/locale/zh-tw.js": -/*!*********************************************!*\ - !*** ./node_modules/moment/locale/zh-tw.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -//! moment.js locale configuration - -;(function (global, factory) { - true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) : - undefined -}(this, (function (moment) { 'use strict'; - - - var zhTw = moment.defineLocale('zh-tw', { - months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), - monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), - weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), - weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'), - weekdaysMin : '日_一_二_三_四_五_六'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY/MM/DD', - LL : 'YYYY年M月D日', - LLL : 'YYYY年M月D日 HH:mm', - LLLL : 'YYYY年M月D日dddd HH:mm', - l : 'YYYY/M/D', - ll : 'YYYY年M月D日', - lll : 'YYYY年M月D日 HH:mm', - llll : 'YYYY年M月D日dddd HH:mm' - }, - meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') { - return hour; - } else if (meridiem === '中午') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === '下午' || meridiem === '晚上') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return '凌晨'; - } else if (hm < 900) { - return '早上'; - } else if (hm < 1130) { - return '上午'; - } else if (hm < 1230) { - return '中午'; - } else if (hm < 1800) { - return '下午'; - } else { - return '晚上'; - } - }, - calendar : { - sameDay : '[今天] LT', - nextDay : '[明天] LT', - nextWeek : '[下]dddd LT', - lastDay : '[昨天] LT', - lastWeek : '[上]dddd LT', - sameElse : 'L' - }, - dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/, - ordinal : function (number, period) { - switch (period) { - case 'd' : - case 'D' : - case 'DDD' : - return number + '日'; - case 'M' : - return number + '月'; - case 'w' : - case 'W' : - return number + '週'; - default : - return number; - } - }, - relativeTime : { - future : '%s內', - past : '%s前', - s : '幾秒', - ss : '%d 秒', - m : '1 分鐘', - mm : '%d 分鐘', - h : '1 小時', - hh : '%d 小時', - d : '1 天', - dd : '%d 天', - M : '1 個月', - MM : '%d 個月', - y : '1 年', - yy : '%d 年' - } - }); - - return zhTw; - -}))); - - -/***/ }), - -/***/ "./node_modules/moment/moment.js": -/*!***************************************!*\ - !*** ./node_modules/moment/moment.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js - -;(function (global, factory) { - true ? module.exports = factory() : - undefined -}(this, (function () { 'use strict'; - - var hookCallback; - - function hooks () { - return hookCallback.apply(null, arguments); - } - - // This is done to register the method called with moment() - // without creating circular dependencies. - function setHookCallback (callback) { - hookCallback = callback; - } - - function isArray(input) { - return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; - } - - function isObject(input) { - // IE8 will treat undefined and null as object if it wasn't for - // input != null - return input != null && Object.prototype.toString.call(input) === '[object Object]'; - } - - function isObjectEmpty(obj) { - if (Object.getOwnPropertyNames) { - return (Object.getOwnPropertyNames(obj).length === 0); - } else { - var k; - for (k in obj) { - if (obj.hasOwnProperty(k)) { - return false; - } - } - return true; - } - } - - function isUndefined(input) { - return input === void 0; - } - - function isNumber(input) { - return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]'; - } - - function isDate(input) { - return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; - } - - function map(arr, fn) { - var res = [], i; - for (i = 0; i < arr.length; ++i) { - res.push(fn(arr[i], i)); - } - return res; - } - - function hasOwnProp(a, b) { - return Object.prototype.hasOwnProperty.call(a, b); - } - - function extend(a, b) { - for (var i in b) { - if (hasOwnProp(b, i)) { - a[i] = b[i]; - } - } - - if (hasOwnProp(b, 'toString')) { - a.toString = b.toString; - } - - if (hasOwnProp(b, 'valueOf')) { - a.valueOf = b.valueOf; - } - - return a; - } - - function createUTC (input, format, locale, strict) { - return createLocalOrUTC(input, format, locale, strict, true).utc(); - } - - function defaultParsingFlags() { - // We need to deep clone this object. - return { - empty : false, - unusedTokens : [], - unusedInput : [], - overflow : -2, - charsLeftOver : 0, - nullInput : false, - invalidMonth : null, - invalidFormat : false, - userInvalidated : false, - iso : false, - parsedDateParts : [], - meridiem : null, - rfc2822 : false, - weekdayMismatch : false - }; - } - - function getParsingFlags(m) { - if (m._pf == null) { - m._pf = defaultParsingFlags(); - } - return m._pf; - } - - var some; - if (Array.prototype.some) { - some = Array.prototype.some; - } else { - some = function (fun) { - var t = Object(this); - var len = t.length >>> 0; - - for (var i = 0; i < len; i++) { - if (i in t && fun.call(this, t[i], i, t)) { - return true; - } - } - - return false; - }; - } - - function isValid(m) { - if (m._isValid == null) { - var flags = getParsingFlags(m); - var parsedParts = some.call(flags.parsedDateParts, function (i) { - return i != null; - }); - var isNowValid = !isNaN(m._d.getTime()) && - flags.overflow < 0 && - !flags.empty && - !flags.invalidMonth && - !flags.invalidWeekday && - !flags.weekdayMismatch && - !flags.nullInput && - !flags.invalidFormat && - !flags.userInvalidated && - (!flags.meridiem || (flags.meridiem && parsedParts)); - - if (m._strict) { - isNowValid = isNowValid && - flags.charsLeftOver === 0 && - flags.unusedTokens.length === 0 && - flags.bigHour === undefined; - } - - if (Object.isFrozen == null || !Object.isFrozen(m)) { - m._isValid = isNowValid; - } - else { - return isNowValid; - } - } - return m._isValid; - } - - function createInvalid (flags) { - var m = createUTC(NaN); - if (flags != null) { - extend(getParsingFlags(m), flags); - } - else { - getParsingFlags(m).userInvalidated = true; - } - - return m; - } - - // Plugins that add properties should also add the key here (null value), - // so we can properly clone ourselves. - var momentProperties = hooks.momentProperties = []; - - function copyConfig(to, from) { - var i, prop, val; - - if (!isUndefined(from._isAMomentObject)) { - to._isAMomentObject = from._isAMomentObject; - } - if (!isUndefined(from._i)) { - to._i = from._i; - } - if (!isUndefined(from._f)) { - to._f = from._f; - } - if (!isUndefined(from._l)) { - to._l = from._l; - } - if (!isUndefined(from._strict)) { - to._strict = from._strict; - } - if (!isUndefined(from._tzm)) { - to._tzm = from._tzm; - } - if (!isUndefined(from._isUTC)) { - to._isUTC = from._isUTC; - } - if (!isUndefined(from._offset)) { - to._offset = from._offset; - } - if (!isUndefined(from._pf)) { - to._pf = getParsingFlags(from); - } - if (!isUndefined(from._locale)) { - to._locale = from._locale; - } - - if (momentProperties.length > 0) { - for (i = 0; i < momentProperties.length; i++) { - prop = momentProperties[i]; - val = from[prop]; - if (!isUndefined(val)) { - to[prop] = val; - } - } - } - - return to; - } - - var updateInProgress = false; - - // Moment prototype object - function Moment(config) { - copyConfig(this, config); - this._d = new Date(config._d != null ? config._d.getTime() : NaN); - if (!this.isValid()) { - this._d = new Date(NaN); - } - // Prevent infinite loop in case updateOffset creates new moment - // objects. - if (updateInProgress === false) { - updateInProgress = true; - hooks.updateOffset(this); - updateInProgress = false; - } - } - - function isMoment (obj) { - return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); - } - - function absFloor (number) { - if (number < 0) { - // -0 -> 0 - return Math.ceil(number) || 0; - } else { - return Math.floor(number); - } - } - - function toInt(argumentForCoercion) { - var coercedNumber = +argumentForCoercion, - value = 0; - - if (coercedNumber !== 0 && isFinite(coercedNumber)) { - value = absFloor(coercedNumber); - } - - return value; - } - - // compare two arrays, return the number of differences - function compareArrays(array1, array2, dontConvert) { - var len = Math.min(array1.length, array2.length), - lengthDiff = Math.abs(array1.length - array2.length), - diffs = 0, - i; - for (i = 0; i < len; i++) { - if ((dontConvert && array1[i] !== array2[i]) || - (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { - diffs++; - } - } - return diffs + lengthDiff; - } - - function warn(msg) { - if (hooks.suppressDeprecationWarnings === false && - (typeof console !== 'undefined') && console.warn) { - console.warn('Deprecation warning: ' + msg); - } - } - - function deprecate(msg, fn) { - var firstTime = true; - - return extend(function () { - if (hooks.deprecationHandler != null) { - hooks.deprecationHandler(null, msg); - } - if (firstTime) { - var args = []; - var arg; - for (var i = 0; i < arguments.length; i++) { - arg = ''; - if (typeof arguments[i] === 'object') { - arg += '\n[' + i + '] '; - for (var key in arguments[0]) { - arg += key + ': ' + arguments[0][key] + ', '; - } - arg = arg.slice(0, -2); // Remove trailing comma and space - } else { - arg = arguments[i]; - } - args.push(arg); - } - warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack); - firstTime = false; - } - return fn.apply(this, arguments); - }, fn); - } - - var deprecations = {}; - - function deprecateSimple(name, msg) { - if (hooks.deprecationHandler != null) { - hooks.deprecationHandler(name, msg); - } - if (!deprecations[name]) { - warn(msg); - deprecations[name] = true; - } - } - - hooks.suppressDeprecationWarnings = false; - hooks.deprecationHandler = null; - - function isFunction(input) { - return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; - } - - function set (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (isFunction(prop)) { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - this._config = config; - // Lenient ordinal parsing accepts just a number in addition to - // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. - // TODO: Remove "ordinalParse" fallback in next major release. - this._dayOfMonthOrdinalParseLenient = new RegExp( - (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + - '|' + (/\d{1,2}/).source); - } - - function mergeConfigs(parentConfig, childConfig) { - var res = extend({}, parentConfig), prop; - for (prop in childConfig) { - if (hasOwnProp(childConfig, prop)) { - if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { - res[prop] = {}; - extend(res[prop], parentConfig[prop]); - extend(res[prop], childConfig[prop]); - } else if (childConfig[prop] != null) { - res[prop] = childConfig[prop]; - } else { - delete res[prop]; - } - } - } - for (prop in parentConfig) { - if (hasOwnProp(parentConfig, prop) && - !hasOwnProp(childConfig, prop) && - isObject(parentConfig[prop])) { - // make sure changes to properties don't modify parent config - res[prop] = extend({}, res[prop]); - } - } - return res; - } - - function Locale(config) { - if (config != null) { - this.set(config); - } - } - - var keys; - - if (Object.keys) { - keys = Object.keys; - } else { - keys = function (obj) { - var i, res = []; - for (i in obj) { - if (hasOwnProp(obj, i)) { - res.push(i); - } - } - return res; - }; - } - - var defaultCalendar = { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }; - - function calendar (key, mom, now) { - var output = this._calendar[key] || this._calendar['sameElse']; - return isFunction(output) ? output.call(mom, now) : output; - } - - var defaultLongDateFormat = { - LTS : 'h:mm:ss A', - LT : 'h:mm A', - L : 'MM/DD/YYYY', - LL : 'MMMM D, YYYY', - LLL : 'MMMM D, YYYY h:mm A', - LLLL : 'dddd, MMMM D, YYYY h:mm A' - }; - - function longDateFormat (key) { - var format = this._longDateFormat[key], - formatUpper = this._longDateFormat[key.toUpperCase()]; - - if (format || !formatUpper) { - return format; - } - - this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) { - return val.slice(1); - }); - - return this._longDateFormat[key]; - } - - var defaultInvalidDate = 'Invalid date'; - - function invalidDate () { - return this._invalidDate; - } - - var defaultOrdinal = '%d'; - var defaultDayOfMonthOrdinalParse = /\d{1,2}/; - - function ordinal (number) { - return this._ordinal.replace('%d', number); - } - - var defaultRelativeTime = { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - ss : '%d seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }; - - function relativeTime (number, withoutSuffix, string, isFuture) { - var output = this._relativeTime[string]; - return (isFunction(output)) ? - output(number, withoutSuffix, string, isFuture) : - output.replace(/%d/i, number); - } - - function pastFuture (diff, output) { - var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return isFunction(format) ? format(output) : format.replace(/%s/i, output); - } - - var aliases = {}; - - function addUnitAlias (unit, shorthand) { - var lowerCase = unit.toLowerCase(); - aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; - } - - function normalizeUnits(units) { - return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; - } - - function normalizeObjectUnits(inputObject) { - var normalizedInput = {}, - normalizedProp, - prop; - - for (prop in inputObject) { - if (hasOwnProp(inputObject, prop)) { - normalizedProp = normalizeUnits(prop); - if (normalizedProp) { - normalizedInput[normalizedProp] = inputObject[prop]; - } - } - } - - return normalizedInput; - } - - var priorities = {}; - - function addUnitPriority(unit, priority) { - priorities[unit] = priority; - } - - function getPrioritizedUnits(unitsObj) { - var units = []; - for (var u in unitsObj) { - units.push({unit: u, priority: priorities[u]}); - } - units.sort(function (a, b) { - return a.priority - b.priority; - }); - return units; - } - - function zeroFill(number, targetLength, forceSign) { - var absNumber = '' + Math.abs(number), - zerosToFill = targetLength - absNumber.length, - sign = number >= 0; - return (sign ? (forceSign ? '+' : '') : '-') + - Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; - } - - var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; - - var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; - - var formatFunctions = {}; - - var formatTokenFunctions = {}; - - // token: 'M' - // padded: ['MM', 2] - // ordinal: 'Mo' - // callback: function () { this.month() + 1 } - function addFormatToken (token, padded, ordinal, callback) { - var func = callback; - if (typeof callback === 'string') { - func = function () { - return this[callback](); - }; - } - if (token) { - formatTokenFunctions[token] = func; - } - if (padded) { - formatTokenFunctions[padded[0]] = function () { - return zeroFill(func.apply(this, arguments), padded[1], padded[2]); - }; - } - if (ordinal) { - formatTokenFunctions[ordinal] = function () { - return this.localeData().ordinal(func.apply(this, arguments), token); - }; - } - } - - function removeFormattingTokens(input) { - if (input.match(/\[[\s\S]/)) { - return input.replace(/^\[|\]$/g, ''); - } - return input.replace(/\\/g, ''); - } - - function makeFormatFunction(format) { - var array = format.match(formattingTokens), i, length; - - for (i = 0, length = array.length; i < length; i++) { - if (formatTokenFunctions[array[i]]) { - array[i] = formatTokenFunctions[array[i]]; - } else { - array[i] = removeFormattingTokens(array[i]); - } - } - - return function (mom) { - var output = '', i; - for (i = 0; i < length; i++) { - output += isFunction(array[i]) ? array[i].call(mom, format) : array[i]; - } - return output; - }; - } - - // format date using native date object - function formatMoment(m, format) { - if (!m.isValid()) { - return m.localeData().invalidDate(); - } - - format = expandFormat(format, m.localeData()); - formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); - - return formatFunctions[format](m); - } - - function expandFormat(format, locale) { - var i = 5; - - function replaceLongDateFormatTokens(input) { - return locale.longDateFormat(input) || input; - } - - localFormattingTokens.lastIndex = 0; - while (i >= 0 && localFormattingTokens.test(format)) { - format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); - localFormattingTokens.lastIndex = 0; - i -= 1; - } - - return format; - } - - var match1 = /\d/; // 0 - 9 - var match2 = /\d\d/; // 00 - 99 - var match3 = /\d{3}/; // 000 - 999 - var match4 = /\d{4}/; // 0000 - 9999 - var match6 = /[+-]?\d{6}/; // -999999 - 999999 - var match1to2 = /\d\d?/; // 0 - 99 - var match3to4 = /\d\d\d\d?/; // 999 - 9999 - var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 - var match1to3 = /\d{1,3}/; // 0 - 999 - var match1to4 = /\d{1,4}/; // 0 - 9999 - var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 - - var matchUnsigned = /\d+/; // 0 - inf - var matchSigned = /[+-]?\d+/; // -inf - inf - - var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z - var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z - - var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 - - // any word (or two) characters or numbers including two/three word month in arabic. - // includes scottish gaelic two word and hyphenated months - var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i; - - var regexes = {}; - - function addRegexToken (token, regex, strictRegex) { - regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { - return (isStrict && strictRegex) ? strictRegex : regex; - }; - } - - function getParseRegexForToken (token, config) { - if (!hasOwnProp(regexes, token)) { - return new RegExp(unescapeFormat(token)); - } - - return regexes[token](config._strict, config._locale); - } - - // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript - function unescapeFormat(s) { - return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { - return p1 || p2 || p3 || p4; - })); - } - - function regexEscape(s) { - return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); - } - - var tokens = {}; - - function addParseToken (token, callback) { - var i, func = callback; - if (typeof token === 'string') { - token = [token]; - } - if (isNumber(callback)) { - func = function (input, array) { - array[callback] = toInt(input); - }; - } - for (i = 0; i < token.length; i++) { - tokens[token[i]] = func; - } - } - - function addWeekParseToken (token, callback) { - addParseToken(token, function (input, array, config, token) { - config._w = config._w || {}; - callback(input, config._w, config, token); - }); - } - - function addTimeToArrayFromToken(token, input, config) { - if (input != null && hasOwnProp(tokens, token)) { - tokens[token](input, config._a, config, token); - } - } - - var YEAR = 0; - var MONTH = 1; - var DATE = 2; - var HOUR = 3; - var MINUTE = 4; - var SECOND = 5; - var MILLISECOND = 6; - var WEEK = 7; - var WEEKDAY = 8; - - // FORMATTING - - addFormatToken('Y', 0, 0, function () { - var y = this.year(); - return y <= 9999 ? '' + y : '+' + y; - }); - - addFormatToken(0, ['YY', 2], 0, function () { - return this.year() % 100; - }); - - addFormatToken(0, ['YYYY', 4], 0, 'year'); - addFormatToken(0, ['YYYYY', 5], 0, 'year'); - addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); - - // ALIASES - - addUnitAlias('year', 'y'); - - // PRIORITIES - - addUnitPriority('year', 1); - - // PARSING - - addRegexToken('Y', matchSigned); - addRegexToken('YY', match1to2, match2); - addRegexToken('YYYY', match1to4, match4); - addRegexToken('YYYYY', match1to6, match6); - addRegexToken('YYYYYY', match1to6, match6); - - addParseToken(['YYYYY', 'YYYYYY'], YEAR); - addParseToken('YYYY', function (input, array) { - array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); - }); - addParseToken('YY', function (input, array) { - array[YEAR] = hooks.parseTwoDigitYear(input); - }); - addParseToken('Y', function (input, array) { - array[YEAR] = parseInt(input, 10); - }); - - // HELPERS - - function daysInYear(year) { - return isLeapYear(year) ? 366 : 365; - } - - function isLeapYear(year) { - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; - } - - // HOOKS - - hooks.parseTwoDigitYear = function (input) { - return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); - }; - - // MOMENTS - - var getSetYear = makeGetSet('FullYear', true); - - function getIsLeapYear () { - return isLeapYear(this.year()); - } - - function makeGetSet (unit, keepTime) { - return function (value) { - if (value != null) { - set$1(this, unit, value); - hooks.updateOffset(this, keepTime); - return this; - } else { - return get(this, unit); - } - }; - } - - function get (mom, unit) { - return mom.isValid() ? - mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; - } - - function set$1 (mom, unit, value) { - if (mom.isValid() && !isNaN(value)) { - if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) { - mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month())); - } - else { - mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); - } - } - } - - // MOMENTS - - function stringGet (units) { - units = normalizeUnits(units); - if (isFunction(this[units])) { - return this[units](); - } - return this; - } - - - function stringSet (units, value) { - if (typeof units === 'object') { - units = normalizeObjectUnits(units); - var prioritized = getPrioritizedUnits(units); - for (var i = 0; i < prioritized.length; i++) { - this[prioritized[i].unit](units[prioritized[i].unit]); - } - } else { - units = normalizeUnits(units); - if (isFunction(this[units])) { - return this[units](value); - } - } - return this; - } - - function mod(n, x) { - return ((n % x) + x) % x; - } - - var indexOf; - - if (Array.prototype.indexOf) { - indexOf = Array.prototype.indexOf; - } else { - indexOf = function (o) { - // I know - var i; - for (i = 0; i < this.length; ++i) { - if (this[i] === o) { - return i; - } - } - return -1; - }; - } - - function daysInMonth(year, month) { - if (isNaN(year) || isNaN(month)) { - return NaN; - } - var modMonth = mod(month, 12); - year += (month - modMonth) / 12; - return modMonth === 1 ? (isLeapYear(year) ? 29 : 28) : (31 - modMonth % 7 % 2); - } - - // FORMATTING - - addFormatToken('M', ['MM', 2], 'Mo', function () { - return this.month() + 1; - }); - - addFormatToken('MMM', 0, 0, function (format) { - return this.localeData().monthsShort(this, format); - }); - - addFormatToken('MMMM', 0, 0, function (format) { - return this.localeData().months(this, format); - }); - - // ALIASES - - addUnitAlias('month', 'M'); - - // PRIORITY - - addUnitPriority('month', 8); - - // PARSING - - addRegexToken('M', match1to2); - addRegexToken('MM', match1to2, match2); - addRegexToken('MMM', function (isStrict, locale) { - return locale.monthsShortRegex(isStrict); - }); - addRegexToken('MMMM', function (isStrict, locale) { - return locale.monthsRegex(isStrict); - }); - - addParseToken(['M', 'MM'], function (input, array) { - array[MONTH] = toInt(input) - 1; - }); - - addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { - var month = config._locale.monthsParse(input, token, config._strict); - // if we didn't find a month name, mark the date as invalid. - if (month != null) { - array[MONTH] = month; - } else { - getParsingFlags(config).invalidMonth = input; - } - }); - - // LOCALES - - var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/; - var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); - function localeMonths (m, format) { - if (!m) { - return isArray(this._months) ? this._months : - this._months['standalone']; - } - return isArray(this._months) ? this._months[m.month()] : - this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()]; - } - - var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); - function localeMonthsShort (m, format) { - if (!m) { - return isArray(this._monthsShort) ? this._monthsShort : - this._monthsShort['standalone']; - } - return isArray(this._monthsShort) ? this._monthsShort[m.month()] : - this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; - } - - function handleStrictParse(monthName, format, strict) { - var i, ii, mom, llc = monthName.toLocaleLowerCase(); - if (!this._monthsParse) { - // this is not used - this._monthsParse = []; - this._longMonthsParse = []; - this._shortMonthsParse = []; - for (i = 0; i < 12; ++i) { - mom = createUTC([2000, i]); - this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase(); - this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); - } - } - - if (strict) { - if (format === 'MMM') { - ii = indexOf.call(this._shortMonthsParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._longMonthsParse, llc); - return ii !== -1 ? ii : null; - } - } else { - if (format === 'MMM') { - ii = indexOf.call(this._shortMonthsParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._longMonthsParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._longMonthsParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._shortMonthsParse, llc); - return ii !== -1 ? ii : null; - } - } - } - - function localeMonthsParse (monthName, format, strict) { - var i, mom, regex; - - if (this._monthsParseExact) { - return handleStrictParse.call(this, monthName, format, strict); - } - - if (!this._monthsParse) { - this._monthsParse = []; - this._longMonthsParse = []; - this._shortMonthsParse = []; - } - - // TODO: add sorting - // Sorting makes sure if one month (or abbr) is a prefix of another - // see sorting in computeMonthsParse - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - mom = createUTC([2000, i]); - if (strict && !this._longMonthsParse[i]) { - this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); - this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); - } - if (!strict && !this._monthsParse[i]) { - regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); - this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { - return i; - } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { - return i; - } else if (!strict && this._monthsParse[i].test(monthName)) { - return i; - } - } - } - - // MOMENTS - - function setMonth (mom, value) { - var dayOfMonth; - - if (!mom.isValid()) { - // No op - return mom; - } - - if (typeof value === 'string') { - if (/^\d+$/.test(value)) { - value = toInt(value); - } else { - value = mom.localeData().monthsParse(value); - // TODO: Another silent failure? - if (!isNumber(value)) { - return mom; - } - } - } - - dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); - mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); - return mom; - } - - function getSetMonth (value) { - if (value != null) { - setMonth(this, value); - hooks.updateOffset(this, true); - return this; - } else { - return get(this, 'Month'); - } - } - - function getDaysInMonth () { - return daysInMonth(this.year(), this.month()); - } - - var defaultMonthsShortRegex = matchWord; - function monthsShortRegex (isStrict) { - if (this._monthsParseExact) { - if (!hasOwnProp(this, '_monthsRegex')) { - computeMonthsParse.call(this); - } - if (isStrict) { - return this._monthsShortStrictRegex; - } else { - return this._monthsShortRegex; - } - } else { - if (!hasOwnProp(this, '_monthsShortRegex')) { - this._monthsShortRegex = defaultMonthsShortRegex; - } - return this._monthsShortStrictRegex && isStrict ? - this._monthsShortStrictRegex : this._monthsShortRegex; - } - } - - var defaultMonthsRegex = matchWord; - function monthsRegex (isStrict) { - if (this._monthsParseExact) { - if (!hasOwnProp(this, '_monthsRegex')) { - computeMonthsParse.call(this); - } - if (isStrict) { - return this._monthsStrictRegex; - } else { - return this._monthsRegex; - } - } else { - if (!hasOwnProp(this, '_monthsRegex')) { - this._monthsRegex = defaultMonthsRegex; - } - return this._monthsStrictRegex && isStrict ? - this._monthsStrictRegex : this._monthsRegex; - } - } - - function computeMonthsParse () { - function cmpLenRev(a, b) { - return b.length - a.length; - } - - var shortPieces = [], longPieces = [], mixedPieces = [], - i, mom; - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - mom = createUTC([2000, i]); - shortPieces.push(this.monthsShort(mom, '')); - longPieces.push(this.months(mom, '')); - mixedPieces.push(this.months(mom, '')); - mixedPieces.push(this.monthsShort(mom, '')); - } - // Sorting makes sure if one month (or abbr) is a prefix of another it - // will match the longer piece. - shortPieces.sort(cmpLenRev); - longPieces.sort(cmpLenRev); - mixedPieces.sort(cmpLenRev); - for (i = 0; i < 12; i++) { - shortPieces[i] = regexEscape(shortPieces[i]); - longPieces[i] = regexEscape(longPieces[i]); - } - for (i = 0; i < 24; i++) { - mixedPieces[i] = regexEscape(mixedPieces[i]); - } - - this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); - this._monthsShortRegex = this._monthsRegex; - this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); - this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); - } - - function createDate (y, m, d, h, M, s, ms) { - // can't just apply() to create a date: - // https://stackoverflow.com/q/181348 - var date; - // the date constructor remaps years 0-99 to 1900-1999 - if (y < 100 && y >= 0) { - // preserve leap years using a full 400 year cycle, then reset - date = new Date(y + 400, m, d, h, M, s, ms); - if (isFinite(date.getFullYear())) { - date.setFullYear(y); - } - } else { - date = new Date(y, m, d, h, M, s, ms); - } - - return date; - } - - function createUTCDate (y) { - var date; - // the Date.UTC function remaps years 0-99 to 1900-1999 - if (y < 100 && y >= 0) { - var args = Array.prototype.slice.call(arguments); - // preserve leap years using a full 400 year cycle, then reset - args[0] = y + 400; - date = new Date(Date.UTC.apply(null, args)); - if (isFinite(date.getUTCFullYear())) { - date.setUTCFullYear(y); - } - } else { - date = new Date(Date.UTC.apply(null, arguments)); - } - - return date; - } - - // start-of-first-week - start-of-year - function firstWeekOffset(year, dow, doy) { - var // first-week day -- which january is always in the first week (4 for iso, 1 for other) - fwd = 7 + dow - doy, - // first-week day local weekday -- which local weekday is fwd - fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; - - return -fwdlw + fwd - 1; - } - - // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, dow, doy) { - var localWeekday = (7 + weekday - dow) % 7, - weekOffset = firstWeekOffset(year, dow, doy), - dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, - resYear, resDayOfYear; - - if (dayOfYear <= 0) { - resYear = year - 1; - resDayOfYear = daysInYear(resYear) + dayOfYear; - } else if (dayOfYear > daysInYear(year)) { - resYear = year + 1; - resDayOfYear = dayOfYear - daysInYear(year); - } else { - resYear = year; - resDayOfYear = dayOfYear; - } - - return { - year: resYear, - dayOfYear: resDayOfYear - }; - } - - function weekOfYear(mom, dow, doy) { - var weekOffset = firstWeekOffset(mom.year(), dow, doy), - week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, - resWeek, resYear; - - if (week < 1) { - resYear = mom.year() - 1; - resWeek = week + weeksInYear(resYear, dow, doy); - } else if (week > weeksInYear(mom.year(), dow, doy)) { - resWeek = week - weeksInYear(mom.year(), dow, doy); - resYear = mom.year() + 1; - } else { - resYear = mom.year(); - resWeek = week; - } - - return { - week: resWeek, - year: resYear - }; - } - - function weeksInYear(year, dow, doy) { - var weekOffset = firstWeekOffset(year, dow, doy), - weekOffsetNext = firstWeekOffset(year + 1, dow, doy); - return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; - } - - // FORMATTING - - addFormatToken('w', ['ww', 2], 'wo', 'week'); - addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); - - // ALIASES - - addUnitAlias('week', 'w'); - addUnitAlias('isoWeek', 'W'); - - // PRIORITIES - - addUnitPriority('week', 5); - addUnitPriority('isoWeek', 5); - - // PARSING - - addRegexToken('w', match1to2); - addRegexToken('ww', match1to2, match2); - addRegexToken('W', match1to2); - addRegexToken('WW', match1to2, match2); - - addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { - week[token.substr(0, 1)] = toInt(input); - }); - - // HELPERS - - // LOCALES - - function localeWeek (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - } - - var defaultLocaleWeek = { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 6th is the first week of the year. - }; - - function localeFirstDayOfWeek () { - return this._week.dow; - } - - function localeFirstDayOfYear () { - return this._week.doy; - } - - // MOMENTS - - function getSetWeek (input) { - var week = this.localeData().week(this); - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - function getSetISOWeek (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - // FORMATTING - - addFormatToken('d', 0, 'do', 'day'); - - addFormatToken('dd', 0, 0, function (format) { - return this.localeData().weekdaysMin(this, format); - }); - - addFormatToken('ddd', 0, 0, function (format) { - return this.localeData().weekdaysShort(this, format); - }); - - addFormatToken('dddd', 0, 0, function (format) { - return this.localeData().weekdays(this, format); - }); - - addFormatToken('e', 0, 0, 'weekday'); - addFormatToken('E', 0, 0, 'isoWeekday'); - - // ALIASES - - addUnitAlias('day', 'd'); - addUnitAlias('weekday', 'e'); - addUnitAlias('isoWeekday', 'E'); - - // PRIORITY - addUnitPriority('day', 11); - addUnitPriority('weekday', 11); - addUnitPriority('isoWeekday', 11); - - // PARSING - - addRegexToken('d', match1to2); - addRegexToken('e', match1to2); - addRegexToken('E', match1to2); - addRegexToken('dd', function (isStrict, locale) { - return locale.weekdaysMinRegex(isStrict); - }); - addRegexToken('ddd', function (isStrict, locale) { - return locale.weekdaysShortRegex(isStrict); - }); - addRegexToken('dddd', function (isStrict, locale) { - return locale.weekdaysRegex(isStrict); - }); - - addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { - var weekday = config._locale.weekdaysParse(input, token, config._strict); - // if we didn't get a weekday name, mark the date as invalid - if (weekday != null) { - week.d = weekday; - } else { - getParsingFlags(config).invalidWeekday = input; - } - }); - - addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { - week[token] = toInt(input); - }); - - // HELPERS - - function parseWeekday(input, locale) { - if (typeof input !== 'string') { - return input; - } - - if (!isNaN(input)) { - return parseInt(input, 10); - } - - input = locale.weekdaysParse(input); - if (typeof input === 'number') { - return input; - } - - return null; - } - - function parseIsoWeekday(input, locale) { - if (typeof input === 'string') { - return locale.weekdaysParse(input) % 7 || 7; - } - return isNaN(input) ? null : input; - } - - // LOCALES - function shiftWeekdays (ws, n) { - return ws.slice(n, 7).concat(ws.slice(0, n)); - } - - var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); - function localeWeekdays (m, format) { - var weekdays = isArray(this._weekdays) ? this._weekdays : - this._weekdays[(m && m !== true && this._weekdays.isFormat.test(format)) ? 'format' : 'standalone']; - return (m === true) ? shiftWeekdays(weekdays, this._week.dow) - : (m) ? weekdays[m.day()] : weekdays; - } - - var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); - function localeWeekdaysShort (m) { - return (m === true) ? shiftWeekdays(this._weekdaysShort, this._week.dow) - : (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort; - } - - var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); - function localeWeekdaysMin (m) { - return (m === true) ? shiftWeekdays(this._weekdaysMin, this._week.dow) - : (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin; - } - - function handleStrictParse$1(weekdayName, format, strict) { - var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); - if (!this._weekdaysParse) { - this._weekdaysParse = []; - this._shortWeekdaysParse = []; - this._minWeekdaysParse = []; - - for (i = 0; i < 7; ++i) { - mom = createUTC([2000, 1]).day(i); - this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase(); - this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase(); - this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); - } - } - - if (strict) { - if (format === 'dddd') { - ii = indexOf.call(this._weekdaysParse, llc); - return ii !== -1 ? ii : null; - } else if (format === 'ddd') { - ii = indexOf.call(this._shortWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._minWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } - } else { - if (format === 'dddd') { - ii = indexOf.call(this._weekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._shortWeekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._minWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } else if (format === 'ddd') { - ii = indexOf.call(this._shortWeekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._weekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._minWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } else { - ii = indexOf.call(this._minWeekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._weekdaysParse, llc); - if (ii !== -1) { - return ii; - } - ii = indexOf.call(this._shortWeekdaysParse, llc); - return ii !== -1 ? ii : null; - } - } - } - - function localeWeekdaysParse (weekdayName, format, strict) { - var i, mom, regex; - - if (this._weekdaysParseExact) { - return handleStrictParse$1.call(this, weekdayName, format, strict); - } - - if (!this._weekdaysParse) { - this._weekdaysParse = []; - this._minWeekdaysParse = []; - this._shortWeekdaysParse = []; - this._fullWeekdaysParse = []; - } - - for (i = 0; i < 7; i++) { - // make the regex if we don't have it already - - mom = createUTC([2000, 1]).day(i); - if (strict && !this._fullWeekdaysParse[i]) { - this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i'); - this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i'); - this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i'); - } - if (!this._weekdaysParse[i]) { - regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); - this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { - return i; - } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { - return i; - } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { - return i; - } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { - return i; - } - } - } - - // MOMENTS - - function getSetDayOfWeek (input) { - if (!this.isValid()) { - return input != null ? this : NaN; - } - var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); - if (input != null) { - input = parseWeekday(input, this.localeData()); - return this.add(input - day, 'd'); - } else { - return day; - } - } - - function getSetLocaleDayOfWeek (input) { - if (!this.isValid()) { - return input != null ? this : NaN; - } - var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; - return input == null ? weekday : this.add(input - weekday, 'd'); - } - - function getSetISODayOfWeek (input) { - if (!this.isValid()) { - return input != null ? this : NaN; - } - - // behaves the same as moment#day except - // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) - // as a setter, sunday should belong to the previous week. - - if (input != null) { - var weekday = parseIsoWeekday(input, this.localeData()); - return this.day(this.day() % 7 ? weekday : weekday - 7); - } else { - return this.day() || 7; - } - } - - var defaultWeekdaysRegex = matchWord; - function weekdaysRegex (isStrict) { - if (this._weekdaysParseExact) { - if (!hasOwnProp(this, '_weekdaysRegex')) { - computeWeekdaysParse.call(this); - } - if (isStrict) { - return this._weekdaysStrictRegex; - } else { - return this._weekdaysRegex; - } - } else { - if (!hasOwnProp(this, '_weekdaysRegex')) { - this._weekdaysRegex = defaultWeekdaysRegex; - } - return this._weekdaysStrictRegex && isStrict ? - this._weekdaysStrictRegex : this._weekdaysRegex; - } - } - - var defaultWeekdaysShortRegex = matchWord; - function weekdaysShortRegex (isStrict) { - if (this._weekdaysParseExact) { - if (!hasOwnProp(this, '_weekdaysRegex')) { - computeWeekdaysParse.call(this); - } - if (isStrict) { - return this._weekdaysShortStrictRegex; - } else { - return this._weekdaysShortRegex; - } - } else { - if (!hasOwnProp(this, '_weekdaysShortRegex')) { - this._weekdaysShortRegex = defaultWeekdaysShortRegex; - } - return this._weekdaysShortStrictRegex && isStrict ? - this._weekdaysShortStrictRegex : this._weekdaysShortRegex; - } - } - - var defaultWeekdaysMinRegex = matchWord; - function weekdaysMinRegex (isStrict) { - if (this._weekdaysParseExact) { - if (!hasOwnProp(this, '_weekdaysRegex')) { - computeWeekdaysParse.call(this); - } - if (isStrict) { - return this._weekdaysMinStrictRegex; - } else { - return this._weekdaysMinRegex; - } - } else { - if (!hasOwnProp(this, '_weekdaysMinRegex')) { - this._weekdaysMinRegex = defaultWeekdaysMinRegex; - } - return this._weekdaysMinStrictRegex && isStrict ? - this._weekdaysMinStrictRegex : this._weekdaysMinRegex; - } - } - - - function computeWeekdaysParse () { - function cmpLenRev(a, b) { - return b.length - a.length; - } - - var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], - i, mom, minp, shortp, longp; - for (i = 0; i < 7; i++) { - // make the regex if we don't have it already - mom = createUTC([2000, 1]).day(i); - minp = this.weekdaysMin(mom, ''); - shortp = this.weekdaysShort(mom, ''); - longp = this.weekdays(mom, ''); - minPieces.push(minp); - shortPieces.push(shortp); - longPieces.push(longp); - mixedPieces.push(minp); - mixedPieces.push(shortp); - mixedPieces.push(longp); - } - // Sorting makes sure if one weekday (or abbr) is a prefix of another it - // will match the longer piece. - minPieces.sort(cmpLenRev); - shortPieces.sort(cmpLenRev); - longPieces.sort(cmpLenRev); - mixedPieces.sort(cmpLenRev); - for (i = 0; i < 7; i++) { - shortPieces[i] = regexEscape(shortPieces[i]); - longPieces[i] = regexEscape(longPieces[i]); - mixedPieces[i] = regexEscape(mixedPieces[i]); - } - - this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); - this._weekdaysShortRegex = this._weekdaysRegex; - this._weekdaysMinRegex = this._weekdaysRegex; - - this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); - this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); - this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i'); - } - - // FORMATTING - - function hFormat() { - return this.hours() % 12 || 12; - } - - function kFormat() { - return this.hours() || 24; - } - - addFormatToken('H', ['HH', 2], 0, 'hour'); - addFormatToken('h', ['hh', 2], 0, hFormat); - addFormatToken('k', ['kk', 2], 0, kFormat); - - addFormatToken('hmm', 0, 0, function () { - return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); - }); - - addFormatToken('hmmss', 0, 0, function () { - return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + - zeroFill(this.seconds(), 2); - }); - - addFormatToken('Hmm', 0, 0, function () { - return '' + this.hours() + zeroFill(this.minutes(), 2); - }); - - addFormatToken('Hmmss', 0, 0, function () { - return '' + this.hours() + zeroFill(this.minutes(), 2) + - zeroFill(this.seconds(), 2); - }); - - function meridiem (token, lowercase) { - addFormatToken(token, 0, 0, function () { - return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); - }); - } - - meridiem('a', true); - meridiem('A', false); - - // ALIASES - - addUnitAlias('hour', 'h'); - - // PRIORITY - addUnitPriority('hour', 13); - - // PARSING - - function matchMeridiem (isStrict, locale) { - return locale._meridiemParse; - } - - addRegexToken('a', matchMeridiem); - addRegexToken('A', matchMeridiem); - addRegexToken('H', match1to2); - addRegexToken('h', match1to2); - addRegexToken('k', match1to2); - addRegexToken('HH', match1to2, match2); - addRegexToken('hh', match1to2, match2); - addRegexToken('kk', match1to2, match2); - - addRegexToken('hmm', match3to4); - addRegexToken('hmmss', match5to6); - addRegexToken('Hmm', match3to4); - addRegexToken('Hmmss', match5to6); - - addParseToken(['H', 'HH'], HOUR); - addParseToken(['k', 'kk'], function (input, array, config) { - var kInput = toInt(input); - array[HOUR] = kInput === 24 ? 0 : kInput; - }); - addParseToken(['a', 'A'], function (input, array, config) { - config._isPm = config._locale.isPM(input); - config._meridiem = input; - }); - addParseToken(['h', 'hh'], function (input, array, config) { - array[HOUR] = toInt(input); - getParsingFlags(config).bigHour = true; - }); - addParseToken('hmm', function (input, array, config) { - var pos = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos)); - array[MINUTE] = toInt(input.substr(pos)); - getParsingFlags(config).bigHour = true; - }); - addParseToken('hmmss', function (input, array, config) { - var pos1 = input.length - 4; - var pos2 = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos1)); - array[MINUTE] = toInt(input.substr(pos1, 2)); - array[SECOND] = toInt(input.substr(pos2)); - getParsingFlags(config).bigHour = true; - }); - addParseToken('Hmm', function (input, array, config) { - var pos = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos)); - array[MINUTE] = toInt(input.substr(pos)); - }); - addParseToken('Hmmss', function (input, array, config) { - var pos1 = input.length - 4; - var pos2 = input.length - 2; - array[HOUR] = toInt(input.substr(0, pos1)); - array[MINUTE] = toInt(input.substr(pos1, 2)); - array[SECOND] = toInt(input.substr(pos2)); - }); - - // LOCALES - - function localeIsPM (input) { - // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays - // Using charAt should be more compatible. - return ((input + '').toLowerCase().charAt(0) === 'p'); - } - - var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i; - function localeMeridiem (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'pm' : 'PM'; - } else { - return isLower ? 'am' : 'AM'; - } - } - - - // MOMENTS - - // Setting the hour should keep the time, because the user explicitly - // specified which hour they want. So trying to maintain the same hour (in - // a new timezone) makes sense. Adding/subtracting hours does not follow - // this rule. - var getSetHour = makeGetSet('Hours', true); - - var baseConfig = { - calendar: defaultCalendar, - longDateFormat: defaultLongDateFormat, - invalidDate: defaultInvalidDate, - ordinal: defaultOrdinal, - dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, - relativeTime: defaultRelativeTime, - - months: defaultLocaleMonths, - monthsShort: defaultLocaleMonthsShort, - - week: defaultLocaleWeek, - - weekdays: defaultLocaleWeekdays, - weekdaysMin: defaultLocaleWeekdaysMin, - weekdaysShort: defaultLocaleWeekdaysShort, - - meridiemParse: defaultLocaleMeridiemParse - }; - - // internal storage for locale config files - var locales = {}; - var localeFamilies = {}; - var globalLocale; - - function normalizeLocale(key) { - return key ? key.toLowerCase().replace('_', '-') : key; - } - - // pick the locale from the array - // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each - // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root - function chooseLocale(names) { - var i = 0, j, next, locale, split; - - while (i < names.length) { - split = normalizeLocale(names[i]).split('-'); - j = split.length; - next = normalizeLocale(names[i + 1]); - next = next ? next.split('-') : null; - while (j > 0) { - locale = loadLocale(split.slice(0, j).join('-')); - if (locale) { - return locale; - } - if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { - //the next array item is better than a shallower substring of this one - break; - } - j--; - } - i++; - } - return globalLocale; - } - - function loadLocale(name) { - var oldLocale = null; - // TODO: Find a better way to register and load all the locales in Node - if (!locales[name] && (typeof module !== 'undefined') && - module && module.exports) { - try { - oldLocale = globalLocale._abbr; - var aliasedRequire = require; - __webpack_require__("./node_modules/moment/locale sync recursive ^\\.\\/.*$")("./" + name); - getSetGlobalLocale(oldLocale); - } catch (e) {} - } - return locales[name]; - } - - // This function will load locale and then set the global locale. If - // no arguments are passed in, it will simply return the current global - // locale key. - function getSetGlobalLocale (key, values) { - var data; - if (key) { - if (isUndefined(values)) { - data = getLocale(key); - } - else { - data = defineLocale(key, values); - } - - if (data) { - // moment.duration._locale = moment._locale = data; - globalLocale = data; - } - else { - if ((typeof console !== 'undefined') && console.warn) { - //warn user if arguments are passed but the locale could not be set - console.warn('Locale ' + key + ' not found. Did you forget to load it?'); - } - } - } - - return globalLocale._abbr; - } - - function defineLocale (name, config) { - if (config !== null) { - var locale, parentConfig = baseConfig; - config.abbr = name; - if (locales[name] != null) { - deprecateSimple('defineLocaleOverride', - 'use moment.updateLocale(localeName, config) to change ' + - 'an existing locale. moment.defineLocale(localeName, ' + - 'config) should only be used for creating a new locale ' + - 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'); - parentConfig = locales[name]._config; - } else if (config.parentLocale != null) { - if (locales[config.parentLocale] != null) { - parentConfig = locales[config.parentLocale]._config; - } else { - locale = loadLocale(config.parentLocale); - if (locale != null) { - parentConfig = locale._config; - } else { - if (!localeFamilies[config.parentLocale]) { - localeFamilies[config.parentLocale] = []; - } - localeFamilies[config.parentLocale].push({ - name: name, - config: config - }); - return null; - } - } - } - locales[name] = new Locale(mergeConfigs(parentConfig, config)); - - if (localeFamilies[name]) { - localeFamilies[name].forEach(function (x) { - defineLocale(x.name, x.config); - }); - } - - // backwards compat for now: also set the locale - // make sure we set the locale AFTER all child locales have been - // created, so we won't end up with the child locale set. - getSetGlobalLocale(name); - - - return locales[name]; - } else { - // useful for testing - delete locales[name]; - return null; - } - } - - function updateLocale(name, config) { - if (config != null) { - var locale, tmpLocale, parentConfig = baseConfig; - // MERGE - tmpLocale = loadLocale(name); - if (tmpLocale != null) { - parentConfig = tmpLocale._config; - } - config = mergeConfigs(parentConfig, config); - locale = new Locale(config); - locale.parentLocale = locales[name]; - locales[name] = locale; - - // backwards compat for now: also set the locale - getSetGlobalLocale(name); - } else { - // pass null for config to unupdate, useful for tests - if (locales[name] != null) { - if (locales[name].parentLocale != null) { - locales[name] = locales[name].parentLocale; - } else if (locales[name] != null) { - delete locales[name]; - } - } - } - return locales[name]; - } - - // returns locale data - function getLocale (key) { - var locale; - - if (key && key._locale && key._locale._abbr) { - key = key._locale._abbr; - } - - if (!key) { - return globalLocale; - } - - if (!isArray(key)) { - //short-circuit everything else - locale = loadLocale(key); - if (locale) { - return locale; - } - key = [key]; - } - - return chooseLocale(key); - } - - function listLocales() { - return keys(locales); - } - - function checkOverflow (m) { - var overflow; - var a = m._a; - - if (a && getParsingFlags(m).overflow === -2) { - overflow = - a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : - a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : - a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : - a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : - a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : - a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : - -1; - - if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { - overflow = DATE; - } - if (getParsingFlags(m)._overflowWeeks && overflow === -1) { - overflow = WEEK; - } - if (getParsingFlags(m)._overflowWeekday && overflow === -1) { - overflow = WEEKDAY; - } - - getParsingFlags(m).overflow = overflow; - } - - return m; - } - - // Pick the first defined of two or three arguments. - function defaults(a, b, c) { - if (a != null) { - return a; - } - if (b != null) { - return b; - } - return c; - } - - function currentDateArray(config) { - // hooks is actually the exported moment object - var nowValue = new Date(hooks.now()); - if (config._useUTC) { - return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; - } - return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; - } - - // convert an array to a date. - // the array should mirror the parameters below - // note: all values past the year are optional and will default to the lowest possible value. - // [year, month, day , hour, minute, second, millisecond] - function configFromArray (config) { - var i, date, input = [], currentDate, expectedWeekday, yearToUse; - - if (config._d) { - return; - } - - currentDate = currentDateArray(config); - - //compute day of the year from weeks and weekdays - if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { - dayOfYearFromWeekInfo(config); - } - - //if the day of the year is set, figure out what it is - if (config._dayOfYear != null) { - yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); - - if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { - getParsingFlags(config)._overflowDayOfYear = true; - } - - date = createUTCDate(yearToUse, 0, config._dayOfYear); - config._a[MONTH] = date.getUTCMonth(); - config._a[DATE] = date.getUTCDate(); - } - - // Default to current date. - // * if no year, month, day of month are given, default to today - // * if day of month is given, default month and year - // * if month is given, default only year - // * if year is given, don't default anything - for (i = 0; i < 3 && config._a[i] == null; ++i) { - config._a[i] = input[i] = currentDate[i]; - } - - // Zero out whatever was not defaulted, including time - for (; i < 7; i++) { - config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; - } - - // Check for 24:00:00.000 - if (config._a[HOUR] === 24 && - config._a[MINUTE] === 0 && - config._a[SECOND] === 0 && - config._a[MILLISECOND] === 0) { - config._nextDay = true; - config._a[HOUR] = 0; - } - - config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); - expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); - - // Apply timezone offset from input. The actual utcOffset can be changed - // with parseZone. - if (config._tzm != null) { - config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); - } - - if (config._nextDay) { - config._a[HOUR] = 24; - } - - // check for mismatching day of week - if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) { - getParsingFlags(config).weekdayMismatch = true; - } - } - - function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; - - w = config._w; - if (w.GG != null || w.W != null || w.E != null) { - dow = 1; - doy = 4; - - // TODO: We need to take the current isoWeekYear, but that depends on - // how we interpret now (local, utc, fixed offset). So create - // a now version of current config (take local/utc/offset flags, and - // create now). - weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year); - week = defaults(w.W, 1); - weekday = defaults(w.E, 1); - if (weekday < 1 || weekday > 7) { - weekdayOverflow = true; - } - } else { - dow = config._locale._week.dow; - doy = config._locale._week.doy; - - var curWeek = weekOfYear(createLocal(), dow, doy); - - weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); - - // Default to current week. - week = defaults(w.w, curWeek.week); - - if (w.d != null) { - // weekday -- low day numbers are considered next week - weekday = w.d; - if (weekday < 0 || weekday > 6) { - weekdayOverflow = true; - } - } else if (w.e != null) { - // local weekday -- counting starts from beginning of week - weekday = w.e + dow; - if (w.e < 0 || w.e > 6) { - weekdayOverflow = true; - } - } else { - // default to beginning of week - weekday = dow; - } - } - if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { - getParsingFlags(config)._overflowWeeks = true; - } else if (weekdayOverflow != null) { - getParsingFlags(config)._overflowWeekday = true; - } else { - temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; - } - } - - // iso 8601 regex - // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) - var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; - var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; - - var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; - - var isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], - ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], - ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], - ['GGGG-[W]WW', /\d{4}-W\d\d/, false], - ['YYYY-DDD', /\d{4}-\d{3}/], - ['YYYY-MM', /\d{4}-\d\d/, false], - ['YYYYYYMMDD', /[+-]\d{10}/], - ['YYYYMMDD', /\d{8}/], - // YYYYMM is NOT allowed by the standard - ['GGGG[W]WWE', /\d{4}W\d{3}/], - ['GGGG[W]WW', /\d{4}W\d{2}/, false], - ['YYYYDDD', /\d{7}/] - ]; - - // iso time formats and regexes - var isoTimes = [ - ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], - ['HH:mm:ss', /\d\d:\d\d:\d\d/], - ['HH:mm', /\d\d:\d\d/], - ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], - ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], - ['HHmmss', /\d\d\d\d\d\d/], - ['HHmm', /\d\d\d\d/], - ['HH', /\d\d/] - ]; - - var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; - - // date from iso format - function configFromISO(config) { - var i, l, - string = config._i, - match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), - allowTime, dateFormat, timeFormat, tzFormat; - - if (match) { - getParsingFlags(config).iso = true; - - for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(match[1])) { - dateFormat = isoDates[i][0]; - allowTime = isoDates[i][2] !== false; - break; - } - } - if (dateFormat == null) { - config._isValid = false; - return; - } - if (match[3]) { - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(match[3])) { - // match[2] should be 'T' or space - timeFormat = (match[2] || ' ') + isoTimes[i][0]; - break; - } - } - if (timeFormat == null) { - config._isValid = false; - return; - } - } - if (!allowTime && timeFormat != null) { - config._isValid = false; - return; - } - if (match[4]) { - if (tzRegex.exec(match[4])) { - tzFormat = 'Z'; - } else { - config._isValid = false; - return; - } - } - config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); - configFromStringAndFormat(config); - } else { - config._isValid = false; - } - } - - // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 - var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/; - - function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { - var result = [ - untruncateYear(yearStr), - defaultLocaleMonthsShort.indexOf(monthStr), - parseInt(dayStr, 10), - parseInt(hourStr, 10), - parseInt(minuteStr, 10) - ]; - - if (secondStr) { - result.push(parseInt(secondStr, 10)); - } - - return result; - } - - function untruncateYear(yearStr) { - var year = parseInt(yearStr, 10); - if (year <= 49) { - return 2000 + year; - } else if (year <= 999) { - return 1900 + year; - } - return year; - } - - function preprocessRFC2822(s) { - // Remove comments and folding whitespace and replace multiple-spaces with a single space - return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, ''); - } - - function checkWeekday(weekdayStr, parsedInput, config) { - if (weekdayStr) { - // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check. - var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), - weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay(); - if (weekdayProvided !== weekdayActual) { - getParsingFlags(config).weekdayMismatch = true; - config._isValid = false; - return false; - } - } - return true; - } - - var obsOffsets = { - UT: 0, - GMT: 0, - EDT: -4 * 60, - EST: -5 * 60, - CDT: -5 * 60, - CST: -6 * 60, - MDT: -6 * 60, - MST: -7 * 60, - PDT: -7 * 60, - PST: -8 * 60 - }; - - function calculateOffset(obsOffset, militaryOffset, numOffset) { - if (obsOffset) { - return obsOffsets[obsOffset]; - } else if (militaryOffset) { - // the only allowed military tz is Z - return 0; - } else { - var hm = parseInt(numOffset, 10); - var m = hm % 100, h = (hm - m) / 100; - return h * 60 + m; - } - } - - // date and time from ref 2822 format - function configFromRFC2822(config) { - var match = rfc2822.exec(preprocessRFC2822(config._i)); - if (match) { - var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); - if (!checkWeekday(match[1], parsedArray, config)) { - return; - } - - config._a = parsedArray; - config._tzm = calculateOffset(match[8], match[9], match[10]); - - config._d = createUTCDate.apply(null, config._a); - config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); - - getParsingFlags(config).rfc2822 = true; - } else { - config._isValid = false; - } - } - - // date from iso format or fallback - function configFromString(config) { - var matched = aspNetJsonRegex.exec(config._i); - - if (matched !== null) { - config._d = new Date(+matched[1]); - return; - } - - configFromISO(config); - if (config._isValid === false) { - delete config._isValid; - } else { - return; - } - - configFromRFC2822(config); - if (config._isValid === false) { - delete config._isValid; - } else { - return; - } - - // Final attempt, use Input Fallback - hooks.createFromInputFallback(config); - } - - hooks.createFromInputFallback = deprecate( - 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + - 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + - 'discouraged and will be removed in an upcoming major release. Please refer to ' + - 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', - function (config) { - config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); - } - ); - - // constant that refers to the ISO standard - hooks.ISO_8601 = function () {}; - - // constant that refers to the RFC 2822 form - hooks.RFC_2822 = function () {}; - - // date from string and format string - function configFromStringAndFormat(config) { - // TODO: Move this to another part of the creation flow to prevent circular deps - if (config._f === hooks.ISO_8601) { - configFromISO(config); - return; - } - if (config._f === hooks.RFC_2822) { - configFromRFC2822(config); - return; - } - config._a = []; - getParsingFlags(config).empty = true; - - // This array is used to make a Date, either with `new Date` or `Date.UTC` - var string = '' + config._i, - i, parsedInput, tokens, token, skipped, - stringLength = string.length, - totalParsedInputLength = 0; - - tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; - - for (i = 0; i < tokens.length; i++) { - token = tokens[i]; - parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; - // console.log('token', token, 'parsedInput', parsedInput, - // 'regex', getParseRegexForToken(token, config)); - if (parsedInput) { - skipped = string.substr(0, string.indexOf(parsedInput)); - if (skipped.length > 0) { - getParsingFlags(config).unusedInput.push(skipped); - } - string = string.slice(string.indexOf(parsedInput) + parsedInput.length); - totalParsedInputLength += parsedInput.length; - } - // don't parse if it's not a known token - if (formatTokenFunctions[token]) { - if (parsedInput) { - getParsingFlags(config).empty = false; - } - else { - getParsingFlags(config).unusedTokens.push(token); - } - addTimeToArrayFromToken(token, parsedInput, config); - } - else if (config._strict && !parsedInput) { - getParsingFlags(config).unusedTokens.push(token); - } - } - - // add remaining unparsed input length to the string - getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; - if (string.length > 0) { - getParsingFlags(config).unusedInput.push(string); - } - - // clear _12h flag if hour is <= 12 - if (config._a[HOUR] <= 12 && - getParsingFlags(config).bigHour === true && - config._a[HOUR] > 0) { - getParsingFlags(config).bigHour = undefined; - } - - getParsingFlags(config).parsedDateParts = config._a.slice(0); - getParsingFlags(config).meridiem = config._meridiem; - // handle meridiem - config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); - - configFromArray(config); - checkOverflow(config); - } - - - function meridiemFixWrap (locale, hour, meridiem) { - var isPm; - - if (meridiem == null) { - // nothing to do - return hour; - } - if (locale.meridiemHour != null) { - return locale.meridiemHour(hour, meridiem); - } else if (locale.isPM != null) { - // Fallback - isPm = locale.isPM(meridiem); - if (isPm && hour < 12) { - hour += 12; - } - if (!isPm && hour === 12) { - hour = 0; - } - return hour; - } else { - // this is not supposed to happen - return hour; - } - } - - // date from string and array of format strings - function configFromStringAndArray(config) { - var tempConfig, - bestMoment, - - scoreToBeat, - i, - currentScore; - - if (config._f.length === 0) { - getParsingFlags(config).invalidFormat = true; - config._d = new Date(NaN); - return; - } - - for (i = 0; i < config._f.length; i++) { - currentScore = 0; - tempConfig = copyConfig({}, config); - if (config._useUTC != null) { - tempConfig._useUTC = config._useUTC; - } - tempConfig._f = config._f[i]; - configFromStringAndFormat(tempConfig); - - if (!isValid(tempConfig)) { - continue; - } - - // if there is any input that was not parsed add a penalty for that format - currentScore += getParsingFlags(tempConfig).charsLeftOver; - - //or tokens - currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; - - getParsingFlags(tempConfig).score = currentScore; - - if (scoreToBeat == null || currentScore < scoreToBeat) { - scoreToBeat = currentScore; - bestMoment = tempConfig; - } - } - - extend(config, bestMoment || tempConfig); - } - - function configFromObject(config) { - if (config._d) { - return; - } - - var i = normalizeObjectUnits(config._i); - config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { - return obj && parseInt(obj, 10); - }); - - configFromArray(config); - } - - function createFromConfig (config) { - var res = new Moment(checkOverflow(prepareConfig(config))); - if (res._nextDay) { - // Adding is smart enough around DST - res.add(1, 'd'); - res._nextDay = undefined; - } - - return res; - } - - function prepareConfig (config) { - var input = config._i, - format = config._f; - - config._locale = config._locale || getLocale(config._l); - - if (input === null || (format === undefined && input === '')) { - return createInvalid({nullInput: true}); - } - - if (typeof input === 'string') { - config._i = input = config._locale.preparse(input); - } - - if (isMoment(input)) { - return new Moment(checkOverflow(input)); - } else if (isDate(input)) { - config._d = input; - } else if (isArray(format)) { - configFromStringAndArray(config); - } else if (format) { - configFromStringAndFormat(config); - } else { - configFromInput(config); - } - - if (!isValid(config)) { - config._d = null; - } - - return config; - } - - function configFromInput(config) { - var input = config._i; - if (isUndefined(input)) { - config._d = new Date(hooks.now()); - } else if (isDate(input)) { - config._d = new Date(input.valueOf()); - } else if (typeof input === 'string') { - configFromString(config); - } else if (isArray(input)) { - config._a = map(input.slice(0), function (obj) { - return parseInt(obj, 10); - }); - configFromArray(config); - } else if (isObject(input)) { - configFromObject(config); - } else if (isNumber(input)) { - // from milliseconds - config._d = new Date(input); - } else { - hooks.createFromInputFallback(config); - } - } - - function createLocalOrUTC (input, format, locale, strict, isUTC) { - var c = {}; - - if (locale === true || locale === false) { - strict = locale; - locale = undefined; - } - - if ((isObject(input) && isObjectEmpty(input)) || - (isArray(input) && input.length === 0)) { - input = undefined; - } - // object construction must be done this way. - // https://github.com/moment/moment/issues/1423 - c._isAMomentObject = true; - c._useUTC = c._isUTC = isUTC; - c._l = locale; - c._i = input; - c._f = format; - c._strict = strict; - - return createFromConfig(c); - } - - function createLocal (input, format, locale, strict) { - return createLocalOrUTC(input, format, locale, strict, false); - } - - var prototypeMin = deprecate( - 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', - function () { - var other = createLocal.apply(null, arguments); - if (this.isValid() && other.isValid()) { - return other < this ? this : other; - } else { - return createInvalid(); - } - } - ); - - var prototypeMax = deprecate( - 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', - function () { - var other = createLocal.apply(null, arguments); - if (this.isValid() && other.isValid()) { - return other > this ? this : other; - } else { - return createInvalid(); - } - } - ); - - // Pick a moment m from moments so that m[fn](other) is true for all - // other. This relies on the function fn to be transitive. - // - // moments should either be an array of moment objects or an array, whose - // first element is an array of moment objects. - function pickBy(fn, moments) { - var res, i; - if (moments.length === 1 && isArray(moments[0])) { - moments = moments[0]; - } - if (!moments.length) { - return createLocal(); - } - res = moments[0]; - for (i = 1; i < moments.length; ++i) { - if (!moments[i].isValid() || moments[i][fn](res)) { - res = moments[i]; - } - } - return res; - } - - // TODO: Use [].sort instead? - function min () { - var args = [].slice.call(arguments, 0); - - return pickBy('isBefore', args); - } - - function max () { - var args = [].slice.call(arguments, 0); - - return pickBy('isAfter', args); - } - - var now = function () { - return Date.now ? Date.now() : +(new Date()); - }; - - var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond']; - - function isDurationValid(m) { - for (var key in m) { - if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) { - return false; - } - } - - var unitHasDecimal = false; - for (var i = 0; i < ordering.length; ++i) { - if (m[ordering[i]]) { - if (unitHasDecimal) { - return false; // only allow non-integers for smallest unit - } - if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { - unitHasDecimal = true; - } - } - } - - return true; - } - - function isValid$1() { - return this._isValid; - } - - function createInvalid$1() { - return createDuration(NaN); - } - - function Duration (duration) { - var normalizedInput = normalizeObjectUnits(duration), - years = normalizedInput.year || 0, - quarters = normalizedInput.quarter || 0, - months = normalizedInput.month || 0, - weeks = normalizedInput.week || normalizedInput.isoWeek || 0, - days = normalizedInput.day || 0, - hours = normalizedInput.hour || 0, - minutes = normalizedInput.minute || 0, - seconds = normalizedInput.second || 0, - milliseconds = normalizedInput.millisecond || 0; - - this._isValid = isDurationValid(normalizedInput); - - // representation for dateAddRemove - this._milliseconds = +milliseconds + - seconds * 1e3 + // 1000 - minutes * 6e4 + // 1000 * 60 - hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 - // Because of dateAddRemove treats 24 hours as different from a - // day when working around DST, we need to store them separately - this._days = +days + - weeks * 7; - // It is impossible to translate months into days without knowing - // which months you are are talking about, so we have to store - // it separately. - this._months = +months + - quarters * 3 + - years * 12; - - this._data = {}; - - this._locale = getLocale(); - - this._bubble(); - } - - function isDuration (obj) { - return obj instanceof Duration; - } - - function absRound (number) { - if (number < 0) { - return Math.round(-1 * number) * -1; - } else { - return Math.round(number); - } - } - - // FORMATTING - - function offset (token, separator) { - addFormatToken(token, 0, 0, function () { - var offset = this.utcOffset(); - var sign = '+'; - if (offset < 0) { - offset = -offset; - sign = '-'; - } - return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2); - }); - } - - offset('Z', ':'); - offset('ZZ', ''); - - // PARSING - - addRegexToken('Z', matchShortOffset); - addRegexToken('ZZ', matchShortOffset); - addParseToken(['Z', 'ZZ'], function (input, array, config) { - config._useUTC = true; - config._tzm = offsetFromString(matchShortOffset, input); - }); - - // HELPERS - - // timezone chunker - // '+10:00' > ['10', '00'] - // '-1530' > ['-15', '30'] - var chunkOffset = /([\+\-]|\d\d)/gi; - - function offsetFromString(matcher, string) { - var matches = (string || '').match(matcher); - - if (matches === null) { - return null; - } - - var chunk = matches[matches.length - 1] || []; - var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; - var minutes = +(parts[1] * 60) + toInt(parts[2]); - - return minutes === 0 ? - 0 : - parts[0] === '+' ? minutes : -minutes; - } - - // Return a moment from input, that is local/utc/zone equivalent to model. - function cloneWithOffset(input, model) { - var res, diff; - if (model._isUTC) { - res = model.clone(); - diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); - // Use low-level api, because this fn is low-level api. - res._d.setTime(res._d.valueOf() + diff); - hooks.updateOffset(res, false); - return res; - } else { - return createLocal(input).local(); - } - } - - function getDateOffset (m) { - // On Firefox.24 Date#getTimezoneOffset returns a floating point. - // https://github.com/moment/moment/pull/1871 - return -Math.round(m._d.getTimezoneOffset() / 15) * 15; - } - - // HOOKS - - // This function will be called whenever a moment is mutated. - // It is intended to keep the offset in sync with the timezone. - hooks.updateOffset = function () {}; - - // MOMENTS - - // keepLocalTime = true means only change the timezone, without - // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> - // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset - // +0200, so we adjust the time as needed, to be valid. - // - // Keeping the time actually adds/subtracts (one hour) - // from the actual represented time. That is why we call updateOffset - // a second time. In case it wants us to change the offset again - // _changeInProgress == true case, then we have to adjust, because - // there is no such time in the given timezone. - function getSetOffset (input, keepLocalTime, keepMinutes) { - var offset = this._offset || 0, - localAdjust; - if (!this.isValid()) { - return input != null ? this : NaN; - } - if (input != null) { - if (typeof input === 'string') { - input = offsetFromString(matchShortOffset, input); - if (input === null) { - return this; - } - } else if (Math.abs(input) < 16 && !keepMinutes) { - input = input * 60; - } - if (!this._isUTC && keepLocalTime) { - localAdjust = getDateOffset(this); - } - this._offset = input; - this._isUTC = true; - if (localAdjust != null) { - this.add(localAdjust, 'm'); - } - if (offset !== input) { - if (!keepLocalTime || this._changeInProgress) { - addSubtract(this, createDuration(input - offset, 'm'), 1, false); - } else if (!this._changeInProgress) { - this._changeInProgress = true; - hooks.updateOffset(this, true); - this._changeInProgress = null; - } - } - return this; - } else { - return this._isUTC ? offset : getDateOffset(this); - } - } - - function getSetZone (input, keepLocalTime) { - if (input != null) { - if (typeof input !== 'string') { - input = -input; - } - - this.utcOffset(input, keepLocalTime); - - return this; - } else { - return -this.utcOffset(); - } - } - - function setOffsetToUTC (keepLocalTime) { - return this.utcOffset(0, keepLocalTime); - } - - function setOffsetToLocal (keepLocalTime) { - if (this._isUTC) { - this.utcOffset(0, keepLocalTime); - this._isUTC = false; - - if (keepLocalTime) { - this.subtract(getDateOffset(this), 'm'); - } - } - return this; - } - - function setOffsetToParsedOffset () { - if (this._tzm != null) { - this.utcOffset(this._tzm, false, true); - } else if (typeof this._i === 'string') { - var tZone = offsetFromString(matchOffset, this._i); - if (tZone != null) { - this.utcOffset(tZone); - } - else { - this.utcOffset(0, true); - } - } - return this; - } - - function hasAlignedHourOffset (input) { - if (!this.isValid()) { - return false; - } - input = input ? createLocal(input).utcOffset() : 0; - - return (this.utcOffset() - input) % 60 === 0; - } - - function isDaylightSavingTime () { - return ( - this.utcOffset() > this.clone().month(0).utcOffset() || - this.utcOffset() > this.clone().month(5).utcOffset() - ); - } - - function isDaylightSavingTimeShifted () { - if (!isUndefined(this._isDSTShifted)) { - return this._isDSTShifted; - } - - var c = {}; - - copyConfig(c, this); - c = prepareConfig(c); - - if (c._a) { - var other = c._isUTC ? createUTC(c._a) : createLocal(c._a); - this._isDSTShifted = this.isValid() && - compareArrays(c._a, other.toArray()) > 0; - } else { - this._isDSTShifted = false; - } - - return this._isDSTShifted; - } - - function isLocal () { - return this.isValid() ? !this._isUTC : false; - } - - function isUtcOffset () { - return this.isValid() ? this._isUTC : false; - } - - function isUtc () { - return this.isValid() ? this._isUTC && this._offset === 0 : false; - } - - // ASP.NET json date format regex - var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/; - - // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html - // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - // and further modified to allow for strings containing both week and day - var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; - - function createDuration (input, key) { - var duration = input, - // matching against regexp is expensive, do it on demand - match = null, - sign, - ret, - diffRes; - - if (isDuration(input)) { - duration = { - ms : input._milliseconds, - d : input._days, - M : input._months - }; - } else if (isNumber(input)) { - duration = {}; - if (key) { - duration[key] = input; - } else { - duration.milliseconds = input; - } - } else if (!!(match = aspNetRegex.exec(input))) { - sign = (match[1] === '-') ? -1 : 1; - duration = { - y : 0, - d : toInt(match[DATE]) * sign, - h : toInt(match[HOUR]) * sign, - m : toInt(match[MINUTE]) * sign, - s : toInt(match[SECOND]) * sign, - ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match - }; - } else if (!!(match = isoRegex.exec(input))) { - sign = (match[1] === '-') ? -1 : 1; - duration = { - y : parseIso(match[2], sign), - M : parseIso(match[3], sign), - w : parseIso(match[4], sign), - d : parseIso(match[5], sign), - h : parseIso(match[6], sign), - m : parseIso(match[7], sign), - s : parseIso(match[8], sign) - }; - } else if (duration == null) {// checks for null or undefined - duration = {}; - } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { - diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to)); - - duration = {}; - duration.ms = diffRes.milliseconds; - duration.M = diffRes.months; - } - - ret = new Duration(duration); - - if (isDuration(input) && hasOwnProp(input, '_locale')) { - ret._locale = input._locale; - } - - return ret; - } - - createDuration.fn = Duration.prototype; - createDuration.invalid = createInvalid$1; - - function parseIso (inp, sign) { - // We'd normally use ~~inp for this, but unfortunately it also - // converts floats to ints. - // inp may be undefined, so careful calling replace on it. - var res = inp && parseFloat(inp.replace(',', '.')); - // apply sign while we're at it - return (isNaN(res) ? 0 : res) * sign; - } - - function positiveMomentsDifference(base, other) { - var res = {}; - - res.months = other.month() - base.month() + - (other.year() - base.year()) * 12; - if (base.clone().add(res.months, 'M').isAfter(other)) { - --res.months; - } - - res.milliseconds = +other - +(base.clone().add(res.months, 'M')); - - return res; - } - - function momentsDifference(base, other) { - var res; - if (!(base.isValid() && other.isValid())) { - return {milliseconds: 0, months: 0}; - } - - other = cloneWithOffset(other, base); - if (base.isBefore(other)) { - res = positiveMomentsDifference(base, other); - } else { - res = positiveMomentsDifference(other, base); - res.milliseconds = -res.milliseconds; - res.months = -res.months; - } - - return res; - } - - // TODO: remove 'name' arg after deprecation is removed - function createAdder(direction, name) { - return function (val, period) { - var dur, tmp; - //invert the arguments, but complain about it - if (period !== null && !isNaN(+period)) { - deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + - 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); - tmp = val; val = period; period = tmp; - } - - val = typeof val === 'string' ? +val : val; - dur = createDuration(val, period); - addSubtract(this, dur, direction); - return this; - }; - } - - function addSubtract (mom, duration, isAdding, updateOffset) { - var milliseconds = duration._milliseconds, - days = absRound(duration._days), - months = absRound(duration._months); - - if (!mom.isValid()) { - // No op - return; - } - - updateOffset = updateOffset == null ? true : updateOffset; - - if (months) { - setMonth(mom, get(mom, 'Month') + months * isAdding); - } - if (days) { - set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); - } - if (milliseconds) { - mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); - } - if (updateOffset) { - hooks.updateOffset(mom, days || months); - } - } - - var add = createAdder(1, 'add'); - var subtract = createAdder(-1, 'subtract'); - - function getCalendarFormat(myMoment, now) { - var diff = myMoment.diff(now, 'days', true); - return diff < -6 ? 'sameElse' : - diff < -1 ? 'lastWeek' : - diff < 0 ? 'lastDay' : - diff < 1 ? 'sameDay' : - diff < 2 ? 'nextDay' : - diff < 7 ? 'nextWeek' : 'sameElse'; - } - - function calendar$1 (time, formats) { - // We want to compare the start of today, vs this. - // Getting start-of-today depends on whether we're local/utc/offset or not. - var now = time || createLocal(), - sod = cloneWithOffset(now, this).startOf('day'), - format = hooks.calendarFormat(this, sod) || 'sameElse'; - - var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); - - return this.format(output || this.localeData().calendar(format, this, createLocal(now))); - } - - function clone () { - return new Moment(this); - } - - function isAfter (input, units) { - var localInput = isMoment(input) ? input : createLocal(input); - if (!(this.isValid() && localInput.isValid())) { - return false; - } - units = normalizeUnits(units) || 'millisecond'; - if (units === 'millisecond') { - return this.valueOf() > localInput.valueOf(); - } else { - return localInput.valueOf() < this.clone().startOf(units).valueOf(); - } - } - - function isBefore (input, units) { - var localInput = isMoment(input) ? input : createLocal(input); - if (!(this.isValid() && localInput.isValid())) { - return false; - } - units = normalizeUnits(units) || 'millisecond'; - if (units === 'millisecond') { - return this.valueOf() < localInput.valueOf(); - } else { - return this.clone().endOf(units).valueOf() < localInput.valueOf(); - } - } - - function isBetween (from, to, units, inclusivity) { - var localFrom = isMoment(from) ? from : createLocal(from), - localTo = isMoment(to) ? to : createLocal(to); - if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { - return false; - } - inclusivity = inclusivity || '()'; - return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && - (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)); - } - - function isSame (input, units) { - var localInput = isMoment(input) ? input : createLocal(input), - inputMs; - if (!(this.isValid() && localInput.isValid())) { - return false; - } - units = normalizeUnits(units) || 'millisecond'; - if (units === 'millisecond') { - return this.valueOf() === localInput.valueOf(); - } else { - inputMs = localInput.valueOf(); - return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); - } - } - - function isSameOrAfter (input, units) { - return this.isSame(input, units) || this.isAfter(input, units); - } - - function isSameOrBefore (input, units) { - return this.isSame(input, units) || this.isBefore(input, units); - } - - function diff (input, units, asFloat) { - var that, - zoneDelta, - output; - - if (!this.isValid()) { - return NaN; - } - - that = cloneWithOffset(input, this); - - if (!that.isValid()) { - return NaN; - } - - zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; - - units = normalizeUnits(units); - - switch (units) { - case 'year': output = monthDiff(this, that) / 12; break; - case 'month': output = monthDiff(this, that); break; - case 'quarter': output = monthDiff(this, that) / 3; break; - case 'second': output = (this - that) / 1e3; break; // 1000 - case 'minute': output = (this - that) / 6e4; break; // 1000 * 60 - case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60 - case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst - case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst - default: output = this - that; - } - - return asFloat ? output : absFloor(output); - } - - function monthDiff (a, b) { - // difference in months - var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), - // b is in (anchor - 1 month, anchor + 1 month) - anchor = a.clone().add(wholeMonthDiff, 'months'), - anchor2, adjust; - - if (b - anchor < 0) { - anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); - // linear across the month - adjust = (b - anchor) / (anchor - anchor2); - } else { - anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); - // linear across the month - adjust = (b - anchor) / (anchor2 - anchor); - } - - //check for negative zero, return zero if negative zero - return -(wholeMonthDiff + adjust) || 0; - } - - hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; - hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; - - function toString () { - return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); - } - - function toISOString(keepOffset) { - if (!this.isValid()) { - return null; - } - var utc = keepOffset !== true; - var m = utc ? this.clone().utc() : this; - if (m.year() < 0 || m.year() > 9999) { - return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'); - } - if (isFunction(Date.prototype.toISOString)) { - // native implementation is ~50x faster, use it when we can - if (utc) { - return this.toDate().toISOString(); - } else { - return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z')); - } - } - return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'); - } - - /** - * Return a human readable representation of a moment that can - * also be evaluated to get a new moment which is the same - * - * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects - */ - function inspect () { - if (!this.isValid()) { - return 'moment.invalid(/* ' + this._i + ' */)'; - } - var func = 'moment'; - var zone = ''; - if (!this.isLocal()) { - func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; - zone = 'Z'; - } - var prefix = '[' + func + '("]'; - var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY'; - var datetime = '-MM-DD[T]HH:mm:ss.SSS'; - var suffix = zone + '[")]'; - - return this.format(prefix + year + datetime + suffix); - } - - function format (inputString) { - if (!inputString) { - inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; - } - var output = formatMoment(this, inputString); - return this.localeData().postformat(output); - } - - function from (time, withoutSuffix) { - if (this.isValid() && - ((isMoment(time) && time.isValid()) || - createLocal(time).isValid())) { - return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); - } else { - return this.localeData().invalidDate(); - } - } - - function fromNow (withoutSuffix) { - return this.from(createLocal(), withoutSuffix); - } - - function to (time, withoutSuffix) { - if (this.isValid() && - ((isMoment(time) && time.isValid()) || - createLocal(time).isValid())) { - return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); - } else { - return this.localeData().invalidDate(); - } - } - - function toNow (withoutSuffix) { - return this.to(createLocal(), withoutSuffix); - } - - // If passed a locale key, it will set the locale for this - // instance. Otherwise, it will return the locale configuration - // variables for this instance. - function locale (key) { - var newLocaleData; - - if (key === undefined) { - return this._locale._abbr; - } else { - newLocaleData = getLocale(key); - if (newLocaleData != null) { - this._locale = newLocaleData; - } - return this; - } - } - - var lang = deprecate( - 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', - function (key) { - if (key === undefined) { - return this.localeData(); - } else { - return this.locale(key); - } - } - ); - - function localeData () { - return this._locale; - } - - var MS_PER_SECOND = 1000; - var MS_PER_MINUTE = 60 * MS_PER_SECOND; - var MS_PER_HOUR = 60 * MS_PER_MINUTE; - var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; - - // actual modulo - handles negative numbers (for dates before 1970): - function mod$1(dividend, divisor) { - return (dividend % divisor + divisor) % divisor; - } - - function localStartOfDate(y, m, d) { - // the date constructor remaps years 0-99 to 1900-1999 - if (y < 100 && y >= 0) { - // preserve leap years using a full 400 year cycle, then reset - return new Date(y + 400, m, d) - MS_PER_400_YEARS; - } else { - return new Date(y, m, d).valueOf(); - } - } - - function utcStartOfDate(y, m, d) { - // Date.UTC remaps years 0-99 to 1900-1999 - if (y < 100 && y >= 0) { - // preserve leap years using a full 400 year cycle, then reset - return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; - } else { - return Date.UTC(y, m, d); - } - } - - function startOf (units) { - var time; - units = normalizeUnits(units); - if (units === undefined || units === 'millisecond' || !this.isValid()) { - return this; - } - - var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; - - switch (units) { - case 'year': - time = startOfDate(this.year(), 0, 1); - break; - case 'quarter': - time = startOfDate(this.year(), this.month() - this.month() % 3, 1); - break; - case 'month': - time = startOfDate(this.year(), this.month(), 1); - break; - case 'week': - time = startOfDate(this.year(), this.month(), this.date() - this.weekday()); - break; - case 'isoWeek': - time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1)); - break; - case 'day': - case 'date': - time = startOfDate(this.year(), this.month(), this.date()); - break; - case 'hour': - time = this._d.valueOf(); - time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR); - break; - case 'minute': - time = this._d.valueOf(); - time -= mod$1(time, MS_PER_MINUTE); - break; - case 'second': - time = this._d.valueOf(); - time -= mod$1(time, MS_PER_SECOND); - break; - } - - this._d.setTime(time); - hooks.updateOffset(this, true); - return this; - } - - function endOf (units) { - var time; - units = normalizeUnits(units); - if (units === undefined || units === 'millisecond' || !this.isValid()) { - return this; - } - - var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; - - switch (units) { - case 'year': - time = startOfDate(this.year() + 1, 0, 1) - 1; - break; - case 'quarter': - time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1; - break; - case 'month': - time = startOfDate(this.year(), this.month() + 1, 1) - 1; - break; - case 'week': - time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1; - break; - case 'isoWeek': - time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1; - break; - case 'day': - case 'date': - time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; - break; - case 'hour': - time = this._d.valueOf(); - time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1; - break; - case 'minute': - time = this._d.valueOf(); - time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; - break; - case 'second': - time = this._d.valueOf(); - time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; - break; - } - - this._d.setTime(time); - hooks.updateOffset(this, true); - return this; - } - - function valueOf () { - return this._d.valueOf() - ((this._offset || 0) * 60000); - } - - function unix () { - return Math.floor(this.valueOf() / 1000); - } - - function toDate () { - return new Date(this.valueOf()); - } - - function toArray () { - var m = this; - return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; - } - - function toObject () { - var m = this; - return { - years: m.year(), - months: m.month(), - date: m.date(), - hours: m.hours(), - minutes: m.minutes(), - seconds: m.seconds(), - milliseconds: m.milliseconds() - }; - } - - function toJSON () { - // new Date(NaN).toJSON() === null - return this.isValid() ? this.toISOString() : null; - } - - function isValid$2 () { - return isValid(this); - } - - function parsingFlags () { - return extend({}, getParsingFlags(this)); - } - - function invalidAt () { - return getParsingFlags(this).overflow; - } - - function creationData() { - return { - input: this._i, - format: this._f, - locale: this._locale, - isUTC: this._isUTC, - strict: this._strict - }; - } - - // FORMATTING - - addFormatToken(0, ['gg', 2], 0, function () { - return this.weekYear() % 100; - }); - - addFormatToken(0, ['GG', 2], 0, function () { - return this.isoWeekYear() % 100; - }); - - function addWeekYearFormatToken (token, getter) { - addFormatToken(0, [token, token.length], 0, getter); - } - - addWeekYearFormatToken('gggg', 'weekYear'); - addWeekYearFormatToken('ggggg', 'weekYear'); - addWeekYearFormatToken('GGGG', 'isoWeekYear'); - addWeekYearFormatToken('GGGGG', 'isoWeekYear'); - - // ALIASES - - addUnitAlias('weekYear', 'gg'); - addUnitAlias('isoWeekYear', 'GG'); - - // PRIORITY - - addUnitPriority('weekYear', 1); - addUnitPriority('isoWeekYear', 1); - - - // PARSING - - addRegexToken('G', matchSigned); - addRegexToken('g', matchSigned); - addRegexToken('GG', match1to2, match2); - addRegexToken('gg', match1to2, match2); - addRegexToken('GGGG', match1to4, match4); - addRegexToken('gggg', match1to4, match4); - addRegexToken('GGGGG', match1to6, match6); - addRegexToken('ggggg', match1to6, match6); - - addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { - week[token.substr(0, 2)] = toInt(input); - }); - - addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { - week[token] = hooks.parseTwoDigitYear(input); - }); - - // MOMENTS - - function getSetWeekYear (input) { - return getSetWeekYearHelper.call(this, - input, - this.week(), - this.weekday(), - this.localeData()._week.dow, - this.localeData()._week.doy); - } - - function getSetISOWeekYear (input) { - return getSetWeekYearHelper.call(this, - input, this.isoWeek(), this.isoWeekday(), 1, 4); - } - - function getISOWeeksInYear () { - return weeksInYear(this.year(), 1, 4); - } - - function getWeeksInYear () { - var weekInfo = this.localeData()._week; - return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); - } - - function getSetWeekYearHelper(input, week, weekday, dow, doy) { - var weeksTarget; - if (input == null) { - return weekOfYear(this, dow, doy).year; - } else { - weeksTarget = weeksInYear(input, dow, doy); - if (week > weeksTarget) { - week = weeksTarget; - } - return setWeekAll.call(this, input, week, weekday, dow, doy); - } - } - - function setWeekAll(weekYear, week, weekday, dow, doy) { - var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), - date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); - - this.year(date.getUTCFullYear()); - this.month(date.getUTCMonth()); - this.date(date.getUTCDate()); - return this; - } - - // FORMATTING - - addFormatToken('Q', 0, 'Qo', 'quarter'); - - // ALIASES - - addUnitAlias('quarter', 'Q'); - - // PRIORITY - - addUnitPriority('quarter', 7); - - // PARSING - - addRegexToken('Q', match1); - addParseToken('Q', function (input, array) { - array[MONTH] = (toInt(input) - 1) * 3; - }); - - // MOMENTS - - function getSetQuarter (input) { - return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); - } - - // FORMATTING - - addFormatToken('D', ['DD', 2], 'Do', 'date'); - - // ALIASES - - addUnitAlias('date', 'D'); - - // PRIORITY - addUnitPriority('date', 9); - - // PARSING - - addRegexToken('D', match1to2); - addRegexToken('DD', match1to2, match2); - addRegexToken('Do', function (isStrict, locale) { - // TODO: Remove "ordinalParse" fallback in next major release. - return isStrict ? - (locale._dayOfMonthOrdinalParse || locale._ordinalParse) : - locale._dayOfMonthOrdinalParseLenient; - }); - - addParseToken(['D', 'DD'], DATE); - addParseToken('Do', function (input, array) { - array[DATE] = toInt(input.match(match1to2)[0]); - }); - - // MOMENTS - - var getSetDayOfMonth = makeGetSet('Date', true); - - // FORMATTING - - addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); - - // ALIASES - - addUnitAlias('dayOfYear', 'DDD'); - - // PRIORITY - addUnitPriority('dayOfYear', 4); - - // PARSING - - addRegexToken('DDD', match1to3); - addRegexToken('DDDD', match3); - addParseToken(['DDD', 'DDDD'], function (input, array, config) { - config._dayOfYear = toInt(input); - }); - - // HELPERS - - // MOMENTS - - function getSetDayOfYear (input) { - var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); - } - - // FORMATTING - - addFormatToken('m', ['mm', 2], 0, 'minute'); - - // ALIASES - - addUnitAlias('minute', 'm'); - - // PRIORITY - - addUnitPriority('minute', 14); - - // PARSING - - addRegexToken('m', match1to2); - addRegexToken('mm', match1to2, match2); - addParseToken(['m', 'mm'], MINUTE); - - // MOMENTS - - var getSetMinute = makeGetSet('Minutes', false); - - // FORMATTING - - addFormatToken('s', ['ss', 2], 0, 'second'); - - // ALIASES - - addUnitAlias('second', 's'); - - // PRIORITY - - addUnitPriority('second', 15); - - // PARSING - - addRegexToken('s', match1to2); - addRegexToken('ss', match1to2, match2); - addParseToken(['s', 'ss'], SECOND); - - // MOMENTS - - var getSetSecond = makeGetSet('Seconds', false); - - // FORMATTING - - addFormatToken('S', 0, 0, function () { - return ~~(this.millisecond() / 100); - }); - - addFormatToken(0, ['SS', 2], 0, function () { - return ~~(this.millisecond() / 10); - }); - - addFormatToken(0, ['SSS', 3], 0, 'millisecond'); - addFormatToken(0, ['SSSS', 4], 0, function () { - return this.millisecond() * 10; - }); - addFormatToken(0, ['SSSSS', 5], 0, function () { - return this.millisecond() * 100; - }); - addFormatToken(0, ['SSSSSS', 6], 0, function () { - return this.millisecond() * 1000; - }); - addFormatToken(0, ['SSSSSSS', 7], 0, function () { - return this.millisecond() * 10000; - }); - addFormatToken(0, ['SSSSSSSS', 8], 0, function () { - return this.millisecond() * 100000; - }); - addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { - return this.millisecond() * 1000000; - }); - - - // ALIASES - - addUnitAlias('millisecond', 'ms'); - - // PRIORITY - - addUnitPriority('millisecond', 16); - - // PARSING - - addRegexToken('S', match1to3, match1); - addRegexToken('SS', match1to3, match2); - addRegexToken('SSS', match1to3, match3); - - var token; - for (token = 'SSSS'; token.length <= 9; token += 'S') { - addRegexToken(token, matchUnsigned); - } - - function parseMs(input, array) { - array[MILLISECOND] = toInt(('0.' + input) * 1000); - } - - for (token = 'S'; token.length <= 9; token += 'S') { - addParseToken(token, parseMs); - } - // MOMENTS - - var getSetMillisecond = makeGetSet('Milliseconds', false); - - // FORMATTING - - addFormatToken('z', 0, 0, 'zoneAbbr'); - addFormatToken('zz', 0, 0, 'zoneName'); - - // MOMENTS - - function getZoneAbbr () { - return this._isUTC ? 'UTC' : ''; - } - - function getZoneName () { - return this._isUTC ? 'Coordinated Universal Time' : ''; - } - - var proto = Moment.prototype; - - proto.add = add; - proto.calendar = calendar$1; - proto.clone = clone; - proto.diff = diff; - proto.endOf = endOf; - proto.format = format; - proto.from = from; - proto.fromNow = fromNow; - proto.to = to; - proto.toNow = toNow; - proto.get = stringGet; - proto.invalidAt = invalidAt; - proto.isAfter = isAfter; - proto.isBefore = isBefore; - proto.isBetween = isBetween; - proto.isSame = isSame; - proto.isSameOrAfter = isSameOrAfter; - proto.isSameOrBefore = isSameOrBefore; - proto.isValid = isValid$2; - proto.lang = lang; - proto.locale = locale; - proto.localeData = localeData; - proto.max = prototypeMax; - proto.min = prototypeMin; - proto.parsingFlags = parsingFlags; - proto.set = stringSet; - proto.startOf = startOf; - proto.subtract = subtract; - proto.toArray = toArray; - proto.toObject = toObject; - proto.toDate = toDate; - proto.toISOString = toISOString; - proto.inspect = inspect; - proto.toJSON = toJSON; - proto.toString = toString; - proto.unix = unix; - proto.valueOf = valueOf; - proto.creationData = creationData; - proto.year = getSetYear; - proto.isLeapYear = getIsLeapYear; - proto.weekYear = getSetWeekYear; - proto.isoWeekYear = getSetISOWeekYear; - proto.quarter = proto.quarters = getSetQuarter; - proto.month = getSetMonth; - proto.daysInMonth = getDaysInMonth; - proto.week = proto.weeks = getSetWeek; - proto.isoWeek = proto.isoWeeks = getSetISOWeek; - proto.weeksInYear = getWeeksInYear; - proto.isoWeeksInYear = getISOWeeksInYear; - proto.date = getSetDayOfMonth; - proto.day = proto.days = getSetDayOfWeek; - proto.weekday = getSetLocaleDayOfWeek; - proto.isoWeekday = getSetISODayOfWeek; - proto.dayOfYear = getSetDayOfYear; - proto.hour = proto.hours = getSetHour; - proto.minute = proto.minutes = getSetMinute; - proto.second = proto.seconds = getSetSecond; - proto.millisecond = proto.milliseconds = getSetMillisecond; - proto.utcOffset = getSetOffset; - proto.utc = setOffsetToUTC; - proto.local = setOffsetToLocal; - proto.parseZone = setOffsetToParsedOffset; - proto.hasAlignedHourOffset = hasAlignedHourOffset; - proto.isDST = isDaylightSavingTime; - proto.isLocal = isLocal; - proto.isUtcOffset = isUtcOffset; - proto.isUtc = isUtc; - proto.isUTC = isUtc; - proto.zoneAbbr = getZoneAbbr; - proto.zoneName = getZoneName; - proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); - proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); - proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); - proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone); - proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted); - - function createUnix (input) { - return createLocal(input * 1000); - } - - function createInZone () { - return createLocal.apply(null, arguments).parseZone(); - } - - function preParsePostFormat (string) { - return string; - } - - var proto$1 = Locale.prototype; - - proto$1.calendar = calendar; - proto$1.longDateFormat = longDateFormat; - proto$1.invalidDate = invalidDate; - proto$1.ordinal = ordinal; - proto$1.preparse = preParsePostFormat; - proto$1.postformat = preParsePostFormat; - proto$1.relativeTime = relativeTime; - proto$1.pastFuture = pastFuture; - proto$1.set = set; - - proto$1.months = localeMonths; - proto$1.monthsShort = localeMonthsShort; - proto$1.monthsParse = localeMonthsParse; - proto$1.monthsRegex = monthsRegex; - proto$1.monthsShortRegex = monthsShortRegex; - proto$1.week = localeWeek; - proto$1.firstDayOfYear = localeFirstDayOfYear; - proto$1.firstDayOfWeek = localeFirstDayOfWeek; - - proto$1.weekdays = localeWeekdays; - proto$1.weekdaysMin = localeWeekdaysMin; - proto$1.weekdaysShort = localeWeekdaysShort; - proto$1.weekdaysParse = localeWeekdaysParse; - - proto$1.weekdaysRegex = weekdaysRegex; - proto$1.weekdaysShortRegex = weekdaysShortRegex; - proto$1.weekdaysMinRegex = weekdaysMinRegex; - - proto$1.isPM = localeIsPM; - proto$1.meridiem = localeMeridiem; - - function get$1 (format, index, field, setter) { - var locale = getLocale(); - var utc = createUTC().set(setter, index); - return locale[field](utc, format); - } - - function listMonthsImpl (format, index, field) { - if (isNumber(format)) { - index = format; - format = undefined; - } - - format = format || ''; - - if (index != null) { - return get$1(format, index, field, 'month'); - } - - var i; - var out = []; - for (i = 0; i < 12; i++) { - out[i] = get$1(format, i, field, 'month'); - } - return out; - } - - // () - // (5) - // (fmt, 5) - // (fmt) - // (true) - // (true, 5) - // (true, fmt, 5) - // (true, fmt) - function listWeekdaysImpl (localeSorted, format, index, field) { - if (typeof localeSorted === 'boolean') { - if (isNumber(format)) { - index = format; - format = undefined; - } - - format = format || ''; - } else { - format = localeSorted; - index = format; - localeSorted = false; - - if (isNumber(format)) { - index = format; - format = undefined; - } - - format = format || ''; - } - - var locale = getLocale(), - shift = localeSorted ? locale._week.dow : 0; - - if (index != null) { - return get$1(format, (index + shift) % 7, field, 'day'); - } - - var i; - var out = []; - for (i = 0; i < 7; i++) { - out[i] = get$1(format, (i + shift) % 7, field, 'day'); - } - return out; - } - - function listMonths (format, index) { - return listMonthsImpl(format, index, 'months'); - } - - function listMonthsShort (format, index) { - return listMonthsImpl(format, index, 'monthsShort'); - } - - function listWeekdays (localeSorted, format, index) { - return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); - } - - function listWeekdaysShort (localeSorted, format, index) { - return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); - } - - function listWeekdaysMin (localeSorted, format, index) { - return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); - } - - getSetGlobalLocale('en', { - dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, - ordinal : function (number) { - var b = number % 10, - output = (toInt(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); - - // Side effect imports - - hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale); - hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale); - - var mathAbs = Math.abs; - - function abs () { - var data = this._data; - - this._milliseconds = mathAbs(this._milliseconds); - this._days = mathAbs(this._days); - this._months = mathAbs(this._months); - - data.milliseconds = mathAbs(data.milliseconds); - data.seconds = mathAbs(data.seconds); - data.minutes = mathAbs(data.minutes); - data.hours = mathAbs(data.hours); - data.months = mathAbs(data.months); - data.years = mathAbs(data.years); - - return this; - } - - function addSubtract$1 (duration, input, value, direction) { - var other = createDuration(input, value); - - duration._milliseconds += direction * other._milliseconds; - duration._days += direction * other._days; - duration._months += direction * other._months; - - return duration._bubble(); - } - - // supports only 2.0-style add(1, 's') or add(duration) - function add$1 (input, value) { - return addSubtract$1(this, input, value, 1); - } - - // supports only 2.0-style subtract(1, 's') or subtract(duration) - function subtract$1 (input, value) { - return addSubtract$1(this, input, value, -1); - } - - function absCeil (number) { - if (number < 0) { - return Math.floor(number); - } else { - return Math.ceil(number); - } - } - - function bubble () { - var milliseconds = this._milliseconds; - var days = this._days; - var months = this._months; - var data = this._data; - var seconds, minutes, hours, years, monthsFromDays; - - // if we have a mix of positive and negative values, bubble down first - // check: https://github.com/moment/moment/issues/2166 - if (!((milliseconds >= 0 && days >= 0 && months >= 0) || - (milliseconds <= 0 && days <= 0 && months <= 0))) { - milliseconds += absCeil(monthsToDays(months) + days) * 864e5; - days = 0; - months = 0; - } - - // The following code bubbles up values, see the tests for - // examples of what that means. - data.milliseconds = milliseconds % 1000; - - seconds = absFloor(milliseconds / 1000); - data.seconds = seconds % 60; - - minutes = absFloor(seconds / 60); - data.minutes = minutes % 60; - - hours = absFloor(minutes / 60); - data.hours = hours % 24; - - days += absFloor(hours / 24); - - // convert days to months - monthsFromDays = absFloor(daysToMonths(days)); - months += monthsFromDays; - days -= absCeil(monthsToDays(monthsFromDays)); - - // 12 months -> 1 year - years = absFloor(months / 12); - months %= 12; - - data.days = days; - data.months = months; - data.years = years; - - return this; - } - - function daysToMonths (days) { - // 400 years have 146097 days (taking into account leap year rules) - // 400 years have 12 months === 4800 - return days * 4800 / 146097; - } - - function monthsToDays (months) { - // the reverse of daysToMonths - return months * 146097 / 4800; - } - - function as (units) { - if (!this.isValid()) { - return NaN; - } - var days; - var months; - var milliseconds = this._milliseconds; - - units = normalizeUnits(units); - - if (units === 'month' || units === 'quarter' || units === 'year') { - days = this._days + milliseconds / 864e5; - months = this._months + daysToMonths(days); - switch (units) { - case 'month': return months; - case 'quarter': return months / 3; - case 'year': return months / 12; - } - } else { - // handle milliseconds separately because of floating point math errors (issue #1867) - days = this._days + Math.round(monthsToDays(this._months)); - switch (units) { - case 'week' : return days / 7 + milliseconds / 6048e5; - case 'day' : return days + milliseconds / 864e5; - case 'hour' : return days * 24 + milliseconds / 36e5; - case 'minute' : return days * 1440 + milliseconds / 6e4; - case 'second' : return days * 86400 + milliseconds / 1000; - // Math.floor prevents floating point math errors here - case 'millisecond': return Math.floor(days * 864e5) + milliseconds; - default: throw new Error('Unknown unit ' + units); - } - } - } - - // TODO: Use this.as('ms')? - function valueOf$1 () { - if (!this.isValid()) { - return NaN; - } - return ( - this._milliseconds + - this._days * 864e5 + - (this._months % 12) * 2592e6 + - toInt(this._months / 12) * 31536e6 - ); - } - - function makeAs (alias) { - return function () { - return this.as(alias); - }; - } - - var asMilliseconds = makeAs('ms'); - var asSeconds = makeAs('s'); - var asMinutes = makeAs('m'); - var asHours = makeAs('h'); - var asDays = makeAs('d'); - var asWeeks = makeAs('w'); - var asMonths = makeAs('M'); - var asQuarters = makeAs('Q'); - var asYears = makeAs('y'); - - function clone$1 () { - return createDuration(this); - } - - function get$2 (units) { - units = normalizeUnits(units); - return this.isValid() ? this[units + 's']() : NaN; - } - - function makeGetter(name) { - return function () { - return this.isValid() ? this._data[name] : NaN; - }; - } - - var milliseconds = makeGetter('milliseconds'); - var seconds = makeGetter('seconds'); - var minutes = makeGetter('minutes'); - var hours = makeGetter('hours'); - var days = makeGetter('days'); - var months = makeGetter('months'); - var years = makeGetter('years'); - - function weeks () { - return absFloor(this.days() / 7); - } - - var round = Math.round; - var thresholds = { - ss: 44, // a few seconds to seconds - s : 45, // seconds to minute - m : 45, // minutes to hour - h : 22, // hours to day - d : 26, // days to month - M : 11 // months to year - }; - - // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize - function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { - return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); - } - - function relativeTime$1 (posNegDuration, withoutSuffix, locale) { - var duration = createDuration(posNegDuration).abs(); - var seconds = round(duration.as('s')); - var minutes = round(duration.as('m')); - var hours = round(duration.as('h')); - var days = round(duration.as('d')); - var months = round(duration.as('M')); - var years = round(duration.as('y')); - - var a = seconds <= thresholds.ss && ['s', seconds] || - seconds < thresholds.s && ['ss', seconds] || - minutes <= 1 && ['m'] || - minutes < thresholds.m && ['mm', minutes] || - hours <= 1 && ['h'] || - hours < thresholds.h && ['hh', hours] || - days <= 1 && ['d'] || - days < thresholds.d && ['dd', days] || - months <= 1 && ['M'] || - months < thresholds.M && ['MM', months] || - years <= 1 && ['y'] || ['yy', years]; - - a[2] = withoutSuffix; - a[3] = +posNegDuration > 0; - a[4] = locale; - return substituteTimeAgo.apply(null, a); - } - - // This function allows you to set the rounding function for relative time strings - function getSetRelativeTimeRounding (roundingFunction) { - if (roundingFunction === undefined) { - return round; - } - if (typeof(roundingFunction) === 'function') { - round = roundingFunction; - return true; - } - return false; - } - - // This function allows you to set a threshold for relative time strings - function getSetRelativeTimeThreshold (threshold, limit) { - if (thresholds[threshold] === undefined) { - return false; - } - if (limit === undefined) { - return thresholds[threshold]; - } - thresholds[threshold] = limit; - if (threshold === 's') { - thresholds.ss = limit - 1; - } - return true; - } - - function humanize (withSuffix) { - if (!this.isValid()) { - return this.localeData().invalidDate(); - } - - var locale = this.localeData(); - var output = relativeTime$1(this, !withSuffix, locale); - - if (withSuffix) { - output = locale.pastFuture(+this, output); - } - - return locale.postformat(output); - } - - var abs$1 = Math.abs; - - function sign(x) { - return ((x > 0) - (x < 0)) || +x; - } - - function toISOString$1() { - // for ISO strings we do not use the normal bubbling rules: - // * milliseconds bubble up until they become hours - // * days do not bubble at all - // * months bubble up until they become years - // This is because there is no context-free conversion between hours and days - // (think of clock changes) - // and also not between days and months (28-31 days per month) - if (!this.isValid()) { - return this.localeData().invalidDate(); - } - - var seconds = abs$1(this._milliseconds) / 1000; - var days = abs$1(this._days); - var months = abs$1(this._months); - var minutes, hours, years; - - // 3600 seconds -> 60 minutes -> 1 hour - minutes = absFloor(seconds / 60); - hours = absFloor(minutes / 60); - seconds %= 60; - minutes %= 60; - - // 12 months -> 1 year - years = absFloor(months / 12); - months %= 12; - - - // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js - var Y = years; - var M = months; - var D = days; - var h = hours; - var m = minutes; - var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; - var total = this.asSeconds(); - - if (!total) { - // this is the same as C#'s (Noda) and python (isodate)... - // but not other JS (goog.date) - return 'P0D'; - } - - var totalSign = total < 0 ? '-' : ''; - var ymSign = sign(this._months) !== sign(total) ? '-' : ''; - var daysSign = sign(this._days) !== sign(total) ? '-' : ''; - var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; - - return totalSign + 'P' + - (Y ? ymSign + Y + 'Y' : '') + - (M ? ymSign + M + 'M' : '') + - (D ? daysSign + D + 'D' : '') + - ((h || m || s) ? 'T' : '') + - (h ? hmsSign + h + 'H' : '') + - (m ? hmsSign + m + 'M' : '') + - (s ? hmsSign + s + 'S' : ''); - } - - var proto$2 = Duration.prototype; - - proto$2.isValid = isValid$1; - proto$2.abs = abs; - proto$2.add = add$1; - proto$2.subtract = subtract$1; - proto$2.as = as; - proto$2.asMilliseconds = asMilliseconds; - proto$2.asSeconds = asSeconds; - proto$2.asMinutes = asMinutes; - proto$2.asHours = asHours; - proto$2.asDays = asDays; - proto$2.asWeeks = asWeeks; - proto$2.asMonths = asMonths; - proto$2.asQuarters = asQuarters; - proto$2.asYears = asYears; - proto$2.valueOf = valueOf$1; - proto$2._bubble = bubble; - proto$2.clone = clone$1; - proto$2.get = get$2; - proto$2.milliseconds = milliseconds; - proto$2.seconds = seconds; - proto$2.minutes = minutes; - proto$2.hours = hours; - proto$2.days = days; - proto$2.weeks = weeks; - proto$2.months = months; - proto$2.years = years; - proto$2.humanize = humanize; - proto$2.toISOString = toISOString$1; - proto$2.toString = toISOString$1; - proto$2.toJSON = toISOString$1; - proto$2.locale = locale; - proto$2.localeData = localeData; - - proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1); - proto$2.lang = lang; - - // Side effect imports - - // FORMATTING - - addFormatToken('X', 0, 0, 'unix'); - addFormatToken('x', 0, 0, 'valueOf'); - - // PARSING - - addRegexToken('x', matchSigned); - addRegexToken('X', matchTimestamp); - addParseToken('X', function (input, array, config) { - config._d = new Date(parseFloat(input, 10) * 1000); - }); - addParseToken('x', function (input, array, config) { - config._d = new Date(toInt(input)); - }); - - // Side effect imports - - - hooks.version = '2.24.0'; - - setHookCallback(createLocal); - - hooks.fn = proto; - hooks.min = min; - hooks.max = max; - hooks.now = now; - hooks.utc = createUTC; - hooks.unix = createUnix; - hooks.months = listMonths; - hooks.isDate = isDate; - hooks.locale = getSetGlobalLocale; - hooks.invalid = createInvalid; - hooks.duration = createDuration; - hooks.isMoment = isMoment; - hooks.weekdays = listWeekdays; - hooks.parseZone = createInZone; - hooks.localeData = getLocale; - hooks.isDuration = isDuration; - hooks.monthsShort = listMonthsShort; - hooks.weekdaysMin = listWeekdaysMin; - hooks.defineLocale = defineLocale; - hooks.updateLocale = updateLocale; - hooks.locales = listLocales; - hooks.weekdaysShort = listWeekdaysShort; - hooks.normalizeUnits = normalizeUnits; - hooks.relativeTimeRounding = getSetRelativeTimeRounding; - hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; - hooks.calendarFormat = getCalendarFormat; - hooks.prototype = proto; - - // currently HTML5 input type only supports 24-hour formats - hooks.HTML5_FMT = { - DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // - DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // - DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // - DATE: 'YYYY-MM-DD', // - TIME: 'HH:mm', // - TIME_SECONDS: 'HH:mm:ss', // - TIME_MS: 'HH:mm:ss.SSS', // - WEEK: 'GGGG-[W]WW', // - MONTH: 'YYYY-MM' // - }; - - return hooks; - -}))); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/browser.js ***! - \*******************************************************************/ -/*! exports provided: getZoomLevel, getTimeSinceLastZoomLevelChanged, onDidChangeZoomLevel, getZoomFactor, getPixelRatio, isEdge, isFirefox, isWebKit, isChrome, isSafari, isWebkitWebView, isIPad, isEdgeWebView, isStandalone */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getZoomLevel", function() { return getZoomLevel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTimeSinceLastZoomLevelChanged", function() { return getTimeSinceLastZoomLevelChanged; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onDidChangeZoomLevel", function() { return onDidChangeZoomLevel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getZoomFactor", function() { return getZoomFactor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPixelRatio", function() { return getPixelRatio; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEdge", function() { return isEdge; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFirefox", function() { return isFirefox; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWebKit", function() { return isWebKit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isChrome", function() { return isChrome; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSafari", function() { return isSafari; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWebkitWebView", function() { return isWebkitWebView; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIPad", function() { return isIPad; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEdgeWebView", function() { return isEdgeWebView; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isStandalone", function() { return isStandalone; }); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class WindowManager { - constructor() { - // --- Zoom Level - this._zoomLevel = 0; - this._lastZoomLevelChangeTime = 0; - this._onDidChangeZoomLevel = new _common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this.onDidChangeZoomLevel = this._onDidChangeZoomLevel.event; - // --- Zoom Factor - this._zoomFactor = 1; - } - getZoomLevel() { - return this._zoomLevel; - } - getTimeSinceLastZoomLevelChanged() { - return Date.now() - this._lastZoomLevelChangeTime; - } - getZoomFactor() { - return this._zoomFactor; - } - // --- Pixel Ratio - getPixelRatio() { - let ctx = document.createElement('canvas').getContext('2d'); - let dpr = window.devicePixelRatio || 1; - let bsr = ctx.webkitBackingStorePixelRatio || - ctx.mozBackingStorePixelRatio || - ctx.msBackingStorePixelRatio || - ctx.oBackingStorePixelRatio || - ctx.backingStorePixelRatio || 1; - return dpr / bsr; - } -} -WindowManager.INSTANCE = new WindowManager(); -function getZoomLevel() { - return WindowManager.INSTANCE.getZoomLevel(); -} -/** Returns the time (in ms) since the zoom level was changed */ -function getTimeSinceLastZoomLevelChanged() { - return WindowManager.INSTANCE.getTimeSinceLastZoomLevelChanged(); -} -function onDidChangeZoomLevel(callback) { - return WindowManager.INSTANCE.onDidChangeZoomLevel(callback); -} -/** The zoom scale for an index, e.g. 1, 1.2, 1.4 */ -function getZoomFactor() { - return WindowManager.INSTANCE.getZoomFactor(); -} -function getPixelRatio() { - return WindowManager.INSTANCE.getPixelRatio(); -} -const userAgent = navigator.userAgent; -const isEdge = (userAgent.indexOf('Edge/') >= 0); -const isFirefox = (userAgent.indexOf('Firefox') >= 0); -const isWebKit = (userAgent.indexOf('AppleWebKit') >= 0); -const isChrome = (userAgent.indexOf('Chrome') >= 0); -const isSafari = (!isChrome && (userAgent.indexOf('Safari') >= 0)); -const isWebkitWebView = (!isChrome && !isSafari && isWebKit); -const isIPad = (userAgent.indexOf('iPad') >= 0 || (isSafari && navigator.maxTouchPoints > 0)); -const isEdgeWebView = isEdge && (userAgent.indexOf('WebView/') >= 0); -const isStandalone = (window.matchMedia && window.matchMedia('(display-mode: standalone)').matches); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/canIUse.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/canIUse.js ***! - \*******************************************************************/ -/*! exports provided: BrowserFeatures */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserFeatures", function() { return BrowserFeatures; }); -/* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -/** - * Browser feature we can support in current platform, browser and environment. - */ -const BrowserFeatures = { - clipboard: { - writeText: (_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isNative"] - || (document.queryCommandSupported && document.queryCommandSupported('copy')) - || !!(navigator && navigator.clipboard && navigator.clipboard.writeText)), - readText: (_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isNative"] - || !!(navigator && navigator.clipboard && navigator.clipboard.readText)), - richText: (() => { - if (_browser_js__WEBPACK_IMPORTED_MODULE_0__["isEdge"]) { - let index = navigator.userAgent.indexOf('Edge/'); - let version = parseInt(navigator.userAgent.substring(index + 5, navigator.userAgent.indexOf('.', index)), 10); - if (!version || (version >= 12 && version <= 16)) { - return false; - } - } - return true; - })() - }, - keyboard: (() => { - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isNative"] || _browser_js__WEBPACK_IMPORTED_MODULE_0__["isStandalone"]) { - return 0 /* Always */; - } - if (navigator.keyboard || _browser_js__WEBPACK_IMPORTED_MODULE_0__["isSafari"]) { - return 1 /* FullScreen */; - } - return 2 /* None */; - })(), - // 'ontouchstart' in window always evaluates to true with typescript's modern typings. This causes `window` to be - // `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast - touch: 'ontouchstart' in window || navigator.maxTouchPoints > 0 || window.navigator.msMaxTouchPoints > 0, - pointerEvents: window.PointerEvent && ('ontouchstart' in window || window.navigator.maxTouchPoints > 0 || navigator.maxTouchPoints > 0 || window.navigator.msMaxTouchPoints > 0) -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/codicons.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/codicons.js ***! - \********************************************************************/ -/*! exports provided: renderCodiconsAsElement */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCodiconsAsElement", function() { return renderCodiconsAsElement; }); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_codicons_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -function renderCodiconsAsElement(text) { - const elements = new Array(); - let match; - let textStart = 0, textStop = 0; - while ((match = _common_codicons_js__WEBPACK_IMPORTED_MODULE_1__["renderCodiconsRegex"].exec(text)) !== null) { - textStop = match.index || 0; - elements.push(text.substring(textStart, textStop)); - textStart = (match.index || 0) + match[0].length; - const [, escaped, codicon, name, animation] = match; - elements.push(escaped ? `$(${codicon})` : _dom_js__WEBPACK_IMPORTED_MODULE_0__["$"](`span.codicon.codicon-${name}${animation ? `.codicon-animation-${animation}` : ''}`)); - } - if (textStart < text.length) { - elements.push(text.substring(textStart)); - } - return elements; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/dnd.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/dnd.js ***! - \***************************************************************/ -/*! exports provided: DataTransfers, DragAndDropData, StaticDND */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataTransfers", function() { return DataTransfers; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragAndDropData", function() { return DragAndDropData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticDND", function() { return StaticDND; }); -// Common data transfers -const DataTransfers = { - /** - * Application specific resource transfer type - */ - RESOURCES: 'ResourceURLs', - /** - * Browser specific transfer type to download - */ - DOWNLOAD_URL: 'DownloadURL', - /** - * Browser specific transfer type for files - */ - FILES: 'Files', - /** - * Typically transfer type for copy/paste transfers. - */ - TEXT: 'text/plain' -}; -class DragAndDropData { - constructor(data) { - this.data = data; - } - update() { - // noop - } - getData() { - return this.data; - } -} -const StaticDND = { - CurrentDragAndDropData: undefined -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/dom.js ***! - \***************************************************************/ -/*! exports provided: clearNode, removeNode, isInDOM, hasClass, addClass, addClasses, removeClass, removeClasses, toggleClass, addDisposableListener, addStandardDisposableListener, addStandardDisposableGenericMouseDownListner, addDisposableGenericMouseDownListner, addDisposableGenericMouseUpListner, addDisposableNonBubblingMouseOutListener, addDisposableNonBubblingPointerOutListener, runAtThisOrScheduleAtNextAnimationFrame, scheduleAtNextAnimationFrame, addDisposableThrottledListener, getComputedStyle, getClientArea, Dimension, getTopLeftOffset, getDomNodePagePosition, StandardWindow, getTotalWidth, getContentWidth, getContentHeight, getTotalHeight, isAncestor, findParentWithClass, hasParentWithClass, isShadowRoot, isInShadowDOM, getShadowRoot, getActiveElement, createStyleSheet, createCSSRule, removeCSSRulesContainingSelector, isHTMLElement, EventType, EventHelper, saveParentsScrollTop, restoreParentsScrollTop, trackFocus, append, reset, Namespace, $, show, hide, removeTabIndexAndUpdateFocus, getElementsByTagName, computeScreenAwareSize, windowOpenNoOpener, animate, asDomUri, asCSSUrl */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearNode", function() { return clearNode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeNode", function() { return removeNode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInDOM", function() { return isInDOM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasClass", function() { return hasClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClasses", function() { return addClasses; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeClass", function() { return removeClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeClasses", function() { return removeClasses; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleClass", function() { return toggleClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addDisposableListener", function() { return addDisposableListener; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addStandardDisposableListener", function() { return addStandardDisposableListener; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addStandardDisposableGenericMouseDownListner", function() { return addStandardDisposableGenericMouseDownListner; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addDisposableGenericMouseDownListner", function() { return addDisposableGenericMouseDownListner; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addDisposableGenericMouseUpListner", function() { return addDisposableGenericMouseUpListner; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addDisposableNonBubblingMouseOutListener", function() { return addDisposableNonBubblingMouseOutListener; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addDisposableNonBubblingPointerOutListener", function() { return addDisposableNonBubblingPointerOutListener; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runAtThisOrScheduleAtNextAnimationFrame", function() { return runAtThisOrScheduleAtNextAnimationFrame; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scheduleAtNextAnimationFrame", function() { return scheduleAtNextAnimationFrame; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addDisposableThrottledListener", function() { return addDisposableThrottledListener; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getComputedStyle", function() { return getComputedStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClientArea", function() { return getClientArea; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dimension", function() { return Dimension; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTopLeftOffset", function() { return getTopLeftOffset; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDomNodePagePosition", function() { return getDomNodePagePosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandardWindow", function() { return StandardWindow; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTotalWidth", function() { return getTotalWidth; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getContentWidth", function() { return getContentWidth; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getContentHeight", function() { return getContentHeight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTotalHeight", function() { return getTotalHeight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAncestor", function() { return isAncestor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findParentWithClass", function() { return findParentWithClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasParentWithClass", function() { return hasParentWithClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isShadowRoot", function() { return isShadowRoot; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInShadowDOM", function() { return isInShadowDOM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getShadowRoot", function() { return getShadowRoot; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActiveElement", function() { return getActiveElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStyleSheet", function() { return createStyleSheet; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCSSRule", function() { return createCSSRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCSSRulesContainingSelector", function() { return removeCSSRulesContainingSelector; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHTMLElement", function() { return isHTMLElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventType", function() { return EventType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventHelper", function() { return EventHelper; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "saveParentsScrollTop", function() { return saveParentsScrollTop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "restoreParentsScrollTop", function() { return restoreParentsScrollTop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trackFocus", function() { return trackFocus; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "append", function() { return append; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reset", function() { return reset; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Namespace", function() { return Namespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$", function() { return $; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "show", function() { return show; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hide", function() { return hide; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeTabIndexAndUpdateFocus", function() { return removeTabIndexAndUpdateFocus; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getElementsByTagName", function() { return getElementsByTagName; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeScreenAwareSize", function() { return computeScreenAwareSize; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowOpenNoOpener", function() { return windowOpenNoOpener; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "animate", function() { return animate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asDomUri", function() { return asDomUri; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asCSSUrl", function() { return asCSSUrl; }); -/* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./event.js */ "./node_modules/monaco-editor/esm/vs/base/browser/event.js"); -/* harmony import */ var _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keyboardEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js"); -/* harmony import */ var _mouseEvent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/* harmony import */ var _common_async_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _common_errors_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _common_network_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../common/network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _canIUse_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./canIUse.js */ "./node_modules/monaco-editor/esm/vs/base/browser/canIUse.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - -function clearNode(node) { - while (node.firstChild) { - node.removeChild(node.firstChild); - } -} -/** - * @deprecated use `node.remove()` instead - */ -function removeNode(node) { - if (node.parentNode) { - node.parentNode.removeChild(node); - } -} -function isInDOM(node) { - while (node) { - if (node === document.body) { - return true; - } - node = node.parentNode || node.host; - } - return false; -} -const _classList = new class { - hasClass(node, className) { - return Boolean(className) && node.classList && node.classList.contains(className); - } - addClasses(node, ...classNames) { - classNames.forEach(nameValue => nameValue.split(' ').forEach(name => this.addClass(node, name))); - } - addClass(node, className) { - if (className && node.classList) { - node.classList.add(className); - } - } - removeClass(node, className) { - if (className && node.classList) { - node.classList.remove(className); - } - } - removeClasses(node, ...classNames) { - classNames.forEach(nameValue => nameValue.split(' ').forEach(name => this.removeClass(node, name))); - } - toggleClass(node, className, shouldHaveIt) { - if (node.classList) { - node.classList.toggle(className, shouldHaveIt); - } - } -}; -/** @deprecated ES6 - use classList*/ -const hasClass = _classList.hasClass.bind(_classList); -/** @deprecated ES6 - use classList*/ -const addClass = _classList.addClass.bind(_classList); -/** @deprecated ES6 - use classList*/ -const addClasses = _classList.addClasses.bind(_classList); -/** @deprecated ES6 - use classList*/ -const removeClass = _classList.removeClass.bind(_classList); -/** @deprecated ES6 - use classList*/ -const removeClasses = _classList.removeClasses.bind(_classList); -/** @deprecated ES6 - use classList*/ -const toggleClass = _classList.toggleClass.bind(_classList); -class DomListener { - constructor(node, type, handler, options) { - this._node = node; - this._type = type; - this._handler = handler; - this._options = (options || false); - this._node.addEventListener(this._type, this._handler, this._options); - } - dispose() { - if (!this._handler) { - // Already disposed - return; - } - this._node.removeEventListener(this._type, this._handler, this._options); - // Prevent leakers from holding on to the dom or handler func - this._node = null; - this._handler = null; - } -} -function addDisposableListener(node, type, handler, useCaptureOrOptions) { - return new DomListener(node, type, handler, useCaptureOrOptions); -} -function _wrapAsStandardMouseEvent(handler) { - return function (e) { - return handler(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_3__["StandardMouseEvent"](e)); - }; -} -function _wrapAsStandardKeyboardEvent(handler) { - return function (e) { - return handler(new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_2__["StandardKeyboardEvent"](e)); - }; -} -let addStandardDisposableListener = function addStandardDisposableListener(node, type, handler, useCapture) { - let wrapHandler = handler; - if (type === 'click' || type === 'mousedown') { - wrapHandler = _wrapAsStandardMouseEvent(handler); - } - else if (type === 'keydown' || type === 'keypress' || type === 'keyup') { - wrapHandler = _wrapAsStandardKeyboardEvent(handler); - } - return addDisposableListener(node, type, wrapHandler, useCapture); -}; -let addStandardDisposableGenericMouseDownListner = function addStandardDisposableListener(node, handler, useCapture) { - let wrapHandler = _wrapAsStandardMouseEvent(handler); - return addDisposableGenericMouseDownListner(node, wrapHandler, useCapture); -}; -function addDisposableGenericMouseDownListner(node, handler, useCapture) { - return addDisposableListener(node, _common_platform_js__WEBPACK_IMPORTED_MODULE_8__["isIOS"] && _canIUse_js__WEBPACK_IMPORTED_MODULE_11__["BrowserFeatures"].pointerEvents ? EventType.POINTER_DOWN : EventType.MOUSE_DOWN, handler, useCapture); -} -function addDisposableGenericMouseUpListner(node, handler, useCapture) { - return addDisposableListener(node, _common_platform_js__WEBPACK_IMPORTED_MODULE_8__["isIOS"] && _canIUse_js__WEBPACK_IMPORTED_MODULE_11__["BrowserFeatures"].pointerEvents ? EventType.POINTER_UP : EventType.MOUSE_UP, handler, useCapture); -} -function addDisposableNonBubblingMouseOutListener(node, handler) { - return addDisposableListener(node, 'mouseout', (e) => { - // Mouse out bubbles, so this is an attempt to ignore faux mouse outs coming from children elements - let toElement = (e.relatedTarget); - while (toElement && toElement !== node) { - toElement = toElement.parentNode; - } - if (toElement === node) { - return; - } - handler(e); - }); -} -function addDisposableNonBubblingPointerOutListener(node, handler) { - return addDisposableListener(node, 'pointerout', (e) => { - // Mouse out bubbles, so this is an attempt to ignore faux mouse outs coming from children elements - let toElement = (e.relatedTarget); - while (toElement && toElement !== node) { - toElement = toElement.parentNode; - } - if (toElement === node) { - return; - } - handler(e); - }); -} -let _animationFrame = null; -function doRequestAnimationFrame(callback) { - if (!_animationFrame) { - const emulatedRequestAnimationFrame = (callback) => { - return setTimeout(() => callback(new Date().getTime()), 0); - }; - _animationFrame = (self.requestAnimationFrame - || self.msRequestAnimationFrame - || self.webkitRequestAnimationFrame - || self.mozRequestAnimationFrame - || self.oRequestAnimationFrame - || emulatedRequestAnimationFrame); - } - return _animationFrame.call(self, callback); -} -/** - * Schedule a callback to be run at the next animation frame. - * This allows multiple parties to register callbacks that should run at the next animation frame. - * If currently in an animation frame, `runner` will be executed immediately. - * @return token that can be used to cancel the scheduled runner (only if `runner` was not executed immediately). - */ -let runAtThisOrScheduleAtNextAnimationFrame; -/** - * Schedule a callback to be run at the next animation frame. - * This allows multiple parties to register callbacks that should run at the next animation frame. - * If currently in an animation frame, `runner` will be executed at the next animation frame. - * @return token that can be used to cancel the scheduled runner. - */ -let scheduleAtNextAnimationFrame; -class AnimationFrameQueueItem { - constructor(runner, priority = 0) { - this._runner = runner; - this.priority = priority; - this._canceled = false; - } - dispose() { - this._canceled = true; - } - execute() { - if (this._canceled) { - return; - } - try { - this._runner(); - } - catch (e) { - Object(_common_errors_js__WEBPACK_IMPORTED_MODULE_5__["onUnexpectedError"])(e); - } - } - // Sort by priority (largest to lowest) - static sort(a, b) { - return b.priority - a.priority; - } -} -(function () { - /** - * The runners scheduled at the next animation frame - */ - let NEXT_QUEUE = []; - /** - * The runners scheduled at the current animation frame - */ - let CURRENT_QUEUE = null; - /** - * A flag to keep track if the native requestAnimationFrame was already called - */ - let animFrameRequested = false; - /** - * A flag to indicate if currently handling a native requestAnimationFrame callback - */ - let inAnimationFrameRunner = false; - let animationFrameRunner = () => { - animFrameRequested = false; - CURRENT_QUEUE = NEXT_QUEUE; - NEXT_QUEUE = []; - inAnimationFrameRunner = true; - while (CURRENT_QUEUE.length > 0) { - CURRENT_QUEUE.sort(AnimationFrameQueueItem.sort); - let top = CURRENT_QUEUE.shift(); - top.execute(); - } - inAnimationFrameRunner = false; - }; - scheduleAtNextAnimationFrame = (runner, priority = 0) => { - let item = new AnimationFrameQueueItem(runner, priority); - NEXT_QUEUE.push(item); - if (!animFrameRequested) { - animFrameRequested = true; - doRequestAnimationFrame(animationFrameRunner); - } - return item; - }; - runAtThisOrScheduleAtNextAnimationFrame = (runner, priority) => { - if (inAnimationFrameRunner) { - let item = new AnimationFrameQueueItem(runner, priority); - CURRENT_QUEUE.push(item); - return item; - } - else { - return scheduleAtNextAnimationFrame(runner, priority); - } - }; -})(); -const MINIMUM_TIME_MS = 16; -const DEFAULT_EVENT_MERGER = function (lastEvent, currentEvent) { - return currentEvent; -}; -class TimeoutThrottledDomListener extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["Disposable"] { - constructor(node, type, handler, eventMerger = DEFAULT_EVENT_MERGER, minimumTimeMs = MINIMUM_TIME_MS) { - super(); - let lastEvent = null; - let lastHandlerTime = 0; - let timeout = this._register(new _common_async_js__WEBPACK_IMPORTED_MODULE_4__["TimeoutTimer"]()); - let invokeHandler = () => { - lastHandlerTime = (new Date()).getTime(); - handler(lastEvent); - lastEvent = null; - }; - this._register(addDisposableListener(node, type, (e) => { - lastEvent = eventMerger(lastEvent, e); - let elapsedTime = (new Date()).getTime() - lastHandlerTime; - if (elapsedTime >= minimumTimeMs) { - timeout.cancel(); - invokeHandler(); - } - else { - timeout.setIfNotSet(invokeHandler, minimumTimeMs - elapsedTime); - } - })); - } -} -function addDisposableThrottledListener(node, type, handler, eventMerger, minimumTimeMs) { - return new TimeoutThrottledDomListener(node, type, handler, eventMerger, minimumTimeMs); -} -function getComputedStyle(el) { - return document.defaultView.getComputedStyle(el, null); -} -function getClientArea(element) { - // Try with DOM clientWidth / clientHeight - if (element !== document.body) { - return new Dimension(element.clientWidth, element.clientHeight); - } - // If visual view port exits and it's on mobile, it should be used instead of window innerWidth / innerHeight, or document.body.clientWidth / document.body.clientHeight - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_8__["isIOS"] && window.visualViewport) { - const width = window.visualViewport.width; - const height = window.visualViewport.height - (_browser_js__WEBPACK_IMPORTED_MODULE_0__["isStandalone"] - // in PWA mode, the visual viewport always includes the safe-area-inset-bottom (which is for the home indicator) - // even when you are using the onscreen monitor, the visual viewport will include the area between system statusbar and the onscreen keyboard - // plus the area between onscreen keyboard and the bottom bezel, which is 20px on iOS. - ? (20 + 4) // + 4px for body margin - : 0); - return new Dimension(width, height); - } - // Try innerWidth / innerHeight - if (window.innerWidth && window.innerHeight) { - return new Dimension(window.innerWidth, window.innerHeight); - } - // Try with document.body.clientWidth / document.body.clientHeight - if (document.body && document.body.clientWidth && document.body.clientHeight) { - return new Dimension(document.body.clientWidth, document.body.clientHeight); - } - // Try with document.documentElement.clientWidth / document.documentElement.clientHeight - if (document.documentElement && document.documentElement.clientWidth && document.documentElement.clientHeight) { - return new Dimension(document.documentElement.clientWidth, document.documentElement.clientHeight); - } - throw new Error('Unable to figure out browser width and height'); -} -class SizeUtils { - // Adapted from WinJS - // Converts a CSS positioning string for the specified element to pixels. - static convertToPixels(element, value) { - return parseFloat(value) || 0; - } - static getDimension(element, cssPropertyName, jsPropertyName) { - let computedStyle = getComputedStyle(element); - let value = '0'; - if (computedStyle) { - if (computedStyle.getPropertyValue) { - value = computedStyle.getPropertyValue(cssPropertyName); - } - else { - // IE8 - value = computedStyle.getAttribute(jsPropertyName); - } - } - return SizeUtils.convertToPixels(element, value); - } - static getBorderLeftWidth(element) { - return SizeUtils.getDimension(element, 'border-left-width', 'borderLeftWidth'); - } - static getBorderRightWidth(element) { - return SizeUtils.getDimension(element, 'border-right-width', 'borderRightWidth'); - } - static getBorderTopWidth(element) { - return SizeUtils.getDimension(element, 'border-top-width', 'borderTopWidth'); - } - static getBorderBottomWidth(element) { - return SizeUtils.getDimension(element, 'border-bottom-width', 'borderBottomWidth'); - } - static getPaddingLeft(element) { - return SizeUtils.getDimension(element, 'padding-left', 'paddingLeft'); - } - static getPaddingRight(element) { - return SizeUtils.getDimension(element, 'padding-right', 'paddingRight'); - } - static getPaddingTop(element) { - return SizeUtils.getDimension(element, 'padding-top', 'paddingTop'); - } - static getPaddingBottom(element) { - return SizeUtils.getDimension(element, 'padding-bottom', 'paddingBottom'); - } - static getMarginLeft(element) { - return SizeUtils.getDimension(element, 'margin-left', 'marginLeft'); - } - static getMarginTop(element) { - return SizeUtils.getDimension(element, 'margin-top', 'marginTop'); - } - static getMarginRight(element) { - return SizeUtils.getDimension(element, 'margin-right', 'marginRight'); - } - static getMarginBottom(element) { - return SizeUtils.getDimension(element, 'margin-bottom', 'marginBottom'); - } -} -class Dimension { - constructor(width, height) { - this.width = width; - this.height = height; - } -} -function getTopLeftOffset(element) { - // Adapted from WinJS.Utilities.getPosition - // and added borders to the mix - let offsetParent = element.offsetParent; - let top = element.offsetTop; - let left = element.offsetLeft; - while ((element = element.parentNode) !== null - && element !== document.body - && element !== document.documentElement) { - top -= element.scrollTop; - const c = isShadowRoot(element) ? null : getComputedStyle(element); - if (c) { - left -= c.direction !== 'rtl' ? element.scrollLeft : -element.scrollLeft; - } - if (element === offsetParent) { - left += SizeUtils.getBorderLeftWidth(element); - top += SizeUtils.getBorderTopWidth(element); - top += element.offsetTop; - left += element.offsetLeft; - offsetParent = element.offsetParent; - } - } - return { - left: left, - top: top - }; -} -/** - * Returns the position of a dom node relative to the entire page. - */ -function getDomNodePagePosition(domNode) { - let bb = domNode.getBoundingClientRect(); - return { - left: bb.left + StandardWindow.scrollX, - top: bb.top + StandardWindow.scrollY, - width: bb.width, - height: bb.height - }; -} -const StandardWindow = new class { - get scrollX() { - if (typeof window.scrollX === 'number') { - // modern browsers - return window.scrollX; - } - else { - return document.body.scrollLeft + document.documentElement.scrollLeft; - } - } - get scrollY() { - if (typeof window.scrollY === 'number') { - // modern browsers - return window.scrollY; - } - else { - return document.body.scrollTop + document.documentElement.scrollTop; - } - } -}; -// Adapted from WinJS -// Gets the width of the element, including margins. -function getTotalWidth(element) { - let margin = SizeUtils.getMarginLeft(element) + SizeUtils.getMarginRight(element); - return element.offsetWidth + margin; -} -function getContentWidth(element) { - let border = SizeUtils.getBorderLeftWidth(element) + SizeUtils.getBorderRightWidth(element); - let padding = SizeUtils.getPaddingLeft(element) + SizeUtils.getPaddingRight(element); - return element.offsetWidth - border - padding; -} -// Adapted from WinJS -// Gets the height of the content of the specified element. The content height does not include borders or padding. -function getContentHeight(element) { - let border = SizeUtils.getBorderTopWidth(element) + SizeUtils.getBorderBottomWidth(element); - let padding = SizeUtils.getPaddingTop(element) + SizeUtils.getPaddingBottom(element); - return element.offsetHeight - border - padding; -} -// Adapted from WinJS -// Gets the height of the element, including its margins. -function getTotalHeight(element) { - let margin = SizeUtils.getMarginTop(element) + SizeUtils.getMarginBottom(element); - return element.offsetHeight + margin; -} -// ---------------------------------------------------------------------------------------- -function isAncestor(testChild, testAncestor) { - while (testChild) { - if (testChild === testAncestor) { - return true; - } - testChild = testChild.parentNode; - } - return false; -} -function findParentWithClass(node, clazz, stopAtClazzOrNode) { - while (node && node.nodeType === node.ELEMENT_NODE) { - if (hasClass(node, clazz)) { - return node; - } - if (stopAtClazzOrNode) { - if (typeof stopAtClazzOrNode === 'string') { - if (hasClass(node, stopAtClazzOrNode)) { - return null; - } - } - else { - if (node === stopAtClazzOrNode) { - return null; - } - } - } - node = node.parentNode; - } - return null; -} -function hasParentWithClass(node, clazz, stopAtClazzOrNode) { - return !!findParentWithClass(node, clazz, stopAtClazzOrNode); -} -function isShadowRoot(node) { - return (node && !!node.host && !!node.mode); -} -function isInShadowDOM(domNode) { - return !!getShadowRoot(domNode); -} -function getShadowRoot(domNode) { - while (domNode.parentNode) { - if (domNode === document.body) { - // reached the body - return null; - } - domNode = domNode.parentNode; - } - return isShadowRoot(domNode) ? domNode : null; -} -function getActiveElement() { - let result = document.activeElement; - while (result === null || result === void 0 ? void 0 : result.shadowRoot) { - result = result.shadowRoot.activeElement; - } - return result; -} -function createStyleSheet(container = document.getElementsByTagName('head')[0]) { - let style = document.createElement('style'); - style.type = 'text/css'; - style.media = 'screen'; - container.appendChild(style); - return style; -} -let _sharedStyleSheet = null; -function getSharedStyleSheet() { - if (!_sharedStyleSheet) { - _sharedStyleSheet = createStyleSheet(); - } - return _sharedStyleSheet; -} -function getDynamicStyleSheetRules(style) { - if (style && style.sheet && style.sheet.rules) { - // Chrome, IE - return style.sheet.rules; - } - if (style && style.sheet && style.sheet.cssRules) { - // FF - return style.sheet.cssRules; - } - return []; -} -function createCSSRule(selector, cssText, style = getSharedStyleSheet()) { - if (!style || !cssText) { - return; - } - style.sheet.insertRule(selector + '{' + cssText + '}', 0); -} -function removeCSSRulesContainingSelector(ruleName, style = getSharedStyleSheet()) { - if (!style) { - return; - } - let rules = getDynamicStyleSheetRules(style); - let toDelete = []; - for (let i = 0; i < rules.length; i++) { - let rule = rules[i]; - if (rule.selectorText.indexOf(ruleName) !== -1) { - toDelete.push(i); - } - } - for (let i = toDelete.length - 1; i >= 0; i--) { - style.sheet.deleteRule(toDelete[i]); - } -} -function isHTMLElement(o) { - if (typeof HTMLElement === 'object') { - return o instanceof HTMLElement; - } - return o && typeof o === 'object' && o.nodeType === 1 && typeof o.nodeName === 'string'; -} -const EventType = { - // Mouse - CLICK: 'click', - AUXCLICK: 'auxclick', - DBLCLICK: 'dblclick', - MOUSE_UP: 'mouseup', - MOUSE_DOWN: 'mousedown', - MOUSE_OVER: 'mouseover', - MOUSE_MOVE: 'mousemove', - MOUSE_OUT: 'mouseout', - MOUSE_ENTER: 'mouseenter', - MOUSE_LEAVE: 'mouseleave', - MOUSE_WHEEL: _browser_js__WEBPACK_IMPORTED_MODULE_0__["isEdge"] ? 'mousewheel' : 'wheel', - POINTER_UP: 'pointerup', - POINTER_DOWN: 'pointerdown', - POINTER_MOVE: 'pointermove', - CONTEXT_MENU: 'contextmenu', - WHEEL: 'wheel', - // Keyboard - KEY_DOWN: 'keydown', - KEY_PRESS: 'keypress', - KEY_UP: 'keyup', - // HTML Document - LOAD: 'load', - BEFORE_UNLOAD: 'beforeunload', - UNLOAD: 'unload', - ABORT: 'abort', - ERROR: 'error', - RESIZE: 'resize', - SCROLL: 'scroll', - FULLSCREEN_CHANGE: 'fullscreenchange', - WK_FULLSCREEN_CHANGE: 'webkitfullscreenchange', - // Form - SELECT: 'select', - CHANGE: 'change', - SUBMIT: 'submit', - RESET: 'reset', - FOCUS: 'focus', - FOCUS_IN: 'focusin', - FOCUS_OUT: 'focusout', - BLUR: 'blur', - INPUT: 'input', - // Local Storage - STORAGE: 'storage', - // Drag - DRAG_START: 'dragstart', - DRAG: 'drag', - DRAG_ENTER: 'dragenter', - DRAG_LEAVE: 'dragleave', - DRAG_OVER: 'dragover', - DROP: 'drop', - DRAG_END: 'dragend', - // Animation - ANIMATION_START: _browser_js__WEBPACK_IMPORTED_MODULE_0__["isWebKit"] ? 'webkitAnimationStart' : 'animationstart', - ANIMATION_END: _browser_js__WEBPACK_IMPORTED_MODULE_0__["isWebKit"] ? 'webkitAnimationEnd' : 'animationend', - ANIMATION_ITERATION: _browser_js__WEBPACK_IMPORTED_MODULE_0__["isWebKit"] ? 'webkitAnimationIteration' : 'animationiteration' -}; -const EventHelper = { - stop: function (e, cancelBubble) { - if (e.preventDefault) { - e.preventDefault(); - } - else { - // IE8 - e.returnValue = false; - } - if (cancelBubble) { - if (e.stopPropagation) { - e.stopPropagation(); - } - else { - // IE8 - e.cancelBubble = true; - } - } - } -}; -function saveParentsScrollTop(node) { - let r = []; - for (let i = 0; node && node.nodeType === node.ELEMENT_NODE; i++) { - r[i] = node.scrollTop; - node = node.parentNode; - } - return r; -} -function restoreParentsScrollTop(node, state) { - for (let i = 0; node && node.nodeType === node.ELEMENT_NODE; i++) { - if (node.scrollTop !== state[i]) { - node.scrollTop = state[i]; - } - node = node.parentNode; - } -} -class FocusTracker extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["Disposable"] { - constructor(element) { - super(); - this._onDidFocus = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidFocus = this._onDidFocus.event; - this._onDidBlur = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidBlur = this._onDidBlur.event; - let hasFocus = isAncestor(document.activeElement, element); - let loosingFocus = false; - const onFocus = () => { - loosingFocus = false; - if (!hasFocus) { - hasFocus = true; - this._onDidFocus.fire(); - } - }; - const onBlur = () => { - if (hasFocus) { - loosingFocus = true; - window.setTimeout(() => { - if (loosingFocus) { - loosingFocus = false; - hasFocus = false; - this._onDidBlur.fire(); - } - }, 0); - } - }; - this._refreshStateHandler = () => { - let currentNodeHasFocus = isAncestor(document.activeElement, element); - if (currentNodeHasFocus !== hasFocus) { - if (hasFocus) { - onBlur(); - } - else { - onFocus(); - } - } - }; - this._register(Object(_event_js__WEBPACK_IMPORTED_MODULE_1__["domEvent"])(element, EventType.FOCUS, true)(onFocus)); - this._register(Object(_event_js__WEBPACK_IMPORTED_MODULE_1__["domEvent"])(element, EventType.BLUR, true)(onBlur)); - } -} -function trackFocus(element) { - return new FocusTracker(element); -} -function append(parent, ...children) { - children.forEach(child => parent.appendChild(child)); - return children[children.length - 1]; -} -const SELECTOR_REGEX = /([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/; -function reset(parent, ...children) { - parent.innerText = ''; - Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_9__["coalesce"])(children) - .forEach(child => { - if (child instanceof Node) { - parent.appendChild(child); - } - else { - parent.appendChild(document.createTextNode(child)); - } - }); -} -var Namespace; -(function (Namespace) { - Namespace["HTML"] = "http://www.w3.org/1999/xhtml"; - Namespace["SVG"] = "http://www.w3.org/2000/svg"; -})(Namespace || (Namespace = {})); -function _$(namespace, description, attrs, ...children) { - let match = SELECTOR_REGEX.exec(description); - if (!match) { - throw new Error('Bad use of emmet'); - } - attrs = Object.assign({}, (attrs || {})); - let tagName = match[1] || 'div'; - let result; - if (namespace !== Namespace.HTML) { - result = document.createElementNS(namespace, tagName); - } - else { - result = document.createElement(tagName); - } - if (match[3]) { - result.id = match[3]; - } - if (match[4]) { - result.className = match[4].replace(/\./g, ' ').trim(); - } - Object.keys(attrs).forEach(name => { - const value = attrs[name]; - if (typeof value === 'undefined') { - return; - } - if (/^on\w+$/.test(name)) { - result[name] = value; - } - else if (name === 'selected') { - if (value) { - result.setAttribute(name, 'true'); - } - } - else { - result.setAttribute(name, value); - } - }); - Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_9__["coalesce"])(children) - .forEach(child => { - if (child instanceof Node) { - result.appendChild(child); - } - else { - result.appendChild(document.createTextNode(child)); - } - }); - return result; -} -function $(description, attrs, ...children) { - return _$(Namespace.HTML, description, attrs, ...children); -} -$.SVG = function (description, attrs, ...children) { - return _$(Namespace.SVG, description, attrs, ...children); -}; -function show(...elements) { - for (let element of elements) { - element.style.display = ''; - element.removeAttribute('aria-hidden'); - } -} -function hide(...elements) { - for (let element of elements) { - element.style.display = 'none'; - element.setAttribute('aria-hidden', 'true'); - } -} -function findParentWithAttribute(node, attribute) { - while (node && node.nodeType === node.ELEMENT_NODE) { - if (node instanceof HTMLElement && node.hasAttribute(attribute)) { - return node; - } - node = node.parentNode; - } - return null; -} -function removeTabIndexAndUpdateFocus(node) { - if (!node || !node.hasAttribute('tabIndex')) { - return; - } - // If we are the currently focused element and tabIndex is removed, - // standard DOM behavior is to move focus to the element. We - // typically never want that, rather put focus to the closest element - // in the hierarchy of the parent DOM nodes. - if (document.activeElement === node) { - let parentFocusable = findParentWithAttribute(node.parentElement, 'tabIndex'); - if (parentFocusable) { - parentFocusable.focus(); - } - } - node.removeAttribute('tabindex'); -} -function getElementsByTagName(tag) { - return Array.prototype.slice.call(document.getElementsByTagName(tag), 0); -} -/** - * Find a value usable for a dom node size such that the likelihood that it would be - * displayed with constant screen pixels size is as high as possible. - * - * e.g. We would desire for the cursors to be 2px (CSS px) wide. Under a devicePixelRatio - * of 1.25, the cursor will be 2.5 screen pixels wide. Depending on how the dom node aligns/"snaps" - * with the screen pixels, it will sometimes be rendered with 2 screen pixels, and sometimes with 3 screen pixels. - */ -function computeScreenAwareSize(cssPx) { - const screenPx = window.devicePixelRatio * cssPx; - return Math.max(1, Math.floor(screenPx)) / window.devicePixelRatio; -} -/** - * See https://github.com/Microsoft/monaco-editor/issues/601 - * To protect against malicious code in the linked site, particularly phishing attempts, - * the window.opener should be set to null to prevent the linked site from having access - * to change the location of the current page. - * See https://mathiasbynens.github.io/rel-noopener/ - */ -function windowOpenNoOpener(url) { - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_8__["isNative"] || _browser_js__WEBPACK_IMPORTED_MODULE_0__["isEdgeWebView"]) { - // In VSCode, window.open() always returns null... - // The same is true for a WebView (see https://github.com/Microsoft/monaco-editor/issues/628) - window.open(url); - } - else { - let newTab = window.open(); - if (newTab) { - newTab.opener = null; - newTab.location.href = url; - } - } -} -function animate(fn) { - const step = () => { - fn(); - stepDisposable = scheduleAtNextAnimationFrame(step); - }; - let stepDisposable = scheduleAtNextAnimationFrame(step); - return Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["toDisposable"])(() => stepDisposable.dispose()); -} -_common_network_js__WEBPACK_IMPORTED_MODULE_10__["RemoteAuthorities"].setPreferredWebSchema(/^https:/.test(window.location.href) ? 'https' : 'http'); -function asDomUri(uri) { - if (!uri) { - return uri; - } - if (_common_network_js__WEBPACK_IMPORTED_MODULE_10__["Schemas"].vscodeRemote === uri.scheme) { - return _common_network_js__WEBPACK_IMPORTED_MODULE_10__["RemoteAuthorities"].rewrite(uri); - } - return uri; -} -/** - * returns url('...') - */ -function asCSSUrl(uri) { - if (!uri) { - return `url('')`; - } - return `url('${asDomUri(uri).toString(true).replace(/'/g, '%27')}')`; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/event.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/event.js ***! - \*****************************************************************/ -/*! exports provided: domEvent, stop */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "domEvent", function() { return domEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stop", function() { return stop; }); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const domEvent = (element, type, useCapture) => { - const fn = (e) => emitter.fire(e); - const emitter = new _common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]({ - onFirstListenerAdd: () => { - element.addEventListener(type, fn, useCapture); - }, - onLastListenerRemove: () => { - element.removeEventListener(type, fn, useCapture); - } - }); - return emitter.event; -}; -function stop(event) { - return _common_event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].map(event, e => { - e.preventDefault(); - e.stopPropagation(); - return e; - }); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js ***! - \***********************************************************************/ -/*! exports provided: FastDomNode, createFastDomNode */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FastDomNode", function() { return FastDomNode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFastDomNode", function() { return createFastDomNode; }); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class FastDomNode { - constructor(domNode) { - this.domNode = domNode; - this._maxWidth = -1; - this._width = -1; - this._height = -1; - this._top = -1; - this._left = -1; - this._bottom = -1; - this._right = -1; - this._fontFamily = ''; - this._fontWeight = ''; - this._fontSize = -1; - this._fontFeatureSettings = ''; - this._lineHeight = -1; - this._letterSpacing = -100; - this._className = ''; - this._display = ''; - this._position = ''; - this._visibility = ''; - this._backgroundColor = ''; - this._layerHint = false; - this._contain = 'none'; - this._boxShadow = ''; - } - setMaxWidth(maxWidth) { - if (this._maxWidth === maxWidth) { - return; - } - this._maxWidth = maxWidth; - this.domNode.style.maxWidth = this._maxWidth + 'px'; - } - setWidth(width) { - if (this._width === width) { - return; - } - this._width = width; - this.domNode.style.width = this._width + 'px'; - } - setHeight(height) { - if (this._height === height) { - return; - } - this._height = height; - this.domNode.style.height = this._height + 'px'; - } - setTop(top) { - if (this._top === top) { - return; - } - this._top = top; - this.domNode.style.top = this._top + 'px'; - } - unsetTop() { - if (this._top === -1) { - return; - } - this._top = -1; - this.domNode.style.top = ''; - } - setLeft(left) { - if (this._left === left) { - return; - } - this._left = left; - this.domNode.style.left = this._left + 'px'; - } - setBottom(bottom) { - if (this._bottom === bottom) { - return; - } - this._bottom = bottom; - this.domNode.style.bottom = this._bottom + 'px'; - } - setRight(right) { - if (this._right === right) { - return; - } - this._right = right; - this.domNode.style.right = this._right + 'px'; - } - setFontFamily(fontFamily) { - if (this._fontFamily === fontFamily) { - return; - } - this._fontFamily = fontFamily; - this.domNode.style.fontFamily = this._fontFamily; - } - setFontWeight(fontWeight) { - if (this._fontWeight === fontWeight) { - return; - } - this._fontWeight = fontWeight; - this.domNode.style.fontWeight = this._fontWeight; - } - setFontSize(fontSize) { - if (this._fontSize === fontSize) { - return; - } - this._fontSize = fontSize; - this.domNode.style.fontSize = this._fontSize + 'px'; - } - setFontFeatureSettings(fontFeatureSettings) { - if (this._fontFeatureSettings === fontFeatureSettings) { - return; - } - this._fontFeatureSettings = fontFeatureSettings; - this.domNode.style.fontFeatureSettings = this._fontFeatureSettings; - } - setLineHeight(lineHeight) { - if (this._lineHeight === lineHeight) { - return; - } - this._lineHeight = lineHeight; - this.domNode.style.lineHeight = this._lineHeight + 'px'; - } - setLetterSpacing(letterSpacing) { - if (this._letterSpacing === letterSpacing) { - return; - } - this._letterSpacing = letterSpacing; - this.domNode.style.letterSpacing = this._letterSpacing + 'px'; - } - setClassName(className) { - if (this._className === className) { - return; - } - this._className = className; - this.domNode.className = this._className; - } - toggleClassName(className, shouldHaveIt) { - _dom_js__WEBPACK_IMPORTED_MODULE_0__["toggleClass"](this.domNode, className, shouldHaveIt); - this._className = this.domNode.className; - } - setDisplay(display) { - if (this._display === display) { - return; - } - this._display = display; - this.domNode.style.display = this._display; - } - setPosition(position) { - if (this._position === position) { - return; - } - this._position = position; - this.domNode.style.position = this._position; - } - setVisibility(visibility) { - if (this._visibility === visibility) { - return; - } - this._visibility = visibility; - this.domNode.style.visibility = this._visibility; - } - setBackgroundColor(backgroundColor) { - if (this._backgroundColor === backgroundColor) { - return; - } - this._backgroundColor = backgroundColor; - this.domNode.style.backgroundColor = this._backgroundColor; - } - setLayerHinting(layerHint) { - if (this._layerHint === layerHint) { - return; - } - this._layerHint = layerHint; - this.domNode.style.transform = this._layerHint ? 'translate3d(0px, 0px, 0px)' : ''; - } - setBoxShadow(boxShadow) { - if (this._boxShadow === boxShadow) { - return; - } - this._boxShadow = boxShadow; - this.domNode.style.boxShadow = boxShadow; - } - setContain(contain) { - if (this._contain === contain) { - return; - } - this._contain = contain; - this.domNode.style.contain = this._contain; - } - setAttribute(name, value) { - this.domNode.setAttribute(name, value); - } - removeAttribute(name) { - this.domNode.removeAttribute(name); - } - appendChild(child) { - this.domNode.appendChild(child.domNode); - } - removeChild(child) { - this.domNode.removeChild(child.domNode); - } -} -function createFastDomNode(domNode) { - return new FastDomNode(domNode); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/formattedTextRenderer.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/formattedTextRenderer.js ***! - \*********************************************************************************/ -/*! exports provided: renderText, renderFormattedText, createElement */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderText", function() { return renderText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderFormattedText", function() { return renderFormattedText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return createElement; }); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -function renderText(text, options = {}) { - const element = createElement(options); - element.textContent = text; - return element; -} -function renderFormattedText(formattedText, options = {}) { - const element = createElement(options); - _renderFormattedText(element, parseFormattedText(formattedText), options.actionHandler); - return element; -} -function createElement(options) { - const tagName = options.inline ? 'span' : 'div'; - const element = document.createElement(tagName); - if (options.className) { - element.className = options.className; - } - return element; -} -class StringStream { - constructor(source) { - this.source = source; - this.index = 0; - } - eos() { - return this.index >= this.source.length; - } - next() { - const next = this.peek(); - this.advance(); - return next; - } - peek() { - return this.source[this.index]; - } - advance() { - this.index++; - } -} -function _renderFormattedText(element, treeNode, actionHandler) { - let child; - if (treeNode.type === 2 /* Text */) { - child = document.createTextNode(treeNode.content || ''); - } - else if (treeNode.type === 3 /* Bold */) { - child = document.createElement('b'); - } - else if (treeNode.type === 4 /* Italics */) { - child = document.createElement('i'); - } - else if (treeNode.type === 5 /* Action */ && actionHandler) { - const a = document.createElement('a'); - a.href = '#'; - actionHandler.disposeables.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addStandardDisposableListener"](a, 'click', (event) => { - actionHandler.callback(String(treeNode.index), event); - })); - child = a; - } - else if (treeNode.type === 7 /* NewLine */) { - child = document.createElement('br'); - } - else if (treeNode.type === 1 /* Root */) { - child = element; - } - if (child && element !== child) { - element.appendChild(child); - } - if (child && Array.isArray(treeNode.children)) { - treeNode.children.forEach((nodeChild) => { - _renderFormattedText(child, nodeChild, actionHandler); - }); - } -} -function parseFormattedText(content) { - const root = { - type: 1 /* Root */, - children: [] - }; - let actionViewItemIndex = 0; - let current = root; - const stack = []; - const stream = new StringStream(content); - while (!stream.eos()) { - let next = stream.next(); - const isEscapedFormatType = (next === '\\' && formatTagType(stream.peek()) !== 0 /* Invalid */); - if (isEscapedFormatType) { - next = stream.next(); // unread the backslash if it escapes a format tag type - } - if (!isEscapedFormatType && isFormatTag(next) && next === stream.peek()) { - stream.advance(); - if (current.type === 2 /* Text */) { - current = stack.pop(); - } - const type = formatTagType(next); - if (current.type === type || (current.type === 5 /* Action */ && type === 6 /* ActionClose */)) { - current = stack.pop(); - } - else { - const newCurrent = { - type: type, - children: [] - }; - if (type === 5 /* Action */) { - newCurrent.index = actionViewItemIndex; - actionViewItemIndex++; - } - current.children.push(newCurrent); - stack.push(current); - current = newCurrent; - } - } - else if (next === '\n') { - if (current.type === 2 /* Text */) { - current = stack.pop(); - } - current.children.push({ - type: 7 /* NewLine */ - }); - } - else { - if (current.type !== 2 /* Text */) { - const textCurrent = { - type: 2 /* Text */, - content: next - }; - current.children.push(textCurrent); - stack.push(current); - current = textCurrent; - } - else { - current.content += next; - } - } - } - if (current.type === 2 /* Text */) { - current = stack.pop(); - } - if (stack.length) { - // incorrectly formatted string literal - } - return root; -} -function isFormatTag(char) { - return formatTagType(char) !== 0 /* Invalid */; -} -function formatTagType(char) { - switch (char) { - case '*': - return 3 /* Bold */; - case '_': - return 4 /* Italics */; - case '[': - return 5 /* Action */; - case ']': - return 6 /* ActionClose */; - default: - return 0 /* Invalid */; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/globalMouseMoveMonitor.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/globalMouseMoveMonitor.js ***! - \**********************************************************************************/ -/*! exports provided: standardMouseMoveMerger, GlobalMouseMoveMonitor */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "standardMouseMoveMerger", function() { return standardMouseMoveMerger; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlobalMouseMoveMonitor", function() { return GlobalMouseMoveMonitor; }); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _iframe_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./iframe.js */ "./node_modules/monaco-editor/esm/vs/base/browser/iframe.js"); -/* harmony import */ var _mouseEvent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _canIUse_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./canIUse.js */ "./node_modules/monaco-editor/esm/vs/base/browser/canIUse.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -function standardMouseMoveMerger(lastEvent, currentEvent) { - let ev = new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_3__["StandardMouseEvent"](currentEvent); - ev.preventDefault(); - return { - leftButton: ev.leftButton, - buttons: ev.buttons, - posx: ev.posx, - posy: ev.posy - }; -} -class GlobalMouseMoveMonitor { - constructor() { - this._hooks = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - this._mouseMoveEventMerger = null; - this._mouseMoveCallback = null; - this._onStopCallback = null; - } - dispose() { - this.stopMonitoring(false); - this._hooks.dispose(); - } - stopMonitoring(invokeStopCallback) { - if (!this.isMonitoring()) { - // Not monitoring - return; - } - // Unhook - this._hooks.clear(); - this._mouseMoveEventMerger = null; - this._mouseMoveCallback = null; - const onStopCallback = this._onStopCallback; - this._onStopCallback = null; - if (invokeStopCallback && onStopCallback) { - onStopCallback(); - } - } - isMonitoring() { - return !!this._mouseMoveEventMerger; - } - startMonitoring(initialElement, initialButtons, mouseMoveEventMerger, mouseMoveCallback, onStopCallback) { - if (this.isMonitoring()) { - // I am already hooked - return; - } - this._mouseMoveEventMerger = mouseMoveEventMerger; - this._mouseMoveCallback = mouseMoveCallback; - this._onStopCallback = onStopCallback; - const windowChain = _iframe_js__WEBPACK_IMPORTED_MODULE_2__["IframeUtils"].getSameOriginWindowChain(); - const mouseMove = _common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isIOS"] && _canIUse_js__WEBPACK_IMPORTED_MODULE_5__["BrowserFeatures"].pointerEvents ? 'pointermove' : 'mousemove'; - const mouseUp = _common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isIOS"] && _canIUse_js__WEBPACK_IMPORTED_MODULE_5__["BrowserFeatures"].pointerEvents ? 'pointerup' : 'mouseup'; - const listenTo = windowChain.map(element => element.window.document); - const shadowRoot = _dom_js__WEBPACK_IMPORTED_MODULE_0__["getShadowRoot"](initialElement); - if (shadowRoot) { - listenTo.unshift(shadowRoot); - } - for (const element of listenTo) { - this._hooks.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableThrottledListener"](element, mouseMove, (data) => { - if (data.buttons !== initialButtons) { - // Buttons state has changed in the meantime - this.stopMonitoring(true); - return; - } - this._mouseMoveCallback(data); - }, (lastEvent, currentEvent) => this._mouseMoveEventMerger(lastEvent, currentEvent))); - this._hooks.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](element, mouseUp, (e) => this.stopMonitoring(true))); - } - if (_iframe_js__WEBPACK_IMPORTED_MODULE_2__["IframeUtils"].hasDifferentOriginAncestor()) { - let lastSameOriginAncestor = windowChain[windowChain.length - 1]; - // We might miss a mouse up if it happens outside the iframe - // This one is for Chrome - this._hooks.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](lastSameOriginAncestor.window.document, 'mouseout', (browserEvent) => { - let e = new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_3__["StandardMouseEvent"](browserEvent); - if (e.target.tagName.toLowerCase() === 'html') { - this.stopMonitoring(true); - } - })); - // This one is for FF - this._hooks.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](lastSameOriginAncestor.window.document, 'mouseover', (browserEvent) => { - let e = new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_3__["StandardMouseEvent"](browserEvent); - if (e.target.tagName.toLowerCase() === 'html') { - this.stopMonitoring(true); - } - })); - // This one is for IE - this._hooks.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](lastSameOriginAncestor.window.document.body, 'mouseleave', (browserEvent) => { - this.stopMonitoring(true); - })); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/iframe.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/iframe.js ***! - \******************************************************************/ -/*! exports provided: IframeUtils */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IframeUtils", function() { return IframeUtils; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -let hasDifferentOriginAncestorFlag = false; -let sameOriginWindowChainCache = null; -function getParentWindowIfSameOrigin(w) { - if (!w.parent || w.parent === w) { - return null; - } - // Cannot really tell if we have access to the parent window unless we try to access something in it - try { - let location = w.location; - let parentLocation = w.parent.location; - if (location.origin !== 'null' && parentLocation.origin !== 'null') { - if (location.protocol !== parentLocation.protocol || location.hostname !== parentLocation.hostname || location.port !== parentLocation.port) { - hasDifferentOriginAncestorFlag = true; - return null; - } - } - } - catch (e) { - hasDifferentOriginAncestorFlag = true; - return null; - } - return w.parent; -} -class IframeUtils { - /** - * Returns a chain of embedded windows with the same origin (which can be accessed programmatically). - * Having a chain of length 1 might mean that the current execution environment is running outside of an iframe or inside an iframe embedded in a window with a different origin. - * To distinguish if at one point the current execution environment is running inside a window with a different origin, see hasDifferentOriginAncestor() - */ - static getSameOriginWindowChain() { - if (!sameOriginWindowChainCache) { - sameOriginWindowChainCache = []; - let w = window; - let parent; - do { - parent = getParentWindowIfSameOrigin(w); - if (parent) { - sameOriginWindowChainCache.push({ - window: w, - iframeElement: w.frameElement || null - }); - } - else { - sameOriginWindowChainCache.push({ - window: w, - iframeElement: null - }); - } - w = parent; - } while (w); - } - return sameOriginWindowChainCache.slice(0); - } - /** - * Returns true if the current execution environment is chained in a list of iframes which at one point ends in a window with a different origin. - * Returns false if the current execution environment is not running inside an iframe or if the entire chain of iframes have the same origin. - */ - static hasDifferentOriginAncestor() { - if (!sameOriginWindowChainCache) { - this.getSameOriginWindowChain(); - } - return hasDifferentOriginAncestorFlag; - } - /** - * Returns the position of `childWindow` relative to `ancestorWindow` - */ - static getPositionOfChildWindowRelativeToAncestorWindow(childWindow, ancestorWindow) { - if (!ancestorWindow || childWindow === ancestorWindow) { - return { - top: 0, - left: 0 - }; - } - let top = 0, left = 0; - let windowChain = this.getSameOriginWindowChain(); - for (const windowChainEl of windowChain) { - top += windowChainEl.window.scrollY; - left += windowChainEl.window.scrollX; - if (windowChainEl.window === ancestorWindow) { - break; - } - if (!windowChainEl.iframeElement) { - break; - } - let boundingRect = windowChainEl.iframeElement.getBoundingClientRect(); - top += boundingRect.top; - left += boundingRect.left; - } - return { - top: top, - left: left - }; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js": -/*!*************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js ***! - \*************************************************************************/ -/*! exports provided: StandardKeyboardEvent */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandardKeyboardEvent", function() { return StandardKeyboardEvent; }); -/* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -let KEY_CODE_MAP = new Array(230); -let INVERSE_KEY_CODE_MAP = new Array(112 /* MAX_VALUE */); -(function () { - for (let i = 0; i < INVERSE_KEY_CODE_MAP.length; i++) { - INVERSE_KEY_CODE_MAP[i] = -1; - } - function define(code, keyCode) { - KEY_CODE_MAP[code] = keyCode; - INVERSE_KEY_CODE_MAP[keyCode] = code; - } - define(3, 7 /* PauseBreak */); // VK_CANCEL 0x03 Control-break processing - define(8, 1 /* Backspace */); - define(9, 2 /* Tab */); - define(13, 3 /* Enter */); - define(16, 4 /* Shift */); - define(17, 5 /* Ctrl */); - define(18, 6 /* Alt */); - define(19, 7 /* PauseBreak */); - define(20, 8 /* CapsLock */); - define(27, 9 /* Escape */); - define(32, 10 /* Space */); - define(33, 11 /* PageUp */); - define(34, 12 /* PageDown */); - define(35, 13 /* End */); - define(36, 14 /* Home */); - define(37, 15 /* LeftArrow */); - define(38, 16 /* UpArrow */); - define(39, 17 /* RightArrow */); - define(40, 18 /* DownArrow */); - define(45, 19 /* Insert */); - define(46, 20 /* Delete */); - define(48, 21 /* KEY_0 */); - define(49, 22 /* KEY_1 */); - define(50, 23 /* KEY_2 */); - define(51, 24 /* KEY_3 */); - define(52, 25 /* KEY_4 */); - define(53, 26 /* KEY_5 */); - define(54, 27 /* KEY_6 */); - define(55, 28 /* KEY_7 */); - define(56, 29 /* KEY_8 */); - define(57, 30 /* KEY_9 */); - define(65, 31 /* KEY_A */); - define(66, 32 /* KEY_B */); - define(67, 33 /* KEY_C */); - define(68, 34 /* KEY_D */); - define(69, 35 /* KEY_E */); - define(70, 36 /* KEY_F */); - define(71, 37 /* KEY_G */); - define(72, 38 /* KEY_H */); - define(73, 39 /* KEY_I */); - define(74, 40 /* KEY_J */); - define(75, 41 /* KEY_K */); - define(76, 42 /* KEY_L */); - define(77, 43 /* KEY_M */); - define(78, 44 /* KEY_N */); - define(79, 45 /* KEY_O */); - define(80, 46 /* KEY_P */); - define(81, 47 /* KEY_Q */); - define(82, 48 /* KEY_R */); - define(83, 49 /* KEY_S */); - define(84, 50 /* KEY_T */); - define(85, 51 /* KEY_U */); - define(86, 52 /* KEY_V */); - define(87, 53 /* KEY_W */); - define(88, 54 /* KEY_X */); - define(89, 55 /* KEY_Y */); - define(90, 56 /* KEY_Z */); - define(93, 58 /* ContextMenu */); - define(96, 93 /* NUMPAD_0 */); - define(97, 94 /* NUMPAD_1 */); - define(98, 95 /* NUMPAD_2 */); - define(99, 96 /* NUMPAD_3 */); - define(100, 97 /* NUMPAD_4 */); - define(101, 98 /* NUMPAD_5 */); - define(102, 99 /* NUMPAD_6 */); - define(103, 100 /* NUMPAD_7 */); - define(104, 101 /* NUMPAD_8 */); - define(105, 102 /* NUMPAD_9 */); - define(106, 103 /* NUMPAD_MULTIPLY */); - define(107, 104 /* NUMPAD_ADD */); - define(108, 105 /* NUMPAD_SEPARATOR */); - define(109, 106 /* NUMPAD_SUBTRACT */); - define(110, 107 /* NUMPAD_DECIMAL */); - define(111, 108 /* NUMPAD_DIVIDE */); - define(112, 59 /* F1 */); - define(113, 60 /* F2 */); - define(114, 61 /* F3 */); - define(115, 62 /* F4 */); - define(116, 63 /* F5 */); - define(117, 64 /* F6 */); - define(118, 65 /* F7 */); - define(119, 66 /* F8 */); - define(120, 67 /* F9 */); - define(121, 68 /* F10 */); - define(122, 69 /* F11 */); - define(123, 70 /* F12 */); - define(124, 71 /* F13 */); - define(125, 72 /* F14 */); - define(126, 73 /* F15 */); - define(127, 74 /* F16 */); - define(128, 75 /* F17 */); - define(129, 76 /* F18 */); - define(130, 77 /* F19 */); - define(144, 78 /* NumLock */); - define(145, 79 /* ScrollLock */); - define(186, 80 /* US_SEMICOLON */); - define(187, 81 /* US_EQUAL */); - define(188, 82 /* US_COMMA */); - define(189, 83 /* US_MINUS */); - define(190, 84 /* US_DOT */); - define(191, 85 /* US_SLASH */); - define(192, 86 /* US_BACKTICK */); - define(193, 110 /* ABNT_C1 */); - define(194, 111 /* ABNT_C2 */); - define(219, 87 /* US_OPEN_SQUARE_BRACKET */); - define(220, 88 /* US_BACKSLASH */); - define(221, 89 /* US_CLOSE_SQUARE_BRACKET */); - define(222, 90 /* US_QUOTE */); - define(223, 91 /* OEM_8 */); - define(226, 92 /* OEM_102 */); - /** - * https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html - * If an Input Method Editor is processing key input and the event is keydown, return 229. - */ - define(229, 109 /* KEY_IN_COMPOSITION */); - if (_browser_js__WEBPACK_IMPORTED_MODULE_0__["isFirefox"]) { - define(59, 80 /* US_SEMICOLON */); - define(107, 81 /* US_EQUAL */); - define(109, 83 /* US_MINUS */); - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"]) { - define(224, 57 /* Meta */); - } - } - else if (_browser_js__WEBPACK_IMPORTED_MODULE_0__["isWebKit"]) { - define(91, 57 /* Meta */); - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"]) { - // the two meta keys in the Mac have different key codes (91 and 93) - define(93, 57 /* Meta */); - } - else { - define(92, 57 /* Meta */); - } - } -})(); -function extractKeyCode(e) { - if (e.charCode) { - // "keypress" events mostly - let char = String.fromCharCode(e.charCode).toUpperCase(); - return _common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__["KeyCodeUtils"].fromString(char); - } - return KEY_CODE_MAP[e.keyCode] || 0 /* Unknown */; -} -const ctrlKeyMod = (_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"] ? 256 /* WinCtrl */ : 2048 /* CtrlCmd */); -const altKeyMod = 512 /* Alt */; -const shiftKeyMod = 1024 /* Shift */; -const metaKeyMod = (_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"] ? 2048 /* CtrlCmd */ : 256 /* WinCtrl */); -class StandardKeyboardEvent { - constructor(source) { - this._standardKeyboardEventBrand = true; - let e = source; - this.browserEvent = e; - this.target = e.target; - this.ctrlKey = e.ctrlKey; - this.shiftKey = e.shiftKey; - this.altKey = e.altKey; - this.metaKey = e.metaKey; - this.keyCode = extractKeyCode(e); - this.code = e.code; - // console.info(e.type + ": keyCode: " + e.keyCode + ", which: " + e.which + ", charCode: " + e.charCode + ", detail: " + e.detail + " ====> " + this.keyCode + ' -- ' + KeyCode[this.keyCode]); - this.ctrlKey = this.ctrlKey || this.keyCode === 5 /* Ctrl */; - this.altKey = this.altKey || this.keyCode === 6 /* Alt */; - this.shiftKey = this.shiftKey || this.keyCode === 4 /* Shift */; - this.metaKey = this.metaKey || this.keyCode === 57 /* Meta */; - this._asKeybinding = this._computeKeybinding(); - this._asRuntimeKeybinding = this._computeRuntimeKeybinding(); - // console.log(`code: ${e.code}, keyCode: ${e.keyCode}, key: ${e.key}`); - } - preventDefault() { - if (this.browserEvent && this.browserEvent.preventDefault) { - this.browserEvent.preventDefault(); - } - } - stopPropagation() { - if (this.browserEvent && this.browserEvent.stopPropagation) { - this.browserEvent.stopPropagation(); - } - } - toKeybinding() { - return this._asRuntimeKeybinding; - } - equals(other) { - return this._asKeybinding === other; - } - _computeKeybinding() { - let key = 0 /* Unknown */; - if (this.keyCode !== 5 /* Ctrl */ && this.keyCode !== 4 /* Shift */ && this.keyCode !== 6 /* Alt */ && this.keyCode !== 57 /* Meta */) { - key = this.keyCode; - } - let result = 0; - if (this.ctrlKey) { - result |= ctrlKeyMod; - } - if (this.altKey) { - result |= altKeyMod; - } - if (this.shiftKey) { - result |= shiftKeyMod; - } - if (this.metaKey) { - result |= metaKeyMod; - } - result |= key; - return result; - } - _computeRuntimeKeybinding() { - let key = 0 /* Unknown */; - if (this.keyCode !== 5 /* Ctrl */ && this.keyCode !== 4 /* Shift */ && this.keyCode !== 6 /* Alt */ && this.keyCode !== 57 /* Meta */) { - key = this.keyCode; - } - return new _common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__["SimpleKeybinding"](this.ctrlKey, this.shiftKey, this.altKey, this.metaKey, key); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/markdownRenderer.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/markdownRenderer.js ***! - \****************************************************************************/ -/*! exports provided: renderMarkdown */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMarkdown", function() { return renderMarkdown; }); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _formattedTextRenderer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./formattedTextRenderer.js */ "./node_modules/monaco-editor/esm/vs/base/browser/formattedTextRenderer.js"); -/* harmony import */ var _common_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _common_htmlContent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/htmlContent.js */ "./node_modules/monaco-editor/esm/vs/base/common/htmlContent.js"); -/* harmony import */ var _common_idGenerator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/idGenerator.js */ "./node_modules/monaco-editor/esm/vs/base/common/idGenerator.js"); -/* harmony import */ var _common_marked_marked_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/marked/marked.js */ "./node_modules/monaco-editor/esm/vs/base/common/marked/marked.js"); -/* harmony import */ var _common_marked_marked_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_common_marked_marked_js__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _common_insane_insane_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/insane/insane.js */ "./node_modules/monaco-editor/esm/vs/base/common/insane/insane.js"); -/* harmony import */ var _common_marshalling_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/marshalling.js */ "./node_modules/monaco-editor/esm/vs/base/common/marshalling.js"); -/* harmony import */ var _common_objects_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _common_strings_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _common_uri_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _common_network_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../common/network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _common_codicons_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/* harmony import */ var _common_resources_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/* harmony import */ var _mouseEvent_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - -/** - * Create html nodes for the given content element. - */ -function renderMarkdown(markdown, options = {}, markedOptions = {}) { - var _a; - const element = Object(_formattedTextRenderer_js__WEBPACK_IMPORTED_MODULE_1__["createElement"])(options); - const _uriMassage = function (part) { - let data; - try { - data = Object(_common_marshalling_js__WEBPACK_IMPORTED_MODULE_7__["parse"])(decodeURIComponent(part)); - } - catch (e) { - // ignore - } - if (!data) { - return part; - } - data = Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_8__["cloneAndChange"])(data, value => { - if (markdown.uris && markdown.uris[value]) { - return _common_uri_js__WEBPACK_IMPORTED_MODULE_10__["URI"].revive(markdown.uris[value]); - } - else { - return undefined; - } - }); - return encodeURIComponent(JSON.stringify(data)); - }; - const _href = function (href, isDomUri) { - const data = markdown.uris && markdown.uris[href]; - if (!data) { - return href; // no uri exists - } - let uri = _common_uri_js__WEBPACK_IMPORTED_MODULE_10__["URI"].revive(data); - if (_common_uri_js__WEBPACK_IMPORTED_MODULE_10__["URI"].parse(href).toString() === uri.toString()) { - return href; // no tranformation performed - } - if (isDomUri) { - // this URI will end up as "src"-attribute of a dom node - // and because of that special rewriting needs to be done - // so that the URI uses a protocol that's understood by - // browsers (like http or https) - return _dom_js__WEBPACK_IMPORTED_MODULE_0__["asDomUri"](uri).toString(true); - } - if (uri.query) { - uri = uri.with({ query: _uriMassage(uri.query) }); - } - return uri.toString(); - }; - // signal to code-block render that the - // element has been created - let signalInnerHTML; - const withInnerHTML = new Promise(c => signalInnerHTML = c); - const renderer = new _common_marked_marked_js__WEBPACK_IMPORTED_MODULE_5__["Renderer"](); - renderer.image = (href, title, text) => { - let dimensions = []; - let attributes = []; - if (href) { - ({ href, dimensions } = Object(_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_3__["parseHrefAndDimensions"])(href)); - href = _href(href, true); - try { - const hrefAsUri = _common_uri_js__WEBPACK_IMPORTED_MODULE_10__["URI"].parse(href); - if (options.baseUrl && hrefAsUri.scheme === _common_network_js__WEBPACK_IMPORTED_MODULE_11__["Schemas"].file) { // absolute or relative local path, or file: uri - href = Object(_common_resources_js__WEBPACK_IMPORTED_MODULE_13__["resolvePath"])(options.baseUrl, href).toString(); - } - } - catch (err) { } - attributes.push(`src="${href}"`); - } - if (text) { - attributes.push(`alt="${text}"`); - } - if (title) { - attributes.push(`title="${title}"`); - } - if (dimensions.length) { - attributes = attributes.concat(dimensions); - } - return ''; - }; - renderer.link = (href, title, text) => { - // Remove markdown escapes. Workaround for https://github.com/chjj/marked/issues/829 - if (href === text) { // raw link case - text = Object(_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_3__["removeMarkdownEscapes"])(text); - } - href = _href(href, false); - if (options.baseUrl) { - const hasScheme = /^\w[\w\d+.-]*:/.test(href); - if (!hasScheme) { - href = Object(_common_resources_js__WEBPACK_IMPORTED_MODULE_13__["resolvePath"])(options.baseUrl, href).toString(); - } - } - title = Object(_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_3__["removeMarkdownEscapes"])(title); - href = Object(_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_3__["removeMarkdownEscapes"])(href); - if (!href - || href.match(/^data:|javascript:/i) - || (href.match(/^command:/i) && !markdown.isTrusted) - || href.match(/^command:(\/\/\/)?_workbench\.downloadResource/i)) { - // drop the link - return text; - } - else { - // HTML Encode href - href = href.replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); - return `
${text}`; - } - }; - renderer.paragraph = (text) => { - return `

${markdown.supportThemeIcons ? Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_12__["renderCodicons"])(text) : text}

`; - }; - if (options.codeBlockRenderer) { - renderer.code = (code, lang) => { - const value = options.codeBlockRenderer(lang, code); - // when code-block rendering is async we return sync - // but update the node with the real result later. - const id = _common_idGenerator_js__WEBPACK_IMPORTED_MODULE_4__["defaultGenerator"].nextId(); - const promise = Promise.all([value, withInnerHTML]).then(values => { - const strValue = values[0]; - const span = element.querySelector(`div[data-code="${id}"]`); - if (span) { - span.innerHTML = strValue; - } - }).catch(err => { - // ignore - }); - if (options.codeBlockRenderCallback) { - promise.then(options.codeBlockRenderCallback); - } - return `
${Object(_common_strings_js__WEBPACK_IMPORTED_MODULE_9__["escape"])(code)}
`; - }; - } - const actionHandler = options.actionHandler; - if (actionHandler) { - [_dom_js__WEBPACK_IMPORTED_MODULE_0__["EventType"].CLICK, _dom_js__WEBPACK_IMPORTED_MODULE_0__["EventType"].AUXCLICK].forEach(event => { - actionHandler.disposeables.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](element, event, (e) => { - const mouseEvent = new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_14__["StandardMouseEvent"](e); - if (!mouseEvent.leftButton && !mouseEvent.middleButton) { - return; - } - let target = mouseEvent.target; - if (target.tagName !== 'A') { - target = target.parentElement; - if (!target || target.tagName !== 'A') { - return; - } - } - try { - const href = target.dataset['href']; - if (href) { - actionHandler.callback(href, mouseEvent); - } - } - catch (err) { - Object(_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["onUnexpectedError"])(err); - } - finally { - mouseEvent.preventDefault(); - } - })); - }); - } - // Use our own sanitizer so that we can let through only spans. - // Otherwise, we'd be letting all html be rendered. - // If we want to allow markdown permitted tags, then we can delete sanitizer and sanitize. - markedOptions.sanitizer = (html) => { - const match = markdown.isTrusted ? html.match(/^()|(<\/\s*span>)$/) : undefined; - return match ? html : ''; - }; - markedOptions.sanitize = true; - markedOptions.renderer = renderer; - const allowedSchemes = [_common_network_js__WEBPACK_IMPORTED_MODULE_11__["Schemas"].http, _common_network_js__WEBPACK_IMPORTED_MODULE_11__["Schemas"].https, _common_network_js__WEBPACK_IMPORTED_MODULE_11__["Schemas"].mailto, _common_network_js__WEBPACK_IMPORTED_MODULE_11__["Schemas"].data, _common_network_js__WEBPACK_IMPORTED_MODULE_11__["Schemas"].file, _common_network_js__WEBPACK_IMPORTED_MODULE_11__["Schemas"].vscodeRemote, _common_network_js__WEBPACK_IMPORTED_MODULE_11__["Schemas"].vscodeRemoteResource]; - if (markdown.isTrusted) { - allowedSchemes.push(_common_network_js__WEBPACK_IMPORTED_MODULE_11__["Schemas"].command); - } - // values that are too long will freeze the UI - let value = (_a = markdown.value) !== null && _a !== void 0 ? _a : ''; - if (value.length > 100000) { - value = `${value.substr(0, 100000)}…`; - } - const renderedMarkdown = _common_marked_marked_js__WEBPACK_IMPORTED_MODULE_5__["parse"](markdown.supportThemeIcons ? Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_12__["markdownEscapeEscapedCodicons"])(value) : value, markedOptions); - function filter(token) { - if (token.tag === 'span' && markdown.isTrusted && (Object.keys(token.attrs).length === 1)) { - if (token.attrs['style']) { - return !!token.attrs['style'].match(/^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/); - } - else if (token.attrs['class']) { - // The class should match codicon rendering in src\vs\base\common\codicons.ts - return !!token.attrs['class'].match(/^codicon codicon-[a-z\-]+( codicon-animation-[a-z\-]+)?$/); - } - return false; - } - return true; - } - element.innerHTML = Object(_common_insane_insane_js__WEBPACK_IMPORTED_MODULE_6__["insane"])(renderedMarkdown, { - allowedSchemes, - // allowedTags should included everything that markdown renders to. - // Since we have our own sanitize function for marked, it's possible we missed some tag so let insane make sure. - // HTML tags that can result from markdown are from reading https://spec.commonmark.org/0.29/ - // HTML table tags that can result from markdown are from https://github.github.com/gfm/#tables-extension- - allowedTags: ['ul', 'li', 'p', 'code', 'blockquote', 'ol', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'em', 'pre', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'div', 'del', 'a', 'strong', 'br', 'img', 'span'], - allowedAttributes: { - 'a': ['href', 'name', 'target', 'data-href'], - 'img': ['src', 'title', 'alt', 'width', 'height'], - 'div': ['class', 'data-code'], - 'span': ['class', 'style'], - // https://github.com/microsoft/vscode/issues/95937 - 'th': ['align'], - 'td': ['align'] - }, - filter - }); - signalInnerHTML(); - return element; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js ***! - \**********************************************************************/ -/*! exports provided: StandardMouseEvent, StandardWheelEvent */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandardMouseEvent", function() { return StandardMouseEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandardWheelEvent", function() { return StandardWheelEvent; }); -/* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _iframe_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iframe.js */ "./node_modules/monaco-editor/esm/vs/base/browser/iframe.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class StandardMouseEvent { - constructor(e) { - this.timestamp = Date.now(); - this.browserEvent = e; - this.leftButton = e.button === 0; - this.middleButton = e.button === 1; - this.rightButton = e.button === 2; - this.buttons = e.buttons; - this.target = e.target; - this.detail = e.detail || 1; - if (e.type === 'dblclick') { - this.detail = 2; - } - this.ctrlKey = e.ctrlKey; - this.shiftKey = e.shiftKey; - this.altKey = e.altKey; - this.metaKey = e.metaKey; - if (typeof e.pageX === 'number') { - this.posx = e.pageX; - this.posy = e.pageY; - } - else { - // Probably hit by MSGestureEvent - this.posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; - this.posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; - } - // Find the position of the iframe this code is executing in relative to the iframe where the event was captured. - let iframeOffsets = _iframe_js__WEBPACK_IMPORTED_MODULE_1__["IframeUtils"].getPositionOfChildWindowRelativeToAncestorWindow(self, e.view); - this.posx -= iframeOffsets.left; - this.posy -= iframeOffsets.top; - } - preventDefault() { - this.browserEvent.preventDefault(); - } - stopPropagation() { - this.browserEvent.stopPropagation(); - } -} -class StandardWheelEvent { - constructor(e, deltaX = 0, deltaY = 0) { - this.browserEvent = e || null; - this.target = e ? (e.target || e.targetNode || e.srcElement) : null; - this.deltaY = deltaY; - this.deltaX = deltaX; - if (e) { - // Old (deprecated) wheel events - let e1 = e; - let e2 = e; - // vertical delta scroll - if (typeof e1.wheelDeltaY !== 'undefined') { - this.deltaY = e1.wheelDeltaY / 120; - } - else if (typeof e2.VERTICAL_AXIS !== 'undefined' && e2.axis === e2.VERTICAL_AXIS) { - this.deltaY = -e2.detail / 3; - } - else if (e.type === 'wheel') { - // Modern wheel event - // https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent - const ev = e; - if (ev.deltaMode === ev.DOM_DELTA_LINE) { - // the deltas are expressed in lines - if (_browser_js__WEBPACK_IMPORTED_MODULE_0__["isFirefox"] && !_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"]) { - this.deltaY = -e.deltaY / 3; - } - else { - this.deltaY = -e.deltaY; - } - } - else { - this.deltaY = -e.deltaY / 40; - } - } - // horizontal delta scroll - if (typeof e1.wheelDeltaX !== 'undefined') { - if (_browser_js__WEBPACK_IMPORTED_MODULE_0__["isSafari"] && _common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWindows"]) { - this.deltaX = -(e1.wheelDeltaX / 120); - } - else { - this.deltaX = e1.wheelDeltaX / 120; - } - } - else if (typeof e2.HORIZONTAL_AXIS !== 'undefined' && e2.axis === e2.HORIZONTAL_AXIS) { - this.deltaX = -e.detail / 3; - } - else if (e.type === 'wheel') { - // Modern wheel event - // https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent - const ev = e; - if (ev.deltaMode === ev.DOM_DELTA_LINE) { - // the deltas are expressed in lines - if (_browser_js__WEBPACK_IMPORTED_MODULE_0__["isFirefox"] && !_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"]) { - this.deltaX = -e.deltaX / 3; - } - else { - this.deltaX = -e.deltaX; - } - } - else { - this.deltaX = -e.deltaX / 40; - } - } - // Assume a vertical scroll if nothing else worked - if (this.deltaY === 0 && this.deltaX === 0 && e.wheelDelta) { - this.deltaY = e.wheelDelta / 120; - } - } - } - preventDefault() { - if (this.browserEvent) { - this.browserEvent.preventDefault(); - } - } - stopPropagation() { - if (this.browserEvent) { - this.browserEvent.stopPropagation(); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/touch.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/touch.js ***! - \*****************************************************************/ -/*! exports provided: EventType, Gesture */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventType", function() { return EventType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Gesture", function() { return Gesture; }); -/* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_decorators_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/decorators.js */ "./node_modules/monaco-editor/esm/vs/base/common/decorators.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; - - - - -var EventType; -(function (EventType) { - EventType.Tap = '-monaco-gesturetap'; - EventType.Change = '-monaco-gesturechange'; - EventType.Start = '-monaco-gesturestart'; - EventType.End = '-monaco-gesturesend'; - EventType.Contextmenu = '-monaco-gesturecontextmenu'; -})(EventType || (EventType = {})); -class Gesture extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor() { - super(); - this.dispatched = false; - this.activeTouches = {}; - this.handle = null; - this.targets = []; - this.ignoreTargets = []; - this._lastSetTapCountTime = 0; - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](document, 'touchstart', (e) => this.onTouchStart(e), { passive: false })); - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](document, 'touchend', (e) => this.onTouchEnd(e))); - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](document, 'touchmove', (e) => this.onTouchMove(e), { passive: false })); - } - static addTarget(element) { - if (!Gesture.isTouchDevice()) { - return _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - } - if (!Gesture.INSTANCE) { - Gesture.INSTANCE = new Gesture(); - } - Gesture.INSTANCE.targets.push(element); - return { - dispose: () => { - Gesture.INSTANCE.targets = Gesture.INSTANCE.targets.filter(t => t !== element); - } - }; - } - static ignoreTarget(element) { - if (!Gesture.isTouchDevice()) { - return _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - } - if (!Gesture.INSTANCE) { - Gesture.INSTANCE = new Gesture(); - } - Gesture.INSTANCE.ignoreTargets.push(element); - return { - dispose: () => { - Gesture.INSTANCE.ignoreTargets = Gesture.INSTANCE.ignoreTargets.filter(t => t !== element); - } - }; - } - static isTouchDevice() { - // `'ontouchstart' in window` always evaluates to true with typescript's modern typings. This causes `window` to be - // `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast - return 'ontouchstart' in window || navigator.maxTouchPoints > 0 || window.navigator.msMaxTouchPoints > 0; - } - dispose() { - if (this.handle) { - this.handle.dispose(); - this.handle = null; - } - super.dispose(); - } - onTouchStart(e) { - let timestamp = Date.now(); // use Date.now() because on FF e.timeStamp is not epoch based. - if (this.handle) { - this.handle.dispose(); - this.handle = null; - } - for (let i = 0, len = e.targetTouches.length; i < len; i++) { - let touch = e.targetTouches.item(i); - this.activeTouches[touch.identifier] = { - id: touch.identifier, - initialTarget: touch.target, - initialTimeStamp: timestamp, - initialPageX: touch.pageX, - initialPageY: touch.pageY, - rollingTimestamps: [timestamp], - rollingPageX: [touch.pageX], - rollingPageY: [touch.pageY] - }; - let evt = this.newGestureEvent(EventType.Start, touch.target); - evt.pageX = touch.pageX; - evt.pageY = touch.pageY; - this.dispatchEvent(evt); - } - if (this.dispatched) { - e.preventDefault(); - e.stopPropagation(); - this.dispatched = false; - } - } - onTouchEnd(e) { - let timestamp = Date.now(); // use Date.now() because on FF e.timeStamp is not epoch based. - let activeTouchCount = Object.keys(this.activeTouches).length; - for (let i = 0, len = e.changedTouches.length; i < len; i++) { - let touch = e.changedTouches.item(i); - if (!this.activeTouches.hasOwnProperty(String(touch.identifier))) { - console.warn('move of an UNKNOWN touch', touch); - continue; - } - let data = this.activeTouches[touch.identifier], holdTime = Date.now() - data.initialTimeStamp; - if (holdTime < Gesture.HOLD_DELAY - && Math.abs(data.initialPageX - _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingPageX)) < 30 - && Math.abs(data.initialPageY - _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingPageY)) < 30) { - let evt = this.newGestureEvent(EventType.Tap, data.initialTarget); - evt.pageX = _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingPageX); - evt.pageY = _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingPageY); - this.dispatchEvent(evt); - } - else if (holdTime >= Gesture.HOLD_DELAY - && Math.abs(data.initialPageX - _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingPageX)) < 30 - && Math.abs(data.initialPageY - _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingPageY)) < 30) { - let evt = this.newGestureEvent(EventType.Contextmenu, data.initialTarget); - evt.pageX = _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingPageX); - evt.pageY = _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingPageY); - this.dispatchEvent(evt); - } - else if (activeTouchCount === 1) { - let finalX = _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingPageX); - let finalY = _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingPageY); - let deltaT = _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingTimestamps) - data.rollingTimestamps[0]; - let deltaX = finalX - data.rollingPageX[0]; - let deltaY = finalY - data.rollingPageY[0]; - // We need to get all the dispatch targets on the start of the inertia event - const dispatchTo = this.targets.filter(t => data.initialTarget instanceof Node && t.contains(data.initialTarget)); - this.inertia(dispatchTo, timestamp, // time now - Math.abs(deltaX) / deltaT, // speed - deltaX > 0 ? 1 : -1, // x direction - finalX, // x now - Math.abs(deltaY) / deltaT, // y speed - deltaY > 0 ? 1 : -1, // y direction - finalY // y now - ); - } - this.dispatchEvent(this.newGestureEvent(EventType.End, data.initialTarget)); - // forget about this touch - delete this.activeTouches[touch.identifier]; - } - if (this.dispatched) { - e.preventDefault(); - e.stopPropagation(); - this.dispatched = false; - } - } - newGestureEvent(type, initialTarget) { - let event = document.createEvent('CustomEvent'); - event.initEvent(type, false, true); - event.initialTarget = initialTarget; - event.tapCount = 0; - return event; - } - dispatchEvent(event) { - if (event.type === EventType.Tap) { - const currentTime = (new Date()).getTime(); - let setTapCount = 0; - if (currentTime - this._lastSetTapCountTime > Gesture.CLEAR_TAP_COUNT_TIME) { - setTapCount = 1; - } - else { - setTapCount = 2; - } - this._lastSetTapCountTime = currentTime; - event.tapCount = setTapCount; - } - else if (event.type === EventType.Change || event.type === EventType.Contextmenu) { - // tap is canceled by scrolling or context menu - this._lastSetTapCountTime = 0; - } - for (let i = 0; i < this.ignoreTargets.length; i++) { - if (event.initialTarget instanceof Node && this.ignoreTargets[i].contains(event.initialTarget)) { - return; - } - } - this.targets.forEach(target => { - if (event.initialTarget instanceof Node && target.contains(event.initialTarget)) { - target.dispatchEvent(event); - this.dispatched = true; - } - }); - } - inertia(dispatchTo, t1, vX, dirX, x, vY, dirY, y) { - this.handle = _dom_js__WEBPACK_IMPORTED_MODULE_2__["scheduleAtNextAnimationFrame"](() => { - let now = Date.now(); - // velocity: old speed + accel_over_time - let deltaT = now - t1, delta_pos_x = 0, delta_pos_y = 0, stopped = true; - vX += Gesture.SCROLL_FRICTION * deltaT; - vY += Gesture.SCROLL_FRICTION * deltaT; - if (vX > 0) { - stopped = false; - delta_pos_x = dirX * vX * deltaT; - } - if (vY > 0) { - stopped = false; - delta_pos_y = dirY * vY * deltaT; - } - // dispatch translation event - let evt = this.newGestureEvent(EventType.Change); - evt.translationX = delta_pos_x; - evt.translationY = delta_pos_y; - dispatchTo.forEach(d => d.dispatchEvent(evt)); - if (!stopped) { - this.inertia(dispatchTo, now, vX, dirX, x + delta_pos_x, vY, dirY, y + delta_pos_y); - } - }); - } - onTouchMove(e) { - let timestamp = Date.now(); // use Date.now() because on FF e.timeStamp is not epoch based. - for (let i = 0, len = e.changedTouches.length; i < len; i++) { - let touch = e.changedTouches.item(i); - if (!this.activeTouches.hasOwnProperty(String(touch.identifier))) { - console.warn('end of an UNKNOWN touch', touch); - continue; - } - let data = this.activeTouches[touch.identifier]; - let evt = this.newGestureEvent(EventType.Change, data.initialTarget); - evt.translationX = touch.pageX - _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingPageX); - evt.translationY = touch.pageY - _common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["tail"](data.rollingPageY); - evt.pageX = touch.pageX; - evt.pageY = touch.pageY; - this.dispatchEvent(evt); - // only keep a few data points, to average the final speed - if (data.rollingPageX.length > 3) { - data.rollingPageX.shift(); - data.rollingPageY.shift(); - data.rollingTimestamps.shift(); - } - data.rollingPageX.push(touch.pageX); - data.rollingPageY.push(touch.pageY); - data.rollingTimestamps.push(timestamp); - } - if (this.dispatched) { - e.preventDefault(); - e.stopPropagation(); - this.dispatched = false; - } - } -} -Gesture.SCROLL_FRICTION = -0.005; -Gesture.HOLD_DELAY = 700; -Gesture.CLEAR_TAP_COUNT_TIME = 400; // ms -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_3__["memoize"] -], Gesture, "isTouchDevice", null); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js ***! - \****************************************************************************************/ -/*! exports provided: BaseActionViewItem, ActionViewItem */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseActionViewItem", function() { return BaseActionViewItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionViewItem", function() { return ActionViewItem; }); -/* harmony import */ var _actionbar_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./actionbar.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.css"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_actions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_types_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _touch_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../touch.js */ "./node_modules/monaco-editor/esm/vs/base/browser/touch.js"); -/* harmony import */ var _dnd_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../dnd.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dnd.js"); -/* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - -class BaseActionViewItem extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(context, action, options = {}) { - super(); - this.options = options; - this._context = context || this; - this._action = action; - if (action instanceof _common_actions_js__WEBPACK_IMPORTED_MODULE_4__["Action"]) { - this._register(action.onDidChange(event => { - if (!this.element) { - // we have not been rendered yet, so there - // is no point in updating the UI - return; - } - this.handleActionChangeEvent(event); - })); - } - } - handleActionChangeEvent(event) { - if (event.enabled !== undefined) { - this.updateEnabled(); - } - if (event.checked !== undefined) { - this.updateChecked(); - } - if (event.class !== undefined) { - this.updateClass(); - } - if (event.label !== undefined) { - this.updateLabel(); - this.updateTooltip(); - } - if (event.tooltip !== undefined) { - this.updateTooltip(); - } - } - get actionRunner() { - if (!this._actionRunner) { - this._actionRunner = this._register(new _common_actions_js__WEBPACK_IMPORTED_MODULE_4__["ActionRunner"]()); - } - return this._actionRunner; - } - set actionRunner(actionRunner) { - this._actionRunner = actionRunner; - } - getAction() { - return this._action; - } - isEnabled() { - return this._action.enabled; - } - setActionContext(newContext) { - this._context = newContext; - } - render(container) { - const element = this.element = container; - this._register(_touch_js__WEBPACK_IMPORTED_MODULE_7__["Gesture"].addTarget(container)); - const enableDragging = this.options && this.options.draggable; - if (enableDragging) { - container.draggable = true; - if (_browser_js__WEBPACK_IMPORTED_MODULE_9__["isFirefox"]) { - // Firefox: requires to set a text data transfer to get going - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_5__["addDisposableListener"](container, _dom_js__WEBPACK_IMPORTED_MODULE_5__["EventType"].DRAG_START, e => { var _a; return (_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.setData(_dnd_js__WEBPACK_IMPORTED_MODULE_8__["DataTransfers"].TEXT, this._action.label); })); - } - } - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_5__["addDisposableListener"](element, _touch_js__WEBPACK_IMPORTED_MODULE_7__["EventType"].Tap, e => this.onClick(e))); - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_5__["addDisposableListener"](element, _dom_js__WEBPACK_IMPORTED_MODULE_5__["EventType"].MOUSE_DOWN, e => { - if (!enableDragging) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["EventHelper"].stop(e, true); // do not run when dragging is on because that would disable it - } - if (this._action.enabled && e.button === 0) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["addClass"](element, 'active'); - } - })); - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isMacintosh"]) { - // macOS: allow to trigger the button when holding Ctrl+key and pressing the - // main mouse button. This is for scenarios where e.g. some interaction forces - // the Ctrl+key to be pressed and hold but the user still wants to interact - // with the actions (for example quick access in quick navigation mode). - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_5__["addDisposableListener"](element, _dom_js__WEBPACK_IMPORTED_MODULE_5__["EventType"].CONTEXT_MENU, e => { - if (e.button === 0 && e.ctrlKey === true) { - this.onClick(e); - } - })); - } - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_5__["addDisposableListener"](element, _dom_js__WEBPACK_IMPORTED_MODULE_5__["EventType"].CLICK, e => { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["EventHelper"].stop(e, true); - // menus do not use the click event - if (!(this.options && this.options.isMenu)) { - _common_platform_js__WEBPACK_IMPORTED_MODULE_1__["setImmediate"](() => this.onClick(e)); - } - })); - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_5__["addDisposableListener"](element, _dom_js__WEBPACK_IMPORTED_MODULE_5__["EventType"].DBLCLICK, e => { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["EventHelper"].stop(e, true); - })); - [_dom_js__WEBPACK_IMPORTED_MODULE_5__["EventType"].MOUSE_UP, _dom_js__WEBPACK_IMPORTED_MODULE_5__["EventType"].MOUSE_OUT].forEach(event => { - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_5__["addDisposableListener"](element, event, e => { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["EventHelper"].stop(e); - _dom_js__WEBPACK_IMPORTED_MODULE_5__["removeClass"](element, 'active'); - })); - }); - } - onClick(event) { - var _a; - _dom_js__WEBPACK_IMPORTED_MODULE_5__["EventHelper"].stop(event, true); - const context = _common_types_js__WEBPACK_IMPORTED_MODULE_6__["isUndefinedOrNull"](this._context) ? ((_a = this.options) === null || _a === void 0 ? void 0 : _a.useEventAsContext) ? event : undefined : this._context; - this.actionRunner.run(this._action, context); - } - focus() { - if (this.element) { - this.element.focus(); - _dom_js__WEBPACK_IMPORTED_MODULE_5__["addClass"](this.element, 'focused'); - } - } - blur() { - if (this.element) { - this.element.blur(); - _dom_js__WEBPACK_IMPORTED_MODULE_5__["removeClass"](this.element, 'focused'); - } - } - updateEnabled() { - // implement in subclass - } - updateLabel() { - // implement in subclass - } - updateTooltip() { - // implement in subclass - } - updateClass() { - // implement in subclass - } - updateChecked() { - // implement in subclass - } - dispose() { - if (this.element) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["removeNode"](this.element); - this.element = undefined; - } - super.dispose(); - } -} -class ActionViewItem extends BaseActionViewItem { - constructor(context, action, options = {}) { - super(context, action, options); - this.options = options; - this.options.icon = options.icon !== undefined ? options.icon : false; - this.options.label = options.label !== undefined ? options.label : true; - this.cssClass = ''; - } - render(container) { - super.render(container); - if (this.element) { - this.label = _dom_js__WEBPACK_IMPORTED_MODULE_5__["append"](this.element, _dom_js__WEBPACK_IMPORTED_MODULE_5__["$"]('a.action-label')); - } - if (this.label) { - if (this._action.id === _common_actions_js__WEBPACK_IMPORTED_MODULE_4__["Separator"].ID) { - this.label.setAttribute('role', 'presentation'); // A separator is a presentation item - } - else { - if (this.options.isMenu) { - this.label.setAttribute('role', 'menuitem'); - } - else { - this.label.setAttribute('role', 'button'); - } - } - } - if (this.options.label && this.options.keybinding && this.element) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["append"](this.element, _dom_js__WEBPACK_IMPORTED_MODULE_5__["$"]('span.keybinding')).textContent = this.options.keybinding; - } - this.updateClass(); - this.updateLabel(); - this.updateTooltip(); - this.updateEnabled(); - this.updateChecked(); - } - focus() { - super.focus(); - if (this.label) { - this.label.focus(); - } - } - updateLabel() { - if (this.options.label && this.label) { - this.label.textContent = this.getAction().label; - } - } - updateTooltip() { - let title = null; - if (this.getAction().tooltip) { - title = this.getAction().tooltip; - } - else if (!this.options.label && this.getAction().label && this.options.icon) { - title = this.getAction().label; - if (this.options.keybinding) { - title = _nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"]({ key: 'titleLabel', comment: ['action title', 'action keybinding'] }, "{0} ({1})", title, this.options.keybinding); - } - } - if (title && this.label) { - this.label.title = title; - } - } - updateClass() { - if (this.cssClass && this.label) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["removeClasses"](this.label, this.cssClass); - } - if (this.options.icon) { - this.cssClass = this.getAction().class; - if (this.label) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["addClass"](this.label, 'codicon'); - if (this.cssClass) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["addClasses"](this.label, this.cssClass); - } - } - this.updateEnabled(); - } - else { - if (this.label) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["removeClass"](this.label, 'codicon'); - } - } - } - updateEnabled() { - if (this.getAction().enabled) { - if (this.label) { - this.label.removeAttribute('aria-disabled'); - _dom_js__WEBPACK_IMPORTED_MODULE_5__["removeClass"](this.label, 'disabled'); - this.label.tabIndex = 0; - } - if (this.element) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["removeClass"](this.element, 'disabled'); - } - } - else { - if (this.label) { - this.label.setAttribute('aria-disabled', 'true'); - _dom_js__WEBPACK_IMPORTED_MODULE_5__["addClass"](this.label, 'disabled'); - _dom_js__WEBPACK_IMPORTED_MODULE_5__["removeTabIndexAndUpdateFocus"](this.label); - } - if (this.element) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["addClass"](this.element, 'disabled'); - } - } - } - updateChecked() { - if (this.label) { - if (this.getAction().checked) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["addClass"](this.label, 'checked'); - } - else { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["removeClass"](this.label, 'checked'); - } - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.css": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.css ***! - \***********************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_actionbar_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./actionbar.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.css"); -/* harmony import */ var _css_loader_dist_cjs_js_actionbar_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_actionbar_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_actionbar_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_actionbar_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js ***! - \**********************************************************************************/ -/*! exports provided: ActionBar */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionBar", function() { return ActionBar; }); -/* harmony import */ var _actionbar_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./actionbar.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.css"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_actions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../keyboardEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _actionViewItems_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./actionViewItems.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - -class ActionBar extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(container, options = {}) { - var _a, _b, _c; - super(); - this._onDidBlur = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidBlur = this._onDidBlur.event; - this._onDidCancel = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidCancel = this._onDidCancel.event; - this._onDidRun = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidRun = this._onDidRun.event; - this._onDidBeforeRun = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidBeforeRun = this._onDidBeforeRun.event; - this.options = options; - this._context = (_a = options.context) !== null && _a !== void 0 ? _a : null; - this._orientation = (_b = this.options.orientation) !== null && _b !== void 0 ? _b : 0 /* HORIZONTAL */; - this._triggerKeys = (_c = this.options.triggerKeys) !== null && _c !== void 0 ? _c : { - keys: [3 /* Enter */, 10 /* Space */], - keyDown: false - }; - if (this.options.actionRunner) { - this._actionRunner = this.options.actionRunner; - } - else { - this._actionRunner = new _common_actions_js__WEBPACK_IMPORTED_MODULE_2__["ActionRunner"](); - this._register(this._actionRunner); - } - this._register(this._actionRunner.onDidRun(e => this._onDidRun.fire(e))); - this._register(this._actionRunner.onDidBeforeRun(e => this._onDidBeforeRun.fire(e))); - this.viewItems = []; - this.focusedItem = undefined; - this.domNode = document.createElement('div'); - this.domNode.className = 'monaco-action-bar'; - if (options.animated !== false) { - _dom_js__WEBPACK_IMPORTED_MODULE_3__["addClass"](this.domNode, 'animated'); - } - let previousKey; - let nextKey; - switch (this._orientation) { - case 0 /* HORIZONTAL */: - previousKey = 15 /* LeftArrow */; - nextKey = 17 /* RightArrow */; - break; - case 1 /* HORIZONTAL_REVERSE */: - previousKey = 17 /* RightArrow */; - nextKey = 15 /* LeftArrow */; - this.domNode.className += ' reverse'; - break; - case 2 /* VERTICAL */: - previousKey = 16 /* UpArrow */; - nextKey = 18 /* DownArrow */; - this.domNode.className += ' vertical'; - break; - case 3 /* VERTICAL_REVERSE */: - previousKey = 18 /* DownArrow */; - nextKey = 16 /* UpArrow */; - this.domNode.className += ' vertical reverse'; - break; - } - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addDisposableListener"](this.domNode, _dom_js__WEBPACK_IMPORTED_MODULE_3__["EventType"].KEY_DOWN, e => { - const event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__["StandardKeyboardEvent"](e); - let eventHandled = true; - if (event.equals(previousKey)) { - eventHandled = this.focusPrevious(); - } - else if (event.equals(nextKey)) { - eventHandled = this.focusNext(); - } - else if (event.equals(9 /* Escape */)) { - this._onDidCancel.fire(); - } - else if (this.isTriggerKeyEvent(event)) { - // Staying out of the else branch even if not triggered - if (this._triggerKeys.keyDown) { - this.doTrigger(event); - } - } - else { - eventHandled = false; - } - if (eventHandled) { - event.preventDefault(); - event.stopPropagation(); - } - })); - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addDisposableListener"](this.domNode, _dom_js__WEBPACK_IMPORTED_MODULE_3__["EventType"].KEY_UP, e => { - const event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__["StandardKeyboardEvent"](e); - // Run action on Enter/Space - if (this.isTriggerKeyEvent(event)) { - if (!this._triggerKeys.keyDown) { - this.doTrigger(event); - } - event.preventDefault(); - event.stopPropagation(); - } - // Recompute focused item - else if (event.equals(2 /* Tab */) || event.equals(1024 /* Shift */ | 2 /* Tab */)) { - this.updateFocusedItem(); - } - })); - this.focusTracker = this._register(_dom_js__WEBPACK_IMPORTED_MODULE_3__["trackFocus"](this.domNode)); - this._register(this.focusTracker.onDidBlur(() => { - if (_dom_js__WEBPACK_IMPORTED_MODULE_3__["getActiveElement"]() === this.domNode || !_dom_js__WEBPACK_IMPORTED_MODULE_3__["isAncestor"](_dom_js__WEBPACK_IMPORTED_MODULE_3__["getActiveElement"](), this.domNode)) { - this._onDidBlur.fire(); - this.focusedItem = undefined; - } - })); - this._register(this.focusTracker.onDidFocus(() => this.updateFocusedItem())); - this.actionsList = document.createElement('ul'); - this.actionsList.className = 'actions-container'; - this.actionsList.setAttribute('role', 'toolbar'); - if (this.options.ariaLabel) { - this.actionsList.setAttribute('aria-label', this.options.ariaLabel); - } - this.domNode.appendChild(this.actionsList); - container.appendChild(this.domNode); - } - isTriggerKeyEvent(event) { - let ret = false; - this._triggerKeys.keys.forEach(keyCode => { - ret = ret || event.equals(keyCode); - }); - return ret; - } - updateFocusedItem() { - for (let i = 0; i < this.actionsList.children.length; i++) { - const elem = this.actionsList.children[i]; - if (_dom_js__WEBPACK_IMPORTED_MODULE_3__["isAncestor"](_dom_js__WEBPACK_IMPORTED_MODULE_3__["getActiveElement"](), elem)) { - this.focusedItem = i; - break; - } - } - } - get context() { - return this._context; - } - set context(context) { - this._context = context; - this.viewItems.forEach(i => i.setActionContext(context)); - } - get actionRunner() { - return this._actionRunner; - } - set actionRunner(actionRunner) { - if (actionRunner) { - this._actionRunner = actionRunner; - this.viewItems.forEach(item => item.actionRunner = actionRunner); - } - } - getContainer() { - return this.domNode; - } - push(arg, options = {}) { - const actions = Array.isArray(arg) ? arg : [arg]; - let index = _common_types_js__WEBPACK_IMPORTED_MODULE_4__["isNumber"](options.index) ? options.index : null; - actions.forEach((action) => { - const actionViewItemElement = document.createElement('li'); - actionViewItemElement.className = 'action-item'; - actionViewItemElement.setAttribute('role', 'presentation'); - // Prevent native context menu on actions - if (!this.options.allowContextMenu) { - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addDisposableListener"](actionViewItemElement, _dom_js__WEBPACK_IMPORTED_MODULE_3__["EventType"].CONTEXT_MENU, (e) => { - _dom_js__WEBPACK_IMPORTED_MODULE_3__["EventHelper"].stop(e, true); - })); - } - let item; - if (this.options.actionViewItemProvider) { - item = this.options.actionViewItemProvider(action); - } - if (!item) { - item = new _actionViewItems_js__WEBPACK_IMPORTED_MODULE_7__["ActionViewItem"](this.context, action, options); - } - item.actionRunner = this._actionRunner; - item.setActionContext(this.context); - item.render(actionViewItemElement); - if (index === null || index < 0 || index >= this.actionsList.children.length) { - this.actionsList.appendChild(actionViewItemElement); - this.viewItems.push(item); - } - else { - this.actionsList.insertBefore(actionViewItemElement, this.actionsList.children[index]); - this.viewItems.splice(index, 0, item); - index++; - } - }); - if (this.focusedItem) { - // After a clear actions might be re-added to simply toggle some actions. We should preserve focus #97128 - this.focus(this.focusedItem); - } - } - clear() { - Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this.viewItems); - this.viewItems = []; - _dom_js__WEBPACK_IMPORTED_MODULE_3__["clearNode"](this.actionsList); - } - focus(arg) { - let selectFirst = false; - let index = undefined; - if (arg === undefined) { - selectFirst = true; - } - else if (typeof arg === 'number') { - index = arg; - } - else if (typeof arg === 'boolean') { - selectFirst = arg; - } - if (selectFirst && typeof this.focusedItem === 'undefined') { - // Focus the first enabled item - this.focusedItem = -1; - this.focusNext(); - } - else { - if (index !== undefined) { - this.focusedItem = index; - } - this.updateFocus(); - } - } - focusNext() { - if (typeof this.focusedItem === 'undefined') { - this.focusedItem = this.viewItems.length - 1; - } - const startIndex = this.focusedItem; - let item; - do { - if (this.options.preventLoopNavigation && this.focusedItem + 1 >= this.viewItems.length) { - this.focusedItem = startIndex; - return false; - } - this.focusedItem = (this.focusedItem + 1) % this.viewItems.length; - item = this.viewItems[this.focusedItem]; - } while (this.focusedItem !== startIndex && !item.isEnabled()); - if (this.focusedItem === startIndex && !item.isEnabled()) { - this.focusedItem = undefined; - } - this.updateFocus(); - return true; - } - focusPrevious() { - if (typeof this.focusedItem === 'undefined') { - this.focusedItem = 0; - } - const startIndex = this.focusedItem; - let item; - do { - this.focusedItem = this.focusedItem - 1; - if (this.focusedItem < 0) { - if (this.options.preventLoopNavigation) { - this.focusedItem = startIndex; - return false; - } - this.focusedItem = this.viewItems.length - 1; - } - item = this.viewItems[this.focusedItem]; - } while (this.focusedItem !== startIndex && !item.isEnabled()); - if (this.focusedItem === startIndex && !item.isEnabled()) { - this.focusedItem = undefined; - } - this.updateFocus(true); - return true; - } - updateFocus(fromRight, preventScroll) { - if (typeof this.focusedItem === 'undefined') { - this.actionsList.focus({ preventScroll }); - } - for (let i = 0; i < this.viewItems.length; i++) { - const item = this.viewItems[i]; - const actionViewItem = item; - if (i === this.focusedItem) { - if (_common_types_js__WEBPACK_IMPORTED_MODULE_4__["isFunction"](actionViewItem.isEnabled)) { - if (actionViewItem.isEnabled() && _common_types_js__WEBPACK_IMPORTED_MODULE_4__["isFunction"](actionViewItem.focus)) { - actionViewItem.focus(fromRight); - } - else { - this.actionsList.focus({ preventScroll }); - } - } - } - else { - if (_common_types_js__WEBPACK_IMPORTED_MODULE_4__["isFunction"](actionViewItem.blur)) { - actionViewItem.blur(); - } - } - } - } - doTrigger(event) { - if (typeof this.focusedItem === 'undefined') { - return; //nothing to focus - } - // trigger action - const actionViewItem = this.viewItems[this.focusedItem]; - if (actionViewItem instanceof _actionViewItems_js__WEBPACK_IMPORTED_MODULE_7__["BaseActionViewItem"]) { - const context = (actionViewItem._context === null || actionViewItem._context === undefined) ? event : actionViewItem._context; - this.run(actionViewItem._action, context); - } - } - run(action, context) { - return this._actionRunner.run(action, context); - } - dispose() { - Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this.viewItems); - this.viewItems = []; - _dom_js__WEBPACK_IMPORTED_MODULE_3__["removeNode"](this.getContainer()); - super.dispose(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.css": -/*!*************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.css ***! - \*************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_aria_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./aria.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.css"); -/* harmony import */ var _css_loader_dist_cjs_js_aria_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_aria_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_aria_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_aria_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js ***! - \************************************************************************/ -/*! exports provided: setARIAContainer, alert, status */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setARIAContainer", function() { return setARIAContainer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "alert", function() { return alert; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "status", function() { return status; }); -/* harmony import */ var _aria_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./aria.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.css"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -// Use a max length since we are inserting the whole msg in the DOM and that can cause browsers to freeze for long messages #94233 -const MAX_MESSAGE_LENGTH = 20000; -let ariaContainer; -let alertContainer; -let alertContainer2; -let statusContainer; -let statusContainer2; -function setARIAContainer(parent) { - ariaContainer = document.createElement('div'); - ariaContainer.className = 'monaco-aria-container'; - const createAlertContainer = () => { - const element = document.createElement('div'); - element.className = 'monaco-alert'; - element.setAttribute('role', 'alert'); - element.setAttribute('aria-atomic', 'true'); - ariaContainer.appendChild(element); - return element; - }; - alertContainer = createAlertContainer(); - alertContainer2 = createAlertContainer(); - const createStatusContainer = () => { - const element = document.createElement('div'); - element.className = 'monaco-status'; - element.setAttribute('role', 'complementary'); - element.setAttribute('aria-live', 'polite'); - element.setAttribute('aria-atomic', 'true'); - ariaContainer.appendChild(element); - return element; - }; - statusContainer = createStatusContainer(); - statusContainer2 = createStatusContainer(); - parent.appendChild(ariaContainer); -} -/** - * Given the provided message, will make sure that it is read as alert to screen readers. - */ -function alert(msg) { - if (!ariaContainer) { - return; - } - // Use alternate containers such that duplicated messages get read out by screen readers #99466 - if (alertContainer.textContent !== msg) { - _dom_js__WEBPACK_IMPORTED_MODULE_2__["clearNode"](alertContainer2); - insertMessage(alertContainer, msg); - } - else { - _dom_js__WEBPACK_IMPORTED_MODULE_2__["clearNode"](alertContainer); - insertMessage(alertContainer2, msg); - } -} -/** - * Given the provided message, will make sure that it is read as status to screen readers. - */ -function status(msg) { - if (!ariaContainer) { - return; - } - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isMacintosh"]) { - alert(msg); // VoiceOver does not seem to support status role - } - else { - if (statusContainer.textContent !== msg) { - _dom_js__WEBPACK_IMPORTED_MODULE_2__["clearNode"](statusContainer2); - insertMessage(statusContainer, msg); - } - else { - _dom_js__WEBPACK_IMPORTED_MODULE_2__["clearNode"](statusContainer); - insertMessage(statusContainer2, msg); - } - } -} -function insertMessage(target, msg) { - _dom_js__WEBPACK_IMPORTED_MODULE_2__["clearNode"](target); - if (msg.length > MAX_MESSAGE_LENGTH) { - msg = msg.substr(0, MAX_MESSAGE_LENGTH); - } - target.textContent = msg; - // See https://www.paciellogroup.com/blog/2012/06/html5-accessibility-chops-aria-rolealert-browser-support/ - target.style.visibility = 'hidden'; - target.style.visibility = 'visible'; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/button/button.css": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/button/button.css ***! - \*****************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_button_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./button.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/button/button.css"); -/* harmony import */ var _css_loader_dist_cjs_js_button_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_button_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_button_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_button_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/button/button.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/button/button.js ***! - \****************************************************************************/ -/*! exports provided: Button */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Button", function() { return Button; }); -/* harmony import */ var _button_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./button.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/button/button.css"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../keyboardEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js"); -/* harmony import */ var _common_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _common_objects_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _touch_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../touch.js */ "./node_modules/monaco-editor/esm/vs/base/browser/touch.js"); -/* harmony import */ var _codicons_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../codicons.js */ "./node_modules/monaco-editor/esm/vs/base/browser/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -const defaultOptions = { - buttonBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_3__["Color"].fromHex('#0E639C'), - buttonHoverBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_3__["Color"].fromHex('#006BB3'), - buttonForeground: _common_color_js__WEBPACK_IMPORTED_MODULE_3__["Color"].white -}; -class Button extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_6__["Disposable"] { - constructor(container, options) { - super(); - this._onDidClick = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this.options = options || Object.create(null); - Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_4__["mixin"])(this.options, defaultOptions, false); - this.buttonForeground = this.options.buttonForeground; - this.buttonBackground = this.options.buttonBackground; - this.buttonHoverBackground = this.options.buttonHoverBackground; - this.buttonSecondaryForeground = this.options.buttonSecondaryForeground; - this.buttonSecondaryBackground = this.options.buttonSecondaryBackground; - this.buttonSecondaryHoverBackground = this.options.buttonSecondaryHoverBackground; - this.buttonBorder = this.options.buttonBorder; - this._element = document.createElement('a'); - _dom_js__WEBPACK_IMPORTED_MODULE_1__["addClass"](this._element, 'monaco-button'); - this._element.tabIndex = 0; - this._element.setAttribute('role', 'button'); - container.appendChild(this._element); - this._register(_touch_js__WEBPACK_IMPORTED_MODULE_7__["Gesture"].addTarget(this._element)); - [_dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].CLICK, _touch_js__WEBPACK_IMPORTED_MODULE_7__["EventType"].Tap].forEach(eventType => { - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](this._element, eventType, e => { - if (!this.enabled) { - _dom_js__WEBPACK_IMPORTED_MODULE_1__["EventHelper"].stop(e); - return; - } - this._onDidClick.fire(e); - })); - }); - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](this._element, _dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].KEY_DOWN, e => { - const event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_2__["StandardKeyboardEvent"](e); - let eventHandled = false; - if (this.enabled && (event.equals(3 /* Enter */) || event.equals(10 /* Space */))) { - this._onDidClick.fire(e); - eventHandled = true; - } - else if (event.equals(9 /* Escape */)) { - this._element.blur(); - eventHandled = true; - } - if (eventHandled) { - _dom_js__WEBPACK_IMPORTED_MODULE_1__["EventHelper"].stop(event, true); - } - })); - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](this._element, _dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].MOUSE_OVER, e => { - if (!_dom_js__WEBPACK_IMPORTED_MODULE_1__["hasClass"](this._element, 'disabled')) { - this.setHoverBackground(); - } - })); - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](this._element, _dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].MOUSE_OUT, e => { - this.applyStyles(); // restore standard styles - })); - // Also set hover background when button is focused for feedback - this.focusTracker = this._register(_dom_js__WEBPACK_IMPORTED_MODULE_1__["trackFocus"](this._element)); - this._register(this.focusTracker.onDidFocus(() => this.setHoverBackground())); - this._register(this.focusTracker.onDidBlur(() => this.applyStyles())); // restore standard styles - this.applyStyles(); - } - get onDidClick() { return this._onDidClick.event; } - setHoverBackground() { - let hoverBackground; - if (this.options.secondary) { - hoverBackground = this.buttonSecondaryHoverBackground ? this.buttonSecondaryHoverBackground.toString() : null; - } - else { - hoverBackground = this.buttonHoverBackground ? this.buttonHoverBackground.toString() : null; - } - if (hoverBackground) { - this._element.style.backgroundColor = hoverBackground; - } - } - style(styles) { - this.buttonForeground = styles.buttonForeground; - this.buttonBackground = styles.buttonBackground; - this.buttonHoverBackground = styles.buttonHoverBackground; - this.buttonSecondaryForeground = styles.buttonSecondaryForeground; - this.buttonSecondaryBackground = styles.buttonSecondaryBackground; - this.buttonSecondaryHoverBackground = styles.buttonSecondaryHoverBackground; - this.buttonBorder = styles.buttonBorder; - this.applyStyles(); - } - applyStyles() { - if (this._element) { - let background, foreground; - if (this.options.secondary) { - foreground = this.buttonSecondaryForeground ? this.buttonSecondaryForeground.toString() : ''; - background = this.buttonSecondaryBackground ? this.buttonSecondaryBackground.toString() : ''; - } - else { - foreground = this.buttonForeground ? this.buttonForeground.toString() : ''; - background = this.buttonBackground ? this.buttonBackground.toString() : ''; - } - const border = this.buttonBorder ? this.buttonBorder.toString() : ''; - this._element.style.color = foreground; - this._element.style.backgroundColor = background; - this._element.style.borderWidth = border ? '1px' : ''; - this._element.style.borderStyle = border ? 'solid' : ''; - this._element.style.borderColor = border; - } - } - get element() { - return this._element; - } - set label(value) { - if (!_dom_js__WEBPACK_IMPORTED_MODULE_1__["hasClass"](this._element, 'monaco-text-button')) { - _dom_js__WEBPACK_IMPORTED_MODULE_1__["addClass"](this._element, 'monaco-text-button'); - } - if (this.options.supportCodicons) { - _dom_js__WEBPACK_IMPORTED_MODULE_1__["reset"](this._element, ...Object(_codicons_js__WEBPACK_IMPORTED_MODULE_8__["renderCodiconsAsElement"])(value)); - } - else { - this._element.textContent = value; - } - if (typeof this.options.title === 'string') { - this._element.title = this.options.title; - } - else if (this.options.title) { - this._element.title = value; - } - } - set enabled(value) { - if (value) { - _dom_js__WEBPACK_IMPORTED_MODULE_1__["removeClass"](this._element, 'disabled'); - this._element.setAttribute('aria-disabled', String(false)); - this._element.tabIndex = 0; - } - else { - _dom_js__WEBPACK_IMPORTED_MODULE_1__["addClass"](this._element, 'disabled'); - this._element.setAttribute('aria-disabled', String(true)); - _dom_js__WEBPACK_IMPORTED_MODULE_1__["removeTabIndexAndUpdateFocus"](this._element); - } - } - get enabled() { - return !_dom_js__WEBPACK_IMPORTED_MODULE_1__["hasClass"](this._element, 'disabled'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/checkbox/checkbox.css": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/checkbox/checkbox.css ***! - \*********************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_checkbox_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./checkbox.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/checkbox/checkbox.css"); -/* harmony import */ var _css_loader_dist_cjs_js_checkbox_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_checkbox_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_checkbox_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_checkbox_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/checkbox/checkbox.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/checkbox/checkbox.js ***! - \********************************************************************************/ -/*! exports provided: Checkbox */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Checkbox", function() { return Checkbox; }); -/* harmony import */ var _checkbox_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./checkbox.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/checkbox/checkbox.css"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _widget_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"); -/* harmony import */ var _common_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -const defaultOpts = { - inputActiveOptionBorder: _common_color_js__WEBPACK_IMPORTED_MODULE_3__["Color"].fromHex('#007ACC00'), - inputActiveOptionForeground: _common_color_js__WEBPACK_IMPORTED_MODULE_3__["Color"].fromHex('#FFFFFF'), - inputActiveOptionBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_3__["Color"].fromHex('#0E639C50') -}; -class Checkbox extends _widget_js__WEBPACK_IMPORTED_MODULE_2__["Widget"] { - constructor(opts) { - super(); - this._onChange = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onChange = this._onChange.event; - this._onKeyDown = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onKeyDown = this._onKeyDown.event; - this._opts = Object.assign(Object.assign({}, defaultOpts), opts); - this._checked = this._opts.isChecked; - const classes = ['monaco-custom-checkbox']; - if (this._opts.icon) { - classes.push(this._opts.icon.classNames); - } - else { - classes.push('codicon'); // todo@aeschli: remove once codicon fully adopted - } - if (this._opts.actionClassName) { - classes.push(this._opts.actionClassName); - } - classes.push(this._checked ? 'checked' : 'unchecked'); - this.domNode = document.createElement('div'); - this.domNode.title = this._opts.title; - this.domNode.className = classes.join(' '); - this.domNode.tabIndex = 0; - this.domNode.setAttribute('role', 'checkbox'); - this.domNode.setAttribute('aria-checked', String(this._checked)); - this.domNode.setAttribute('aria-label', this._opts.title); - this.applyStyles(); - this.onclick(this.domNode, (ev) => { - this.checked = !this._checked; - this._onChange.fire(false); - ev.preventDefault(); - }); - this.ignoreGesture(this.domNode); - this.onkeydown(this.domNode, (keyboardEvent) => { - if (keyboardEvent.keyCode === 10 /* Space */ || keyboardEvent.keyCode === 3 /* Enter */) { - this.checked = !this._checked; - this._onChange.fire(true); - keyboardEvent.preventDefault(); - return; - } - this._onKeyDown.fire(keyboardEvent); - }); - } - get enabled() { - return this.domNode.getAttribute('aria-disabled') !== 'true'; - } - focus() { - this.domNode.focus(); - } - get checked() { - return this._checked; - } - set checked(newIsChecked) { - this._checked = newIsChecked; - this.domNode.setAttribute('aria-checked', String(this._checked)); - if (this._checked) { - this.domNode.classList.add('checked'); - } - else { - this.domNode.classList.remove('checked'); - } - this.applyStyles(); - } - width() { - return 2 /*marginleft*/ + 2 /*border*/ + 2 /*padding*/ + 16 /* icon width */; - } - style(styles) { - if (styles.inputActiveOptionBorder) { - this._opts.inputActiveOptionBorder = styles.inputActiveOptionBorder; - } - if (styles.inputActiveOptionForeground) { - this._opts.inputActiveOptionForeground = styles.inputActiveOptionForeground; - } - if (styles.inputActiveOptionBackground) { - this._opts.inputActiveOptionBackground = styles.inputActiveOptionBackground; - } - this.applyStyles(); - } - applyStyles() { - if (this.domNode) { - this.domNode.style.borderColor = this._checked && this._opts.inputActiveOptionBorder ? this._opts.inputActiveOptionBorder.toString() : 'transparent'; - this.domNode.style.color = this._checked && this._opts.inputActiveOptionForeground ? this._opts.inputActiveOptionForeground.toString() : 'inherit'; - this.domNode.style.backgroundColor = this._checked && this._opts.inputActiveOptionBackground ? this._opts.inputActiveOptionBackground.toString() : 'transparent'; - } - } - enable() { - this.domNode.tabIndex = 0; - this.domNode.setAttribute('aria-disabled', String(false)); - } - disable() { - _dom_js__WEBPACK_IMPORTED_MODULE_1__["removeTabIndexAndUpdateFocus"](this.domNode); - this.domNode.setAttribute('aria-disabled', String(true)); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon-animations.css": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon-animations.css ***! - \***************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_codicon_animations_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../../css-loader/dist/cjs.js!./codicon-animations.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon-animations.css"); -/* harmony import */ var _css_loader_dist_cjs_js_codicon_animations_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_codicon_animations_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_codicon_animations_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_codicon_animations_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon-modifications.css": -/*!******************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon-modifications.css ***! - \******************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_codicon_modifications_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../../css-loader/dist/cjs.js!./codicon-modifications.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon-modifications.css"); -/* harmony import */ var _css_loader_dist_cjs_js_codicon_modifications_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_codicon_modifications_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_codicon_modifications_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_codicon_modifications_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.css": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.css ***! - \****************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_codicon_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../../css-loader/dist/cjs.js!./codicon.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.css"); -/* harmony import */ var _css_loader_dist_cjs_js_codicon_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_codicon_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_codicon_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_codicon_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf ***! - \****************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.p + "codicon.ttf"); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codiconStyles.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codiconStyles.js ***! - \*************************************************************************************/ -/*! exports provided: CodiconStyles, formatRule */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodiconStyles", function() { return CodiconStyles; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatRule", function() { return formatRule; }); -/* harmony import */ var _codicon_codicon_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./codicon/codicon.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.css"); -/* harmony import */ var _codicon_codicon_modifications_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./codicon/codicon-modifications.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon-modifications.css"); -/* harmony import */ var _codicon_codicon_animations_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./codicon/codicon-animations.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon-animations.css"); -/* harmony import */ var _common_codicons_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -const CodiconStyles = new class { - constructor() { - this.onDidChange = _common_codicons_js__WEBPACK_IMPORTED_MODULE_3__["iconRegistry"].onDidRegister; - } - getCSS() { - const rules = []; - for (let c of _common_codicons_js__WEBPACK_IMPORTED_MODULE_3__["iconRegistry"].all) { - rules.push(formatRule(c)); - } - return rules.join('\n'); - } -}; -function formatRule(c) { - let def = c.definition; - while (def instanceof _common_codicons_js__WEBPACK_IMPORTED_MODULE_3__["Codicon"]) { - def = def.definition; - } - return `.codicon-${c.id}:before { content: '${def.character}'; }`; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/contextview/contextview.css": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/contextview/contextview.css ***! - \***************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_contextview_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./contextview.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/contextview/contextview.css"); -/* harmony import */ var _css_loader_dist_cjs_js_contextview_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_contextview_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_contextview_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_contextview_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/contextview/contextview.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/contextview/contextview.js ***! - \**************************************************************************************/ -/*! exports provided: layout, ContextView */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "layout", function() { return layout; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextView", function() { return ContextView; }); -/* harmony import */ var _contextview_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contextview.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/contextview/contextview.css"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/range.js */ "./node_modules/monaco-editor/esm/vs/base/common/range.js"); -/* harmony import */ var _canIUse_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../canIUse.js */ "./node_modules/monaco-editor/esm/vs/base/browser/canIUse.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -/** - * Lays out a one dimensional view next to an anchor in a viewport. - * - * @returns The view offset within the viewport. - */ -function layout(viewportSize, viewSize, anchor) { - const anchorEnd = anchor.offset + anchor.size; - if (anchor.position === 0 /* Before */) { - if (viewSize <= viewportSize - anchorEnd) { - return anchorEnd; // happy case, lay it out after the anchor - } - if (viewSize <= anchor.offset) { - return anchor.offset - viewSize; // ok case, lay it out before the anchor - } - return Math.max(viewportSize - viewSize, 0); // sad case, lay it over the anchor - } - else { - if (viewSize <= anchor.offset) { - return anchor.offset - viewSize; // happy case, lay it out before the anchor - } - if (viewSize <= viewportSize - anchorEnd) { - return anchorEnd; // ok case, lay it out after the anchor - } - return 0; // sad case, lay it over the anchor - } -} -class ContextView extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(container, domPosition) { - super(); - this.container = null; - this.delegate = null; - this.toDisposeOnClean = _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"].None; - this.toDisposeOnSetContainer = _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"].None; - this.shadowRoot = null; - this.shadowRootHostElement = null; - this.view = _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('.context-view'); - this.useFixedPosition = false; - this.useShadowDOM = false; - _dom_js__WEBPACK_IMPORTED_MODULE_1__["hide"](this.view); - this.setContainer(container, domPosition); - this._register(Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["toDisposable"])(() => this.setContainer(null, 1 /* ABSOLUTE */))); - } - setContainer(container, domPosition) { - if (this.container) { - this.toDisposeOnSetContainer.dispose(); - if (this.shadowRoot) { - this.shadowRoot.removeChild(this.view); - this.shadowRoot = null; - _dom_js__WEBPACK_IMPORTED_MODULE_1__["removeNode"](this.shadowRootHostElement); - this.shadowRootHostElement = null; - } - else { - this.container.removeChild(this.view); - } - this.container = null; - } - if (container) { - this.container = container; - this.useFixedPosition = domPosition !== 1 /* ABSOLUTE */; - this.useShadowDOM = domPosition === 3 /* FIXED_SHADOW */; - if (this.useShadowDOM) { - this.shadowRootHostElement = _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('.shadow-root-host'); - this.container.appendChild(this.shadowRootHostElement); - this.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' }); - this.shadowRoot.innerHTML = ` - - `; - this.shadowRoot.appendChild(this.view); - this.shadowRoot.appendChild(_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('slot')); - } - else { - this.container.appendChild(this.view); - } - const toDisposeOnSetContainer = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - ContextView.BUBBLE_UP_EVENTS.forEach(event => { - toDisposeOnSetContainer.add(_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](this.container, event, (e) => { - this.onDOMEvent(e, false); - })); - }); - ContextView.BUBBLE_DOWN_EVENTS.forEach(event => { - toDisposeOnSetContainer.add(_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](this.container, event, (e) => { - this.onDOMEvent(e, true); - }, true)); - }); - this.toDisposeOnSetContainer = toDisposeOnSetContainer; - } - } - show(delegate) { - if (this.isVisible()) { - this.hide(); - } - // Show static box - _dom_js__WEBPACK_IMPORTED_MODULE_1__["clearNode"](this.view); - this.view.className = 'context-view'; - this.view.style.top = '0px'; - this.view.style.left = '0px'; - this.view.style.zIndex = '2500'; - this.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute'; - _dom_js__WEBPACK_IMPORTED_MODULE_1__["show"](this.view); - // Render content - this.toDisposeOnClean = delegate.render(this.view) || _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"].None; - // Set active delegate - this.delegate = delegate; - // Layout - this.doLayout(); - // Focus - if (this.delegate.focus) { - this.delegate.focus(); - } - } - getViewElement() { - return this.view; - } - layout() { - if (!this.isVisible()) { - return; - } - if (this.delegate.canRelayout === false && !(_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isIOS"] && _canIUse_js__WEBPACK_IMPORTED_MODULE_5__["BrowserFeatures"].pointerEvents)) { - this.hide(); - return; - } - if (this.delegate.layout) { - this.delegate.layout(); - } - this.doLayout(); - } - doLayout() { - // Check that we still have a delegate - this.delegate.layout may have hidden - if (!this.isVisible()) { - return; - } - // Get anchor - let anchor = this.delegate.getAnchor(); - // Compute around - let around; - // Get the element's position and size (to anchor the view) - if (_dom_js__WEBPACK_IMPORTED_MODULE_1__["isHTMLElement"](anchor)) { - let elementPosition = _dom_js__WEBPACK_IMPORTED_MODULE_1__["getDomNodePagePosition"](anchor); - around = { - top: elementPosition.top, - left: elementPosition.left, - width: elementPosition.width, - height: elementPosition.height - }; - } - else { - around = { - top: anchor.y, - left: anchor.x, - width: anchor.width || 1, - height: anchor.height || 2 - }; - } - const viewSizeWidth = _dom_js__WEBPACK_IMPORTED_MODULE_1__["getTotalWidth"](this.view); - const viewSizeHeight = _dom_js__WEBPACK_IMPORTED_MODULE_1__["getTotalHeight"](this.view); - const anchorPosition = this.delegate.anchorPosition || 0 /* BELOW */; - const anchorAlignment = this.delegate.anchorAlignment || 0 /* LEFT */; - const verticalAnchor = { offset: around.top - window.pageYOffset, size: around.height, position: anchorPosition === 0 /* BELOW */ ? 0 /* Before */ : 1 /* After */ }; - let horizontalAnchor; - if (anchorAlignment === 0 /* LEFT */) { - horizontalAnchor = { offset: around.left, size: 0, position: 0 /* Before */ }; - } - else { - horizontalAnchor = { offset: around.left + around.width, size: 0, position: 1 /* After */ }; - } - const top = layout(window.innerHeight, viewSizeHeight, verticalAnchor) + window.pageYOffset; - // if view intersects vertically with anchor, shift it horizontally - if (_common_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].intersects({ start: top, end: top + viewSizeHeight }, { start: verticalAnchor.offset, end: verticalAnchor.offset + verticalAnchor.size })) { - horizontalAnchor.size = around.width; - if (anchorAlignment === 1 /* RIGHT */) { - horizontalAnchor.offset = around.left; - } - } - const left = layout(window.innerWidth, viewSizeWidth, horizontalAnchor); - _dom_js__WEBPACK_IMPORTED_MODULE_1__["removeClasses"](this.view, 'top', 'bottom', 'left', 'right'); - _dom_js__WEBPACK_IMPORTED_MODULE_1__["addClass"](this.view, anchorPosition === 0 /* BELOW */ ? 'bottom' : 'top'); - _dom_js__WEBPACK_IMPORTED_MODULE_1__["addClass"](this.view, anchorAlignment === 0 /* LEFT */ ? 'left' : 'right'); - _dom_js__WEBPACK_IMPORTED_MODULE_1__["toggleClass"](this.view, 'fixed', this.useFixedPosition); - const containerPosition = _dom_js__WEBPACK_IMPORTED_MODULE_1__["getDomNodePagePosition"](this.container); - this.view.style.top = `${top - (this.useFixedPosition ? _dom_js__WEBPACK_IMPORTED_MODULE_1__["getDomNodePagePosition"](this.view).top : containerPosition.top)}px`; - this.view.style.left = `${left - (this.useFixedPosition ? _dom_js__WEBPACK_IMPORTED_MODULE_1__["getDomNodePagePosition"](this.view).left : containerPosition.left)}px`; - this.view.style.width = 'initial'; - } - hide(data) { - const delegate = this.delegate; - this.delegate = null; - if (delegate === null || delegate === void 0 ? void 0 : delegate.onHide) { - delegate.onHide(data); - } - this.toDisposeOnClean.dispose(); - _dom_js__WEBPACK_IMPORTED_MODULE_1__["hide"](this.view); - } - isVisible() { - return !!this.delegate; - } - onDOMEvent(e, onCapture) { - if (this.delegate) { - if (this.delegate.onDOMEvent) { - this.delegate.onDOMEvent(e, document.activeElement); - } - else if (onCapture && !_dom_js__WEBPACK_IMPORTED_MODULE_1__["isAncestor"](e.target, this.container)) { - this.hide(); - } - } - } - dispose() { - this.hide(); - super.dispose(); - } -} -ContextView.BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur']; -ContextView.BUBBLE_DOWN_EVENTS = ['click']; -let SHADOW_ROOT_CSS = /* css */ ` - :host { - all: initial; /* 1st rule so subsequent properties are reset. */ - } - - @font-face { - font-family: "codicon"; - src: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype"); - } - - .codicon[class*='codicon-'] { - font: normal normal normal 16px/1 codicon; - display: inline-block; - text-decoration: none; - text-rendering: auto; - text-align: center; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - user-select: none; - -webkit-user-select: none; - -ms-user-select: none; - } - - :host { - font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif; - } - - :host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } - :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } - :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } - :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } - :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; } - - :host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; } - :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } - :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } - :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; } - :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; } - - :host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; } - :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } - :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } - :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } - :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } -`; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.css": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.css ***! - \*************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_countBadge_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./countBadge.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.css"); -/* harmony import */ var _css_loader_dist_cjs_js_countBadge_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_countBadge_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_countBadge_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_countBadge_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.js ***! - \************************************************************************************/ -/*! exports provided: CountBadge */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CountBadge", function() { return CountBadge; }); -/* harmony import */ var _countBadge_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./countBadge.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.css"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _common_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _common_objects_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -const defaultOpts = { - badgeBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_3__["Color"].fromHex('#4D4D4D'), - badgeForeground: _common_color_js__WEBPACK_IMPORTED_MODULE_3__["Color"].fromHex('#FFFFFF') -}; -class CountBadge { - constructor(container, options) { - this.count = 0; - this.options = options || Object.create(null); - Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_4__["mixin"])(this.options, defaultOpts, false); - this.badgeBackground = this.options.badgeBackground; - this.badgeForeground = this.options.badgeForeground; - this.badgeBorder = this.options.badgeBorder; - this.element = Object(_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"])(container, Object(_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('.monaco-count-badge')); - this.countFormat = this.options.countFormat || '{0}'; - this.titleFormat = this.options.titleFormat || ''; - this.setCount(this.options.count || 0); - } - setCount(count) { - this.count = count; - this.render(); - } - setTitleFormat(titleFormat) { - this.titleFormat = titleFormat; - this.render(); - } - render() { - this.element.textContent = Object(_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["format"])(this.countFormat, this.count); - this.element.title = Object(_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["format"])(this.titleFormat, this.count); - this.applyStyles(); - } - style(styles) { - this.badgeBackground = styles.badgeBackground; - this.badgeForeground = styles.badgeForeground; - this.badgeBorder = styles.badgeBorder; - this.applyStyles(); - } - applyStyles() { - if (this.element) { - const background = this.badgeBackground ? this.badgeBackground.toString() : ''; - const foreground = this.badgeForeground ? this.badgeForeground.toString() : ''; - const border = this.badgeBorder ? this.badgeBorder.toString() : ''; - this.element.style.backgroundColor = background; - this.element.style.color = foreground; - this.element.style.borderWidth = border ? '1px' : ''; - this.element.style.borderStyle = border ? 'solid' : ''; - this.element.style.borderColor = border; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdown.css": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdown.css ***! - \*********************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_dropdown_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./dropdown.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdown.css"); -/* harmony import */ var _css_loader_dist_cjs_js_dropdown_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_dropdown_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_dropdown_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_dropdown_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdown.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdown.js ***! - \********************************************************************************/ -/*! exports provided: BaseDropdown, DropdownMenu */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseDropdown", function() { return BaseDropdown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return DropdownMenu; }); -/* harmony import */ var _dropdown_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dropdown.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdown.css"); -/* harmony import */ var _touch_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../touch.js */ "./node_modules/monaco-editor/esm/vs/base/browser/touch.js"); -/* harmony import */ var _common_actions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../keyboardEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -class BaseDropdown extends _common_actions_js__WEBPACK_IMPORTED_MODULE_2__["ActionRunner"] { - constructor(container, options) { - super(); - this._onDidChangeVisibility = new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"](); - this.onDidChangeVisibility = this._onDidChangeVisibility.event; - this._element = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["append"])(container, Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])('.monaco-dropdown')); - this._label = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["append"])(this._element, Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])('.dropdown-label')); - let labelRenderer = options.labelRenderer; - if (!labelRenderer) { - labelRenderer = (container) => { - container.textContent = options.label || ''; - return null; - }; - } - for (const event of [_dom_js__WEBPACK_IMPORTED_MODULE_3__["EventType"].CLICK, _dom_js__WEBPACK_IMPORTED_MODULE_3__["EventType"].MOUSE_DOWN, _touch_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].Tap]) { - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addDisposableListener"])(this.element, event, e => _dom_js__WEBPACK_IMPORTED_MODULE_3__["EventHelper"].stop(e, true))); // prevent default click behaviour to trigger - } - for (const event of [_dom_js__WEBPACK_IMPORTED_MODULE_3__["EventType"].MOUSE_DOWN, _touch_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].Tap]) { - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addDisposableListener"])(this._label, event, e => { - if (e instanceof MouseEvent && e.detail > 1) { - return; // prevent multiple clicks to open multiple context menus (https://github.com/Microsoft/vscode/issues/41363) - } - if (this.visible) { - this.hide(); - } - else { - this.show(); - } - })); - } - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addDisposableListener"])(this._label, _dom_js__WEBPACK_IMPORTED_MODULE_3__["EventType"].KEY_UP, e => { - const event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_4__["StandardKeyboardEvent"](e); - if (event.equals(3 /* Enter */) || event.equals(10 /* Space */)) { - _dom_js__WEBPACK_IMPORTED_MODULE_3__["EventHelper"].stop(e, true); // https://github.com/Microsoft/vscode/issues/57997 - if (this.visible) { - this.hide(); - } - else { - this.show(); - } - } - })); - const cleanupFn = labelRenderer(this._label); - if (cleanupFn) { - this._register(cleanupFn); - } - this._register(_touch_js__WEBPACK_IMPORTED_MODULE_1__["Gesture"].addTarget(this._label)); - } - get element() { - return this._element; - } - show() { - if (!this.visible) { - this.visible = true; - this._onDidChangeVisibility.fire(true); - } - } - hide() { - if (this.visible) { - this.visible = false; - this._onDidChangeVisibility.fire(false); - } - } - dispose() { - super.dispose(); - this.hide(); - if (this.boxContainer) { - this.boxContainer.remove(); - this.boxContainer = undefined; - } - if (this.contents) { - this.contents.remove(); - this.contents = undefined; - } - if (this._label) { - this._label.remove(); - this._label = undefined; - } - } -} -class DropdownMenu extends BaseDropdown { - constructor(container, options) { - super(container, options); - this._actions = []; - this._contextMenuProvider = options.contextMenuProvider; - this.actions = options.actions || []; - this.actionProvider = options.actionProvider; - this.menuClassName = options.menuClassName || ''; - this.menuAsChild = !!options.menuAsChild; - } - set menuOptions(options) { - this._menuOptions = options; - } - get menuOptions() { - return this._menuOptions; - } - get actions() { - if (this.actionProvider) { - return this.actionProvider.getActions(); - } - return this._actions; - } - set actions(actions) { - this._actions = actions; - } - show() { - super.show(); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addClass"])(this.element, 'active'); - this._contextMenuProvider.showContextMenu({ - getAnchor: () => this.element, - getActions: () => this.actions, - getActionsContext: () => this.menuOptions ? this.menuOptions.context : null, - getActionViewItem: action => this.menuOptions && this.menuOptions.actionViewItemProvider ? this.menuOptions.actionViewItemProvider(action) : undefined, - getKeyBinding: action => this.menuOptions && this.menuOptions.getKeyBinding ? this.menuOptions.getKeyBinding(action) : undefined, - getMenuClassName: () => this.menuClassName, - onHide: () => this.onHide(), - actionRunner: this.menuOptions ? this.menuOptions.actionRunner : undefined, - anchorAlignment: this.menuOptions ? this.menuOptions.anchorAlignment : 0 /* LEFT */, - domForShadowRoot: this.menuAsChild ? this.element : undefined - }); - } - hide() { - super.hide(); - } - onHide() { - this.hide(); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["removeClass"])(this.element, 'active'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js ***! - \**********************************************************************************************/ -/*! exports provided: DropdownMenuActionViewItem */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownMenuActionViewItem", function() { return DropdownMenuActionViewItem; }); -/* harmony import */ var _dropdown_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dropdown.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdown.css"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _actionbar_actionViewItems_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../actionbar/actionViewItems.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js"); -/* harmony import */ var _dropdown_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dropdown.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdown.js"); -/* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -class DropdownMenuActionViewItem extends _actionbar_actionViewItems_js__WEBPACK_IMPORTED_MODULE_3__["BaseActionViewItem"] { - constructor(action, menuActionsOrProvider, contextMenuProvider, options = {}) { - super(null, action, options); - this.options = options; - this._onDidChangeVisibility = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"]()); - this.menuActionsOrProvider = menuActionsOrProvider; - this.contextMenuProvider = contextMenuProvider; - if (this.options.actionRunner) { - this.actionRunner = this.options.actionRunner; - } - } - render(container) { - const labelRenderer = (el) => { - this.element = Object(_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"])(el, Object(_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('a.action-label')); - const classNames = this.options.classNames ? Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_5__["asArray"])(this.options.classNames) : []; - // todo@aeschli: remove codicon, should come through `this.options.classNames` - if (!classNames.find(c => c === 'icon')) { - classNames.push('codicon'); - } - Object(_dom_js__WEBPACK_IMPORTED_MODULE_1__["addClasses"])(this.element, ...classNames); - this.element.tabIndex = 0; - this.element.setAttribute('role', 'button'); - this.element.setAttribute('aria-haspopup', 'true'); - this.element.setAttribute('aria-expanded', 'false'); - this.element.title = this._action.label || ''; - return null; - }; - const options = { - contextMenuProvider: this.contextMenuProvider, - labelRenderer: labelRenderer, - menuAsChild: this.options.menuAsChild - }; - // Render the DropdownMenu around a simple action to toggle it - if (Array.isArray(this.menuActionsOrProvider)) { - options.actions = this.menuActionsOrProvider; - } - else { - options.actionProvider = this.menuActionsOrProvider; - } - this.dropdownMenu = this._register(new _dropdown_js__WEBPACK_IMPORTED_MODULE_4__["DropdownMenu"](container, options)); - this._register(this.dropdownMenu.onDidChangeVisibility(visible => { - var _a; - (_a = this.element) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', `${visible}`); - this._onDidChangeVisibility.fire(visible); - })); - this.dropdownMenu.menuOptions = { - actionViewItemProvider: this.options.actionViewItemProvider, - actionRunner: this.actionRunner, - getKeyBinding: this.options.keybindingProvider, - context: this._context - }; - if (this.options.anchorAlignmentProvider) { - const that = this; - this.dropdownMenu.menuOptions = Object.assign(Object.assign({}, this.dropdownMenu.menuOptions), { get anchorAlignment() { - return that.options.anchorAlignmentProvider(); - } }); - } - } - setActionContext(newContext) { - super.setActionContext(newContext); - if (this.dropdownMenu) { - if (this.dropdownMenu.menuOptions) { - this.dropdownMenu.menuOptions.context = newContext; - } - else { - this.dropdownMenu.menuOptions = { context: newContext }; - } - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInput.css": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInput.css ***! - \***********************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_findInput_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./findInput.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInput.css"); -/* harmony import */ var _css_loader_dist_cjs_js_findInput_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_findInput_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_findInput_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_findInput_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInput.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInput.js ***! - \**********************************************************************************/ -/*! exports provided: FindInput */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindInput", function() { return FindInput; }); -/* harmony import */ var _findInput_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./findInput.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInput.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _inputbox_inputBox_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../inputbox/inputBox.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.js"); -/* harmony import */ var _widget_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../widget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _findInputCheckboxes_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./findInputCheckboxes.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInputCheckboxes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -const NLS_DEFAULT_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('defaultLabel', "input"); -class FindInput extends _widget_js__WEBPACK_IMPORTED_MODULE_4__["Widget"] { - constructor(parent, contextViewProvider, _showOptionButtons, options) { - super(); - this._showOptionButtons = _showOptionButtons; - this.fixFocusOnOptionClickEnabled = true; - this._onDidOptionChange = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this.onDidOptionChange = this._onDidOptionChange.event; - this._onKeyDown = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this.onKeyDown = this._onKeyDown.event; - this._onMouseDown = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this.onMouseDown = this._onMouseDown.event; - this._onInput = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this._onKeyUp = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this._onCaseSensitiveKeyDown = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this.onCaseSensitiveKeyDown = this._onCaseSensitiveKeyDown.event; - this._onRegexKeyDown = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this.onRegexKeyDown = this._onRegexKeyDown.event; - this._lastHighlightFindOptions = 0; - this.contextViewProvider = contextViewProvider; - this.placeholder = options.placeholder || ''; - this.validation = options.validation; - this.label = options.label || NLS_DEFAULT_LABEL; - this.inputActiveOptionBorder = options.inputActiveOptionBorder; - this.inputActiveOptionForeground = options.inputActiveOptionForeground; - this.inputActiveOptionBackground = options.inputActiveOptionBackground; - this.inputBackground = options.inputBackground; - this.inputForeground = options.inputForeground; - this.inputBorder = options.inputBorder; - this.inputValidationInfoBorder = options.inputValidationInfoBorder; - this.inputValidationInfoBackground = options.inputValidationInfoBackground; - this.inputValidationInfoForeground = options.inputValidationInfoForeground; - this.inputValidationWarningBorder = options.inputValidationWarningBorder; - this.inputValidationWarningBackground = options.inputValidationWarningBackground; - this.inputValidationWarningForeground = options.inputValidationWarningForeground; - this.inputValidationErrorBorder = options.inputValidationErrorBorder; - this.inputValidationErrorBackground = options.inputValidationErrorBackground; - this.inputValidationErrorForeground = options.inputValidationErrorForeground; - const appendCaseSensitiveLabel = options.appendCaseSensitiveLabel || ''; - const appendWholeWordsLabel = options.appendWholeWordsLabel || ''; - const appendRegexLabel = options.appendRegexLabel || ''; - const history = options.history || []; - const flexibleHeight = !!options.flexibleHeight; - const flexibleWidth = !!options.flexibleWidth; - const flexibleMaxHeight = options.flexibleMaxHeight; - this.domNode = document.createElement('div'); - _dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](this.domNode, 'monaco-findInput'); - this.inputBox = this._register(new _inputbox_inputBox_js__WEBPACK_IMPORTED_MODULE_3__["HistoryInputBox"](this.domNode, this.contextViewProvider, { - placeholder: this.placeholder || '', - ariaLabel: this.label || '', - validationOptions: { - validation: this.validation - }, - inputBackground: this.inputBackground, - inputForeground: this.inputForeground, - inputBorder: this.inputBorder, - inputValidationInfoBackground: this.inputValidationInfoBackground, - inputValidationInfoForeground: this.inputValidationInfoForeground, - inputValidationInfoBorder: this.inputValidationInfoBorder, - inputValidationWarningBackground: this.inputValidationWarningBackground, - inputValidationWarningForeground: this.inputValidationWarningForeground, - inputValidationWarningBorder: this.inputValidationWarningBorder, - inputValidationErrorBackground: this.inputValidationErrorBackground, - inputValidationErrorForeground: this.inputValidationErrorForeground, - inputValidationErrorBorder: this.inputValidationErrorBorder, - history, - flexibleHeight, - flexibleWidth, - flexibleMaxHeight - })); - this.regex = this._register(new _findInputCheckboxes_js__WEBPACK_IMPORTED_MODULE_6__["RegexCheckbox"]({ - appendTitle: appendRegexLabel, - isChecked: false, - inputActiveOptionBorder: this.inputActiveOptionBorder, - inputActiveOptionForeground: this.inputActiveOptionForeground, - inputActiveOptionBackground: this.inputActiveOptionBackground - })); - this._register(this.regex.onChange(viaKeyboard => { - this._onDidOptionChange.fire(viaKeyboard); - if (!viaKeyboard && this.fixFocusOnOptionClickEnabled) { - this.inputBox.focus(); - } - this.validate(); - })); - this._register(this.regex.onKeyDown(e => { - this._onRegexKeyDown.fire(e); - })); - this.wholeWords = this._register(new _findInputCheckboxes_js__WEBPACK_IMPORTED_MODULE_6__["WholeWordsCheckbox"]({ - appendTitle: appendWholeWordsLabel, - isChecked: false, - inputActiveOptionBorder: this.inputActiveOptionBorder, - inputActiveOptionForeground: this.inputActiveOptionForeground, - inputActiveOptionBackground: this.inputActiveOptionBackground - })); - this._register(this.wholeWords.onChange(viaKeyboard => { - this._onDidOptionChange.fire(viaKeyboard); - if (!viaKeyboard && this.fixFocusOnOptionClickEnabled) { - this.inputBox.focus(); - } - this.validate(); - })); - this.caseSensitive = this._register(new _findInputCheckboxes_js__WEBPACK_IMPORTED_MODULE_6__["CaseSensitiveCheckbox"]({ - appendTitle: appendCaseSensitiveLabel, - isChecked: false, - inputActiveOptionBorder: this.inputActiveOptionBorder, - inputActiveOptionForeground: this.inputActiveOptionForeground, - inputActiveOptionBackground: this.inputActiveOptionBackground - })); - this._register(this.caseSensitive.onChange(viaKeyboard => { - this._onDidOptionChange.fire(viaKeyboard); - if (!viaKeyboard && this.fixFocusOnOptionClickEnabled) { - this.inputBox.focus(); - } - this.validate(); - })); - this._register(this.caseSensitive.onKeyDown(e => { - this._onCaseSensitiveKeyDown.fire(e); - })); - if (this._showOptionButtons) { - this.inputBox.paddingRight = this.caseSensitive.width() + this.wholeWords.width() + this.regex.width(); - } - // Arrow-Key support to navigate between options - let indexes = [this.caseSensitive.domNode, this.wholeWords.domNode, this.regex.domNode]; - this.onkeydown(this.domNode, (event) => { - if (event.equals(15 /* LeftArrow */) || event.equals(17 /* RightArrow */) || event.equals(9 /* Escape */)) { - let index = indexes.indexOf(document.activeElement); - if (index >= 0) { - let newIndex = -1; - if (event.equals(17 /* RightArrow */)) { - newIndex = (index + 1) % indexes.length; - } - else if (event.equals(15 /* LeftArrow */)) { - if (index === 0) { - newIndex = indexes.length - 1; - } - else { - newIndex = index - 1; - } - } - if (event.equals(9 /* Escape */)) { - indexes[index].blur(); - } - else if (newIndex >= 0) { - indexes[newIndex].focus(); - } - _dom_js__WEBPACK_IMPORTED_MODULE_2__["EventHelper"].stop(event, true); - } - } - }); - let controls = document.createElement('div'); - controls.className = 'controls'; - controls.style.display = this._showOptionButtons ? 'block' : 'none'; - controls.appendChild(this.caseSensitive.domNode); - controls.appendChild(this.wholeWords.domNode); - controls.appendChild(this.regex.domNode); - this.domNode.appendChild(controls); - if (parent) { - parent.appendChild(this.domNode); - } - this.onkeydown(this.inputBox.inputElement, (e) => this._onKeyDown.fire(e)); - this.onkeyup(this.inputBox.inputElement, (e) => this._onKeyUp.fire(e)); - this.oninput(this.inputBox.inputElement, (e) => this._onInput.fire()); - this.onmousedown(this.inputBox.inputElement, (e) => this._onMouseDown.fire(e)); - } - enable() { - _dom_js__WEBPACK_IMPORTED_MODULE_2__["removeClass"](this.domNode, 'disabled'); - this.inputBox.enable(); - this.regex.enable(); - this.wholeWords.enable(); - this.caseSensitive.enable(); - } - disable() { - _dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](this.domNode, 'disabled'); - this.inputBox.disable(); - this.regex.disable(); - this.wholeWords.disable(); - this.caseSensitive.disable(); - } - setFocusInputOnOptionClick(value) { - this.fixFocusOnOptionClickEnabled = value; - } - setEnabled(enabled) { - if (enabled) { - this.enable(); - } - else { - this.disable(); - } - } - getValue() { - return this.inputBox.value; - } - setValue(value) { - if (this.inputBox.value !== value) { - this.inputBox.value = value; - } - } - style(styles) { - this.inputActiveOptionBorder = styles.inputActiveOptionBorder; - this.inputActiveOptionForeground = styles.inputActiveOptionForeground; - this.inputActiveOptionBackground = styles.inputActiveOptionBackground; - this.inputBackground = styles.inputBackground; - this.inputForeground = styles.inputForeground; - this.inputBorder = styles.inputBorder; - this.inputValidationInfoBackground = styles.inputValidationInfoBackground; - this.inputValidationInfoForeground = styles.inputValidationInfoForeground; - this.inputValidationInfoBorder = styles.inputValidationInfoBorder; - this.inputValidationWarningBackground = styles.inputValidationWarningBackground; - this.inputValidationWarningForeground = styles.inputValidationWarningForeground; - this.inputValidationWarningBorder = styles.inputValidationWarningBorder; - this.inputValidationErrorBackground = styles.inputValidationErrorBackground; - this.inputValidationErrorForeground = styles.inputValidationErrorForeground; - this.inputValidationErrorBorder = styles.inputValidationErrorBorder; - this.applyStyles(); - } - applyStyles() { - if (this.domNode) { - const checkBoxStyles = { - inputActiveOptionBorder: this.inputActiveOptionBorder, - inputActiveOptionForeground: this.inputActiveOptionForeground, - inputActiveOptionBackground: this.inputActiveOptionBackground, - }; - this.regex.style(checkBoxStyles); - this.wholeWords.style(checkBoxStyles); - this.caseSensitive.style(checkBoxStyles); - const inputBoxStyles = { - inputBackground: this.inputBackground, - inputForeground: this.inputForeground, - inputBorder: this.inputBorder, - inputValidationInfoBackground: this.inputValidationInfoBackground, - inputValidationInfoForeground: this.inputValidationInfoForeground, - inputValidationInfoBorder: this.inputValidationInfoBorder, - inputValidationWarningBackground: this.inputValidationWarningBackground, - inputValidationWarningForeground: this.inputValidationWarningForeground, - inputValidationWarningBorder: this.inputValidationWarningBorder, - inputValidationErrorBackground: this.inputValidationErrorBackground, - inputValidationErrorForeground: this.inputValidationErrorForeground, - inputValidationErrorBorder: this.inputValidationErrorBorder - }; - this.inputBox.style(inputBoxStyles); - } - } - select() { - this.inputBox.select(); - } - focus() { - this.inputBox.focus(); - } - getCaseSensitive() { - return this.caseSensitive.checked; - } - setCaseSensitive(value) { - this.caseSensitive.checked = value; - } - getWholeWords() { - return this.wholeWords.checked; - } - setWholeWords(value) { - this.wholeWords.checked = value; - } - getRegex() { - return this.regex.checked; - } - setRegex(value) { - this.regex.checked = value; - this.validate(); - } - focusOnCaseSensitive() { - this.caseSensitive.focus(); - } - highlightFindOptions() { - _dom_js__WEBPACK_IMPORTED_MODULE_2__["removeClass"](this.domNode, 'highlight-' + (this._lastHighlightFindOptions)); - this._lastHighlightFindOptions = 1 - this._lastHighlightFindOptions; - _dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](this.domNode, 'highlight-' + (this._lastHighlightFindOptions)); - } - validate() { - this.inputBox.validate(); - } - clearMessage() { - this.inputBox.hideMessage(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInputCheckboxes.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInputCheckboxes.js ***! - \********************************************************************************************/ -/*! exports provided: CaseSensitiveCheckbox, WholeWordsCheckbox, RegexCheckbox */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CaseSensitiveCheckbox", function() { return CaseSensitiveCheckbox; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WholeWordsCheckbox", function() { return WholeWordsCheckbox; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RegexCheckbox", function() { return RegexCheckbox; }); -/* harmony import */ var _checkbox_checkbox_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../checkbox/checkbox.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/checkbox/checkbox.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _common_codicons_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -const NLS_CASE_SENSITIVE_CHECKBOX_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('caseDescription', "Match Case"); -const NLS_WHOLE_WORD_CHECKBOX_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('wordsDescription', "Match Whole Word"); -const NLS_REGEX_CHECKBOX_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('regexDescription', "Use Regular Expression"); -class CaseSensitiveCheckbox extends _checkbox_checkbox_js__WEBPACK_IMPORTED_MODULE_0__["Checkbox"] { - constructor(opts) { - super({ - icon: _common_codicons_js__WEBPACK_IMPORTED_MODULE_2__["Codicon"].caseSensitive, - title: NLS_CASE_SENSITIVE_CHECKBOX_LABEL + opts.appendTitle, - isChecked: opts.isChecked, - inputActiveOptionBorder: opts.inputActiveOptionBorder, - inputActiveOptionForeground: opts.inputActiveOptionForeground, - inputActiveOptionBackground: opts.inputActiveOptionBackground - }); - } -} -class WholeWordsCheckbox extends _checkbox_checkbox_js__WEBPACK_IMPORTED_MODULE_0__["Checkbox"] { - constructor(opts) { - super({ - icon: _common_codicons_js__WEBPACK_IMPORTED_MODULE_2__["Codicon"].wholeWord, - title: NLS_WHOLE_WORD_CHECKBOX_LABEL + opts.appendTitle, - isChecked: opts.isChecked, - inputActiveOptionBorder: opts.inputActiveOptionBorder, - inputActiveOptionForeground: opts.inputActiveOptionForeground, - inputActiveOptionBackground: opts.inputActiveOptionBackground - }); - } -} -class RegexCheckbox extends _checkbox_checkbox_js__WEBPACK_IMPORTED_MODULE_0__["Checkbox"] { - constructor(opts) { - super({ - icon: _common_codicons_js__WEBPACK_IMPORTED_MODULE_2__["Codicon"].regex, - title: NLS_REGEX_CHECKBOX_LABEL + opts.appendTitle, - isChecked: opts.isChecked, - inputActiveOptionBorder: opts.inputActiveOptionBorder, - inputActiveOptionForeground: opts.inputActiveOptionForeground, - inputActiveOptionBackground: opts.inputActiveOptionBackground - }); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/replaceInput.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/replaceInput.js ***! - \*************************************************************************************/ -/*! exports provided: PreserveCaseCheckbox, ReplaceInput */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreserveCaseCheckbox", function() { return PreserveCaseCheckbox; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaceInput", function() { return ReplaceInput; }); -/* harmony import */ var _findInput_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./findInput.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInput.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _inputbox_inputBox_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../inputbox/inputBox.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.js"); -/* harmony import */ var _widget_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../widget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _checkbox_checkbox_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../checkbox/checkbox.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/checkbox/checkbox.js"); -/* harmony import */ var _common_codicons_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - -const NLS_DEFAULT_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('defaultLabel', "input"); -const NLS_PRESERVE_CASE_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.preserveCaseCheckbox', "Preserve Case"); -class PreserveCaseCheckbox extends _checkbox_checkbox_js__WEBPACK_IMPORTED_MODULE_6__["Checkbox"] { - constructor(opts) { - super({ - // TODO: does this need its own icon? - icon: _common_codicons_js__WEBPACK_IMPORTED_MODULE_7__["Codicon"].preserveCase, - title: NLS_PRESERVE_CASE_LABEL + opts.appendTitle, - isChecked: opts.isChecked, - inputActiveOptionBorder: opts.inputActiveOptionBorder, - inputActiveOptionForeground: opts.inputActiveOptionForeground, - inputActiveOptionBackground: opts.inputActiveOptionBackground - }); - } -} -class ReplaceInput extends _widget_js__WEBPACK_IMPORTED_MODULE_4__["Widget"] { - constructor(parent, contextViewProvider, _showOptionButtons, options) { - super(); - this._showOptionButtons = _showOptionButtons; - this.fixFocusOnOptionClickEnabled = true; - this.cachedOptionsWidth = 0; - this._onDidOptionChange = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this.onDidOptionChange = this._onDidOptionChange.event; - this._onKeyDown = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this.onKeyDown = this._onKeyDown.event; - this._onMouseDown = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this._onInput = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this._onKeyUp = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this._onPreserveCaseKeyDown = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"]()); - this.onPreserveCaseKeyDown = this._onPreserveCaseKeyDown.event; - this.contextViewProvider = contextViewProvider; - this.placeholder = options.placeholder || ''; - this.validation = options.validation; - this.label = options.label || NLS_DEFAULT_LABEL; - this.inputActiveOptionBorder = options.inputActiveOptionBorder; - this.inputActiveOptionForeground = options.inputActiveOptionForeground; - this.inputActiveOptionBackground = options.inputActiveOptionBackground; - this.inputBackground = options.inputBackground; - this.inputForeground = options.inputForeground; - this.inputBorder = options.inputBorder; - this.inputValidationInfoBorder = options.inputValidationInfoBorder; - this.inputValidationInfoBackground = options.inputValidationInfoBackground; - this.inputValidationInfoForeground = options.inputValidationInfoForeground; - this.inputValidationWarningBorder = options.inputValidationWarningBorder; - this.inputValidationWarningBackground = options.inputValidationWarningBackground; - this.inputValidationWarningForeground = options.inputValidationWarningForeground; - this.inputValidationErrorBorder = options.inputValidationErrorBorder; - this.inputValidationErrorBackground = options.inputValidationErrorBackground; - this.inputValidationErrorForeground = options.inputValidationErrorForeground; - const history = options.history || []; - const flexibleHeight = !!options.flexibleHeight; - const flexibleWidth = !!options.flexibleWidth; - const flexibleMaxHeight = options.flexibleMaxHeight; - this.domNode = document.createElement('div'); - _dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](this.domNode, 'monaco-findInput'); - this.inputBox = this._register(new _inputbox_inputBox_js__WEBPACK_IMPORTED_MODULE_3__["HistoryInputBox"](this.domNode, this.contextViewProvider, { - ariaLabel: this.label || '', - placeholder: this.placeholder || '', - validationOptions: { - validation: this.validation - }, - inputBackground: this.inputBackground, - inputForeground: this.inputForeground, - inputBorder: this.inputBorder, - inputValidationInfoBackground: this.inputValidationInfoBackground, - inputValidationInfoForeground: this.inputValidationInfoForeground, - inputValidationInfoBorder: this.inputValidationInfoBorder, - inputValidationWarningBackground: this.inputValidationWarningBackground, - inputValidationWarningForeground: this.inputValidationWarningForeground, - inputValidationWarningBorder: this.inputValidationWarningBorder, - inputValidationErrorBackground: this.inputValidationErrorBackground, - inputValidationErrorForeground: this.inputValidationErrorForeground, - inputValidationErrorBorder: this.inputValidationErrorBorder, - history, - flexibleHeight, - flexibleWidth, - flexibleMaxHeight - })); - this.preserveCase = this._register(new PreserveCaseCheckbox({ - appendTitle: '', - isChecked: false, - inputActiveOptionBorder: this.inputActiveOptionBorder, - inputActiveOptionForeground: this.inputActiveOptionForeground, - inputActiveOptionBackground: this.inputActiveOptionBackground, - })); - this._register(this.preserveCase.onChange(viaKeyboard => { - this._onDidOptionChange.fire(viaKeyboard); - if (!viaKeyboard && this.fixFocusOnOptionClickEnabled) { - this.inputBox.focus(); - } - this.validate(); - })); - this._register(this.preserveCase.onKeyDown(e => { - this._onPreserveCaseKeyDown.fire(e); - })); - if (this._showOptionButtons) { - this.cachedOptionsWidth = this.preserveCase.width(); - } - else { - this.cachedOptionsWidth = 0; - } - // Arrow-Key support to navigate between options - let indexes = [this.preserveCase.domNode]; - this.onkeydown(this.domNode, (event) => { - if (event.equals(15 /* LeftArrow */) || event.equals(17 /* RightArrow */) || event.equals(9 /* Escape */)) { - let index = indexes.indexOf(document.activeElement); - if (index >= 0) { - let newIndex = -1; - if (event.equals(17 /* RightArrow */)) { - newIndex = (index + 1) % indexes.length; - } - else if (event.equals(15 /* LeftArrow */)) { - if (index === 0) { - newIndex = indexes.length - 1; - } - else { - newIndex = index - 1; - } - } - if (event.equals(9 /* Escape */)) { - indexes[index].blur(); - } - else if (newIndex >= 0) { - indexes[newIndex].focus(); - } - _dom_js__WEBPACK_IMPORTED_MODULE_2__["EventHelper"].stop(event, true); - } - } - }); - let controls = document.createElement('div'); - controls.className = 'controls'; - controls.style.display = this._showOptionButtons ? 'block' : 'none'; - controls.appendChild(this.preserveCase.domNode); - this.domNode.appendChild(controls); - if (parent) { - parent.appendChild(this.domNode); - } - this.onkeydown(this.inputBox.inputElement, (e) => this._onKeyDown.fire(e)); - this.onkeyup(this.inputBox.inputElement, (e) => this._onKeyUp.fire(e)); - this.oninput(this.inputBox.inputElement, (e) => this._onInput.fire()); - this.onmousedown(this.inputBox.inputElement, (e) => this._onMouseDown.fire(e)); - } - enable() { - _dom_js__WEBPACK_IMPORTED_MODULE_2__["removeClass"](this.domNode, 'disabled'); - this.inputBox.enable(); - this.preserveCase.enable(); - } - disable() { - _dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](this.domNode, 'disabled'); - this.inputBox.disable(); - this.preserveCase.disable(); - } - setEnabled(enabled) { - if (enabled) { - this.enable(); - } - else { - this.disable(); - } - } - style(styles) { - this.inputActiveOptionBorder = styles.inputActiveOptionBorder; - this.inputActiveOptionForeground = styles.inputActiveOptionForeground; - this.inputActiveOptionBackground = styles.inputActiveOptionBackground; - this.inputBackground = styles.inputBackground; - this.inputForeground = styles.inputForeground; - this.inputBorder = styles.inputBorder; - this.inputValidationInfoBackground = styles.inputValidationInfoBackground; - this.inputValidationInfoForeground = styles.inputValidationInfoForeground; - this.inputValidationInfoBorder = styles.inputValidationInfoBorder; - this.inputValidationWarningBackground = styles.inputValidationWarningBackground; - this.inputValidationWarningForeground = styles.inputValidationWarningForeground; - this.inputValidationWarningBorder = styles.inputValidationWarningBorder; - this.inputValidationErrorBackground = styles.inputValidationErrorBackground; - this.inputValidationErrorForeground = styles.inputValidationErrorForeground; - this.inputValidationErrorBorder = styles.inputValidationErrorBorder; - this.applyStyles(); - } - applyStyles() { - if (this.domNode) { - const checkBoxStyles = { - inputActiveOptionBorder: this.inputActiveOptionBorder, - inputActiveOptionForeground: this.inputActiveOptionForeground, - inputActiveOptionBackground: this.inputActiveOptionBackground, - }; - this.preserveCase.style(checkBoxStyles); - const inputBoxStyles = { - inputBackground: this.inputBackground, - inputForeground: this.inputForeground, - inputBorder: this.inputBorder, - inputValidationInfoBackground: this.inputValidationInfoBackground, - inputValidationInfoForeground: this.inputValidationInfoForeground, - inputValidationInfoBorder: this.inputValidationInfoBorder, - inputValidationWarningBackground: this.inputValidationWarningBackground, - inputValidationWarningForeground: this.inputValidationWarningForeground, - inputValidationWarningBorder: this.inputValidationWarningBorder, - inputValidationErrorBackground: this.inputValidationErrorBackground, - inputValidationErrorForeground: this.inputValidationErrorForeground, - inputValidationErrorBorder: this.inputValidationErrorBorder - }; - this.inputBox.style(inputBoxStyles); - } - } - select() { - this.inputBox.select(); - } - focus() { - this.inputBox.focus(); - } - getPreserveCase() { - return this.preserveCase.checked; - } - setPreserveCase(value) { - this.preserveCase.checked = value; - } - focusOnPreserve() { - this.preserveCase.focus(); - } - validate() { - if (this.inputBox) { - this.inputBox.validate(); - } - } - set width(newWidth) { - this.inputBox.paddingRight = this.cachedOptionsWidth; - this.inputBox.width = newWidth; - this.domNode.style.width = newWidth + 'px'; - } - dispose() { - super.dispose(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/highlightedlabel/highlightedLabel.js": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/highlightedlabel/highlightedLabel.js ***! - \************************************************************************************************/ -/*! exports provided: HighlightedLabel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HighlightedLabel", function() { return HighlightedLabel; }); -/* harmony import */ var _common_objects_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _common_codicons_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/* harmony import */ var _common_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class HighlightedLabel { - constructor(container, supportCodicons) { - this.supportCodicons = supportCodicons; - this.text = ''; - this.title = ''; - this.highlights = []; - this.didEverRender = false; - this.domNode = document.createElement('span'); - this.domNode.className = 'monaco-highlighted-label'; - container.appendChild(this.domNode); - } - get element() { - return this.domNode; - } - set(text, highlights = [], title = '', escapeNewLines) { - if (!text) { - text = ''; - } - if (escapeNewLines) { - // adjusts highlights inplace - text = HighlightedLabel.escapeNewLines(text, highlights); - } - if (this.didEverRender && this.text === text && this.title === title && _common_objects_js__WEBPACK_IMPORTED_MODULE_0__["equals"](this.highlights, highlights)) { - return; - } - if (!Array.isArray(highlights)) { - highlights = []; - } - this.text = text; - this.title = title; - this.highlights = highlights; - this.render(); - } - render() { - let htmlContent = ''; - let pos = 0; - for (const highlight of this.highlights) { - if (highlight.end === highlight.start) { - continue; - } - if (pos < highlight.start) { - htmlContent += ''; - const substring = this.text.substring(pos, highlight.start); - htmlContent += this.supportCodicons ? Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__["renderCodicons"])(Object(_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["escape"])(substring)) : Object(_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["escape"])(substring); - htmlContent += ''; - pos = highlight.end; - } - if (highlight.extraClasses) { - htmlContent += ``; - } - else { - htmlContent += ``; - } - const substring = this.text.substring(highlight.start, highlight.end); - htmlContent += this.supportCodicons ? Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__["renderCodicons"])(Object(_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["escape"])(substring)) : Object(_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["escape"])(substring); - htmlContent += ''; - pos = highlight.end; - } - if (pos < this.text.length) { - htmlContent += ''; - const substring = this.text.substring(pos); - htmlContent += this.supportCodicons ? Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__["renderCodicons"])(Object(_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["escape"])(substring)) : Object(_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["escape"])(substring); - htmlContent += ''; - } - this.domNode.innerHTML = htmlContent; - if (this.title) { - this.domNode.title = this.title; - } - else { - this.domNode.removeAttribute('title'); - } - this.didEverRender = true; - } - static escapeNewLines(text, highlights) { - let total = 0; - let extra = 0; - return text.replace(/\r\n|\r|\n/g, (match, offset) => { - extra = match === '\r\n' ? -1 : 0; - offset += total; - for (const highlight of highlights) { - if (highlight.end <= offset) { - continue; - } - if (highlight.start >= offset) { - highlight.start += extra; - } - if (highlight.end >= offset) { - highlight.end += extra; - } - } - total += extra; - return '\u23CE'; - }); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/hover/hover.css": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/hover/hover.css ***! - \***************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_hover_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./hover.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/hover/hover.css"); -/* harmony import */ var _css_loader_dist_cjs_js_hover_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_hover_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_hover_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_hover_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/hover/hoverWidget.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/hover/hoverWidget.js ***! - \********************************************************************************/ -/*! exports provided: HoverWidget, renderHoverAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HoverWidget", function() { return HoverWidget; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderHoverAction", function() { return renderHoverAction; }); -/* harmony import */ var _hover_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hover.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/hover/hover.css"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../scrollbar/scrollableElement.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -const $ = _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]; -class HoverWidget extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor() { - super(); - this.containerDomNode = document.createElement('div'); - this.containerDomNode.className = 'monaco-hover'; - this.containerDomNode.tabIndex = 0; - this.containerDomNode.setAttribute('role', 'tooltip'); - this.contentsDomNode = document.createElement('div'); - this.contentsDomNode.className = 'monaco-hover-content'; - this._scrollbar = this._register(new _scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_3__["DomScrollableElement"](this.contentsDomNode, {})); - this.containerDomNode.appendChild(this._scrollbar.getDomNode()); - } - onContentsChanged() { - this._scrollbar.scanDomNode(); - } -} -function renderHoverAction(parent, actionOptions, keybindingLabel) { - const actionContainer = _dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](parent, $('div.action-container')); - const action = _dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](actionContainer, $('a.action')); - action.setAttribute('href', '#'); - action.setAttribute('role', 'button'); - if (actionOptions.iconClass) { - _dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](action, $(`span.icon.${actionOptions.iconClass}`)); - } - const label = _dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](action, $('span')); - label.textContent = keybindingLabel ? `${actionOptions.label} (${keybindingLabel})` : actionOptions.label; - return _dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](actionContainer, _dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].CLICK, e => { - e.stopPropagation(); - e.preventDefault(); - actionOptions.run(actionContainer); - }); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabel.js ***! - \**********************************************************************************/ -/*! exports provided: IconLabel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IconLabel", function() { return IconLabel; }); -/* harmony import */ var _iconlabel_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iconlabel.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconlabel.css"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _highlightedlabel_highlightedLabel_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../highlightedlabel/highlightedLabel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/highlightedlabel/highlightedLabel.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/range.js */ "./node_modules/monaco-editor/esm/vs/base/common/range.js"); -/* harmony import */ var _common_objects_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -class FastLabelNode { - constructor(_element) { - this._element = _element; - } - get element() { - return this._element; - } - set textContent(content) { - if (this.disposed || content === this._textContent) { - return; - } - this._textContent = content; - this._element.textContent = content; - } - set className(className) { - if (this.disposed || className === this._className) { - return; - } - this._className = className; - this._element.className = className; - } - set title(title) { - if (this.disposed || title === this._title) { - return; - } - this._title = title; - if (this._title) { - this._element.title = title; - } - else { - this._element.removeAttribute('title'); - } - } - set empty(empty) { - if (this.disposed || empty === this._empty) { - return; - } - this._empty = empty; - this._element.style.marginLeft = empty ? '0' : ''; - } - dispose() { - this.disposed = true; - } -} -class IconLabel extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(container, options) { - super(); - this.domNode = this._register(new FastLabelNode(_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](container, _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('.monaco-icon-label')))); - const labelContainer = _dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this.domNode.element, _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('.monaco-icon-label-container')); - const nameContainer = _dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](labelContainer, _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('span.monaco-icon-name-container')); - this.descriptionContainer = this._register(new FastLabelNode(_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](labelContainer, _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('span.monaco-icon-description-container')))); - if (options === null || options === void 0 ? void 0 : options.supportHighlights) { - this.nameNode = new LabelWithHighlights(nameContainer, !!options.supportCodicons); - } - else { - this.nameNode = new Label(nameContainer); - } - if (options === null || options === void 0 ? void 0 : options.supportDescriptionHighlights) { - this.descriptionNodeFactory = () => new _highlightedlabel_highlightedLabel_js__WEBPACK_IMPORTED_MODULE_2__["HighlightedLabel"](_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this.descriptionContainer.element, _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('span.label-description')), !!options.supportCodicons); - } - else { - this.descriptionNodeFactory = () => this._register(new FastLabelNode(_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this.descriptionContainer.element, _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('span.label-description')))); - } - } - setLabel(label, description, options) { - const classes = ['monaco-icon-label']; - if (options) { - if (options.extraClasses) { - classes.push(...options.extraClasses); - } - if (options.italic) { - classes.push('italic'); - } - if (options.strikethrough) { - classes.push('strikethrough'); - } - } - this.domNode.className = classes.join(' '); - this.domNode.title = (options === null || options === void 0 ? void 0 : options.title) || ''; - this.nameNode.setLabel(label, options); - if (description || this.descriptionNode) { - if (!this.descriptionNode) { - this.descriptionNode = this.descriptionNodeFactory(); // description node is created lazily on demand - } - if (this.descriptionNode instanceof _highlightedlabel_highlightedLabel_js__WEBPACK_IMPORTED_MODULE_2__["HighlightedLabel"]) { - this.descriptionNode.set(description || '', options ? options.descriptionMatches : undefined); - if (options === null || options === void 0 ? void 0 : options.descriptionTitle) { - this.descriptionNode.element.title = options.descriptionTitle; - } - else { - this.descriptionNode.element.removeAttribute('title'); - } - } - else { - this.descriptionNode.textContent = description || ''; - this.descriptionNode.title = (options === null || options === void 0 ? void 0 : options.descriptionTitle) || ''; - this.descriptionNode.empty = !description; - } - } - } -} -class Label { - constructor(container) { - this.container = container; - this.label = undefined; - this.singleLabel = undefined; - } - setLabel(label, options) { - if (this.label === label && Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_5__["equals"])(this.options, options)) { - return; - } - this.label = label; - this.options = options; - if (typeof label === 'string') { - if (!this.singleLabel) { - this.container.innerText = ''; - _dom_js__WEBPACK_IMPORTED_MODULE_1__["removeClass"](this.container, 'multiple'); - this.singleLabel = _dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this.container, _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('a.label-name', { id: options === null || options === void 0 ? void 0 : options.domId })); - } - this.singleLabel.textContent = label; - } - else { - this.container.innerText = ''; - _dom_js__WEBPACK_IMPORTED_MODULE_1__["addClass"](this.container, 'multiple'); - this.singleLabel = undefined; - for (let i = 0; i < label.length; i++) { - const l = label[i]; - const id = (options === null || options === void 0 ? void 0 : options.domId) && `${options === null || options === void 0 ? void 0 : options.domId}_${i}`; - _dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this.container, _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l)); - if (i < label.length - 1) { - _dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this.container, _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('span.label-separator', undefined, (options === null || options === void 0 ? void 0 : options.separator) || '/')); - } - } - } - } -} -function splitMatches(labels, separator, matches) { - if (!matches) { - return undefined; - } - let labelStart = 0; - return labels.map(label => { - const labelRange = { start: labelStart, end: labelStart + label.length }; - const result = matches - .map(match => _common_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].intersect(labelRange, match)) - .filter(range => !_common_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].isEmpty(range)) - .map(({ start, end }) => ({ start: start - labelStart, end: end - labelStart })); - labelStart = labelRange.end + separator.length; - return result; - }); -} -class LabelWithHighlights { - constructor(container, supportCodicons) { - this.container = container; - this.supportCodicons = supportCodicons; - this.label = undefined; - this.singleLabel = undefined; - } - setLabel(label, options) { - if (this.label === label && Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_5__["equals"])(this.options, options)) { - return; - } - this.label = label; - this.options = options; - if (typeof label === 'string') { - if (!this.singleLabel) { - this.container.innerText = ''; - _dom_js__WEBPACK_IMPORTED_MODULE_1__["removeClass"](this.container, 'multiple'); - this.singleLabel = new _highlightedlabel_highlightedLabel_js__WEBPACK_IMPORTED_MODULE_2__["HighlightedLabel"](_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this.container, _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('a.label-name', { id: options === null || options === void 0 ? void 0 : options.domId })), this.supportCodicons); - } - this.singleLabel.set(label, options === null || options === void 0 ? void 0 : options.matches, options === null || options === void 0 ? void 0 : options.title, options === null || options === void 0 ? void 0 : options.labelEscapeNewLines); - } - else { - this.container.innerText = ''; - _dom_js__WEBPACK_IMPORTED_MODULE_1__["addClass"](this.container, 'multiple'); - this.singleLabel = undefined; - const separator = (options === null || options === void 0 ? void 0 : options.separator) || '/'; - const matches = splitMatches(label, separator, options === null || options === void 0 ? void 0 : options.matches); - for (let i = 0; i < label.length; i++) { - const l = label[i]; - const m = matches ? matches[i] : undefined; - const id = (options === null || options === void 0 ? void 0 : options.domId) && `${options === null || options === void 0 ? void 0 : options.domId}_${i}`; - const name = _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }); - const highlightedLabel = new _highlightedlabel_highlightedLabel_js__WEBPACK_IMPORTED_MODULE_2__["HighlightedLabel"](_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this.container, name), this.supportCodicons); - highlightedLabel.set(l, m, options === null || options === void 0 ? void 0 : options.title, options === null || options === void 0 ? void 0 : options.labelEscapeNewLines); - if (i < label.length - 1) { - _dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](name, _dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('span.label-separator', undefined, separator)); - } - } - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconlabel.css": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconlabel.css ***! - \***********************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_iconlabel_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./iconlabel.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconlabel.css"); -/* harmony import */ var _css_loader_dist_cjs_js_iconlabel_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_iconlabel_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_iconlabel_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_iconlabel_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.css": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.css ***! - \*********************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_inputBox_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./inputBox.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.css"); -/* harmony import */ var _css_loader_dist_cjs_js_inputBox_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_inputBox_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_inputBox_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_inputBox_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.js ***! - \********************************************************************************/ -/*! exports provided: InputBox, HistoryInputBox */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputBox", function() { return InputBox; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HistoryInputBox", function() { return HistoryInputBox; }); -/* harmony import */ var _inputBox_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./inputBox.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _formattedTextRenderer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../formattedTextRenderer.js */ "./node_modules/monaco-editor/esm/vs/base/browser/formattedTextRenderer.js"); -/* harmony import */ var _aria_aria_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/* harmony import */ var _actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../actionbar/actionbar.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _widget_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../widget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"); -/* harmony import */ var _common_color_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _common_objects_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _common_history_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../common/history.js */ "./node_modules/monaco-editor/esm/vs/base/common/history.js"); -/* harmony import */ var _scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../scrollbar/scrollableElement.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js"); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../event.js */ "./node_modules/monaco-editor/esm/vs/base/browser/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - -const $ = _dom_js__WEBPACK_IMPORTED_MODULE_2__["$"]; -const defaultOpts = { - inputBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_8__["Color"].fromHex('#3C3C3C'), - inputForeground: _common_color_js__WEBPACK_IMPORTED_MODULE_8__["Color"].fromHex('#CCCCCC'), - inputValidationInfoBorder: _common_color_js__WEBPACK_IMPORTED_MODULE_8__["Color"].fromHex('#55AAFF'), - inputValidationInfoBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_8__["Color"].fromHex('#063B49'), - inputValidationWarningBorder: _common_color_js__WEBPACK_IMPORTED_MODULE_8__["Color"].fromHex('#B89500'), - inputValidationWarningBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_8__["Color"].fromHex('#352A05'), - inputValidationErrorBorder: _common_color_js__WEBPACK_IMPORTED_MODULE_8__["Color"].fromHex('#BE1100'), - inputValidationErrorBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_8__["Color"].fromHex('#5A1D1D') -}; -class InputBox extends _widget_js__WEBPACK_IMPORTED_MODULE_7__["Widget"] { - constructor(container, contextViewProvider, options) { - super(); - this.state = 'idle'; - this.maxHeight = Number.POSITIVE_INFINITY; - this._onDidChange = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidChange = this._onDidChange.event; - this._onDidHeightChange = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidHeightChange = this._onDidHeightChange.event; - this.contextViewProvider = contextViewProvider; - this.options = options || Object.create(null); - Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_9__["mixin"])(this.options, defaultOpts, false); - this.message = null; - this.placeholder = this.options.placeholder || ''; - this.ariaLabel = this.options.ariaLabel || ''; - this.inputBackground = this.options.inputBackground; - this.inputForeground = this.options.inputForeground; - this.inputBorder = this.options.inputBorder; - this.inputValidationInfoBorder = this.options.inputValidationInfoBorder; - this.inputValidationInfoBackground = this.options.inputValidationInfoBackground; - this.inputValidationInfoForeground = this.options.inputValidationInfoForeground; - this.inputValidationWarningBorder = this.options.inputValidationWarningBorder; - this.inputValidationWarningBackground = this.options.inputValidationWarningBackground; - this.inputValidationWarningForeground = this.options.inputValidationWarningForeground; - this.inputValidationErrorBorder = this.options.inputValidationErrorBorder; - this.inputValidationErrorBackground = this.options.inputValidationErrorBackground; - this.inputValidationErrorForeground = this.options.inputValidationErrorForeground; - if (this.options.validationOptions) { - this.validation = this.options.validationOptions.validation; - } - this.element = _dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](container, $('.monaco-inputbox.idle')); - let tagName = this.options.flexibleHeight ? 'textarea' : 'input'; - let wrapper = _dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](this.element, $('.wrapper')); - this.input = _dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](wrapper, $(tagName + '.input.empty')); - this.input.setAttribute('autocorrect', 'off'); - this.input.setAttribute('autocapitalize', 'off'); - this.input.setAttribute('spellcheck', 'false'); - this.onfocus(this.input, () => this.element.classList.add('synthetic-focus')); - this.onblur(this.input, () => this.element.classList.remove('synthetic-focus')); - if (this.options.flexibleHeight) { - this.maxHeight = typeof this.options.flexibleMaxHeight === 'number' ? this.options.flexibleMaxHeight : Number.POSITIVE_INFINITY; - this.mirror = _dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](wrapper, $('div.mirror')); - this.mirror.innerText = '\u00a0'; - this.scrollableElement = new _scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_11__["ScrollableElement"](this.element, { vertical: 1 /* Auto */ }); - if (this.options.flexibleWidth) { - this.input.setAttribute('wrap', 'off'); - this.mirror.style.whiteSpace = 'pre'; - this.mirror.style.wordWrap = 'initial'; - } - _dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](container, this.scrollableElement.getDomNode()); - this._register(this.scrollableElement); - // from ScrollableElement to DOM - this._register(this.scrollableElement.onScroll(e => this.input.scrollTop = e.scrollTop)); - const onSelectionChange = _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Event"].filter(Object(_event_js__WEBPACK_IMPORTED_MODULE_12__["domEvent"])(document, 'selectionchange'), () => { - const selection = document.getSelection(); - return (selection === null || selection === void 0 ? void 0 : selection.anchorNode) === wrapper; - }); - // from DOM to ScrollableElement - this._register(onSelectionChange(this.updateScrollDimensions, this)); - this._register(this.onDidHeightChange(this.updateScrollDimensions, this)); - } - else { - this.input.type = this.options.type || 'text'; - this.input.setAttribute('wrap', 'off'); - } - if (this.ariaLabel) { - this.input.setAttribute('aria-label', this.ariaLabel); - } - if (this.placeholder) { - this.setPlaceHolder(this.placeholder); - } - this.oninput(this.input, () => this.onValueChange()); - this.onblur(this.input, () => this.onBlur()); - this.onfocus(this.input, () => this.onFocus()); - this.ignoreGesture(this.input); - setTimeout(() => this.updateMirror(), 0); - // Support actions - if (this.options.actions) { - this.actionbar = this._register(new _actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_5__["ActionBar"](this.element)); - this.actionbar.push(this.options.actions, { icon: true, label: false }); - } - this.applyStyles(); - } - onBlur() { - this._hideMessage(); - } - onFocus() { - this._showMessage(); - } - setPlaceHolder(placeHolder) { - this.placeholder = placeHolder; - this.input.setAttribute('placeholder', placeHolder); - this.input.title = placeHolder; - } - setAriaLabel(label) { - this.ariaLabel = label; - if (label) { - this.input.setAttribute('aria-label', this.ariaLabel); - } - else { - this.input.removeAttribute('aria-label'); - } - } - getAriaLabel() { - return this.ariaLabel; - } - get inputElement() { - return this.input; - } - get value() { - return this.input.value; - } - set value(newValue) { - if (this.input.value !== newValue) { - this.input.value = newValue; - this.onValueChange(); - } - } - get height() { - return typeof this.cachedHeight === 'number' ? this.cachedHeight : _dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalHeight"](this.element); - } - focus() { - this.input.focus(); - } - blur() { - this.input.blur(); - } - hasFocus() { - return document.activeElement === this.input; - } - select(range = null) { - this.input.select(); - if (range) { - this.input.setSelectionRange(range.start, range.end); - } - } - isSelectionAtEnd() { - return this.input.selectionEnd === this.input.value.length && this.input.selectionStart === this.input.selectionEnd; - } - enable() { - this.input.removeAttribute('disabled'); - } - disable() { - this.blur(); - this.input.disabled = true; - this._hideMessage(); - } - get width() { - return _dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalWidth"](this.input); - } - set width(width) { - if (this.options.flexibleHeight && this.options.flexibleWidth) { - // textarea with horizontal scrolling - let horizontalPadding = 0; - if (this.mirror) { - const paddingLeft = parseFloat(this.mirror.style.paddingLeft || '') || 0; - const paddingRight = parseFloat(this.mirror.style.paddingRight || '') || 0; - horizontalPadding = paddingLeft + paddingRight; - } - this.input.style.width = (width - horizontalPadding) + 'px'; - } - else { - this.input.style.width = width + 'px'; - } - if (this.mirror) { - this.mirror.style.width = width + 'px'; - } - } - set paddingRight(paddingRight) { - if (this.options.flexibleHeight && this.options.flexibleWidth) { - this.input.style.width = `calc(100% - ${paddingRight}px)`; - } - else { - this.input.style.paddingRight = paddingRight + 'px'; - } - if (this.mirror) { - this.mirror.style.paddingRight = paddingRight + 'px'; - } - } - updateScrollDimensions() { - if (typeof this.cachedContentHeight !== 'number' || typeof this.cachedHeight !== 'number' || !this.scrollableElement) { - return; - } - const scrollHeight = this.cachedContentHeight; - const height = this.cachedHeight; - const scrollTop = this.input.scrollTop; - this.scrollableElement.setScrollDimensions({ scrollHeight, height }); - this.scrollableElement.setScrollPosition({ scrollTop }); - } - showMessage(message, force) { - this.message = message; - this.element.classList.remove('idle'); - this.element.classList.remove('info'); - this.element.classList.remove('warning'); - this.element.classList.remove('error'); - this.element.classList.add(this.classForType(message.type)); - const styles = this.stylesForType(this.message.type); - this.element.style.border = styles.border ? `1px solid ${styles.border}` : ''; - if (this.hasFocus() || force) { - this._showMessage(); - } - } - hideMessage() { - this.message = null; - this.element.classList.remove('info'); - this.element.classList.remove('warning'); - this.element.classList.remove('error'); - this.element.classList.add('idle'); - this._hideMessage(); - this.applyStyles(); - } - validate() { - let errorMsg = null; - if (this.validation) { - errorMsg = this.validation(this.value); - if (errorMsg) { - this.inputElement.setAttribute('aria-invalid', 'true'); - this.showMessage(errorMsg); - } - else if (this.inputElement.hasAttribute('aria-invalid')) { - this.inputElement.removeAttribute('aria-invalid'); - this.hideMessage(); - } - } - return !errorMsg; - } - stylesForType(type) { - switch (type) { - case 1 /* INFO */: return { border: this.inputValidationInfoBorder, background: this.inputValidationInfoBackground, foreground: this.inputValidationInfoForeground }; - case 2 /* WARNING */: return { border: this.inputValidationWarningBorder, background: this.inputValidationWarningBackground, foreground: this.inputValidationWarningForeground }; - default: return { border: this.inputValidationErrorBorder, background: this.inputValidationErrorBackground, foreground: this.inputValidationErrorForeground }; - } - } - classForType(type) { - switch (type) { - case 1 /* INFO */: return 'info'; - case 2 /* WARNING */: return 'warning'; - default: return 'error'; - } - } - _showMessage() { - if (!this.contextViewProvider || !this.message) { - return; - } - let div; - let layout = () => div.style.width = _dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalWidth"](this.element) + 'px'; - this.contextViewProvider.showContextView({ - getAnchor: () => this.element, - anchorAlignment: 1 /* RIGHT */, - render: (container) => { - if (!this.message) { - return null; - } - div = _dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](container, $('.monaco-inputbox-container')); - layout(); - const renderOptions = { - inline: true, - className: 'monaco-inputbox-message' - }; - const spanElement = (this.message.formatContent - ? Object(_formattedTextRenderer_js__WEBPACK_IMPORTED_MODULE_3__["renderFormattedText"])(this.message.content, renderOptions) - : Object(_formattedTextRenderer_js__WEBPACK_IMPORTED_MODULE_3__["renderText"])(this.message.content, renderOptions)); - spanElement.classList.add(this.classForType(this.message.type)); - const styles = this.stylesForType(this.message.type); - spanElement.style.backgroundColor = styles.background ? styles.background.toString() : ''; - spanElement.style.color = styles.foreground ? styles.foreground.toString() : ''; - spanElement.style.border = styles.border ? `1px solid ${styles.border}` : ''; - _dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](div, spanElement); - return null; - }, - onHide: () => { - this.state = 'closed'; - }, - layout: layout - }); - // ARIA Support - let alertText; - if (this.message.type === 3 /* ERROR */) { - alertText = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('alertErrorMessage', "Error: {0}", this.message.content); - } - else if (this.message.type === 2 /* WARNING */) { - alertText = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('alertWarningMessage', "Warning: {0}", this.message.content); - } - else { - alertText = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('alertInfoMessage', "Info: {0}", this.message.content); - } - _aria_aria_js__WEBPACK_IMPORTED_MODULE_4__["alert"](alertText); - this.state = 'open'; - } - _hideMessage() { - if (!this.contextViewProvider) { - return; - } - if (this.state === 'open') { - this.contextViewProvider.hideContextView(); - } - this.state = 'idle'; - } - onValueChange() { - this._onDidChange.fire(this.value); - this.validate(); - this.updateMirror(); - this.input.classList.toggle('empty', !this.value); - if (this.state === 'open' && this.contextViewProvider) { - this.contextViewProvider.layout(); - } - } - updateMirror() { - if (!this.mirror) { - return; - } - const value = this.value; - const lastCharCode = value.charCodeAt(value.length - 1); - const suffix = lastCharCode === 10 ? ' ' : ''; - const mirrorTextContent = value + suffix; - if (mirrorTextContent) { - this.mirror.textContent = value + suffix; - } - else { - this.mirror.innerText = '\u00a0'; - } - this.layout(); - } - style(styles) { - this.inputBackground = styles.inputBackground; - this.inputForeground = styles.inputForeground; - this.inputBorder = styles.inputBorder; - this.inputValidationInfoBackground = styles.inputValidationInfoBackground; - this.inputValidationInfoForeground = styles.inputValidationInfoForeground; - this.inputValidationInfoBorder = styles.inputValidationInfoBorder; - this.inputValidationWarningBackground = styles.inputValidationWarningBackground; - this.inputValidationWarningForeground = styles.inputValidationWarningForeground; - this.inputValidationWarningBorder = styles.inputValidationWarningBorder; - this.inputValidationErrorBackground = styles.inputValidationErrorBackground; - this.inputValidationErrorForeground = styles.inputValidationErrorForeground; - this.inputValidationErrorBorder = styles.inputValidationErrorBorder; - this.applyStyles(); - } - applyStyles() { - const background = this.inputBackground ? this.inputBackground.toString() : ''; - const foreground = this.inputForeground ? this.inputForeground.toString() : ''; - const border = this.inputBorder ? this.inputBorder.toString() : ''; - this.element.style.backgroundColor = background; - this.element.style.color = foreground; - this.input.style.backgroundColor = 'inherit'; - this.input.style.color = foreground; - this.element.style.borderWidth = border ? '1px' : ''; - this.element.style.borderStyle = border ? 'solid' : ''; - this.element.style.borderColor = border; - } - layout() { - if (!this.mirror) { - return; - } - const previousHeight = this.cachedContentHeight; - this.cachedContentHeight = _dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalHeight"](this.mirror); - if (previousHeight !== this.cachedContentHeight) { - this.cachedHeight = Math.min(this.cachedContentHeight, this.maxHeight); - this.input.style.height = this.cachedHeight + 'px'; - this._onDidHeightChange.fire(this.cachedContentHeight); - } - } - insertAtCursor(text) { - const inputElement = this.inputElement; - const start = inputElement.selectionStart; - const end = inputElement.selectionEnd; - const content = inputElement.value; - if (start !== null && end !== null) { - this.value = content.substr(0, start) + text + content.substr(end); - inputElement.setSelectionRange(start + 1, start + 1); - this.layout(); - } - } - dispose() { - this._hideMessage(); - this.message = null; - if (this.actionbar) { - this.actionbar.dispose(); - } - super.dispose(); - } -} -class HistoryInputBox extends InputBox { - constructor(container, contextViewProvider, options) { - super(container, contextViewProvider, options); - this.history = new _common_history_js__WEBPACK_IMPORTED_MODULE_10__["HistoryNavigator"](options.history, 100); - } - addToHistory() { - if (this.value && this.value !== this.getCurrentValue()) { - this.history.add(this.value); - } - } - showNextValue() { - if (!this.history.has(this.value)) { - this.addToHistory(); - } - let next = this.getNextValue(); - if (next) { - next = next === this.value ? this.getNextValue() : next; - } - if (next) { - this.value = next; - _aria_aria_js__WEBPACK_IMPORTED_MODULE_4__["status"](this.value); - } - } - showPreviousValue() { - if (!this.history.has(this.value)) { - this.addToHistory(); - } - let previous = this.getPreviousValue(); - if (previous) { - previous = previous === this.value ? this.getPreviousValue() : previous; - } - if (previous) { - this.value = previous; - _aria_aria_js__WEBPACK_IMPORTED_MODULE_4__["status"](this.value); - } - } - getCurrentValue() { - let currentValue = this.history.current(); - if (!currentValue) { - currentValue = this.history.last(); - this.history.next(); - } - return currentValue; - } - getPreviousValue() { - return this.history.previous() || this.history.first(); - } - getNextValue() { - return this.history.next() || this.history.last(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.css": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.css ***! - \***********************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_keybindingLabel_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./keybindingLabel.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.css"); -/* harmony import */ var _css_loader_dist_cjs_js_keybindingLabel_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_keybindingLabel_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_keybindingLabel_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_keybindingLabel_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.js ***! - \**********************************************************************************************/ -/*! exports provided: KeybindingLabel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeybindingLabel", function() { return KeybindingLabel; }); -/* harmony import */ var _keybindingLabel_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./keybindingLabel.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.css"); -/* harmony import */ var _common_objects_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _common_keybindingLabels_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/keybindingLabels.js */ "./node_modules/monaco-editor/esm/vs/base/common/keybindingLabels.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -const $ = _dom_js__WEBPACK_IMPORTED_MODULE_3__["$"]; -class KeybindingLabel { - constructor(container, os, options) { - this.os = os; - this.options = options; - this.domNode = _dom_js__WEBPACK_IMPORTED_MODULE_3__["append"](container, $('.monaco-keybinding')); - this.didEverRender = false; - container.appendChild(this.domNode); - } - set(keybinding, matches) { - if (this.didEverRender && this.keybinding === keybinding && KeybindingLabel.areSame(this.matches, matches)) { - return; - } - this.keybinding = keybinding; - this.matches = matches; - this.render(); - } - render() { - _dom_js__WEBPACK_IMPORTED_MODULE_3__["clearNode"](this.domNode); - if (this.keybinding) { - let [firstPart, chordPart] = this.keybinding.getParts(); - if (firstPart) { - this.renderPart(this.domNode, firstPart, this.matches ? this.matches.firstPart : null); - } - if (chordPart) { - _dom_js__WEBPACK_IMPORTED_MODULE_3__["append"](this.domNode, $('span.monaco-keybinding-key-chord-separator', undefined, ' ')); - this.renderPart(this.domNode, chordPart, this.matches ? this.matches.chordPart : null); - } - this.domNode.title = this.keybinding.getAriaLabel() || ''; - } - else if (this.options && this.options.renderUnboundKeybindings) { - this.renderUnbound(this.domNode); - } - this.didEverRender = true; - } - renderPart(parent, part, match) { - const modifierLabels = _common_keybindingLabels_js__WEBPACK_IMPORTED_MODULE_2__["UILabelProvider"].modifierLabels[this.os]; - if (part.ctrlKey) { - this.renderKey(parent, modifierLabels.ctrlKey, Boolean(match === null || match === void 0 ? void 0 : match.ctrlKey), modifierLabels.separator); - } - if (part.shiftKey) { - this.renderKey(parent, modifierLabels.shiftKey, Boolean(match === null || match === void 0 ? void 0 : match.shiftKey), modifierLabels.separator); - } - if (part.altKey) { - this.renderKey(parent, modifierLabels.altKey, Boolean(match === null || match === void 0 ? void 0 : match.altKey), modifierLabels.separator); - } - if (part.metaKey) { - this.renderKey(parent, modifierLabels.metaKey, Boolean(match === null || match === void 0 ? void 0 : match.metaKey), modifierLabels.separator); - } - const keyLabel = part.keyLabel; - if (keyLabel) { - this.renderKey(parent, keyLabel, Boolean(match === null || match === void 0 ? void 0 : match.keyCode), ''); - } - } - renderKey(parent, label, highlight, separator) { - _dom_js__WEBPACK_IMPORTED_MODULE_3__["append"](parent, $('span.monaco-keybinding-key' + (highlight ? '.highlight' : ''), undefined, label)); - if (separator) { - _dom_js__WEBPACK_IMPORTED_MODULE_3__["append"](parent, $('span.monaco-keybinding-key-separator', undefined, separator)); - } - } - renderUnbound(parent) { - _dom_js__WEBPACK_IMPORTED_MODULE_3__["append"](parent, $('span.monaco-keybinding-key', undefined, Object(_nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"])('unbound', "Unbound"))); - } - static areSame(a, b) { - if (a === b || (!a && !b)) { - return true; - } - return !!a && !!b && Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_1__["equals"])(a.firstPart, b.firstPart) && Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_1__["equals"])(a.chordPart, b.chordPart); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/list.css": -/*!*************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/list/list.css ***! - \*************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_list_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./list.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/list/list.css"); -/* harmony import */ var _css_loader_dist_cjs_js_list_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_list_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_list_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_list_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/list.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/list/list.js ***! - \************************************************************************/ -/*! exports provided: ListError */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListError", function() { return ListError; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class ListError extends Error { - constructor(user, message) { - super(`ListError [${user}] ${message}`); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listPaging.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listPaging.js ***! - \******************************************************************************/ -/*! exports provided: PagedList */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PagedList", function() { return PagedList; }); -/* harmony import */ var _list_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./list.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/list.css"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _listWidget_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./listWidget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listWidget.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _common_cancellation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -class PagedRenderer { - constructor(renderer, modelProvider) { - this.renderer = renderer; - this.modelProvider = modelProvider; - } - get templateId() { return this.renderer.templateId; } - renderTemplate(container) { - const data = this.renderer.renderTemplate(container); - return { data, disposable: _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None }; - } - renderElement(index, _, data, height) { - if (data.disposable) { - data.disposable.dispose(); - } - if (!data.data) { - return; - } - const model = this.modelProvider(); - if (model.isResolved(index)) { - return this.renderer.renderElement(model.get(index), index, data.data, height); - } - const cts = new _common_cancellation_js__WEBPACK_IMPORTED_MODULE_5__["CancellationTokenSource"](); - const promise = model.resolve(index, cts.token); - data.disposable = { dispose: () => cts.cancel() }; - this.renderer.renderPlaceholder(index, data.data); - promise.then(entry => this.renderer.renderElement(entry, index, data.data, height)); - } - disposeTemplate(data) { - if (data.disposable) { - data.disposable.dispose(); - data.disposable = undefined; - } - if (data.data) { - this.renderer.disposeTemplate(data.data); - data.data = undefined; - } - } -} -class PagedAccessibilityProvider { - constructor(modelProvider, accessibilityProvider) { - this.modelProvider = modelProvider; - this.accessibilityProvider = accessibilityProvider; - } - getWidgetAriaLabel() { - return this.accessibilityProvider.getWidgetAriaLabel(); - } - getAriaLabel(index) { - const model = this.modelProvider(); - if (!model.isResolved(index)) { - return null; - } - return this.accessibilityProvider.getAriaLabel(model.get(index)); - } -} -function fromPagedListOptions(modelProvider, options) { - return Object.assign(Object.assign({}, options), { accessibilityProvider: options.accessibilityProvider && new PagedAccessibilityProvider(modelProvider, options.accessibilityProvider) }); -} -class PagedList { - constructor(user, container, virtualDelegate, renderers, options = {}) { - const modelProvider = () => this.model; - const pagedRenderers = renderers.map(r => new PagedRenderer(r, modelProvider)); - this.list = new _listWidget_js__WEBPACK_IMPORTED_MODULE_3__["List"](user, container, virtualDelegate, pagedRenderers, fromPagedListOptions(modelProvider, options)); - } - updateOptions(options) { - this.list.updateOptions(options); - } - getHTMLElement() { - return this.list.getHTMLElement(); - } - get onDidFocus() { - return this.list.onDidFocus; - } - get onDidDispose() { - return this.list.onDidDispose; - } - get onMouseDblClick() { - return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(this.list.onMouseDblClick, ({ element, index, browserEvent }) => ({ element: element === undefined ? undefined : this._model.get(element), index, browserEvent })); - } - get onPointer() { - return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(this.list.onPointer, ({ element, index, browserEvent }) => ({ element: element === undefined ? undefined : this._model.get(element), index, browserEvent })); - } - get onDidChangeFocus() { - return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(this.list.onDidChangeFocus, ({ elements, indexes, browserEvent }) => ({ elements: elements.map(e => this._model.get(e)), indexes, browserEvent })); - } - get onDidChangeSelection() { - return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(this.list.onDidChangeSelection, ({ elements, indexes, browserEvent }) => ({ elements: elements.map(e => this._model.get(e)), indexes, browserEvent })); - } - get model() { - return this._model; - } - set model(model) { - this._model = model; - this.list.splice(0, this.list.length, Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_2__["range"])(model.length)); - } - getFocus() { - return this.list.getFocus(); - } - setSelection(indexes, browserEvent) { - this.list.setSelection(indexes, browserEvent); - } - getSelection() { - return this.list.getSelection(); - } - style(styles) { - this.list.style(styles); - } - dispose() { - this.list.dispose(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listView.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listView.js ***! - \****************************************************************************/ -/*! exports provided: ElementsDragAndDropData, ExternalElementsDragAndDropData, NativeDragAndDropData, ListView */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ElementsDragAndDropData", function() { return ElementsDragAndDropData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExternalElementsDragAndDropData", function() { return ExternalElementsDragAndDropData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NativeDragAndDropData", function() { return NativeDragAndDropData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListView", function() { return ListView; }); -/* harmony import */ var _common_objects_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _touch_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../touch.js */ "./node_modules/monaco-editor/esm/vs/base/browser/touch.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../event.js */ "./node_modules/monaco-editor/esm/vs/base/browser/event.js"); -/* harmony import */ var _scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../scrollbar/scrollableElement.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js"); -/* harmony import */ var _common_scrollable_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../common/scrollable.js */ "./node_modules/monaco-editor/esm/vs/base/common/scrollable.js"); -/* harmony import */ var _rangeMap_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./rangeMap.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/rangeMap.js"); -/* harmony import */ var _rowCache_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./rowCache.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/rowCache.js"); -/* harmony import */ var _common_decorators_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../common/decorators.js */ "./node_modules/monaco-editor/esm/vs/base/common/decorators.js"); -/* harmony import */ var _common_range_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../common/range.js */ "./node_modules/monaco-editor/esm/vs/base/common/range.js"); -/* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _dnd_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../dnd.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dnd.js"); -/* harmony import */ var _common_async_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; - - - - - - - - - - - - - - - - -const DefaultOptions = { - useShadows: true, - verticalScrollMode: 1 /* Auto */, - setRowLineHeight: true, - setRowHeight: true, - supportDynamicHeights: false, - dnd: { - getDragElements(e) { return [e]; }, - getDragURI() { return null; }, - onDragStart() { }, - onDragOver() { return false; }, - drop() { } - }, - horizontalScrolling: false, - transformOptimization: true -}; -class ElementsDragAndDropData { - constructor(elements) { - this.elements = elements; - } - update() { } - getData() { - return this.elements; - } -} -class ExternalElementsDragAndDropData { - constructor(elements) { - this.elements = elements; - } - update() { } - getData() { - return this.elements; - } -} -class NativeDragAndDropData { - constructor() { - this.types = []; - this.files = []; - } - update(dataTransfer) { - if (dataTransfer.types) { - this.types.splice(0, this.types.length, ...dataTransfer.types); - } - if (dataTransfer.files) { - this.files.splice(0, this.files.length); - for (let i = 0; i < dataTransfer.files.length; i++) { - const file = dataTransfer.files.item(i); - if (file && (file.size || file.type)) { - this.files.push(file); - } - } - } - } - getData() { - return { - types: this.types, - files: this.files - }; - } -} -function equalsDragFeedback(f1, f2) { - if (Array.isArray(f1) && Array.isArray(f2)) { - return Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_12__["equals"])(f1, f2); - } - return f1 === f2; -} -class ListViewAccessibilityProvider { - constructor(accessibilityProvider) { - if (accessibilityProvider === null || accessibilityProvider === void 0 ? void 0 : accessibilityProvider.getSetSize) { - this.getSetSize = accessibilityProvider.getSetSize.bind(accessibilityProvider); - } - else { - this.getSetSize = (e, i, l) => l; - } - if (accessibilityProvider === null || accessibilityProvider === void 0 ? void 0 : accessibilityProvider.getPosInSet) { - this.getPosInSet = accessibilityProvider.getPosInSet.bind(accessibilityProvider); - } - else { - this.getPosInSet = (e, i) => i + 1; - } - if (accessibilityProvider === null || accessibilityProvider === void 0 ? void 0 : accessibilityProvider.getRole) { - this.getRole = accessibilityProvider.getRole.bind(accessibilityProvider); - } - else { - this.getRole = _ => 'listitem'; - } - if (accessibilityProvider === null || accessibilityProvider === void 0 ? void 0 : accessibilityProvider.isChecked) { - this.isChecked = accessibilityProvider.isChecked.bind(accessibilityProvider); - } - else { - this.isChecked = _ => undefined; - } - } -} -class ListView { - constructor(container, virtualDelegate, renderers, options = DefaultOptions) { - this.virtualDelegate = virtualDelegate; - this.domId = `list_id_${++ListView.InstanceCount}`; - this.renderers = new Map(); - this.renderWidth = 0; - this._scrollHeight = 0; - this.scrollableElementUpdateDisposable = null; - this.scrollableElementWidthDelayer = new _common_async_js__WEBPACK_IMPORTED_MODULE_14__["Delayer"](50); - this.splicing = false; - this.dragOverAnimationStopDisposable = _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - this.dragOverMouseY = 0; - this.canDrop = false; - this.currentDragFeedbackDisposable = _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - this.onDragLeaveTimeout = _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - this.disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this._onDidChangeContentHeight = new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"](); - this._horizontalScrolling = false; - if (options.horizontalScrolling && options.supportDynamicHeights) { - throw new Error('Horizontal scrolling and dynamic heights not supported simultaneously'); - } - this.items = []; - this.itemId = 0; - this.rangeMap = new _rangeMap_js__WEBPACK_IMPORTED_MODULE_8__["RangeMap"](); - for (const renderer of renderers) { - this.renderers.set(renderer.templateId, renderer); - } - this.cache = this.disposables.add(new _rowCache_js__WEBPACK_IMPORTED_MODULE_9__["RowCache"](this.renderers)); - this.lastRenderTop = 0; - this.lastRenderHeight = 0; - this.domNode = document.createElement('div'); - this.domNode.className = 'monaco-list'; - _dom_js__WEBPACK_IMPORTED_MODULE_3__["addClass"](this.domNode, this.domId); - this.domNode.tabIndex = 0; - _dom_js__WEBPACK_IMPORTED_MODULE_3__["toggleClass"](this.domNode, 'mouse-support', typeof options.mouseSupport === 'boolean' ? options.mouseSupport : true); - this._horizontalScrolling = Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_0__["getOrDefault"])(options, o => o.horizontalScrolling, DefaultOptions.horizontalScrolling); - _dom_js__WEBPACK_IMPORTED_MODULE_3__["toggleClass"](this.domNode, 'horizontal-scrolling', this._horizontalScrolling); - this.additionalScrollHeight = typeof options.additionalScrollHeight === 'undefined' ? 0 : options.additionalScrollHeight; - this.accessibilityProvider = new ListViewAccessibilityProvider(options.accessibilityProvider); - this.rowsContainer = document.createElement('div'); - this.rowsContainer.className = 'monaco-list-rows'; - const transformOptimization = Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_0__["getOrDefault"])(options, o => o.transformOptimization, DefaultOptions.transformOptimization); - if (transformOptimization) { - this.rowsContainer.style.transform = 'translate3d(0px, 0px, 0px)'; - } - this.disposables.add(_touch_js__WEBPACK_IMPORTED_MODULE_2__["Gesture"].addTarget(this.rowsContainer)); - this.scrollable = new _common_scrollable_js__WEBPACK_IMPORTED_MODULE_7__["Scrollable"](Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_0__["getOrDefault"])(options, o => o.smoothScrolling, false) ? 125 : 0, cb => _dom_js__WEBPACK_IMPORTED_MODULE_3__["scheduleAtNextAnimationFrame"](cb)); - this.scrollableElement = this.disposables.add(new _scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_6__["SmoothScrollableElement"](this.rowsContainer, { - alwaysConsumeMouseWheel: true, - horizontal: 1 /* Auto */, - vertical: Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_0__["getOrDefault"])(options, o => o.verticalScrollMode, DefaultOptions.verticalScrollMode), - useShadows: Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_0__["getOrDefault"])(options, o => o.useShadows, DefaultOptions.useShadows), - }, this.scrollable)); - this.domNode.appendChild(this.scrollableElement.getDomNode()); - container.appendChild(this.domNode); - this.scrollableElement.onScroll(this.onScroll, this, this.disposables); - Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(this.rowsContainer, _touch_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].Change)(this.onTouchChange, this, this.disposables); - // Prevent the monaco-scrollable-element from scrolling - // https://github.com/Microsoft/vscode/issues/44181 - Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(this.scrollableElement.getDomNode(), 'scroll')(e => e.target.scrollTop = 0, null, this.disposables); - _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(this.domNode, 'dragover'), e => this.toDragEvent(e))(this.onDragOver, this, this.disposables); - _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(this.domNode, 'drop'), e => this.toDragEvent(e))(this.onDrop, this, this.disposables); - Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(this.domNode, 'dragleave')(this.onDragLeave, this, this.disposables); - Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(window, 'dragend')(this.onDragEnd, this, this.disposables); - this.setRowLineHeight = Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_0__["getOrDefault"])(options, o => o.setRowLineHeight, DefaultOptions.setRowLineHeight); - this.setRowHeight = Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_0__["getOrDefault"])(options, o => o.setRowHeight, DefaultOptions.setRowHeight); - this.supportDynamicHeights = Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_0__["getOrDefault"])(options, o => o.supportDynamicHeights, DefaultOptions.supportDynamicHeights); - this.dnd = Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_0__["getOrDefault"])(options, o => o.dnd, DefaultOptions.dnd); - this.layout(); - } - get contentHeight() { return this.rangeMap.size; } - get horizontalScrolling() { return this._horizontalScrolling; } - set horizontalScrolling(value) { - if (value === this._horizontalScrolling) { - return; - } - if (value && this.supportDynamicHeights) { - throw new Error('Horizontal scrolling and dynamic heights not supported simultaneously'); - } - this._horizontalScrolling = value; - _dom_js__WEBPACK_IMPORTED_MODULE_3__["toggleClass"](this.domNode, 'horizontal-scrolling', this._horizontalScrolling); - if (this._horizontalScrolling) { - for (const item of this.items) { - this.measureItemWidth(item); - } - this.updateScrollWidth(); - this.scrollableElement.setScrollDimensions({ width: _dom_js__WEBPACK_IMPORTED_MODULE_3__["getContentWidth"](this.domNode) }); - this.rowsContainer.style.width = `${Math.max(this.scrollWidth || 0, this.renderWidth)}px`; - } - else { - this.scrollableElementWidthDelayer.cancel(); - this.scrollableElement.setScrollDimensions({ width: this.renderWidth, scrollWidth: this.renderWidth }); - this.rowsContainer.style.width = ''; - } - } - updateOptions(options) { - if (options.additionalScrollHeight !== undefined) { - this.additionalScrollHeight = options.additionalScrollHeight; - } - if (options.smoothScrolling !== undefined) { - this.scrollable.setSmoothScrollDuration(options.smoothScrolling ? 125 : 0); - } - if (options.horizontalScrolling !== undefined) { - this.horizontalScrolling = options.horizontalScrolling; - } - } - splice(start, deleteCount, elements = []) { - if (this.splicing) { - throw new Error('Can\'t run recursive splices.'); - } - this.splicing = true; - try { - return this._splice(start, deleteCount, elements); - } - finally { - this.splicing = false; - this._onDidChangeContentHeight.fire(this.contentHeight); - } - } - _splice(start, deleteCount, elements = []) { - const previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight); - const deleteRange = { start, end: start + deleteCount }; - const removeRange = _common_range_js__WEBPACK_IMPORTED_MODULE_11__["Range"].intersect(previousRenderRange, deleteRange); - for (let i = removeRange.start; i < removeRange.end; i++) { - this.removeItemFromDOM(i); - } - const previousRestRange = { start: start + deleteCount, end: this.items.length }; - const previousRenderedRestRange = _common_range_js__WEBPACK_IMPORTED_MODULE_11__["Range"].intersect(previousRestRange, previousRenderRange); - const previousUnrenderedRestRanges = _common_range_js__WEBPACK_IMPORTED_MODULE_11__["Range"].relativeComplement(previousRestRange, previousRenderRange); - const inserted = elements.map(element => ({ - id: String(this.itemId++), - element, - templateId: this.virtualDelegate.getTemplateId(element), - size: this.virtualDelegate.getHeight(element), - width: undefined, - hasDynamicHeight: !!this.virtualDelegate.hasDynamicHeight && this.virtualDelegate.hasDynamicHeight(element), - lastDynamicHeightWidth: undefined, - row: null, - uri: undefined, - dropTarget: false, - dragStartDisposable: _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None - })); - let deleted; - // TODO@joao: improve this optimization to catch even more cases - if (start === 0 && deleteCount >= this.items.length) { - this.rangeMap = new _rangeMap_js__WEBPACK_IMPORTED_MODULE_8__["RangeMap"](); - this.rangeMap.splice(0, 0, inserted); - this.items = inserted; - deleted = []; - } - else { - this.rangeMap.splice(start, deleteCount, inserted); - deleted = this.items.splice(start, deleteCount, ...inserted); - } - const delta = elements.length - deleteCount; - const renderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight); - const renderedRestRange = Object(_rangeMap_js__WEBPACK_IMPORTED_MODULE_8__["shift"])(previousRenderedRestRange, delta); - const updateRange = _common_range_js__WEBPACK_IMPORTED_MODULE_11__["Range"].intersect(renderRange, renderedRestRange); - for (let i = updateRange.start; i < updateRange.end; i++) { - this.updateItemInDOM(this.items[i], i); - } - const removeRanges = _common_range_js__WEBPACK_IMPORTED_MODULE_11__["Range"].relativeComplement(renderedRestRange, renderRange); - for (const range of removeRanges) { - for (let i = range.start; i < range.end; i++) { - this.removeItemFromDOM(i); - } - } - const unrenderedRestRanges = previousUnrenderedRestRanges.map(r => Object(_rangeMap_js__WEBPACK_IMPORTED_MODULE_8__["shift"])(r, delta)); - const elementsRange = { start, end: start + elements.length }; - const insertRanges = [elementsRange, ...unrenderedRestRanges].map(r => _common_range_js__WEBPACK_IMPORTED_MODULE_11__["Range"].intersect(renderRange, r)); - const beforeElement = this.getNextToLastElement(insertRanges); - for (const range of insertRanges) { - for (let i = range.start; i < range.end; i++) { - this.insertItemInDOM(i, beforeElement); - } - } - this.eventuallyUpdateScrollDimensions(); - if (this.supportDynamicHeights) { - this._rerender(this.scrollTop, this.renderHeight); - } - return deleted.map(i => i.element); - } - eventuallyUpdateScrollDimensions() { - this._scrollHeight = this.contentHeight; - this.rowsContainer.style.height = `${this._scrollHeight}px`; - if (!this.scrollableElementUpdateDisposable) { - this.scrollableElementUpdateDisposable = _dom_js__WEBPACK_IMPORTED_MODULE_3__["scheduleAtNextAnimationFrame"](() => { - this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }); - this.updateScrollWidth(); - this.scrollableElementUpdateDisposable = null; - }); - } - } - eventuallyUpdateScrollWidth() { - if (!this.horizontalScrolling) { - this.scrollableElementWidthDelayer.cancel(); - return; - } - this.scrollableElementWidthDelayer.trigger(() => this.updateScrollWidth()); - } - updateScrollWidth() { - if (!this.horizontalScrolling) { - return; - } - let scrollWidth = 0; - for (const item of this.items) { - if (typeof item.width !== 'undefined') { - scrollWidth = Math.max(scrollWidth, item.width); - } - } - this.scrollWidth = scrollWidth; - this.scrollableElement.setScrollDimensions({ scrollWidth: scrollWidth === 0 ? 0 : (scrollWidth + 10) }); - } - rerender() { - if (!this.supportDynamicHeights) { - return; - } - for (const item of this.items) { - item.lastDynamicHeightWidth = undefined; - } - this._rerender(this.lastRenderTop, this.lastRenderHeight); - } - get length() { - return this.items.length; - } - get renderHeight() { - const scrollDimensions = this.scrollableElement.getScrollDimensions(); - return scrollDimensions.height; - } - element(index) { - return this.items[index].element; - } - domElement(index) { - const row = this.items[index].row; - return row && row.domNode; - } - elementHeight(index) { - return this.items[index].size; - } - elementTop(index) { - return this.rangeMap.positionAt(index); - } - indexAt(position) { - return this.rangeMap.indexAt(position); - } - indexAfter(position) { - return this.rangeMap.indexAfter(position); - } - layout(height, width) { - let scrollDimensions = { - height: typeof height === 'number' ? height : _dom_js__WEBPACK_IMPORTED_MODULE_3__["getContentHeight"](this.domNode) - }; - if (this.scrollableElementUpdateDisposable) { - this.scrollableElementUpdateDisposable.dispose(); - this.scrollableElementUpdateDisposable = null; - scrollDimensions.scrollHeight = this.scrollHeight; - } - this.scrollableElement.setScrollDimensions(scrollDimensions); - if (typeof width !== 'undefined') { - this.renderWidth = width; - if (this.supportDynamicHeights) { - this._rerender(this.scrollTop, this.renderHeight); - } - if (this.horizontalScrolling) { - this.scrollableElement.setScrollDimensions({ - width: typeof width === 'number' ? width : _dom_js__WEBPACK_IMPORTED_MODULE_3__["getContentWidth"](this.domNode) - }); - } - } - } - // Render - render(previousRenderRange, renderTop, renderHeight, renderLeft, scrollWidth, updateItemsInDOM = false) { - const renderRange = this.getRenderRange(renderTop, renderHeight); - const rangesToInsert = _common_range_js__WEBPACK_IMPORTED_MODULE_11__["Range"].relativeComplement(renderRange, previousRenderRange); - const rangesToRemove = _common_range_js__WEBPACK_IMPORTED_MODULE_11__["Range"].relativeComplement(previousRenderRange, renderRange); - const beforeElement = this.getNextToLastElement(rangesToInsert); - if (updateItemsInDOM) { - const rangesToUpdate = _common_range_js__WEBPACK_IMPORTED_MODULE_11__["Range"].intersect(previousRenderRange, renderRange); - for (let i = rangesToUpdate.start; i < rangesToUpdate.end; i++) { - this.updateItemInDOM(this.items[i], i); - } - } - for (const range of rangesToInsert) { - for (let i = range.start; i < range.end; i++) { - this.insertItemInDOM(i, beforeElement); - } - } - for (const range of rangesToRemove) { - for (let i = range.start; i < range.end; i++) { - this.removeItemFromDOM(i); - } - } - if (renderLeft !== undefined) { - this.rowsContainer.style.left = `-${renderLeft}px`; - } - this.rowsContainer.style.top = `-${renderTop}px`; - if (this.horizontalScrolling && scrollWidth !== undefined) { - this.rowsContainer.style.width = `${Math.max(scrollWidth, this.renderWidth)}px`; - } - this.lastRenderTop = renderTop; - this.lastRenderHeight = renderHeight; - } - // DOM operations - insertItemInDOM(index, beforeElement) { - const item = this.items[index]; - if (!item.row) { - item.row = this.cache.alloc(item.templateId); - const role = this.accessibilityProvider.getRole(item.element) || 'listitem'; - item.row.domNode.setAttribute('role', role); - const checked = this.accessibilityProvider.isChecked(item.element); - if (typeof checked !== 'undefined') { - item.row.domNode.setAttribute('aria-checked', String(!!checked)); - } - } - if (!item.row.domNode.parentElement) { - if (beforeElement) { - this.rowsContainer.insertBefore(item.row.domNode, beforeElement); - } - else { - this.rowsContainer.appendChild(item.row.domNode); - } - } - this.updateItemInDOM(item, index); - const renderer = this.renderers.get(item.templateId); - if (!renderer) { - throw new Error(`No renderer found for template id ${item.templateId}`); - } - if (renderer) { - renderer.renderElement(item.element, index, item.row.templateData, item.size); - } - const uri = this.dnd.getDragURI(item.element); - item.dragStartDisposable.dispose(); - item.row.domNode.draggable = !!uri; - if (uri) { - const onDragStart = Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(item.row.domNode, 'dragstart'); - item.dragStartDisposable = onDragStart(event => this.onDragStart(item.element, uri, event)); - } - if (this.horizontalScrolling) { - this.measureItemWidth(item); - this.eventuallyUpdateScrollWidth(); - } - } - measureItemWidth(item) { - if (!item.row || !item.row.domNode) { - return; - } - item.row.domNode.style.width = _browser_js__WEBPACK_IMPORTED_MODULE_15__["isFirefox"] ? '-moz-fit-content' : 'fit-content'; - item.width = _dom_js__WEBPACK_IMPORTED_MODULE_3__["getContentWidth"](item.row.domNode); - const style = window.getComputedStyle(item.row.domNode); - if (style.paddingLeft) { - item.width += parseFloat(style.paddingLeft); - } - if (style.paddingRight) { - item.width += parseFloat(style.paddingRight); - } - item.row.domNode.style.width = ''; - } - updateItemInDOM(item, index) { - item.row.domNode.style.top = `${this.elementTop(index)}px`; - if (this.setRowHeight) { - item.row.domNode.style.height = `${item.size}px`; - } - if (this.setRowLineHeight) { - item.row.domNode.style.lineHeight = `${item.size}px`; - } - item.row.domNode.setAttribute('data-index', `${index}`); - item.row.domNode.setAttribute('data-last-element', index === this.length - 1 ? 'true' : 'false'); - item.row.domNode.setAttribute('aria-setsize', String(this.accessibilityProvider.getSetSize(item.element, index, this.length))); - item.row.domNode.setAttribute('aria-posinset', String(this.accessibilityProvider.getPosInSet(item.element, index))); - item.row.domNode.setAttribute('id', this.getElementDomId(index)); - _dom_js__WEBPACK_IMPORTED_MODULE_3__["toggleClass"](item.row.domNode, 'drop-target', item.dropTarget); - } - removeItemFromDOM(index) { - const item = this.items[index]; - item.dragStartDisposable.dispose(); - const renderer = this.renderers.get(item.templateId); - if (item.row && renderer && renderer.disposeElement) { - renderer.disposeElement(item.element, index, item.row.templateData, item.size); - } - this.cache.release(item.row); - item.row = null; - if (this.horizontalScrolling) { - this.eventuallyUpdateScrollWidth(); - } - } - getScrollTop() { - const scrollPosition = this.scrollableElement.getScrollPosition(); - return scrollPosition.scrollTop; - } - setScrollTop(scrollTop) { - if (this.scrollableElementUpdateDisposable) { - this.scrollableElementUpdateDisposable.dispose(); - this.scrollableElementUpdateDisposable = null; - this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }); - } - this.scrollableElement.setScrollPosition({ scrollTop }); - } - get scrollTop() { - return this.getScrollTop(); - } - set scrollTop(scrollTop) { - this.setScrollTop(scrollTop); - } - get scrollHeight() { - return this._scrollHeight + (this.horizontalScrolling ? 10 : 0) + this.additionalScrollHeight; - } - // Events - get onMouseClick() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(this.domNode, 'click'), e => this.toMouseEvent(e)); } - get onMouseDblClick() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(this.domNode, 'dblclick'), e => this.toMouseEvent(e)); } - get onMouseMiddleClick() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].filter(_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(this.domNode, 'auxclick'), e => this.toMouseEvent(e)), e => e.browserEvent.button === 1); } - get onMouseDown() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(this.domNode, 'mousedown'), e => this.toMouseEvent(e)); } - get onContextMenu() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(this.domNode, 'contextmenu'), e => this.toMouseEvent(e)); } - get onTouchStart() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(this.domNode, 'touchstart'), e => this.toTouchEvent(e)); } - get onTap() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(Object(_event_js__WEBPACK_IMPORTED_MODULE_5__["domEvent"])(this.rowsContainer, _touch_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].Tap), e => this.toGestureEvent(e)); } - toMouseEvent(browserEvent) { - const index = this.getItemIndexFromEventTarget(browserEvent.target || null); - const item = typeof index === 'undefined' ? undefined : this.items[index]; - const element = item && item.element; - return { browserEvent, index, element }; - } - toTouchEvent(browserEvent) { - const index = this.getItemIndexFromEventTarget(browserEvent.target || null); - const item = typeof index === 'undefined' ? undefined : this.items[index]; - const element = item && item.element; - return { browserEvent, index, element }; - } - toGestureEvent(browserEvent) { - const index = this.getItemIndexFromEventTarget(browserEvent.initialTarget || null); - const item = typeof index === 'undefined' ? undefined : this.items[index]; - const element = item && item.element; - return { browserEvent, index, element }; - } - toDragEvent(browserEvent) { - const index = this.getItemIndexFromEventTarget(browserEvent.target || null); - const item = typeof index === 'undefined' ? undefined : this.items[index]; - const element = item && item.element; - return { browserEvent, index, element }; - } - onScroll(e) { - try { - const previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight); - this.render(previousRenderRange, e.scrollTop, e.height, e.scrollLeft, e.scrollWidth); - if (this.supportDynamicHeights) { - this._rerender(e.scrollTop, e.height); - } - } - catch (err) { - console.error('Got bad scroll event:', e); - throw err; - } - } - onTouchChange(event) { - event.preventDefault(); - event.stopPropagation(); - this.scrollTop -= event.translationY; - } - // DND - onDragStart(element, uri, event) { - if (!event.dataTransfer) { - return; - } - const elements = this.dnd.getDragElements(element); - event.dataTransfer.effectAllowed = 'copyMove'; - event.dataTransfer.setData(_dnd_js__WEBPACK_IMPORTED_MODULE_13__["DataTransfers"].RESOURCES, JSON.stringify([uri])); - if (event.dataTransfer.setDragImage) { - let label; - if (this.dnd.getDragLabel) { - label = this.dnd.getDragLabel(elements, event); - } - if (typeof label === 'undefined') { - label = String(elements.length); - } - const dragImage = _dom_js__WEBPACK_IMPORTED_MODULE_3__["$"]('.monaco-drag-image'); - dragImage.textContent = label; - document.body.appendChild(dragImage); - event.dataTransfer.setDragImage(dragImage, -10, -10); - setTimeout(() => document.body.removeChild(dragImage), 0); - } - this.currentDragData = new ElementsDragAndDropData(elements); - _dnd_js__WEBPACK_IMPORTED_MODULE_13__["StaticDND"].CurrentDragAndDropData = new ExternalElementsDragAndDropData(elements); - if (this.dnd.onDragStart) { - this.dnd.onDragStart(this.currentDragData, event); - } - } - onDragOver(event) { - event.browserEvent.preventDefault(); // needed so that the drop event fires (https://stackoverflow.com/questions/21339924/drop-event-not-firing-in-chrome) - this.onDragLeaveTimeout.dispose(); - if (_dnd_js__WEBPACK_IMPORTED_MODULE_13__["StaticDND"].CurrentDragAndDropData && _dnd_js__WEBPACK_IMPORTED_MODULE_13__["StaticDND"].CurrentDragAndDropData.getData() === 'vscode-ui') { - return false; - } - this.setupDragAndDropScrollTopAnimation(event.browserEvent); - if (!event.browserEvent.dataTransfer) { - return false; - } - // Drag over from outside - if (!this.currentDragData) { - if (_dnd_js__WEBPACK_IMPORTED_MODULE_13__["StaticDND"].CurrentDragAndDropData) { - // Drag over from another list - this.currentDragData = _dnd_js__WEBPACK_IMPORTED_MODULE_13__["StaticDND"].CurrentDragAndDropData; - } - else { - // Drag over from the desktop - if (!event.browserEvent.dataTransfer.types) { - return false; - } - this.currentDragData = new NativeDragAndDropData(); - } - } - const result = this.dnd.onDragOver(this.currentDragData, event.element, event.index, event.browserEvent); - this.canDrop = typeof result === 'boolean' ? result : result.accept; - if (!this.canDrop) { - this.currentDragFeedback = undefined; - this.currentDragFeedbackDisposable.dispose(); - return false; - } - event.browserEvent.dataTransfer.dropEffect = (typeof result !== 'boolean' && result.effect === 0 /* Copy */) ? 'copy' : 'move'; - let feedback; - if (typeof result !== 'boolean' && result.feedback) { - feedback = result.feedback; - } - else { - if (typeof event.index === 'undefined') { - feedback = [-1]; - } - else { - feedback = [event.index]; - } - } - // sanitize feedback list - feedback = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_12__["distinct"])(feedback).filter(i => i >= -1 && i < this.length).sort((a, b) => a - b); - feedback = feedback[0] === -1 ? [-1] : feedback; - if (equalsDragFeedback(this.currentDragFeedback, feedback)) { - return true; - } - this.currentDragFeedback = feedback; - this.currentDragFeedbackDisposable.dispose(); - if (feedback[0] === -1) { // entire list feedback - _dom_js__WEBPACK_IMPORTED_MODULE_3__["addClass"](this.domNode, 'drop-target'); - _dom_js__WEBPACK_IMPORTED_MODULE_3__["addClass"](this.rowsContainer, 'drop-target'); - this.currentDragFeedbackDisposable = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => { - _dom_js__WEBPACK_IMPORTED_MODULE_3__["removeClass"](this.domNode, 'drop-target'); - _dom_js__WEBPACK_IMPORTED_MODULE_3__["removeClass"](this.rowsContainer, 'drop-target'); - }); - } - else { - for (const index of feedback) { - const item = this.items[index]; - item.dropTarget = true; - if (item.row && item.row.domNode) { - _dom_js__WEBPACK_IMPORTED_MODULE_3__["addClass"](item.row.domNode, 'drop-target'); - } - } - this.currentDragFeedbackDisposable = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => { - for (const index of feedback) { - const item = this.items[index]; - item.dropTarget = false; - if (item.row && item.row.domNode) { - _dom_js__WEBPACK_IMPORTED_MODULE_3__["removeClass"](item.row.domNode, 'drop-target'); - } - } - }); - } - return true; - } - onDragLeave() { - this.onDragLeaveTimeout.dispose(); - this.onDragLeaveTimeout = Object(_common_async_js__WEBPACK_IMPORTED_MODULE_14__["disposableTimeout"])(() => this.clearDragOverFeedback(), 100); - } - onDrop(event) { - if (!this.canDrop) { - return; - } - const dragData = this.currentDragData; - this.teardownDragAndDropScrollTopAnimation(); - this.clearDragOverFeedback(); - this.currentDragData = undefined; - _dnd_js__WEBPACK_IMPORTED_MODULE_13__["StaticDND"].CurrentDragAndDropData = undefined; - if (!dragData || !event.browserEvent.dataTransfer) { - return; - } - event.browserEvent.preventDefault(); - dragData.update(event.browserEvent.dataTransfer); - this.dnd.drop(dragData, event.element, event.index, event.browserEvent); - } - onDragEnd(event) { - this.canDrop = false; - this.teardownDragAndDropScrollTopAnimation(); - this.clearDragOverFeedback(); - this.currentDragData = undefined; - _dnd_js__WEBPACK_IMPORTED_MODULE_13__["StaticDND"].CurrentDragAndDropData = undefined; - if (this.dnd.onDragEnd) { - this.dnd.onDragEnd(event); - } - } - clearDragOverFeedback() { - this.currentDragFeedback = undefined; - this.currentDragFeedbackDisposable.dispose(); - this.currentDragFeedbackDisposable = _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - } - // DND scroll top animation - setupDragAndDropScrollTopAnimation(event) { - if (!this.dragOverAnimationDisposable) { - const viewTop = _dom_js__WEBPACK_IMPORTED_MODULE_3__["getTopLeftOffset"](this.domNode).top; - this.dragOverAnimationDisposable = _dom_js__WEBPACK_IMPORTED_MODULE_3__["animate"](this.animateDragAndDropScrollTop.bind(this, viewTop)); - } - this.dragOverAnimationStopDisposable.dispose(); - this.dragOverAnimationStopDisposable = Object(_common_async_js__WEBPACK_IMPORTED_MODULE_14__["disposableTimeout"])(() => { - if (this.dragOverAnimationDisposable) { - this.dragOverAnimationDisposable.dispose(); - this.dragOverAnimationDisposable = undefined; - } - }, 1000); - this.dragOverMouseY = event.pageY; - } - animateDragAndDropScrollTop(viewTop) { - if (this.dragOverMouseY === undefined) { - return; - } - const diff = this.dragOverMouseY - viewTop; - const upperLimit = this.renderHeight - 35; - if (diff < 35) { - this.scrollTop += Math.max(-14, Math.floor(0.3 * (diff - 35))); - } - else if (diff > upperLimit) { - this.scrollTop += Math.min(14, Math.floor(0.3 * (diff - upperLimit))); - } - } - teardownDragAndDropScrollTopAnimation() { - this.dragOverAnimationStopDisposable.dispose(); - if (this.dragOverAnimationDisposable) { - this.dragOverAnimationDisposable.dispose(); - this.dragOverAnimationDisposable = undefined; - } - } - // Util - getItemIndexFromEventTarget(target) { - const scrollableElement = this.scrollableElement.getDomNode(); - let element = target; - while (element instanceof HTMLElement && element !== this.rowsContainer && scrollableElement.contains(element)) { - const rawIndex = element.getAttribute('data-index'); - if (rawIndex) { - const index = Number(rawIndex); - if (!isNaN(index)) { - return index; - } - } - element = element.parentElement; - } - return undefined; - } - getRenderRange(renderTop, renderHeight) { - return { - start: this.rangeMap.indexAt(renderTop), - end: this.rangeMap.indexAfter(renderTop + renderHeight - 1) - }; - } - /** - * Given a stable rendered state, checks every rendered element whether it needs - * to be probed for dynamic height. Adjusts scroll height and top if necessary. - */ - _rerender(renderTop, renderHeight) { - const previousRenderRange = this.getRenderRange(renderTop, renderHeight); - // Let's remember the second element's position, this helps in scrolling up - // and preserving a linear upwards scroll movement - let anchorElementIndex; - let anchorElementTopDelta; - if (renderTop === this.elementTop(previousRenderRange.start)) { - anchorElementIndex = previousRenderRange.start; - anchorElementTopDelta = 0; - } - else if (previousRenderRange.end - previousRenderRange.start > 1) { - anchorElementIndex = previousRenderRange.start + 1; - anchorElementTopDelta = this.elementTop(anchorElementIndex) - renderTop; - } - let heightDiff = 0; - while (true) { - const renderRange = this.getRenderRange(renderTop, renderHeight); - let didChange = false; - for (let i = renderRange.start; i < renderRange.end; i++) { - const diff = this.probeDynamicHeight(i); - if (diff !== 0) { - this.rangeMap.splice(i, 1, [this.items[i]]); - } - heightDiff += diff; - didChange = didChange || diff !== 0; - } - if (!didChange) { - if (heightDiff !== 0) { - this.eventuallyUpdateScrollDimensions(); - } - const unrenderRanges = _common_range_js__WEBPACK_IMPORTED_MODULE_11__["Range"].relativeComplement(previousRenderRange, renderRange); - for (const range of unrenderRanges) { - for (let i = range.start; i < range.end; i++) { - if (this.items[i].row) { - this.removeItemFromDOM(i); - } - } - } - const renderRanges = _common_range_js__WEBPACK_IMPORTED_MODULE_11__["Range"].relativeComplement(renderRange, previousRenderRange); - for (const range of renderRanges) { - for (let i = range.start; i < range.end; i++) { - const afterIndex = i + 1; - const beforeRow = afterIndex < this.items.length ? this.items[afterIndex].row : null; - const beforeElement = beforeRow ? beforeRow.domNode : null; - this.insertItemInDOM(i, beforeElement); - } - } - for (let i = renderRange.start; i < renderRange.end; i++) { - if (this.items[i].row) { - this.updateItemInDOM(this.items[i], i); - } - } - if (typeof anchorElementIndex === 'number') { - this.scrollTop = this.elementTop(anchorElementIndex) - anchorElementTopDelta; - } - this._onDidChangeContentHeight.fire(this.contentHeight); - return; - } - } - } - probeDynamicHeight(index) { - const item = this.items[index]; - if (!item.hasDynamicHeight || item.lastDynamicHeightWidth === this.renderWidth) { - return 0; - } - if (!!this.virtualDelegate.hasDynamicHeight && !this.virtualDelegate.hasDynamicHeight(item.element)) { - return 0; - } - const size = item.size; - if (!this.setRowHeight && item.row && item.row.domNode) { - let newSize = item.row.domNode.offsetHeight; - item.size = newSize; - item.lastDynamicHeightWidth = this.renderWidth; - return newSize - size; - } - const row = this.cache.alloc(item.templateId); - row.domNode.style.height = ''; - this.rowsContainer.appendChild(row.domNode); - const renderer = this.renderers.get(item.templateId); - if (renderer) { - renderer.renderElement(item.element, index, row.templateData, undefined); - if (renderer.disposeElement) { - renderer.disposeElement(item.element, index, row.templateData, undefined); - } - } - item.size = row.domNode.offsetHeight; - if (this.virtualDelegate.setDynamicHeight) { - this.virtualDelegate.setDynamicHeight(item.element, item.size); - } - item.lastDynamicHeightWidth = this.renderWidth; - this.rowsContainer.removeChild(row.domNode); - this.cache.release(row); - return item.size - size; - } - getNextToLastElement(ranges) { - const lastRange = ranges[ranges.length - 1]; - if (!lastRange) { - return null; - } - const nextToLastItem = this.items[lastRange.end]; - if (!nextToLastItem) { - return null; - } - if (!nextToLastItem.row) { - return null; - } - return nextToLastItem.row.domNode; - } - getElementDomId(index) { - return `${this.domId}_${index}`; - } - // Dispose - dispose() { - if (this.items) { - for (const item of this.items) { - if (item.row) { - const renderer = this.renderers.get(item.row.templateId); - if (renderer) { - renderer.disposeTemplate(item.row.templateData); - } - } - } - this.items = []; - } - if (this.domNode && this.domNode.parentNode) { - this.domNode.parentNode.removeChild(this.domNode); - } - Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this.disposables); - } -} -ListView.InstanceCount = 0; -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_10__["memoize"] -], ListView.prototype, "onMouseClick", null); -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_10__["memoize"] -], ListView.prototype, "onMouseDblClick", null); -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_10__["memoize"] -], ListView.prototype, "onMouseMiddleClick", null); -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_10__["memoize"] -], ListView.prototype, "onMouseDown", null); -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_10__["memoize"] -], ListView.prototype, "onContextMenu", null); -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_10__["memoize"] -], ListView.prototype, "onTouchStart", null); -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_10__["memoize"] -], ListView.prototype, "onTap", null); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listWidget.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listWidget.js ***! - \******************************************************************************/ -/*! exports provided: isInputElement, isMonacoEditor, DefaultKeyboardNavigationDelegate, isSelectionSingleChangeEvent, isSelectionRangeChangeEvent, MouseController, DefaultStyleController, List */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInputElement", function() { return isInputElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMonacoEditor", function() { return isMonacoEditor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultKeyboardNavigationDelegate", function() { return DefaultKeyboardNavigationDelegate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSelectionSingleChangeEvent", function() { return isSelectionSingleChangeEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSelectionRangeChangeEvent", function() { return isSelectionRangeChangeEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseController", function() { return MouseController; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultStyleController", function() { return DefaultStyleController; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "List", function() { return List; }); -/* harmony import */ var _list_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./list.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/list.css"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _common_decorators_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/decorators.js */ "./node_modules/monaco-editor/esm/vs/base/common/decorators.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _touch_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../touch.js */ "./node_modules/monaco-editor/esm/vs/base/browser/touch.js"); -/* harmony import */ var _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../keyboardEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../event.js */ "./node_modules/monaco-editor/esm/vs/base/browser/event.js"); -/* harmony import */ var _list_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./list.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/list.js"); -/* harmony import */ var _listView_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./listView.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listView.js"); -/* harmony import */ var _common_color_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _common_objects_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _splice_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./splice.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/splice.js"); -/* harmony import */ var _common_numbers_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../common/numbers.js */ "./node_modules/monaco-editor/esm/vs/base/common/numbers.js"); -/* harmony import */ var _common_filters_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../common/filters.js */ "./node_modules/monaco-editor/esm/vs/base/common/filters.js"); -/* harmony import */ var _aria_aria_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; - - - - - - - - - - - - - - - - - - - -class TraitRenderer { - constructor(trait) { - this.trait = trait; - this.renderedElements = []; - } - get templateId() { - return `template:${this.trait.trait}`; - } - renderTemplate(container) { - return container; - } - renderElement(element, index, templateData) { - const renderedElementIndex = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_3__["firstIndex"])(this.renderedElements, el => el.templateData === templateData); - if (renderedElementIndex >= 0) { - const rendered = this.renderedElements[renderedElementIndex]; - this.trait.unrender(templateData); - rendered.index = index; - } - else { - const rendered = { index, templateData }; - this.renderedElements.push(rendered); - } - this.trait.renderIndex(index, templateData); - } - splice(start, deleteCount, insertCount) { - const rendered = []; - for (const renderedElement of this.renderedElements) { - if (renderedElement.index < start) { - rendered.push(renderedElement); - } - else if (renderedElement.index >= start + deleteCount) { - rendered.push({ - index: renderedElement.index + insertCount - deleteCount, - templateData: renderedElement.templateData - }); - } - } - this.renderedElements = rendered; - } - renderIndexes(indexes) { - for (const { index, templateData } of this.renderedElements) { - if (indexes.indexOf(index) > -1) { - this.trait.renderIndex(index, templateData); - } - } - } - disposeTemplate(templateData) { - const index = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_3__["firstIndex"])(this.renderedElements, el => el.templateData === templateData); - if (index < 0) { - return; - } - this.renderedElements.splice(index, 1); - } -} -class Trait { - constructor(_trait) { - this._trait = _trait; - this.indexes = []; - this.sortedIndexes = []; - this._onChange = new _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Emitter"](); - this.onChange = this._onChange.event; - } - get trait() { return this._trait; } - get renderer() { - return new TraitRenderer(this); - } - splice(start, deleteCount, elements) { - const diff = elements.length - deleteCount; - const end = start + deleteCount; - const indexes = [ - ...this.sortedIndexes.filter(i => i < start), - ...elements.map((hasTrait, i) => hasTrait ? i + start : -1).filter(i => i !== -1), - ...this.sortedIndexes.filter(i => i >= end).map(i => i + diff) - ]; - this.renderer.splice(start, deleteCount, elements.length); - this._set(indexes, indexes); - } - renderIndex(index, container) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["toggleClass"](container, this._trait, this.contains(index)); - } - unrender(container) { - _dom_js__WEBPACK_IMPORTED_MODULE_5__["removeClass"](container, this._trait); - } - /** - * Sets the indexes which should have this trait. - * - * @param indexes Indexes which should have this trait. - * @return The old indexes which had this trait. - */ - set(indexes, browserEvent) { - return this._set(indexes, [...indexes].sort(numericSort), browserEvent); - } - _set(indexes, sortedIndexes, browserEvent) { - const result = this.indexes; - const sortedResult = this.sortedIndexes; - this.indexes = indexes; - this.sortedIndexes = sortedIndexes; - const toRender = disjunction(sortedResult, indexes); - this.renderer.renderIndexes(toRender); - this._onChange.fire({ indexes, browserEvent }); - return result; - } - get() { - return this.indexes; - } - contains(index) { - return Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_3__["binarySearch"])(this.sortedIndexes, index, numericSort) >= 0; - } - dispose() { - Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this._onChange); - } -} -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_4__["memoize"] -], Trait.prototype, "renderer", null); -class SelectionTrait extends Trait { - constructor(setAriaSelected) { - super('selected'); - this.setAriaSelected = setAriaSelected; - } - renderIndex(index, container) { - super.renderIndex(index, container); - if (this.setAriaSelected) { - if (this.contains(index)) { - container.setAttribute('aria-selected', 'true'); - } - else { - container.setAttribute('aria-selected', 'false'); - } - } - } -} -/** - * The TraitSpliceable is used as a util class to be able - * to preserve traits across splice calls, given an identity - * provider. - */ -class TraitSpliceable { - constructor(trait, view, identityProvider) { - this.trait = trait; - this.view = view; - this.identityProvider = identityProvider; - } - splice(start, deleteCount, elements) { - if (!this.identityProvider) { - return this.trait.splice(start, deleteCount, elements.map(() => false)); - } - const pastElementsWithTrait = this.trait.get().map(i => this.identityProvider.getId(this.view.element(i)).toString()); - const elementsWithTrait = elements.map(e => pastElementsWithTrait.indexOf(this.identityProvider.getId(e).toString()) > -1); - this.trait.splice(start, deleteCount, elementsWithTrait); - } -} -function isInputElement(e) { - return e.tagName === 'INPUT' || e.tagName === 'TEXTAREA'; -} -function isMonacoEditor(e) { - if (_dom_js__WEBPACK_IMPORTED_MODULE_5__["hasClass"](e, 'monaco-editor')) { - return true; - } - if (_dom_js__WEBPACK_IMPORTED_MODULE_5__["hasClass"](e, 'monaco-list')) { - return false; - } - if (!e.parentElement) { - return false; - } - return isMonacoEditor(e.parentElement); -} -class KeyboardController { - constructor(list, view, options) { - this.list = list; - this.view = view; - this.disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - const multipleSelectionSupport = options.multipleSelectionSupport !== false; - const onKeyDown = _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].chain(Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(view.domNode, 'keydown')) - .filter(e => !isInputElement(e.target)) - .map(e => new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_8__["StandardKeyboardEvent"](e)); - onKeyDown.filter(e => e.keyCode === 3 /* Enter */).on(this.onEnter, this, this.disposables); - onKeyDown.filter(e => e.keyCode === 16 /* UpArrow */).on(this.onUpArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === 18 /* DownArrow */).on(this.onDownArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === 11 /* PageUp */).on(this.onPageUpArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === 12 /* PageDown */).on(this.onPageDownArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === 9 /* Escape */).on(this.onEscape, this, this.disposables); - if (multipleSelectionSupport) { - onKeyDown.filter(e => (_common_platform_js__WEBPACK_IMPORTED_MODULE_6__["isMacintosh"] ? e.metaKey : e.ctrlKey) && e.keyCode === 31 /* KEY_A */).on(this.onCtrlA, this, this.disposables); - } - } - onEnter(e) { - e.preventDefault(); - e.stopPropagation(); - this.list.setSelection(this.list.getFocus(), e.browserEvent); - } - onUpArrow(e) { - e.preventDefault(); - e.stopPropagation(); - this.list.focusPrevious(1, false, e.browserEvent); - this.list.reveal(this.list.getFocus()[0]); - this.view.domNode.focus(); - } - onDownArrow(e) { - e.preventDefault(); - e.stopPropagation(); - this.list.focusNext(1, false, e.browserEvent); - this.list.reveal(this.list.getFocus()[0]); - this.view.domNode.focus(); - } - onPageUpArrow(e) { - e.preventDefault(); - e.stopPropagation(); - this.list.focusPreviousPage(e.browserEvent); - this.list.reveal(this.list.getFocus()[0]); - this.view.domNode.focus(); - } - onPageDownArrow(e) { - e.preventDefault(); - e.stopPropagation(); - this.list.focusNextPage(e.browserEvent); - this.list.reveal(this.list.getFocus()[0]); - this.view.domNode.focus(); - } - onCtrlA(e) { - e.preventDefault(); - e.stopPropagation(); - this.list.setSelection(Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_3__["range"])(this.list.length), e.browserEvent); - this.view.domNode.focus(); - } - onEscape(e) { - e.preventDefault(); - e.stopPropagation(); - this.list.setSelection([], e.browserEvent); - this.view.domNode.focus(); - } - dispose() { - this.disposables.dispose(); - } -} -var TypeLabelControllerState; -(function (TypeLabelControllerState) { - TypeLabelControllerState[TypeLabelControllerState["Idle"] = 0] = "Idle"; - TypeLabelControllerState[TypeLabelControllerState["Typing"] = 1] = "Typing"; -})(TypeLabelControllerState || (TypeLabelControllerState = {})); -const DefaultKeyboardNavigationDelegate = new class { - mightProducePrintableCharacter(event) { - if (event.ctrlKey || event.metaKey || event.altKey) { - return false; - } - return (event.keyCode >= 31 /* KEY_A */ && event.keyCode <= 56 /* KEY_Z */) - || (event.keyCode >= 21 /* KEY_0 */ && event.keyCode <= 30 /* KEY_9 */) - || (event.keyCode >= 93 /* NUMPAD_0 */ && event.keyCode <= 102 /* NUMPAD_9 */) - || (event.keyCode >= 80 /* US_SEMICOLON */ && event.keyCode <= 90 /* US_QUOTE */); - } -}; -class TypeLabelController { - constructor(list, view, keyboardNavigationLabelProvider, delegate) { - this.list = list; - this.view = view; - this.keyboardNavigationLabelProvider = keyboardNavigationLabelProvider; - this.delegate = delegate; - this.enabled = false; - this.state = TypeLabelControllerState.Idle; - this.automaticKeyboardNavigation = true; - this.triggered = false; - this.previouslyFocused = -1; - this.enabledDisposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this.disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this.updateOptions(list.options); - } - updateOptions(options) { - const enableKeyboardNavigation = typeof options.enableKeyboardNavigation === 'undefined' ? true : !!options.enableKeyboardNavigation; - if (enableKeyboardNavigation) { - this.enable(); - } - else { - this.disable(); - } - if (typeof options.automaticKeyboardNavigation !== 'undefined') { - this.automaticKeyboardNavigation = options.automaticKeyboardNavigation; - } - } - enable() { - if (this.enabled) { - return; - } - const onChar = _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].chain(Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(this.view.domNode, 'keydown')) - .filter(e => !isInputElement(e.target)) - .filter(() => this.automaticKeyboardNavigation || this.triggered) - .map(event => new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_8__["StandardKeyboardEvent"](event)) - .filter(e => this.delegate.mightProducePrintableCharacter(e)) - .forEach(e => { e.stopPropagation(); e.preventDefault(); }) - .map(event => event.browserEvent.key) - .event; - const onClear = _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].debounce(onChar, () => null, 800); - const onInput = _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].reduce(_common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].any(onChar, onClear), (r, i) => i === null ? null : ((r || '') + i)); - onInput(this.onInput, this, this.enabledDisposables); - onClear(this.onClear, this, this.enabledDisposables); - this.enabled = true; - this.triggered = false; - } - disable() { - if (!this.enabled) { - return; - } - this.enabledDisposables.clear(); - this.enabled = false; - this.triggered = false; - } - onClear() { - var _a; - const focus = this.list.getFocus(); - if (focus.length > 0 && focus[0] === this.previouslyFocused) { - // List: re-anounce element on typing end since typed keys will interupt aria label of focused element - // Do not announce if there was a focus change at the end to prevent duplication https://github.com/microsoft/vscode/issues/95961 - const ariaLabel = (_a = this.list.options.accessibilityProvider) === null || _a === void 0 ? void 0 : _a.getAriaLabel(this.list.element(focus[0])); - if (ariaLabel) { - Object(_aria_aria_js__WEBPACK_IMPORTED_MODULE_18__["alert"])(ariaLabel); - } - } - this.previouslyFocused = -1; - } - onInput(word) { - if (!word) { - this.state = TypeLabelControllerState.Idle; - this.triggered = false; - return; - } - const focus = this.list.getFocus(); - const start = focus.length > 0 ? focus[0] : 0; - const delta = this.state === TypeLabelControllerState.Idle ? 1 : 0; - this.state = TypeLabelControllerState.Typing; - for (let i = 0; i < this.list.length; i++) { - const index = (start + i + delta) % this.list.length; - const label = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(index)); - const labelStr = label && label.toString(); - if (typeof labelStr === 'undefined' || Object(_common_filters_js__WEBPACK_IMPORTED_MODULE_17__["matchesPrefix"])(word, labelStr)) { - this.previouslyFocused = start; - this.list.setFocus([index]); - this.list.reveal(index); - return; - } - } - } - dispose() { - this.disable(); - this.enabledDisposables.dispose(); - this.disposables.dispose(); - } -} -class DOMFocusController { - constructor(list, view) { - this.list = list; - this.view = view; - this.disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - const onKeyDown = _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].chain(Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(view.domNode, 'keydown')) - .filter(e => !isInputElement(e.target)) - .map(e => new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_8__["StandardKeyboardEvent"](e)); - onKeyDown.filter(e => e.keyCode === 2 /* Tab */ && !e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey) - .on(this.onTab, this, this.disposables); - } - onTab(e) { - if (e.target !== this.view.domNode) { - return; - } - const focus = this.list.getFocus(); - if (focus.length === 0) { - return; - } - const focusedDomElement = this.view.domElement(focus[0]); - if (!focusedDomElement) { - return; - } - const tabIndexElement = focusedDomElement.querySelector('[tabIndex]'); - if (!tabIndexElement || !(tabIndexElement instanceof HTMLElement) || tabIndexElement.tabIndex === -1) { - return; - } - const style = window.getComputedStyle(tabIndexElement); - if (style.visibility === 'hidden' || style.display === 'none') { - return; - } - e.preventDefault(); - e.stopPropagation(); - tabIndexElement.focus(); - } - dispose() { - this.disposables.dispose(); - } -} -function isSelectionSingleChangeEvent(event) { - return _common_platform_js__WEBPACK_IMPORTED_MODULE_6__["isMacintosh"] ? event.browserEvent.metaKey : event.browserEvent.ctrlKey; -} -function isSelectionRangeChangeEvent(event) { - return event.browserEvent.shiftKey; -} -function isMouseRightClick(event) { - return event instanceof MouseEvent && event.button === 2; -} -const DefaultMultipleSelectionController = { - isSelectionSingleChangeEvent, - isSelectionRangeChangeEvent -}; -class MouseController { - constructor(list) { - this.list = list; - this.disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this._onPointer = new _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Emitter"](); - this.onPointer = this._onPointer.event; - this.multipleSelectionSupport = !(list.options.multipleSelectionSupport === false); - if (this.multipleSelectionSupport) { - this.multipleSelectionController = list.options.multipleSelectionController || DefaultMultipleSelectionController; - } - this.mouseSupport = typeof list.options.mouseSupport === 'undefined' || !!list.options.mouseSupport; - if (this.mouseSupport) { - list.onMouseDown(this.onMouseDown, this, this.disposables); - list.onContextMenu(this.onContextMenu, this, this.disposables); - list.onMouseDblClick(this.onDoubleClick, this, this.disposables); - list.onTouchStart(this.onMouseDown, this, this.disposables); - this.disposables.add(_touch_js__WEBPACK_IMPORTED_MODULE_7__["Gesture"].addTarget(list.getHTMLElement())); - } - _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].any(list.onMouseClick, list.onMouseMiddleClick, list.onTap)(this.onViewPointer, this, this.disposables); - } - isSelectionSingleChangeEvent(event) { - if (this.multipleSelectionController) { - return this.multipleSelectionController.isSelectionSingleChangeEvent(event); - } - return _common_platform_js__WEBPACK_IMPORTED_MODULE_6__["isMacintosh"] ? event.browserEvent.metaKey : event.browserEvent.ctrlKey; - } - isSelectionRangeChangeEvent(event) { - if (this.multipleSelectionController) { - return this.multipleSelectionController.isSelectionRangeChangeEvent(event); - } - return event.browserEvent.shiftKey; - } - isSelectionChangeEvent(event) { - return this.isSelectionSingleChangeEvent(event) || this.isSelectionRangeChangeEvent(event); - } - onMouseDown(e) { - if (isMonacoEditor(e.browserEvent.target)) { - return; - } - if (document.activeElement !== e.browserEvent.target) { - this.list.domFocus(); - } - } - onContextMenu(e) { - if (isMonacoEditor(e.browserEvent.target)) { - return; - } - const focus = typeof e.index === 'undefined' ? [] : [e.index]; - this.list.setFocus(focus, e.browserEvent); - } - onViewPointer(e) { - if (!this.mouseSupport) { - return; - } - if (isInputElement(e.browserEvent.target) || isMonacoEditor(e.browserEvent.target)) { - return; - } - let reference = this.list.getFocus()[0]; - const selection = this.list.getSelection(); - reference = reference === undefined ? selection[0] : reference; - const focus = e.index; - if (typeof focus === 'undefined') { - this.list.setFocus([], e.browserEvent); - this.list.setSelection([], e.browserEvent); - return; - } - if (this.multipleSelectionSupport && this.isSelectionRangeChangeEvent(e)) { - return this.changeSelection(e, reference); - } - if (this.multipleSelectionSupport && this.isSelectionChangeEvent(e)) { - return this.changeSelection(e, reference); - } - this.list.setFocus([focus], e.browserEvent); - if (!isMouseRightClick(e.browserEvent)) { - this.list.setSelection([focus], e.browserEvent); - } - this._onPointer.fire(e); - } - onDoubleClick(e) { - if (isInputElement(e.browserEvent.target) || isMonacoEditor(e.browserEvent.target)) { - return; - } - if (this.multipleSelectionSupport && this.isSelectionChangeEvent(e)) { - return; - } - const focus = this.list.getFocus(); - this.list.setSelection(focus, e.browserEvent); - } - changeSelection(e, reference) { - const focus = e.index; - if (this.isSelectionRangeChangeEvent(e) && reference !== undefined) { - const min = Math.min(reference, focus); - const max = Math.max(reference, focus); - const rangeSelection = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_3__["range"])(min, max + 1); - const selection = this.list.getSelection(); - const contiguousRange = getContiguousRangeContaining(disjunction(selection, [reference]), reference); - if (contiguousRange.length === 0) { - return; - } - const newSelection = disjunction(rangeSelection, relativeComplement(selection, contiguousRange)); - this.list.setSelection(newSelection, e.browserEvent); - } - else if (this.isSelectionSingleChangeEvent(e)) { - const selection = this.list.getSelection(); - const newSelection = selection.filter(i => i !== focus); - this.list.setFocus([focus]); - if (selection.length === newSelection.length) { - this.list.setSelection([...newSelection, focus], e.browserEvent); - } - else { - this.list.setSelection(newSelection, e.browserEvent); - } - } - } - dispose() { - this.disposables.dispose(); - } -} -class DefaultStyleController { - constructor(styleElement, selectorSuffix) { - this.styleElement = styleElement; - this.selectorSuffix = selectorSuffix; - } - style(styles) { - const suffix = this.selectorSuffix && `.${this.selectorSuffix}`; - const content = []; - if (styles.listBackground) { - if (styles.listBackground.isOpaque()) { - content.push(`.monaco-list${suffix} .monaco-list-rows { background: ${styles.listBackground}; }`); - } - else if (!_common_platform_js__WEBPACK_IMPORTED_MODULE_6__["isMacintosh"]) { // subpixel AA doesn't exist in macOS - console.warn(`List with id '${this.selectorSuffix}' was styled with a non-opaque background color. This will break sub-pixel antialiasing.`); - } - } - if (styles.listFocusBackground) { - content.push(`.monaco-list${suffix}:focus .monaco-list-row.focused { background-color: ${styles.listFocusBackground}; }`); - content.push(`.monaco-list${suffix}:focus .monaco-list-row.focused:hover { background-color: ${styles.listFocusBackground}; }`); // overwrite :hover style in this case! - } - if (styles.listFocusForeground) { - content.push(`.monaco-list${suffix}:focus .monaco-list-row.focused { color: ${styles.listFocusForeground}; }`); - } - if (styles.listActiveSelectionBackground) { - content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected { background-color: ${styles.listActiveSelectionBackground}; }`); - content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected:hover { background-color: ${styles.listActiveSelectionBackground}; }`); // overwrite :hover style in this case! - } - if (styles.listActiveSelectionForeground) { - content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected { color: ${styles.listActiveSelectionForeground}; }`); - } - if (styles.listFocusAndSelectionBackground) { - content.push(` - .monaco-drag-image, - .monaco-list${suffix}:focus .monaco-list-row.selected.focused { background-color: ${styles.listFocusAndSelectionBackground}; } - `); - } - if (styles.listFocusAndSelectionForeground) { - content.push(` - .monaco-drag-image, - .monaco-list${suffix}:focus .monaco-list-row.selected.focused { color: ${styles.listFocusAndSelectionForeground}; } - `); - } - if (styles.listInactiveFocusBackground) { - content.push(`.monaco-list${suffix} .monaco-list-row.focused { background-color: ${styles.listInactiveFocusBackground}; }`); - content.push(`.monaco-list${suffix} .monaco-list-row.focused:hover { background-color: ${styles.listInactiveFocusBackground}; }`); // overwrite :hover style in this case! - } - if (styles.listInactiveSelectionBackground) { - content.push(`.monaco-list${suffix} .monaco-list-row.selected { background-color: ${styles.listInactiveSelectionBackground}; }`); - content.push(`.monaco-list${suffix} .monaco-list-row.selected:hover { background-color: ${styles.listInactiveSelectionBackground}; }`); // overwrite :hover style in this case! - } - if (styles.listInactiveSelectionForeground) { - content.push(`.monaco-list${suffix} .monaco-list-row.selected { color: ${styles.listInactiveSelectionForeground}; }`); - } - if (styles.listHoverBackground) { - content.push(`.monaco-list${suffix}:not(.drop-target) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${styles.listHoverBackground}; }`); - } - if (styles.listHoverForeground) { - content.push(`.monaco-list${suffix} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${styles.listHoverForeground}; }`); - } - if (styles.listSelectionOutline) { - content.push(`.monaco-list${suffix} .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; outline-offset: -1px; }`); - } - if (styles.listFocusOutline) { - content.push(` - .monaco-drag-image, - .monaco-list${suffix}:focus .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; } - `); - } - if (styles.listInactiveFocusOutline) { - content.push(`.monaco-list${suffix} .monaco-list-row.focused { outline: 1px dotted ${styles.listInactiveFocusOutline}; outline-offset: -1px; }`); - } - if (styles.listHoverOutline) { - content.push(`.monaco-list${suffix} .monaco-list-row:hover { outline: 1px dashed ${styles.listHoverOutline}; outline-offset: -1px; }`); - } - if (styles.listDropBackground) { - content.push(` - .monaco-list${suffix}.drop-target, - .monaco-list${suffix} .monaco-list-rows.drop-target, - .monaco-list${suffix} .monaco-list-row.drop-target { background-color: ${styles.listDropBackground} !important; color: inherit !important; } - `); - } - if (styles.listFilterWidgetBackground) { - content.push(`.monaco-list-type-filter { background-color: ${styles.listFilterWidgetBackground} }`); - } - if (styles.listFilterWidgetOutline) { - content.push(`.monaco-list-type-filter { border: 1px solid ${styles.listFilterWidgetOutline}; }`); - } - if (styles.listFilterWidgetNoMatchesOutline) { - content.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${styles.listFilterWidgetNoMatchesOutline}; }`); - } - if (styles.listMatchesShadow) { - content.push(`.monaco-list-type-filter { box-shadow: 1px 1px 1px ${styles.listMatchesShadow}; }`); - } - const newStyles = content.join('\n'); - if (newStyles !== this.styleElement.innerHTML) { - this.styleElement.innerHTML = newStyles; - } - } -} -const defaultStyles = { - listFocusBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_13__["Color"].fromHex('#7FB0D0'), - listActiveSelectionBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_13__["Color"].fromHex('#0E639C'), - listActiveSelectionForeground: _common_color_js__WEBPACK_IMPORTED_MODULE_13__["Color"].fromHex('#FFFFFF'), - listFocusAndSelectionBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_13__["Color"].fromHex('#094771'), - listFocusAndSelectionForeground: _common_color_js__WEBPACK_IMPORTED_MODULE_13__["Color"].fromHex('#FFFFFF'), - listInactiveSelectionBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_13__["Color"].fromHex('#3F3F46'), - listHoverBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_13__["Color"].fromHex('#2A2D2E'), - listDropBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_13__["Color"].fromHex('#383B3D'), - treeIndentGuidesStroke: _common_color_js__WEBPACK_IMPORTED_MODULE_13__["Color"].fromHex('#a9a9a9') -}; -const DefaultOptions = { - keyboardSupport: true, - mouseSupport: true, - multipleSelectionSupport: true, - dnd: { - getDragURI() { return null; }, - onDragStart() { }, - onDragOver() { return false; }, - drop() { } - } -}; -// TODO@Joao: move these utils into a SortedArray class -function getContiguousRangeContaining(range, value) { - const index = range.indexOf(value); - if (index === -1) { - return []; - } - const result = []; - let i = index - 1; - while (i >= 0 && range[i] === value - (index - i)) { - result.push(range[i--]); - } - result.reverse(); - i = index; - while (i < range.length && range[i] === value + (i - index)) { - result.push(range[i++]); - } - return result; -} -/** - * Given two sorted collections of numbers, returns the intersection - * between them (OR). - */ -function disjunction(one, other) { - const result = []; - let i = 0, j = 0; - while (i < one.length || j < other.length) { - if (i >= one.length) { - result.push(other[j++]); - } - else if (j >= other.length) { - result.push(one[i++]); - } - else if (one[i] === other[j]) { - result.push(one[i]); - i++; - j++; - continue; - } - else if (one[i] < other[j]) { - result.push(one[i++]); - } - else { - result.push(other[j++]); - } - } - return result; -} -/** - * Given two sorted collections of numbers, returns the relative - * complement between them (XOR). - */ -function relativeComplement(one, other) { - const result = []; - let i = 0, j = 0; - while (i < one.length || j < other.length) { - if (i >= one.length) { - result.push(other[j++]); - } - else if (j >= other.length) { - result.push(one[i++]); - } - else if (one[i] === other[j]) { - i++; - j++; - continue; - } - else if (one[i] < other[j]) { - result.push(one[i++]); - } - else { - j++; - } - } - return result; -} -const numericSort = (a, b) => a - b; -class PipelineRenderer { - constructor(_templateId, renderers) { - this._templateId = _templateId; - this.renderers = renderers; - } - get templateId() { - return this._templateId; - } - renderTemplate(container) { - return this.renderers.map(r => r.renderTemplate(container)); - } - renderElement(element, index, templateData, height) { - let i = 0; - for (const renderer of this.renderers) { - renderer.renderElement(element, index, templateData[i++], height); - } - } - disposeElement(element, index, templateData, height) { - let i = 0; - for (const renderer of this.renderers) { - if (renderer.disposeElement) { - renderer.disposeElement(element, index, templateData[i], height); - } - i += 1; - } - } - disposeTemplate(templateData) { - let i = 0; - for (const renderer of this.renderers) { - renderer.disposeTemplate(templateData[i++]); - } - } -} -class AccessibiltyRenderer { - constructor(accessibilityProvider) { - this.accessibilityProvider = accessibilityProvider; - this.templateId = 'a18n'; - } - renderTemplate(container) { - return container; - } - renderElement(element, index, container) { - const ariaLabel = this.accessibilityProvider.getAriaLabel(element); - if (ariaLabel) { - container.setAttribute('aria-label', ariaLabel); - } - else { - container.removeAttribute('aria-label'); - } - const ariaLevel = this.accessibilityProvider.getAriaLevel && this.accessibilityProvider.getAriaLevel(element); - if (typeof ariaLevel === 'number') { - container.setAttribute('aria-level', `${ariaLevel}`); - } - else { - container.removeAttribute('aria-level'); - } - } - disposeTemplate(templateData) { - // noop - } -} -class ListViewDragAndDrop { - constructor(list, dnd) { - this.list = list; - this.dnd = dnd; - } - getDragElements(element) { - const selection = this.list.getSelectedElements(); - const elements = selection.indexOf(element) > -1 ? selection : [element]; - return elements; - } - getDragURI(element) { - return this.dnd.getDragURI(element); - } - getDragLabel(elements, originalEvent) { - if (this.dnd.getDragLabel) { - return this.dnd.getDragLabel(elements, originalEvent); - } - return undefined; - } - onDragStart(data, originalEvent) { - if (this.dnd.onDragStart) { - this.dnd.onDragStart(data, originalEvent); - } - } - onDragOver(data, targetElement, targetIndex, originalEvent) { - return this.dnd.onDragOver(data, targetElement, targetIndex, originalEvent); - } - onDragEnd(originalEvent) { - if (this.dnd.onDragEnd) { - this.dnd.onDragEnd(originalEvent); - } - } - drop(data, targetElement, targetIndex, originalEvent) { - this.dnd.drop(data, targetElement, targetIndex, originalEvent); - } -} -class List { - constructor(user, container, virtualDelegate, renderers, _options = DefaultOptions) { - var _a; - this.user = user; - this._options = _options; - this.eventBufferer = new _common_event_js__WEBPACK_IMPORTED_MODULE_9__["EventBufferer"](); - this._ariaLabel = ''; - this.disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this.didJustPressContextMenuKey = false; - this._onDidDispose = new _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Emitter"](); - this.onDidDispose = this._onDidDispose.event; - const role = this._options.accessibilityProvider && this._options.accessibilityProvider.getWidgetRole ? (_a = this._options.accessibilityProvider) === null || _a === void 0 ? void 0 : _a.getWidgetRole() : 'list'; - this.selection = new SelectionTrait(role !== 'listbox'); - this.focus = new Trait('focused'); - Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_14__["mixin"])(_options, defaultStyles, false); - const baseRenderers = [this.focus.renderer, this.selection.renderer]; - this.accessibilityProvider = _options.accessibilityProvider; - if (this.accessibilityProvider) { - baseRenderers.push(new AccessibiltyRenderer(this.accessibilityProvider)); - if (this.accessibilityProvider.onDidChangeActiveDescendant) { - this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant, this, this.disposables); - } - } - renderers = renderers.map(r => new PipelineRenderer(r.templateId, [...baseRenderers, r])); - const viewOptions = Object.assign(Object.assign({}, _options), { dnd: _options.dnd && new ListViewDragAndDrop(this, _options.dnd) }); - this.view = new _listView_js__WEBPACK_IMPORTED_MODULE_12__["ListView"](container, virtualDelegate, renderers, viewOptions); - this.view.domNode.setAttribute('role', role); - if (_options.styleController) { - this.styleController = _options.styleController(this.view.domId); - } - else { - const styleElement = _dom_js__WEBPACK_IMPORTED_MODULE_5__["createStyleSheet"](this.view.domNode); - this.styleController = new DefaultStyleController(styleElement, this.view.domId); - } - this.spliceable = new _splice_js__WEBPACK_IMPORTED_MODULE_15__["CombinedSpliceable"]([ - new TraitSpliceable(this.focus, this.view, _options.identityProvider), - new TraitSpliceable(this.selection, this.view, _options.identityProvider), - this.view - ]); - this.disposables.add(this.focus); - this.disposables.add(this.selection); - this.disposables.add(this.view); - this.disposables.add(this._onDidDispose); - this.onDidFocus = _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].map(Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(this.view.domNode, 'focus', true), () => null); - this.onDidBlur = _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].map(Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(this.view.domNode, 'blur', true), () => null); - this.disposables.add(new DOMFocusController(this, this.view)); - if (typeof _options.keyboardSupport !== 'boolean' || _options.keyboardSupport) { - const controller = new KeyboardController(this, this.view, _options); - this.disposables.add(controller); - } - if (_options.keyboardNavigationLabelProvider) { - const delegate = _options.keyboardNavigationDelegate || DefaultKeyboardNavigationDelegate; - this.typeLabelController = new TypeLabelController(this, this.view, _options.keyboardNavigationLabelProvider, delegate); - this.disposables.add(this.typeLabelController); - } - this.mouseController = this.createMouseController(_options); - this.disposables.add(this.mouseController); - this.onDidChangeFocus(this._onFocusChange, this, this.disposables); - this.onDidChangeSelection(this._onSelectionChange, this, this.disposables); - if (this.accessibilityProvider) { - this.ariaLabel = this.accessibilityProvider.getWidgetAriaLabel(); - } - if (_options.multipleSelectionSupport) { - this.view.domNode.setAttribute('aria-multiselectable', 'true'); - } - } - get onDidChangeFocus() { - return _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].map(this.eventBufferer.wrapEvent(this.focus.onChange), e => this.toListEvent(e)); - } - get onDidChangeSelection() { - return _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].map(this.eventBufferer.wrapEvent(this.selection.onChange), e => this.toListEvent(e)); - } - get domId() { return this.view.domId; } - get onMouseClick() { return this.view.onMouseClick; } - get onMouseDblClick() { return this.view.onMouseDblClick; } - get onMouseMiddleClick() { return this.view.onMouseMiddleClick; } - get onPointer() { return this.mouseController.onPointer; } - get onMouseDown() { return this.view.onMouseDown; } - get onTouchStart() { return this.view.onTouchStart; } - get onTap() { return this.view.onTap; } - get onContextMenu() { - const fromKeydown = _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].chain(Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(this.view.domNode, 'keydown')) - .map(e => new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_8__["StandardKeyboardEvent"](e)) - .filter(e => this.didJustPressContextMenuKey = e.keyCode === 58 /* ContextMenu */ || (e.shiftKey && e.keyCode === 68 /* F10 */)) - .filter(e => { e.preventDefault(); e.stopPropagation(); return false; }) - .event; - const fromKeyup = _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].chain(Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(this.view.domNode, 'keyup')) - .filter(() => { - const didJustPressContextMenuKey = this.didJustPressContextMenuKey; - this.didJustPressContextMenuKey = false; - return didJustPressContextMenuKey; - }) - .filter(() => this.getFocus().length > 0 && !!this.view.domElement(this.getFocus()[0])) - .map(browserEvent => { - const index = this.getFocus()[0]; - const element = this.view.element(index); - const anchor = this.view.domElement(index); - return { index, element, anchor, browserEvent }; - }) - .event; - const fromMouse = _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].chain(this.view.onContextMenu) - .filter(() => !this.didJustPressContextMenuKey) - .map(({ element, index, browserEvent }) => ({ element, index, anchor: { x: browserEvent.clientX + 1, y: browserEvent.clientY }, browserEvent })) - .event; - return _common_event_js__WEBPACK_IMPORTED_MODULE_9__["Event"].any(fromKeydown, fromKeyup, fromMouse); - } - get onKeyDown() { return Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(this.view.domNode, 'keydown'); } - createMouseController(options) { - return new MouseController(this); - } - updateOptions(optionsUpdate = {}) { - this._options = Object.assign(Object.assign({}, this._options), optionsUpdate); - if (this.typeLabelController) { - this.typeLabelController.updateOptions(this._options); - } - this.view.updateOptions(optionsUpdate); - } - get options() { - return this._options; - } - splice(start, deleteCount, elements = []) { - if (start < 0 || start > this.view.length) { - throw new _list_js__WEBPACK_IMPORTED_MODULE_11__["ListError"](this.user, `Invalid start index: ${start}`); - } - if (deleteCount < 0) { - throw new _list_js__WEBPACK_IMPORTED_MODULE_11__["ListError"](this.user, `Invalid delete count: ${deleteCount}`); - } - if (deleteCount === 0 && elements.length === 0) { - return; - } - this.eventBufferer.bufferEvents(() => this.spliceable.splice(start, deleteCount, elements)); - } - rerender() { - this.view.rerender(); - } - element(index) { - return this.view.element(index); - } - get length() { - return this.view.length; - } - get contentHeight() { - return this.view.contentHeight; - } - get scrollTop() { - return this.view.getScrollTop(); - } - set scrollTop(scrollTop) { - this.view.setScrollTop(scrollTop); - } - get ariaLabel() { - return this._ariaLabel; - } - set ariaLabel(value) { - this._ariaLabel = value; - this.view.domNode.setAttribute('aria-label', value); - } - domFocus() { - this.view.domNode.focus(); - } - layout(height, width) { - this.view.layout(height, width); - } - setSelection(indexes, browserEvent) { - for (const index of indexes) { - if (index < 0 || index >= this.length) { - throw new _list_js__WEBPACK_IMPORTED_MODULE_11__["ListError"](this.user, `Invalid index ${index}`); - } - } - this.selection.set(indexes, browserEvent); - } - getSelection() { - return this.selection.get(); - } - getSelectedElements() { - return this.getSelection().map(i => this.view.element(i)); - } - setFocus(indexes, browserEvent) { - for (const index of indexes) { - if (index < 0 || index >= this.length) { - throw new _list_js__WEBPACK_IMPORTED_MODULE_11__["ListError"](this.user, `Invalid index ${index}`); - } - } - this.focus.set(indexes, browserEvent); - } - focusNext(n = 1, loop = false, browserEvent, filter) { - if (this.length === 0) { - return; - } - const focus = this.focus.get(); - const index = this.findNextIndex(focus.length > 0 ? focus[0] + n : 0, loop, filter); - if (index > -1) { - this.setFocus([index], browserEvent); - } - } - focusPrevious(n = 1, loop = false, browserEvent, filter) { - if (this.length === 0) { - return; - } - const focus = this.focus.get(); - const index = this.findPreviousIndex(focus.length > 0 ? focus[0] - n : 0, loop, filter); - if (index > -1) { - this.setFocus([index], browserEvent); - } - } - focusNextPage(browserEvent, filter) { - let lastPageIndex = this.view.indexAt(this.view.getScrollTop() + this.view.renderHeight); - lastPageIndex = lastPageIndex === 0 ? 0 : lastPageIndex - 1; - const lastPageElement = this.view.element(lastPageIndex); - const currentlyFocusedElement = this.getFocusedElements()[0]; - if (currentlyFocusedElement !== lastPageElement) { - const lastGoodPageIndex = this.findPreviousIndex(lastPageIndex, false, filter); - if (lastGoodPageIndex > -1 && currentlyFocusedElement !== this.view.element(lastGoodPageIndex)) { - this.setFocus([lastGoodPageIndex], browserEvent); - } - else { - this.setFocus([lastPageIndex], browserEvent); - } - } - else { - const previousScrollTop = this.view.getScrollTop(); - this.view.setScrollTop(previousScrollTop + this.view.renderHeight - this.view.elementHeight(lastPageIndex)); - if (this.view.getScrollTop() !== previousScrollTop) { - // Let the scroll event listener run - setTimeout(() => this.focusNextPage(browserEvent, filter), 0); - } - } - } - focusPreviousPage(browserEvent, filter) { - let firstPageIndex; - const scrollTop = this.view.getScrollTop(); - if (scrollTop === 0) { - firstPageIndex = this.view.indexAt(scrollTop); - } - else { - firstPageIndex = this.view.indexAfter(scrollTop - 1); - } - const firstPageElement = this.view.element(firstPageIndex); - const currentlyFocusedElement = this.getFocusedElements()[0]; - if (currentlyFocusedElement !== firstPageElement) { - const firstGoodPageIndex = this.findNextIndex(firstPageIndex, false, filter); - if (firstGoodPageIndex > -1 && currentlyFocusedElement !== this.view.element(firstGoodPageIndex)) { - this.setFocus([firstGoodPageIndex], browserEvent); - } - else { - this.setFocus([firstPageIndex], browserEvent); - } - } - else { - const previousScrollTop = scrollTop; - this.view.setScrollTop(scrollTop - this.view.renderHeight); - if (this.view.getScrollTop() !== previousScrollTop) { - // Let the scroll event listener run - setTimeout(() => this.focusPreviousPage(browserEvent, filter), 0); - } - } - } - focusLast(browserEvent, filter) { - if (this.length === 0) { - return; - } - const index = this.findPreviousIndex(this.length - 1, false, filter); - if (index > -1) { - this.setFocus([index], browserEvent); - } - } - focusFirst(browserEvent, filter) { - this.focusNth(0, browserEvent, filter); - } - focusNth(n, browserEvent, filter) { - if (this.length === 0) { - return; - } - const index = this.findNextIndex(n, false, filter); - if (index > -1) { - this.setFocus([index], browserEvent); - } - } - findNextIndex(index, loop = false, filter) { - for (let i = 0; i < this.length; i++) { - if (index >= this.length && !loop) { - return -1; - } - index = index % this.length; - if (!filter || filter(this.element(index))) { - return index; - } - index++; - } - return -1; - } - findPreviousIndex(index, loop = false, filter) { - for (let i = 0; i < this.length; i++) { - if (index < 0 && !loop) { - return -1; - } - index = (this.length + (index % this.length)) % this.length; - if (!filter || filter(this.element(index))) { - return index; - } - index--; - } - return -1; - } - getFocus() { - return this.focus.get(); - } - getFocusedElements() { - return this.getFocus().map(i => this.view.element(i)); - } - reveal(index, relativeTop) { - if (index < 0 || index >= this.length) { - throw new _list_js__WEBPACK_IMPORTED_MODULE_11__["ListError"](this.user, `Invalid index ${index}`); - } - const scrollTop = this.view.getScrollTop(); - const elementTop = this.view.elementTop(index); - const elementHeight = this.view.elementHeight(index); - if (Object(_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isNumber"])(relativeTop)) { - // y = mx + b - const m = elementHeight - this.view.renderHeight; - this.view.setScrollTop(m * Object(_common_numbers_js__WEBPACK_IMPORTED_MODULE_16__["clamp"])(relativeTop, 0, 1) + elementTop); - } - else { - const viewItemBottom = elementTop + elementHeight; - const wrapperBottom = scrollTop + this.view.renderHeight; - if (elementTop < scrollTop && viewItemBottom >= wrapperBottom) { - // The element is already overflowing the viewport, no-op - } - else if (elementTop < scrollTop) { - this.view.setScrollTop(elementTop); - } - else if (viewItemBottom >= wrapperBottom) { - this.view.setScrollTop(viewItemBottom - this.view.renderHeight); - } - } - } - /** - * Returns the relative position of an element rendered in the list. - * Returns `null` if the element isn't *entirely* in the visible viewport. - */ - getRelativeTop(index) { - if (index < 0 || index >= this.length) { - throw new _list_js__WEBPACK_IMPORTED_MODULE_11__["ListError"](this.user, `Invalid index ${index}`); - } - const scrollTop = this.view.getScrollTop(); - const elementTop = this.view.elementTop(index); - const elementHeight = this.view.elementHeight(index); - if (elementTop < scrollTop || elementTop + elementHeight > scrollTop + this.view.renderHeight) { - return null; - } - // y = mx + b - const m = elementHeight - this.view.renderHeight; - return Math.abs((scrollTop - elementTop) / m); - } - getHTMLElement() { - return this.view.domNode; - } - style(styles) { - this.styleController.style(styles); - } - toListEvent({ indexes, browserEvent }) { - return { indexes, elements: indexes.map(i => this.view.element(i)), browserEvent }; - } - _onFocusChange() { - const focus = this.focus.get(); - _dom_js__WEBPACK_IMPORTED_MODULE_5__["toggleClass"](this.view.domNode, 'element-focused', focus.length > 0); - this.onDidChangeActiveDescendant(); - } - onDidChangeActiveDescendant() { - var _a; - const focus = this.focus.get(); - if (focus.length > 0) { - let id; - if ((_a = this.accessibilityProvider) === null || _a === void 0 ? void 0 : _a.getActiveDescendantId) { - id = this.accessibilityProvider.getActiveDescendantId(this.view.element(focus[0])); - } - this.view.domNode.setAttribute('aria-activedescendant', id || this.view.getElementDomId(focus[0])); - } - else { - this.view.domNode.removeAttribute('aria-activedescendant'); - } - } - _onSelectionChange() { - const selection = this.selection.get(); - _dom_js__WEBPACK_IMPORTED_MODULE_5__["toggleClass"](this.view.domNode, 'selection-none', selection.length === 0); - _dom_js__WEBPACK_IMPORTED_MODULE_5__["toggleClass"](this.view.domNode, 'selection-single', selection.length === 1); - _dom_js__WEBPACK_IMPORTED_MODULE_5__["toggleClass"](this.view.domNode, 'selection-multiple', selection.length > 1); - } - dispose() { - this._onDidDispose.fire(); - this.disposables.dispose(); - this._onDidDispose.dispose(); - } -} -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_4__["memoize"] -], List.prototype, "onDidChangeFocus", null); -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_4__["memoize"] -], List.prototype, "onDidChangeSelection", null); -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_4__["memoize"] -], List.prototype, "onContextMenu", null); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/rangeMap.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/list/rangeMap.js ***! - \****************************************************************************/ -/*! exports provided: groupIntersect, shift, consolidate, RangeMap */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupIntersect", function() { return groupIntersect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shift", function() { return shift; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "consolidate", function() { return consolidate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RangeMap", function() { return RangeMap; }); -/* harmony import */ var _common_range_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../common/range.js */ "./node_modules/monaco-editor/esm/vs/base/common/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * Returns the intersection between a ranged group and a range. - * Returns `[]` if the intersection is empty. - */ -function groupIntersect(range, groups) { - const result = []; - for (let r of groups) { - if (range.start >= r.range.end) { - continue; - } - if (range.end < r.range.start) { - break; - } - const intersection = _common_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"].intersect(range, r.range); - if (_common_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"].isEmpty(intersection)) { - continue; - } - result.push({ - range: intersection, - size: r.size - }); - } - return result; -} -/** - * Shifts a range by that `much`. - */ -function shift({ start, end }, much) { - return { start: start + much, end: end + much }; -} -/** - * Consolidates a collection of ranged groups. - * - * Consolidation is the process of merging consecutive ranged groups - * that share the same `size`. - */ -function consolidate(groups) { - const result = []; - let previousGroup = null; - for (let group of groups) { - const start = group.range.start; - const end = group.range.end; - const size = group.size; - if (previousGroup && size === previousGroup.size) { - previousGroup.range.end = end; - continue; - } - previousGroup = { range: { start, end }, size }; - result.push(previousGroup); - } - return result; -} -/** - * Concatenates several collections of ranged groups into a single - * collection. - */ -function concat(...groups) { - return consolidate(groups.reduce((r, g) => r.concat(g), [])); -} -class RangeMap { - constructor() { - this.groups = []; - this._size = 0; - } - splice(index, deleteCount, items = []) { - const diff = items.length - deleteCount; - const before = groupIntersect({ start: 0, end: index }, this.groups); - const after = groupIntersect({ start: index + deleteCount, end: Number.POSITIVE_INFINITY }, this.groups) - .map(g => ({ range: shift(g.range, diff), size: g.size })); - const middle = items.map((item, i) => ({ - range: { start: index + i, end: index + i + 1 }, - size: item.size - })); - this.groups = concat(before, middle, after); - this._size = this.groups.reduce((t, g) => t + (g.size * (g.range.end - g.range.start)), 0); - } - /** - * Returns the number of items in the range map. - */ - get count() { - const len = this.groups.length; - if (!len) { - return 0; - } - return this.groups[len - 1].range.end; - } - /** - * Returns the sum of the sizes of all items in the range map. - */ - get size() { - return this._size; - } - /** - * Returns the index of the item at the given position. - */ - indexAt(position) { - if (position < 0) { - return -1; - } - let index = 0; - let size = 0; - for (let group of this.groups) { - const count = group.range.end - group.range.start; - const newSize = size + (count * group.size); - if (position < newSize) { - return index + Math.floor((position - size) / group.size); - } - index += count; - size = newSize; - } - return index; - } - /** - * Returns the index of the item right after the item at the - * index of the given position. - */ - indexAfter(position) { - return Math.min(this.indexAt(position) + 1, this.count); - } - /** - * Returns the start position of the item at the given index. - */ - positionAt(index) { - if (index < 0) { - return -1; - } - let position = 0; - let count = 0; - for (let group of this.groups) { - const groupCount = group.range.end - group.range.start; - const newCount = count + groupCount; - if (index < newCount) { - return position + ((index - count) * group.size); - } - position += groupCount * group.size; - count = newCount; - } - return -1; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/rowCache.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/list/rowCache.js ***! - \****************************************************************************/ -/*! exports provided: RowCache */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowCache", function() { return RowCache; }); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -function removeFromParent(element) { - try { - if (element.parentElement) { - element.parentElement.removeChild(element); - } - } - catch (e) { - // this will throw if this happens due to a blur event, nasty business - } -} -class RowCache { - constructor(renderers) { - this.renderers = renderers; - this.cache = new Map(); - } - /** - * Returns a row either by creating a new one or reusing - * a previously released row which shares the same templateId. - */ - alloc(templateId) { - let result = this.getTemplateCache(templateId).pop(); - if (!result) { - const domNode = Object(_dom_js__WEBPACK_IMPORTED_MODULE_0__["$"])('.monaco-list-row'); - const renderer = this.getRenderer(templateId); - const templateData = renderer.renderTemplate(domNode); - result = { domNode, templateId, templateData }; - } - return result; - } - /** - * Releases the row for eventual reuse. - */ - release(row) { - if (!row) { - return; - } - this.releaseRow(row); - } - releaseRow(row) { - const { domNode, templateId } = row; - if (domNode) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_0__["removeClass"])(domNode, 'scrolling'); - removeFromParent(domNode); - } - const cache = this.getTemplateCache(templateId); - cache.push(row); - } - getTemplateCache(templateId) { - let result = this.cache.get(templateId); - if (!result) { - result = []; - this.cache.set(templateId, result); - } - return result; - } - dispose() { - this.cache.forEach((cachedRows, templateId) => { - for (const cachedRow of cachedRows) { - const renderer = this.getRenderer(templateId); - renderer.disposeTemplate(cachedRow.templateData); - cachedRow.domNode = null; - cachedRow.templateData = null; - } - }); - this.cache.clear(); - } - getRenderer(templateId) { - const renderer = this.renderers.get(templateId); - if (!renderer) { - throw new Error(`No renderer found for ${templateId}`); - } - return renderer; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/splice.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/list/splice.js ***! - \**************************************************************************/ -/*! exports provided: CombinedSpliceable */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CombinedSpliceable", function() { return CombinedSpliceable; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class CombinedSpliceable { - constructor(spliceables) { - this.spliceables = spliceables; - } - splice(start, deleteCount, elements) { - this.spliceables.forEach(s => s.splice(start, deleteCount, elements)); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/menu/menu.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/menu/menu.js ***! - \************************************************************************/ -/*! exports provided: MENU_MNEMONIC_REGEX, MENU_ESCAPED_MNEMONIC_REGEX, Direction, Menu, cleanMnemonic */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MENU_MNEMONIC_REGEX", function() { return MENU_MNEMONIC_REGEX; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MENU_ESCAPED_MNEMONIC_REGEX", function() { return MENU_ESCAPED_MNEMONIC_REGEX; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Direction", function() { return Direction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Menu", function() { return Menu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanMnemonic", function() { return cleanMnemonic; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _common_actions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../actionbar/actionbar.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../keyboardEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js"); -/* harmony import */ var _common_async_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../scrollbar/scrollableElement.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js"); -/* harmony import */ var _contextview_contextview_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../contextview/contextview.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/contextview/contextview.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _common_codicons_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/* harmony import */ var _actionbar_actionViewItems_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../actionbar/actionViewItems.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js"); -/* harmony import */ var _codicons_codiconStyles_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../codicons/codiconStyles.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codiconStyles.js"); -/* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _mouseEvent_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - -const MENU_MNEMONIC_REGEX = /\(&([^\s&])\)|(^|[^&])&([^\s&])/; -const MENU_ESCAPED_MNEMONIC_REGEX = /(&)?(&)([^\s&])/g; -const menuSelectionIcon = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_11__["registerIcon"])('menu-selection', _common_codicons_js__WEBPACK_IMPORTED_MODULE_11__["Codicon"].check); -const menuSubmenuIcon = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_11__["registerIcon"])('menu-submenu', _common_codicons_js__WEBPACK_IMPORTED_MODULE_11__["Codicon"].chevronRight); -var Direction; -(function (Direction) { - Direction[Direction["Right"] = 0] = "Right"; - Direction[Direction["Left"] = 1] = "Left"; -})(Direction || (Direction = {})); -class Menu extends _actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_3__["ActionBar"] { - constructor(container, actions, options = {}) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"])(container, 'monaco-menu-container'); - container.setAttribute('role', 'presentation'); - const menuElement = document.createElement('div'); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"])(menuElement, 'monaco-menu'); - menuElement.setAttribute('role', 'presentation'); - super(menuElement, { - orientation: 2 /* VERTICAL */, - actionViewItemProvider: action => this.doGetActionViewItem(action, options, parentData), - context: options.context, - actionRunner: options.actionRunner, - ariaLabel: options.ariaLabel, - triggerKeys: { keys: [3 /* Enter */, ...(_common_platform_js__WEBPACK_IMPORTED_MODULE_10__["isMacintosh"] || _common_platform_js__WEBPACK_IMPORTED_MODULE_10__["isLinux"] ? [10 /* Space */] : [])], keyDown: true } - }); - this.menuElement = menuElement; - this.actionsList.setAttribute('role', 'menu'); - this.actionsList.tabIndex = 0; - this.menuDisposables = this._register(new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["DisposableStore"]()); - this.initializeStyleSheet(container); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(menuElement, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].KEY_DOWN, (e) => { - const event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__["StandardKeyboardEvent"](e); - // Stop tab navigation of menus - if (event.equals(2 /* Tab */)) { - e.preventDefault(); - } - }); - if (options.enableMnemonics) { - this.menuDisposables.add(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(menuElement, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].KEY_DOWN, (e) => { - const key = e.key.toLocaleLowerCase(); - if (this.mnemonics.has(key)) { - _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventHelper"].stop(e, true); - const actions = this.mnemonics.get(key); - if (actions.length === 1) { - if (actions[0] instanceof SubmenuMenuActionViewItem && actions[0].container) { - this.focusItemByElement(actions[0].container); - } - actions[0].onClick(e); - } - if (actions.length > 1) { - const action = actions.shift(); - if (action && action.container) { - this.focusItemByElement(action.container); - actions.push(action); - } - this.mnemonics.set(key, actions); - } - } - })); - } - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_10__["isLinux"]) { - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(menuElement, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].KEY_DOWN, e => { - const event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__["StandardKeyboardEvent"](e); - if (event.equals(14 /* Home */) || event.equals(11 /* PageUp */)) { - this.focusedItem = this.viewItems.length - 1; - this.focusNext(); - _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventHelper"].stop(e, true); - } - else if (event.equals(13 /* End */) || event.equals(12 /* PageDown */)) { - this.focusedItem = 0; - this.focusPrevious(); - _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventHelper"].stop(e, true); - } - })); - } - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(this.domNode, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].MOUSE_OUT, e => { - let relatedTarget = e.relatedTarget; - if (!Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["isAncestor"])(relatedTarget, this.domNode)) { - this.focusedItem = undefined; - this.updateFocus(); - e.stopPropagation(); - } - })); - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(this.actionsList, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].MOUSE_OVER, e => { - let target = e.target; - if (!target || !Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["isAncestor"])(target, this.actionsList) || target === this.actionsList) { - return; - } - while (target.parentElement !== this.actionsList && target.parentElement !== null) { - target = target.parentElement; - } - if (Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["hasClass"])(target, 'action-item')) { - const lastFocusedItem = this.focusedItem; - this.setFocusedItem(target); - if (lastFocusedItem !== this.focusedItem) { - this.updateFocus(); - } - } - })); - let parentData = { - parent: this - }; - this.mnemonics = new Map(); - // Scroll Logic - this.scrollableElement = this._register(new _scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_8__["DomScrollableElement"](menuElement, { - alwaysConsumeMouseWheel: true, - horizontal: 2 /* Hidden */, - vertical: 3 /* Visible */, - verticalScrollbarSize: 7, - handleMouseWheel: true, - useShadows: true - })); - const scrollElement = this.scrollableElement.getDomNode(); - scrollElement.style.position = ''; - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(scrollElement, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].MOUSE_UP, e => { - // Absorb clicks in menu dead space https://github.com/Microsoft/vscode/issues/63575 - // We do this on the scroll element so the scroll bar doesn't dismiss the menu either - e.preventDefault(); - })); - menuElement.style.maxHeight = `${Math.max(10, window.innerHeight - container.getBoundingClientRect().top - 35)}px`; - actions = actions.filter(a => { - var _a; - if ((_a = options.submenuIds) === null || _a === void 0 ? void 0 : _a.has(a.id)) { - console.warn(`Found submenu cycle: ${a.id}`); - return false; - } - return true; - }); - this.push(actions, { icon: true, label: true, isMenu: true }); - container.appendChild(this.scrollableElement.getDomNode()); - this.scrollableElement.scanDomNode(); - this.viewItems.filter(item => !(item instanceof MenuSeparatorActionViewItem)).forEach((item, index, array) => { - item.updatePositionInSet(index + 1, array.length); - }); - } - initializeStyleSheet(container) { - if (Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["isInShadowDOM"])(container)) { - this.styleSheet = Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["createStyleSheet"])(container); - this.styleSheet.innerHTML = MENU_WIDGET_CSS; - } - else { - if (!Menu.globalStyleSheet) { - Menu.globalStyleSheet = Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["createStyleSheet"])(); - Menu.globalStyleSheet.innerHTML = MENU_WIDGET_CSS; - } - this.styleSheet = Menu.globalStyleSheet; - } - } - style(style) { - const container = this.getContainer(); - const fgColor = style.foregroundColor ? `${style.foregroundColor}` : ''; - const bgColor = style.backgroundColor ? `${style.backgroundColor}` : ''; - const border = style.borderColor ? `1px solid ${style.borderColor}` : ''; - const shadow = style.shadowColor ? `0 2px 4px ${style.shadowColor}` : ''; - container.style.border = border; - this.domNode.style.color = fgColor; - this.domNode.style.backgroundColor = bgColor; - container.style.boxShadow = shadow; - if (this.viewItems) { - this.viewItems.forEach(item => { - if (item instanceof BaseMenuActionViewItem || item instanceof MenuSeparatorActionViewItem) { - item.style(style); - } - }); - } - } - getContainer() { - return this.scrollableElement.getDomNode(); - } - get onScroll() { - return this.scrollableElement.onScroll; - } - focusItemByElement(element) { - const lastFocusedItem = this.focusedItem; - this.setFocusedItem(element); - if (lastFocusedItem !== this.focusedItem) { - this.updateFocus(); - } - } - setFocusedItem(element) { - for (let i = 0; i < this.actionsList.children.length; i++) { - let elem = this.actionsList.children[i]; - if (element === elem) { - this.focusedItem = i; - break; - } - } - } - updateFocus(fromRight) { - super.updateFocus(fromRight, true); - if (typeof this.focusedItem !== 'undefined') { - // Workaround for #80047 caused by an issue in chromium - // https://bugs.chromium.org/p/chromium/issues/detail?id=414283 - // When that's fixed, just call this.scrollableElement.scanDomNode() - this.scrollableElement.setScrollPosition({ - scrollTop: Math.round(this.menuElement.scrollTop) - }); - } - } - doGetActionViewItem(action, options, parentData) { - if (action instanceof _common_actions_js__WEBPACK_IMPORTED_MODULE_2__["Separator"]) { - return new MenuSeparatorActionViewItem(options.context, action, { icon: true }); - } - else if (action instanceof _common_actions_js__WEBPACK_IMPORTED_MODULE_2__["SubmenuAction"]) { - const menuActionViewItem = new SubmenuMenuActionViewItem(action, action.actions, parentData, Object.assign(Object.assign({}, options), { submenuIds: new Set([...(options.submenuIds || []), action.id]) })); - if (options.enableMnemonics) { - const mnemonic = menuActionViewItem.getMnemonic(); - if (mnemonic && menuActionViewItem.isEnabled()) { - let actionViewItems = []; - if (this.mnemonics.has(mnemonic)) { - actionViewItems = this.mnemonics.get(mnemonic); - } - actionViewItems.push(menuActionViewItem); - this.mnemonics.set(mnemonic, actionViewItems); - } - } - return menuActionViewItem; - } - else { - const menuItemOptions = { enableMnemonics: options.enableMnemonics, useEventAsContext: options.useEventAsContext }; - if (options.getKeyBinding) { - const keybinding = options.getKeyBinding(action); - if (keybinding) { - const keybindingLabel = keybinding.getLabel(); - if (keybindingLabel) { - menuItemOptions.keybinding = keybindingLabel; - } - } - } - const menuActionViewItem = new BaseMenuActionViewItem(options.context, action, menuItemOptions); - if (options.enableMnemonics) { - const mnemonic = menuActionViewItem.getMnemonic(); - if (mnemonic && menuActionViewItem.isEnabled()) { - let actionViewItems = []; - if (this.mnemonics.has(mnemonic)) { - actionViewItems = this.mnemonics.get(mnemonic); - } - actionViewItems.push(menuActionViewItem); - this.mnemonics.set(mnemonic, actionViewItems); - } - } - return menuActionViewItem; - } - } -} -class BaseMenuActionViewItem extends _actionbar_actionViewItems_js__WEBPACK_IMPORTED_MODULE_12__["BaseActionViewItem"] { - constructor(ctx, action, options = {}) { - options.isMenu = true; - super(action, action, options); - this.options = options; - this.options.icon = options.icon !== undefined ? options.icon : false; - this.options.label = options.label !== undefined ? options.label : true; - this.cssClass = ''; - // Set mnemonic - if (this.options.label && options.enableMnemonics) { - let label = this.getAction().label; - if (label) { - let matches = MENU_MNEMONIC_REGEX.exec(label); - if (matches) { - this.mnemonic = (!!matches[1] ? matches[1] : matches[3]).toLocaleLowerCase(); - } - } - } - // Add mouse up listener later to avoid accidental clicks - this.runOnceToEnableMouseUp = new _common_async_js__WEBPACK_IMPORTED_MODULE_6__["RunOnceScheduler"](() => { - if (!this.element) { - return; - } - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(this.element, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].MOUSE_UP, e => { - // removed default prevention as it conflicts - // with BaseActionViewItem #101537 - // add back if issues arise and link new issue - _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventHelper"].stop(e, true); - // See https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Interact_with_the_clipboard - // > Writing to the clipboard - // > You can use the "cut" and "copy" commands without any special - // permission if you are using them in a short-lived event handler - // for a user action (for example, a click handler). - // => to get the Copy and Paste context menu actions working on Firefox, - // there should be no timeout here - if (_browser_js__WEBPACK_IMPORTED_MODULE_14__["isFirefox"]) { - const mouseEvent = new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_15__["StandardMouseEvent"](e); - // Allowing right click to trigger the event causes the issue described below, - // but since the solution below does not work in FF, we must disable right click - if (mouseEvent.rightButton) { - return; - } - this.onClick(e); - } - // In all other cases, set timout to allow context menu cancellation to trigger - // otherwise the action will destroy the menu and a second context menu - // will still trigger for right click. - setTimeout(() => { - this.onClick(e); - }, 0); - })); - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(this.element, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].CONTEXT_MENU, e => { - _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventHelper"].stop(e, true); - })); - }, 100); - this._register(this.runOnceToEnableMouseUp); - } - render(container) { - super.render(container); - if (!this.element) { - return; - } - this.container = container; - this.item = Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["append"])(this.element, Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["$"])('a.action-menu-item')); - if (this._action.id === _common_actions_js__WEBPACK_IMPORTED_MODULE_2__["Separator"].ID) { - // A separator is a presentation item - this.item.setAttribute('role', 'presentation'); - } - else { - this.item.setAttribute('role', 'menuitem'); - if (this.mnemonic) { - this.item.setAttribute('aria-keyshortcuts', `${this.mnemonic}`); - } - } - this.check = Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["append"])(this.item, Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["$"])('span.menu-item-check' + menuSelectionIcon.cssSelector)); - this.check.setAttribute('role', 'none'); - this.label = Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["append"])(this.item, Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["$"])('span.action-label')); - if (this.options.label && this.options.keybinding) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["append"])(this.item, Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["$"])('span.keybinding')).textContent = this.options.keybinding; - } - // Adds mouse up listener to actually run the action - this.runOnceToEnableMouseUp.schedule(); - this.updateClass(); - this.updateLabel(); - this.updateTooltip(); - this.updateEnabled(); - this.updateChecked(); - } - blur() { - super.blur(); - this.applyStyle(); - } - focus() { - super.focus(); - if (this.item) { - this.item.focus(); - } - this.applyStyle(); - } - updatePositionInSet(pos, setSize) { - if (this.item) { - this.item.setAttribute('aria-posinset', `${pos}`); - this.item.setAttribute('aria-setsize', `${setSize}`); - } - } - updateLabel() { - if (!this.label) { - return; - } - if (this.options.label) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["clearNode"])(this.label); - let label = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_11__["stripCodicons"])(this.getAction().label); - if (label) { - const cleanLabel = cleanMnemonic(label); - if (!this.options.enableMnemonics) { - label = cleanLabel; - } - this.label.setAttribute('aria-label', cleanLabel.replace(/&&/g, '&')); - const matches = MENU_MNEMONIC_REGEX.exec(label); - if (matches) { - label = _common_strings_js__WEBPACK_IMPORTED_MODULE_1__["escape"](label); - // This is global, reset it - MENU_ESCAPED_MNEMONIC_REGEX.lastIndex = 0; - let escMatch = MENU_ESCAPED_MNEMONIC_REGEX.exec(label); - // We can't use negative lookbehind so if we match our negative and skip - while (escMatch && escMatch[1]) { - escMatch = MENU_ESCAPED_MNEMONIC_REGEX.exec(label); - } - const replaceDoubleEscapes = (str) => str.replace(/&&/g, '&'); - if (escMatch) { - this.label.append(_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["ltrim"](replaceDoubleEscapes(label.substr(0, escMatch.index)), ' '), Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["$"])('u', { 'aria-hidden': 'true' }, escMatch[3]), _common_strings_js__WEBPACK_IMPORTED_MODULE_1__["rtrim"](replaceDoubleEscapes(label.substr(escMatch.index + escMatch[0].length)), ' ')); - } - else { - this.label.innerText = replaceDoubleEscapes(label).trim(); - } - if (this.item) { - this.item.setAttribute('aria-keyshortcuts', (!!matches[1] ? matches[1] : matches[3]).toLocaleLowerCase()); - } - } - else { - this.label.innerText = label.replace(/&&/g, '&').trim(); - } - } - } - } - updateTooltip() { - let title = null; - if (this.getAction().tooltip) { - title = this.getAction().tooltip; - } - else if (!this.options.label && this.getAction().label && this.options.icon) { - title = this.getAction().label; - if (this.options.keybinding) { - title = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'titleLabel', comment: ['action title', 'action keybinding'] }, "{0} ({1})", title, this.options.keybinding); - } - } - if (title && this.item) { - this.item.title = title; - } - } - updateClass() { - if (this.cssClass && this.item) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["removeClasses"])(this.item, this.cssClass); - } - if (this.options.icon && this.label) { - this.cssClass = this.getAction().class || ''; - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"])(this.label, 'icon'); - if (this.cssClass) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClasses"])(this.label, this.cssClass); - } - this.updateEnabled(); - } - else if (this.label) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["removeClass"])(this.label, 'icon'); - } - } - updateEnabled() { - if (this.getAction().enabled) { - if (this.element) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["removeClass"])(this.element, 'disabled'); - } - if (this.item) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["removeClass"])(this.item, 'disabled'); - this.item.tabIndex = 0; - } - } - else { - if (this.element) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"])(this.element, 'disabled'); - } - if (this.item) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"])(this.item, 'disabled'); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["removeTabIndexAndUpdateFocus"])(this.item); - } - } - } - updateChecked() { - if (!this.item) { - return; - } - if (this.getAction().checked) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"])(this.item, 'checked'); - this.item.setAttribute('role', 'menuitemcheckbox'); - this.item.setAttribute('aria-checked', 'true'); - } - else { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["removeClass"])(this.item, 'checked'); - this.item.setAttribute('role', 'menuitem'); - this.item.setAttribute('aria-checked', 'false'); - } - } - getMnemonic() { - return this.mnemonic; - } - applyStyle() { - if (!this.menuStyle) { - return; - } - const isSelected = this.element && Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["hasClass"])(this.element, 'focused'); - const fgColor = isSelected && this.menuStyle.selectionForegroundColor ? this.menuStyle.selectionForegroundColor : this.menuStyle.foregroundColor; - const bgColor = isSelected && this.menuStyle.selectionBackgroundColor ? this.menuStyle.selectionBackgroundColor : undefined; - const border = isSelected && this.menuStyle.selectionBorderColor ? `thin solid ${this.menuStyle.selectionBorderColor}` : ''; - if (this.item) { - this.item.style.color = fgColor ? fgColor.toString() : ''; - this.item.style.backgroundColor = bgColor ? bgColor.toString() : ''; - } - if (this.check) { - this.check.style.color = fgColor ? fgColor.toString() : ''; - } - if (this.container) { - this.container.style.border = border; - } - } - style(style) { - this.menuStyle = style; - this.applyStyle(); - } -} -class SubmenuMenuActionViewItem extends BaseMenuActionViewItem { - constructor(action, submenuActions, parentData, submenuOptions) { - super(action, action, submenuOptions); - this.submenuActions = submenuActions; - this.parentData = parentData; - this.submenuOptions = submenuOptions; - this.mysubmenu = null; - this.submenuDisposables = this._register(new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["DisposableStore"]()); - this.mouseOver = false; - this.expandDirection = submenuOptions && submenuOptions.expandDirection !== undefined ? submenuOptions.expandDirection : Direction.Right; - this.showScheduler = new _common_async_js__WEBPACK_IMPORTED_MODULE_6__["RunOnceScheduler"](() => { - if (this.mouseOver) { - this.cleanupExistingSubmenu(false); - this.createSubmenu(false); - } - }, 250); - this.hideScheduler = new _common_async_js__WEBPACK_IMPORTED_MODULE_6__["RunOnceScheduler"](() => { - if (this.element && (!Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["isAncestor"])(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["getActiveElement"])(), this.element) && this.parentData.submenu === this.mysubmenu)) { - this.parentData.parent.focus(false); - this.cleanupExistingSubmenu(true); - } - }, 750); - } - render(container) { - super.render(container); - if (!this.element) { - return; - } - if (this.item) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"])(this.item, 'monaco-submenu-item'); - this.item.setAttribute('aria-haspopup', 'true'); - this.updateAriaExpanded('false'); - this.submenuIndicator = Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["append"])(this.item, Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["$"])('span.submenu-indicator' + menuSubmenuIcon.cssSelector)); - this.submenuIndicator.setAttribute('aria-hidden', 'true'); - } - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(this.element, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].KEY_UP, e => { - let event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__["StandardKeyboardEvent"](e); - if (event.equals(17 /* RightArrow */) || event.equals(3 /* Enter */)) { - _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventHelper"].stop(e, true); - this.createSubmenu(true); - } - })); - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(this.element, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].KEY_DOWN, e => { - let event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__["StandardKeyboardEvent"](e); - if (Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["getActiveElement"])() === this.item) { - if (event.equals(17 /* RightArrow */) || event.equals(3 /* Enter */)) { - _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventHelper"].stop(e, true); - } - } - })); - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(this.element, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].MOUSE_OVER, e => { - if (!this.mouseOver) { - this.mouseOver = true; - this.showScheduler.schedule(); - } - })); - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(this.element, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].MOUSE_LEAVE, e => { - this.mouseOver = false; - })); - this._register(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(this.element, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].FOCUS_OUT, e => { - if (this.element && !Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["isAncestor"])(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["getActiveElement"])(), this.element)) { - this.hideScheduler.schedule(); - } - })); - this._register(this.parentData.parent.onScroll(() => { - this.parentData.parent.focus(false); - this.cleanupExistingSubmenu(false); - })); - } - onClick(e) { - // stop clicking from trying to run an action - _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventHelper"].stop(e, true); - this.cleanupExistingSubmenu(false); - this.createSubmenu(true); - } - cleanupExistingSubmenu(force) { - if (this.parentData.submenu && (force || (this.parentData.submenu !== this.mysubmenu))) { - // disposal may throw if the submenu has already been removed - try { - this.parentData.submenu.dispose(); - } - catch (_a) { } - this.parentData.submenu = undefined; - this.updateAriaExpanded('false'); - if (this.submenuContainer) { - this.submenuDisposables.clear(); - this.submenuContainer = undefined; - } - } - } - calculateSubmenuMenuLayout(windowDimensions, submenu, entry, expandDirection) { - const ret = { top: 0, left: 0 }; - // Start with horizontal - ret.left = Object(_contextview_contextview_js__WEBPACK_IMPORTED_MODULE_9__["layout"])(windowDimensions.width, submenu.width, { position: expandDirection === Direction.Right ? 0 /* Before */ : 1 /* After */, offset: entry.left, size: entry.width }); - // We don't have enough room to layout the menu fully, so we are overlapping the menu - if (ret.left >= entry.left && ret.left < entry.left + entry.width) { - if (entry.left + 10 + submenu.width <= windowDimensions.width) { - ret.left = entry.left + 10; - } - entry.top += 10; - entry.height = 0; - } - // Now that we have a horizontal position, try layout vertically - ret.top = Object(_contextview_contextview_js__WEBPACK_IMPORTED_MODULE_9__["layout"])(windowDimensions.height, submenu.height, { position: 0 /* Before */, offset: entry.top, size: 0 }); - // We didn't have enough room below, but we did above, so we shift down to align the menu - if (ret.top + submenu.height === entry.top && ret.top + entry.height + submenu.height <= windowDimensions.height) { - ret.top += entry.height; - } - return ret; - } - createSubmenu(selectFirstItem = true) { - if (!this.element) { - return; - } - if (!this.parentData.submenu) { - this.updateAriaExpanded('true'); - this.submenuContainer = Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["append"])(this.element, Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["$"])('div.monaco-submenu')); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClasses"])(this.submenuContainer, 'menubar-menu-items-holder', 'context-view'); - // Set the top value of the menu container before construction - // This allows the menu constructor to calculate the proper max height - const computedStyles = getComputedStyle(this.parentData.parent.domNode); - const paddingTop = parseFloat(computedStyles.paddingTop || '0') || 0; - // this.submenuContainer.style.top = `${this.element.offsetTop - this.parentData.parent.scrollOffset - paddingTop}px`; - this.submenuContainer.style.zIndex = '1'; - this.submenuContainer.style.position = 'fixed'; - this.submenuContainer.style.top = '0'; - this.submenuContainer.style.left = '0'; - this.parentData.submenu = new Menu(this.submenuContainer, this.submenuActions, this.submenuOptions); - if (this.menuStyle) { - this.parentData.submenu.style(this.menuStyle); - } - // layout submenu - const entryBox = this.element.getBoundingClientRect(); - const entryBoxUpdated = { - top: entryBox.top - paddingTop, - left: entryBox.left, - height: entryBox.height + 2 * paddingTop, - width: entryBox.width - }; - const viewBox = this.submenuContainer.getBoundingClientRect(); - const { top, left } = this.calculateSubmenuMenuLayout({ height: window.innerHeight, width: window.innerWidth }, viewBox, entryBoxUpdated, this.expandDirection); - this.submenuContainer.style.left = `${left}px`; - this.submenuContainer.style.top = `${top}px`; - this.submenuDisposables.add(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(this.submenuContainer, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].KEY_UP, e => { - let event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__["StandardKeyboardEvent"](e); - if (event.equals(15 /* LeftArrow */)) { - _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventHelper"].stop(e, true); - this.parentData.parent.focus(); - this.cleanupExistingSubmenu(true); - } - })); - this.submenuDisposables.add(Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addDisposableListener"])(this.submenuContainer, _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].KEY_DOWN, e => { - let event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__["StandardKeyboardEvent"](e); - if (event.equals(15 /* LeftArrow */)) { - _dom_js__WEBPACK_IMPORTED_MODULE_4__["EventHelper"].stop(e, true); - } - })); - this.submenuDisposables.add(this.parentData.submenu.onDidCancel(() => { - this.parentData.parent.focus(); - this.cleanupExistingSubmenu(true); - })); - this.parentData.submenu.focus(selectFirstItem); - this.mysubmenu = this.parentData.submenu; - } - else { - this.parentData.submenu.focus(false); - } - } - updateAriaExpanded(value) { - var _a; - if (this.item) { - (_a = this.item) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', value); - } - } - applyStyle() { - super.applyStyle(); - if (!this.menuStyle) { - return; - } - const isSelected = this.element && Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["hasClass"])(this.element, 'focused'); - const fgColor = isSelected && this.menuStyle.selectionForegroundColor ? this.menuStyle.selectionForegroundColor : this.menuStyle.foregroundColor; - if (this.submenuIndicator) { - this.submenuIndicator.style.color = fgColor ? `${fgColor}` : ''; - } - if (this.parentData.submenu) { - this.parentData.submenu.style(this.menuStyle); - } - } - dispose() { - super.dispose(); - this.hideScheduler.dispose(); - if (this.mysubmenu) { - this.mysubmenu.dispose(); - this.mysubmenu = null; - } - if (this.submenuContainer) { - this.submenuContainer = undefined; - } - } -} -class MenuSeparatorActionViewItem extends _actionbar_actionViewItems_js__WEBPACK_IMPORTED_MODULE_12__["ActionViewItem"] { - style(style) { - if (this.label) { - this.label.style.borderBottomColor = style.separatorColor ? `${style.separatorColor}` : ''; - } - } -} -function cleanMnemonic(label) { - const regex = MENU_MNEMONIC_REGEX; - const matches = regex.exec(label); - if (!matches) { - return label; - } - const mnemonicInText = !matches[1]; - return label.replace(regex, mnemonicInText ? '$2$3' : '').trim(); -} -let MENU_WIDGET_CSS = ` -.monaco-menu { - font-size: 13px; - -} - -${Object(_codicons_codiconStyles_js__WEBPACK_IMPORTED_MODULE_13__["formatRule"])(menuSelectionIcon)} -${Object(_codicons_codiconStyles_js__WEBPACK_IMPORTED_MODULE_13__["formatRule"])(menuSubmenuIcon)} - -.monaco-menu .monaco-action-bar { - text-align: right; - overflow: hidden; - white-space: nowrap; -} - -.monaco-menu .monaco-action-bar .actions-container { - display: flex; - margin: 0 auto; - padding: 0; - width: 100%; - justify-content: flex-end; -} - -.monaco-menu .monaco-action-bar.vertical .actions-container { - display: inline-block; -} - -.monaco-menu .monaco-action-bar.reverse .actions-container { - flex-direction: row-reverse; -} - -.monaco-menu .monaco-action-bar .action-item { - cursor: pointer; - display: inline-block; - transition: transform 50ms ease; - position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */ -} - -.monaco-menu .monaco-action-bar .action-item.disabled { - cursor: default; -} - -.monaco-menu .monaco-action-bar.animated .action-item.active { - transform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */ -} - -.monaco-menu .monaco-action-bar .action-item .icon, -.monaco-menu .monaco-action-bar .action-item .codicon { - display: inline-block; -} - -.monaco-menu .monaco-action-bar .action-item .codicon { - display: flex; - align-items: center; -} - -.monaco-menu .monaco-action-bar .action-label { - font-size: 11px; - margin-right: 4px; -} - -.monaco-menu .monaco-action-bar .action-item.disabled .action-label, -.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover { - opacity: 0.4; -} - -/* Vertical actions */ - -.monaco-menu .monaco-action-bar.vertical { - text-align: left; -} - -.monaco-menu .monaco-action-bar.vertical .action-item { - display: block; -} - -.monaco-menu .monaco-action-bar.vertical .action-label.separator { - display: block; - border-bottom: 1px solid #bbb; - padding-top: 1px; - margin-left: .8em; - margin-right: .8em; -} - -.monaco-menu .secondary-actions .monaco-action-bar .action-label { - margin-left: 6px; -} - -/* Action Items */ -.monaco-menu .monaco-action-bar .action-item.select-container { - overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */ - flex: 1; - max-width: 170px; - min-width: 60px; - display: flex; - align-items: center; - justify-content: center; - margin-right: 10px; -} - -.monaco-menu .monaco-action-bar.vertical { - margin-left: 0; - overflow: visible; -} - -.monaco-menu .monaco-action-bar.vertical .actions-container { - display: block; -} - -.monaco-menu .monaco-action-bar.vertical .action-item { - padding: 0; - transform: none; - display: flex; -} - -.monaco-menu .monaco-action-bar.vertical .action-item.active { - transform: none; -} - -.monaco-menu .monaco-action-bar.vertical .action-menu-item { - flex: 1 1 auto; - display: flex; - height: 2em; - align-items: center; - position: relative; -} - -.monaco-menu .monaco-action-bar.vertical .action-label { - flex: 1 1 auto; - text-decoration: none; - padding: 0 1em; - background: none; - font-size: 12px; - line-height: 1; -} - -.monaco-menu .monaco-action-bar.vertical .keybinding, -.monaco-menu .monaco-action-bar.vertical .submenu-indicator { - display: inline-block; - flex: 2 1 auto; - padding: 0 1em; - text-align: right; - font-size: 12px; - line-height: 1; -} - -.monaco-menu .monaco-action-bar.vertical .submenu-indicator { - height: 100%; -} - -.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon { - font-size: 16px !important; - display: flex; - align-items: center; -} - -.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before { - margin-left: auto; - margin-right: -20px; -} - -.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding, -.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator { - opacity: 0.4; -} - -.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) { - display: inline-block; - box-sizing: border-box; - margin: 0; -} - -.monaco-menu .monaco-action-bar.vertical .action-item { - position: static; - overflow: visible; -} - -.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu { - position: absolute; -} - -.monaco-menu .monaco-action-bar.vertical .action-label.separator { - padding: 0.5em 0 0 0; - margin-bottom: 0.5em; - width: 100%; - height: 0px !important; - margin-left: .8em !important; - margin-right: .8em !important; -} - -.monaco-menu .monaco-action-bar.vertical .action-label.separator.text { - padding: 0.7em 1em 0.1em 1em; - font-weight: bold; - opacity: 1; -} - -.monaco-menu .monaco-action-bar.vertical .action-label:hover { - color: inherit; -} - -.monaco-menu .monaco-action-bar.vertical .menu-item-check { - position: absolute; - visibility: hidden; - width: 1em; - height: 100%; -} - -.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check { - visibility: visible; - display: flex; - align-items: center; - justify-content: center; -} - -/* Context Menu */ - -.context-view.monaco-menu-container { - outline: 0; - border: none; - animation: fadeIn 0.083s linear; -} - -.context-view.monaco-menu-container :focus, -.context-view.monaco-menu-container .monaco-action-bar.vertical:focus, -.context-view.monaco-menu-container .monaco-action-bar.vertical :focus { - outline: 0; -} - -.monaco-menu .monaco-action-bar.vertical .action-item { - border: thin solid transparent; /* prevents jumping behaviour on hover or focus */ -} - - -/* High Contrast Theming */ -:host-context(.hc-black) .context-view.monaco-menu-container { - box-shadow: none; -} - -:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused { - background: none; -} - -/* Vertical Action Bar Styles */ - -.monaco-menu .monaco-action-bar.vertical { - padding: .5em 0; -} - -.monaco-menu .monaco-action-bar.vertical .action-menu-item { - height: 1.8em; -} - -.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator), -.monaco-menu .monaco-action-bar.vertical .keybinding { - font-size: inherit; - padding: 0 2em; -} - -.monaco-menu .monaco-action-bar.vertical .menu-item-check { - font-size: inherit; - width: 2em; -} - -.monaco-menu .monaco-action-bar.vertical .action-label.separator { - font-size: inherit; - padding: 0.2em 0 0 0; - margin-bottom: 0.2em; -} - -:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator { - margin-left: 0; - margin-right: 0; -} - -.monaco-menu .monaco-action-bar.vertical .submenu-indicator { - font-size: 60%; - padding: 0 1.8em; -} - -:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator { - height: 100%; - mask-size: 10px 10px; - -webkit-mask-size: 10px 10px; -} - -.monaco-menu .action-item { - cursor: default; -} - -/* Arrows */ -.monaco-scrollable-element > .scrollbar > .scra { - cursor: pointer; - font-size: 11px !important; -} - -.monaco-scrollable-element > .visible { - opacity: 1; - - /* Background rule added for IE9 - to allow clicks on dom node */ - background:rgba(0,0,0,0); - - transition: opacity 100ms linear; -} -.monaco-scrollable-element > .invisible { - opacity: 0; - pointer-events: none; -} -.monaco-scrollable-element > .invisible.fade { - transition: opacity 800ms linear; -} - -/* Scrollable Content Inset Shadow */ -.monaco-scrollable-element > .shadow { - position: absolute; - display: none; -} -.monaco-scrollable-element > .shadow.top { - display: block; - top: 0; - left: 3px; - height: 3px; - width: 100%; - box-shadow: #DDD 0 6px 6px -6px inset; -} -.monaco-scrollable-element > .shadow.left { - display: block; - top: 3px; - left: 0; - height: 100%; - width: 3px; - box-shadow: #DDD 6px 0 6px -6px inset; -} -.monaco-scrollable-element > .shadow.top-left-corner { - display: block; - top: 0; - left: 0; - height: 3px; - width: 3px; -} -.monaco-scrollable-element > .shadow.top.left { - box-shadow: #DDD 6px 6px 6px -6px inset; -} - -/* ---------- Default Style ---------- */ - -:host-context(.vs) .monaco-scrollable-element > .scrollbar > .slider { - background: rgba(100, 100, 100, .4); -} -:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider { - background: rgba(121, 121, 121, .4); -} -:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider { - background: rgba(111, 195, 223, .6); -} - -.monaco-scrollable-element > .scrollbar > .slider:hover { - background: rgba(100, 100, 100, .7); -} -:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider:hover { - background: rgba(111, 195, 223, .8); -} - -.monaco-scrollable-element > .scrollbar > .slider.active { - background: rgba(0, 0, 0, .6); -} -:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider.active { - background: rgba(191, 191, 191, .4); -} -:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider.active { - background: rgba(111, 195, 223, 1); -} - -:host-context(.vs-dark) .monaco-scrollable-element .shadow.top { - box-shadow: none; -} - -:host-context(.vs-dark) .monaco-scrollable-element .shadow.left { - box-shadow: #000 6px 0 6px -6px inset; -} - -:host-context(.vs-dark) .monaco-scrollable-element .shadow.top.left { - box-shadow: #000 6px 6px 6px -6px inset; -} - -:host-context(.hc-black) .monaco-scrollable-element .shadow.top { - box-shadow: none; -} - -:host-context(.hc-black) .monaco-scrollable-element .shadow.left { - box-shadow: none; -} - -:host-context(.hc-black) .monaco-scrollable-element .shadow.top.left { - box-shadow: none; -} -`; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.css": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.css ***! - \***************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_mouseCursor_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./mouseCursor.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.css"); -/* harmony import */ var _css_loader_dist_cjs_js_mouseCursor_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_mouseCursor_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_mouseCursor_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_mouseCursor_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.js ***! - \**************************************************************************************/ -/*! exports provided: MOUSE_CURSOR_TEXT_CSS_CLASS_NAME */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MOUSE_CURSOR_TEXT_CSS_CLASS_NAME", function() { return MOUSE_CURSOR_TEXT_CSS_CLASS_NAME; }); -/* harmony import */ var _mouseCursor_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mouseCursor.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.css"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const MOUSE_CURSOR_TEXT_CSS_CLASS_NAME = `monaco-mouse-cursor-text`; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.css": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.css ***! - \***************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_progressbar_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./progressbar.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.css"); -/* harmony import */ var _css_loader_dist_cjs_js_progressbar_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_progressbar_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_progressbar_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_progressbar_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.js ***! - \**************************************************************************************/ -/*! exports provided: ProgressBar */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProgressBar", function() { return ProgressBar; }); -/* harmony import */ var _progressbar_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./progressbar.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.css"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _common_objects_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_async_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -const css_done = 'done'; -const css_active = 'active'; -const css_infinite = 'infinite'; -const css_discrete = 'discrete'; -const css_progress_container = 'monaco-progress-container'; -const css_progress_bit = 'progress-bit'; -const defaultOpts = { - progressBarBackground: _common_color_js__WEBPACK_IMPORTED_MODULE_2__["Color"].fromHex('#0E70C0') -}; -/** - * A progress bar with support for infinite or discrete progress. - */ -class ProgressBar extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(container, options) { - super(); - this.options = options || Object.create(null); - Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_3__["mixin"])(this.options, defaultOpts, false); - this.workedVal = 0; - this.progressBarBackground = this.options.progressBarBackground; - this._register(this.showDelayedScheduler = new _common_async_js__WEBPACK_IMPORTED_MODULE_5__["RunOnceScheduler"](() => Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["show"])(this.element), 0)); - this.create(container); - } - create(container) { - this.element = document.createElement('div'); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"])(this.element, css_progress_container); - container.appendChild(this.element); - this.bit = document.createElement('div'); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"])(this.bit, css_progress_bit); - this.element.appendChild(this.bit); - this.applyStyles(); - } - off() { - this.bit.style.width = 'inherit'; - this.bit.style.opacity = '1'; - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["removeClasses"])(this.element, css_active, css_infinite, css_discrete); - this.workedVal = 0; - this.totalWork = undefined; - } - /** - * Stops the progressbar from showing any progress instantly without fading out. - */ - stop() { - return this.doDone(false); - } - doDone(delayed) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"])(this.element, css_done); - // let it grow to 100% width and hide afterwards - if (!Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["hasClass"])(this.element, css_infinite)) { - this.bit.style.width = 'inherit'; - if (delayed) { - setTimeout(() => this.off(), 200); - } - else { - this.off(); - } - } - // let it fade out and hide afterwards - else { - this.bit.style.opacity = '0'; - if (delayed) { - setTimeout(() => this.off(), 200); - } - else { - this.off(); - } - } - return this; - } - /** - * Use this mode to indicate progress that has no total number of work units. - */ - infinite() { - this.bit.style.width = '2%'; - this.bit.style.opacity = '1'; - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["removeClasses"])(this.element, css_discrete, css_done); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_4__["addClasses"])(this.element, css_active, css_infinite); - return this; - } - getContainer() { - return this.element; - } - style(styles) { - this.progressBarBackground = styles.progressBarBackground; - this.applyStyles(); - } - applyStyles() { - if (this.bit) { - const background = this.progressBarBackground ? this.progressBarBackground.toString() : ''; - this.bit.style.backgroundColor = background; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/sash/sash.css": -/*!*************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/sash/sash.css ***! - \*************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_sash_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./sash.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/sash/sash.css"); -/* harmony import */ var _css_loader_dist_cjs_js_sash_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_sash_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_sash_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_sash_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/sash/sash.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/sash/sash.js ***! - \************************************************************************/ -/*! exports provided: Sash */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sash", function() { return Sash; }); -/* harmony import */ var _sash_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sash.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/sash/sash.css"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _common_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _touch_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../touch.js */ "./node_modules/monaco-editor/esm/vs/base/browser/touch.js"); -/* harmony import */ var _mouseEvent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../event.js */ "./node_modules/monaco-editor/esm/vs/base/browser/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -const DEBUG = false; -let globalSize = 4; -const onDidChangeGlobalSize = new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"](); -class Sash extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(container, layoutProvider, options) { - super(); - this._state = 3 /* Enabled */; - this._onDidEnablementChange = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidEnablementChange = this._onDidEnablementChange.event; - this._onDidStart = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidStart = this._onDidStart.event; - this._onDidChange = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidChange = this._onDidChange.event; - this._onDidReset = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidReset = this._onDidReset.event; - this._onDidEnd = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidEnd = this._onDidEnd.event; - this.linkedSash = undefined; - this.orthogonalStartSashDisposables = this._register(new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"]()); - this.orthogonalEndSashDisposables = this._register(new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"]()); - this.el = Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["append"])(container, Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["$"])('.monaco-sash')); - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"]) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["addClass"])(this.el, 'mac'); - } - this._register(Object(_event_js__WEBPACK_IMPORTED_MODULE_8__["domEvent"])(this.el, 'mousedown')(this.onMouseDown, this)); - this._register(Object(_event_js__WEBPACK_IMPORTED_MODULE_8__["domEvent"])(this.el, 'dblclick')(this.onMouseDoubleClick, this)); - this._register(_touch_js__WEBPACK_IMPORTED_MODULE_4__["Gesture"].addTarget(this.el)); - this._register(Object(_event_js__WEBPACK_IMPORTED_MODULE_8__["domEvent"])(this.el, _touch_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].Start)(this.onTouchStart, this)); - if (typeof options.size === 'number') { - this.size = options.size; - if (options.orientation === 0 /* VERTICAL */) { - this.el.style.width = `${this.size}px`; - } - else { - this.el.style.height = `${this.size}px`; - } - } - else { - this.size = globalSize; - this._register(onDidChangeGlobalSize.event(size => { - this.size = size; - this.layout(); - })); - } - this.hidden = false; - this.layoutProvider = layoutProvider; - this.orthogonalStartSash = options.orthogonalStartSash; - this.orthogonalEndSash = options.orthogonalEndSash; - this.orientation = options.orientation || 0 /* VERTICAL */; - if (this.orientation === 1 /* HORIZONTAL */) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["addClass"])(this.el, 'horizontal'); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["removeClass"])(this.el, 'vertical'); - } - else { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["removeClass"])(this.el, 'horizontal'); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["addClass"])(this.el, 'vertical'); - } - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["toggleClass"])(this.el, 'debug', DEBUG); - this.layout(); - } - get state() { return this._state; } - set state(state) { - if (this._state === state) { - return; - } - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["toggleClass"])(this.el, 'disabled', state === 0 /* Disabled */); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["toggleClass"])(this.el, 'minimum', state === 1 /* Minimum */); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["toggleClass"])(this.el, 'maximum', state === 2 /* Maximum */); - this._state = state; - this._onDidEnablementChange.fire(state); - } - get orthogonalStartSash() { return this._orthogonalStartSash; } - set orthogonalStartSash(sash) { - this.orthogonalStartSashDisposables.clear(); - if (sash) { - this.orthogonalStartSashDisposables.add(sash.onDidEnablementChange(this.onOrthogonalStartSashEnablementChange, this)); - this.onOrthogonalStartSashEnablementChange(sash.state); - } - else { - this.onOrthogonalStartSashEnablementChange(0 /* Disabled */); - } - this._orthogonalStartSash = sash; - } - get orthogonalEndSash() { return this._orthogonalEndSash; } - set orthogonalEndSash(sash) { - this.orthogonalEndSashDisposables.clear(); - if (sash) { - this.orthogonalEndSashDisposables.add(sash.onDidEnablementChange(this.onOrthogonalEndSashEnablementChange, this)); - this.onOrthogonalEndSashEnablementChange(sash.state); - } - else { - this.onOrthogonalEndSashEnablementChange(0 /* Disabled */); - } - this._orthogonalEndSash = sash; - } - onMouseDown(e) { - _dom_js__WEBPACK_IMPORTED_MODULE_7__["EventHelper"].stop(e, false); - let isMultisashResize = false; - if (!e.__orthogonalSashEvent) { - const orthogonalSash = this.getOrthogonalSash(e); - if (orthogonalSash) { - isMultisashResize = true; - e.__orthogonalSashEvent = true; - orthogonalSash.onMouseDown(e); - } - } - if (this.linkedSash && !e.__linkedSashEvent) { - e.__linkedSashEvent = true; - this.linkedSash.onMouseDown(e); - } - if (!this.state) { - return; - } - // Select both iframes and webviews; internally Electron nests an iframe - // in its component, but this isn't queryable. - const iframes = [ - ...Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["getElementsByTagName"])('iframe'), - ...Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["getElementsByTagName"])('webview'), - ]; - for (const iframe of iframes) { - iframe.style.pointerEvents = 'none'; // disable mouse events on iframes as long as we drag the sash - } - const mouseDownEvent = new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_5__["StandardMouseEvent"](e); - const startX = mouseDownEvent.posx; - const startY = mouseDownEvent.posy; - const altKey = mouseDownEvent.altKey; - const startEvent = { startX, currentX: startX, startY, currentY: startY, altKey }; - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["addClass"])(this.el, 'active'); - this._onDidStart.fire(startEvent); - // fix https://github.com/Microsoft/vscode/issues/21675 - const style = Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["createStyleSheet"])(this.el); - const updateStyle = () => { - let cursor = ''; - if (isMultisashResize) { - cursor = 'all-scroll'; - } - else if (this.orientation === 1 /* HORIZONTAL */) { - if (this.state === 1 /* Minimum */) { - cursor = 's-resize'; - } - else if (this.state === 2 /* Maximum */) { - cursor = 'n-resize'; - } - else { - cursor = _common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"] ? 'row-resize' : 'ns-resize'; - } - } - else { - if (this.state === 1 /* Minimum */) { - cursor = 'e-resize'; - } - else if (this.state === 2 /* Maximum */) { - cursor = 'w-resize'; - } - else { - cursor = _common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"] ? 'col-resize' : 'ew-resize'; - } - } - style.innerHTML = `* { cursor: ${cursor} !important; }`; - }; - const disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - updateStyle(); - if (!isMultisashResize) { - this.onDidEnablementChange(updateStyle, null, disposables); - } - const onMouseMove = (e) => { - _dom_js__WEBPACK_IMPORTED_MODULE_7__["EventHelper"].stop(e, false); - const mouseMoveEvent = new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_5__["StandardMouseEvent"](e); - const event = { startX, currentX: mouseMoveEvent.posx, startY, currentY: mouseMoveEvent.posy, altKey }; - this._onDidChange.fire(event); - }; - const onMouseUp = (e) => { - _dom_js__WEBPACK_IMPORTED_MODULE_7__["EventHelper"].stop(e, false); - this.el.removeChild(style); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["removeClass"])(this.el, 'active'); - this._onDidEnd.fire(); - disposables.dispose(); - for (const iframe of iframes) { - iframe.style.pointerEvents = 'auto'; - } - }; - Object(_event_js__WEBPACK_IMPORTED_MODULE_8__["domEvent"])(window, 'mousemove')(onMouseMove, null, disposables); - Object(_event_js__WEBPACK_IMPORTED_MODULE_8__["domEvent"])(window, 'mouseup')(onMouseUp, null, disposables); - } - onMouseDoubleClick(e) { - const orthogonalSash = this.getOrthogonalSash(e); - if (orthogonalSash) { - orthogonalSash._onDidReset.fire(); - } - if (this.linkedSash) { - this.linkedSash._onDidReset.fire(); - } - this._onDidReset.fire(); - } - onTouchStart(event) { - _dom_js__WEBPACK_IMPORTED_MODULE_7__["EventHelper"].stop(event); - const listeners = []; - const startX = event.pageX; - const startY = event.pageY; - const altKey = event.altKey; - this._onDidStart.fire({ - startX: startX, - currentX: startX, - startY: startY, - currentY: startY, - altKey - }); - listeners.push(Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["addDisposableListener"])(this.el, _touch_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].Change, (event) => { - if (_common_types_js__WEBPACK_IMPORTED_MODULE_3__["isNumber"](event.pageX) && _common_types_js__WEBPACK_IMPORTED_MODULE_3__["isNumber"](event.pageY)) { - this._onDidChange.fire({ - startX: startX, - currentX: event.pageX, - startY: startY, - currentY: event.pageY, - altKey - }); - } - })); - listeners.push(Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["addDisposableListener"])(this.el, _touch_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].End, (event) => { - this._onDidEnd.fire(); - Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(listeners); - })); - } - layout() { - if (this.orientation === 0 /* VERTICAL */) { - const verticalProvider = this.layoutProvider; - this.el.style.left = verticalProvider.getVerticalSashLeft(this) - (this.size / 2) + 'px'; - if (verticalProvider.getVerticalSashTop) { - this.el.style.top = verticalProvider.getVerticalSashTop(this) + 'px'; - } - if (verticalProvider.getVerticalSashHeight) { - this.el.style.height = verticalProvider.getVerticalSashHeight(this) + 'px'; - } - } - else { - const horizontalProvider = this.layoutProvider; - this.el.style.top = horizontalProvider.getHorizontalSashTop(this) - (this.size / 2) + 'px'; - if (horizontalProvider.getHorizontalSashLeft) { - this.el.style.left = horizontalProvider.getHorizontalSashLeft(this) + 'px'; - } - if (horizontalProvider.getHorizontalSashWidth) { - this.el.style.width = horizontalProvider.getHorizontalSashWidth(this) + 'px'; - } - } - } - hide() { - this.hidden = true; - this.el.style.display = 'none'; - this.el.setAttribute('aria-hidden', 'true'); - } - onOrthogonalStartSashEnablementChange(state) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["toggleClass"])(this.el, 'orthogonal-start', state !== 0 /* Disabled */); - } - onOrthogonalEndSashEnablementChange(state) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_7__["toggleClass"])(this.el, 'orthogonal-end', state !== 0 /* Disabled */); - } - getOrthogonalSash(e) { - if (this.orientation === 0 /* VERTICAL */) { - if (e.offsetY <= this.size) { - return this.orthogonalStartSash; - } - else if (e.offsetY >= this.el.clientHeight - this.size) { - return this.orthogonalEndSash; - } - } - else { - if (e.offsetX <= this.size) { - return this.orthogonalStartSash; - } - else if (e.offsetX >= this.el.clientWidth - this.size) { - return this.orthogonalEndSash; - } - } - return undefined; - } - dispose() { - super.dispose(); - this.el.remove(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/abstractScrollbar.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/abstractScrollbar.js ***! - \******************************************************************************************/ -/*! exports provided: AbstractScrollbar */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractScrollbar", function() { return AbstractScrollbar; }); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../globalMouseMoveMonitor.js */ "./node_modules/monaco-editor/esm/vs/base/browser/globalMouseMoveMonitor.js"); -/* harmony import */ var _scrollbarArrow_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scrollbarArrow.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarArrow.js"); -/* harmony import */ var _scrollbarVisibilityController_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./scrollbarVisibilityController.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.js"); -/* harmony import */ var _widget_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../widget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -/** - * The orthogonal distance to the slider at which dragging "resets". This implements "snapping" - */ -const MOUSE_DRAG_RESET_DISTANCE = 140; -class AbstractScrollbar extends _widget_js__WEBPACK_IMPORTED_MODULE_5__["Widget"] { - constructor(opts) { - super(); - this._lazyRender = opts.lazyRender; - this._host = opts.host; - this._scrollable = opts.scrollable; - this._scrollbarState = opts.scrollbarState; - this._visibilityController = this._register(new _scrollbarVisibilityController_js__WEBPACK_IMPORTED_MODULE_4__["ScrollbarVisibilityController"](opts.visibility, 'visible scrollbar ' + opts.extraScrollbarClassName, 'invisible scrollbar ' + opts.extraScrollbarClassName)); - this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()); - this._mouseMoveMonitor = this._register(new _globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_2__["GlobalMouseMoveMonitor"]()); - this._shouldRender = true; - this.domNode = Object(_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(document.createElement('div')); - this.domNode.setAttribute('role', 'presentation'); - this.domNode.setAttribute('aria-hidden', 'true'); - this._visibilityController.setDomNode(this.domNode); - this.domNode.setPosition('absolute'); - this.onmousedown(this.domNode.domNode, (e) => this._domNodeMouseDown(e)); - } - // ----------------- creation - /** - * Creates the dom node for an arrow & adds it to the container - */ - _createArrow(opts) { - let arrow = this._register(new _scrollbarArrow_js__WEBPACK_IMPORTED_MODULE_3__["ScrollbarArrow"](opts)); - this.domNode.domNode.appendChild(arrow.bgDomNode); - this.domNode.domNode.appendChild(arrow.domNode); - } - /** - * Creates the slider dom node, adds it to the container & hooks up the events - */ - _createSlider(top, left, width, height) { - this.slider = Object(_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(document.createElement('div')); - this.slider.setClassName('slider'); - this.slider.setPosition('absolute'); - this.slider.setTop(top); - this.slider.setLeft(left); - if (typeof width === 'number') { - this.slider.setWidth(width); - } - if (typeof height === 'number') { - this.slider.setHeight(height); - } - this.slider.setLayerHinting(true); - this.slider.setContain('strict'); - this.domNode.domNode.appendChild(this.slider.domNode); - this.onmousedown(this.slider.domNode, (e) => { - if (e.leftButton) { - e.preventDefault(); - this._sliderMouseDown(e, () => { }); - } - }); - this.onclick(this.slider.domNode, e => { - if (e.leftButton) { - e.stopPropagation(); - } - }); - } - // ----------------- Update state - _onElementSize(visibleSize) { - if (this._scrollbarState.setVisibleSize(visibleSize)) { - this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()); - this._shouldRender = true; - if (!this._lazyRender) { - this.render(); - } - } - return this._shouldRender; - } - _onElementScrollSize(elementScrollSize) { - if (this._scrollbarState.setScrollSize(elementScrollSize)) { - this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()); - this._shouldRender = true; - if (!this._lazyRender) { - this.render(); - } - } - return this._shouldRender; - } - _onElementScrollPosition(elementScrollPosition) { - if (this._scrollbarState.setScrollPosition(elementScrollPosition)) { - this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()); - this._shouldRender = true; - if (!this._lazyRender) { - this.render(); - } - } - return this._shouldRender; - } - // ----------------- rendering - beginReveal() { - this._visibilityController.setShouldBeVisible(true); - } - beginHide() { - this._visibilityController.setShouldBeVisible(false); - } - render() { - if (!this._shouldRender) { - return; - } - this._shouldRender = false; - this._renderDomNode(this._scrollbarState.getRectangleLargeSize(), this._scrollbarState.getRectangleSmallSize()); - this._updateSlider(this._scrollbarState.getSliderSize(), this._scrollbarState.getArrowSize() + this._scrollbarState.getSliderPosition()); - } - // ----------------- DOM events - _domNodeMouseDown(e) { - if (e.target !== this.domNode.domNode) { - return; - } - this._onMouseDown(e); - } - delegateMouseDown(e) { - let domTop = this.domNode.domNode.getClientRects()[0].top; - let sliderStart = domTop + this._scrollbarState.getSliderPosition(); - let sliderStop = domTop + this._scrollbarState.getSliderPosition() + this._scrollbarState.getSliderSize(); - let mousePos = this._sliderMousePosition(e); - if (sliderStart <= mousePos && mousePos <= sliderStop) { - // Act as if it was a mouse down on the slider - if (e.leftButton) { - e.preventDefault(); - this._sliderMouseDown(e, () => { }); - } - } - else { - // Act as if it was a mouse down on the scrollbar - this._onMouseDown(e); - } - } - _onMouseDown(e) { - let offsetX; - let offsetY; - if (e.target === this.domNode.domNode && typeof e.browserEvent.offsetX === 'number' && typeof e.browserEvent.offsetY === 'number') { - offsetX = e.browserEvent.offsetX; - offsetY = e.browserEvent.offsetY; - } - else { - const domNodePosition = _dom_js__WEBPACK_IMPORTED_MODULE_0__["getDomNodePagePosition"](this.domNode.domNode); - offsetX = e.posx - domNodePosition.left; - offsetY = e.posy - domNodePosition.top; - } - this._setDesiredScrollPositionNow(this._scrollbarState.getDesiredScrollPositionFromOffset(this._mouseDownRelativePosition(offsetX, offsetY))); - if (e.leftButton) { - e.preventDefault(); - this._sliderMouseDown(e, () => { }); - } - } - _sliderMouseDown(e, onDragFinished) { - const initialMousePosition = this._sliderMousePosition(e); - const initialMouseOrthogonalPosition = this._sliderOrthogonalMousePosition(e); - const initialScrollbarState = this._scrollbarState.clone(); - this.slider.toggleClassName('active', true); - this._mouseMoveMonitor.startMonitoring(e.target, e.buttons, _globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_2__["standardMouseMoveMerger"], (mouseMoveData) => { - const mouseOrthogonalPosition = this._sliderOrthogonalMousePosition(mouseMoveData); - const mouseOrthogonalDelta = Math.abs(mouseOrthogonalPosition - initialMouseOrthogonalPosition); - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_6__["isWindows"] && mouseOrthogonalDelta > MOUSE_DRAG_RESET_DISTANCE) { - // The mouse has wondered away from the scrollbar => reset dragging - this._setDesiredScrollPositionNow(initialScrollbarState.getScrollPosition()); - return; - } - const mousePosition = this._sliderMousePosition(mouseMoveData); - const mouseDelta = mousePosition - initialMousePosition; - this._setDesiredScrollPositionNow(initialScrollbarState.getDesiredScrollPositionFromDelta(mouseDelta)); - }, () => { - this.slider.toggleClassName('active', false); - this._host.onDragEnd(); - onDragFinished(); - }); - this._host.onDragStart(); - } - _setDesiredScrollPositionNow(_desiredScrollPosition) { - let desiredScrollPosition = {}; - this.writeScrollPosition(desiredScrollPosition, _desiredScrollPosition); - this._scrollable.setScrollPositionNow(desiredScrollPosition); - } - updateScrollbarSize(scrollbarSize) { - this._updateScrollbarSize(scrollbarSize); - this._scrollbarState.setScrollbarSize(scrollbarSize); - this._shouldRender = true; - if (!this._lazyRender) { - this.render(); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/horizontalScrollbar.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/horizontalScrollbar.js ***! - \********************************************************************************************/ -/*! exports provided: HorizontalScrollbar */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HorizontalScrollbar", function() { return HorizontalScrollbar; }); -/* harmony import */ var _mouseEvent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/* harmony import */ var _abstractScrollbar_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./abstractScrollbar.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/abstractScrollbar.js"); -/* harmony import */ var _scrollbarArrow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scrollbarArrow.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarArrow.js"); -/* harmony import */ var _scrollbarState_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scrollbarState.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarState.js"); -/* harmony import */ var _common_codicons_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -const scrollbarButtonLeftIcon = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_4__["registerIcon"])('scrollbar-button-left', _common_codicons_js__WEBPACK_IMPORTED_MODULE_4__["Codicon"].triangleLeft); -const scrollbarButtonRightIcon = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_4__["registerIcon"])('scrollbar-button-right', _common_codicons_js__WEBPACK_IMPORTED_MODULE_4__["Codicon"].triangleRight); -class HorizontalScrollbar extends _abstractScrollbar_js__WEBPACK_IMPORTED_MODULE_1__["AbstractScrollbar"] { - constructor(scrollable, options, host) { - const scrollDimensions = scrollable.getScrollDimensions(); - const scrollPosition = scrollable.getCurrentScrollPosition(); - super({ - lazyRender: options.lazyRender, - host: host, - scrollbarState: new _scrollbarState_js__WEBPACK_IMPORTED_MODULE_3__["ScrollbarState"]((options.horizontalHasArrows ? options.arrowSize : 0), (options.horizontal === 2 /* Hidden */ ? 0 : options.horizontalScrollbarSize), (options.vertical === 2 /* Hidden */ ? 0 : options.verticalScrollbarSize), scrollDimensions.width, scrollDimensions.scrollWidth, scrollPosition.scrollLeft), - visibility: options.horizontal, - extraScrollbarClassName: 'horizontal', - scrollable: scrollable - }); - if (options.horizontalHasArrows) { - let arrowDelta = (options.arrowSize - _scrollbarArrow_js__WEBPACK_IMPORTED_MODULE_2__["ARROW_IMG_SIZE"]) / 2; - let scrollbarDelta = (options.horizontalScrollbarSize - _scrollbarArrow_js__WEBPACK_IMPORTED_MODULE_2__["ARROW_IMG_SIZE"]) / 2; - this._createArrow({ - className: 'scra', - icon: scrollbarButtonLeftIcon, - top: scrollbarDelta, - left: arrowDelta, - bottom: undefined, - right: undefined, - bgWidth: options.arrowSize, - bgHeight: options.horizontalScrollbarSize, - onActivate: () => this._host.onMouseWheel(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_0__["StandardWheelEvent"](null, 1, 0)), - }); - this._createArrow({ - className: 'scra', - icon: scrollbarButtonRightIcon, - top: scrollbarDelta, - left: undefined, - bottom: undefined, - right: arrowDelta, - bgWidth: options.arrowSize, - bgHeight: options.horizontalScrollbarSize, - onActivate: () => this._host.onMouseWheel(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_0__["StandardWheelEvent"](null, -1, 0)), - }); - } - this._createSlider(Math.floor((options.horizontalScrollbarSize - options.horizontalSliderSize) / 2), 0, undefined, options.horizontalSliderSize); - } - _updateSlider(sliderSize, sliderPosition) { - this.slider.setWidth(sliderSize); - this.slider.setLeft(sliderPosition); - } - _renderDomNode(largeSize, smallSize) { - this.domNode.setWidth(largeSize); - this.domNode.setHeight(smallSize); - this.domNode.setLeft(0); - this.domNode.setBottom(0); - } - onDidScroll(e) { - this._shouldRender = this._onElementScrollSize(e.scrollWidth) || this._shouldRender; - this._shouldRender = this._onElementScrollPosition(e.scrollLeft) || this._shouldRender; - this._shouldRender = this._onElementSize(e.width) || this._shouldRender; - return this._shouldRender; - } - _mouseDownRelativePosition(offsetX, offsetY) { - return offsetX; - } - _sliderMousePosition(e) { - return e.posx; - } - _sliderOrthogonalMousePosition(e) { - return e.posy; - } - _updateScrollbarSize(size) { - this.slider.setHeight(size); - } - writeScrollPosition(target, scrollPosition) { - target.scrollLeft = scrollPosition; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/media/scrollbars.css": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/media/scrollbars.css ***! - \******************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_scrollbars_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../../css-loader/dist/cjs.js!./scrollbars.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/media/scrollbars.css"); -/* harmony import */ var _css_loader_dist_cjs_js_scrollbars_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_scrollbars_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_scrollbars_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_scrollbars_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js ***! - \******************************************************************************************/ -/*! exports provided: MouseWheelClassifier, AbstractScrollableElement, ScrollableElement, SmoothScrollableElement, DomScrollableElement */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseWheelClassifier", function() { return MouseWheelClassifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractScrollableElement", function() { return AbstractScrollableElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollableElement", function() { return ScrollableElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SmoothScrollableElement", function() { return SmoothScrollableElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DomScrollableElement", function() { return DomScrollableElement; }); -/* harmony import */ var _media_scrollbars_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/scrollbars.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/media/scrollbars.css"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _mouseEvent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/* harmony import */ var _horizontalScrollbar_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./horizontalScrollbar.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/horizontalScrollbar.js"); -/* harmony import */ var _verticalScrollbar_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./verticalScrollbar.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/verticalScrollbar.js"); -/* harmony import */ var _widget_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../widget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"); -/* harmony import */ var _common_async_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _common_scrollable_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../common/scrollable.js */ "./node_modules/monaco-editor/esm/vs/base/common/scrollable.js"); -/* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - -const HIDE_TIMEOUT = 500; -const SCROLL_WHEEL_SENSITIVITY = 50; -const SCROLL_WHEEL_SMOOTH_SCROLL_ENABLED = true; -class MouseWheelClassifierItem { - constructor(timestamp, deltaX, deltaY) { - this.timestamp = timestamp; - this.deltaX = deltaX; - this.deltaY = deltaY; - this.score = 0; - } -} -class MouseWheelClassifier { - constructor() { - this._capacity = 5; - this._memory = []; - this._front = -1; - this._rear = -1; - } - isPhysicalMouseWheel() { - if (this._front === -1 && this._rear === -1) { - // no elements - return false; - } - // 0.5 * last + 0.25 * 2nd last + 0.125 * 3rd last + ... - let remainingInfluence = 1; - let score = 0; - let iteration = 1; - let index = this._rear; - do { - const influence = (index === this._front ? remainingInfluence : Math.pow(2, -iteration)); - remainingInfluence -= influence; - score += this._memory[index].score * influence; - if (index === this._front) { - break; - } - index = (this._capacity + index - 1) % this._capacity; - iteration++; - } while (true); - return (score <= 0.5); - } - accept(timestamp, deltaX, deltaY) { - const item = new MouseWheelClassifierItem(timestamp, deltaX, deltaY); - item.score = this._computeScore(item); - if (this._front === -1 && this._rear === -1) { - this._memory[0] = item; - this._front = 0; - this._rear = 0; - } - else { - this._rear = (this._rear + 1) % this._capacity; - if (this._rear === this._front) { - // Drop oldest - this._front = (this._front + 1) % this._capacity; - } - this._memory[this._rear] = item; - } - } - /** - * A score between 0 and 1 for `item`. - * - a score towards 0 indicates that the source appears to be a physical mouse wheel - * - a score towards 1 indicates that the source appears to be a touchpad or magic mouse, etc. - */ - _computeScore(item) { - if (Math.abs(item.deltaX) > 0 && Math.abs(item.deltaY) > 0) { - // both axes exercised => definitely not a physical mouse wheel - return 1; - } - let score = 0.5; - const prev = (this._front === -1 && this._rear === -1 ? null : this._memory[this._rear]); - if (prev) { - // const deltaT = item.timestamp - prev.timestamp; - // if (deltaT < 1000 / 30) { - // // sooner than X times per second => indicator that this is not a physical mouse wheel - // score += 0.25; - // } - // if (item.deltaX === prev.deltaX && item.deltaY === prev.deltaY) { - // // equal amplitude => indicator that this is a physical mouse wheel - // score -= 0.25; - // } - } - if (!this._isAlmostInt(item.deltaX) || !this._isAlmostInt(item.deltaY)) { - // non-integer deltas => indicator that this is not a physical mouse wheel - score += 0.25; - } - return Math.min(Math.max(score, 0), 1); - } - _isAlmostInt(value) { - const delta = Math.abs(Math.round(value) - value); - return (delta < 0.01); - } -} -MouseWheelClassifier.INSTANCE = new MouseWheelClassifier(); -class AbstractScrollableElement extends _widget_js__WEBPACK_IMPORTED_MODULE_6__["Widget"] { - constructor(element, options, scrollable) { - super(); - this._onScroll = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_8__["Emitter"]()); - this.onScroll = this._onScroll.event; - this._onWillScroll = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_8__["Emitter"]()); - element.style.overflow = 'hidden'; - this._options = resolveOptions(options); - this._scrollable = scrollable; - this._register(this._scrollable.onScroll((e) => { - this._onWillScroll.fire(e); - this._onDidScroll(e); - this._onScroll.fire(e); - })); - let scrollbarHost = { - onMouseWheel: (mouseWheelEvent) => this._onMouseWheel(mouseWheelEvent), - onDragStart: () => this._onDragStart(), - onDragEnd: () => this._onDragEnd(), - }; - this._verticalScrollbar = this._register(new _verticalScrollbar_js__WEBPACK_IMPORTED_MODULE_5__["VerticalScrollbar"](this._scrollable, this._options, scrollbarHost)); - this._horizontalScrollbar = this._register(new _horizontalScrollbar_js__WEBPACK_IMPORTED_MODULE_4__["HorizontalScrollbar"](this._scrollable, this._options, scrollbarHost)); - this._domNode = document.createElement('div'); - this._domNode.className = 'monaco-scrollable-element ' + this._options.className; - this._domNode.setAttribute('role', 'presentation'); - this._domNode.style.position = 'relative'; - this._domNode.style.overflow = 'hidden'; - this._domNode.appendChild(element); - this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode); - this._domNode.appendChild(this._verticalScrollbar.domNode.domNode); - if (this._options.useShadows) { - this._leftShadowDomNode = Object(_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('div')); - this._leftShadowDomNode.setClassName('shadow'); - this._domNode.appendChild(this._leftShadowDomNode.domNode); - this._topShadowDomNode = Object(_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('div')); - this._topShadowDomNode.setClassName('shadow'); - this._domNode.appendChild(this._topShadowDomNode.domNode); - this._topLeftShadowDomNode = Object(_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('div')); - this._topLeftShadowDomNode.setClassName('shadow top-left-corner'); - this._domNode.appendChild(this._topLeftShadowDomNode.domNode); - } - else { - this._leftShadowDomNode = null; - this._topShadowDomNode = null; - this._topLeftShadowDomNode = null; - } - this._listenOnDomNode = this._options.listenOnDomNode || this._domNode; - this._mouseWheelToDispose = []; - this._setListeningToMouseWheel(this._options.handleMouseWheel); - this.onmouseover(this._listenOnDomNode, (e) => this._onMouseOver(e)); - this.onnonbubblingmouseout(this._listenOnDomNode, (e) => this._onMouseOut(e)); - this._hideTimeout = this._register(new _common_async_js__WEBPACK_IMPORTED_MODULE_7__["TimeoutTimer"]()); - this._isDragging = false; - this._mouseIsOver = false; - this._shouldRender = true; - this._revealOnScroll = true; - } - dispose() { - this._mouseWheelToDispose = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["dispose"])(this._mouseWheelToDispose); - super.dispose(); - } - /** - * Get the generated 'scrollable' dom node - */ - getDomNode() { - return this._domNode; - } - getOverviewRulerLayoutInfo() { - return { - parent: this._domNode, - insertBefore: this._verticalScrollbar.domNode.domNode, - }; - } - /** - * Delegate a mouse down event to the vertical scrollbar. - * This is to help with clicking somewhere else and having the scrollbar react. - */ - delegateVerticalScrollbarMouseDown(browserEvent) { - this._verticalScrollbar.delegateMouseDown(browserEvent); - } - getScrollDimensions() { - return this._scrollable.getScrollDimensions(); - } - setScrollDimensions(dimensions) { - this._scrollable.setScrollDimensions(dimensions, false); - } - /** - * Update the class name of the scrollable element. - */ - updateClassName(newClassName) { - this._options.className = newClassName; - // Defaults are different on Macs - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_10__["isMacintosh"]) { - this._options.className += ' mac'; - } - this._domNode.className = 'monaco-scrollable-element ' + this._options.className; - } - /** - * Update configuration options for the scrollbar. - * Really this is Editor.IEditorScrollbarOptions, but base shouldn't - * depend on Editor. - */ - updateOptions(newOptions) { - if (typeof newOptions.handleMouseWheel !== 'undefined') { - this._options.handleMouseWheel = newOptions.handleMouseWheel; - this._setListeningToMouseWheel(this._options.handleMouseWheel); - } - if (typeof newOptions.mouseWheelScrollSensitivity !== 'undefined') { - this._options.mouseWheelScrollSensitivity = newOptions.mouseWheelScrollSensitivity; - } - if (typeof newOptions.fastScrollSensitivity !== 'undefined') { - this._options.fastScrollSensitivity = newOptions.fastScrollSensitivity; - } - if (typeof newOptions.scrollPredominantAxis !== 'undefined') { - this._options.scrollPredominantAxis = newOptions.scrollPredominantAxis; - } - if (typeof newOptions.horizontalScrollbarSize !== 'undefined') { - this._horizontalScrollbar.updateScrollbarSize(newOptions.horizontalScrollbarSize); - } - if (!this._options.lazyRender) { - this._render(); - } - } - // -------------------- mouse wheel scrolling -------------------- - _setListeningToMouseWheel(shouldListen) { - let isListening = (this._mouseWheelToDispose.length > 0); - if (isListening === shouldListen) { - // No change - return; - } - // Stop listening (if necessary) - this._mouseWheelToDispose = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["dispose"])(this._mouseWheelToDispose); - // Start listening (if necessary) - if (shouldListen) { - let onMouseWheel = (browserEvent) => { - this._onMouseWheel(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_3__["StandardWheelEvent"](browserEvent)); - }; - this._mouseWheelToDispose.push(_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](this._listenOnDomNode, _dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].MOUSE_WHEEL, onMouseWheel, { passive: false })); - } - } - _onMouseWheel(e) { - const classifier = MouseWheelClassifier.INSTANCE; - if (SCROLL_WHEEL_SMOOTH_SCROLL_ENABLED) { - const osZoomFactor = window.devicePixelRatio / Object(_browser_js__WEBPACK_IMPORTED_MODULE_12__["getZoomFactor"])(); - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_10__["isWindows"] || _common_platform_js__WEBPACK_IMPORTED_MODULE_10__["isLinux"]) { - // On Windows and Linux, the incoming delta events are multiplied with the OS zoom factor. - // The OS zoom factor can be reverse engineered by using the device pixel ratio and the configured zoom factor into account. - classifier.accept(Date.now(), e.deltaX / osZoomFactor, e.deltaY / osZoomFactor); - } - else { - classifier.accept(Date.now(), e.deltaX, e.deltaY); - } - } - // console.log(`${Date.now()}, ${e.deltaY}, ${e.deltaX}`); - if (e.deltaY || e.deltaX) { - let deltaY = e.deltaY * this._options.mouseWheelScrollSensitivity; - let deltaX = e.deltaX * this._options.mouseWheelScrollSensitivity; - if (this._options.scrollPredominantAxis) { - if (Math.abs(deltaY) >= Math.abs(deltaX)) { - deltaX = 0; - } - else { - deltaY = 0; - } - } - if (this._options.flipAxes) { - [deltaY, deltaX] = [deltaX, deltaY]; - } - // Convert vertical scrolling to horizontal if shift is held, this - // is handled at a higher level on Mac - const shiftConvert = !_common_platform_js__WEBPACK_IMPORTED_MODULE_10__["isMacintosh"] && e.browserEvent && e.browserEvent.shiftKey; - if ((this._options.scrollYToX || shiftConvert) && !deltaX) { - deltaX = deltaY; - deltaY = 0; - } - if (e.browserEvent && e.browserEvent.altKey) { - // fastScrolling - deltaX = deltaX * this._options.fastScrollSensitivity; - deltaY = deltaY * this._options.fastScrollSensitivity; - } - const futureScrollPosition = this._scrollable.getFutureScrollPosition(); - let desiredScrollPosition = {}; - if (deltaY) { - const desiredScrollTop = futureScrollPosition.scrollTop - SCROLL_WHEEL_SENSITIVITY * deltaY; - this._verticalScrollbar.writeScrollPosition(desiredScrollPosition, desiredScrollTop); - } - if (deltaX) { - const desiredScrollLeft = futureScrollPosition.scrollLeft - SCROLL_WHEEL_SENSITIVITY * deltaX; - this._horizontalScrollbar.writeScrollPosition(desiredScrollPosition, desiredScrollLeft); - } - // Check that we are scrolling towards a location which is valid - desiredScrollPosition = this._scrollable.validateScrollPosition(desiredScrollPosition); - if (futureScrollPosition.scrollLeft !== desiredScrollPosition.scrollLeft || futureScrollPosition.scrollTop !== desiredScrollPosition.scrollTop) { - const canPerformSmoothScroll = (SCROLL_WHEEL_SMOOTH_SCROLL_ENABLED - && this._options.mouseWheelSmoothScroll - && classifier.isPhysicalMouseWheel()); - if (canPerformSmoothScroll) { - this._scrollable.setScrollPositionSmooth(desiredScrollPosition); - } - else { - this._scrollable.setScrollPositionNow(desiredScrollPosition); - } - this._shouldRender = true; - } - } - if (this._options.alwaysConsumeMouseWheel || this._shouldRender) { - e.preventDefault(); - e.stopPropagation(); - } - } - _onDidScroll(e) { - this._shouldRender = this._horizontalScrollbar.onDidScroll(e) || this._shouldRender; - this._shouldRender = this._verticalScrollbar.onDidScroll(e) || this._shouldRender; - if (this._options.useShadows) { - this._shouldRender = true; - } - if (this._revealOnScroll) { - this._reveal(); - } - if (!this._options.lazyRender) { - this._render(); - } - } - /** - * Render / mutate the DOM now. - * Should be used together with the ctor option `lazyRender`. - */ - renderNow() { - if (!this._options.lazyRender) { - throw new Error('Please use `lazyRender` together with `renderNow`!'); - } - this._render(); - } - _render() { - if (!this._shouldRender) { - return; - } - this._shouldRender = false; - this._horizontalScrollbar.render(); - this._verticalScrollbar.render(); - if (this._options.useShadows) { - const scrollState = this._scrollable.getCurrentScrollPosition(); - let enableTop = scrollState.scrollTop > 0; - let enableLeft = scrollState.scrollLeft > 0; - this._leftShadowDomNode.setClassName('shadow' + (enableLeft ? ' left' : '')); - this._topShadowDomNode.setClassName('shadow' + (enableTop ? ' top' : '')); - this._topLeftShadowDomNode.setClassName('shadow top-left-corner' + (enableTop ? ' top' : '') + (enableLeft ? ' left' : '')); - } - } - // -------------------- fade in / fade out -------------------- - _onDragStart() { - this._isDragging = true; - this._reveal(); - } - _onDragEnd() { - this._isDragging = false; - this._hide(); - } - _onMouseOut(e) { - this._mouseIsOver = false; - this._hide(); - } - _onMouseOver(e) { - this._mouseIsOver = true; - this._reveal(); - } - _reveal() { - this._verticalScrollbar.beginReveal(); - this._horizontalScrollbar.beginReveal(); - this._scheduleHide(); - } - _hide() { - if (!this._mouseIsOver && !this._isDragging) { - this._verticalScrollbar.beginHide(); - this._horizontalScrollbar.beginHide(); - } - } - _scheduleHide() { - if (!this._mouseIsOver && !this._isDragging) { - this._hideTimeout.cancelAndSet(() => this._hide(), HIDE_TIMEOUT); - } - } -} -class ScrollableElement extends AbstractScrollableElement { - constructor(element, options) { - options = options || {}; - options.mouseWheelSmoothScroll = false; - const scrollable = new _common_scrollable_js__WEBPACK_IMPORTED_MODULE_11__["Scrollable"](0, (callback) => _dom_js__WEBPACK_IMPORTED_MODULE_1__["scheduleAtNextAnimationFrame"](callback)); - super(element, options, scrollable); - this._register(scrollable); - } - setScrollPosition(update) { - this._scrollable.setScrollPositionNow(update); - } -} -class SmoothScrollableElement extends AbstractScrollableElement { - constructor(element, options, scrollable) { - super(element, options, scrollable); - } - setScrollPosition(update) { - this._scrollable.setScrollPositionNow(update); - } - getScrollPosition() { - return this._scrollable.getCurrentScrollPosition(); - } -} -class DomScrollableElement extends ScrollableElement { - constructor(element, options) { - super(element, options); - this._element = element; - this.onScroll((e) => { - if (e.scrollTopChanged) { - this._element.scrollTop = e.scrollTop; - } - if (e.scrollLeftChanged) { - this._element.scrollLeft = e.scrollLeft; - } - }); - this.scanDomNode(); - } - scanDomNode() { - // width, scrollLeft, scrollWidth, height, scrollTop, scrollHeight - this.setScrollDimensions({ - width: this._element.clientWidth, - scrollWidth: this._element.scrollWidth, - height: this._element.clientHeight, - scrollHeight: this._element.scrollHeight - }); - this.setScrollPosition({ - scrollLeft: this._element.scrollLeft, - scrollTop: this._element.scrollTop, - }); - } -} -function resolveOptions(opts) { - let result = { - lazyRender: (typeof opts.lazyRender !== 'undefined' ? opts.lazyRender : false), - className: (typeof opts.className !== 'undefined' ? opts.className : ''), - useShadows: (typeof opts.useShadows !== 'undefined' ? opts.useShadows : true), - handleMouseWheel: (typeof opts.handleMouseWheel !== 'undefined' ? opts.handleMouseWheel : true), - flipAxes: (typeof opts.flipAxes !== 'undefined' ? opts.flipAxes : false), - alwaysConsumeMouseWheel: (typeof opts.alwaysConsumeMouseWheel !== 'undefined' ? opts.alwaysConsumeMouseWheel : false), - scrollYToX: (typeof opts.scrollYToX !== 'undefined' ? opts.scrollYToX : false), - mouseWheelScrollSensitivity: (typeof opts.mouseWheelScrollSensitivity !== 'undefined' ? opts.mouseWheelScrollSensitivity : 1), - fastScrollSensitivity: (typeof opts.fastScrollSensitivity !== 'undefined' ? opts.fastScrollSensitivity : 5), - scrollPredominantAxis: (typeof opts.scrollPredominantAxis !== 'undefined' ? opts.scrollPredominantAxis : true), - mouseWheelSmoothScroll: (typeof opts.mouseWheelSmoothScroll !== 'undefined' ? opts.mouseWheelSmoothScroll : true), - arrowSize: (typeof opts.arrowSize !== 'undefined' ? opts.arrowSize : 11), - listenOnDomNode: (typeof opts.listenOnDomNode !== 'undefined' ? opts.listenOnDomNode : null), - horizontal: (typeof opts.horizontal !== 'undefined' ? opts.horizontal : 1 /* Auto */), - horizontalScrollbarSize: (typeof opts.horizontalScrollbarSize !== 'undefined' ? opts.horizontalScrollbarSize : 10), - horizontalSliderSize: (typeof opts.horizontalSliderSize !== 'undefined' ? opts.horizontalSliderSize : 0), - horizontalHasArrows: (typeof opts.horizontalHasArrows !== 'undefined' ? opts.horizontalHasArrows : false), - vertical: (typeof opts.vertical !== 'undefined' ? opts.vertical : 1 /* Auto */), - verticalScrollbarSize: (typeof opts.verticalScrollbarSize !== 'undefined' ? opts.verticalScrollbarSize : 10), - verticalHasArrows: (typeof opts.verticalHasArrows !== 'undefined' ? opts.verticalHasArrows : false), - verticalSliderSize: (typeof opts.verticalSliderSize !== 'undefined' ? opts.verticalSliderSize : 0) - }; - result.horizontalSliderSize = (typeof opts.horizontalSliderSize !== 'undefined' ? opts.horizontalSliderSize : result.horizontalScrollbarSize); - result.verticalSliderSize = (typeof opts.verticalSliderSize !== 'undefined' ? opts.verticalSliderSize : result.verticalScrollbarSize); - // Defaults are different on Macs - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_10__["isMacintosh"]) { - result.className += ' mac'; - } - return result; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarArrow.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarArrow.js ***! - \***************************************************************************************/ -/*! exports provided: ARROW_IMG_SIZE, ScrollbarArrow */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARROW_IMG_SIZE", function() { return ARROW_IMG_SIZE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollbarArrow", function() { return ScrollbarArrow; }); -/* harmony import */ var _globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../globalMouseMoveMonitor.js */ "./node_modules/monaco-editor/esm/vs/base/browser/globalMouseMoveMonitor.js"); -/* harmony import */ var _widget_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../widget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"); -/* harmony import */ var _common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -/** - * The arrow image size. - */ -const ARROW_IMG_SIZE = 11; -class ScrollbarArrow extends _widget_js__WEBPACK_IMPORTED_MODULE_1__["Widget"] { - constructor(opts) { - super(); - this._onActivate = opts.onActivate; - this.bgDomNode = document.createElement('div'); - this.bgDomNode.className = 'arrow-background'; - this.bgDomNode.style.position = 'absolute'; - this.bgDomNode.style.width = opts.bgWidth + 'px'; - this.bgDomNode.style.height = opts.bgHeight + 'px'; - if (typeof opts.top !== 'undefined') { - this.bgDomNode.style.top = '0px'; - } - if (typeof opts.left !== 'undefined') { - this.bgDomNode.style.left = '0px'; - } - if (typeof opts.bottom !== 'undefined') { - this.bgDomNode.style.bottom = '0px'; - } - if (typeof opts.right !== 'undefined') { - this.bgDomNode.style.right = '0px'; - } - this.domNode = document.createElement('div'); - this.domNode.className = opts.className; - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addClasses"])(this.domNode, opts.icon.classNames); - this.domNode.style.position = 'absolute'; - this.domNode.style.width = ARROW_IMG_SIZE + 'px'; - this.domNode.style.height = ARROW_IMG_SIZE + 'px'; - if (typeof opts.top !== 'undefined') { - this.domNode.style.top = opts.top + 'px'; - } - if (typeof opts.left !== 'undefined') { - this.domNode.style.left = opts.left + 'px'; - } - if (typeof opts.bottom !== 'undefined') { - this.domNode.style.bottom = opts.bottom + 'px'; - } - if (typeof opts.right !== 'undefined') { - this.domNode.style.right = opts.right + 'px'; - } - this._mouseMoveMonitor = this._register(new _globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_0__["GlobalMouseMoveMonitor"]()); - this.onmousedown(this.bgDomNode, (e) => this._arrowMouseDown(e)); - this.onmousedown(this.domNode, (e) => this._arrowMouseDown(e)); - this._mousedownRepeatTimer = this._register(new _common_async_js__WEBPACK_IMPORTED_MODULE_2__["IntervalTimer"]()); - this._mousedownScheduleRepeatTimer = this._register(new _common_async_js__WEBPACK_IMPORTED_MODULE_2__["TimeoutTimer"]()); - } - _arrowMouseDown(e) { - let scheduleRepeater = () => { - this._mousedownRepeatTimer.cancelAndSet(() => this._onActivate(), 1000 / 24); - }; - this._onActivate(); - this._mousedownRepeatTimer.cancel(); - this._mousedownScheduleRepeatTimer.cancelAndSet(scheduleRepeater, 200); - this._mouseMoveMonitor.startMonitoring(e.target, e.buttons, _globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_0__["standardMouseMoveMerger"], (mouseMoveData) => { - /* Intentional empty */ - }, () => { - this._mousedownRepeatTimer.cancel(); - this._mousedownScheduleRepeatTimer.cancel(); - }); - e.preventDefault(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarState.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarState.js ***! - \***************************************************************************************/ -/*! exports provided: ScrollbarState */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollbarState", function() { return ScrollbarState; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * The minimal size of the slider (such that it can still be clickable) -- it is artificially enlarged. - */ -const MINIMUM_SLIDER_SIZE = 20; -class ScrollbarState { - constructor(arrowSize, scrollbarSize, oppositeScrollbarSize, visibleSize, scrollSize, scrollPosition) { - this._scrollbarSize = Math.round(scrollbarSize); - this._oppositeScrollbarSize = Math.round(oppositeScrollbarSize); - this._arrowSize = Math.round(arrowSize); - this._visibleSize = visibleSize; - this._scrollSize = scrollSize; - this._scrollPosition = scrollPosition; - this._computedAvailableSize = 0; - this._computedIsNeeded = false; - this._computedSliderSize = 0; - this._computedSliderRatio = 0; - this._computedSliderPosition = 0; - this._refreshComputedValues(); - } - clone() { - return new ScrollbarState(this._arrowSize, this._scrollbarSize, this._oppositeScrollbarSize, this._visibleSize, this._scrollSize, this._scrollPosition); - } - setVisibleSize(visibleSize) { - let iVisibleSize = Math.round(visibleSize); - if (this._visibleSize !== iVisibleSize) { - this._visibleSize = iVisibleSize; - this._refreshComputedValues(); - return true; - } - return false; - } - setScrollSize(scrollSize) { - let iScrollSize = Math.round(scrollSize); - if (this._scrollSize !== iScrollSize) { - this._scrollSize = iScrollSize; - this._refreshComputedValues(); - return true; - } - return false; - } - setScrollPosition(scrollPosition) { - let iScrollPosition = Math.round(scrollPosition); - if (this._scrollPosition !== iScrollPosition) { - this._scrollPosition = iScrollPosition; - this._refreshComputedValues(); - return true; - } - return false; - } - setScrollbarSize(scrollbarSize) { - this._scrollbarSize = scrollbarSize; - } - static _computeValues(oppositeScrollbarSize, arrowSize, visibleSize, scrollSize, scrollPosition) { - const computedAvailableSize = Math.max(0, visibleSize - oppositeScrollbarSize); - const computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * arrowSize); - const computedIsNeeded = (scrollSize > 0 && scrollSize > visibleSize); - if (!computedIsNeeded) { - // There is no need for a slider - return { - computedAvailableSize: Math.round(computedAvailableSize), - computedIsNeeded: computedIsNeeded, - computedSliderSize: Math.round(computedRepresentableSize), - computedSliderRatio: 0, - computedSliderPosition: 0, - }; - } - // We must artificially increase the size of the slider if needed, since the slider would be too small to grab with the mouse otherwise - const computedSliderSize = Math.round(Math.max(MINIMUM_SLIDER_SIZE, Math.floor(visibleSize * computedRepresentableSize / scrollSize))); - // The slider can move from 0 to `computedRepresentableSize` - `computedSliderSize` - // in the same way `scrollPosition` can move from 0 to `scrollSize` - `visibleSize`. - const computedSliderRatio = (computedRepresentableSize - computedSliderSize) / (scrollSize - visibleSize); - const computedSliderPosition = (scrollPosition * computedSliderRatio); - return { - computedAvailableSize: Math.round(computedAvailableSize), - computedIsNeeded: computedIsNeeded, - computedSliderSize: Math.round(computedSliderSize), - computedSliderRatio: computedSliderRatio, - computedSliderPosition: Math.round(computedSliderPosition), - }; - } - _refreshComputedValues() { - const r = ScrollbarState._computeValues(this._oppositeScrollbarSize, this._arrowSize, this._visibleSize, this._scrollSize, this._scrollPosition); - this._computedAvailableSize = r.computedAvailableSize; - this._computedIsNeeded = r.computedIsNeeded; - this._computedSliderSize = r.computedSliderSize; - this._computedSliderRatio = r.computedSliderRatio; - this._computedSliderPosition = r.computedSliderPosition; - } - getArrowSize() { - return this._arrowSize; - } - getScrollPosition() { - return this._scrollPosition; - } - getRectangleLargeSize() { - return this._computedAvailableSize; - } - getRectangleSmallSize() { - return this._scrollbarSize; - } - isNeeded() { - return this._computedIsNeeded; - } - getSliderSize() { - return this._computedSliderSize; - } - getSliderPosition() { - return this._computedSliderPosition; - } - /** - * Compute a desired `scrollPosition` such that `offset` ends up in the center of the slider. - * `offset` is based on the same coordinate system as the `sliderPosition`. - */ - getDesiredScrollPositionFromOffset(offset) { - if (!this._computedIsNeeded) { - // no need for a slider - return 0; - } - let desiredSliderPosition = offset - this._arrowSize - this._computedSliderSize / 2; - return Math.round(desiredSliderPosition / this._computedSliderRatio); - } - /** - * Compute a desired `scrollPosition` such that the slider moves by `delta`. - */ - getDesiredScrollPositionFromDelta(delta) { - if (!this._computedIsNeeded) { - // no need for a slider - return 0; - } - let desiredSliderPosition = this._computedSliderPosition + delta; - return Math.round(desiredSliderPosition / this._computedSliderRatio); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.js": -/*!******************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.js ***! - \******************************************************************************************************/ -/*! exports provided: ScrollbarVisibilityController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollbarVisibilityController", function() { return ScrollbarVisibilityController; }); -/* harmony import */ var _common_async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class ScrollbarVisibilityController extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(visibility, visibleClassName, invisibleClassName) { - super(); - this._visibility = visibility; - this._visibleClassName = visibleClassName; - this._invisibleClassName = invisibleClassName; - this._domNode = null; - this._isVisible = false; - this._isNeeded = false; - this._shouldBeVisible = false; - this._revealTimer = this._register(new _common_async_js__WEBPACK_IMPORTED_MODULE_0__["TimeoutTimer"]()); - } - // ----------------- Hide / Reveal - applyVisibilitySetting(shouldBeVisible) { - if (this._visibility === 2 /* Hidden */) { - return false; - } - if (this._visibility === 3 /* Visible */) { - return true; - } - return shouldBeVisible; - } - setShouldBeVisible(rawShouldBeVisible) { - let shouldBeVisible = this.applyVisibilitySetting(rawShouldBeVisible); - if (this._shouldBeVisible !== shouldBeVisible) { - this._shouldBeVisible = shouldBeVisible; - this.ensureVisibility(); - } - } - setIsNeeded(isNeeded) { - if (this._isNeeded !== isNeeded) { - this._isNeeded = isNeeded; - this.ensureVisibility(); - } - } - setDomNode(domNode) { - this._domNode = domNode; - this._domNode.setClassName(this._invisibleClassName); - // Now that the flags & the dom node are in a consistent state, ensure the Hidden/Visible configuration - this.setShouldBeVisible(false); - } - ensureVisibility() { - if (!this._isNeeded) { - // Nothing to be rendered - this._hide(false); - return; - } - if (this._shouldBeVisible) { - this._reveal(); - } - else { - this._hide(true); - } - } - _reveal() { - if (this._isVisible) { - return; - } - this._isVisible = true; - // The CSS animation doesn't play otherwise - this._revealTimer.setIfNotSet(() => { - if (this._domNode) { - this._domNode.setClassName(this._visibleClassName); - } - }, 0); - } - _hide(withFadeAway) { - this._revealTimer.cancel(); - if (!this._isVisible) { - return; - } - this._isVisible = false; - if (this._domNode) { - this._domNode.setClassName(this._invisibleClassName + (withFadeAway ? ' fade' : '')); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/verticalScrollbar.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/verticalScrollbar.js ***! - \******************************************************************************************/ -/*! exports provided: VerticalScrollbar */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VerticalScrollbar", function() { return VerticalScrollbar; }); -/* harmony import */ var _mouseEvent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/* harmony import */ var _abstractScrollbar_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./abstractScrollbar.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/abstractScrollbar.js"); -/* harmony import */ var _scrollbarArrow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scrollbarArrow.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarArrow.js"); -/* harmony import */ var _scrollbarState_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scrollbarState.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarState.js"); -/* harmony import */ var _common_codicons_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -const scrollbarButtonUpIcon = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_4__["registerIcon"])('scrollbar-button-up', _common_codicons_js__WEBPACK_IMPORTED_MODULE_4__["Codicon"].triangleUp); -const scrollbarButtonDownIcon = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_4__["registerIcon"])('scrollbar-button-down', _common_codicons_js__WEBPACK_IMPORTED_MODULE_4__["Codicon"].triangleDown); -class VerticalScrollbar extends _abstractScrollbar_js__WEBPACK_IMPORTED_MODULE_1__["AbstractScrollbar"] { - constructor(scrollable, options, host) { - const scrollDimensions = scrollable.getScrollDimensions(); - const scrollPosition = scrollable.getCurrentScrollPosition(); - super({ - lazyRender: options.lazyRender, - host: host, - scrollbarState: new _scrollbarState_js__WEBPACK_IMPORTED_MODULE_3__["ScrollbarState"]((options.verticalHasArrows ? options.arrowSize : 0), (options.vertical === 2 /* Hidden */ ? 0 : options.verticalScrollbarSize), - // give priority to vertical scroll bar over horizontal and let it scroll all the way to the bottom - 0, scrollDimensions.height, scrollDimensions.scrollHeight, scrollPosition.scrollTop), - visibility: options.vertical, - extraScrollbarClassName: 'vertical', - scrollable: scrollable - }); - if (options.verticalHasArrows) { - let arrowDelta = (options.arrowSize - _scrollbarArrow_js__WEBPACK_IMPORTED_MODULE_2__["ARROW_IMG_SIZE"]) / 2; - let scrollbarDelta = (options.verticalScrollbarSize - _scrollbarArrow_js__WEBPACK_IMPORTED_MODULE_2__["ARROW_IMG_SIZE"]) / 2; - this._createArrow({ - className: 'scra', - icon: scrollbarButtonUpIcon, - top: arrowDelta, - left: scrollbarDelta, - bottom: undefined, - right: undefined, - bgWidth: options.verticalScrollbarSize, - bgHeight: options.arrowSize, - onActivate: () => this._host.onMouseWheel(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_0__["StandardWheelEvent"](null, 0, 1)), - }); - this._createArrow({ - className: 'scra', - icon: scrollbarButtonDownIcon, - top: undefined, - left: scrollbarDelta, - bottom: arrowDelta, - right: undefined, - bgWidth: options.verticalScrollbarSize, - bgHeight: options.arrowSize, - onActivate: () => this._host.onMouseWheel(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_0__["StandardWheelEvent"](null, 0, -1)), - }); - } - this._createSlider(0, Math.floor((options.verticalScrollbarSize - options.verticalSliderSize) / 2), options.verticalSliderSize, undefined); - } - _updateSlider(sliderSize, sliderPosition) { - this.slider.setHeight(sliderSize); - this.slider.setTop(sliderPosition); - } - _renderDomNode(largeSize, smallSize) { - this.domNode.setWidth(smallSize); - this.domNode.setHeight(largeSize); - this.domNode.setRight(0); - this.domNode.setTop(0); - } - onDidScroll(e) { - this._shouldRender = this._onElementScrollSize(e.scrollHeight) || this._shouldRender; - this._shouldRender = this._onElementScrollPosition(e.scrollTop) || this._shouldRender; - this._shouldRender = this._onElementSize(e.height) || this._shouldRender; - return this._shouldRender; - } - _mouseDownRelativePosition(offsetX, offsetY) { - return offsetY; - } - _sliderMousePosition(e) { - return e.posy; - } - _sliderOrthogonalMousePosition(e) { - return e.posx; - } - _updateScrollbarSize(size) { - this.slider.setWidth(size); - } - writeScrollPosition(target, scrollPosition) { - target.scrollTop = scrollPosition; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/splitview/splitview.css": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/splitview/splitview.css ***! - \***********************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_splitview_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./splitview.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/splitview/splitview.css"); -/* harmony import */ var _css_loader_dist_cjs_js_splitview_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_splitview_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_splitview_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_splitview_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/splitview/splitview.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/splitview/splitview.js ***! - \**********************************************************************************/ -/*! exports provided: Sizing, SplitView */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sizing", function() { return Sizing; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SplitView", function() { return SplitView; }); -/* harmony import */ var _splitview_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./splitview.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/splitview/splitview.css"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _common_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_numbers_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/numbers.js */ "./node_modules/monaco-editor/esm/vs/base/common/numbers.js"); -/* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _sash_sash_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../sash/sash.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/sash/sash.js"); -/* harmony import */ var _common_color_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../event.js */ "./node_modules/monaco-editor/esm/vs/base/browser/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - -const defaultStyles = { - separatorBorder: _common_color_js__WEBPACK_IMPORTED_MODULE_8__["Color"].transparent -}; -class ViewItem { - constructor(container, view, size, disposable) { - this.container = container; - this.view = view; - this.disposable = disposable; - this._cachedVisibleSize = undefined; - if (typeof size === 'number') { - this._size = size; - this._cachedVisibleSize = undefined; - _dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"](container, 'visible'); - } - else { - this._size = 0; - this._cachedVisibleSize = size.cachedVisibleSize; - } - } - set size(size) { - this._size = size; - } - get size() { - return this._size; - } - get visible() { - return typeof this._cachedVisibleSize === 'undefined'; - } - setVisible(visible, size) { - if (visible === this.visible) { - return; - } - if (visible) { - this.size = Object(_common_numbers_js__WEBPACK_IMPORTED_MODULE_5__["clamp"])(this._cachedVisibleSize, this.viewMinimumSize, this.viewMaximumSize); - this._cachedVisibleSize = undefined; - } - else { - this._cachedVisibleSize = typeof size === 'number' ? size : this.size; - this.size = 0; - } - _dom_js__WEBPACK_IMPORTED_MODULE_4__["toggleClass"](this.container, 'visible', visible); - if (this.view.setVisible) { - this.view.setVisible(visible); - } - } - get minimumSize() { return this.visible ? this.view.minimumSize : 0; } - get viewMinimumSize() { return this.view.minimumSize; } - get maximumSize() { return this.visible ? this.view.maximumSize : 0; } - get viewMaximumSize() { return this.view.maximumSize; } - get priority() { return this.view.priority; } - get snap() { return !!this.view.snap; } - set enabled(enabled) { - this.container.style.pointerEvents = enabled ? '' : 'none'; - } - layout(offset, layoutContext) { - this.layoutContainer(offset); - this.view.layout(this.size, offset, layoutContext); - } - dispose() { - this.disposable.dispose(); - return this.view; - } -} -class VerticalViewItem extends ViewItem { - layoutContainer(offset) { - this.container.style.top = `${offset}px`; - this.container.style.height = `${this.size}px`; - } -} -class HorizontalViewItem extends ViewItem { - layoutContainer(offset) { - this.container.style.left = `${offset}px`; - this.container.style.width = `${this.size}px`; - } -} -var State; -(function (State) { - State[State["Idle"] = 0] = "Idle"; - State[State["Busy"] = 1] = "Busy"; -})(State || (State = {})); -var Sizing; -(function (Sizing) { - Sizing.Distribute = { type: 'distribute' }; - function Split(index) { return { type: 'split', index }; } - Sizing.Split = Split; - function Invisible(cachedVisibleSize) { return { type: 'invisible', cachedVisibleSize }; } - Sizing.Invisible = Invisible; -})(Sizing || (Sizing = {})); -class SplitView extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(container, options = {}) { - super(); - this.size = 0; - this.contentSize = 0; - this.proportions = undefined; - this.viewItems = []; - this.sashItems = []; - this.state = State.Idle; - this._onDidSashChange = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"]()); - this.onDidSashChange = this._onDidSashChange.event; - this._onDidSashReset = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"]()); - this._startSnappingEnabled = true; - this._endSnappingEnabled = true; - this.orientation = _common_types_js__WEBPACK_IMPORTED_MODULE_3__["isUndefined"](options.orientation) ? 0 /* VERTICAL */ : options.orientation; - this.inverseAltBehavior = !!options.inverseAltBehavior; - this.proportionalLayout = _common_types_js__WEBPACK_IMPORTED_MODULE_3__["isUndefined"](options.proportionalLayout) ? true : !!options.proportionalLayout; - this.el = document.createElement('div'); - _dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"](this.el, 'monaco-split-view2'); - _dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"](this.el, this.orientation === 0 /* VERTICAL */ ? 'vertical' : 'horizontal'); - container.appendChild(this.el); - this.sashContainer = _dom_js__WEBPACK_IMPORTED_MODULE_4__["append"](this.el, _dom_js__WEBPACK_IMPORTED_MODULE_4__["$"]('.sash-container')); - this.viewContainer = _dom_js__WEBPACK_IMPORTED_MODULE_4__["append"](this.el, _dom_js__WEBPACK_IMPORTED_MODULE_4__["$"]('.split-view-container')); - this.style(options.styles || defaultStyles); - // We have an existing set of view, add them now - if (options.descriptor) { - this.size = options.descriptor.size; - options.descriptor.views.forEach((viewDescriptor, index) => { - const sizing = _common_types_js__WEBPACK_IMPORTED_MODULE_3__["isUndefined"](viewDescriptor.visible) || viewDescriptor.visible ? viewDescriptor.size : { type: 'invisible', cachedVisibleSize: viewDescriptor.size }; - const view = viewDescriptor.view; - this.doAddView(view, sizing, index, true); - }); - // Initialize content size and proportions for first layout - this.contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); - this.saveProportions(); - } - } - get orthogonalStartSash() { return this._orthogonalStartSash; } - set orthogonalStartSash(sash) { - for (const sashItem of this.sashItems) { - sashItem.sash.orthogonalStartSash = sash; - } - this._orthogonalStartSash = sash; - } - get orthogonalEndSash() { return this._orthogonalEndSash; } - set orthogonalEndSash(sash) { - for (const sashItem of this.sashItems) { - sashItem.sash.orthogonalEndSash = sash; - } - this._orthogonalEndSash = sash; - } - get startSnappingEnabled() { return this._startSnappingEnabled; } - set startSnappingEnabled(startSnappingEnabled) { - if (this._startSnappingEnabled === startSnappingEnabled) { - return; - } - this._startSnappingEnabled = startSnappingEnabled; - this.updateSashEnablement(); - } - get endSnappingEnabled() { return this._endSnappingEnabled; } - set endSnappingEnabled(endSnappingEnabled) { - if (this._endSnappingEnabled === endSnappingEnabled) { - return; - } - this._endSnappingEnabled = endSnappingEnabled; - this.updateSashEnablement(); - } - style(styles) { - if (styles.separatorBorder.isTransparent()) { - _dom_js__WEBPACK_IMPORTED_MODULE_4__["removeClass"](this.el, 'separator-border'); - this.el.style.removeProperty('--separator-border'); - } - else { - _dom_js__WEBPACK_IMPORTED_MODULE_4__["addClass"](this.el, 'separator-border'); - this.el.style.setProperty('--separator-border', styles.separatorBorder.toString()); - } - } - addView(view, size, index = this.viewItems.length, skipLayout) { - this.doAddView(view, size, index, skipLayout); - } - layout(size, layoutContext) { - const previousSize = Math.max(this.size, this.contentSize); - this.size = size; - this.layoutContext = layoutContext; - if (!this.proportions) { - const indexes = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["range"])(this.viewItems.length); - const lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 1 /* Low */); - const highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 2 /* High */); - this.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes); - } - else { - for (let i = 0; i < this.viewItems.length; i++) { - const item = this.viewItems[i]; - item.size = Object(_common_numbers_js__WEBPACK_IMPORTED_MODULE_5__["clamp"])(Math.round(this.proportions[i] * size), item.minimumSize, item.maximumSize); - } - } - this.distributeEmptySpace(); - this.layoutViews(); - } - saveProportions() { - if (this.proportionalLayout && this.contentSize > 0) { - this.proportions = this.viewItems.map(i => i.size / this.contentSize); - } - } - onSashStart({ sash, start, alt }) { - for (const item of this.viewItems) { - item.enabled = false; - } - const index = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["firstIndex"])(this.sashItems, item => item.sash === sash); - // This way, we can press Alt while we resize a sash, macOS style! - const disposable = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["combinedDisposable"])(Object(_event_js__WEBPACK_IMPORTED_MODULE_9__["domEvent"])(document.body, 'keydown')(e => resetSashDragState(this.sashDragState.current, e.altKey)), Object(_event_js__WEBPACK_IMPORTED_MODULE_9__["domEvent"])(document.body, 'keyup')(() => resetSashDragState(this.sashDragState.current, false))); - const resetSashDragState = (start, alt) => { - const sizes = this.viewItems.map(i => i.size); - let minDelta = Number.NEGATIVE_INFINITY; - let maxDelta = Number.POSITIVE_INFINITY; - if (this.inverseAltBehavior) { - alt = !alt; - } - if (alt) { - // When we're using the last sash with Alt, we're resizing - // the view to the left/up, instead of right/down as usual - // Thus, we must do the inverse of the usual - const isLastSash = index === this.sashItems.length - 1; - if (isLastSash) { - const viewItem = this.viewItems[index]; - minDelta = (viewItem.minimumSize - viewItem.size) / 2; - maxDelta = (viewItem.maximumSize - viewItem.size) / 2; - } - else { - const viewItem = this.viewItems[index + 1]; - minDelta = (viewItem.size - viewItem.maximumSize) / 2; - maxDelta = (viewItem.size - viewItem.minimumSize) / 2; - } - } - let snapBefore; - let snapAfter; - if (!alt) { - const upIndexes = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["range"])(index, -1); - const downIndexes = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["range"])(index + 1, this.viewItems.length); - const minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0); - const maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].viewMaximumSize - sizes[i]), 0); - const maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0); - const minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].viewMaximumSize), 0); - const minDelta = Math.max(minDeltaUp, minDeltaDown); - const maxDelta = Math.min(maxDeltaDown, maxDeltaUp); - const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); - const snapAfterIndex = this.findFirstSnapIndex(downIndexes); - if (typeof snapBeforeIndex === 'number') { - const viewItem = this.viewItems[snapBeforeIndex]; - const halfSize = Math.floor(viewItem.viewMinimumSize / 2); - snapBefore = { - index: snapBeforeIndex, - limitDelta: viewItem.visible ? minDelta - halfSize : minDelta + halfSize, - size: viewItem.size - }; - } - if (typeof snapAfterIndex === 'number') { - const viewItem = this.viewItems[snapAfterIndex]; - const halfSize = Math.floor(viewItem.viewMinimumSize / 2); - snapAfter = { - index: snapAfterIndex, - limitDelta: viewItem.visible ? maxDelta + halfSize : maxDelta - halfSize, - size: viewItem.size - }; - } - } - this.sashDragState = { start, current: start, index, sizes, minDelta, maxDelta, alt, snapBefore, snapAfter, disposable }; - }; - resetSashDragState(start, alt); - } - onSashChange({ current }) { - const { index, start, sizes, alt, minDelta, maxDelta, snapBefore, snapAfter } = this.sashDragState; - this.sashDragState.current = current; - const delta = current - start; - const newDelta = this.resize(index, delta, sizes, undefined, undefined, minDelta, maxDelta, snapBefore, snapAfter); - if (alt) { - const isLastSash = index === this.sashItems.length - 1; - const newSizes = this.viewItems.map(i => i.size); - const viewItemIndex = isLastSash ? index : index + 1; - const viewItem = this.viewItems[viewItemIndex]; - const newMinDelta = viewItem.size - viewItem.maximumSize; - const newMaxDelta = viewItem.size - viewItem.minimumSize; - const resizeIndex = isLastSash ? index - 1 : index + 1; - this.resize(resizeIndex, -newDelta, newSizes, undefined, undefined, newMinDelta, newMaxDelta); - } - this.distributeEmptySpace(); - this.layoutViews(); - } - onSashEnd(index) { - this._onDidSashChange.fire(index); - this.sashDragState.disposable.dispose(); - this.saveProportions(); - for (const item of this.viewItems) { - item.enabled = true; - } - } - onViewChange(item, size) { - const index = this.viewItems.indexOf(item); - if (index < 0 || index >= this.viewItems.length) { - return; - } - size = typeof size === 'number' ? size : item.size; - size = Object(_common_numbers_js__WEBPACK_IMPORTED_MODULE_5__["clamp"])(size, item.minimumSize, item.maximumSize); - if (this.inverseAltBehavior && index > 0) { - // In this case, we want the view to grow or shrink both sides equally - // so we just resize the "left" side by half and let `resize` do the clamping magic - this.resize(index - 1, Math.floor((item.size - size) / 2)); - this.distributeEmptySpace(); - this.layoutViews(); - } - else { - item.size = size; - this.relayout([index], undefined); - } - } - resizeView(index, size) { - if (this.state !== State.Idle) { - throw new Error('Cant modify splitview'); - } - this.state = State.Busy; - if (index < 0 || index >= this.viewItems.length) { - return; - } - const indexes = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["range"])(this.viewItems.length).filter(i => i !== index); - const lowPriorityIndexes = [...indexes.filter(i => this.viewItems[i].priority === 1 /* Low */), index]; - const highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 2 /* High */); - const item = this.viewItems[index]; - size = Math.round(size); - size = Object(_common_numbers_js__WEBPACK_IMPORTED_MODULE_5__["clamp"])(size, item.minimumSize, Math.min(item.maximumSize, this.size)); - item.size = size; - this.relayout(lowPriorityIndexes, highPriorityIndexes); - this.state = State.Idle; - } - distributeViewSizes() { - const flexibleViewItems = []; - let flexibleSize = 0; - for (const item of this.viewItems) { - if (item.maximumSize - item.minimumSize > 0) { - flexibleViewItems.push(item); - flexibleSize += item.size; - } - } - const size = Math.floor(flexibleSize / flexibleViewItems.length); - for (const item of flexibleViewItems) { - item.size = Object(_common_numbers_js__WEBPACK_IMPORTED_MODULE_5__["clamp"])(size, item.minimumSize, item.maximumSize); - } - const indexes = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["range"])(this.viewItems.length); - const lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 1 /* Low */); - const highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 2 /* High */); - this.relayout(lowPriorityIndexes, highPriorityIndexes); - } - getViewSize(index) { - if (index < 0 || index >= this.viewItems.length) { - return -1; - } - return this.viewItems[index].size; - } - doAddView(view, size, index = this.viewItems.length, skipLayout) { - if (this.state !== State.Idle) { - throw new Error('Cant modify splitview'); - } - this.state = State.Busy; - // Add view - const container = _dom_js__WEBPACK_IMPORTED_MODULE_4__["$"]('.split-view-view'); - if (index === this.viewItems.length) { - this.viewContainer.appendChild(container); - } - else { - this.viewContainer.insertBefore(container, this.viewContainer.children.item(index)); - } - const onChangeDisposable = view.onDidChange(size => this.onViewChange(item, size)); - const containerDisposable = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => this.viewContainer.removeChild(container)); - const disposable = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["combinedDisposable"])(onChangeDisposable, containerDisposable); - let viewSize; - if (typeof size === 'number') { - viewSize = size; - } - else if (size.type === 'split') { - viewSize = this.getViewSize(size.index) / 2; - } - else if (size.type === 'invisible') { - viewSize = { cachedVisibleSize: size.cachedVisibleSize }; - } - else { - viewSize = view.minimumSize; - } - const item = this.orientation === 0 /* VERTICAL */ - ? new VerticalViewItem(container, view, viewSize, disposable) - : new HorizontalViewItem(container, view, viewSize, disposable); - this.viewItems.splice(index, 0, item); - // Add sash - if (this.viewItems.length > 1) { - const sash = this.orientation === 0 /* VERTICAL */ - ? new _sash_sash_js__WEBPACK_IMPORTED_MODULE_7__["Sash"](this.sashContainer, { getHorizontalSashTop: (sash) => this.getSashPosition(sash) }, { - orientation: 1 /* HORIZONTAL */, - orthogonalStartSash: this.orthogonalStartSash, - orthogonalEndSash: this.orthogonalEndSash - }) - : new _sash_sash_js__WEBPACK_IMPORTED_MODULE_7__["Sash"](this.sashContainer, { getVerticalSashLeft: (sash) => this.getSashPosition(sash) }, { - orientation: 0 /* VERTICAL */, - orthogonalStartSash: this.orthogonalStartSash, - orthogonalEndSash: this.orthogonalEndSash - }); - const sashEventMapper = this.orientation === 0 /* VERTICAL */ - ? (e) => ({ sash, start: e.startY, current: e.currentY, alt: e.altKey }) - : (e) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey }); - const onStart = _common_event_js__WEBPACK_IMPORTED_MODULE_2__["Event"].map(sash.onDidStart, sashEventMapper); - const onStartDisposable = onStart(this.onSashStart, this); - const onChange = _common_event_js__WEBPACK_IMPORTED_MODULE_2__["Event"].map(sash.onDidChange, sashEventMapper); - const onChangeDisposable = onChange(this.onSashChange, this); - const onEnd = _common_event_js__WEBPACK_IMPORTED_MODULE_2__["Event"].map(sash.onDidEnd, () => Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["firstIndex"])(this.sashItems, item => item.sash === sash)); - const onEndDisposable = onEnd(this.onSashEnd, this); - const onDidResetDisposable = sash.onDidReset(() => { - const index = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["firstIndex"])(this.sashItems, item => item.sash === sash); - const upIndexes = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["range"])(index, -1); - const downIndexes = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["range"])(index + 1, this.viewItems.length); - const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); - const snapAfterIndex = this.findFirstSnapIndex(downIndexes); - if (typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible) { - return; - } - if (typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible) { - return; - } - this._onDidSashReset.fire(index); - }); - const disposable = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["combinedDisposable"])(onStartDisposable, onChangeDisposable, onEndDisposable, onDidResetDisposable, sash); - const sashItem = { sash, disposable }; - this.sashItems.splice(index - 1, 0, sashItem); - } - container.appendChild(view.element); - let highPriorityIndexes; - if (typeof size !== 'number' && size.type === 'split') { - highPriorityIndexes = [size.index]; - } - if (!skipLayout) { - this.relayout([index], highPriorityIndexes); - } - this.state = State.Idle; - if (!skipLayout && typeof size !== 'number' && size.type === 'distribute') { - this.distributeViewSizes(); - } - } - relayout(lowPriorityIndexes, highPriorityIndexes) { - const contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); - this.resize(this.viewItems.length - 1, this.size - contentSize, undefined, lowPriorityIndexes, highPriorityIndexes); - this.distributeEmptySpace(); - this.layoutViews(); - this.saveProportions(); - } - resize(index, delta, sizes = this.viewItems.map(i => i.size), lowPriorityIndexes, highPriorityIndexes, overloadMinDelta = Number.NEGATIVE_INFINITY, overloadMaxDelta = Number.POSITIVE_INFINITY, snapBefore, snapAfter) { - if (index < 0 || index >= this.viewItems.length) { - return 0; - } - const upIndexes = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["range"])(index, -1); - const downIndexes = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["range"])(index + 1, this.viewItems.length); - if (highPriorityIndexes) { - for (const index of highPriorityIndexes) { - Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["pushToStart"])(upIndexes, index); - Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["pushToStart"])(downIndexes, index); - } - } - if (lowPriorityIndexes) { - for (const index of lowPriorityIndexes) { - Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["pushToEnd"])(upIndexes, index); - Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["pushToEnd"])(downIndexes, index); - } - } - const upItems = upIndexes.map(i => this.viewItems[i]); - const upSizes = upIndexes.map(i => sizes[i]); - const downItems = downIndexes.map(i => this.viewItems[i]); - const downSizes = downIndexes.map(i => sizes[i]); - const minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0); - const maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].maximumSize - sizes[i]), 0); - const maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0); - const minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].maximumSize), 0); - const minDelta = Math.max(minDeltaUp, minDeltaDown, overloadMinDelta); - const maxDelta = Math.min(maxDeltaDown, maxDeltaUp, overloadMaxDelta); - let snapped = false; - if (snapBefore) { - const snapView = this.viewItems[snapBefore.index]; - const visible = delta >= snapBefore.limitDelta; - snapped = visible !== snapView.visible; - snapView.setVisible(visible, snapBefore.size); - } - if (!snapped && snapAfter) { - const snapView = this.viewItems[snapAfter.index]; - const visible = delta < snapAfter.limitDelta; - snapped = visible !== snapView.visible; - snapView.setVisible(visible, snapAfter.size); - } - if (snapped) { - return this.resize(index, delta, sizes, lowPriorityIndexes, highPriorityIndexes, overloadMinDelta, overloadMaxDelta); - } - delta = Object(_common_numbers_js__WEBPACK_IMPORTED_MODULE_5__["clamp"])(delta, minDelta, maxDelta); - for (let i = 0, deltaUp = delta; i < upItems.length; i++) { - const item = upItems[i]; - const size = Object(_common_numbers_js__WEBPACK_IMPORTED_MODULE_5__["clamp"])(upSizes[i] + deltaUp, item.minimumSize, item.maximumSize); - const viewDelta = size - upSizes[i]; - deltaUp -= viewDelta; - item.size = size; - } - for (let i = 0, deltaDown = delta; i < downItems.length; i++) { - const item = downItems[i]; - const size = Object(_common_numbers_js__WEBPACK_IMPORTED_MODULE_5__["clamp"])(downSizes[i] - deltaDown, item.minimumSize, item.maximumSize); - const viewDelta = size - downSizes[i]; - deltaDown += viewDelta; - item.size = size; - } - return delta; - } - distributeEmptySpace(lowPriorityIndex) { - const contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); - let emptyDelta = this.size - contentSize; - const indexes = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["range"])(this.viewItems.length - 1, -1); - const lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 1 /* Low */); - const highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 2 /* High */); - for (const index of highPriorityIndexes) { - Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["pushToStart"])(indexes, index); - } - for (const index of lowPriorityIndexes) { - Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["pushToEnd"])(indexes, index); - } - if (typeof lowPriorityIndex === 'number') { - Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["pushToEnd"])(indexes, lowPriorityIndex); - } - for (let i = 0; emptyDelta !== 0 && i < indexes.length; i++) { - const item = this.viewItems[indexes[i]]; - const size = Object(_common_numbers_js__WEBPACK_IMPORTED_MODULE_5__["clamp"])(item.size + emptyDelta, item.minimumSize, item.maximumSize); - const viewDelta = size - item.size; - emptyDelta -= viewDelta; - item.size = size; - } - } - layoutViews() { - // Save new content size - this.contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); - // Layout views - let offset = 0; - for (const viewItem of this.viewItems) { - viewItem.layout(offset, this.layoutContext); - offset += viewItem.size; - } - // Layout sashes - this.sashItems.forEach(item => item.sash.layout()); - this.updateSashEnablement(); - } - updateSashEnablement() { - let previous = false; - const collapsesDown = this.viewItems.map(i => previous = (i.size - i.minimumSize > 0) || previous); - previous = false; - const expandsDown = this.viewItems.map(i => previous = (i.maximumSize - i.size > 0) || previous); - const reverseViews = [...this.viewItems].reverse(); - previous = false; - const collapsesUp = reverseViews.map(i => previous = (i.size - i.minimumSize > 0) || previous).reverse(); - previous = false; - const expandsUp = reverseViews.map(i => previous = (i.maximumSize - i.size > 0) || previous).reverse(); - let position = 0; - for (let index = 0; index < this.sashItems.length; index++) { - const { sash } = this.sashItems[index]; - const viewItem = this.viewItems[index]; - position += viewItem.size; - const min = !(collapsesDown[index] && expandsUp[index + 1]); - const max = !(expandsDown[index] && collapsesUp[index + 1]); - if (min && max) { - const upIndexes = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["range"])(index, -1); - const downIndexes = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["range"])(index + 1, this.viewItems.length); - const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); - const snapAfterIndex = this.findFirstSnapIndex(downIndexes); - const snappedBefore = typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible; - const snappedAfter = typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible; - if (snappedBefore && collapsesUp[index] && (position > 0 || this.startSnappingEnabled)) { - sash.state = 1 /* Minimum */; - } - else if (snappedAfter && collapsesDown[index] && (position < this.contentSize || this.endSnappingEnabled)) { - sash.state = 2 /* Maximum */; - } - else { - sash.state = 0 /* Disabled */; - } - } - else if (min && !max) { - sash.state = 1 /* Minimum */; - } - else if (!min && max) { - sash.state = 2 /* Maximum */; - } - else { - sash.state = 3 /* Enabled */; - } - } - } - getSashPosition(sash) { - let position = 0; - for (let i = 0; i < this.sashItems.length; i++) { - position += this.viewItems[i].size; - if (this.sashItems[i].sash === sash) { - return position; - } - } - return 0; - } - findFirstSnapIndex(indexes) { - // visible views first - for (const index of indexes) { - const viewItem = this.viewItems[index]; - if (!viewItem.visible) { - continue; - } - if (viewItem.snap) { - return index; - } - } - // then, hidden views - for (const index of indexes) { - const viewItem = this.viewItems[index]; - if (viewItem.visible && viewItem.maximumSize - viewItem.minimumSize > 0) { - return undefined; - } - if (!viewItem.visible && viewItem.snap) { - return index; - } - } - return undefined; - } - dispose() { - super.dispose(); - this.viewItems.forEach(i => i.dispose()); - this.viewItems = []; - this.sashItems.forEach(i => i.disposable.dispose()); - this.sashItems = []; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/abstractTree.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/abstractTree.js ***! - \********************************************************************************/ -/*! exports provided: ComposedTreeDelegate, RenderIndentGuides, AbstractTree */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComposedTreeDelegate", function() { return ComposedTreeDelegate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderIndentGuides", function() { return RenderIndentGuides; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractTree", function() { return AbstractTree; }); -/* harmony import */ var _media_tree_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/tree.css */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/media/tree.css"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../list/listWidget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listWidget.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../keyboardEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js"); -/* harmony import */ var _tree_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tree.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/tree.js"); -/* harmony import */ var _dnd_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../dnd.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dnd.js"); -/* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _list_listView_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../list/listView.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listView.js"); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../event.js */ "./node_modules/monaco-editor/esm/vs/base/browser/event.js"); -/* harmony import */ var _common_filters_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../common/filters.js */ "./node_modules/monaco-editor/esm/vs/base/common/filters.js"); -/* harmony import */ var _indexTreeModel_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./indexTreeModel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/indexTreeModel.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _common_async_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _common_numbers_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../common/numbers.js */ "./node_modules/monaco-editor/esm/vs/base/common/numbers.js"); -/* harmony import */ var _common_collections_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../common/collections.js */ "./node_modules/monaco-editor/esm/vs/base/common/collections.js"); -/* harmony import */ var _treeIcons_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./treeIcons.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/treeIcons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - - - -class TreeElementsDragAndDropData extends _list_listView_js__WEBPACK_IMPORTED_MODULE_9__["ElementsDragAndDropData"] { - constructor(data) { - super(data.elements.map(node => node.element)); - this.data = data; - } -} -function asTreeDragAndDropData(data) { - if (data instanceof _list_listView_js__WEBPACK_IMPORTED_MODULE_9__["ElementsDragAndDropData"]) { - return new TreeElementsDragAndDropData(data); - } - return data; -} -class TreeNodeListDragAndDrop { - constructor(modelProvider, dnd) { - this.modelProvider = modelProvider; - this.dnd = dnd; - this.autoExpandDisposable = _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - } - getDragURI(node) { - return this.dnd.getDragURI(node.element); - } - getDragLabel(nodes, originalEvent) { - if (this.dnd.getDragLabel) { - return this.dnd.getDragLabel(nodes.map(node => node.element), originalEvent); - } - return undefined; - } - onDragStart(data, originalEvent) { - if (this.dnd.onDragStart) { - this.dnd.onDragStart(asTreeDragAndDropData(data), originalEvent); - } - } - onDragOver(data, targetNode, targetIndex, originalEvent, raw = true) { - const result = this.dnd.onDragOver(asTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, originalEvent); - const didChangeAutoExpandNode = this.autoExpandNode !== targetNode; - if (didChangeAutoExpandNode) { - this.autoExpandDisposable.dispose(); - this.autoExpandNode = targetNode; - } - if (typeof targetNode === 'undefined') { - return result; - } - if (didChangeAutoExpandNode && typeof result !== 'boolean' && result.autoExpand) { - this.autoExpandDisposable = Object(_common_async_js__WEBPACK_IMPORTED_MODULE_14__["disposableTimeout"])(() => { - const model = this.modelProvider(); - const ref = model.getNodeLocation(targetNode); - if (model.isCollapsed(ref)) { - model.setCollapsed(ref, false); - } - this.autoExpandNode = undefined; - }, 500); - } - if (typeof result === 'boolean' || !result.accept || typeof result.bubble === 'undefined' || result.feedback) { - if (!raw) { - const accept = typeof result === 'boolean' ? result : result.accept; - const effect = typeof result === 'boolean' ? undefined : result.effect; - return { accept, effect, feedback: [targetIndex] }; - } - return result; - } - if (result.bubble === 1 /* Up */) { - const model = this.modelProvider(); - const ref = model.getNodeLocation(targetNode); - const parentRef = model.getParentNodeLocation(ref); - const parentNode = model.getNode(parentRef); - const parentIndex = parentRef && model.getListIndex(parentRef); - return this.onDragOver(data, parentNode, parentIndex, originalEvent, false); - } - const model = this.modelProvider(); - const ref = model.getNodeLocation(targetNode); - const start = model.getListIndex(ref); - const length = model.getListRenderCount(ref); - return Object.assign(Object.assign({}, result), { feedback: Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_8__["range"])(start, start + length) }); - } - drop(data, targetNode, targetIndex, originalEvent) { - this.autoExpandDisposable.dispose(); - this.autoExpandNode = undefined; - this.dnd.drop(asTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, originalEvent); - } - onDragEnd(originalEvent) { - if (this.dnd.onDragEnd) { - this.dnd.onDragEnd(originalEvent); - } - } -} -function asListOptions(modelProvider, options) { - return options && Object.assign(Object.assign({}, options), { identityProvider: options.identityProvider && { - getId(el) { - return options.identityProvider.getId(el.element); - } - }, dnd: options.dnd && new TreeNodeListDragAndDrop(modelProvider, options.dnd), multipleSelectionController: options.multipleSelectionController && { - isSelectionSingleChangeEvent(e) { - return options.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({}, e), { element: e.element })); - }, - isSelectionRangeChangeEvent(e) { - return options.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({}, e), { element: e.element })); - } - }, accessibilityProvider: options.accessibilityProvider && Object.assign(Object.assign({}, options.accessibilityProvider), { getSetSize(node) { - const model = modelProvider(); - const ref = model.getNodeLocation(node); - const parentRef = model.getParentNodeLocation(ref); - const parentNode = model.getNode(parentRef); - return parentNode.visibleChildrenCount; - }, - getPosInSet(node) { - return node.visibleChildIndex + 1; - }, isChecked: options.accessibilityProvider && options.accessibilityProvider.isChecked ? (node) => { - return options.accessibilityProvider.isChecked(node.element); - } : undefined, getRole: options.accessibilityProvider && options.accessibilityProvider.getRole ? (node) => { - return options.accessibilityProvider.getRole(node.element); - } : () => 'treeitem', getAriaLabel(e) { - return options.accessibilityProvider.getAriaLabel(e.element); - }, - getWidgetAriaLabel() { - return options.accessibilityProvider.getWidgetAriaLabel(); - }, getWidgetRole: options.accessibilityProvider && options.accessibilityProvider.getWidgetRole ? () => options.accessibilityProvider.getWidgetRole() : () => 'tree', getAriaLevel(node) { - return node.depth; - }, getActiveDescendantId: options.accessibilityProvider.getActiveDescendantId && (node => { - return options.accessibilityProvider.getActiveDescendantId(node.element); - }) }), keyboardNavigationLabelProvider: options.keyboardNavigationLabelProvider && Object.assign(Object.assign({}, options.keyboardNavigationLabelProvider), { getKeyboardNavigationLabel(node) { - return options.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(node.element); - } }), enableKeyboardNavigation: options.simpleKeyboardNavigation }); -} -class ComposedTreeDelegate { - constructor(delegate) { - this.delegate = delegate; - } - getHeight(element) { - return this.delegate.getHeight(element.element); - } - getTemplateId(element) { - return this.delegate.getTemplateId(element.element); - } - hasDynamicHeight(element) { - return !!this.delegate.hasDynamicHeight && this.delegate.hasDynamicHeight(element.element); - } - setDynamicHeight(element, height) { - if (this.delegate.setDynamicHeight) { - this.delegate.setDynamicHeight(element.element, height); - } - } -} -var RenderIndentGuides; -(function (RenderIndentGuides) { - RenderIndentGuides["None"] = "none"; - RenderIndentGuides["OnHover"] = "onHover"; - RenderIndentGuides["Always"] = "always"; -})(RenderIndentGuides || (RenderIndentGuides = {})); -class EventCollection { - constructor(onDidChange, _elements = []) { - this._elements = _elements; - this.onDidChange = _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].forEach(onDidChange, elements => this._elements = elements); - } - get elements() { - return this._elements; - } -} -class TreeRenderer { - constructor(renderer, modelProvider, onDidChangeCollapseState, activeNodes, options = {}) { - this.renderer = renderer; - this.modelProvider = modelProvider; - this.activeNodes = activeNodes; - this.renderedElements = new Map(); - this.renderedNodes = new Map(); - this.indent = TreeRenderer.DefaultIndent; - this.hideTwistiesOfChildlessElements = false; - this.shouldRenderIndentGuides = false; - this.renderedIndentGuides = new _common_collections_js__WEBPACK_IMPORTED_MODULE_17__["SetMap"](); - this.activeIndentNodes = new Set(); - this.indentGuidesDisposable = _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - this.disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this.templateId = renderer.templateId; - this.updateOptions(options); - _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(onDidChangeCollapseState, e => e.node)(this.onDidChangeNodeTwistieState, this, this.disposables); - if (renderer.onDidChangeTwistieState) { - renderer.onDidChangeTwistieState(this.onDidChangeTwistieState, this, this.disposables); - } - } - updateOptions(options = {}) { - if (typeof options.indent !== 'undefined') { - this.indent = Object(_common_numbers_js__WEBPACK_IMPORTED_MODULE_16__["clamp"])(options.indent, 0, 40); - } - if (typeof options.renderIndentGuides !== 'undefined') { - const shouldRenderIndentGuides = options.renderIndentGuides !== RenderIndentGuides.None; - if (shouldRenderIndentGuides !== this.shouldRenderIndentGuides) { - this.shouldRenderIndentGuides = shouldRenderIndentGuides; - this.indentGuidesDisposable.dispose(); - if (shouldRenderIndentGuides) { - const disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this.activeNodes.onDidChange(this._onDidChangeActiveNodes, this, disposables); - this.indentGuidesDisposable = disposables; - this._onDidChangeActiveNodes(this.activeNodes.elements); - } - } - } - if (typeof options.hideTwistiesOfChildlessElements !== 'undefined') { - this.hideTwistiesOfChildlessElements = options.hideTwistiesOfChildlessElements; - } - } - renderTemplate(container) { - const el = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["append"])(container, Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])('.monaco-tl-row')); - const indent = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["append"])(el, Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])('.monaco-tl-indent')); - const twistie = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["append"])(el, Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])('.monaco-tl-twistie')); - const contents = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["append"])(el, Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])('.monaco-tl-contents')); - const templateData = this.renderer.renderTemplate(contents); - return { container, indent, twistie, indentGuidesDisposable: _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None, templateData }; - } - renderElement(node, index, templateData, height) { - if (typeof height === 'number') { - this.renderedNodes.set(node, { templateData, height }); - this.renderedElements.set(node.element, node); - } - const indent = TreeRenderer.DefaultIndent + (node.depth - 1) * this.indent; - templateData.twistie.style.paddingLeft = `${indent}px`; - templateData.indent.style.width = `${indent + this.indent - 16}px`; - this.renderTwistie(node, templateData); - if (typeof height === 'number') { - this.renderIndentGuides(node, templateData); - } - this.renderer.renderElement(node, index, templateData.templateData, height); - } - disposeElement(node, index, templateData, height) { - templateData.indentGuidesDisposable.dispose(); - if (this.renderer.disposeElement) { - this.renderer.disposeElement(node, index, templateData.templateData, height); - } - if (typeof height === 'number') { - this.renderedNodes.delete(node); - this.renderedElements.delete(node.element); - } - } - disposeTemplate(templateData) { - this.renderer.disposeTemplate(templateData.templateData); - } - onDidChangeTwistieState(element) { - const node = this.renderedElements.get(element); - if (!node) { - return; - } - this.onDidChangeNodeTwistieState(node); - } - onDidChangeNodeTwistieState(node) { - const data = this.renderedNodes.get(node); - if (!data) { - return; - } - this.renderTwistie(node, data.templateData); - this._onDidChangeActiveNodes(this.activeNodes.elements); - this.renderIndentGuides(node, data.templateData); - } - renderTwistie(node, templateData) { - if (this.renderer.renderTwistie) { - this.renderer.renderTwistie(node.element, templateData.twistie); - } - if (node.collapsible && (!this.hideTwistiesOfChildlessElements || node.visibleChildrenCount > 0)) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addClasses"])(templateData.twistie, _treeIcons_js__WEBPACK_IMPORTED_MODULE_18__["treeItemExpandedIcon"].classNames, 'collapsible'); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(templateData.twistie, 'collapsed', node.collapsed); - } - else { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["removeClasses"])(templateData.twistie, _treeIcons_js__WEBPACK_IMPORTED_MODULE_18__["treeItemExpandedIcon"].classNames, 'collapsible', 'collapsed'); - } - if (node.collapsible) { - templateData.container.setAttribute('aria-expanded', String(!node.collapsed)); - } - else { - templateData.container.removeAttribute('aria-expanded'); - } - } - renderIndentGuides(target, templateData) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["clearNode"])(templateData.indent); - templateData.indentGuidesDisposable.dispose(); - if (!this.shouldRenderIndentGuides) { - return; - } - const disposableStore = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - const model = this.modelProvider(); - let node = target; - while (true) { - const ref = model.getNodeLocation(node); - const parentRef = model.getParentNodeLocation(ref); - if (!parentRef) { - break; - } - const parent = model.getNode(parentRef); - const guide = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])('.indent-guide', { style: `width: ${this.indent}px` }); - if (this.activeIndentNodes.has(parent)) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addClass"])(guide, 'active'); - } - if (templateData.indent.childElementCount === 0) { - templateData.indent.appendChild(guide); - } - else { - templateData.indent.insertBefore(guide, templateData.indent.firstElementChild); - } - this.renderedIndentGuides.add(parent, guide); - disposableStore.add(Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => this.renderedIndentGuides.delete(parent, guide))); - node = parent; - } - templateData.indentGuidesDisposable = disposableStore; - } - _onDidChangeActiveNodes(nodes) { - if (!this.shouldRenderIndentGuides) { - return; - } - const set = new Set(); - const model = this.modelProvider(); - nodes.forEach(node => { - const ref = model.getNodeLocation(node); - try { - const parentRef = model.getParentNodeLocation(ref); - if (node.collapsible && node.children.length > 0 && !node.collapsed) { - set.add(node); - } - else if (parentRef) { - set.add(model.getNode(parentRef)); - } - } - catch (_a) { - // noop - } - }); - this.activeIndentNodes.forEach(node => { - if (!set.has(node)) { - this.renderedIndentGuides.forEach(node, line => Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["removeClass"])(line, 'active')); - } - }); - set.forEach(node => { - if (!this.activeIndentNodes.has(node)) { - this.renderedIndentGuides.forEach(node, line => Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addClass"])(line, 'active')); - } - }); - this.activeIndentNodes = set; - } - dispose() { - this.renderedNodes.clear(); - this.renderedElements.clear(); - this.indentGuidesDisposable.dispose(); - Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this.disposables); - } -} -TreeRenderer.DefaultIndent = 8; -class TypeFilter { - constructor(tree, keyboardNavigationLabelProvider, _filter) { - this.tree = tree; - this.keyboardNavigationLabelProvider = keyboardNavigationLabelProvider; - this._filter = _filter; - this._totalCount = 0; - this._matchCount = 0; - this._pattern = ''; - this._lowercasePattern = ''; - this.disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - tree.onWillRefilter(this.reset, this, this.disposables); - } - get totalCount() { return this._totalCount; } - get matchCount() { return this._matchCount; } - set pattern(pattern) { - this._pattern = pattern; - this._lowercasePattern = pattern.toLowerCase(); - } - filter(element, parentVisibility) { - if (this._filter) { - const result = this._filter.filter(element, parentVisibility); - if (this.tree.options.simpleKeyboardNavigation) { - return result; - } - let visibility; - if (typeof result === 'boolean') { - visibility = result ? 1 /* Visible */ : 0 /* Hidden */; - } - else if (Object(_indexTreeModel_js__WEBPACK_IMPORTED_MODULE_12__["isFilterResult"])(result)) { - visibility = Object(_indexTreeModel_js__WEBPACK_IMPORTED_MODULE_12__["getVisibleState"])(result.visibility); - } - else { - visibility = result; - } - if (visibility === 0 /* Hidden */) { - return false; - } - } - this._totalCount++; - if (this.tree.options.simpleKeyboardNavigation || !this._pattern) { - this._matchCount++; - return { data: _common_filters_js__WEBPACK_IMPORTED_MODULE_11__["FuzzyScore"].Default, visibility: true }; - } - const label = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(element); - const labelStr = label && label.toString(); - if (typeof labelStr === 'undefined') { - return { data: _common_filters_js__WEBPACK_IMPORTED_MODULE_11__["FuzzyScore"].Default, visibility: true }; - } - const score = Object(_common_filters_js__WEBPACK_IMPORTED_MODULE_11__["fuzzyScore"])(this._pattern, this._lowercasePattern, 0, labelStr, labelStr.toLowerCase(), 0, true); - if (!score) { - if (this.tree.options.filterOnType) { - return 2 /* Recurse */; - } - else { - return { data: _common_filters_js__WEBPACK_IMPORTED_MODULE_11__["FuzzyScore"].Default, visibility: true }; - } - // DEMO: smarter filter ? - // return parentVisibility === TreeVisibility.Visible ? true : TreeVisibility.Recurse; - } - this._matchCount++; - return { data: score, visibility: true }; - } - reset() { - this._totalCount = 0; - this._matchCount = 0; - } - dispose() { - Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this.disposables); - } -} -class TypeFilterController { - constructor(tree, model, view, filter, keyboardNavigationDelegate) { - this.tree = tree; - this.view = view; - this.filter = filter; - this.keyboardNavigationDelegate = keyboardNavigationDelegate; - this._enabled = false; - this._pattern = ''; - this._empty = false; - this._onDidChangeEmptyState = new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"](); - this.positionClassName = 'ne'; - this.automaticKeyboardNavigation = true; - this.triggered = false; - this._onDidChangePattern = new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"](); - this.enabledDisposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this.disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this.domNode = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])(`.monaco-list-type-filter.${this.positionClassName}`); - this.domNode.draggable = true; - Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(this.domNode, 'dragstart')(this.onDragStart, this, this.disposables); - this.messageDomNode = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["append"])(view.getHTMLElement(), Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])(`.monaco-list-type-filter-message`)); - this.labelDomNode = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["append"])(this.domNode, Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])('span.label')); - const controls = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["append"])(this.domNode, Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])('.controls')); - this._filterOnType = !!tree.options.filterOnType; - this.filterOnTypeDomNode = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["append"])(controls, Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])('input.filter')); - this.filterOnTypeDomNode.type = 'checkbox'; - this.filterOnTypeDomNode.checked = this._filterOnType; - this.filterOnTypeDomNode.tabIndex = -1; - this.updateFilterOnTypeTitleAndIcon(); - Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(this.filterOnTypeDomNode, 'input')(this.onDidChangeFilterOnType, this, this.disposables); - this.clearDomNode = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["append"])(controls, Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["$"])('button.clear' + _treeIcons_js__WEBPACK_IMPORTED_MODULE_18__["treeFilterClearIcon"].cssSelector)); - this.clearDomNode.tabIndex = -1; - this.clearDomNode.title = Object(_nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"])('clear', "Clear"); - this.keyboardNavigationEventFilter = tree.options.keyboardNavigationEventFilter; - model.onDidSplice(this.onDidSpliceModel, this, this.disposables); - this.updateOptions(tree.options); - } - get enabled() { return this._enabled; } - get pattern() { return this._pattern; } - get filterOnType() { return this._filterOnType; } - updateOptions(options) { - if (options.simpleKeyboardNavigation) { - this.disable(); - } - else { - this.enable(); - } - if (typeof options.filterOnType !== 'undefined') { - this._filterOnType = !!options.filterOnType; - this.filterOnTypeDomNode.checked = this._filterOnType; - } - if (typeof options.automaticKeyboardNavigation !== 'undefined') { - this.automaticKeyboardNavigation = options.automaticKeyboardNavigation; - } - this.tree.refilter(); - this.render(); - if (!this.automaticKeyboardNavigation) { - this.onEventOrInput(''); - } - } - enable() { - if (this._enabled) { - return; - } - const onKeyDown = _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].chain(Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(this.view.getHTMLElement(), 'keydown')) - .filter(e => !Object(_list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__["isInputElement"])(e.target) || e.target === this.filterOnTypeDomNode) - .filter(e => e.key !== 'Dead' && !/^Media/.test(e.key)) - .map(e => new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__["StandardKeyboardEvent"](e)) - .filter(this.keyboardNavigationEventFilter || (() => true)) - .filter(() => this.automaticKeyboardNavigation || this.triggered) - .filter(e => (this.keyboardNavigationDelegate.mightProducePrintableCharacter(e) && !(e.keyCode === 18 /* DownArrow */ || e.keyCode === 16 /* UpArrow */ || e.keyCode === 15 /* LeftArrow */ || e.keyCode === 17 /* RightArrow */)) || ((this.pattern.length > 0 || this.triggered) && ((e.keyCode === 9 /* Escape */ || e.keyCode === 1 /* Backspace */) && !e.altKey && !e.ctrlKey && !e.metaKey) || (e.keyCode === 1 /* Backspace */ && (_common_platform_js__WEBPACK_IMPORTED_MODULE_15__["isMacintosh"] ? (e.altKey && !e.metaKey) : e.ctrlKey) && !e.shiftKey))) - .forEach(e => { e.stopPropagation(); e.preventDefault(); }) - .event; - const onClear = Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(this.clearDomNode, 'click'); - _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].chain(_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].any(onKeyDown, onClear)) - .event(this.onEventOrInput, this, this.enabledDisposables); - this.filter.pattern = ''; - this.tree.refilter(); - this.render(); - this._enabled = true; - this.triggered = false; - } - disable() { - if (!this._enabled) { - return; - } - this.domNode.remove(); - this.enabledDisposables.clear(); - this.tree.refilter(); - this.render(); - this._enabled = false; - this.triggered = false; - } - onEventOrInput(e) { - if (typeof e === 'string') { - this.onInput(e); - } - else if (e instanceof MouseEvent || e.keyCode === 9 /* Escape */ || (e.keyCode === 1 /* Backspace */ && (_common_platform_js__WEBPACK_IMPORTED_MODULE_15__["isMacintosh"] ? e.altKey : e.ctrlKey))) { - this.onInput(''); - } - else if (e.keyCode === 1 /* Backspace */) { - this.onInput(this.pattern.length === 0 ? '' : this.pattern.substr(0, this.pattern.length - 1)); - } - else { - this.onInput(this.pattern + e.browserEvent.key); - } - } - onInput(pattern) { - const container = this.view.getHTMLElement(); - if (pattern && !this.domNode.parentElement) { - container.append(this.domNode); - } - else if (!pattern && this.domNode.parentElement) { - this.domNode.remove(); - this.tree.domFocus(); - } - this._pattern = pattern; - this._onDidChangePattern.fire(pattern); - this.filter.pattern = pattern; - this.tree.refilter(); - if (pattern) { - this.tree.focusNext(0, true, undefined, node => !_common_filters_js__WEBPACK_IMPORTED_MODULE_11__["FuzzyScore"].isDefault(node.filterData)); - } - const focus = this.tree.getFocus(); - if (focus.length > 0) { - const element = focus[0]; - if (this.tree.getRelativeTop(element) === null) { - this.tree.reveal(element, 0.5); - } - } - this.render(); - if (!pattern) { - this.triggered = false; - } - } - onDragStart() { - const container = this.view.getHTMLElement(); - const { left } = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["getDomNodePagePosition"])(container); - const containerWidth = container.clientWidth; - const midContainerWidth = containerWidth / 2; - const width = this.domNode.clientWidth; - const disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - let positionClassName = this.positionClassName; - const updatePosition = () => { - switch (positionClassName) { - case 'nw': - this.domNode.style.top = `4px`; - this.domNode.style.left = `4px`; - break; - case 'ne': - this.domNode.style.top = `4px`; - this.domNode.style.left = `${containerWidth - width - 6}px`; - break; - } - }; - const onDragOver = (event) => { - event.preventDefault(); // needed so that the drop event fires (https://stackoverflow.com/questions/21339924/drop-event-not-firing-in-chrome) - const x = event.screenX - left; - if (event.dataTransfer) { - event.dataTransfer.dropEffect = 'none'; - } - if (x < midContainerWidth) { - positionClassName = 'nw'; - } - else { - positionClassName = 'ne'; - } - updatePosition(); - }; - const onDragEnd = () => { - this.positionClassName = positionClassName; - this.domNode.className = `monaco-list-type-filter ${this.positionClassName}`; - this.domNode.style.top = ''; - this.domNode.style.left = ''; - Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(disposables); - }; - updatePosition(); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["removeClass"])(this.domNode, positionClassName); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addClass"])(this.domNode, 'dragging'); - disposables.add(Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["removeClass"])(this.domNode, 'dragging'))); - Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(document, 'dragover')(onDragOver, null, disposables); - Object(_event_js__WEBPACK_IMPORTED_MODULE_10__["domEvent"])(this.domNode, 'dragend')(onDragEnd, null, disposables); - _dnd_js__WEBPACK_IMPORTED_MODULE_7__["StaticDND"].CurrentDragAndDropData = new _dnd_js__WEBPACK_IMPORTED_MODULE_7__["DragAndDropData"]('vscode-ui'); - disposables.add(Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => _dnd_js__WEBPACK_IMPORTED_MODULE_7__["StaticDND"].CurrentDragAndDropData = undefined)); - } - onDidSpliceModel() { - if (!this._enabled || this.pattern.length === 0) { - return; - } - this.tree.refilter(); - this.render(); - } - onDidChangeFilterOnType() { - this.tree.updateOptions({ filterOnType: this.filterOnTypeDomNode.checked }); - this.tree.refilter(); - this.tree.domFocus(); - this.render(); - this.updateFilterOnTypeTitleAndIcon(); - } - updateFilterOnTypeTitleAndIcon() { - if (this.filterOnType) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["removeClasses"])(this.filterOnTypeDomNode, _treeIcons_js__WEBPACK_IMPORTED_MODULE_18__["treeFilterOnTypeOffIcon"].classNames); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addClasses"])(this.filterOnTypeDomNode, _treeIcons_js__WEBPACK_IMPORTED_MODULE_18__["treeFilterOnTypeOnIcon"].classNames); - this.filterOnTypeDomNode.title = Object(_nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"])('disable filter on type', "Disable Filter on Type"); - } - else { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["removeClasses"])(this.filterOnTypeDomNode, _treeIcons_js__WEBPACK_IMPORTED_MODULE_18__["treeFilterOnTypeOnIcon"].classNames); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["addClasses"])(this.filterOnTypeDomNode, _treeIcons_js__WEBPACK_IMPORTED_MODULE_18__["treeFilterOnTypeOffIcon"].classNames); - this.filterOnTypeDomNode.title = Object(_nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"])('enable filter on type', "Enable Filter on Type"); - } - } - render() { - const noMatches = this.filter.totalCount > 0 && this.filter.matchCount === 0; - if (this.pattern && this.tree.options.filterOnType && noMatches) { - this.messageDomNode.textContent = Object(_nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"])('empty', "No elements found"); - this._empty = true; - } - else { - this.messageDomNode.innerText = ''; - this._empty = false; - } - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(this.domNode, 'no-matches', noMatches); - this.domNode.title = Object(_nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"])('found', "Matched {0} out of {1} elements", this.filter.matchCount, this.filter.totalCount); - this.labelDomNode.textContent = this.pattern.length > 16 ? '…' + this.pattern.substr(this.pattern.length - 16) : this.pattern; - this._onDidChangeEmptyState.fire(this._empty); - } - shouldAllowFocus(node) { - if (!this.enabled || !this.pattern || this.filterOnType) { - return true; - } - if (this.filter.totalCount > 0 && this.filter.matchCount <= 1) { - return true; - } - return !_common_filters_js__WEBPACK_IMPORTED_MODULE_11__["FuzzyScore"].isDefault(node.filterData); - } - dispose() { - if (this._enabled) { - this.domNode.remove(); - this.enabledDisposables.dispose(); - this._enabled = false; - this.triggered = false; - } - this._onDidChangePattern.dispose(); - Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this.disposables); - } -} -function asTreeMouseEvent(event) { - let target = _tree_js__WEBPACK_IMPORTED_MODULE_6__["TreeMouseEventTarget"].Unknown; - if (Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["hasParentWithClass"])(event.browserEvent.target, 'monaco-tl-twistie', 'monaco-tl-row')) { - target = _tree_js__WEBPACK_IMPORTED_MODULE_6__["TreeMouseEventTarget"].Twistie; - } - else if (Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["hasParentWithClass"])(event.browserEvent.target, 'monaco-tl-contents', 'monaco-tl-row')) { - target = _tree_js__WEBPACK_IMPORTED_MODULE_6__["TreeMouseEventTarget"].Element; - } - return { - browserEvent: event.browserEvent, - element: event.element ? event.element.element : null, - target - }; -} -function dfs(node, fn) { - fn(node); - node.children.forEach(child => dfs(child, fn)); -} -/** - * The trait concept needs to exist at the tree level, because collapsed - * tree nodes will not be known by the list. - */ -class Trait { - constructor(identityProvider) { - this.identityProvider = identityProvider; - this.nodes = []; - this._onDidChange = new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"](); - this.onDidChange = this._onDidChange.event; - } - get nodeSet() { - if (!this._nodeSet) { - this._nodeSet = this.createNodeSet(); - } - return this._nodeSet; - } - set(nodes, browserEvent) { - if (Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_8__["equals"])(this.nodes, nodes)) { - return; - } - this._set(nodes, false, browserEvent); - } - _set(nodes, silent, browserEvent) { - this.nodes = [...nodes]; - this.elements = undefined; - this._nodeSet = undefined; - if (!silent) { - const that = this; - this._onDidChange.fire({ get elements() { return that.get(); }, browserEvent }); - } - } - get() { - if (!this.elements) { - this.elements = this.nodes.map(node => node.element); - } - return [...this.elements]; - } - getNodes() { - return this.nodes; - } - has(node) { - return this.nodeSet.has(node); - } - onDidModelSplice({ insertedNodes, deletedNodes }) { - if (!this.identityProvider) { - const set = this.createNodeSet(); - const visit = (node) => set.delete(node); - deletedNodes.forEach(node => dfs(node, visit)); - this.set([...set.values()]); - return; - } - const deletedNodesIdSet = new Set(); - const deletedNodesVisitor = (node) => deletedNodesIdSet.add(this.identityProvider.getId(node.element).toString()); - deletedNodes.forEach(node => dfs(node, deletedNodesVisitor)); - const insertedNodesMap = new Map(); - const insertedNodesVisitor = (node) => insertedNodesMap.set(this.identityProvider.getId(node.element).toString(), node); - insertedNodes.forEach(node => dfs(node, insertedNodesVisitor)); - const nodes = []; - for (const node of this.nodes) { - const id = this.identityProvider.getId(node.element).toString(); - const wasDeleted = deletedNodesIdSet.has(id); - if (!wasDeleted) { - nodes.push(node); - } - else { - const insertedNode = insertedNodesMap.get(id); - if (insertedNode) { - nodes.push(insertedNode); - } - } - } - this._set(nodes, true); - } - createNodeSet() { - const set = new Set(); - for (const node of this.nodes) { - set.add(node); - } - return set; - } -} -class TreeNodeListMouseController extends _list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__["MouseController"] { - constructor(list, tree) { - super(list); - this.tree = tree; - } - onViewPointer(e) { - if (Object(_list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__["isInputElement"])(e.browserEvent.target) || Object(_list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__["isMonacoEditor"])(e.browserEvent.target)) { - return; - } - const node = e.element; - if (!node) { - return super.onViewPointer(e); - } - if (this.isSelectionRangeChangeEvent(e) || this.isSelectionSingleChangeEvent(e)) { - return super.onViewPointer(e); - } - const target = e.browserEvent.target; - const onTwistie = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["hasClass"])(target, 'monaco-tl-twistie') - || (Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["hasClass"])(target, 'monaco-icon-label') && Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["hasClass"])(target, 'folder-icon') && e.browserEvent.offsetX < 16); - let expandOnlyOnTwistieClick = false; - if (typeof this.tree.expandOnlyOnTwistieClick === 'function') { - expandOnlyOnTwistieClick = this.tree.expandOnlyOnTwistieClick(node.element); - } - else { - expandOnlyOnTwistieClick = !!this.tree.expandOnlyOnTwistieClick; - } - if (expandOnlyOnTwistieClick && !onTwistie) { - return super.onViewPointer(e); - } - if (this.tree.expandOnlyOnDoubleClick && e.browserEvent.detail !== 2 && !onTwistie) { - return super.onViewPointer(e); - } - if (node.collapsible) { - const model = this.tree.model; // internal - const location = model.getNodeLocation(node); - const recursive = e.browserEvent.altKey; - model.setCollapsed(location, undefined, recursive); - if (expandOnlyOnTwistieClick && onTwistie) { - return; - } - } - super.onViewPointer(e); - } - onDoubleClick(e) { - const onTwistie = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["hasClass"])(e.browserEvent.target, 'monaco-tl-twistie'); - if (onTwistie) { - return; - } - super.onDoubleClick(e); - } -} -/** - * We use this List subclass to restore selection and focus as nodes - * get rendered in the list, possibly due to a node expand() call. - */ -class TreeNodeList extends _list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__["List"] { - constructor(user, container, virtualDelegate, renderers, focusTrait, selectionTrait, options) { - super(user, container, virtualDelegate, renderers, options); - this.focusTrait = focusTrait; - this.selectionTrait = selectionTrait; - } - createMouseController(options) { - return new TreeNodeListMouseController(this, options.tree); - } - splice(start, deleteCount, elements = []) { - super.splice(start, deleteCount, elements); - if (elements.length === 0) { - return; - } - const additionalFocus = []; - const additionalSelection = []; - elements.forEach((node, index) => { - if (this.focusTrait.has(node)) { - additionalFocus.push(start + index); - } - if (this.selectionTrait.has(node)) { - additionalSelection.push(start + index); - } - }); - if (additionalFocus.length > 0) { - super.setFocus(Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_8__["distinctES6"])([...super.getFocus(), ...additionalFocus])); - } - if (additionalSelection.length > 0) { - super.setSelection(Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_8__["distinctES6"])([...super.getSelection(), ...additionalSelection])); - } - } - setFocus(indexes, browserEvent, fromAPI = false) { - super.setFocus(indexes, browserEvent); - if (!fromAPI) { - this.focusTrait.set(indexes.map(i => this.element(i)), browserEvent); - } - } - setSelection(indexes, browserEvent, fromAPI = false) { - super.setSelection(indexes, browserEvent); - if (!fromAPI) { - this.selectionTrait.set(indexes.map(i => this.element(i)), browserEvent); - } - } -} -class AbstractTree { - constructor(user, container, delegate, renderers, _options = {}) { - this._options = _options; - this.eventBufferer = new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["EventBufferer"](); - this.disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this._onWillRefilter = new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"](); - this.onWillRefilter = this._onWillRefilter.event; - this._onDidUpdateOptions = new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"](); - const treeDelegate = new ComposedTreeDelegate(delegate); - const onDidChangeCollapseStateRelay = new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Relay"](); - const onDidChangeActiveNodes = new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Relay"](); - const activeNodes = new EventCollection(onDidChangeActiveNodes.event); - this.renderers = renderers.map(r => new TreeRenderer(r, () => this.model, onDidChangeCollapseStateRelay.event, activeNodes, _options)); - for (let r of this.renderers) { - this.disposables.add(r); - } - let filter; - if (_options.keyboardNavigationLabelProvider) { - filter = new TypeFilter(this, _options.keyboardNavigationLabelProvider, _options.filter); - _options = Object.assign(Object.assign({}, _options), { filter: filter }); // TODO need typescript help here - this.disposables.add(filter); - } - this.focus = new Trait(_options.identityProvider); - this.selection = new Trait(_options.identityProvider); - this.view = new TreeNodeList(user, container, treeDelegate, this.renderers, this.focus, this.selection, Object.assign(Object.assign({}, asListOptions(() => this.model, _options)), { tree: this })); - this.model = this.createModel(user, this.view, _options); - onDidChangeCollapseStateRelay.input = this.model.onDidChangeCollapseState; - const onDidModelSplice = _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].forEach(this.model.onDidSplice, e => { - this.eventBufferer.bufferEvents(() => { - this.focus.onDidModelSplice(e); - this.selection.onDidModelSplice(e); - }); - }); - // Make sure the `forEach` always runs - onDidModelSplice(() => null, null, this.disposables); - // Active nodes can change when the model changes or when focus or selection change. - // We debounce it with 0 delay since these events may fire in the same stack and we only - // want to run this once. It also doesn't matter if it runs on the next tick since it's only - // a nice to have UI feature. - onDidChangeActiveNodes.input = _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].chain(_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].any(onDidModelSplice, this.focus.onDidChange, this.selection.onDidChange)) - .debounce(() => null, 0) - .map(() => { - const set = new Set(); - for (const node of this.focus.getNodes()) { - set.add(node); - } - for (const node of this.selection.getNodes()) { - set.add(node); - } - return [...set.values()]; - }).event; - if (_options.keyboardSupport !== false) { - const onKeyDown = _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].chain(this.view.onKeyDown) - .filter(e => !Object(_list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__["isInputElement"])(e.target)) - .map(e => new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_5__["StandardKeyboardEvent"](e)); - onKeyDown.filter(e => e.keyCode === 15 /* LeftArrow */).on(this.onLeftArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === 17 /* RightArrow */).on(this.onRightArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === 10 /* Space */).on(this.onSpace, this, this.disposables); - } - if (_options.keyboardNavigationLabelProvider) { - const delegate = _options.keyboardNavigationDelegate || _list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__["DefaultKeyboardNavigationDelegate"]; - this.typeFilterController = new TypeFilterController(this, this.model, this.view, filter, delegate); - this.focusNavigationFilter = node => this.typeFilterController.shouldAllowFocus(node); - this.disposables.add(this.typeFilterController); - } - this.styleElement = Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["createStyleSheet"])(this.view.getHTMLElement()); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(this.getHTMLElement(), 'always', this._options.renderIndentGuides === RenderIndentGuides.Always); - } - get onDidChangeFocus() { return this.eventBufferer.wrapEvent(this.focus.onDidChange); } - get onDidChangeSelection() { return this.eventBufferer.wrapEvent(this.selection.onDidChange); } - get onMouseDblClick() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(this.view.onMouseDblClick, asTreeMouseEvent); } - get onPointer() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(this.view.onPointer, asTreeMouseEvent); } - get onDidFocus() { return this.view.onDidFocus; } - get onDidChangeCollapseState() { return this.model.onDidChangeCollapseState; } - get expandOnlyOnDoubleClick() { var _a; return (_a = this._options.expandOnlyOnDoubleClick) !== null && _a !== void 0 ? _a : false; } - get expandOnlyOnTwistieClick() { return typeof this._options.expandOnlyOnTwistieClick === 'undefined' ? false : this._options.expandOnlyOnTwistieClick; } - get onDidDispose() { return this.view.onDidDispose; } - updateOptions(optionsUpdate = {}) { - this._options = Object.assign(Object.assign({}, this._options), optionsUpdate); - for (const renderer of this.renderers) { - renderer.updateOptions(optionsUpdate); - } - this.view.updateOptions({ - enableKeyboardNavigation: this._options.simpleKeyboardNavigation, - automaticKeyboardNavigation: this._options.automaticKeyboardNavigation, - smoothScrolling: this._options.smoothScrolling, - horizontalScrolling: this._options.horizontalScrolling - }); - if (this.typeFilterController) { - this.typeFilterController.updateOptions(this._options); - } - this._onDidUpdateOptions.fire(this._options); - Object(_dom_js__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(this.getHTMLElement(), 'always', this._options.renderIndentGuides === RenderIndentGuides.Always); - } - get options() { - return this._options; - } - // Widget - getHTMLElement() { - return this.view.getHTMLElement(); - } - get scrollTop() { - return this.view.scrollTop; - } - set scrollTop(scrollTop) { - this.view.scrollTop = scrollTop; - } - domFocus() { - this.view.domFocus(); - } - layout(height, width) { - this.view.layout(height, width); - } - style(styles) { - const suffix = `.${this.view.domId}`; - const content = []; - if (styles.treeIndentGuidesStroke) { - content.push(`.monaco-list${suffix}:hover .monaco-tl-indent > .indent-guide, .monaco-list${suffix}.always .monaco-tl-indent > .indent-guide { border-color: ${styles.treeIndentGuidesStroke.transparent(0.4)}; }`); - content.push(`.monaco-list${suffix} .monaco-tl-indent > .indent-guide.active { border-color: ${styles.treeIndentGuidesStroke}; }`); - } - const newStyles = content.join('\n'); - if (newStyles !== this.styleElement.innerHTML) { - this.styleElement.innerHTML = newStyles; - } - this.view.style(styles); - } - collapse(location, recursive = false) { - return this.model.setCollapsed(location, true, recursive); - } - expand(location, recursive = false) { - return this.model.setCollapsed(location, false, recursive); - } - isCollapsible(location) { - return this.model.isCollapsible(location); - } - setCollapsible(location, collapsible) { - return this.model.setCollapsible(location, collapsible); - } - isCollapsed(location) { - return this.model.isCollapsed(location); - } - refilter() { - this._onWillRefilter.fire(undefined); - this.model.refilter(); - } - setSelection(elements, browserEvent) { - const nodes = elements.map(e => this.model.getNode(e)); - this.selection.set(nodes, browserEvent); - const indexes = elements.map(e => this.model.getListIndex(e)).filter(i => i > -1); - this.view.setSelection(indexes, browserEvent, true); - } - getSelection() { - return this.selection.get(); - } - setFocus(elements, browserEvent) { - const nodes = elements.map(e => this.model.getNode(e)); - this.focus.set(nodes, browserEvent); - const indexes = elements.map(e => this.model.getListIndex(e)).filter(i => i > -1); - this.view.setFocus(indexes, browserEvent, true); - } - focusNext(n = 1, loop = false, browserEvent, filter = this.focusNavigationFilter) { - this.view.focusNext(n, loop, browserEvent, filter); - } - getFocus() { - return this.focus.get(); - } - reveal(location, relativeTop) { - this.model.expandTo(location); - const index = this.model.getListIndex(location); - if (index === -1) { - return; - } - this.view.reveal(index, relativeTop); - } - /** - * Returns the relative position of an element rendered in the list. - * Returns `null` if the element isn't *entirely* in the visible viewport. - */ - getRelativeTop(location) { - const index = this.model.getListIndex(location); - if (index === -1) { - return null; - } - return this.view.getRelativeTop(index); - } - // List - onLeftArrow(e) { - e.preventDefault(); - e.stopPropagation(); - const nodes = this.view.getFocusedElements(); - if (nodes.length === 0) { - return; - } - const node = nodes[0]; - const location = this.model.getNodeLocation(node); - const didChange = this.model.setCollapsed(location, true); - if (!didChange) { - const parentLocation = this.model.getParentNodeLocation(location); - if (!parentLocation) { - return; - } - const parentListIndex = this.model.getListIndex(parentLocation); - this.view.reveal(parentListIndex); - this.view.setFocus([parentListIndex]); - } - } - onRightArrow(e) { - e.preventDefault(); - e.stopPropagation(); - const nodes = this.view.getFocusedElements(); - if (nodes.length === 0) { - return; - } - const node = nodes[0]; - const location = this.model.getNodeLocation(node); - const didChange = this.model.setCollapsed(location, false); - if (!didChange) { - if (!node.children.some(child => child.visible)) { - return; - } - const [focusedIndex] = this.view.getFocus(); - const firstChildIndex = focusedIndex + 1; - this.view.reveal(firstChildIndex); - this.view.setFocus([firstChildIndex]); - } - } - onSpace(e) { - e.preventDefault(); - e.stopPropagation(); - const nodes = this.view.getFocusedElements(); - if (nodes.length === 0) { - return; - } - const node = nodes[0]; - const location = this.model.getNodeLocation(node); - const recursive = e.browserEvent.altKey; - this.model.setCollapsed(location, undefined, recursive); - } - dispose() { - Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this.disposables); - this.view.dispose(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/asyncDataTree.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/asyncDataTree.js ***! - \*********************************************************************************/ -/*! exports provided: AsyncDataTree, CompressibleAsyncDataTree */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncDataTree", function() { return AsyncDataTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompressibleAsyncDataTree", function() { return CompressibleAsyncDataTree; }); -/* harmony import */ var _abstractTree_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./abstractTree.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/abstractTree.js"); -/* harmony import */ var _objectTree_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./objectTree.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/objectTree.js"); -/* harmony import */ var _tree_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tree.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/tree.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _common_async_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _common_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/* harmony import */ var _list_listView_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../list/listView.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listView.js"); -/* harmony import */ var _common_errors_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _indexTreeModel_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./indexTreeModel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/indexTreeModel.js"); -/* harmony import */ var _treeIcons_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./treeIcons.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/treeIcons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - -function createAsyncDataTreeNode(props) { - return Object.assign(Object.assign({}, props), { children: [], refreshPromise: undefined, stale: true, slow: false, collapsedByDefault: undefined }); -} -function isAncestor(ancestor, descendant) { - if (!descendant.parent) { - return false; - } - else if (descendant.parent === ancestor) { - return true; - } - else { - return isAncestor(ancestor, descendant.parent); - } -} -function intersects(node, other) { - return node === other || isAncestor(node, other) || isAncestor(other, node); -} -class AsyncDataTreeNodeWrapper { - constructor(node) { - this.node = node; - } - get element() { return this.node.element.element; } - get children() { return this.node.children.map(node => new AsyncDataTreeNodeWrapper(node)); } - get depth() { return this.node.depth; } - get visibleChildrenCount() { return this.node.visibleChildrenCount; } - get visibleChildIndex() { return this.node.visibleChildIndex; } - get collapsible() { return this.node.collapsible; } - get collapsed() { return this.node.collapsed; } - get visible() { return this.node.visible; } - get filterData() { return this.node.filterData; } -} -class AsyncDataTreeRenderer { - constructor(renderer, nodeMapper, onDidChangeTwistieState) { - this.renderer = renderer; - this.nodeMapper = nodeMapper; - this.onDidChangeTwistieState = onDidChangeTwistieState; - this.renderedNodes = new Map(); - this.templateId = renderer.templateId; - } - renderTemplate(container) { - const templateData = this.renderer.renderTemplate(container); - return { templateData }; - } - renderElement(node, index, templateData, height) { - this.renderer.renderElement(this.nodeMapper.map(node), index, templateData.templateData, height); - } - renderTwistie(element, twistieElement) { - if (element.slow) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_9__["addClasses"])(twistieElement, _treeIcons_js__WEBPACK_IMPORTED_MODULE_11__["treeItemLoadingIcon"].classNames); - } - else { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_9__["removeClasses"])(twistieElement, _treeIcons_js__WEBPACK_IMPORTED_MODULE_11__["treeItemLoadingIcon"].classNames); - } - return false; - } - disposeElement(node, index, templateData, height) { - if (this.renderer.disposeElement) { - this.renderer.disposeElement(this.nodeMapper.map(node), index, templateData.templateData, height); - } - } - disposeTemplate(templateData) { - this.renderer.disposeTemplate(templateData.templateData); - } - dispose() { - this.renderedNodes.clear(); - } -} -function asTreeEvent(e) { - return { - browserEvent: e.browserEvent, - elements: e.elements.map(e => e.element) - }; -} -function asTreeMouseEvent(e) { - return { - browserEvent: e.browserEvent, - element: e.element && e.element.element, - target: e.target - }; -} -class AsyncDataTreeElementsDragAndDropData extends _list_listView_js__WEBPACK_IMPORTED_MODULE_7__["ElementsDragAndDropData"] { - constructor(data) { - super(data.elements.map(node => node.element)); - this.data = data; - } -} -function asAsyncDataTreeDragAndDropData(data) { - if (data instanceof _list_listView_js__WEBPACK_IMPORTED_MODULE_7__["ElementsDragAndDropData"]) { - return new AsyncDataTreeElementsDragAndDropData(data); - } - return data; -} -class AsyncDataTreeNodeListDragAndDrop { - constructor(dnd) { - this.dnd = dnd; - } - getDragURI(node) { - return this.dnd.getDragURI(node.element); - } - getDragLabel(nodes, originalEvent) { - if (this.dnd.getDragLabel) { - return this.dnd.getDragLabel(nodes.map(node => node.element), originalEvent); - } - return undefined; - } - onDragStart(data, originalEvent) { - if (this.dnd.onDragStart) { - this.dnd.onDragStart(asAsyncDataTreeDragAndDropData(data), originalEvent); - } - } - onDragOver(data, targetNode, targetIndex, originalEvent, raw = true) { - return this.dnd.onDragOver(asAsyncDataTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, originalEvent); - } - drop(data, targetNode, targetIndex, originalEvent) { - this.dnd.drop(asAsyncDataTreeDragAndDropData(data), targetNode && targetNode.element, targetIndex, originalEvent); - } - onDragEnd(originalEvent) { - if (this.dnd.onDragEnd) { - this.dnd.onDragEnd(originalEvent); - } - } -} -function asObjectTreeOptions(options) { - return options && Object.assign(Object.assign({}, options), { collapseByDefault: true, identityProvider: options.identityProvider && { - getId(el) { - return options.identityProvider.getId(el.element); - } - }, dnd: options.dnd && new AsyncDataTreeNodeListDragAndDrop(options.dnd), multipleSelectionController: options.multipleSelectionController && { - isSelectionSingleChangeEvent(e) { - return options.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({}, e), { element: e.element })); - }, - isSelectionRangeChangeEvent(e) { - return options.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({}, e), { element: e.element })); - } - }, accessibilityProvider: options.accessibilityProvider && Object.assign(Object.assign({}, options.accessibilityProvider), { getPosInSet: undefined, getSetSize: undefined, getRole: options.accessibilityProvider.getRole ? (el) => { - return options.accessibilityProvider.getRole(el.element); - } : () => 'treeitem', isChecked: options.accessibilityProvider.isChecked ? (e) => { - var _a; - return !!((_a = options.accessibilityProvider) === null || _a === void 0 ? void 0 : _a.isChecked(e.element)); - } : undefined, getAriaLabel(e) { - return options.accessibilityProvider.getAriaLabel(e.element); - }, - getWidgetAriaLabel() { - return options.accessibilityProvider.getWidgetAriaLabel(); - }, getWidgetRole: options.accessibilityProvider.getWidgetRole ? () => options.accessibilityProvider.getWidgetRole() : () => 'tree', getAriaLevel: options.accessibilityProvider.getAriaLevel && (node => { - return options.accessibilityProvider.getAriaLevel(node.element); - }), getActiveDescendantId: options.accessibilityProvider.getActiveDescendantId && (node => { - return options.accessibilityProvider.getActiveDescendantId(node.element); - }) }), filter: options.filter && { - filter(e, parentVisibility) { - return options.filter.filter(e.element, parentVisibility); - } - }, keyboardNavigationLabelProvider: options.keyboardNavigationLabelProvider && Object.assign(Object.assign({}, options.keyboardNavigationLabelProvider), { getKeyboardNavigationLabel(e) { - return options.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element); - } }), sorter: undefined, expandOnlyOnTwistieClick: typeof options.expandOnlyOnTwistieClick === 'undefined' ? undefined : (typeof options.expandOnlyOnTwistieClick !== 'function' ? options.expandOnlyOnTwistieClick : (e => options.expandOnlyOnTwistieClick(e.element))), additionalScrollHeight: options.additionalScrollHeight }); -} -function dfs(node, fn) { - fn(node); - node.children.forEach(child => dfs(child, fn)); -} -class AsyncDataTree { - constructor(user, container, delegate, renderers, dataSource, options = {}) { - this.user = user; - this.dataSource = dataSource; - this.nodes = new Map(); - this.subTreeRefreshPromises = new Map(); - this.refreshPromises = new Map(); - this._onDidRender = new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"](); - this._onDidChangeNodeSlowState = new _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"](); - this.nodeMapper = new _tree_js__WEBPACK_IMPORTED_MODULE_2__["WeakMapper"](node => new AsyncDataTreeNodeWrapper(node)); - this.disposables = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - this.identityProvider = options.identityProvider; - this.autoExpandSingleChildren = typeof options.autoExpandSingleChildren === 'undefined' ? false : options.autoExpandSingleChildren; - this.sorter = options.sorter; - this.collapseByDefault = options.collapseByDefault; - this.tree = this.createTree(user, container, delegate, renderers, options); - this.root = createAsyncDataTreeNode({ - element: undefined, - parent: null, - hasChildren: true - }); - if (this.identityProvider) { - this.root = Object.assign(Object.assign({}, this.root), { id: null }); - } - this.nodes.set(null, this.root); - this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState, this, this.disposables); - } - get onDidChangeFocus() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(this.tree.onDidChangeFocus, asTreeEvent); } - get onDidChangeSelection() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(this.tree.onDidChangeSelection, asTreeEvent); } - get onMouseDblClick() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(this.tree.onMouseDblClick, asTreeMouseEvent); } - get onPointer() { return _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].map(this.tree.onPointer, asTreeMouseEvent); } - get onDidFocus() { return this.tree.onDidFocus; } - get onDidDispose() { return this.tree.onDidDispose; } - createTree(user, container, delegate, renderers, options) { - const objectTreeDelegate = new _abstractTree_js__WEBPACK_IMPORTED_MODULE_0__["ComposedTreeDelegate"](delegate); - const objectTreeRenderers = renderers.map(r => new AsyncDataTreeRenderer(r, this.nodeMapper, this._onDidChangeNodeSlowState.event)); - const objectTreeOptions = asObjectTreeOptions(options) || {}; - return new _objectTree_js__WEBPACK_IMPORTED_MODULE_1__["ObjectTree"](user, container, objectTreeDelegate, objectTreeRenderers, objectTreeOptions); - } - updateOptions(options = {}) { - this.tree.updateOptions(options); - } - // Widget - getHTMLElement() { - return this.tree.getHTMLElement(); - } - get scrollTop() { - return this.tree.scrollTop; - } - set scrollTop(scrollTop) { - this.tree.scrollTop = scrollTop; - } - domFocus() { - this.tree.domFocus(); - } - layout(height, width) { - this.tree.layout(height, width); - } - style(styles) { - this.tree.style(styles); - } - // Model - getInput() { - return this.root.element; - } - setInput(input, viewState) { - return __awaiter(this, void 0, void 0, function* () { - this.refreshPromises.forEach(promise => promise.cancel()); - this.refreshPromises.clear(); - this.root.element = input; - const viewStateContext = viewState && { viewState, focus: [], selection: [] }; - yield this._updateChildren(input, true, false, viewStateContext); - if (viewStateContext) { - this.tree.setFocus(viewStateContext.focus); - this.tree.setSelection(viewStateContext.selection); - } - if (viewState && typeof viewState.scrollTop === 'number') { - this.scrollTop = viewState.scrollTop; - } - }); - } - _updateChildren(element = this.root.element, recursive = true, rerender = false, viewStateContext) { - return __awaiter(this, void 0, void 0, function* () { - if (typeof this.root.element === 'undefined') { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_2__["TreeError"](this.user, 'Tree input not set'); - } - if (this.root.refreshPromise) { - yield this.root.refreshPromise; - yield _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].toPromise(this._onDidRender.event); - } - const node = this.getDataNode(element); - yield this.refreshAndRenderNode(node, recursive, viewStateContext); - if (rerender) { - try { - this.tree.rerender(node); - } - catch (_a) { - // missing nodes are fine, this could've resulted from - // parallel refresh calls, removing `node` altogether - } - } - }); - } - // View - rerender(element) { - if (element === undefined || element === this.root.element) { - this.tree.rerender(); - return; - } - const node = this.getDataNode(element); - this.tree.rerender(node); - } - collapse(element, recursive = false) { - const node = this.getDataNode(element); - return this.tree.collapse(node === this.root ? null : node, recursive); - } - expand(element, recursive = false) { - return __awaiter(this, void 0, void 0, function* () { - if (typeof this.root.element === 'undefined') { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_2__["TreeError"](this.user, 'Tree input not set'); - } - if (this.root.refreshPromise) { - yield this.root.refreshPromise; - yield _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].toPromise(this._onDidRender.event); - } - const node = this.getDataNode(element); - if (this.tree.hasElement(node) && !this.tree.isCollapsible(node)) { - return false; - } - if (node.refreshPromise) { - yield this.root.refreshPromise; - yield _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].toPromise(this._onDidRender.event); - } - if (node !== this.root && !node.refreshPromise && !this.tree.isCollapsed(node)) { - return false; - } - const result = this.tree.expand(node === this.root ? null : node, recursive); - if (node.refreshPromise) { - yield this.root.refreshPromise; - yield _common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].toPromise(this._onDidRender.event); - } - return result; - }); - } - setSelection(elements, browserEvent) { - const nodes = elements.map(e => this.getDataNode(e)); - this.tree.setSelection(nodes, browserEvent); - } - getSelection() { - const nodes = this.tree.getSelection(); - return nodes.map(n => n.element); - } - setFocus(elements, browserEvent) { - const nodes = elements.map(e => this.getDataNode(e)); - this.tree.setFocus(nodes, browserEvent); - } - getFocus() { - const nodes = this.tree.getFocus(); - return nodes.map(n => n.element); - } - reveal(element, relativeTop) { - this.tree.reveal(this.getDataNode(element), relativeTop); - } - // Implementation - getDataNode(element) { - const node = this.nodes.get((element === this.root.element ? null : element)); - if (!node) { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_2__["TreeError"](this.user, `Data tree node not found: ${element}`); - } - return node; - } - refreshAndRenderNode(node, recursive, viewStateContext) { - return __awaiter(this, void 0, void 0, function* () { - yield this.refreshNode(node, recursive, viewStateContext); - this.render(node, viewStateContext); - }); - } - refreshNode(node, recursive, viewStateContext) { - return __awaiter(this, void 0, void 0, function* () { - let result; - this.subTreeRefreshPromises.forEach((refreshPromise, refreshNode) => { - if (!result && intersects(refreshNode, node)) { - result = refreshPromise.then(() => this.refreshNode(node, recursive, viewStateContext)); - } - }); - if (result) { - return result; - } - return this.doRefreshSubTree(node, recursive, viewStateContext); - }); - } - doRefreshSubTree(node, recursive, viewStateContext) { - return __awaiter(this, void 0, void 0, function* () { - let done; - node.refreshPromise = new Promise(c => done = c); - this.subTreeRefreshPromises.set(node, node.refreshPromise); - node.refreshPromise.finally(() => { - node.refreshPromise = undefined; - this.subTreeRefreshPromises.delete(node); - }); - try { - const childrenToRefresh = yield this.doRefreshNode(node, recursive, viewStateContext); - node.stale = false; - yield Promise.all(childrenToRefresh.map(child => this.doRefreshSubTree(child, recursive, viewStateContext))); - } - finally { - done(); - } - }); - } - doRefreshNode(node, recursive, viewStateContext) { - return __awaiter(this, void 0, void 0, function* () { - node.hasChildren = !!this.dataSource.hasChildren(node.element); - let childrenPromise; - if (!node.hasChildren) { - childrenPromise = Promise.resolve(_common_iterator_js__WEBPACK_IMPORTED_MODULE_6__["Iterable"].empty()); - } - else { - const slowTimeout = Object(_common_async_js__WEBPACK_IMPORTED_MODULE_5__["timeout"])(800); - slowTimeout.then(() => { - node.slow = true; - this._onDidChangeNodeSlowState.fire(node); - }, _ => null); - childrenPromise = this.doGetChildren(node) - .finally(() => slowTimeout.cancel()); - } - try { - const children = yield childrenPromise; - return this.setChildren(node, children, recursive, viewStateContext); - } - catch (err) { - if (node !== this.root) { - this.tree.collapse(node === this.root ? null : node); - } - if (Object(_common_errors_js__WEBPACK_IMPORTED_MODULE_8__["isPromiseCanceledError"])(err)) { - return []; - } - throw err; - } - finally { - if (node.slow) { - node.slow = false; - this._onDidChangeNodeSlowState.fire(node); - } - } - }); - } - doGetChildren(node) { - let result = this.refreshPromises.get(node); - if (result) { - return result; - } - result = Object(_common_async_js__WEBPACK_IMPORTED_MODULE_5__["createCancelablePromise"])(() => __awaiter(this, void 0, void 0, function* () { - const children = yield this.dataSource.getChildren(node.element); - return this.processChildren(children); - })); - this.refreshPromises.set(node, result); - return result.finally(() => { this.refreshPromises.delete(node); }); - } - _onDidChangeCollapseState({ node, deep }) { - if (node.element === null) { - return; - } - if (!node.collapsed && node.element.stale) { - if (deep) { - this.collapse(node.element.element); - } - else { - this.refreshAndRenderNode(node.element, false) - .catch(_common_errors_js__WEBPACK_IMPORTED_MODULE_8__["onUnexpectedError"]); - } - } - } - setChildren(node, childrenElementsIterable, recursive, viewStateContext) { - const childrenElements = [...childrenElementsIterable]; - // perf: if the node was and still is a leaf, avoid all this hassle - if (node.children.length === 0 && childrenElements.length === 0) { - return []; - } - const nodesToForget = new Map(); - const childrenTreeNodesById = new Map(); - for (const child of node.children) { - nodesToForget.set(child.element, child); - if (this.identityProvider) { - const collapsed = this.tree.isCollapsed(child); - childrenTreeNodesById.set(child.id, { node: child, collapsed }); - } - } - const childrenToRefresh = []; - const children = childrenElements.map(element => { - const hasChildren = !!this.dataSource.hasChildren(element); - if (!this.identityProvider) { - const asyncDataTreeNode = createAsyncDataTreeNode({ element, parent: node, hasChildren }); - if (hasChildren && this.collapseByDefault && !this.collapseByDefault(element)) { - asyncDataTreeNode.collapsedByDefault = false; - childrenToRefresh.push(asyncDataTreeNode); - } - return asyncDataTreeNode; - } - const id = this.identityProvider.getId(element).toString(); - const result = childrenTreeNodesById.get(id); - if (result) { - const asyncDataTreeNode = result.node; - nodesToForget.delete(asyncDataTreeNode.element); - this.nodes.delete(asyncDataTreeNode.element); - this.nodes.set(element, asyncDataTreeNode); - asyncDataTreeNode.element = element; - asyncDataTreeNode.hasChildren = hasChildren; - if (recursive) { - if (result.collapsed) { - asyncDataTreeNode.children.forEach(node => dfs(node, node => this.nodes.delete(node.element))); - asyncDataTreeNode.children.splice(0, asyncDataTreeNode.children.length); - asyncDataTreeNode.stale = true; - } - else { - childrenToRefresh.push(asyncDataTreeNode); - } - } - else if (hasChildren && this.collapseByDefault && !this.collapseByDefault(element)) { - asyncDataTreeNode.collapsedByDefault = false; - childrenToRefresh.push(asyncDataTreeNode); - } - return asyncDataTreeNode; - } - const childAsyncDataTreeNode = createAsyncDataTreeNode({ element, parent: node, id, hasChildren }); - if (viewStateContext && viewStateContext.viewState.focus && viewStateContext.viewState.focus.indexOf(id) > -1) { - viewStateContext.focus.push(childAsyncDataTreeNode); - } - if (viewStateContext && viewStateContext.viewState.selection && viewStateContext.viewState.selection.indexOf(id) > -1) { - viewStateContext.selection.push(childAsyncDataTreeNode); - } - if (viewStateContext && viewStateContext.viewState.expanded && viewStateContext.viewState.expanded.indexOf(id) > -1) { - childrenToRefresh.push(childAsyncDataTreeNode); - } - else if (hasChildren && this.collapseByDefault && !this.collapseByDefault(element)) { - childAsyncDataTreeNode.collapsedByDefault = false; - childrenToRefresh.push(childAsyncDataTreeNode); - } - return childAsyncDataTreeNode; - }); - for (const node of nodesToForget.values()) { - dfs(node, node => this.nodes.delete(node.element)); - } - for (const child of children) { - this.nodes.set(child.element, child); - } - node.children.splice(0, node.children.length, ...children); - // TODO@joao this doesn't take filter into account - if (node !== this.root && this.autoExpandSingleChildren && children.length === 1 && childrenToRefresh.length === 0) { - children[0].collapsedByDefault = false; - childrenToRefresh.push(children[0]); - } - return childrenToRefresh; - } - render(node, viewStateContext) { - const children = node.children.map(node => this.asTreeElement(node, viewStateContext)); - this.tree.setChildren(node === this.root ? null : node, children); - if (node !== this.root) { - this.tree.setCollapsible(node, node.hasChildren); - } - this._onDidRender.fire(); - } - asTreeElement(node, viewStateContext) { - if (node.stale) { - return { - element: node, - collapsible: node.hasChildren, - collapsed: true - }; - } - let collapsed; - if (viewStateContext && viewStateContext.viewState.expanded && node.id && viewStateContext.viewState.expanded.indexOf(node.id) > -1) { - collapsed = false; - } - else { - collapsed = node.collapsedByDefault; - } - node.collapsedByDefault = undefined; - return { - element: node, - children: node.hasChildren ? _common_iterator_js__WEBPACK_IMPORTED_MODULE_6__["Iterable"].map(node.children, child => this.asTreeElement(child, viewStateContext)) : [], - collapsible: node.hasChildren, - collapsed - }; - } - processChildren(children) { - if (this.sorter) { - children = [...children].sort(this.sorter.compare.bind(this.sorter)); - } - return children; - } - dispose() { - this.disposables.dispose(); - } -} -class CompressibleAsyncDataTreeNodeWrapper { - constructor(node) { - this.node = node; - } - get element() { - return { - elements: this.node.element.elements.map(e => e.element), - incompressible: this.node.element.incompressible - }; - } - get children() { return this.node.children.map(node => new CompressibleAsyncDataTreeNodeWrapper(node)); } - get depth() { return this.node.depth; } - get visibleChildrenCount() { return this.node.visibleChildrenCount; } - get visibleChildIndex() { return this.node.visibleChildIndex; } - get collapsible() { return this.node.collapsible; } - get collapsed() { return this.node.collapsed; } - get visible() { return this.node.visible; } - get filterData() { return this.node.filterData; } -} -class CompressibleAsyncDataTreeRenderer { - constructor(renderer, nodeMapper, compressibleNodeMapperProvider, onDidChangeTwistieState) { - this.renderer = renderer; - this.nodeMapper = nodeMapper; - this.compressibleNodeMapperProvider = compressibleNodeMapperProvider; - this.onDidChangeTwistieState = onDidChangeTwistieState; - this.renderedNodes = new Map(); - this.disposables = []; - this.templateId = renderer.templateId; - } - renderTemplate(container) { - const templateData = this.renderer.renderTemplate(container); - return { templateData }; - } - renderElement(node, index, templateData, height) { - this.renderer.renderElement(this.nodeMapper.map(node), index, templateData.templateData, height); - } - renderCompressedElements(node, index, templateData, height) { - this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(node), index, templateData.templateData, height); - } - renderTwistie(element, twistieElement) { - if (element.slow) { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_9__["addClasses"])(twistieElement, _treeIcons_js__WEBPACK_IMPORTED_MODULE_11__["treeItemLoadingIcon"].classNames); - } - else { - Object(_dom_js__WEBPACK_IMPORTED_MODULE_9__["removeClasses"])(twistieElement, _treeIcons_js__WEBPACK_IMPORTED_MODULE_11__["treeItemLoadingIcon"].classNames); - } - return false; - } - disposeElement(node, index, templateData, height) { - if (this.renderer.disposeElement) { - this.renderer.disposeElement(this.nodeMapper.map(node), index, templateData.templateData, height); - } - } - disposeCompressedElements(node, index, templateData, height) { - if (this.renderer.disposeCompressedElements) { - this.renderer.disposeCompressedElements(this.compressibleNodeMapperProvider().map(node), index, templateData.templateData, height); - } - } - disposeTemplate(templateData) { - this.renderer.disposeTemplate(templateData.templateData); - } - dispose() { - this.renderedNodes.clear(); - this.disposables = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["dispose"])(this.disposables); - } -} -function asCompressibleObjectTreeOptions(options) { - const objectTreeOptions = options && asObjectTreeOptions(options); - return objectTreeOptions && Object.assign(Object.assign({}, objectTreeOptions), { keyboardNavigationLabelProvider: objectTreeOptions.keyboardNavigationLabelProvider && Object.assign(Object.assign({}, objectTreeOptions.keyboardNavigationLabelProvider), { getCompressedNodeKeyboardNavigationLabel(els) { - return options.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(els.map(e => e.element)); - } }) }); -} -class CompressibleAsyncDataTree extends AsyncDataTree { - constructor(user, container, virtualDelegate, compressionDelegate, renderers, dataSource, options = {}) { - super(user, container, virtualDelegate, renderers, dataSource, options); - this.compressionDelegate = compressionDelegate; - this.compressibleNodeMapper = new _tree_js__WEBPACK_IMPORTED_MODULE_2__["WeakMapper"](node => new CompressibleAsyncDataTreeNodeWrapper(node)); - this.filter = options.filter; - } - createTree(user, container, delegate, renderers, options) { - const objectTreeDelegate = new _abstractTree_js__WEBPACK_IMPORTED_MODULE_0__["ComposedTreeDelegate"](delegate); - const objectTreeRenderers = renderers.map(r => new CompressibleAsyncDataTreeRenderer(r, this.nodeMapper, () => this.compressibleNodeMapper, this._onDidChangeNodeSlowState.event)); - const objectTreeOptions = asCompressibleObjectTreeOptions(options) || {}; - return new _objectTree_js__WEBPACK_IMPORTED_MODULE_1__["CompressibleObjectTree"](user, container, objectTreeDelegate, objectTreeRenderers, objectTreeOptions); - } - asTreeElement(node, viewStateContext) { - return Object.assign({ incompressible: this.compressionDelegate.isIncompressible(node.element) }, super.asTreeElement(node, viewStateContext)); - } - updateOptions(options = {}) { - this.tree.updateOptions(options); - } - render(node, viewStateContext) { - if (!this.identityProvider) { - return super.render(node, viewStateContext); - } - // Preserve traits across compressions. Hacky but does the trick. - // This is hard to fix properly since it requires rewriting the traits - // across trees and lists. Let's just keep it this way for now. - const getId = (element) => this.identityProvider.getId(element).toString(); - const getUncompressedIds = (nodes) => { - const result = new Set(); - for (const node of nodes) { - const compressedNode = this.tree.getCompressedTreeNode(node === this.root ? null : node); - if (!compressedNode.element) { - continue; - } - for (const node of compressedNode.element.elements) { - result.add(getId(node.element)); - } - } - return result; - }; - const oldSelection = getUncompressedIds(this.tree.getSelection()); - const oldFocus = getUncompressedIds(this.tree.getFocus()); - super.render(node, viewStateContext); - const selection = this.getSelection(); - let didChangeSelection = false; - const focus = this.getFocus(); - let didChangeFocus = false; - const visit = (node) => { - const compressedNode = node.element; - if (compressedNode) { - for (let i = 0; i < compressedNode.elements.length; i++) { - const id = getId(compressedNode.elements[i].element); - const element = compressedNode.elements[compressedNode.elements.length - 1].element; - // github.com/microsoft/vscode/issues/85938 - if (oldSelection.has(id) && selection.indexOf(element) === -1) { - selection.push(element); - didChangeSelection = true; - } - if (oldFocus.has(id) && focus.indexOf(element) === -1) { - focus.push(element); - didChangeFocus = true; - } - } - } - node.children.forEach(visit); - }; - visit(this.tree.getCompressedTreeNode(node === this.root ? null : node)); - if (didChangeSelection) { - this.setSelection(selection); - } - if (didChangeFocus) { - this.setFocus(focus); - } - } - // For compressed async data trees, `TreeVisibility.Recurse` doesn't currently work - // and we have to filter everything beforehand - // Related to #85193 and #85835 - processChildren(children) { - if (this.filter) { - children = _common_iterator_js__WEBPACK_IMPORTED_MODULE_6__["Iterable"].filter(children, e => { - const result = this.filter.filter(e, 1 /* Visible */); - const visibility = getVisibility(result); - if (visibility === 2 /* Recurse */) { - throw new Error('Recursive tree visibility not supported in async data compressed trees'); - } - return visibility === 1 /* Visible */; - }); - } - return super.processChildren(children); - } -} -function getVisibility(filterResult) { - if (typeof filterResult === 'boolean') { - return filterResult ? 1 /* Visible */ : 0 /* Hidden */; - } - else if (Object(_indexTreeModel_js__WEBPACK_IMPORTED_MODULE_10__["isFilterResult"])(filterResult)) { - return Object(_indexTreeModel_js__WEBPACK_IMPORTED_MODULE_10__["getVisibleState"])(filterResult.visibility); - } - else { - return Object(_indexTreeModel_js__WEBPACK_IMPORTED_MODULE_10__["getVisibleState"])(filterResult); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/compressedObjectTreeModel.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/compressedObjectTreeModel.js ***! - \*********************************************************************************************/ -/*! exports provided: compress, decompress, CompressedObjectTreeModel, DefaultElementMapper, CompressibleObjectTreeModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compress", function() { return compress; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decompress", function() { return decompress; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompressedObjectTreeModel", function() { return CompressedObjectTreeModel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultElementMapper", function() { return DefaultElementMapper; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompressibleObjectTreeModel", function() { return CompressibleObjectTreeModel; }); -/* harmony import */ var _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _tree_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tree.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/tree.js"); -/* harmony import */ var _objectTreeModel_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./objectTreeModel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/objectTreeModel.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -function noCompress(element) { - const elements = [element.element]; - const incompressible = element.incompressible || false; - return { - element: { elements, incompressible }, - children: _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].map(_common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].from(element.children), noCompress), - collapsible: element.collapsible, - collapsed: element.collapsed - }; -} -// Exported only for test reasons, do not use directly -function compress(element) { - const elements = [element.element]; - const incompressible = element.incompressible || false; - let childrenIterator; - let children; - while (true) { - [children, childrenIterator] = _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].consume(_common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].from(element.children), 2); - if (children.length !== 1) { - break; - } - element = children[0]; - if (element.incompressible) { - break; - } - elements.push(element.element); - } - return { - element: { elements, incompressible }, - children: _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].map(_common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].concat(children, childrenIterator), compress), - collapsible: element.collapsible, - collapsed: element.collapsed - }; -} -function _decompress(element, index = 0) { - let children; - if (index < element.element.elements.length - 1) { - children = [_decompress(element, index + 1)]; - } - else { - children = _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].map(_common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].from(element.children), el => _decompress(el, 0)); - } - if (index === 0 && element.element.incompressible) { - return { - element: element.element.elements[index], - children, - incompressible: true, - collapsible: element.collapsible, - collapsed: element.collapsed - }; - } - return { - element: element.element.elements[index], - children, - collapsible: element.collapsible, - collapsed: element.collapsed - }; -} -// Exported only for test reasons, do not use directly -function decompress(element) { - return _decompress(element, 0); -} -function splice(treeElement, element, children) { - if (treeElement.element === element) { - return Object.assign(Object.assign({}, treeElement), { children }); - } - return Object.assign(Object.assign({}, treeElement), { children: _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].map(_common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].from(treeElement.children), e => splice(e, element, children)) }); -} -// Exported only for test reasons, do not use directly -class CompressedObjectTreeModel { - constructor(user, list, options = {}) { - this.user = user; - this.rootRef = null; - this.nodes = new Map(); - this.model = new _objectTreeModel_js__WEBPACK_IMPORTED_MODULE_3__["ObjectTreeModel"](user, list, options); - this.enabled = typeof options.compressionEnabled === 'undefined' ? true : options.compressionEnabled; - } - get onDidSplice() { return this.model.onDidSplice; } - get onDidChangeCollapseState() { return this.model.onDidChangeCollapseState; } - get onDidChangeRenderNodeCount() { return this.model.onDidChangeRenderNodeCount; } - setChildren(element, children = _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].empty()) { - if (element === null) { - const compressedChildren = _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].map(children, this.enabled ? compress : noCompress); - this._setChildren(null, compressedChildren); - return; - } - const compressedNode = this.nodes.get(element); - if (!compressedNode) { - throw new Error('Unknown compressed tree node'); - } - const node = this.model.getNode(compressedNode); - const compressedParentNode = this.model.getParentNodeLocation(compressedNode); - const parent = this.model.getNode(compressedParentNode); - const decompressedElement = decompress(node); - const splicedElement = splice(decompressedElement, element, children); - const recompressedElement = (this.enabled ? compress : noCompress)(splicedElement); - const parentChildren = parent.children - .map(child => child === node ? recompressedElement : child); - this._setChildren(parent.element, parentChildren); - } - setCompressionEnabled(enabled) { - if (enabled === this.enabled) { - return; - } - this.enabled = enabled; - const root = this.model.getNode(); - const rootChildren = root.children; - const decompressedRootChildren = _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].map(rootChildren, decompress); - const recompressedRootChildren = _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].map(decompressedRootChildren, enabled ? compress : noCompress); - this._setChildren(null, recompressedRootChildren); - } - _setChildren(node, children) { - const insertedElements = new Set(); - const _onDidCreateNode = (node) => { - for (const element of node.element.elements) { - insertedElements.add(element); - this.nodes.set(element, node.element); - } - }; - const _onDidDeleteNode = (node) => { - for (const element of node.element.elements) { - if (!insertedElements.has(element)) { - this.nodes.delete(element); - } - } - }; - this.model.setChildren(node, children, _onDidCreateNode, _onDidDeleteNode); - } - has(element) { - return this.nodes.has(element); - } - getListIndex(location) { - const node = this.getCompressedNode(location); - return this.model.getListIndex(node); - } - getListRenderCount(location) { - const node = this.getCompressedNode(location); - return this.model.getListRenderCount(node); - } - getNode(location) { - if (typeof location === 'undefined') { - return this.model.getNode(); - } - const node = this.getCompressedNode(location); - return this.model.getNode(node); - } - // TODO: review this - getNodeLocation(node) { - const compressedNode = this.model.getNodeLocation(node); - if (compressedNode === null) { - return null; - } - return compressedNode.elements[compressedNode.elements.length - 1]; - } - // TODO: review this - getParentNodeLocation(location) { - const compressedNode = this.getCompressedNode(location); - const parentNode = this.model.getParentNodeLocation(compressedNode); - if (parentNode === null) { - return null; - } - return parentNode.elements[parentNode.elements.length - 1]; - } - isCollapsible(location) { - const compressedNode = this.getCompressedNode(location); - return this.model.isCollapsible(compressedNode); - } - setCollapsible(location, collapsible) { - const compressedNode = this.getCompressedNode(location); - return this.model.setCollapsible(compressedNode, collapsible); - } - isCollapsed(location) { - const compressedNode = this.getCompressedNode(location); - return this.model.isCollapsed(compressedNode); - } - setCollapsed(location, collapsed, recursive) { - const compressedNode = this.getCompressedNode(location); - return this.model.setCollapsed(compressedNode, collapsed, recursive); - } - expandTo(location) { - const compressedNode = this.getCompressedNode(location); - this.model.expandTo(compressedNode); - } - rerender(location) { - const compressedNode = this.getCompressedNode(location); - this.model.rerender(compressedNode); - } - refilter() { - this.model.refilter(); - } - getCompressedNode(element) { - if (element === null) { - return null; - } - const node = this.nodes.get(element); - if (!node) { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_2__["TreeError"](this.user, `Tree element not found: ${element}`); - } - return node; - } -} -const DefaultElementMapper = elements => elements[elements.length - 1]; -class CompressedTreeNodeWrapper { - constructor(unwrapper, node) { - this.unwrapper = unwrapper; - this.node = node; - } - get element() { return this.node.element === null ? null : this.unwrapper(this.node.element); } - get children() { return this.node.children.map(node => new CompressedTreeNodeWrapper(this.unwrapper, node)); } - get depth() { return this.node.depth; } - get visibleChildrenCount() { return this.node.visibleChildrenCount; } - get visibleChildIndex() { return this.node.visibleChildIndex; } - get collapsible() { return this.node.collapsible; } - get collapsed() { return this.node.collapsed; } - get visible() { return this.node.visible; } - get filterData() { return this.node.filterData; } -} -function mapList(nodeMapper, list) { - return { - splice(start, deleteCount, toInsert) { - list.splice(start, deleteCount, toInsert.map(node => nodeMapper.map(node))); - }, - updateElementHeight(index, height) { - list.updateElementHeight(index, height); - } - }; -} -function mapOptions(compressedNodeUnwrapper, options) { - return Object.assign(Object.assign({}, options), { sorter: options.sorter && { - compare(node, otherNode) { - return options.sorter.compare(node.elements[0], otherNode.elements[0]); - } - }, identityProvider: options.identityProvider && { - getId(node) { - return options.identityProvider.getId(compressedNodeUnwrapper(node)); - } - }, filter: options.filter && { - filter(node, parentVisibility) { - return options.filter.filter(compressedNodeUnwrapper(node), parentVisibility); - } - } }); -} -class CompressibleObjectTreeModel { - constructor(user, list, options = {}) { - this.rootRef = null; - this.elementMapper = options.elementMapper || DefaultElementMapper; - const compressedNodeUnwrapper = node => this.elementMapper(node.elements); - this.nodeMapper = new _tree_js__WEBPACK_IMPORTED_MODULE_2__["WeakMapper"](node => new CompressedTreeNodeWrapper(compressedNodeUnwrapper, node)); - this.model = new CompressedObjectTreeModel(user, mapList(this.nodeMapper, list), mapOptions(compressedNodeUnwrapper, options)); - } - get onDidSplice() { - return _common_event_js__WEBPACK_IMPORTED_MODULE_1__["Event"].map(this.model.onDidSplice, ({ insertedNodes, deletedNodes }) => ({ - insertedNodes: insertedNodes.map(node => this.nodeMapper.map(node)), - deletedNodes: deletedNodes.map(node => this.nodeMapper.map(node)), - })); - } - get onDidChangeCollapseState() { - return _common_event_js__WEBPACK_IMPORTED_MODULE_1__["Event"].map(this.model.onDidChangeCollapseState, ({ node, deep }) => ({ - node: this.nodeMapper.map(node), - deep - })); - } - get onDidChangeRenderNodeCount() { - return _common_event_js__WEBPACK_IMPORTED_MODULE_1__["Event"].map(this.model.onDidChangeRenderNodeCount, node => this.nodeMapper.map(node)); - } - setChildren(element, children = _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].empty()) { - this.model.setChildren(element, children); - } - setCompressionEnabled(enabled) { - this.model.setCompressionEnabled(enabled); - } - has(location) { - return this.model.has(location); - } - getListIndex(location) { - return this.model.getListIndex(location); - } - getListRenderCount(location) { - return this.model.getListRenderCount(location); - } - getNode(location) { - return this.nodeMapper.map(this.model.getNode(location)); - } - getNodeLocation(node) { - return node.element; - } - getParentNodeLocation(location) { - return this.model.getParentNodeLocation(location); - } - isCollapsible(location) { - return this.model.isCollapsible(location); - } - setCollapsible(location, collapsed) { - return this.model.setCollapsible(location, collapsed); - } - isCollapsed(location) { - return this.model.isCollapsed(location); - } - setCollapsed(location, collapsed, recursive) { - return this.model.setCollapsed(location, collapsed, recursive); - } - expandTo(location) { - return this.model.expandTo(location); - } - rerender(location) { - return this.model.rerender(location); - } - refilter() { - return this.model.refilter(); - } - getCompressedTreeNode(location = null) { - return this.model.getNode(location); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/dataTree.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/dataTree.js ***! - \****************************************************************************/ -/*! exports provided: DataTree */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataTree", function() { return DataTree; }); -/* harmony import */ var _abstractTree_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./abstractTree.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/abstractTree.js"); -/* harmony import */ var _objectTreeModel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./objectTreeModel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/objectTreeModel.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class DataTree extends _abstractTree_js__WEBPACK_IMPORTED_MODULE_0__["AbstractTree"] { - constructor(user, container, delegate, renderers, dataSource, options = {}) { - super(user, container, delegate, renderers, options); - this.user = user; - this.dataSource = dataSource; - this.identityProvider = options.identityProvider; - } - createModel(user, view, options) { - return new _objectTreeModel_js__WEBPACK_IMPORTED_MODULE_1__["ObjectTreeModel"](user, view, options); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/indexTreeModel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/indexTreeModel.js ***! - \**********************************************************************************/ -/*! exports provided: isFilterResult, getVisibleState, IndexTreeModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFilterResult", function() { return isFilterResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVisibleState", function() { return getVisibleState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndexTreeModel", function() { return IndexTreeModel; }); -/* harmony import */ var _tree_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tree.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/tree.js"); -/* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _common_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -function isFilterResult(obj) { - return typeof obj === 'object' && 'visibility' in obj && 'data' in obj; -} -function getVisibleState(visibility) { - switch (visibility) { - case true: return 1 /* Visible */; - case false: return 0 /* Hidden */; - default: return visibility; - } -} -function isCollapsibleStateUpdate(update) { - return typeof update.collapsible === 'boolean'; -} -class IndexTreeModel { - constructor(user, list, rootElement, options = {}) { - this.user = user; - this.list = list; - this.rootRef = []; - this.eventBufferer = new _common_event_js__WEBPACK_IMPORTED_MODULE_2__["EventBufferer"](); - this._onDidChangeCollapseState = new _common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"](); - this.onDidChangeCollapseState = this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event); - this._onDidChangeRenderNodeCount = new _common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"](); - this.onDidChangeRenderNodeCount = this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event); - this._onDidSplice = new _common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"](); - this.onDidSplice = this._onDidSplice.event; - this.collapseByDefault = typeof options.collapseByDefault === 'undefined' ? false : options.collapseByDefault; - this.filter = options.filter; - this.autoExpandSingleChildren = typeof options.autoExpandSingleChildren === 'undefined' ? false : options.autoExpandSingleChildren; - this.root = { - parent: undefined, - element: rootElement, - children: [], - depth: 0, - visibleChildrenCount: 0, - visibleChildIndex: -1, - collapsible: false, - collapsed: false, - renderNodeCount: 0, - visibility: 1 /* Visible */, - visible: true, - filterData: undefined - }; - } - splice(location, deleteCount, toInsert = _common_iterator_js__WEBPACK_IMPORTED_MODULE_3__["Iterable"].empty(), onDidCreateNode, onDidDeleteNode) { - if (location.length === 0) { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_0__["TreeError"](this.user, 'Invalid tree location'); - } - const { parentNode, listIndex, revealed, visible } = this.getParentNodeWithListIndex(location); - const treeListElementsToInsert = []; - const nodesToInsertIterator = _common_iterator_js__WEBPACK_IMPORTED_MODULE_3__["Iterable"].map(toInsert, el => this.createTreeNode(el, parentNode, parentNode.visible ? 1 /* Visible */ : 0 /* Hidden */, revealed, treeListElementsToInsert, onDidCreateNode)); - const lastIndex = location[location.length - 1]; - // figure out what's the visible child start index right before the - // splice point - let visibleChildStartIndex = 0; - for (let i = lastIndex; i >= 0 && i < parentNode.children.length; i--) { - const child = parentNode.children[i]; - if (child.visible) { - visibleChildStartIndex = child.visibleChildIndex; - break; - } - } - const nodesToInsert = []; - let insertedVisibleChildrenCount = 0; - let renderNodeCount = 0; - for (const child of nodesToInsertIterator) { - nodesToInsert.push(child); - renderNodeCount += child.renderNodeCount; - if (child.visible) { - child.visibleChildIndex = visibleChildStartIndex + insertedVisibleChildrenCount++; - } - } - const deletedNodes = parentNode.children.splice(lastIndex, deleteCount, ...nodesToInsert); - // figure out what is the count of deleted visible children - let deletedVisibleChildrenCount = 0; - for (const child of deletedNodes) { - if (child.visible) { - deletedVisibleChildrenCount++; - } - } - // and adjust for all visible children after the splice point - if (deletedVisibleChildrenCount !== 0) { - for (let i = lastIndex + nodesToInsert.length; i < parentNode.children.length; i++) { - const child = parentNode.children[i]; - if (child.visible) { - child.visibleChildIndex -= deletedVisibleChildrenCount; - } - } - } - // update parent's visible children count - parentNode.visibleChildrenCount += insertedVisibleChildrenCount - deletedVisibleChildrenCount; - if (revealed && visible) { - const visibleDeleteCount = deletedNodes.reduce((r, node) => r + (node.visible ? node.renderNodeCount : 0), 0); - this._updateAncestorsRenderNodeCount(parentNode, renderNodeCount - visibleDeleteCount); - this.list.splice(listIndex, visibleDeleteCount, treeListElementsToInsert); - } - if (deletedNodes.length > 0 && onDidDeleteNode) { - const visit = (node) => { - onDidDeleteNode(node); - node.children.forEach(visit); - }; - deletedNodes.forEach(visit); - } - this._onDidSplice.fire({ insertedNodes: nodesToInsert, deletedNodes }); - let node = parentNode; - while (node) { - if (node.visibility === 2 /* Recurse */) { - this.refilter(); - break; - } - node = node.parent; - } - } - rerender(location) { - if (location.length === 0) { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_0__["TreeError"](this.user, 'Invalid tree location'); - } - const { node, listIndex, revealed } = this.getTreeNodeWithListIndex(location); - if (node.visible && revealed) { - this.list.splice(listIndex, 1, [node]); - } - } - has(location) { - return this.hasTreeNode(location); - } - getListIndex(location) { - const { listIndex, visible, revealed } = this.getTreeNodeWithListIndex(location); - return visible && revealed ? listIndex : -1; - } - getListRenderCount(location) { - return this.getTreeNode(location).renderNodeCount; - } - isCollapsible(location) { - return this.getTreeNode(location).collapsible; - } - setCollapsible(location, collapsible) { - const node = this.getTreeNode(location); - if (typeof collapsible === 'undefined') { - collapsible = !node.collapsible; - } - const update = { collapsible }; - return this.eventBufferer.bufferEvents(() => this._setCollapseState(location, update)); - } - isCollapsed(location) { - return this.getTreeNode(location).collapsed; - } - setCollapsed(location, collapsed, recursive) { - const node = this.getTreeNode(location); - if (typeof collapsed === 'undefined') { - collapsed = !node.collapsed; - } - const update = { collapsed, recursive: recursive || false }; - return this.eventBufferer.bufferEvents(() => this._setCollapseState(location, update)); - } - _setCollapseState(location, update) { - const { node, listIndex, revealed } = this.getTreeNodeWithListIndex(location); - const result = this._setListNodeCollapseState(node, listIndex, revealed, update); - if (node !== this.root && this.autoExpandSingleChildren && result && !isCollapsibleStateUpdate(update) && node.collapsible && !node.collapsed && !update.recursive) { - let onlyVisibleChildIndex = -1; - for (let i = 0; i < node.children.length; i++) { - const child = node.children[i]; - if (child.visible) { - if (onlyVisibleChildIndex > -1) { - onlyVisibleChildIndex = -1; - break; - } - else { - onlyVisibleChildIndex = i; - } - } - } - if (onlyVisibleChildIndex > -1) { - this._setCollapseState([...location, onlyVisibleChildIndex], update); - } - } - return result; - } - _setListNodeCollapseState(node, listIndex, revealed, update) { - const result = this._setNodeCollapseState(node, update, false); - if (!revealed || !node.visible || !result) { - return result; - } - const previousRenderNodeCount = node.renderNodeCount; - const toInsert = this.updateNodeAfterCollapseChange(node); - const deleteCount = previousRenderNodeCount - (listIndex === -1 ? 0 : 1); - this.list.splice(listIndex + 1, deleteCount, toInsert.slice(1)); - return result; - } - _setNodeCollapseState(node, update, deep) { - let result; - if (node === this.root) { - result = false; - } - else { - if (isCollapsibleStateUpdate(update)) { - result = node.collapsible !== update.collapsible; - node.collapsible = update.collapsible; - } - else if (!node.collapsible) { - result = false; - } - else { - result = node.collapsed !== update.collapsed; - node.collapsed = update.collapsed; - } - if (result) { - this._onDidChangeCollapseState.fire({ node, deep }); - } - } - if (!isCollapsibleStateUpdate(update) && update.recursive) { - for (const child of node.children) { - result = this._setNodeCollapseState(child, update, true) || result; - } - } - return result; - } - expandTo(location) { - this.eventBufferer.bufferEvents(() => { - let node = this.getTreeNode(location); - while (node.parent) { - node = node.parent; - location = location.slice(0, location.length - 1); - if (node.collapsed) { - this._setCollapseState(location, { collapsed: false, recursive: false }); - } - } - }); - } - refilter() { - const previousRenderNodeCount = this.root.renderNodeCount; - const toInsert = this.updateNodeAfterFilterChange(this.root); - this.list.splice(0, previousRenderNodeCount, toInsert); - } - createTreeNode(treeElement, parent, parentVisibility, revealed, treeListElements, onDidCreateNode) { - const node = { - parent, - element: treeElement.element, - children: [], - depth: parent.depth + 1, - visibleChildrenCount: 0, - visibleChildIndex: -1, - collapsible: typeof treeElement.collapsible === 'boolean' ? treeElement.collapsible : (typeof treeElement.collapsed !== 'undefined'), - collapsed: typeof treeElement.collapsed === 'undefined' ? this.collapseByDefault : treeElement.collapsed, - renderNodeCount: 1, - visibility: 1 /* Visible */, - visible: true, - filterData: undefined - }; - const visibility = this._filterNode(node, parentVisibility); - node.visibility = visibility; - if (revealed) { - treeListElements.push(node); - } - const childElements = treeElement.children || _common_iterator_js__WEBPACK_IMPORTED_MODULE_3__["Iterable"].empty(); - const childRevealed = revealed && visibility !== 0 /* Hidden */ && !node.collapsed; - const childNodes = _common_iterator_js__WEBPACK_IMPORTED_MODULE_3__["Iterable"].map(childElements, el => this.createTreeNode(el, node, visibility, childRevealed, treeListElements, onDidCreateNode)); - let visibleChildrenCount = 0; - let renderNodeCount = 1; - for (const child of childNodes) { - node.children.push(child); - renderNodeCount += child.renderNodeCount; - if (child.visible) { - child.visibleChildIndex = visibleChildrenCount++; - } - } - node.collapsible = node.collapsible || node.children.length > 0; - node.visibleChildrenCount = visibleChildrenCount; - node.visible = visibility === 2 /* Recurse */ ? visibleChildrenCount > 0 : (visibility === 1 /* Visible */); - if (!node.visible) { - node.renderNodeCount = 0; - if (revealed) { - treeListElements.pop(); - } - } - else if (!node.collapsed) { - node.renderNodeCount = renderNodeCount; - } - if (onDidCreateNode) { - onDidCreateNode(node); - } - return node; - } - updateNodeAfterCollapseChange(node) { - const previousRenderNodeCount = node.renderNodeCount; - const result = []; - this._updateNodeAfterCollapseChange(node, result); - this._updateAncestorsRenderNodeCount(node.parent, result.length - previousRenderNodeCount); - return result; - } - _updateNodeAfterCollapseChange(node, result) { - if (node.visible === false) { - return 0; - } - result.push(node); - node.renderNodeCount = 1; - if (!node.collapsed) { - for (const child of node.children) { - node.renderNodeCount += this._updateNodeAfterCollapseChange(child, result); - } - } - this._onDidChangeRenderNodeCount.fire(node); - return node.renderNodeCount; - } - updateNodeAfterFilterChange(node) { - const previousRenderNodeCount = node.renderNodeCount; - const result = []; - this._updateNodeAfterFilterChange(node, node.visible ? 1 /* Visible */ : 0 /* Hidden */, result); - this._updateAncestorsRenderNodeCount(node.parent, result.length - previousRenderNodeCount); - return result; - } - _updateNodeAfterFilterChange(node, parentVisibility, result, revealed = true) { - let visibility; - if (node !== this.root) { - visibility = this._filterNode(node, parentVisibility); - if (visibility === 0 /* Hidden */) { - node.visible = false; - node.renderNodeCount = 0; - return false; - } - if (revealed) { - result.push(node); - } - } - const resultStartLength = result.length; - node.renderNodeCount = node === this.root ? 0 : 1; - let hasVisibleDescendants = false; - if (!node.collapsed || visibility !== 0 /* Hidden */) { - let visibleChildIndex = 0; - for (const child of node.children) { - hasVisibleDescendants = this._updateNodeAfterFilterChange(child, visibility, result, revealed && !node.collapsed) || hasVisibleDescendants; - if (child.visible) { - child.visibleChildIndex = visibleChildIndex++; - } - } - node.visibleChildrenCount = visibleChildIndex; - } - else { - node.visibleChildrenCount = 0; - } - if (node !== this.root) { - node.visible = visibility === 2 /* Recurse */ ? hasVisibleDescendants : (visibility === 1 /* Visible */); - } - if (!node.visible) { - node.renderNodeCount = 0; - if (revealed) { - result.pop(); - } - } - else if (!node.collapsed) { - node.renderNodeCount += result.length - resultStartLength; - } - this._onDidChangeRenderNodeCount.fire(node); - return node.visible; - } - _updateAncestorsRenderNodeCount(node, diff) { - if (diff === 0) { - return; - } - while (node) { - node.renderNodeCount += diff; - this._onDidChangeRenderNodeCount.fire(node); - node = node.parent; - } - } - _filterNode(node, parentVisibility) { - const result = this.filter ? this.filter.filter(node.element, parentVisibility) : 1 /* Visible */; - if (typeof result === 'boolean') { - node.filterData = undefined; - return result ? 1 /* Visible */ : 0 /* Hidden */; - } - else if (isFilterResult(result)) { - node.filterData = result.data; - return getVisibleState(result.visibility); - } - else { - node.filterData = undefined; - return getVisibleState(result); - } - } - // cheap - hasTreeNode(location, node = this.root) { - if (!location || location.length === 0) { - return true; - } - const [index, ...rest] = location; - if (index < 0 || index > node.children.length) { - return false; - } - return this.hasTreeNode(rest, node.children[index]); - } - // cheap - getTreeNode(location, node = this.root) { - if (!location || location.length === 0) { - return node; - } - const [index, ...rest] = location; - if (index < 0 || index > node.children.length) { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_0__["TreeError"](this.user, 'Invalid tree location'); - } - return this.getTreeNode(rest, node.children[index]); - } - // expensive - getTreeNodeWithListIndex(location) { - if (location.length === 0) { - return { node: this.root, listIndex: -1, revealed: true, visible: false }; - } - const { parentNode, listIndex, revealed, visible } = this.getParentNodeWithListIndex(location); - const index = location[location.length - 1]; - if (index < 0 || index > parentNode.children.length) { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_0__["TreeError"](this.user, 'Invalid tree location'); - } - const node = parentNode.children[index]; - return { node, listIndex, revealed, visible: visible && node.visible }; - } - getParentNodeWithListIndex(location, node = this.root, listIndex = 0, revealed = true, visible = true) { - const [index, ...rest] = location; - if (index < 0 || index > node.children.length) { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_0__["TreeError"](this.user, 'Invalid tree location'); - } - // TODO@joao perf! - for (let i = 0; i < index; i++) { - listIndex += node.children[i].renderNodeCount; - } - revealed = revealed && !node.collapsed; - visible = visible && node.visible; - if (rest.length === 0) { - return { parentNode: node, listIndex, revealed, visible }; - } - return this.getParentNodeWithListIndex(rest, node.children[index], listIndex + 1, revealed, visible); - } - getNode(location = []) { - return this.getTreeNode(location); - } - // TODO@joao perf! - getNodeLocation(node) { - const location = []; - let indexTreeNode = node; // typing woes - while (indexTreeNode.parent) { - location.push(indexTreeNode.parent.children.indexOf(indexTreeNode)); - indexTreeNode = indexTreeNode.parent; - } - return location.reverse(); - } - getParentNodeLocation(location) { - if (location.length === 0) { - return undefined; - } - else if (location.length === 1) { - return []; - } - else { - return Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["tail2"])(location)[0]; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/media/tree.css": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/media/tree.css ***! - \*******************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_tree_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../../css-loader/dist/cjs.js!./tree.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/media/tree.css"); -/* harmony import */ var _css_loader_dist_cjs_js_tree_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_tree_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_tree_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_tree_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/objectTree.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/objectTree.js ***! - \******************************************************************************/ -/*! exports provided: ObjectTree, CompressibleObjectTree */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectTree", function() { return ObjectTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompressibleObjectTree", function() { return CompressibleObjectTree; }); -/* harmony import */ var _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/* harmony import */ var _abstractTree_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./abstractTree.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/abstractTree.js"); -/* harmony import */ var _objectTreeModel_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./objectTreeModel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/objectTreeModel.js"); -/* harmony import */ var _compressedObjectTreeModel_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./compressedObjectTreeModel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/compressedObjectTreeModel.js"); -/* harmony import */ var _common_decorators_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/decorators.js */ "./node_modules/monaco-editor/esm/vs/base/common/decorators.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; - - - - - -class ObjectTree extends _abstractTree_js__WEBPACK_IMPORTED_MODULE_1__["AbstractTree"] { - constructor(user, container, delegate, renderers, options = {}) { - super(user, container, delegate, renderers, options); - } - get onDidChangeCollapseState() { return this.model.onDidChangeCollapseState; } - setChildren(element, children = _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].empty()) { - this.model.setChildren(element, children); - } - rerender(element) { - if (element === undefined) { - this.view.rerender(); - return; - } - this.model.rerender(element); - } - hasElement(element) { - return this.model.has(element); - } - createModel(user, view, options) { - return new _objectTreeModel_js__WEBPACK_IMPORTED_MODULE_2__["ObjectTreeModel"](user, view, options); - } -} -class CompressibleRenderer { - constructor(_compressedTreeNodeProvider, renderer) { - this._compressedTreeNodeProvider = _compressedTreeNodeProvider; - this.renderer = renderer; - this.templateId = renderer.templateId; - if (renderer.onDidChangeTwistieState) { - this.onDidChangeTwistieState = renderer.onDidChangeTwistieState; - } - } - get compressedTreeNodeProvider() { - return this._compressedTreeNodeProvider(); - } - renderTemplate(container) { - const data = this.renderer.renderTemplate(container); - return { compressedTreeNode: undefined, data }; - } - renderElement(node, index, templateData, height) { - const compressedTreeNode = this.compressedTreeNodeProvider.getCompressedTreeNode(node.element); - if (compressedTreeNode.element.elements.length === 1) { - templateData.compressedTreeNode = undefined; - this.renderer.renderElement(node, index, templateData.data, height); - } - else { - templateData.compressedTreeNode = compressedTreeNode; - this.renderer.renderCompressedElements(compressedTreeNode, index, templateData.data, height); - } - } - disposeElement(node, index, templateData, height) { - if (templateData.compressedTreeNode) { - if (this.renderer.disposeCompressedElements) { - this.renderer.disposeCompressedElements(templateData.compressedTreeNode, index, templateData.data, height); - } - } - else { - if (this.renderer.disposeElement) { - this.renderer.disposeElement(node, index, templateData.data, height); - } - } - } - disposeTemplate(templateData) { - this.renderer.disposeTemplate(templateData.data); - } - renderTwistie(element, twistieElement) { - if (this.renderer.renderTwistie) { - this.renderer.renderTwistie(element, twistieElement); - } - } -} -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_4__["memoize"] -], CompressibleRenderer.prototype, "compressedTreeNodeProvider", null); -function asObjectTreeOptions(compressedTreeNodeProvider, options) { - return options && Object.assign(Object.assign({}, options), { keyboardNavigationLabelProvider: options.keyboardNavigationLabelProvider && { - getKeyboardNavigationLabel(e) { - let compressedTreeNode; - try { - compressedTreeNode = compressedTreeNodeProvider().getCompressedTreeNode(e); - } - catch (_a) { - return options.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e); - } - if (compressedTreeNode.element.elements.length === 1) { - return options.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e); - } - else { - return options.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(compressedTreeNode.element.elements); - } - } - } }); -} -class CompressibleObjectTree extends ObjectTree { - constructor(user, container, delegate, renderers, options = {}) { - const compressedTreeNodeProvider = () => this; - const compressibleRenderers = renderers.map(r => new CompressibleRenderer(compressedTreeNodeProvider, r)); - super(user, container, delegate, compressibleRenderers, asObjectTreeOptions(compressedTreeNodeProvider, options)); - } - setChildren(element, children = _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].empty()) { - this.model.setChildren(element, children); - } - createModel(user, view, options) { - return new _compressedObjectTreeModel_js__WEBPACK_IMPORTED_MODULE_3__["CompressibleObjectTreeModel"](user, view, options); - } - updateOptions(optionsUpdate = {}) { - super.updateOptions(optionsUpdate); - if (typeof optionsUpdate.compressionEnabled !== 'undefined') { - this.model.setCompressionEnabled(optionsUpdate.compressionEnabled); - } - } - getCompressedTreeNode(element = null) { - return this.model.getCompressedTreeNode(element); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/objectTreeModel.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/objectTreeModel.js ***! - \***********************************************************************************/ -/*! exports provided: ObjectTreeModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectTreeModel", function() { return ObjectTreeModel; }); -/* harmony import */ var _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/* harmony import */ var _indexTreeModel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./indexTreeModel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/indexTreeModel.js"); -/* harmony import */ var _tree_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tree.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/tree.js"); -/* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class ObjectTreeModel { - constructor(user, list, options = {}) { - this.user = user; - this.rootRef = null; - this.nodes = new Map(); - this.nodesByIdentity = new Map(); - this.model = new _indexTreeModel_js__WEBPACK_IMPORTED_MODULE_1__["IndexTreeModel"](user, list, null, options); - this.onDidSplice = this.model.onDidSplice; - this.onDidChangeCollapseState = this.model.onDidChangeCollapseState; - this.onDidChangeRenderNodeCount = this.model.onDidChangeRenderNodeCount; - if (options.sorter) { - this.sorter = { - compare(a, b) { - return options.sorter.compare(a.element, b.element); - } - }; - } - this.identityProvider = options.identityProvider; - } - setChildren(element, children = _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].empty(), onDidCreateNode, onDidDeleteNode) { - const location = this.getElementLocation(element); - this._setChildren(location, this.preserveCollapseState(children), onDidCreateNode, onDidDeleteNode); - } - _setChildren(location, children = _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].empty(), onDidCreateNode, onDidDeleteNode) { - const insertedElements = new Set(); - const insertedElementIds = new Set(); - const _onDidCreateNode = (node) => { - if (node.element === null) { - return; - } - const tnode = node; - insertedElements.add(tnode.element); - this.nodes.set(tnode.element, tnode); - if (this.identityProvider) { - const id = this.identityProvider.getId(tnode.element).toString(); - insertedElementIds.add(id); - this.nodesByIdentity.set(id, tnode); - } - if (onDidCreateNode) { - onDidCreateNode(tnode); - } - }; - const _onDidDeleteNode = (node) => { - if (node.element === null) { - return; - } - const tnode = node; - if (!insertedElements.has(tnode.element)) { - this.nodes.delete(tnode.element); - } - if (this.identityProvider) { - const id = this.identityProvider.getId(tnode.element).toString(); - if (!insertedElementIds.has(id)) { - this.nodesByIdentity.delete(id); - } - } - if (onDidDeleteNode) { - onDidDeleteNode(tnode); - } - }; - this.model.splice([...location, 0], Number.MAX_VALUE, children, _onDidCreateNode, _onDidDeleteNode); - } - preserveCollapseState(elements = _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].empty()) { - if (this.sorter) { - elements = Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_3__["mergeSort"])([...elements], this.sorter.compare.bind(this.sorter)); - } - return _common_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].map(elements, treeElement => { - let node = this.nodes.get(treeElement.element); - if (!node && this.identityProvider) { - const id = this.identityProvider.getId(treeElement.element).toString(); - node = this.nodesByIdentity.get(id); - } - if (!node) { - return Object.assign(Object.assign({}, treeElement), { children: this.preserveCollapseState(treeElement.children) }); - } - const collapsible = typeof treeElement.collapsible === 'boolean' ? treeElement.collapsible : node.collapsible; - const collapsed = typeof treeElement.collapsed !== 'undefined' ? treeElement.collapsed : node.collapsed; - return Object.assign(Object.assign({}, treeElement), { collapsible, - collapsed, children: this.preserveCollapseState(treeElement.children) }); - }); - } - rerender(element) { - const location = this.getElementLocation(element); - this.model.rerender(location); - } - has(element) { - return this.nodes.has(element); - } - getListIndex(element) { - const location = this.getElementLocation(element); - return this.model.getListIndex(location); - } - getListRenderCount(element) { - const location = this.getElementLocation(element); - return this.model.getListRenderCount(location); - } - isCollapsible(element) { - const location = this.getElementLocation(element); - return this.model.isCollapsible(location); - } - setCollapsible(element, collapsible) { - const location = this.getElementLocation(element); - return this.model.setCollapsible(location, collapsible); - } - isCollapsed(element) { - const location = this.getElementLocation(element); - return this.model.isCollapsed(location); - } - setCollapsed(element, collapsed, recursive) { - const location = this.getElementLocation(element); - return this.model.setCollapsed(location, collapsed, recursive); - } - expandTo(element) { - const location = this.getElementLocation(element); - this.model.expandTo(location); - } - refilter() { - this.model.refilter(); - } - getNode(element = null) { - if (element === null) { - return this.model.getNode(this.model.rootRef); - } - const node = this.nodes.get(element); - if (!node) { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_2__["TreeError"](this.user, `Tree element not found: ${element}`); - } - return node; - } - getNodeLocation(node) { - return node.element; - } - getParentNodeLocation(element) { - if (element === null) { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_2__["TreeError"](this.user, `Invalid getParentNodeLocation call`); - } - const node = this.nodes.get(element); - if (!node) { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_2__["TreeError"](this.user, `Tree element not found: ${element}`); - } - const location = this.model.getNodeLocation(node); - const parentLocation = this.model.getParentNodeLocation(location); - const parent = this.model.getNode(parentLocation); - return parent.element; - } - getElementLocation(element) { - if (element === null) { - return []; - } - const node = this.nodes.get(element); - if (!node) { - throw new _tree_js__WEBPACK_IMPORTED_MODULE_2__["TreeError"](this.user, `Tree element not found: ${element}`); - } - return this.model.getNodeLocation(node); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/tree.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/tree.js ***! - \************************************************************************/ -/*! exports provided: TreeMouseEventTarget, TreeError, WeakMapper */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TreeMouseEventTarget", function() { return TreeMouseEventTarget; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TreeError", function() { return TreeError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WeakMapper", function() { return WeakMapper; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var TreeMouseEventTarget; -(function (TreeMouseEventTarget) { - TreeMouseEventTarget[TreeMouseEventTarget["Unknown"] = 0] = "Unknown"; - TreeMouseEventTarget[TreeMouseEventTarget["Twistie"] = 1] = "Twistie"; - TreeMouseEventTarget[TreeMouseEventTarget["Element"] = 2] = "Element"; -})(TreeMouseEventTarget || (TreeMouseEventTarget = {})); -class TreeError extends Error { - constructor(user, message) { - super(`TreeError [${user}] ${message}`); - } -} -class WeakMapper { - constructor(fn) { - this.fn = fn; - this._map = new WeakMap(); - } - map(key) { - let result = this._map.get(key); - if (!result) { - result = this.fn(key); - this._map.set(key, result); - } - return result; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/treeIcons.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/treeIcons.js ***! - \*****************************************************************************/ -/*! exports provided: treeItemExpandedIcon, treeFilterOnTypeOnIcon, treeFilterOnTypeOffIcon, treeFilterClearIcon, treeItemLoadingIcon */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "treeItemExpandedIcon", function() { return treeItemExpandedIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "treeFilterOnTypeOnIcon", function() { return treeFilterOnTypeOnIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "treeFilterOnTypeOffIcon", function() { return treeFilterOnTypeOffIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "treeFilterClearIcon", function() { return treeFilterClearIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "treeItemLoadingIcon", function() { return treeItemLoadingIcon; }); -/* harmony import */ var _common_codicons_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const treeItemExpandedIcon = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_0__["registerIcon"])('tree-item-expanded', _common_codicons_js__WEBPACK_IMPORTED_MODULE_0__["Codicon"].chevronDown); // collapsed is done with rotation -const treeFilterOnTypeOnIcon = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_0__["registerIcon"])('tree-filter-on-type-on', _common_codicons_js__WEBPACK_IMPORTED_MODULE_0__["Codicon"].listFilter); -const treeFilterOnTypeOffIcon = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_0__["registerIcon"])('tree-filter-on-type-off', _common_codicons_js__WEBPACK_IMPORTED_MODULE_0__["Codicon"].listSelection); -const treeFilterClearIcon = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_0__["registerIcon"])('tree-filter-clear', _common_codicons_js__WEBPACK_IMPORTED_MODULE_0__["Codicon"].close); -const treeItemLoadingIcon = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_0__["registerIcon"])('tree-item-loading', _common_codicons_js__WEBPACK_IMPORTED_MODULE_0__["Codicon"].loading); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js ***! - \*********************************************************************/ -/*! exports provided: Widget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Widget", function() { return Widget; }); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../keyboardEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js"); -/* harmony import */ var _mouseEvent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _touch_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../touch.js */ "./node_modules/monaco-editor/esm/vs/base/browser/touch.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -class Widget extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - onclick(domNode, listener) { - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__["EventType"].CLICK, (e) => listener(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_2__["StandardMouseEvent"](e)))); - } - onmousedown(domNode, listener) { - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__["EventType"].MOUSE_DOWN, (e) => listener(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_2__["StandardMouseEvent"](e)))); - } - onmouseover(domNode, listener) { - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__["EventType"].MOUSE_OVER, (e) => listener(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_2__["StandardMouseEvent"](e)))); - } - onnonbubblingmouseout(domNode, listener) { - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableNonBubblingMouseOutListener"](domNode, (e) => listener(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_2__["StandardMouseEvent"](e)))); - } - onkeydown(domNode, listener) { - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__["EventType"].KEY_DOWN, (e) => listener(new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_1__["StandardKeyboardEvent"](e)))); - } - onkeyup(domNode, listener) { - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__["EventType"].KEY_UP, (e) => listener(new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_1__["StandardKeyboardEvent"](e)))); - } - oninput(domNode, listener) { - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__["EventType"].INPUT, listener)); - } - onblur(domNode, listener) { - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__["EventType"].BLUR, listener)); - } - onfocus(domNode, listener) { - this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__["EventType"].FOCUS, listener)); - } - ignoreGesture(domNode) { - _touch_js__WEBPACK_IMPORTED_MODULE_4__["Gesture"].ignoreTarget(domNode); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/actions.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/actions.js ***! - \******************************************************************/ -/*! exports provided: Action, ActionRunner, Separator, SubmenuAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Action", function() { return Action; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionRunner", function() { return ActionRunner; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Separator", function() { return Separator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubmenuAction", function() { return SubmenuAction; }); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - -class Action extends _lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["Disposable"] { - constructor(id, label = '', cssClass = '', enabled = true, actionCallback) { - super(); - this._onDidChange = this._register(new _event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidChange = this._onDidChange.event; - this._enabled = true; - this._checked = false; - this._id = id; - this._label = label; - this._cssClass = cssClass; - this._enabled = enabled; - this._actionCallback = actionCallback; - } - get id() { - return this._id; - } - get label() { - return this._label; - } - set label(value) { - this._setLabel(value); - } - _setLabel(value) { - if (this._label !== value) { - this._label = value; - this._onDidChange.fire({ label: value }); - } - } - get tooltip() { - return this._tooltip || ''; - } - set tooltip(value) { - this._setTooltip(value); - } - _setTooltip(value) { - if (this._tooltip !== value) { - this._tooltip = value; - this._onDidChange.fire({ tooltip: value }); - } - } - get class() { - return this._cssClass; - } - set class(value) { - this._setClass(value); - } - _setClass(value) { - if (this._cssClass !== value) { - this._cssClass = value; - this._onDidChange.fire({ class: value }); - } - } - get enabled() { - return this._enabled; - } - set enabled(value) { - this._setEnabled(value); - } - _setEnabled(value) { - if (this._enabled !== value) { - this._enabled = value; - this._onDidChange.fire({ enabled: value }); - } - } - get checked() { - return this._checked; - } - set checked(value) { - this._setChecked(value); - } - _setChecked(value) { - if (this._checked !== value) { - this._checked = value; - this._onDidChange.fire({ checked: value }); - } - } - run(event, _data) { - if (this._actionCallback) { - return this._actionCallback(event); - } - return Promise.resolve(true); - } -} -class ActionRunner extends _lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["Disposable"] { - constructor() { - super(...arguments); - this._onDidBeforeRun = this._register(new _event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidBeforeRun = this._onDidBeforeRun.event; - this._onDidRun = this._register(new _event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidRun = this._onDidRun.event; - } - run(action, context) { - return __awaiter(this, void 0, void 0, function* () { - if (!action.enabled) { - return Promise.resolve(null); - } - this._onDidBeforeRun.fire({ action: action }); - try { - const result = yield this.runAction(action, context); - this._onDidRun.fire({ action: action, result: result }); - } - catch (error) { - this._onDidRun.fire({ action: action, error: error }); - } - }); - } - runAction(action, context) { - const res = context ? action.run(context) : action.run(); - return Promise.resolve(res); - } -} -class Separator extends Action { - constructor(label) { - super(Separator.ID, label, label ? 'separator text' : 'separator'); - this.checked = false; - this.enabled = false; - } -} -Separator.ID = 'vs.actions.separator'; -class SubmenuAction extends Action { - constructor(id, label, _actions, cssClass) { - super(id, label, cssClass, true); - this._actions = _actions; - } - get actions() { - return Array.isArray(this._actions) ? this._actions : this._actions(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/arrays.js ***! - \*****************************************************************/ -/*! exports provided: tail, tail2, equals, binarySearch, findFirstInSorted, mergeSort, groupBy, coalesce, isFalsyOrEmpty, isNonEmptyArray, distinct, distinctES6, firstIndex, first, firstOrDefault, flatten, range, arrayInsert, pushToStart, pushToEnd, asArray */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return tail; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail2", function() { return tail2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "binarySearch", function() { return binarySearch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findFirstInSorted", function() { return findFirstInSorted; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeSort", function() { return mergeSort; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coalesce", function() { return coalesce; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrEmpty", function() { return isFalsyOrEmpty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonEmptyArray", function() { return isNonEmptyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctES6", function() { return distinctES6; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstIndex", function() { return firstIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstOrDefault", function() { return firstOrDefault; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return flatten; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayInsert", function() { return arrayInsert; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToStart", function() { return pushToStart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToEnd", function() { return pushToEnd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asArray", function() { return asArray; }); -/** - * Returns the last element of an array. - * @param array The array. - * @param n Which element from the end (default is zero). - */ -function tail(array, n = 0) { - return array[array.length - (1 + n)]; -} -function tail2(arr) { - if (arr.length === 0) { - throw new Error('Invalid tail call'); - } - return [arr.slice(0, arr.length - 1), arr[arr.length - 1]]; -} -function equals(one, other, itemEquals = (a, b) => a === b) { - if (one === other) { - return true; - } - if (!one || !other) { - return false; - } - if (one.length !== other.length) { - return false; - } - for (let i = 0, len = one.length; i < len; i++) { - if (!itemEquals(one[i], other[i])) { - return false; - } - } - return true; -} -function binarySearch(array, key, comparator) { - let low = 0, high = array.length - 1; - while (low <= high) { - const mid = ((low + high) / 2) | 0; - const comp = comparator(array[mid], key); - if (comp < 0) { - low = mid + 1; - } - else if (comp > 0) { - high = mid - 1; - } - else { - return mid; - } - } - return -(low + 1); -} -/** - * Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false - * are located before all elements where p(x) is true. - * @returns the least x for which p(x) is true or array.length if no element fullfills the given function. - */ -function findFirstInSorted(array, p) { - let low = 0, high = array.length; - if (high === 0) { - return 0; // no children - } - while (low < high) { - const mid = Math.floor((low + high) / 2); - if (p(array[mid])) { - high = mid; - } - else { - low = mid + 1; - } - } - return low; -} -/** - * Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort` - * so only use this when actually needing stable sort. - */ -function mergeSort(data, compare) { - _sort(data, compare, 0, data.length - 1, []); - return data; -} -function _merge(a, compare, lo, mid, hi, aux) { - let leftIdx = lo, rightIdx = mid + 1; - for (let i = lo; i <= hi; i++) { - aux[i] = a[i]; - } - for (let i = lo; i <= hi; i++) { - if (leftIdx > mid) { - // left side consumed - a[i] = aux[rightIdx++]; - } - else if (rightIdx > hi) { - // right side consumed - a[i] = aux[leftIdx++]; - } - else if (compare(aux[rightIdx], aux[leftIdx]) < 0) { - // right element is less -> comes first - a[i] = aux[rightIdx++]; - } - else { - // left element comes first (less or equal) - a[i] = aux[leftIdx++]; - } - } -} -function _sort(a, compare, lo, hi, aux) { - if (hi <= lo) { - return; - } - const mid = lo + ((hi - lo) / 2) | 0; - _sort(a, compare, lo, mid, aux); - _sort(a, compare, mid + 1, hi, aux); - if (compare(a[mid], a[mid + 1]) <= 0) { - // left and right are sorted and if the last-left element is less - // or equals than the first-right element there is nothing else - // to do - return; - } - _merge(a, compare, lo, mid, hi, aux); -} -function groupBy(data, compare) { - const result = []; - let currentGroup = undefined; - for (const element of mergeSort(data.slice(0), compare)) { - if (!currentGroup || compare(currentGroup[0], element) !== 0) { - currentGroup = [element]; - result.push(currentGroup); - } - else { - currentGroup.push(element); - } - } - return result; -} -/** - * @returns New array with all falsy values removed. The original array IS NOT modified. - */ -function coalesce(array) { - return array.filter(e => !!e); -} -/** - * @returns false if the provided object is an array and not empty. - */ -function isFalsyOrEmpty(obj) { - return !Array.isArray(obj) || obj.length === 0; -} -function isNonEmptyArray(obj) { - return Array.isArray(obj) && obj.length > 0; -} -/** - * Removes duplicates from the given array. The optional keyFn allows to specify - * how elements are checked for equalness by returning a unique string for each. - */ -function distinct(array, keyFn) { - if (!keyFn) { - return array.filter((element, position) => { - return array.indexOf(element) === position; - }); - } - const seen = Object.create(null); - return array.filter((elem) => { - const key = keyFn(elem); - if (seen[key]) { - return false; - } - seen[key] = true; - return true; - }); -} -function distinctES6(array) { - const seen = new Set(); - return array.filter(element => { - if (seen.has(element)) { - return false; - } - seen.add(element); - return true; - }); -} -/** - * @deprecated ES6: use `Array.findIndex` - */ -function firstIndex(array, fn) { - for (let i = 0; i < array.length; i++) { - const element = array[i]; - if (fn(element)) { - return i; - } - } - return -1; -} -function first(array, fn, notFoundValue = undefined) { - const index = firstIndex(array, fn); - return index < 0 ? notFoundValue : array[index]; -} -function firstOrDefault(array, notFoundValue) { - return array.length > 0 ? array[0] : notFoundValue; -} -function flatten(arr) { - return [].concat(...arr); -} -function range(arg, to) { - let from = typeof to === 'number' ? arg : 0; - if (typeof to === 'number') { - from = arg; - } - else { - from = 0; - to = arg; - } - const result = []; - if (from <= to) { - for (let i = from; i < to; i++) { - result.push(i); - } - } - else { - for (let i = from; i > to; i--) { - result.push(i); - } - } - return result; -} -/** - * Insert `insertArr` inside `target` at `insertIndex`. - * Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array - */ -function arrayInsert(target, insertIndex, insertArr) { - const before = target.slice(0, insertIndex); - const after = target.slice(insertIndex); - return before.concat(insertArr, after); -} -/** - * Pushes an element to the start of the array, if found. - */ -function pushToStart(arr, value) { - const index = arr.indexOf(value); - if (index > -1) { - arr.splice(index, 1); - arr.unshift(value); - } -} -/** - * Pushes an element to the end of the array, if found. - */ -function pushToEnd(arr, value) { - const index = arr.indexOf(value); - if (index > -1) { - arr.splice(index, 1); - arr.push(value); - } -} -function asArray(x) { - return Array.isArray(x) ? x : [x]; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/assert.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/assert.js ***! - \*****************************************************************/ -/*! exports provided: ok */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ok", function() { return ok; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * Throws an error with the provided message if the provided value does not evaluate to a true Javascript value. - */ -function ok(value, message) { - if (!value) { - throw new Error(message ? `Assertion failed (${message})` : 'Assertion Failed'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/async.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/async.js ***! - \****************************************************************/ -/*! exports provided: isThenable, createCancelablePromise, raceCancellation, Delayer, timeout, disposableTimeout, first, TimeoutTimer, IntervalTimer, RunOnceScheduler, runWhenIdle, IdleValue */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isThenable", function() { return isThenable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCancelablePromise", function() { return createCancelablePromise; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "raceCancellation", function() { return raceCancellation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Delayer", function() { return Delayer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return timeout; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disposableTimeout", function() { return disposableTimeout; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeoutTimer", function() { return TimeoutTimer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntervalTimer", function() { return IntervalTimer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RunOnceScheduler", function() { return RunOnceScheduler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runWhenIdle", function() { return runWhenIdle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IdleValue", function() { return IdleValue; }); -/* harmony import */ var _cancellation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -function isThenable(obj) { - return obj && typeof obj.then === 'function'; -} -function createCancelablePromise(callback) { - const source = new _cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationTokenSource"](); - const thenable = callback(source.token); - const promise = new Promise((resolve, reject) => { - source.token.onCancellationRequested(() => { - reject(_errors_js__WEBPACK_IMPORTED_MODULE_1__["canceled"]()); - }); - Promise.resolve(thenable).then(value => { - source.dispose(); - resolve(value); - }, err => { - source.dispose(); - reject(err); - }); - }); - return new class { - cancel() { - source.cancel(); - } - then(resolve, reject) { - return promise.then(resolve, reject); - } - catch(reject) { - return this.then(undefined, reject); - } - finally(onfinally) { - return promise.finally(onfinally); - } - }; -} -function raceCancellation(promise, token, defaultValue) { - return Promise.race([promise, new Promise(resolve => token.onCancellationRequested(() => resolve(defaultValue)))]); -} -/** - * A helper to delay execution of a task that is being requested often. - * - * Following the throttler, now imagine the mail man wants to optimize the number of - * trips proactively. The trip itself can be long, so he decides not to make the trip - * as soon as a letter is submitted. Instead he waits a while, in case more - * letters are submitted. After said waiting period, if no letters were submitted, he - * decides to make the trip. Imagine that N more letters were submitted after the first - * one, all within a short period of time between each other. Even though N+1 - * submissions occurred, only 1 delivery was made. - * - * The delayer offers this behavior via the trigger() method, into which both the task - * to be executed and the waiting period (delay) must be passed in as arguments. Following - * the example: - * - * const delayer = new Delayer(WAITING_PERIOD); - * const letters = []; - * - * function letterReceived(l) { - * letters.push(l); - * delayer.trigger(() => { return makeTheTrip(); }); - * } - */ -class Delayer { - constructor(defaultDelay) { - this.defaultDelay = defaultDelay; - this.timeout = null; - this.completionPromise = null; - this.doResolve = null; - this.doReject = null; - this.task = null; - } - trigger(task, delay = this.defaultDelay) { - this.task = task; - this.cancelTimeout(); - if (!this.completionPromise) { - this.completionPromise = new Promise((c, e) => { - this.doResolve = c; - this.doReject = e; - }).then(() => { - this.completionPromise = null; - this.doResolve = null; - if (this.task) { - const task = this.task; - this.task = null; - return task(); - } - return undefined; - }); - } - this.timeout = setTimeout(() => { - this.timeout = null; - if (this.doResolve) { - this.doResolve(null); - } - }, delay); - return this.completionPromise; - } - isTriggered() { - return this.timeout !== null; - } - cancel() { - this.cancelTimeout(); - if (this.completionPromise) { - if (this.doReject) { - this.doReject(_errors_js__WEBPACK_IMPORTED_MODULE_1__["canceled"]()); - } - this.completionPromise = null; - } - } - cancelTimeout() { - if (this.timeout !== null) { - clearTimeout(this.timeout); - this.timeout = null; - } - } - dispose() { - this.cancelTimeout(); - } -} -function timeout(millis, token) { - if (!token) { - return createCancelablePromise(token => timeout(millis, token)); - } - return new Promise((resolve, reject) => { - const handle = setTimeout(resolve, millis); - token.onCancellationRequested(() => { - clearTimeout(handle); - reject(_errors_js__WEBPACK_IMPORTED_MODULE_1__["canceled"]()); - }); - }); -} -function disposableTimeout(handler, timeout = 0) { - const timer = setTimeout(handler, timeout); - return Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["toDisposable"])(() => clearTimeout(timer)); -} -function first(promiseFactories, shouldStop = t => !!t, defaultValue = null) { - let index = 0; - const len = promiseFactories.length; - const loop = () => { - if (index >= len) { - return Promise.resolve(defaultValue); - } - const factory = promiseFactories[index++]; - const promise = Promise.resolve(factory()); - return promise.then(result => { - if (shouldStop(result)) { - return Promise.resolve(result); - } - return loop(); - }); - }; - return loop(); -} -class TimeoutTimer { - constructor(runner, timeout) { - this._token = -1; - if (typeof runner === 'function' && typeof timeout === 'number') { - this.setIfNotSet(runner, timeout); - } - } - dispose() { - this.cancel(); - } - cancel() { - if (this._token !== -1) { - clearTimeout(this._token); - this._token = -1; - } - } - cancelAndSet(runner, timeout) { - this.cancel(); - this._token = setTimeout(() => { - this._token = -1; - runner(); - }, timeout); - } - setIfNotSet(runner, timeout) { - if (this._token !== -1) { - // timer is already set - return; - } - this._token = setTimeout(() => { - this._token = -1; - runner(); - }, timeout); - } -} -class IntervalTimer { - constructor() { - this._token = -1; - } - dispose() { - this.cancel(); - } - cancel() { - if (this._token !== -1) { - clearInterval(this._token); - this._token = -1; - } - } - cancelAndSet(runner, interval) { - this.cancel(); - this._token = setInterval(() => { - runner(); - }, interval); - } -} -class RunOnceScheduler { - constructor(runner, timeout) { - this.timeoutToken = -1; - this.runner = runner; - this.timeout = timeout; - this.timeoutHandler = this.onTimeout.bind(this); - } - /** - * Dispose RunOnceScheduler - */ - dispose() { - this.cancel(); - this.runner = null; - } - /** - * Cancel current scheduled runner (if any). - */ - cancel() { - if (this.isScheduled()) { - clearTimeout(this.timeoutToken); - this.timeoutToken = -1; - } - } - /** - * Cancel previous runner (if any) & schedule a new runner. - */ - schedule(delay = this.timeout) { - this.cancel(); - this.timeoutToken = setTimeout(this.timeoutHandler, delay); - } - /** - * Returns true if scheduled. - */ - isScheduled() { - return this.timeoutToken !== -1; - } - onTimeout() { - this.timeoutToken = -1; - if (this.runner) { - this.doRun(); - } - } - doRun() { - if (this.runner) { - this.runner(); - } - } -} -/** - * Execute the callback the next time the browser is idle - */ -let runWhenIdle; -(function () { - if (typeof requestIdleCallback !== 'function' || typeof cancelIdleCallback !== 'function') { - const dummyIdle = Object.freeze({ - didTimeout: true, - timeRemaining() { return 15; } - }); - runWhenIdle = (runner) => { - const handle = setTimeout(() => runner(dummyIdle)); - let disposed = false; - return { - dispose() { - if (disposed) { - return; - } - disposed = true; - clearTimeout(handle); - } - }; - }; - } - else { - runWhenIdle = (runner, timeout) => { - const handle = requestIdleCallback(runner, typeof timeout === 'number' ? { timeout } : undefined); - let disposed = false; - return { - dispose() { - if (disposed) { - return; - } - disposed = true; - cancelIdleCallback(handle); - } - }; - }; - } -})(); -/** - * An implementation of the "idle-until-urgent"-strategy as introduced - * here: https://philipwalton.com/articles/idle-until-urgent/ - */ -class IdleValue { - constructor(executor) { - this._didRun = false; - this._executor = () => { - try { - this._value = executor(); - } - catch (err) { - this._error = err; - } - finally { - this._didRun = true; - } - }; - this._handle = runWhenIdle(() => this._executor()); - } - dispose() { - this._handle.dispose(); - } - get value() { - if (!this._didRun) { - this._handle.dispose(); - this._executor(); - } - if (this._error) { - throw this._error; - } - return this._value; - } -} -//#endregion - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/buffer.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/buffer.js ***! - \*****************************************************************/ -/*! exports provided: VSBuffer, readUInt16LE, writeUInt16LE, readUInt32BE, writeUInt32BE, readUInt8, writeUInt8 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VSBuffer", function() { return VSBuffer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readUInt16LE", function() { return readUInt16LE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "writeUInt16LE", function() { return writeUInt16LE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readUInt32BE", function() { return readUInt32BE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "writeUInt32BE", function() { return writeUInt32BE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readUInt8", function() { return readUInt8; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "writeUInt8", function() { return writeUInt8; }); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const hasBuffer = (typeof Buffer !== 'undefined'); -const hasTextDecoder = (typeof TextDecoder !== 'undefined'); -let textDecoder; -class VSBuffer { - constructor(buffer) { - this.buffer = buffer; - this.byteLength = this.buffer.byteLength; - } - toString() { - if (hasBuffer) { - return this.buffer.toString(); - } - else if (hasTextDecoder) { - if (!textDecoder) { - textDecoder = new TextDecoder(); - } - return textDecoder.decode(this.buffer); - } - else { - return _strings_js__WEBPACK_IMPORTED_MODULE_0__["decodeUTF8"](this.buffer); - } - } -} -function readUInt16LE(source, offset) { - return (((source[offset + 0] << 0) >>> 0) | - ((source[offset + 1] << 8) >>> 0)); -} -function writeUInt16LE(destination, value, offset) { - destination[offset + 0] = (value & 0b11111111); - value = value >>> 8; - destination[offset + 1] = (value & 0b11111111); -} -function readUInt32BE(source, offset) { - return (source[offset] * Math.pow(2, 24) - + source[offset + 1] * Math.pow(2, 16) - + source[offset + 2] * Math.pow(2, 8) - + source[offset + 3]); -} -function writeUInt32BE(destination, value, offset) { - destination[offset + 3] = value; - value = value >>> 8; - destination[offset + 2] = value; - value = value >>> 8; - destination[offset + 1] = value; - value = value >>> 8; - destination[offset] = value; -} -function readUInt8(source, offset) { - return source[offset]; -} -function writeUInt8(destination, value, offset) { - destination[offset] = value; -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js ***! - \***********************************************************************/ -/*! exports provided: CancellationToken, CancellationTokenSource */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationToken", function() { return CancellationToken; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationTokenSource", function() { return CancellationTokenSource; }); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const shortcutEvent = Object.freeze(function (callback, context) { - const handle = setTimeout(callback.bind(context), 0); - return { dispose() { clearTimeout(handle); } }; -}); -var CancellationToken; -(function (CancellationToken) { - function isCancellationToken(thing) { - if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { - return true; - } - if (thing instanceof MutableToken) { - return true; - } - if (!thing || typeof thing !== 'object') { - return false; - } - return typeof thing.isCancellationRequested === 'boolean' - && typeof thing.onCancellationRequested === 'function'; - } - CancellationToken.isCancellationToken = isCancellationToken; - CancellationToken.None = Object.freeze({ - isCancellationRequested: false, - onCancellationRequested: _event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].None - }); - CancellationToken.Cancelled = Object.freeze({ - isCancellationRequested: true, - onCancellationRequested: shortcutEvent - }); -})(CancellationToken || (CancellationToken = {})); -class MutableToken { - constructor() { - this._isCancelled = false; - this._emitter = null; - } - cancel() { - if (!this._isCancelled) { - this._isCancelled = true; - if (this._emitter) { - this._emitter.fire(undefined); - this.dispose(); - } - } - } - get isCancellationRequested() { - return this._isCancelled; - } - get onCancellationRequested() { - if (this._isCancelled) { - return shortcutEvent; - } - if (!this._emitter) { - this._emitter = new _event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - } - return this._emitter.event; - } - dispose() { - if (this._emitter) { - this._emitter.dispose(); - this._emitter = null; - } - } -} -class CancellationTokenSource { - constructor(parent) { - this._token = undefined; - this._parentListener = undefined; - this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); - } - get token() { - if (!this._token) { - // be lazy and create the token only when - // actually needed - this._token = new MutableToken(); - } - return this._token; - } - cancel() { - if (!this._token) { - // save an object by returning the default - // cancelled token when cancellation happens - // before someone asks for the token - this._token = CancellationToken.Cancelled; - } - else if (this._token instanceof MutableToken) { - // actually cancel - this._token.cancel(); - } - } - dispose(cancel = false) { - if (cancel) { - this.cancel(); - } - if (this._parentListener) { - this._parentListener.dispose(); - } - if (!this._token) { - // ensure to initialize with an empty token if we had none - this._token = CancellationToken.None; - } - else if (this._token instanceof MutableToken) { - // actually dispose - this._token.dispose(); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/codicon.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/codicon.js ***! - \******************************************************************/ -/*! exports provided: codiconStartMarker, parseCodicons, matchesFuzzyCodiconAware */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "codiconStartMarker", function() { return codiconStartMarker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseCodicons", function() { return parseCodicons; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchesFuzzyCodiconAware", function() { return matchesFuzzyCodiconAware; }); -/* harmony import */ var _filters_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filters.js */ "./node_modules/monaco-editor/esm/vs/base/common/filters.js"); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -const codiconStartMarker = '$('; -function parseCodicons(text) { - const firstCodiconIndex = text.indexOf(codiconStartMarker); - if (firstCodiconIndex === -1) { - return { text }; // return early if the word does not include an codicon - } - return doParseCodicons(text, firstCodiconIndex); -} -function doParseCodicons(text, firstCodiconIndex) { - const codiconOffsets = []; - let textWithoutCodicons = ''; - function appendChars(chars) { - if (chars) { - textWithoutCodicons += chars; - for (const _ of chars) { - codiconOffsets.push(codiconsOffset); // make sure to fill in codicon offsets - } - } - } - let currentCodiconStart = -1; - let currentCodiconValue = ''; - let codiconsOffset = 0; - let char; - let nextChar; - let offset = firstCodiconIndex; - const length = text.length; - // Append all characters until the first codicon - appendChars(text.substr(0, firstCodiconIndex)); - // example: $(file-symlink-file) my cool $(other-codicon) entry - while (offset < length) { - char = text[offset]; - nextChar = text[offset + 1]; - // beginning of codicon: some value $( <-- - if (char === codiconStartMarker[0] && nextChar === codiconStartMarker[1]) { - currentCodiconStart = offset; - // if we had a previous potential codicon value without - // the closing ')', it was actually not an codicon and - // so we have to add it to the actual value - appendChars(currentCodiconValue); - currentCodiconValue = codiconStartMarker; - offset++; // jump over '(' - } - // end of codicon: some value $(some-codicon) <-- - else if (char === ')' && currentCodiconStart !== -1) { - const currentCodiconLength = offset - currentCodiconStart + 1; // +1 to include the closing ')' - codiconsOffset += currentCodiconLength; - currentCodiconStart = -1; - currentCodiconValue = ''; - } - // within codicon - else if (currentCodiconStart !== -1) { - // Make sure this is a real codicon name - if (/^[a-z0-9\-]$/i.test(char)) { - currentCodiconValue += char; - } - else { - // This is not a real codicon, treat it as text - appendChars(currentCodiconValue); - currentCodiconStart = -1; - currentCodiconValue = ''; - } - } - // any value outside of codicons - else { - appendChars(char); - } - offset++; - } - // if we had a previous potential codicon value without - // the closing ')', it was actually not an codicon and - // so we have to add it to the actual value - appendChars(currentCodiconValue); - return { text: textWithoutCodicons, codiconOffsets }; -} -function matchesFuzzyCodiconAware(query, target, enableSeparateSubstringMatching = false) { - const { text, codiconOffsets } = target; - // Return early if there are no codicon markers in the word to match against - if (!codiconOffsets || codiconOffsets.length === 0) { - return Object(_filters_js__WEBPACK_IMPORTED_MODULE_0__["matchesFuzzy"])(query, text, enableSeparateSubstringMatching); - } - // Trim the word to match against because it could have leading - // whitespace now if the word started with an codicon - const wordToMatchAgainstWithoutCodiconsTrimmed = Object(_strings_js__WEBPACK_IMPORTED_MODULE_1__["ltrim"])(text, ' '); - const leadingWhitespaceOffset = text.length - wordToMatchAgainstWithoutCodiconsTrimmed.length; - // match on value without codicons - const matches = Object(_filters_js__WEBPACK_IMPORTED_MODULE_0__["matchesFuzzy"])(query, wordToMatchAgainstWithoutCodiconsTrimmed, enableSeparateSubstringMatching); - // Map matches back to offsets with codicons and trimming - if (matches) { - for (const match of matches) { - const codiconOffset = codiconOffsets[match.start + leadingWhitespaceOffset] /* codicon offsets at index */ + leadingWhitespaceOffset /* overall leading whitespace offset */; - match.start += codiconOffset; - match.end += codiconOffset; - } - } - return matches; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/codicons.js ***! - \*******************************************************************/ -/*! exports provided: iconRegistry, registerIcon, Codicon, escapeCodicons, markdownEscapeEscapedCodicons, renderCodiconsRegex, renderCodicons, stripCodicons */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iconRegistry", function() { return iconRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerIcon", function() { return registerIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Codicon", function() { return Codicon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeCodicons", function() { return escapeCodicons; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "markdownEscapeEscapedCodicons", function() { return markdownEscapeEscapedCodicons; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCodiconsRegex", function() { return renderCodiconsRegex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCodicons", function() { return renderCodicons; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripCodicons", function() { return stripCodicons; }); -/* harmony import */ var _codicon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./codicon.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicon.js"); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class Registry { - constructor() { - this._icons = new Map(); - this._onDidRegister = new _event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"](); - } - add(icon) { - if (!this._icons.has(icon.id)) { - this._icons.set(icon.id, icon); - this._onDidRegister.fire(icon); - } - else { - console.error(`Duplicate registration of codicon ${icon.id}`); - } - } - get(id) { - return this._icons.get(id); - } - get all() { - return this._icons.values(); - } - get onDidRegister() { - return this._onDidRegister.event; - } -} -const _registry = new Registry(); -const iconRegistry = _registry; -function registerIcon(id, def, description) { - return new Codicon(id, def); -} -class Codicon { - constructor(id, definition, description) { - this.id = id; - this.definition = definition; - this.description = description; - _registry.add(this); - } - get classNames() { return 'codicon codicon-' + this.id; } - get cssSelector() { return '.codicon.codicon-' + this.id; } -} -(function (Codicon) { - // built-in icons, with image name - Codicon.add = new Codicon('add', { character: '\\ea60' }); - Codicon.plus = new Codicon('plus', { character: '\\ea60' }); - Codicon.gistNew = new Codicon('gist-new', { character: '\\ea60' }); - Codicon.repoCreate = new Codicon('repo-create', { character: '\\ea60' }); - Codicon.lightbulb = new Codicon('lightbulb', { character: '\\ea61' }); - Codicon.lightBulb = new Codicon('light-bulb', { character: '\\ea61' }); - Codicon.repo = new Codicon('repo', { character: '\\ea62' }); - Codicon.repoDelete = new Codicon('repo-delete', { character: '\\ea62' }); - Codicon.gistFork = new Codicon('gist-fork', { character: '\\ea63' }); - Codicon.repoForked = new Codicon('repo-forked', { character: '\\ea63' }); - Codicon.gitPullRequest = new Codicon('git-pull-request', { character: '\\ea64' }); - Codicon.gitPullRequestAbandoned = new Codicon('git-pull-request-abandoned', { character: '\\ea64' }); - Codicon.recordKeys = new Codicon('record-keys', { character: '\\ea65' }); - Codicon.keyboard = new Codicon('keyboard', { character: '\\ea65' }); - Codicon.tag = new Codicon('tag', { character: '\\ea66' }); - Codicon.tagAdd = new Codicon('tag-add', { character: '\\ea66' }); - Codicon.tagRemove = new Codicon('tag-remove', { character: '\\ea66' }); - Codicon.person = new Codicon('person', { character: '\\ea67' }); - Codicon.personAdd = new Codicon('person-add', { character: '\\ea67' }); - Codicon.personFollow = new Codicon('person-follow', { character: '\\ea67' }); - Codicon.personOutline = new Codicon('person-outline', { character: '\\ea67' }); - Codicon.personFilled = new Codicon('person-filled', { character: '\\ea67' }); - Codicon.gitBranch = new Codicon('git-branch', { character: '\\ea68' }); - Codicon.gitBranchCreate = new Codicon('git-branch-create', { character: '\\ea68' }); - Codicon.gitBranchDelete = new Codicon('git-branch-delete', { character: '\\ea68' }); - Codicon.sourceControl = new Codicon('source-control', { character: '\\ea68' }); - Codicon.mirror = new Codicon('mirror', { character: '\\ea69' }); - Codicon.mirrorPublic = new Codicon('mirror-public', { character: '\\ea69' }); - Codicon.star = new Codicon('star', { character: '\\ea6a' }); - Codicon.starAdd = new Codicon('star-add', { character: '\\ea6a' }); - Codicon.starDelete = new Codicon('star-delete', { character: '\\ea6a' }); - Codicon.starEmpty = new Codicon('star-empty', { character: '\\ea6a' }); - Codicon.comment = new Codicon('comment', { character: '\\ea6b' }); - Codicon.commentAdd = new Codicon('comment-add', { character: '\\ea6b' }); - Codicon.alert = new Codicon('alert', { character: '\\ea6c' }); - Codicon.warning = new Codicon('warning', { character: '\\ea6c' }); - Codicon.search = new Codicon('search', { character: '\\ea6d' }); - Codicon.searchSave = new Codicon('search-save', { character: '\\ea6d' }); - Codicon.logOut = new Codicon('log-out', { character: '\\ea6e' }); - Codicon.signOut = new Codicon('sign-out', { character: '\\ea6e' }); - Codicon.logIn = new Codicon('log-in', { character: '\\ea6f' }); - Codicon.signIn = new Codicon('sign-in', { character: '\\ea6f' }); - Codicon.eye = new Codicon('eye', { character: '\\ea70' }); - Codicon.eyeUnwatch = new Codicon('eye-unwatch', { character: '\\ea70' }); - Codicon.eyeWatch = new Codicon('eye-watch', { character: '\\ea70' }); - Codicon.circleFilled = new Codicon('circle-filled', { character: '\\ea71' }); - Codicon.primitiveDot = new Codicon('primitive-dot', { character: '\\ea71' }); - Codicon.closeDirty = new Codicon('close-dirty', { character: '\\ea71' }); - Codicon.debugBreakpoint = new Codicon('debug-breakpoint', { character: '\\ea71' }); - Codicon.debugBreakpointDisabled = new Codicon('debug-breakpoint-disabled', { character: '\\ea71' }); - Codicon.debugHint = new Codicon('debug-hint', { character: '\\ea71' }); - Codicon.primitiveSquare = new Codicon('primitive-square', { character: '\\ea72' }); - Codicon.edit = new Codicon('edit', { character: '\\ea73' }); - Codicon.pencil = new Codicon('pencil', { character: '\\ea73' }); - Codicon.info = new Codicon('info', { character: '\\ea74' }); - Codicon.issueOpened = new Codicon('issue-opened', { character: '\\ea74' }); - Codicon.gistPrivate = new Codicon('gist-private', { character: '\\ea75' }); - Codicon.gitForkPrivate = new Codicon('git-fork-private', { character: '\\ea75' }); - Codicon.lock = new Codicon('lock', { character: '\\ea75' }); - Codicon.mirrorPrivate = new Codicon('mirror-private', { character: '\\ea75' }); - Codicon.close = new Codicon('close', { character: '\\ea76' }); - Codicon.removeClose = new Codicon('remove-close', { character: '\\ea76' }); - Codicon.x = new Codicon('x', { character: '\\ea76' }); - Codicon.repoSync = new Codicon('repo-sync', { character: '\\ea77' }); - Codicon.sync = new Codicon('sync', { character: '\\ea77' }); - Codicon.clone = new Codicon('clone', { character: '\\ea78' }); - Codicon.desktopDownload = new Codicon('desktop-download', { character: '\\ea78' }); - Codicon.beaker = new Codicon('beaker', { character: '\\ea79' }); - Codicon.microscope = new Codicon('microscope', { character: '\\ea79' }); - Codicon.vm = new Codicon('vm', { character: '\\ea7a' }); - Codicon.deviceDesktop = new Codicon('device-desktop', { character: '\\ea7a' }); - Codicon.file = new Codicon('file', { character: '\\ea7b' }); - Codicon.fileText = new Codicon('file-text', { character: '\\ea7b' }); - Codicon.more = new Codicon('more', { character: '\\ea7c' }); - Codicon.ellipsis = new Codicon('ellipsis', { character: '\\ea7c' }); - Codicon.kebabHorizontal = new Codicon('kebab-horizontal', { character: '\\ea7c' }); - Codicon.mailReply = new Codicon('mail-reply', { character: '\\ea7d' }); - Codicon.reply = new Codicon('reply', { character: '\\ea7d' }); - Codicon.organization = new Codicon('organization', { character: '\\ea7e' }); - Codicon.organizationFilled = new Codicon('organization-filled', { character: '\\ea7e' }); - Codicon.organizationOutline = new Codicon('organization-outline', { character: '\\ea7e' }); - Codicon.newFile = new Codicon('new-file', { character: '\\ea7f' }); - Codicon.fileAdd = new Codicon('file-add', { character: '\\ea7f' }); - Codicon.newFolder = new Codicon('new-folder', { character: '\\ea80' }); - Codicon.fileDirectoryCreate = new Codicon('file-directory-create', { character: '\\ea80' }); - Codicon.trash = new Codicon('trash', { character: '\\ea81' }); - Codicon.trashcan = new Codicon('trashcan', { character: '\\ea81' }); - Codicon.history = new Codicon('history', { character: '\\ea82' }); - Codicon.clock = new Codicon('clock', { character: '\\ea82' }); - Codicon.folder = new Codicon('folder', { character: '\\ea83' }); - Codicon.fileDirectory = new Codicon('file-directory', { character: '\\ea83' }); - Codicon.symbolFolder = new Codicon('symbol-folder', { character: '\\ea83' }); - Codicon.logoGithub = new Codicon('logo-github', { character: '\\ea84' }); - Codicon.markGithub = new Codicon('mark-github', { character: '\\ea84' }); - Codicon.github = new Codicon('github', { character: '\\ea84' }); - Codicon.terminal = new Codicon('terminal', { character: '\\ea85' }); - Codicon.console = new Codicon('console', { character: '\\ea85' }); - Codicon.repl = new Codicon('repl', { character: '\\ea85' }); - Codicon.zap = new Codicon('zap', { character: '\\ea86' }); - Codicon.symbolEvent = new Codicon('symbol-event', { character: '\\ea86' }); - Codicon.error = new Codicon('error', { character: '\\ea87' }); - Codicon.stop = new Codicon('stop', { character: '\\ea87' }); - Codicon.variable = new Codicon('variable', { character: '\\ea88' }); - Codicon.symbolVariable = new Codicon('symbol-variable', { character: '\\ea88' }); - Codicon.array = new Codicon('array', { character: '\\ea8a' }); - Codicon.symbolArray = new Codicon('symbol-array', { character: '\\ea8a' }); - Codicon.symbolModule = new Codicon('symbol-module', { character: '\\ea8b' }); - Codicon.symbolPackage = new Codicon('symbol-package', { character: '\\ea8b' }); - Codicon.symbolNamespace = new Codicon('symbol-namespace', { character: '\\ea8b' }); - Codicon.symbolObject = new Codicon('symbol-object', { character: '\\ea8b' }); - Codicon.symbolMethod = new Codicon('symbol-method', { character: '\\ea8c' }); - Codicon.symbolFunction = new Codicon('symbol-function', { character: '\\ea8c' }); - Codicon.symbolConstructor = new Codicon('symbol-constructor', { character: '\\ea8c' }); - Codicon.symbolBoolean = new Codicon('symbol-boolean', { character: '\\ea8f' }); - Codicon.symbolNull = new Codicon('symbol-null', { character: '\\ea8f' }); - Codicon.symbolNumeric = new Codicon('symbol-numeric', { character: '\\ea90' }); - Codicon.symbolNumber = new Codicon('symbol-number', { character: '\\ea90' }); - Codicon.symbolStructure = new Codicon('symbol-structure', { character: '\\ea91' }); - Codicon.symbolStruct = new Codicon('symbol-struct', { character: '\\ea91' }); - Codicon.symbolParameter = new Codicon('symbol-parameter', { character: '\\ea92' }); - Codicon.symbolTypeParameter = new Codicon('symbol-type-parameter', { character: '\\ea92' }); - Codicon.symbolKey = new Codicon('symbol-key', { character: '\\ea93' }); - Codicon.symbolText = new Codicon('symbol-text', { character: '\\ea93' }); - Codicon.symbolReference = new Codicon('symbol-reference', { character: '\\ea94' }); - Codicon.goToFile = new Codicon('go-to-file', { character: '\\ea94' }); - Codicon.symbolEnum = new Codicon('symbol-enum', { character: '\\ea95' }); - Codicon.symbolValue = new Codicon('symbol-value', { character: '\\ea95' }); - Codicon.symbolRuler = new Codicon('symbol-ruler', { character: '\\ea96' }); - Codicon.symbolUnit = new Codicon('symbol-unit', { character: '\\ea96' }); - Codicon.activateBreakpoints = new Codicon('activate-breakpoints', { character: '\\ea97' }); - Codicon.archive = new Codicon('archive', { character: '\\ea98' }); - Codicon.arrowBoth = new Codicon('arrow-both', { character: '\\ea99' }); - Codicon.arrowDown = new Codicon('arrow-down', { character: '\\ea9a' }); - Codicon.arrowLeft = new Codicon('arrow-left', { character: '\\ea9b' }); - Codicon.arrowRight = new Codicon('arrow-right', { character: '\\ea9c' }); - Codicon.arrowSmallDown = new Codicon('arrow-small-down', { character: '\\ea9d' }); - Codicon.arrowSmallLeft = new Codicon('arrow-small-left', { character: '\\ea9e' }); - Codicon.arrowSmallRight = new Codicon('arrow-small-right', { character: '\\ea9f' }); - Codicon.arrowSmallUp = new Codicon('arrow-small-up', { character: '\\eaa0' }); - Codicon.arrowUp = new Codicon('arrow-up', { character: '\\eaa1' }); - Codicon.bell = new Codicon('bell', { character: '\\eaa2' }); - Codicon.bold = new Codicon('bold', { character: '\\eaa3' }); - Codicon.book = new Codicon('book', { character: '\\eaa4' }); - Codicon.bookmark = new Codicon('bookmark', { character: '\\eaa5' }); - Codicon.debugBreakpointConditionalUnverified = new Codicon('debug-breakpoint-conditional-unverified', { character: '\\eaa6' }); - Codicon.debugBreakpointConditional = new Codicon('debug-breakpoint-conditional', { character: '\\eaa7' }); - Codicon.debugBreakpointConditionalDisabled = new Codicon('debug-breakpoint-conditional-disabled', { character: '\\eaa7' }); - Codicon.debugBreakpointDataUnverified = new Codicon('debug-breakpoint-data-unverified', { character: '\\eaa8' }); - Codicon.debugBreakpointData = new Codicon('debug-breakpoint-data', { character: '\\eaa9' }); - Codicon.debugBreakpointDataDisabled = new Codicon('debug-breakpoint-data-disabled', { character: '\\eaa9' }); - Codicon.debugBreakpointLogUnverified = new Codicon('debug-breakpoint-log-unverified', { character: '\\eaaa' }); - Codicon.debugBreakpointLog = new Codicon('debug-breakpoint-log', { character: '\\eaab' }); - Codicon.debugBreakpointLogDisabled = new Codicon('debug-breakpoint-log-disabled', { character: '\\eaab' }); - Codicon.briefcase = new Codicon('briefcase', { character: '\\eaac' }); - Codicon.broadcast = new Codicon('broadcast', { character: '\\eaad' }); - Codicon.browser = new Codicon('browser', { character: '\\eaae' }); - Codicon.bug = new Codicon('bug', { character: '\\eaaf' }); - Codicon.calendar = new Codicon('calendar', { character: '\\eab0' }); - Codicon.caseSensitive = new Codicon('case-sensitive', { character: '\\eab1' }); - Codicon.check = new Codicon('check', { character: '\\eab2' }); - Codicon.checklist = new Codicon('checklist', { character: '\\eab3' }); - Codicon.chevronDown = new Codicon('chevron-down', { character: '\\eab4' }); - Codicon.chevronLeft = new Codicon('chevron-left', { character: '\\eab5' }); - Codicon.chevronRight = new Codicon('chevron-right', { character: '\\eab6' }); - Codicon.chevronUp = new Codicon('chevron-up', { character: '\\eab7' }); - Codicon.chromeClose = new Codicon('chrome-close', { character: '\\eab8' }); - Codicon.chromeMaximize = new Codicon('chrome-maximize', { character: '\\eab9' }); - Codicon.chromeMinimize = new Codicon('chrome-minimize', { character: '\\eaba' }); - Codicon.chromeRestore = new Codicon('chrome-restore', { character: '\\eabb' }); - Codicon.circleOutline = new Codicon('circle-outline', { character: '\\eabc' }); - Codicon.debugBreakpointUnverified = new Codicon('debug-breakpoint-unverified', { character: '\\eabc' }); - Codicon.circleSlash = new Codicon('circle-slash', { character: '\\eabd' }); - Codicon.circuitBoard = new Codicon('circuit-board', { character: '\\eabe' }); - Codicon.clearAll = new Codicon('clear-all', { character: '\\eabf' }); - Codicon.clippy = new Codicon('clippy', { character: '\\eac0' }); - Codicon.closeAll = new Codicon('close-all', { character: '\\eac1' }); - Codicon.cloudDownload = new Codicon('cloud-download', { character: '\\eac2' }); - Codicon.cloudUpload = new Codicon('cloud-upload', { character: '\\eac3' }); - Codicon.code = new Codicon('code', { character: '\\eac4' }); - Codicon.collapseAll = new Codicon('collapse-all', { character: '\\eac5' }); - Codicon.colorMode = new Codicon('color-mode', { character: '\\eac6' }); - Codicon.commentDiscussion = new Codicon('comment-discussion', { character: '\\eac7' }); - Codicon.compareChanges = new Codicon('compare-changes', { character: '\\eafd' }); - Codicon.creditCard = new Codicon('credit-card', { character: '\\eac9' }); - Codicon.dash = new Codicon('dash', { character: '\\eacc' }); - Codicon.dashboard = new Codicon('dashboard', { character: '\\eacd' }); - Codicon.database = new Codicon('database', { character: '\\eace' }); - Codicon.debugContinue = new Codicon('debug-continue', { character: '\\eacf' }); - Codicon.debugDisconnect = new Codicon('debug-disconnect', { character: '\\ead0' }); - Codicon.debugPause = new Codicon('debug-pause', { character: '\\ead1' }); - Codicon.debugRestart = new Codicon('debug-restart', { character: '\\ead2' }); - Codicon.debugStart = new Codicon('debug-start', { character: '\\ead3' }); - Codicon.debugStepInto = new Codicon('debug-step-into', { character: '\\ead4' }); - Codicon.debugStepOut = new Codicon('debug-step-out', { character: '\\ead5' }); - Codicon.debugStepOver = new Codicon('debug-step-over', { character: '\\ead6' }); - Codicon.debugStop = new Codicon('debug-stop', { character: '\\ead7' }); - Codicon.debug = new Codicon('debug', { character: '\\ead8' }); - Codicon.deviceCameraVideo = new Codicon('device-camera-video', { character: '\\ead9' }); - Codicon.deviceCamera = new Codicon('device-camera', { character: '\\eada' }); - Codicon.deviceMobile = new Codicon('device-mobile', { character: '\\eadb' }); - Codicon.diffAdded = new Codicon('diff-added', { character: '\\eadc' }); - Codicon.diffIgnored = new Codicon('diff-ignored', { character: '\\eadd' }); - Codicon.diffModified = new Codicon('diff-modified', { character: '\\eade' }); - Codicon.diffRemoved = new Codicon('diff-removed', { character: '\\eadf' }); - Codicon.diffRenamed = new Codicon('diff-renamed', { character: '\\eae0' }); - Codicon.diff = new Codicon('diff', { character: '\\eae1' }); - Codicon.discard = new Codicon('discard', { character: '\\eae2' }); - Codicon.editorLayout = new Codicon('editor-layout', { character: '\\eae3' }); - Codicon.emptyWindow = new Codicon('empty-window', { character: '\\eae4' }); - Codicon.exclude = new Codicon('exclude', { character: '\\eae5' }); - Codicon.extensions = new Codicon('extensions', { character: '\\eae6' }); - Codicon.eyeClosed = new Codicon('eye-closed', { character: '\\eae7' }); - Codicon.fileBinary = new Codicon('file-binary', { character: '\\eae8' }); - Codicon.fileCode = new Codicon('file-code', { character: '\\eae9' }); - Codicon.fileMedia = new Codicon('file-media', { character: '\\eaea' }); - Codicon.filePdf = new Codicon('file-pdf', { character: '\\eaeb' }); - Codicon.fileSubmodule = new Codicon('file-submodule', { character: '\\eaec' }); - Codicon.fileSymlinkDirectory = new Codicon('file-symlink-directory', { character: '\\eaed' }); - Codicon.fileSymlinkFile = new Codicon('file-symlink-file', { character: '\\eaee' }); - Codicon.fileZip = new Codicon('file-zip', { character: '\\eaef' }); - Codicon.files = new Codicon('files', { character: '\\eaf0' }); - Codicon.filter = new Codicon('filter', { character: '\\eaf1' }); - Codicon.flame = new Codicon('flame', { character: '\\eaf2' }); - Codicon.foldDown = new Codicon('fold-down', { character: '\\eaf3' }); - Codicon.foldUp = new Codicon('fold-up', { character: '\\eaf4' }); - Codicon.fold = new Codicon('fold', { character: '\\eaf5' }); - Codicon.folderActive = new Codicon('folder-active', { character: '\\eaf6' }); - Codicon.folderOpened = new Codicon('folder-opened', { character: '\\eaf7' }); - Codicon.gear = new Codicon('gear', { character: '\\eaf8' }); - Codicon.gift = new Codicon('gift', { character: '\\eaf9' }); - Codicon.gistSecret = new Codicon('gist-secret', { character: '\\eafa' }); - Codicon.gist = new Codicon('gist', { character: '\\eafb' }); - Codicon.gitCommit = new Codicon('git-commit', { character: '\\eafc' }); - Codicon.gitCompare = new Codicon('git-compare', { character: '\\eafd' }); - Codicon.gitMerge = new Codicon('git-merge', { character: '\\eafe' }); - Codicon.githubAction = new Codicon('github-action', { character: '\\eaff' }); - Codicon.githubAlt = new Codicon('github-alt', { character: '\\eb00' }); - Codicon.globe = new Codicon('globe', { character: '\\eb01' }); - Codicon.grabber = new Codicon('grabber', { character: '\\eb02' }); - Codicon.graph = new Codicon('graph', { character: '\\eb03' }); - Codicon.gripper = new Codicon('gripper', { character: '\\eb04' }); - Codicon.heart = new Codicon('heart', { character: '\\eb05' }); - Codicon.home = new Codicon('home', { character: '\\eb06' }); - Codicon.horizontalRule = new Codicon('horizontal-rule', { character: '\\eb07' }); - Codicon.hubot = new Codicon('hubot', { character: '\\eb08' }); - Codicon.inbox = new Codicon('inbox', { character: '\\eb09' }); - Codicon.issueClosed = new Codicon('issue-closed', { character: '\\eb0a' }); - Codicon.issueReopened = new Codicon('issue-reopened', { character: '\\eb0b' }); - Codicon.issues = new Codicon('issues', { character: '\\eb0c' }); - Codicon.italic = new Codicon('italic', { character: '\\eb0d' }); - Codicon.jersey = new Codicon('jersey', { character: '\\eb0e' }); - Codicon.json = new Codicon('json', { character: '\\eb0f' }); - Codicon.kebabVertical = new Codicon('kebab-vertical', { character: '\\eb10' }); - Codicon.key = new Codicon('key', { character: '\\eb11' }); - Codicon.law = new Codicon('law', { character: '\\eb12' }); - Codicon.lightbulbAutofix = new Codicon('lightbulb-autofix', { character: '\\eb13' }); - Codicon.linkExternal = new Codicon('link-external', { character: '\\eb14' }); - Codicon.link = new Codicon('link', { character: '\\eb15' }); - Codicon.listOrdered = new Codicon('list-ordered', { character: '\\eb16' }); - Codicon.listUnordered = new Codicon('list-unordered', { character: '\\eb17' }); - Codicon.liveShare = new Codicon('live-share', { character: '\\eb18' }); - Codicon.loading = new Codicon('loading', { character: '\\eb19' }); - Codicon.location = new Codicon('location', { character: '\\eb1a' }); - Codicon.mailRead = new Codicon('mail-read', { character: '\\eb1b' }); - Codicon.mail = new Codicon('mail', { character: '\\eb1c' }); - Codicon.markdown = new Codicon('markdown', { character: '\\eb1d' }); - Codicon.megaphone = new Codicon('megaphone', { character: '\\eb1e' }); - Codicon.mention = new Codicon('mention', { character: '\\eb1f' }); - Codicon.milestone = new Codicon('milestone', { character: '\\eb20' }); - Codicon.mortarBoard = new Codicon('mortar-board', { character: '\\eb21' }); - Codicon.move = new Codicon('move', { character: '\\eb22' }); - Codicon.multipleWindows = new Codicon('multiple-windows', { character: '\\eb23' }); - Codicon.mute = new Codicon('mute', { character: '\\eb24' }); - Codicon.noNewline = new Codicon('no-newline', { character: '\\eb25' }); - Codicon.note = new Codicon('note', { character: '\\eb26' }); - Codicon.octoface = new Codicon('octoface', { character: '\\eb27' }); - Codicon.openPreview = new Codicon('open-preview', { character: '\\eb28' }); - Codicon.package_ = new Codicon('package', { character: '\\eb29' }); - Codicon.paintcan = new Codicon('paintcan', { character: '\\eb2a' }); - Codicon.pin = new Codicon('pin', { character: '\\eb2b' }); - Codicon.play = new Codicon('play', { character: '\\eb2c' }); - Codicon.run = new Codicon('run', { character: '\\eb2c' }); - Codicon.plug = new Codicon('plug', { character: '\\eb2d' }); - Codicon.preserveCase = new Codicon('preserve-case', { character: '\\eb2e' }); - Codicon.preview = new Codicon('preview', { character: '\\eb2f' }); - Codicon.project = new Codicon('project', { character: '\\eb30' }); - Codicon.pulse = new Codicon('pulse', { character: '\\eb31' }); - Codicon.question = new Codicon('question', { character: '\\eb32' }); - Codicon.quote = new Codicon('quote', { character: '\\eb33' }); - Codicon.radioTower = new Codicon('radio-tower', { character: '\\eb34' }); - Codicon.reactions = new Codicon('reactions', { character: '\\eb35' }); - Codicon.references = new Codicon('references', { character: '\\eb36' }); - Codicon.refresh = new Codicon('refresh', { character: '\\eb37' }); - Codicon.regex = new Codicon('regex', { character: '\\eb38' }); - Codicon.remoteExplorer = new Codicon('remote-explorer', { character: '\\eb39' }); - Codicon.remote = new Codicon('remote', { character: '\\eb3a' }); - Codicon.remove = new Codicon('remove', { character: '\\eb3b' }); - Codicon.replaceAll = new Codicon('replace-all', { character: '\\eb3c' }); - Codicon.replace = new Codicon('replace', { character: '\\eb3d' }); - Codicon.repoClone = new Codicon('repo-clone', { character: '\\eb3e' }); - Codicon.repoForcePush = new Codicon('repo-force-push', { character: '\\eb3f' }); - Codicon.repoPull = new Codicon('repo-pull', { character: '\\eb40' }); - Codicon.repoPush = new Codicon('repo-push', { character: '\\eb41' }); - Codicon.report = new Codicon('report', { character: '\\eb42' }); - Codicon.requestChanges = new Codicon('request-changes', { character: '\\eb43' }); - Codicon.rocket = new Codicon('rocket', { character: '\\eb44' }); - Codicon.rootFolderOpened = new Codicon('root-folder-opened', { character: '\\eb45' }); - Codicon.rootFolder = new Codicon('root-folder', { character: '\\eb46' }); - Codicon.rss = new Codicon('rss', { character: '\\eb47' }); - Codicon.ruby = new Codicon('ruby', { character: '\\eb48' }); - Codicon.saveAll = new Codicon('save-all', { character: '\\eb49' }); - Codicon.saveAs = new Codicon('save-as', { character: '\\eb4a' }); - Codicon.save = new Codicon('save', { character: '\\eb4b' }); - Codicon.screenFull = new Codicon('screen-full', { character: '\\eb4c' }); - Codicon.screenNormal = new Codicon('screen-normal', { character: '\\eb4d' }); - Codicon.searchStop = new Codicon('search-stop', { character: '\\eb4e' }); - Codicon.server = new Codicon('server', { character: '\\eb50' }); - Codicon.settingsGear = new Codicon('settings-gear', { character: '\\eb51' }); - Codicon.settings = new Codicon('settings', { character: '\\eb52' }); - Codicon.shield = new Codicon('shield', { character: '\\eb53' }); - Codicon.smiley = new Codicon('smiley', { character: '\\eb54' }); - Codicon.sortPrecedence = new Codicon('sort-precedence', { character: '\\eb55' }); - Codicon.splitHorizontal = new Codicon('split-horizontal', { character: '\\eb56' }); - Codicon.splitVertical = new Codicon('split-vertical', { character: '\\eb57' }); - Codicon.squirrel = new Codicon('squirrel', { character: '\\eb58' }); - Codicon.starFull = new Codicon('star-full', { character: '\\eb59' }); - Codicon.starHalf = new Codicon('star-half', { character: '\\eb5a' }); - Codicon.symbolClass = new Codicon('symbol-class', { character: '\\eb5b' }); - Codicon.symbolColor = new Codicon('symbol-color', { character: '\\eb5c' }); - Codicon.symbolConstant = new Codicon('symbol-constant', { character: '\\eb5d' }); - Codicon.symbolEnumMember = new Codicon('symbol-enum-member', { character: '\\eb5e' }); - Codicon.symbolField = new Codicon('symbol-field', { character: '\\eb5f' }); - Codicon.symbolFile = new Codicon('symbol-file', { character: '\\eb60' }); - Codicon.symbolInterface = new Codicon('symbol-interface', { character: '\\eb61' }); - Codicon.symbolKeyword = new Codicon('symbol-keyword', { character: '\\eb62' }); - Codicon.symbolMisc = new Codicon('symbol-misc', { character: '\\eb63' }); - Codicon.symbolOperator = new Codicon('symbol-operator', { character: '\\eb64' }); - Codicon.symbolProperty = new Codicon('symbol-property', { character: '\\eb65' }); - Codicon.wrench = new Codicon('wrench', { character: '\\eb65' }); - Codicon.wrenchSubaction = new Codicon('wrench-subaction', { character: '\\eb65' }); - Codicon.symbolSnippet = new Codicon('symbol-snippet', { character: '\\eb66' }); - Codicon.tasklist = new Codicon('tasklist', { character: '\\eb67' }); - Codicon.telescope = new Codicon('telescope', { character: '\\eb68' }); - Codicon.textSize = new Codicon('text-size', { character: '\\eb69' }); - Codicon.threeBars = new Codicon('three-bars', { character: '\\eb6a' }); - Codicon.thumbsdown = new Codicon('thumbsdown', { character: '\\eb6b' }); - Codicon.thumbsup = new Codicon('thumbsup', { character: '\\eb6c' }); - Codicon.tools = new Codicon('tools', { character: '\\eb6d' }); - Codicon.triangleDown = new Codicon('triangle-down', { character: '\\eb6e' }); - Codicon.triangleLeft = new Codicon('triangle-left', { character: '\\eb6f' }); - Codicon.triangleRight = new Codicon('triangle-right', { character: '\\eb70' }); - Codicon.triangleUp = new Codicon('triangle-up', { character: '\\eb71' }); - Codicon.twitter = new Codicon('twitter', { character: '\\eb72' }); - Codicon.unfold = new Codicon('unfold', { character: '\\eb73' }); - Codicon.unlock = new Codicon('unlock', { character: '\\eb74' }); - Codicon.unmute = new Codicon('unmute', { character: '\\eb75' }); - Codicon.unverified = new Codicon('unverified', { character: '\\eb76' }); - Codicon.verified = new Codicon('verified', { character: '\\eb77' }); - Codicon.versions = new Codicon('versions', { character: '\\eb78' }); - Codicon.vmActive = new Codicon('vm-active', { character: '\\eb79' }); - Codicon.vmOutline = new Codicon('vm-outline', { character: '\\eb7a' }); - Codicon.vmRunning = new Codicon('vm-running', { character: '\\eb7b' }); - Codicon.watch = new Codicon('watch', { character: '\\eb7c' }); - Codicon.whitespace = new Codicon('whitespace', { character: '\\eb7d' }); - Codicon.wholeWord = new Codicon('whole-word', { character: '\\eb7e' }); - Codicon.window = new Codicon('window', { character: '\\eb7f' }); - Codicon.wordWrap = new Codicon('word-wrap', { character: '\\eb80' }); - Codicon.zoomIn = new Codicon('zoom-in', { character: '\\eb81' }); - Codicon.zoomOut = new Codicon('zoom-out', { character: '\\eb82' }); - Codicon.listFilter = new Codicon('list-filter', { character: '\\eb83' }); - Codicon.listFlat = new Codicon('list-flat', { character: '\\eb84' }); - Codicon.listSelection = new Codicon('list-selection', { character: '\\eb85' }); - Codicon.selection = new Codicon('selection', { character: '\\eb85' }); - Codicon.listTree = new Codicon('list-tree', { character: '\\eb86' }); - Codicon.debugBreakpointFunctionUnverified = new Codicon('debug-breakpoint-function-unverified', { character: '\\eb87' }); - Codicon.debugBreakpointFunction = new Codicon('debug-breakpoint-function', { character: '\\eb88' }); - Codicon.debugBreakpointFunctionDisabled = new Codicon('debug-breakpoint-function-disabled', { character: '\\eb88' }); - Codicon.debugStackframeActive = new Codicon('debug-stackframe-active', { character: '\\eb89' }); - Codicon.debugStackframeDot = new Codicon('debug-stackframe-dot', { character: '\\eb8a' }); - Codicon.debugStackframe = new Codicon('debug-stackframe', { character: '\\eb8b' }); - Codicon.debugStackframeFocused = new Codicon('debug-stackframe-focused', { character: '\\eb8b' }); - Codicon.debugBreakpointUnsupported = new Codicon('debug-breakpoint-unsupported', { character: '\\eb8c' }); - Codicon.symbolString = new Codicon('symbol-string', { character: '\\eb8d' }); - Codicon.debugReverseContinue = new Codicon('debug-reverse-continue', { character: '\\eb8e' }); - Codicon.debugStepBack = new Codicon('debug-step-back', { character: '\\eb8f' }); - Codicon.debugRestartFrame = new Codicon('debug-restart-frame', { character: '\\eb90' }); - Codicon.callIncoming = new Codicon('call-incoming', { character: '\\eb92' }); - Codicon.callOutgoing = new Codicon('call-outgoing', { character: '\\eb93' }); - Codicon.menu = new Codicon('menu', { character: '\\eb94' }); - Codicon.expandAll = new Codicon('expand-all', { character: '\\eb95' }); - Codicon.feedback = new Codicon('feedback', { character: '\\eb96' }); - Codicon.groupByRefType = new Codicon('group-by-ref-type', { character: '\\eb97' }); - Codicon.ungroupByRefType = new Codicon('ungroup-by-ref-type', { character: '\\eb98' }); - Codicon.account = new Codicon('account', { character: '\\eb99' }); - Codicon.bellDot = new Codicon('bell-dot', { character: '\\eb9a' }); - Codicon.debugConsole = new Codicon('debug-console', { character: '\\eb9b' }); - Codicon.library = new Codicon('library', { character: '\\eb9c' }); - Codicon.output = new Codicon('output', { character: '\\eb9d' }); - Codicon.runAll = new Codicon('run-all', { character: '\\eb9e' }); - Codicon.syncIgnored = new Codicon('sync-ignored', { character: '\\eb9f' }); - Codicon.pinned = new Codicon('pinned', { character: '\\eba0' }); - Codicon.githubInverted = new Codicon('github-inverted', { character: '\\eba1' }); - Codicon.debugAlt = new Codicon('debug-alt', { character: '\\eb91' }); - Codicon.serverProcess = new Codicon('server-process', { character: '\\eba2' }); - Codicon.serverEnvironment = new Codicon('server-environment', { character: '\\eba3' }); - Codicon.pass = new Codicon('pass', { character: '\\eba4' }); - Codicon.stopCircle = new Codicon('stop-circle', { character: '\\eba5' }); - Codicon.playCircle = new Codicon('play-circle', { character: '\\eba6' }); - Codicon.record = new Codicon('record', { character: '\\eba7' }); - Codicon.debugAltSmall = new Codicon('debug-alt-small', { character: '\\eba8' }); - Codicon.vmConnect = new Codicon('vm-connect', { character: '\\eba9' }); - Codicon.cloud = new Codicon('cloud', { character: '\\ebaa' }); - Codicon.merge = new Codicon('merge', { character: '\\ebab' }); -})(Codicon || (Codicon = {})); -const escapeCodiconsRegex = /(\\)?\$\([a-z0-9\-]+?(?:~[a-z0-9\-]*?)?\)/gi; -function escapeCodicons(text) { - return text.replace(escapeCodiconsRegex, (match, escaped) => escaped ? match : `\\${match}`); -} -const markdownEscapedCodiconsRegex = /\\\$\([a-z0-9\-]+?(?:~[a-z0-9\-]*?)?\)/gi; -function markdownEscapeEscapedCodicons(text) { - // Need to add an extra \ for escaping in markdown - return text.replace(markdownEscapedCodiconsRegex, match => `\\${match}`); -} -const renderCodiconsRegex = /(\\)?\$\((([a-z0-9\-]+?)(?:~([a-z0-9\-]*?))?)\)/gi; -/** - * @deprecated Use `renderCodiconsAsElement` instead - */ -function renderCodicons(text) { - return text.replace(renderCodiconsRegex, (_, escaped, codicon, name, animation) => { - // If the class for codicons is changed, it should also be updated in src\vs\base\browser\markdownRenderer.ts - return escaped - ? `$(${codicon})` - : ``; - }); -} -const stripCodiconsRegex = /(\s)?(\\)?\$\([a-z0-9\-]+?(?:~[a-z0-9\-]*?)?\)(\s)?/gi; -function stripCodicons(text) { - if (text.indexOf(_codicon_js__WEBPACK_IMPORTED_MODULE_0__["codiconStartMarker"]) === -1) { - return text; - } - return text.replace(stripCodiconsRegex, (match, preWhitespace, escaped, postWhitespace) => escaped ? match : preWhitespace || postWhitespace || ''); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/collections.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/collections.js ***! - \**********************************************************************/ -/*! exports provided: forEach, SetMap */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SetMap", function() { return SetMap; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -const hasOwnProperty = Object.prototype.hasOwnProperty; -/** - * Iterates over each entry in the provided dictionary. The iterator allows - * to remove elements and will stop when the callback returns {{false}}. - */ -function forEach(from, callback) { - for (let key in from) { - if (hasOwnProperty.call(from, key)) { - const result = callback({ key: key, value: from[key] }, function () { - delete from[key]; - }); - if (result === false) { - return; - } - } - } -} -class SetMap { - constructor() { - this.map = new Map(); - } - add(key, value) { - let values = this.map.get(key); - if (!values) { - values = new Set(); - this.map.set(key, values); - } - values.add(value); - } - delete(key, value) { - const values = this.map.get(key); - if (!values) { - return; - } - values.delete(value); - if (values.size === 0) { - this.map.delete(key); - } - } - forEach(key, fn) { - const values = this.map.get(key); - if (!values) { - return; - } - values.forEach(fn); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/color.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/color.js ***! - \****************************************************************/ -/*! exports provided: RGBA, HSLA, HSVA, Color */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA", function() { return RGBA; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HSLA", function() { return HSLA; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HSVA", function() { return HSVA; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function roundFloat(number, decimalPoints) { - const decimal = Math.pow(10, decimalPoints); - return Math.round(number * decimal) / decimal; -} -class RGBA { - constructor(r, g, b, a = 1) { - this.r = Math.min(255, Math.max(0, r)) | 0; - this.g = Math.min(255, Math.max(0, g)) | 0; - this.b = Math.min(255, Math.max(0, b)) | 0; - this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); - } - static equals(a, b) { - return a.r === b.r && a.g === b.g && a.b === b.b && a.a === b.a; - } -} -class HSLA { - constructor(h, s, l, a) { - this.h = Math.max(Math.min(360, h), 0) | 0; - this.s = roundFloat(Math.max(Math.min(1, s), 0), 3); - this.l = roundFloat(Math.max(Math.min(1, l), 0), 3); - this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); - } - static equals(a, b) { - return a.h === b.h && a.s === b.s && a.l === b.l && a.a === b.a; - } - /** - * Converts an RGB color value to HSL. Conversion formula - * adapted from http://en.wikipedia.org/wiki/HSL_color_space. - * Assumes r, g, and b are contained in the set [0, 255] and - * returns h in the set [0, 360], s, and l in the set [0, 1]. - */ - static fromRGBA(rgba) { - const r = rgba.r / 255; - const g = rgba.g / 255; - const b = rgba.b / 255; - const a = rgba.a; - const max = Math.max(r, g, b); - const min = Math.min(r, g, b); - let h = 0; - let s = 0; - const l = (min + max) / 2; - const chroma = max - min; - if (chroma > 0) { - s = Math.min((l <= 0.5 ? chroma / (2 * l) : chroma / (2 - (2 * l))), 1); - switch (max) { - case r: - h = (g - b) / chroma + (g < b ? 6 : 0); - break; - case g: - h = (b - r) / chroma + 2; - break; - case b: - h = (r - g) / chroma + 4; - break; - } - h *= 60; - h = Math.round(h); - } - return new HSLA(h, s, l, a); - } - static _hue2rgb(p, q, t) { - if (t < 0) { - t += 1; - } - if (t > 1) { - t -= 1; - } - if (t < 1 / 6) { - return p + (q - p) * 6 * t; - } - if (t < 1 / 2) { - return q; - } - if (t < 2 / 3) { - return p + (q - p) * (2 / 3 - t) * 6; - } - return p; - } - /** - * Converts an HSL color value to RGB. Conversion formula - * adapted from http://en.wikipedia.org/wiki/HSL_color_space. - * Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and - * returns r, g, and b in the set [0, 255]. - */ - static toRGBA(hsla) { - const h = hsla.h / 360; - const { s, l, a } = hsla; - let r, g, b; - if (s === 0) { - r = g = b = l; // achromatic - } - else { - const q = l < 0.5 ? l * (1 + s) : l + s - l * s; - const p = 2 * l - q; - r = HSLA._hue2rgb(p, q, h + 1 / 3); - g = HSLA._hue2rgb(p, q, h); - b = HSLA._hue2rgb(p, q, h - 1 / 3); - } - return new RGBA(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a); - } -} -class HSVA { - constructor(h, s, v, a) { - this.h = Math.max(Math.min(360, h), 0) | 0; - this.s = roundFloat(Math.max(Math.min(1, s), 0), 3); - this.v = roundFloat(Math.max(Math.min(1, v), 0), 3); - this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); - } - static equals(a, b) { - return a.h === b.h && a.s === b.s && a.v === b.v && a.a === b.a; - } - // from http://www.rapidtables.com/convert/color/rgb-to-hsv.htm - static fromRGBA(rgba) { - const r = rgba.r / 255; - const g = rgba.g / 255; - const b = rgba.b / 255; - const cmax = Math.max(r, g, b); - const cmin = Math.min(r, g, b); - const delta = cmax - cmin; - const s = cmax === 0 ? 0 : (delta / cmax); - let m; - if (delta === 0) { - m = 0; - } - else if (cmax === r) { - m = ((((g - b) / delta) % 6) + 6) % 6; - } - else if (cmax === g) { - m = ((b - r) / delta) + 2; - } - else { - m = ((r - g) / delta) + 4; - } - return new HSVA(Math.round(m * 60), s, cmax, rgba.a); - } - // from http://www.rapidtables.com/convert/color/hsv-to-rgb.htm - static toRGBA(hsva) { - const { h, s, v, a } = hsva; - const c = v * s; - const x = c * (1 - Math.abs((h / 60) % 2 - 1)); - const m = v - c; - let [r, g, b] = [0, 0, 0]; - if (h < 60) { - r = c; - g = x; - } - else if (h < 120) { - r = x; - g = c; - } - else if (h < 180) { - g = c; - b = x; - } - else if (h < 240) { - g = x; - b = c; - } - else if (h < 300) { - r = x; - b = c; - } - else if (h < 360) { - r = c; - b = x; - } - r = Math.round((r + m) * 255); - g = Math.round((g + m) * 255); - b = Math.round((b + m) * 255); - return new RGBA(r, g, b, a); - } -} -class Color { - constructor(arg) { - if (!arg) { - throw new Error('Color needs a value'); - } - else if (arg instanceof RGBA) { - this.rgba = arg; - } - else if (arg instanceof HSLA) { - this._hsla = arg; - this.rgba = HSLA.toRGBA(arg); - } - else if (arg instanceof HSVA) { - this._hsva = arg; - this.rgba = HSVA.toRGBA(arg); - } - else { - throw new Error('Invalid color ctor argument'); - } - } - static fromHex(hex) { - return Color.Format.CSS.parseHex(hex) || Color.red; - } - get hsla() { - if (this._hsla) { - return this._hsla; - } - else { - return HSLA.fromRGBA(this.rgba); - } - } - get hsva() { - if (this._hsva) { - return this._hsva; - } - return HSVA.fromRGBA(this.rgba); - } - equals(other) { - return !!other && RGBA.equals(this.rgba, other.rgba) && HSLA.equals(this.hsla, other.hsla) && HSVA.equals(this.hsva, other.hsva); - } - /** - * http://www.w3.org/TR/WCAG20/#relativeluminancedef - * Returns the number in the set [0, 1]. O => Darkest Black. 1 => Lightest white. - */ - getRelativeLuminance() { - const R = Color._relativeLuminanceForComponent(this.rgba.r); - const G = Color._relativeLuminanceForComponent(this.rgba.g); - const B = Color._relativeLuminanceForComponent(this.rgba.b); - const luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B; - return roundFloat(luminance, 4); - } - static _relativeLuminanceForComponent(color) { - const c = color / 255; - return (c <= 0.03928) ? c / 12.92 : Math.pow(((c + 0.055) / 1.055), 2.4); - } - /** - * http://24ways.org/2010/calculating-color-contrast - * Return 'true' if lighter color otherwise 'false' - */ - isLighter() { - const yiq = (this.rgba.r * 299 + this.rgba.g * 587 + this.rgba.b * 114) / 1000; - return yiq >= 128; - } - isLighterThan(another) { - const lum1 = this.getRelativeLuminance(); - const lum2 = another.getRelativeLuminance(); - return lum1 > lum2; - } - isDarkerThan(another) { - const lum1 = this.getRelativeLuminance(); - const lum2 = another.getRelativeLuminance(); - return lum1 < lum2; - } - lighten(factor) { - return new Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * factor, this.hsla.a)); - } - darken(factor) { - return new Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * factor, this.hsla.a)); - } - transparent(factor) { - const { r, g, b, a } = this.rgba; - return new Color(new RGBA(r, g, b, a * factor)); - } - isTransparent() { - return this.rgba.a === 0; - } - isOpaque() { - return this.rgba.a === 1; - } - opposite() { - return new Color(new RGBA(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a)); - } - toString() { - return '' + Color.Format.CSS.format(this); - } - static getLighterColor(of, relative, factor) { - if (of.isLighterThan(relative)) { - return of; - } - factor = factor ? factor : 0.5; - const lum1 = of.getRelativeLuminance(); - const lum2 = relative.getRelativeLuminance(); - factor = factor * (lum2 - lum1) / lum2; - return of.lighten(factor); - } - static getDarkerColor(of, relative, factor) { - if (of.isDarkerThan(relative)) { - return of; - } - factor = factor ? factor : 0.5; - const lum1 = of.getRelativeLuminance(); - const lum2 = relative.getRelativeLuminance(); - factor = factor * (lum1 - lum2) / lum1; - return of.darken(factor); - } -} -Color.white = new Color(new RGBA(255, 255, 255, 1)); -Color.black = new Color(new RGBA(0, 0, 0, 1)); -Color.red = new Color(new RGBA(255, 0, 0, 1)); -Color.blue = new Color(new RGBA(0, 0, 255, 1)); -Color.cyan = new Color(new RGBA(0, 255, 255, 1)); -Color.lightgrey = new Color(new RGBA(211, 211, 211, 1)); -Color.transparent = new Color(new RGBA(0, 0, 0, 0)); -(function (Color) { - let Format; - (function (Format) { - let CSS; - (function (CSS) { - function formatRGB(color) { - if (color.rgba.a === 1) { - return `rgb(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b})`; - } - return Color.Format.CSS.formatRGBA(color); - } - CSS.formatRGB = formatRGB; - function formatRGBA(color) { - return `rgba(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b}, ${+(color.rgba.a).toFixed(2)})`; - } - CSS.formatRGBA = formatRGBA; - function formatHSL(color) { - if (color.hsla.a === 1) { - return `hsl(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%)`; - } - return Color.Format.CSS.formatHSLA(color); - } - CSS.formatHSL = formatHSL; - function formatHSLA(color) { - return `hsla(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%, ${color.hsla.a.toFixed(2)})`; - } - CSS.formatHSLA = formatHSLA; - function _toTwoDigitHex(n) { - const r = n.toString(16); - return r.length !== 2 ? '0' + r : r; - } - /** - * Formats the color as #RRGGBB - */ - function formatHex(color) { - return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}`; - } - CSS.formatHex = formatHex; - /** - * Formats the color as #RRGGBBAA - * If 'compact' is set, colors without transparancy will be printed as #RRGGBB - */ - function formatHexA(color, compact = false) { - if (compact && color.rgba.a === 1) { - return Color.Format.CSS.formatHex(color); - } - return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}${_toTwoDigitHex(Math.round(color.rgba.a * 255))}`; - } - CSS.formatHexA = formatHexA; - /** - * The default format will use HEX if opaque and RGBA otherwise. - */ - function format(color) { - if (color.isOpaque()) { - return Color.Format.CSS.formatHex(color); - } - return Color.Format.CSS.formatRGBA(color); - } - CSS.format = format; - /** - * Converts an Hex color value to a Color. - * returns r, g, and b are contained in the set [0, 255] - * @param hex string (#RGB, #RGBA, #RRGGBB or #RRGGBBAA). - */ - function parseHex(hex) { - const length = hex.length; - if (length === 0) { - // Invalid color - return null; - } - if (hex.charCodeAt(0) !== 35 /* Hash */) { - // Does not begin with a # - return null; - } - if (length === 7) { - // #RRGGBB format - const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2)); - const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4)); - const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6)); - return new Color(new RGBA(r, g, b, 1)); - } - if (length === 9) { - // #RRGGBBAA format - const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2)); - const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4)); - const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6)); - const a = 16 * _parseHexDigit(hex.charCodeAt(7)) + _parseHexDigit(hex.charCodeAt(8)); - return new Color(new RGBA(r, g, b, a / 255)); - } - if (length === 4) { - // #RGB format - const r = _parseHexDigit(hex.charCodeAt(1)); - const g = _parseHexDigit(hex.charCodeAt(2)); - const b = _parseHexDigit(hex.charCodeAt(3)); - return new Color(new RGBA(16 * r + r, 16 * g + g, 16 * b + b)); - } - if (length === 5) { - // #RGBA format - const r = _parseHexDigit(hex.charCodeAt(1)); - const g = _parseHexDigit(hex.charCodeAt(2)); - const b = _parseHexDigit(hex.charCodeAt(3)); - const a = _parseHexDigit(hex.charCodeAt(4)); - return new Color(new RGBA(16 * r + r, 16 * g + g, 16 * b + b, (16 * a + a) / 255)); - } - // Invalid color - return null; - } - CSS.parseHex = parseHex; - function _parseHexDigit(charCode) { - switch (charCode) { - case 48 /* Digit0 */: return 0; - case 49 /* Digit1 */: return 1; - case 50 /* Digit2 */: return 2; - case 51 /* Digit3 */: return 3; - case 52 /* Digit4 */: return 4; - case 53 /* Digit5 */: return 5; - case 54 /* Digit6 */: return 6; - case 55 /* Digit7 */: return 7; - case 56 /* Digit8 */: return 8; - case 57 /* Digit9 */: return 9; - case 97 /* a */: return 10; - case 65 /* A */: return 10; - case 98 /* b */: return 11; - case 66 /* B */: return 11; - case 99 /* c */: return 12; - case 67 /* C */: return 12; - case 100 /* d */: return 13; - case 68 /* D */: return 13; - case 101 /* e */: return 14; - case 69 /* E */: return 14; - case 102 /* f */: return 15; - case 70 /* F */: return 15; - } - return 0; - } - })(CSS = Format.CSS || (Format.CSS = {})); - })(Format = Color.Format || (Color.Format = {})); -})(Color || (Color = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/comparers.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/comparers.js ***! - \********************************************************************/ -/*! exports provided: compareFileNames, compareAnything, compareByPrefix */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareFileNames", function() { return compareFileNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareAnything", function() { return compareAnything; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareByPrefix", function() { return compareByPrefix; }); -/* harmony import */ var _async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); - -// When comparing large numbers of strings, such as in sorting large arrays, is better for -// performance to create an Intl.Collator object and use the function provided by its compare -// property than it is to use String.prototype.localeCompare() -// A collator with numeric sorting enabled, and no sensitivity to case or to accents -const intlFileNameCollatorBaseNumeric = new _async_js__WEBPACK_IMPORTED_MODULE_0__["IdleValue"](() => { - const collator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' }); - return { - collator: collator, - collatorIsNumeric: collator.resolvedOptions().numeric - }; -}); /** Compares filenames without distinguishing the name from the extension. Disambiguates by unicode comparison. */ -function compareFileNames(one, other, caseSensitive = false) { - const a = one || ''; - const b = other || ''; - const result = intlFileNameCollatorBaseNumeric.value.collator.compare(a, b); - // Using the numeric option in the collator will - // make compare(`foo1`, `foo01`) === 0. We must disambiguate. - if (intlFileNameCollatorBaseNumeric.value.collatorIsNumeric && result === 0 && a !== b) { - return a < b ? -1 : 1; - } - return result; -} -function compareAnything(one, other, lookFor) { - const elementAName = one.toLowerCase(); - const elementBName = other.toLowerCase(); - // Sort prefix matches over non prefix matches - const prefixCompare = compareByPrefix(one, other, lookFor); - if (prefixCompare) { - return prefixCompare; - } - // Sort suffix matches over non suffix matches - const elementASuffixMatch = elementAName.endsWith(lookFor); - const elementBSuffixMatch = elementBName.endsWith(lookFor); - if (elementASuffixMatch !== elementBSuffixMatch) { - return elementASuffixMatch ? -1 : 1; - } - // Understand file names - const r = compareFileNames(elementAName, elementBName); - if (r !== 0) { - return r; - } - // Compare by name - return elementAName.localeCompare(elementBName); -} -function compareByPrefix(one, other, lookFor) { - const elementAName = one.toLowerCase(); - const elementBName = other.toLowerCase(); - // Sort prefix matches over non prefix matches - const elementAPrefixMatch = elementAName.startsWith(lookFor); - const elementBPrefixMatch = elementBName.startsWith(lookFor); - if (elementAPrefixMatch !== elementBPrefixMatch) { - return elementAPrefixMatch ? -1 : 1; - } - // Same prefix: Sort shorter matches to the top to have those on top that match more precisely - else if (elementAPrefixMatch && elementBPrefixMatch) { - if (elementAName.length < elementBName.length) { - return -1; - } - if (elementAName.length > elementBName.length) { - return 1; - } - } - return 0; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/decorators.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/decorators.js ***! - \*********************************************************************/ -/*! exports provided: createMemoizer, memoize */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMemoizer", function() { return createMemoizer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return memoize; }); -let memoizeId = 0; -function createMemoizer() { - const memoizeKeyPrefix = `$memoize${memoizeId++}`; - let self = undefined; - const result = function memoize(target, key, descriptor) { - let fnKey = null; - let fn = null; - if (typeof descriptor.value === 'function') { - fnKey = 'value'; - fn = descriptor.value; - if (fn.length !== 0) { - console.warn('Memoize should only be used in functions with zero parameters'); - } - } - else if (typeof descriptor.get === 'function') { - fnKey = 'get'; - fn = descriptor.get; - } - if (!fn) { - throw new Error('not supported'); - } - const memoizeKey = `${memoizeKeyPrefix}:${key}`; - descriptor[fnKey] = function (...args) { - self = this; - if (!this.hasOwnProperty(memoizeKey)) { - Object.defineProperty(this, memoizeKey, { - configurable: true, - enumerable: false, - writable: true, - value: fn.apply(this, args) - }); - } - return this[memoizeKey]; - }; - }; - result.clear = () => { - if (typeof self === 'undefined') { - return; - } - Object.getOwnPropertyNames(self).forEach(property => { - if (property.indexOf(memoizeKeyPrefix) === 0) { - delete self[property]; - } - }); - }; - return result; -} -function memoize(target, key, descriptor) { - return createMemoizer()(target, key, descriptor); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js ***! - \********************************************************************/ -/*! exports provided: StringDiffSequence, stringDiff, Debug, MyArray, LcsDiff */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringDiffSequence", function() { return StringDiffSequence; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringDiff", function() { return stringDiff; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Debug", function() { return Debug; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MyArray", function() { return MyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LcsDiff", function() { return LcsDiff; }); -/* harmony import */ var _diffChange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diffChange.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js"); -/* harmony import */ var _hash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../hash.js */ "./node_modules/monaco-editor/esm/vs/base/common/hash.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class StringDiffSequence { - constructor(source) { - this.source = source; - } - getElements() { - const source = this.source; - const characters = new Int32Array(source.length); - for (let i = 0, len = source.length; i < len; i++) { - characters[i] = source.charCodeAt(i); - } - return characters; - } -} -function stringDiff(original, modified, pretty) { - return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes; -} -// -// The code below has been ported from a C# implementation in VS -// -class Debug { - static Assert(condition, message) { - if (!condition) { - throw new Error(message); - } - } -} -class MyArray { - /** - * Copies a range of elements from an Array starting at the specified source index and pastes - * them to another Array starting at the specified destination index. The length and the indexes - * are specified as 64-bit integers. - * sourceArray: - * The Array that contains the data to copy. - * sourceIndex: - * A 64-bit integer that represents the index in the sourceArray at which copying begins. - * destinationArray: - * The Array that receives the data. - * destinationIndex: - * A 64-bit integer that represents the index in the destinationArray at which storing begins. - * length: - * A 64-bit integer that represents the number of elements to copy. - */ - static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) { - for (let i = 0; i < length; i++) { - destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; - } - } - static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) { - for (let i = 0; i < length; i++) { - destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; - } - } -} -/** - * A utility class which helps to create the set of DiffChanges from - * a difference operation. This class accepts original DiffElements and - * modified DiffElements that are involved in a particular change. The - * MarktNextChange() method can be called to mark the separation between - * distinct changes. At the end, the Changes property can be called to retrieve - * the constructed changes. - */ -class DiffChangeHelper { - /** - * Constructs a new DiffChangeHelper for the given DiffSequences. - */ - constructor() { - this.m_changes = []; - this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - this.m_originalCount = 0; - this.m_modifiedCount = 0; - } - /** - * Marks the beginning of the next change in the set of differences. - */ - MarkNextChange() { - // Only add to the list if there is something to add - if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { - // Add the new change to our list - this.m_changes.push(new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); - } - // Reset for the next change - this.m_originalCount = 0; - this.m_modifiedCount = 0; - this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - } - /** - * Adds the original element at the given position to the elements - * affected by the current change. The modified index gives context - * to the change position with respect to the original sequence. - * @param originalIndex The index of the original element to add. - * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence. - */ - AddOriginalElement(originalIndex, modifiedIndex) { - // The 'true' start index is the smallest of the ones we've seen - this.m_originalStart = Math.min(this.m_originalStart, originalIndex); - this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex); - this.m_originalCount++; - } - /** - * Adds the modified element at the given position to the elements - * affected by the current change. The original index gives context - * to the change position with respect to the modified sequence. - * @param originalIndex The index of the original element that provides corresponding position in the original sequence. - * @param modifiedIndex The index of the modified element to add. - */ - AddModifiedElement(originalIndex, modifiedIndex) { - // The 'true' start index is the smallest of the ones we've seen - this.m_originalStart = Math.min(this.m_originalStart, originalIndex); - this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex); - this.m_modifiedCount++; - } - /** - * Retrieves all of the changes marked by the class. - */ - getChanges() { - if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { - // Finish up on whatever is left - this.MarkNextChange(); - } - return this.m_changes; - } - /** - * Retrieves all of the changes marked by the class in the reverse order - */ - getReverseChanges() { - if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { - // Finish up on whatever is left - this.MarkNextChange(); - } - this.m_changes.reverse(); - return this.m_changes; - } -} -/** - * An implementation of the difference algorithm described in - * "An O(ND) Difference Algorithm and its variations" by Eugene W. Myers - */ -class LcsDiff { - /** - * Constructs the DiffFinder - */ - constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) { - this.ContinueProcessingPredicate = continueProcessingPredicate; - const [originalStringElements, originalElementsOrHash, originalHasStrings] = LcsDiff._getElements(originalSequence); - const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = LcsDiff._getElements(modifiedSequence); - this._hasStrings = (originalHasStrings && modifiedHasStrings); - this._originalStringElements = originalStringElements; - this._originalElementsOrHash = originalElementsOrHash; - this._modifiedStringElements = modifiedStringElements; - this._modifiedElementsOrHash = modifiedElementsOrHash; - this.m_forwardHistory = []; - this.m_reverseHistory = []; - } - static _isStringArray(arr) { - return (arr.length > 0 && typeof arr[0] === 'string'); - } - static _getElements(sequence) { - const elements = sequence.getElements(); - if (LcsDiff._isStringArray(elements)) { - const hashes = new Int32Array(elements.length); - for (let i = 0, len = elements.length; i < len; i++) { - hashes[i] = Object(_hash_js__WEBPACK_IMPORTED_MODULE_1__["stringHash"])(elements[i], 0); - } - return [elements, hashes, true]; - } - if (elements instanceof Int32Array) { - return [[], elements, false]; - } - return [[], new Int32Array(elements), false]; - } - ElementsAreEqual(originalIndex, newIndex) { - if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) { - return false; - } - return (this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true); - } - OriginalElementsAreEqual(index1, index2) { - if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) { - return false; - } - return (this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true); - } - ModifiedElementsAreEqual(index1, index2) { - if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) { - return false; - } - return (this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true); - } - ComputeDiff(pretty) { - return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty); - } - /** - * Computes the differences between the original and modified input - * sequences on the bounded range. - * @returns An array of the differences between the two input sequences. - */ - _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) { - const quitEarlyArr = [false]; - let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr); - if (pretty) { - // We have to clean up the computed diff to be more intuitive - // but it turns out this cannot be done correctly until the entire set - // of diffs have been computed - changes = this.PrettifyChanges(changes); - } - return { - quitEarly: quitEarlyArr[0], - changes: changes - }; - } - /** - * Private helper method which computes the differences on the bounded range - * recursively. - * @returns An array of the differences between the two input sequences. - */ - ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) { - quitEarlyArr[0] = false; - // Find the start of the differences - while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) { - originalStart++; - modifiedStart++; - } - // Find the end of the differences - while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) { - originalEnd--; - modifiedEnd--; - } - // In the special case where we either have all insertions or all deletions or the sequences are identical - if (originalStart > originalEnd || modifiedStart > modifiedEnd) { - let changes; - if (modifiedStart <= modifiedEnd) { - Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); - // All insertions - changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) - ]; - } - else if (originalStart <= originalEnd) { - Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); - // All deletions - changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, 0) - ]; - } - else { - Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); - Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); - // Identical sequences - No differences - changes = []; - } - return changes; - } - // This problem can be solved using the Divide-And-Conquer technique. - const midOriginalArr = [0]; - const midModifiedArr = [0]; - const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr); - const midOriginal = midOriginalArr[0]; - const midModified = midModifiedArr[0]; - if (result !== null) { - // Result is not-null when there was enough memory to compute the changes while - // searching for the recursion point - return result; - } - else if (!quitEarlyArr[0]) { - // We can break the problem down recursively by finding the changes in the - // First Half: (originalStart, modifiedStart) to (midOriginal, midModified) - // Second Half: (midOriginal + 1, minModified + 1) to (originalEnd, modifiedEnd) - // NOTE: ComputeDiff() is inclusive, therefore the second range starts on the next point - const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr); - let rightChanges = []; - if (!quitEarlyArr[0]) { - rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr); - } - else { - // We did't have time to finish the first half, so we don't have time to compute this half. - // Consider the entire rest of the sequence different. - rightChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) - ]; - } - return this.ConcatenateChanges(leftChanges, rightChanges); - } - // If we hit here, we quit early, and so can't return anything meaningful - return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) - ]; - } - WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) { - let forwardChanges = null; - let reverseChanges = null; - // First, walk backward through the forward diagonals history - let changeHelper = new DiffChangeHelper(); - let diagonalMin = diagonalForwardStart; - let diagonalMax = diagonalForwardEnd; - let diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset; - let lastOriginalIndex = -1073741824 /* MIN_SAFE_SMALL_INTEGER */; - let historyIndex = this.m_forwardHistory.length - 1; - do { - // Get the diagonal index from the relative diagonal number - const diagonal = diagonalRelative + diagonalForwardBase; - // Figure out where we came from - if (diagonal === diagonalMin || (diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) { - // Vertical line (the element is an insert) - originalIndex = forwardPoints[diagonal + 1]; - modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset; - if (originalIndex < lastOriginalIndex) { - changeHelper.MarkNextChange(); - } - lastOriginalIndex = originalIndex; - changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex); - diagonalRelative = (diagonal + 1) - diagonalForwardBase; //Setup for the next iteration - } - else { - // Horizontal line (the element is a deletion) - originalIndex = forwardPoints[diagonal - 1] + 1; - modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset; - if (originalIndex < lastOriginalIndex) { - changeHelper.MarkNextChange(); - } - lastOriginalIndex = originalIndex - 1; - changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1); - diagonalRelative = (diagonal - 1) - diagonalForwardBase; //Setup for the next iteration - } - if (historyIndex >= 0) { - forwardPoints = this.m_forwardHistory[historyIndex]; - diagonalForwardBase = forwardPoints[0]; //We stored this in the first spot - diagonalMin = 1; - diagonalMax = forwardPoints.length - 1; - } - } while (--historyIndex >= -1); - // Ironically, we get the forward changes as the reverse of the - // order we added them since we technically added them backwards - forwardChanges = changeHelper.getReverseChanges(); - if (quitEarlyArr[0]) { - // TODO: Calculate a partial from the reverse diagonals. - // For now, just assume everything after the midOriginal/midModified point is a diff - let originalStartPoint = midOriginalArr[0] + 1; - let modifiedStartPoint = midModifiedArr[0] + 1; - if (forwardChanges !== null && forwardChanges.length > 0) { - const lastForwardChange = forwardChanges[forwardChanges.length - 1]; - originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd()); - modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd()); - } - reverseChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) - ]; - } - else { - // Now walk backward through the reverse diagonals history - changeHelper = new DiffChangeHelper(); - diagonalMin = diagonalReverseStart; - diagonalMax = diagonalReverseEnd; - diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset; - lastOriginalIndex = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - historyIndex = (deltaIsEven) ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2; - do { - // Get the diagonal index from the relative diagonal number - const diagonal = diagonalRelative + diagonalReverseBase; - // Figure out where we came from - if (diagonal === diagonalMin || (diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) { - // Horizontal line (the element is a deletion)) - originalIndex = reversePoints[diagonal + 1] - 1; - modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset; - if (originalIndex > lastOriginalIndex) { - changeHelper.MarkNextChange(); - } - lastOriginalIndex = originalIndex + 1; - changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1); - diagonalRelative = (diagonal + 1) - diagonalReverseBase; //Setup for the next iteration - } - else { - // Vertical line (the element is an insertion) - originalIndex = reversePoints[diagonal - 1]; - modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset; - if (originalIndex > lastOriginalIndex) { - changeHelper.MarkNextChange(); - } - lastOriginalIndex = originalIndex; - changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1); - diagonalRelative = (diagonal - 1) - diagonalReverseBase; //Setup for the next iteration - } - if (historyIndex >= 0) { - reversePoints = this.m_reverseHistory[historyIndex]; - diagonalReverseBase = reversePoints[0]; //We stored this in the first spot - diagonalMin = 1; - diagonalMax = reversePoints.length - 1; - } - } while (--historyIndex >= -1); - // There are cases where the reverse history will find diffs that - // are correct, but not intuitive, so we need shift them. - reverseChanges = changeHelper.getChanges(); - } - return this.ConcatenateChanges(forwardChanges, reverseChanges); - } - /** - * Given the range to compute the diff on, this method finds the point: - * (midOriginal, midModified) - * that exists in the middle of the LCS of the two sequences and - * is the point at which the LCS problem may be broken down recursively. - * This method will try to keep the LCS trace in memory. If the LCS recursion - * point is calculated and the full trace is available in memory, then this method - * will return the change list. - * @param originalStart The start bound of the original sequence range - * @param originalEnd The end bound of the original sequence range - * @param modifiedStart The start bound of the modified sequence range - * @param modifiedEnd The end bound of the modified sequence range - * @param midOriginal The middle point of the original sequence range - * @param midModified The middle point of the modified sequence range - * @returns The diff changes, if available, otherwise null - */ - ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) { - let originalIndex = 0, modifiedIndex = 0; - let diagonalForwardStart = 0, diagonalForwardEnd = 0; - let diagonalReverseStart = 0, diagonalReverseEnd = 0; - // To traverse the edit graph and produce the proper LCS, our actual - // start position is just outside the given boundary - originalStart--; - modifiedStart--; - // We set these up to make the compiler happy, but they will - // be replaced before we return with the actual recursion point - midOriginalArr[0] = 0; - midModifiedArr[0] = 0; - // Clear out the history - this.m_forwardHistory = []; - this.m_reverseHistory = []; - // Each cell in the two arrays corresponds to a diagonal in the edit graph. - // The integer value in the cell represents the originalIndex of the furthest - // reaching point found so far that ends in that diagonal. - // The modifiedIndex can be computed mathematically from the originalIndex and the diagonal number. - const maxDifferences = (originalEnd - originalStart) + (modifiedEnd - modifiedStart); - const numDiagonals = maxDifferences + 1; - const forwardPoints = new Int32Array(numDiagonals); - const reversePoints = new Int32Array(numDiagonals); - // diagonalForwardBase: Index into forwardPoints of the diagonal which passes through (originalStart, modifiedStart) - // diagonalReverseBase: Index into reversePoints of the diagonal which passes through (originalEnd, modifiedEnd) - const diagonalForwardBase = (modifiedEnd - modifiedStart); - const diagonalReverseBase = (originalEnd - originalStart); - // diagonalForwardOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the - // diagonal number (relative to diagonalForwardBase) - // diagonalReverseOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the - // diagonal number (relative to diagonalReverseBase) - const diagonalForwardOffset = (originalStart - modifiedStart); - const diagonalReverseOffset = (originalEnd - modifiedEnd); - // delta: The difference between the end diagonal and the start diagonal. This is used to relate diagonal numbers - // relative to the start diagonal with diagonal numbers relative to the end diagonal. - // The Even/Oddn-ness of this delta is important for determining when we should check for overlap - const delta = diagonalReverseBase - diagonalForwardBase; - const deltaIsEven = (delta % 2 === 0); - // Here we set up the start and end points as the furthest points found so far - // in both the forward and reverse directions, respectively - forwardPoints[diagonalForwardBase] = originalStart; - reversePoints[diagonalReverseBase] = originalEnd; - // Remember if we quit early, and thus need to do a best-effort result instead of a real result. - quitEarlyArr[0] = false; - // A couple of points: - // --With this method, we iterate on the number of differences between the two sequences. - // The more differences there actually are, the longer this will take. - // --Also, as the number of differences increases, we have to search on diagonals further - // away from the reference diagonal (which is diagonalForwardBase for forward, diagonalReverseBase for reverse). - // --We extend on even diagonals (relative to the reference diagonal) only when numDifferences - // is even and odd diagonals only when numDifferences is odd. - for (let numDifferences = 1; numDifferences <= (maxDifferences / 2) + 1; numDifferences++) { - let furthestOriginalIndex = 0; - let furthestModifiedIndex = 0; - // Run the algorithm in the forward direction - diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals); - diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals); - for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) { - // STEP 1: We extend the furthest reaching point in the present diagonal - // by looking at the diagonals above and below and picking the one whose point - // is further away from the start point (originalStart, modifiedStart) - if (diagonal === diagonalForwardStart || (diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) { - originalIndex = forwardPoints[diagonal + 1]; - } - else { - originalIndex = forwardPoints[diagonal - 1] + 1; - } - modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset; - // Save the current originalIndex so we can test for false overlap in step 3 - const tempOriginalIndex = originalIndex; - // STEP 2: We can continue to extend the furthest reaching point in the present diagonal - // so long as the elements are equal. - while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) { - originalIndex++; - modifiedIndex++; - } - forwardPoints[diagonal] = originalIndex; - if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) { - furthestOriginalIndex = originalIndex; - furthestModifiedIndex = modifiedIndex; - } - // STEP 3: If delta is odd (overlap first happens on forward when delta is odd) - // and diagonal is in the range of reverse diagonals computed for numDifferences-1 - // (the previous iteration; we haven't computed reverse diagonals for numDifferences yet) - // then check for overlap. - if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= (numDifferences - 1)) { - if (originalIndex >= reversePoints[diagonal]) { - midOriginalArr[0] = originalIndex; - midModifiedArr[0] = modifiedIndex; - if (tempOriginalIndex <= reversePoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) { - // BINGO! We overlapped, and we have the full trace in memory! - return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); - } - else { - // Either false overlap, or we didn't have enough memory for the full trace - // Just return the recursion point - return null; - } - } - } - } - // Check to see if we should be quitting early, before moving on to the next iteration. - const matchLengthOfLongest = ((furthestOriginalIndex - originalStart) + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2; - if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) { - // We can't finish, so skip ahead to generating a result from what we have. - quitEarlyArr[0] = true; - // Use the furthest distance we got in the forward direction. - midOriginalArr[0] = furthestOriginalIndex; - midModifiedArr[0] = furthestModifiedIndex; - if (matchLengthOfLongest > 0 && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) { - // Enough of the history is in memory to walk it backwards - return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); - } - else { - // We didn't actually remember enough of the history. - //Since we are quiting the diff early, we need to shift back the originalStart and modified start - //back into the boundary limits since we decremented their value above beyond the boundary limit. - originalStart++; - modifiedStart++; - return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) - ]; - } - } - // Run the algorithm in the reverse direction - diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals); - diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals); - for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) { - // STEP 1: We extend the furthest reaching point in the present diagonal - // by looking at the diagonals above and below and picking the one whose point - // is further away from the start point (originalEnd, modifiedEnd) - if (diagonal === diagonalReverseStart || (diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) { - originalIndex = reversePoints[diagonal + 1] - 1; - } - else { - originalIndex = reversePoints[diagonal - 1]; - } - modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset; - // Save the current originalIndex so we can test for false overlap - const tempOriginalIndex = originalIndex; - // STEP 2: We can continue to extend the furthest reaching point in the present diagonal - // as long as the elements are equal. - while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) { - originalIndex--; - modifiedIndex--; - } - reversePoints[diagonal] = originalIndex; - // STEP 4: If delta is even (overlap first happens on reverse when delta is even) - // and diagonal is in the range of forward diagonals computed for numDifferences - // then check for overlap. - if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) { - if (originalIndex <= forwardPoints[diagonal]) { - midOriginalArr[0] = originalIndex; - midModifiedArr[0] = modifiedIndex; - if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) { - // BINGO! We overlapped, and we have the full trace in memory! - return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); - } - else { - // Either false overlap, or we didn't have enough memory for the full trace - // Just return the recursion point - return null; - } - } - } - } - // Save current vectors to history before the next iteration - if (numDifferences <= 1447 /* MaxDifferencesHistory */) { - // We are allocating space for one extra int, which we fill with - // the index of the diagonal base index - let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2); - temp[0] = diagonalForwardBase - diagonalForwardStart + 1; - MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1); - this.m_forwardHistory.push(temp); - temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2); - temp[0] = diagonalReverseBase - diagonalReverseStart + 1; - MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1); - this.m_reverseHistory.push(temp); - } - } - // If we got here, then we have the full trace in history. We just have to convert it to a change list - // NOTE: This part is a bit messy - return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); - } - /** - * Shifts the given changes to provide a more intuitive diff. - * While the first element in a diff matches the first element after the diff, - * we shift the diff down. - * - * @param changes The list of changes to shift - * @returns The shifted changes - */ - PrettifyChanges(changes) { - // Shift all the changes down first - for (let i = 0; i < changes.length; i++) { - const change = changes[i]; - const originalStop = (i < changes.length - 1) ? changes[i + 1].originalStart : this._originalElementsOrHash.length; - const modifiedStop = (i < changes.length - 1) ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length; - const checkOriginal = change.originalLength > 0; - const checkModified = change.modifiedLength > 0; - while (change.originalStart + change.originalLength < originalStop && - change.modifiedStart + change.modifiedLength < modifiedStop && - (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) && - (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) { - change.originalStart++; - change.modifiedStart++; - } - let mergedChangeArr = [null]; - if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) { - changes[i] = mergedChangeArr[0]; - changes.splice(i + 1, 1); - i--; - continue; - } - } - // Shift changes back up until we hit empty or whitespace-only lines - for (let i = changes.length - 1; i >= 0; i--) { - const change = changes[i]; - let originalStop = 0; - let modifiedStop = 0; - if (i > 0) { - const prevChange = changes[i - 1]; - if (prevChange.originalLength > 0) { - originalStop = prevChange.originalStart + prevChange.originalLength; - } - if (prevChange.modifiedLength > 0) { - modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength; - } - } - const checkOriginal = change.originalLength > 0; - const checkModified = change.modifiedLength > 0; - let bestDelta = 0; - let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength); - for (let delta = 1;; delta++) { - const originalStart = change.originalStart - delta; - const modifiedStart = change.modifiedStart - delta; - if (originalStart < originalStop || modifiedStart < modifiedStop) { - break; - } - if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) { - break; - } - if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) { - break; - } - const score = this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength); - if (score > bestScore) { - bestScore = score; - bestDelta = delta; - } - } - change.originalStart -= bestDelta; - change.modifiedStart -= bestDelta; - } - return changes; - } - _OriginalIsBoundary(index) { - if (index <= 0 || index >= this._originalElementsOrHash.length - 1) { - return true; - } - return (this._hasStrings && /^\s*$/.test(this._originalStringElements[index])); - } - _OriginalRegionIsBoundary(originalStart, originalLength) { - if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) { - return true; - } - if (originalLength > 0) { - const originalEnd = originalStart + originalLength; - if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) { - return true; - } - } - return false; - } - _ModifiedIsBoundary(index) { - if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) { - return true; - } - return (this._hasStrings && /^\s*$/.test(this._modifiedStringElements[index])); - } - _ModifiedRegionIsBoundary(modifiedStart, modifiedLength) { - if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) { - return true; - } - if (modifiedLength > 0) { - const modifiedEnd = modifiedStart + modifiedLength; - if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) { - return true; - } - } - return false; - } - _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) { - const originalScore = (this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0); - const modifiedScore = (this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0); - return (originalScore + modifiedScore); - } - /** - * Concatenates the two input DiffChange lists and returns the resulting - * list. - * @param The left changes - * @param The right changes - * @returns The concatenated list - */ - ConcatenateChanges(left, right) { - let mergedChangeArr = []; - if (left.length === 0 || right.length === 0) { - return (right.length > 0) ? right : left; - } - else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) { - // Since we break the problem down recursively, it is possible that we - // might recurse in the middle of a change thereby splitting it into - // two changes. Here in the combining stage, we detect and fuse those - // changes back together - const result = new Array(left.length + right.length - 1); - MyArray.Copy(left, 0, result, 0, left.length - 1); - result[left.length - 1] = mergedChangeArr[0]; - MyArray.Copy(right, 1, result, left.length, right.length - 1); - return result; - } - else { - const result = new Array(left.length + right.length); - MyArray.Copy(left, 0, result, 0, left.length); - MyArray.Copy(right, 0, result, left.length, right.length); - return result; - } - } - /** - * Returns true if the two changes overlap and can be merged into a single - * change - * @param left The left change - * @param right The right change - * @param mergedChange The merged change if the two overlap, null otherwise - * @returns True if the two changes overlap - */ - ChangesOverlap(left, right, mergedChangeArr) { - Debug.Assert(left.originalStart <= right.originalStart, 'Left change is not less than or equal to right change'); - Debug.Assert(left.modifiedStart <= right.modifiedStart, 'Left change is not less than or equal to right change'); - if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) { - const originalStart = left.originalStart; - let originalLength = left.originalLength; - const modifiedStart = left.modifiedStart; - let modifiedLength = left.modifiedLength; - if (left.originalStart + left.originalLength >= right.originalStart) { - originalLength = right.originalStart + right.originalLength - left.originalStart; - } - if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) { - modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart; - } - mergedChangeArr[0] = new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalLength, modifiedStart, modifiedLength); - return true; - } - else { - mergedChangeArr[0] = null; - return false; - } - } - /** - * Helper method used to clip a diagonal index to the range of valid - * diagonals. This also decides whether or not the diagonal index, - * if it exceeds the boundary, should be clipped to the boundary or clipped - * one inside the boundary depending on the Even/Odd status of the boundary - * and numDifferences. - * @param diagonal The index of the diagonal to clip. - * @param numDifferences The current number of differences being iterated upon. - * @param diagonalBaseIndex The base reference diagonal. - * @param numDiagonals The total number of diagonals. - * @returns The clipped diagonal index. - */ - ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) { - if (diagonal >= 0 && diagonal < numDiagonals) { - // Nothing to clip, its in range - return diagonal; - } - // diagonalsBelow: The number of diagonals below the reference diagonal - // diagonalsAbove: The number of diagonals above the reference diagonal - const diagonalsBelow = diagonalBaseIndex; - const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1; - const diffEven = (numDifferences % 2 === 0); - if (diagonal < 0) { - const lowerBoundEven = (diagonalsBelow % 2 === 0); - return (diffEven === lowerBoundEven) ? 0 : 1; - } - else { - const upperBoundEven = (diagonalsAbove % 2 === 0); - return (diffEven === upperBoundEven) ? numDiagonals - 1 : numDiagonals - 2; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js ***! - \**************************************************************************/ -/*! exports provided: DiffChange */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffChange", function() { return DiffChange; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * Represents information about a specific difference between two sequences. - */ -class DiffChange { - /** - * Constructs a new DiffChange with the given sequence information - * and content. - */ - constructor(originalStart, originalLength, modifiedStart, modifiedLength) { - //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); - this.originalStart = originalStart; - this.originalLength = originalLength; - this.modifiedStart = modifiedStart; - this.modifiedLength = modifiedLength; - } - /** - * The end point (exclusive) of the change in the original sequence. - */ - getOriginalEnd() { - return this.originalStart + this.originalLength; - } - /** - * The end point (exclusive) of the change in the modified sequence. - */ - getModifiedEnd() { - return this.modifiedStart + this.modifiedLength; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/errorMessage.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/errorMessage.js ***! - \***********************************************************************/ -/*! exports provided: toErrorMessage */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toErrorMessage", function() { return toErrorMessage; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _arrays_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -function exceptionToErrorMessage(exception, verbose) { - if (verbose && (exception.stack || exception.stacktrace)) { - return _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('stackTrace.format', "{0}: {1}", detectSystemErrorMessage(exception), stackToString(exception.stack) || stackToString(exception.stacktrace)); - } - return detectSystemErrorMessage(exception); -} -function stackToString(stack) { - if (Array.isArray(stack)) { - return stack.join('\n'); - } - return stack; -} -function detectSystemErrorMessage(exception) { - // See https://nodejs.org/api/errors.html#errors_class_system_error - if (typeof exception.code === 'string' && typeof exception.errno === 'number' && typeof exception.syscall === 'string') { - return _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('nodeExceptionMessage', "A system error occurred ({0})", exception.message); - } - return exception.message || _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('error.defaultMessage', "An unknown error occurred. Please consult the log for more details."); -} -/** - * Tries to generate a human readable error message out of the error. If the verbose parameter - * is set to true, the error message will include stacktrace details if provided. - * - * @returns A string containing the error message. - */ -function toErrorMessage(error = null, verbose = false) { - if (!error) { - return _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('error.defaultMessage', "An unknown error occurred. Please consult the log for more details."); - } - if (Array.isArray(error)) { - const errors = _arrays_js__WEBPACK_IMPORTED_MODULE_2__["coalesce"](error); - const msg = toErrorMessage(errors[0], verbose); - if (errors.length > 1) { - return _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('error.moreErrors', "{0} ({1} errors in total)", msg, errors.length); - } - return msg; - } - if (_types_js__WEBPACK_IMPORTED_MODULE_1__["isString"](error)) { - return error; - } - if (error.detail) { - const detail = error.detail; - if (detail.error) { - return exceptionToErrorMessage(detail.error, verbose); - } - if (detail.exception) { - return exceptionToErrorMessage(detail.exception, verbose); - } - } - if (error.stack) { - return exceptionToErrorMessage(error, verbose); - } - if (error.message) { - return error.message; - } - return _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('error.defaultMessage', "An unknown error occurred. Please consult the log for more details."); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/errors.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/errors.js ***! - \*****************************************************************/ -/*! exports provided: ErrorHandler, errorHandler, onUnexpectedError, onUnexpectedExternalError, transformErrorForSerialization, isPromiseCanceledError, canceled, illegalArgument, illegalState */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "errorHandler", function() { return errorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedError", function() { return onUnexpectedError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedExternalError", function() { return onUnexpectedExternalError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformErrorForSerialization", function() { return transformErrorForSerialization; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromiseCanceledError", function() { return isPromiseCanceledError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canceled", function() { return canceled; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalArgument", function() { return illegalArgument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalState", function() { return illegalState; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// Avoid circular dependency on EventEmitter by implementing a subset of the interface. -class ErrorHandler { - constructor() { - this.listeners = []; - this.unexpectedErrorHandler = function (e) { - setTimeout(() => { - if (e.stack) { - throw new Error(e.message + '\n\n' + e.stack); - } - throw e; - }, 0); - }; - } - emit(e) { - this.listeners.forEach((listener) => { - listener(e); - }); - } - onUnexpectedError(e) { - this.unexpectedErrorHandler(e); - this.emit(e); - } - // For external errors, we don't want the listeners to be called - onUnexpectedExternalError(e) { - this.unexpectedErrorHandler(e); - } -} -const errorHandler = new ErrorHandler(); -function onUnexpectedError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedError(e); - } - return undefined; -} -function onUnexpectedExternalError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedExternalError(e); - } - return undefined; -} -function transformErrorForSerialization(error) { - if (error instanceof Error) { - let { name, message } = error; - const stack = error.stacktrace || error.stack; - return { - $isError: true, - name, - message, - stack - }; - } - // return as is - return error; -} -const canceledName = 'Canceled'; -/** - * Checks if the given error is a promise in canceled state - */ -function isPromiseCanceledError(error) { - return error instanceof Error && error.name === canceledName && error.message === canceledName; -} -/** - * Returns an error that signals cancellation. - */ -function canceled() { - const error = new Error(canceledName); - error.name = error.message; - return error; -} -function illegalArgument(name) { - if (name) { - return new Error(`Illegal argument: ${name}`); - } - else { - return new Error('Illegal argument'); - } -} -function illegalState(name) { - if (name) { - return new Error(`Illegal state: ${name}`); - } - else { - return new Error('Illegal state'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/event.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/event.js ***! - \****************************************************************/ -/*! exports provided: Event, Emitter, PauseableEmitter, EventBufferer, Relay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return Event; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Emitter", function() { return Emitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PauseableEmitter", function() { return PauseableEmitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventBufferer", function() { return EventBufferer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Relay", function() { return Relay; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _linkedList_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -var Event; -(function (Event) { - Event.None = () => _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - /** - * Given an event, returns another event which only fires once. - */ - function once(event) { - return (listener, thisArgs = null, disposables) => { - // we need this, in case the event fires during the listener call - let didFire = false; - let result; - result = event(e => { - if (didFire) { - return; - } - else if (result) { - result.dispose(); - } - else { - didFire = true; - } - return listener.call(thisArgs, e); - }, null, disposables); - if (didFire) { - result.dispose(); - } - return result; - }; - } - Event.once = once; - /** - * Given an event and a `map` function, returns another event which maps each element - * through the mapping function. - */ - function map(event, map) { - return snapshot((listener, thisArgs = null, disposables) => event(i => listener.call(thisArgs, map(i)), null, disposables)); - } - Event.map = map; - /** - * Given an event and an `each` function, returns another identical event and calls - * the `each` function per each element. - */ - function forEach(event, each) { - return snapshot((listener, thisArgs = null, disposables) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables)); - } - Event.forEach = forEach; - function filter(event, filter) { - return snapshot((listener, thisArgs = null, disposables) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables)); - } - Event.filter = filter; - /** - * Given an event, returns the same event but typed as `Event`. - */ - function signal(event) { - return event; - } - Event.signal = signal; - function any(...events) { - return (listener, thisArgs = null, disposables) => Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["combinedDisposable"])(...events.map(event => event(e => listener.call(thisArgs, e), null, disposables))); - } - Event.any = any; - /** - * Given an event and a `merge` function, returns another event which maps each element - * and the cumulative result through the `merge` function. Similar to `map`, but with memory. - */ - function reduce(event, merge, initial) { - let output = initial; - return map(event, e => { - output = merge(output, e); - return output; - }); - } - Event.reduce = reduce; - /** - * Given a chain of event processing functions (filter, map, etc), each - * function will be invoked per event & per listener. Snapshotting an event - * chain allows each function to be invoked just once per event. - */ - function snapshot(event) { - let listener; - const emitter = new Emitter({ - onFirstListenerAdd() { - listener = event(emitter.fire, emitter); - }, - onLastListenerRemove() { - listener.dispose(); - } - }); - return emitter.event; - } - Event.snapshot = snapshot; - function debounce(event, merge, delay = 100, leading = false, leakWarningThreshold) { - let subscription; - let output = undefined; - let handle = undefined; - let numDebouncedCalls = 0; - const emitter = new Emitter({ - leakWarningThreshold, - onFirstListenerAdd() { - subscription = event(cur => { - numDebouncedCalls++; - output = merge(output, cur); - if (leading && !handle) { - emitter.fire(output); - output = undefined; - } - clearTimeout(handle); - handle = setTimeout(() => { - const _output = output; - output = undefined; - handle = undefined; - if (!leading || numDebouncedCalls > 1) { - emitter.fire(_output); - } - numDebouncedCalls = 0; - }, delay); - }); - }, - onLastListenerRemove() { - subscription.dispose(); - } - }); - return emitter.event; - } - Event.debounce = debounce; - /** - * Given an event, it returns another event which fires only once and as soon as - * the input event emits. The event data is the number of millis it took for the - * event to fire. - */ - function stopwatch(event) { - const start = new Date().getTime(); - return map(once(event), _ => new Date().getTime() - start); - } - Event.stopwatch = stopwatch; - /** - * Given an event, it returns another event which fires only when the event - * element changes. - */ - function latch(event) { - let firstCall = true; - let cache; - return filter(event, value => { - const shouldEmit = firstCall || value !== cache; - firstCall = false; - cache = value; - return shouldEmit; - }); - } - Event.latch = latch; - /** - * Buffers the provided event until a first listener comes - * along, at which point fire all the events at once and - * pipe the event from then on. - * - * ```typescript - * const emitter = new Emitter(); - * const event = emitter.event; - * const bufferedEvent = buffer(event); - * - * emitter.fire(1); - * emitter.fire(2); - * emitter.fire(3); - * // nothing... - * - * const listener = bufferedEvent(num => console.log(num)); - * // 1, 2, 3 - * - * emitter.fire(4); - * // 4 - * ``` - */ - function buffer(event, nextTick = false, _buffer = []) { - let buffer = _buffer.slice(); - let listener = event(e => { - if (buffer) { - buffer.push(e); - } - else { - emitter.fire(e); - } - }); - const flush = () => { - if (buffer) { - buffer.forEach(e => emitter.fire(e)); - } - buffer = null; - }; - const emitter = new Emitter({ - onFirstListenerAdd() { - if (!listener) { - listener = event(e => emitter.fire(e)); - } - }, - onFirstListenerDidAdd() { - if (buffer) { - if (nextTick) { - setTimeout(flush); - } - else { - flush(); - } - } - }, - onLastListenerRemove() { - if (listener) { - listener.dispose(); - } - listener = null; - } - }); - return emitter.event; - } - Event.buffer = buffer; - class ChainableEvent { - constructor(event) { - this.event = event; - } - map(fn) { - return new ChainableEvent(map(this.event, fn)); - } - forEach(fn) { - return new ChainableEvent(forEach(this.event, fn)); - } - filter(fn) { - return new ChainableEvent(filter(this.event, fn)); - } - reduce(merge, initial) { - return new ChainableEvent(reduce(this.event, merge, initial)); - } - latch() { - return new ChainableEvent(latch(this.event)); - } - debounce(merge, delay = 100, leading = false, leakWarningThreshold) { - return new ChainableEvent(debounce(this.event, merge, delay, leading, leakWarningThreshold)); - } - on(listener, thisArgs, disposables) { - return this.event(listener, thisArgs, disposables); - } - once(listener, thisArgs, disposables) { - return once(this.event)(listener, thisArgs, disposables); - } - } - function chain(event) { - return new ChainableEvent(event); - } - Event.chain = chain; - function fromNodeEventEmitter(emitter, eventName, map = id => id) { - const fn = (...args) => result.fire(map(...args)); - const onFirstListenerAdd = () => emitter.on(eventName, fn); - const onLastListenerRemove = () => emitter.removeListener(eventName, fn); - const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove }); - return result.event; - } - Event.fromNodeEventEmitter = fromNodeEventEmitter; - function fromDOMEventEmitter(emitter, eventName, map = id => id) { - const fn = (...args) => result.fire(map(...args)); - const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn); - const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn); - const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove }); - return result.event; - } - Event.fromDOMEventEmitter = fromDOMEventEmitter; - function fromPromise(promise) { - const emitter = new Emitter(); - let shouldEmit = false; - promise - .then(undefined, () => null) - .then(() => { - if (!shouldEmit) { - setTimeout(() => emitter.fire(undefined), 0); - } - else { - emitter.fire(undefined); - } - }); - shouldEmit = true; - return emitter.event; - } - Event.fromPromise = fromPromise; - function toPromise(event) { - return new Promise(c => once(event)(c)); - } - Event.toPromise = toPromise; -})(Event || (Event = {})); -let _globalLeakWarningThreshold = -1; -class LeakageMonitor { - constructor(customThreshold, name = Math.random().toString(18).slice(2, 5)) { - this.customThreshold = customThreshold; - this.name = name; - this._warnCountdown = 0; - } - dispose() { - if (this._stacks) { - this._stacks.clear(); - } - } - check(listenerCount) { - let threshold = _globalLeakWarningThreshold; - if (typeof this.customThreshold === 'number') { - threshold = this.customThreshold; - } - if (threshold <= 0 || listenerCount < threshold) { - return undefined; - } - if (!this._stacks) { - this._stacks = new Map(); - } - const stack = new Error().stack.split('\n').slice(3).join('\n'); - const count = (this._stacks.get(stack) || 0); - this._stacks.set(stack, count + 1); - this._warnCountdown -= 1; - if (this._warnCountdown <= 0) { - // only warn on first exceed and then every time the limit - // is exceeded by 50% again - this._warnCountdown = threshold * 0.5; - // find most frequent listener and print warning - let topStack; - let topCount = 0; - for (const [stack, count] of this._stacks) { - if (!topStack || topCount < count) { - topStack = stack; - topCount = count; - } - } - console.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`); - console.warn(topStack); - } - return () => { - const count = (this._stacks.get(stack) || 0); - this._stacks.set(stack, count - 1); - }; - } -} -/** - * The Emitter can be used to expose an Event to the public - * to fire it from the insides. - * Sample: - class Document { - - private readonly _onDidChange = new Emitter<(value:string)=>any>(); - - public onDidChange = this._onDidChange.event; - - // getter-style - // get onDidChange(): Event<(value:string)=>any> { - // return this._onDidChange.event; - // } - - private _doIt() { - //... - this._onDidChange.fire(value); - } - } - */ -class Emitter { - constructor(options) { - this._disposed = false; - this._options = options; - this._leakageMon = _globalLeakWarningThreshold > 0 - ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) - : undefined; - } - /** - * For the public to allow to subscribe - * to events from this Emitter - */ - get event() { - if (!this._event) { - this._event = (listener, thisArgs, disposables) => { - if (!this._listeners) { - this._listeners = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__["LinkedList"](); - } - const firstListener = this._listeners.isEmpty(); - if (firstListener && this._options && this._options.onFirstListenerAdd) { - this._options.onFirstListenerAdd(this); - } - const remove = this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); - if (firstListener && this._options && this._options.onFirstListenerDidAdd) { - this._options.onFirstListenerDidAdd(this); - } - if (this._options && this._options.onListenerDidAdd) { - this._options.onListenerDidAdd(this, listener, thisArgs); - } - // check and record this emitter for potential leakage - let removeMonitor; - if (this._leakageMon) { - removeMonitor = this._leakageMon.check(this._listeners.size); - } - let result; - result = { - dispose: () => { - if (removeMonitor) { - removeMonitor(); - } - result.dispose = Emitter._noop; - if (!this._disposed) { - remove(); - if (this._options && this._options.onLastListenerRemove) { - const hasListeners = (this._listeners && !this._listeners.isEmpty()); - if (!hasListeners) { - this._options.onLastListenerRemove(this); - } - } - } - } - }; - if (disposables instanceof _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"]) { - disposables.add(result); - } - else if (Array.isArray(disposables)) { - disposables.push(result); - } - return result; - }; - } - return this._event; - } - /** - * To be kept private to fire an event to - * subscribers - */ - fire(event) { - if (this._listeners) { - // put all [listener,event]-pairs into delivery queue - // then emit all event. an inner/nested event might be - // the driver of this - if (!this._deliveryQueue) { - this._deliveryQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__["LinkedList"](); - } - for (let listener of this._listeners) { - this._deliveryQueue.push([listener, event]); - } - while (this._deliveryQueue.size > 0) { - const [listener, event] = this._deliveryQueue.shift(); - try { - if (typeof listener === 'function') { - listener.call(undefined, event); - } - else { - listener[0].call(listener[1], event); - } - } - catch (e) { - Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - } - } - } - } - dispose() { - if (this._listeners) { - this._listeners.clear(); - } - if (this._deliveryQueue) { - this._deliveryQueue.clear(); - } - if (this._leakageMon) { - this._leakageMon.dispose(); - } - this._disposed = true; - } -} -Emitter._noop = function () { }; -class PauseableEmitter extends Emitter { - constructor(options) { - super(options); - this._isPaused = 0; - this._eventQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__["LinkedList"](); - this._mergeFn = options && options.merge; - } - pause() { - this._isPaused++; - } - resume() { - if (this._isPaused !== 0 && --this._isPaused === 0) { - if (this._mergeFn) { - // use the merge function to create a single composite - // event. make a copy in case firing pauses this emitter - const events = this._eventQueue.toArray(); - this._eventQueue.clear(); - super.fire(this._mergeFn(events)); - } - else { - // no merging, fire each event individually and test - // that this emitter isn't paused halfway through - while (!this._isPaused && this._eventQueue.size !== 0) { - super.fire(this._eventQueue.shift()); - } - } - } - } - fire(event) { - if (this._listeners) { - if (this._isPaused !== 0) { - this._eventQueue.push(event); - } - else { - super.fire(event); - } - } - } -} -/** - * The EventBufferer is useful in situations in which you want - * to delay firing your events during some code. - * You can wrap that code and be sure that the event will not - * be fired during that wrap. - * - * ``` - * const emitter: Emitter; - * const delayer = new EventDelayer(); - * const delayedEvent = delayer.wrapEvent(emitter.event); - * - * delayedEvent(console.log); - * - * delayer.bufferEvents(() => { - * emitter.fire(); // event will not be fired yet - * }); - * - * // event will only be fired at this point - * ``` - */ -class EventBufferer { - constructor() { - this.buffers = []; - } - wrapEvent(event) { - return (listener, thisArgs, disposables) => { - return event(i => { - const buffer = this.buffers[this.buffers.length - 1]; - if (buffer) { - buffer.push(() => listener.call(thisArgs, i)); - } - else { - listener.call(thisArgs, i); - } - }, undefined, disposables); - }; - } - bufferEvents(fn) { - const buffer = []; - this.buffers.push(buffer); - const r = fn(); - this.buffers.pop(); - buffer.forEach(flush => flush()); - return r; - } -} -/** - * A Relay is an event forwarder which functions as a replugabble event pipe. - * Once created, you can connect an input event to it and it will simply forward - * events from that input event through its own `event` property. The `input` - * can be changed at any point in time. - */ -class Relay { - constructor() { - this.listening = false; - this.inputEvent = Event.None; - this.inputEventListener = _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - this.emitter = new Emitter({ - onFirstListenerDidAdd: () => { - this.listening = true; - this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter); - }, - onLastListenerRemove: () => { - this.listening = false; - this.inputEventListener.dispose(); - } - }); - this.event = this.emitter.event; - } - set input(event) { - this.inputEvent = event; - if (this.listening) { - this.inputEventListener.dispose(); - this.inputEventListener = event(this.emitter.fire, this.emitter); - } - } - dispose() { - this.inputEventListener.dispose(); - this.emitter.dispose(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/extpath.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/extpath.js ***! - \******************************************************************/ -/*! exports provided: toSlashes, isEqualOrParent */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toSlashes", function() { return toSlashes; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEqualOrParent", function() { return isEqualOrParent; }); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./path.js */ "./node_modules/monaco-editor/esm/vs/base/common/path.js"); - - -/** - * Takes a Windows OS path and changes backward slashes to forward slashes. - * This should only be done for OS paths from Windows (or user provided paths potentially from Windows). - * Using it on a Linux or MaxOS path might change it. - */ -function toSlashes(osPath) { - return osPath.replace(/[\\/]/g, _path_js__WEBPACK_IMPORTED_MODULE_1__["posix"].sep); -} -function isEqualOrParent(path, candidate, ignoreCase, separator = _path_js__WEBPACK_IMPORTED_MODULE_1__["sep"]) { - if (path === candidate) { - return true; - } - if (!path || !candidate) { - return false; - } - if (candidate.length > path.length) { - return false; - } - if (ignoreCase) { - const beginsWith = Object(_strings_js__WEBPACK_IMPORTED_MODULE_0__["startsWithIgnoreCase"])(path, candidate); - if (!beginsWith) { - return false; - } - if (candidate.length === path.length) { - return true; // same path, different casing - } - let sepOffset = candidate.length; - if (candidate.charAt(candidate.length - 1) === separator) { - sepOffset--; // adjust the expected sep offset in case our candidate already ends in separator character - } - return path.charAt(sepOffset) === separator; - } - if (candidate.charAt(candidate.length - 1) !== separator) { - candidate += separator; - } - return path.indexOf(candidate) === 0; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/filters.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/filters.js ***! - \******************************************************************/ -/*! exports provided: or, matchesPrefix, matchesContiguousSubString, matchesSubString, isUpper, matchesCamelCase, matchesWords, matchesFuzzy, anyScore, createMatches, isPatternInWord, FuzzyScore, fuzzyScore, fuzzyScoreGracefulAggressive */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "or", function() { return or; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchesPrefix", function() { return matchesPrefix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchesContiguousSubString", function() { return matchesContiguousSubString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchesSubString", function() { return matchesSubString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUpper", function() { return isUpper; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchesCamelCase", function() { return matchesCamelCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchesWords", function() { return matchesWords; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchesFuzzy", function() { return matchesFuzzy; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "anyScore", function() { return anyScore; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatches", function() { return createMatches; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPatternInWord", function() { return isPatternInWord; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FuzzyScore", function() { return FuzzyScore; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fuzzyScore", function() { return fuzzyScore; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fuzzyScoreGracefulAggressive", function() { return fuzzyScoreGracefulAggressive; }); -/* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./map.js */ "./node_modules/monaco-editor/esm/vs/base/common/map.js"); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -// Combined filters -/** - * @returns A filter which combines the provided set - * of filters with an or. The *first* filters that - * matches defined the return value of the returned - * filter. - */ -function or(...filter) { - return function (word, wordToMatchAgainst) { - for (let i = 0, len = filter.length; i < len; i++) { - const match = filter[i](word, wordToMatchAgainst); - if (match) { - return match; - } - } - return null; - }; -} -const matchesPrefix = _matchesPrefix.bind(undefined, true); -function _matchesPrefix(ignoreCase, word, wordToMatchAgainst) { - if (!wordToMatchAgainst || wordToMatchAgainst.length < word.length) { - return null; - } - let matches; - if (ignoreCase) { - matches = _strings_js__WEBPACK_IMPORTED_MODULE_1__["startsWithIgnoreCase"](wordToMatchAgainst, word); - } - else { - matches = wordToMatchAgainst.indexOf(word) === 0; - } - if (!matches) { - return null; - } - return word.length > 0 ? [{ start: 0, end: word.length }] : []; -} -// Contiguous Substring -function matchesContiguousSubString(word, wordToMatchAgainst) { - const index = wordToMatchAgainst.toLowerCase().indexOf(word.toLowerCase()); - if (index === -1) { - return null; - } - return [{ start: index, end: index + word.length }]; -} -// Substring -function matchesSubString(word, wordToMatchAgainst) { - return _matchesSubString(word.toLowerCase(), wordToMatchAgainst.toLowerCase(), 0, 0); -} -function _matchesSubString(word, wordToMatchAgainst, i, j) { - if (i === word.length) { - return []; - } - else if (j === wordToMatchAgainst.length) { - return null; - } - else { - if (word[i] === wordToMatchAgainst[j]) { - let result = null; - if (result = _matchesSubString(word, wordToMatchAgainst, i + 1, j + 1)) { - return join({ start: j, end: j + 1 }, result); - } - return null; - } - return _matchesSubString(word, wordToMatchAgainst, i, j + 1); - } -} -// CamelCase -function isLower(code) { - return 97 /* a */ <= code && code <= 122 /* z */; -} -function isUpper(code) { - return 65 /* A */ <= code && code <= 90 /* Z */; -} -function isNumber(code) { - return 48 /* Digit0 */ <= code && code <= 57 /* Digit9 */; -} -function isWhitespace(code) { - return (code === 32 /* Space */ - || code === 9 /* Tab */ - || code === 10 /* LineFeed */ - || code === 13 /* CarriageReturn */); -} -const wordSeparators = new Set(); -'`~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?' - .split('') - .forEach(s => wordSeparators.add(s.charCodeAt(0))); -function isWordSeparator(code) { - return isWhitespace(code) || wordSeparators.has(code); -} -function charactersMatch(codeA, codeB) { - return (codeA === codeB) || (isWordSeparator(codeA) && isWordSeparator(codeB)); -} -function isAlphanumeric(code) { - return isLower(code) || isUpper(code) || isNumber(code); -} -function join(head, tail) { - if (tail.length === 0) { - tail = [head]; - } - else if (head.end === tail[0].start) { - tail[0].start = head.start; - } - else { - tail.unshift(head); - } - return tail; -} -function nextAnchor(camelCaseWord, start) { - for (let i = start; i < camelCaseWord.length; i++) { - const c = camelCaseWord.charCodeAt(i); - if (isUpper(c) || isNumber(c) || (i > 0 && !isAlphanumeric(camelCaseWord.charCodeAt(i - 1)))) { - return i; - } - } - return camelCaseWord.length; -} -function _matchesCamelCase(word, camelCaseWord, i, j) { - if (i === word.length) { - return []; - } - else if (j === camelCaseWord.length) { - return null; - } - else if (word[i] !== camelCaseWord[j].toLowerCase()) { - return null; - } - else { - let result = null; - let nextUpperIndex = j + 1; - result = _matchesCamelCase(word, camelCaseWord, i + 1, j + 1); - while (!result && (nextUpperIndex = nextAnchor(camelCaseWord, nextUpperIndex)) < camelCaseWord.length) { - result = _matchesCamelCase(word, camelCaseWord, i + 1, nextUpperIndex); - nextUpperIndex++; - } - return result === null ? null : join({ start: j, end: j + 1 }, result); - } -} -// Heuristic to avoid computing camel case matcher for words that don't -// look like camelCaseWords. -function analyzeCamelCaseWord(word) { - let upper = 0, lower = 0, alpha = 0, numeric = 0, code = 0; - for (let i = 0; i < word.length; i++) { - code = word.charCodeAt(i); - if (isUpper(code)) { - upper++; - } - if (isLower(code)) { - lower++; - } - if (isAlphanumeric(code)) { - alpha++; - } - if (isNumber(code)) { - numeric++; - } - } - const upperPercent = upper / word.length; - const lowerPercent = lower / word.length; - const alphaPercent = alpha / word.length; - const numericPercent = numeric / word.length; - return { upperPercent, lowerPercent, alphaPercent, numericPercent }; -} -function isUpperCaseWord(analysis) { - const { upperPercent, lowerPercent } = analysis; - return lowerPercent === 0 && upperPercent > 0.6; -} -function isCamelCaseWord(analysis) { - const { upperPercent, lowerPercent, alphaPercent, numericPercent } = analysis; - return lowerPercent > 0.2 && upperPercent < 0.8 && alphaPercent > 0.6 && numericPercent < 0.2; -} -// Heuristic to avoid computing camel case matcher for words that don't -// look like camel case patterns. -function isCamelCasePattern(word) { - let upper = 0, lower = 0, code = 0, whitespace = 0; - for (let i = 0; i < word.length; i++) { - code = word.charCodeAt(i); - if (isUpper(code)) { - upper++; - } - if (isLower(code)) { - lower++; - } - if (isWhitespace(code)) { - whitespace++; - } - } - if ((upper === 0 || lower === 0) && whitespace === 0) { - return word.length <= 30; - } - else { - return upper <= 5; - } -} -function matchesCamelCase(word, camelCaseWord) { - if (!camelCaseWord) { - return null; - } - camelCaseWord = camelCaseWord.trim(); - if (camelCaseWord.length === 0) { - return null; - } - if (!isCamelCasePattern(word)) { - return null; - } - if (camelCaseWord.length > 60) { - return null; - } - const analysis = analyzeCamelCaseWord(camelCaseWord); - if (!isCamelCaseWord(analysis)) { - if (!isUpperCaseWord(analysis)) { - return null; - } - camelCaseWord = camelCaseWord.toLowerCase(); - } - let result = null; - let i = 0; - word = word.toLowerCase(); - while (i < camelCaseWord.length && (result = _matchesCamelCase(word, camelCaseWord, 0, i)) === null) { - i = nextAnchor(camelCaseWord, i + 1); - } - return result; -} -// Matches beginning of words supporting non-ASCII languages -// If `contiguous` is true then matches word with beginnings of the words in the target. E.g. "pul" will match "Git: Pull" -// Otherwise also matches sub string of the word with beginnings of the words in the target. E.g. "gp" or "g p" will match "Git: Pull" -// Useful in cases where the target is words (e.g. command labels) -function matchesWords(word, target, contiguous = false) { - if (!target || target.length === 0) { - return null; - } - let result = null; - let i = 0; - word = word.toLowerCase(); - target = target.toLowerCase(); - while (i < target.length && (result = _matchesWords(word, target, 0, i, contiguous)) === null) { - i = nextWord(target, i + 1); - } - return result; -} -function _matchesWords(word, target, i, j, contiguous) { - if (i === word.length) { - return []; - } - else if (j === target.length) { - return null; - } - else if (!charactersMatch(word.charCodeAt(i), target.charCodeAt(j))) { - return null; - } - else { - let result = null; - let nextWordIndex = j + 1; - result = _matchesWords(word, target, i + 1, j + 1, contiguous); - if (!contiguous) { - while (!result && (nextWordIndex = nextWord(target, nextWordIndex)) < target.length) { - result = _matchesWords(word, target, i + 1, nextWordIndex, contiguous); - nextWordIndex++; - } - } - return result === null ? null : join({ start: j, end: j + 1 }, result); - } -} -function nextWord(word, start) { - for (let i = start; i < word.length; i++) { - if (isWordSeparator(word.charCodeAt(i)) || - (i > 0 && isWordSeparator(word.charCodeAt(i - 1)))) { - return i; - } - } - return word.length; -} -// Fuzzy -const fuzzyContiguousFilter = or(matchesPrefix, matchesCamelCase, matchesContiguousSubString); -const fuzzySeparateFilter = or(matchesPrefix, matchesCamelCase, matchesSubString); -const fuzzyRegExpCache = new _map_js__WEBPACK_IMPORTED_MODULE_0__["LRUCache"](10000); // bounded to 10000 elements -function matchesFuzzy(word, wordToMatchAgainst, enableSeparateSubstringMatching = false) { - if (typeof word !== 'string' || typeof wordToMatchAgainst !== 'string') { - return null; // return early for invalid input - } - // Form RegExp for wildcard matches - let regexp = fuzzyRegExpCache.get(word); - if (!regexp) { - regexp = new RegExp(_strings_js__WEBPACK_IMPORTED_MODULE_1__["convertSimple2RegExpPattern"](word), 'i'); - fuzzyRegExpCache.set(word, regexp); - } - // RegExp Filter - const match = regexp.exec(wordToMatchAgainst); - if (match) { - return [{ start: match.index, end: match.index + match[0].length }]; - } - // Default Filter - return enableSeparateSubstringMatching ? fuzzySeparateFilter(word, wordToMatchAgainst) : fuzzyContiguousFilter(word, wordToMatchAgainst); -} -function anyScore(pattern, lowPattern, _patternPos, word, lowWord, _wordPos) { - const result = fuzzyScore(pattern, lowPattern, 0, word, lowWord, 0, true); - if (result) { - return result; - } - let matches = 0; - let score = 0; - let idx = _wordPos; - for (let patternPos = 0; patternPos < lowPattern.length && patternPos < _maxLen; ++patternPos) { - const wordPos = lowWord.indexOf(lowPattern.charAt(patternPos), idx); - if (wordPos >= 0) { - score += 1; - matches += Math.pow(2, wordPos); - idx = wordPos + 1; - } - else if (matches !== 0) { - // once we have started matching things - // we need to match the remaining pattern - // characters - break; - } - } - return [score, matches, _wordPos]; -} -//#region --- fuzzyScore --- -function createMatches(score) { - if (typeof score === 'undefined') { - return []; - } - const matches = score[1].toString(2); - const wordStart = score[2]; - const res = []; - for (let pos = wordStart; pos < _maxLen; pos++) { - if (matches[matches.length - (pos + 1)] === '1') { - const last = res[res.length - 1]; - if (last && last.end === pos) { - last.end = pos + 1; - } - else { - res.push({ start: pos, end: pos + 1 }); - } - } - } - return res; -} -const _maxLen = 128; -function initTable() { - const table = []; - const row = [0]; - for (let i = 1; i <= _maxLen; i++) { - row.push(-i); - } - for (let i = 0; i <= _maxLen; i++) { - const thisRow = row.slice(0); - thisRow[0] = -i; - table.push(thisRow); - } - return table; -} -const _table = initTable(); -const _scores = initTable(); -const _arrows = initTable(); -const _debug = false; -function printTable(table, pattern, patternLen, word, wordLen) { - function pad(s, n, pad = ' ') { - while (s.length < n) { - s = pad + s; - } - return s; - } - let ret = ` | |${word.split('').map(c => pad(c, 3)).join('|')}\n`; - for (let i = 0; i <= patternLen; i++) { - if (i === 0) { - ret += ' |'; - } - else { - ret += `${pattern[i - 1]}|`; - } - ret += table[i].slice(0, wordLen + 1).map(n => pad(n.toString(), 3)).join('|') + '\n'; - } - return ret; -} -function printTables(pattern, patternStart, word, wordStart) { - pattern = pattern.substr(patternStart); - word = word.substr(wordStart); - console.log(printTable(_table, pattern, pattern.length, word, word.length)); - console.log(printTable(_arrows, pattern, pattern.length, word, word.length)); - console.log(printTable(_scores, pattern, pattern.length, word, word.length)); -} -function isSeparatorAtPos(value, index) { - if (index < 0 || index >= value.length) { - return false; - } - const code = value.charCodeAt(index); - switch (code) { - case 95 /* Underline */: - case 45 /* Dash */: - case 46 /* Period */: - case 32 /* Space */: - case 47 /* Slash */: - case 92 /* Backslash */: - case 39 /* SingleQuote */: - case 34 /* DoubleQuote */: - case 58 /* Colon */: - case 36 /* DollarSign */: - return true; - default: - return false; - } -} -function isWhitespaceAtPos(value, index) { - if (index < 0 || index >= value.length) { - return false; - } - const code = value.charCodeAt(index); - switch (code) { - case 32 /* Space */: - case 9 /* Tab */: - return true; - default: - return false; - } -} -function isUpperCaseAtPos(pos, word, wordLow) { - return word[pos] !== wordLow[pos]; -} -function isPatternInWord(patternLow, patternPos, patternLen, wordLow, wordPos, wordLen) { - while (patternPos < patternLen && wordPos < wordLen) { - if (patternLow[patternPos] === wordLow[wordPos]) { - patternPos += 1; - } - wordPos += 1; - } - return patternPos === patternLen; // pattern must be exhausted -} -var FuzzyScore; -(function (FuzzyScore) { - /** - * No matches and value `-100` - */ - FuzzyScore.Default = Object.freeze([-100, 0, 0]); - function isDefault(score) { - return !score || (score[0] === -100 && score[1] === 0 && score[2] === 0); - } - FuzzyScore.isDefault = isDefault; -})(FuzzyScore || (FuzzyScore = {})); -function fuzzyScore(pattern, patternLow, patternStart, word, wordLow, wordStart, firstMatchCanBeWeak) { - const patternLen = pattern.length > _maxLen ? _maxLen : pattern.length; - const wordLen = word.length > _maxLen ? _maxLen : word.length; - if (patternStart >= patternLen || wordStart >= wordLen || (patternLen - patternStart) > (wordLen - wordStart)) { - return undefined; - } - // Run a simple check if the characters of pattern occur - // (in order) at all in word. If that isn't the case we - // stop because no match will be possible - if (!isPatternInWord(patternLow, patternStart, patternLen, wordLow, wordStart, wordLen)) { - return undefined; - } - let row = 1; - let column = 1; - let patternPos = patternStart; - let wordPos = wordStart; - let hasStrongFirstMatch = false; - // There will be a match, fill in tables - for (row = 1, patternPos = patternStart; patternPos < patternLen; row++, patternPos++) { - for (column = 1, wordPos = wordStart; wordPos < wordLen; column++, wordPos++) { - const score = _doScore(pattern, patternLow, patternPos, patternStart, word, wordLow, wordPos); - if (patternPos === patternStart && score > 1) { - hasStrongFirstMatch = true; - } - _scores[row][column] = score; - const diag = _table[row - 1][column - 1] + (score > 1 ? 1 : score); - const top = _table[row - 1][column] + -1; - const left = _table[row][column - 1] + -1; - if (left >= top) { - // left or diag - if (left > diag) { - _table[row][column] = left; - _arrows[row][column] = 4 /* Left */; - } - else if (left === diag) { - _table[row][column] = left; - _arrows[row][column] = 4 /* Left */ | 2 /* Diag */; - } - else { - _table[row][column] = diag; - _arrows[row][column] = 2 /* Diag */; - } - } - else { - // top or diag - if (top > diag) { - _table[row][column] = top; - _arrows[row][column] = 1 /* Top */; - } - else if (top === diag) { - _table[row][column] = top; - _arrows[row][column] = 1 /* Top */ | 2 /* Diag */; - } - else { - _table[row][column] = diag; - _arrows[row][column] = 2 /* Diag */; - } - } - } - } - if (_debug) { - printTables(pattern, patternStart, word, wordStart); - } - if (!hasStrongFirstMatch && !firstMatchCanBeWeak) { - return undefined; - } - _matchesCount = 0; - _topScore = -100; - _wordStart = wordStart; - _firstMatchCanBeWeak = firstMatchCanBeWeak; - _findAllMatches2(row - 1, column - 1, patternLen === wordLen ? 1 : 0, 0, false); - if (_matchesCount === 0) { - return undefined; - } - return [_topScore, _topMatch2, wordStart]; -} -function _doScore(pattern, patternLow, patternPos, patternStart, word, wordLow, wordPos) { - if (patternLow[patternPos] !== wordLow[wordPos]) { - return -1; - } - if (wordPos === (patternPos - patternStart)) { - // common prefix: `foobar <-> foobaz` - // ^^^^^ - if (pattern[patternPos] === word[wordPos]) { - return 7; - } - else { - return 5; - } - } - else if (isUpperCaseAtPos(wordPos, word, wordLow) && (wordPos === 0 || !isUpperCaseAtPos(wordPos - 1, word, wordLow))) { - // hitting upper-case: `foo <-> forOthers` - // ^^ ^ - if (pattern[patternPos] === word[wordPos]) { - return 7; - } - else { - return 5; - } - } - else if (isSeparatorAtPos(wordLow, wordPos) && (wordPos === 0 || !isSeparatorAtPos(wordLow, wordPos - 1))) { - // hitting a separator: `. <-> foo.bar` - // ^ - return 5; - } - else if (isSeparatorAtPos(wordLow, wordPos - 1) || isWhitespaceAtPos(wordLow, wordPos - 1)) { - // post separator: `foo <-> bar_foo` - // ^^^ - return 5; - } - else { - return 1; - } -} -let _matchesCount = 0; -let _topMatch2 = 0; -let _topScore = 0; -let _wordStart = 0; -let _firstMatchCanBeWeak = false; -function _findAllMatches2(row, column, total, matches, lastMatched) { - if (_matchesCount >= 10 || total < -25) { - // stop when having already 10 results, or - // when a potential alignment as already 5 gaps - return; - } - let simpleMatchCount = 0; - while (row > 0 && column > 0) { - const score = _scores[row][column]; - const arrow = _arrows[row][column]; - if (arrow === 4 /* Left */) { - // left -> no match, skip a word character - column -= 1; - if (lastMatched) { - total -= 5; // new gap penalty - } - else if (matches !== 0) { - total -= 1; // gap penalty after first match - } - lastMatched = false; - simpleMatchCount = 0; - } - else if (arrow & 2 /* Diag */) { - if (arrow & 4 /* Left */) { - // left - _findAllMatches2(row, column - 1, matches !== 0 ? total - 1 : total, // gap penalty after first match - matches, lastMatched); - } - // diag - total += score; - row -= 1; - column -= 1; - lastMatched = true; - // match -> set a 1 at the word pos - matches += Math.pow(2, (column + _wordStart)); - // count simple matches and boost a row of - // simple matches when they yield in a - // strong match. - if (score === 1) { - simpleMatchCount += 1; - if (row === 0 && !_firstMatchCanBeWeak) { - // when the first match is a weak - // match we discard it - return undefined; - } - } - else { - // boost - total += 1 + (simpleMatchCount * (score - 1)); - simpleMatchCount = 0; - } - } - else { - return undefined; - } - } - total -= column >= 3 ? 9 : column * 3; // late start penalty - // dynamically keep track of the current top score - // and insert the current best score at head, the rest at tail - _matchesCount += 1; - if (total > _topScore) { - _topScore = total; - _topMatch2 = matches; - } -} -//#endregion -//#region --- graceful --- -function fuzzyScoreGracefulAggressive(pattern, lowPattern, patternPos, word, lowWord, wordPos, firstMatchCanBeWeak) { - return fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, true, firstMatchCanBeWeak); -} -function fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, aggressive, firstMatchCanBeWeak) { - let top = fuzzyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos, firstMatchCanBeWeak); - if (top && !aggressive) { - // when using the original pattern yield a result we` - // return it unless we are aggressive and try to find - // a better alignment, e.g. `cno` -> `^co^ns^ole` or `^c^o^nsole`. - return top; - } - if (pattern.length >= 3) { - // When the pattern is long enough then try a few (max 7) - // permutations of the pattern to find a better match. The - // permutations only swap neighbouring characters, e.g - // `cnoso` becomes `conso`, `cnsoo`, `cnoos`. - const tries = Math.min(7, pattern.length - 1); - for (let movingPatternPos = patternPos + 1; movingPatternPos < tries; movingPatternPos++) { - const newPattern = nextTypoPermutation(pattern, movingPatternPos); - if (newPattern) { - const candidate = fuzzyScore(newPattern, newPattern.toLowerCase(), patternPos, word, lowWord, wordPos, firstMatchCanBeWeak); - if (candidate) { - candidate[0] -= 3; // permutation penalty - if (!top || candidate[0] > top[0]) { - top = candidate; - } - } - } - } - } - return top; -} -function nextTypoPermutation(pattern, patternPos) { - if (patternPos + 1 >= pattern.length) { - return undefined; - } - const swap1 = pattern[patternPos]; - const swap2 = pattern[patternPos + 1]; - if (swap1 === swap2) { - return undefined; - } - return pattern.slice(0, patternPos) - + swap2 - + swap1 - + pattern.slice(patternPos + 2); -} -//#endregion - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/functional.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/functional.js ***! - \*********************************************************************/ -/*! exports provided: once */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return once; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function once(fn) { - const _this = this; - let didCall = false; - let result; - return function () { - if (didCall) { - return result; - } - didCall = true; - result = fn.apply(_this, arguments); - return result; - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/fuzzyScorer.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/fuzzyScorer.js ***! - \**********************************************************************/ -/*! exports provided: scoreFuzzy2, prepareQuery, pieceToQuery */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scoreFuzzy2", function() { return scoreFuzzy2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareQuery", function() { return prepareQuery; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pieceToQuery", function() { return pieceToQuery; }); -/* harmony import */ var _filters_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filters.js */ "./node_modules/monaco-editor/esm/vs/base/common/filters.js"); -/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./path.js */ "./node_modules/monaco-editor/esm/vs/base/common/path.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); - - - - -const NO_SCORE2 = [undefined, []]; -function scoreFuzzy2(target, query, patternStart = 0, wordStart = 0) { - // Score: multiple inputs - const preparedQuery = query; - if (preparedQuery.values && preparedQuery.values.length > 1) { - return doScoreFuzzy2Multiple(target, preparedQuery.values, patternStart, wordStart); - } - // Score: single input - return doScoreFuzzy2Single(target, query, patternStart, wordStart); -} -function doScoreFuzzy2Multiple(target, query, patternStart, wordStart) { - let totalScore = 0; - const totalMatches = []; - for (const queryPiece of query) { - const [score, matches] = doScoreFuzzy2Single(target, queryPiece, patternStart, wordStart); - if (typeof score !== 'number') { - // if a single query value does not match, return with - // no score entirely, we require all queries to match - return NO_SCORE2; - } - totalScore += score; - totalMatches.push(...matches); - } - // if we have a score, ensure that the positions are - // sorted in ascending order and distinct - return [totalScore, normalizeMatches(totalMatches)]; -} -function doScoreFuzzy2Single(target, query, patternStart, wordStart) { - const score = Object(_filters_js__WEBPACK_IMPORTED_MODULE_0__["fuzzyScore"])(query.original, query.originalLowercase, patternStart, target, target.toLowerCase(), wordStart, true); - if (!score) { - return NO_SCORE2; - } - return [score[0], Object(_filters_js__WEBPACK_IMPORTED_MODULE_0__["createMatches"])(score)]; -} -function normalizeMatches(matches) { - // sort matches by start to be able to normalize - const sortedMatches = matches.sort((matchA, matchB) => { - return matchA.start - matchB.start; - }); - // merge matches that overlap - const normalizedMatches = []; - let currentMatch = undefined; - for (const match of sortedMatches) { - // if we have no current match or the matches - // do not overlap, we take it as is and remember - // it for future merging - if (!currentMatch || !matchOverlaps(currentMatch, match)) { - currentMatch = match; - normalizedMatches.push(match); - } - // otherwise we merge the matches - else { - currentMatch.start = Math.min(currentMatch.start, match.start); - currentMatch.end = Math.max(currentMatch.end, match.end); - } - } - return normalizedMatches; -} -function matchOverlaps(matchA, matchB) { - if (matchA.end < matchB.start) { - return false; // A ends before B starts - } - if (matchB.end < matchA.start) { - return false; // B ends before A starts - } - return true; -} -/** - * Helper function to prepare a search value for scoring by removing unwanted characters - * and allowing to score on multiple pieces separated by whitespace character. - */ -const MULTIPLE_QUERY_VALUES_SEPARATOR = ' '; -function prepareQuery(original) { - if (typeof original !== 'string') { - original = ''; - } - const originalLowercase = original.toLowerCase(); - const { pathNormalized, normalized, normalizedLowercase } = normalizeQuery(original); - const containsPathSeparator = pathNormalized.indexOf(_path_js__WEBPACK_IMPORTED_MODULE_1__["sep"]) >= 0; - let values = undefined; - const originalSplit = original.split(MULTIPLE_QUERY_VALUES_SEPARATOR); - if (originalSplit.length > 1) { - for (const originalPiece of originalSplit) { - const { pathNormalized: pathNormalizedPiece, normalized: normalizedPiece, normalizedLowercase: normalizedLowercasePiece } = normalizeQuery(originalPiece); - if (normalizedPiece) { - if (!values) { - values = []; - } - values.push({ - original: originalPiece, - originalLowercase: originalPiece.toLowerCase(), - pathNormalized: pathNormalizedPiece, - normalized: normalizedPiece, - normalizedLowercase: normalizedLowercasePiece - }); - } - } - } - return { original, originalLowercase, pathNormalized, normalized, normalizedLowercase, values, containsPathSeparator }; -} -function normalizeQuery(original) { - let pathNormalized; - if (_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWindows"]) { - pathNormalized = original.replace(/\//g, _path_js__WEBPACK_IMPORTED_MODULE_1__["sep"]); // Help Windows users to search for paths when using slash - } - else { - pathNormalized = original.replace(/\\/g, _path_js__WEBPACK_IMPORTED_MODULE_1__["sep"]); // Help macOS/Linux users to search for paths when using backslash - } - const normalized = Object(_strings_js__WEBPACK_IMPORTED_MODULE_3__["stripWildcards"])(pathNormalized).replace(/\s/g, ''); - return { - pathNormalized, - normalized, - normalizedLowercase: normalized.toLowerCase() - }; -} -function pieceToQuery(arg1) { - if (Array.isArray(arg1)) { - return prepareQuery(arg1.map(piece => piece.original).join(MULTIPLE_QUERY_VALUES_SEPARATOR)); - } - return prepareQuery(arg1.original); -} -//#endregion - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/glob.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/glob.js ***! - \***************************************************************/ -/*! exports provided: splitGlobAware, match, parse, isRelativePattern */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitGlobAware", function() { return splitGlobAware; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "match", function() { return match; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRelativePattern", function() { return isRelativePattern; }); -/* harmony import */ var _arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _extpath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./extpath.js */ "./node_modules/monaco-editor/esm/vs/base/common/extpath.js"); -/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./path.js */ "./node_modules/monaco-editor/esm/vs/base/common/path.js"); -/* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./map.js */ "./node_modules/monaco-editor/esm/vs/base/common/map.js"); -/* harmony import */ var _async_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -const GLOBSTAR = '**'; -const GLOB_SPLIT = '/'; -const PATH_REGEX = '[/\\\\]'; // any slash or backslash -const NO_PATH_REGEX = '[^/\\\\]'; // any non-slash and non-backslash -const ALL_FORWARD_SLASHES = /\//g; -function starsToRegExp(starCount) { - switch (starCount) { - case 0: - return ''; - case 1: - return `${NO_PATH_REGEX}*?`; // 1 star matches any number of characters except path separator (/ and \) - non greedy (?) - default: - // Matches: (Path Sep OR Path Val followed by Path Sep OR Path Sep followed by Path Val) 0-many times - // Group is non capturing because we don't need to capture at all (?:...) - // Overall we use non-greedy matching because it could be that we match too much - return `(?:${PATH_REGEX}|${NO_PATH_REGEX}+${PATH_REGEX}|${PATH_REGEX}${NO_PATH_REGEX}+)*?`; - } -} -function splitGlobAware(pattern, splitChar) { - if (!pattern) { - return []; - } - const segments = []; - let inBraces = false; - let inBrackets = false; - let curVal = ''; - for (const char of pattern) { - switch (char) { - case splitChar: - if (!inBraces && !inBrackets) { - segments.push(curVal); - curVal = ''; - continue; - } - break; - case '{': - inBraces = true; - break; - case '}': - inBraces = false; - break; - case '[': - inBrackets = true; - break; - case ']': - inBrackets = false; - break; - } - curVal += char; - } - // Tail - if (curVal) { - segments.push(curVal); - } - return segments; -} -function parseRegExp(pattern) { - if (!pattern) { - return ''; - } - let regEx = ''; - // Split up into segments for each slash found - const segments = splitGlobAware(pattern, GLOB_SPLIT); - // Special case where we only have globstars - if (segments.every(s => s === GLOBSTAR)) { - regEx = '.*'; - } - // Build regex over segments - else { - let previousSegmentWasGlobStar = false; - segments.forEach((segment, index) => { - // Globstar is special - if (segment === GLOBSTAR) { - // if we have more than one globstar after another, just ignore it - if (!previousSegmentWasGlobStar) { - regEx += starsToRegExp(2); - previousSegmentWasGlobStar = true; - } - return; - } - // States - let inBraces = false; - let braceVal = ''; - let inBrackets = false; - let bracketVal = ''; - for (const char of segment) { - // Support brace expansion - if (char !== '}' && inBraces) { - braceVal += char; - continue; - } - // Support brackets - if (inBrackets && (char !== ']' || !bracketVal) /* ] is literally only allowed as first character in brackets to match it */) { - let res; - // range operator - if (char === '-') { - res = char; - } - // negation operator (only valid on first index in bracket) - else if ((char === '^' || char === '!') && !bracketVal) { - res = '^'; - } - // glob split matching is not allowed within character ranges - // see http://man7.org/linux/man-pages/man7/glob.7.html - else if (char === GLOB_SPLIT) { - res = ''; - } - // anything else gets escaped - else { - res = _strings_js__WEBPACK_IMPORTED_MODULE_1__["escapeRegExpCharacters"](char); - } - bracketVal += res; - continue; - } - switch (char) { - case '{': - inBraces = true; - continue; - case '[': - inBrackets = true; - continue; - case '}': - const choices = splitGlobAware(braceVal, ','); - // Converts {foo,bar} => [foo|bar] - const braceRegExp = `(?:${choices.map(c => parseRegExp(c)).join('|')})`; - regEx += braceRegExp; - inBraces = false; - braceVal = ''; - break; - case ']': - regEx += ('[' + bracketVal + ']'); - inBrackets = false; - bracketVal = ''; - break; - case '?': - regEx += NO_PATH_REGEX; // 1 ? matches any single character except path separator (/ and \) - continue; - case '*': - regEx += starsToRegExp(1); - continue; - default: - regEx += _strings_js__WEBPACK_IMPORTED_MODULE_1__["escapeRegExpCharacters"](char); - } - } - // Tail: Add the slash we had split on if there is more to come and the remaining pattern is not a globstar - // For example if pattern: some/**/*.js we want the "/" after some to be included in the RegEx to prevent - // a folder called "something" to match as well. - // However, if pattern: some/**, we tolerate that we also match on "something" because our globstar behaviour - // is to match 0-N segments. - if (index < segments.length - 1 && (segments[index + 1] !== GLOBSTAR || index + 2 < segments.length)) { - regEx += PATH_REGEX; - } - // reset state - previousSegmentWasGlobStar = false; - }); - } - return regEx; -} -// regexes to check for trival glob patterns that just check for String#endsWith -const T1 = /^\*\*\/\*\.[\w\.-]+$/; // **/*.something -const T2 = /^\*\*\/([\w\.-]+)\/?$/; // **/something -const T3 = /^{\*\*\/[\*\.]?[\w\.-]+\/?(,\*\*\/[\*\.]?[\w\.-]+\/?)*}$/; // {**/*.something,**/*.else} or {**/package.json,**/project.json} -const T3_2 = /^{\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?(,\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?)*}$/; // Like T3, with optional trailing /** -const T4 = /^\*\*((\/[\w\.-]+)+)\/?$/; // **/something/else -const T5 = /^([\w\.-]+(\/[\w\.-]+)*)\/?$/; // something/else -const CACHE = new _map_js__WEBPACK_IMPORTED_MODULE_4__["LRUCache"](10000); // bounded to 10000 elements -const FALSE = function () { - return false; -}; -const NULL = function () { - return null; -}; -function parsePattern(arg1, options) { - if (!arg1) { - return NULL; - } - // Handle IRelativePattern - let pattern; - if (typeof arg1 !== 'string') { - pattern = arg1.pattern; - } - else { - pattern = arg1; - } - // Whitespace trimming - pattern = pattern.trim(); - // Check cache - const patternKey = `${pattern}_${!!options.trimForExclusions}`; - let parsedPattern = CACHE.get(patternKey); - if (parsedPattern) { - return wrapRelativePattern(parsedPattern, arg1); - } - // Check for Trivias - let match; - if (T1.test(pattern)) { // common pattern: **/*.txt just need endsWith check - const base = pattern.substr(4); // '**/*'.length === 4 - parsedPattern = function (path, basename) { - return typeof path === 'string' && path.endsWith(base) ? pattern : null; - }; - } - else if (match = T2.exec(trimForExclusions(pattern, options))) { // common pattern: **/some.txt just need basename check - parsedPattern = trivia2(match[1], pattern); - } - else if ((options.trimForExclusions ? T3_2 : T3).test(pattern)) { // repetition of common patterns (see above) {**/*.txt,**/*.png} - parsedPattern = trivia3(pattern, options); - } - else if (match = T4.exec(trimForExclusions(pattern, options))) { // common pattern: **/something/else just need endsWith check - parsedPattern = trivia4and5(match[1].substr(1), pattern, true); - } - else if (match = T5.exec(trimForExclusions(pattern, options))) { // common pattern: something/else just need equals check - parsedPattern = trivia4and5(match[1], pattern, false); - } - // Otherwise convert to pattern - else { - parsedPattern = toRegExp(pattern); - } - // Cache - CACHE.set(patternKey, parsedPattern); - return wrapRelativePattern(parsedPattern, arg1); -} -function wrapRelativePattern(parsedPattern, arg2) { - if (typeof arg2 === 'string') { - return parsedPattern; - } - return function (path, basename) { - if (!_extpath_js__WEBPACK_IMPORTED_MODULE_2__["isEqualOrParent"](path, arg2.base)) { - return null; - } - return parsedPattern(_path_js__WEBPACK_IMPORTED_MODULE_3__["relative"](arg2.base, path), basename); - }; -} -function trimForExclusions(pattern, options) { - return options.trimForExclusions && pattern.endsWith('/**') ? pattern.substr(0, pattern.length - 2) : pattern; // dropping **, tailing / is dropped later -} -// common pattern: **/some.txt just need basename check -function trivia2(base, originalPattern) { - const slashBase = `/${base}`; - const backslashBase = `\\${base}`; - const parsedPattern = function (path, basename) { - if (typeof path !== 'string') { - return null; - } - if (basename) { - return basename === base ? originalPattern : null; - } - return path === base || path.endsWith(slashBase) || path.endsWith(backslashBase) ? originalPattern : null; - }; - const basenames = [base]; - parsedPattern.basenames = basenames; - parsedPattern.patterns = [originalPattern]; - parsedPattern.allBasenames = basenames; - return parsedPattern; -} -// repetition of common patterns (see above) {**/*.txt,**/*.png} -function trivia3(pattern, options) { - const parsedPatterns = aggregateBasenameMatches(pattern.slice(1, -1).split(',') - .map(pattern => parsePattern(pattern, options)) - .filter(pattern => pattern !== NULL), pattern); - const n = parsedPatterns.length; - if (!n) { - return NULL; - } - if (n === 1) { - return parsedPatterns[0]; - } - const parsedPattern = function (path, basename) { - for (let i = 0, n = parsedPatterns.length; i < n; i++) { - if (parsedPatterns[i](path, basename)) { - return pattern; - } - } - return null; - }; - const withBasenames = _arrays_js__WEBPACK_IMPORTED_MODULE_0__["first"](parsedPatterns, pattern => !!pattern.allBasenames); - if (withBasenames) { - parsedPattern.allBasenames = withBasenames.allBasenames; - } - const allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, []); - if (allPaths.length) { - parsedPattern.allPaths = allPaths; - } - return parsedPattern; -} -// common patterns: **/something/else just need endsWith check, something/else just needs and equals check -function trivia4and5(path, pattern, matchPathEnds) { - const nativePath = _path_js__WEBPACK_IMPORTED_MODULE_3__["sep"] !== _path_js__WEBPACK_IMPORTED_MODULE_3__["posix"].sep ? path.replace(ALL_FORWARD_SLASHES, _path_js__WEBPACK_IMPORTED_MODULE_3__["sep"]) : path; - const nativePathEnd = _path_js__WEBPACK_IMPORTED_MODULE_3__["sep"] + nativePath; - const parsedPattern = matchPathEnds ? function (path, basename) { - return typeof path === 'string' && (path === nativePath || path.endsWith(nativePathEnd)) ? pattern : null; - } : function (path, basename) { - return typeof path === 'string' && path === nativePath ? pattern : null; - }; - parsedPattern.allPaths = [(matchPathEnds ? '*/' : './') + path]; - return parsedPattern; -} -function toRegExp(pattern) { - try { - const regExp = new RegExp(`^${parseRegExp(pattern)}$`); - return function (path) { - regExp.lastIndex = 0; // reset RegExp to its initial state to reuse it! - return typeof path === 'string' && regExp.test(path) ? pattern : null; - }; - } - catch (error) { - return NULL; - } -} -function match(arg1, path, hasSibling) { - if (!arg1 || typeof path !== 'string') { - return false; - } - return parse(arg1)(path, undefined, hasSibling); -} -function parse(arg1, options = {}) { - if (!arg1) { - return FALSE; - } - // Glob with String - if (typeof arg1 === 'string' || isRelativePattern(arg1)) { - const parsedPattern = parsePattern(arg1, options); - if (parsedPattern === NULL) { - return FALSE; - } - const resultPattern = function (path, basename) { - return !!parsedPattern(path, basename); - }; - if (parsedPattern.allBasenames) { - resultPattern.allBasenames = parsedPattern.allBasenames; - } - if (parsedPattern.allPaths) { - resultPattern.allPaths = parsedPattern.allPaths; - } - return resultPattern; - } - // Glob with Expression - return parsedExpression(arg1, options); -} -function isRelativePattern(obj) { - const rp = obj; - return rp && typeof rp.base === 'string' && typeof rp.pattern === 'string'; -} -function parsedExpression(expression, options) { - const parsedPatterns = aggregateBasenameMatches(Object.getOwnPropertyNames(expression) - .map(pattern => parseExpressionPattern(pattern, expression[pattern], options)) - .filter(pattern => pattern !== NULL)); - const n = parsedPatterns.length; - if (!n) { - return NULL; - } - if (!parsedPatterns.some(parsedPattern => !!parsedPattern.requiresSiblings)) { - if (n === 1) { - return parsedPatterns[0]; - } - const resultExpression = function (path, basename) { - for (let i = 0, n = parsedPatterns.length; i < n; i++) { - // Pattern matches path - const result = parsedPatterns[i](path, basename); - if (result) { - return result; - } - } - return null; - }; - const withBasenames = _arrays_js__WEBPACK_IMPORTED_MODULE_0__["first"](parsedPatterns, pattern => !!pattern.allBasenames); - if (withBasenames) { - resultExpression.allBasenames = withBasenames.allBasenames; - } - const allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, []); - if (allPaths.length) { - resultExpression.allPaths = allPaths; - } - return resultExpression; - } - const resultExpression = function (path, basename, hasSibling) { - let name = undefined; - for (let i = 0, n = parsedPatterns.length; i < n; i++) { - // Pattern matches path - const parsedPattern = parsedPatterns[i]; - if (parsedPattern.requiresSiblings && hasSibling) { - if (!basename) { - basename = _path_js__WEBPACK_IMPORTED_MODULE_3__["basename"](path); - } - if (!name) { - name = basename.substr(0, basename.length - _path_js__WEBPACK_IMPORTED_MODULE_3__["extname"](path).length); - } - } - const result = parsedPattern(path, basename, name, hasSibling); - if (result) { - return result; - } - } - return null; - }; - const withBasenames = _arrays_js__WEBPACK_IMPORTED_MODULE_0__["first"](parsedPatterns, pattern => !!pattern.allBasenames); - if (withBasenames) { - resultExpression.allBasenames = withBasenames.allBasenames; - } - const allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, []); - if (allPaths.length) { - resultExpression.allPaths = allPaths; - } - return resultExpression; -} -function parseExpressionPattern(pattern, value, options) { - if (value === false) { - return NULL; // pattern is disabled - } - const parsedPattern = parsePattern(pattern, options); - if (parsedPattern === NULL) { - return NULL; - } - // Expression Pattern is - if (typeof value === 'boolean') { - return parsedPattern; - } - // Expression Pattern is - if (value) { - const when = value.when; - if (typeof when === 'string') { - const result = (path, basename, name, hasSibling) => { - if (!hasSibling || !parsedPattern(path, basename)) { - return null; - } - const clausePattern = when.replace('$(basename)', name); - const matched = hasSibling(clausePattern); - return Object(_async_js__WEBPACK_IMPORTED_MODULE_5__["isThenable"])(matched) ? - matched.then(m => m ? pattern : null) : - matched ? pattern : null; - }; - result.requiresSiblings = true; - return result; - } - } - // Expression is Anything - return parsedPattern; -} -function aggregateBasenameMatches(parsedPatterns, result) { - const basenamePatterns = parsedPatterns.filter(parsedPattern => !!parsedPattern.basenames); - if (basenamePatterns.length < 2) { - return parsedPatterns; - } - const basenames = basenamePatterns.reduce((all, current) => { - const basenames = current.basenames; - return basenames ? all.concat(basenames) : all; - }, []); - let patterns; - if (result) { - patterns = []; - for (let i = 0, n = basenames.length; i < n; i++) { - patterns.push(result); - } - } - else { - patterns = basenamePatterns.reduce((all, current) => { - const patterns = current.patterns; - return patterns ? all.concat(patterns) : all; - }, []); - } - const aggregate = function (path, basename) { - if (typeof path !== 'string') { - return null; - } - if (!basename) { - let i; - for (i = path.length; i > 0; i--) { - const ch = path.charCodeAt(i - 1); - if (ch === 47 /* Slash */ || ch === 92 /* Backslash */) { - break; - } - } - basename = path.substr(i); - } - const index = basenames.indexOf(basename); - return index !== -1 ? patterns[index] : null; - }; - aggregate.basenames = basenames; - aggregate.patterns = patterns; - aggregate.allBasenames = basenames; - const aggregatedPatterns = parsedPatterns.filter(parsedPattern => !parsedPattern.basenames); - aggregatedPatterns.push(aggregate); - return aggregatedPatterns; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/hash.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/hash.js ***! - \***************************************************************/ -/*! exports provided: hash, doHash, stringHash, StringSHA1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hash", function() { return hash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doHash", function() { return doHash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringHash", function() { return stringHash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringSHA1", function() { return StringSHA1; }); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * Return a hash value for an object. - */ -function hash(obj) { - return doHash(obj, 0); -} -function doHash(obj, hashVal) { - switch (typeof obj) { - case 'object': - if (obj === null) { - return numberHash(349, hashVal); - } - else if (Array.isArray(obj)) { - return arrayHash(obj, hashVal); - } - return objectHash(obj, hashVal); - case 'string': - return stringHash(obj, hashVal); - case 'boolean': - return booleanHash(obj, hashVal); - case 'number': - return numberHash(obj, hashVal); - case 'undefined': - return numberHash(937, hashVal); - default: - return numberHash(617, hashVal); - } -} -function numberHash(val, initialHashVal) { - return (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32 -} -function booleanHash(b, initialHashVal) { - return numberHash(b ? 433 : 863, initialHashVal); -} -function stringHash(s, hashVal) { - hashVal = numberHash(149417, hashVal); - for (let i = 0, length = s.length; i < length; i++) { - hashVal = numberHash(s.charCodeAt(i), hashVal); - } - return hashVal; -} -function arrayHash(arr, initialHashVal) { - initialHashVal = numberHash(104579, initialHashVal); - return arr.reduce((hashVal, item) => doHash(item, hashVal), initialHashVal); -} -function objectHash(obj, initialHashVal) { - initialHashVal = numberHash(181387, initialHashVal); - return Object.keys(obj).sort().reduce((hashVal, key) => { - hashVal = stringHash(key, hashVal); - return doHash(obj[key], hashVal); - }, initialHashVal); -} -function leftRotate(value, bits, totalBits = 32) { - // delta + bits = totalBits - const delta = totalBits - bits; - // All ones, expect `delta` zeros aligned to the right - const mask = ~((1 << delta) - 1); - // Join (value left-shifted `bits` bits) with (masked value right-shifted `delta` bits) - return ((value << bits) | ((mask & value) >>> delta)) >>> 0; -} -function fill(dest, index = 0, count = dest.byteLength, value = 0) { - for (let i = 0; i < count; i++) { - dest[index + i] = value; - } -} -function leftPad(value, length, char = '0') { - while (value.length < length) { - value = char + value; - } - return value; -} -function toHexString(value, bitsize = 32) { - return leftPad((value >>> 0).toString(16), bitsize / 4); -} -/** - * A SHA1 implementation that works with strings and does not allocate. - */ -class StringSHA1 { - constructor() { - this._h0 = 0x67452301; - this._h1 = 0xEFCDAB89; - this._h2 = 0x98BADCFE; - this._h3 = 0x10325476; - this._h4 = 0xC3D2E1F0; - this._buff = new Uint8Array(64 /* BLOCK_SIZE */ + 3 /* to fit any utf-8 */); - this._buffDV = new DataView(this._buff.buffer); - this._buffLen = 0; - this._totalLen = 0; - this._leftoverHighSurrogate = 0; - this._finished = false; - } - update(str) { - const strLen = str.length; - if (strLen === 0) { - return; - } - const buff = this._buff; - let buffLen = this._buffLen; - let leftoverHighSurrogate = this._leftoverHighSurrogate; - let charCode; - let offset; - if (leftoverHighSurrogate !== 0) { - charCode = leftoverHighSurrogate; - offset = -1; - leftoverHighSurrogate = 0; - } - else { - charCode = str.charCodeAt(0); - offset = 0; - } - while (true) { - let codePoint = charCode; - if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["isHighSurrogate"](charCode)) { - if (offset + 1 < strLen) { - const nextCharCode = str.charCodeAt(offset + 1); - if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["isLowSurrogate"](nextCharCode)) { - offset++; - codePoint = _strings_js__WEBPACK_IMPORTED_MODULE_0__["computeCodePoint"](charCode, nextCharCode); - } - else { - // illegal => unicode replacement character - codePoint = 65533 /* UNICODE_REPLACEMENT */; - } - } - else { - // last character is a surrogate pair - leftoverHighSurrogate = charCode; - break; - } - } - else if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["isLowSurrogate"](charCode)) { - // illegal => unicode replacement character - codePoint = 65533 /* UNICODE_REPLACEMENT */; - } - buffLen = this._push(buff, buffLen, codePoint); - offset++; - if (offset < strLen) { - charCode = str.charCodeAt(offset); - } - else { - break; - } - } - this._buffLen = buffLen; - this._leftoverHighSurrogate = leftoverHighSurrogate; - } - _push(buff, buffLen, codePoint) { - if (codePoint < 0x0080) { - buff[buffLen++] = codePoint; - } - else if (codePoint < 0x0800) { - buff[buffLen++] = 0b11000000 | ((codePoint & 0b00000000000000000000011111000000) >>> 6); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0); - } - else if (codePoint < 0x10000) { - buff[buffLen++] = 0b11100000 | ((codePoint & 0b00000000000000001111000000000000) >>> 12); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0); - } - else { - buff[buffLen++] = 0b11110000 | ((codePoint & 0b00000000000111000000000000000000) >>> 18); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000111111000000000000) >>> 12); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0); - } - if (buffLen >= 64 /* BLOCK_SIZE */) { - this._step(); - buffLen -= 64 /* BLOCK_SIZE */; - this._totalLen += 64 /* BLOCK_SIZE */; - // take last 3 in case of UTF8 overflow - buff[0] = buff[64 /* BLOCK_SIZE */ + 0]; - buff[1] = buff[64 /* BLOCK_SIZE */ + 1]; - buff[2] = buff[64 /* BLOCK_SIZE */ + 2]; - } - return buffLen; - } - digest() { - if (!this._finished) { - this._finished = true; - if (this._leftoverHighSurrogate) { - // illegal => unicode replacement character - this._leftoverHighSurrogate = 0; - this._buffLen = this._push(this._buff, this._buffLen, 65533 /* UNICODE_REPLACEMENT */); - } - this._totalLen += this._buffLen; - this._wrapUp(); - } - return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4); - } - _wrapUp() { - this._buff[this._buffLen++] = 0x80; - fill(this._buff, this._buffLen); - if (this._buffLen > 56) { - this._step(); - fill(this._buff); - } - // this will fit because the mantissa can cover up to 52 bits - const ml = 8 * this._totalLen; - this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false); - this._buffDV.setUint32(60, ml % 4294967296, false); - this._step(); - } - _step() { - const bigBlock32 = StringSHA1._bigBlock32; - const data = this._buffDV; - for (let j = 0; j < 64 /* 16*4 */; j += 4) { - bigBlock32.setUint32(j, data.getUint32(j, false), false); - } - for (let j = 64; j < 320 /* 80*4 */; j += 4) { - bigBlock32.setUint32(j, leftRotate((bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false)), 1), false); - } - let a = this._h0; - let b = this._h1; - let c = this._h2; - let d = this._h3; - let e = this._h4; - let f, k; - let temp; - for (let j = 0; j < 80; j++) { - if (j < 20) { - f = (b & c) | ((~b) & d); - k = 0x5A827999; - } - else if (j < 40) { - f = b ^ c ^ d; - k = 0x6ED9EBA1; - } - else if (j < 60) { - f = (b & c) | (b & d) | (c & d); - k = 0x8F1BBCDC; - } - else { - f = b ^ c ^ d; - k = 0xCA62C1D6; - } - temp = (leftRotate(a, 5) + f + e + k + bigBlock32.getUint32(j * 4, false)) & 0xffffffff; - e = d; - d = c; - c = leftRotate(b, 30); - b = a; - a = temp; - } - this._h0 = (this._h0 + a) & 0xffffffff; - this._h1 = (this._h1 + b) & 0xffffffff; - this._h2 = (this._h2 + c) & 0xffffffff; - this._h3 = (this._h3 + d) & 0xffffffff; - this._h4 = (this._h4 + e) & 0xffffffff; - } -} -StringSHA1._bigBlock32 = new DataView(new ArrayBuffer(320)); // 80 * 4 = 320 - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/history.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/history.js ***! - \******************************************************************/ -/*! exports provided: HistoryNavigator */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HistoryNavigator", function() { return HistoryNavigator; }); -/* harmony import */ var _navigator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./navigator.js */ "./node_modules/monaco-editor/esm/vs/base/common/navigator.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class HistoryNavigator { - constructor(history = [], limit = 10) { - this._initialize(history); - this._limit = limit; - this._onChange(); - } - add(t) { - this._history.delete(t); - this._history.add(t); - this._onChange(); - } - next() { - if (this._currentPosition() !== this._elements.length - 1) { - return this._navigator.next(); - } - return null; - } - previous() { - if (this._currentPosition() !== 0) { - return this._navigator.previous(); - } - return null; - } - current() { - return this._navigator.current(); - } - first() { - return this._navigator.first(); - } - last() { - return this._navigator.last(); - } - has(t) { - return this._history.has(t); - } - _onChange() { - this._reduceToLimit(); - const elements = this._elements; - this._navigator = new _navigator_js__WEBPACK_IMPORTED_MODULE_0__["ArrayNavigator"](elements, 0, elements.length, elements.length); - } - _reduceToLimit() { - const data = this._elements; - if (data.length > this._limit) { - this._initialize(data.slice(data.length - this._limit)); - } - } - _currentPosition() { - const currentElement = this._navigator.current(); - if (!currentElement) { - return -1; - } - return this._elements.indexOf(currentElement); - } - _initialize(history) { - this._history = new Set(); - for (const entry of history) { - this._history.add(entry); - } - } - get _elements() { - const elements = []; - this._history.forEach(e => elements.push(e)); - return elements; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/htmlContent.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/htmlContent.js ***! - \**********************************************************************/ -/*! exports provided: MarkdownString, isEmptyMarkdownString, isMarkdownString, markedStringsEquals, removeMarkdownEscapes, parseHrefAndDimensions */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkdownString", function() { return MarkdownString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmptyMarkdownString", function() { return isEmptyMarkdownString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMarkdownString", function() { return isMarkdownString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "markedStringsEquals", function() { return markedStringsEquals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeMarkdownEscapes", function() { return removeMarkdownEscapes; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseHrefAndDimensions", function() { return parseHrefAndDimensions; }); -/* harmony import */ var _arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _codicons_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class MarkdownString { - constructor(_value = '', isTrustedOrOptions = false) { - var _a, _b; - this._value = _value; - if (typeof this._value !== 'string') { - throw Object(_errors_js__WEBPACK_IMPORTED_MODULE_2__["illegalArgument"])('value'); - } - if (typeof isTrustedOrOptions === 'boolean') { - this._isTrusted = isTrustedOrOptions; - this._supportThemeIcons = false; - } - else { - this._isTrusted = (_a = isTrustedOrOptions.isTrusted) !== null && _a !== void 0 ? _a : false; - this._supportThemeIcons = (_b = isTrustedOrOptions.supportThemeIcons) !== null && _b !== void 0 ? _b : false; - } - } - get value() { return this._value; } - get isTrusted() { return this._isTrusted; } - get supportThemeIcons() { return this._supportThemeIcons; } - appendText(value) { - // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash - this._value += (this._supportThemeIcons ? Object(_codicons_js__WEBPACK_IMPORTED_MODULE_1__["escapeCodicons"])(value) : value) - .replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&') - .replace(/\n/g, '\n\n'); - return this; - } - appendMarkdown(value) { - this._value += value; - return this; - } - appendCodeblock(langId, code) { - this._value += '\n```'; - this._value += langId; - this._value += '\n'; - this._value += code; - this._value += '\n```\n'; - return this; - } -} -function isEmptyMarkdownString(oneOrMany) { - if (isMarkdownString(oneOrMany)) { - return !oneOrMany.value; - } - else if (Array.isArray(oneOrMany)) { - return oneOrMany.every(isEmptyMarkdownString); - } - else { - return true; - } -} -function isMarkdownString(thing) { - if (thing instanceof MarkdownString) { - return true; - } - else if (thing && typeof thing === 'object') { - return typeof thing.value === 'string' - && (typeof thing.isTrusted === 'boolean' || thing.isTrusted === undefined) - && (typeof thing.supportThemeIcons === 'boolean' || thing.supportThemeIcons === undefined); - } - return false; -} -function markedStringsEquals(a, b) { - if (!a && !b) { - return true; - } - else if (!a || !b) { - return false; - } - else if (Array.isArray(a) && Array.isArray(b)) { - return Object(_arrays_js__WEBPACK_IMPORTED_MODULE_0__["equals"])(a, b, markdownStringEqual); - } - else if (isMarkdownString(a) && isMarkdownString(b)) { - return markdownStringEqual(a, b); - } - else { - return false; - } -} -function markdownStringEqual(a, b) { - if (a === b) { - return true; - } - else if (!a || !b) { - return false; - } - else { - return a.value === b.value && a.isTrusted === b.isTrusted && a.supportThemeIcons === b.supportThemeIcons; - } -} -function removeMarkdownEscapes(text) { - if (!text) { - return text; - } - return text.replace(/\\([\\`*_{}[\]()#+\-.!])/g, '$1'); -} -function parseHrefAndDimensions(href) { - const dimensions = []; - const splitted = href.split('|').map(s => s.trim()); - href = splitted[0]; - const parameters = splitted[1]; - if (parameters) { - const heightFromParams = /height=(\d+)/.exec(parameters); - const widthFromParams = /width=(\d+)/.exec(parameters); - const height = heightFromParams ? heightFromParams[1] : ''; - const width = widthFromParams ? widthFromParams[1] : ''; - const widthIsFinite = isFinite(parseInt(width)); - const heightIsFinite = isFinite(parseInt(height)); - if (widthIsFinite) { - dimensions.push(`width="${width}"`); - } - if (heightIsFinite) { - dimensions.push(`height="${height}"`); - } - } - return { href, dimensions }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/idGenerator.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/idGenerator.js ***! - \**********************************************************************/ -/*! exports provided: IdGenerator, defaultGenerator */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IdGenerator", function() { return IdGenerator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultGenerator", function() { return defaultGenerator; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class IdGenerator { - constructor(prefix) { - this._prefix = prefix; - this._lastId = 0; - } - nextId() { - return this._prefix + (++this._lastId); - } -} -const defaultGenerator = new IdGenerator('id#'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/insane/insane.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/insane/insane.js ***! - \************************************************************************/ -/*! exports provided: insane */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insane", function() { return insane; }); -var require;var require;/* -The MIT License (MIT) - -Copyright © 2015 Nicolas Bevacqua - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -let __insane_func; - -(function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return require(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r) }, p, p.exports, r, e, n, t) } return n[i].exports } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++)o(t[i]); return o } return r })()({ - 1: [function (require, module, exports) { - 'use strict'; - - var toMap = require('./toMap'); - var uris = ['background', 'base', 'cite', 'href', 'longdesc', 'src', 'usemap']; - - module.exports = { - uris: toMap(uris) // attributes that have an href and hence need to be sanitized - }; - - }, { "./toMap": 10 }], 2: [function (require, module, exports) { - 'use strict'; - - var defaults = { - allowedAttributes: { - '*': ['title', 'accesskey'], - a: ['href', 'name', 'target', 'aria-label'], - iframe: ['allowfullscreen', 'frameborder', 'src'], - img: ['src', 'alt', 'title', 'aria-label'] - }, - allowedClasses: {}, - allowedSchemes: ['http', 'https', 'mailto'], - allowedTags: [ - 'a', 'abbr', 'article', 'b', 'blockquote', 'br', 'caption', 'code', 'del', 'details', 'div', 'em', - 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'ins', 'kbd', 'li', 'main', 'mark', - 'ol', 'p', 'pre', 'section', 'span', 'strike', 'strong', 'sub', 'summary', 'sup', 'table', - 'tbody', 'td', 'th', 'thead', 'tr', 'u', 'ul' - ], - filter: null - }; - - module.exports = defaults; - - }, {}], 3: [function (require, module, exports) { - 'use strict'; - - var toMap = require('./toMap'); - var voids = ['area', 'br', 'col', 'hr', 'img', 'wbr', 'input', 'base', 'basefont', 'link', 'meta']; - - module.exports = { - voids: toMap(voids) - }; - - }, { "./toMap": 10 }], 4: [function (require, module, exports) { - 'use strict'; - - var he = require('he'); - var assign = require('assignment'); - var parser = require('./parser'); - var sanitizer = require('./sanitizer'); - var defaults = require('./defaults'); - - function insane(html, options, strict) { - var buffer = []; - var configuration = strict === true ? options : assign({}, defaults, options); - var handler = sanitizer(buffer, configuration); - - parser(html, handler); - - return buffer.join(''); - } - - insane.defaults = defaults; - module.exports = insane; - __insane_func = insane; - - }, { "./defaults": 2, "./parser": 7, "./sanitizer": 8, "assignment": 6, "he": 9 }], 5: [function (require, module, exports) { - 'use strict'; - - module.exports = function lowercase(string) { - return typeof string === 'string' ? string.toLowerCase() : string; - }; - - }, {}], 6: [function (require, module, exports) { - 'use strict'; - - function assignment(result) { - var stack = Array.prototype.slice.call(arguments, 1); - var item; - var key; - while (stack.length) { - item = stack.shift(); - for (key in item) { - if (item.hasOwnProperty(key)) { - if (Object.prototype.toString.call(result[key]) === '[object Object]') { - result[key] = assignment(result[key], item[key]); - } else { - result[key] = item[key]; - } - } - } - } - return result; - } - - module.exports = assignment; - - }, {}], 7: [function (require, module, exports) { - 'use strict'; - - var he = require('he'); - var lowercase = require('./lowercase'); - var attributes = require('./attributes'); - var elements = require('./elements'); - var rstart = /^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/; - var rend = /^<\s*\/\s*([\w:-]+)[^>]*>/; - var rattrs = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g; - var rtag = /^'); - if (index >= 0) { - if (handler.comment) { - handler.comment(html.substring(4, index)); - } - html = html.substring(index + 3); - chars = false; - } - } - - function parseTagDecode() { - if (!chars) { - return; - } - var text; - var index = html.indexOf('<'); - if (index >= 0) { - text = html.substring(0, index); - html = html.substring(index); - } else { - text = html; - html = ''; - } - if (handler.chars) { - handler.chars(text); - } - } - - function parseStartTag(tag, tagName, rest, unary) { - var attrs = {}; - var low = lowercase(tagName); - var u = elements.voids[low] || !!unary; - - rest.replace(rattrs, attrReplacer); - - if (!u) { - stack.push(low); - } - if (handler.start) { - handler.start(low, attrs, u); - } - - function attrReplacer(match, name, doubleQuotedValue, singleQuotedValue, unquotedValue) { - if (doubleQuotedValue === void 0 && singleQuotedValue === void 0 && unquotedValue === void 0) { - attrs[name] = void 0; // attribute is like - } else { - attrs[name] = he.decode(doubleQuotedValue || singleQuotedValue || unquotedValue || ''); - } - } - } - - function parseEndTag(tag, tagName) { - var i; - var pos = 0; - var low = lowercase(tagName); - if (low) { - for (pos = stack.length - 1; pos >= 0; pos--) { - if (stack[pos] === low) { - break; // find the closest opened tag of the same type - } - } - } - if (pos >= 0) { - for (i = stack.length - 1; i >= pos; i--) { - if (handler.end) { // close all the open elements, up the stack - handler.end(stack[i]); - } - } - stack.length = pos; - } - } - } - - module.exports = parser; - - }, { "./attributes": 1, "./elements": 3, "./lowercase": 5, "he": 9 }], 8: [function (require, module, exports) { - 'use strict'; - - var he = require('he'); - var lowercase = require('./lowercase'); - var attributes = require('./attributes'); - var elements = require('./elements'); - - function sanitizer(buffer, options) { - var last; - var context; - var o = options || {}; - - reset(); - - return { - start: start, - end: end, - chars: chars - }; - - function out(value) { - buffer.push(value); - } - - function start(tag, attrs, unary) { - var low = lowercase(tag); - - if (context.ignoring) { - ignore(low); return; - } - if ((o.allowedTags || []).indexOf(low) === -1) { - ignore(low); return; - } - if (o.filter && !o.filter({ tag: low, attrs: attrs })) { - ignore(low); return; - } - - out('<'); - out(low); - Object.keys(attrs).forEach(parse); - out(unary ? '/>' : '>'); - - function parse(key) { - var value = attrs[key]; - var classesOk = (o.allowedClasses || {})[low] || []; - var attrsOk = (o.allowedAttributes || {})[low] || []; - attrsOk = attrsOk.concat((o.allowedAttributes || {})['*'] || []); - var valid; - var lkey = lowercase(key); - if (lkey === 'class' && attrsOk.indexOf(lkey) === -1) { - value = value.split(' ').filter(isValidClass).join(' ').trim(); - valid = value.length; - } else { - valid = attrsOk.indexOf(lkey) !== -1 && (attributes.uris[lkey] !== true || testUrl(value)); - } - if (valid) { - out(' '); - out(key); - if (typeof value === 'string') { - out('="'); - out(he.encode(value)); - out('"'); - } - } - function isValidClass(className) { - return classesOk && classesOk.indexOf(className) !== -1; - } - } - } - - function end(tag) { - var low = lowercase(tag); - var allowed = (o.allowedTags || []).indexOf(low) !== -1; - if (allowed) { - if (context.ignoring === false) { - out(''); - } else { - unignore(low); - } - } else { - unignore(low); - } - } - - function testUrl(text) { - var start = text[0]; - if (start === '#' || start === '/') { - return true; - } - var colon = text.indexOf(':'); - if (colon === -1) { - return true; - } - var questionmark = text.indexOf('?'); - if (questionmark !== -1 && colon > questionmark) { - return true; - } - var hash = text.indexOf('#'); - if (hash !== -1 && colon > hash) { - return true; - } - return o.allowedSchemes.some(matches); - - function matches(scheme) { - return text.indexOf(scheme + ':') === 0; - } - } - - function chars(text) { - if (context.ignoring === false) { - out(o.transformText ? o.transformText(text) : text); - } - } - - function ignore(tag) { - if (elements.voids[tag]) { - return; - } - if (context.ignoring === false) { - context = { ignoring: tag, depth: 1 }; - } else if (context.ignoring === tag) { - context.depth++; - } - } - - function unignore(tag) { - if (context.ignoring === tag) { - if (--context.depth <= 0) { - reset(); - } - } - } - - function reset() { - context = { ignoring: false, depth: 0 }; - } - } - - module.exports = sanitizer; - - }, { "./attributes": 1, "./elements": 3, "./lowercase": 5, "he": 9 }], 9: [function (require, module, exports) { - 'use strict'; - - var escapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - var unescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" - }; - var rescaped = /(&|<|>|"|')/g; - var runescaped = /[&<>"']/g; - - function escapeHtmlChar(match) { - return escapes[match]; - } - function unescapeHtmlChar(match) { - return unescapes[match]; - } - - function escapeHtml(text) { - return text == null ? '' : String(text).replace(runescaped, escapeHtmlChar); - } - - function unescapeHtml(html) { - return html == null ? '' : String(html).replace(rescaped, unescapeHtmlChar); - } - - escapeHtml.options = unescapeHtml.options = {}; - - module.exports = { - encode: escapeHtml, - escape: escapeHtml, - decode: unescapeHtml, - unescape: unescapeHtml, - version: '1.0.0-browser' - }; - - }, {}], 10: [function (require, module, exports) { - 'use strict'; - - function toMap(list) { - return list.reduce(asKey, {}); - } - - function asKey(accumulator, item) { - accumulator[item] = true; - return accumulator; - } - - module.exports = toMap; - - }, {}] -}, {}, [4]); - -// ESM-comment-begin -// define(function() { return { insane: __insane_func }; }); -// ESM-comment-end - -// ESM-uncomment-begin -var insane = __insane_func; -// ESM-uncomment-end - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/iterator.js ***! - \*******************************************************************/ -/*! exports provided: Iterable */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Iterable", function() { return Iterable; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Iterable; -(function (Iterable) { - function is(thing) { - return thing && typeof thing === 'object' && typeof thing[Symbol.iterator] === 'function'; - } - Iterable.is = is; - const _empty = Object.freeze([]); - function empty() { - return _empty; - } - Iterable.empty = empty; - function* single(element) { - yield element; - } - Iterable.single = single; - function from(iterable) { - return iterable || _empty; - } - Iterable.from = from; - function first(iterable) { - return iterable[Symbol.iterator]().next().value; - } - Iterable.first = first; - function some(iterable, predicate) { - for (const element of iterable) { - if (predicate(element)) { - return true; - } - } - return false; - } - Iterable.some = some; - function* filter(iterable, predicate) { - for (const element of iterable) { - if (predicate(element)) { - yield element; - } - } - } - Iterable.filter = filter; - function* map(iterable, fn) { - for (const element of iterable) { - yield fn(element); - } - } - Iterable.map = map; - function* concat(...iterables) { - for (const iterable of iterables) { - for (const element of iterable) { - yield element; - } - } - } - Iterable.concat = concat; - /** - * Consumes `atMost` elements from iterable and returns the consumed elements, - * and an iterable for the rest of the elements. - */ - function consume(iterable, atMost = Number.POSITIVE_INFINITY) { - const consumed = []; - if (atMost === 0) { - return [consumed, iterable]; - } - const iterator = iterable[Symbol.iterator](); - for (let i = 0; i < atMost; i++) { - const next = iterator.next(); - if (next.done) { - return [consumed, Iterable.empty()]; - } - consumed.push(next.value); - } - return [consumed, { [Symbol.iterator]() { return iterator; } }]; - } - Iterable.consume = consume; -})(Iterable || (Iterable = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js ***! - \*******************************************************************/ -/*! exports provided: KeyCodeUtils, KeyChord, createKeybinding, createSimpleKeybinding, SimpleKeybinding, ChordKeybinding, ResolvedKeybindingPart, ResolvedKeybinding */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCodeUtils", function() { return KeyCodeUtils; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyChord", function() { return KeyChord; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createKeybinding", function() { return createKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleKeybinding", function() { return createSimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleKeybinding", function() { return SimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChordKeybinding", function() { return ChordKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybindingPart", function() { return ResolvedKeybindingPart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybinding", function() { return ResolvedKeybinding; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class KeyCodeStrMap { - constructor() { - this._keyCodeToStr = []; - this._strToKeyCode = Object.create(null); - } - define(keyCode, str) { - this._keyCodeToStr[keyCode] = str; - this._strToKeyCode[str.toLowerCase()] = keyCode; - } - keyCodeToStr(keyCode) { - return this._keyCodeToStr[keyCode]; - } - strToKeyCode(str) { - return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; - } -} -const uiMap = new KeyCodeStrMap(); -const userSettingsUSMap = new KeyCodeStrMap(); -const userSettingsGeneralMap = new KeyCodeStrMap(); -(function () { - function define(keyCode, uiLabel, usUserSettingsLabel = uiLabel, generalUserSettingsLabel = usUserSettingsLabel) { - uiMap.define(keyCode, uiLabel); - userSettingsUSMap.define(keyCode, usUserSettingsLabel); - userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); - } - define(0 /* Unknown */, 'unknown'); - define(1 /* Backspace */, 'Backspace'); - define(2 /* Tab */, 'Tab'); - define(3 /* Enter */, 'Enter'); - define(4 /* Shift */, 'Shift'); - define(5 /* Ctrl */, 'Ctrl'); - define(6 /* Alt */, 'Alt'); - define(7 /* PauseBreak */, 'PauseBreak'); - define(8 /* CapsLock */, 'CapsLock'); - define(9 /* Escape */, 'Escape'); - define(10 /* Space */, 'Space'); - define(11 /* PageUp */, 'PageUp'); - define(12 /* PageDown */, 'PageDown'); - define(13 /* End */, 'End'); - define(14 /* Home */, 'Home'); - define(15 /* LeftArrow */, 'LeftArrow', 'Left'); - define(16 /* UpArrow */, 'UpArrow', 'Up'); - define(17 /* RightArrow */, 'RightArrow', 'Right'); - define(18 /* DownArrow */, 'DownArrow', 'Down'); - define(19 /* Insert */, 'Insert'); - define(20 /* Delete */, 'Delete'); - define(21 /* KEY_0 */, '0'); - define(22 /* KEY_1 */, '1'); - define(23 /* KEY_2 */, '2'); - define(24 /* KEY_3 */, '3'); - define(25 /* KEY_4 */, '4'); - define(26 /* KEY_5 */, '5'); - define(27 /* KEY_6 */, '6'); - define(28 /* KEY_7 */, '7'); - define(29 /* KEY_8 */, '8'); - define(30 /* KEY_9 */, '9'); - define(31 /* KEY_A */, 'A'); - define(32 /* KEY_B */, 'B'); - define(33 /* KEY_C */, 'C'); - define(34 /* KEY_D */, 'D'); - define(35 /* KEY_E */, 'E'); - define(36 /* KEY_F */, 'F'); - define(37 /* KEY_G */, 'G'); - define(38 /* KEY_H */, 'H'); - define(39 /* KEY_I */, 'I'); - define(40 /* KEY_J */, 'J'); - define(41 /* KEY_K */, 'K'); - define(42 /* KEY_L */, 'L'); - define(43 /* KEY_M */, 'M'); - define(44 /* KEY_N */, 'N'); - define(45 /* KEY_O */, 'O'); - define(46 /* KEY_P */, 'P'); - define(47 /* KEY_Q */, 'Q'); - define(48 /* KEY_R */, 'R'); - define(49 /* KEY_S */, 'S'); - define(50 /* KEY_T */, 'T'); - define(51 /* KEY_U */, 'U'); - define(52 /* KEY_V */, 'V'); - define(53 /* KEY_W */, 'W'); - define(54 /* KEY_X */, 'X'); - define(55 /* KEY_Y */, 'Y'); - define(56 /* KEY_Z */, 'Z'); - define(57 /* Meta */, 'Meta'); - define(58 /* ContextMenu */, 'ContextMenu'); - define(59 /* F1 */, 'F1'); - define(60 /* F2 */, 'F2'); - define(61 /* F3 */, 'F3'); - define(62 /* F4 */, 'F4'); - define(63 /* F5 */, 'F5'); - define(64 /* F6 */, 'F6'); - define(65 /* F7 */, 'F7'); - define(66 /* F8 */, 'F8'); - define(67 /* F9 */, 'F9'); - define(68 /* F10 */, 'F10'); - define(69 /* F11 */, 'F11'); - define(70 /* F12 */, 'F12'); - define(71 /* F13 */, 'F13'); - define(72 /* F14 */, 'F14'); - define(73 /* F15 */, 'F15'); - define(74 /* F16 */, 'F16'); - define(75 /* F17 */, 'F17'); - define(76 /* F18 */, 'F18'); - define(77 /* F19 */, 'F19'); - define(78 /* NumLock */, 'NumLock'); - define(79 /* ScrollLock */, 'ScrollLock'); - define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); - define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); - define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); - define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); - define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); - define(85 /* US_SLASH */, '/', '/', 'OEM_2'); - define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); - define(110 /* ABNT_C1 */, 'ABNT_C1'); - define(111 /* ABNT_C2 */, 'ABNT_C2'); - define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); - define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); - define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); - define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); - define(91 /* OEM_8 */, 'OEM_8'); - define(92 /* OEM_102 */, 'OEM_102'); - define(93 /* NUMPAD_0 */, 'NumPad0'); - define(94 /* NUMPAD_1 */, 'NumPad1'); - define(95 /* NUMPAD_2 */, 'NumPad2'); - define(96 /* NUMPAD_3 */, 'NumPad3'); - define(97 /* NUMPAD_4 */, 'NumPad4'); - define(98 /* NUMPAD_5 */, 'NumPad5'); - define(99 /* NUMPAD_6 */, 'NumPad6'); - define(100 /* NUMPAD_7 */, 'NumPad7'); - define(101 /* NUMPAD_8 */, 'NumPad8'); - define(102 /* NUMPAD_9 */, 'NumPad9'); - define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); - define(104 /* NUMPAD_ADD */, 'NumPad_Add'); - define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); - define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); - define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); - define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); -})(); -var KeyCodeUtils; -(function (KeyCodeUtils) { - function toString(keyCode) { - return uiMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toString = toString; - function fromString(key) { - return uiMap.strToKeyCode(key); - } - KeyCodeUtils.fromString = fromString; - function toUserSettingsUS(keyCode) { - return userSettingsUSMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; - function toUserSettingsGeneral(keyCode) { - return userSettingsGeneralMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; - function fromUserSettings(key) { - return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); - } - KeyCodeUtils.fromUserSettings = fromUserSettings; -})(KeyCodeUtils || (KeyCodeUtils = {})); -function KeyChord(firstPart, secondPart) { - const chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; - return (firstPart | chordPart) >>> 0; -} -function createKeybinding(keybinding, OS) { - if (keybinding === 0) { - return null; - } - const firstPart = (keybinding & 0x0000FFFF) >>> 0; - const chordPart = (keybinding & 0xFFFF0000) >>> 16; - if (chordPart !== 0) { - return new ChordKeybinding([ - createSimpleKeybinding(firstPart, OS), - createSimpleKeybinding(chordPart, OS) - ]); - } - return new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); -} -function createSimpleKeybinding(keybinding, OS) { - const ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); - const winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); - const ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); - const shiftKey = (keybinding & 1024 /* Shift */ ? true : false); - const altKey = (keybinding & 512 /* Alt */ ? true : false); - const metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); - const keyCode = (keybinding & 255 /* KeyCode */); - return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); -} -class SimpleKeybinding { - constructor(ctrlKey, shiftKey, altKey, metaKey, keyCode) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyCode = keyCode; - } - equals(other) { - return (this.ctrlKey === other.ctrlKey - && this.shiftKey === other.shiftKey - && this.altKey === other.altKey - && this.metaKey === other.metaKey - && this.keyCode === other.keyCode); - } - isModifierKey() { - return (this.keyCode === 0 /* Unknown */ - || this.keyCode === 5 /* Ctrl */ - || this.keyCode === 57 /* Meta */ - || this.keyCode === 6 /* Alt */ - || this.keyCode === 4 /* Shift */); - } - toChord() { - return new ChordKeybinding([this]); - } - /** - * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? - */ - isDuplicateModifierCase() { - return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) - || (this.shiftKey && this.keyCode === 4 /* Shift */) - || (this.altKey && this.keyCode === 6 /* Alt */) - || (this.metaKey && this.keyCode === 57 /* Meta */)); - } -} -class ChordKeybinding { - constructor(parts) { - if (parts.length === 0) { - throw Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["illegalArgument"])(`parts`); - } - this.parts = parts; - } -} -class ResolvedKeybindingPart { - constructor(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyLabel = kbLabel; - this.keyAriaLabel = kbAriaLabel; - } -} -/** - * A resolved keybinding. Can be a simple keybinding or a chord keybinding. - */ -class ResolvedKeybinding { -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/keybindingLabels.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/keybindingLabels.js ***! - \***************************************************************************/ -/*! exports provided: ModifierLabelProvider, UILabelProvider, AriaLabelProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModifierLabelProvider", function() { return ModifierLabelProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UILabelProvider", function() { return UILabelProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AriaLabelProvider", function() { return AriaLabelProvider; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class ModifierLabelProvider { - constructor(mac, windows, linux = windows) { - this.modifierLabels = [null]; // index 0 will never me accessed. - this.modifierLabels[2 /* Macintosh */] = mac; - this.modifierLabels[1 /* Windows */] = windows; - this.modifierLabels[3 /* Linux */] = linux; - } - toLabel(OS, parts, keyLabelProvider) { - if (parts.length === 0) { - return null; - } - const result = []; - for (let i = 0, len = parts.length; i < len; i++) { - const part = parts[i]; - const keyLabel = keyLabelProvider(part); - if (keyLabel === null) { - // this keybinding cannot be expressed... - return null; - } - result[i] = _simpleAsString(part, keyLabel, this.modifierLabels[OS]); - } - return result.join(' '); - } -} -/** - * A label provider that prints modifiers in a suitable format for displaying in the UI. - */ -const UILabelProvider = new ModifierLabelProvider({ - ctrlKey: '⌃', - shiftKey: '⇧', - altKey: '⌥', - metaKey: '⌘', - separator: '', -}, { - ctrlKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'ctrlKey', comment: ['This is the short form for the Control key on the keyboard'] }, "Ctrl"), - shiftKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'shiftKey', comment: ['This is the short form for the Shift key on the keyboard'] }, "Shift"), - altKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'altKey', comment: ['This is the short form for the Alt key on the keyboard'] }, "Alt"), - metaKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'windowsKey', comment: ['This is the short form for the Windows key on the keyboard'] }, "Windows"), - separator: '+', -}, { - ctrlKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'ctrlKey', comment: ['This is the short form for the Control key on the keyboard'] }, "Ctrl"), - shiftKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'shiftKey', comment: ['This is the short form for the Shift key on the keyboard'] }, "Shift"), - altKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'altKey', comment: ['This is the short form for the Alt key on the keyboard'] }, "Alt"), - metaKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'superKey', comment: ['This is the short form for the Super key on the keyboard'] }, "Super"), - separator: '+', -}); -/** - * A label provider that prints modifiers in a suitable format for ARIA. - */ -const AriaLabelProvider = new ModifierLabelProvider({ - ctrlKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'ctrlKey.long', comment: ['This is the long form for the Control key on the keyboard'] }, "Control"), - shiftKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'shiftKey.long', comment: ['This is the long form for the Shift key on the keyboard'] }, "Shift"), - altKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'altKey.long', comment: ['This is the long form for the Alt key on the keyboard'] }, "Alt"), - metaKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cmdKey.long', comment: ['This is the long form for the Command key on the keyboard'] }, "Command"), - separator: '+', -}, { - ctrlKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'ctrlKey.long', comment: ['This is the long form for the Control key on the keyboard'] }, "Control"), - shiftKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'shiftKey.long', comment: ['This is the long form for the Shift key on the keyboard'] }, "Shift"), - altKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'altKey.long', comment: ['This is the long form for the Alt key on the keyboard'] }, "Alt"), - metaKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'windowsKey.long', comment: ['This is the long form for the Windows key on the keyboard'] }, "Windows"), - separator: '+', -}, { - ctrlKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'ctrlKey.long', comment: ['This is the long form for the Control key on the keyboard'] }, "Control"), - shiftKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'shiftKey.long', comment: ['This is the long form for the Shift key on the keyboard'] }, "Shift"), - altKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'altKey.long', comment: ['This is the long form for the Alt key on the keyboard'] }, "Alt"), - metaKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'superKey.long', comment: ['This is the long form for the Super key on the keyboard'] }, "Super"), - separator: '+', -}); -function _simpleAsString(modifiers, key, labels) { - if (key === null) { - return ''; - } - const result = []; - // translate modifier keys: Ctrl-Shift-Alt-Meta - if (modifiers.ctrlKey) { - result.push(labels.ctrlKey); - } - if (modifiers.shiftKey) { - result.push(labels.shiftKey); - } - if (modifiers.altKey) { - result.push(labels.altKey); - } - if (modifiers.metaKey) { - result.push(labels.metaKey); - } - // the actual key - if (key !== '') { - result.push(key); - } - return result.join(labels.separator); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/labels.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/labels.js ***! - \*****************************************************************/ -/*! exports provided: getPathLabel, getBaseLabel, normalizeDriveLetter, tildify */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPathLabel", function() { return getPathLabel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBaseLabel", function() { return getBaseLabel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeDriveLetter", function() { return normalizeDriveLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tildify", function() { return tildify; }); -/* harmony import */ var _uri_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./path.js */ "./node_modules/monaco-editor/esm/vs/base/common/path.js"); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _network_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _resources_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -/** - * @deprecated use LabelService instead - */ -function getPathLabel(resource, userHomeProvider, rootProvider) { - if (typeof resource === 'string') { - resource = _uri_js__WEBPACK_IMPORTED_MODULE_0__["URI"].file(resource); - } - // return early if we can resolve a relative path label from the root - if (rootProvider) { - const baseResource = rootProvider.getWorkspaceFolder(resource); - if (baseResource) { - const hasMultipleRoots = rootProvider.getWorkspace().folders.length > 1; - let pathLabel; - if (Object(_resources_js__WEBPACK_IMPORTED_MODULE_5__["isEqual"])(baseResource.uri, resource)) { - pathLabel = ''; // no label if paths are identical - } - else { - pathLabel = Object(_resources_js__WEBPACK_IMPORTED_MODULE_5__["relativePath"])(baseResource.uri, resource); - } - if (hasMultipleRoots) { - const rootName = baseResource.name ? baseResource.name : Object(_resources_js__WEBPACK_IMPORTED_MODULE_5__["basename"])(baseResource.uri); - pathLabel = pathLabel ? (rootName + ' • ' + pathLabel) : rootName; // always show root basename if there are multiple - } - return pathLabel; - } - } - // return if the resource is neither file:// nor untitled:// and no baseResource was provided - if (resource.scheme !== _network_js__WEBPACK_IMPORTED_MODULE_3__["Schemas"].file && resource.scheme !== _network_js__WEBPACK_IMPORTED_MODULE_3__["Schemas"].untitled) { - return resource.with({ query: null, fragment: null }).toString(true); - } - // convert c:\something => C:\something - if (hasDriveLetter(resource.fsPath)) { - return Object(_path_js__WEBPACK_IMPORTED_MODULE_1__["normalize"])(normalizeDriveLetter(resource.fsPath)); - } - // normalize and tildify (macOS, Linux only) - let res = Object(_path_js__WEBPACK_IMPORTED_MODULE_1__["normalize"])(resource.fsPath); - if (!_platform_js__WEBPACK_IMPORTED_MODULE_4__["isWindows"] && (userHomeProvider === null || userHomeProvider === void 0 ? void 0 : userHomeProvider.userHome)) { - res = tildify(res, userHomeProvider.userHome.fsPath); - } - return res; -} -function getBaseLabel(resource) { - if (!resource) { - return undefined; - } - if (typeof resource === 'string') { - resource = _uri_js__WEBPACK_IMPORTED_MODULE_0__["URI"].file(resource); - } - const base = Object(_resources_js__WEBPACK_IMPORTED_MODULE_5__["basename"])(resource) || (resource.scheme === _network_js__WEBPACK_IMPORTED_MODULE_3__["Schemas"].file ? resource.fsPath : resource.path) /* can be empty string if '/' is passed in */; - // convert c: => C: - if (hasDriveLetter(base)) { - return normalizeDriveLetter(base); - } - return base; -} -function hasDriveLetter(path) { - return !!(_platform_js__WEBPACK_IMPORTED_MODULE_4__["isWindows"] && path && path[1] === ':'); -} -function normalizeDriveLetter(path) { - if (hasDriveLetter(path)) { - return path.charAt(0).toUpperCase() + path.slice(1); - } - return path; -} -let normalizedUserHomeCached = Object.create(null); -function tildify(path, userHome) { - if (_platform_js__WEBPACK_IMPORTED_MODULE_4__["isWindows"] || !path || !userHome) { - return path; // unsupported - } - // Keep a normalized user home path as cache to prevent accumulated string creation - let normalizedUserHome = normalizedUserHomeCached.original === userHome ? normalizedUserHomeCached.normalized : undefined; - if (!normalizedUserHome) { - normalizedUserHome = `${Object(_strings_js__WEBPACK_IMPORTED_MODULE_2__["rtrim"])(userHome, _path_js__WEBPACK_IMPORTED_MODULE_1__["posix"].sep)}${_path_js__WEBPACK_IMPORTED_MODULE_1__["posix"].sep}`; - normalizedUserHomeCached = { original: userHome, normalized: normalizedUserHome }; - } - // Linux: case sensitive, macOS: case insensitive - if (_platform_js__WEBPACK_IMPORTED_MODULE_4__["isLinux"] ? path.startsWith(normalizedUserHome) : Object(_strings_js__WEBPACK_IMPORTED_MODULE_2__["startsWithIgnoreCase"])(path, normalizedUserHome)) { - path = `~/${path.substr(normalizedUserHome.length)}`; - } - return path; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/lazy.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/lazy.js ***! - \***************************************************************/ -/*! exports provided: Lazy */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Lazy", function() { return Lazy; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class Lazy { - constructor(executor) { - this.executor = executor; - this._didRun = false; - } - /** - * Get the wrapped value. - * - * This will force evaluation of the lazy value if it has not been resolved yet. Lazy values are only - * resolved once. `getValue` will re-throw exceptions that are hit while resolving the value - */ - getValue() { - if (!this._didRun) { - try { - this._value = this.executor(); - } - catch (err) { - this._error = err; - } - finally { - this._didRun = true; - } - } - if (this._error) { - throw this._error; - } - return this._value; - } - /** - * Get the wrapped value without forcing evaluation. - */ - get rawValue() { return this._value; } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js ***! - \********************************************************************/ -/*! exports provided: MultiDisposeError, isDisposable, dispose, combinedDisposable, toDisposable, DisposableStore, Disposable, MutableDisposable, ImmortalReference */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiDisposeError", function() { return MultiDisposeError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDisposable", function() { return isDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispose", function() { return dispose; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combinedDisposable", function() { return combinedDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDisposable", function() { return toDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DisposableStore", function() { return DisposableStore; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Disposable", function() { return Disposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MutableDisposable", function() { return MutableDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImmortalReference", function() { return ImmortalReference; }); -/* harmony import */ var _iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); - -/** - * Enables logging of potentially leaked disposables. - * - * A disposable is considered leaked if it is not disposed or not registered as the child of - * another disposable. This tracking is very simple an only works for classes that either - * extend Disposable or use a DisposableStore. This means there are a lot of false positives. - */ -const TRACK_DISPOSABLES = false; -const __is_disposable_tracked__ = '__is_disposable_tracked__'; -function markTracked(x) { - if (!TRACK_DISPOSABLES) { - return; - } - if (x && x !== Disposable.None) { - try { - x[__is_disposable_tracked__] = true; - } - catch (_a) { - // noop - } - } -} -function trackDisposable(x) { - if (!TRACK_DISPOSABLES) { - return x; - } - const stack = new Error('Potentially leaked disposable').stack; - setTimeout(() => { - if (!x[__is_disposable_tracked__]) { - console.log(stack); - } - }, 3000); - return x; -} -class MultiDisposeError extends Error { - constructor(errors) { - super(`Encounter errors while disposing of store. Errors: [${errors.join(', ')}]`); - this.errors = errors; - } -} -function isDisposable(thing) { - return typeof thing.dispose === 'function' && thing.dispose.length === 0; -} -function dispose(arg) { - if (_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].is(arg)) { - let errors = []; - for (const d of arg) { - if (d) { - markTracked(d); - try { - d.dispose(); - } - catch (e) { - errors.push(e); - } - } - } - if (errors.length === 1) { - throw errors[0]; - } - else if (errors.length > 1) { - throw new MultiDisposeError(errors); - } - return Array.isArray(arg) ? [] : arg; - } - else if (arg) { - markTracked(arg); - arg.dispose(); - return arg; - } -} -function combinedDisposable(...disposables) { - disposables.forEach(markTracked); - return trackDisposable({ dispose: () => dispose(disposables) }); -} -function toDisposable(fn) { - const self = trackDisposable({ - dispose: () => { - markTracked(self); - fn(); - } - }); - return self; -} -class DisposableStore { - constructor() { - this._toDispose = new Set(); - this._isDisposed = false; - } - /** - * Dispose of all registered disposables and mark this object as disposed. - * - * Any future disposables added to this object will be disposed of on `add`. - */ - dispose() { - if (this._isDisposed) { - return; - } - markTracked(this); - this._isDisposed = true; - this.clear(); - } - /** - * Dispose of all registered disposables but do not mark this object as disposed. - */ - clear() { - try { - dispose(this._toDispose.values()); - } - finally { - this._toDispose.clear(); - } - } - add(t) { - if (!t) { - return t; - } - if (t === this) { - throw new Error('Cannot register a disposable on itself!'); - } - markTracked(t); - if (this._isDisposed) { - if (!DisposableStore.DISABLE_DISPOSED_WARNING) { - console.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack); - } - } - else { - this._toDispose.add(t); - } - return t; - } -} -DisposableStore.DISABLE_DISPOSED_WARNING = false; -class Disposable { - constructor() { - this._store = new DisposableStore(); - trackDisposable(this); - } - dispose() { - markTracked(this); - this._store.dispose(); - } - _register(t) { - if (t === this) { - throw new Error('Cannot register a disposable on itself!'); - } - return this._store.add(t); - } -} -Disposable.None = Object.freeze({ dispose() { } }); -/** - * Manages the lifecycle of a disposable value that may be changed. - * - * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can - * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up. - */ -class MutableDisposable { - constructor() { - this._isDisposed = false; - trackDisposable(this); - } - get value() { - return this._isDisposed ? undefined : this._value; - } - set value(value) { - if (this._isDisposed || value === this._value) { - return; - } - if (this._value) { - this._value.dispose(); - } - if (value) { - markTracked(value); - } - this._value = value; - } - clear() { - this.value = undefined; - } - dispose() { - this._isDisposed = true; - markTracked(this); - if (this._value) { - this._value.dispose(); - } - this._value = undefined; - } -} -class ImmortalReference { - constructor(object) { - this.object = object; - } - dispose() { } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js ***! - \*********************************************************************/ -/*! exports provided: LinkedList */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedList", function() { return LinkedList; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class Node { - constructor(element) { - this.element = element; - this.next = Node.Undefined; - this.prev = Node.Undefined; - } -} -Node.Undefined = new Node(undefined); -class LinkedList { - constructor() { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - } - get size() { - return this._size; - } - isEmpty() { - return this._first === Node.Undefined; - } - clear() { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - } - unshift(element) { - return this._insert(element, false); - } - push(element) { - return this._insert(element, true); - } - _insert(element, atTheEnd) { - const newNode = new Node(element); - if (this._first === Node.Undefined) { - this._first = newNode; - this._last = newNode; - } - else if (atTheEnd) { - // push - const oldLast = this._last; - this._last = newNode; - newNode.prev = oldLast; - oldLast.next = newNode; - } - else { - // unshift - const oldFirst = this._first; - this._first = newNode; - newNode.next = oldFirst; - oldFirst.prev = newNode; - } - this._size += 1; - let didRemove = false; - return () => { - if (!didRemove) { - didRemove = true; - this._remove(newNode); - } - }; - } - shift() { - if (this._first === Node.Undefined) { - return undefined; - } - else { - const res = this._first.element; - this._remove(this._first); - return res; - } - } - pop() { - if (this._last === Node.Undefined) { - return undefined; - } - else { - const res = this._last.element; - this._remove(this._last); - return res; - } - } - _remove(node) { - if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { - // middle - const anchor = node.prev; - anchor.next = node.next; - node.next.prev = anchor; - } - else if (node.prev === Node.Undefined && node.next === Node.Undefined) { - // only node - this._first = Node.Undefined; - this._last = Node.Undefined; - } - else if (node.next === Node.Undefined) { - // last - this._last = this._last.prev; - this._last.next = Node.Undefined; - } - else if (node.prev === Node.Undefined) { - // first - this._first = this._first.next; - this._first.prev = Node.Undefined; - } - // done - this._size -= 1; - } - *[Symbol.iterator]() { - let node = this._first; - while (node !== Node.Undefined) { - yield node.element; - node = node.next; - } - } - toArray() { - const result = []; - for (let node = this._first; node !== Node.Undefined; node = node.next) { - result.push(node.element); - } - return result; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/map.js": -/*!**************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/map.js ***! - \**************************************************************/ -/*! exports provided: StringIterator, PathIterator, UriIterator, TernarySearchTree, ResourceMap, LinkedMap, LRUCache */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringIterator", function() { return StringIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PathIterator", function() { return PathIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UriIterator", function() { return UriIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TernarySearchTree", function() { return TernarySearchTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResourceMap", function() { return ResourceMap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedMap", function() { return LinkedMap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LRUCache", function() { return LRUCache; }); -/* harmony import */ var _uri_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _network_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class StringIterator { - constructor() { - this._value = ''; - this._pos = 0; - } - reset(key) { - this._value = key; - this._pos = 0; - return this; - } - next() { - this._pos += 1; - return this; - } - hasNext() { - return this._pos < this._value.length - 1; - } - cmp(a) { - const aCode = a.charCodeAt(0); - const thisCode = this._value.charCodeAt(this._pos); - return aCode - thisCode; - } - value() { - return this._value[this._pos]; - } -} -class PathIterator { - constructor(_splitOnBackslash = true, _caseSensitive = true) { - this._splitOnBackslash = _splitOnBackslash; - this._caseSensitive = _caseSensitive; - } - reset(key) { - this._value = key.replace(/\\$|\/$/, ''); - this._from = 0; - this._to = 0; - return this.next(); - } - hasNext() { - return this._to < this._value.length; - } - next() { - // this._data = key.split(/[\\/]/).filter(s => !!s); - this._from = this._to; - let justSeps = true; - for (; this._to < this._value.length; this._to++) { - const ch = this._value.charCodeAt(this._to); - if (ch === 47 /* Slash */ || this._splitOnBackslash && ch === 92 /* Backslash */) { - if (justSeps) { - this._from++; - } - else { - break; - } - } - else { - justSeps = false; - } - } - return this; - } - cmp(a) { - return this._caseSensitive - ? Object(_strings_js__WEBPACK_IMPORTED_MODULE_1__["compareSubstring"])(a, this._value, 0, a.length, this._from, this._to) - : Object(_strings_js__WEBPACK_IMPORTED_MODULE_1__["compareSubstringIgnoreCase"])(a, this._value, 0, a.length, this._from, this._to); - } - value() { - return this._value.substring(this._from, this._to); - } -} -class UriIterator { - constructor() { - this._states = []; - this._stateIdx = 0; - } - reset(key) { - this._value = key; - this._states = []; - if (this._value.scheme) { - this._states.push(1 /* Scheme */); - } - if (this._value.authority) { - this._states.push(2 /* Authority */); - } - if (this._value.path) { - //todo@jrieken the case-sensitive logic is copied form `resources.ts#hasToIgnoreCase` - // which cannot be used because it depends on this - const caseSensitive = key.scheme === _network_js__WEBPACK_IMPORTED_MODULE_2__["Schemas"].file && _platform_js__WEBPACK_IMPORTED_MODULE_3__["isLinux"]; - this._pathIterator = new PathIterator(false, caseSensitive); - this._pathIterator.reset(key.path); - if (this._pathIterator.value()) { - this._states.push(3 /* Path */); - } - } - if (this._value.query) { - this._states.push(4 /* Query */); - } - if (this._value.fragment) { - this._states.push(5 /* Fragment */); - } - this._stateIdx = 0; - return this; - } - next() { - if (this._states[this._stateIdx] === 3 /* Path */ && this._pathIterator.hasNext()) { - this._pathIterator.next(); - } - else { - this._stateIdx += 1; - } - return this; - } - hasNext() { - return (this._states[this._stateIdx] === 3 /* Path */ && this._pathIterator.hasNext()) - || this._stateIdx < this._states.length - 1; - } - cmp(a) { - if (this._states[this._stateIdx] === 1 /* Scheme */) { - return Object(_strings_js__WEBPACK_IMPORTED_MODULE_1__["compare"])(a, this._value.scheme); - } - else if (this._states[this._stateIdx] === 2 /* Authority */) { - return Object(_strings_js__WEBPACK_IMPORTED_MODULE_1__["compareSubstringIgnoreCase"])(a, this._value.authority); - } - else if (this._states[this._stateIdx] === 3 /* Path */) { - return this._pathIterator.cmp(a); - } - else if (this._states[this._stateIdx] === 4 /* Query */) { - return Object(_strings_js__WEBPACK_IMPORTED_MODULE_1__["compare"])(a, this._value.query); - } - else if (this._states[this._stateIdx] === 5 /* Fragment */) { - return Object(_strings_js__WEBPACK_IMPORTED_MODULE_1__["compare"])(a, this._value.fragment); - } - throw new Error(); - } - value() { - if (this._states[this._stateIdx] === 1 /* Scheme */) { - return this._value.scheme; - } - else if (this._states[this._stateIdx] === 2 /* Authority */) { - return this._value.authority; - } - else if (this._states[this._stateIdx] === 3 /* Path */) { - return this._pathIterator.value(); - } - else if (this._states[this._stateIdx] === 4 /* Query */) { - return this._value.query; - } - else if (this._states[this._stateIdx] === 5 /* Fragment */) { - return this._value.fragment; - } - throw new Error(); - } -} -class TernarySearchTreeNode { -} -class TernarySearchTree { - constructor(segments) { - this._iter = segments; - } - static forUris() { - return new TernarySearchTree(new UriIterator()); - } - static forStrings() { - return new TernarySearchTree(new StringIterator()); - } - clear() { - this._root = undefined; - } - set(key, element) { - const iter = this._iter.reset(key); - let node; - if (!this._root) { - this._root = new TernarySearchTreeNode(); - this._root.segment = iter.value(); - } - node = this._root; - while (true) { - const val = iter.cmp(node.segment); - if (val > 0) { - // left - if (!node.left) { - node.left = new TernarySearchTreeNode(); - node.left.segment = iter.value(); - } - node = node.left; - } - else if (val < 0) { - // right - if (!node.right) { - node.right = new TernarySearchTreeNode(); - node.right.segment = iter.value(); - } - node = node.right; - } - else if (iter.hasNext()) { - // mid - iter.next(); - if (!node.mid) { - node.mid = new TernarySearchTreeNode(); - node.mid.segment = iter.value(); - } - node = node.mid; - } - else { - break; - } - } - const oldElement = node.value; - node.value = element; - node.key = key; - return oldElement; - } - get(key) { - const iter = this._iter.reset(key); - let node = this._root; - while (node) { - const val = iter.cmp(node.segment); - if (val > 0) { - // left - node = node.left; - } - else if (val < 0) { - // right - node = node.right; - } - else if (iter.hasNext()) { - // mid - iter.next(); - node = node.mid; - } - else { - break; - } - } - return node ? node.value : undefined; - } - findSubstr(key) { - const iter = this._iter.reset(key); - let node = this._root; - let candidate = undefined; - while (node) { - const val = iter.cmp(node.segment); - if (val > 0) { - // left - node = node.left; - } - else if (val < 0) { - // right - node = node.right; - } - else if (iter.hasNext()) { - // mid - iter.next(); - candidate = node.value || candidate; - node = node.mid; - } - else { - break; - } - } - return node && node.value || candidate; - } - forEach(callback) { - this._forEach(this._root, callback); - } - _forEach(node, callback) { - if (node) { - // left - this._forEach(node.left, callback); - // node - if (node.value) { - // callback(node.value, this._iter.join(parts)); - callback(node.value, node.key); - } - // mid - this._forEach(node.mid, callback); - // right - this._forEach(node.right, callback); - } - } -} -class ResourceMap { - constructor(mapOrKeyFn, toKey) { - this[Symbol.toStringTag] = 'ResourceMap'; - if (mapOrKeyFn instanceof ResourceMap) { - this.map = new Map(mapOrKeyFn.map); - this.toKey = toKey !== null && toKey !== void 0 ? toKey : ResourceMap.defaultToKey; - } - else { - this.map = new Map(); - this.toKey = mapOrKeyFn !== null && mapOrKeyFn !== void 0 ? mapOrKeyFn : ResourceMap.defaultToKey; - } - } - set(resource, value) { - this.map.set(this.toKey(resource), value); - return this; - } - get(resource) { - return this.map.get(this.toKey(resource)); - } - has(resource) { - return this.map.has(this.toKey(resource)); - } - get size() { - return this.map.size; - } - clear() { - this.map.clear(); - } - delete(resource) { - return this.map.delete(this.toKey(resource)); - } - forEach(clb, thisArg) { - if (typeof thisArg !== 'undefined') { - clb = clb.bind(thisArg); - } - for (let [index, value] of this.map) { - clb(value, _uri_js__WEBPACK_IMPORTED_MODULE_0__["URI"].parse(index), this); - } - } - values() { - return this.map.values(); - } - *keys() { - for (let key of this.map.keys()) { - yield _uri_js__WEBPACK_IMPORTED_MODULE_0__["URI"].parse(key); - } - } - *entries() { - for (let tuple of this.map.entries()) { - yield [_uri_js__WEBPACK_IMPORTED_MODULE_0__["URI"].parse(tuple[0]), tuple[1]]; - } - } - *[Symbol.iterator]() { - for (let item of this.map) { - yield [_uri_js__WEBPACK_IMPORTED_MODULE_0__["URI"].parse(item[0]), item[1]]; - } - } -} -ResourceMap.defaultToKey = (resource) => resource.toString(); -class LinkedMap { - constructor() { - this[Symbol.toStringTag] = 'LinkedMap'; - this._map = new Map(); - this._head = undefined; - this._tail = undefined; - this._size = 0; - this._state = 0; - } - clear() { - this._map.clear(); - this._head = undefined; - this._tail = undefined; - this._size = 0; - this._state++; - } - isEmpty() { - return !this._head && !this._tail; - } - get size() { - return this._size; - } - get first() { - var _a; - return (_a = this._head) === null || _a === void 0 ? void 0 : _a.value; - } - get last() { - var _a; - return (_a = this._tail) === null || _a === void 0 ? void 0 : _a.value; - } - has(key) { - return this._map.has(key); - } - get(key, touch = 0 /* None */) { - const item = this._map.get(key); - if (!item) { - return undefined; - } - if (touch !== 0 /* None */) { - this.touch(item, touch); - } - return item.value; - } - set(key, value, touch = 0 /* None */) { - let item = this._map.get(key); - if (item) { - item.value = value; - if (touch !== 0 /* None */) { - this.touch(item, touch); - } - } - else { - item = { key, value, next: undefined, previous: undefined }; - switch (touch) { - case 0 /* None */: - this.addItemLast(item); - break; - case 1 /* AsOld */: - this.addItemFirst(item); - break; - case 2 /* AsNew */: - this.addItemLast(item); - break; - default: - this.addItemLast(item); - break; - } - this._map.set(key, item); - this._size++; - } - return this; - } - delete(key) { - return !!this.remove(key); - } - remove(key) { - const item = this._map.get(key); - if (!item) { - return undefined; - } - this._map.delete(key); - this.removeItem(item); - this._size--; - return item.value; - } - shift() { - if (!this._head && !this._tail) { - return undefined; - } - if (!this._head || !this._tail) { - throw new Error('Invalid list'); - } - const item = this._head; - this._map.delete(item.key); - this.removeItem(item); - this._size--; - return item.value; - } - forEach(callbackfn, thisArg) { - const state = this._state; - let current = this._head; - while (current) { - if (thisArg) { - callbackfn.bind(thisArg)(current.value, current.key, this); - } - else { - callbackfn(current.value, current.key, this); - } - if (this._state !== state) { - throw new Error(`LinkedMap got modified during iteration.`); - } - current = current.next; - } - } - keys() { - const map = this; - const state = this._state; - let current = this._head; - const iterator = { - [Symbol.iterator]() { - return iterator; - }, - next() { - if (map._state !== state) { - throw new Error(`LinkedMap got modified during iteration.`); - } - if (current) { - const result = { value: current.key, done: false }; - current = current.next; - return result; - } - else { - return { value: undefined, done: true }; - } - } - }; - return iterator; - } - values() { - const map = this; - const state = this._state; - let current = this._head; - const iterator = { - [Symbol.iterator]() { - return iterator; - }, - next() { - if (map._state !== state) { - throw new Error(`LinkedMap got modified during iteration.`); - } - if (current) { - const result = { value: current.value, done: false }; - current = current.next; - return result; - } - else { - return { value: undefined, done: true }; - } - } - }; - return iterator; - } - entries() { - const map = this; - const state = this._state; - let current = this._head; - const iterator = { - [Symbol.iterator]() { - return iterator; - }, - next() { - if (map._state !== state) { - throw new Error(`LinkedMap got modified during iteration.`); - } - if (current) { - const result = { value: [current.key, current.value], done: false }; - current = current.next; - return result; - } - else { - return { value: undefined, done: true }; - } - } - }; - return iterator; - } - [Symbol.iterator]() { - return this.entries(); - } - trimOld(newSize) { - if (newSize >= this.size) { - return; - } - if (newSize === 0) { - this.clear(); - return; - } - let current = this._head; - let currentSize = this.size; - while (current && currentSize > newSize) { - this._map.delete(current.key); - current = current.next; - currentSize--; - } - this._head = current; - this._size = currentSize; - if (current) { - current.previous = undefined; - } - this._state++; - } - addItemFirst(item) { - // First time Insert - if (!this._head && !this._tail) { - this._tail = item; - } - else if (!this._head) { - throw new Error('Invalid list'); - } - else { - item.next = this._head; - this._head.previous = item; - } - this._head = item; - this._state++; - } - addItemLast(item) { - // First time Insert - if (!this._head && !this._tail) { - this._head = item; - } - else if (!this._tail) { - throw new Error('Invalid list'); - } - else { - item.previous = this._tail; - this._tail.next = item; - } - this._tail = item; - this._state++; - } - removeItem(item) { - if (item === this._head && item === this._tail) { - this._head = undefined; - this._tail = undefined; - } - else if (item === this._head) { - // This can only happend if size === 1 which is handle - // by the case above. - if (!item.next) { - throw new Error('Invalid list'); - } - item.next.previous = undefined; - this._head = item.next; - } - else if (item === this._tail) { - // This can only happend if size === 1 which is handle - // by the case above. - if (!item.previous) { - throw new Error('Invalid list'); - } - item.previous.next = undefined; - this._tail = item.previous; - } - else { - const next = item.next; - const previous = item.previous; - if (!next || !previous) { - throw new Error('Invalid list'); - } - next.previous = previous; - previous.next = next; - } - item.next = undefined; - item.previous = undefined; - this._state++; - } - touch(item, touch) { - if (!this._head || !this._tail) { - throw new Error('Invalid list'); - } - if ((touch !== 1 /* AsOld */ && touch !== 2 /* AsNew */)) { - return; - } - if (touch === 1 /* AsOld */) { - if (item === this._head) { - return; - } - const next = item.next; - const previous = item.previous; - // Unlink the item - if (item === this._tail) { - // previous must be defined since item was not head but is tail - // So there are more than on item in the map - previous.next = undefined; - this._tail = previous; - } - else { - // Both next and previous are not undefined since item was neither head nor tail. - next.previous = previous; - previous.next = next; - } - // Insert the node at head - item.previous = undefined; - item.next = this._head; - this._head.previous = item; - this._head = item; - this._state++; - } - else if (touch === 2 /* AsNew */) { - if (item === this._tail) { - return; - } - const next = item.next; - const previous = item.previous; - // Unlink the item. - if (item === this._head) { - // next must be defined since item was not tail but is head - // So there are more than on item in the map - next.previous = undefined; - this._head = next; - } - else { - // Both next and previous are not undefined since item was neither head nor tail. - next.previous = previous; - previous.next = next; - } - item.next = undefined; - item.previous = this._tail; - this._tail.next = item; - this._tail = item; - this._state++; - } - } - toJSON() { - const data = []; - this.forEach((value, key) => { - data.push([key, value]); - }); - return data; - } - fromJSON(data) { - this.clear(); - for (const [key, value] of data) { - this.set(key, value); - } - } -} -class LRUCache extends LinkedMap { - constructor(limit, ratio = 1) { - super(); - this._limit = limit; - this._ratio = Math.min(Math.max(0, ratio), 1); - } - get limit() { - return this._limit; - } - set limit(limit) { - this._limit = limit; - this.checkTrim(); - } - get(key, touch = 2 /* AsNew */) { - return super.get(key, touch); - } - peek(key) { - return super.get(key, 0 /* None */); - } - set(key, value) { - super.set(key, value, 2 /* AsNew */); - this.checkTrim(); - return this; - } - checkTrim() { - if (this.size > this._limit) { - this.trimOld(Math.round(this._limit * this._ratio)); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/marked/marked.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/marked/marked.js ***! - \************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * marked - a markdown parser - * Copyright (c) 2011-2020, Christopher Jeffrey. (MIT Licensed) - * https://github.com/markedjs/marked - */ - -/** - * DO NOT EDIT THIS FILE - * The code in this file is generated from files in ./src/ - */ - -(function (global, factory) { - true ? module.exports = factory() : - undefined; -}(this, (function () { 'use strict'; - - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } - - function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); - } - - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - - return arr2; - } - - function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); - } - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } - - var defaults = createCommonjsModule(function (module) { - function getDefaults() { - return { - baseUrl: null, - breaks: false, - gfm: true, - headerIds: true, - headerPrefix: '', - highlight: null, - langPrefix: 'language-', - mangle: true, - pedantic: false, - renderer: null, - sanitize: false, - sanitizer: null, - silent: false, - smartLists: false, - smartypants: false, - tokenizer: null, - walkTokens: null, - xhtml: false - }; - } - - function changeDefaults(newDefaults) { - module.exports.defaults = newDefaults; - } - - module.exports = { - defaults: getDefaults(), - getDefaults: getDefaults, - changeDefaults: changeDefaults - }; - }); - var defaults_1 = defaults.defaults; - var defaults_2 = defaults.getDefaults; - var defaults_3 = defaults.changeDefaults; - - /** - * Helpers - */ - var escapeTest = /[&<>"']/; - var escapeReplace = /[&<>"']/g; - var escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/; - var escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g; - var escapeReplacements = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - var getEscapeReplacement = function getEscapeReplacement(ch) { - return escapeReplacements[ch]; - }; - - function escape(html, encode) { - if (encode) { - if (escapeTest.test(html)) { - return html.replace(escapeReplace, getEscapeReplacement); - } - } else { - if (escapeTestNoEncode.test(html)) { - return html.replace(escapeReplaceNoEncode, getEscapeReplacement); - } - } - - return html; - } - - var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; - - function unescape(html) { - // explicitly match decimal, hex, and named HTML entities - return html.replace(unescapeTest, function (_, n) { - n = n.toLowerCase(); - if (n === 'colon') return ':'; - - if (n.charAt(0) === '#') { - return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)); - } - - return ''; - }); - } - - var caret = /(^|[^\[])\^/g; - - function edit(regex, opt) { - regex = regex.source || regex; - opt = opt || ''; - var obj = { - replace: function replace(name, val) { - val = val.source || val; - val = val.replace(caret, '$1'); - regex = regex.replace(name, val); - return obj; - }, - getRegex: function getRegex() { - return new RegExp(regex, opt); - } - }; - return obj; - } - - var nonWordAndColonTest = /[^\w:]/g; - var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; - - function cleanUrl(sanitize, base, href) { - if (sanitize) { - var prot; - - try { - prot = decodeURIComponent(unescape(href)).replace(nonWordAndColonTest, '').toLowerCase(); - } catch (e) { - return null; - } - - if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { - return null; - } - } - - if (base && !originIndependentUrl.test(href)) { - href = resolveUrl(base, href); - } - - try { - href = encodeURI(href).replace(/%25/g, '%'); - } catch (e) { - return null; - } - - return href; - } - - var baseUrls = {}; - var justDomain = /^[^:]+:\/*[^/]*$/; - var protocol = /^([^:]+:)[\s\S]*$/; - var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/; - - function resolveUrl(base, href) { - if (!baseUrls[' ' + base]) { - // we can ignore everything in base after the last slash of its path component, - // but we might need to add _that_ - // https://tools.ietf.org/html/rfc3986#section-3 - if (justDomain.test(base)) { - baseUrls[' ' + base] = base + '/'; - } else { - baseUrls[' ' + base] = rtrim(base, '/', true); - } - } - - base = baseUrls[' ' + base]; - var relativeBase = base.indexOf(':') === -1; - - if (href.substring(0, 2) === '//') { - if (relativeBase) { - return href; - } - - return base.replace(protocol, '$1') + href; - } else if (href.charAt(0) === '/') { - if (relativeBase) { - return href; - } - - return base.replace(domain, '$1') + href; - } else { - return base + href; - } - } - - var noopTest = { - exec: function noopTest() {} - }; - - function merge(obj) { - var i = 1, - target, - key; - - for (; i < arguments.length; i++) { - target = arguments[i]; - - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; - } - } - } - - return obj; - } - - function splitCells(tableRow, count) { - // ensure that every cell-delimiting pipe has a space - // before it to distinguish it from an escaped pipe - var row = tableRow.replace(/\|/g, function (match, offset, str) { - var escaped = false, - curr = offset; - - while (--curr >= 0 && str[curr] === '\\') { - escaped = !escaped; - } - - if (escaped) { - // odd number of slashes means | is escaped - // so we leave it alone - return '|'; - } else { - // add space before unescaped | - return ' |'; - } - }), - cells = row.split(/ \|/); - var i = 0; - - if (cells.length > count) { - cells.splice(count); - } else { - while (cells.length < count) { - cells.push(''); - } - } - - for (; i < cells.length; i++) { - // leading or trailing whitespace is ignored per the gfm spec - cells[i] = cells[i].trim().replace(/\\\|/g, '|'); - } - - return cells; - } // Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). - // /c*$/ is vulnerable to REDOS. - // invert: Remove suffix of non-c chars instead. Default falsey. - - - function rtrim(str, c, invert) { - var l = str.length; - - if (l === 0) { - return ''; - } // Length of suffix matching the invert condition. - - - var suffLen = 0; // Step left until we fail to match the invert condition. - - while (suffLen < l) { - var currChar = str.charAt(l - suffLen - 1); - - if (currChar === c && !invert) { - suffLen++; - } else if (currChar !== c && invert) { - suffLen++; - } else { - break; - } - } - - return str.substr(0, l - suffLen); - } - - function findClosingBracket(str, b) { - if (str.indexOf(b[1]) === -1) { - return -1; - } - - var l = str.length; - var level = 0, - i = 0; - - for (; i < l; i++) { - if (str[i] === '\\') { - i++; - } else if (str[i] === b[0]) { - level++; - } else if (str[i] === b[1]) { - level--; - - if (level < 0) { - return i; - } - } - } - - return -1; - } - - function checkSanitizeDeprecation(opt) { - if (opt && opt.sanitize && !opt.silent) { - // VS CODE CHANGE - // Disable logging about sanitize options. We already use insane after running the sanitizer - - // console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options'); - } - } - - var helpers = { - escape: escape, - unescape: unescape, - edit: edit, - cleanUrl: cleanUrl, - resolveUrl: resolveUrl, - noopTest: noopTest, - merge: merge, - splitCells: splitCells, - rtrim: rtrim, - findClosingBracket: findClosingBracket, - checkSanitizeDeprecation: checkSanitizeDeprecation - }; - - var defaults$1 = defaults.defaults; - var rtrim$1 = helpers.rtrim, - splitCells$1 = helpers.splitCells, - _escape = helpers.escape, - findClosingBracket$1 = helpers.findClosingBracket; - - function outputLink(cap, link, raw) { - var href = link.href; - var title = link.title ? _escape(link.title) : null; - var text = cap[1].replace(/\\([\[\]])/g, '$1'); - - if (cap[0].charAt(0) !== '!') { - return { - type: 'link', - raw: raw, - href: href, - title: title, - text: text - }; - } else { - return { - type: 'image', - raw: raw, - href: href, - title: title, - text: _escape(text) - }; - } - } - - function indentCodeCompensation(raw, text) { - var matchIndentToCode = raw.match(/^(\s+)(?:```)/); - - if (matchIndentToCode === null) { - return text; - } - - var indentToCode = matchIndentToCode[1]; - return text.split('\n').map(function (node) { - var matchIndentInNode = node.match(/^\s+/); - - if (matchIndentInNode === null) { - return node; - } - - var indentInNode = matchIndentInNode[0]; - - if (indentInNode.length >= indentToCode.length) { - return node.slice(indentToCode.length); - } - - return node; - }).join('\n'); - } - /** - * Tokenizer - */ - - - var Tokenizer_1 = /*#__PURE__*/function () { - function Tokenizer(options) { - this.options = options || defaults$1; - } - - var _proto = Tokenizer.prototype; - - _proto.space = function space(src) { - var cap = this.rules.block.newline.exec(src); - - if (cap) { - if (cap[0].length > 1) { - return { - type: 'space', - raw: cap[0] - }; - } - - return { - raw: '\n' - }; - } - }; - - _proto.code = function code(src, tokens) { - var cap = this.rules.block.code.exec(src); - - if (cap) { - var lastToken = tokens[tokens.length - 1]; // An indented code block cannot interrupt a paragraph. - - if (lastToken && lastToken.type === 'paragraph') { - return { - raw: cap[0], - text: cap[0].trimRight() - }; - } - - var text = cap[0].replace(/^ {4}/gm, ''); - return { - type: 'code', - raw: cap[0], - codeBlockStyle: 'indented', - text: !this.options.pedantic ? rtrim$1(text, '\n') : text - }; - } - }; - - _proto.fences = function fences(src) { - var cap = this.rules.block.fences.exec(src); - - if (cap) { - var raw = cap[0]; - var text = indentCodeCompensation(raw, cap[3] || ''); - return { - type: 'code', - raw: raw, - lang: cap[2] ? cap[2].trim() : cap[2], - text: text - }; - } - }; - - _proto.heading = function heading(src) { - var cap = this.rules.block.heading.exec(src); - - if (cap) { - return { - type: 'heading', - raw: cap[0], - depth: cap[1].length, - text: cap[2] - }; - } - }; - - _proto.nptable = function nptable(src) { - var cap = this.rules.block.nptable.exec(src); - - if (cap) { - var item = { - type: 'table', - header: splitCells$1(cap[1].replace(/^ *| *\| *$/g, '')), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [], - raw: cap[0] - }; - - if (item.header.length === item.align.length) { - var l = item.align.length; - var i; - - for (i = 0; i < l; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - l = item.cells.length; - - for (i = 0; i < l; i++) { - item.cells[i] = splitCells$1(item.cells[i], item.header.length); - } - - return item; - } - } - }; - - _proto.hr = function hr(src) { - var cap = this.rules.block.hr.exec(src); - - if (cap) { - return { - type: 'hr', - raw: cap[0] - }; - } - }; - - _proto.blockquote = function blockquote(src) { - var cap = this.rules.block.blockquote.exec(src); - - if (cap) { - var text = cap[0].replace(/^ *> ?/gm, ''); - return { - type: 'blockquote', - raw: cap[0], - text: text - }; - } - }; - - _proto.list = function list(src) { - var cap = this.rules.block.list.exec(src); - - if (cap) { - var raw = cap[0]; - var bull = cap[2]; - var isordered = bull.length > 1; - var isparen = bull[bull.length - 1] === ')'; - var list = { - type: 'list', - raw: raw, - ordered: isordered, - start: isordered ? +bull.slice(0, -1) : '', - loose: false, - items: [] - }; // Get each top-level item. - - var itemMatch = cap[0].match(this.rules.block.item); - var next = false, - item, - space, - b, - addBack, - loose, - istask, - ischecked; - var l = itemMatch.length; - - for (var i = 0; i < l; i++) { - item = itemMatch[i]; - raw = item; // Remove the list item's bullet - // so it is seen as the next token. - - space = item.length; - item = item.replace(/^ *([*+-]|\d+[.)]) */, ''); // Outdent whatever the - // list item contains. Hacky. - - if (~item.indexOf('\n ')) { - space -= item.length; - item = !this.options.pedantic ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') : item.replace(/^ {1,4}/gm, ''); - } // Determine whether the next list item belongs here. - // Backpedal if it does not belong in this list. - - - if (i !== l - 1) { - b = this.rules.block.bullet.exec(itemMatch[i + 1])[0]; - - if (isordered ? b.length === 1 || !isparen && b[b.length - 1] === ')' : b.length > 1 || this.options.smartLists && b !== bull) { - addBack = itemMatch.slice(i + 1).join('\n'); - list.raw = list.raw.substring(0, list.raw.length - addBack.length); - i = l - 1; - } - } // Determine whether item is loose or not. - // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ - // for discount behavior. - - - loose = next || /\n\n(?!\s*$)/.test(item); - - if (i !== l - 1) { - next = item.charAt(item.length - 1) === '\n'; - if (!loose) loose = next; - } - - if (loose) { - list.loose = true; - } // Check for task list items - - - istask = /^\[[ xX]\] /.test(item); - ischecked = undefined; - - if (istask) { - ischecked = item[1] !== ' '; - item = item.replace(/^\[[ xX]\] +/, ''); - } - - list.items.push({ - type: 'list_item', - raw: raw, - task: istask, - checked: ischecked, - loose: loose, - text: item - }); - } - - return list; - } - }; - - _proto.html = function html(src) { - var cap = this.rules.block.html.exec(src); - - if (cap) { - return { - type: this.options.sanitize ? 'paragraph' : 'html', - raw: cap[0], - pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), - text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]) : cap[0] - }; - } - }; - - _proto.def = function def(src) { - var cap = this.rules.block.def.exec(src); - - if (cap) { - if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1); - var tag = cap[1].toLowerCase().replace(/\s+/g, ' '); - return { - tag: tag, - raw: cap[0], - href: cap[2], - title: cap[3] - }; - } - }; - - _proto.table = function table(src) { - var cap = this.rules.block.table.exec(src); - - if (cap) { - var item = { - type: 'table', - header: splitCells$1(cap[1].replace(/^ *| *\| *$/g, '')), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] - }; - - if (item.header.length === item.align.length) { - item.raw = cap[0]; - var l = item.align.length; - var i; - - for (i = 0; i < l; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - l = item.cells.length; - - for (i = 0; i < l; i++) { - item.cells[i] = splitCells$1(item.cells[i].replace(/^ *\| *| *\| *$/g, ''), item.header.length); - } - - return item; - } - } - }; - - _proto.lheading = function lheading(src) { - var cap = this.rules.block.lheading.exec(src); - - if (cap) { - return { - type: 'heading', - raw: cap[0], - depth: cap[2].charAt(0) === '=' ? 1 : 2, - text: cap[1] - }; - } - }; - - _proto.paragraph = function paragraph(src) { - var cap = this.rules.block.paragraph.exec(src); - - if (cap) { - return { - type: 'paragraph', - raw: cap[0], - text: cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1] - }; - } - }; - - _proto.text = function text(src, tokens) { - var cap = this.rules.block.text.exec(src); - - if (cap) { - var lastToken = tokens[tokens.length - 1]; - - if (lastToken && lastToken.type === 'text') { - return { - raw: cap[0], - text: cap[0] - }; - } - - return { - type: 'text', - raw: cap[0], - text: cap[0] - }; - } - }; - - _proto.escape = function escape(src) { - var cap = this.rules.inline.escape.exec(src); - - if (cap) { - return { - type: 'escape', - raw: cap[0], - text: _escape(cap[1]) - }; - } - }; - - _proto.tag = function tag(src, inLink, inRawBlock) { - var cap = this.rules.inline.tag.exec(src); - - if (cap) { - if (!inLink && /^/i.test(cap[0])) { - inLink = false; - } - - if (!inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - inRawBlock = true; - } else if (inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - inRawBlock = false; - } - - return { - type: this.options.sanitize ? 'text' : 'html', - raw: cap[0], - inLink: inLink, - inRawBlock: inRawBlock, - text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]) : cap[0] - }; - } - }; - - _proto.link = function link(src) { - var cap = this.rules.inline.link.exec(src); - - if (cap) { - var lastParenIndex = findClosingBracket$1(cap[2], '()'); - - if (lastParenIndex > -1) { - var start = cap[0].indexOf('!') === 0 ? 5 : 4; - var linkLen = start + cap[1].length + lastParenIndex; - cap[2] = cap[2].substring(0, lastParenIndex); - cap[0] = cap[0].substring(0, linkLen).trim(); - cap[3] = ''; - } - - var href = cap[2]; - var title = ''; - - if (this.options.pedantic) { - var link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); - - if (link) { - href = link[1]; - title = link[3]; - } else { - title = ''; - } - } else { - title = cap[3] ? cap[3].slice(1, -1) : ''; - } - - href = href.trim().replace(/^<([\s\S]*)>$/, '$1'); - var token = outputLink(cap, { - href: href ? href.replace(this.rules.inline._escapes, '$1') : href, - title: title ? title.replace(this.rules.inline._escapes, '$1') : title - }, cap[0]); - return token; - } - }; - - _proto.reflink = function reflink(src, links) { - var cap; - - if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) { - var link = (cap[2] || cap[1]).replace(/\s+/g, ' '); - link = links[link.toLowerCase()]; - - if (!link || !link.href) { - var text = cap[0].charAt(0); - return { - type: 'text', - raw: text, - text: text - }; - } - - var token = outputLink(cap, link, cap[0]); - return token; - } - }; - - _proto.strong = function strong(src, maskedSrc, prevChar) { - if (prevChar === void 0) { - prevChar = ''; - } - - var match = this.rules.inline.strong.start.exec(src); - - if (match && (!match[1] || match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) { - maskedSrc = maskedSrc.slice(-1 * src.length); - var endReg = match[0] === '**' ? this.rules.inline.strong.endAst : this.rules.inline.strong.endUnd; - endReg.lastIndex = 0; - var cap; - - while ((match = endReg.exec(maskedSrc)) != null) { - cap = this.rules.inline.strong.middle.exec(maskedSrc.slice(0, match.index + 3)); - - if (cap) { - return { - type: 'strong', - raw: src.slice(0, cap[0].length), - text: src.slice(2, cap[0].length - 2) - }; - } - } - } - }; - - _proto.em = function em(src, maskedSrc, prevChar) { - if (prevChar === void 0) { - prevChar = ''; - } - - var match = this.rules.inline.em.start.exec(src); - - if (match && (!match[1] || match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) { - maskedSrc = maskedSrc.slice(-1 * src.length); - var endReg = match[0] === '*' ? this.rules.inline.em.endAst : this.rules.inline.em.endUnd; - endReg.lastIndex = 0; - var cap; - - while ((match = endReg.exec(maskedSrc)) != null) { - cap = this.rules.inline.em.middle.exec(maskedSrc.slice(0, match.index + 2)); - - if (cap) { - return { - type: 'em', - raw: src.slice(0, cap[0].length), - text: src.slice(1, cap[0].length - 1) - }; - } - } - } - }; - - _proto.codespan = function codespan(src) { - var cap = this.rules.inline.code.exec(src); - - if (cap) { - var text = cap[2].replace(/\n/g, ' '); - var hasNonSpaceChars = /[^ ]/.test(text); - var hasSpaceCharsOnBothEnds = text.startsWith(' ') && text.endsWith(' '); - - if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { - text = text.substring(1, text.length - 1); - } - - text = _escape(text, true); - return { - type: 'codespan', - raw: cap[0], - text: text - }; - } - }; - - _proto.br = function br(src) { - var cap = this.rules.inline.br.exec(src); - - if (cap) { - return { - type: 'br', - raw: cap[0] - }; - } - }; - - _proto.del = function del(src) { - var cap = this.rules.inline.del.exec(src); - - if (cap) { - return { - type: 'del', - raw: cap[0], - text: cap[1] - }; - } - }; - - _proto.autolink = function autolink(src, mangle) { - var cap = this.rules.inline.autolink.exec(src); - - if (cap) { - var text, href; - - if (cap[2] === '@') { - text = _escape(this.options.mangle ? mangle(cap[1]) : cap[1]); - href = 'mailto:' + text; - } else { - text = _escape(cap[1]); - href = text; - } - - return { - type: 'link', - raw: cap[0], - text: text, - href: href, - tokens: [{ - type: 'text', - raw: text, - text: text - }] - }; - } - }; - - _proto.url = function url(src, mangle) { - var cap; - - if (cap = this.rules.inline.url.exec(src)) { - var text, href; - - if (cap[2] === '@') { - text = _escape(this.options.mangle ? mangle(cap[0]) : cap[0]); - href = 'mailto:' + text; - } else { - // do extended autolink path validation - var prevCapZero; - - do { - prevCapZero = cap[0]; - cap[0] = this.rules.inline._backpedal.exec(cap[0])[0]; - } while (prevCapZero !== cap[0]); - - text = _escape(cap[0]); - - if (cap[1] === 'www.') { - href = 'http://' + text; - } else { - href = text; - } - } - - return { - type: 'link', - raw: cap[0], - text: text, - href: href, - tokens: [{ - type: 'text', - raw: text, - text: text - }] - }; - } - }; - - _proto.inlineText = function inlineText(src, inRawBlock, smartypants) { - var cap = this.rules.inline.text.exec(src); - - if (cap) { - var text; - - if (inRawBlock) { - text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]) : cap[0]; - } else { - text = _escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]); - } - - return { - type: 'text', - raw: cap[0], - text: text - }; - } - }; - - return Tokenizer; - }(); - - var noopTest$1 = helpers.noopTest, - edit$1 = helpers.edit, - merge$1 = helpers.merge; - /** - * Block-Level Grammar - */ - - var block = { - newline: /^\n+/, - code: /^( {4}[^\n]+\n*)+/, - fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/, - hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, - heading: /^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/, - blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, - list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: '^ {0,3}(?:' // optional indentation - + '<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) - + '|comment[^\\n]*(\\n+|$)' // (2) - + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3) - + '|\\n*|$)' // (4) - + '|\\n*|$)' // (5) - + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) - + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag - + '|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag - + ')', - def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, - nptable: noopTest$1, - table: noopTest$1, - lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/, - // regex template, placeholders will be replaced according to different paragraph - // interruption rules of commonmark and the original markdown spec: - _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/, - text: /^[^\n]+/ - }; - block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; - block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; - block.def = edit$1(block.def).replace('label', block._label).replace('title', block._title).getRegex(); - block.bullet = /(?:[*+-]|\d{1,9}[.)])/; - block.item = /^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/; - block.item = edit$1(block.item, 'gm').replace(/bull/g, block.bullet).getRegex(); - block.list = edit$1(block.list).replace(/bull/g, block.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block.def.source + ')').getRegex(); - block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul'; - block._comment = /|$)/; - block.html = edit$1(block.html, 'i').replace('comment', block._comment).replace('tag', block._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(); - block.paragraph = edit$1(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs - .replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks - .getRegex(); - block.blockquote = edit$1(block.blockquote).replace('paragraph', block.paragraph).getRegex(); - /** - * Normal Block Grammar - */ - - block.normal = merge$1({}, block); - /** - * GFM Block Grammar - */ - - block.gfm = merge$1({}, block.normal, { - nptable: '^ *([^|\\n ].*\\|.*)\\n' // Header - + ' *([-:]+ *\\|[-| :]*)' // Align - + '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', - // Cells - table: '^ *\\|(.+)\\n' // Header - + ' *\\|?( *[-:]+[-| :]*)' // Align - + '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells - - }); - block.gfm.nptable = edit$1(block.gfm.nptable).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks - .getRegex(); - block.gfm.table = edit$1(block.gfm.table).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', ')|<(?:script|pre|style|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks - .getRegex(); - /** - * Pedantic grammar (original John Gruber's loose markdown specification) - */ - - block.pedantic = merge$1({}, block.normal, { - html: edit$1('^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag - + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))').replace('comment', block._comment).replace(/tag/g, '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b').getRegex(), - def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, - heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/, - fences: noopTest$1, - // fences not supported - paragraph: edit$1(block.normal._paragraph).replace('hr', block.hr).replace('heading', ' *#{1,6} *[^\n]').replace('lheading', block.lheading).replace('blockquote', ' {0,3}>').replace('|fences', '').replace('|list', '').replace('|html', '').getRegex() - }); - /** - * Inline-Level Grammar - */ - - var inline = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: noopTest$1, - tag: '^comment' + '|^' // self-closing tag - + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag - + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. - + '|^' // declaration, e.g. - + '|^', - // CDATA section - link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, - nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, - reflinkSearch: 'reflink|nolink(?!\\()', - strong: { - start: /^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/, - // (1) returns if starts w/ punctuation - middle: /^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/, - endAst: /[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/, - // last char can't be punct, or final * must also be followed by punct (or endline) - endUnd: /[^\s]__(?!_)(?:(?=[punctuation\s])|$)/ // last char can't be a space, and final _ must preceed punct or \s (or endline) - - }, - em: { - start: /^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/, - // (1) returns if starts w/ punctuation - middle: /^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/, - endAst: /[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/, - // last char can't be punct, or final * must also be followed by punct (or endline) - endUnd: /[^\s]_(?!_)(?:(?=[punctuation\s])|$)/ // last char can't be a space, and final _ must preceed punct or \s (or endline) - - }, - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: noopTest$1, - text: /^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~'; - inline.punctuation = edit$1(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex(); // sequences em should skip over [title](link), `code`, - - inline._blockSkip = '\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>'; - inline._overlapSkip = '__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*'; - inline._comment = edit$1(block._comment).replace('(?:-->|$)', '-->').getRegex(); - inline.em.start = edit$1(inline.em.start).replace(/punctuation/g, inline._punctuation).getRegex(); - inline.em.middle = edit$1(inline.em.middle).replace(/punctuation/g, inline._punctuation).replace(/overlapSkip/g, inline._overlapSkip).getRegex(); - inline.em.endAst = edit$1(inline.em.endAst, 'g').replace(/punctuation/g, inline._punctuation).getRegex(); - inline.em.endUnd = edit$1(inline.em.endUnd, 'g').replace(/punctuation/g, inline._punctuation).getRegex(); - inline.strong.start = edit$1(inline.strong.start).replace(/punctuation/g, inline._punctuation).getRegex(); - inline.strong.middle = edit$1(inline.strong.middle).replace(/punctuation/g, inline._punctuation).replace(/blockSkip/g, inline._blockSkip).getRegex(); - inline.strong.endAst = edit$1(inline.strong.endAst, 'g').replace(/punctuation/g, inline._punctuation).getRegex(); - inline.strong.endUnd = edit$1(inline.strong.endUnd, 'g').replace(/punctuation/g, inline._punctuation).getRegex(); - inline.blockSkip = edit$1(inline._blockSkip, 'g').getRegex(); - inline.overlapSkip = edit$1(inline._overlapSkip, 'g').getRegex(); - inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g; - inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; - inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/; - inline.autolink = edit$1(inline.autolink).replace('scheme', inline._scheme).replace('email', inline._email).getRegex(); - inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; - inline.tag = edit$1(inline.tag).replace('comment', inline._comment).replace('attribute', inline._attribute).getRegex(); - inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/; - inline._href = /<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/; - inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; - inline.link = edit$1(inline.link).replace('label', inline._label).replace('href', inline._href).replace('title', inline._title).getRegex(); - inline.reflink = edit$1(inline.reflink).replace('label', inline._label).getRegex(); - inline.reflinkSearch = edit$1(inline.reflinkSearch, 'g').replace('reflink', inline.reflink).replace('nolink', inline.nolink).getRegex(); - /** - * Normal Inline Grammar - */ - - inline.normal = merge$1({}, inline); - /** - * Pedantic Inline Grammar - */ - - inline.pedantic = merge$1({}, inline.normal, { - strong: { - start: /^__|\*\*/, - middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - endAst: /\*\*(?!\*)/g, - endUnd: /__(?!_)/g - }, - em: { - start: /^_|\*/, - middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/, - endAst: /\*(?!\*)/g, - endUnd: /_(?!_)/g - }, - link: edit$1(/^!?\[(label)\]\((.*?)\)/).replace('label', inline._label).getRegex(), - reflink: edit$1(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace('label', inline._label).getRegex() - }); - /** - * GFM Inline Grammar - */ - - inline.gfm = merge$1({}, inline.normal, { - escape: edit$1(inline.escape).replace('])', '~|])').getRegex(), - _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, - url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, - _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, - del: /^~+(?=\S)([\s\S]*?\S)~+/, - text: /^(`+|[^`])(?:[\s\S]*?(?:(?=[\\ 0.5) { - ch = 'x' + ch.toString(16); - } - - out += '&#' + ch + ';'; - } - - return out; - } - /** - * Block Lexer - */ - - - var Lexer_1 = /*#__PURE__*/function () { - function Lexer(options) { - this.tokens = []; - this.tokens.links = Object.create(null); - this.options = options || defaults$2; - this.options.tokenizer = this.options.tokenizer || new Tokenizer_1(); - this.tokenizer = this.options.tokenizer; - this.tokenizer.options = this.options; - var rules = { - block: block$1.normal, - inline: inline$1.normal - }; - - if (this.options.pedantic) { - rules.block = block$1.pedantic; - rules.inline = inline$1.pedantic; - } else if (this.options.gfm) { - rules.block = block$1.gfm; - - if (this.options.breaks) { - rules.inline = inline$1.breaks; - } else { - rules.inline = inline$1.gfm; - } - } - - this.tokenizer.rules = rules; - } - /** - * Expose Rules - */ - - - /** - * Static Lex Method - */ - Lexer.lex = function lex(src, options) { - var lexer = new Lexer(options); - return lexer.lex(src); - } - /** - * Preprocessing - */ - ; - - var _proto = Lexer.prototype; - - _proto.lex = function lex(src) { - src = src.replace(/\r\n|\r/g, '\n').replace(/\t/g, ' '); - this.blockTokens(src, this.tokens, true); - this.inline(this.tokens); - return this.tokens; - } - /** - * Lexing - */ - ; - - _proto.blockTokens = function blockTokens(src, tokens, top) { - if (tokens === void 0) { - tokens = []; - } - - if (top === void 0) { - top = true; - } - - src = src.replace(/^ +$/gm, ''); - var token, i, l, lastToken; - - while (src) { - // newline - if (token = this.tokenizer.space(src)) { - src = src.substring(token.raw.length); - - if (token.type) { - tokens.push(token); - } - - continue; - } // code - - - if (token = this.tokenizer.code(src, tokens)) { - src = src.substring(token.raw.length); - - if (token.type) { - tokens.push(token); - } else { - lastToken = tokens[tokens.length - 1]; - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - } - - continue; - } // fences - - - if (token = this.tokenizer.fences(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // heading - - - if (token = this.tokenizer.heading(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // table no leading pipe (gfm) - - - if (token = this.tokenizer.nptable(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // hr - - - if (token = this.tokenizer.hr(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // blockquote - - - if (token = this.tokenizer.blockquote(src)) { - src = src.substring(token.raw.length); - token.tokens = this.blockTokens(token.text, [], top); - tokens.push(token); - continue; - } // list - - - if (token = this.tokenizer.list(src)) { - src = src.substring(token.raw.length); - l = token.items.length; - - for (i = 0; i < l; i++) { - token.items[i].tokens = this.blockTokens(token.items[i].text, [], false); - } - - tokens.push(token); - continue; - } // html - - - if (token = this.tokenizer.html(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // def - - - if (top && (token = this.tokenizer.def(src))) { - src = src.substring(token.raw.length); - - if (!this.tokens.links[token.tag]) { - this.tokens.links[token.tag] = { - href: token.href, - title: token.title - }; - } - - continue; - } // table (gfm) - - - if (token = this.tokenizer.table(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // lheading - - - if (token = this.tokenizer.lheading(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // top-level paragraph - - - if (top && (token = this.tokenizer.paragraph(src))) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // text - - - if (token = this.tokenizer.text(src, tokens)) { - src = src.substring(token.raw.length); - - if (token.type) { - tokens.push(token); - } else { - lastToken = tokens[tokens.length - 1]; - lastToken.raw += '\n' + token.raw; - lastToken.text += '\n' + token.text; - } - - continue; - } - - if (src) { - var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); - - if (this.options.silent) { - console.error(errMsg); - break; - } else { - throw new Error(errMsg); - } - } - } - - return tokens; - }; - - _proto.inline = function inline(tokens) { - var i, j, k, l2, row, token; - var l = tokens.length; - - for (i = 0; i < l; i++) { - token = tokens[i]; - - switch (token.type) { - case 'paragraph': - case 'text': - case 'heading': - { - token.tokens = []; - this.inlineTokens(token.text, token.tokens); - break; - } - - case 'table': - { - token.tokens = { - header: [], - cells: [] - }; // header - - l2 = token.header.length; - - for (j = 0; j < l2; j++) { - token.tokens.header[j] = []; - this.inlineTokens(token.header[j], token.tokens.header[j]); - } // cells - - - l2 = token.cells.length; - - for (j = 0; j < l2; j++) { - row = token.cells[j]; - token.tokens.cells[j] = []; - - for (k = 0; k < row.length; k++) { - token.tokens.cells[j][k] = []; - this.inlineTokens(row[k], token.tokens.cells[j][k]); - } - } - - break; - } - - case 'blockquote': - { - this.inline(token.tokens); - break; - } - - case 'list': - { - l2 = token.items.length; - - for (j = 0; j < l2; j++) { - this.inline(token.items[j].tokens); - } - - break; - } - } - } - - return tokens; - } - /** - * Lexing/Compiling - */ - ; - - _proto.inlineTokens = function inlineTokens(src, tokens, inLink, inRawBlock, prevChar) { - if (tokens === void 0) { - tokens = []; - } - - if (inLink === void 0) { - inLink = false; - } - - if (inRawBlock === void 0) { - inRawBlock = false; - } - - if (prevChar === void 0) { - prevChar = ''; - } - - var token; // String with links masked to avoid interference with em and strong - - var maskedSrc = src; - var match; // Mask out reflinks - - if (this.tokens.links) { - var links = Object.keys(this.tokens.links); - - if (links.length > 0) { - while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) { - if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex); - } - } - } - } // Mask out other blocks - - - while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { - maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); - } - - while (src) { - // escape - if (token = this.tokenizer.escape(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // tag - - - if (token = this.tokenizer.tag(src, inLink, inRawBlock)) { - src = src.substring(token.raw.length); - inLink = token.inLink; - inRawBlock = token.inRawBlock; - tokens.push(token); - continue; - } // link - - - if (token = this.tokenizer.link(src)) { - src = src.substring(token.raw.length); - - if (token.type === 'link') { - token.tokens = this.inlineTokens(token.text, [], true, inRawBlock); - } - - tokens.push(token); - continue; - } // reflink, nolink - - - if (token = this.tokenizer.reflink(src, this.tokens.links)) { - src = src.substring(token.raw.length); - - if (token.type === 'link') { - token.tokens = this.inlineTokens(token.text, [], true, inRawBlock); - } - - tokens.push(token); - continue; - } // strong - - - if (token = this.tokenizer.strong(src, maskedSrc, prevChar)) { - src = src.substring(token.raw.length); - token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock); - tokens.push(token); - continue; - } // em - - - if (token = this.tokenizer.em(src, maskedSrc, prevChar)) { - src = src.substring(token.raw.length); - token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock); - tokens.push(token); - continue; - } // code - - - if (token = this.tokenizer.codespan(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // br - - - if (token = this.tokenizer.br(src)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // del (gfm) - - - if (token = this.tokenizer.del(src)) { - src = src.substring(token.raw.length); - token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock); - tokens.push(token); - continue; - } // autolink - - - if (token = this.tokenizer.autolink(src, mangle)) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // url (gfm) - - - if (!inLink && (token = this.tokenizer.url(src, mangle))) { - src = src.substring(token.raw.length); - tokens.push(token); - continue; - } // text - - - if (token = this.tokenizer.inlineText(src, inRawBlock, smartypants)) { - src = src.substring(token.raw.length); - prevChar = token.raw.slice(-1); - tokens.push(token); - continue; - } - - if (src) { - var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); - - if (this.options.silent) { - console.error(errMsg); - break; - } else { - throw new Error(errMsg); - } - } - } - - return tokens; - }; - - _createClass(Lexer, null, [{ - key: "rules", - get: function get() { - return { - block: block$1, - inline: inline$1 - }; - } - }]); - - return Lexer; - }(); - - var defaults$3 = defaults.defaults; - var cleanUrl$1 = helpers.cleanUrl, - escape$1 = helpers.escape; - /** - * Renderer - */ - - var Renderer_1 = /*#__PURE__*/function () { - function Renderer(options) { - this.options = options || defaults$3; - } - - var _proto = Renderer.prototype; - - _proto.code = function code(_code, infostring, escaped) { - var lang = (infostring || '').match(/\S*/)[0]; - - if (this.options.highlight) { - var out = this.options.highlight(_code, lang); - - if (out != null && out !== _code) { - escaped = true; - _code = out; - } - } - - if (!lang) { - return '
' + (escaped ? _code : escape$1(_code, true)) + '
\n'; - } - - return '
' + (escaped ? _code : escape$1(_code, true)) + '
\n'; - }; - - _proto.blockquote = function blockquote(quote) { - return '
\n' + quote + '
\n'; - }; - - _proto.html = function html(_html) { - return _html; - }; - - _proto.heading = function heading(text, level, raw, slugger) { - if (this.options.headerIds) { - return '' + text + '\n'; - } // ignore IDs - - - return '' + text + '\n'; - }; - - _proto.hr = function hr() { - return this.options.xhtml ? '
\n' : '
\n'; - }; - - _proto.list = function list(body, ordered, start) { - var type = ordered ? 'ol' : 'ul', - startatt = ordered && start !== 1 ? ' start="' + start + '"' : ''; - return '<' + type + startatt + '>\n' + body + '\n'; - }; - - _proto.listitem = function listitem(text) { - return '
  • ' + text + '
  • \n'; - }; - - _proto.checkbox = function checkbox(checked) { - return ' '; - }; - - _proto.paragraph = function paragraph(text) { - return '

    ' + text + '

    \n'; - }; - - _proto.table = function table(header, body) { - if (body) body = '' + body + ''; - return '\n' + '\n' + header + '\n' + body + '
    \n'; - }; - - _proto.tablerow = function tablerow(content) { - return '\n' + content + '\n'; - }; - - _proto.tablecell = function tablecell(content, flags) { - var type = flags.header ? 'th' : 'td'; - var tag = flags.align ? '<' + type + ' align="' + flags.align + '">' : '<' + type + '>'; - return tag + content + '\n'; - } // span level renderer - ; - - _proto.strong = function strong(text) { - return '' + text + ''; - }; - - _proto.em = function em(text) { - return '' + text + ''; - }; - - _proto.codespan = function codespan(text) { - return '' + text + ''; - }; - - _proto.br = function br() { - return this.options.xhtml ? '
    ' : '
    '; - }; - - _proto.del = function del(text) { - return '' + text + ''; - }; - - _proto.link = function link(href, title, text) { - href = cleanUrl$1(this.options.sanitize, this.options.baseUrl, href); - - if (href === null) { - return text; - } - - var out = '
    '; - return out; - }; - - _proto.image = function image(href, title, text) { - href = cleanUrl$1(this.options.sanitize, this.options.baseUrl, href); - - if (href === null) { - return text; - } - - var out = '' + text + '' : '>'; - return out; - }; - - _proto.text = function text(_text) { - return _text; - }; - - return Renderer; - }(); - - /** - * TextRenderer - * returns only the textual part of the token - */ - var TextRenderer_1 = /*#__PURE__*/function () { - function TextRenderer() {} - - var _proto = TextRenderer.prototype; - - // no need for block level renderers - _proto.strong = function strong(text) { - return text; - }; - - _proto.em = function em(text) { - return text; - }; - - _proto.codespan = function codespan(text) { - return text; - }; - - _proto.del = function del(text) { - return text; - }; - - _proto.html = function html(text) { - return text; - }; - - _proto.text = function text(_text) { - return _text; - }; - - _proto.link = function link(href, title, text) { - return '' + text; - }; - - _proto.image = function image(href, title, text) { - return '' + text; - }; - - _proto.br = function br() { - return ''; - }; - - return TextRenderer; - }(); - - /** - * Slugger generates header id - */ - var Slugger_1 = /*#__PURE__*/function () { - function Slugger() { - this.seen = {}; - } - - var _proto = Slugger.prototype; - - _proto.serialize = function serialize(value) { - return value.toLowerCase().trim() // remove html tags - .replace(/<[!\/a-z].*?>/ig, '') // remove unwanted chars - .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '').replace(/\s/g, '-'); - } - /** - * Finds the next safe (unique) slug to use - */ - ; - - _proto.getNextSafeSlug = function getNextSafeSlug(originalSlug, isDryRun) { - var slug = originalSlug; - var occurenceAccumulator = 0; - - if (this.seen.hasOwnProperty(slug)) { - occurenceAccumulator = this.seen[originalSlug]; - - do { - occurenceAccumulator++; - slug = originalSlug + '-' + occurenceAccumulator; - } while (this.seen.hasOwnProperty(slug)); - } - - if (!isDryRun) { - this.seen[originalSlug] = occurenceAccumulator; - this.seen[slug] = 0; - } - - return slug; - } - /** - * Convert string to unique id - * @param {object} options - * @param {boolean} options.dryrun Generates the next unique slug without updating the internal accumulator. - */ - ; - - _proto.slug = function slug(value, options) { - if (options === void 0) { - options = {}; - } - - var slug = this.serialize(value); - return this.getNextSafeSlug(slug, options.dryrun); - }; - - return Slugger; - }(); - - var defaults$4 = defaults.defaults; - var unescape$1 = helpers.unescape; - /** - * Parsing & Compiling - */ - - var Parser_1 = /*#__PURE__*/function () { - function Parser(options) { - this.options = options || defaults$4; - this.options.renderer = this.options.renderer || new Renderer_1(); - this.renderer = this.options.renderer; - this.renderer.options = this.options; - this.textRenderer = new TextRenderer_1(); - this.slugger = new Slugger_1(); - } - /** - * Static Parse Method - */ - - - Parser.parse = function parse(tokens, options) { - var parser = new Parser(options); - return parser.parse(tokens); - } - /** - * Parse Loop - */ - ; - - var _proto = Parser.prototype; - - _proto.parse = function parse(tokens, top) { - if (top === void 0) { - top = true; - } - - var out = '', - i, - j, - k, - l2, - l3, - row, - cell, - header, - body, - token, - ordered, - start, - loose, - itemBody, - item, - checked, - task, - checkbox; - var l = tokens.length; - - for (i = 0; i < l; i++) { - token = tokens[i]; - - switch (token.type) { - case 'space': - { - continue; - } - - case 'hr': - { - out += this.renderer.hr(); - continue; - } - - case 'heading': - { - out += this.renderer.heading(this.parseInline(token.tokens), token.depth, unescape$1(this.parseInline(token.tokens, this.textRenderer)), this.slugger); - continue; - } - - case 'code': - { - out += this.renderer.code(token.text, token.lang, token.escaped); - continue; - } - - case 'table': - { - header = ''; // header - - cell = ''; - l2 = token.header.length; - - for (j = 0; j < l2; j++) { - cell += this.renderer.tablecell(this.parseInline(token.tokens.header[j]), { - header: true, - align: token.align[j] - }); - } - - header += this.renderer.tablerow(cell); - body = ''; - l2 = token.cells.length; - - for (j = 0; j < l2; j++) { - row = token.tokens.cells[j]; - cell = ''; - l3 = row.length; - - for (k = 0; k < l3; k++) { - cell += this.renderer.tablecell(this.parseInline(row[k]), { - header: false, - align: token.align[k] - }); - } - - body += this.renderer.tablerow(cell); - } - - out += this.renderer.table(header, body); - continue; - } - - case 'blockquote': - { - body = this.parse(token.tokens); - out += this.renderer.blockquote(body); - continue; - } - - case 'list': - { - ordered = token.ordered; - start = token.start; - loose = token.loose; - l2 = token.items.length; - body = ''; - - for (j = 0; j < l2; j++) { - item = token.items[j]; - checked = item.checked; - task = item.task; - itemBody = ''; - - if (item.task) { - checkbox = this.renderer.checkbox(checked); - - if (loose) { - if (item.tokens.length > 0 && item.tokens[0].type === 'text') { - item.tokens[0].text = checkbox + ' ' + item.tokens[0].text; - - if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') { - item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text; - } - } else { - item.tokens.unshift({ - type: 'text', - text: checkbox - }); - } - } else { - itemBody += checkbox; - } - } - - itemBody += this.parse(item.tokens, loose); - body += this.renderer.listitem(itemBody, task, checked); - } - - out += this.renderer.list(body, ordered, start); - continue; - } - - case 'html': - { - // TODO parse inline content if parameter markdown=1 - out += this.renderer.html(token.text); - continue; - } - - case 'paragraph': - { - out += this.renderer.paragraph(this.parseInline(token.tokens)); - continue; - } - - case 'text': - { - body = token.tokens ? this.parseInline(token.tokens) : token.text; - - while (i + 1 < l && tokens[i + 1].type === 'text') { - token = tokens[++i]; - body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text); - } - - out += top ? this.renderer.paragraph(body) : body; - continue; - } - - default: - { - var errMsg = 'Token with "' + token.type + '" type was not found.'; - - if (this.options.silent) { - console.error(errMsg); - return; - } else { - throw new Error(errMsg); - } - } - } - } - - return out; - } - /** - * Parse Inline Tokens - */ - ; - - _proto.parseInline = function parseInline(tokens, renderer) { - renderer = renderer || this.renderer; - var out = '', - i, - token; - var l = tokens.length; - - for (i = 0; i < l; i++) { - token = tokens[i]; - - switch (token.type) { - case 'escape': - { - out += renderer.text(token.text); - break; - } - - case 'html': - { - out += renderer.html(token.text); - break; - } - - case 'link': - { - out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer)); - break; - } - - case 'image': - { - out += renderer.image(token.href, token.title, token.text); - break; - } - - case 'strong': - { - out += renderer.strong(this.parseInline(token.tokens, renderer)); - break; - } - - case 'em': - { - out += renderer.em(this.parseInline(token.tokens, renderer)); - break; - } - - case 'codespan': - { - out += renderer.codespan(token.text); - break; - } - - case 'br': - { - out += renderer.br(); - break; - } - - case 'del': - { - out += renderer.del(this.parseInline(token.tokens, renderer)); - break; - } - - case 'text': - { - out += renderer.text(token.text); - break; - } - - default: - { - var errMsg = 'Token with "' + token.type + '" type was not found.'; - - if (this.options.silent) { - console.error(errMsg); - return; - } else { - throw new Error(errMsg); - } - } - } - } - - return out; - }; - - return Parser; - }(); - - var merge$2 = helpers.merge, - checkSanitizeDeprecation$1 = helpers.checkSanitizeDeprecation, - escape$2 = helpers.escape; - var getDefaults = defaults.getDefaults, - changeDefaults = defaults.changeDefaults, - defaults$5 = defaults.defaults; - /** - * Marked - */ - - function marked(src, opt, callback) { - // throw error in case of non string input - if (typeof src === 'undefined' || src === null) { - throw new Error('marked(): input parameter is undefined or null'); - } - - if (typeof src !== 'string') { - throw new Error('marked(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected'); - } - - if (typeof opt === 'function') { - callback = opt; - opt = null; - } - - opt = merge$2({}, marked.defaults, opt || {}); - checkSanitizeDeprecation$1(opt); - - if (callback) { - var highlight = opt.highlight; - var tokens; - - try { - tokens = Lexer_1.lex(src, opt); - } catch (e) { - return callback(e); - } - - var done = function done(err) { - var out; - - if (!err) { - try { - out = Parser_1.parse(tokens, opt); - } catch (e) { - err = e; - } - } - - opt.highlight = highlight; - return err ? callback(err) : callback(null, out); - }; - - if (!highlight || highlight.length < 3) { - return done(); - } - - delete opt.highlight; - if (!tokens.length) return done(); - var pending = 0; - marked.walkTokens(tokens, function (token) { - if (token.type === 'code') { - pending++; - setTimeout(function () { - highlight(token.text, token.lang, function (err, code) { - if (err) { - return done(err); - } - - if (code != null && code !== token.text) { - token.text = code; - token.escaped = true; - } - - pending--; - - if (pending === 0) { - done(); - } - }); - }, 0); - } - }); - - if (pending === 0) { - done(); - } - - return; - } - - try { - var _tokens = Lexer_1.lex(src, opt); - - if (opt.walkTokens) { - marked.walkTokens(_tokens, opt.walkTokens); - } - - return Parser_1.parse(_tokens, opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - - if (opt.silent) { - return '

    An error occurred:

    ' + escape$2(e.message + '', true) + '
    '; - } - - throw e; - } - } - /** - * Options - */ - - - marked.options = marked.setOptions = function (opt) { - merge$2(marked.defaults, opt); - changeDefaults(marked.defaults); - return marked; - }; - - marked.getDefaults = getDefaults; - marked.defaults = defaults$5; - /** - * Use Extension - */ - - marked.use = function (extension) { - var opts = merge$2({}, extension); - - if (extension.renderer) { - (function () { - var renderer = marked.defaults.renderer || new Renderer_1(); - - var _loop = function _loop(prop) { - var prevRenderer = renderer[prop]; - - renderer[prop] = function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var ret = extension.renderer[prop].apply(renderer, args); - - if (ret === false) { - ret = prevRenderer.apply(renderer, args); - } - - return ret; - }; - }; - - for (var prop in extension.renderer) { - _loop(prop); - } - - opts.renderer = renderer; - })(); - } - - if (extension.tokenizer) { - (function () { - var tokenizer = marked.defaults.tokenizer || new Tokenizer_1(); - - var _loop2 = function _loop2(prop) { - var prevTokenizer = tokenizer[prop]; - - tokenizer[prop] = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - var ret = extension.tokenizer[prop].apply(tokenizer, args); - - if (ret === false) { - ret = prevTokenizer.apply(tokenizer, args); - } - - return ret; - }; - }; - - for (var prop in extension.tokenizer) { - _loop2(prop); - } - - opts.tokenizer = tokenizer; - })(); - } - - if (extension.walkTokens) { - var walkTokens = marked.defaults.walkTokens; - - opts.walkTokens = function (token) { - extension.walkTokens(token); - - if (walkTokens) { - walkTokens(token); - } - }; - } - - marked.setOptions(opts); - }; - /** - * Run callback for every token - */ - - - marked.walkTokens = function (tokens, callback) { - for (var _iterator = _createForOfIteratorHelperLoose(tokens), _step; !(_step = _iterator()).done;) { - var token = _step.value; - callback(token); - - switch (token.type) { - case 'table': - { - for (var _iterator2 = _createForOfIteratorHelperLoose(token.tokens.header), _step2; !(_step2 = _iterator2()).done;) { - var cell = _step2.value; - marked.walkTokens(cell, callback); - } - - for (var _iterator3 = _createForOfIteratorHelperLoose(token.tokens.cells), _step3; !(_step3 = _iterator3()).done;) { - var row = _step3.value; - - for (var _iterator4 = _createForOfIteratorHelperLoose(row), _step4; !(_step4 = _iterator4()).done;) { - var _cell = _step4.value; - marked.walkTokens(_cell, callback); - } - } - - break; - } - - case 'list': - { - marked.walkTokens(token.items, callback); - break; - } - - default: - { - if (token.tokens) { - marked.walkTokens(token.tokens, callback); - } - } - } - } - }; - /** - * Expose - */ - - - marked.Parser = Parser_1; - marked.parser = Parser_1.parse; - marked.Renderer = Renderer_1; - marked.TextRenderer = TextRenderer_1; - marked.Lexer = Lexer_1; - marked.lexer = Lexer_1.lex; - marked.Tokenizer = Tokenizer_1; - marked.Slugger = Slugger_1; - marked.parse = marked; - var marked_1 = marked; - - return marked_1; - -}))); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/marshalling.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/marshalling.js ***! - \**********************************************************************/ -/*! exports provided: parse, revive */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "revive", function() { return revive; }); -/* harmony import */ var _buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./buffer.js */ "./node_modules/monaco-editor/esm/vs/base/common/buffer.js"); -/* harmony import */ var _uri_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -function parse(text) { - let data = JSON.parse(text); - data = revive(data); - return data; -} -function revive(obj, depth = 0) { - if (!obj || depth > 200) { - return obj; - } - if (typeof obj === 'object') { - switch (obj.$mid) { - case 1: return _uri_js__WEBPACK_IMPORTED_MODULE_1__["URI"].revive(obj); - case 2: return new RegExp(obj.source, obj.flags); - } - if (obj instanceof _buffer_js__WEBPACK_IMPORTED_MODULE_0__["VSBuffer"] - || obj instanceof Uint8Array) { - return obj; - } - if (Array.isArray(obj)) { - for (let i = 0; i < obj.length; ++i) { - obj[i] = revive(obj[i], depth + 1); - } - } - else { - // walk object - for (const key in obj) { - if (Object.hasOwnProperty.call(obj, key)) { - obj[key] = revive(obj[key], depth + 1); - } - } - } - } - return obj; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/mime.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/mime.js ***! - \***************************************************************/ -/*! exports provided: MIME_TEXT, MIME_UNKNOWN, registerTextMime, guessMimeTypes */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MIME_TEXT", function() { return MIME_TEXT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MIME_UNKNOWN", function() { return MIME_UNKNOWN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerTextMime", function() { return registerTextMime; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "guessMimeTypes", function() { return guessMimeTypes; }); -/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./path.js */ "./node_modules/monaco-editor/esm/vs/base/common/path.js"); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _glob_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./glob.js */ "./node_modules/monaco-editor/esm/vs/base/common/glob.js"); -/* harmony import */ var _network_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _resources_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -const MIME_TEXT = 'text/plain'; -const MIME_UNKNOWN = 'application/unknown'; -let registeredAssociations = []; -let nonUserRegisteredAssociations = []; -let userRegisteredAssociations = []; -/** - * Associate a text mime to the registry. - */ -function registerTextMime(association, warnOnOverwrite = false) { - // Register - const associationItem = toTextMimeAssociationItem(association); - registeredAssociations.push(associationItem); - if (!associationItem.userConfigured) { - nonUserRegisteredAssociations.push(associationItem); - } - else { - userRegisteredAssociations.push(associationItem); - } - // Check for conflicts unless this is a user configured association - if (warnOnOverwrite && !associationItem.userConfigured) { - registeredAssociations.forEach(a => { - if (a.mime === associationItem.mime || a.userConfigured) { - return; // same mime or userConfigured is ok - } - if (associationItem.extension && a.extension === associationItem.extension) { - console.warn(`Overwriting extension <<${associationItem.extension}>> to now point to mime <<${associationItem.mime}>>`); - } - if (associationItem.filename && a.filename === associationItem.filename) { - console.warn(`Overwriting filename <<${associationItem.filename}>> to now point to mime <<${associationItem.mime}>>`); - } - if (associationItem.filepattern && a.filepattern === associationItem.filepattern) { - console.warn(`Overwriting filepattern <<${associationItem.filepattern}>> to now point to mime <<${associationItem.mime}>>`); - } - if (associationItem.firstline && a.firstline === associationItem.firstline) { - console.warn(`Overwriting firstline <<${associationItem.firstline}>> to now point to mime <<${associationItem.mime}>>`); - } - }); - } -} -function toTextMimeAssociationItem(association) { - return { - id: association.id, - mime: association.mime, - filename: association.filename, - extension: association.extension, - filepattern: association.filepattern, - firstline: association.firstline, - userConfigured: association.userConfigured, - filenameLowercase: association.filename ? association.filename.toLowerCase() : undefined, - extensionLowercase: association.extension ? association.extension.toLowerCase() : undefined, - filepatternLowercase: association.filepattern ? association.filepattern.toLowerCase() : undefined, - filepatternOnPath: association.filepattern ? association.filepattern.indexOf(_path_js__WEBPACK_IMPORTED_MODULE_0__["posix"].sep) >= 0 : false - }; -} -/** - * Given a file, return the best matching mime type for it - */ -function guessMimeTypes(resource, firstLine) { - let path; - if (resource) { - switch (resource.scheme) { - case _network_js__WEBPACK_IMPORTED_MODULE_3__["Schemas"].file: - path = resource.fsPath; - break; - case _network_js__WEBPACK_IMPORTED_MODULE_3__["Schemas"].data: - const metadata = _resources_js__WEBPACK_IMPORTED_MODULE_4__["DataUri"].parseMetaData(resource); - path = metadata.get(_resources_js__WEBPACK_IMPORTED_MODULE_4__["DataUri"].META_DATA_LABEL); - break; - default: - path = resource.path; - } - } - if (!path) { - return [MIME_UNKNOWN]; - } - path = path.toLowerCase(); - const filename = Object(_path_js__WEBPACK_IMPORTED_MODULE_0__["basename"])(path); - // 1.) User configured mappings have highest priority - const configuredMime = guessMimeTypeByPath(path, filename, userRegisteredAssociations); - if (configuredMime) { - return [configuredMime, MIME_TEXT]; - } - // 2.) Registered mappings have middle priority - const registeredMime = guessMimeTypeByPath(path, filename, nonUserRegisteredAssociations); - if (registeredMime) { - return [registeredMime, MIME_TEXT]; - } - // 3.) Firstline has lowest priority - if (firstLine) { - const firstlineMime = guessMimeTypeByFirstline(firstLine); - if (firstlineMime) { - return [firstlineMime, MIME_TEXT]; - } - } - return [MIME_UNKNOWN]; -} -function guessMimeTypeByPath(path, filename, associations) { - let filenameMatch = null; - let patternMatch = null; - let extensionMatch = null; - // We want to prioritize associations based on the order they are registered so that the last registered - // association wins over all other. This is for https://github.com/Microsoft/vscode/issues/20074 - for (let i = associations.length - 1; i >= 0; i--) { - const association = associations[i]; - // First exact name match - if (filename === association.filenameLowercase) { - filenameMatch = association; - break; // take it! - } - // Longest pattern match - if (association.filepattern) { - if (!patternMatch || association.filepattern.length > patternMatch.filepattern.length) { - const target = association.filepatternOnPath ? path : filename; // match on full path if pattern contains path separator - if (Object(_glob_js__WEBPACK_IMPORTED_MODULE_2__["match"])(association.filepatternLowercase, target)) { - patternMatch = association; - } - } - } - // Longest extension match - if (association.extension) { - if (!extensionMatch || association.extension.length > extensionMatch.extension.length) { - if (filename.endsWith(association.extensionLowercase)) { - extensionMatch = association; - } - } - } - } - // 1.) Exact name match has second highest prio - if (filenameMatch) { - return filenameMatch.mime; - } - // 2.) Match on pattern - if (patternMatch) { - return patternMatch.mime; - } - // 3.) Match on extension comes next - if (extensionMatch) { - return extensionMatch.mime; - } - return null; -} -function guessMimeTypeByFirstline(firstLine) { - if (Object(_strings_js__WEBPACK_IMPORTED_MODULE_1__["startsWithUTF8BOM"])(firstLine)) { - firstLine = firstLine.substr(1); - } - if (firstLine.length > 0) { - // We want to prioritize associations based on the order they are registered so that the last registered - // association wins over all other. This is for https://github.com/Microsoft/vscode/issues/20074 - for (let i = registeredAssociations.length - 1; i >= 0; i--) { - const association = registeredAssociations[i]; - if (!association.firstline) { - continue; - } - const matches = firstLine.match(association.firstline); - if (matches && matches.length > 0) { - return association.mime; - } - } - } - return null; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/navigator.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/navigator.js ***! - \********************************************************************/ -/*! exports provided: ArrayNavigator */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayNavigator", function() { return ArrayNavigator; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class ArrayNavigator { - constructor(items, start = 0, end = items.length, index = start - 1) { - this.items = items; - this.start = start; - this.end = end; - this.index = index; - } - current() { - if (this.index === this.start - 1 || this.index === this.end) { - return null; - } - return this.items[this.index]; - } - next() { - this.index = Math.min(this.index + 1, this.end); - return this.current(); - } - previous() { - this.index = Math.max(this.index - 1, this.start - 1); - return this.current(); - } - first() { - this.index = this.start; - return this.current(); - } - last() { - this.index = this.end - 1; - return this.current(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/network.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/network.js ***! - \******************************************************************/ -/*! exports provided: Schemas, RemoteAuthorities */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Schemas", function() { return Schemas; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RemoteAuthorities", function() { return RemoteAuthorities; }); -/* harmony import */ var _uri_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -var Schemas; -(function (Schemas) { - /** - * A schema that is used for models that exist in memory - * only and that have no correspondence on a server or such. - */ - Schemas.inMemory = 'inmemory'; - /** - * A schema that is used for setting files - */ - Schemas.vscode = 'vscode'; - /** - * A schema that is used for internal private files - */ - Schemas.internal = 'private'; - /** - * A walk-through document. - */ - Schemas.walkThrough = 'walkThrough'; - /** - * An embedded code snippet. - */ - Schemas.walkThroughSnippet = 'walkThroughSnippet'; - Schemas.http = 'http'; - Schemas.https = 'https'; - Schemas.file = 'file'; - Schemas.mailto = 'mailto'; - Schemas.untitled = 'untitled'; - Schemas.data = 'data'; - Schemas.command = 'command'; - Schemas.vscodeRemote = 'vscode-remote'; - Schemas.vscodeRemoteResource = 'vscode-remote-resource'; - Schemas.userData = 'vscode-userdata'; - Schemas.vscodeCustomEditor = 'vscode-custom-editor'; - Schemas.vscodeNotebook = 'vscode-notebook'; - Schemas.vscodeNotebookCell = 'vscode-notebook-cell'; - Schemas.vscodeSettings = 'vscode-settings'; - Schemas.webviewPanel = 'webview-panel'; - /** - * Scheme used for loading the wrapper html and script in webviews. - */ - Schemas.vscodeWebview = 'vscode-webview'; - /** - * Scheme used for loading resources inside of webviews. - */ - Schemas.vscodeWebviewResource = 'vscode-webview-resource'; - /** - * Scheme used for extension pages - */ - Schemas.extension = 'extension'; -})(Schemas || (Schemas = {})); -class RemoteAuthoritiesImpl { - constructor() { - this._hosts = Object.create(null); - this._ports = Object.create(null); - this._connectionTokens = Object.create(null); - this._preferredWebSchema = 'http'; - this._delegate = null; - } - setPreferredWebSchema(schema) { - this._preferredWebSchema = schema; - } - rewrite(uri) { - if (this._delegate) { - return this._delegate(uri); - } - const authority = uri.authority; - let host = this._hosts[authority]; - if (host && host.indexOf(':') !== -1) { - host = `[${host}]`; - } - const port = this._ports[authority]; - const connectionToken = this._connectionTokens[authority]; - let query = `path=${encodeURIComponent(uri.path)}`; - if (typeof connectionToken === 'string') { - query += `&tkn=${encodeURIComponent(connectionToken)}`; - } - return _uri_js__WEBPACK_IMPORTED_MODULE_0__["URI"].from({ - scheme: _platform_js__WEBPACK_IMPORTED_MODULE_1__["isWeb"] ? this._preferredWebSchema : Schemas.vscodeRemoteResource, - authority: `${host}:${port}`, - path: `/vscode-remote-resource`, - query - }); - } -} -const RemoteAuthorities = new RemoteAuthoritiesImpl(); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/numbers.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/numbers.js ***! - \******************************************************************/ -/*! exports provided: clamp, MovingAverage */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return clamp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MovingAverage", function() { return MovingAverage; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function clamp(value, min, max) { - return Math.min(Math.max(value, min), max); -} -class MovingAverage { - constructor() { - this._n = 1; - this._val = 0; - } - update(value) { - this._val = this._val + (value - this._val) / this._n; - this._n += 1; - return this; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/objects.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/objects.js ***! - \******************************************************************/ -/*! exports provided: deepClone, deepFreeze, cloneAndChange, mixin, assign, equals, getOrDefault */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deepClone", function() { return deepClone; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deepFreeze", function() { return deepFreeze; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cloneAndChange", function() { return cloneAndChange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return mixin; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return assign; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOrDefault", function() { return getOrDefault; }); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -function deepClone(obj) { - if (!obj || typeof obj !== 'object') { - return obj; - } - if (obj instanceof RegExp) { - // See https://github.com/Microsoft/TypeScript/issues/10990 - return obj; - } - const result = Array.isArray(obj) ? [] : {}; - Object.keys(obj).forEach((key) => { - if (obj[key] && typeof obj[key] === 'object') { - result[key] = deepClone(obj[key]); - } - else { - result[key] = obj[key]; - } - }); - return result; -} -function deepFreeze(obj) { - if (!obj || typeof obj !== 'object') { - return obj; - } - const stack = [obj]; - while (stack.length > 0) { - const obj = stack.shift(); - Object.freeze(obj); - for (const key in obj) { - if (_hasOwnProperty.call(obj, key)) { - const prop = obj[key]; - if (typeof prop === 'object' && !Object.isFrozen(prop)) { - stack.push(prop); - } - } - } - } - return obj; -} -const _hasOwnProperty = Object.prototype.hasOwnProperty; -function cloneAndChange(obj, changer) { - return _cloneAndChange(obj, changer, new Set()); -} -function _cloneAndChange(obj, changer, seen) { - if (Object(_types_js__WEBPACK_IMPORTED_MODULE_0__["isUndefinedOrNull"])(obj)) { - return obj; - } - const changed = changer(obj); - if (typeof changed !== 'undefined') { - return changed; - } - if (Object(_types_js__WEBPACK_IMPORTED_MODULE_0__["isArray"])(obj)) { - const r1 = []; - for (const e of obj) { - r1.push(_cloneAndChange(e, changer, seen)); - } - return r1; - } - if (Object(_types_js__WEBPACK_IMPORTED_MODULE_0__["isObject"])(obj)) { - if (seen.has(obj)) { - throw new Error('Cannot clone recursive data-structure'); - } - seen.add(obj); - const r2 = {}; - for (let i2 in obj) { - if (_hasOwnProperty.call(obj, i2)) { - r2[i2] = _cloneAndChange(obj[i2], changer, seen); - } - } - seen.delete(obj); - return r2; - } - return obj; -} -/** - * Copies all properties of source into destination. The optional parameter "overwrite" allows to control - * if existing properties on the destination should be overwritten or not. Defaults to true (overwrite). - */ -function mixin(destination, source, overwrite = true) { - if (!Object(_types_js__WEBPACK_IMPORTED_MODULE_0__["isObject"])(destination)) { - return source; - } - if (Object(_types_js__WEBPACK_IMPORTED_MODULE_0__["isObject"])(source)) { - Object.keys(source).forEach(key => { - if (key in destination) { - if (overwrite) { - if (Object(_types_js__WEBPACK_IMPORTED_MODULE_0__["isObject"])(destination[key]) && Object(_types_js__WEBPACK_IMPORTED_MODULE_0__["isObject"])(source[key])) { - mixin(destination[key], source[key], overwrite); - } - else { - destination[key] = source[key]; - } - } - } - else { - destination[key] = source[key]; - } - }); - } - return destination; -} -function assign(destination, ...sources) { - sources.forEach(source => Object.keys(source).forEach(key => destination[key] = source[key])); - return destination; -} -function equals(one, other) { - if (one === other) { - return true; - } - if (one === null || one === undefined || other === null || other === undefined) { - return false; - } - if (typeof one !== typeof other) { - return false; - } - if (typeof one !== 'object') { - return false; - } - if ((Array.isArray(one)) !== (Array.isArray(other))) { - return false; - } - let i; - let key; - if (Array.isArray(one)) { - if (one.length !== other.length) { - return false; - } - for (i = 0; i < one.length; i++) { - if (!equals(one[i], other[i])) { - return false; - } - } - } - else { - const oneKeys = []; - for (key in one) { - oneKeys.push(key); - } - oneKeys.sort(); - const otherKeys = []; - for (key in other) { - otherKeys.push(key); - } - otherKeys.sort(); - if (!equals(oneKeys, otherKeys)) { - return false; - } - for (i = 0; i < oneKeys.length; i++) { - if (!equals(one[oneKeys[i]], other[oneKeys[i]])) { - return false; - } - } - } - return true; -} -function getOrDefault(obj, fn, defaultValue) { - const result = fn(obj); - return typeof result === 'undefined' ? defaultValue : result; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/path.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/path.js ***! - \***************************************************************/ -/*! exports provided: win32, posix, normalize, resolve, relative, dirname, basename, extname, sep */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "win32", function() { return win32; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "posix", function() { return posix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolve", function() { return resolve; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relative", function() { return relative; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return dirname; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basename", function() { return basename; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extname", function() { return extname; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sep", function() { return sep; }); -/* harmony import */ var _process_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./process.js */ "./node_modules/monaco-editor/esm/vs/base/common/process.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// NOTE: VSCode's copy of nodejs path library to be usable in common (non-node) namespace -// Copied from: https://github.com/nodejs/node/blob/v12.8.1/lib/path.js -/** - * Copyright Joyent, Inc. and other Node contributors. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to permit - * persons to whom the Software is furnished to do so, subject to the - * following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -const CHAR_UPPERCASE_A = 65; /* A */ -const CHAR_LOWERCASE_A = 97; /* a */ -const CHAR_UPPERCASE_Z = 90; /* Z */ -const CHAR_LOWERCASE_Z = 122; /* z */ -const CHAR_DOT = 46; /* . */ -const CHAR_FORWARD_SLASH = 47; /* / */ -const CHAR_BACKWARD_SLASH = 92; /* \ */ -const CHAR_COLON = 58; /* : */ -const CHAR_QUESTION_MARK = 63; /* ? */ -class ErrorInvalidArgType extends Error { - constructor(name, expected, actual) { - // determiner: 'must be' or 'must not be' - let determiner; - if (typeof expected === 'string' && expected.indexOf('not ') === 0) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } - else { - determiner = 'must be'; - } - const type = name.indexOf('.') !== -1 ? 'property' : 'argument'; - let msg = `The "${name}" ${type} ${determiner} of type ${expected}`; - msg += `. Received type ${typeof actual}`; - super(msg); - this.code = 'ERR_INVALID_ARG_TYPE'; - } -} -function validateString(value, name) { - if (typeof value !== 'string') { - throw new ErrorInvalidArgType(name, 'string', value); - } -} -function isPathSeparator(code) { - return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; -} -function isPosixPathSeparator(code) { - return code === CHAR_FORWARD_SLASH; -} -function isWindowsDeviceRoot(code) { - return code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z || - code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z; -} -// Resolves . and .. elements in a path with directory names -function normalizeString(path, allowAboveRoot, separator, isPathSeparator) { - let res = ''; - let lastSegmentLength = 0; - let lastSlash = -1; - let dots = 0; - let code = 0; - for (let i = 0; i <= path.length; ++i) { - if (i < path.length) { - code = path.charCodeAt(i); - } - else if (isPathSeparator(code)) { - break; - } - else { - code = CHAR_FORWARD_SLASH; - } - if (isPathSeparator(code)) { - if (lastSlash === i - 1 || dots === 1) { - // NOOP - } - else if (dots === 2) { - if (res.length < 2 || lastSegmentLength !== 2 || - res.charCodeAt(res.length - 1) !== CHAR_DOT || - res.charCodeAt(res.length - 2) !== CHAR_DOT) { - if (res.length > 2) { - const lastSlashIndex = res.lastIndexOf(separator); - if (lastSlashIndex === -1) { - res = ''; - lastSegmentLength = 0; - } - else { - res = res.slice(0, lastSlashIndex); - lastSegmentLength = res.length - 1 - res.lastIndexOf(separator); - } - lastSlash = i; - dots = 0; - continue; - } - else if (res.length !== 0) { - res = ''; - lastSegmentLength = 0; - lastSlash = i; - dots = 0; - continue; - } - } - if (allowAboveRoot) { - res += res.length > 0 ? `${separator}..` : '..'; - lastSegmentLength = 2; - } - } - else { - if (res.length > 0) { - res += `${separator}${path.slice(lastSlash + 1, i)}`; - } - else { - res = path.slice(lastSlash + 1, i); - } - lastSegmentLength = i - lastSlash - 1; - } - lastSlash = i; - dots = 0; - } - else if (code === CHAR_DOT && dots !== -1) { - ++dots; - } - else { - dots = -1; - } - } - return res; -} -function _format(sep, pathObject) { - if (pathObject === null || typeof pathObject !== 'object') { - throw new ErrorInvalidArgType('pathObject', 'Object', pathObject); - } - const dir = pathObject.dir || pathObject.root; - const base = pathObject.base || - `${pathObject.name || ''}${pathObject.ext || ''}`; - if (!dir) { - return base; - } - return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep}${base}`; -} -const win32 = { - // path.resolve([from ...], to) - resolve(...pathSegments) { - let resolvedDevice = ''; - let resolvedTail = ''; - let resolvedAbsolute = false; - for (let i = pathSegments.length - 1; i >= -1; i--) { - let path; - if (i >= 0) { - path = pathSegments[i]; - validateString(path, 'path'); - // Skip empty entries - if (path.length === 0) { - continue; - } - } - else if (resolvedDevice.length === 0) { - path = _process_js__WEBPACK_IMPORTED_MODULE_0__["cwd"](); - } - else { - // Windows has the concept of drive-specific current working - // directories. If we've resolved a drive letter but not yet an - // absolute path, get cwd for that drive, or the process cwd if - // the drive cwd is not available. We're sure the device is not - // a UNC path at this points, because UNC paths are always absolute. - path = _process_js__WEBPACK_IMPORTED_MODULE_0__["env"][`=${resolvedDevice}`] || _process_js__WEBPACK_IMPORTED_MODULE_0__["cwd"](); - // Verify that a cwd was found and that it actually points - // to our drive. If not, default to the drive's root. - if (path === undefined || - path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() && - path.charCodeAt(2) === CHAR_BACKWARD_SLASH) { - path = `${resolvedDevice}\\`; - } - } - const len = path.length; - let rootEnd = 0; - let device = ''; - let isAbsolute = false; - const code = path.charCodeAt(0); - // Try to match a root - if (len === 1) { - if (isPathSeparator(code)) { - // `path` contains just a path separator - rootEnd = 1; - isAbsolute = true; - } - } - else if (isPathSeparator(code)) { - // Possible UNC root - // If we started with a separator, we know we at least have an - // absolute path of some kind (UNC or otherwise) - isAbsolute = true; - if (isPathSeparator(path.charCodeAt(1))) { - // Matched double path separator at beginning - let j = 2; - let last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - const firstPart = path.slice(last, j); - // Matched! - last = j; - // Match 1 or more path separators - while (j < len && isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j === len || j !== last) { - // We matched a UNC root - device = `\\\\${firstPart}\\${path.slice(last, j)}`; - rootEnd = j; - } - } - } - } - else { - rootEnd = 1; - } - } - else if (isWindowsDeviceRoot(code) && - path.charCodeAt(1) === CHAR_COLON) { - // Possible device root - device = path.slice(0, 2); - rootEnd = 2; - if (len > 2 && isPathSeparator(path.charCodeAt(2))) { - // Treat separator following drive name as an absolute path - // indicator - isAbsolute = true; - rootEnd = 3; - } - } - if (device.length > 0) { - if (resolvedDevice.length > 0) { - if (device.toLowerCase() !== resolvedDevice.toLowerCase()) { - // This path points to another device so it is not applicable - continue; - } - } - else { - resolvedDevice = device; - } - } - if (resolvedAbsolute) { - if (resolvedDevice.length > 0) { - break; - } - } - else { - resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`; - resolvedAbsolute = isAbsolute; - if (isAbsolute && resolvedDevice.length > 0) { - break; - } - } - } - // At this point the path should be resolved to a full absolute path, - // but handle relative paths to be safe (might happen when process.cwd() - // fails) - // Normalize the tail path - resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparator); - return resolvedAbsolute ? - `${resolvedDevice}\\${resolvedTail}` : - `${resolvedDevice}${resolvedTail}` || '.'; - }, - normalize(path) { - validateString(path, 'path'); - const len = path.length; - if (len === 0) { - return '.'; - } - let rootEnd = 0; - let device; - let isAbsolute = false; - const code = path.charCodeAt(0); - // Try to match a root - if (len === 1) { - // `path` contains just a single char, exit early to avoid - // unnecessary work - return isPosixPathSeparator(code) ? '\\' : path; - } - if (isPathSeparator(code)) { - // Possible UNC root - // If we started with a separator, we know we at least have an absolute - // path of some kind (UNC or otherwise) - isAbsolute = true; - if (isPathSeparator(path.charCodeAt(1))) { - // Matched double path separator at beginning - let j = 2; - let last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - const firstPart = path.slice(last, j); - // Matched! - last = j; - // Match 1 or more path separators - while (j < len && isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j === len) { - // We matched a UNC root only - // Return the normalized version of the UNC root since there - // is nothing left to process - return `\\\\${firstPart}\\${path.slice(last)}\\`; - } - if (j !== last) { - // We matched a UNC root with leftovers - device = `\\\\${firstPart}\\${path.slice(last, j)}`; - rootEnd = j; - } - } - } - } - else { - rootEnd = 1; - } - } - else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { - // Possible device root - device = path.slice(0, 2); - rootEnd = 2; - if (len > 2 && isPathSeparator(path.charCodeAt(2))) { - // Treat separator following drive name as an absolute path - // indicator - isAbsolute = true; - rootEnd = 3; - } - } - let tail = rootEnd < len ? - normalizeString(path.slice(rootEnd), !isAbsolute, '\\', isPathSeparator) : - ''; - if (tail.length === 0 && !isAbsolute) { - tail = '.'; - } - if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) { - tail += '\\'; - } - if (device === undefined) { - return isAbsolute ? `\\${tail}` : tail; - } - return isAbsolute ? `${device}\\${tail}` : `${device}${tail}`; - }, - isAbsolute(path) { - validateString(path, 'path'); - const len = path.length; - if (len === 0) { - return false; - } - const code = path.charCodeAt(0); - return isPathSeparator(code) || - // Possible device root - len > 2 && - isWindowsDeviceRoot(code) && - path.charCodeAt(1) === CHAR_COLON && - isPathSeparator(path.charCodeAt(2)); - }, - join(...paths) { - if (paths.length === 0) { - return '.'; - } - let joined; - let firstPart; - for (let i = 0; i < paths.length; ++i) { - const arg = paths[i]; - validateString(arg, 'path'); - if (arg.length > 0) { - if (joined === undefined) { - joined = firstPart = arg; - } - else { - joined += `\\${arg}`; - } - } - } - if (joined === undefined) { - return '.'; - } - // Make sure that the joined path doesn't start with two slashes, because - // normalize() will mistake it for an UNC path then. - // - // This step is skipped when it is very clear that the user actually - // intended to point at an UNC path. This is assumed when the first - // non-empty string arguments starts with exactly two slashes followed by - // at least one more non-slash character. - // - // Note that for normalize() to treat a path as an UNC path it needs to - // have at least 2 components, so we don't filter for that here. - // This means that the user can use join to construct UNC paths from - // a server name and a share name; for example: - // path.join('//server', 'share') -> '\\\\server\\share\\') - let needsReplace = true; - let slashCount = 0; - if (typeof firstPart === 'string' && isPathSeparator(firstPart.charCodeAt(0))) { - ++slashCount; - const firstLen = firstPart.length; - if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) { - ++slashCount; - if (firstLen > 2) { - if (isPathSeparator(firstPart.charCodeAt(2))) { - ++slashCount; - } - else { - // We matched a UNC path in the first part - needsReplace = false; - } - } - } - } - if (needsReplace) { - // Find any more consecutive slashes we need to replace - while (slashCount < joined.length && - isPathSeparator(joined.charCodeAt(slashCount))) { - slashCount++; - } - // Replace the slashes if needed - if (slashCount >= 2) { - joined = `\\${joined.slice(slashCount)}`; - } - } - return win32.normalize(joined); - }, - // It will solve the relative path from `from` to `to`, for instance: - // from = 'C:\\orandea\\test\\aaa' - // to = 'C:\\orandea\\impl\\bbb' - // The output of the function should be: '..\\..\\impl\\bbb' - relative(from, to) { - validateString(from, 'from'); - validateString(to, 'to'); - if (from === to) { - return ''; - } - const fromOrig = win32.resolve(from); - const toOrig = win32.resolve(to); - if (fromOrig === toOrig) { - return ''; - } - from = fromOrig.toLowerCase(); - to = toOrig.toLowerCase(); - if (from === to) { - return ''; - } - // Trim any leading backslashes - let fromStart = 0; - while (fromStart < from.length && - from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) { - fromStart++; - } - // Trim trailing backslashes (applicable to UNC paths only) - let fromEnd = from.length; - while (fromEnd - 1 > fromStart && - from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) { - fromEnd--; - } - const fromLen = fromEnd - fromStart; - // Trim any leading backslashes - let toStart = 0; - while (toStart < to.length && - to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) { - toStart++; - } - // Trim trailing backslashes (applicable to UNC paths only) - let toEnd = to.length; - while (toEnd - 1 > toStart && - to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) { - toEnd--; - } - const toLen = toEnd - toStart; - // Compare paths to find the longest common path from root - const length = fromLen < toLen ? fromLen : toLen; - let lastCommonSep = -1; - let i = 0; - for (; i < length; i++) { - const fromCode = from.charCodeAt(fromStart + i); - if (fromCode !== to.charCodeAt(toStart + i)) { - break; - } - else if (fromCode === CHAR_BACKWARD_SLASH) { - lastCommonSep = i; - } - } - // We found a mismatch before the first common path separator was seen, so - // return the original `to`. - if (i !== length) { - if (lastCommonSep === -1) { - return toOrig; - } - } - else { - if (toLen > length) { - if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) { - // We get here if `from` is the exact base path for `to`. - // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz' - return toOrig.slice(toStart + i + 1); - } - if (i === 2) { - // We get here if `from` is the device root. - // For example: from='C:\\'; to='C:\\foo' - return toOrig.slice(toStart + i); - } - } - if (fromLen > length) { - if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) { - // We get here if `to` is the exact base path for `from`. - // For example: from='C:\\foo\\bar'; to='C:\\foo' - lastCommonSep = i; - } - else if (i === 2) { - // We get here if `to` is the device root. - // For example: from='C:\\foo\\bar'; to='C:\\' - lastCommonSep = 3; - } - } - if (lastCommonSep === -1) { - lastCommonSep = 0; - } - } - let out = ''; - // Generate the relative path based on the path difference between `to` and - // `from` - for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { - if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) { - out += out.length === 0 ? '..' : '\\..'; - } - } - toStart += lastCommonSep; - // Lastly, append the rest of the destination (`to`) path that comes after - // the common path parts - if (out.length > 0) { - return `${out}${toOrig.slice(toStart, toEnd)}`; - } - if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) { - ++toStart; - } - return toOrig.slice(toStart, toEnd); - }, - toNamespacedPath(path) { - // Note: this will *probably* throw somewhere. - if (typeof path !== 'string') { - return path; - } - if (path.length === 0) { - return ''; - } - const resolvedPath = win32.resolve(path); - if (resolvedPath.length <= 2) { - return path; - } - if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) { - // Possible UNC root - if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) { - const code = resolvedPath.charCodeAt(2); - if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) { - // Matched non-long UNC root, convert the path to a long UNC path - return `\\\\?\\UNC\\${resolvedPath.slice(2)}`; - } - } - } - else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) && - resolvedPath.charCodeAt(1) === CHAR_COLON && - resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) { - // Matched device root, convert the path to a long UNC path - return `\\\\?\\${resolvedPath}`; - } - return path; - }, - dirname(path) { - validateString(path, 'path'); - const len = path.length; - if (len === 0) { - return '.'; - } - let rootEnd = -1; - let offset = 0; - const code = path.charCodeAt(0); - if (len === 1) { - // `path` contains just a path separator, exit early to avoid - // unnecessary work or a dot. - return isPathSeparator(code) ? path : '.'; - } - // Try to match a root - if (isPathSeparator(code)) { - // Possible UNC root - rootEnd = offset = 1; - if (isPathSeparator(path.charCodeAt(1))) { - // Matched double path separator at beginning - let j = 2; - let last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more path separators - while (j < len && isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j === len) { - // We matched a UNC root only - return path; - } - if (j !== last) { - // We matched a UNC root with leftovers - // Offset by 1 to include the separator after the UNC root to - // treat it as a "normal root" on top of a (UNC) root - rootEnd = offset = j + 1; - } - } - } - } - // Possible device root - } - else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { - rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2; - offset = rootEnd; - } - let end = -1; - let matchedSlash = true; - for (let i = len - 1; i >= offset; --i) { - if (isPathSeparator(path.charCodeAt(i))) { - if (!matchedSlash) { - end = i; - break; - } - } - else { - // We saw the first non-path separator - matchedSlash = false; - } - } - if (end === -1) { - if (rootEnd === -1) { - return '.'; - } - end = rootEnd; - } - return path.slice(0, end); - }, - basename(path, ext) { - if (ext !== undefined) { - validateString(ext, 'ext'); - } - validateString(path, 'path'); - let start = 0; - let end = -1; - let matchedSlash = true; - let i; - // Check for a drive letter prefix so as not to mistake the following - // path separator as an extra separator at the end of the path that can be - // disregarded - if (path.length >= 2 && - isWindowsDeviceRoot(path.charCodeAt(0)) && - path.charCodeAt(1) === CHAR_COLON) { - start = 2; - } - if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { - if (ext === path) { - return ''; - } - let extIdx = ext.length - 1; - let firstNonSlashEnd = -1; - for (i = path.length - 1; i >= start; --i) { - const code = path.charCodeAt(i); - if (isPathSeparator(code)) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } - else { - if (firstNonSlashEnd === -1) { - // We saw the first non-path separator, remember this index in case - // we need it if the extension ends up not matching - matchedSlash = false; - firstNonSlashEnd = i + 1; - } - if (extIdx >= 0) { - // Try to match the explicit extension - if (code === ext.charCodeAt(extIdx)) { - if (--extIdx === -1) { - // We matched the extension, so mark this as the end of our path - // component - end = i; - } - } - else { - // Extension does not match, so our result is the entire path - // component - extIdx = -1; - end = firstNonSlashEnd; - } - } - } - } - if (start === end) { - end = firstNonSlashEnd; - } - else if (end === -1) { - end = path.length; - } - return path.slice(start, end); - } - for (i = path.length - 1; i >= start; --i) { - if (isPathSeparator(path.charCodeAt(i))) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } - else if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // path component - matchedSlash = false; - end = i + 1; - } - } - if (end === -1) { - return ''; - } - return path.slice(start, end); - }, - extname(path) { - validateString(path, 'path'); - let start = 0; - let startDot = -1; - let startPart = 0; - let end = -1; - let matchedSlash = true; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - let preDotState = 0; - // Check for a drive letter prefix so as not to mistake the following - // path separator as an extra separator at the end of the path that can be - // disregarded - if (path.length >= 2 && - path.charCodeAt(1) === CHAR_COLON && - isWindowsDeviceRoot(path.charCodeAt(0))) { - start = startPart = 2; - } - for (let i = path.length - 1; i >= start; --i) { - const code = path.charCodeAt(i); - if (isPathSeparator(code)) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === CHAR_DOT) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) { - startDot = i; - } - else if (preDotState !== 1) { - preDotState = 1; - } - } - else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if (startDot === -1 || - end === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1)) { - return ''; - } - return path.slice(startDot, end); - }, - format: _format.bind(null, '\\'), - parse(path) { - validateString(path, 'path'); - const ret = { root: '', dir: '', base: '', ext: '', name: '' }; - if (path.length === 0) { - return ret; - } - const len = path.length; - let rootEnd = 0; - let code = path.charCodeAt(0); - if (len === 1) { - if (isPathSeparator(code)) { - // `path` contains just a path separator, exit early to avoid - // unnecessary work - ret.root = ret.dir = path; - return ret; - } - ret.base = ret.name = path; - return ret; - } - // Try to match a root - if (isPathSeparator(code)) { - // Possible UNC root - rootEnd = 1; - if (isPathSeparator(path.charCodeAt(1))) { - // Matched double path separator at beginning - let j = 2; - let last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more path separators - while (j < len && isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j === len) { - // We matched a UNC root only - rootEnd = j; - } - else if (j !== last) { - // We matched a UNC root with leftovers - rootEnd = j + 1; - } - } - } - } - } - else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { - // Possible device root - if (len <= 2) { - // `path` contains just a drive root, exit early to avoid - // unnecessary work - ret.root = ret.dir = path; - return ret; - } - rootEnd = 2; - if (isPathSeparator(path.charCodeAt(2))) { - if (len === 3) { - // `path` contains just a drive root, exit early to avoid - // unnecessary work - ret.root = ret.dir = path; - return ret; - } - rootEnd = 3; - } - } - if (rootEnd > 0) { - ret.root = path.slice(0, rootEnd); - } - let startDot = -1; - let startPart = rootEnd; - let end = -1; - let matchedSlash = true; - let i = path.length - 1; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - let preDotState = 0; - // Get non-dir info - for (; i >= rootEnd; --i) { - code = path.charCodeAt(i); - if (isPathSeparator(code)) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === CHAR_DOT) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) { - startDot = i; - } - else if (preDotState !== 1) { - preDotState = 1; - } - } - else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if (end !== -1) { - if (startDot === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1)) { - ret.base = ret.name = path.slice(startPart, end); - } - else { - ret.name = path.slice(startPart, startDot); - ret.base = path.slice(startPart, end); - ret.ext = path.slice(startDot, end); - } - } - // If the directory is the root, use the entire root as the `dir` including - // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the - // trailing slash (`C:\abc\def` -> `C:\abc`). - if (startPart > 0 && startPart !== rootEnd) { - ret.dir = path.slice(0, startPart - 1); - } - else { - ret.dir = ret.root; - } - return ret; - }, - sep: '\\', - delimiter: ';', - win32: null, - posix: null -}; -const posix = { - // path.resolve([from ...], to) - resolve(...pathSegments) { - let resolvedPath = ''; - let resolvedAbsolute = false; - for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - const path = i >= 0 ? pathSegments[i] : _process_js__WEBPACK_IMPORTED_MODULE_0__["cwd"](); - validateString(path, 'path'); - // Skip empty entries - if (path.length === 0) { - continue; - } - resolvedPath = `${path}/${resolvedPath}`; - resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; - } - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - // Normalize the path - resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, '/', isPosixPathSeparator); - if (resolvedAbsolute) { - return `/${resolvedPath}`; - } - return resolvedPath.length > 0 ? resolvedPath : '.'; - }, - normalize(path) { - validateString(path, 'path'); - if (path.length === 0) { - return '.'; - } - const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; - const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH; - // Normalize the path - path = normalizeString(path, !isAbsolute, '/', isPosixPathSeparator); - if (path.length === 0) { - if (isAbsolute) { - return '/'; - } - return trailingSeparator ? './' : '.'; - } - if (trailingSeparator) { - path += '/'; - } - return isAbsolute ? `/${path}` : path; - }, - isAbsolute(path) { - validateString(path, 'path'); - return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH; - }, - join(...paths) { - if (paths.length === 0) { - return '.'; - } - let joined; - for (let i = 0; i < paths.length; ++i) { - const arg = paths[i]; - validateString(arg, 'path'); - if (arg.length > 0) { - if (joined === undefined) { - joined = arg; - } - else { - joined += `/${arg}`; - } - } - } - if (joined === undefined) { - return '.'; - } - return posix.normalize(joined); - }, - relative(from, to) { - validateString(from, 'from'); - validateString(to, 'to'); - if (from === to) { - return ''; - } - // Trim leading forward slashes. - from = posix.resolve(from); - to = posix.resolve(to); - if (from === to) { - return ''; - } - const fromStart = 1; - const fromEnd = from.length; - const fromLen = fromEnd - fromStart; - const toStart = 1; - const toLen = to.length - toStart; - // Compare paths to find the longest common path from root - const length = (fromLen < toLen ? fromLen : toLen); - let lastCommonSep = -1; - let i = 0; - for (; i < length; i++) { - const fromCode = from.charCodeAt(fromStart + i); - if (fromCode !== to.charCodeAt(toStart + i)) { - break; - } - else if (fromCode === CHAR_FORWARD_SLASH) { - lastCommonSep = i; - } - } - if (i === length) { - if (toLen > length) { - if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) { - // We get here if `from` is the exact base path for `to`. - // For example: from='/foo/bar'; to='/foo/bar/baz' - return to.slice(toStart + i + 1); - } - if (i === 0) { - // We get here if `from` is the root - // For example: from='/'; to='/foo' - return to.slice(toStart + i); - } - } - else if (fromLen > length) { - if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) { - // We get here if `to` is the exact base path for `from`. - // For example: from='/foo/bar/baz'; to='/foo/bar' - lastCommonSep = i; - } - else if (i === 0) { - // We get here if `to` is the root. - // For example: from='/foo/bar'; to='/' - lastCommonSep = 0; - } - } - } - let out = ''; - // Generate the relative path based on the path difference between `to` - // and `from`. - for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { - if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) { - out += out.length === 0 ? '..' : '/..'; - } - } - // Lastly, append the rest of the destination (`to`) path that comes after - // the common path parts. - return `${out}${to.slice(toStart + lastCommonSep)}`; - }, - toNamespacedPath(path) { - // Non-op on posix systems - return path; - }, - dirname(path) { - validateString(path, 'path'); - if (path.length === 0) { - return '.'; - } - const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH; - let end = -1; - let matchedSlash = true; - for (let i = path.length - 1; i >= 1; --i) { - if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { - if (!matchedSlash) { - end = i; - break; - } - } - else { - // We saw the first non-path separator - matchedSlash = false; - } - } - if (end === -1) { - return hasRoot ? '/' : '.'; - } - if (hasRoot && end === 1) { - return '//'; - } - return path.slice(0, end); - }, - basename(path, ext) { - if (ext !== undefined) { - validateString(ext, 'ext'); - } - validateString(path, 'path'); - let start = 0; - let end = -1; - let matchedSlash = true; - let i; - if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { - if (ext === path) { - return ''; - } - let extIdx = ext.length - 1; - let firstNonSlashEnd = -1; - for (i = path.length - 1; i >= 0; --i) { - const code = path.charCodeAt(i); - if (code === CHAR_FORWARD_SLASH) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } - else { - if (firstNonSlashEnd === -1) { - // We saw the first non-path separator, remember this index in case - // we need it if the extension ends up not matching - matchedSlash = false; - firstNonSlashEnd = i + 1; - } - if (extIdx >= 0) { - // Try to match the explicit extension - if (code === ext.charCodeAt(extIdx)) { - if (--extIdx === -1) { - // We matched the extension, so mark this as the end of our path - // component - end = i; - } - } - else { - // Extension does not match, so our result is the entire path - // component - extIdx = -1; - end = firstNonSlashEnd; - } - } - } - } - if (start === end) { - end = firstNonSlashEnd; - } - else if (end === -1) { - end = path.length; - } - return path.slice(start, end); - } - for (i = path.length - 1; i >= 0; --i) { - if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } - else if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // path component - matchedSlash = false; - end = i + 1; - } - } - if (end === -1) { - return ''; - } - return path.slice(start, end); - }, - extname(path) { - validateString(path, 'path'); - let startDot = -1; - let startPart = 0; - let end = -1; - let matchedSlash = true; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - let preDotState = 0; - for (let i = path.length - 1; i >= 0; --i) { - const code = path.charCodeAt(i); - if (code === CHAR_FORWARD_SLASH) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === CHAR_DOT) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) { - startDot = i; - } - else if (preDotState !== 1) { - preDotState = 1; - } - } - else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if (startDot === -1 || - end === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1)) { - return ''; - } - return path.slice(startDot, end); - }, - format: _format.bind(null, '/'), - parse(path) { - validateString(path, 'path'); - const ret = { root: '', dir: '', base: '', ext: '', name: '' }; - if (path.length === 0) { - return ret; - } - const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; - let start; - if (isAbsolute) { - ret.root = '/'; - start = 1; - } - else { - start = 0; - } - let startDot = -1; - let startPart = 0; - let end = -1; - let matchedSlash = true; - let i = path.length - 1; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - let preDotState = 0; - // Get non-dir info - for (; i >= start; --i) { - const code = path.charCodeAt(i); - if (code === CHAR_FORWARD_SLASH) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === CHAR_DOT) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) { - startDot = i; - } - else if (preDotState !== 1) { - preDotState = 1; - } - } - else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if (end !== -1) { - const start = startPart === 0 && isAbsolute ? 1 : startPart; - if (startDot === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1)) { - ret.base = ret.name = path.slice(start, end); - } - else { - ret.name = path.slice(start, startDot); - ret.base = path.slice(start, end); - ret.ext = path.slice(startDot, end); - } - } - if (startPart > 0) { - ret.dir = path.slice(0, startPart - 1); - } - else if (isAbsolute) { - ret.dir = '/'; - } - return ret; - }, - sep: '/', - delimiter: ':', - win32: null, - posix: null -}; -posix.win32 = win32.win32 = win32; -posix.posix = win32.posix = posix; -const normalize = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.normalize : posix.normalize); -const resolve = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.resolve : posix.resolve); -const relative = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.relative : posix.relative); -const dirname = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.dirname : posix.dirname); -const basename = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.basename : posix.basename); -const extname = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.extname : posix.extname); -const sep = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.sep : posix.sep); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/platform.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/platform.js ***! - \*******************************************************************/ -/*! exports provided: isWindows, isMacintosh, isLinux, isNative, isWeb, isIOS, globals, setImmediate, OS, isLittleEndian */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(process, global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWindows", function() { return isWindows; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMacintosh", function() { return isMacintosh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinux", function() { return isLinux; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return isNative; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWeb", function() { return isWeb; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIOS", function() { return isIOS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "globals", function() { return globals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setImmediate", function() { return setImmediate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OS", function() { return OS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLittleEndian", function() { return isLittleEndian; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -const LANGUAGE_DEFAULT = 'en'; -let _isWindows = false; -let _isMacintosh = false; -let _isLinux = false; -let _isNative = false; -let _isWeb = false; -let _isIOS = false; -let _locale = undefined; -let _language = LANGUAGE_DEFAULT; -let _translationsConfigFile = undefined; -let _userAgent = undefined; -const isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); -// OS detection -if (typeof navigator === 'object' && !isElectronRenderer) { - _userAgent = navigator.userAgent; - _isWindows = _userAgent.indexOf('Windows') >= 0; - _isMacintosh = _userAgent.indexOf('Macintosh') >= 0; - _isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0; - _isLinux = _userAgent.indexOf('Linux') >= 0; - _isWeb = true; - _locale = navigator.language; - _language = _locale; -} -else if (typeof process === 'object') { - _isWindows = (process.platform === 'win32'); - _isMacintosh = (process.platform === 'darwin'); - _isLinux = (process.platform === 'linux'); - _locale = LANGUAGE_DEFAULT; - _language = LANGUAGE_DEFAULT; - const rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; - if (rawNlsConfig) { - try { - const nlsConfig = JSON.parse(rawNlsConfig); - const resolved = nlsConfig.availableLanguages['*']; - _locale = nlsConfig.locale; - // VSCode's default language is 'en' - _language = resolved ? resolved : LANGUAGE_DEFAULT; - _translationsConfigFile = nlsConfig._translationsConfigFile; - } - catch (e) { - } - } - _isNative = true; -} -let _platform = 0 /* Web */; -if (_isMacintosh) { - _platform = 1 /* Mac */; -} -else if (_isWindows) { - _platform = 3 /* Windows */; -} -else if (_isLinux) { - _platform = 2 /* Linux */; -} -const isWindows = _isWindows; -const isMacintosh = _isMacintosh; -const isLinux = _isLinux; -const isNative = _isNative; -const isWeb = _isWeb; -const isIOS = _isIOS; -const _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); -const globals = _globals; -const setImmediate = (function defineSetImmediate() { - if (globals.setImmediate) { - return globals.setImmediate.bind(globals); - } - if (typeof globals.postMessage === 'function' && !globals.importScripts) { - let pending = []; - globals.addEventListener('message', (e) => { - if (e.data && e.data.vscodeSetImmediateId) { - for (let i = 0, len = pending.length; i < len; i++) { - const candidate = pending[i]; - if (candidate.id === e.data.vscodeSetImmediateId) { - pending.splice(i, 1); - candidate.callback(); - return; - } - } - } - }); - let lastId = 0; - return (callback) => { - const myId = ++lastId; - pending.push({ - id: myId, - callback: callback - }); - globals.postMessage({ vscodeSetImmediateId: myId }, '*'); - }; - } - if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { - return process.nextTick.bind(process); - } - const _promise = Promise.resolve(); - return (callback) => _promise.then(callback); -})(); -const OS = (_isMacintosh || _isIOS ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); -let _isLittleEndian = true; -let _isLittleEndianComputed = false; -function isLittleEndian() { - if (!_isLittleEndianComputed) { - _isLittleEndianComputed = true; - const test = new Uint8Array(2); - test[0] = 1; - test[1] = 2; - const view = new Uint16Array(test.buffer); - _isLittleEndian = (view[0] === (2 << 8) + 1); - } - return _isLittleEndian; -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/process.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/process.js ***! - \******************************************************************/ -/*! exports provided: cwd, env, platform */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cwd", function() { return cwd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "env", function() { return env; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "platform", function() { return platform; }); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const safeProcess = (typeof process === 'undefined') ? { - cwd() { return '/'; }, - env: Object.create(null), - get platform() { return _platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"] ? 'win32' : _platform_js__WEBPACK_IMPORTED_MODULE_0__["isMacintosh"] ? 'darwin' : 'linux'; }, - nextTick(callback) { return Object(_platform_js__WEBPACK_IMPORTED_MODULE_0__["setImmediate"])(callback); } -} : process; -const cwd = safeProcess.cwd; -const env = safeProcess.env; -const platform = safeProcess.platform; - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "./node_modules/process/browser.js"))) - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/range.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/range.js ***! - \****************************************************************/ -/*! exports provided: Range */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Range; -(function (Range) { - /** - * Returns the intersection between two ranges as a range itself. - * Returns `{ start: 0, end: 0 }` if the intersection is empty. - */ - function intersect(one, other) { - if (one.start >= other.end || other.start >= one.end) { - return { start: 0, end: 0 }; - } - const start = Math.max(one.start, other.start); - const end = Math.min(one.end, other.end); - if (end - start <= 0) { - return { start: 0, end: 0 }; - } - return { start, end }; - } - Range.intersect = intersect; - function isEmpty(range) { - return range.end - range.start <= 0; - } - Range.isEmpty = isEmpty; - function intersects(one, other) { - return !isEmpty(intersect(one, other)); - } - Range.intersects = intersects; - function relativeComplement(one, other) { - const result = []; - const first = { start: one.start, end: Math.min(other.start, one.end) }; - const second = { start: Math.max(other.end, one.start), end: one.end }; - if (!isEmpty(first)) { - result.push(first); - } - if (!isEmpty(second)) { - result.push(second); - } - return result; - } - Range.relativeComplement = relativeComplement; -})(Range || (Range = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/resources.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/resources.js ***! - \********************************************************************/ -/*! exports provided: originalFSPath, ExtUri, extUri, isEqual, basenameOrAuthority, basename, dirname, joinPath, normalizePath, relativePath, resolvePath, isEqualAuthority, DataUri */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "originalFSPath", function() { return originalFSPath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExtUri", function() { return ExtUri; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extUri", function() { return extUri; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return isEqual; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basenameOrAuthority", function() { return basenameOrAuthority; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basename", function() { return basename; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return dirname; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "joinPath", function() { return joinPath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizePath", function() { return normalizePath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relativePath", function() { return relativePath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolvePath", function() { return resolvePath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEqualAuthority", function() { return isEqualAuthority; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataUri", function() { return DataUri; }); -/* harmony import */ var _extpath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extpath.js */ "./node_modules/monaco-editor/esm/vs/base/common/extpath.js"); -/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./path.js */ "./node_modules/monaco-editor/esm/vs/base/common/path.js"); -/* harmony import */ var _uri_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _network_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -function originalFSPath(uri) { - return Object(_uri_js__WEBPACK_IMPORTED_MODULE_2__["uriToFsPath"])(uri, true); -} -class ExtUri { - constructor(_ignorePathCasing) { - this._ignorePathCasing = _ignorePathCasing; - } - compare(uri1, uri2, ignoreFragment = false) { - if (uri1 === uri2) { - return 0; - } - return Object(_strings_js__WEBPACK_IMPORTED_MODULE_3__["compare"])(this.getComparisonKey(uri1, ignoreFragment), this.getComparisonKey(uri2, ignoreFragment)); - } - isEqual(uri1, uri2, ignoreFragment = false) { - if (uri1 === uri2) { - return true; - } - if (!uri1 || !uri2) { - return false; - } - return this.getComparisonKey(uri1, ignoreFragment) === this.getComparisonKey(uri2, ignoreFragment); - } - getComparisonKey(uri, ignoreFragment = false) { - return uri.with({ - path: this._ignorePathCasing(uri) ? uri.path.toLowerCase() : undefined, - fragment: ignoreFragment ? null : undefined - }).toString(); - } - // --- path math - joinPath(resource, ...pathFragment) { - return _uri_js__WEBPACK_IMPORTED_MODULE_2__["URI"].joinPath(resource, ...pathFragment); - } - basenameOrAuthority(resource) { - return basename(resource) || resource.authority; - } - basename(resource) { - return _path_js__WEBPACK_IMPORTED_MODULE_1__["posix"].basename(resource.path); - } - dirname(resource) { - if (resource.path.length === 0) { - return resource; - } - let dirname; - if (resource.scheme === _network_js__WEBPACK_IMPORTED_MODULE_4__["Schemas"].file) { - dirname = _uri_js__WEBPACK_IMPORTED_MODULE_2__["URI"].file(_path_js__WEBPACK_IMPORTED_MODULE_1__["dirname"](originalFSPath(resource))).path; - } - else { - dirname = _path_js__WEBPACK_IMPORTED_MODULE_1__["posix"].dirname(resource.path); - if (resource.authority && dirname.length && dirname.charCodeAt(0) !== 47 /* Slash */) { - console.error(`dirname("${resource.toString})) resulted in a relative path`); - dirname = '/'; // If a URI contains an authority component, then the path component must either be empty or begin with a CharCode.Slash ("/") character - } - } - return resource.with({ - path: dirname - }); - } - normalizePath(resource) { - if (!resource.path.length) { - return resource; - } - let normalizedPath; - if (resource.scheme === _network_js__WEBPACK_IMPORTED_MODULE_4__["Schemas"].file) { - normalizedPath = _uri_js__WEBPACK_IMPORTED_MODULE_2__["URI"].file(_path_js__WEBPACK_IMPORTED_MODULE_1__["normalize"](originalFSPath(resource))).path; - } - else { - normalizedPath = _path_js__WEBPACK_IMPORTED_MODULE_1__["posix"].normalize(resource.path); - } - return resource.with({ - path: normalizedPath - }); - } - relativePath(from, to) { - if (from.scheme !== to.scheme || !isEqualAuthority(from.authority, to.authority)) { - return undefined; - } - if (from.scheme === _network_js__WEBPACK_IMPORTED_MODULE_4__["Schemas"].file) { - const relativePath = _path_js__WEBPACK_IMPORTED_MODULE_1__["relative"](originalFSPath(from), originalFSPath(to)); - return _platform_js__WEBPACK_IMPORTED_MODULE_5__["isWindows"] ? _extpath_js__WEBPACK_IMPORTED_MODULE_0__["toSlashes"](relativePath) : relativePath; - } - let fromPath = from.path || '/', toPath = to.path || '/'; - if (this._ignorePathCasing(from)) { - // make casing of fromPath match toPath - let i = 0; - for (const len = Math.min(fromPath.length, toPath.length); i < len; i++) { - if (fromPath.charCodeAt(i) !== toPath.charCodeAt(i)) { - if (fromPath.charAt(i).toLowerCase() !== toPath.charAt(i).toLowerCase()) { - break; - } - } - } - fromPath = toPath.substr(0, i) + fromPath.substr(i); - } - return _path_js__WEBPACK_IMPORTED_MODULE_1__["posix"].relative(fromPath, toPath); - } - resolvePath(base, path) { - if (base.scheme === _network_js__WEBPACK_IMPORTED_MODULE_4__["Schemas"].file) { - const newURI = _uri_js__WEBPACK_IMPORTED_MODULE_2__["URI"].file(_path_js__WEBPACK_IMPORTED_MODULE_1__["resolve"](originalFSPath(base), path)); - return base.with({ - authority: newURI.authority, - path: newURI.path - }); - } - if (path.indexOf('/') === -1) { // no slashes? it's likely a Windows path - path = _extpath_js__WEBPACK_IMPORTED_MODULE_0__["toSlashes"](path); - if (/^[a-zA-Z]:(\/|$)/.test(path)) { // starts with a drive letter - path = '/' + path; - } - } - return base.with({ - path: _path_js__WEBPACK_IMPORTED_MODULE_1__["posix"].resolve(base.path, path) - }); - } - isEqualAuthority(a1, a2) { - return a1 === a2 || Object(_strings_js__WEBPACK_IMPORTED_MODULE_3__["equalsIgnoreCase"])(a1, a2); - } -} -/** - * Unbiased utility that takes uris "as they are". This means it can be interchanged with - * uri#toString() usages. The following is true - * ``` - * assertEqual(aUri.toString() === bUri.toString(), exturi.isEqual(aUri, bUri)) - * ``` - */ -const extUri = new ExtUri(() => false); -const isEqual = extUri.isEqual.bind(extUri); -const basenameOrAuthority = extUri.basenameOrAuthority.bind(extUri); -const basename = extUri.basename.bind(extUri); -const dirname = extUri.dirname.bind(extUri); -const joinPath = extUri.joinPath.bind(extUri); -const normalizePath = extUri.normalizePath.bind(extUri); -const relativePath = extUri.relativePath.bind(extUri); -const resolvePath = extUri.resolvePath.bind(extUri); -const isEqualAuthority = extUri.isEqualAuthority.bind(extUri); -/** - * Data URI related helpers. - */ -var DataUri; -(function (DataUri) { - DataUri.META_DATA_LABEL = 'label'; - DataUri.META_DATA_DESCRIPTION = 'description'; - DataUri.META_DATA_SIZE = 'size'; - DataUri.META_DATA_MIME = 'mime'; - function parseMetaData(dataUri) { - const metadata = new Map(); - // Given a URI of: data:image/png;size:2313;label:SomeLabel;description:SomeDescription;base64,77+9UE5... - // the metadata is: size:2313;label:SomeLabel;description:SomeDescription - const meta = dataUri.path.substring(dataUri.path.indexOf(';') + 1, dataUri.path.lastIndexOf(';')); - meta.split(';').forEach(property => { - const [key, value] = property.split(':'); - if (key && value) { - metadata.set(key, value); - } - }); - // Given a URI of: data:image/png;size:2313;label:SomeLabel;description:SomeDescription;base64,77+9UE5... - // the mime is: image/png - const mime = dataUri.path.substring(0, dataUri.path.indexOf(';')); - if (mime) { - metadata.set(DataUri.META_DATA_MIME, mime); - } - return metadata; - } - DataUri.parseMetaData = parseMetaData; -})(DataUri || (DataUri = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/scrollable.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/scrollable.js ***! - \*********************************************************************/ -/*! exports provided: ScrollState, Scrollable, SmoothScrollingUpdate, SmoothScrollingOperation */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollState", function() { return ScrollState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scrollable", function() { return Scrollable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SmoothScrollingUpdate", function() { return SmoothScrollingUpdate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SmoothScrollingOperation", function() { return SmoothScrollingOperation; }); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class ScrollState { - constructor(width, scrollWidth, scrollLeft, height, scrollHeight, scrollTop) { - width = width | 0; - scrollWidth = scrollWidth | 0; - scrollLeft = scrollLeft | 0; - height = height | 0; - scrollHeight = scrollHeight | 0; - scrollTop = scrollTop | 0; - this.rawScrollLeft = scrollLeft; // before validation - this.rawScrollTop = scrollTop; // before validation - if (width < 0) { - width = 0; - } - if (scrollLeft + width > scrollWidth) { - scrollLeft = scrollWidth - width; - } - if (scrollLeft < 0) { - scrollLeft = 0; - } - if (height < 0) { - height = 0; - } - if (scrollTop + height > scrollHeight) { - scrollTop = scrollHeight - height; - } - if (scrollTop < 0) { - scrollTop = 0; - } - this.width = width; - this.scrollWidth = scrollWidth; - this.scrollLeft = scrollLeft; - this.height = height; - this.scrollHeight = scrollHeight; - this.scrollTop = scrollTop; - } - equals(other) { - return (this.rawScrollLeft === other.rawScrollLeft - && this.rawScrollTop === other.rawScrollTop - && this.width === other.width - && this.scrollWidth === other.scrollWidth - && this.scrollLeft === other.scrollLeft - && this.height === other.height - && this.scrollHeight === other.scrollHeight - && this.scrollTop === other.scrollTop); - } - withScrollDimensions(update, useRawScrollPositions) { - return new ScrollState((typeof update.width !== 'undefined' ? update.width : this.width), (typeof update.scrollWidth !== 'undefined' ? update.scrollWidth : this.scrollWidth), useRawScrollPositions ? this.rawScrollLeft : this.scrollLeft, (typeof update.height !== 'undefined' ? update.height : this.height), (typeof update.scrollHeight !== 'undefined' ? update.scrollHeight : this.scrollHeight), useRawScrollPositions ? this.rawScrollTop : this.scrollTop); - } - withScrollPosition(update) { - return new ScrollState(this.width, this.scrollWidth, (typeof update.scrollLeft !== 'undefined' ? update.scrollLeft : this.rawScrollLeft), this.height, this.scrollHeight, (typeof update.scrollTop !== 'undefined' ? update.scrollTop : this.rawScrollTop)); - } - createScrollEvent(previous) { - const widthChanged = (this.width !== previous.width); - const scrollWidthChanged = (this.scrollWidth !== previous.scrollWidth); - const scrollLeftChanged = (this.scrollLeft !== previous.scrollLeft); - const heightChanged = (this.height !== previous.height); - const scrollHeightChanged = (this.scrollHeight !== previous.scrollHeight); - const scrollTopChanged = (this.scrollTop !== previous.scrollTop); - return { - oldWidth: previous.width, - oldScrollWidth: previous.scrollWidth, - oldScrollLeft: previous.scrollLeft, - width: this.width, - scrollWidth: this.scrollWidth, - scrollLeft: this.scrollLeft, - oldHeight: previous.height, - oldScrollHeight: previous.scrollHeight, - oldScrollTop: previous.scrollTop, - height: this.height, - scrollHeight: this.scrollHeight, - scrollTop: this.scrollTop, - widthChanged: widthChanged, - scrollWidthChanged: scrollWidthChanged, - scrollLeftChanged: scrollLeftChanged, - heightChanged: heightChanged, - scrollHeightChanged: scrollHeightChanged, - scrollTopChanged: scrollTopChanged, - }; - } -} -class Scrollable extends _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(smoothScrollDuration, scheduleAtNextAnimationFrame) { - super(); - this._onScroll = this._register(new _event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this.onScroll = this._onScroll.event; - this._smoothScrollDuration = smoothScrollDuration; - this._scheduleAtNextAnimationFrame = scheduleAtNextAnimationFrame; - this._state = new ScrollState(0, 0, 0, 0, 0, 0); - this._smoothScrolling = null; - } - dispose() { - if (this._smoothScrolling) { - this._smoothScrolling.dispose(); - this._smoothScrolling = null; - } - super.dispose(); - } - setSmoothScrollDuration(smoothScrollDuration) { - this._smoothScrollDuration = smoothScrollDuration; - } - validateScrollPosition(scrollPosition) { - return this._state.withScrollPosition(scrollPosition); - } - getScrollDimensions() { - return this._state; - } - setScrollDimensions(dimensions, useRawScrollPositions) { - const newState = this._state.withScrollDimensions(dimensions, useRawScrollPositions); - this._setState(newState); - // Validate outstanding animated scroll position target - if (this._smoothScrolling) { - this._smoothScrolling.acceptScrollDimensions(this._state); - } - } - /** - * Returns the final scroll position that the instance will have once the smooth scroll animation concludes. - * If no scroll animation is occurring, it will return the current scroll position instead. - */ - getFutureScrollPosition() { - if (this._smoothScrolling) { - return this._smoothScrolling.to; - } - return this._state; - } - /** - * Returns the current scroll position. - * Note: This result might be an intermediate scroll position, as there might be an ongoing smooth scroll animation. - */ - getCurrentScrollPosition() { - return this._state; - } - setScrollPositionNow(update) { - // no smooth scrolling requested - const newState = this._state.withScrollPosition(update); - // Terminate any outstanding smooth scrolling - if (this._smoothScrolling) { - this._smoothScrolling.dispose(); - this._smoothScrolling = null; - } - this._setState(newState); - } - setScrollPositionSmooth(update) { - if (this._smoothScrollDuration === 0) { - // Smooth scrolling not supported. - return this.setScrollPositionNow(update); - } - if (this._smoothScrolling) { - // Combine our pending scrollLeft/scrollTop with incoming scrollLeft/scrollTop - update = { - scrollLeft: (typeof update.scrollLeft === 'undefined' ? this._smoothScrolling.to.scrollLeft : update.scrollLeft), - scrollTop: (typeof update.scrollTop === 'undefined' ? this._smoothScrolling.to.scrollTop : update.scrollTop) - }; - // Validate `update` - const validTarget = this._state.withScrollPosition(update); - if (this._smoothScrolling.to.scrollLeft === validTarget.scrollLeft && this._smoothScrolling.to.scrollTop === validTarget.scrollTop) { - // No need to interrupt or extend the current animation since we're going to the same place - return; - } - const newSmoothScrolling = this._smoothScrolling.combine(this._state, validTarget, this._smoothScrollDuration); - this._smoothScrolling.dispose(); - this._smoothScrolling = newSmoothScrolling; - } - else { - // Validate `update` - const validTarget = this._state.withScrollPosition(update); - this._smoothScrolling = SmoothScrollingOperation.start(this._state, validTarget, this._smoothScrollDuration); - } - // Begin smooth scrolling animation - this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => { - if (!this._smoothScrolling) { - return; - } - this._smoothScrolling.animationFrameDisposable = null; - this._performSmoothScrolling(); - }); - } - _performSmoothScrolling() { - if (!this._smoothScrolling) { - return; - } - const update = this._smoothScrolling.tick(); - const newState = this._state.withScrollPosition(update); - this._setState(newState); - if (!this._smoothScrolling) { - // Looks like someone canceled the smooth scrolling - // from the scroll event handler - return; - } - if (update.isDone) { - this._smoothScrolling.dispose(); - this._smoothScrolling = null; - return; - } - // Continue smooth scrolling animation - this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => { - if (!this._smoothScrolling) { - return; - } - this._smoothScrolling.animationFrameDisposable = null; - this._performSmoothScrolling(); - }); - } - _setState(newState) { - const oldState = this._state; - if (oldState.equals(newState)) { - // no change - return; - } - this._state = newState; - this._onScroll.fire(this._state.createScrollEvent(oldState)); - } -} -class SmoothScrollingUpdate { - constructor(scrollLeft, scrollTop, isDone) { - this.scrollLeft = scrollLeft; - this.scrollTop = scrollTop; - this.isDone = isDone; - } -} -function createEaseOutCubic(from, to) { - const delta = to - from; - return function (completion) { - return from + delta * easeOutCubic(completion); - }; -} -function createComposed(a, b, cut) { - return function (completion) { - if (completion < cut) { - return a(completion / cut); - } - return b((completion - cut) / (1 - cut)); - }; -} -class SmoothScrollingOperation { - constructor(from, to, startTime, duration) { - this.from = from; - this.to = to; - this.duration = duration; - this._startTime = startTime; - this.animationFrameDisposable = null; - this._initAnimations(); - } - _initAnimations() { - this.scrollLeft = this._initAnimation(this.from.scrollLeft, this.to.scrollLeft, this.to.width); - this.scrollTop = this._initAnimation(this.from.scrollTop, this.to.scrollTop, this.to.height); - } - _initAnimation(from, to, viewportSize) { - const delta = Math.abs(from - to); - if (delta > 2.5 * viewportSize) { - let stop1, stop2; - if (from < to) { - // scroll to 75% of the viewportSize - stop1 = from + 0.75 * viewportSize; - stop2 = to - 0.75 * viewportSize; - } - else { - stop1 = from - 0.75 * viewportSize; - stop2 = to + 0.75 * viewportSize; - } - return createComposed(createEaseOutCubic(from, stop1), createEaseOutCubic(stop2, to), 0.33); - } - return createEaseOutCubic(from, to); - } - dispose() { - if (this.animationFrameDisposable !== null) { - this.animationFrameDisposable.dispose(); - this.animationFrameDisposable = null; - } - } - acceptScrollDimensions(state) { - this.to = state.withScrollPosition(this.to); - this._initAnimations(); - } - tick() { - return this._tick(Date.now()); - } - _tick(now) { - const completion = (now - this._startTime) / this.duration; - if (completion < 1) { - const newScrollLeft = this.scrollLeft(completion); - const newScrollTop = this.scrollTop(completion); - return new SmoothScrollingUpdate(newScrollLeft, newScrollTop, false); - } - return new SmoothScrollingUpdate(this.to.scrollLeft, this.to.scrollTop, true); - } - combine(from, to, duration) { - return SmoothScrollingOperation.start(from, to, duration); - } - static start(from, to, duration) { - // +10 / -10 : pretend the animation already started for a quicker response to a scroll request - duration = duration + 10; - const startTime = Date.now() - 10; - return new SmoothScrollingOperation(from, to, startTime, duration); - } -} -function easeInCubic(t) { - return Math.pow(t, 3); -} -function easeOutCubic(t) { - return 1 - easeInCubic(1 - t); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/search.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/search.js ***! - \*****************************************************************/ -/*! exports provided: buildReplaceStringWithCasePreserved */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildReplaceStringWithCasePreserved", function() { return buildReplaceStringWithCasePreserved; }); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -function buildReplaceStringWithCasePreserved(matches, pattern) { - if (matches && (matches[0] !== '')) { - const containsHyphens = validateSpecificSpecialCharacter(matches, pattern, '-'); - const containsUnderscores = validateSpecificSpecialCharacter(matches, pattern, '_'); - if (containsHyphens && !containsUnderscores) { - return buildReplaceStringForSpecificSpecialCharacter(matches, pattern, '-'); - } - else if (!containsHyphens && containsUnderscores) { - return buildReplaceStringForSpecificSpecialCharacter(matches, pattern, '_'); - } - if (matches[0].toUpperCase() === matches[0]) { - return pattern.toUpperCase(); - } - else if (matches[0].toLowerCase() === matches[0]) { - return pattern.toLowerCase(); - } - else if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["containsUppercaseCharacter"](matches[0][0]) && pattern.length > 0) { - return pattern[0].toUpperCase() + pattern.substr(1); - } - else { - // we don't understand its pattern yet. - return pattern; - } - } - else { - return pattern; - } -} -function validateSpecificSpecialCharacter(matches, pattern, specialCharacter) { - const doesContainSpecialCharacter = matches[0].indexOf(specialCharacter) !== -1 && pattern.indexOf(specialCharacter) !== -1; - return doesContainSpecialCharacter && matches[0].split(specialCharacter).length === pattern.split(specialCharacter).length; -} -function buildReplaceStringForSpecificSpecialCharacter(matches, pattern, specialCharacter) { - const splitPatternAtSpecialCharacter = pattern.split(specialCharacter); - const splitMatchAtSpecialCharacter = matches[0].split(specialCharacter); - let replaceString = ''; - splitPatternAtSpecialCharacter.forEach((splitValue, index) => { - replaceString += buildReplaceStringWithCasePreserved([splitMatchAtSpecialCharacter[index]], splitValue) + specialCharacter; - }); - return replaceString.slice(0, -1); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/severity.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/severity.js ***! - \*******************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var Severity; -(function (Severity) { - Severity[Severity["Ignore"] = 0] = "Ignore"; - Severity[Severity["Info"] = 1] = "Info"; - Severity[Severity["Warning"] = 2] = "Warning"; - Severity[Severity["Error"] = 3] = "Error"; -})(Severity || (Severity = {})); -(function (Severity) { - const _error = 'error'; - const _warning = 'warning'; - const _warn = 'warn'; - const _info = 'info'; - /** - * Parses 'error', 'warning', 'warn', 'info' in call casings - * and falls back to ignore. - */ - function fromValue(value) { - if (!value) { - return Severity.Ignore; - } - if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["equalsIgnoreCase"](_error, value)) { - return Severity.Error; - } - if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["equalsIgnoreCase"](_warning, value) || _strings_js__WEBPACK_IMPORTED_MODULE_0__["equalsIgnoreCase"](_warn, value)) { - return Severity.Warning; - } - if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["equalsIgnoreCase"](_info, value)) { - return Severity.Info; - } - return Severity.Ignore; - } - Severity.fromValue = fromValue; -})(Severity || (Severity = {})); -/* harmony default export */ __webpack_exports__["default"] = (Severity); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/stopwatch.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/stopwatch.js ***! - \********************************************************************/ -/*! exports provided: StopWatch */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StopWatch", function() { return StopWatch; }); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const hasPerformanceNow = (_platform_js__WEBPACK_IMPORTED_MODULE_0__["globals"].performance && typeof _platform_js__WEBPACK_IMPORTED_MODULE_0__["globals"].performance.now === 'function'); -class StopWatch { - constructor(highResolution) { - this._highResolution = hasPerformanceNow && highResolution; - this._startTime = this._now(); - this._stopTime = -1; - } - static create(highResolution = true) { - return new StopWatch(highResolution); - } - stop() { - this._stopTime = this._now(); - } - elapsed() { - if (this._stopTime !== -1) { - return this._stopTime - this._startTime; - } - return this._now() - this._startTime; - } - _now() { - return this._highResolution ? _platform_js__WEBPACK_IMPORTED_MODULE_0__["globals"].performance.now() : new Date().getTime(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/strings.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/strings.js ***! - \******************************************************************/ -/*! exports provided: isFalsyOrWhitespace, pad, format, escape, escapeRegExpCharacters, trim, ltrim, rtrim, convertSimple2RegExpPattern, stripWildcards, startsWith, endsWith, createRegExp, regExpLeadsToEndlessLoop, regExpFlags, firstNonWhitespaceIndex, getLeadingWhitespace, lastNonWhitespaceIndex, compare, compareSubstring, compareIgnoreCase, compareSubstringIgnoreCase, isLowerAsciiLetter, isUpperAsciiLetter, equalsIgnoreCase, startsWithIgnoreCase, commonPrefixLength, commonSuffixLength, isHighSurrogate, isLowSurrogate, computeCodePoint, getNextCodePoint, nextCharLength, prevCharLength, decodeUTF8, containsRTL, containsEmoji, isBasicASCII, UNUSUAL_LINE_TERMINATORS, containsUnusualLineTerminators, containsFullWidthCharacter, isFullWidthCharacter, isEmojiImprecise, UTF8_BOM_CHARACTER, startsWithUTF8BOM, containsUppercaseCharacter, singleLetterHash, getGraphemeBreakType, breakBetweenGraphemeBreakType */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrWhitespace", function() { return isFalsyOrWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return pad; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return escape; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeRegExpCharacters", function() { return escapeRegExpCharacters; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return trim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ltrim", function() { return ltrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtrim", function() { return rtrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSimple2RegExpPattern", function() { return convertSimple2RegExpPattern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripWildcards", function() { return stripWildcards; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRegExp", function() { return createRegExp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpLeadsToEndlessLoop", function() { return regExpLeadsToEndlessLoop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpFlags", function() { return regExpFlags; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstNonWhitespaceIndex", function() { return firstNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLeadingWhitespace", function() { return getLeadingWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastNonWhitespaceIndex", function() { return lastNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compare", function() { return compare; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareSubstring", function() { return compareSubstring; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareIgnoreCase", function() { return compareIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareSubstringIgnoreCase", function() { return compareSubstringIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowerAsciiLetter", function() { return isLowerAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUpperAsciiLetter", function() { return isUpperAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equalsIgnoreCase", function() { return equalsIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithIgnoreCase", function() { return startsWithIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonPrefixLength", function() { return commonPrefixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonSuffixLength", function() { return commonSuffixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogate", function() { return isHighSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogate", function() { return isLowSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeCodePoint", function() { return computeCodePoint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNextCodePoint", function() { return getNextCodePoint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nextCharLength", function() { return nextCharLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prevCharLength", function() { return prevCharLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeUTF8", function() { return decodeUTF8; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsRTL", function() { return containsRTL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsEmoji", function() { return containsEmoji; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBasicASCII", function() { return isBasicASCII; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNUSUAL_LINE_TERMINATORS", function() { return UNUSUAL_LINE_TERMINATORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsUnusualLineTerminators", function() { return containsUnusualLineTerminators; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsFullWidthCharacter", function() { return containsFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFullWidthCharacter", function() { return isFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmojiImprecise", function() { return isEmojiImprecise; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UTF8_BOM_CHARACTER", function() { return UTF8_BOM_CHARACTER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithUTF8BOM", function() { return startsWithUTF8BOM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsUppercaseCharacter", function() { return containsUppercaseCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "singleLetterHash", function() { return singleLetterHash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGraphemeBreakType", function() { return getGraphemeBreakType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "breakBetweenGraphemeBreakType", function() { return breakBetweenGraphemeBreakType; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function isFalsyOrWhitespace(str) { - if (!str || typeof str !== 'string') { - return true; - } - return str.trim().length === 0; -} -/** - * @deprecated ES6: use `String.padStart` - */ -function pad(n, l, char = '0') { - const str = '' + n; - const r = [str]; - for (let i = str.length; i < l; i++) { - r.push(char); - } - return r.reverse().join(''); -} -const _formatRegexp = /{(\d+)}/g; -/** - * Helper to produce a string with a variable number of arguments. Insert variable segments - * into the string using the {n} notation where N is the index of the argument following the string. - * @param value string to which formatting is applied - * @param args replacements for {n}-entries - */ -function format(value, ...args) { - if (args.length === 0) { - return value; - } - return value.replace(_formatRegexp, function (match, group) { - const idx = parseInt(group, 10); - return isNaN(idx) || idx < 0 || idx >= args.length ? - match : - args[idx]; - }); -} -/** - * Converts HTML characters inside the string to use entities instead. Makes the string safe from - * being used e.g. in HTMLElement.innerHTML. - */ -function escape(html) { - return html.replace(/[<>&]/g, function (match) { - switch (match) { - case '<': return '<'; - case '>': return '>'; - case '&': return '&'; - default: return match; - } - }); -} -/** - * Escapes regular expression characters in a given string - */ -function escapeRegExpCharacters(value) { - return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, '\\$&'); -} -/** - * Removes all occurrences of needle from the beginning and end of haystack. - * @param haystack string to trim - * @param needle the thing to trim (default is a blank) - */ -function trim(haystack, needle = ' ') { - const trimmed = ltrim(haystack, needle); - return rtrim(trimmed, needle); -} -/** - * Removes all occurrences of needle from the beginning of haystack. - * @param haystack string to trim - * @param needle the thing to trim - */ -function ltrim(haystack, needle) { - if (!haystack || !needle) { - return haystack; - } - const needleLen = needle.length; - if (needleLen === 0 || haystack.length === 0) { - return haystack; - } - let offset = 0; - while (haystack.indexOf(needle, offset) === offset) { - offset = offset + needleLen; - } - return haystack.substring(offset); -} -/** - * Removes all occurrences of needle from the end of haystack. - * @param haystack string to trim - * @param needle the thing to trim - */ -function rtrim(haystack, needle) { - if (!haystack || !needle) { - return haystack; - } - const needleLen = needle.length, haystackLen = haystack.length; - if (needleLen === 0 || haystackLen === 0) { - return haystack; - } - let offset = haystackLen, idx = -1; - while (true) { - idx = haystack.lastIndexOf(needle, offset - 1); - if (idx === -1 || idx + needleLen !== offset) { - break; - } - if (idx === 0) { - return ''; - } - offset = idx; - } - return haystack.substring(0, offset); -} -function convertSimple2RegExpPattern(pattern) { - return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*'); -} -function stripWildcards(pattern) { - return pattern.replace(/\*/g, ''); -} -/** - * @deprecated ES6: use `String.startsWith` - */ -function startsWith(haystack, needle) { - if (haystack.length < needle.length) { - return false; - } - if (haystack === needle) { - return true; - } - for (let i = 0; i < needle.length; i++) { - if (haystack[i] !== needle[i]) { - return false; - } - } - return true; -} -/** - * @deprecated ES6: use `String.endsWith` - */ -function endsWith(haystack, needle) { - const diff = haystack.length - needle.length; - if (diff > 0) { - return haystack.indexOf(needle, diff) === diff; - } - else if (diff === 0) { - return haystack === needle; - } - else { - return false; - } -} -function createRegExp(searchString, isRegex, options = {}) { - if (!searchString) { - throw new Error('Cannot create regex from empty string'); - } - if (!isRegex) { - searchString = escapeRegExpCharacters(searchString); - } - if (options.wholeWord) { - if (!/\B/.test(searchString.charAt(0))) { - searchString = '\\b' + searchString; - } - if (!/\B/.test(searchString.charAt(searchString.length - 1))) { - searchString = searchString + '\\b'; - } - } - let modifiers = ''; - if (options.global) { - modifiers += 'g'; - } - if (!options.matchCase) { - modifiers += 'i'; - } - if (options.multiline) { - modifiers += 'm'; - } - if (options.unicode) { - modifiers += 'u'; - } - return new RegExp(searchString, modifiers); -} -function regExpLeadsToEndlessLoop(regexp) { - // Exit early if it's one of these special cases which are meant to match - // against an empty string - if (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\s*$') { - return false; - } - // We check against an empty string. If the regular expression doesn't advance - // (e.g. ends in an endless loop) it will match an empty string. - const match = regexp.exec(''); - return !!(match && regexp.lastIndex === 0); -} -function regExpFlags(regexp) { - return (regexp.global ? 'g' : '') - + (regexp.ignoreCase ? 'i' : '') - + (regexp.multiline ? 'm' : '') - + (regexp /* standalone editor compilation */.unicode ? 'u' : ''); -} -/** - * Returns first index of the string that is not whitespace. - * If string is empty or contains only whitespaces, returns -1 - */ -function firstNonWhitespaceIndex(str) { - for (let i = 0, len = str.length; i < len; i++) { - const chCode = str.charCodeAt(i); - if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) { - return i; - } - } - return -1; -} -/** - * Returns the leading whitespace of the string. - * If the string contains only whitespaces, returns entire string - */ -function getLeadingWhitespace(str, start = 0, end = str.length) { - for (let i = start; i < end; i++) { - const chCode = str.charCodeAt(i); - if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) { - return str.substring(start, i); - } - } - return str.substring(start, end); -} -/** - * Returns last index of the string that is not whitespace. - * If string is empty or contains only whitespaces, returns -1 - */ -function lastNonWhitespaceIndex(str, startIndex = str.length - 1) { - for (let i = startIndex; i >= 0; i--) { - const chCode = str.charCodeAt(i); - if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) { - return i; - } - } - return -1; -} -function compare(a, b) { - if (a < b) { - return -1; - } - else if (a > b) { - return 1; - } - else { - return 0; - } -} -function compareSubstring(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) { - for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) { - let codeA = a.charCodeAt(aStart); - let codeB = b.charCodeAt(bStart); - if (codeA < codeB) { - return -1; - } - else if (codeA > codeB) { - return 1; - } - } - const aLen = aEnd - aStart; - const bLen = bEnd - bStart; - if (aLen < bLen) { - return -1; - } - else if (aLen > bLen) { - return 1; - } - return 0; -} -function compareIgnoreCase(a, b) { - return compareSubstringIgnoreCase(a, b, 0, a.length, 0, b.length); -} -function compareSubstringIgnoreCase(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) { - for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) { - let codeA = a.charCodeAt(aStart); - let codeB = b.charCodeAt(bStart); - if (codeA === codeB) { - // equal - continue; - } - const diff = codeA - codeB; - if (diff === 32 && isUpperAsciiLetter(codeB)) { //codeB =[65-90] && codeA =[97-122] - continue; - } - else if (diff === -32 && isUpperAsciiLetter(codeA)) { //codeB =[97-122] && codeA =[65-90] - continue; - } - if (isLowerAsciiLetter(codeA) && isLowerAsciiLetter(codeB)) { - // - return diff; - } - else { - return compareSubstring(a.toLowerCase(), b.toLowerCase(), aStart, aEnd, bStart, bEnd); - } - } - const aLen = aEnd - aStart; - const bLen = bEnd - bStart; - if (aLen < bLen) { - return -1; - } - else if (aLen > bLen) { - return 1; - } - return 0; -} -function isLowerAsciiLetter(code) { - return code >= 97 /* a */ && code <= 122 /* z */; -} -function isUpperAsciiLetter(code) { - return code >= 65 /* A */ && code <= 90 /* Z */; -} -function isAsciiLetter(code) { - return isLowerAsciiLetter(code) || isUpperAsciiLetter(code); -} -function equalsIgnoreCase(a, b) { - return a.length === b.length && doEqualsIgnoreCase(a, b); -} -function doEqualsIgnoreCase(a, b, stopAt = a.length) { - for (let i = 0; i < stopAt; i++) { - const codeA = a.charCodeAt(i); - const codeB = b.charCodeAt(i); - if (codeA === codeB) { - continue; - } - // a-z A-Z - if (isAsciiLetter(codeA) && isAsciiLetter(codeB)) { - const diff = Math.abs(codeA - codeB); - if (diff !== 0 && diff !== 32) { - return false; - } - } - // Any other charcode - else { - if (String.fromCharCode(codeA).toLowerCase() !== String.fromCharCode(codeB).toLowerCase()) { - return false; - } - } - } - return true; -} -function startsWithIgnoreCase(str, candidate) { - const candidateLength = candidate.length; - if (candidate.length > str.length) { - return false; - } - return doEqualsIgnoreCase(str, candidate, candidateLength); -} -/** - * @returns the length of the common prefix of the two strings. - */ -function commonPrefixLength(a, b) { - let i, len = Math.min(a.length, b.length); - for (i = 0; i < len; i++) { - if (a.charCodeAt(i) !== b.charCodeAt(i)) { - return i; - } - } - return len; -} -/** - * @returns the length of the common suffix of the two strings. - */ -function commonSuffixLength(a, b) { - let i, len = Math.min(a.length, b.length); - const aLastIndex = a.length - 1; - const bLastIndex = b.length - 1; - for (i = 0; i < len; i++) { - if (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) { - return i; - } - } - return len; -} -/** - * See http://en.wikipedia.org/wiki/Surrogate_pair - */ -function isHighSurrogate(charCode) { - return (0xD800 <= charCode && charCode <= 0xDBFF); -} -/** - * See http://en.wikipedia.org/wiki/Surrogate_pair - */ -function isLowSurrogate(charCode) { - return (0xDC00 <= charCode && charCode <= 0xDFFF); -} -/** - * See http://en.wikipedia.org/wiki/Surrogate_pair - */ -function computeCodePoint(highSurrogate, lowSurrogate) { - return ((highSurrogate - 0xD800) << 10) + (lowSurrogate - 0xDC00) + 0x10000; -} -/** - * get the code point that begins at offset `offset` - */ -function getNextCodePoint(str, len, offset) { - const charCode = str.charCodeAt(offset); - if (isHighSurrogate(charCode) && offset + 1 < len) { - const nextCharCode = str.charCodeAt(offset + 1); - if (isLowSurrogate(nextCharCode)) { - return computeCodePoint(charCode, nextCharCode); - } - } - return charCode; -} -/** - * get the code point that ends right before offset `offset` - */ -function getPrevCodePoint(str, offset) { - const charCode = str.charCodeAt(offset - 1); - if (isLowSurrogate(charCode) && offset > 1) { - const prevCharCode = str.charCodeAt(offset - 2); - if (isHighSurrogate(prevCharCode)) { - return computeCodePoint(prevCharCode, charCode); - } - } - return charCode; -} -function nextCharLength(str, offset) { - const graphemeBreakTree = GraphemeBreakTree.getInstance(); - const initialOffset = offset; - const len = str.length; - const initialCodePoint = getNextCodePoint(str, len, offset); - offset += (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint); - while (offset < len) { - const nextCodePoint = getNextCodePoint(str, len, offset); - const nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(nextCodePoint); - if (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) { - break; - } - offset += (nextCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - graphemeBreakType = nextGraphemeBreakType; - } - return (offset - initialOffset); -} -function prevCharLength(str, offset) { - const graphemeBreakTree = GraphemeBreakTree.getInstance(); - const initialOffset = offset; - const initialCodePoint = getPrevCodePoint(str, offset); - offset -= (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint); - while (offset > 0) { - const prevCodePoint = getPrevCodePoint(str, offset); - const prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(prevCodePoint); - if (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)) { - break; - } - offset -= (prevCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - graphemeBreakType = prevGraphemeBreakType; - } - return (initialOffset - offset); -} -/** - * A manual decoding of a UTF8 string. - * Use only in environments which do not offer native conversion methods! - */ -function decodeUTF8(buffer) { - // https://en.wikipedia.org/wiki/UTF-8 - const len = buffer.byteLength; - const result = []; - let offset = 0; - while (offset < len) { - const v0 = buffer[offset]; - let codePoint; - if (v0 >= 0b11110000 && offset + 3 < len) { - // 4 bytes - codePoint = ((((buffer[offset++] & 0b00000111) << 18) >>> 0) - | (((buffer[offset++] & 0b00111111) << 12) >>> 0) - | (((buffer[offset++] & 0b00111111) << 6) >>> 0) - | (((buffer[offset++] & 0b00111111) << 0) >>> 0)); - } - else if (v0 >= 0b11100000 && offset + 2 < len) { - // 3 bytes - codePoint = ((((buffer[offset++] & 0b00001111) << 12) >>> 0) - | (((buffer[offset++] & 0b00111111) << 6) >>> 0) - | (((buffer[offset++] & 0b00111111) << 0) >>> 0)); - } - else if (v0 >= 0b11000000 && offset + 1 < len) { - // 2 bytes - codePoint = ((((buffer[offset++] & 0b00011111) << 6) >>> 0) - | (((buffer[offset++] & 0b00111111) << 0) >>> 0)); - } - else { - // 1 byte - codePoint = buffer[offset++]; - } - if ((codePoint >= 0 && codePoint <= 0xD7FF) || (codePoint >= 0xE000 && codePoint <= 0xFFFF)) { - // Basic Multilingual Plane - result.push(String.fromCharCode(codePoint)); - } - else if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) { - // Supplementary Planes - const uPrime = codePoint - 0x10000; - const w1 = 0xD800 + ((uPrime & 0b11111111110000000000) >>> 10); - const w2 = 0xDC00 + ((uPrime & 0b00000000001111111111) >>> 0); - result.push(String.fromCharCode(w1)); - result.push(String.fromCharCode(w2)); - } - else { - // illegal code point - result.push(String.fromCharCode(0xFFFD)); - } - } - return result.join(''); -} -/** - * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-rtl-test.js - */ -const CONTAINS_RTL = /(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/; -/** - * Returns true if `str` contains any Unicode character that is classified as "R" or "AL". - */ -function containsRTL(str) { - return CONTAINS_RTL.test(str); -} -/** - * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js - */ -const CONTAINS_EMOJI = /(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/; -function containsEmoji(str) { - return CONTAINS_EMOJI.test(str); -} -const IS_BASIC_ASCII = /^[\t\n\r\x20-\x7E]*$/; -/** - * Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \n, \r, \t - */ -function isBasicASCII(str) { - return IS_BASIC_ASCII.test(str); -} -const UNUSUAL_LINE_TERMINATORS = /[\u2028\u2029]/; // LINE SEPARATOR (LS) or PARAGRAPH SEPARATOR (PS) -/** - * Returns true if `str` contains unusual line terminators, like LS or PS - */ -function containsUnusualLineTerminators(str) { - return UNUSUAL_LINE_TERMINATORS.test(str); -} -function containsFullWidthCharacter(str) { - for (let i = 0, len = str.length; i < len; i++) { - if (isFullWidthCharacter(str.charCodeAt(i))) { - return true; - } - } - return false; -} -function isFullWidthCharacter(charCode) { - // Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns - // http://jrgraphix.net/research/unicode_blocks.php - // 2E80 — 2EFF CJK Radicals Supplement - // 2F00 — 2FDF Kangxi Radicals - // 2FF0 — 2FFF Ideographic Description Characters - // 3000 — 303F CJK Symbols and Punctuation - // 3040 — 309F Hiragana - // 30A0 — 30FF Katakana - // 3100 — 312F Bopomofo - // 3130 — 318F Hangul Compatibility Jamo - // 3190 — 319F Kanbun - // 31A0 — 31BF Bopomofo Extended - // 31F0 — 31FF Katakana Phonetic Extensions - // 3200 — 32FF Enclosed CJK Letters and Months - // 3300 — 33FF CJK Compatibility - // 3400 — 4DBF CJK Unified Ideographs Extension A - // 4DC0 — 4DFF Yijing Hexagram Symbols - // 4E00 — 9FFF CJK Unified Ideographs - // A000 — A48F Yi Syllables - // A490 — A4CF Yi Radicals - // AC00 — D7AF Hangul Syllables - // [IGNORE] D800 — DB7F High Surrogates - // [IGNORE] DB80 — DBFF High Private Use Surrogates - // [IGNORE] DC00 — DFFF Low Surrogates - // [IGNORE] E000 — F8FF Private Use Area - // F900 — FAFF CJK Compatibility Ideographs - // [IGNORE] FB00 — FB4F Alphabetic Presentation Forms - // [IGNORE] FB50 — FDFF Arabic Presentation Forms-A - // [IGNORE] FE00 — FE0F Variation Selectors - // [IGNORE] FE20 — FE2F Combining Half Marks - // [IGNORE] FE30 — FE4F CJK Compatibility Forms - // [IGNORE] FE50 — FE6F Small Form Variants - // [IGNORE] FE70 — FEFF Arabic Presentation Forms-B - // FF00 — FFEF Halfwidth and Fullwidth Forms - // [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms] - // of which FF01 - FF5E fullwidth ASCII of 21 to 7E - // [IGNORE] and FF65 - FFDC halfwidth of Katakana and Hangul - // [IGNORE] FFF0 — FFFF Specials - charCode = +charCode; // @perf - return ((charCode >= 0x2E80 && charCode <= 0xD7AF) - || (charCode >= 0xF900 && charCode <= 0xFAFF) - || (charCode >= 0xFF01 && charCode <= 0xFF5E)); -} -/** - * A fast function (therefore imprecise) to check if code points are emojis. - * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js - */ -function isEmojiImprecise(x) { - return ((x >= 0x1F1E6 && x <= 0x1F1FF) || (x >= 9728 && x <= 10175) || (x >= 127744 && x <= 128591) - || (x >= 128640 && x <= 128764) || (x >= 128992 && x <= 129003) || (x >= 129280 && x <= 129535) - || (x >= 129648 && x <= 129651) || (x >= 129656 && x <= 129666) || (x >= 129680 && x <= 129685)); -} -// -- UTF-8 BOM -const UTF8_BOM_CHARACTER = String.fromCharCode(65279 /* UTF8_BOM */); -function startsWithUTF8BOM(str) { - return !!(str && str.length > 0 && str.charCodeAt(0) === 65279 /* UTF8_BOM */); -} -function containsUppercaseCharacter(target, ignoreEscapedChars = false) { - if (!target) { - return false; - } - if (ignoreEscapedChars) { - target = target.replace(/\\./g, ''); - } - return target.toLowerCase() !== target; -} -/** - * Produces 'a'-'z', followed by 'A'-'Z'... followed by 'a'-'z', etc. - */ -function singleLetterHash(n) { - const LETTERS_CNT = (90 /* Z */ - 65 /* A */ + 1); - n = n % (2 * LETTERS_CNT); - if (n < LETTERS_CNT) { - return String.fromCharCode(97 /* a */ + n); - } - return String.fromCharCode(65 /* A */ + n - LETTERS_CNT); -} -//#region Unicode Grapheme Break -function getGraphemeBreakType(codePoint) { - const graphemeBreakTree = GraphemeBreakTree.getInstance(); - return graphemeBreakTree.getGraphemeBreakType(codePoint); -} -function breakBetweenGraphemeBreakType(breakTypeA, breakTypeB) { - // http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules - // !!! Let's make the common case a bit faster - if (breakTypeA === 0 /* Other */) { - // see https://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakTest-13.0.0d10.html#table - return (breakTypeB !== 5 /* Extend */ && breakTypeB !== 7 /* SpacingMark */); - } - // Do not break between a CR and LF. Otherwise, break before and after controls. - // GB3 CR × LF - // GB4 (Control | CR | LF) ÷ - // GB5 ÷ (Control | CR | LF) - if (breakTypeA === 2 /* CR */) { - if (breakTypeB === 3 /* LF */) { - return false; // GB3 - } - } - if (breakTypeA === 4 /* Control */ || breakTypeA === 2 /* CR */ || breakTypeA === 3 /* LF */) { - return true; // GB4 - } - if (breakTypeB === 4 /* Control */ || breakTypeB === 2 /* CR */ || breakTypeB === 3 /* LF */) { - return true; // GB5 - } - // Do not break Hangul syllable sequences. - // GB6 L × (L | V | LV | LVT) - // GB7 (LV | V) × (V | T) - // GB8 (LVT | T) × T - if (breakTypeA === 8 /* L */) { - if (breakTypeB === 8 /* L */ || breakTypeB === 9 /* V */ || breakTypeB === 11 /* LV */ || breakTypeB === 12 /* LVT */) { - return false; // GB6 - } - } - if (breakTypeA === 11 /* LV */ || breakTypeA === 9 /* V */) { - if (breakTypeB === 9 /* V */ || breakTypeB === 10 /* T */) { - return false; // GB7 - } - } - if (breakTypeA === 12 /* LVT */ || breakTypeA === 10 /* T */) { - if (breakTypeB === 10 /* T */) { - return false; // GB8 - } - } - // Do not break before extending characters or ZWJ. - // GB9 × (Extend | ZWJ) - if (breakTypeB === 5 /* Extend */ || breakTypeB === 13 /* ZWJ */) { - return false; // GB9 - } - // The GB9a and GB9b rules only apply to extended grapheme clusters: - // Do not break before SpacingMarks, or after Prepend characters. - // GB9a × SpacingMark - // GB9b Prepend × - if (breakTypeB === 7 /* SpacingMark */) { - return false; // GB9a - } - if (breakTypeA === 1 /* Prepend */) { - return false; // GB9b - } - // Do not break within emoji modifier sequences or emoji zwj sequences. - // GB11 \p{Extended_Pictographic} Extend* ZWJ × \p{Extended_Pictographic} - if (breakTypeA === 13 /* ZWJ */ && breakTypeB === 14 /* Extended_Pictographic */) { - // Note: we are not implementing the rule entirely here to avoid introducing states - return false; // GB11 - } - // GB12 sot (RI RI)* RI × RI - // GB13 [^RI] (RI RI)* RI × RI - if (breakTypeA === 6 /* Regional_Indicator */ && breakTypeB === 6 /* Regional_Indicator */) { - // Note: we are not implementing the rule entirely here to avoid introducing states - return false; // GB12 & GB13 - } - // GB999 Any ÷ Any - return true; -} -class GraphemeBreakTree { - constructor() { - this._data = getGraphemeBreakRawData(); - } - static getInstance() { - if (!GraphemeBreakTree._INSTANCE) { - GraphemeBreakTree._INSTANCE = new GraphemeBreakTree(); - } - return GraphemeBreakTree._INSTANCE; - } - getGraphemeBreakType(codePoint) { - // !!! Let's make 7bit ASCII a bit faster: 0..31 - if (codePoint < 32) { - if (codePoint === 10 /* LineFeed */) { - return 3 /* LF */; - } - if (codePoint === 13 /* CarriageReturn */) { - return 2 /* CR */; - } - return 4 /* Control */; - } - // !!! Let's make 7bit ASCII a bit faster: 32..126 - if (codePoint < 127) { - return 0 /* Other */; - } - const data = this._data; - const nodeCount = data.length / 3; - let nodeIndex = 1; - while (nodeIndex <= nodeCount) { - if (codePoint < data[3 * nodeIndex]) { - // go left - nodeIndex = 2 * nodeIndex; - } - else if (codePoint > data[3 * nodeIndex + 1]) { - // go right - nodeIndex = 2 * nodeIndex + 1; - } - else { - // hit - return data[3 * nodeIndex + 2]; - } - } - return 0 /* Other */; - } -} -GraphemeBreakTree._INSTANCE = null; -function getGraphemeBreakRawData() { - // generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-grapheme-break.js - return JSON.parse('[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]'); -} -//#endregion - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/types.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/types.js ***! - \****************************************************************/ -/*! exports provided: isArray, isString, isObject, isNumber, isBoolean, isUndefined, isUndefinedOrNull, assertType, assertIsDefined, isFunction, validateConstraints, validateConstraint, getAllPropertyNames, getAllMethodNames, createProxyObject, withNullAsUndefined */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return isNumber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return isBoolean; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return isUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefinedOrNull", function() { return isUndefinedOrNull; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assertType", function() { return assertType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assertIsDefined", function() { return assertIsDefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraints", function() { return validateConstraints; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraint", function() { return validateConstraint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllPropertyNames", function() { return getAllPropertyNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllMethodNames", function() { return getAllMethodNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createProxyObject", function() { return createProxyObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withNullAsUndefined", function() { return withNullAsUndefined; }); -/** - * @returns whether the provided parameter is a JavaScript Array or not. - */ -function isArray(array) { - return Array.isArray(array); -} -/** - * @returns whether the provided parameter is a JavaScript String or not. - */ -function isString(str) { - return (typeof str === 'string'); -} -/** - * - * @returns whether the provided parameter is of type `object` but **not** - * `null`, an `array`, a `regexp`, nor a `date`. - */ -function isObject(obj) { - // The method can't do a type cast since there are type (like strings) which - // are subclasses of any put not positvely matched by the function. Hence type - // narrowing results in wrong results. - return typeof obj === 'object' - && obj !== null - && !Array.isArray(obj) - && !(obj instanceof RegExp) - && !(obj instanceof Date); -} -/** - * In **contrast** to just checking `typeof` this will return `false` for `NaN`. - * @returns whether the provided parameter is a JavaScript Number or not. - */ -function isNumber(obj) { - return (typeof obj === 'number' && !isNaN(obj)); -} -/** - * @returns whether the provided parameter is a JavaScript Boolean or not. - */ -function isBoolean(obj) { - return (obj === true || obj === false); -} -/** - * @returns whether the provided parameter is undefined. - */ -function isUndefined(obj) { - return (typeof obj === 'undefined'); -} -/** - * @returns whether the provided parameter is undefined or null. - */ -function isUndefinedOrNull(obj) { - return (isUndefined(obj) || obj === null); -} -function assertType(condition, type) { - if (!condition) { - throw new Error(type ? `Unexpected type, expected '${type}'` : 'Unexpected type'); - } -} -/** - * Asserts that the argument passed in is neither undefined nor null. - */ -function assertIsDefined(arg) { - if (isUndefinedOrNull(arg)) { - throw new Error('Assertion Failed: argument is undefined or null'); - } - return arg; -} -/** - * @returns whether the provided parameter is a JavaScript Function or not. - */ -function isFunction(obj) { - return (typeof obj === 'function'); -} -function validateConstraints(args, constraints) { - const len = Math.min(args.length, constraints.length); - for (let i = 0; i < len; i++) { - validateConstraint(args[i], constraints[i]); - } -} -function validateConstraint(arg, constraint) { - if (isString(constraint)) { - if (typeof arg !== constraint) { - throw new Error(`argument does not match constraint: typeof ${constraint}`); - } - } - else if (isFunction(constraint)) { - try { - if (arg instanceof constraint) { - return; - } - } - catch (_a) { - // ignore - } - if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { - return; - } - if (constraint.length === 1 && constraint.call(undefined, arg) === true) { - return; - } - throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`); - } -} -function getAllPropertyNames(obj) { - let res = []; - let proto = Object.getPrototypeOf(obj); - while (Object.prototype !== proto) { - res = res.concat(Object.getOwnPropertyNames(proto)); - proto = Object.getPrototypeOf(proto); - } - return res; -} -function getAllMethodNames(obj) { - const methods = []; - for (const prop of getAllPropertyNames(obj)) { - if (typeof obj[prop] === 'function') { - methods.push(prop); - } - } - return methods; -} -function createProxyObject(methodNames, invoke) { - const createProxyMethod = (method) => { - return function () { - const args = Array.prototype.slice.call(arguments, 0); - return invoke(method, args); - }; - }; - let result = {}; - for (const methodName of methodNames) { - result[methodName] = createProxyMethod(methodName); - } - return result; -} -/** - * Converts null to undefined, passes all other values through. - */ -function withNullAsUndefined(x) { - return x === null ? undefined : x; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/uint.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/uint.js ***! - \***************************************************************/ -/*! exports provided: toUint8, toUint32 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint8", function() { return toUint8; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32", function() { return toUint32; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function toUint8(v) { - if (v < 0) { - return 0; - } - if (v > 255 /* MAX_UINT_8 */) { - return 255 /* MAX_UINT_8 */; - } - return v | 0; -} -function toUint32(v) { - if (v < 0) { - return 0; - } - if (v > 4294967295 /* MAX_UINT_32 */) { - return 4294967295 /* MAX_UINT_32 */; - } - return v | 0; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/uri.js": -/*!**************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/uri.js ***! - \**************************************************************/ -/*! exports provided: URI, uriToFsPath */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "URI", function() { return URI; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uriToFsPath", function() { return uriToFsPath; }); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./path.js */ "./node_modules/monaco-editor/esm/vs/base/common/path.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -const _schemePattern = /^\w[\w\d+.-]*$/; -const _singleSlashStart = /^\//; -const _doubleSlashStart = /^\/\//; -function _validateUri(ret, _strict) { - // scheme, must be set - if (!ret.scheme && _strict) { - throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${ret.authority}", path: "${ret.path}", query: "${ret.query}", fragment: "${ret.fragment}"}`); - } - // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 - // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - if (ret.scheme && !_schemePattern.test(ret.scheme)) { - throw new Error('[UriError]: Scheme contains illegal characters.'); - } - // path, http://tools.ietf.org/html/rfc3986#section-3.3 - // If a URI contains an authority component, then the path component - // must either be empty or begin with a slash ("/") character. If a URI - // does not contain an authority component, then the path cannot begin - // with two slash characters ("//"). - if (ret.path) { - if (ret.authority) { - if (!_singleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); - } - } - else { - if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } - } - } -} -// for a while we allowed uris *without* schemes and this is the migration -// for them, e.g. an uri without scheme and without strict-mode warns and falls -// back to the file-scheme. that should cause the least carnage and still be a -// clear warning -function _schemeFix(scheme, _strict) { - if (!scheme && !_strict) { - return 'file'; - } - return scheme; -} -// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 -function _referenceResolution(scheme, path) { - // the slash-character is our 'default base' as we don't - // support constructing URIs relative to other URIs. This - // also means that we alter and potentially break paths. - // see https://tools.ietf.org/html/rfc3986#section-5.1.4 - switch (scheme) { - case 'https': - case 'http': - case 'file': - if (!path) { - path = _slash; - } - else if (path[0] !== _slash) { - path = _slash + path; - } - break; - } - return path; -} -const _empty = ''; -const _slash = '/'; -const _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; -/** - * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. - * This class is a simple parser which creates the basic component parts - * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation - * and encoding. - * - * ```txt - * foo://example.com:8042/over/there?name=ferret#nose - * \_/ \______________/\_________/ \_________/ \__/ - * | | | | | - * scheme authority path query fragment - * | _____________________|__ - * / \ / \ - * urn:example:animal:ferret:nose - * ``` - */ -class URI { - /** - * @internal - */ - constructor(schemeOrData, authority, path, query, fragment, _strict = false) { - if (typeof schemeOrData === 'object') { - this.scheme = schemeOrData.scheme || _empty; - this.authority = schemeOrData.authority || _empty; - this.path = schemeOrData.path || _empty; - this.query = schemeOrData.query || _empty; - this.fragment = schemeOrData.fragment || _empty; - // no validation because it's this URI - // that creates uri components. - // _validateUri(this); - } - else { - this.scheme = _schemeFix(schemeOrData, _strict); - this.authority = authority || _empty; - this.path = _referenceResolution(this.scheme, path || _empty); - this.query = query || _empty; - this.fragment = fragment || _empty; - _validateUri(this, _strict); - } - } - static isUri(thing) { - if (thing instanceof URI) { - return true; - } - if (!thing) { - return false; - } - return typeof thing.authority === 'string' - && typeof thing.fragment === 'string' - && typeof thing.path === 'string' - && typeof thing.query === 'string' - && typeof thing.scheme === 'string' - && typeof thing.fsPath === 'function' - && typeof thing.with === 'function' - && typeof thing.toString === 'function'; - } - // ---- filesystem path ----------------------- - /** - * Returns a string representing the corresponding file system path of this URI. - * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the - * platform specific path separator. - * - * * Will *not* validate the path for invalid characters and semantics. - * * Will *not* look at the scheme of this URI. - * * The result shall *not* be used for display purposes but for accessing a file on disk. - * - * - * The *difference* to `URI#path` is the use of the platform specific separator and the handling - * of UNC paths. See the below sample of a file-uri with an authority (UNC path). - * - * ```ts - const u = URI.parse('file://server/c$/folder/file.txt') - u.authority === 'server' - u.path === '/shares/c$/file.txt' - u.fsPath === '\\server\c$\folder\file.txt' - ``` - * - * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, - * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working - * with URIs that represent files on disk (`file` scheme). - */ - get fsPath() { - // if (this.scheme !== 'file') { - // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); - // } - return uriToFsPath(this, false); - } - // ---- modify to new ------------------------- - with(change) { - if (!change) { - return this; - } - let { scheme, authority, path, query, fragment } = change; - if (scheme === undefined) { - scheme = this.scheme; - } - else if (scheme === null) { - scheme = _empty; - } - if (authority === undefined) { - authority = this.authority; - } - else if (authority === null) { - authority = _empty; - } - if (path === undefined) { - path = this.path; - } - else if (path === null) { - path = _empty; - } - if (query === undefined) { - query = this.query; - } - else if (query === null) { - query = _empty; - } - if (fragment === undefined) { - fragment = this.fragment; - } - else if (fragment === null) { - fragment = _empty; - } - if (scheme === this.scheme - && authority === this.authority - && path === this.path - && query === this.query - && fragment === this.fragment) { - return this; - } - return new Uri(scheme, authority, path, query, fragment); - } - // ---- parse & validate ------------------------ - /** - * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, - * `file:///usr/home`, or `scheme:with/path`. - * - * @param value A string which represents an URI (see `URI#toString`). - */ - static parse(value, _strict = false) { - const match = _regexp.exec(value); - if (!match) { - return new Uri(_empty, _empty, _empty, _empty, _empty); - } - return new Uri(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict); - } - /** - * Creates a new URI from a file system path, e.g. `c:\my\files`, - * `/usr/home`, or `\\server\share\some\path`. - * - * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument - * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** - * `URI.parse('file://' + path)` because the path might contain characters that are - * interpreted (# and ?). See the following sample: - * ```ts - const good = URI.file('/coding/c#/project1'); - good.scheme === 'file'; - good.path === '/coding/c#/project1'; - good.fragment === ''; - const bad = URI.parse('file://' + '/coding/c#/project1'); - bad.scheme === 'file'; - bad.path === '/coding/c'; // path is now broken - bad.fragment === '/project1'; - ``` - * - * @param path A file system path (see `URI#fsPath`) - */ - static file(path) { - let authority = _empty; - // normalize to fwd-slashes on windows, - // on other systems bwd-slashes are valid - // filename character, eg /f\oo/ba\r.txt - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - path = path.replace(/\\/g, _slash); - } - // check for authority as used in UNC shares - // or use the path as given - if (path[0] === _slash && path[1] === _slash) { - const idx = path.indexOf(_slash, 2); - if (idx === -1) { - authority = path.substring(2); - path = _slash; - } - else { - authority = path.substring(2, idx); - path = path.substring(idx) || _slash; - } - } - return new Uri('file', authority, path, _empty, _empty); - } - static from(components) { - return new Uri(components.scheme, components.authority, components.path, components.query, components.fragment); - } - /** - * Join a URI path with path fragments and normalizes the resulting path. - * - * @param uri The input URI. - * @param pathFragment The path fragment to add to the URI path. - * @returns The resulting URI. - */ - static joinPath(uri, ...pathFragment) { - if (!uri.path) { - throw new Error(`[UriError]: cannot call joinPaths on URI without path`); - } - let newPath; - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"] && uri.scheme === 'file') { - newPath = URI.file(_path_js__WEBPACK_IMPORTED_MODULE_1__["win32"].join(uriToFsPath(uri, true), ...pathFragment)).path; - } - else { - newPath = _path_js__WEBPACK_IMPORTED_MODULE_1__["posix"].join(uri.path, ...pathFragment); - } - return uri.with({ path: newPath }); - } - // ---- printing/externalize --------------------------- - /** - * Creates a string representation for this URI. It's guaranteed that calling - * `URI.parse` with the result of this function creates an URI which is equal - * to this URI. - * - * * The result shall *not* be used for display purposes but for externalization or transport. - * * The result will be encoded using the percentage encoding and encoding happens mostly - * ignore the scheme-specific encoding rules. - * - * @param skipEncoding Do not encode the result, default is `false` - */ - toString(skipEncoding = false) { - return _asFormatted(this, skipEncoding); - } - toJSON() { - return this; - } - static revive(data) { - if (!data) { - return data; - } - else if (data instanceof URI) { - return data; - } - else { - const result = new Uri(data); - result._formatted = data.external; - result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null; - return result; - } - } -} -const _pathSepMarker = _platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"] ? 1 : undefined; -// This class exists so that URI is compatibile with vscode.Uri (API). -class Uri extends URI { - constructor() { - super(...arguments); - this._formatted = null; - this._fsPath = null; - } - get fsPath() { - if (!this._fsPath) { - this._fsPath = uriToFsPath(this, false); - } - return this._fsPath; - } - toString(skipEncoding = false) { - if (!skipEncoding) { - if (!this._formatted) { - this._formatted = _asFormatted(this, false); - } - return this._formatted; - } - else { - // we don't cache that - return _asFormatted(this, true); - } - } - toJSON() { - const res = { - $mid: 1 - }; - // cached state - if (this._fsPath) { - res.fsPath = this._fsPath; - res._sep = _pathSepMarker; - } - if (this._formatted) { - res.external = this._formatted; - } - // uri components - if (this.path) { - res.path = this.path; - } - if (this.scheme) { - res.scheme = this.scheme; - } - if (this.authority) { - res.authority = this.authority; - } - if (this.query) { - res.query = this.query; - } - if (this.fragment) { - res.fragment = this.fragment; - } - return res; - } -} -// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 -const encodeTable = { - [58 /* Colon */]: '%3A', - [47 /* Slash */]: '%2F', - [63 /* QuestionMark */]: '%3F', - [35 /* Hash */]: '%23', - [91 /* OpenSquareBracket */]: '%5B', - [93 /* CloseSquareBracket */]: '%5D', - [64 /* AtSign */]: '%40', - [33 /* ExclamationMark */]: '%21', - [36 /* DollarSign */]: '%24', - [38 /* Ampersand */]: '%26', - [39 /* SingleQuote */]: '%27', - [40 /* OpenParen */]: '%28', - [41 /* CloseParen */]: '%29', - [42 /* Asterisk */]: '%2A', - [43 /* Plus */]: '%2B', - [44 /* Comma */]: '%2C', - [59 /* Semicolon */]: '%3B', - [61 /* Equals */]: '%3D', - [32 /* Space */]: '%20', -}; -function encodeURIComponentFast(uriComponent, allowSlash) { - let res = undefined; - let nativeEncodePos = -1; - for (let pos = 0; pos < uriComponent.length; pos++) { - const code = uriComponent.charCodeAt(pos); - // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 - if ((code >= 97 /* a */ && code <= 122 /* z */) - || (code >= 65 /* A */ && code <= 90 /* Z */) - || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) - || code === 45 /* Dash */ - || code === 46 /* Period */ - || code === 95 /* Underline */ - || code === 126 /* Tilde */ - || (allowSlash && code === 47 /* Slash */)) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // check if we write into a new string (by default we try to return the param) - if (res !== undefined) { - res += uriComponent.charAt(pos); - } - } - else { - // encoding needed, we need to allocate a new string - if (res === undefined) { - res = uriComponent.substr(0, pos); - } - // check with default table first - const escaped = encodeTable[code]; - if (escaped !== undefined) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // append escaped variant to result - res += escaped; - } - else if (nativeEncodePos === -1) { - // use native encode only when needed - nativeEncodePos = pos; - } - } - } - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); - } - return res !== undefined ? res : uriComponent; -} -function encodeURIComponentMinimal(path) { - let res = undefined; - for (let pos = 0; pos < path.length; pos++) { - const code = path.charCodeAt(pos); - if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { - if (res === undefined) { - res = path.substr(0, pos); - } - res += encodeTable[code]; - } - else { - if (res !== undefined) { - res += path[pos]; - } - } - } - return res !== undefined ? res : path; -} -/** - * Compute `fsPath` for the given uri - */ -function uriToFsPath(uri, keepDriveLetterCasing) { - let value; - if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { - // unc path: file://shares/c$/far/boo - value = `//${uri.authority}${uri.path}`; - } - else if (uri.path.charCodeAt(0) === 47 /* Slash */ - && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) - && uri.path.charCodeAt(2) === 58 /* Colon */) { - if (!keepDriveLetterCasing) { - // windows drive letter: file:///c:/far/boo - value = uri.path[1].toLowerCase() + uri.path.substr(2); - } - else { - value = uri.path.substr(1); - } - } - else { - // other path - value = uri.path; - } - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - value = value.replace(/\//g, '\\'); - } - return value; -} -/** - * Create the external version of a uri - */ -function _asFormatted(uri, skipEncoding) { - const encoder = !skipEncoding - ? encodeURIComponentFast - : encodeURIComponentMinimal; - let res = ''; - let { scheme, authority, path, query, fragment } = uri; - if (scheme) { - res += scheme; - res += ':'; - } - if (authority || scheme === 'file') { - res += _slash; - res += _slash; - } - if (authority) { - let idx = authority.indexOf('@'); - if (idx !== -1) { - // @ - const userinfo = authority.substr(0, idx); - authority = authority.substr(idx + 1); - idx = userinfo.indexOf(':'); - if (idx === -1) { - res += encoder(userinfo, false); - } - else { - // :@ - res += encoder(userinfo.substr(0, idx), false); - res += ':'; - res += encoder(userinfo.substr(idx + 1), false); - } - res += '@'; - } - authority = authority.toLowerCase(); - idx = authority.indexOf(':'); - if (idx === -1) { - res += encoder(authority, false); - } - else { - // : - res += encoder(authority.substr(0, idx), false); - res += authority.substr(idx); - } - } - if (path) { - // lower-case windows drive letters in /C:/fff or C:/fff - if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { - const code = path.charCodeAt(1); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`; // "/c:".length === 3 - } - } - else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { - const code = path.charCodeAt(0); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`; // "/c:".length === 3 - } - } - // encode the rest of the path - res += encoder(path, true); - } - if (query) { - res += '?'; - res += encoder(query, false); - } - if (fragment) { - res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; - } - return res; -} -// --- decode -function decodeURIComponentGraceful(str) { - try { - return decodeURIComponent(str); - } - catch (_a) { - if (str.length > 3) { - return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3)); - } - else { - return str; - } - } -} -const _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g; -function percentDecode(str) { - if (!str.match(_rEncodedAsHex)) { - return str; - } - return str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match)); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js ***! - \******************************************************************************/ -/*! exports provided: logOnceWebWorkerWarning, SimpleWorkerClient, SimpleWorkerServer, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logOnceWebWorkerWarning", function() { return logOnceWebWorkerWarning; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerClient", function() { return SimpleWorkerClient; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerServer", function() { return SimpleWorkerServer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -const INITIALIZE = '$initialize'; -let webWorkerWarningLogged = false; -function logOnceWebWorkerWarning(err) { - if (!_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWeb"]) { - // running tests - return; - } - if (!webWorkerWarningLogged) { - webWorkerWarningLogged = true; - console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); - } - console.warn(err.message); -} -class SimpleWorkerProtocol { - constructor(handler) { - this._workerId = -1; - this._handler = handler; - this._lastSentReq = 0; - this._pendingReplies = Object.create(null); - } - setWorkerId(workerId) { - this._workerId = workerId; - } - sendMessage(method, args) { - let req = String(++this._lastSentReq); - return new Promise((resolve, reject) => { - this._pendingReplies[req] = { - resolve: resolve, - reject: reject - }; - this._send({ - vsWorker: this._workerId, - req: req, - method: method, - args: args - }); - }); - } - handleMessage(message) { - if (!message || !message.vsWorker) { - return; - } - if (this._workerId !== -1 && message.vsWorker !== this._workerId) { - return; - } - this._handleMessage(message); - } - _handleMessage(msg) { - if (msg.seq) { - let replyMessage = msg; - if (!this._pendingReplies[replyMessage.seq]) { - console.warn('Got reply to unknown seq'); - return; - } - let reply = this._pendingReplies[replyMessage.seq]; - delete this._pendingReplies[replyMessage.seq]; - if (replyMessage.err) { - let err = replyMessage.err; - if (replyMessage.err.$isError) { - err = new Error(); - err.name = replyMessage.err.name; - err.message = replyMessage.err.message; - err.stack = replyMessage.err.stack; - } - reply.reject(err); - return; - } - reply.resolve(replyMessage.res); - return; - } - let requestMessage = msg; - let req = requestMessage.req; - let result = this._handler.handleMessage(requestMessage.method, requestMessage.args); - result.then((r) => { - this._send({ - vsWorker: this._workerId, - seq: req, - res: r, - err: undefined - }); - }, (e) => { - if (e.detail instanceof Error) { - // Loading errors have a detail property that points to the actual error - e.detail = Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e.detail); - } - this._send({ - vsWorker: this._workerId, - seq: req, - res: undefined, - err: Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e) - }); - }); - } - _send(msg) { - let transfer = []; - if (msg.req) { - const m = msg; - for (let i = 0; i < m.args.length; i++) { - if (m.args[i] instanceof ArrayBuffer) { - transfer.push(m.args[i]); - } - } - } - else { - const m = msg; - if (m.res instanceof ArrayBuffer) { - transfer.push(m.res); - } - } - this._handler.sendMessage(msg, transfer); - } -} -/** - * Main thread side - */ -class SimpleWorkerClient extends _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(workerFactory, moduleId, host) { - super(); - let lazyProxyReject = null; - this._worker = this._register(workerFactory.create('vs/base/common/worker/simpleWorker', (msg) => { - this._protocol.handleMessage(msg); - }, (err) => { - // in Firefox, web workers fail lazily :( - // we will reject the proxy - if (lazyProxyReject) { - lazyProxyReject(err); - } - })); - this._protocol = new SimpleWorkerProtocol({ - sendMessage: (msg, transfer) => { - this._worker.postMessage(msg, transfer); - }, - handleMessage: (method, args) => { - if (typeof host[method] !== 'function') { - return Promise.reject(new Error('Missing method ' + method + ' on main thread host.')); - } - try { - return Promise.resolve(host[method].apply(host, args)); - } - catch (e) { - return Promise.reject(e); - } - } - }); - this._protocol.setWorkerId(this._worker.getId()); - // Gather loader configuration - let loaderConfiguration = null; - if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { - // Get the configuration from the Monaco AMD Loader - loaderConfiguration = self.require.getConfig(); - } - else if (typeof self.requirejs !== 'undefined') { - // Get the configuration from requirejs - loaderConfiguration = self.requirejs.s.contexts._.config; - } - const hostMethods = _types_js__WEBPACK_IMPORTED_MODULE_3__["getAllMethodNames"](host); - // Send initialize message - this._onModuleLoaded = this._protocol.sendMessage(INITIALIZE, [ - this._worker.getId(), - JSON.parse(JSON.stringify(loaderConfiguration)), - moduleId, - hostMethods, - ]); - // Create proxy to loaded code - const proxyMethodRequest = (method, args) => { - return this._request(method, args); - }; - this._lazyProxy = new Promise((resolve, reject) => { - lazyProxyReject = reject; - this._onModuleLoaded.then((availableMethods) => { - resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__["createProxyObject"](availableMethods, proxyMethodRequest)); - }, (e) => { - reject(e); - this._onError('Worker failed to load ' + moduleId, e); - }); - }); - } - getProxyObject() { - return this._lazyProxy; - } - _request(method, args) { - return new Promise((resolve, reject) => { - this._onModuleLoaded.then(() => { - this._protocol.sendMessage(method, args).then(resolve, reject); - }, reject); - }); - } - _onError(message, error) { - console.error(message); - console.info(error); - } -} -/** - * Worker side - */ -class SimpleWorkerServer { - constructor(postMessage, requestHandlerFactory) { - this._requestHandlerFactory = requestHandlerFactory; - this._requestHandler = null; - this._protocol = new SimpleWorkerProtocol({ - sendMessage: (msg, transfer) => { - postMessage(msg, transfer); - }, - handleMessage: (method, args) => this._handleMessage(method, args) - }); - } - onmessage(msg) { - this._protocol.handleMessage(msg); - } - _handleMessage(method, args) { - if (method === INITIALIZE) { - return this.initialize(args[0], args[1], args[2], args[3]); - } - if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); - } - catch (e) { - return Promise.reject(e); - } - } - initialize(workerId, loaderConfig, moduleId, hostMethods) { - this._protocol.setWorkerId(workerId); - const proxyMethodRequest = (method, args) => { - return this._protocol.sendMessage(method, args); - }; - const hostProxy = _types_js__WEBPACK_IMPORTED_MODULE_3__["createProxyObject"](hostMethods, proxyMethodRequest); - if (this._requestHandlerFactory) { - // static request handler - this._requestHandler = this._requestHandlerFactory(hostProxy); - return Promise.resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllMethodNames"](this._requestHandler)); - } - if (loaderConfig) { - // Remove 'baseUrl', handling it is beyond scope for now - if (typeof loaderConfig.baseUrl !== 'undefined') { - delete loaderConfig['baseUrl']; - } - if (typeof loaderConfig.paths !== 'undefined') { - if (typeof loaderConfig.paths.vs !== 'undefined') { - delete loaderConfig.paths['vs']; - } - } - // Since this is in a web worker, enable catching errors - loaderConfig.catchError = true; - self.require.config(loaderConfig); - } - return new Promise((resolve, reject) => { - // Use the global require to be sure to get the global config - self.require([moduleId], (module) => { - this._requestHandler = module.create(hostProxy); - if (!this._requestHandler) { - reject(new Error(`No RequestHandler!`)); - return; - } - resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllMethodNames"](this._requestHandler)); - }, reject); - }); - } -} -/** - * Called on the worker side - */ -function create(postMessage) { - return new SimpleWorkerServer(postMessage, null); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/media/quickInput.css": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/media/quickInput.css ***! - \**********************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_quickInput_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../../css-loader/dist/cjs.js!./quickInput.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/media/quickInput.css"); -/* harmony import */ var _css_loader_dist_cjs_js_quickInput_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_quickInput_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_quickInput_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_quickInput_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInput.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInput.js ***! - \***************************************************************************************/ -/*! exports provided: QuickInputController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickInputController", function() { return QuickInputController; }); -/* harmony import */ var _media_quickInput_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/quickInput.css */ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/media/quickInput.css"); -/* harmony import */ var _common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/quickInput.js */ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/common/quickInput.js"); -/* harmony import */ var _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_cancellation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _quickInputList_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./quickInputList.js */ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInputList.js"); -/* harmony import */ var _quickInputBox_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./quickInputBox.js */ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInputBox.js"); -/* harmony import */ var _browser_keyboardEvent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../browser/keyboardEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _browser_ui_countBadge_countBadge_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../browser/ui/countBadge/countBadge.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.js"); -/* harmony import */ var _browser_ui_progressbar_progressbar_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../browser/ui/progressbar/progressbar.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _browser_ui_button_button_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../browser/ui/button/button.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/button/button.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_severity_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../common/severity.js */ "./node_modules/monaco-editor/esm/vs/base/common/severity.js"); -/* harmony import */ var _browser_ui_actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../browser/ui/actionbar/actionbar.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js"); -/* harmony import */ var _common_actions_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _common_async_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _quickInputUtils_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./quickInputUtils.js */ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInputUtils.js"); -/* harmony import */ var _common_codicons_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - - - - - -const $ = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["$"]; -const backButtonIcon = Object(_common_codicons_js__WEBPACK_IMPORTED_MODULE_19__["registerIcon"])('quick-input-back', _common_codicons_js__WEBPACK_IMPORTED_MODULE_19__["Codicon"].arrowLeft); -const backButton = { - iconClass: backButtonIcon.classNames, - tooltip: Object(_nls_js__WEBPACK_IMPORTED_MODULE_7__["localize"])('quickInput.back', "Back"), - handle: -1 // TODO -}; -class QuickInput extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_12__["Disposable"] { - constructor(ui) { - super(); - this.ui = ui; - this.visible = false; - this._enabled = true; - this._busy = false; - this._ignoreFocusOut = false; - this._buttons = []; - this.buttonsUpdated = false; - this.onDidTriggerButtonEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this.onDidHideEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this.onDisposeEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this.visibleDisposables = this._register(new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_12__["DisposableStore"]()); - this.onDidHide = this.onDidHideEmitter.event; - } - get title() { - return this._title; - } - set title(title) { - this._title = title; - this.update(); - } - get description() { - return this._description; - } - set description(description) { - this._description = description; - this.update(); - } - get step() { - return this._steps; - } - set step(step) { - this._steps = step; - this.update(); - } - get totalSteps() { - return this._totalSteps; - } - set totalSteps(totalSteps) { - this._totalSteps = totalSteps; - this.update(); - } - get enabled() { - return this._enabled; - } - set enabled(enabled) { - this._enabled = enabled; - this.update(); - } - get contextKey() { - return this._contextKey; - } - set contextKey(contextKey) { - this._contextKey = contextKey; - this.update(); - } - get busy() { - return this._busy; - } - set busy(busy) { - this._busy = busy; - this.update(); - } - get ignoreFocusOut() { - return this._ignoreFocusOut; - } - set ignoreFocusOut(ignoreFocusOut) { - this._ignoreFocusOut = ignoreFocusOut; - this.update(); - } - get buttons() { - return this._buttons; - } - set buttons(buttons) { - this._buttons = buttons; - this.buttonsUpdated = true; - this.update(); - } - show() { - if (this.visible) { - return; - } - this.visibleDisposables.add(this.ui.onDidTriggerButton(button => { - if (this.buttons.indexOf(button) !== -1) { - this.onDidTriggerButtonEmitter.fire(button); - } - })); - this.ui.show(this); - this.visible = true; - this.update(); - } - hide() { - if (!this.visible) { - return; - } - this.ui.hide(); - } - didHide() { - this.visible = false; - this.visibleDisposables.clear(); - this.onDidHideEmitter.fire(); - } - update() { - if (!this.visible) { - return; - } - const title = this.getTitle(); - if (title && this.ui.title.textContent !== title) { - this.ui.title.textContent = title; - } - else if (!title && this.ui.title.innerHTML !== ' ') { - this.ui.title.innerText = '\u00a0;'; - } - const description = this.getDescription(); - if (this.ui.description.textContent !== description) { - this.ui.description.textContent = description; - } - if (this.busy && !this.busyDelay) { - this.busyDelay = new _common_async_js__WEBPACK_IMPORTED_MODULE_17__["TimeoutTimer"](); - this.busyDelay.setIfNotSet(() => { - if (this.visible) { - this.ui.progressBar.infinite(); - } - }, 800); - } - if (!this.busy && this.busyDelay) { - this.ui.progressBar.stop(); - this.busyDelay.cancel(); - this.busyDelay = undefined; - } - if (this.buttonsUpdated) { - this.buttonsUpdated = false; - this.ui.leftActionBar.clear(); - const leftButtons = this.buttons.filter(button => button === backButton); - this.ui.leftActionBar.push(leftButtons.map((button, index) => { - const action = new _common_actions_js__WEBPACK_IMPORTED_MODULE_15__["Action"](`id-${index}`, '', button.iconClass || Object(_quickInputUtils_js__WEBPACK_IMPORTED_MODULE_18__["getIconClass"])(button.iconPath), true, () => __awaiter(this, void 0, void 0, function* () { - this.onDidTriggerButtonEmitter.fire(button); - })); - action.tooltip = button.tooltip || ''; - return action; - }), { icon: true, label: false }); - this.ui.rightActionBar.clear(); - const rightButtons = this.buttons.filter(button => button !== backButton); - this.ui.rightActionBar.push(rightButtons.map((button, index) => { - const action = new _common_actions_js__WEBPACK_IMPORTED_MODULE_15__["Action"](`id-${index}`, '', button.iconClass || Object(_quickInputUtils_js__WEBPACK_IMPORTED_MODULE_18__["getIconClass"])(button.iconPath), true, () => __awaiter(this, void 0, void 0, function* () { - this.onDidTriggerButtonEmitter.fire(button); - })); - action.tooltip = button.tooltip || ''; - return action; - }), { icon: true, label: false }); - } - this.ui.ignoreFocusOut = this.ignoreFocusOut; - this.ui.setEnabled(this.enabled); - this.ui.setContextKey(this.contextKey); - } - getTitle() { - if (this.title && this.step) { - return `${this.title} (${this.getSteps()})`; - } - if (this.title) { - return this.title; - } - if (this.step) { - return this.getSteps(); - } - return ''; - } - getDescription() { - return this.description || ''; - } - getSteps() { - if (this.step && this.totalSteps) { - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_7__["localize"])('quickInput.steps', "{0}/{1}", this.step, this.totalSteps); - } - if (this.step) { - return String(this.step); - } - return ''; - } - showMessageDecoration(severity) { - this.ui.inputBox.showDecoration(severity); - if (severity === _common_severity_js__WEBPACK_IMPORTED_MODULE_13__["default"].Error) { - const styles = this.ui.inputBox.stylesForType(severity); - this.ui.message.style.color = styles.foreground ? `${styles.foreground}` : ''; - this.ui.message.style.backgroundColor = styles.background ? `${styles.background}` : ''; - this.ui.message.style.border = styles.border ? `1px solid ${styles.border}` : ''; - this.ui.message.style.paddingBottom = '4px'; - } - else { - this.ui.message.style.color = ''; - this.ui.message.style.backgroundColor = ''; - this.ui.message.style.border = ''; - this.ui.message.style.paddingBottom = ''; - } - } - dispose() { - this.hide(); - this.onDisposeEmitter.fire(); - super.dispose(); - } -} -class QuickPick extends QuickInput { - constructor() { - super(...arguments); - this._value = ''; - this.onDidChangeValueEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this.onDidAcceptEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this.onDidCustomEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this._items = []; - this.itemsUpdated = false; - this._canSelectMany = false; - this._canAcceptInBackground = false; - this._matchOnDescription = false; - this._matchOnDetail = false; - this._matchOnLabel = true; - this._sortByLabel = true; - this._autoFocusOnList = true; - this._itemActivation = this.ui.isScreenReaderOptimized() ? _common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__["ItemActivation"].NONE /* https://github.com/microsoft/vscode/issues/57501 */ : _common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__["ItemActivation"].FIRST; - this._activeItems = []; - this.activeItemsUpdated = false; - this.activeItemsToConfirm = []; - this.onDidChangeActiveEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this._selectedItems = []; - this.selectedItemsUpdated = false; - this.selectedItemsToConfirm = []; - this.onDidChangeSelectionEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this.onDidTriggerItemButtonEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this.valueSelectionUpdated = true; - this._ok = 'default'; - this._customButton = false; - this.filterValue = (value) => value; - this.onDidChangeValue = this.onDidChangeValueEmitter.event; - this.onDidAccept = this.onDidAcceptEmitter.event; - this.onDidChangeActive = this.onDidChangeActiveEmitter.event; - this.onDidChangeSelection = this.onDidChangeSelectionEmitter.event; - this.onDidTriggerItemButton = this.onDidTriggerItemButtonEmitter.event; - } - get quickNavigate() { - return this._quickNavigate; - } - set quickNavigate(quickNavigate) { - this._quickNavigate = quickNavigate; - this.update(); - } - get value() { - return this._value; - } - set value(value) { - this._value = value || ''; - this.update(); - } - set ariaLabel(ariaLabel) { - this._ariaLabel = ariaLabel; - this.update(); - } - get ariaLabel() { - return this._ariaLabel; - } - get placeholder() { - return this._placeholder; - } - set placeholder(placeholder) { - this._placeholder = placeholder; - this.update(); - } - get items() { - return this._items; - } - set items(items) { - this._items = items; - this.itemsUpdated = true; - this.update(); - } - get canSelectMany() { - return this._canSelectMany; - } - set canSelectMany(canSelectMany) { - this._canSelectMany = canSelectMany; - this.update(); - } - get canAcceptInBackground() { - return this._canAcceptInBackground; - } - set canAcceptInBackground(canAcceptInBackground) { - this._canAcceptInBackground = canAcceptInBackground; - } - get matchOnDescription() { - return this._matchOnDescription; - } - set matchOnDescription(matchOnDescription) { - this._matchOnDescription = matchOnDescription; - this.update(); - } - get matchOnDetail() { - return this._matchOnDetail; - } - set matchOnDetail(matchOnDetail) { - this._matchOnDetail = matchOnDetail; - this.update(); - } - get matchOnLabel() { - return this._matchOnLabel; - } - set matchOnLabel(matchOnLabel) { - this._matchOnLabel = matchOnLabel; - this.update(); - } - get sortByLabel() { - return this._sortByLabel; - } - set sortByLabel(sortByLabel) { - this._sortByLabel = sortByLabel; - this.update(); - } - get autoFocusOnList() { - return this._autoFocusOnList; - } - set autoFocusOnList(autoFocusOnList) { - this._autoFocusOnList = autoFocusOnList; - this.update(); - } - get itemActivation() { - return this._itemActivation; - } - set itemActivation(itemActivation) { - this._itemActivation = itemActivation; - } - get activeItems() { - return this._activeItems; - } - set activeItems(activeItems) { - this._activeItems = activeItems; - this.activeItemsUpdated = true; - this.update(); - } - get selectedItems() { - return this._selectedItems; - } - set selectedItems(selectedItems) { - this._selectedItems = selectedItems; - this.selectedItemsUpdated = true; - this.update(); - } - get keyMods() { - if (this._quickNavigate) { - // Disable keyMods when quick navigate is enabled - // because in this model the interaction is purely - // keyboard driven and Ctrl/Alt are typically - // pressed and hold during this interaction. - return _common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__["NO_KEY_MODS"]; - } - return this.ui.keyMods; - } - set valueSelection(valueSelection) { - this._valueSelection = valueSelection; - this.valueSelectionUpdated = true; - this.update(); - } - get validationMessage() { - return this._validationMessage; - } - set validationMessage(validationMessage) { - this._validationMessage = validationMessage; - this.update(); - } - get customButton() { - return this._customButton; - } - set customButton(showCustomButton) { - this._customButton = showCustomButton; - this.update(); - } - get customLabel() { - return this._customButtonLabel; - } - set customLabel(label) { - this._customButtonLabel = label; - this.update(); - } - get customHover() { - return this._customButtonHover; - } - set customHover(hover) { - this._customButtonHover = hover; - this.update(); - } - get ok() { - return this._ok; - } - set ok(showOkButton) { - this._ok = showOkButton; - this.update(); - } - get hideInput() { - return !!this._hideInput; - } - set hideInput(hideInput) { - this._hideInput = hideInput; - this.update(); - } - trySelectFirst() { - if (this.autoFocusOnList) { - if (!this.canSelectMany) { - this.ui.list.focus(_quickInputList_js__WEBPACK_IMPORTED_MODULE_4__["QuickInputListFocus"].First); - } - } - } - show() { - if (!this.visible) { - this.visibleDisposables.add(this.ui.inputBox.onDidChange(value => { - if (value === this.value) { - return; - } - this._value = value; - const didFilter = this.ui.list.filter(this.filterValue(this.ui.inputBox.value)); - if (didFilter) { - this.trySelectFirst(); - } - this.onDidChangeValueEmitter.fire(value); - })); - this.visibleDisposables.add(this.ui.inputBox.onMouseDown(event => { - if (!this.autoFocusOnList) { - this.ui.list.clearFocus(); - } - })); - this.visibleDisposables.add((this._hideInput ? this.ui.list : this.ui.inputBox).onKeyDown((event) => { - switch (event.keyCode) { - case 18 /* DownArrow */: - this.ui.list.focus(_quickInputList_js__WEBPACK_IMPORTED_MODULE_4__["QuickInputListFocus"].Next); - if (this.canSelectMany) { - this.ui.list.domFocus(); - } - _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventHelper"].stop(event, true); - break; - case 16 /* UpArrow */: - if (this.ui.list.getFocusedElements().length) { - this.ui.list.focus(_quickInputList_js__WEBPACK_IMPORTED_MODULE_4__["QuickInputListFocus"].Previous); - } - else { - this.ui.list.focus(_quickInputList_js__WEBPACK_IMPORTED_MODULE_4__["QuickInputListFocus"].Last); - } - if (this.canSelectMany) { - this.ui.list.domFocus(); - } - _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventHelper"].stop(event, true); - break; - case 12 /* PageDown */: - this.ui.list.focus(_quickInputList_js__WEBPACK_IMPORTED_MODULE_4__["QuickInputListFocus"].NextPage); - if (this.canSelectMany) { - this.ui.list.domFocus(); - } - _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventHelper"].stop(event, true); - break; - case 11 /* PageUp */: - this.ui.list.focus(_quickInputList_js__WEBPACK_IMPORTED_MODULE_4__["QuickInputListFocus"].PreviousPage); - if (this.canSelectMany) { - this.ui.list.domFocus(); - } - _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventHelper"].stop(event, true); - break; - case 17 /* RightArrow */: - if (!this._canAcceptInBackground) { - return; // needs to be enabled - } - if (!this.ui.inputBox.isSelectionAtEnd()) { - return; // ensure input box selection at end - } - if (this.activeItems[0]) { - this._selectedItems = [this.activeItems[0]]; - this.onDidChangeSelectionEmitter.fire(this.selectedItems); - this.onDidAcceptEmitter.fire({ inBackground: true }); - } - break; - case 14 /* Home */: - if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey) { - this.ui.list.focus(_quickInputList_js__WEBPACK_IMPORTED_MODULE_4__["QuickInputListFocus"].First); - _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventHelper"].stop(event, true); - } - break; - case 13 /* End */: - if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey) { - this.ui.list.focus(_quickInputList_js__WEBPACK_IMPORTED_MODULE_4__["QuickInputListFocus"].Last); - _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventHelper"].stop(event, true); - } - break; - } - })); - this.visibleDisposables.add(this.ui.onDidAccept(() => { - if (!this.canSelectMany && this.activeItems[0]) { - this._selectedItems = [this.activeItems[0]]; - this.onDidChangeSelectionEmitter.fire(this.selectedItems); - } - this.onDidAcceptEmitter.fire({ inBackground: false }); - })); - this.visibleDisposables.add(this.ui.onDidCustom(() => { - this.onDidCustomEmitter.fire(); - })); - this.visibleDisposables.add(this.ui.list.onDidChangeFocus(focusedItems => { - if (this.activeItemsUpdated) { - return; // Expect another event. - } - if (this.activeItemsToConfirm !== this._activeItems && Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_16__["equals"])(focusedItems, this._activeItems, (a, b) => a === b)) { - return; - } - this._activeItems = focusedItems; - this.onDidChangeActiveEmitter.fire(focusedItems); - })); - this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({ items: selectedItems, event }) => { - if (this.canSelectMany) { - if (selectedItems.length) { - this.ui.list.setSelectedElements([]); - } - return; - } - if (this.selectedItemsToConfirm !== this._selectedItems && Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_16__["equals"])(selectedItems, this._selectedItems, (a, b) => a === b)) { - return; - } - this._selectedItems = selectedItems; - this.onDidChangeSelectionEmitter.fire(selectedItems); - if (selectedItems.length) { - this.onDidAcceptEmitter.fire({ inBackground: event instanceof MouseEvent && event.button === 1 /* mouse middle click */ }); - } - })); - this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(checkedItems => { - if (!this.canSelectMany) { - return; - } - if (this.selectedItemsToConfirm !== this._selectedItems && Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_16__["equals"])(checkedItems, this._selectedItems, (a, b) => a === b)) { - return; - } - this._selectedItems = checkedItems; - this.onDidChangeSelectionEmitter.fire(checkedItems); - })); - this.visibleDisposables.add(this.ui.list.onButtonTriggered(event => this.onDidTriggerItemButtonEmitter.fire(event))); - this.visibleDisposables.add(this.registerQuickNavigation()); - this.valueSelectionUpdated = true; - } - super.show(); // TODO: Why have show() bubble up while update() trickles down? (Could move setComboboxAccessibility() here.) - } - registerQuickNavigation() { - return _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](this.ui.container, _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].KEY_UP, e => { - if (this.canSelectMany || !this._quickNavigate) { - return; - } - const keyboardEvent = new _browser_keyboardEvent_js__WEBPACK_IMPORTED_MODULE_6__["StandardKeyboardEvent"](e); - const keyCode = keyboardEvent.keyCode; - // Select element when keys are pressed that signal it - const quickNavKeys = this._quickNavigate.keybindings; - const wasTriggerKeyPressed = quickNavKeys.some(k => { - const [firstPart, chordPart] = k.getParts(); - if (chordPart) { - return false; - } - if (firstPart.shiftKey && keyCode === 4 /* Shift */) { - if (keyboardEvent.ctrlKey || keyboardEvent.altKey || keyboardEvent.metaKey) { - return false; // this is an optimistic check for the shift key being used to navigate back in quick input - } - return true; - } - if (firstPart.altKey && keyCode === 6 /* Alt */) { - return true; - } - if (firstPart.ctrlKey && keyCode === 5 /* Ctrl */) { - return true; - } - if (firstPart.metaKey && keyCode === 57 /* Meta */) { - return true; - } - return false; - }); - if (wasTriggerKeyPressed) { - if (this.activeItems[0]) { - this._selectedItems = [this.activeItems[0]]; - this.onDidChangeSelectionEmitter.fire(this.selectedItems); - this.onDidAcceptEmitter.fire({ inBackground: false }); - } - // Unset quick navigate after press. It is only valid once - // and should not result in any behaviour change afterwards - // if the picker remains open because there was no active item - this._quickNavigate = undefined; - } - }); - } - update() { - if (!this.visible) { - return; - } - let hideInput = false; - let inputShownJustForScreenReader = false; - if (!!this._hideInput && this._items.length > 0) { - if (this.ui.isScreenReaderOptimized()) { - // Always show input if screen reader attached https://github.com/microsoft/vscode/issues/94360 - inputShownJustForScreenReader = true; - } - else { - hideInput = true; - } - } - _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["toggleClass"](this.ui.container, 'hidden-input', hideInput); - const visibilities = { - title: !!this.title || !!this.step || !!this.buttons.length, - description: !!this.description, - checkAll: this.canSelectMany, - inputBox: !hideInput, - progressBar: !hideInput, - visibleCount: true, - count: this.canSelectMany, - ok: this.ok === 'default' ? this.canSelectMany : this.ok, - list: true, - message: !!this.validationMessage, - customButton: this.customButton - }; - this.ui.setVisibilities(visibilities); - super.update(); - if (this.ui.inputBox.value !== this.value) { - this.ui.inputBox.value = this.value; - } - if (this.valueSelectionUpdated) { - this.valueSelectionUpdated = false; - this.ui.inputBox.select(this._valueSelection && { start: this._valueSelection[0], end: this._valueSelection[1] }); - } - if (this.ui.inputBox.placeholder !== (this.placeholder || '')) { - this.ui.inputBox.placeholder = (this.placeholder || ''); - } - if (inputShownJustForScreenReader) { - this.ui.inputBox.ariaLabel = ''; - } - else { - const ariaLabel = this.ariaLabel || this.placeholder || QuickPick.DEFAULT_ARIA_LABEL; - if (this.ui.inputBox.ariaLabel !== ariaLabel) { - this.ui.inputBox.ariaLabel = ariaLabel; - } - } - this.ui.list.matchOnDescription = this.matchOnDescription; - this.ui.list.matchOnDetail = this.matchOnDetail; - this.ui.list.matchOnLabel = this.matchOnLabel; - this.ui.list.sortByLabel = this.sortByLabel; - if (this.itemsUpdated) { - this.itemsUpdated = false; - this.ui.list.setElements(this.items); - this.ui.list.filter(this.filterValue(this.ui.inputBox.value)); - this.ui.checkAll.checked = this.ui.list.getAllVisibleChecked(); - this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()); - this.ui.count.setCount(this.ui.list.getCheckedCount()); - switch (this._itemActivation) { - case _common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__["ItemActivation"].NONE: - this._itemActivation = _common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__["ItemActivation"].FIRST; // only valid once, then unset - break; - case _common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__["ItemActivation"].SECOND: - this.ui.list.focus(_quickInputList_js__WEBPACK_IMPORTED_MODULE_4__["QuickInputListFocus"].Second); - this._itemActivation = _common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__["ItemActivation"].FIRST; // only valid once, then unset - break; - case _common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__["ItemActivation"].LAST: - this.ui.list.focus(_quickInputList_js__WEBPACK_IMPORTED_MODULE_4__["QuickInputListFocus"].Last); - this._itemActivation = _common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__["ItemActivation"].FIRST; // only valid once, then unset - break; - default: - this.trySelectFirst(); - break; - } - } - if (this.ui.container.classList.contains('show-checkboxes') !== !!this.canSelectMany) { - if (this.canSelectMany) { - this.ui.list.clearFocus(); - } - else { - this.trySelectFirst(); - } - } - if (this.activeItemsUpdated) { - this.activeItemsUpdated = false; - this.activeItemsToConfirm = this._activeItems; - this.ui.list.setFocusedElements(this.activeItems); - if (this.activeItemsToConfirm === this._activeItems) { - this.activeItemsToConfirm = null; - } - } - if (this.selectedItemsUpdated) { - this.selectedItemsUpdated = false; - this.selectedItemsToConfirm = this._selectedItems; - if (this.canSelectMany) { - this.ui.list.setCheckedElements(this.selectedItems); - } - else { - this.ui.list.setSelectedElements(this.selectedItems); - } - if (this.selectedItemsToConfirm === this._selectedItems) { - this.selectedItemsToConfirm = null; - } - } - if (this.validationMessage) { - this.ui.message.textContent = this.validationMessage; - this.showMessageDecoration(_common_severity_js__WEBPACK_IMPORTED_MODULE_13__["default"].Error); - } - else { - this.ui.message.textContent = null; - this.showMessageDecoration(_common_severity_js__WEBPACK_IMPORTED_MODULE_13__["default"].Ignore); - } - this.ui.customButton.label = this.customLabel || ''; - this.ui.customButton.element.title = this.customHover || ''; - this.ui.setComboboxAccessibility(true); - if (!visibilities.inputBox) { - // we need to move focus into the tree to detect keybindings - // properly when the input box is not visible (quick nav) - this.ui.list.domFocus(); - } - } -} -QuickPick.DEFAULT_ARIA_LABEL = Object(_nls_js__WEBPACK_IMPORTED_MODULE_7__["localize"])('quickInputBox.ariaLabel', "Type to narrow down results."); -class QuickInputController extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_12__["Disposable"] { - constructor(options) { - super(); - this.options = options; - this.comboboxAccessibility = false; - this.enabled = true; - this.onDidAcceptEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this.onDidCustomEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this.onDidTriggerButtonEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this.keyMods = { ctrlCmd: false, alt: false }; - this.controller = null; - this.onShowEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this.onShow = this.onShowEmitter.event; - this.onHideEmitter = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_10__["Emitter"]()); - this.onHide = this.onHideEmitter.event; - this.idPrefix = options.idPrefix; - this.parentElement = options.container; - this.styles = options.styles; - this.registerKeyModsListeners(); - } - registerKeyModsListeners() { - const listener = (e) => { - this.keyMods.ctrlCmd = e.ctrlKey || e.metaKey; - this.keyMods.alt = e.altKey; - }; - this._register(_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](window, _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].KEY_DOWN, listener, true)); - this._register(_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](window, _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].KEY_UP, listener, true)); - this._register(_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](window, _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].MOUSE_DOWN, listener, true)); - } - getUI() { - if (this.ui) { - return this.ui; - } - const container = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](this.parentElement, $('.quick-input-widget.show-file-icons')); - container.tabIndex = -1; - container.style.display = 'none'; - const styleSheet = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["createStyleSheet"](container); - const titleBar = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](container, $('.quick-input-titlebar')); - const leftActionBar = this._register(new _browser_ui_actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_14__["ActionBar"](titleBar)); - leftActionBar.domNode.classList.add('quick-input-left-action-bar'); - const title = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](titleBar, $('.quick-input-title')); - const rightActionBar = this._register(new _browser_ui_actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_14__["ActionBar"](titleBar)); - rightActionBar.domNode.classList.add('quick-input-right-action-bar'); - const description = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](container, $('.quick-input-description')); - const headerContainer = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](container, $('.quick-input-header')); - const checkAll = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](headerContainer, $('input.quick-input-check-all')); - checkAll.type = 'checkbox'; - this._register(_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addStandardDisposableListener"](checkAll, _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].CHANGE, e => { - const checked = checkAll.checked; - list.setAllVisibleChecked(checked); - })); - this._register(_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](checkAll, _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].CLICK, e => { - if (e.x || e.y) { // Avoid 'click' triggered by 'space'... - inputBox.setFocus(); - } - })); - const extraContainer = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](headerContainer, $('.quick-input-and-message')); - const filterContainer = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](extraContainer, $('.quick-input-filter')); - const inputBox = this._register(new _quickInputBox_js__WEBPACK_IMPORTED_MODULE_5__["QuickInputBox"](filterContainer)); - inputBox.setAttribute('aria-describedby', `${this.idPrefix}message`); - const visibleCountContainer = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](filterContainer, $('.quick-input-visible-count')); - visibleCountContainer.setAttribute('aria-live', 'polite'); - visibleCountContainer.setAttribute('aria-atomic', 'true'); - const visibleCount = new _browser_ui_countBadge_countBadge_js__WEBPACK_IMPORTED_MODULE_8__["CountBadge"](visibleCountContainer, { countFormat: Object(_nls_js__WEBPACK_IMPORTED_MODULE_7__["localize"])({ key: 'quickInput.visibleCount', comment: ['This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers.'] }, "{0} Results") }); - const countContainer = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](filterContainer, $('.quick-input-count')); - countContainer.setAttribute('aria-live', 'polite'); - const count = new _browser_ui_countBadge_countBadge_js__WEBPACK_IMPORTED_MODULE_8__["CountBadge"](countContainer, { countFormat: Object(_nls_js__WEBPACK_IMPORTED_MODULE_7__["localize"])({ key: 'quickInput.countSelected', comment: ['This tells the user how many items are selected in a list of items to select from. The items can be anything.'] }, "{0} Selected") }); - const okContainer = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](headerContainer, $('.quick-input-action')); - const ok = new _browser_ui_button_button_js__WEBPACK_IMPORTED_MODULE_11__["Button"](okContainer); - ok.label = Object(_nls_js__WEBPACK_IMPORTED_MODULE_7__["localize"])('ok', "OK"); - this._register(ok.onDidClick(e => { - this.onDidAcceptEmitter.fire(); - })); - const customButtonContainer = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](headerContainer, $('.quick-input-action')); - const customButton = new _browser_ui_button_button_js__WEBPACK_IMPORTED_MODULE_11__["Button"](customButtonContainer); - customButton.label = Object(_nls_js__WEBPACK_IMPORTED_MODULE_7__["localize"])('custom', "Custom"); - this._register(customButton.onDidClick(e => { - this.onDidCustomEmitter.fire(); - })); - const message = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](extraContainer, $(`#${this.idPrefix}message.quick-input-message`)); - const progressBar = new _browser_ui_progressbar_progressbar_js__WEBPACK_IMPORTED_MODULE_9__["ProgressBar"](container); - _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](progressBar.getContainer(), 'quick-input-progress'); - const list = this._register(new _quickInputList_js__WEBPACK_IMPORTED_MODULE_4__["QuickInputList"](container, this.idPrefix + 'list', this.options)); - this._register(list.onChangedAllVisibleChecked(checked => { - checkAll.checked = checked; - })); - this._register(list.onChangedVisibleCount(c => { - visibleCount.setCount(c); - })); - this._register(list.onChangedCheckedCount(c => { - count.setCount(c); - })); - this._register(list.onLeave(() => { - // Defer to avoid the input field reacting to the triggering key. - setTimeout(() => { - inputBox.setFocus(); - if (this.controller instanceof QuickPick && this.controller.canSelectMany) { - list.clearFocus(); - } - }, 0); - })); - this._register(list.onDidChangeFocus(() => { - if (this.comboboxAccessibility) { - this.getUI().inputBox.setAttribute('aria-activedescendant', this.getUI().list.getActiveDescendant() || ''); - } - })); - const focusTracker = _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["trackFocus"](container); - this._register(focusTracker); - this._register(_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](container, _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].FOCUS, e => { - this.previousFocusElement = e.relatedTarget instanceof HTMLElement ? e.relatedTarget : undefined; - }, true)); - this._register(focusTracker.onDidBlur(() => { - if (!this.getUI().ignoreFocusOut && !this.options.ignoreFocusOut()) { - this.hide(); - } - this.previousFocusElement = undefined; - })); - this._register(_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](container, _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].FOCUS, (e) => { - inputBox.setFocus(); - })); - this._register(_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](container, _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].KEY_DOWN, (e) => { - const event = new _browser_keyboardEvent_js__WEBPACK_IMPORTED_MODULE_6__["StandardKeyboardEvent"](e); - switch (event.keyCode) { - case 3 /* Enter */: - _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventHelper"].stop(e, true); - this.onDidAcceptEmitter.fire(); - break; - case 9 /* Escape */: - _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventHelper"].stop(e, true); - this.hide(); - break; - case 2 /* Tab */: - if (!event.altKey && !event.ctrlKey && !event.metaKey) { - const selectors = ['.action-label.codicon']; - if (container.classList.contains('show-checkboxes')) { - selectors.push('input'); - } - else { - selectors.push('input[type=text]'); - } - if (this.getUI().list.isDisplayed()) { - selectors.push('.monaco-list'); - } - const stops = container.querySelectorAll(selectors.join(', ')); - if (event.shiftKey && event.target === stops[0]) { - _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventHelper"].stop(e, true); - stops[stops.length - 1].focus(); - } - else if (!event.shiftKey && event.target === stops[stops.length - 1]) { - _browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventHelper"].stop(e, true); - stops[0].focus(); - } - } - break; - } - })); - this.ui = { - container, - styleSheet, - leftActionBar, - titleBar, - title, - description, - rightActionBar, - checkAll, - filterContainer, - inputBox, - visibleCountContainer, - visibleCount, - countContainer, - count, - okContainer, - ok, - message, - customButtonContainer, - customButton, - progressBar, - list, - onDidAccept: this.onDidAcceptEmitter.event, - onDidCustom: this.onDidCustomEmitter.event, - onDidTriggerButton: this.onDidTriggerButtonEmitter.event, - ignoreFocusOut: false, - keyMods: this.keyMods, - isScreenReaderOptimized: () => this.options.isScreenReaderOptimized(), - show: controller => this.show(controller), - hide: () => this.hide(), - setVisibilities: visibilities => this.setVisibilities(visibilities), - setComboboxAccessibility: enabled => this.setComboboxAccessibility(enabled), - setEnabled: enabled => this.setEnabled(enabled), - setContextKey: contextKey => this.options.setContextKey(contextKey), - }; - this.updateStyles(); - return this.ui; - } - pick(picks, options = {}, token = _common_cancellation_js__WEBPACK_IMPORTED_MODULE_3__["CancellationToken"].None) { - return new Promise((doResolve, reject) => { - let resolve = (result) => { - resolve = doResolve; - if (options.onKeyMods) { - options.onKeyMods(input.keyMods); - } - doResolve(result); - }; - if (token.isCancellationRequested) { - resolve(undefined); - return; - } - const input = this.createQuickPick(); - let activeItem; - const disposables = [ - input, - input.onDidAccept(() => { - if (input.canSelectMany) { - resolve(input.selectedItems.slice()); - input.hide(); - } - else { - const result = input.activeItems[0]; - if (result) { - resolve(result); - input.hide(); - } - } - }), - input.onDidChangeActive(items => { - const focused = items[0]; - if (focused && options.onDidFocus) { - options.onDidFocus(focused); - } - }), - input.onDidChangeSelection(items => { - if (!input.canSelectMany) { - const result = items[0]; - if (result) { - resolve(result); - input.hide(); - } - } - }), - input.onDidTriggerItemButton(event => options.onDidTriggerItemButton && options.onDidTriggerItemButton(Object.assign(Object.assign({}, event), { removeItem: () => { - const index = input.items.indexOf(event.item); - if (index !== -1) { - const items = input.items.slice(); - items.splice(index, 1); - input.items = items; - } - } }))), - input.onDidChangeValue(value => { - if (activeItem && !value && (input.activeItems.length !== 1 || input.activeItems[0] !== activeItem)) { - input.activeItems = [activeItem]; - } - }), - token.onCancellationRequested(() => { - input.hide(); - }), - input.onDidHide(() => { - Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_12__["dispose"])(disposables); - resolve(undefined); - }), - ]; - input.canSelectMany = !!options.canPickMany; - input.placeholder = options.placeHolder; - input.ignoreFocusOut = !!options.ignoreFocusLost; - input.matchOnDescription = !!options.matchOnDescription; - input.matchOnDetail = !!options.matchOnDetail; - input.matchOnLabel = (options.matchOnLabel === undefined) || options.matchOnLabel; // default to true - input.autoFocusOnList = (options.autoFocusOnList === undefined) || options.autoFocusOnList; // default to true - input.quickNavigate = options.quickNavigate; - input.contextKey = options.contextKey; - input.busy = true; - Promise.all([picks, options.activeItem]) - .then(([items, _activeItem]) => { - activeItem = _activeItem; - input.busy = false; - input.items = items; - if (input.canSelectMany) { - input.selectedItems = items.filter(item => item.type !== 'separator' && item.picked); - } - if (activeItem) { - input.activeItems = [activeItem]; - } - }); - input.show(); - Promise.resolve(picks).then(undefined, err => { - reject(err); - input.hide(); - }); - }); - } - createQuickPick() { - const ui = this.getUI(); - return new QuickPick(ui); - } - show(controller) { - const ui = this.getUI(); - this.onShowEmitter.fire(); - const oldController = this.controller; - this.controller = controller; - if (oldController) { - oldController.didHide(); - } - this.setEnabled(true); - ui.leftActionBar.clear(); - ui.title.textContent = ''; - ui.description.textContent = ''; - ui.rightActionBar.clear(); - ui.checkAll.checked = false; - // ui.inputBox.value = ''; Avoid triggering an event. - ui.inputBox.placeholder = ''; - ui.inputBox.password = false; - ui.inputBox.showDecoration(_common_severity_js__WEBPACK_IMPORTED_MODULE_13__["default"].Ignore); - ui.visibleCount.setCount(0); - ui.count.setCount(0); - ui.message.textContent = ''; - ui.progressBar.stop(); - ui.list.setElements([]); - ui.list.matchOnDescription = false; - ui.list.matchOnDetail = false; - ui.list.matchOnLabel = true; - ui.list.sortByLabel = true; - ui.ignoreFocusOut = false; - this.setComboboxAccessibility(false); - ui.inputBox.ariaLabel = ''; - const backKeybindingLabel = this.options.backKeybindingLabel(); - backButton.tooltip = backKeybindingLabel ? Object(_nls_js__WEBPACK_IMPORTED_MODULE_7__["localize"])('quickInput.backWithKeybinding', "Back ({0})", backKeybindingLabel) : Object(_nls_js__WEBPACK_IMPORTED_MODULE_7__["localize"])('quickInput.back', "Back"); - ui.container.style.display = ''; - this.updateLayout(); - ui.inputBox.setFocus(); - } - setVisibilities(visibilities) { - const ui = this.getUI(); - ui.title.style.display = visibilities.title ? '' : 'none'; - ui.description.style.display = visibilities.description ? '' : 'none'; - ui.checkAll.style.display = visibilities.checkAll ? '' : 'none'; - ui.filterContainer.style.display = visibilities.inputBox ? '' : 'none'; - ui.visibleCountContainer.style.display = visibilities.visibleCount ? '' : 'none'; - ui.countContainer.style.display = visibilities.count ? '' : 'none'; - ui.okContainer.style.display = visibilities.ok ? '' : 'none'; - ui.customButtonContainer.style.display = visibilities.customButton ? '' : 'none'; - ui.message.style.display = visibilities.message ? '' : 'none'; - ui.progressBar.getContainer().style.display = visibilities.progressBar ? '' : 'none'; - ui.list.display(!!visibilities.list); - ui.container.classList[visibilities.checkAll ? 'add' : 'remove']('show-checkboxes'); - this.updateLayout(); // TODO - } - setComboboxAccessibility(enabled) { - if (enabled !== this.comboboxAccessibility) { - const ui = this.getUI(); - this.comboboxAccessibility = enabled; - if (this.comboboxAccessibility) { - ui.inputBox.setAttribute('role', 'combobox'); - ui.inputBox.setAttribute('aria-haspopup', 'true'); - ui.inputBox.setAttribute('aria-autocomplete', 'list'); - ui.inputBox.setAttribute('aria-activedescendant', ui.list.getActiveDescendant() || ''); - } - else { - ui.inputBox.removeAttribute('role'); - ui.inputBox.removeAttribute('aria-haspopup'); - ui.inputBox.removeAttribute('aria-autocomplete'); - ui.inputBox.removeAttribute('aria-activedescendant'); - } - } - } - setEnabled(enabled) { - if (enabled !== this.enabled) { - this.enabled = enabled; - for (const item of this.getUI().leftActionBar.viewItems) { - item.getAction().enabled = enabled; - } - for (const item of this.getUI().rightActionBar.viewItems) { - item.getAction().enabled = enabled; - } - this.getUI().checkAll.disabled = !enabled; - // this.getUI().inputBox.enabled = enabled; Avoid loosing focus. - this.getUI().ok.enabled = enabled; - this.getUI().list.enabled = enabled; - } - } - hide() { - var _a; - const controller = this.controller; - if (controller) { - const focusChanged = !((_a = this.ui) === null || _a === void 0 ? void 0 : _a.container.contains(document.activeElement)); - this.controller = null; - this.onHideEmitter.fire(); - this.getUI().container.style.display = 'none'; - if (!focusChanged) { - if (this.previousFocusElement && this.previousFocusElement.offsetParent) { - this.previousFocusElement.focus(); - this.previousFocusElement = undefined; - } - else { - this.options.returnFocus(); - } - } - controller.didHide(); - } - } - layout(dimension, titleBarOffset) { - this.dimension = dimension; - this.titleBarOffset = titleBarOffset; - this.updateLayout(); - } - updateLayout() { - if (this.ui) { - this.ui.container.style.top = `${this.titleBarOffset}px`; - const style = this.ui.container.style; - const width = Math.min(this.dimension.width * 0.62 /* golden cut */, QuickInputController.MAX_WIDTH); - style.width = width + 'px'; - style.marginLeft = '-' + (width / 2) + 'px'; - this.ui.inputBox.layout(); - this.ui.list.layout(this.dimension && this.dimension.height * 0.4); - } - } - applyStyles(styles) { - this.styles = styles; - this.updateStyles(); - } - updateStyles() { - if (this.ui) { - const { quickInputTitleBackground, quickInputBackground, quickInputForeground, contrastBorder, widgetShadow, } = this.styles.widget; - this.ui.titleBar.style.backgroundColor = quickInputTitleBackground ? quickInputTitleBackground.toString() : ''; - this.ui.container.style.backgroundColor = quickInputBackground ? quickInputBackground.toString() : ''; - this.ui.container.style.color = quickInputForeground ? quickInputForeground.toString() : ''; - this.ui.container.style.border = contrastBorder ? `1px solid ${contrastBorder}` : ''; - this.ui.container.style.boxShadow = widgetShadow ? `0 5px 8px ${widgetShadow}` : ''; - this.ui.inputBox.style(this.styles.inputBox); - this.ui.count.style(this.styles.countBadge); - this.ui.ok.style(this.styles.button); - this.ui.customButton.style(this.styles.button); - this.ui.progressBar.style(this.styles.progressBar); - this.ui.list.style(this.styles.list); - const content = []; - if (this.styles.list.listInactiveFocusForeground) { - content.push(`.monaco-list .monaco-list-row.focused { color: ${this.styles.list.listInactiveFocusForeground}; }`); - content.push(`.monaco-list .monaco-list-row.focused:hover { color: ${this.styles.list.listInactiveFocusForeground}; }`); // overwrite :hover style in this case! - } - if (this.styles.list.pickerGroupBorder) { - content.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.list.pickerGroupBorder}; }`); - } - if (this.styles.list.pickerGroupForeground) { - content.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.list.pickerGroupForeground}; }`); - } - const newStyles = content.join('\n'); - if (newStyles !== this.ui.styleSheet.innerHTML) { - this.ui.styleSheet.innerHTML = newStyles; - } - } - } -} -QuickInputController.MAX_WIDTH = 600; // Max total width of quick input widget - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInputBox.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInputBox.js ***! - \******************************************************************************************/ -/*! exports provided: QuickInputBox */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickInputBox", function() { return QuickInputBox; }); -/* harmony import */ var _media_quickInput_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/quickInput.css */ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/media/quickInput.css"); -/* harmony import */ var _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _browser_ui_inputbox_inputBox_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../browser/ui/inputbox/inputBox.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_keyboardEvent_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../browser/keyboardEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js"); -/* harmony import */ var _common_severity_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/severity.js */ "./node_modules/monaco-editor/esm/vs/base/common/severity.js"); -/* harmony import */ var _browser_mouseEvent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../browser/mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -const $ = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]; -class QuickInputBox extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(parent) { - super(); - this.parent = parent; - this.onKeyDown = (handler) => { - return _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](this.inputBox.inputElement, _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].KEY_DOWN, (e) => { - handler(new _browser_keyboardEvent_js__WEBPACK_IMPORTED_MODULE_4__["StandardKeyboardEvent"](e)); - }); - }; - this.onMouseDown = (handler) => { - return _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](this.inputBox.inputElement, _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].MOUSE_DOWN, (e) => { - handler(new _browser_mouseEvent_js__WEBPACK_IMPORTED_MODULE_6__["StandardMouseEvent"](e)); - }); - }; - this.onDidChange = (handler) => { - return this.inputBox.onDidChange(handler); - }; - this.container = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this.parent, $('.quick-input-box')); - this.inputBox = this._register(new _browser_ui_inputbox_inputBox_js__WEBPACK_IMPORTED_MODULE_2__["InputBox"](this.container, undefined)); - } - get value() { - return this.inputBox.value; - } - set value(value) { - this.inputBox.value = value; - } - select(range = null) { - this.inputBox.select(range); - } - isSelectionAtEnd() { - return this.inputBox.isSelectionAtEnd(); - } - get placeholder() { - return this.inputBox.inputElement.getAttribute('placeholder') || ''; - } - set placeholder(placeholder) { - this.inputBox.setPlaceHolder(placeholder); - } - get ariaLabel() { - return this.inputBox.getAriaLabel(); - } - set ariaLabel(ariaLabel) { - this.inputBox.setAriaLabel(ariaLabel); - } - get password() { - return this.inputBox.inputElement.type === 'password'; - } - set password(password) { - this.inputBox.inputElement.type = password ? 'password' : 'text'; - } - setAttribute(name, value) { - this.inputBox.inputElement.setAttribute(name, value); - } - removeAttribute(name) { - this.inputBox.inputElement.removeAttribute(name); - } - showDecoration(decoration) { - if (decoration === _common_severity_js__WEBPACK_IMPORTED_MODULE_5__["default"].Ignore) { - this.inputBox.hideMessage(); - } - else { - this.inputBox.showMessage({ type: decoration === _common_severity_js__WEBPACK_IMPORTED_MODULE_5__["default"].Info ? 1 /* INFO */ : decoration === _common_severity_js__WEBPACK_IMPORTED_MODULE_5__["default"].Warning ? 2 /* WARNING */ : 3 /* ERROR */, content: '' }); - } - } - stylesForType(decoration) { - return this.inputBox.stylesForType(decoration === _common_severity_js__WEBPACK_IMPORTED_MODULE_5__["default"].Info ? 1 /* INFO */ : decoration === _common_severity_js__WEBPACK_IMPORTED_MODULE_5__["default"].Warning ? 2 /* WARNING */ : 3 /* ERROR */); - } - setFocus() { - this.inputBox.focus(); - } - layout() { - this.inputBox.layout(); - } - style(styles) { - this.inputBox.style(styles); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInputList.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInputList.js ***! - \*******************************************************************************************/ -/*! exports provided: QuickInputListFocus, QuickInputList */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickInputListFocus", function() { return QuickInputListFocus; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickInputList", function() { return QuickInputList; }); -/* harmony import */ var _media_quickInput_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/quickInput.css */ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/media/quickInput.css"); -/* harmony import */ var _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_codicon_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/codicon.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicon.js"); -/* harmony import */ var _common_comparers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/comparers.js */ "./node_modules/monaco-editor/esm/vs/base/common/comparers.js"); -/* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _common_objects_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _browser_keyboardEvent_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../browser/keyboardEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js"); -/* harmony import */ var _browser_ui_iconLabel_iconLabel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../browser/ui/iconLabel/iconLabel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabel.js"); -/* harmony import */ var _browser_ui_highlightedlabel_highlightedLabel_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../browser/ui/highlightedlabel/highlightedLabel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/highlightedlabel/highlightedLabel.js"); -/* harmony import */ var _common_decorators_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../common/decorators.js */ "./node_modules/monaco-editor/esm/vs/base/common/decorators.js"); -/* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _browser_ui_actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../browser/ui/actionbar/actionbar.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js"); -/* harmony import */ var _common_actions_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _quickInputUtils_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./quickInputUtils.js */ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInputUtils.js"); -/* harmony import */ var _common_types_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _browser_ui_keybindingLabel_keybindingLabel_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../browser/ui/keybindingLabel/keybindingLabel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; - - - - - - - - - - - - - - - - - - - -const $ = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]; -class ListElement { - constructor(init) { - this.hidden = false; - this._onChecked = new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"](); - this.onChecked = this._onChecked.event; - Object(_common_objects_js__WEBPACK_IMPORTED_MODULE_6__["assign"])(this, init); - } - get checked() { - return !!this._checked; - } - set checked(value) { - if (value !== this._checked) { - this._checked = value; - this._onChecked.fire(value); - } - } - dispose() { - this._onChecked.dispose(); - } -} -class ListElementRenderer { - get templateId() { - return ListElementRenderer.ID; - } - renderTemplate(container) { - const data = Object.create(null); - data.toDisposeElement = []; - data.toDisposeTemplate = []; - data.entry = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](container, $('.quick-input-list-entry')); - // Checkbox - const label = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](data.entry, $('label.quick-input-list-label')); - data.toDisposeTemplate.push(_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](label, _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].CLICK, e => { - if (!data.checkbox.offsetParent) { // If checkbox not visible: - e.preventDefault(); // Prevent toggle of checkbox when it is immediately shown afterwards. #91740 - } - })); - data.checkbox = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](label, $('input.quick-input-list-checkbox')); - data.checkbox.type = 'checkbox'; - data.toDisposeTemplate.push(_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](data.checkbox, _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].CHANGE, e => { - data.element.checked = data.checkbox.checked; - })); - // Rows - const rows = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](label, $('.quick-input-list-rows')); - const row1 = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](rows, $('.quick-input-list-row')); - const row2 = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](rows, $('.quick-input-list-row')); - // Label - data.label = new _browser_ui_iconLabel_iconLabel_js__WEBPACK_IMPORTED_MODULE_8__["IconLabel"](row1, { supportHighlights: true, supportDescriptionHighlights: true, supportCodicons: true }); - // Keybinding - const keybindingContainer = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](row1, $('.quick-input-list-entry-keybinding')); - data.keybinding = new _browser_ui_keybindingLabel_keybindingLabel_js__WEBPACK_IMPORTED_MODULE_17__["KeybindingLabel"](keybindingContainer, _common_platform_js__WEBPACK_IMPORTED_MODULE_12__["OS"]); - // Detail - const detailContainer = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](row2, $('.quick-input-list-label-meta')); - data.detail = new _browser_ui_highlightedlabel_highlightedLabel_js__WEBPACK_IMPORTED_MODULE_9__["HighlightedLabel"](detailContainer, true); - // Separator - data.separator = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](data.entry, $('.quick-input-list-separator')); - // Actions - data.actionBar = new _browser_ui_actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_13__["ActionBar"](data.entry); - data.actionBar.domNode.classList.add('quick-input-list-entry-action-bar'); - data.toDisposeTemplate.push(data.actionBar); - return data; - } - renderElement(element, index, data) { - data.toDisposeElement = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(data.toDisposeElement); - data.element = element; - data.checkbox.checked = element.checked; - data.toDisposeElement.push(element.onChecked(checked => data.checkbox.checked = checked)); - const { labelHighlights, descriptionHighlights, detailHighlights } = element; - // Label - const options = Object.create(null); - options.matches = labelHighlights || []; - options.descriptionTitle = element.saneDescription; - options.descriptionMatches = descriptionHighlights || []; - options.extraClasses = element.item.iconClasses; - options.italic = element.item.italic; - options.strikethrough = element.item.strikethrough; - data.label.setLabel(element.saneLabel, element.saneDescription, options); - // Keybinding - data.keybinding.set(element.item.keybinding); - // Meta - data.detail.set(element.saneDetail, detailHighlights); - // Separator - if (element.separator && element.separator.label) { - data.separator.textContent = element.separator.label; - data.separator.style.display = ''; - } - else { - data.separator.style.display = 'none'; - } - if (element.separator) { - _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addClass"](data.entry, 'quick-input-list-separator-border'); - } - else { - _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["removeClass"](data.entry, 'quick-input-list-separator-border'); - } - // Actions - data.actionBar.clear(); - const buttons = element.item.buttons; - if (buttons && buttons.length) { - data.actionBar.push(buttons.map((button, index) => { - let cssClasses = button.iconClass || (button.iconPath ? Object(_quickInputUtils_js__WEBPACK_IMPORTED_MODULE_15__["getIconClass"])(button.iconPath) : undefined); - if (button.alwaysVisible) { - cssClasses = cssClasses ? `${cssClasses} always-visible` : 'always-visible'; - } - const action = new _common_actions_js__WEBPACK_IMPORTED_MODULE_14__["Action"](`id-${index}`, '', cssClasses, true, () => { - element.fireButtonTriggered({ - button, - item: element.item - }); - return Promise.resolve(); - }); - action.tooltip = button.tooltip || ''; - return action; - }), { icon: true, label: false }); - _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addClass"](data.entry, 'has-actions'); - } - else { - _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["removeClass"](data.entry, 'has-actions'); - } - } - disposeElement(element, index, data) { - data.toDisposeElement = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(data.toDisposeElement); - } - disposeTemplate(data) { - data.toDisposeElement = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(data.toDisposeElement); - data.toDisposeTemplate = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(data.toDisposeTemplate); - } -} -ListElementRenderer.ID = 'listelement'; -class ListElementDelegate { - getHeight(element) { - return element.saneDetail ? 44 : 22; - } - getTemplateId(element) { - return ListElementRenderer.ID; - } -} -var QuickInputListFocus; -(function (QuickInputListFocus) { - QuickInputListFocus[QuickInputListFocus["First"] = 1] = "First"; - QuickInputListFocus[QuickInputListFocus["Second"] = 2] = "Second"; - QuickInputListFocus[QuickInputListFocus["Last"] = 3] = "Last"; - QuickInputListFocus[QuickInputListFocus["Next"] = 4] = "Next"; - QuickInputListFocus[QuickInputListFocus["Previous"] = 5] = "Previous"; - QuickInputListFocus[QuickInputListFocus["NextPage"] = 6] = "NextPage"; - QuickInputListFocus[QuickInputListFocus["PreviousPage"] = 7] = "PreviousPage"; -})(QuickInputListFocus || (QuickInputListFocus = {})); -class QuickInputList { - constructor(parent, id, options) { - this.parent = parent; - this.inputElements = []; - this.elements = []; - this.elementsToIndexes = new Map(); - this.matchOnDescription = false; - this.matchOnDetail = false; - this.matchOnLabel = true; - this.sortByLabel = true; - this._onChangedAllVisibleChecked = new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"](); - this.onChangedAllVisibleChecked = this._onChangedAllVisibleChecked.event; - this._onChangedCheckedCount = new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"](); - this.onChangedCheckedCount = this._onChangedCheckedCount.event; - this._onChangedVisibleCount = new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"](); - this.onChangedVisibleCount = this._onChangedVisibleCount.event; - this._onChangedCheckedElements = new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"](); - this.onChangedCheckedElements = this._onChangedCheckedElements.event; - this._onButtonTriggered = new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"](); - this.onButtonTriggered = this._onButtonTriggered.event; - this._onKeyDown = new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"](); - this.onKeyDown = this._onKeyDown.event; - this._onLeave = new _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"](); - this.onLeave = this._onLeave.event; - this._fireCheckedEvents = true; - this.elementDisposables = []; - this.disposables = []; - this.id = id; - this.container = _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this.parent, $('.quick-input-list')); - const delegate = new ListElementDelegate(); - const accessibilityProvider = new QuickInputAccessibilityProvider(); - this.list = options.createList('QuickInput', this.container, delegate, [new ListElementRenderer()], { - identityProvider: { getId: element => element.saneLabel }, - setRowLineHeight: false, - multipleSelectionSupport: false, - horizontalScrolling: false, - accessibilityProvider - }); - this.list.getHTMLElement().id = id; - this.disposables.push(this.list); - this.disposables.push(this.list.onKeyDown(e => { - const event = new _browser_keyboardEvent_js__WEBPACK_IMPORTED_MODULE_7__["StandardKeyboardEvent"](e); - switch (event.keyCode) { - case 10 /* Space */: - this.toggleCheckbox(); - break; - case 31 /* KEY_A */: - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_12__["isMacintosh"] ? e.metaKey : e.ctrlKey) { - this.list.setFocus(Object(_common_arrays_js__WEBPACK_IMPORTED_MODULE_11__["range"])(this.list.length)); - } - break; - case 16 /* UpArrow */: - const focus1 = this.list.getFocus(); - if (focus1.length === 1 && focus1[0] === 0) { - this._onLeave.fire(); - } - break; - case 18 /* DownArrow */: - const focus2 = this.list.getFocus(); - if (focus2.length === 1 && focus2[0] === this.list.length - 1) { - this._onLeave.fire(); - } - break; - } - this._onKeyDown.fire(event); - })); - this.disposables.push(this.list.onMouseDown(e => { - if (e.browserEvent.button !== 2) { - // Works around / fixes #64350. - e.browserEvent.preventDefault(); - } - })); - this.disposables.push(_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](this.container, _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].CLICK, e => { - if (e.x || e.y) { // Avoid 'click' triggered by 'space' on checkbox. - this._onLeave.fire(); - } - })); - this.disposables.push(this.list.onMouseMiddleClick(e => { - this._onLeave.fire(); - })); - this.disposables.push(this.list.onContextMenu(e => { - if (typeof e.index === 'number') { - e.browserEvent.preventDefault(); - // we want to treat a context menu event as - // a gesture to open the item at the index - // since we do not have any context menu - // this enables for example macOS to Ctrl- - // click on an item to open it. - this.list.setSelection([e.index]); - } - })); - this.disposables.push(this._onChangedAllVisibleChecked, this._onChangedCheckedCount, this._onChangedVisibleCount, this._onChangedCheckedElements, this._onButtonTriggered, this._onLeave, this._onKeyDown); - } - get onDidChangeFocus() { - return _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Event"].map(this.list.onDidChangeFocus, e => e.elements.map(e => e.item)); - } - get onDidChangeSelection() { - return _common_event_js__WEBPACK_IMPORTED_MODULE_5__["Event"].map(this.list.onDidChangeSelection, e => ({ items: e.elements.map(e => e.item), event: e.browserEvent })); - } - getAllVisibleChecked() { - return this.allVisibleChecked(this.elements, false); - } - allVisibleChecked(elements, whenNoneVisible = true) { - for (let i = 0, n = elements.length; i < n; i++) { - const element = elements[i]; - if (!element.hidden) { - if (!element.checked) { - return false; - } - else { - whenNoneVisible = true; - } - } - } - return whenNoneVisible; - } - getCheckedCount() { - let count = 0; - const elements = this.elements; - for (let i = 0, n = elements.length; i < n; i++) { - if (elements[i].checked) { - count++; - } - } - return count; - } - getVisibleCount() { - let count = 0; - const elements = this.elements; - for (let i = 0, n = elements.length; i < n; i++) { - if (!elements[i].hidden) { - count++; - } - } - return count; - } - setAllVisibleChecked(checked) { - try { - this._fireCheckedEvents = false; - this.elements.forEach(element => { - if (!element.hidden) { - element.checked = checked; - } - }); - } - finally { - this._fireCheckedEvents = true; - this.fireCheckedEvents(); - } - } - setElements(inputElements) { - this.elementDisposables = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(this.elementDisposables); - const fireButtonTriggered = (event) => this.fireButtonTriggered(event); - this.inputElements = inputElements; - this.elements = inputElements.reduce((result, item, index) => { - var _a, _b, _c; - if (item.type !== 'separator') { - const previous = index && inputElements[index - 1]; - const saneLabel = item.label && item.label.replace(/\r?\n/g, ' '); - const saneDescription = item.description && item.description.replace(/\r?\n/g, ' '); - const saneDetail = item.detail && item.detail.replace(/\r?\n/g, ' '); - const saneAriaLabel = item.ariaLabel || [saneLabel, saneDescription, saneDetail] - .map(s => s && Object(_common_codicon_js__WEBPACK_IMPORTED_MODULE_3__["parseCodicons"])(s).text) - .filter(s => !!s) - .join(', '); - result.push(new ListElement({ - index, - item, - saneLabel, - saneAriaLabel, - saneDescription, - saneDetail, - labelHighlights: (_a = item.highlights) === null || _a === void 0 ? void 0 : _a.label, - descriptionHighlights: (_b = item.highlights) === null || _b === void 0 ? void 0 : _b.description, - detailHighlights: (_c = item.highlights) === null || _c === void 0 ? void 0 : _c.detail, - checked: false, - separator: previous && previous.type === 'separator' ? previous : undefined, - fireButtonTriggered - })); - } - return result; - }, []); - this.elementDisposables.push(...this.elements); - this.elementDisposables.push(...this.elements.map(element => element.onChecked(() => this.fireCheckedEvents()))); - this.elementsToIndexes = this.elements.reduce((map, element, index) => { - map.set(element.item, index); - return map; - }, new Map()); - this.list.splice(0, this.list.length); // Clear focus and selection first, sending the events when the list is empty. - this.list.splice(0, this.list.length, this.elements); - this._onChangedVisibleCount.fire(this.elements.length); - } - getFocusedElements() { - return this.list.getFocusedElements() - .map(e => e.item); - } - setFocusedElements(items) { - this.list.setFocus(items - .filter(item => this.elementsToIndexes.has(item)) - .map(item => this.elementsToIndexes.get(item))); - if (items.length > 0) { - const focused = this.list.getFocus()[0]; - if (typeof focused === 'number') { - this.list.reveal(focused); - } - } - } - getActiveDescendant() { - return this.list.getHTMLElement().getAttribute('aria-activedescendant'); - } - setSelectedElements(items) { - this.list.setSelection(items - .filter(item => this.elementsToIndexes.has(item)) - .map(item => this.elementsToIndexes.get(item))); - } - getCheckedElements() { - return this.elements.filter(e => e.checked) - .map(e => e.item); - } - setCheckedElements(items) { - try { - this._fireCheckedEvents = false; - const checked = new Set(); - for (const item of items) { - checked.add(item); - } - for (const element of this.elements) { - element.checked = checked.has(element.item); - } - } - finally { - this._fireCheckedEvents = true; - this.fireCheckedEvents(); - } - } - set enabled(value) { - this.list.getHTMLElement().style.pointerEvents = value ? '' : 'none'; - } - focus(what) { - if (!this.list.length) { - return; - } - if (what === QuickInputListFocus.Next && this.list.getFocus()[0] === this.list.length - 1) { - what = QuickInputListFocus.First; - } - if (what === QuickInputListFocus.Previous && this.list.getFocus()[0] === 0) { - what = QuickInputListFocus.Last; - } - if (what === QuickInputListFocus.Second && this.list.length < 2) { - what = QuickInputListFocus.First; - } - switch (what) { - case QuickInputListFocus.First: - this.list.focusFirst(); - break; - case QuickInputListFocus.Second: - this.list.focusNth(1); - break; - case QuickInputListFocus.Last: - this.list.focusLast(); - break; - case QuickInputListFocus.Next: - this.list.focusNext(); - break; - case QuickInputListFocus.Previous: - this.list.focusPrevious(); - break; - case QuickInputListFocus.NextPage: - this.list.focusNextPage(); - break; - case QuickInputListFocus.PreviousPage: - this.list.focusPreviousPage(); - break; - } - const focused = this.list.getFocus()[0]; - if (typeof focused === 'number') { - this.list.reveal(focused); - } - } - clearFocus() { - this.list.setFocus([]); - } - domFocus() { - this.list.domFocus(); - } - layout(maxHeight) { - this.list.getHTMLElement().style.maxHeight = maxHeight ? `calc(${Math.floor(maxHeight / 44) * 44}px)` : ''; - this.list.layout(); - } - filter(query) { - if (!(this.sortByLabel || this.matchOnLabel || this.matchOnDescription || this.matchOnDetail)) { - this.list.layout(); - return false; - } - query = query.trim(); - // Reset filtering - if (!query || !(this.matchOnLabel || this.matchOnDescription || this.matchOnDetail)) { - this.elements.forEach(element => { - element.labelHighlights = undefined; - element.descriptionHighlights = undefined; - element.detailHighlights = undefined; - element.hidden = false; - const previous = element.index && this.inputElements[element.index - 1]; - element.separator = previous && previous.type === 'separator' ? previous : undefined; - }); - } - // Filter by value (since we support codicons, use codicon aware fuzzy matching) - else { - this.elements.forEach(element => { - const labelHighlights = this.matchOnLabel ? Object(_common_types_js__WEBPACK_IMPORTED_MODULE_16__["withNullAsUndefined"])(Object(_common_codicon_js__WEBPACK_IMPORTED_MODULE_3__["matchesFuzzyCodiconAware"])(query, Object(_common_codicon_js__WEBPACK_IMPORTED_MODULE_3__["parseCodicons"])(element.saneLabel))) : undefined; - const descriptionHighlights = this.matchOnDescription ? Object(_common_types_js__WEBPACK_IMPORTED_MODULE_16__["withNullAsUndefined"])(Object(_common_codicon_js__WEBPACK_IMPORTED_MODULE_3__["matchesFuzzyCodiconAware"])(query, Object(_common_codicon_js__WEBPACK_IMPORTED_MODULE_3__["parseCodicons"])(element.saneDescription || ''))) : undefined; - const detailHighlights = this.matchOnDetail ? Object(_common_types_js__WEBPACK_IMPORTED_MODULE_16__["withNullAsUndefined"])(Object(_common_codicon_js__WEBPACK_IMPORTED_MODULE_3__["matchesFuzzyCodiconAware"])(query, Object(_common_codicon_js__WEBPACK_IMPORTED_MODULE_3__["parseCodicons"])(element.saneDetail || ''))) : undefined; - if (labelHighlights || descriptionHighlights || detailHighlights) { - element.labelHighlights = labelHighlights; - element.descriptionHighlights = descriptionHighlights; - element.detailHighlights = detailHighlights; - element.hidden = false; - } - else { - element.labelHighlights = undefined; - element.descriptionHighlights = undefined; - element.detailHighlights = undefined; - element.hidden = !element.item.alwaysShow; - } - element.separator = undefined; - }); - } - const shownElements = this.elements.filter(element => !element.hidden); - // Sort by value - if (this.sortByLabel && query) { - const normalizedSearchValue = query.toLowerCase(); - shownElements.sort((a, b) => { - return compareEntries(a, b, normalizedSearchValue); - }); - } - this.elementsToIndexes = shownElements.reduce((map, element, index) => { - map.set(element.item, index); - return map; - }, new Map()); - this.list.splice(0, this.list.length, shownElements); - this.list.setFocus([]); - this.list.layout(); - this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()); - this._onChangedVisibleCount.fire(shownElements.length); - return true; - } - toggleCheckbox() { - try { - this._fireCheckedEvents = false; - const elements = this.list.getFocusedElements(); - const allChecked = this.allVisibleChecked(elements); - for (const element of elements) { - element.checked = !allChecked; - } - } - finally { - this._fireCheckedEvents = true; - this.fireCheckedEvents(); - } - } - display(display) { - this.container.style.display = display ? '' : 'none'; - } - isDisplayed() { - return this.container.style.display !== 'none'; - } - dispose() { - this.elementDisposables = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(this.elementDisposables); - this.disposables = Object(_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(this.disposables); - } - fireCheckedEvents() { - if (this._fireCheckedEvents) { - this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()); - this._onChangedCheckedCount.fire(this.getCheckedCount()); - this._onChangedCheckedElements.fire(this.getCheckedElements()); - } - } - fireButtonTriggered(event) { - this._onButtonTriggered.fire(event); - } - style(styles) { - this.list.style(styles); - } -} -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_10__["memoize"] -], QuickInputList.prototype, "onDidChangeFocus", null); -__decorate([ - _common_decorators_js__WEBPACK_IMPORTED_MODULE_10__["memoize"] -], QuickInputList.prototype, "onDidChangeSelection", null); -function compareEntries(elementA, elementB, lookFor) { - const labelHighlightsA = elementA.labelHighlights || []; - const labelHighlightsB = elementB.labelHighlights || []; - if (labelHighlightsA.length && !labelHighlightsB.length) { - return -1; - } - if (!labelHighlightsA.length && labelHighlightsB.length) { - return 1; - } - if (labelHighlightsA.length === 0 && labelHighlightsB.length === 0) { - return 0; - } - return Object(_common_comparers_js__WEBPACK_IMPORTED_MODULE_4__["compareAnything"])(elementA.saneLabel, elementB.saneLabel, lookFor); -} -class QuickInputAccessibilityProvider { - getWidgetAriaLabel() { - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_18__["localize"])('quickInput', "Quick Input"); - } - getAriaLabel(element) { - return element.saneAriaLabel; - } - getWidgetRole() { - return 'listbox'; - } - getRole() { - return 'option'; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInputUtils.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInputUtils.js ***! - \********************************************************************************************/ -/*! exports provided: getIconClass */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getIconClass", function() { return getIconClass; }); -/* harmony import */ var _media_quickInput_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/quickInput.css */ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/media/quickInput.css"); -/* harmony import */ var _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_idGenerator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/idGenerator.js */ "./node_modules/monaco-editor/esm/vs/base/common/idGenerator.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -const iconPathToClass = {}; -const iconClassGenerator = new _common_idGenerator_js__WEBPACK_IMPORTED_MODULE_2__["IdGenerator"]('quick-input-button-icon-'); -function getIconClass(iconPath) { - if (!iconPath) { - return undefined; - } - let iconClass; - const key = iconPath.dark.toString(); - if (iconPathToClass[key]) { - iconClass = iconPathToClass[key]; - } - else { - iconClass = iconClassGenerator.nextId(); - _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["createCSSRule"](`.${iconClass}`, `background-image: ${_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["asCSSUrl"](iconPath.light || iconPath.dark)}`); - _browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["createCSSRule"](`.vs-dark .${iconClass}, .hc-black .${iconClass}`, `background-image: ${_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["asCSSUrl"](iconPath.dark)}`); - iconPathToClass[key] = iconClass; - } - return iconClass; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/common/quickInput.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/parts/quickinput/common/quickInput.js ***! - \**************************************************************************************/ -/*! exports provided: NO_KEY_MODS, ItemActivation */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NO_KEY_MODS", function() { return NO_KEY_MODS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ItemActivation", function() { return ItemActivation; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -const NO_KEY_MODS = { ctrlCmd: false, alt: false }; -var ItemActivation; -(function (ItemActivation) { - ItemActivation[ItemActivation["NONE"] = 0] = "NONE"; - ItemActivation[ItemActivation["FIRST"] = 1] = "FIRST"; - ItemActivation[ItemActivation["SECOND"] = 2] = "SECOND"; - ItemActivation[ItemActivation["LAST"] = 3] = "LAST"; -})(ItemActivation || (ItemActivation = {})); -//#endregion - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/worker/defaultWorkerFactory.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/worker/defaultWorkerFactory.js ***! - \*******************************************************************************/ -/*! exports provided: DefaultWorkerFactory */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultWorkerFactory", function() { return DefaultWorkerFactory; }); -/* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/worker/simpleWorker.js */ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -function getWorker(workerId, label) { - // Option for hosts to overwrite the worker script (used in the standalone editor) - if (_common_platform_js__WEBPACK_IMPORTED_MODULE_0__["globals"].MonacoEnvironment) { - if (typeof _common_platform_js__WEBPACK_IMPORTED_MODULE_0__["globals"].MonacoEnvironment.getWorker === 'function') { - return _common_platform_js__WEBPACK_IMPORTED_MODULE_0__["globals"].MonacoEnvironment.getWorker(workerId, label); - } - if (typeof _common_platform_js__WEBPACK_IMPORTED_MODULE_0__["globals"].MonacoEnvironment.getWorkerUrl === 'function') { - return new Worker(_common_platform_js__WEBPACK_IMPORTED_MODULE_0__["globals"].MonacoEnvironment.getWorkerUrl(workerId, label)); - } - } - // ESM-comment-begin - // if (typeof require === 'function') { - // // check if the JS lives on a different origin - // const workerMain = require.toUrl('./' + workerId); - // const workerUrl = getWorkerBootstrapUrl(workerMain, label); - // return new Worker(workerUrl, { name: label }); - // } - // ESM-comment-end - throw new Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`); -} -// ESM-comment-begin -// export function getWorkerBootstrapUrl(scriptPath: string, label: string, forceDataUri: boolean = false): string { -// if (forceDataUri || /^((http:)|(https:)|(file:))/.test(scriptPath)) { -// const currentUrl = String(window.location); -// const currentOrigin = currentUrl.substr(0, currentUrl.length - window.location.hash.length - window.location.search.length - window.location.pathname.length); -// if (forceDataUri || scriptPath.substring(0, currentOrigin.length) !== currentOrigin) { -// // this is the cross-origin case -// // i.e. the webpage is running at a different origin than where the scripts are loaded from -// const myPath = 'vs/base/worker/defaultWorkerFactory.js'; -// const workerBaseUrl = require.toUrl(myPath).slice(0, -myPath.length); -// const js = `/*${label}*/self.MonacoEnvironment={baseUrl: '${workerBaseUrl}'};importScripts('${scriptPath}');/*${label}*/`; -// if (forceDataUri) { -// const url = `data:text/javascript;charset=utf-8,${encodeURIComponent(js)}`; -// return url; -// } -// const blob = new Blob([js], { type: 'application/javascript' }); -// return URL.createObjectURL(blob); -// } -// } -// return scriptPath + '#' + label; -// } -// ESM-comment-end -function isPromiseLike(obj) { - if (typeof obj.then === 'function') { - return true; - } - return false; -} -/** - * A worker that uses HTML5 web workers so that is has - * its own global scope and its own thread. - */ -class WebWorker { - constructor(moduleId, id, label, onMessageCallback, onErrorCallback) { - this.id = id; - const workerOrPromise = getWorker('workerMain.js', label); - if (isPromiseLike(workerOrPromise)) { - this.worker = workerOrPromise; - } - else { - this.worker = Promise.resolve(workerOrPromise); - } - this.postMessage(moduleId, []); - this.worker.then((w) => { - w.onmessage = function (ev) { - onMessageCallback(ev.data); - }; - w.onmessageerror = onErrorCallback; - if (typeof w.addEventListener === 'function') { - w.addEventListener('error', onErrorCallback); - } - }); - } - getId() { - return this.id; - } - postMessage(message, transfer) { - if (this.worker) { - this.worker.then(w => w.postMessage(message, transfer)); - } - } - dispose() { - if (this.worker) { - this.worker.then(w => w.terminate()); - } - this.worker = null; - } -} -class DefaultWorkerFactory { - constructor(label) { - this._label = label; - this._webWorkerFailedBeforeError = false; - } - create(moduleId, onMessageCallback, onErrorCallback) { - let workerId = (++DefaultWorkerFactory.LAST_WORKER_ID); - if (this._webWorkerFailedBeforeError) { - throw this._webWorkerFailedBeforeError; - } - return new WebWorker(moduleId, workerId, this._label || 'anonymous' + workerId, onMessageCallback, (err) => { - Object(_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_1__["logOnceWebWorkerWarning"])(err); - this._webWorkerFailedBeforeError = err; - onErrorCallback(err); - }); - } -} -DefaultWorkerFactory.LAST_WORKER_ID = 0; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js ***! - \*****************************************************************************/ -/*! exports provided: loadLanguage, registerLanguage */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadLanguage", function() { return loadLanguage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerLanguage", function() { return registerLanguage; }); -/* harmony import */ var _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fillers/monaco-editor-core.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/fillers/monaco-editor-core.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var languageDefinitions = {}; -var lazyLanguageLoaders = {}; -var LazyLanguageLoader = /** @class */ (function () { - function LazyLanguageLoader(languageId) { - var _this = this; - this._languageId = languageId; - this._loadingTriggered = false; - this._lazyLoadPromise = new Promise(function (resolve, reject) { - _this._lazyLoadPromiseResolve = resolve; - _this._lazyLoadPromiseReject = reject; - }); - } - LazyLanguageLoader.getOrCreate = function (languageId) { - if (!lazyLanguageLoaders[languageId]) { - lazyLanguageLoaders[languageId] = new LazyLanguageLoader(languageId); - } - return lazyLanguageLoaders[languageId]; - }; - LazyLanguageLoader.prototype.whenLoaded = function () { - return this._lazyLoadPromise; - }; - LazyLanguageLoader.prototype.load = function () { - var _this = this; - if (!this._loadingTriggered) { - this._loadingTriggered = true; - languageDefinitions[this._languageId].loader().then(function (mod) { return _this._lazyLoadPromiseResolve(mod); }, function (err) { return _this._lazyLoadPromiseReject(err); }); - } - return this._lazyLoadPromise; - }; - return LazyLanguageLoader; -}()); -function loadLanguage(languageId) { - return LazyLanguageLoader.getOrCreate(languageId).load(); -} -function registerLanguage(def) { - var languageId = def.id; - languageDefinitions[languageId] = def; - _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__["languages"].register(def); - var lazyLanguageLoader = LazyLanguageLoader.getOrCreate(languageId); - _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__["languages"].setMonarchTokensProvider(languageId, lazyLanguageLoader.whenLoaded().then(function (mod) { return mod.language; })); - _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__["languages"].onLanguage(languageId, function () { - lazyLanguageLoader.load().then(function (mod) { - _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__["languages"].setLanguageConfiguration(languageId, mod.conf); - }); - }); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/abap/abap.contribution.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/abap/abap.contribution.js ***! - \*************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'abap', - extensions: ['.abap'], - aliases: ['abap', 'ABAP'], - loader: function () { return __webpack_require__.e(/*! import() */ 7).then(__webpack_require__.bind(null, /*! ./abap.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/abap/abap.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/apex/apex.contribution.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/apex/apex.contribution.js ***! - \*************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'apex', - extensions: ['.cls'], - aliases: ['Apex', 'apex'], - mimetypes: ['text/x-apex-source', 'text/x-apex'], - loader: function () { return __webpack_require__.e(/*! import() */ 8).then(__webpack_require__.bind(null, /*! ./apex.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/apex/apex.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/azcli/azcli.contribution.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/azcli/azcli.contribution.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'azcli', - extensions: ['.azcli'], - aliases: ['Azure CLI', 'azcli'], - loader: function () { return __webpack_require__.e(/*! import() */ 9).then(__webpack_require__.bind(null, /*! ./azcli.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/azcli/azcli.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/bat/bat.contribution.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/bat/bat.contribution.js ***! - \***********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'bat', - extensions: ['.bat', '.cmd'], - aliases: ['Batch', 'bat'], - loader: function () { return __webpack_require__.e(/*! import() */ 10).then(__webpack_require__.bind(null, /*! ./bat.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/bat/bat.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/cameligo/cameligo.contribution.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/cameligo/cameligo.contribution.js ***! - \*********************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'cameligo', - extensions: ['.mligo'], - aliases: ['Cameligo'], - loader: function () { return __webpack_require__.e(/*! import() */ 11).then(__webpack_require__.bind(null, /*! ./cameligo.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/cameligo/cameligo.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/clojure/clojure.contribution.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/clojure/clojure.contribution.js ***! - \*******************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'clojure', - extensions: ['.clj', '.cljs', '.cljc', '.edn'], - aliases: ['clojure', 'Clojure'], - loader: function () { return __webpack_require__.e(/*! import() */ 12).then(__webpack_require__.bind(null, /*! ./clojure.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/clojure/clojure.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/coffee/coffee.contribution.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/coffee/coffee.contribution.js ***! - \*****************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'coffeescript', - extensions: ['.coffee'], - aliases: ['CoffeeScript', 'coffeescript', 'coffee'], - mimetypes: ['text/x-coffeescript', 'text/coffeescript'], - loader: function () { return __webpack_require__.e(/*! import() */ 13).then(__webpack_require__.bind(null, /*! ./coffee.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/coffee/coffee.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/cpp/cpp.contribution.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/cpp/cpp.contribution.js ***! - \***********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'c', - extensions: ['.c', '.h'], - aliases: ['C', 'c'], - loader: function () { return __webpack_require__.e(/*! import() */ 0).then(__webpack_require__.bind(null, /*! ./cpp.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/cpp/cpp.js")); } -}); -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'cpp', - extensions: ['.cpp', '.cc', '.cxx', '.hpp', '.hh', '.hxx'], - aliases: ['C++', 'Cpp', 'cpp'], - loader: function () { return __webpack_require__.e(/*! import() */ 0).then(__webpack_require__.bind(null, /*! ./cpp.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/cpp/cpp.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/csharp/csharp.contribution.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/csharp/csharp.contribution.js ***! - \*****************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'csharp', - extensions: ['.cs', '.csx', '.cake'], - aliases: ['C#', 'csharp'], - loader: function () { return __webpack_require__.e(/*! import() */ 14).then(__webpack_require__.bind(null, /*! ./csharp.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/csharp/csharp.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/csp/csp.contribution.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/csp/csp.contribution.js ***! - \***********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'csp', - extensions: [], - aliases: ['CSP', 'csp'], - loader: function () { return __webpack_require__.e(/*! import() */ 15).then(__webpack_require__.bind(null, /*! ./csp.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/csp/csp.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/css/css.contribution.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/css/css.contribution.js ***! - \***********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'css', - extensions: ['.css'], - aliases: ['CSS', 'css'], - mimetypes: ['text/css'], - loader: function () { return __webpack_require__.e(/*! import() */ 16).then(__webpack_require__.bind(null, /*! ./css.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/css/css.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/dart/dart.contribution.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/dart/dart.contribution.js ***! - \*************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'dart', - extensions: ['.dart'], - aliases: ['Dart', 'dart'], - mimetypes: ['text/x-dart-source', 'text/x-dart'], - loader: function () { return __webpack_require__.e(/*! import() */ 17).then(__webpack_require__.bind(null, /*! ./dart.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/dart/dart.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/dockerfile/dockerfile.contribution.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/dockerfile/dockerfile.contribution.js ***! - \*************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'dockerfile', - extensions: ['.dockerfile'], - filenames: ['Dockerfile'], - aliases: ['Dockerfile'], - loader: function () { return __webpack_require__.e(/*! import() */ 18).then(__webpack_require__.bind(null, /*! ./dockerfile.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/dockerfile/dockerfile.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/fillers/monaco-editor-core.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/fillers/monaco-editor-core.js ***! - \*****************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.api.js */ "./include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js"); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/fsharp/fsharp.contribution.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/fsharp/fsharp.contribution.js ***! - \*****************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'fsharp', - extensions: ['.fs', '.fsi', '.ml', '.mli', '.fsx', '.fsscript'], - aliases: ['F#', 'FSharp', 'fsharp'], - loader: function () { return __webpack_require__.e(/*! import() */ 19).then(__webpack_require__.bind(null, /*! ./fsharp.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/fsharp/fsharp.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/go/go.contribution.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/go/go.contribution.js ***! - \*********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'go', - extensions: ['.go'], - aliases: ['Go'], - loader: function () { return __webpack_require__.e(/*! import() */ 20).then(__webpack_require__.bind(null, /*! ./go.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/go/go.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/graphql/graphql.contribution.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/graphql/graphql.contribution.js ***! - \*******************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'graphql', - extensions: ['.graphql', '.gql'], - aliases: ['GraphQL', 'graphql', 'gql'], - mimetypes: ['application/graphql'], - loader: function () { return __webpack_require__.e(/*! import() */ 21).then(__webpack_require__.bind(null, /*! ./graphql.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/graphql/graphql.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/handlebars/handlebars.contribution.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/handlebars/handlebars.contribution.js ***! - \*************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'handlebars', - extensions: ['.handlebars', '.hbs'], - aliases: ['Handlebars', 'handlebars'], - mimetypes: ['text/x-handlebars-template'], - loader: function () { return __webpack_require__.e(/*! import() */ 22).then(__webpack_require__.bind(null, /*! ./handlebars.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/handlebars/handlebars.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/hcl/hcl.contribution.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/hcl/hcl.contribution.js ***! - \***********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'hcl', - extensions: ['.tf', '.tfvars', '.hcl'], - aliases: ['Terraform', 'tf', 'HCL', 'hcl'], - loader: function () { return __webpack_require__.e(/*! import() */ 23).then(__webpack_require__.bind(null, /*! ./hcl.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/hcl/hcl.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/html/html.contribution.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/html/html.contribution.js ***! - \*************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'html', - extensions: ['.html', '.htm', '.shtml', '.xhtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm'], - aliases: ['HTML', 'htm', 'html', 'xhtml'], - mimetypes: ['text/html', 'text/x-jshtm', 'text/template', 'text/ng-template'], - loader: function () { return __webpack_require__.e(/*! import() */ 24).then(__webpack_require__.bind(null, /*! ./html.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/html/html.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/ini/ini.contribution.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/ini/ini.contribution.js ***! - \***********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'ini', - extensions: ['.ini', '.properties', '.gitconfig'], - filenames: ['config', '.gitattributes', '.gitconfig', '.editorconfig'], - aliases: ['Ini', 'ini'], - loader: function () { return __webpack_require__.e(/*! import() */ 25).then(__webpack_require__.bind(null, /*! ./ini.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/ini/ini.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/java/java.contribution.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/java/java.contribution.js ***! - \*************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'java', - extensions: ['.java', '.jav'], - aliases: ['Java', 'java'], - mimetypes: ['text/x-java-source', 'text/x-java'], - loader: function () { return __webpack_require__.e(/*! import() */ 26).then(__webpack_require__.bind(null, /*! ./java.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/java/java.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.js ***! - \*************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'javascript', - extensions: ['.js', '.es6', '.jsx', '.mjs'], - firstLine: '^#!.*\\bnode', - filenames: ['jakefile'], - aliases: ['JavaScript', 'javascript', 'js'], - mimetypes: ['text/javascript'], - loader: function () { return __webpack_require__.e(/*! import() */ 6).then(__webpack_require__.bind(null, /*! ./javascript.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/javascript/javascript.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/julia/julia.contribution.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/julia/julia.contribution.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'julia', - extensions: ['.jl'], - aliases: ['julia', 'Julia'], - loader: function () { return __webpack_require__.e(/*! import() */ 27).then(__webpack_require__.bind(null, /*! ./julia.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/julia/julia.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/kotlin/kotlin.contribution.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/kotlin/kotlin.contribution.js ***! - \*****************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'kotlin', - extensions: ['.kt'], - aliases: ['Kotlin', 'kotlin'], - mimetypes: ['text/x-kotlin-source', 'text/x-kotlin'], - loader: function () { return __webpack_require__.e(/*! import() */ 28).then(__webpack_require__.bind(null, /*! ./kotlin.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/kotlin/kotlin.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/less/less.contribution.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/less/less.contribution.js ***! - \*************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'less', - extensions: ['.less'], - aliases: ['Less', 'less'], - mimetypes: ['text/x-less', 'text/less'], - loader: function () { return __webpack_require__.e(/*! import() */ 29).then(__webpack_require__.bind(null, /*! ./less.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/less/less.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/lexon/lexon.contribution.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/lexon/lexon.contribution.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'lexon', - extensions: ['.lex'], - aliases: ['Lexon'], - loader: function () { return __webpack_require__.e(/*! import() */ 30).then(__webpack_require__.bind(null, /*! ./lexon.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/lexon/lexon.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/lua/lua.contribution.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/lua/lua.contribution.js ***! - \***********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'lua', - extensions: ['.lua'], - aliases: ['Lua', 'lua'], - loader: function () { return __webpack_require__.e(/*! import() */ 31).then(__webpack_require__.bind(null, /*! ./lua.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/lua/lua.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/markdown/markdown.contribution.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/markdown/markdown.contribution.js ***! - \*********************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'markdown', - extensions: ['.md', '.markdown', '.mdown', '.mkdn', '.mkd', '.mdwn', '.mdtxt', '.mdtext'], - aliases: ['Markdown', 'markdown'], - loader: function () { return __webpack_require__.e(/*! import() */ 32).then(__webpack_require__.bind(null, /*! ./markdown.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/markdown/markdown.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/mips/mips.contribution.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/mips/mips.contribution.js ***! - \*************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'mips', - extensions: ['.s'], - aliases: ['MIPS', 'MIPS-V'], - mimetypes: ['text/x-mips', 'text/mips', 'text/plaintext'], - loader: function () { return __webpack_require__.e(/*! import() */ 33).then(__webpack_require__.bind(null, /*! ./mips.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/mips/mips.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/monaco.contribution.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/monaco.contribution.js ***! - \**********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../editor/editor.api.js */ "./include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js"); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _abap_abap_contribution_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./abap/abap.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/abap/abap.contribution.js"); -/* harmony import */ var _apex_apex_contribution_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./apex/apex.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/apex/apex.contribution.js"); -/* harmony import */ var _azcli_azcli_contribution_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./azcli/azcli.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/azcli/azcli.contribution.js"); -/* harmony import */ var _bat_bat_contribution_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bat/bat.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/bat/bat.contribution.js"); -/* harmony import */ var _cameligo_cameligo_contribution_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cameligo/cameligo.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/cameligo/cameligo.contribution.js"); -/* harmony import */ var _clojure_clojure_contribution_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./clojure/clojure.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/clojure/clojure.contribution.js"); -/* harmony import */ var _coffee_coffee_contribution_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./coffee/coffee.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/coffee/coffee.contribution.js"); -/* harmony import */ var _cpp_cpp_contribution_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./cpp/cpp.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/cpp/cpp.contribution.js"); -/* harmony import */ var _csharp_csharp_contribution_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./csharp/csharp.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/csharp/csharp.contribution.js"); -/* harmony import */ var _csp_csp_contribution_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./csp/csp.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/csp/csp.contribution.js"); -/* harmony import */ var _css_css_contribution_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./css/css.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/css/css.contribution.js"); -/* harmony import */ var _dart_dart_contribution_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./dart/dart.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/dart/dart.contribution.js"); -/* harmony import */ var _dockerfile_dockerfile_contribution_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./dockerfile/dockerfile.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/dockerfile/dockerfile.contribution.js"); -/* harmony import */ var _fsharp_fsharp_contribution_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./fsharp/fsharp.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/fsharp/fsharp.contribution.js"); -/* harmony import */ var _go_go_contribution_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./go/go.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/go/go.contribution.js"); -/* harmony import */ var _graphql_graphql_contribution_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./graphql/graphql.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/graphql/graphql.contribution.js"); -/* harmony import */ var _handlebars_handlebars_contribution_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./handlebars/handlebars.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/handlebars/handlebars.contribution.js"); -/* harmony import */ var _hcl_hcl_contribution_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./hcl/hcl.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/hcl/hcl.contribution.js"); -/* harmony import */ var _html_html_contribution_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./html/html.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/html/html.contribution.js"); -/* harmony import */ var _ini_ini_contribution_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./ini/ini.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/ini/ini.contribution.js"); -/* harmony import */ var _java_java_contribution_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./java/java.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/java/java.contribution.js"); -/* harmony import */ var _javascript_javascript_contribution_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./javascript/javascript.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.js"); -/* harmony import */ var _julia_julia_contribution_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./julia/julia.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/julia/julia.contribution.js"); -/* harmony import */ var _kotlin_kotlin_contribution_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./kotlin/kotlin.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/kotlin/kotlin.contribution.js"); -/* harmony import */ var _less_less_contribution_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./less/less.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/less/less.contribution.js"); -/* harmony import */ var _lexon_lexon_contribution_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./lexon/lexon.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/lexon/lexon.contribution.js"); -/* harmony import */ var _lua_lua_contribution_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./lua/lua.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/lua/lua.contribution.js"); -/* harmony import */ var _markdown_markdown_contribution_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./markdown/markdown.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/markdown/markdown.contribution.js"); -/* harmony import */ var _mips_mips_contribution_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./mips/mips.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/mips/mips.contribution.js"); -/* harmony import */ var _msdax_msdax_contribution_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./msdax/msdax.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/msdax/msdax.contribution.js"); -/* harmony import */ var _mysql_mysql_contribution_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./mysql/mysql.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/mysql/mysql.contribution.js"); -/* harmony import */ var _objective_c_objective_c_contribution_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./objective-c/objective-c.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/objective-c/objective-c.contribution.js"); -/* harmony import */ var _pascal_pascal_contribution_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./pascal/pascal.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/pascal/pascal.contribution.js"); -/* harmony import */ var _pascaligo_pascaligo_contribution_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./pascaligo/pascaligo.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/pascaligo/pascaligo.contribution.js"); -/* harmony import */ var _perl_perl_contribution_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./perl/perl.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/perl/perl.contribution.js"); -/* harmony import */ var _pgsql_pgsql_contribution_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./pgsql/pgsql.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/pgsql/pgsql.contribution.js"); -/* harmony import */ var _php_php_contribution_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./php/php.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/php/php.contribution.js"); -/* harmony import */ var _postiats_postiats_contribution_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./postiats/postiats.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/postiats/postiats.contribution.js"); -/* harmony import */ var _powerquery_powerquery_contribution_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./powerquery/powerquery.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/powerquery/powerquery.contribution.js"); -/* harmony import */ var _powershell_powershell_contribution_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./powershell/powershell.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/powershell/powershell.contribution.js"); -/* harmony import */ var _pug_pug_contribution_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./pug/pug.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/pug/pug.contribution.js"); -/* harmony import */ var _python_python_contribution_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./python/python.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/python/python.contribution.js"); -/* harmony import */ var _r_r_contribution_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./r/r.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/r/r.contribution.js"); -/* harmony import */ var _razor_razor_contribution_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./razor/razor.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/razor/razor.contribution.js"); -/* harmony import */ var _redis_redis_contribution_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./redis/redis.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/redis/redis.contribution.js"); -/* harmony import */ var _redshift_redshift_contribution_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./redshift/redshift.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/redshift/redshift.contribution.js"); -/* harmony import */ var _restructuredtext_restructuredtext_contribution_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./restructuredtext/restructuredtext.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/restructuredtext/restructuredtext.contribution.js"); -/* harmony import */ var _ruby_ruby_contribution_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./ruby/ruby.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/ruby/ruby.contribution.js"); -/* harmony import */ var _rust_rust_contribution_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./rust/rust.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/rust/rust.contribution.js"); -/* harmony import */ var _sb_sb_contribution_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./sb/sb.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/sb/sb.contribution.js"); -/* harmony import */ var _scala_scala_contribution_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./scala/scala.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/scala/scala.contribution.js"); -/* harmony import */ var _scheme_scheme_contribution_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./scheme/scheme.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/scheme/scheme.contribution.js"); -/* harmony import */ var _scss_scss_contribution_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./scss/scss.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/scss/scss.contribution.js"); -/* harmony import */ var _shell_shell_contribution_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./shell/shell.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/shell/shell.contribution.js"); -/* harmony import */ var _solidity_solidity_contribution_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./solidity/solidity.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/solidity/solidity.contribution.js"); -/* harmony import */ var _sophia_sophia_contribution_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./sophia/sophia.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/sophia/sophia.contribution.js"); -/* harmony import */ var _sql_sql_contribution_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./sql/sql.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/sql/sql.contribution.js"); -/* harmony import */ var _st_st_contribution_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./st/st.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/st/st.contribution.js"); -/* harmony import */ var _swift_swift_contribution_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./swift/swift.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/swift/swift.contribution.js"); -/* harmony import */ var _systemverilog_systemverilog_contribution_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./systemverilog/systemverilog.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/systemverilog/systemverilog.contribution.js"); -/* harmony import */ var _tcl_tcl_contribution_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./tcl/tcl.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/tcl/tcl.contribution.js"); -/* harmony import */ var _twig_twig_contribution_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./twig/twig.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/twig/twig.contribution.js"); -/* harmony import */ var _typescript_typescript_contribution_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./typescript/typescript.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution.js"); -/* harmony import */ var _vb_vb_contribution_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./vb/vb.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/vb/vb.contribution.js"); -/* harmony import */ var _xml_xml_contribution_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./xml/xml.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/xml/xml.contribution.js"); -/* harmony import */ var _yaml_yaml_contribution_js__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./yaml/yaml.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution.js"); - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/msdax/msdax.contribution.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/msdax/msdax.contribution.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'msdax', - extensions: ['.dax', '.msdax'], - aliases: ['DAX', 'MSDAX'], - loader: function () { return __webpack_require__.e(/*! import() */ 34).then(__webpack_require__.bind(null, /*! ./msdax.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/msdax/msdax.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/mysql/mysql.contribution.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/mysql/mysql.contribution.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'mysql', - extensions: [], - aliases: ['MySQL', 'mysql'], - loader: function () { return __webpack_require__.e(/*! import() */ 35).then(__webpack_require__.bind(null, /*! ./mysql.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/mysql/mysql.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/objective-c/objective-c.contribution.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/objective-c/objective-c.contribution.js ***! - \***************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'objective-c', - extensions: ['.m'], - aliases: ['Objective-C'], - loader: function () { return __webpack_require__.e(/*! import() */ 36).then(__webpack_require__.bind(null, /*! ./objective-c.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/objective-c/objective-c.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/pascal/pascal.contribution.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/pascal/pascal.contribution.js ***! - \*****************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'pascal', - extensions: ['.pas', '.p', '.pp'], - aliases: ['Pascal', 'pas'], - mimetypes: ['text/x-pascal-source', 'text/x-pascal'], - loader: function () { return __webpack_require__.e(/*! import() */ 37).then(__webpack_require__.bind(null, /*! ./pascal.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/pascal/pascal.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/pascaligo/pascaligo.contribution.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/pascaligo/pascaligo.contribution.js ***! - \***********************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'pascaligo', - extensions: ['.ligo'], - aliases: ['Pascaligo', 'ligo'], - loader: function () { return __webpack_require__.e(/*! import() */ 38).then(__webpack_require__.bind(null, /*! ./pascaligo.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/pascaligo/pascaligo.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/perl/perl.contribution.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/perl/perl.contribution.js ***! - \*************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'perl', - extensions: ['.pl'], - aliases: ['Perl', 'pl'], - loader: function () { return __webpack_require__.e(/*! import() */ 39).then(__webpack_require__.bind(null, /*! ./perl.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/perl/perl.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/pgsql/pgsql.contribution.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/pgsql/pgsql.contribution.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'pgsql', - extensions: [], - aliases: ['PostgreSQL', 'postgres', 'pg', 'postgre'], - loader: function () { return __webpack_require__.e(/*! import() */ 40).then(__webpack_require__.bind(null, /*! ./pgsql.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/pgsql/pgsql.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/php/php.contribution.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/php/php.contribution.js ***! - \***********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'php', - extensions: ['.php', '.php4', '.php5', '.phtml', '.ctp'], - aliases: ['PHP', 'php'], - mimetypes: ['application/x-php'], - loader: function () { return __webpack_require__.e(/*! import() */ 41).then(__webpack_require__.bind(null, /*! ./php.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/php/php.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/postiats/postiats.contribution.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/postiats/postiats.contribution.js ***! - \*********************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'postiats', - extensions: ['.dats', '.sats', '.hats'], - aliases: ['ATS', 'ATS/Postiats'], - loader: function () { return __webpack_require__.e(/*! import() */ 42).then(__webpack_require__.bind(null, /*! ./postiats.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/postiats/postiats.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/powerquery/powerquery.contribution.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/powerquery/powerquery.contribution.js ***! - \*************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'powerquery', - extensions: ['.pq', '.pqm'], - aliases: ['PQ', 'M', 'Power Query', 'Power Query M'], - loader: function () { return __webpack_require__.e(/*! import() */ 43).then(__webpack_require__.bind(null, /*! ./powerquery.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/powerquery/powerquery.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/powershell/powershell.contribution.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/powershell/powershell.contribution.js ***! - \*************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'powershell', - extensions: ['.ps1', '.psm1', '.psd1'], - aliases: ['PowerShell', 'powershell', 'ps', 'ps1'], - loader: function () { return __webpack_require__.e(/*! import() */ 44).then(__webpack_require__.bind(null, /*! ./powershell.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/powershell/powershell.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/pug/pug.contribution.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/pug/pug.contribution.js ***! - \***********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'pug', - extensions: ['.jade', '.pug'], - aliases: ['Pug', 'Jade', 'jade'], - loader: function () { return __webpack_require__.e(/*! import() */ 45).then(__webpack_require__.bind(null, /*! ./pug.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/pug/pug.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/python/python.contribution.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/python/python.contribution.js ***! - \*****************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'python', - extensions: ['.py', '.rpy', '.pyw', '.cpy', '.gyp', '.gypi'], - aliases: ['Python', 'py'], - firstLine: '^#!/.*\\bpython[0-9.-]*\\b', - loader: function () { return __webpack_require__.e(/*! import() */ 46).then(__webpack_require__.bind(null, /*! ./python.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/python/python.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/r/r.contribution.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/r/r.contribution.js ***! - \*******************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'r', - extensions: ['.r', '.rhistory', '.rmd', '.rprofile', '.rt'], - aliases: ['R', 'r'], - loader: function () { return __webpack_require__.e(/*! import() */ 47).then(__webpack_require__.bind(null, /*! ./r.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/r/r.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/razor/razor.contribution.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/razor/razor.contribution.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'razor', - extensions: ['.cshtml'], - aliases: ['Razor', 'razor'], - mimetypes: ['text/x-cshtml'], - loader: function () { return __webpack_require__.e(/*! import() */ 48).then(__webpack_require__.bind(null, /*! ./razor.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/razor/razor.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/redis/redis.contribution.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/redis/redis.contribution.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'redis', - extensions: ['.redis'], - aliases: ['redis'], - loader: function () { return __webpack_require__.e(/*! import() */ 49).then(__webpack_require__.bind(null, /*! ./redis.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/redis/redis.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/redshift/redshift.contribution.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/redshift/redshift.contribution.js ***! - \*********************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'redshift', - extensions: [], - aliases: ['Redshift', 'redshift'], - loader: function () { return __webpack_require__.e(/*! import() */ 50).then(__webpack_require__.bind(null, /*! ./redshift.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/redshift/redshift.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/restructuredtext/restructuredtext.contribution.js": -/*!*************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/restructuredtext/restructuredtext.contribution.js ***! - \*************************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'restructuredtext', - extensions: ['.rst'], - aliases: ['reStructuredText', 'restructuredtext'], - loader: function () { return __webpack_require__.e(/*! import() */ 51).then(__webpack_require__.bind(null, /*! ./restructuredtext.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/restructuredtext/restructuredtext.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/ruby/ruby.contribution.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/ruby/ruby.contribution.js ***! - \*************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'ruby', - extensions: ['.rb', '.rbx', '.rjs', '.gemspec', '.pp'], - filenames: ['rakefile', 'Gemfile'], - aliases: ['Ruby', 'rb'], - loader: function () { return __webpack_require__.e(/*! import() */ 52).then(__webpack_require__.bind(null, /*! ./ruby.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/ruby/ruby.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/rust/rust.contribution.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/rust/rust.contribution.js ***! - \*************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'rust', - extensions: ['.rs', '.rlib'], - aliases: ['Rust', 'rust'], - loader: function () { return __webpack_require__.e(/*! import() */ 53).then(__webpack_require__.bind(null, /*! ./rust.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/rust/rust.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/sb/sb.contribution.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/sb/sb.contribution.js ***! - \*********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'sb', - extensions: ['.sb'], - aliases: ['Small Basic', 'sb'], - loader: function () { return __webpack_require__.e(/*! import() */ 54).then(__webpack_require__.bind(null, /*! ./sb.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/sb/sb.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/scala/scala.contribution.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/scala/scala.contribution.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'scala', - extensions: ['.scala', '.sc', '.sbt'], - aliases: ['Scala', 'scala', 'SBT', 'Sbt', 'sbt', 'Dotty', 'dotty'], - mimetypes: ['text/x-scala-source', 'text/x-scala', 'text/x-sbt', 'text/x-dotty'], - loader: function () { return __webpack_require__.e(/*! import() */ 55).then(__webpack_require__.bind(null, /*! ./scala.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/scala/scala.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/scheme/scheme.contribution.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/scheme/scheme.contribution.js ***! - \*****************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'scheme', - extensions: ['.scm', '.ss', '.sch', '.rkt'], - aliases: ['scheme', 'Scheme'], - loader: function () { return __webpack_require__.e(/*! import() */ 56).then(__webpack_require__.bind(null, /*! ./scheme.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/scheme/scheme.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/scss/scss.contribution.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/scss/scss.contribution.js ***! - \*************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'scss', - extensions: ['.scss'], - aliases: ['Sass', 'sass', 'scss'], - mimetypes: ['text/x-scss', 'text/scss'], - loader: function () { return __webpack_require__.e(/*! import() */ 57).then(__webpack_require__.bind(null, /*! ./scss.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/scss/scss.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/shell/shell.contribution.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/shell/shell.contribution.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'shell', - extensions: ['.sh', '.bash'], - aliases: ['Shell', 'sh'], - loader: function () { return __webpack_require__.e(/*! import() */ 58).then(__webpack_require__.bind(null, /*! ./shell.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/shell/shell.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/solidity/solidity.contribution.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/solidity/solidity.contribution.js ***! - \*********************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'sol', - extensions: ['.sol'], - aliases: ['sol', 'solidity', 'Solidity'], - loader: function () { return __webpack_require__.e(/*! import() */ 59).then(__webpack_require__.bind(null, /*! ./solidity.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/solidity/solidity.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/sophia/sophia.contribution.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/sophia/sophia.contribution.js ***! - \*****************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'aes', - extensions: ['.aes'], - aliases: ['aes', 'sophia', 'Sophia'], - loader: function () { return __webpack_require__.e(/*! import() */ 60).then(__webpack_require__.bind(null, /*! ./sophia.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/sophia/sophia.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/sql/sql.contribution.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/sql/sql.contribution.js ***! - \***********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'sql', - extensions: ['.sql'], - aliases: ['SQL'], - loader: function () { return __webpack_require__.e(/*! import() */ 61).then(__webpack_require__.bind(null, /*! ./sql.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/sql/sql.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/st/st.contribution.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/st/st.contribution.js ***! - \*********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'st', - extensions: ['.st', '.iecst', '.iecplc', '.lc3lib'], - aliases: ['StructuredText', 'scl', 'stl'], - loader: function () { return __webpack_require__.e(/*! import() */ 62).then(__webpack_require__.bind(null, /*! ./st.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/st/st.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/swift/swift.contribution.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/swift/swift.contribution.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'swift', - aliases: ['Swift', 'swift'], - extensions: ['.swift'], - mimetypes: ['text/swift'], - loader: function () { return __webpack_require__.e(/*! import() */ 63).then(__webpack_require__.bind(null, /*! ./swift.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/swift/swift.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/systemverilog/systemverilog.contribution.js": -/*!*******************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/systemverilog/systemverilog.contribution.js ***! - \*******************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'systemverilog', - extensions: ['.sv', '.svh'], - aliases: ['SV', 'sv', 'SystemVerilog', 'systemverilog'], - loader: function () { return __webpack_require__.e(/*! import() */ 1).then(__webpack_require__.bind(null, /*! ./systemverilog.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/systemverilog/systemverilog.js")); } -}); -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'verilog', - extensions: ['.v', '.vh'], - aliases: ['V', 'v', 'Verilog', 'verilog'], - loader: function () { return __webpack_require__.e(/*! import() */ 1).then(__webpack_require__.bind(null, /*! ./systemverilog.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/systemverilog/systemverilog.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/tcl/tcl.contribution.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/tcl/tcl.contribution.js ***! - \***********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'tcl', - extensions: ['.tcl'], - aliases: ['tcl', 'Tcl', 'tcltk', 'TclTk', 'tcl/tk', 'Tcl/Tk'], - loader: function () { return __webpack_require__.e(/*! import() */ 64).then(__webpack_require__.bind(null, /*! ./tcl.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/tcl/tcl.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/twig/twig.contribution.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/twig/twig.contribution.js ***! - \*************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'twig', - extensions: ['.twig'], - aliases: ['Twig', 'twig'], - mimetypes: ['text/x-twig'], - loader: function () { return __webpack_require__.e(/*! import() */ 65).then(__webpack_require__.bind(null, /*! ./twig.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/twig/twig.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution.js ***! - \*************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'typescript', - extensions: ['.ts', '.tsx'], - aliases: ['TypeScript', 'ts', 'typescript'], - mimetypes: ['text/typescript'], - loader: function () { return __webpack_require__.e(/*! import() */ 66).then(__webpack_require__.bind(null, /*! ./typescript.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/typescript/typescript.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/vb/vb.contribution.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/vb/vb.contribution.js ***! - \*********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'vb', - extensions: ['.vb'], - aliases: ['Visual Basic', 'vb'], - loader: function () { return __webpack_require__.e(/*! import() */ 67).then(__webpack_require__.bind(null, /*! ./vb.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/vb/vb.js")); } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/basic-languages/xml/xml.contribution.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/basic-languages/xml/xml.contribution.js ***! - \***********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ "./node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object(_contribution_js__WEBPACK_IMPORTED_MODULE_0__["registerLanguage"])({ - id: 'xml', - extensions: [ - '.xml', - '.dtd', - '.ascx', - '.csproj', - '.config', - '.wxi', - '.wxl', - '.wxs', - '.xaml', - '.svg', - '.svgz', - '.opf', - '.xsl' - ], - firstLine: '(\\<\\?xml.*)|(\\ this._values[id]); - } -} -function clearAllFontInfos() { - CSSBasedConfiguration.INSTANCE.clearCache(); -} -class CSSBasedConfiguration extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor() { - super(); - this._onDidChange = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidChange = this._onDidChange.event; - this._cache = new CSSBasedConfigurationCache(); - this._evictUntrustedReadingsTimeout = -1; - } - dispose() { - if (this._evictUntrustedReadingsTimeout !== -1) { - clearTimeout(this._evictUntrustedReadingsTimeout); - this._evictUntrustedReadingsTimeout = -1; - } - super.dispose(); - } - clearCache() { - this._cache = new CSSBasedConfigurationCache(); - this._onDidChange.fire(); - } - _writeToCache(item, value) { - this._cache.put(item, value); - if (!value.isTrusted && this._evictUntrustedReadingsTimeout === -1) { - // Try reading again after some time - this._evictUntrustedReadingsTimeout = setTimeout(() => { - this._evictUntrustedReadingsTimeout = -1; - this._evictUntrustedReadings(); - }, 5000); - } - } - _evictUntrustedReadings() { - const values = this._cache.getValues(); - let somethingRemoved = false; - for (let i = 0, len = values.length; i < len; i++) { - const item = values[i]; - if (!item.isTrusted) { - somethingRemoved = true; - this._cache.remove(item); - } - } - if (somethingRemoved) { - this._onDidChange.fire(); - } - } - readConfiguration(bareFontInfo) { - if (!this._cache.has(bareFontInfo)) { - let readConfig = CSSBasedConfiguration._actualReadConfiguration(bareFontInfo); - if (readConfig.typicalHalfwidthCharacterWidth <= 2 || readConfig.typicalFullwidthCharacterWidth <= 2 || readConfig.spaceWidth <= 2 || readConfig.maxDigitWidth <= 2) { - // Hey, it's Bug 14341 ... we couldn't read - readConfig = new _common_config_fontInfo_js__WEBPACK_IMPORTED_MODULE_8__["FontInfo"]({ - zoomLevel: _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["getZoomLevel"](), - fontFamily: readConfig.fontFamily, - fontWeight: readConfig.fontWeight, - fontSize: readConfig.fontSize, - fontFeatureSettings: readConfig.fontFeatureSettings, - lineHeight: readConfig.lineHeight, - letterSpacing: readConfig.letterSpacing, - isMonospace: readConfig.isMonospace, - typicalHalfwidthCharacterWidth: Math.max(readConfig.typicalHalfwidthCharacterWidth, 5), - typicalFullwidthCharacterWidth: Math.max(readConfig.typicalFullwidthCharacterWidth, 5), - canUseHalfwidthRightwardsArrow: readConfig.canUseHalfwidthRightwardsArrow, - spaceWidth: Math.max(readConfig.spaceWidth, 5), - middotWidth: Math.max(readConfig.middotWidth, 5), - wsmiddotWidth: Math.max(readConfig.wsmiddotWidth, 5), - maxDigitWidth: Math.max(readConfig.maxDigitWidth, 5), - }, false); - } - this._writeToCache(bareFontInfo, readConfig); - } - return this._cache.get(bareFontInfo); - } - static createRequest(chr, type, all, monospace) { - const result = new _charWidthReader_js__WEBPACK_IMPORTED_MODULE_4__["CharWidthRequest"](chr, type); - all.push(result); - if (monospace) { - monospace.push(result); - } - return result; - } - static _actualReadConfiguration(bareFontInfo) { - const all = []; - const monospace = []; - const typicalHalfwidthCharacter = this.createRequest('n', 0 /* Regular */, all, monospace); - const typicalFullwidthCharacter = this.createRequest('\uff4d', 0 /* Regular */, all, null); - const space = this.createRequest(' ', 0 /* Regular */, all, monospace); - const digit0 = this.createRequest('0', 0 /* Regular */, all, monospace); - const digit1 = this.createRequest('1', 0 /* Regular */, all, monospace); - const digit2 = this.createRequest('2', 0 /* Regular */, all, monospace); - const digit3 = this.createRequest('3', 0 /* Regular */, all, monospace); - const digit4 = this.createRequest('4', 0 /* Regular */, all, monospace); - const digit5 = this.createRequest('5', 0 /* Regular */, all, monospace); - const digit6 = this.createRequest('6', 0 /* Regular */, all, monospace); - const digit7 = this.createRequest('7', 0 /* Regular */, all, monospace); - const digit8 = this.createRequest('8', 0 /* Regular */, all, monospace); - const digit9 = this.createRequest('9', 0 /* Regular */, all, monospace); - // monospace test: used for whitespace rendering - const rightwardsArrow = this.createRequest('→', 0 /* Regular */, all, monospace); - const halfwidthRightwardsArrow = this.createRequest('→', 0 /* Regular */, all, null); - // U+00B7 - MIDDLE DOT - const middot = this.createRequest('·', 0 /* Regular */, all, monospace); - // U+2E31 - WORD SEPARATOR MIDDLE DOT - const wsmiddotWidth = this.createRequest(String.fromCharCode(0x2E31), 0 /* Regular */, all, null); - // monospace test: some characters - this.createRequest('|', 0 /* Regular */, all, monospace); - this.createRequest('/', 0 /* Regular */, all, monospace); - this.createRequest('-', 0 /* Regular */, all, monospace); - this.createRequest('_', 0 /* Regular */, all, monospace); - this.createRequest('i', 0 /* Regular */, all, monospace); - this.createRequest('l', 0 /* Regular */, all, monospace); - this.createRequest('m', 0 /* Regular */, all, monospace); - // monospace italic test - this.createRequest('|', 1 /* Italic */, all, monospace); - this.createRequest('_', 1 /* Italic */, all, monospace); - this.createRequest('i', 1 /* Italic */, all, monospace); - this.createRequest('l', 1 /* Italic */, all, monospace); - this.createRequest('m', 1 /* Italic */, all, monospace); - this.createRequest('n', 1 /* Italic */, all, monospace); - // monospace bold test - this.createRequest('|', 2 /* Bold */, all, monospace); - this.createRequest('_', 2 /* Bold */, all, monospace); - this.createRequest('i', 2 /* Bold */, all, monospace); - this.createRequest('l', 2 /* Bold */, all, monospace); - this.createRequest('m', 2 /* Bold */, all, monospace); - this.createRequest('n', 2 /* Bold */, all, monospace); - Object(_charWidthReader_js__WEBPACK_IMPORTED_MODULE_4__["readCharWidths"])(bareFontInfo, all); - const maxDigitWidth = Math.max(digit0.width, digit1.width, digit2.width, digit3.width, digit4.width, digit5.width, digit6.width, digit7.width, digit8.width, digit9.width); - let isMonospace = (bareFontInfo.fontFeatureSettings === _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_7__["EditorFontLigatures"].OFF); - const referenceWidth = monospace[0].width; - for (let i = 1, len = monospace.length; isMonospace && i < len; i++) { - const diff = referenceWidth - monospace[i].width; - if (diff < -0.001 || diff > 0.001) { - isMonospace = false; - break; - } - } - let canUseHalfwidthRightwardsArrow = true; - if (isMonospace && halfwidthRightwardsArrow.width !== referenceWidth) { - // using a halfwidth rightwards arrow would break monospace... - canUseHalfwidthRightwardsArrow = false; - } - if (halfwidthRightwardsArrow.width > rightwardsArrow.width) { - // using a halfwidth rightwards arrow would paint a larger arrow than a regular rightwards arrow - canUseHalfwidthRightwardsArrow = false; - } - // let's trust the zoom level only 2s after it was changed. - const canTrustBrowserZoomLevel = (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["getTimeSinceLastZoomLevelChanged"]() > 2000); - return new _common_config_fontInfo_js__WEBPACK_IMPORTED_MODULE_8__["FontInfo"]({ - zoomLevel: _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["getZoomLevel"](), - fontFamily: bareFontInfo.fontFamily, - fontWeight: bareFontInfo.fontWeight, - fontSize: bareFontInfo.fontSize, - fontFeatureSettings: bareFontInfo.fontFeatureSettings, - lineHeight: bareFontInfo.lineHeight, - letterSpacing: bareFontInfo.letterSpacing, - isMonospace: isMonospace, - typicalHalfwidthCharacterWidth: typicalHalfwidthCharacter.width, - typicalFullwidthCharacterWidth: typicalFullwidthCharacter.width, - canUseHalfwidthRightwardsArrow: canUseHalfwidthRightwardsArrow, - spaceWidth: space.width, - middotWidth: middot.width, - wsmiddotWidth: wsmiddotWidth.width, - maxDigitWidth: maxDigitWidth - }, canTrustBrowserZoomLevel); - } -} -CSSBasedConfiguration.INSTANCE = new CSSBasedConfiguration(); -class Configuration extends _common_config_commonEditorConfig_js__WEBPACK_IMPORTED_MODULE_6__["CommonEditorConfiguration"] { - constructor(isSimpleWidget, options, referenceDomElement = null, accessibilityService) { - super(isSimpleWidget, options); - this.accessibilityService = accessibilityService; - this._elementSizeObserver = this._register(new _elementSizeObserver_js__WEBPACK_IMPORTED_MODULE_5__["ElementSizeObserver"](referenceDomElement, options.dimension, () => this._onReferenceDomElementSizeChanged())); - this._register(CSSBasedConfiguration.INSTANCE.onDidChange(() => this._onCSSBasedConfigurationChanged())); - if (this._validatedOptions.get(9 /* automaticLayout */)) { - this._elementSizeObserver.startObserving(); - } - this._register(_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["onDidChangeZoomLevel"](_ => this._recomputeOptions())); - this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(() => this._recomputeOptions())); - this._recomputeOptions(); - } - static applyFontInfoSlow(domNode, fontInfo) { - domNode.style.fontFamily = fontInfo.getMassagedFontFamily(); - domNode.style.fontWeight = fontInfo.fontWeight; - domNode.style.fontSize = fontInfo.fontSize + 'px'; - domNode.style.fontFeatureSettings = fontInfo.fontFeatureSettings; - domNode.style.lineHeight = fontInfo.lineHeight + 'px'; - domNode.style.letterSpacing = fontInfo.letterSpacing + 'px'; - } - static applyFontInfo(domNode, fontInfo) { - domNode.setFontFamily(fontInfo.getMassagedFontFamily()); - domNode.setFontWeight(fontInfo.fontWeight); - domNode.setFontSize(fontInfo.fontSize); - domNode.setFontFeatureSettings(fontInfo.fontFeatureSettings); - domNode.setLineHeight(fontInfo.lineHeight); - domNode.setLetterSpacing(fontInfo.letterSpacing); - } - _onReferenceDomElementSizeChanged() { - this._recomputeOptions(); - } - _onCSSBasedConfigurationChanged() { - this._recomputeOptions(); - } - observeReferenceElement(dimension) { - this._elementSizeObserver.observe(dimension); - } - dispose() { - super.dispose(); - } - _getExtraEditorClassName() { - let extra = ''; - if (!_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isSafari"] && !_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isWebkitWebView"]) { - // Use user-select: none in all browsers except Safari and native macOS WebView - extra += 'no-user-select '; - } - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__["isMacintosh"]) { - extra += 'mac '; - } - return extra; - } - _getEnvConfiguration() { - return { - extraEditorClassName: this._getExtraEditorClassName(), - outerWidth: this._elementSizeObserver.getWidth(), - outerHeight: this._elementSizeObserver.getHeight(), - emptySelectionClipboard: _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isWebKit"] || _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isFirefox"], - pixelRatio: _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["getPixelRatio"](), - zoomLevel: _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["getZoomLevel"](), - accessibilitySupport: (this.accessibilityService.isScreenReaderOptimized() - ? 2 /* Enabled */ - : this.accessibilityService.getAccessibilitySupport()) - }; - } - readConfiguration(bareFontInfo) { - return CSSBasedConfiguration.INSTANCE.readConfiguration(bareFontInfo); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/config/elementSizeObserver.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/config/elementSizeObserver.js ***! - \****************************************************************************************/ -/*! exports provided: ElementSizeObserver */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ElementSizeObserver", function() { return ElementSizeObserver; }); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class ElementSizeObserver extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["Disposable"] { - constructor(referenceDomElement, dimension, changeCallback) { - super(); - this.referenceDomElement = referenceDomElement; - this.changeCallback = changeCallback; - this.width = -1; - this.height = -1; - this.resizeObserver = null; - this.measureReferenceDomElementToken = -1; - this.measureReferenceDomElement(false, dimension); - } - dispose() { - this.stopObserving(); - super.dispose(); - } - getWidth() { - return this.width; - } - getHeight() { - return this.height; - } - startObserving() { - if (typeof ResizeObserver !== 'undefined') { - if (!this.resizeObserver && this.referenceDomElement) { - this.resizeObserver = new ResizeObserver((entries) => { - if (entries && entries[0] && entries[0].contentRect) { - this.observe({ width: entries[0].contentRect.width, height: entries[0].contentRect.height }); - } - else { - this.observe(); - } - }); - this.resizeObserver.observe(this.referenceDomElement); - } - } - else { - if (this.measureReferenceDomElementToken === -1) { - // setInterval type defaults to NodeJS.Timeout instead of number, so specify it as a number - this.measureReferenceDomElementToken = setInterval(() => this.observe(), 100); - } - } - } - stopObserving() { - if (this.resizeObserver) { - this.resizeObserver.disconnect(); - this.resizeObserver = null; - } - if (this.measureReferenceDomElementToken !== -1) { - clearInterval(this.measureReferenceDomElementToken); - this.measureReferenceDomElementToken = -1; - } - } - observe(dimension) { - this.measureReferenceDomElement(true, dimension); - } - measureReferenceDomElement(callChangeCallback, dimension) { - let observedWidth = 0; - let observedHeight = 0; - if (dimension) { - observedWidth = dimension.width; - observedHeight = dimension.height; - } - else if (this.referenceDomElement) { - observedWidth = this.referenceDomElement.clientWidth; - observedHeight = this.referenceDomElement.clientHeight; - } - observedWidth = Math.max(5, observedWidth); - observedHeight = Math.max(5, observedHeight); - if (this.width !== observedWidth || this.height !== observedHeight) { - this.width = observedWidth; - this.height = observedHeight; - if (callChangeCallback) { - this.changeCallback(); - } - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/coreCommands.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/controller/coreCommands.js ***! - \*************************************************************************************/ -/*! exports provided: CoreEditorCommand, EditorScroll_, RevealLine_, CoreNavigationCommands, CoreEditingCommands */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CoreEditorCommand", function() { return CoreEditorCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorScroll_", function() { return EditorScroll_; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RevealLine_", function() { return RevealLine_; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CoreNavigationCommands", function() { return CoreNavigationCommands; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CoreEditingCommands", function() { return CoreEditingCommands; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _common_controller_cursorColumnSelection_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/controller/cursorColumnSelection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorColumnSelection.js"); -/* harmony import */ var _common_controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/controller/cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _common_controller_cursorDeleteOperations_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/controller/cursorDeleteOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorDeleteOperations.js"); -/* harmony import */ var _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/controller/cursorMoveCommands.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorMoveCommands.js"); -/* harmony import */ var _common_controller_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/controller/cursorTypeOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorTypeOperations.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybindingsRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - -const CORE_WEIGHT = 0 /* EditorCore */; -class CoreEditorCommand extends _editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["EditorCommand"] { - runEditorCommand(accessor, editor, args) { - const viewModel = editor._getViewModel(); - if (!viewModel) { - // the editor has no view => has no cursors - return; - } - this.runCoreEditorCommand(viewModel, args || {}); - } -} -var EditorScroll_; -(function (EditorScroll_) { - const isEditorScrollArgs = function (arg) { - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["isObject"](arg)) { - return false; - } - const scrollArg = arg; - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["isString"](scrollArg.to)) { - return false; - } - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["isUndefined"](scrollArg.by) && !_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["isString"](scrollArg.by)) { - return false; - } - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["isUndefined"](scrollArg.value) && !_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"](scrollArg.value)) { - return false; - } - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["isUndefined"](scrollArg.revealCursor) && !_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["isBoolean"](scrollArg.revealCursor)) { - return false; - } - return true; - }; - EditorScroll_.description = { - description: 'Scroll editor in the given direction', - args: [ - { - name: 'Editor scroll argument object', - description: `Property-value pairs that can be passed through this argument: - * 'to': A mandatory direction value. - \`\`\` - 'up', 'down' - \`\`\` - * 'by': Unit to move. Default is computed based on 'to' value. - \`\`\` - 'line', 'wrappedLine', 'page', 'halfPage' - \`\`\` - * 'value': Number of units to move. Default is '1'. - * 'revealCursor': If 'true' reveals the cursor if it is outside view port. - `, - constraint: isEditorScrollArgs, - schema: { - 'type': 'object', - 'required': ['to'], - 'properties': { - 'to': { - 'type': 'string', - 'enum': ['up', 'down'] - }, - 'by': { - 'type': 'string', - 'enum': ['line', 'wrappedLine', 'page', 'halfPage'] - }, - 'value': { - 'type': 'number', - 'default': 1 - }, - 'revealCursor': { - 'type': 'boolean', - } - } - } - } - ] - }; - /** - * Directions in the view for editor scroll command. - */ - EditorScroll_.RawDirection = { - Up: 'up', - Down: 'down', - }; - /** - * Units for editor scroll 'by' argument - */ - EditorScroll_.RawUnit = { - Line: 'line', - WrappedLine: 'wrappedLine', - Page: 'page', - HalfPage: 'halfPage' - }; - function parse(args) { - let direction; - switch (args.to) { - case EditorScroll_.RawDirection.Up: - direction = 1 /* Up */; - break; - case EditorScroll_.RawDirection.Down: - direction = 2 /* Down */; - break; - default: - // Illegal arguments - return null; - } - let unit; - switch (args.by) { - case EditorScroll_.RawUnit.Line: - unit = 1 /* Line */; - break; - case EditorScroll_.RawUnit.WrappedLine: - unit = 2 /* WrappedLine */; - break; - case EditorScroll_.RawUnit.Page: - unit = 3 /* Page */; - break; - case EditorScroll_.RawUnit.HalfPage: - unit = 4 /* HalfPage */; - break; - default: - unit = 2 /* WrappedLine */; - } - const value = Math.floor(args.value || 1); - const revealCursor = !!args.revealCursor; - return { - direction: direction, - unit: unit, - value: value, - revealCursor: revealCursor, - select: (!!args.select) - }; - } - EditorScroll_.parse = parse; -})(EditorScroll_ || (EditorScroll_ = {})); -var RevealLine_; -(function (RevealLine_) { - const isRevealLineArgs = function (arg) { - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["isObject"](arg)) { - return false; - } - const reveaLineArg = arg; - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"](reveaLineArg.lineNumber)) { - return false; - } - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["isUndefined"](reveaLineArg.at) && !_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["isString"](reveaLineArg.at)) { - return false; - } - return true; - }; - RevealLine_.description = { - description: 'Reveal the given line at the given logical position', - args: [ - { - name: 'Reveal line argument object', - description: `Property-value pairs that can be passed through this argument: - * 'lineNumber': A mandatory line number value. - * 'at': Logical position at which line has to be revealed . - \`\`\` - 'top', 'center', 'bottom' - \`\`\` - `, - constraint: isRevealLineArgs, - schema: { - 'type': 'object', - 'required': ['lineNumber'], - 'properties': { - 'lineNumber': { - 'type': 'number', - }, - 'at': { - 'type': 'string', - 'enum': ['top', 'center', 'bottom'] - } - } - } - } - ] - }; - /** - * Values for reveal line 'at' argument - */ - RevealLine_.RawAtArgument = { - Top: 'top', - Center: 'center', - Bottom: 'bottom' - }; -})(RevealLine_ || (RevealLine_ = {})); -class EditorOrNativeTextInputCommand { - constructor(target) { - // 1. handle case when focus is in editor. - target.addImplementation(10000, (accessor, args) => { - // Only if editor text focus (i.e. not if editor has widget focus). - const focusedEditor = accessor.get(_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__["ICodeEditorService"]).getFocusedCodeEditor(); - if (focusedEditor && focusedEditor.hasTextFocus()) { - this.runEditorCommand(accessor, focusedEditor, args); - return true; - } - return false; - }); - // 2. handle case when focus is in some other `input` / `textarea`. - target.addImplementation(1000, (accessor, args) => { - // Only if focused on an element that allows for entering text - const activeElement = document.activeElement; - if (activeElement && ['input', 'textarea'].indexOf(activeElement.tagName.toLowerCase()) >= 0) { - this.runDOMCommand(); - return true; - } - return false; - }); - // 3. (default) handle case when focus is somewhere else. - target.addImplementation(0, (accessor, args) => { - // Redirecting to active editor - const activeEditor = accessor.get(_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__["ICodeEditorService"]).getActiveCodeEditor(); - if (activeEditor) { - activeEditor.focus(); - this.runEditorCommand(accessor, activeEditor, args); - return true; - } - return false; - }); - } -} -var CoreNavigationCommands; -(function (CoreNavigationCommands) { - class BaseMoveToCommand extends CoreEditorCommand { - constructor(opts) { - super(opts); - this._inSelectionMode = opts.inSelectionMode; - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, [ - _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].moveTo(viewModel, viewModel.getPrimaryCursorState(), this._inSelectionMode, args.position, args.viewPosition) - ]); - viewModel.revealPrimaryCursor(args.source, true); - } - } - CoreNavigationCommands.MoveTo = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new BaseMoveToCommand({ - id: '_moveTo', - inSelectionMode: false, - precondition: undefined - })); - CoreNavigationCommands.MoveToSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new BaseMoveToCommand({ - id: '_moveToSelect', - inSelectionMode: true, - precondition: undefined - })); - class ColumnSelectCommand extends CoreEditorCommand { - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - const result = this._getColumnSelectResult(viewModel, viewModel.getPrimaryCursorState(), viewModel.getCursorColumnSelectData(), args); - viewModel.setCursorStates(args.source, 3 /* Explicit */, result.viewStates.map((viewState) => _common_controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["CursorState"].fromViewState(viewState))); - viewModel.setCursorColumnSelectData({ - isReal: true, - fromViewLineNumber: result.fromLineNumber, - fromViewVisualColumn: result.fromVisualColumn, - toViewLineNumber: result.toLineNumber, - toViewVisualColumn: result.toVisualColumn - }); - if (result.reversed) { - viewModel.revealTopMostCursor(args.source); - } - else { - viewModel.revealBottomMostCursor(args.source); - } - } - } - CoreNavigationCommands.ColumnSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends ColumnSelectCommand { - constructor() { - super({ - id: 'columnSelect', - precondition: undefined - }); - } - _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { - // validate `args` - const validatedPosition = viewModel.model.validatePosition(args.position); - const validatedViewPosition = viewModel.coordinatesConverter.validateViewPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_9__["Position"](args.viewPosition.lineNumber, args.viewPosition.column), validatedPosition); - let fromViewLineNumber = args.doColumnSelect ? prevColumnSelectData.fromViewLineNumber : validatedViewPosition.lineNumber; - let fromViewVisualColumn = args.doColumnSelect ? prevColumnSelectData.fromViewVisualColumn : args.mouseColumn - 1; - return _common_controller_cursorColumnSelection_js__WEBPACK_IMPORTED_MODULE_4__["ColumnSelection"].columnSelect(viewModel.cursorConfig, viewModel, fromViewLineNumber, fromViewVisualColumn, validatedViewPosition.lineNumber, args.mouseColumn - 1); - } - }); - CoreNavigationCommands.CursorColumnSelectLeft = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends ColumnSelectCommand { - constructor() { - super({ - id: 'cursorColumnSelectLeft', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 512 /* Alt */ | 15 /* LeftArrow */, - linux: { primary: 0 } - } - }); - } - _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { - return _common_controller_cursorColumnSelection_js__WEBPACK_IMPORTED_MODULE_4__["ColumnSelection"].columnSelectLeft(viewModel.cursorConfig, viewModel, prevColumnSelectData); - } - }); - CoreNavigationCommands.CursorColumnSelectRight = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends ColumnSelectCommand { - constructor() { - super({ - id: 'cursorColumnSelectRight', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 512 /* Alt */ | 17 /* RightArrow */, - linux: { primary: 0 } - } - }); - } - _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { - return _common_controller_cursorColumnSelection_js__WEBPACK_IMPORTED_MODULE_4__["ColumnSelection"].columnSelectRight(viewModel.cursorConfig, viewModel, prevColumnSelectData); - } - }); - class ColumnSelectUpCommand extends ColumnSelectCommand { - constructor(opts) { - super(opts); - this._isPaged = opts.isPaged; - } - _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { - return _common_controller_cursorColumnSelection_js__WEBPACK_IMPORTED_MODULE_4__["ColumnSelection"].columnSelectUp(viewModel.cursorConfig, viewModel, prevColumnSelectData, this._isPaged); - } - } - CoreNavigationCommands.CursorColumnSelectUp = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new ColumnSelectUpCommand({ - isPaged: false, - id: 'cursorColumnSelectUp', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 512 /* Alt */ | 16 /* UpArrow */, - linux: { primary: 0 } - } - })); - CoreNavigationCommands.CursorColumnSelectPageUp = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new ColumnSelectUpCommand({ - isPaged: true, - id: 'cursorColumnSelectPageUp', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 512 /* Alt */ | 11 /* PageUp */, - linux: { primary: 0 } - } - })); - class ColumnSelectDownCommand extends ColumnSelectCommand { - constructor(opts) { - super(opts); - this._isPaged = opts.isPaged; - } - _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { - return _common_controller_cursorColumnSelection_js__WEBPACK_IMPORTED_MODULE_4__["ColumnSelection"].columnSelectDown(viewModel.cursorConfig, viewModel, prevColumnSelectData, this._isPaged); - } - } - CoreNavigationCommands.CursorColumnSelectDown = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new ColumnSelectDownCommand({ - isPaged: false, - id: 'cursorColumnSelectDown', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 512 /* Alt */ | 18 /* DownArrow */, - linux: { primary: 0 } - } - })); - CoreNavigationCommands.CursorColumnSelectPageDown = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new ColumnSelectDownCommand({ - isPaged: true, - id: 'cursorColumnSelectPageDown', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 512 /* Alt */ | 12 /* PageDown */, - linux: { primary: 0 } - } - })); - class CursorMoveImpl extends CoreEditorCommand { - constructor() { - super({ - id: 'cursorMove', - precondition: undefined, - description: _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMove"].description - }); - } - runCoreEditorCommand(viewModel, args) { - const parsed = _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMove"].parse(args); - if (!parsed) { - // illegal arguments - return; - } - this._runCursorMove(viewModel, args.source, parsed); - } - _runCursorMove(viewModel, source, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(source, 3 /* Explicit */, CursorMoveImpl._move(viewModel, viewModel.getCursorStates(), args)); - viewModel.revealPrimaryCursor(source, true); - } - static _move(viewModel, cursors, args) { - const inSelectionMode = args.select; - const value = args.value; - switch (args.direction) { - case 0 /* Left */: - case 1 /* Right */: - case 2 /* Up */: - case 3 /* Down */: - case 4 /* WrappedLineStart */: - case 5 /* WrappedLineFirstNonWhitespaceCharacter */: - case 6 /* WrappedLineColumnCenter */: - case 7 /* WrappedLineEnd */: - case 8 /* WrappedLineLastNonWhitespaceCharacter */: - return _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].simpleMove(viewModel, cursors, args.direction, inSelectionMode, value, args.unit); - case 9 /* ViewPortTop */: - case 11 /* ViewPortBottom */: - case 10 /* ViewPortCenter */: - case 12 /* ViewPortIfOutside */: - return _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].viewportMove(viewModel, cursors, args.direction, inSelectionMode, value); - default: - return null; - } - } - } - CoreNavigationCommands.CursorMoveImpl = CursorMoveImpl; - CoreNavigationCommands.CursorMove = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveImpl()); - class CursorMoveBasedCommand extends CoreEditorCommand { - constructor(opts) { - super(opts); - this._staticArgs = opts.args; - } - runCoreEditorCommand(viewModel, dynamicArgs) { - let args = this._staticArgs; - if (this._staticArgs.value === -1 /* PAGE_SIZE_MARKER */) { - // -1 is a marker for page size - args = { - direction: this._staticArgs.direction, - unit: this._staticArgs.unit, - select: this._staticArgs.select, - value: viewModel.cursorConfig.pageSize - }; - } - viewModel.model.pushStackElement(); - viewModel.setCursorStates(dynamicArgs.source, 3 /* Explicit */, _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].simpleMove(viewModel, viewModel.getCursorStates(), args.direction, args.select, args.value, args.unit)); - viewModel.revealPrimaryCursor(dynamicArgs.source, true); - } - } - CoreNavigationCommands.CursorLeft = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveBasedCommand({ - args: { - direction: 0 /* Left */, - unit: 0 /* None */, - select: false, - value: 1 - }, - id: 'cursorLeft', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 15 /* LeftArrow */, - mac: { primary: 15 /* LeftArrow */, secondary: [256 /* WinCtrl */ | 32 /* KEY_B */] } - } - })); - CoreNavigationCommands.CursorLeftSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveBasedCommand({ - args: { - direction: 0 /* Left */, - unit: 0 /* None */, - select: true, - value: 1 - }, - id: 'cursorLeftSelect', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 1024 /* Shift */ | 15 /* LeftArrow */ - } - })); - CoreNavigationCommands.CursorRight = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveBasedCommand({ - args: { - direction: 1 /* Right */, - unit: 0 /* None */, - select: false, - value: 1 - }, - id: 'cursorRight', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 17 /* RightArrow */, - mac: { primary: 17 /* RightArrow */, secondary: [256 /* WinCtrl */ | 36 /* KEY_F */] } - } - })); - CoreNavigationCommands.CursorRightSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveBasedCommand({ - args: { - direction: 1 /* Right */, - unit: 0 /* None */, - select: true, - value: 1 - }, - id: 'cursorRightSelect', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 1024 /* Shift */ | 17 /* RightArrow */ - } - })); - CoreNavigationCommands.CursorUp = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveBasedCommand({ - args: { - direction: 2 /* Up */, - unit: 2 /* WrappedLine */, - select: false, - value: 1 - }, - id: 'cursorUp', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 16 /* UpArrow */, - mac: { primary: 16 /* UpArrow */, secondary: [256 /* WinCtrl */ | 46 /* KEY_P */] } - } - })); - CoreNavigationCommands.CursorUpSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveBasedCommand({ - args: { - direction: 2 /* Up */, - unit: 2 /* WrappedLine */, - select: true, - value: 1 - }, - id: 'cursorUpSelect', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 1024 /* Shift */ | 16 /* UpArrow */, - secondary: [2048 /* CtrlCmd */ | 1024 /* Shift */ | 16 /* UpArrow */], - mac: { primary: 1024 /* Shift */ | 16 /* UpArrow */ }, - linux: { primary: 1024 /* Shift */ | 16 /* UpArrow */ } - } - })); - CoreNavigationCommands.CursorPageUp = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveBasedCommand({ - args: { - direction: 2 /* Up */, - unit: 2 /* WrappedLine */, - select: false, - value: -1 /* PAGE_SIZE_MARKER */ - }, - id: 'cursorPageUp', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 11 /* PageUp */ - } - })); - CoreNavigationCommands.CursorPageUpSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveBasedCommand({ - args: { - direction: 2 /* Up */, - unit: 2 /* WrappedLine */, - select: true, - value: -1 /* PAGE_SIZE_MARKER */ - }, - id: 'cursorPageUpSelect', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 1024 /* Shift */ | 11 /* PageUp */ - } - })); - CoreNavigationCommands.CursorDown = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveBasedCommand({ - args: { - direction: 3 /* Down */, - unit: 2 /* WrappedLine */, - select: false, - value: 1 - }, - id: 'cursorDown', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 18 /* DownArrow */, - mac: { primary: 18 /* DownArrow */, secondary: [256 /* WinCtrl */ | 44 /* KEY_N */] } - } - })); - CoreNavigationCommands.CursorDownSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveBasedCommand({ - args: { - direction: 3 /* Down */, - unit: 2 /* WrappedLine */, - select: true, - value: 1 - }, - id: 'cursorDownSelect', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 1024 /* Shift */ | 18 /* DownArrow */, - secondary: [2048 /* CtrlCmd */ | 1024 /* Shift */ | 18 /* DownArrow */], - mac: { primary: 1024 /* Shift */ | 18 /* DownArrow */ }, - linux: { primary: 1024 /* Shift */ | 18 /* DownArrow */ } - } - })); - CoreNavigationCommands.CursorPageDown = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveBasedCommand({ - args: { - direction: 3 /* Down */, - unit: 2 /* WrappedLine */, - select: false, - value: -1 /* PAGE_SIZE_MARKER */ - }, - id: 'cursorPageDown', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 12 /* PageDown */ - } - })); - CoreNavigationCommands.CursorPageDownSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new CursorMoveBasedCommand({ - args: { - direction: 3 /* Down */, - unit: 2 /* WrappedLine */, - select: true, - value: -1 /* PAGE_SIZE_MARKER */ - }, - id: 'cursorPageDownSelect', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 1024 /* Shift */ | 12 /* PageDown */ - } - })); - CoreNavigationCommands.CreateCursor = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditorCommand { - constructor() { - super({ - id: 'createCursor', - precondition: undefined - }); - } - runCoreEditorCommand(viewModel, args) { - let newState; - if (args.wholeLine) { - newState = _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].line(viewModel, viewModel.getPrimaryCursorState(), false, args.position, args.viewPosition); - } - else { - newState = _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].moveTo(viewModel, viewModel.getPrimaryCursorState(), false, args.position, args.viewPosition); - } - const states = viewModel.getCursorStates(); - // Check if we should remove a cursor (sort of like a toggle) - if (states.length > 1) { - const newModelPosition = (newState.modelState ? newState.modelState.position : null); - const newViewPosition = (newState.viewState ? newState.viewState.position : null); - for (let i = 0, len = states.length; i < len; i++) { - const state = states[i]; - if (newModelPosition && !state.modelState.selection.containsPosition(newModelPosition)) { - continue; - } - if (newViewPosition && !state.viewState.selection.containsPosition(newViewPosition)) { - continue; - } - // => Remove the cursor - states.splice(i, 1); - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, states); - return; - } - } - // => Add the new cursor - states.push(newState); - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, states); - } - }); - CoreNavigationCommands.LastCursorMoveToSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditorCommand { - constructor() { - super({ - id: '_lastCursorMoveToSelect', - precondition: undefined - }); - } - runCoreEditorCommand(viewModel, args) { - const lastAddedCursorIndex = viewModel.getLastAddedCursorIndex(); - const states = viewModel.getCursorStates(); - const newStates = states.slice(0); - newStates[lastAddedCursorIndex] = _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].moveTo(viewModel, states[lastAddedCursorIndex], true, args.position, args.viewPosition); - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, newStates); - } - }); - class HomeCommand extends CoreEditorCommand { - constructor(opts) { - super(opts); - this._inSelectionMode = opts.inSelectionMode; - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].moveToBeginningOfLine(viewModel, viewModel.getCursorStates(), this._inSelectionMode)); - viewModel.revealPrimaryCursor(args.source, true); - } - } - CoreNavigationCommands.CursorHome = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new HomeCommand({ - inSelectionMode: false, - id: 'cursorHome', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 14 /* Home */, - mac: { primary: 14 /* Home */, secondary: [2048 /* CtrlCmd */ | 15 /* LeftArrow */] } - } - })); - CoreNavigationCommands.CursorHomeSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new HomeCommand({ - inSelectionMode: true, - id: 'cursorHomeSelect', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 1024 /* Shift */ | 14 /* Home */, - mac: { primary: 1024 /* Shift */ | 14 /* Home */, secondary: [2048 /* CtrlCmd */ | 1024 /* Shift */ | 15 /* LeftArrow */] } - } - })); - class LineStartCommand extends CoreEditorCommand { - constructor(opts) { - super(opts); - this._inSelectionMode = opts.inSelectionMode; - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, this._exec(viewModel.getCursorStates())); - viewModel.revealPrimaryCursor(args.source, true); - } - _exec(cursors) { - const result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const lineNumber = cursor.modelState.position.lineNumber; - result[i] = _common_controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["CursorState"].fromModelState(cursor.modelState.move(this._inSelectionMode, lineNumber, 1, 0)); - } - return result; - } - } - CoreNavigationCommands.CursorLineStart = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new LineStartCommand({ - inSelectionMode: false, - id: 'cursorLineStart', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 31 /* KEY_A */ } - } - })); - CoreNavigationCommands.CursorLineStartSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new LineStartCommand({ - inSelectionMode: true, - id: 'cursorLineStartSelect', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 1024 /* Shift */ | 31 /* KEY_A */ } - } - })); - class EndCommand extends CoreEditorCommand { - constructor(opts) { - super(opts); - this._inSelectionMode = opts.inSelectionMode; - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].moveToEndOfLine(viewModel, viewModel.getCursorStates(), this._inSelectionMode, args.sticky || false)); - viewModel.revealPrimaryCursor(args.source, true); - } - } - CoreNavigationCommands.CursorEnd = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new EndCommand({ - inSelectionMode: false, - id: 'cursorEnd', - precondition: undefined, - kbOpts: { - args: { sticky: false }, - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 13 /* End */, - mac: { primary: 13 /* End */, secondary: [2048 /* CtrlCmd */ | 17 /* RightArrow */] } - }, - description: { - description: `Go to End`, - args: [{ - name: 'args', - schema: { - type: 'object', - properties: { - 'sticky': { - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('stickydesc', "Stick to the end even when going to longer lines"), - type: 'boolean', - default: false - } - } - } - }] - } - })); - CoreNavigationCommands.CursorEndSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new EndCommand({ - inSelectionMode: true, - id: 'cursorEndSelect', - precondition: undefined, - kbOpts: { - args: { sticky: false }, - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 1024 /* Shift */ | 13 /* End */, - mac: { primary: 1024 /* Shift */ | 13 /* End */, secondary: [2048 /* CtrlCmd */ | 1024 /* Shift */ | 17 /* RightArrow */] } - }, - description: { - description: `Select to End`, - args: [{ - name: 'args', - schema: { - type: 'object', - properties: { - 'sticky': { - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('stickydesc', "Stick to the end even when going to longer lines"), - type: 'boolean', - default: false - } - } - } - }] - } - })); - class LineEndCommand extends CoreEditorCommand { - constructor(opts) { - super(opts); - this._inSelectionMode = opts.inSelectionMode; - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, this._exec(viewModel, viewModel.getCursorStates())); - viewModel.revealPrimaryCursor(args.source, true); - } - _exec(viewModel, cursors) { - const result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const lineNumber = cursor.modelState.position.lineNumber; - const maxColumn = viewModel.model.getLineMaxColumn(lineNumber); - result[i] = _common_controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["CursorState"].fromModelState(cursor.modelState.move(this._inSelectionMode, lineNumber, maxColumn, 0)); - } - return result; - } - } - CoreNavigationCommands.CursorLineEnd = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new LineEndCommand({ - inSelectionMode: false, - id: 'cursorLineEnd', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 35 /* KEY_E */ } - } - })); - CoreNavigationCommands.CursorLineEndSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new LineEndCommand({ - inSelectionMode: true, - id: 'cursorLineEndSelect', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 1024 /* Shift */ | 35 /* KEY_E */ } - } - })); - class TopCommand extends CoreEditorCommand { - constructor(opts) { - super(opts); - this._inSelectionMode = opts.inSelectionMode; - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].moveToBeginningOfBuffer(viewModel, viewModel.getCursorStates(), this._inSelectionMode)); - viewModel.revealPrimaryCursor(args.source, true); - } - } - CoreNavigationCommands.CursorTop = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new TopCommand({ - inSelectionMode: false, - id: 'cursorTop', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 14 /* Home */, - mac: { primary: 2048 /* CtrlCmd */ | 16 /* UpArrow */ } - } - })); - CoreNavigationCommands.CursorTopSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new TopCommand({ - inSelectionMode: true, - id: 'cursorTopSelect', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 14 /* Home */, - mac: { primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 16 /* UpArrow */ } - } - })); - class BottomCommand extends CoreEditorCommand { - constructor(opts) { - super(opts); - this._inSelectionMode = opts.inSelectionMode; - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].moveToEndOfBuffer(viewModel, viewModel.getCursorStates(), this._inSelectionMode)); - viewModel.revealPrimaryCursor(args.source, true); - } - } - CoreNavigationCommands.CursorBottom = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new BottomCommand({ - inSelectionMode: false, - id: 'cursorBottom', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 13 /* End */, - mac: { primary: 2048 /* CtrlCmd */ | 18 /* DownArrow */ } - } - })); - CoreNavigationCommands.CursorBottomSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new BottomCommand({ - inSelectionMode: true, - id: 'cursorBottomSelect', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 13 /* End */, - mac: { primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 18 /* DownArrow */ } - } - })); - class EditorScrollImpl extends CoreEditorCommand { - constructor() { - super({ - id: 'editorScroll', - precondition: undefined, - description: EditorScroll_.description - }); - } - runCoreEditorCommand(viewModel, args) { - const parsed = EditorScroll_.parse(args); - if (!parsed) { - // illegal arguments - return; - } - this._runEditorScroll(viewModel, args.source, parsed); - } - _runEditorScroll(viewModel, source, args) { - const desiredScrollTop = this._computeDesiredScrollTop(viewModel, args); - if (args.revealCursor) { - // must ensure cursor is in new visible range - const desiredVisibleViewRange = viewModel.getCompletelyVisibleViewRangeAtScrollTop(desiredScrollTop); - viewModel.setCursorStates(source, 3 /* Explicit */, [ - _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].findPositionInViewportIfOutside(viewModel, viewModel.getPrimaryCursorState(), desiredVisibleViewRange, args.select) - ]); - } - viewModel.setScrollTop(desiredScrollTop, 0 /* Smooth */); - } - _computeDesiredScrollTop(viewModel, args) { - if (args.unit === 1 /* Line */) { - // scrolling by model lines - const visibleViewRange = viewModel.getCompletelyVisibleViewRange(); - const visibleModelRange = viewModel.coordinatesConverter.convertViewRangeToModelRange(visibleViewRange); - let desiredTopModelLineNumber; - if (args.direction === 1 /* Up */) { - // must go x model lines up - desiredTopModelLineNumber = Math.max(1, visibleModelRange.startLineNumber - args.value); - } - else { - // must go x model lines down - desiredTopModelLineNumber = Math.min(viewModel.model.getLineCount(), visibleModelRange.startLineNumber + args.value); - } - const viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_9__["Position"](desiredTopModelLineNumber, 1)); - return viewModel.getVerticalOffsetForLineNumber(viewPosition.lineNumber); - } - let noOfLines; - if (args.unit === 3 /* Page */) { - noOfLines = viewModel.cursorConfig.pageSize * args.value; - } - else if (args.unit === 4 /* HalfPage */) { - noOfLines = Math.round(viewModel.cursorConfig.pageSize / 2) * args.value; - } - else { - noOfLines = args.value; - } - const deltaLines = (args.direction === 1 /* Up */ ? -1 : 1) * noOfLines; - return viewModel.getScrollTop() + deltaLines * viewModel.cursorConfig.lineHeight; - } - } - CoreNavigationCommands.EditorScrollImpl = EditorScrollImpl; - CoreNavigationCommands.EditorScroll = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new EditorScrollImpl()); - CoreNavigationCommands.ScrollLineUp = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditorCommand { - constructor() { - super({ - id: 'scrollLineUp', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 16 /* UpArrow */, - mac: { primary: 256 /* WinCtrl */ | 11 /* PageUp */ } - } - }); - } - runCoreEditorCommand(viewModel, args) { - CoreNavigationCommands.EditorScroll._runEditorScroll(viewModel, args.source, { - direction: 1 /* Up */, - unit: 2 /* WrappedLine */, - value: 1, - revealCursor: false, - select: false - }); - } - }); - CoreNavigationCommands.ScrollPageUp = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditorCommand { - constructor() { - super({ - id: 'scrollPageUp', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 11 /* PageUp */, - win: { primary: 512 /* Alt */ | 11 /* PageUp */ }, - linux: { primary: 512 /* Alt */ | 11 /* PageUp */ } - } - }); - } - runCoreEditorCommand(viewModel, args) { - CoreNavigationCommands.EditorScroll._runEditorScroll(viewModel, args.source, { - direction: 1 /* Up */, - unit: 3 /* Page */, - value: 1, - revealCursor: false, - select: false - }); - } - }); - CoreNavigationCommands.ScrollLineDown = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditorCommand { - constructor() { - super({ - id: 'scrollLineDown', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 18 /* DownArrow */, - mac: { primary: 256 /* WinCtrl */ | 12 /* PageDown */ } - } - }); - } - runCoreEditorCommand(viewModel, args) { - CoreNavigationCommands.EditorScroll._runEditorScroll(viewModel, args.source, { - direction: 2 /* Down */, - unit: 2 /* WrappedLine */, - value: 1, - revealCursor: false, - select: false - }); - } - }); - CoreNavigationCommands.ScrollPageDown = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditorCommand { - constructor() { - super({ - id: 'scrollPageDown', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 12 /* PageDown */, - win: { primary: 512 /* Alt */ | 12 /* PageDown */ }, - linux: { primary: 512 /* Alt */ | 12 /* PageDown */ } - } - }); - } - runCoreEditorCommand(viewModel, args) { - CoreNavigationCommands.EditorScroll._runEditorScroll(viewModel, args.source, { - direction: 2 /* Down */, - unit: 3 /* Page */, - value: 1, - revealCursor: false, - select: false - }); - } - }); - class WordCommand extends CoreEditorCommand { - constructor(opts) { - super(opts); - this._inSelectionMode = opts.inSelectionMode; - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, [ - _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].word(viewModel, viewModel.getPrimaryCursorState(), this._inSelectionMode, args.position) - ]); - viewModel.revealPrimaryCursor(args.source, true); - } - } - CoreNavigationCommands.WordSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new WordCommand({ - inSelectionMode: false, - id: '_wordSelect', - precondition: undefined - })); - CoreNavigationCommands.WordSelectDrag = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new WordCommand({ - inSelectionMode: true, - id: '_wordSelectDrag', - precondition: undefined - })); - CoreNavigationCommands.LastCursorWordSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditorCommand { - constructor() { - super({ - id: 'lastCursorWordSelect', - precondition: undefined - }); - } - runCoreEditorCommand(viewModel, args) { - const lastAddedCursorIndex = viewModel.getLastAddedCursorIndex(); - const states = viewModel.getCursorStates(); - const newStates = states.slice(0); - const lastAddedState = states[lastAddedCursorIndex]; - newStates[lastAddedCursorIndex] = _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].word(viewModel, lastAddedState, lastAddedState.modelState.hasSelection(), args.position); - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, newStates); - } - }); - class LineCommand extends CoreEditorCommand { - constructor(opts) { - super(opts); - this._inSelectionMode = opts.inSelectionMode; - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, [ - _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].line(viewModel, viewModel.getPrimaryCursorState(), this._inSelectionMode, args.position, args.viewPosition) - ]); - viewModel.revealPrimaryCursor(args.source, false); - } - } - CoreNavigationCommands.LineSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new LineCommand({ - inSelectionMode: false, - id: '_lineSelect', - precondition: undefined - })); - CoreNavigationCommands.LineSelectDrag = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new LineCommand({ - inSelectionMode: true, - id: '_lineSelectDrag', - precondition: undefined - })); - class LastCursorLineCommand extends CoreEditorCommand { - constructor(opts) { - super(opts); - this._inSelectionMode = opts.inSelectionMode; - } - runCoreEditorCommand(viewModel, args) { - const lastAddedCursorIndex = viewModel.getLastAddedCursorIndex(); - const states = viewModel.getCursorStates(); - const newStates = states.slice(0); - newStates[lastAddedCursorIndex] = _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].line(viewModel, states[lastAddedCursorIndex], this._inSelectionMode, args.position, args.viewPosition); - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, newStates); - } - } - CoreNavigationCommands.LastCursorLineSelect = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new LastCursorLineCommand({ - inSelectionMode: false, - id: 'lastCursorLineSelect', - precondition: undefined - })); - CoreNavigationCommands.LastCursorLineSelectDrag = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new LastCursorLineCommand({ - inSelectionMode: true, - id: 'lastCursorLineSelectDrag', - precondition: undefined - })); - CoreNavigationCommands.ExpandLineSelection = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditorCommand { - constructor() { - super({ - id: 'expandLineSelection', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 42 /* KEY_L */ - } - }); - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].expandLineSelection(viewModel, viewModel.getCursorStates())); - viewModel.revealPrimaryCursor(args.source, true); - } - }); - CoreNavigationCommands.CancelSelection = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditorCommand { - constructor() { - super({ - id: 'cancelSelection', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].hasNonEmptySelection, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 9 /* Escape */, - secondary: [1024 /* Shift */ | 9 /* Escape */] - } - }); - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, [ - _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].cancelSelection(viewModel, viewModel.getPrimaryCursorState()) - ]); - viewModel.revealPrimaryCursor(args.source, true); - } - }); - CoreNavigationCommands.RemoveSecondaryCursors = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditorCommand { - constructor() { - super({ - id: 'removeSecondaryCursors', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].hasMultipleSelections, - kbOpts: { - weight: CORE_WEIGHT + 1, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 9 /* Escape */, - secondary: [1024 /* Shift */ | 9 /* Escape */] - } - }); - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, [ - viewModel.getPrimaryCursorState() - ]); - viewModel.revealPrimaryCursor(args.source, true); - } - }); - CoreNavigationCommands.RevealLine = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditorCommand { - constructor() { - super({ - id: 'revealLine', - precondition: undefined, - description: RevealLine_.description - }); - } - runCoreEditorCommand(viewModel, args) { - const revealLineArg = args; - let lineNumber = (revealLineArg.lineNumber || 0) + 1; - if (lineNumber < 1) { - lineNumber = 1; - } - const lineCount = viewModel.model.getLineCount(); - if (lineNumber > lineCount) { - lineNumber = lineCount; - } - const range = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__["Range"](lineNumber, 1, lineNumber, viewModel.model.getLineMaxColumn(lineNumber)); - let revealAt = 0 /* Simple */; - if (revealLineArg.at) { - switch (revealLineArg.at) { - case RevealLine_.RawAtArgument.Top: - revealAt = 3 /* Top */; - break; - case RevealLine_.RawAtArgument.Center: - revealAt = 1 /* Center */; - break; - case RevealLine_.RawAtArgument.Bottom: - revealAt = 4 /* Bottom */; - break; - default: - break; - } - } - const viewRange = viewModel.coordinatesConverter.convertModelRangeToViewRange(range); - viewModel.revealRange(args.source, false, viewRange, revealAt, 0 /* Smooth */); - } - }); - CoreNavigationCommands.SelectAll = new class extends EditorOrNativeTextInputCommand { - constructor() { - super(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["SelectAllCommand"]); - } - runDOMCommand() { - document.execCommand('selectAll'); - } - runEditorCommand(accessor, editor, args) { - const viewModel = editor._getViewModel(); - if (!viewModel) { - // the editor has no view => has no cursors - return; - } - this.runCoreEditorCommand(viewModel, args); - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates('keyboard', 3 /* Explicit */, [ - _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_7__["CursorMoveCommands"].selectAll(viewModel, viewModel.getPrimaryCursorState()) - ]); - } - }(); - CoreNavigationCommands.SetSelection = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditorCommand { - constructor() { - super({ - id: 'setSelection', - precondition: undefined - }); - } - runCoreEditorCommand(viewModel, args) { - viewModel.model.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, [ - _common_controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["CursorState"].fromModelSelection(args.selection) - ]); - } - }); -})(CoreNavigationCommands || (CoreNavigationCommands = {})); -const columnSelectionCondition = _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].columnSelection); -function registerColumnSelection(id, keybinding) { - _platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_13__["KeybindingsRegistry"].registerKeybindingRule({ - id: id, - primary: keybinding, - when: columnSelectionCondition, - weight: CORE_WEIGHT + 1 - }); -} -registerColumnSelection(CoreNavigationCommands.CursorColumnSelectLeft.id, 1024 /* Shift */ | 15 /* LeftArrow */); -registerColumnSelection(CoreNavigationCommands.CursorColumnSelectRight.id, 1024 /* Shift */ | 17 /* RightArrow */); -registerColumnSelection(CoreNavigationCommands.CursorColumnSelectUp.id, 1024 /* Shift */ | 16 /* UpArrow */); -registerColumnSelection(CoreNavigationCommands.CursorColumnSelectPageUp.id, 1024 /* Shift */ | 11 /* PageUp */); -registerColumnSelection(CoreNavigationCommands.CursorColumnSelectDown.id, 1024 /* Shift */ | 18 /* DownArrow */); -registerColumnSelection(CoreNavigationCommands.CursorColumnSelectPageDown.id, 1024 /* Shift */ | 12 /* PageDown */); -function registerCommand(command) { - command.register(); - return command; -} -var CoreEditingCommands; -(function (CoreEditingCommands) { - class CoreEditingCommand extends _editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["EditorCommand"] { - runEditorCommand(accessor, editor, args) { - const viewModel = editor._getViewModel(); - if (!viewModel) { - // the editor has no view => has no cursors - return; - } - this.runCoreEditingCommand(editor, viewModel, args || {}); - } - } - CoreEditingCommands.CoreEditingCommand = CoreEditingCommand; - CoreEditingCommands.LineBreakInsert = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditingCommand { - constructor() { - super({ - id: 'lineBreakInsert', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 45 /* KEY_O */ } - } - }); - } - runCoreEditingCommand(editor, viewModel, args) { - editor.pushUndoStop(); - editor.executeCommands(this.id, _common_controller_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_8__["TypeOperations"].lineBreakInsert(viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection))); - } - }); - CoreEditingCommands.Outdent = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditingCommand { - constructor() { - super({ - id: 'outdent', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].editorTextFocus, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].tabDoesNotMoveFocus), - primary: 1024 /* Shift */ | 2 /* Tab */ - } - }); - } - runCoreEditingCommand(editor, viewModel, args) { - editor.pushUndoStop(); - editor.executeCommands(this.id, _common_controller_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_8__["TypeOperations"].outdent(viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection))); - editor.pushUndoStop(); - } - }); - CoreEditingCommands.Tab = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditingCommand { - constructor() { - super({ - id: 'tab', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].editorTextFocus, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].tabDoesNotMoveFocus), - primary: 2 /* Tab */ - } - }); - } - runCoreEditingCommand(editor, viewModel, args) { - editor.pushUndoStop(); - editor.executeCommands(this.id, _common_controller_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_8__["TypeOperations"].tab(viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection))); - editor.pushUndoStop(); - } - }); - CoreEditingCommands.DeleteLeft = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditingCommand { - constructor() { - super({ - id: 'deleteLeft', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 1 /* Backspace */, - secondary: [1024 /* Shift */ | 1 /* Backspace */], - mac: { primary: 1 /* Backspace */, secondary: [1024 /* Shift */ | 1 /* Backspace */, 256 /* WinCtrl */ | 38 /* KEY_H */, 256 /* WinCtrl */ | 1 /* Backspace */] } - } - }); - } - runCoreEditingCommand(editor, viewModel, args) { - const [shouldPushStackElementBefore, commands] = _common_controller_cursorDeleteOperations_js__WEBPACK_IMPORTED_MODULE_6__["DeleteOperations"].deleteLeft(viewModel.getPrevEditOperationType(), viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection)); - if (shouldPushStackElementBefore) { - editor.pushUndoStop(); - } - editor.executeCommands(this.id, commands); - viewModel.setPrevEditOperationType(2 /* DeletingLeft */); - } - }); - CoreEditingCommands.DeleteRight = Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new class extends CoreEditingCommand { - constructor() { - super({ - id: 'deleteRight', - precondition: undefined, - kbOpts: { - weight: CORE_WEIGHT, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 20 /* Delete */, - mac: { primary: 20 /* Delete */, secondary: [256 /* WinCtrl */ | 34 /* KEY_D */, 256 /* WinCtrl */ | 20 /* Delete */] } - } - }); - } - runCoreEditingCommand(editor, viewModel, args) { - const [shouldPushStackElementBefore, commands] = _common_controller_cursorDeleteOperations_js__WEBPACK_IMPORTED_MODULE_6__["DeleteOperations"].deleteRight(viewModel.getPrevEditOperationType(), viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection)); - if (shouldPushStackElementBefore) { - editor.pushUndoStop(); - } - editor.executeCommands(this.id, commands); - viewModel.setPrevEditOperationType(3 /* DeletingRight */); - } - }); - CoreEditingCommands.Undo = new class extends EditorOrNativeTextInputCommand { - constructor() { - super(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["UndoCommand"]); - } - runDOMCommand() { - document.execCommand('undo'); - } - runEditorCommand(accessor, editor, args) { - if (!editor.hasModel() || editor.getOption(72 /* readOnly */) === true) { - return; - } - editor.getModel().undo(); - } - }(); - CoreEditingCommands.Redo = new class extends EditorOrNativeTextInputCommand { - constructor() { - super(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["RedoCommand"]); - } - runDOMCommand() { - document.execCommand('redo'); - } - runEditorCommand(accessor, editor, args) { - if (!editor.hasModel() || editor.getOption(72 /* readOnly */) === true) { - return; - } - editor.getModel().redo(); - } - }(); -})(CoreEditingCommands || (CoreEditingCommands = {})); -/** - * A command that will invoke a command on the focused editor. - */ -class EditorHandlerCommand extends _editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["Command"] { - constructor(id, handlerId, description) { - super({ - id: id, - precondition: undefined, - description: description - }); - this._handlerId = handlerId; - } - runCommand(accessor, args) { - const editor = accessor.get(_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__["ICodeEditorService"]).getFocusedCodeEditor(); - if (!editor) { - return; - } - editor.trigger('keyboard', this._handlerId, args); - } -} -function registerOverwritableCommand(handlerId, description) { - registerCommand(new EditorHandlerCommand('default:' + handlerId, handlerId)); - registerCommand(new EditorHandlerCommand(handlerId, handlerId, description)); -} -registerOverwritableCommand("type" /* Type */, { - description: `Type`, - args: [{ - name: 'args', - schema: { - 'type': 'object', - 'required': ['text'], - 'properties': { - 'text': { - 'type': 'string' - } - }, - } - }] -}); -registerOverwritableCommand("replacePreviousChar" /* ReplacePreviousChar */); -registerOverwritableCommand("compositionStart" /* CompositionStart */); -registerOverwritableCommand("compositionEnd" /* CompositionEnd */); -registerOverwritableCommand("paste" /* Paste */); -registerOverwritableCommand("cut" /* Cut */); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseHandler.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseHandler.js ***! - \*************************************************************************************/ -/*! exports provided: createMouseMoveEventMerger, MouseHandler */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMouseMoveEventMerger", function() { return createMouseMoveEventMerger; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseHandler", function() { return MouseHandler; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_mouseEvent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _mouseTarget_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mouseTarget.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js"); -/* harmony import */ var _editorDom_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../editorDom.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorDom.js"); -/* harmony import */ var _common_config_editorZoom_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/config/editorZoom.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorZoom.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_viewModel_viewEventHandler_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/viewModel/viewEventHandler.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewEventHandler.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - -/** - * Merges mouse events when mouse move events are throttled - */ -function createMouseMoveEventMerger(mouseTargetFactory) { - return function (lastEvent, currentEvent) { - let targetIsWidget = false; - if (mouseTargetFactory) { - targetIsWidget = mouseTargetFactory.mouseTargetIsWidget(currentEvent); - } - if (!targetIsWidget) { - currentEvent.preventDefault(); - } - return currentEvent; - }; -} -class MouseHandler extends _common_viewModel_viewEventHandler_js__WEBPACK_IMPORTED_MODULE_10__["ViewEventHandler"] { - constructor(context, viewController, viewHelper) { - super(); - this._context = context; - this.viewController = viewController; - this.viewHelper = viewHelper; - this.mouseTargetFactory = new _mouseTarget_js__WEBPACK_IMPORTED_MODULE_5__["MouseTargetFactory"](this._context, viewHelper); - this._mouseDownOperation = this._register(new MouseDownOperation(this._context, this.viewController, this.viewHelper, (e, testEventTarget) => this._createMouseTarget(e, testEventTarget), (e) => this._getMouseColumn(e))); - this.lastMouseLeaveTime = -1; - const mouseEvents = new _editorDom_js__WEBPACK_IMPORTED_MODULE_6__["EditorMouseEventFactory"](this.viewHelper.viewDomNode); - this._register(mouseEvents.onContextMenu(this.viewHelper.viewDomNode, (e) => this._onContextMenu(e, true))); - this._register(mouseEvents.onMouseMoveThrottled(this.viewHelper.viewDomNode, (e) => this._onMouseMove(e), createMouseMoveEventMerger(this.mouseTargetFactory), MouseHandler.MOUSE_MOVE_MINIMUM_TIME)); - this._register(mouseEvents.onMouseUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e))); - this._register(mouseEvents.onMouseLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e))); - this._register(mouseEvents.onMouseDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e))); - const onMouseWheel = (browserEvent) => { - this.viewController.emitMouseWheel(browserEvent); - if (!this._context.configuration.options.get(59 /* mouseWheelZoom */)) { - return; - } - const e = new _base_browser_mouseEvent_js__WEBPACK_IMPORTED_MODULE_1__["StandardWheelEvent"](browserEvent); - if (e.browserEvent.ctrlKey || e.browserEvent.metaKey) { - const zoomLevel = _common_config_editorZoom_js__WEBPACK_IMPORTED_MODULE_7__["EditorZoom"].getZoomLevel(); - const delta = e.deltaY > 0 ? 1 : -1; - _common_config_editorZoom_js__WEBPACK_IMPORTED_MODULE_7__["EditorZoom"].setZoomLevel(zoomLevel + delta); - e.preventDefault(); - e.stopPropagation(); - } - }; - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](this.viewHelper.viewDomNode, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["EventType"].MOUSE_WHEEL, onMouseWheel, { capture: true, passive: false })); - this._context.addEventHandler(this); - } - dispose() { - this._context.removeEventHandler(this); - super.dispose(); - } - // --- begin event handlers - onCursorStateChanged(e) { - this._mouseDownOperation.onCursorStateChanged(e); - return false; - } - onFocusChanged(e) { - return false; - } - onScrollChanged(e) { - this._mouseDownOperation.onScrollChanged(); - return false; - } - // --- end event handlers - getTargetAtClientPoint(clientX, clientY) { - const clientPos = new _editorDom_js__WEBPACK_IMPORTED_MODULE_6__["ClientCoordinates"](clientX, clientY); - const pos = clientPos.toPageCoordinates(); - const editorPos = Object(_editorDom_js__WEBPACK_IMPORTED_MODULE_6__["createEditorPagePosition"])(this.viewHelper.viewDomNode); - if (pos.y < editorPos.y || pos.y > editorPos.y + editorPos.height || pos.x < editorPos.x || pos.x > editorPos.x + editorPos.width) { - return null; - } - return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), editorPos, pos, null); - } - _createMouseTarget(e, testEventTarget) { - return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), e.editorPos, e.pos, testEventTarget ? e.target : null); - } - _getMouseColumn(e) { - return this.mouseTargetFactory.getMouseColumn(e.editorPos, e.pos); - } - _onContextMenu(e, testEventTarget) { - this.viewController.emitContextMenu({ - event: e, - target: this._createMouseTarget(e, testEventTarget) - }); - } - _onMouseMove(e) { - if (this._mouseDownOperation.isActive()) { - // In selection/drag operation - return; - } - const actualMouseMoveTime = e.timestamp; - if (actualMouseMoveTime < this.lastMouseLeaveTime) { - // Due to throttling, this event occurred before the mouse left the editor, therefore ignore it. - return; - } - this.viewController.emitMouseMove({ - event: e, - target: this._createMouseTarget(e, true) - }); - } - _onMouseLeave(e) { - this.lastMouseLeaveTime = (new Date()).getTime(); - this.viewController.emitMouseLeave({ - event: e, - target: null - }); - } - _onMouseUp(e) { - this.viewController.emitMouseUp({ - event: e, - target: this._createMouseTarget(e, true) - }); - } - _onMouseDown(e) { - const t = this._createMouseTarget(e, true); - const targetIsContent = (t.type === 6 /* CONTENT_TEXT */ || t.type === 7 /* CONTENT_EMPTY */); - const targetIsGutter = (t.type === 2 /* GUTTER_GLYPH_MARGIN */ || t.type === 3 /* GUTTER_LINE_NUMBERS */ || t.type === 4 /* GUTTER_LINE_DECORATIONS */); - const targetIsLineNumbers = (t.type === 3 /* GUTTER_LINE_NUMBERS */); - const selectOnLineNumbers = this._context.configuration.options.get(90 /* selectOnLineNumbers */); - const targetIsViewZone = (t.type === 8 /* CONTENT_VIEW_ZONE */ || t.type === 5 /* GUTTER_VIEW_ZONE */); - const targetIsWidget = (t.type === 9 /* CONTENT_WIDGET */); - let shouldHandle = e.leftButton || e.middleButton; - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_4__["isMacintosh"] && e.leftButton && e.ctrlKey) { - shouldHandle = false; - } - const focus = () => { - e.preventDefault(); - this.viewHelper.focusTextArea(); - }; - if (shouldHandle && (targetIsContent || (targetIsLineNumbers && selectOnLineNumbers))) { - focus(); - this._mouseDownOperation.start(t.type, e); - } - else if (targetIsGutter) { - // Do not steal focus - e.preventDefault(); - } - else if (targetIsViewZone) { - const viewZoneData = t.detail; - if (this.viewHelper.shouldSuppressMouseDownOnViewZone(viewZoneData.viewZoneId)) { - focus(); - this._mouseDownOperation.start(t.type, e); - e.preventDefault(); - } - } - else if (targetIsWidget && this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)) { - focus(); - e.preventDefault(); - } - this.viewController.emitMouseDown({ - event: e, - target: t - }); - } -} -MouseHandler.MOUSE_MOVE_MINIMUM_TIME = 100; // ms -class MouseDownOperation extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(context, viewController, viewHelper, createMouseTarget, getMouseColumn) { - super(); - this._context = context; - this._viewController = viewController; - this._viewHelper = viewHelper; - this._createMouseTarget = createMouseTarget; - this._getMouseColumn = getMouseColumn; - this._mouseMoveMonitor = this._register(new _editorDom_js__WEBPACK_IMPORTED_MODULE_6__["GlobalEditorMouseMoveMonitor"](this._viewHelper.viewDomNode)); - this._onScrollTimeout = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["TimeoutTimer"]()); - this._mouseState = new MouseDownState(); - this._currentSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_9__["Selection"](1, 1, 1, 1); - this._isActive = false; - this._lastMouseEvent = null; - } - dispose() { - super.dispose(); - } - isActive() { - return this._isActive; - } - _onMouseDownThenMove(e) { - this._lastMouseEvent = e; - this._mouseState.setModifiers(e); - const position = this._findMousePosition(e, true); - if (!position) { - // Ignoring because position is unknown - return; - } - if (this._mouseState.isDragAndDrop) { - this._viewController.emitMouseDrag({ - event: e, - target: position - }); - } - else { - this._dispatchMouse(position, true); - } - } - start(targetType, e) { - this._lastMouseEvent = e; - this._mouseState.setStartedOnLineNumbers(targetType === 3 /* GUTTER_LINE_NUMBERS */); - this._mouseState.setStartButtons(e); - this._mouseState.setModifiers(e); - const position = this._findMousePosition(e, true); - if (!position || !position.position) { - // Ignoring because position is unknown - return; - } - this._mouseState.trySetCount(e.detail, position.position); - // Overwrite the detail of the MouseEvent, as it will be sent out in an event and contributions might rely on it. - e.detail = this._mouseState.count; - const options = this._context.configuration.options; - if (!options.get(72 /* readOnly */) - && options.get(25 /* dragAndDrop */) - && !options.get(13 /* columnSelection */) - && !this._mouseState.altKey // we don't support multiple mouse - && e.detail < 2 // only single click on a selection can work - && !this._isActive // the mouse is not down yet - && !this._currentSelection.isEmpty() // we don't drag single cursor - && (position.type === 6 /* CONTENT_TEXT */) // single click on text - && position.position && this._currentSelection.containsPosition(position.position) // single click on a selection - ) { - this._mouseState.isDragAndDrop = true; - this._isActive = true; - this._mouseMoveMonitor.startMonitoring(e.target, e.buttons, createMouseMoveEventMerger(null), (e) => this._onMouseDownThenMove(e), () => { - const position = this._findMousePosition(this._lastMouseEvent, true); - this._viewController.emitMouseDrop({ - event: this._lastMouseEvent, - target: (position ? this._createMouseTarget(this._lastMouseEvent, true) : null) // Ignoring because position is unknown, e.g., Content View Zone - }); - this._stop(); - }); - return; - } - this._mouseState.isDragAndDrop = false; - this._dispatchMouse(position, e.shiftKey); - if (!this._isActive) { - this._isActive = true; - this._mouseMoveMonitor.startMonitoring(e.target, e.buttons, createMouseMoveEventMerger(null), (e) => this._onMouseDownThenMove(e), () => this._stop()); - } - } - _stop() { - this._isActive = false; - this._onScrollTimeout.cancel(); - } - onScrollChanged() { - if (!this._isActive) { - return; - } - this._onScrollTimeout.setIfNotSet(() => { - if (!this._lastMouseEvent) { - return; - } - const position = this._findMousePosition(this._lastMouseEvent, false); - if (!position) { - // Ignoring because position is unknown - return; - } - if (this._mouseState.isDragAndDrop) { - // Ignoring because users are dragging the text - return; - } - this._dispatchMouse(position, true); - }, 10); - } - onCursorStateChanged(e) { - this._currentSelection = e.selections[0]; - } - _getPositionOutsideEditor(e) { - const editorContent = e.editorPos; - const model = this._context.model; - const viewLayout = this._context.viewLayout; - const mouseColumn = this._getMouseColumn(e); - if (e.posy < editorContent.y) { - const verticalOffset = Math.max(viewLayout.getCurrentScrollTop() - (editorContent.y - e.posy), 0); - const viewZoneData = _mouseTarget_js__WEBPACK_IMPORTED_MODULE_5__["HitTestContext"].getZoneAtCoord(this._context, verticalOffset); - if (viewZoneData) { - const newPosition = this._helpPositionJumpOverViewZone(viewZoneData); - if (newPosition) { - return new _mouseTarget_js__WEBPACK_IMPORTED_MODULE_5__["MouseTarget"](null, 13 /* OUTSIDE_EDITOR */, mouseColumn, newPosition); - } - } - const aboveLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset); - return new _mouseTarget_js__WEBPACK_IMPORTED_MODULE_5__["MouseTarget"](null, 13 /* OUTSIDE_EDITOR */, mouseColumn, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_8__["Position"](aboveLineNumber, 1)); - } - if (e.posy > editorContent.y + editorContent.height) { - const verticalOffset = viewLayout.getCurrentScrollTop() + (e.posy - editorContent.y); - const viewZoneData = _mouseTarget_js__WEBPACK_IMPORTED_MODULE_5__["HitTestContext"].getZoneAtCoord(this._context, verticalOffset); - if (viewZoneData) { - const newPosition = this._helpPositionJumpOverViewZone(viewZoneData); - if (newPosition) { - return new _mouseTarget_js__WEBPACK_IMPORTED_MODULE_5__["MouseTarget"](null, 13 /* OUTSIDE_EDITOR */, mouseColumn, newPosition); - } - } - const belowLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset); - return new _mouseTarget_js__WEBPACK_IMPORTED_MODULE_5__["MouseTarget"](null, 13 /* OUTSIDE_EDITOR */, mouseColumn, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_8__["Position"](belowLineNumber, model.getLineMaxColumn(belowLineNumber))); - } - const possibleLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getCurrentScrollTop() + (e.posy - editorContent.y)); - if (e.posx < editorContent.x) { - return new _mouseTarget_js__WEBPACK_IMPORTED_MODULE_5__["MouseTarget"](null, 13 /* OUTSIDE_EDITOR */, mouseColumn, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_8__["Position"](possibleLineNumber, 1)); - } - if (e.posx > editorContent.x + editorContent.width) { - return new _mouseTarget_js__WEBPACK_IMPORTED_MODULE_5__["MouseTarget"](null, 13 /* OUTSIDE_EDITOR */, mouseColumn, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_8__["Position"](possibleLineNumber, model.getLineMaxColumn(possibleLineNumber))); - } - return null; - } - _findMousePosition(e, testEventTarget) { - const positionOutsideEditor = this._getPositionOutsideEditor(e); - if (positionOutsideEditor) { - return positionOutsideEditor; - } - const t = this._createMouseTarget(e, testEventTarget); - const hintedPosition = t.position; - if (!hintedPosition) { - return null; - } - if (t.type === 8 /* CONTENT_VIEW_ZONE */ || t.type === 5 /* GUTTER_VIEW_ZONE */) { - const newPosition = this._helpPositionJumpOverViewZone(t.detail); - if (newPosition) { - return new _mouseTarget_js__WEBPACK_IMPORTED_MODULE_5__["MouseTarget"](t.element, t.type, t.mouseColumn, newPosition, null, t.detail); - } - } - return t; - } - _helpPositionJumpOverViewZone(viewZoneData) { - // Force position on view zones to go above or below depending on where selection started from - const selectionStart = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_8__["Position"](this._currentSelection.selectionStartLineNumber, this._currentSelection.selectionStartColumn); - const positionBefore = viewZoneData.positionBefore; - const positionAfter = viewZoneData.positionAfter; - if (positionBefore && positionAfter) { - if (positionBefore.isBefore(selectionStart)) { - return positionBefore; - } - else { - return positionAfter; - } - } - return null; - } - _dispatchMouse(position, inSelectionMode) { - if (!position.position) { - return; - } - this._viewController.dispatchMouse({ - position: position.position, - mouseColumn: position.mouseColumn, - startedOnLineNumbers: this._mouseState.startedOnLineNumbers, - inSelectionMode: inSelectionMode, - mouseDownCount: this._mouseState.count, - altKey: this._mouseState.altKey, - ctrlKey: this._mouseState.ctrlKey, - metaKey: this._mouseState.metaKey, - shiftKey: this._mouseState.shiftKey, - leftButton: this._mouseState.leftButton, - middleButton: this._mouseState.middleButton, - }); - } -} -class MouseDownState { - constructor() { - this._altKey = false; - this._ctrlKey = false; - this._metaKey = false; - this._shiftKey = false; - this._leftButton = false; - this._middleButton = false; - this._startedOnLineNumbers = false; - this._lastMouseDownPosition = null; - this._lastMouseDownPositionEqualCount = 0; - this._lastMouseDownCount = 0; - this._lastSetMouseDownCountTime = 0; - this.isDragAndDrop = false; - } - get altKey() { return this._altKey; } - get ctrlKey() { return this._ctrlKey; } - get metaKey() { return this._metaKey; } - get shiftKey() { return this._shiftKey; } - get leftButton() { return this._leftButton; } - get middleButton() { return this._middleButton; } - get startedOnLineNumbers() { return this._startedOnLineNumbers; } - get count() { - return this._lastMouseDownCount; - } - setModifiers(source) { - this._altKey = source.altKey; - this._ctrlKey = source.ctrlKey; - this._metaKey = source.metaKey; - this._shiftKey = source.shiftKey; - } - setStartButtons(source) { - this._leftButton = source.leftButton; - this._middleButton = source.middleButton; - } - setStartedOnLineNumbers(startedOnLineNumbers) { - this._startedOnLineNumbers = startedOnLineNumbers; - } - trySetCount(setMouseDownCount, newMouseDownPosition) { - // a. Invalidate multiple clicking if too much time has passed (will be hit by IE because the detail field of mouse events contains garbage in IE10) - const currentTime = (new Date()).getTime(); - if (currentTime - this._lastSetMouseDownCountTime > MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME) { - setMouseDownCount = 1; - } - this._lastSetMouseDownCountTime = currentTime; - // b. Ensure that we don't jump from single click to triple click in one go (will be hit by IE because the detail field of mouse events contains garbage in IE10) - if (setMouseDownCount > this._lastMouseDownCount + 1) { - setMouseDownCount = this._lastMouseDownCount + 1; - } - // c. Invalidate multiple clicking if the logical position is different - if (this._lastMouseDownPosition && this._lastMouseDownPosition.equals(newMouseDownPosition)) { - this._lastMouseDownPositionEqualCount++; - } - else { - this._lastMouseDownPositionEqualCount = 1; - } - this._lastMouseDownPosition = newMouseDownPosition; - // Finally set the lastMouseDownCount - this._lastMouseDownCount = Math.min(setMouseDownCount, this._lastMouseDownPositionEqualCount); - } -} -MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME = 400; // ms - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js ***! - \************************************************************************************/ -/*! exports provided: PointerHandlerLastRenderData, MouseTarget, HitTestContext, MouseTargetFactory, shadowCaretRangeFromPoint */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PointerHandlerLastRenderData", function() { return PointerHandlerLastRenderData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseTarget", function() { return MouseTarget; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HitTestContext", function() { return HitTestContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseTargetFactory", function() { return MouseTargetFactory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shadowCaretRangeFromPoint", function() { return shadowCaretRangeFromPoint; }); -/* harmony import */ var _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _editorDom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../editorDom.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorDom.js"); -/* harmony import */ var _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../view/viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/* harmony import */ var _viewParts_lines_viewLine_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../viewParts/lines/viewLine.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLine.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/controller/cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - -class PointerHandlerLastRenderData { - constructor(lastViewCursorsRenderData, lastTextareaPosition) { - this.lastViewCursorsRenderData = lastViewCursorsRenderData; - this.lastTextareaPosition = lastTextareaPosition; - } -} -class MouseTarget { - constructor(element, type, mouseColumn = 0, position = null, range = null, detail = null) { - this.element = element; - this.type = type; - this.mouseColumn = mouseColumn; - this.position = position; - if (!range && position) { - range = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](position.lineNumber, position.column, position.lineNumber, position.column); - } - this.range = range; - this.detail = detail; - } - static _typeToString(type) { - if (type === 1 /* TEXTAREA */) { - return 'TEXTAREA'; - } - if (type === 2 /* GUTTER_GLYPH_MARGIN */) { - return 'GUTTER_GLYPH_MARGIN'; - } - if (type === 3 /* GUTTER_LINE_NUMBERS */) { - return 'GUTTER_LINE_NUMBERS'; - } - if (type === 4 /* GUTTER_LINE_DECORATIONS */) { - return 'GUTTER_LINE_DECORATIONS'; - } - if (type === 5 /* GUTTER_VIEW_ZONE */) { - return 'GUTTER_VIEW_ZONE'; - } - if (type === 6 /* CONTENT_TEXT */) { - return 'CONTENT_TEXT'; - } - if (type === 7 /* CONTENT_EMPTY */) { - return 'CONTENT_EMPTY'; - } - if (type === 8 /* CONTENT_VIEW_ZONE */) { - return 'CONTENT_VIEW_ZONE'; - } - if (type === 9 /* CONTENT_WIDGET */) { - return 'CONTENT_WIDGET'; - } - if (type === 10 /* OVERVIEW_RULER */) { - return 'OVERVIEW_RULER'; - } - if (type === 11 /* SCROLLBAR */) { - return 'SCROLLBAR'; - } - if (type === 12 /* OVERLAY_WIDGET */) { - return 'OVERLAY_WIDGET'; - } - return 'UNKNOWN'; - } - static toString(target) { - return this._typeToString(target.type) + ': ' + target.position + ' - ' + target.range + ' - ' + target.detail; - } - toString() { - return MouseTarget.toString(this); - } -} -class ElementPath { - static isTextArea(path) { - return (path.length === 2 - && path[0] === 3 /* OverflowGuard */ - && path[1] === 6 /* TextArea */); - } - static isChildOfViewLines(path) { - return (path.length >= 4 - && path[0] === 3 /* OverflowGuard */ - && path[3] === 7 /* ViewLines */); - } - static isStrictChildOfViewLines(path) { - return (path.length > 4 - && path[0] === 3 /* OverflowGuard */ - && path[3] === 7 /* ViewLines */); - } - static isChildOfScrollableElement(path) { - return (path.length >= 2 - && path[0] === 3 /* OverflowGuard */ - && path[1] === 5 /* ScrollableElement */); - } - static isChildOfMinimap(path) { - return (path.length >= 2 - && path[0] === 3 /* OverflowGuard */ - && path[1] === 8 /* Minimap */); - } - static isChildOfContentWidgets(path) { - return (path.length >= 4 - && path[0] === 3 /* OverflowGuard */ - && path[3] === 1 /* ContentWidgets */); - } - static isChildOfOverflowingContentWidgets(path) { - return (path.length >= 1 - && path[0] === 2 /* OverflowingContentWidgets */); - } - static isChildOfOverlayWidgets(path) { - return (path.length >= 2 - && path[0] === 3 /* OverflowGuard */ - && path[1] === 4 /* OverlayWidgets */); - } -} -class HitTestContext { - constructor(context, viewHelper, lastRenderData) { - this.model = context.model; - const options = context.configuration.options; - this.layoutInfo = options.get(117 /* layoutInfo */); - this.viewDomNode = viewHelper.viewDomNode; - this.lineHeight = options.get(51 /* lineHeight */); - this.typicalHalfwidthCharacterWidth = options.get(36 /* fontInfo */).typicalHalfwidthCharacterWidth; - this.lastRenderData = lastRenderData; - this._context = context; - this._viewHelper = viewHelper; - } - getZoneAtCoord(mouseVerticalOffset) { - return HitTestContext.getZoneAtCoord(this._context, mouseVerticalOffset); - } - static getZoneAtCoord(context, mouseVerticalOffset) { - // The target is either a view zone or the empty space after the last view-line - const viewZoneWhitespace = context.viewLayout.getWhitespaceAtVerticalOffset(mouseVerticalOffset); - if (viewZoneWhitespace) { - let viewZoneMiddle = viewZoneWhitespace.verticalOffset + viewZoneWhitespace.height / 2, lineCount = context.model.getLineCount(), positionBefore = null, position, positionAfter = null; - if (viewZoneWhitespace.afterLineNumber !== lineCount) { - // There are more lines after this view zone - positionAfter = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](viewZoneWhitespace.afterLineNumber + 1, 1); - } - if (viewZoneWhitespace.afterLineNumber > 0) { - // There are more lines above this view zone - positionBefore = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](viewZoneWhitespace.afterLineNumber, context.model.getLineMaxColumn(viewZoneWhitespace.afterLineNumber)); - } - if (positionAfter === null) { - position = positionBefore; - } - else if (positionBefore === null) { - position = positionAfter; - } - else if (mouseVerticalOffset < viewZoneMiddle) { - position = positionBefore; - } - else { - position = positionAfter; - } - return { - viewZoneId: viewZoneWhitespace.id, - afterLineNumber: viewZoneWhitespace.afterLineNumber, - positionBefore: positionBefore, - positionAfter: positionAfter, - position: position - }; - } - return null; - } - getFullLineRangeAtCoord(mouseVerticalOffset) { - if (this._context.viewLayout.isAfterLines(mouseVerticalOffset)) { - // Below the last line - const lineNumber = this._context.model.getLineCount(); - const maxLineColumn = this._context.model.getLineMaxColumn(lineNumber); - return { - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](lineNumber, maxLineColumn, lineNumber, maxLineColumn), - isAfterLines: true - }; - } - const lineNumber = this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset); - const maxLineColumn = this._context.model.getLineMaxColumn(lineNumber); - return { - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](lineNumber, 1, lineNumber, maxLineColumn), - isAfterLines: false - }; - } - getLineNumberAtVerticalOffset(mouseVerticalOffset) { - return this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset); - } - isAfterLines(mouseVerticalOffset) { - return this._context.viewLayout.isAfterLines(mouseVerticalOffset); - } - getVerticalOffsetForLineNumber(lineNumber) { - return this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber); - } - findAttribute(element, attr) { - return HitTestContext._findAttribute(element, attr, this._viewHelper.viewDomNode); - } - static _findAttribute(element, attr, stopAt) { - while (element && element !== document.body) { - if (element.hasAttribute && element.hasAttribute(attr)) { - return element.getAttribute(attr); - } - if (element === stopAt) { - return null; - } - element = element.parentNode; - } - return null; - } - getLineWidth(lineNumber) { - return this._viewHelper.getLineWidth(lineNumber); - } - visibleRangeForPosition(lineNumber, column) { - return this._viewHelper.visibleRangeForPosition(lineNumber, column); - } - getPositionFromDOMInfo(spanNode, offset) { - return this._viewHelper.getPositionFromDOMInfo(spanNode, offset); - } - getCurrentScrollTop() { - return this._context.viewLayout.getCurrentScrollTop(); - } - getCurrentScrollLeft() { - return this._context.viewLayout.getCurrentScrollLeft(); - } -} -class BareHitTestRequest { - constructor(ctx, editorPos, pos) { - this.editorPos = editorPos; - this.pos = pos; - this.mouseVerticalOffset = Math.max(0, ctx.getCurrentScrollTop() + pos.y - editorPos.y); - this.mouseContentHorizontalOffset = ctx.getCurrentScrollLeft() + pos.x - editorPos.x - ctx.layoutInfo.contentLeft; - this.isInMarginArea = (pos.x - editorPos.x < ctx.layoutInfo.contentLeft && pos.x - editorPos.x >= ctx.layoutInfo.glyphMarginLeft); - this.isInContentArea = !this.isInMarginArea; - this.mouseColumn = Math.max(0, MouseTargetFactory._getMouseColumn(this.mouseContentHorizontalOffset, ctx.typicalHalfwidthCharacterWidth)); - } -} -class HitTestRequest extends BareHitTestRequest { - constructor(ctx, editorPos, pos, target) { - super(ctx, editorPos, pos); - this._ctx = ctx; - if (target) { - this.target = target; - this.targetPath = _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__["PartFingerprints"].collect(target, ctx.viewDomNode); - } - else { - this.target = null; - this.targetPath = new Uint8Array(0); - } - } - toString() { - return `pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target ? this.target.outerHTML : null}`; - } - fulfill(type, position = null, range = null, detail = null) { - let mouseColumn = this.mouseColumn; - if (position && position.column < this._ctx.model.getLineMaxColumn(position.lineNumber)) { - // Most likely, the line contains foreign decorations... - mouseColumn = _common_controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_6__["CursorColumns"].visibleColumnFromColumn(this._ctx.model.getLineContent(position.lineNumber), position.column, this._ctx.model.getTextModelOptions().tabSize) + 1; - } - return new MouseTarget(this.target, type, mouseColumn, position, range, detail); - } - withTarget(target) { - return new HitTestRequest(this._ctx, this.editorPos, this.pos, target); - } -} -const EMPTY_CONTENT_AFTER_LINES = { isAfterLines: true }; -function createEmptyContentDataInLines(horizontalDistanceToText) { - return { - isAfterLines: false, - horizontalDistanceToText: horizontalDistanceToText - }; -} -class MouseTargetFactory { - constructor(context, viewHelper) { - this._context = context; - this._viewHelper = viewHelper; - } - mouseTargetIsWidget(e) { - const t = e.target; - const path = _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__["PartFingerprints"].collect(t, this._viewHelper.viewDomNode); - // Is it a content widget? - if (ElementPath.isChildOfContentWidgets(path) || ElementPath.isChildOfOverflowingContentWidgets(path)) { - return true; - } - // Is it an overlay widget? - if (ElementPath.isChildOfOverlayWidgets(path)) { - return true; - } - return false; - } - createMouseTarget(lastRenderData, editorPos, pos, target) { - const ctx = new HitTestContext(this._context, this._viewHelper, lastRenderData); - const request = new HitTestRequest(ctx, editorPos, pos, target); - try { - const r = MouseTargetFactory._createMouseTarget(ctx, request, false); - // console.log(r.toString()); - return r; - } - catch (err) { - // console.log(err); - return request.fulfill(0 /* UNKNOWN */); - } - } - static _createMouseTarget(ctx, request, domHitTestExecuted) { - // console.log(`${domHitTestExecuted ? '=>' : ''}CAME IN REQUEST: ${request}`); - // First ensure the request has a target - if (request.target === null) { - if (domHitTestExecuted) { - // Still no target... and we have already executed hit test... - return request.fulfill(0 /* UNKNOWN */); - } - const hitTestResult = MouseTargetFactory._doHitTest(ctx, request); - if (hitTestResult.position) { - return MouseTargetFactory.createMouseTargetFromHitTestPosition(ctx, request, hitTestResult.position.lineNumber, hitTestResult.position.column); - } - return this._createMouseTarget(ctx, request.withTarget(hitTestResult.hitTarget), true); - } - // we know for a fact that request.target is not null - const resolvedRequest = request; - let result = null; - result = result || MouseTargetFactory._hitTestContentWidget(ctx, resolvedRequest); - result = result || MouseTargetFactory._hitTestOverlayWidget(ctx, resolvedRequest); - result = result || MouseTargetFactory._hitTestMinimap(ctx, resolvedRequest); - result = result || MouseTargetFactory._hitTestScrollbarSlider(ctx, resolvedRequest); - result = result || MouseTargetFactory._hitTestViewZone(ctx, resolvedRequest); - result = result || MouseTargetFactory._hitTestMargin(ctx, resolvedRequest); - result = result || MouseTargetFactory._hitTestViewCursor(ctx, resolvedRequest); - result = result || MouseTargetFactory._hitTestTextArea(ctx, resolvedRequest); - result = result || MouseTargetFactory._hitTestViewLines(ctx, resolvedRequest, domHitTestExecuted); - result = result || MouseTargetFactory._hitTestScrollbar(ctx, resolvedRequest); - return (result || request.fulfill(0 /* UNKNOWN */)); - } - static _hitTestContentWidget(ctx, request) { - // Is it a content widget? - if (ElementPath.isChildOfContentWidgets(request.targetPath) || ElementPath.isChildOfOverflowingContentWidgets(request.targetPath)) { - const widgetId = ctx.findAttribute(request.target, 'widgetId'); - if (widgetId) { - return request.fulfill(9 /* CONTENT_WIDGET */, null, null, widgetId); - } - else { - return request.fulfill(0 /* UNKNOWN */); - } - } - return null; - } - static _hitTestOverlayWidget(ctx, request) { - // Is it an overlay widget? - if (ElementPath.isChildOfOverlayWidgets(request.targetPath)) { - const widgetId = ctx.findAttribute(request.target, 'widgetId'); - if (widgetId) { - return request.fulfill(12 /* OVERLAY_WIDGET */, null, null, widgetId); - } - else { - return request.fulfill(0 /* UNKNOWN */); - } - } - return null; - } - static _hitTestViewCursor(ctx, request) { - if (request.target) { - // Check if we've hit a painted cursor - const lastViewCursorsRenderData = ctx.lastRenderData.lastViewCursorsRenderData; - for (const d of lastViewCursorsRenderData) { - if (request.target === d.domNode) { - return request.fulfill(6 /* CONTENT_TEXT */, d.position); - } - } - } - if (request.isInContentArea) { - // Edge has a bug when hit-testing the exact position of a cursor, - // instead of returning the correct dom node, it returns the - // first or last rendered view line dom node, therefore help it out - // and first check if we are on top of a cursor - const lastViewCursorsRenderData = ctx.lastRenderData.lastViewCursorsRenderData; - const mouseContentHorizontalOffset = request.mouseContentHorizontalOffset; - const mouseVerticalOffset = request.mouseVerticalOffset; - for (const d of lastViewCursorsRenderData) { - if (mouseContentHorizontalOffset < d.contentLeft) { - // mouse position is to the left of the cursor - continue; - } - if (mouseContentHorizontalOffset > d.contentLeft + d.width) { - // mouse position is to the right of the cursor - continue; - } - const cursorVerticalOffset = ctx.getVerticalOffsetForLineNumber(d.position.lineNumber); - if (cursorVerticalOffset <= mouseVerticalOffset - && mouseVerticalOffset <= cursorVerticalOffset + d.height) { - return request.fulfill(6 /* CONTENT_TEXT */, d.position); - } - } - } - return null; - } - static _hitTestViewZone(ctx, request) { - const viewZoneData = ctx.getZoneAtCoord(request.mouseVerticalOffset); - if (viewZoneData) { - const mouseTargetType = (request.isInContentArea ? 8 /* CONTENT_VIEW_ZONE */ : 5 /* GUTTER_VIEW_ZONE */); - return request.fulfill(mouseTargetType, viewZoneData.position, null, viewZoneData); - } - return null; - } - static _hitTestTextArea(ctx, request) { - // Is it the textarea? - if (ElementPath.isTextArea(request.targetPath)) { - if (ctx.lastRenderData.lastTextareaPosition) { - return request.fulfill(6 /* CONTENT_TEXT */, ctx.lastRenderData.lastTextareaPosition); - } - return request.fulfill(1 /* TEXTAREA */, ctx.lastRenderData.lastTextareaPosition); - } - return null; - } - static _hitTestMargin(ctx, request) { - if (request.isInMarginArea) { - const res = ctx.getFullLineRangeAtCoord(request.mouseVerticalOffset); - const pos = res.range.getStartPosition(); - let offset = Math.abs(request.pos.x - request.editorPos.x); - const detail = { - isAfterLines: res.isAfterLines, - glyphMarginLeft: ctx.layoutInfo.glyphMarginLeft, - glyphMarginWidth: ctx.layoutInfo.glyphMarginWidth, - lineNumbersWidth: ctx.layoutInfo.lineNumbersWidth, - offsetX: offset - }; - offset -= ctx.layoutInfo.glyphMarginLeft; - if (offset <= ctx.layoutInfo.glyphMarginWidth) { - // On the glyph margin - return request.fulfill(2 /* GUTTER_GLYPH_MARGIN */, pos, res.range, detail); - } - offset -= ctx.layoutInfo.glyphMarginWidth; - if (offset <= ctx.layoutInfo.lineNumbersWidth) { - // On the line numbers - return request.fulfill(3 /* GUTTER_LINE_NUMBERS */, pos, res.range, detail); - } - offset -= ctx.layoutInfo.lineNumbersWidth; - // On the line decorations - return request.fulfill(4 /* GUTTER_LINE_DECORATIONS */, pos, res.range, detail); - } - return null; - } - static _hitTestViewLines(ctx, request, domHitTestExecuted) { - if (!ElementPath.isChildOfViewLines(request.targetPath)) { - return null; - } - // Check if it is below any lines and any view zones - if (ctx.isAfterLines(request.mouseVerticalOffset)) { - // This most likely indicates it happened after the last view-line - const lineCount = ctx.model.getLineCount(); - const maxLineColumn = ctx.model.getLineMaxColumn(lineCount); - return request.fulfill(7 /* CONTENT_EMPTY */, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](lineCount, maxLineColumn), undefined, EMPTY_CONTENT_AFTER_LINES); - } - if (domHitTestExecuted) { - // Check if we are hitting a view-line (can happen in the case of inline decorations on empty lines) - // See https://github.com/Microsoft/vscode/issues/46942 - if (ElementPath.isStrictChildOfViewLines(request.targetPath)) { - const lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset); - if (ctx.model.getLineLength(lineNumber) === 0) { - const lineWidth = ctx.getLineWidth(lineNumber); - const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth); - return request.fulfill(7 /* CONTENT_EMPTY */, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](lineNumber, 1), undefined, detail); - } - const lineWidth = ctx.getLineWidth(lineNumber); - if (request.mouseContentHorizontalOffset >= lineWidth) { - const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth); - const pos = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](lineNumber, ctx.model.getLineMaxColumn(lineNumber)); - return request.fulfill(7 /* CONTENT_EMPTY */, pos, undefined, detail); - } - } - // We have already executed hit test... - return request.fulfill(0 /* UNKNOWN */); - } - const hitTestResult = MouseTargetFactory._doHitTest(ctx, request); - if (hitTestResult.position) { - return MouseTargetFactory.createMouseTargetFromHitTestPosition(ctx, request, hitTestResult.position.lineNumber, hitTestResult.position.column); - } - return this._createMouseTarget(ctx, request.withTarget(hitTestResult.hitTarget), true); - } - static _hitTestMinimap(ctx, request) { - if (ElementPath.isChildOfMinimap(request.targetPath)) { - const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset); - const maxColumn = ctx.model.getLineMaxColumn(possibleLineNumber); - return request.fulfill(11 /* SCROLLBAR */, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](possibleLineNumber, maxColumn)); - } - return null; - } - static _hitTestScrollbarSlider(ctx, request) { - if (ElementPath.isChildOfScrollableElement(request.targetPath)) { - if (request.target && request.target.nodeType === 1) { - const className = request.target.className; - if (className && /\b(slider|scrollbar)\b/.test(className)) { - const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset); - const maxColumn = ctx.model.getLineMaxColumn(possibleLineNumber); - return request.fulfill(11 /* SCROLLBAR */, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](possibleLineNumber, maxColumn)); - } - } - } - return null; - } - static _hitTestScrollbar(ctx, request) { - // Is it the overview ruler? - // Is it a child of the scrollable element? - if (ElementPath.isChildOfScrollableElement(request.targetPath)) { - const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset); - const maxColumn = ctx.model.getLineMaxColumn(possibleLineNumber); - return request.fulfill(11 /* SCROLLBAR */, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](possibleLineNumber, maxColumn)); - } - return null; - } - getMouseColumn(editorPos, pos) { - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - const mouseContentHorizontalOffset = this._context.viewLayout.getCurrentScrollLeft() + pos.x - editorPos.x - layoutInfo.contentLeft; - return MouseTargetFactory._getMouseColumn(mouseContentHorizontalOffset, options.get(36 /* fontInfo */).typicalHalfwidthCharacterWidth); - } - static _getMouseColumn(mouseContentHorizontalOffset, typicalHalfwidthCharacterWidth) { - if (mouseContentHorizontalOffset < 0) { - return 1; - } - const chars = Math.round(mouseContentHorizontalOffset / typicalHalfwidthCharacterWidth); - return (chars + 1); - } - static createMouseTargetFromHitTestPosition(ctx, request, lineNumber, column) { - const pos = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](lineNumber, column); - const lineWidth = ctx.getLineWidth(lineNumber); - if (request.mouseContentHorizontalOffset > lineWidth) { - if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isEdge"] && pos.column === 1) { - // See https://github.com/Microsoft/vscode/issues/10875 - const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth); - return request.fulfill(7 /* CONTENT_EMPTY */, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](lineNumber, ctx.model.getLineMaxColumn(lineNumber)), undefined, detail); - } - const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth); - return request.fulfill(7 /* CONTENT_EMPTY */, pos, undefined, detail); - } - const visibleRange = ctx.visibleRangeForPosition(lineNumber, column); - if (!visibleRange) { - return request.fulfill(0 /* UNKNOWN */, pos); - } - const columnHorizontalOffset = visibleRange.left; - if (request.mouseContentHorizontalOffset === columnHorizontalOffset) { - return request.fulfill(6 /* CONTENT_TEXT */, pos); - } - const points = []; - points.push({ offset: visibleRange.left, column: column }); - if (column > 1) { - const visibleRange = ctx.visibleRangeForPosition(lineNumber, column - 1); - if (visibleRange) { - points.push({ offset: visibleRange.left, column: column - 1 }); - } - } - const lineMaxColumn = ctx.model.getLineMaxColumn(lineNumber); - if (column < lineMaxColumn) { - const visibleRange = ctx.visibleRangeForPosition(lineNumber, column + 1); - if (visibleRange) { - points.push({ offset: visibleRange.left, column: column + 1 }); - } - } - points.sort((a, b) => a.offset - b.offset); - for (let i = 1; i < points.length; i++) { - const prev = points[i - 1]; - const curr = points[i]; - if (prev.offset <= request.mouseContentHorizontalOffset && request.mouseContentHorizontalOffset <= curr.offset) { - const rng = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](lineNumber, prev.column, lineNumber, curr.column); - return request.fulfill(6 /* CONTENT_TEXT */, pos, rng); - } - } - return request.fulfill(6 /* CONTENT_TEXT */, pos); - } - /** - * Most probably WebKit browsers and Edge - */ - static _doHitTestWithCaretRangeFromPoint(ctx, request) { - // In Chrome, especially on Linux it is possible to click between lines, - // so try to adjust the `hity` below so that it lands in the center of a line - const lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset); - const lineVerticalOffset = ctx.getVerticalOffsetForLineNumber(lineNumber); - const lineCenteredVerticalOffset = lineVerticalOffset + Math.floor(ctx.lineHeight / 2); - let adjustedPageY = request.pos.y + (lineCenteredVerticalOffset - request.mouseVerticalOffset); - if (adjustedPageY <= request.editorPos.y) { - adjustedPageY = request.editorPos.y + 1; - } - if (adjustedPageY >= request.editorPos.y + ctx.layoutInfo.height) { - adjustedPageY = request.editorPos.y + ctx.layoutInfo.height - 1; - } - const adjustedPage = new _editorDom_js__WEBPACK_IMPORTED_MODULE_1__["PageCoordinates"](request.pos.x, adjustedPageY); - const r = this._actualDoHitTestWithCaretRangeFromPoint(ctx, adjustedPage.toClientCoordinates()); - if (r.position) { - return r; - } - // Also try to hit test without the adjustment (for the edge cases that we are near the top or bottom) - return this._actualDoHitTestWithCaretRangeFromPoint(ctx, request.pos.toClientCoordinates()); - } - static _actualDoHitTestWithCaretRangeFromPoint(ctx, coords) { - const shadowRoot = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_7__["getShadowRoot"](ctx.viewDomNode); - let range; - if (shadowRoot) { - if (typeof shadowRoot.caretRangeFromPoint === 'undefined') { - range = shadowCaretRangeFromPoint(shadowRoot, coords.clientX, coords.clientY); - } - else { - range = shadowRoot.caretRangeFromPoint(coords.clientX, coords.clientY); - } - } - else { - range = document.caretRangeFromPoint(coords.clientX, coords.clientY); - } - if (!range || !range.startContainer) { - return { - position: null, - hitTarget: null - }; - } - // Chrome always hits a TEXT_NODE, while Edge sometimes hits a token span - const startContainer = range.startContainer; - let hitTarget = null; - if (startContainer.nodeType === startContainer.TEXT_NODE) { - // startContainer is expected to be the token text - const parent1 = startContainer.parentNode; // expected to be the token span - const parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line container span - const parent3 = parent2 ? parent2.parentNode : null; // expected to be the view line div - const parent3ClassName = parent3 && parent3.nodeType === parent3.ELEMENT_NODE ? parent3.className : null; - if (parent3ClassName === _viewParts_lines_viewLine_js__WEBPACK_IMPORTED_MODULE_3__["ViewLine"].CLASS_NAME) { - const p = ctx.getPositionFromDOMInfo(parent1, range.startOffset); - return { - position: p, - hitTarget: null - }; - } - else { - hitTarget = startContainer.parentNode; - } - } - else if (startContainer.nodeType === startContainer.ELEMENT_NODE) { - // startContainer is expected to be the token span - const parent1 = startContainer.parentNode; // expected to be the view line container span - const parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line div - const parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? parent2.className : null; - if (parent2ClassName === _viewParts_lines_viewLine_js__WEBPACK_IMPORTED_MODULE_3__["ViewLine"].CLASS_NAME) { - const p = ctx.getPositionFromDOMInfo(startContainer, startContainer.textContent.length); - return { - position: p, - hitTarget: null - }; - } - else { - hitTarget = startContainer; - } - } - return { - position: null, - hitTarget: hitTarget - }; - } - /** - * Most probably Gecko - */ - static _doHitTestWithCaretPositionFromPoint(ctx, coords) { - const hitResult = document.caretPositionFromPoint(coords.clientX, coords.clientY); - if (hitResult.offsetNode.nodeType === hitResult.offsetNode.TEXT_NODE) { - // offsetNode is expected to be the token text - const parent1 = hitResult.offsetNode.parentNode; // expected to be the token span - const parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line container span - const parent3 = parent2 ? parent2.parentNode : null; // expected to be the view line div - const parent3ClassName = parent3 && parent3.nodeType === parent3.ELEMENT_NODE ? parent3.className : null; - if (parent3ClassName === _viewParts_lines_viewLine_js__WEBPACK_IMPORTED_MODULE_3__["ViewLine"].CLASS_NAME) { - const p = ctx.getPositionFromDOMInfo(hitResult.offsetNode.parentNode, hitResult.offset); - return { - position: p, - hitTarget: null - }; - } - else { - return { - position: null, - hitTarget: hitResult.offsetNode.parentNode - }; - } - } - // For inline decorations, Gecko returns the `` of the line and the offset is the `` with the inline decoration - if (hitResult.offsetNode.nodeType === hitResult.offsetNode.ELEMENT_NODE) { - const parent1 = hitResult.offsetNode.parentNode; // expected to be the view line div - const parent1ClassName = parent1 && parent1.nodeType === parent1.ELEMENT_NODE ? parent1.className : null; - if (parent1ClassName === _viewParts_lines_viewLine_js__WEBPACK_IMPORTED_MODULE_3__["ViewLine"].CLASS_NAME) { - const tokenSpan = hitResult.offsetNode.childNodes[Math.min(hitResult.offset, hitResult.offsetNode.childNodes.length - 1)]; - if (tokenSpan) { - const p = ctx.getPositionFromDOMInfo(tokenSpan, 0); - return { - position: p, - hitTarget: null - }; - } - } - } - return { - position: null, - hitTarget: hitResult.offsetNode - }; - } - /** - * Most probably IE - */ - static _doHitTestWithMoveToPoint(ctx, coords) { - let resultPosition = null; - let resultHitTarget = null; - const textRange = document.body.createTextRange(); - try { - textRange.moveToPoint(coords.clientX, coords.clientY); - } - catch (err) { - return { - position: null, - hitTarget: null - }; - } - textRange.collapse(true); - // Now, let's do our best to figure out what we hit :) - const parentElement = textRange ? textRange.parentElement() : null; - const parent1 = parentElement ? parentElement.parentNode : null; - const parent2 = parent1 ? parent1.parentNode : null; - const parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? parent2.className : ''; - if (parent2ClassName === _viewParts_lines_viewLine_js__WEBPACK_IMPORTED_MODULE_3__["ViewLine"].CLASS_NAME) { - const rangeToContainEntireSpan = textRange.duplicate(); - rangeToContainEntireSpan.moveToElementText(parentElement); - rangeToContainEntireSpan.setEndPoint('EndToStart', textRange); - resultPosition = ctx.getPositionFromDOMInfo(parentElement, rangeToContainEntireSpan.text.length); - // Move range out of the span node, IE doesn't like having many ranges in - // the same spot and will act badly for lines containing dashes ('-') - rangeToContainEntireSpan.moveToElementText(ctx.viewDomNode); - } - else { - // Looks like we've hit the hover or something foreign - resultHitTarget = parentElement; - } - // Move range out of the span node, IE doesn't like having many ranges in - // the same spot and will act badly for lines containing dashes ('-') - textRange.moveToElementText(ctx.viewDomNode); - return { - position: resultPosition, - hitTarget: resultHitTarget - }; - } - static _doHitTest(ctx, request) { - // State of the art (18.10.2012): - // The spec says browsers should support document.caretPositionFromPoint, but nobody implemented it (http://dev.w3.org/csswg/cssom-view/) - // Gecko: - // - they tried to implement it once, but failed: https://bugzilla.mozilla.org/show_bug.cgi?id=654352 - // - however, they do give out rangeParent/rangeOffset properties on mouse events - // Webkit: - // - they have implemented a previous version of the spec which was using document.caretRangeFromPoint - // IE: - // - they have a proprietary method on ranges, moveToPoint: https://msdn.microsoft.com/en-us/library/ie/ms536632(v=vs.85).aspx - // 24.08.2016: Edge has added WebKit's document.caretRangeFromPoint, but it is quite buggy - // - when hit testing the cursor it returns the first or the last line in the viewport - // - it inconsistently hits text nodes or span nodes, while WebKit only hits text nodes - // - when toggling render whitespace on, and hit testing in the empty content after a line, it always hits offset 0 of the first span of the line - // Thank you browsers for making this so 'easy' :) - if (typeof document.caretRangeFromPoint === 'function') { - return this._doHitTestWithCaretRangeFromPoint(ctx, request); - } - else if (document.caretPositionFromPoint) { - return this._doHitTestWithCaretPositionFromPoint(ctx, request.pos.toClientCoordinates()); - } - else if (document.body.createTextRange) { - return this._doHitTestWithMoveToPoint(ctx, request.pos.toClientCoordinates()); - } - return { - position: null, - hitTarget: null - }; - } -} -function shadowCaretRangeFromPoint(shadowRoot, x, y) { - const range = document.createRange(); - // Get the element under the point - let el = shadowRoot.elementFromPoint(x, y); - if (el !== null) { - // Get the last child of the element until its firstChild is a text node - // This assumes that the pointer is on the right of the line, out of the tokens - // and that we want to get the offset of the last token of the line - while (el && el.firstChild && el.firstChild.nodeType !== el.firstChild.TEXT_NODE) { - el = el.lastChild; - } - // Grab its rect - const rect = el.getBoundingClientRect(); - // And its font - const font = window.getComputedStyle(el, null).getPropertyValue('font'); - // And also its txt content - const text = el.innerText; - // Position the pixel cursor at the left of the element - let pixelCursor = rect.left; - let offset = 0; - let step; - // If the point is on the right of the box put the cursor after the last character - if (x > rect.left + rect.width) { - offset = text.length; - } - else { - const charWidthReader = CharWidthReader.getInstance(); - // Goes through all the characters of the innerText, and checks if the x of the point - // belongs to the character. - for (let i = 0; i < text.length + 1; i++) { - // The step is half the width of the character - step = charWidthReader.getCharWidth(text.charAt(i), font) / 2; - // Move to the center of the character - pixelCursor += step; - // If the x of the point is smaller that the position of the cursor, the point is over that character - if (x < pixelCursor) { - offset = i; - break; - } - // Move between the current character and the next - pixelCursor += step; - } - } - // Creates a range with the text node of the element and set the offset found - range.setStart(el.firstChild, offset); - range.setEnd(el.firstChild, offset); - } - return range; -} -class CharWidthReader { - constructor() { - this._cache = {}; - this._canvas = document.createElement('canvas'); - } - static getInstance() { - if (!CharWidthReader._INSTANCE) { - CharWidthReader._INSTANCE = new CharWidthReader(); - } - return CharWidthReader._INSTANCE; - } - getCharWidth(char, font) { - const cacheKey = char + font; - if (this._cache[cacheKey]) { - return this._cache[cacheKey]; - } - const context = this._canvas.getContext('2d'); - context.font = font; - const metrics = context.measureText(char); - const width = metrics.width; - this._cache[cacheKey] = width; - return width; - } -} -CharWidthReader._INSTANCE = null; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/pointerHandler.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/controller/pointerHandler.js ***! - \***************************************************************************************/ -/*! exports provided: PointerEventHandler, PointerHandler */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PointerEventHandler", function() { return PointerEventHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PointerHandler", function() { return PointerHandler; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/touch.js */ "./node_modules/monaco-editor/esm/vs/base/browser/touch.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _mouseHandler_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mouseHandler.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseHandler.js"); -/* harmony import */ var _editorDom_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../editorDom.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorDom.js"); -/* harmony import */ var _base_browser_canIUse_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/browser/canIUse.js */ "./node_modules/monaco-editor/esm/vs/base/browser/canIUse.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -function gestureChangeEventMerger(lastEvent, currentEvent) { - const r = { - translationY: currentEvent.translationY, - translationX: currentEvent.translationX - }; - if (lastEvent) { - r.translationY += lastEvent.translationY; - r.translationX += lastEvent.translationX; - } - return r; -} -/** - * Basically Edge but should be modified to handle any pointerEnabled, even without support of MSGesture - */ -class StandardPointerHandler extends _mouseHandler_js__WEBPACK_IMPORTED_MODULE_4__["MouseHandler"] { - constructor(context, viewController, viewHelper) { - super(context, viewController, viewHelper); - this.viewHelper.linesContentDomNode.style.touchAction = 'none'; - // TODO@Alex -> this expects that the view is added in 100 ms, might not be the case - // This handler should be added when the dom node is in the dom tree - this._installGestureHandlerTimeout = window.setTimeout(() => { - this._installGestureHandlerTimeout = -1; - // TODO@Alex: replace the usage of MSGesture here with something that works across all browsers - if (window.MSGesture) { - const touchGesture = new MSGesture(); - const penGesture = new MSGesture(); - touchGesture.target = this.viewHelper.linesContentDomNode; - penGesture.target = this.viewHelper.linesContentDomNode; - this.viewHelper.linesContentDomNode.addEventListener('pointerdown', (e) => { - const pointerType = e.pointerType; - if (pointerType === 'mouse') { - this._lastPointerType = 'mouse'; - return; - } - else if (pointerType === 'touch') { - this._lastPointerType = 'touch'; - touchGesture.addPointer(e.pointerId); - } - else { - this._lastPointerType = 'pen'; - penGesture.addPointer(e.pointerId); - } - }); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableThrottledListener"](this.viewHelper.linesContentDomNode, 'MSGestureChange', (e) => this._onGestureChange(e), gestureChangeEventMerger)); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](this.viewHelper.linesContentDomNode, 'MSGestureTap', (e) => this._onCaptureGestureTap(e), true)); - } - }, 100); - this._lastPointerType = 'mouse'; - } - _onMouseDown(e) { - if (this._lastPointerType === 'mouse') { - super._onMouseDown(e); - } - } - _onCaptureGestureTap(rawEvent) { - const e = new _editorDom_js__WEBPACK_IMPORTED_MODULE_5__["EditorMouseEvent"](rawEvent, this.viewHelper.viewDomNode); - const t = this._createMouseTarget(e, false); - if (t.position) { - this.viewController.moveTo(t.position); - } - // IE does not want to focus when coming in from the browser's address bar - if (e.browserEvent.fromElement) { - e.preventDefault(); - this.viewHelper.focusTextArea(); - } - else { - // TODO@Alex -> cancel this is focus is lost - setTimeout(() => { - this.viewHelper.focusTextArea(); - }); - } - } - _onGestureChange(e) { - this._context.model.deltaScrollNow(-e.translationX, -e.translationY); - } - dispose() { - window.clearTimeout(this._installGestureHandlerTimeout); - super.dispose(); - } -} -/** - * Currently only tested on iOS 13/ iPadOS. - */ -class PointerEventHandler extends _mouseHandler_js__WEBPACK_IMPORTED_MODULE_4__["MouseHandler"] { - constructor(context, viewController, viewHelper) { - super(context, viewController, viewHelper); - this._register(_base_browser_touch_js__WEBPACK_IMPORTED_MODULE_2__["Gesture"].addTarget(this.viewHelper.linesContentDomNode)); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](this.viewHelper.linesContentDomNode, _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].Tap, (e) => this.onTap(e))); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](this.viewHelper.linesContentDomNode, _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].Change, (e) => this.onChange(e))); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](this.viewHelper.linesContentDomNode, _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].Contextmenu, (e) => this._onContextMenu(new _editorDom_js__WEBPACK_IMPORTED_MODULE_5__["EditorMouseEvent"](e, this.viewHelper.viewDomNode), false))); - this._lastPointerType = 'mouse'; - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](this.viewHelper.linesContentDomNode, 'pointerdown', (e) => { - const pointerType = e.pointerType; - if (pointerType === 'mouse') { - this._lastPointerType = 'mouse'; - return; - } - else if (pointerType === 'touch') { - this._lastPointerType = 'touch'; - } - else { - this._lastPointerType = 'pen'; - } - })); - // PonterEvents - const pointerEvents = new _editorDom_js__WEBPACK_IMPORTED_MODULE_5__["EditorPointerEventFactory"](this.viewHelper.viewDomNode); - this._register(pointerEvents.onPointerMoveThrottled(this.viewHelper.viewDomNode, (e) => this._onMouseMove(e), Object(_mouseHandler_js__WEBPACK_IMPORTED_MODULE_4__["createMouseMoveEventMerger"])(this.mouseTargetFactory), _mouseHandler_js__WEBPACK_IMPORTED_MODULE_4__["MouseHandler"].MOUSE_MOVE_MINIMUM_TIME)); - this._register(pointerEvents.onPointerUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e))); - this._register(pointerEvents.onPointerLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e))); - this._register(pointerEvents.onPointerDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e))); - } - onTap(event) { - if (!event.initialTarget || !this.viewHelper.linesContentDomNode.contains(event.initialTarget)) { - return; - } - event.preventDefault(); - this.viewHelper.focusTextArea(); - const target = this._createMouseTarget(new _editorDom_js__WEBPACK_IMPORTED_MODULE_5__["EditorMouseEvent"](event, this.viewHelper.viewDomNode), false); - if (target.position) { - // this.viewController.moveTo(target.position); - this.viewController.dispatchMouse({ - position: target.position, - mouseColumn: target.position.column, - startedOnLineNumbers: false, - mouseDownCount: event.tapCount, - inSelectionMode: false, - altKey: false, - ctrlKey: false, - metaKey: false, - shiftKey: false, - leftButton: false, - middleButton: false, - }); - } - } - onChange(e) { - if (this._lastPointerType === 'touch') { - this._context.model.deltaScrollNow(-e.translationX, -e.translationY); - } - } - _onMouseDown(e) { - if (e.target && this.viewHelper.linesContentDomNode.contains(e.target) && this._lastPointerType === 'touch') { - return; - } - super._onMouseDown(e); - } -} -class TouchHandler extends _mouseHandler_js__WEBPACK_IMPORTED_MODULE_4__["MouseHandler"] { - constructor(context, viewController, viewHelper) { - super(context, viewController, viewHelper); - this._register(_base_browser_touch_js__WEBPACK_IMPORTED_MODULE_2__["Gesture"].addTarget(this.viewHelper.linesContentDomNode)); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](this.viewHelper.linesContentDomNode, _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].Tap, (e) => this.onTap(e))); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](this.viewHelper.linesContentDomNode, _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].Change, (e) => this.onChange(e))); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](this.viewHelper.linesContentDomNode, _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].Contextmenu, (e) => this._onContextMenu(new _editorDom_js__WEBPACK_IMPORTED_MODULE_5__["EditorMouseEvent"](e, this.viewHelper.viewDomNode), false))); - } - onTap(event) { - event.preventDefault(); - this.viewHelper.focusTextArea(); - const target = this._createMouseTarget(new _editorDom_js__WEBPACK_IMPORTED_MODULE_5__["EditorMouseEvent"](event, this.viewHelper.viewDomNode), false); - if (target.position) { - this.viewController.moveTo(target.position); - } - } - onChange(e) { - this._context.model.deltaScrollNow(-e.translationX, -e.translationY); - } -} -class PointerHandler extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(context, viewController, viewHelper) { - super(); - if ((_base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isIOS"] && _base_browser_canIUse_js__WEBPACK_IMPORTED_MODULE_6__["BrowserFeatures"].pointerEvents)) { - this.handler = this._register(new PointerEventHandler(context, viewController, viewHelper)); - } - else if (window.TouchEvent) { - this.handler = this._register(new TouchHandler(context, viewController, viewHelper)); - } - else if (window.navigator.pointerEnabled || window.PointerEvent) { - this.handler = this._register(new StandardPointerHandler(context, viewController, viewHelper)); - } - else { - this.handler = this._register(new _mouseHandler_js__WEBPACK_IMPORTED_MODULE_4__["MouseHandler"](context, viewController, viewHelper)); - } - } - getTargetAtClientPoint(clientX, clientY) { - return this.handler.getTargetAtClientPoint(clientX, clientY); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaHandler.css": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaHandler.css ***! - \*****************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_textAreaHandler_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./textAreaHandler.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaHandler.css"); -/* harmony import */ var _css_loader_dist_cjs_js_textAreaHandler_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_textAreaHandler_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_textAreaHandler_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_textAreaHandler_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaHandler.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaHandler.js ***! - \****************************************************************************************/ -/*! exports provided: TextAreaHandler */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextAreaHandler", function() { return TextAreaHandler; }); -/* harmony import */ var _textAreaHandler_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./textAreaHandler.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaHandler.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _config_configuration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../config/configuration.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/config/configuration.js"); -/* harmony import */ var _textAreaInput_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./textAreaInput.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaInput.js"); -/* harmony import */ var _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./textAreaState.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaState.js"); -/* harmony import */ var _view_viewPart_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../view/viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/* harmony import */ var _viewParts_lineNumbers_lineNumbers_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../viewParts/lineNumbers/lineNumbers.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js"); -/* harmony import */ var _viewParts_margin_margin_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../viewParts/margin/margin.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/margin/margin.js"); -/* harmony import */ var _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../common/config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _common_controller_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../common/controller/wordCharacterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/wordCharacterClassifier.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _base_browser_ui_mouseCursor_mouseCursor_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../base/browser/ui/mouseCursor/mouseCursor.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - - -class VisibleTextAreaData { - constructor(top, left, width) { - this.top = top; - this.left = left; - this.width = width; - } - setWidth(width) { - return new VisibleTextAreaData(this.top, this.left, width); - } -} -const canUseZeroSizeTextarea = (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_2__["isEdge"] || _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_2__["isFirefox"]); -class TextAreaHandler extends _view_viewPart_js__WEBPACK_IMPORTED_MODULE_9__["ViewPart"] { - constructor(context, viewController, viewHelper) { - super(context); - // --- end view API - this._primaryCursorPosition = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_14__["Position"](1, 1); - this._primaryCursorVisibleRange = null; - this._viewController = viewController; - this._viewHelper = viewHelper; - this._scrollLeft = 0; - this._scrollTop = 0; - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._setAccessibilityOptions(options); - this._contentLeft = layoutInfo.contentLeft; - this._contentWidth = layoutInfo.contentWidth; - this._contentHeight = layoutInfo.height; - this._fontInfo = options.get(36 /* fontInfo */); - this._lineHeight = options.get(51 /* lineHeight */); - this._emptySelectionClipboard = options.get(26 /* emptySelectionClipboard */); - this._copyWithSyntaxHighlighting = options.get(16 /* copyWithSyntaxHighlighting */); - this._visibleTextArea = null; - this._selections = [new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_16__["Selection"](1, 1, 1, 1)]; - this._modelSelections = [new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_16__["Selection"](1, 1, 1, 1)]; - this._lastRenderPosition = null; - // Text Area (The focus will always be in the textarea when the cursor is blinking) - this.textArea = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_3__["createFastDomNode"])(document.createElement('textarea')); - _view_viewPart_js__WEBPACK_IMPORTED_MODULE_9__["PartFingerprints"].write(this.textArea, 6 /* TextArea */); - this.textArea.setClassName(`inputarea ${_base_browser_ui_mouseCursor_mouseCursor_js__WEBPACK_IMPORTED_MODULE_17__["MOUSE_CURSOR_TEXT_CSS_CLASS_NAME"]}`); - this.textArea.setAttribute('wrap', 'off'); - this.textArea.setAttribute('autocorrect', 'off'); - this.textArea.setAttribute('autocapitalize', 'off'); - this.textArea.setAttribute('autocomplete', 'off'); - this.textArea.setAttribute('spellcheck', 'false'); - this.textArea.setAttribute('aria-label', this._getAriaLabel(options)); - this.textArea.setAttribute('tabindex', String(options.get(102 /* tabIndex */))); - this.textArea.setAttribute('role', 'textbox'); - this.textArea.setAttribute('aria-roledescription', _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('editor', "editor")); - this.textArea.setAttribute('aria-multiline', 'true'); - this.textArea.setAttribute('aria-haspopup', 'false'); - this.textArea.setAttribute('aria-autocomplete', 'both'); - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_4__["isWeb"] && options.get(72 /* readOnly */)) { - this.textArea.setAttribute('readonly', 'true'); - } - this.textAreaCover = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_3__["createFastDomNode"])(document.createElement('div')); - this.textAreaCover.setPosition('absolute'); - const simpleModel = { - getLineCount: () => { - return this._context.model.getLineCount(); - }, - getLineMaxColumn: (lineNumber) => { - return this._context.model.getLineMaxColumn(lineNumber); - }, - getValueInRange: (range, eol) => { - return this._context.model.getValueInRange(range, eol); - } - }; - const textAreaInputHost = { - getDataToCopy: (generateHTML) => { - const rawTextToCopy = this._context.model.getPlainTextToCopy(this._modelSelections, this._emptySelectionClipboard, _base_common_platform_js__WEBPACK_IMPORTED_MODULE_4__["isWindows"]); - const newLineCharacter = this._context.model.getEOL(); - const isFromEmptySelection = (this._emptySelectionClipboard && this._modelSelections.length === 1 && this._modelSelections[0].isEmpty()); - const multicursorText = (Array.isArray(rawTextToCopy) ? rawTextToCopy : null); - const text = (Array.isArray(rawTextToCopy) ? rawTextToCopy.join(newLineCharacter) : rawTextToCopy); - let html = undefined; - let mode = null; - if (generateHTML) { - if (_textAreaInput_js__WEBPACK_IMPORTED_MODULE_7__["CopyOptions"].forceCopyWithSyntaxHighlighting || (this._copyWithSyntaxHighlighting && text.length < 65536)) { - const richText = this._context.model.getRichTextToCopy(this._modelSelections, this._emptySelectionClipboard); - if (richText) { - html = richText.html; - mode = richText.mode; - } - } - } - return { - isFromEmptySelection, - multicursorText, - text, - html, - mode - }; - }, - getScreenReaderContent: (currentState) => { - if (this._accessibilitySupport === 1 /* Disabled */) { - // We know for a fact that a screen reader is not attached - // On OSX, we write the character before the cursor to allow for "long-press" composition - // Also on OSX, we write the word before the cursor to allow for the Accessibility Keyboard to give good hints - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_4__["isMacintosh"]) { - const selection = this._selections[0]; - if (selection.isEmpty()) { - const position = selection.getStartPosition(); - let textBefore = this._getWordBeforePosition(position); - if (textBefore.length === 0) { - textBefore = this._getCharacterBeforePosition(position); - } - if (textBefore.length > 0) { - return new _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__["TextAreaState"](textBefore, textBefore.length, textBefore.length, position, position); - } - } - } - return _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__["TextAreaState"].EMPTY; - } - return _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__["PagedScreenReaderStrategy"].fromEditorSelection(currentState, simpleModel, this._selections[0], this._accessibilityPageSize, this._accessibilitySupport === 0 /* Unknown */); - }, - deduceModelPosition: (viewAnchorPosition, deltaOffset, lineFeedCnt) => { - return this._context.model.deduceModelPositionRelativeToViewPosition(viewAnchorPosition, deltaOffset, lineFeedCnt); - } - }; - this._textAreaInput = this._register(new _textAreaInput_js__WEBPACK_IMPORTED_MODULE_7__["TextAreaInput"](textAreaInputHost, this.textArea)); - this._register(this._textAreaInput.onKeyDown((e) => { - this._viewController.emitKeyDown(e); - })); - this._register(this._textAreaInput.onKeyUp((e) => { - this._viewController.emitKeyUp(e); - })); - this._register(this._textAreaInput.onPaste((e) => { - let pasteOnNewLine = false; - let multicursorText = null; - let mode = null; - if (e.metadata) { - pasteOnNewLine = (this._emptySelectionClipboard && !!e.metadata.isFromEmptySelection); - multicursorText = (typeof e.metadata.multicursorText !== 'undefined' ? e.metadata.multicursorText : null); - mode = e.metadata.mode; - } - this._viewController.paste(e.text, pasteOnNewLine, multicursorText, mode); - })); - this._register(this._textAreaInput.onCut(() => { - this._viewController.cut(); - })); - this._register(this._textAreaInput.onType((e) => { - if (e.replaceCharCnt) { - this._viewController.replacePreviousChar(e.text, e.replaceCharCnt); - } - else { - this._viewController.type(e.text); - } - })); - this._register(this._textAreaInput.onSelectionChangeRequest((modelSelection) => { - this._viewController.setSelection(modelSelection); - })); - this._register(this._textAreaInput.onCompositionStart((e) => { - const lineNumber = this._selections[0].startLineNumber; - const column = this._selections[0].startColumn - (e.moveOneCharacterLeft ? 1 : 0); - this._context.model.revealRange('keyboard', true, new _common_core_range_js__WEBPACK_IMPORTED_MODULE_15__["Range"](lineNumber, column, lineNumber, column), 0 /* Simple */, 1 /* Immediate */); - // Find range pixel position - const visibleRange = this._viewHelper.visibleRangeForPositionRelativeToEditor(lineNumber, column); - if (visibleRange) { - this._visibleTextArea = new VisibleTextAreaData(this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber), visibleRange.left, canUseZeroSizeTextarea ? 0 : 1); - this._render(); - } - // Show the textarea - this.textArea.setClassName(`inputarea ${_base_browser_ui_mouseCursor_mouseCursor_js__WEBPACK_IMPORTED_MODULE_17__["MOUSE_CURSOR_TEXT_CSS_CLASS_NAME"]} ime-input`); - this._viewController.compositionStart(); - })); - this._register(this._textAreaInput.onCompositionUpdate((e) => { - if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_2__["isEdge"]) { - // Due to isEdgeOrIE (where the textarea was not cleared initially) - // we cannot assume the text consists only of the composited text - this._visibleTextArea = this._visibleTextArea.setWidth(0); - } - else { - // adjust width by its size - this._visibleTextArea = this._visibleTextArea.setWidth(measureText(e.data, this._fontInfo)); - } - this._render(); - })); - this._register(this._textAreaInput.onCompositionEnd(() => { - this._visibleTextArea = null; - this._render(); - this.textArea.setClassName(`inputarea ${_base_browser_ui_mouseCursor_mouseCursor_js__WEBPACK_IMPORTED_MODULE_17__["MOUSE_CURSOR_TEXT_CSS_CLASS_NAME"]}`); - this._viewController.compositionEnd(); - })); - this._register(this._textAreaInput.onFocus(() => { - this._context.model.setHasFocus(true); - })); - this._register(this._textAreaInput.onBlur(() => { - this._context.model.setHasFocus(false); - })); - } - dispose() { - super.dispose(); - } - _getWordBeforePosition(position) { - const lineContent = this._context.model.getLineContent(position.lineNumber); - const wordSeparators = Object(_common_controller_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_13__["getMapForWordSeparators"])(this._context.configuration.options.get(105 /* wordSeparators */)); - let column = position.column; - let distance = 0; - while (column > 1) { - const charCode = lineContent.charCodeAt(column - 2); - const charClass = wordSeparators.get(charCode); - if (charClass !== 0 /* Regular */ || distance > 50) { - return lineContent.substring(column - 1, position.column - 1); - } - distance++; - column--; - } - return lineContent.substring(0, position.column - 1); - } - _getCharacterBeforePosition(position) { - if (position.column > 1) { - const lineContent = this._context.model.getLineContent(position.lineNumber); - const charBefore = lineContent.charAt(position.column - 2); - if (!_base_common_strings_js__WEBPACK_IMPORTED_MODULE_5__["isHighSurrogate"](charBefore.charCodeAt(0))) { - return charBefore; - } - } - return ''; - } - _getAriaLabel(options) { - const accessibilitySupport = options.get(2 /* accessibilitySupport */); - if (accessibilitySupport === 1 /* Disabled */) { - return _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('accessibilityOffAriaLabel', "The editor is not accessible at this time. Press {0} for options.", _base_common_platform_js__WEBPACK_IMPORTED_MODULE_4__["isLinux"] ? 'Shift+Alt+F1' : 'Alt+F1'); - } - return options.get(4 /* ariaLabel */); - } - _setAccessibilityOptions(options) { - this._accessibilitySupport = options.get(2 /* accessibilitySupport */); - const accessibilityPageSize = options.get(3 /* accessibilityPageSize */); - if (this._accessibilitySupport === 2 /* Enabled */ && accessibilityPageSize === _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_12__["EditorOptions"].accessibilityPageSize.defaultValue) { - // If a screen reader is attached and the default value is not set we shuold automatically increase the page size to 100 for a better experience - // If we put more than 100 lines the nvda can not handle this https://github.com/microsoft/vscode/issues/89717 - this._accessibilityPageSize = 100; - } - else { - this._accessibilityPageSize = accessibilityPageSize; - } - } - // --- begin event handlers - onConfigurationChanged(e) { - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._setAccessibilityOptions(options); - this._contentLeft = layoutInfo.contentLeft; - this._contentWidth = layoutInfo.contentWidth; - this._contentHeight = layoutInfo.height; - this._fontInfo = options.get(36 /* fontInfo */); - this._lineHeight = options.get(51 /* lineHeight */); - this._emptySelectionClipboard = options.get(26 /* emptySelectionClipboard */); - this._copyWithSyntaxHighlighting = options.get(16 /* copyWithSyntaxHighlighting */); - this.textArea.setAttribute('aria-label', this._getAriaLabel(options)); - this.textArea.setAttribute('tabindex', String(options.get(102 /* tabIndex */))); - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_4__["isWeb"] && e.hasChanged(72 /* readOnly */)) { - if (options.get(72 /* readOnly */)) { - this.textArea.setAttribute('readonly', 'true'); - } - else { - this.textArea.removeAttribute('readonly'); - } - } - if (e.hasChanged(2 /* accessibilitySupport */)) { - this._textAreaInput.writeScreenReaderContent('strategy changed'); - } - return true; - } - onCursorStateChanged(e) { - this._selections = e.selections.slice(0); - this._modelSelections = e.modelSelections.slice(0); - this._textAreaInput.writeScreenReaderContent('selection changed'); - return true; - } - onDecorationsChanged(e) { - // true for inline decorations that can end up relayouting text - return true; - } - onFlushed(e) { - return true; - } - onLinesChanged(e) { - return true; - } - onLinesDeleted(e) { - return true; - } - onLinesInserted(e) { - return true; - } - onScrollChanged(e) { - this._scrollLeft = e.scrollLeft; - this._scrollTop = e.scrollTop; - return true; - } - onZonesChanged(e) { - return true; - } - // --- end event handlers - // --- begin view API - isFocused() { - return this._textAreaInput.isFocused(); - } - focusTextArea() { - this._textAreaInput.focusTextArea(); - } - getLastRenderData() { - return this._lastRenderPosition; - } - setAriaOptions(options) { - if (options.activeDescendant) { - this.textArea.setAttribute('aria-haspopup', 'true'); - this.textArea.setAttribute('aria-autocomplete', 'list'); - this.textArea.setAttribute('aria-activedescendant', options.activeDescendant); - } - else { - this.textArea.setAttribute('aria-haspopup', 'false'); - this.textArea.setAttribute('aria-autocomplete', 'both'); - this.textArea.removeAttribute('aria-activedescendant'); - } - if (options.role) { - this.textArea.setAttribute('role', options.role); - } - } - prepareRender(ctx) { - this._primaryCursorPosition = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_14__["Position"](this._selections[0].positionLineNumber, this._selections[0].positionColumn); - this._primaryCursorVisibleRange = ctx.visibleRangeForPosition(this._primaryCursorPosition); - } - render(ctx) { - this._textAreaInput.writeScreenReaderContent('render'); - this._render(); - } - _render() { - if (this._visibleTextArea) { - // The text area is visible for composition reasons - this._renderInsideEditor(null, this._visibleTextArea.top - this._scrollTop, this._contentLeft + this._visibleTextArea.left - this._scrollLeft, this._visibleTextArea.width, this._lineHeight); - return; - } - if (!this._primaryCursorVisibleRange) { - // The primary cursor is outside the viewport => place textarea to the top left - this._renderAtTopLeft(); - return; - } - const left = this._contentLeft + this._primaryCursorVisibleRange.left - this._scrollLeft; - if (left < this._contentLeft || left > this._contentLeft + this._contentWidth) { - // cursor is outside the viewport - this._renderAtTopLeft(); - return; - } - const top = this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber) - this._scrollTop; - if (top < 0 || top > this._contentHeight) { - // cursor is outside the viewport - this._renderAtTopLeft(); - return; - } - // The primary cursor is in the viewport (at least vertically) => place textarea on the cursor - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_4__["isMacintosh"]) { - // For the popup emoji input, we will make the text area as high as the line height - // We will also make the fontSize and lineHeight the correct dimensions to help with the placement of these pickers - this._renderInsideEditor(this._primaryCursorPosition, top, left, canUseZeroSizeTextarea ? 0 : 1, this._lineHeight); - return; - } - this._renderInsideEditor(this._primaryCursorPosition, top, left, canUseZeroSizeTextarea ? 0 : 1, canUseZeroSizeTextarea ? 0 : 1); - } - _renderInsideEditor(renderedPosition, top, left, width, height) { - this._lastRenderPosition = renderedPosition; - const ta = this.textArea; - const tac = this.textAreaCover; - _config_configuration_js__WEBPACK_IMPORTED_MODULE_6__["Configuration"].applyFontInfo(ta, this._fontInfo); - ta.setTop(top); - ta.setLeft(left); - ta.setWidth(width); - ta.setHeight(height); - tac.setTop(0); - tac.setLeft(0); - tac.setWidth(0); - tac.setHeight(0); - } - _renderAtTopLeft() { - this._lastRenderPosition = null; - const ta = this.textArea; - const tac = this.textAreaCover; - _config_configuration_js__WEBPACK_IMPORTED_MODULE_6__["Configuration"].applyFontInfo(ta, this._fontInfo); - ta.setTop(0); - ta.setLeft(0); - tac.setTop(0); - tac.setLeft(0); - if (canUseZeroSizeTextarea) { - ta.setWidth(0); - ta.setHeight(0); - tac.setWidth(0); - tac.setHeight(0); - return; - } - // (in WebKit the textarea is 1px by 1px because it cannot handle input to a 0x0 textarea) - // specifically, when doing Korean IME, setting the textarea to 0x0 breaks IME badly. - ta.setWidth(1); - ta.setHeight(1); - tac.setWidth(1); - tac.setHeight(1); - const options = this._context.configuration.options; - if (options.get(42 /* glyphMargin */)) { - tac.setClassName('monaco-editor-background textAreaCover ' + _viewParts_margin_margin_js__WEBPACK_IMPORTED_MODULE_11__["Margin"].OUTER_CLASS_NAME); - } - else { - if (options.get(52 /* lineNumbers */).renderType !== 0 /* Off */) { - tac.setClassName('monaco-editor-background textAreaCover ' + _viewParts_lineNumbers_lineNumbers_js__WEBPACK_IMPORTED_MODULE_10__["LineNumbersOverlay"].CLASS_NAME); - } - else { - tac.setClassName('monaco-editor-background textAreaCover'); - } - } - } -} -function measureText(text, fontInfo) { - // adjust width by its size - const canvasElem = document.createElement('canvas'); - const context = canvasElem.getContext('2d'); - context.font = createFontString(fontInfo); - const metrics = context.measureText(text); - if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_2__["isFirefox"]) { - return metrics.width + 2; // +2 for Japanese... - } - else { - return metrics.width; - } -} -function createFontString(bareFontInfo) { - return doCreateFontString('normal', bareFontInfo.fontWeight, bareFontInfo.fontSize, bareFontInfo.lineHeight, bareFontInfo.fontFamily); -} -function doCreateFontString(fontStyle, fontWeight, fontSize, lineHeight, fontFamily) { - // The full font syntax is: - // style | variant | weight | stretch | size/line-height | fontFamily - // (https://developer.mozilla.org/en-US/docs/Web/CSS/font) - // But it appears Edge and IE11 cannot properly parse `stretch`. - return `${fontStyle} normal ${fontWeight} ${fontSize}px / ${lineHeight}px ${fontFamily}`; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaInput.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaInput.js ***! - \**************************************************************************************/ -/*! exports provided: CopyOptions, InMemoryClipboardMetadataManager, TextAreaInput */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CopyOptions", function() { return CopyOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InMemoryClipboardMetadataManager", function() { return InMemoryClipboardMetadataManager; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextAreaInput", function() { return TextAreaInput; }); -/* harmony import */ var _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _textAreaState_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./textAreaState.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaState.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _base_browser_canIUse_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/browser/canIUse.js */ "./node_modules/monaco-editor/esm/vs/base/browser/canIUse.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - -const CopyOptions = { - forceCopyWithSyntaxHighlighting: false -}; -/** - * Every time we write to the clipboard, we record a bit of extra metadata here. - * Every time we read from the cipboard, if the text matches our last written text, - * we can fetch the previous metadata. - */ -class InMemoryClipboardMetadataManager { - constructor() { - this._lastState = null; - } - set(lastCopiedValue, data) { - this._lastState = { lastCopiedValue, data }; - } - get(pastedText) { - if (this._lastState && this._lastState.lastCopiedValue === pastedText) { - // match! - return this._lastState.data; - } - this._lastState = null; - return null; - } -} -InMemoryClipboardMetadataManager.INSTANCE = new InMemoryClipboardMetadataManager(); -/** - * Writes screen reader content to the textarea and is able to analyze its input events to generate: - * - onCut - * - onPaste - * - onType - * - * Composition events are generated for presentation purposes (composition input is reflected in onType). - */ -class TextAreaInput extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["Disposable"] { - constructor(host, textArea) { - super(); - this.textArea = textArea; - this._onFocus = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this.onFocus = this._onFocus.event; - this._onBlur = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this.onBlur = this._onBlur.event; - this._onKeyDown = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this.onKeyDown = this._onKeyDown.event; - this._onKeyUp = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this.onKeyUp = this._onKeyUp.event; - this._onCut = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this.onCut = this._onCut.event; - this._onPaste = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this.onPaste = this._onPaste.event; - this._onType = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this.onType = this._onType.event; - this._onCompositionStart = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this.onCompositionStart = this._onCompositionStart.event; - this._onCompositionUpdate = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this.onCompositionUpdate = this._onCompositionUpdate.event; - this._onCompositionEnd = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this.onCompositionEnd = this._onCompositionEnd.event; - this._onSelectionChangeRequest = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this.onSelectionChangeRequest = this._onSelectionChangeRequest.event; - this._host = host; - this._textArea = this._register(new TextAreaWrapper(textArea)); - this._asyncTriggerCut = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["RunOnceScheduler"](() => this._onCut.fire(), 0)); - this._textAreaState = _textAreaState_js__WEBPACK_IMPORTED_MODULE_7__["TextAreaState"].EMPTY; - this._selectionChangeListener = null; - this.writeScreenReaderContent('ctor'); - this._hasFocus = false; - this._isDoingComposition = false; - this._nextCommand = 0 /* Type */; - let lastKeyDown = null; - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](textArea.domNode, 'keydown', (e) => { - if (e.keyCode === 109 /* KEY_IN_COMPOSITION */ - || (this._isDoingComposition && e.keyCode === 1 /* Backspace */)) { - // Stop propagation for keyDown events if the IME is processing key input - e.stopPropagation(); - } - if (e.equals(9 /* Escape */)) { - // Prevent default always for `Esc`, otherwise it will generate a keypress - // See https://msdn.microsoft.com/en-us/library/ie/ms536939(v=vs.85).aspx - e.preventDefault(); - } - lastKeyDown = e; - this._onKeyDown.fire(e); - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](textArea.domNode, 'keyup', (e) => { - this._onKeyUp.fire(e); - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](textArea.domNode, 'compositionstart', (e) => { - if (this._isDoingComposition) { - return; - } - this._isDoingComposition = true; - let moveOneCharacterLeft = false; - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_5__["isMacintosh"] - && lastKeyDown - && lastKeyDown.equals(109 /* KEY_IN_COMPOSITION */) - && this._textAreaState.selectionStart === this._textAreaState.selectionEnd - && this._textAreaState.selectionStart > 0 - && this._textAreaState.value.substr(this._textAreaState.selectionStart - 1, 1) === e.data) { - // Handling long press case on macOS + arrow key => pretend the character was selected - if (lastKeyDown.code === 'ArrowRight' || lastKeyDown.code === 'ArrowLeft') { - moveOneCharacterLeft = true; - } - } - if (moveOneCharacterLeft) { - this._textAreaState = new _textAreaState_js__WEBPACK_IMPORTED_MODULE_7__["TextAreaState"](this._textAreaState.value, this._textAreaState.selectionStart - 1, this._textAreaState.selectionEnd, this._textAreaState.selectionStartPosition ? new _common_core_position_js__WEBPACK_IMPORTED_MODULE_8__["Position"](this._textAreaState.selectionStartPosition.lineNumber, this._textAreaState.selectionStartPosition.column - 1) : null, this._textAreaState.selectionEndPosition); - } - else if (!_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isEdge"]) { - // In IE we cannot set .value when handling 'compositionstart' because the entire composition will get canceled. - this._setAndWriteTextAreaState('compositionstart', _textAreaState_js__WEBPACK_IMPORTED_MODULE_7__["TextAreaState"].EMPTY); - } - this._onCompositionStart.fire({ moveOneCharacterLeft }); - })); - /** - * Deduce the typed input from a text area's value and the last observed state. - */ - const deduceInputFromTextAreaValue = (couldBeEmojiInput) => { - const oldState = this._textAreaState; - const newState = _textAreaState_js__WEBPACK_IMPORTED_MODULE_7__["TextAreaState"].readFromTextArea(this._textArea); - return [newState, _textAreaState_js__WEBPACK_IMPORTED_MODULE_7__["TextAreaState"].deduceInput(oldState, newState, couldBeEmojiInput)]; - }; - /** - * Deduce the composition input from a string. - */ - const deduceComposition = (text) => { - const oldState = this._textAreaState; - const newState = _textAreaState_js__WEBPACK_IMPORTED_MODULE_7__["TextAreaState"].selectedText(text); - const typeInput = { - text: newState.value, - replaceCharCnt: oldState.selectionEnd - oldState.selectionStart - }; - return [newState, typeInput]; - }; - const compositionDataInValid = (locale) => { - // https://github.com/Microsoft/monaco-editor/issues/339 - // Multi-part Japanese compositions reset cursor in Edge/IE, Chinese and Korean IME don't have this issue. - // The reason that we can't use this path for all CJK IME is IE and Edge behave differently when handling Korean IME, - // which breaks this path of code. - if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isEdge"] && locale === 'ja') { - return true; - } - return false; - }; - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](textArea.domNode, 'compositionupdate', (e) => { - if (compositionDataInValid(e.locale)) { - const [newState, typeInput] = deduceInputFromTextAreaValue(/*couldBeEmojiInput*/ false); - this._textAreaState = newState; - this._onType.fire(typeInput); - this._onCompositionUpdate.fire(e); - return; - } - const [newState, typeInput] = deduceComposition(e.data || ''); - this._textAreaState = newState; - this._onType.fire(typeInput); - this._onCompositionUpdate.fire(e); - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](textArea.domNode, 'compositionend', (e) => { - // https://github.com/microsoft/monaco-editor/issues/1663 - // On iOS 13.2, Chinese system IME randomly trigger an additional compositionend event with empty data - if (!this._isDoingComposition) { - return; - } - if (compositionDataInValid(e.locale)) { - // https://github.com/Microsoft/monaco-editor/issues/339 - const [newState, typeInput] = deduceInputFromTextAreaValue(/*couldBeEmojiInput*/ false); - this._textAreaState = newState; - this._onType.fire(typeInput); - } - else { - const [newState, typeInput] = deduceComposition(e.data || ''); - this._textAreaState = newState; - this._onType.fire(typeInput); - } - // Due to isEdgeOrIE (where the textarea was not cleared initially) and isChrome (the textarea is not updated correctly when composition ends) - // we cannot assume the text at the end consists only of the composited text - if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isEdge"] || _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isChrome"]) { - this._textAreaState = _textAreaState_js__WEBPACK_IMPORTED_MODULE_7__["TextAreaState"].readFromTextArea(this._textArea); - } - if (!this._isDoingComposition) { - return; - } - this._isDoingComposition = false; - this._onCompositionEnd.fire(); - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](textArea.domNode, 'input', () => { - // Pretend here we touched the text area, as the `input` event will most likely - // result in a `selectionchange` event which we want to ignore - this._textArea.setIgnoreSelectionChangeTime('received input event'); - if (this._isDoingComposition) { - return; - } - const [newState, typeInput] = deduceInputFromTextAreaValue(/*couldBeEmojiInput*/ _base_common_platform_js__WEBPACK_IMPORTED_MODULE_5__["isMacintosh"]); - if (typeInput.replaceCharCnt === 0 && typeInput.text.length === 1 && _base_common_strings_js__WEBPACK_IMPORTED_MODULE_6__["isHighSurrogate"](typeInput.text.charCodeAt(0))) { - // Ignore invalid input but keep it around for next time - return; - } - this._textAreaState = newState; - if (this._nextCommand === 0 /* Type */) { - if (typeInput.text !== '') { - this._onType.fire(typeInput); - } - } - else { - if (typeInput.text !== '' || typeInput.replaceCharCnt !== 0) { - this._firePaste(typeInput.text, null); - } - this._nextCommand = 0 /* Type */; - } - })); - // --- Clipboard operations - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](textArea.domNode, 'cut', (e) => { - // Pretend here we touched the text area, as the `cut` event will most likely - // result in a `selectionchange` event which we want to ignore - this._textArea.setIgnoreSelectionChangeTime('received cut event'); - this._ensureClipboardGetsEditorSelection(e); - this._asyncTriggerCut.schedule(); - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](textArea.domNode, 'copy', (e) => { - this._ensureClipboardGetsEditorSelection(e); - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](textArea.domNode, 'paste', (e) => { - // Pretend here we touched the text area, as the `paste` event will most likely - // result in a `selectionchange` event which we want to ignore - this._textArea.setIgnoreSelectionChangeTime('received paste event'); - if (ClipboardEventUtils.canUseTextData(e)) { - const [pastePlainText, metadata] = ClipboardEventUtils.getTextData(e); - if (pastePlainText !== '') { - this._firePaste(pastePlainText, metadata); - } - } - else { - if (this._textArea.getSelectionStart() !== this._textArea.getSelectionEnd()) { - // Clean up the textarea, to get a clean paste - this._setAndWriteTextAreaState('paste', _textAreaState_js__WEBPACK_IMPORTED_MODULE_7__["TextAreaState"].EMPTY); - } - this._nextCommand = 1 /* Paste */; - } - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](textArea.domNode, 'focus', () => { - this._setHasFocus(true); - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](textArea.domNode, 'blur', () => { - this._setHasFocus(false); - })); - } - _installSelectionChangeListener() { - // See https://github.com/Microsoft/vscode/issues/27216 and https://github.com/microsoft/vscode/issues/98256 - // When using a Braille display, it is possible for users to reposition the - // system caret. This is reflected in Chrome as a `selectionchange` event. - // - // The `selectionchange` event appears to be emitted under numerous other circumstances, - // so it is quite a challenge to distinguish a `selectionchange` coming in from a user - // using a Braille display from all the other cases. - // - // The problems with the `selectionchange` event are: - // * the event is emitted when the textarea is focused programmatically -- textarea.focus() - // * the event is emitted when the selection is changed in the textarea programmatically -- textarea.setSelectionRange(...) - // * the event is emitted when the value of the textarea is changed programmatically -- textarea.value = '...' - // * the event is emitted when tabbing into the textarea - // * the event is emitted asynchronously (sometimes with a delay as high as a few tens of ms) - // * the event sometimes comes in bursts for a single logical textarea operation - // `selectionchange` events often come multiple times for a single logical change - // so throttle multiple `selectionchange` events that burst in a short period of time. - let previousSelectionChangeEventTime = 0; - return _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](document, 'selectionchange', (e) => { - if (!this._hasFocus) { - return; - } - if (this._isDoingComposition) { - return; - } - if (!_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isChrome"]) { - // Support only for Chrome until testing happens on other browsers - return; - } - const now = Date.now(); - const delta1 = now - previousSelectionChangeEventTime; - previousSelectionChangeEventTime = now; - if (delta1 < 5) { - // received another `selectionchange` event within 5ms of the previous `selectionchange` event - // => ignore it - return; - } - const delta2 = now - this._textArea.getIgnoreSelectionChangeTime(); - this._textArea.resetSelectionChangeTime(); - if (delta2 < 100) { - // received a `selectionchange` event within 100ms since we touched the textarea - // => ignore it, since we caused it - return; - } - if (!this._textAreaState.selectionStartPosition || !this._textAreaState.selectionEndPosition) { - // Cannot correlate a position in the textarea with a position in the editor... - return; - } - const newValue = this._textArea.getValue(); - if (this._textAreaState.value !== newValue) { - // Cannot correlate a position in the textarea with a position in the editor... - return; - } - const newSelectionStart = this._textArea.getSelectionStart(); - const newSelectionEnd = this._textArea.getSelectionEnd(); - if (this._textAreaState.selectionStart === newSelectionStart && this._textAreaState.selectionEnd === newSelectionEnd) { - // Nothing to do... - return; - } - const _newSelectionStartPosition = this._textAreaState.deduceEditorPosition(newSelectionStart); - const newSelectionStartPosition = this._host.deduceModelPosition(_newSelectionStartPosition[0], _newSelectionStartPosition[1], _newSelectionStartPosition[2]); - const _newSelectionEndPosition = this._textAreaState.deduceEditorPosition(newSelectionEnd); - const newSelectionEndPosition = this._host.deduceModelPosition(_newSelectionEndPosition[0], _newSelectionEndPosition[1], _newSelectionEndPosition[2]); - const newSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_9__["Selection"](newSelectionStartPosition.lineNumber, newSelectionStartPosition.column, newSelectionEndPosition.lineNumber, newSelectionEndPosition.column); - this._onSelectionChangeRequest.fire(newSelection); - }); - } - dispose() { - super.dispose(); - if (this._selectionChangeListener) { - this._selectionChangeListener.dispose(); - this._selectionChangeListener = null; - } - } - focusTextArea() { - // Setting this._hasFocus and writing the screen reader content - // will result in a focus() and setSelectionRange() in the textarea - this._setHasFocus(true); - // If the editor is off DOM, focus cannot be really set, so let's double check that we have managed to set the focus - this.refreshFocusState(); - } - isFocused() { - return this._hasFocus; - } - refreshFocusState() { - const shadowRoot = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["getShadowRoot"](this.textArea.domNode); - if (shadowRoot) { - this._setHasFocus(shadowRoot.activeElement === this.textArea.domNode); - } - else if (_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["isInDOM"](this.textArea.domNode)) { - this._setHasFocus(document.activeElement === this.textArea.domNode); - } - else { - this._setHasFocus(false); - } - } - _setHasFocus(newHasFocus) { - if (this._hasFocus === newHasFocus) { - // no change - return; - } - this._hasFocus = newHasFocus; - if (this._selectionChangeListener) { - this._selectionChangeListener.dispose(); - this._selectionChangeListener = null; - } - if (this._hasFocus) { - this._selectionChangeListener = this._installSelectionChangeListener(); - } - if (this._hasFocus) { - if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isEdge"]) { - // Edge has a bug where setting the selection range while the focus event - // is dispatching doesn't work. To reproduce, "tab into" the editor. - this._setAndWriteTextAreaState('focusgain', _textAreaState_js__WEBPACK_IMPORTED_MODULE_7__["TextAreaState"].EMPTY); - } - else { - this.writeScreenReaderContent('focusgain'); - } - } - if (this._hasFocus) { - this._onFocus.fire(); - } - else { - this._onBlur.fire(); - } - } - _setAndWriteTextAreaState(reason, textAreaState) { - if (!this._hasFocus) { - textAreaState = textAreaState.collapseSelection(); - } - textAreaState.writeToTextArea(reason, this._textArea, this._hasFocus); - this._textAreaState = textAreaState; - } - writeScreenReaderContent(reason) { - if (this._isDoingComposition) { - // Do not write to the text area when doing composition - return; - } - this._setAndWriteTextAreaState(reason, this._host.getScreenReaderContent(this._textAreaState)); - } - _ensureClipboardGetsEditorSelection(e) { - const dataToCopy = this._host.getDataToCopy(ClipboardEventUtils.canUseTextData(e) && _base_browser_canIUse_js__WEBPACK_IMPORTED_MODULE_10__["BrowserFeatures"].clipboard.richText); - const storedMetadata = { - version: 1, - isFromEmptySelection: dataToCopy.isFromEmptySelection, - multicursorText: dataToCopy.multicursorText, - mode: dataToCopy.mode - }; - InMemoryClipboardMetadataManager.INSTANCE.set( - // When writing "LINE\r\n" to the clipboard and then pasting, - // Firefox pastes "LINE\n", so let's work around this quirk - (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isFirefox"] ? dataToCopy.text.replace(/\r\n/g, '\n') : dataToCopy.text), storedMetadata); - if (!ClipboardEventUtils.canUseTextData(e)) { - // Looks like an old browser. The strategy is to place the text - // we'd like to be copied to the clipboard in the textarea and select it. - this._setAndWriteTextAreaState('copy or cut', _textAreaState_js__WEBPACK_IMPORTED_MODULE_7__["TextAreaState"].selectedText(dataToCopy.text)); - return; - } - ClipboardEventUtils.setTextData(e, dataToCopy.text, dataToCopy.html, storedMetadata); - } - _firePaste(text, metadata) { - if (!metadata) { - // try the in-memory store - metadata = InMemoryClipboardMetadataManager.INSTANCE.get(text); - } - this._onPaste.fire({ - text: text, - metadata: metadata - }); - } -} -class ClipboardEventUtils { - static canUseTextData(e) { - if (e.clipboardData) { - return true; - } - if (window.clipboardData) { - return true; - } - return false; - } - static getTextData(e) { - if (e.clipboardData) { - e.preventDefault(); - const text = e.clipboardData.getData('text/plain'); - let metadata = null; - const rawmetadata = e.clipboardData.getData('vscode-editor-data'); - if (typeof rawmetadata === 'string') { - try { - metadata = JSON.parse(rawmetadata); - if (metadata.version !== 1) { - metadata = null; - } - } - catch (err) { - // no problem! - } - } - return [text, metadata]; - } - if (window.clipboardData) { - e.preventDefault(); - const text = window.clipboardData.getData('Text'); - return [text, null]; - } - throw new Error('ClipboardEventUtils.getTextData: Cannot use text data!'); - } - static setTextData(e, text, html, metadata) { - if (e.clipboardData) { - e.clipboardData.setData('text/plain', text); - if (typeof html === 'string') { - e.clipboardData.setData('text/html', html); - } - e.clipboardData.setData('vscode-editor-data', JSON.stringify(metadata)); - e.preventDefault(); - return; - } - if (window.clipboardData) { - window.clipboardData.setData('Text', text); - e.preventDefault(); - return; - } - throw new Error('ClipboardEventUtils.setTextData: Cannot use text data!'); - } -} -class TextAreaWrapper extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["Disposable"] { - constructor(_textArea) { - super(); - this._actual = _textArea; - this._ignoreSelectionChangeTime = 0; - } - setIgnoreSelectionChangeTime(reason) { - this._ignoreSelectionChangeTime = Date.now(); - } - getIgnoreSelectionChangeTime() { - return this._ignoreSelectionChangeTime; - } - resetSelectionChangeTime() { - this._ignoreSelectionChangeTime = 0; - } - getValue() { - // console.log('current value: ' + this._textArea.value); - return this._actual.domNode.value; - } - setValue(reason, value) { - const textArea = this._actual.domNode; - if (textArea.value === value) { - // No change - return; - } - // console.log('reason: ' + reason + ', current value: ' + textArea.value + ' => new value: ' + value); - this.setIgnoreSelectionChangeTime('setValue'); - textArea.value = value; - } - getSelectionStart() { - return this._actual.domNode.selectionStart; - } - getSelectionEnd() { - return this._actual.domNode.selectionEnd; - } - setSelectionRange(reason, selectionStart, selectionEnd) { - const textArea = this._actual.domNode; - let activeElement = null; - const shadowRoot = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["getShadowRoot"](textArea); - if (shadowRoot) { - activeElement = shadowRoot.activeElement; - } - else { - activeElement = document.activeElement; - } - const currentIsFocused = (activeElement === textArea); - const currentSelectionStart = textArea.selectionStart; - const currentSelectionEnd = textArea.selectionEnd; - if (currentIsFocused && currentSelectionStart === selectionStart && currentSelectionEnd === selectionEnd) { - // No change - // Firefox iframe bug https://github.com/Microsoft/monaco-editor/issues/643#issuecomment-367871377 - if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isFirefox"] && window.parent !== window) { - textArea.focus(); - } - return; - } - // console.log('reason: ' + reason + ', setSelectionRange: ' + selectionStart + ' -> ' + selectionEnd); - if (currentIsFocused) { - // No need to focus, only need to change the selection range - this.setIgnoreSelectionChangeTime('setSelectionRange'); - textArea.setSelectionRange(selectionStart, selectionEnd); - if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isFirefox"] && window.parent !== window) { - textArea.focus(); - } - return; - } - // If the focus is outside the textarea, browsers will try really hard to reveal the textarea. - // Here, we try to undo the browser's desperate reveal. - try { - const scrollState = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["saveParentsScrollTop"](textArea); - this.setIgnoreSelectionChangeTime('setSelectionRange'); - textArea.focus(); - textArea.setSelectionRange(selectionStart, selectionEnd); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["restoreParentsScrollTop"](textArea, scrollState); - } - catch (e) { - // Sometimes IE throws when setting selection (e.g. textarea is off-DOM) - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaState.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaState.js ***! - \**************************************************************************************/ -/*! exports provided: TextAreaState, PagedScreenReaderStrategy */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextAreaState", function() { return TextAreaState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PagedScreenReaderStrategy", function() { return PagedScreenReaderStrategy; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class TextAreaState { - constructor(value, selectionStart, selectionEnd, selectionStartPosition, selectionEndPosition) { - this.value = value; - this.selectionStart = selectionStart; - this.selectionEnd = selectionEnd; - this.selectionStartPosition = selectionStartPosition; - this.selectionEndPosition = selectionEndPosition; - } - toString() { - return '[ <' + this.value + '>, selectionStart: ' + this.selectionStart + ', selectionEnd: ' + this.selectionEnd + ']'; - } - static readFromTextArea(textArea) { - return new TextAreaState(textArea.getValue(), textArea.getSelectionStart(), textArea.getSelectionEnd(), null, null); - } - collapseSelection() { - return new TextAreaState(this.value, this.value.length, this.value.length, null, null); - } - writeToTextArea(reason, textArea, select) { - // console.log(Date.now() + ': writeToTextArea ' + reason + ': ' + this.toString()); - textArea.setValue(reason, this.value); - if (select) { - textArea.setSelectionRange(reason, this.selectionStart, this.selectionEnd); - } - } - deduceEditorPosition(offset) { - if (offset <= this.selectionStart) { - const str = this.value.substring(offset, this.selectionStart); - return this._finishDeduceEditorPosition(this.selectionStartPosition, str, -1); - } - if (offset >= this.selectionEnd) { - const str = this.value.substring(this.selectionEnd, offset); - return this._finishDeduceEditorPosition(this.selectionEndPosition, str, 1); - } - const str1 = this.value.substring(this.selectionStart, offset); - if (str1.indexOf(String.fromCharCode(8230)) === -1) { - return this._finishDeduceEditorPosition(this.selectionStartPosition, str1, 1); - } - const str2 = this.value.substring(offset, this.selectionEnd); - return this._finishDeduceEditorPosition(this.selectionEndPosition, str2, -1); - } - _finishDeduceEditorPosition(anchor, deltaText, signum) { - let lineFeedCnt = 0; - let lastLineFeedIndex = -1; - while ((lastLineFeedIndex = deltaText.indexOf('\n', lastLineFeedIndex + 1)) !== -1) { - lineFeedCnt++; - } - return [anchor, signum * deltaText.length, lineFeedCnt]; - } - static selectedText(text) { - return new TextAreaState(text, 0, text.length, null, null); - } - static deduceInput(previousState, currentState, couldBeEmojiInput) { - if (!previousState) { - // This is the EMPTY state - return { - text: '', - replaceCharCnt: 0 - }; - } - // console.log('------------------------deduceInput'); - // console.log('PREVIOUS STATE: ' + previousState.toString()); - // console.log('CURRENT STATE: ' + currentState.toString()); - let previousValue = previousState.value; - let previousSelectionStart = previousState.selectionStart; - let previousSelectionEnd = previousState.selectionEnd; - let currentValue = currentState.value; - let currentSelectionStart = currentState.selectionStart; - let currentSelectionEnd = currentState.selectionEnd; - // Strip the previous suffix from the value (without interfering with the current selection) - const previousSuffix = previousValue.substring(previousSelectionEnd); - const currentSuffix = currentValue.substring(currentSelectionEnd); - const suffixLength = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["commonSuffixLength"](previousSuffix, currentSuffix); - currentValue = currentValue.substring(0, currentValue.length - suffixLength); - previousValue = previousValue.substring(0, previousValue.length - suffixLength); - const previousPrefix = previousValue.substring(0, previousSelectionStart); - const currentPrefix = currentValue.substring(0, currentSelectionStart); - const prefixLength = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["commonPrefixLength"](previousPrefix, currentPrefix); - currentValue = currentValue.substring(prefixLength); - previousValue = previousValue.substring(prefixLength); - currentSelectionStart -= prefixLength; - previousSelectionStart -= prefixLength; - currentSelectionEnd -= prefixLength; - previousSelectionEnd -= prefixLength; - // console.log('AFTER DIFFING PREVIOUS STATE: <' + previousValue + '>, selectionStart: ' + previousSelectionStart + ', selectionEnd: ' + previousSelectionEnd); - // console.log('AFTER DIFFING CURRENT STATE: <' + currentValue + '>, selectionStart: ' + currentSelectionStart + ', selectionEnd: ' + currentSelectionEnd); - if (couldBeEmojiInput && currentSelectionStart === currentSelectionEnd && previousValue.length > 0) { - // on OSX, emojis from the emoji picker are inserted at random locations - // the only hints we can use is that the selection is immediately after the inserted emoji - // and that none of the old text has been deleted - let potentialEmojiInput = null; - if (currentSelectionStart === currentValue.length) { - // emoji potentially inserted "somewhere" after the previous selection => it should appear at the end of `currentValue` - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["startsWith"](currentValue, previousValue)) { - // only if all of the old text is accounted for - potentialEmojiInput = currentValue.substring(previousValue.length); - } - } - else { - // emoji potentially inserted "somewhere" before the previous selection => it should appear at the start of `currentValue` - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["endsWith"](currentValue, previousValue)) { - // only if all of the old text is accounted for - potentialEmojiInput = currentValue.substring(0, currentValue.length - previousValue.length); - } - } - if (potentialEmojiInput !== null && potentialEmojiInput.length > 0) { - // now we check that this is indeed an emoji - // emojis can grow quite long, so a length check is of no help - // e.g. 1F3F4 E0067 E0062 E0065 E006E E0067 E007F ; fully-qualified # 🏴󠁧󠁢󠁥󠁮󠁧󠁿 England - // Oftentimes, emojis use Variation Selector-16 (U+FE0F), so that is a good hint - // http://emojipedia.org/variation-selector-16/ - // > An invisible codepoint which specifies that the preceding character - // > should be displayed with emoji presentation. Only required if the - // > preceding character defaults to text presentation. - if (/\uFE0F/.test(potentialEmojiInput) || _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["containsEmoji"](potentialEmojiInput)) { - return { - text: potentialEmojiInput, - replaceCharCnt: 0 - }; - } - } - } - if (currentSelectionStart === currentSelectionEnd) { - // composition accept case (noticed in FF + Japanese) - // [blahblah] => blahblah| - if (previousValue === currentValue - && previousSelectionStart === 0 - && previousSelectionEnd === previousValue.length - && currentSelectionStart === currentValue.length - && currentValue.indexOf('\n') === -1) { - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["containsFullWidthCharacter"](currentValue)) { - return { - text: '', - replaceCharCnt: 0 - }; - } - } - // no current selection - const replacePreviousCharacters = (previousPrefix.length - prefixLength); - // console.log('REMOVE PREVIOUS: ' + (previousPrefix.length - prefixLength) + ' chars'); - return { - text: currentValue, - replaceCharCnt: replacePreviousCharacters - }; - } - // there is a current selection => composition case - const replacePreviousCharacters = previousSelectionEnd - previousSelectionStart; - return { - text: currentValue, - replaceCharCnt: replacePreviousCharacters - }; - } -} -TextAreaState.EMPTY = new TextAreaState('', 0, 0, null, null); -class PagedScreenReaderStrategy { - static _getPageOfLine(lineNumber, linesPerPage) { - return Math.floor((lineNumber - 1) / linesPerPage); - } - static _getRangeForPage(page, linesPerPage) { - const offset = page * linesPerPage; - const startLineNumber = offset + 1; - const endLineNumber = offset + linesPerPage; - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](startLineNumber, 1, endLineNumber + 1, 1); - } - static fromEditorSelection(previousState, model, selection, linesPerPage, trimLongText) { - const selectionStartPage = PagedScreenReaderStrategy._getPageOfLine(selection.startLineNumber, linesPerPage); - const selectionStartPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionStartPage, linesPerPage); - const selectionEndPage = PagedScreenReaderStrategy._getPageOfLine(selection.endLineNumber, linesPerPage); - const selectionEndPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionEndPage, linesPerPage); - const pretextRange = selectionStartPageRange.intersectRanges(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](1, 1, selection.startLineNumber, selection.startColumn)); - let pretext = model.getValueInRange(pretextRange, 1 /* LF */); - const lastLine = model.getLineCount(); - const lastLineMaxColumn = model.getLineMaxColumn(lastLine); - const posttextRange = selectionEndPageRange.intersectRanges(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](selection.endLineNumber, selection.endColumn, lastLine, lastLineMaxColumn)); - let posttext = model.getValueInRange(posttextRange, 1 /* LF */); - let text; - if (selectionStartPage === selectionEndPage || selectionStartPage + 1 === selectionEndPage) { - // take full selection - text = model.getValueInRange(selection, 1 /* LF */); - } - else { - const selectionRange1 = selectionStartPageRange.intersectRanges(selection); - const selectionRange2 = selectionEndPageRange.intersectRanges(selection); - text = (model.getValueInRange(selectionRange1, 1 /* LF */) - + String.fromCharCode(8230) - + model.getValueInRange(selectionRange2, 1 /* LF */)); - } - // Chromium handles very poorly text even of a few thousand chars - // Cut text to avoid stalling the entire UI - if (trimLongText) { - const LIMIT_CHARS = 500; - if (pretext.length > LIMIT_CHARS) { - pretext = pretext.substring(pretext.length - LIMIT_CHARS, pretext.length); - } - if (posttext.length > LIMIT_CHARS) { - posttext = posttext.substring(0, LIMIT_CHARS); - } - if (text.length > 2 * LIMIT_CHARS) { - text = text.substring(0, LIMIT_CHARS) + String.fromCharCode(8230) + text.substring(text.length - LIMIT_CHARS, text.length); - } - } - return new TextAreaState(pretext + text + posttext, pretext.length, pretext.length + text.length, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](selection.startLineNumber, selection.startColumn), new _common_core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](selection.endLineNumber, selection.endColumn)); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/core/editorState.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/core/editorState.js ***! - \******************************************************************************/ -/*! exports provided: EditorState, EditorStateCancellationTokenSource, TextModelCancellationTokenSource, StableEditorScrollState */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorState", function() { return EditorState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorStateCancellationTokenSource", function() { return EditorStateCancellationTokenSource; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextModelCancellationTokenSource", function() { return TextModelCancellationTokenSource; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StableEditorScrollState", function() { return StableEditorScrollState; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _keybindingCancellation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./keybindingCancellation.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/core/keybindingCancellation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -class EditorState { - constructor(editor, flags) { - this.flags = flags; - if ((this.flags & 1 /* Value */) !== 0) { - const model = editor.getModel(); - this.modelVersionId = model ? _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["format"]('{0}#{1}', model.uri.toString(), model.getVersionId()) : null; - } - else { - this.modelVersionId = null; - } - if ((this.flags & 4 /* Position */) !== 0) { - this.position = editor.getPosition(); - } - else { - this.position = null; - } - if ((this.flags & 2 /* Selection */) !== 0) { - this.selection = editor.getSelection(); - } - else { - this.selection = null; - } - if ((this.flags & 8 /* Scroll */) !== 0) { - this.scrollLeft = editor.getScrollLeft(); - this.scrollTop = editor.getScrollTop(); - } - else { - this.scrollLeft = -1; - this.scrollTop = -1; - } - } - _equals(other) { - if (!(other instanceof EditorState)) { - return false; - } - const state = other; - if (this.modelVersionId !== state.modelVersionId) { - return false; - } - if (this.scrollLeft !== state.scrollLeft || this.scrollTop !== state.scrollTop) { - return false; - } - if (!this.position && state.position || this.position && !state.position || this.position && state.position && !this.position.equals(state.position)) { - return false; - } - if (!this.selection && state.selection || this.selection && !state.selection || this.selection && state.selection && !this.selection.equalsRange(state.selection)) { - return false; - } - return true; - } - validate(editor) { - return this._equals(new EditorState(editor, this.flags)); - } -} -/** - * A cancellation token source that cancels when the editor changes as expressed - * by the provided flags - * @param range If provided, changes in position and selection within this range will not trigger cancellation - */ -class EditorStateCancellationTokenSource extends _keybindingCancellation_js__WEBPACK_IMPORTED_MODULE_4__["EditorKeybindingCancellationTokenSource"] { - constructor(editor, flags, range, parent) { - super(editor, parent); - this.editor = editor; - this._listener = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - if (flags & 4 /* Position */) { - this._listener.add(editor.onDidChangeCursorPosition(e => { - if (!range || !_common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].containsPosition(range, e.position)) { - this.cancel(); - } - })); - } - if (flags & 2 /* Selection */) { - this._listener.add(editor.onDidChangeCursorSelection(e => { - if (!range || !_common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].containsRange(range, e.selection)) { - this.cancel(); - } - })); - } - if (flags & 8 /* Scroll */) { - this._listener.add(editor.onDidScrollChange(_ => this.cancel())); - } - if (flags & 1 /* Value */) { - this._listener.add(editor.onDidChangeModel(_ => this.cancel())); - this._listener.add(editor.onDidChangeModelContent(_ => this.cancel())); - } - } - dispose() { - this._listener.dispose(); - super.dispose(); - } -} -/** - * A cancellation token source that cancels when the provided model changes - */ -class TextModelCancellationTokenSource extends _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_2__["CancellationTokenSource"] { - constructor(model, parent) { - super(parent); - this._listener = model.onDidChangeContent(() => this.cancel()); - } - dispose() { - this._listener.dispose(); - super.dispose(); - } -} -class StableEditorScrollState { - constructor(_visiblePosition, _visiblePositionScrollDelta, _cursorPosition) { - this._visiblePosition = _visiblePosition; - this._visiblePositionScrollDelta = _visiblePositionScrollDelta; - this._cursorPosition = _cursorPosition; - } - static capture(editor) { - let visiblePosition = null; - let visiblePositionScrollDelta = 0; - if (editor.getScrollTop() !== 0) { - const visibleRanges = editor.getVisibleRanges(); - if (visibleRanges.length > 0) { - visiblePosition = visibleRanges[0].getStartPosition(); - const visiblePositionScrollTop = editor.getTopForPosition(visiblePosition.lineNumber, visiblePosition.column); - visiblePositionScrollDelta = editor.getScrollTop() - visiblePositionScrollTop; - } - } - return new StableEditorScrollState(visiblePosition, visiblePositionScrollDelta, editor.getPosition()); - } - restore(editor) { - if (this._visiblePosition) { - const visiblePositionScrollTop = editor.getTopForPosition(this._visiblePosition.lineNumber, this._visiblePosition.column); - editor.setScrollTop(visiblePositionScrollTop + this._visiblePositionScrollDelta); - } - } - restoreRelativeVerticalPositionOfCursor(editor) { - const currentCursorPosition = editor.getPosition(); - if (!this._cursorPosition || !currentCursorPosition) { - return; - } - const offset = editor.getTopForLineNumber(currentCursorPosition.lineNumber) - editor.getTopForLineNumber(this._cursorPosition.lineNumber); - editor.setScrollTop(editor.getScrollTop() + offset); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/core/keybindingCancellation.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/core/keybindingCancellation.js ***! - \*****************************************************************************************/ -/*! exports provided: EditorKeybindingCancellationTokenSource */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorKeybindingCancellationTokenSource", function() { return EditorKeybindingCancellationTokenSource; }); -/* harmony import */ var _editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../platform/instantiation/common/extensions.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/extensions.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -const IEditorCancellationTokens = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_4__["createDecorator"])('IEditorCancelService'); -const ctxCancellableOperation = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_1__["RawContextKey"]('cancellableOperation', false); -Object(_platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_5__["registerSingleton"])(IEditorCancellationTokens, class { - constructor() { - this._tokens = new WeakMap(); - } - add(editor, cts) { - let data = this._tokens.get(editor); - if (!data) { - data = editor.invokeWithinContext(accessor => { - const key = ctxCancellableOperation.bindTo(accessor.get(_platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_1__["IContextKeyService"])); - const tokens = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - return { key, tokens }; - }); - this._tokens.set(editor, data); - } - let removeFn; - data.key.set(true); - removeFn = data.tokens.push(cts); - return () => { - // remove w/o cancellation - if (removeFn) { - removeFn(); - data.key.set(!data.tokens.isEmpty()); - removeFn = undefined; - } - }; - } - cancel(editor) { - const data = this._tokens.get(editor); - if (!data) { - return; - } - // remove with cancellation - const cts = data.tokens.pop(); - if (cts) { - cts.cancel(); - data.key.set(!data.tokens.isEmpty()); - } - } -}, true); -class EditorKeybindingCancellationTokenSource extends _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_2__["CancellationTokenSource"] { - constructor(editor, parent) { - super(parent); - this.editor = editor; - this._unregister = editor.invokeWithinContext(accessor => accessor.get(IEditorCancellationTokens).add(editor, this)); - } - dispose() { - this._unregister(); - super.dispose(); - } -} -Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new class extends _editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["EditorCommand"] { - constructor() { - super({ - id: 'editor.cancelOperation', - kbOpts: { - weight: 100 /* EditorContrib */, - primary: 9 /* Escape */ - }, - precondition: ctxCancellableOperation - }); - } - runEditorCommand(accessor, editor) { - accessor.get(IEditorCancellationTokens).cancel(editor); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/editorBrowser.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/editorBrowser.js ***! - \***************************************************************************/ -/*! exports provided: isCodeEditor, isDiffEditor, getCodeEditor */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCodeEditor", function() { return isCodeEditor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDiffEditor", function() { return isDiffEditor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCodeEditor", function() { return getCodeEditor; }); -/* harmony import */ var _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/editorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorCommon.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - *@internal - */ -function isCodeEditor(thing) { - if (thing && typeof thing.getEditorType === 'function') { - return thing.getEditorType() === _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_0__["EditorType"].ICodeEditor; - } - else { - return false; - } -} -/** - *@internal - */ -function isDiffEditor(thing) { - if (thing && typeof thing.getEditorType === 'function') { - return thing.getEditorType() === _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_0__["EditorType"].IDiffEditor; - } - else { - return false; - } -} -/** - *@internal - */ -function getCodeEditor(thing) { - if (isCodeEditor(thing)) { - return thing; - } - if (isDiffEditor(thing)) { - return thing.getModifiedEditor(); - } - return null; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/editorDom.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/editorDom.js ***! - \***********************************************************************/ -/*! exports provided: PageCoordinates, ClientCoordinates, EditorPagePosition, createEditorPagePosition, EditorMouseEvent, EditorMouseEventFactory, EditorPointerEventFactory, GlobalEditorMouseMoveMonitor */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageCoordinates", function() { return PageCoordinates; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClientCoordinates", function() { return ClientCoordinates; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorPagePosition", function() { return EditorPagePosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEditorPagePosition", function() { return createEditorPagePosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorMouseEvent", function() { return EditorMouseEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorMouseEventFactory", function() { return EditorMouseEventFactory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorPointerEventFactory", function() { return EditorPointerEventFactory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlobalEditorMouseMoveMonitor", function() { return GlobalEditorMouseMoveMonitor; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../base/browser/globalMouseMoveMonitor.js */ "./node_modules/monaco-editor/esm/vs/base/browser/globalMouseMoveMonitor.js"); -/* harmony import */ var _base_browser_mouseEvent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../base/browser/mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -/** - * Coordinates relative to the whole document (e.g. mouse event's pageX and pageY) - */ -class PageCoordinates { - constructor(x, y) { - this.x = x; - this.y = y; - } - toClientCoordinates() { - return new ClientCoordinates(this.x - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["StandardWindow"].scrollX, this.y - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["StandardWindow"].scrollY); - } -} -/** - * Coordinates within the application's client area (i.e. origin is document's scroll position). - * - * For example, clicking in the top-left corner of the client area will - * always result in a mouse event with a client.x value of 0, regardless - * of whether the page is scrolled horizontally. - */ -class ClientCoordinates { - constructor(clientX, clientY) { - this.clientX = clientX; - this.clientY = clientY; - } - toPageCoordinates() { - return new PageCoordinates(this.clientX + _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["StandardWindow"].scrollX, this.clientY + _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["StandardWindow"].scrollY); - } -} -/** - * The position of the editor in the page. - */ -class EditorPagePosition { - constructor(x, y, width, height) { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } -} -function createEditorPagePosition(editorViewDomNode) { - const editorPos = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["getDomNodePagePosition"](editorViewDomNode); - return new EditorPagePosition(editorPos.left, editorPos.top, editorPos.width, editorPos.height); -} -class EditorMouseEvent extends _base_browser_mouseEvent_js__WEBPACK_IMPORTED_MODULE_2__["StandardMouseEvent"] { - constructor(e, editorViewDomNode) { - super(e); - this.pos = new PageCoordinates(this.posx, this.posy); - this.editorPos = createEditorPagePosition(editorViewDomNode); - } -} -class EditorMouseEventFactory { - constructor(editorViewDomNode) { - this._editorViewDomNode = editorViewDomNode; - } - _create(e) { - return new EditorMouseEvent(e, this._editorViewDomNode); - } - onContextMenu(target, callback) { - return _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](target, 'contextmenu', (e) => { - callback(this._create(e)); - }); - } - onMouseUp(target, callback) { - return _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](target, 'mouseup', (e) => { - callback(this._create(e)); - }); - } - onMouseDown(target, callback) { - return _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](target, 'mousedown', (e) => { - callback(this._create(e)); - }); - } - onMouseLeave(target, callback) { - return _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableNonBubblingMouseOutListener"](target, (e) => { - callback(this._create(e)); - }); - } - onMouseMoveThrottled(target, callback, merger, minimumTimeMs) { - const myMerger = (lastEvent, currentEvent) => { - return merger(lastEvent, this._create(currentEvent)); - }; - return _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableThrottledListener"](target, 'mousemove', callback, myMerger, minimumTimeMs); - } -} -class EditorPointerEventFactory { - constructor(editorViewDomNode) { - this._editorViewDomNode = editorViewDomNode; - } - _create(e) { - return new EditorMouseEvent(e, this._editorViewDomNode); - } - onPointerUp(target, callback) { - return _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](target, 'pointerup', (e) => { - callback(this._create(e)); - }); - } - onPointerDown(target, callback) { - return _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](target, 'pointerdown', (e) => { - callback(this._create(e)); - }); - } - onPointerLeave(target, callback) { - return _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableNonBubblingPointerOutListener"](target, (e) => { - callback(this._create(e)); - }); - } - onPointerMoveThrottled(target, callback, merger, minimumTimeMs) { - const myMerger = (lastEvent, currentEvent) => { - return merger(lastEvent, this._create(currentEvent)); - }; - return _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableThrottledListener"](target, 'pointermove', callback, myMerger, minimumTimeMs); - } -} -class GlobalEditorMouseMoveMonitor extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(editorViewDomNode) { - super(); - this._editorViewDomNode = editorViewDomNode; - this._globalMouseMoveMonitor = this._register(new _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_1__["GlobalMouseMoveMonitor"]()); - this._keydownListener = null; - } - startMonitoring(initialElement, initialButtons, merger, mouseMoveCallback, onStopCallback) { - // Add a <> keydown event listener that will cancel the monitoring - // if something other than a modifier key is pressed - this._keydownListener = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addStandardDisposableListener"](document, 'keydown', (e) => { - const kb = e.toKeybinding(); - if (kb.isModifierKey()) { - // Allow modifier keys - return; - } - this._globalMouseMoveMonitor.stopMonitoring(true); - }, true); - const myMerger = (lastEvent, currentEvent) => { - return merger(lastEvent, new EditorMouseEvent(currentEvent, this._editorViewDomNode)); - }; - this._globalMouseMoveMonitor.startMonitoring(initialElement, initialButtons, myMerger, mouseMoveCallback, () => { - this._keydownListener.dispose(); - onStopCallback(); - }); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js ***! - \******************************************************************************/ -/*! exports provided: Command, MultiCommand, ProxyCommand, EditorCommand, EditorAction, MultiEditorAction, registerLanguageCommand, registerDefaultLanguageCommand, registerModelAndPositionCommand, registerModelCommand, registerEditorCommand, registerEditorAction, registerMultiEditorAction, registerInstantiatedEditorAction, registerEditorContribution, EditorExtensionsRegistry, UndoCommand, RedoCommand, SelectAllCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiCommand", function() { return MultiCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProxyCommand", function() { return ProxyCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorCommand", function() { return EditorCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorAction", function() { return EditorAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiEditorAction", function() { return MultiEditorAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerLanguageCommand", function() { return registerLanguageCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerDefaultLanguageCommand", function() { return registerDefaultLanguageCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerModelAndPositionCommand", function() { return registerModelAndPositionCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerModelCommand", function() { return registerModelCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerEditorCommand", function() { return registerEditorCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerEditorAction", function() { return registerEditorAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerMultiEditorAction", function() { return registerMultiEditorAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerInstantiatedEditorAction", function() { return registerInstantiatedEditorAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerEditorContribution", function() { return registerEditorContribution; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorExtensionsRegistry", function() { return EditorExtensionsRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UndoCommand", function() { return UndoCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RedoCommand", function() { return RedoCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectAllCommand", function() { return SelectAllCommand; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/services/resolverService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/resolverService.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../platform/keybinding/common/keybindingsRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js"); -/* harmony import */ var _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../platform/registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../platform/telemetry/common/telemetry.js */ "./node_modules/monaco-editor/esm/vs/platform/telemetry/common/telemetry.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - -class Command { - constructor(opts) { - this.id = opts.id; - this.precondition = opts.precondition; - this._kbOpts = opts.kbOpts; - this._menuOpts = opts.menuOpts; - this._description = opts.description; - } - register() { - if (Array.isArray(this._menuOpts)) { - this._menuOpts.forEach(this._registerMenuItem, this); - } - else if (this._menuOpts) { - this._registerMenuItem(this._menuOpts); - } - if (this._kbOpts) { - let kbWhen = this._kbOpts.kbExpr; - if (this.precondition) { - if (kbWhen) { - kbWhen = _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_9__["ContextKeyExpr"].and(kbWhen, this.precondition); - } - else { - kbWhen = this.precondition; - } - } - _platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_10__["KeybindingsRegistry"].registerCommandAndKeybindingRule({ - id: this.id, - handler: (accessor, args) => this.runCommand(accessor, args), - weight: this._kbOpts.weight, - args: this._kbOpts.args, - when: kbWhen, - primary: this._kbOpts.primary, - secondary: this._kbOpts.secondary, - win: this._kbOpts.win, - linux: this._kbOpts.linux, - mac: this._kbOpts.mac, - description: this._description - }); - } - else { - _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_8__["CommandsRegistry"].registerCommand({ - id: this.id, - handler: (accessor, args) => this.runCommand(accessor, args), - description: this._description - }); - } - } - _registerMenuItem(item) { - _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuRegistry"].appendMenuItem(item.menuId, { - group: item.group, - command: { - id: this.id, - title: item.title, - icon: item.icon - // precondition: this.precondition - }, - when: item.when, - order: item.order - }); - } -} -class MultiCommand extends Command { - constructor() { - super(...arguments); - this._implementations = []; - } - /** - * A higher priority gets to be looked at first - */ - addImplementation(priority, implementation) { - this._implementations.push([priority, implementation]); - this._implementations.sort((a, b) => b[0] - a[0]); - return { - dispose: () => { - for (let i = 0; i < this._implementations.length; i++) { - if (this._implementations[i][1] === implementation) { - this._implementations.splice(i, 1); - return; - } - } - } - }; - } - runCommand(accessor, args) { - for (const impl of this._implementations) { - if (impl[1](accessor, args)) { - return; - } - } - } -} -//#endregion -/** - * A command that delegates to another command's implementation. - * - * This lets different commands be registered but share the same implementation - */ -class ProxyCommand extends Command { - constructor(command, opts) { - super(opts); - this.command = command; - } - runCommand(accessor, args) { - return this.command.runCommand(accessor, args); - } -} -class EditorCommand extends Command { - /** - * Create a command class that is bound to a certain editor contribution. - */ - static bindToContribution(controllerGetter) { - return class EditorControllerCommandImpl extends EditorCommand { - constructor(opts) { - super(opts); - this._callback = opts.handler; - } - runEditorCommand(accessor, editor, args) { - const controller = controllerGetter(editor); - if (controller) { - this._callback(controllerGetter(editor), args); - } - } - }; - } - runCommand(accessor, args) { - const codeEditorService = accessor.get(_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__["ICodeEditorService"]); - // Find the editor with text focus or active - const editor = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor(); - if (!editor) { - // well, at least we tried... - return; - } - return editor.invokeWithinContext((editorAccessor) => { - const kbService = editorAccessor.get(_platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_9__["IContextKeyService"]); - if (!kbService.contextMatchesRules(Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_13__["withNullAsUndefined"])(this.precondition))) { - // precondition does not hold - return; - } - return this.runEditorCommand(editorAccessor, editor, args); - }); - } -} -class EditorAction extends EditorCommand { - constructor(opts) { - super(EditorAction.convertOptions(opts)); - this.label = opts.label; - this.alias = opts.alias; - } - static convertOptions(opts) { - let menuOpts; - if (Array.isArray(opts.menuOpts)) { - menuOpts = opts.menuOpts; - } - else if (opts.menuOpts) { - menuOpts = [opts.menuOpts]; - } - else { - menuOpts = []; - } - function withDefaults(item) { - if (!item.menuId) { - item.menuId = _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].EditorContext; - } - if (!item.title) { - item.title = opts.label; - } - item.when = _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_9__["ContextKeyExpr"].and(opts.precondition, item.when); - return item; - } - if (Array.isArray(opts.contextMenuOpts)) { - menuOpts.push(...opts.contextMenuOpts.map(withDefaults)); - } - else if (opts.contextMenuOpts) { - menuOpts.push(withDefaults(opts.contextMenuOpts)); - } - opts.menuOpts = menuOpts; - return opts; - } - runEditorCommand(accessor, editor, args) { - this.reportTelemetry(accessor, editor); - return this.run(accessor, editor, args || {}); - } - reportTelemetry(accessor, editor) { - accessor.get(_platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_12__["ITelemetryService"]).publicLog2('editorActionInvoked', { name: this.label, id: this.id }); - } -} -class MultiEditorAction extends EditorAction { - constructor(opts) { - super(opts); - this._implementations = []; - } - runEditorCommand(accessor, editor, args) { - this.reportTelemetry(accessor, editor); - for (const impl of this._implementations) { - if (impl[1](accessor, args)) { - return; - } - } - return this.run(accessor, editor, args || {}); - } -} -//#endregion -// --- Registration of commands and actions -function registerLanguageCommand(id, handler) { - _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_8__["CommandsRegistry"].registerCommand(id, (accessor, args) => handler(accessor, args || {})); -} -function registerDefaultLanguageCommand(id, handler) { - registerLanguageCommand(id, function (accessor, args) { - const { resource, position } = args; - if (!(resource instanceof _base_common_uri_js__WEBPACK_IMPORTED_MODULE_2__["URI"])) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["illegalArgument"])('resource'); - } - if (!_common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"].isIPosition(position)) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["illegalArgument"])('position'); - } - const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_5__["IModelService"]).getModel(resource); - if (model) { - const editorPosition = _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"].lift(position); - return handler(model, editorPosition, args); - } - return accessor.get(_common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_6__["ITextModelService"]).createModelReference(resource).then(reference => { - return new Promise((resolve, reject) => { - try { - const result = handler(reference.object.textEditorModel, _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"].lift(position), args); - resolve(result); - } - catch (err) { - reject(err); - } - }).finally(() => { - reference.dispose(); - }); - }); - }); -} -function registerModelAndPositionCommand(id, handler) { - _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_8__["CommandsRegistry"].registerCommand(id, function (accessor, ...args) { - const [resource, position] = args; - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_13__["assertType"])(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_2__["URI"].isUri(resource)); - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_13__["assertType"])(_common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"].isIPosition(position)); - const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_5__["IModelService"]).getModel(resource); - if (model) { - const editorPosition = _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"].lift(position); - return handler(model, editorPosition, ...args.slice(2)); - } - return accessor.get(_common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_6__["ITextModelService"]).createModelReference(resource).then(reference => { - return new Promise((resolve, reject) => { - try { - const result = handler(reference.object.textEditorModel, _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"].lift(position), args.slice(2)); - resolve(result); - } - catch (err) { - reject(err); - } - }).finally(() => { - reference.dispose(); - }); - }); - }); -} -function registerModelCommand(id, handler) { - _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_8__["CommandsRegistry"].registerCommand(id, function (accessor, ...args) { - const [resource] = args; - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_13__["assertType"])(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_2__["URI"].isUri(resource)); - const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_5__["IModelService"]).getModel(resource); - if (model) { - return handler(model, ...args.slice(1)); - } - return accessor.get(_common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_6__["ITextModelService"]).createModelReference(resource).then(reference => { - return new Promise((resolve, reject) => { - try { - const result = handler(reference.object.textEditorModel, args.slice(1)); - resolve(result); - } - catch (err) { - reject(err); - } - }).finally(() => { - reference.dispose(); - }); - }); - }); -} -function registerEditorCommand(editorCommand) { - EditorContributionRegistry.INSTANCE.registerEditorCommand(editorCommand); - return editorCommand; -} -function registerEditorAction(ctor) { - const action = new ctor(); - EditorContributionRegistry.INSTANCE.registerEditorAction(action); - return action; -} -function registerMultiEditorAction(action) { - EditorContributionRegistry.INSTANCE.registerEditorAction(action); - return action; -} -function registerInstantiatedEditorAction(editorAction) { - EditorContributionRegistry.INSTANCE.registerEditorAction(editorAction); -} -function registerEditorContribution(id, ctor) { - EditorContributionRegistry.INSTANCE.registerEditorContribution(id, ctor); -} -var EditorExtensionsRegistry; -(function (EditorExtensionsRegistry) { - function getEditorCommand(commandId) { - return EditorContributionRegistry.INSTANCE.getEditorCommand(commandId); - } - EditorExtensionsRegistry.getEditorCommand = getEditorCommand; - function getEditorActions() { - return EditorContributionRegistry.INSTANCE.getEditorActions(); - } - EditorExtensionsRegistry.getEditorActions = getEditorActions; - function getEditorContributions() { - return EditorContributionRegistry.INSTANCE.getEditorContributions(); - } - EditorExtensionsRegistry.getEditorContributions = getEditorContributions; - function getSomeEditorContributions(ids) { - return EditorContributionRegistry.INSTANCE.getEditorContributions().filter(c => ids.indexOf(c.id) >= 0); - } - EditorExtensionsRegistry.getSomeEditorContributions = getSomeEditorContributions; - function getDiffEditorContributions() { - return EditorContributionRegistry.INSTANCE.getDiffEditorContributions(); - } - EditorExtensionsRegistry.getDiffEditorContributions = getDiffEditorContributions; -})(EditorExtensionsRegistry || (EditorExtensionsRegistry = {})); -// Editor extension points -const Extensions = { - EditorCommonContributions: 'editor.contributions' -}; -class EditorContributionRegistry { - constructor() { - this.editorContributions = []; - this.diffEditorContributions = []; - this.editorActions = []; - this.editorCommands = Object.create(null); - } - registerEditorContribution(id, ctor) { - this.editorContributions.push({ id, ctor: ctor }); - } - getEditorContributions() { - return this.editorContributions.slice(0); - } - getDiffEditorContributions() { - return this.diffEditorContributions.slice(0); - } - registerEditorAction(action) { - action.register(); - this.editorActions.push(action); - } - getEditorActions() { - return this.editorActions.slice(0); - } - registerEditorCommand(editorCommand) { - editorCommand.register(); - this.editorCommands[editorCommand.id] = editorCommand; - } - getEditorCommand(commandId) { - return (this.editorCommands[commandId] || null); - } -} -EditorContributionRegistry.INSTANCE = new EditorContributionRegistry(); -_platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_11__["Registry"].add(Extensions.EditorCommonContributions, EditorContributionRegistry.INSTANCE); -function registerCommand(command) { - command.register(); - return command; -} -const UndoCommand = registerCommand(new MultiCommand({ - id: 'undo', - precondition: undefined, - kbOpts: { - weight: 0 /* EditorCore */, - primary: 2048 /* CtrlCmd */ | 56 /* KEY_Z */ - }, - menuOpts: [{ - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].MenubarEditMenu, - group: '1_do', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miUndo', comment: ['&& denotes a mnemonic'] }, "&&Undo"), - order: 1 - }, { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].CommandPalette, - group: '', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('undo', "Undo"), - order: 1 - }] -})); -registerCommand(new ProxyCommand(UndoCommand, { id: 'default:undo', precondition: undefined })); -const RedoCommand = registerCommand(new MultiCommand({ - id: 'redo', - precondition: undefined, - kbOpts: { - weight: 0 /* EditorCore */, - primary: 2048 /* CtrlCmd */ | 55 /* KEY_Y */, - secondary: [2048 /* CtrlCmd */ | 1024 /* Shift */ | 56 /* KEY_Z */], - mac: { primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 56 /* KEY_Z */ } - }, - menuOpts: [{ - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].MenubarEditMenu, - group: '1_do', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miRedo', comment: ['&& denotes a mnemonic'] }, "&&Redo"), - order: 2 - }, { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].CommandPalette, - group: '', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('redo', "Redo"), - order: 1 - }] -})); -registerCommand(new ProxyCommand(RedoCommand, { id: 'default:redo', precondition: undefined })); -const SelectAllCommand = registerCommand(new MultiCommand({ - id: 'editor.action.selectAll', - precondition: undefined, - kbOpts: { - weight: 0 /* EditorCore */, - kbExpr: null, - primary: 2048 /* CtrlCmd */ | 31 /* KEY_A */ - }, - menuOpts: [{ - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].MenubarSelectionMenu, - group: '1_basic', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miSelectAll', comment: ['&& denotes a mnemonic'] }, "&&Select All"), - order: 1 - }, { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].CommandPalette, - group: '', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('selectAll', "Select All"), - order: 1 - }] -})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/services/abstractCodeEditorService.js": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/services/abstractCodeEditorService.js ***! - \************************************************************************************************/ -/*! exports provided: AbstractCodeEditorService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractCodeEditorService", function() { return AbstractCodeEditorService; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class AbstractCodeEditorService extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor() { - super(); - this._onCodeEditorAdd = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this.onCodeEditorAdd = this._onCodeEditorAdd.event; - this._onCodeEditorRemove = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this.onCodeEditorRemove = this._onCodeEditorRemove.event; - this._onDiffEditorAdd = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this._onDiffEditorRemove = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this._modelProperties = new Map(); - this._codeEditors = Object.create(null); - this._diffEditors = Object.create(null); - } - addCodeEditor(editor) { - this._codeEditors[editor.getId()] = editor; - this._onCodeEditorAdd.fire(editor); - } - removeCodeEditor(editor) { - if (delete this._codeEditors[editor.getId()]) { - this._onCodeEditorRemove.fire(editor); - } - } - listCodeEditors() { - return Object.keys(this._codeEditors).map(id => this._codeEditors[id]); - } - addDiffEditor(editor) { - this._diffEditors[editor.getId()] = editor; - this._onDiffEditorAdd.fire(editor); - } - removeDiffEditor(editor) { - if (delete this._diffEditors[editor.getId()]) { - this._onDiffEditorRemove.fire(editor); - } - } - listDiffEditors() { - return Object.keys(this._diffEditors).map(id => this._diffEditors[id]); - } - getFocusedCodeEditor() { - let editorWithWidgetFocus = null; - const editors = this.listCodeEditors(); - for (const editor of editors) { - if (editor.hasTextFocus()) { - // bingo! - return editor; - } - if (editor.hasWidgetFocus()) { - editorWithWidgetFocus = editor; - } - } - return editorWithWidgetFocus; - } - setModelProperty(resource, key, value) { - const key1 = resource.toString(); - let dest; - if (this._modelProperties.has(key1)) { - dest = this._modelProperties.get(key1); - } - else { - dest = new Map(); - this._modelProperties.set(key1, dest); - } - dest.set(key, value); - } - getModelProperty(resource, key) { - const key1 = resource.toString(); - if (this._modelProperties.has(key1)) { - const innerMap = this._modelProperties.get(key1); - return innerMap.get(key); - } - return undefined; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/services/bulkEditService.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/services/bulkEditService.js ***! - \**************************************************************************************/ -/*! exports provided: IBulkEditService, ResourceEdit, ResourceTextEdit, ResourceFileEdit */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IBulkEditService", function() { return IBulkEditService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResourceEdit", function() { return ResourceEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResourceTextEdit", function() { return ResourceTextEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResourceFileEdit", function() { return ResourceFileEdit; }); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -const IBulkEditService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('IWorkspaceEditService'); -function isWorkspaceFileEdit(thing) { - return Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isObject"])(thing) && (Boolean(thing.newUri) || Boolean(thing.oldUri)); -} -function isWorkspaceTextEdit(thing) { - return Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isObject"])(thing) && _base_common_uri_js__WEBPACK_IMPORTED_MODULE_1__["URI"].isUri(thing.resource) && Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isObject"])(thing.edit); -} -class ResourceEdit { - constructor(metadata) { - this.metadata = metadata; - } - static convert(edit) { - return edit.edits.map(edit => { - if (isWorkspaceTextEdit(edit)) { - return new ResourceTextEdit(edit.resource, edit.edit, edit.modelVersionId, edit.metadata); - } - if (isWorkspaceFileEdit(edit)) { - return new ResourceFileEdit(edit.oldUri, edit.newUri, edit.options, edit.metadata); - } - throw new Error('Unsupported edit'); - }); - } -} -class ResourceTextEdit extends ResourceEdit { - constructor(resource, textEdit, versionId, metadata) { - super(metadata); - this.resource = resource; - this.textEdit = textEdit; - this.versionId = versionId; - this.metadata = metadata; - } -} -class ResourceFileEdit extends ResourceEdit { - constructor(oldResource, newResource, options, metadata) { - super(metadata); - this.oldResource = oldResource; - this.newResource = newResource; - this.options = options; - this.metadata = metadata; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js ***! - \****************************************************************************************/ -/*! exports provided: ICodeEditorService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ICodeEditorService", function() { return ICodeEditorService; }); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const ICodeEditorService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('codeEditorService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorServiceImpl.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorServiceImpl.js ***! - \********************************************************************************************/ -/*! exports provided: RefCountedStyleSheet, GlobalStyleSheet, CodeEditorServiceImpl */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RefCountedStyleSheet", function() { return RefCountedStyleSheet; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlobalStyleSheet", function() { return GlobalStyleSheet; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditorServiceImpl", function() { return CodeEditorServiceImpl; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _abstractCodeEditorService_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./abstractCodeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/abstractCodeEditorService.js"); -/* harmony import */ var _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/editorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorCommon.js"); -/* harmony import */ var _common_model_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - -class RefCountedStyleSheet { - constructor(parent, editorId, styleSheet) { - this._parent = parent; - this._editorId = editorId; - this._styleSheet = styleSheet; - this._refCount = 0; - } - ref() { - this._refCount++; - } - unref() { - var _a; - this._refCount--; - if (this._refCount === 0) { - (_a = this._styleSheet.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this._styleSheet); - this._parent._removeEditorStyleSheets(this._editorId); - } - } - insertRule(rule, index) { - const sheet = this._styleSheet.sheet; - sheet.insertRule(rule, index); - } - removeRulesContainingSelector(ruleName) { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["removeCSSRulesContainingSelector"](ruleName, this._styleSheet); - } -} -class GlobalStyleSheet { - constructor(styleSheet) { - this._styleSheet = styleSheet; - } - ref() { - } - unref() { - } - insertRule(rule, index) { - const sheet = this._styleSheet.sheet; - sheet.insertRule(rule, index); - } - removeRulesContainingSelector(ruleName) { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["removeCSSRulesContainingSelector"](ruleName, this._styleSheet); - } -} -let CodeEditorServiceImpl = class CodeEditorServiceImpl extends _abstractCodeEditorService_js__WEBPACK_IMPORTED_MODULE_4__["AbstractCodeEditorService"] { - constructor(themeService, styleSheet = null) { - super(); - this._decorationOptionProviders = new Map(); - this._editorStyleSheets = new Map(); - this._globalStyleSheet = styleSheet ? styleSheet : null; - this._themeService = themeService; - } - _getOrCreateGlobalStyleSheet() { - if (!this._globalStyleSheet) { - this._globalStyleSheet = new GlobalStyleSheet(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["createStyleSheet"]()); - } - return this._globalStyleSheet; - } - _getOrCreateStyleSheet(editor) { - if (!editor) { - return this._getOrCreateGlobalStyleSheet(); - } - const domNode = editor.getContainerDomNode(); - if (!_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["isInShadowDOM"](domNode)) { - return this._getOrCreateGlobalStyleSheet(); - } - const editorId = editor.getId(); - if (!this._editorStyleSheets.has(editorId)) { - const refCountedStyleSheet = new RefCountedStyleSheet(this, editorId, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["createStyleSheet"](domNode)); - this._editorStyleSheets.set(editorId, refCountedStyleSheet); - } - return this._editorStyleSheets.get(editorId); - } - _removeEditorStyleSheets(editorId) { - this._editorStyleSheets.delete(editorId); - } - registerDecorationType(key, options, parentTypeKey, editor) { - let provider = this._decorationOptionProviders.get(key); - if (!provider) { - const styleSheet = this._getOrCreateStyleSheet(editor); - const providerArgs = { - styleSheet: styleSheet, - key: key, - parentTypeKey: parentTypeKey, - options: options || Object.create(null) - }; - if (!parentTypeKey) { - provider = new DecorationTypeOptionsProvider(this._themeService, styleSheet, providerArgs); - } - else { - provider = new DecorationSubTypeOptionsProvider(this._themeService, styleSheet, providerArgs); - } - this._decorationOptionProviders.set(key, provider); - } - provider.refCount++; - } - removeDecorationType(key) { - const provider = this._decorationOptionProviders.get(key); - if (provider) { - provider.refCount--; - if (provider.refCount <= 0) { - this._decorationOptionProviders.delete(key); - provider.dispose(); - this.listCodeEditors().forEach((ed) => ed.removeDecorations(key)); - } - } - } - resolveDecorationOptions(decorationTypeKey, writable) { - const provider = this._decorationOptionProviders.get(decorationTypeKey); - if (!provider) { - throw new Error('Unknown decoration type key: ' + decorationTypeKey); - } - return provider.getOptions(this, writable); - } -}; -CodeEditorServiceImpl = __decorate([ - __param(0, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__["IThemeService"]) -], CodeEditorServiceImpl); - -class DecorationSubTypeOptionsProvider { - constructor(themeService, styleSheet, providerArgs) { - this._styleSheet = styleSheet; - this._styleSheet.ref(); - this._parentTypeKey = providerArgs.parentTypeKey; - this.refCount = 0; - this._beforeContentRules = new DecorationCSSRules(3 /* BeforeContentClassName */, providerArgs, themeService); - this._afterContentRules = new DecorationCSSRules(4 /* AfterContentClassName */, providerArgs, themeService); - } - getOptions(codeEditorService, writable) { - const options = codeEditorService.resolveDecorationOptions(this._parentTypeKey, true); - if (this._beforeContentRules) { - options.beforeContentClassName = this._beforeContentRules.className; - } - if (this._afterContentRules) { - options.afterContentClassName = this._afterContentRules.className; - } - return options; - } - dispose() { - if (this._beforeContentRules) { - this._beforeContentRules.dispose(); - this._beforeContentRules = null; - } - if (this._afterContentRules) { - this._afterContentRules.dispose(); - this._afterContentRules = null; - } - this._styleSheet.unref(); - } -} -class DecorationTypeOptionsProvider { - constructor(themeService, styleSheet, providerArgs) { - this._disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this._styleSheet = styleSheet; - this._styleSheet.ref(); - this.refCount = 0; - const createCSSRules = (type) => { - const rules = new DecorationCSSRules(type, providerArgs, themeService); - this._disposables.add(rules); - if (rules.hasContent) { - return rules.className; - } - return undefined; - }; - const createInlineCSSRules = (type) => { - const rules = new DecorationCSSRules(type, providerArgs, themeService); - this._disposables.add(rules); - if (rules.hasContent) { - return { className: rules.className, hasLetterSpacing: rules.hasLetterSpacing }; - } - return null; - }; - this.className = createCSSRules(0 /* ClassName */); - const inlineData = createInlineCSSRules(1 /* InlineClassName */); - if (inlineData) { - this.inlineClassName = inlineData.className; - this.inlineClassNameAffectsLetterSpacing = inlineData.hasLetterSpacing; - } - this.beforeContentClassName = createCSSRules(3 /* BeforeContentClassName */); - this.afterContentClassName = createCSSRules(4 /* AfterContentClassName */); - this.glyphMarginClassName = createCSSRules(2 /* GlyphMarginClassName */); - const options = providerArgs.options; - this.isWholeLine = Boolean(options.isWholeLine); - this.stickiness = options.rangeBehavior; - const lightOverviewRulerColor = options.light && options.light.overviewRulerColor || options.overviewRulerColor; - const darkOverviewRulerColor = options.dark && options.dark.overviewRulerColor || options.overviewRulerColor; - if (typeof lightOverviewRulerColor !== 'undefined' - || typeof darkOverviewRulerColor !== 'undefined') { - this.overviewRuler = { - color: lightOverviewRulerColor || darkOverviewRulerColor, - darkColor: darkOverviewRulerColor || lightOverviewRulerColor, - position: options.overviewRulerLane || _common_model_js__WEBPACK_IMPORTED_MODULE_6__["OverviewRulerLane"].Center - }; - } - } - getOptions(codeEditorService, writable) { - if (!writable) { - return this; - } - return { - inlineClassName: this.inlineClassName, - beforeContentClassName: this.beforeContentClassName, - afterContentClassName: this.afterContentClassName, - className: this.className, - glyphMarginClassName: this.glyphMarginClassName, - isWholeLine: this.isWholeLine, - overviewRuler: this.overviewRuler, - stickiness: this.stickiness - }; - } - dispose() { - this._disposables.dispose(); - this._styleSheet.unref(); - } -} -const _CSS_MAP = { - color: 'color:{0} !important;', - opacity: 'opacity:{0};', - backgroundColor: 'background-color:{0};', - outline: 'outline:{0};', - outlineColor: 'outline-color:{0};', - outlineStyle: 'outline-style:{0};', - outlineWidth: 'outline-width:{0};', - border: 'border:{0};', - borderColor: 'border-color:{0};', - borderRadius: 'border-radius:{0};', - borderSpacing: 'border-spacing:{0};', - borderStyle: 'border-style:{0};', - borderWidth: 'border-width:{0};', - fontStyle: 'font-style:{0};', - fontWeight: 'font-weight:{0};', - textDecoration: 'text-decoration:{0};', - cursor: 'cursor:{0};', - letterSpacing: 'letter-spacing:{0};', - gutterIconPath: 'background:{0} center center no-repeat;', - gutterIconSize: 'background-size:{0};', - contentText: 'content:\'{0}\';', - contentIconPath: 'content:{0};', - margin: 'margin:{0};', - width: 'width:{0};', - height: 'height:{0};' -}; -class DecorationCSSRules { - constructor(ruleType, providerArgs, themeService) { - this._theme = themeService.getColorTheme(); - this._ruleType = ruleType; - this._providerArgs = providerArgs; - this._usesThemeColors = false; - this._hasContent = false; - this._hasLetterSpacing = false; - let className = CSSNameHelper.getClassName(this._providerArgs.key, ruleType); - if (this._providerArgs.parentTypeKey) { - className = className + ' ' + CSSNameHelper.getClassName(this._providerArgs.parentTypeKey, ruleType); - } - this._className = className; - this._unThemedSelector = CSSNameHelper.getSelector(this._providerArgs.key, this._providerArgs.parentTypeKey, ruleType); - this._buildCSS(); - if (this._usesThemeColors) { - this._themeListener = themeService.onDidColorThemeChange(theme => { - this._theme = themeService.getColorTheme(); - this._removeCSS(); - this._buildCSS(); - }); - } - else { - this._themeListener = null; - } - } - dispose() { - if (this._hasContent) { - this._removeCSS(); - this._hasContent = false; - } - if (this._themeListener) { - this._themeListener.dispose(); - this._themeListener = null; - } - } - get hasContent() { - return this._hasContent; - } - get hasLetterSpacing() { - return this._hasLetterSpacing; - } - get className() { - return this._className; - } - _buildCSS() { - const options = this._providerArgs.options; - let unthemedCSS, lightCSS, darkCSS; - switch (this._ruleType) { - case 0 /* ClassName */: - unthemedCSS = this.getCSSTextForModelDecorationClassName(options); - lightCSS = this.getCSSTextForModelDecorationClassName(options.light); - darkCSS = this.getCSSTextForModelDecorationClassName(options.dark); - break; - case 1 /* InlineClassName */: - unthemedCSS = this.getCSSTextForModelDecorationInlineClassName(options); - lightCSS = this.getCSSTextForModelDecorationInlineClassName(options.light); - darkCSS = this.getCSSTextForModelDecorationInlineClassName(options.dark); - break; - case 2 /* GlyphMarginClassName */: - unthemedCSS = this.getCSSTextForModelDecorationGlyphMarginClassName(options); - lightCSS = this.getCSSTextForModelDecorationGlyphMarginClassName(options.light); - darkCSS = this.getCSSTextForModelDecorationGlyphMarginClassName(options.dark); - break; - case 3 /* BeforeContentClassName */: - unthemedCSS = this.getCSSTextForModelDecorationContentClassName(options.before); - lightCSS = this.getCSSTextForModelDecorationContentClassName(options.light && options.light.before); - darkCSS = this.getCSSTextForModelDecorationContentClassName(options.dark && options.dark.before); - break; - case 4 /* AfterContentClassName */: - unthemedCSS = this.getCSSTextForModelDecorationContentClassName(options.after); - lightCSS = this.getCSSTextForModelDecorationContentClassName(options.light && options.light.after); - darkCSS = this.getCSSTextForModelDecorationContentClassName(options.dark && options.dark.after); - break; - default: - throw new Error('Unknown rule type: ' + this._ruleType); - } - const sheet = this._providerArgs.styleSheet; - let hasContent = false; - if (unthemedCSS.length > 0) { - sheet.insertRule(`${this._unThemedSelector} {${unthemedCSS}}`, 0); - hasContent = true; - } - if (lightCSS.length > 0) { - sheet.insertRule(`.vs${this._unThemedSelector} {${lightCSS}}`, 0); - hasContent = true; - } - if (darkCSS.length > 0) { - sheet.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector} {${darkCSS}}`, 0); - hasContent = true; - } - this._hasContent = hasContent; - } - _removeCSS() { - this._providerArgs.styleSheet.removeRulesContainingSelector(this._unThemedSelector); - } - /** - * Build the CSS for decorations styled via `className`. - */ - getCSSTextForModelDecorationClassName(opts) { - if (!opts) { - return ''; - } - const cssTextArr = []; - this.collectCSSText(opts, ['backgroundColor'], cssTextArr); - this.collectCSSText(opts, ['outline', 'outlineColor', 'outlineStyle', 'outlineWidth'], cssTextArr); - this.collectBorderSettingsCSSText(opts, cssTextArr); - return cssTextArr.join(''); - } - /** - * Build the CSS for decorations styled via `inlineClassName`. - */ - getCSSTextForModelDecorationInlineClassName(opts) { - if (!opts) { - return ''; - } - const cssTextArr = []; - this.collectCSSText(opts, ['fontStyle', 'fontWeight', 'textDecoration', 'cursor', 'color', 'opacity', 'letterSpacing'], cssTextArr); - if (opts.letterSpacing) { - this._hasLetterSpacing = true; - } - return cssTextArr.join(''); - } - /** - * Build the CSS for decorations styled before or after content. - */ - getCSSTextForModelDecorationContentClassName(opts) { - if (!opts) { - return ''; - } - const cssTextArr = []; - if (typeof opts !== 'undefined') { - this.collectBorderSettingsCSSText(opts, cssTextArr); - if (typeof opts.contentIconPath !== 'undefined') { - cssTextArr.push(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["format"](_CSS_MAP.contentIconPath, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["asCSSUrl"](_base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"].revive(opts.contentIconPath)))); - } - if (typeof opts.contentText === 'string') { - const truncated = opts.contentText.match(/^.*$/m)[0]; // only take first line - const escaped = truncated.replace(/['\\]/g, '\\$&'); - cssTextArr.push(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["format"](_CSS_MAP.contentText, escaped)); - } - this.collectCSSText(opts, ['fontStyle', 'fontWeight', 'textDecoration', 'color', 'opacity', 'backgroundColor', 'margin'], cssTextArr); - if (this.collectCSSText(opts, ['width', 'height'], cssTextArr)) { - cssTextArr.push('display:inline-block;'); - } - } - return cssTextArr.join(''); - } - /** - * Build the CSS for decorations styled via `glpyhMarginClassName`. - */ - getCSSTextForModelDecorationGlyphMarginClassName(opts) { - if (!opts) { - return ''; - } - const cssTextArr = []; - if (typeof opts.gutterIconPath !== 'undefined') { - cssTextArr.push(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["format"](_CSS_MAP.gutterIconPath, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["asCSSUrl"](_base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"].revive(opts.gutterIconPath)))); - if (typeof opts.gutterIconSize !== 'undefined') { - cssTextArr.push(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["format"](_CSS_MAP.gutterIconSize, opts.gutterIconSize)); - } - } - return cssTextArr.join(''); - } - collectBorderSettingsCSSText(opts, cssTextArr) { - if (this.collectCSSText(opts, ['border', 'borderColor', 'borderRadius', 'borderSpacing', 'borderStyle', 'borderWidth'], cssTextArr)) { - cssTextArr.push(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["format"]('box-sizing: border-box;')); - return true; - } - return false; - } - collectCSSText(opts, properties, cssTextArr) { - const lenBefore = cssTextArr.length; - for (let property of properties) { - const value = this.resolveValue(opts[property]); - if (typeof value === 'string') { - cssTextArr.push(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["format"](_CSS_MAP[property], value)); - } - } - return cssTextArr.length !== lenBefore; - } - resolveValue(value) { - if (Object(_common_editorCommon_js__WEBPACK_IMPORTED_MODULE_5__["isThemeColor"])(value)) { - this._usesThemeColors = true; - const color = this._theme.getColor(value.id); - if (color) { - return color.toString(); - } - return 'transparent'; - } - return value; - } -} -class CSSNameHelper { - static getClassName(key, type) { - return 'ced-' + key + '-' + type; - } - static getSelector(key, parentKey, ruleType) { - let selector = '.monaco-editor .' + this.getClassName(key, ruleType); - if (parentKey) { - selector = selector + '.' + this.getClassName(parentKey, ruleType); - } - if (ruleType === 3 /* BeforeContentClassName */) { - selector += '::before'; - } - else if (ruleType === 4 /* AfterContentClassName */) { - selector += '::after'; - } - return selector; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/services/openerService.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/services/openerService.js ***! - \************************************************************************************/ -/*! exports provided: OpenerService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OpenerService", function() { return OpenerService; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/* harmony import */ var _base_common_marshalling_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/marshalling.js */ "./node_modules/monaco-editor/esm/vs/base/common/marshalling.js"); -/* harmony import */ var _base_common_network_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _base_common_resources_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _codeEditorService_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/opener/common/opener.js */ "./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js"); -/* harmony import */ var _platform_editor_common_editor_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/editor/common/editor.js */ "./node_modules/monaco-editor/esm/vs/platform/editor/common/editor.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - -let CommandOpener = class CommandOpener { - constructor(_commandService) { - this._commandService = _commandService; - } - open(target) { - return __awaiter(this, void 0, void 0, function* () { - if (!Object(_platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_8__["matchesScheme"])(target, _base_common_network_js__WEBPACK_IMPORTED_MODULE_3__["Schemas"].command)) { - return false; - } - // run command or bail out if command isn't known - if (typeof target === 'string') { - target = _base_common_uri_js__WEBPACK_IMPORTED_MODULE_5__["URI"].parse(target); - } - // execute as command - let args = []; - try { - args = Object(_base_common_marshalling_js__WEBPACK_IMPORTED_MODULE_2__["parse"])(decodeURIComponent(target.query)); - } - catch (_a) { - // ignore and retry - try { - args = Object(_base_common_marshalling_js__WEBPACK_IMPORTED_MODULE_2__["parse"])(target.query); - } - catch (_b) { - // ignore error - } - } - if (!Array.isArray(args)) { - args = [args]; - } - yield this._commandService.executeCommand(target.path, ...args); - return true; - }); - } -}; -CommandOpener = __decorate([ - __param(0, _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_7__["ICommandService"]) -], CommandOpener); -let EditorOpener = class EditorOpener { - constructor(_editorService) { - this._editorService = _editorService; - } - open(target, options) { - return __awaiter(this, void 0, void 0, function* () { - if (typeof target === 'string') { - target = _base_common_uri_js__WEBPACK_IMPORTED_MODULE_5__["URI"].parse(target); - } - let selection = undefined; - const match = /^L?(\d+)(?:,(\d+))?/.exec(target.fragment); - if (match) { - // support file:///some/file.js#73,84 - // support file:///some/file.js#L73 - selection = { - startLineNumber: parseInt(match[1]), - startColumn: match[2] ? parseInt(match[2]) : 1 - }; - // remove fragment - target = target.with({ fragment: '' }); - } - if (target.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_3__["Schemas"].file) { - target = Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_4__["normalizePath"])(target); // workaround for non-normalized paths (https://github.com/Microsoft/vscode/issues/12954) - } - yield this._editorService.openCodeEditor({ resource: target, options: { selection, context: (options === null || options === void 0 ? void 0 : options.fromUserGesture) ? _platform_editor_common_editor_js__WEBPACK_IMPORTED_MODULE_9__["EditorOpenContext"].USER : _platform_editor_common_editor_js__WEBPACK_IMPORTED_MODULE_9__["EditorOpenContext"].API } }, this._editorService.getFocusedCodeEditor(), options === null || options === void 0 ? void 0 : options.openToSide); - return true; - }); - } -}; -EditorOpener = __decorate([ - __param(0, _codeEditorService_js__WEBPACK_IMPORTED_MODULE_6__["ICodeEditorService"]) -], EditorOpener); -let OpenerService = class OpenerService { - constructor(editorService, commandService) { - this._openers = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_1__["LinkedList"](); - this._validators = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_1__["LinkedList"](); - this._resolvers = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_1__["LinkedList"](); - // Default external opener is going through window.open() - this._externalOpener = { - openExternal: href => { - // ensure to open HTTP/HTTPS links into new windows - // to not trigger a navigation. Any other link is - // safe to be set as HREF to prevent a blank window - // from opening. - if (Object(_platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_8__["matchesScheme"])(href, _base_common_network_js__WEBPACK_IMPORTED_MODULE_3__["Schemas"].http) || Object(_platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_8__["matchesScheme"])(href, _base_common_network_js__WEBPACK_IMPORTED_MODULE_3__["Schemas"].https)) { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["windowOpenNoOpener"](href); - } - else { - window.location.href = href; - } - return Promise.resolve(true); - } - }; - // Default opener: maito, http(s), command, and catch-all-editors - this._openers.push({ - open: (target, options) => __awaiter(this, void 0, void 0, function* () { - if ((options === null || options === void 0 ? void 0 : options.openExternal) || Object(_platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_8__["matchesScheme"])(target, _base_common_network_js__WEBPACK_IMPORTED_MODULE_3__["Schemas"].mailto) || Object(_platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_8__["matchesScheme"])(target, _base_common_network_js__WEBPACK_IMPORTED_MODULE_3__["Schemas"].http) || Object(_platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_8__["matchesScheme"])(target, _base_common_network_js__WEBPACK_IMPORTED_MODULE_3__["Schemas"].https)) { - // open externally - yield this._doOpenExternal(target, options); - return true; - } - return false; - }) - }); - this._openers.push(new CommandOpener(commandService)); - this._openers.push(new EditorOpener(editorService)); - } - open(target, options) { - return __awaiter(this, void 0, void 0, function* () { - // check with contributed validators - for (const validator of this._validators.toArray()) { - if (!(yield validator.shouldOpen(target))) { - return false; - } - } - // check with contributed openers - for (const opener of this._openers.toArray()) { - const handled = yield opener.open(target, options); - if (handled) { - return true; - } - } - return false; - }); - } - resolveExternalUri(resource, options) { - return __awaiter(this, void 0, void 0, function* () { - for (const resolver of this._resolvers.toArray()) { - const result = yield resolver.resolveExternalUri(resource, options); - if (result) { - return result; - } - } - return { resolved: resource, dispose: () => { } }; - }); - } - _doOpenExternal(resource, options) { - return __awaiter(this, void 0, void 0, function* () { - //todo@joh IExternalUriResolver should support `uri: URI | string` - const uri = typeof resource === 'string' ? _base_common_uri_js__WEBPACK_IMPORTED_MODULE_5__["URI"].parse(resource) : resource; - const { resolved } = yield this.resolveExternalUri(uri, options); - if (typeof resource === 'string' && uri.toString() === resolved.toString()) { - // open the url-string AS IS - return this._externalOpener.openExternal(resource); - } - else { - // open URI using the toString(noEncode)+encodeURI-trick - return this._externalOpener.openExternal(encodeURI(resolved.toString(true))); - } - }); - } - dispose() { - this._validators.clear(); - } -}; -OpenerService = __decorate([ - __param(0, _codeEditorService_js__WEBPACK_IMPORTED_MODULE_6__["ICodeEditorService"]), - __param(1, _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_7__["ICommandService"]) -], OpenerService); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/view/domLineBreaksComputer.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/view/domLineBreaksComputer.js ***! - \****************************************************************************************/ -/*! exports provided: DOMLineBreaksComputerFactory */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMLineBreaksComputerFactory", function() { return DOMLineBreaksComputerFactory; }); -/* harmony import */ var _common_viewModel_splitLinesCollection_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/viewModel/splitLinesCollection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/splitLinesCollection.js"); -/* harmony import */ var _common_core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/stringBuilder.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/stringBuilder.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _config_configuration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config/configuration.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/config/configuration.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class DOMLineBreaksComputerFactory { - static create() { - return new DOMLineBreaksComputerFactory(); - } - constructor() { - } - createLineBreaksComputer(fontInfo, tabSize, wrappingColumn, wrappingIndent) { - tabSize = tabSize | 0; //@perf - wrappingColumn = +wrappingColumn; //@perf - let requests = []; - return { - addRequest: (lineText, previousLineBreakData) => { - requests.push(lineText); - }, - finalize: () => { - return createLineBreaks(requests, fontInfo, tabSize, wrappingColumn, wrappingIndent); - } - }; - } -} -function createLineBreaks(requests, fontInfo, tabSize, firstLineBreakColumn, wrappingIndent) { - if (firstLineBreakColumn === -1) { - const result = []; - for (let i = 0, len = requests.length; i < len; i++) { - result[i] = null; - } - return result; - } - const overallWidth = Math.round(firstLineBreakColumn * fontInfo.typicalHalfwidthCharacterWidth); - // Cannot respect WrappingIndent.Indent and WrappingIndent.DeepIndent because that would require - // two dom layouts, in order to first set the width of the first line, and then set the width of the wrapped lines - if (wrappingIndent === 2 /* Indent */ || wrappingIndent === 3 /* DeepIndent */) { - wrappingIndent = 1 /* Same */; - } - const containerDomNode = document.createElement('div'); - _config_configuration_js__WEBPACK_IMPORTED_MODULE_3__["Configuration"].applyFontInfoSlow(containerDomNode, fontInfo); - const sb = Object(_common_core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_1__["createStringBuilder"])(10000); - const firstNonWhitespaceIndices = []; - const wrappedTextIndentLengths = []; - const renderLineContents = []; - const allCharOffsets = []; - const allVisibleColumns = []; - for (let i = 0; i < requests.length; i++) { - const lineContent = requests[i]; - let firstNonWhitespaceIndex = 0; - let wrappedTextIndentLength = 0; - let width = overallWidth; - if (wrappingIndent !== 0 /* None */) { - firstNonWhitespaceIndex = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["firstNonWhitespaceIndex"](lineContent); - if (firstNonWhitespaceIndex === -1) { - // all whitespace line - firstNonWhitespaceIndex = 0; - } - else { - // Track existing indent - for (let i = 0; i < firstNonWhitespaceIndex; i++) { - const charWidth = (lineContent.charCodeAt(i) === 9 /* Tab */ - ? (tabSize - (wrappedTextIndentLength % tabSize)) - : 1); - wrappedTextIndentLength += charWidth; - } - const indentWidth = Math.ceil(fontInfo.spaceWidth * wrappedTextIndentLength); - // Force sticking to beginning of line if no character would fit except for the indentation - if (indentWidth + fontInfo.typicalFullwidthCharacterWidth > overallWidth) { - firstNonWhitespaceIndex = 0; - wrappedTextIndentLength = 0; - } - else { - width = overallWidth - indentWidth; - } - } - } - const renderLineContent = lineContent.substr(firstNonWhitespaceIndex); - const tmp = renderLine(renderLineContent, wrappedTextIndentLength, tabSize, width, sb); - firstNonWhitespaceIndices[i] = firstNonWhitespaceIndex; - wrappedTextIndentLengths[i] = wrappedTextIndentLength; - renderLineContents[i] = renderLineContent; - allCharOffsets[i] = tmp[0]; - allVisibleColumns[i] = tmp[1]; - } - containerDomNode.innerHTML = sb.build(); - containerDomNode.style.position = 'absolute'; - containerDomNode.style.top = '10000'; - containerDomNode.style.wordWrap = 'break-word'; - document.body.appendChild(containerDomNode); - let range = document.createRange(); - const lineDomNodes = Array.prototype.slice.call(containerDomNode.children, 0); - let result = []; - for (let i = 0; i < requests.length; i++) { - const lineDomNode = lineDomNodes[i]; - const breakOffsets = readLineBreaks(range, lineDomNode, renderLineContents[i], allCharOffsets[i]); - if (breakOffsets === null) { - result[i] = null; - continue; - } - const firstNonWhitespaceIndex = firstNonWhitespaceIndices[i]; - const wrappedTextIndentLength = wrappedTextIndentLengths[i]; - const visibleColumns = allVisibleColumns[i]; - const breakOffsetsVisibleColumn = []; - for (let j = 0, len = breakOffsets.length; j < len; j++) { - breakOffsetsVisibleColumn[j] = visibleColumns[breakOffsets[j]]; - } - if (firstNonWhitespaceIndex !== 0) { - // All break offsets are relative to the renderLineContent, make them absolute again - for (let j = 0, len = breakOffsets.length; j < len; j++) { - breakOffsets[j] += firstNonWhitespaceIndex; - } - } - result[i] = new _common_viewModel_splitLinesCollection_js__WEBPACK_IMPORTED_MODULE_0__["LineBreakData"](breakOffsets, breakOffsetsVisibleColumn, wrappedTextIndentLength); - } - document.body.removeChild(containerDomNode); - return result; -} -function renderLine(lineContent, initialVisibleColumn, tabSize, width, sb) { - sb.appendASCIIString('
    '); - // if (containsRTL) { - // sb.appendASCIIString('" dir="ltr'); - // } - const len = lineContent.length; - let visibleColumn = initialVisibleColumn; - let charOffset = 0; - let charOffsets = []; - let visibleColumns = []; - let nextCharCode = (0 < len ? lineContent.charCodeAt(0) : 0 /* Null */); - sb.appendASCIIString(''); - for (let charIndex = 0; charIndex < len; charIndex++) { - if (charIndex !== 0 && charIndex % 16384 /* SPAN_MODULO_LIMIT */ === 0) { - sb.appendASCIIString(''); - } - charOffsets[charIndex] = charOffset; - visibleColumns[charIndex] = visibleColumn; - const charCode = nextCharCode; - nextCharCode = (charIndex + 1 < len ? lineContent.charCodeAt(charIndex + 1) : 0 /* Null */); - let producedCharacters = 1; - let charWidth = 1; - switch (charCode) { - case 9 /* Tab */: - producedCharacters = (tabSize - (visibleColumn % tabSize)); - charWidth = producedCharacters; - for (let space = 1; space <= producedCharacters; space++) { - if (space < producedCharacters) { - sb.write1(0xA0); //   - } - else { - sb.appendASCII(32 /* Space */); - } - } - break; - case 32 /* Space */: - if (nextCharCode === 32 /* Space */) { - sb.write1(0xA0); //   - } - else { - sb.appendASCII(32 /* Space */); - } - break; - case 60 /* LessThan */: - sb.appendASCIIString('<'); - break; - case 62 /* GreaterThan */: - sb.appendASCIIString('>'); - break; - case 38 /* Ampersand */: - sb.appendASCIIString('&'); - break; - case 0 /* Null */: - sb.appendASCIIString('�'); - break; - case 65279 /* UTF8_BOM */: - case 8232 /* LINE_SEPARATOR */: - case 8233 /* PARAGRAPH_SEPARATOR */: - case 133 /* NEXT_LINE */: - sb.write1(0xFFFD); - break; - default: - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["isFullWidthCharacter"](charCode)) { - charWidth++; - } - // if (renderControlCharacters && charCode < 32) { - // sb.write1(9216 + charCode); - // } else { - sb.write1(charCode); - // } - } - charOffset += producedCharacters; - visibleColumn += charWidth; - } - sb.appendASCIIString(''); - charOffsets[lineContent.length] = charOffset; - visibleColumns[lineContent.length] = visibleColumn; - sb.appendASCIIString('
    '); - return [charOffsets, visibleColumns]; -} -function readLineBreaks(range, lineDomNode, lineContent, charOffsets) { - if (lineContent.length <= 1) { - return null; - } - const spans = Array.prototype.slice.call(lineDomNode.children, 0); - const breakOffsets = []; - try { - discoverBreaks(range, spans, charOffsets, 0, null, lineContent.length - 1, null, breakOffsets); - } - catch (err) { - console.log(err); - return null; - } - if (breakOffsets.length === 0) { - return null; - } - breakOffsets.push(lineContent.length); - return breakOffsets; -} -function discoverBreaks(range, spans, charOffsets, low, lowRects, high, highRects, result) { - if (low === high) { - return; - } - lowRects = lowRects || readClientRect(range, spans, charOffsets[low], charOffsets[low + 1]); - highRects = highRects || readClientRect(range, spans, charOffsets[high], charOffsets[high + 1]); - if (Math.abs(lowRects[0].top - highRects[0].top) <= 0.1) { - // same line - return; - } - // there is at least one line break between these two offsets - if (low + 1 === high) { - // the two characters are adjacent, so the line break must be exactly between them - result.push(high); - return; - } - const mid = low + ((high - low) / 2) | 0; - const midRects = readClientRect(range, spans, charOffsets[mid], charOffsets[mid + 1]); - discoverBreaks(range, spans, charOffsets, low, lowRects, mid, midRects, result); - discoverBreaks(range, spans, charOffsets, mid, midRects, high, highRects, result); -} -function readClientRect(range, spans, startOffset, endOffset) { - range.setStart(spans[(startOffset / 16384 /* SPAN_MODULO_LIMIT */) | 0].firstChild, startOffset % 16384 /* SPAN_MODULO_LIMIT */); - range.setEnd(spans[(endOffset / 16384 /* SPAN_MODULO_LIMIT */) | 0].firstChild, endOffset % 16384 /* SPAN_MODULO_LIMIT */); - return range.getClientRects(); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/view/dynamicViewOverlay.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/view/dynamicViewOverlay.js ***! - \*************************************************************************************/ -/*! exports provided: DynamicViewOverlay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DynamicViewOverlay", function() { return DynamicViewOverlay; }); -/* harmony import */ var _common_viewModel_viewEventHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/viewModel/viewEventHandler.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewEventHandler.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class DynamicViewOverlay extends _common_viewModel_viewEventHandler_js__WEBPACK_IMPORTED_MODULE_0__["ViewEventHandler"] { -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewController.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/view/viewController.js ***! - \*********************************************************************************/ -/*! exports provided: ViewController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewController", function() { return ViewController; }); -/* harmony import */ var _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../controller/coreCommands.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/coreCommands.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class ViewController { - constructor(configuration, viewModel, userInputEvents, commandDelegate) { - this.configuration = configuration; - this.viewModel = viewModel; - this.userInputEvents = userInputEvents; - this.commandDelegate = commandDelegate; - } - paste(text, pasteOnNewLine, multicursorText, mode) { - this.commandDelegate.paste(text, pasteOnNewLine, multicursorText, mode); - } - type(text) { - this.commandDelegate.type(text); - } - replacePreviousChar(text, replaceCharCnt) { - this.commandDelegate.replacePreviousChar(text, replaceCharCnt); - } - compositionStart() { - this.commandDelegate.startComposition(); - } - compositionEnd() { - this.commandDelegate.endComposition(); - } - cut() { - this.commandDelegate.cut(); - } - setSelection(modelSelection) { - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].SetSelection.runCoreEditorCommand(this.viewModel, { - source: 'keyboard', - selection: modelSelection - }); - } - _validateViewColumn(viewPosition) { - const minColumn = this.viewModel.getLineMinColumn(viewPosition.lineNumber); - if (viewPosition.column < minColumn) { - return new _common_core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](viewPosition.lineNumber, minColumn); - } - return viewPosition; - } - _hasMulticursorModifier(data) { - switch (this.configuration.options.get(61 /* multiCursorModifier */)) { - case 'altKey': - return data.altKey; - case 'ctrlKey': - return data.ctrlKey; - case 'metaKey': - return data.metaKey; - default: - return false; - } - } - _hasNonMulticursorModifier(data) { - switch (this.configuration.options.get(61 /* multiCursorModifier */)) { - case 'altKey': - return data.ctrlKey || data.metaKey; - case 'ctrlKey': - return data.altKey || data.metaKey; - case 'metaKey': - return data.ctrlKey || data.altKey; - default: - return false; - } - } - dispatchMouse(data) { - const options = this.configuration.options; - const selectionClipboardIsOn = (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isLinux"] && options.get(88 /* selectionClipboard */)); - const columnSelection = options.get(13 /* columnSelection */); - if (data.middleButton && !selectionClipboardIsOn) { - this._columnSelect(data.position, data.mouseColumn, data.inSelectionMode); - } - else if (data.startedOnLineNumbers) { - // If the dragging started on the gutter, then have operations work on the entire line - if (this._hasMulticursorModifier(data)) { - if (data.inSelectionMode) { - this._lastCursorLineSelect(data.position); - } - else { - this._createCursor(data.position, true); - } - } - else { - if (data.inSelectionMode) { - this._lineSelectDrag(data.position); - } - else { - this._lineSelect(data.position); - } - } - } - else if (data.mouseDownCount >= 4) { - this._selectAll(); - } - else if (data.mouseDownCount === 3) { - if (this._hasMulticursorModifier(data)) { - if (data.inSelectionMode) { - this._lastCursorLineSelectDrag(data.position); - } - else { - this._lastCursorLineSelect(data.position); - } - } - else { - if (data.inSelectionMode) { - this._lineSelectDrag(data.position); - } - else { - this._lineSelect(data.position); - } - } - } - else if (data.mouseDownCount === 2) { - if (this._hasMulticursorModifier(data)) { - this._lastCursorWordSelect(data.position); - } - else { - if (data.inSelectionMode) { - this._wordSelectDrag(data.position); - } - else { - this._wordSelect(data.position); - } - } - } - else { - if (this._hasMulticursorModifier(data)) { - if (!this._hasNonMulticursorModifier(data)) { - if (data.shiftKey) { - this._columnSelect(data.position, data.mouseColumn, true); - } - else { - // Do multi-cursor operations only when purely alt is pressed - if (data.inSelectionMode) { - this._lastCursorMoveToSelect(data.position); - } - else { - this._createCursor(data.position, false); - } - } - } - } - else { - if (data.inSelectionMode) { - if (data.altKey) { - this._columnSelect(data.position, data.mouseColumn, true); - } - else { - if (columnSelection) { - this._columnSelect(data.position, data.mouseColumn, true); - } - else { - this._moveToSelect(data.position); - } - } - } - else { - this.moveTo(data.position); - } - } - } - } - _usualArgs(viewPosition) { - viewPosition = this._validateViewColumn(viewPosition); - return { - source: 'mouse', - position: this._convertViewToModelPosition(viewPosition), - viewPosition: viewPosition - }; - } - moveTo(viewPosition) { - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].MoveTo.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition)); - } - _moveToSelect(viewPosition) { - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].MoveToSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition)); - } - _columnSelect(viewPosition, mouseColumn, doColumnSelect) { - viewPosition = this._validateViewColumn(viewPosition); - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].ColumnSelect.runCoreEditorCommand(this.viewModel, { - source: 'mouse', - position: this._convertViewToModelPosition(viewPosition), - viewPosition: viewPosition, - mouseColumn: mouseColumn, - doColumnSelect: doColumnSelect - }); - } - _createCursor(viewPosition, wholeLine) { - viewPosition = this._validateViewColumn(viewPosition); - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].CreateCursor.runCoreEditorCommand(this.viewModel, { - source: 'mouse', - position: this._convertViewToModelPosition(viewPosition), - viewPosition: viewPosition, - wholeLine: wholeLine - }); - } - _lastCursorMoveToSelect(viewPosition) { - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition)); - } - _wordSelect(viewPosition) { - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].WordSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition)); - } - _wordSelectDrag(viewPosition) { - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].WordSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition)); - } - _lastCursorWordSelect(viewPosition) { - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].LastCursorWordSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition)); - } - _lineSelect(viewPosition) { - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].LineSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition)); - } - _lineSelectDrag(viewPosition) { - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].LineSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition)); - } - _lastCursorLineSelect(viewPosition) { - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].LastCursorLineSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition)); - } - _lastCursorLineSelectDrag(viewPosition) { - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(viewPosition)); - } - _selectAll() { - _controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__["CoreNavigationCommands"].SelectAll.runCoreEditorCommand(this.viewModel, { source: 'mouse' }); - } - // ---------------------- - _convertViewToModelPosition(viewPosition) { - return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(viewPosition); - } - emitKeyDown(e) { - this.userInputEvents.emitKeyDown(e); - } - emitKeyUp(e) { - this.userInputEvents.emitKeyUp(e); - } - emitContextMenu(e) { - this.userInputEvents.emitContextMenu(e); - } - emitMouseMove(e) { - this.userInputEvents.emitMouseMove(e); - } - emitMouseLeave(e) { - this.userInputEvents.emitMouseLeave(e); - } - emitMouseUp(e) { - this.userInputEvents.emitMouseUp(e); - } - emitMouseDown(e) { - this.userInputEvents.emitMouseDown(e); - } - emitMouseDrag(e) { - this.userInputEvents.emitMouseDrag(e); - } - emitMouseDrop(e) { - this.userInputEvents.emitMouseDrop(e); - } - emitMouseWheel(e) { - this.userInputEvents.emitMouseWheel(e); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewImpl.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/view/viewImpl.js ***! - \***************************************************************************/ -/*! exports provided: View */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "View", function() { return View; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _controller_pointerHandler_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../controller/pointerHandler.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/pointerHandler.js"); -/* harmony import */ var _controller_textAreaHandler_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../controller/textAreaHandler.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaHandler.js"); -/* harmony import */ var _viewController_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./viewController.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewController.js"); -/* harmony import */ var _viewUserInputEvents_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./viewUserInputEvents.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewUserInputEvents.js"); -/* harmony import */ var _viewOverlays_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./viewOverlays.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewOverlays.js"); -/* harmony import */ var _viewPart_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/* harmony import */ var _viewParts_contentWidgets_contentWidgets_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../viewParts/contentWidgets/contentWidgets.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js"); -/* harmony import */ var _viewParts_currentLineHighlight_currentLineHighlight_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../viewParts/currentLineHighlight/currentLineHighlight.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js"); -/* harmony import */ var _viewParts_decorations_decorations_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../viewParts/decorations/decorations.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.js"); -/* harmony import */ var _viewParts_editorScrollbar_editorScrollbar_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../viewParts/editorScrollbar/editorScrollbar.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js"); -/* harmony import */ var _viewParts_glyphMargin_glyphMargin_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../viewParts/glyphMargin/glyphMargin.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js"); -/* harmony import */ var _viewParts_indentGuides_indentGuides_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../viewParts/indentGuides/indentGuides.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js"); -/* harmony import */ var _viewParts_lineNumbers_lineNumbers_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../viewParts/lineNumbers/lineNumbers.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js"); -/* harmony import */ var _viewParts_lines_viewLines_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../viewParts/lines/viewLines.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLines.js"); -/* harmony import */ var _viewParts_linesDecorations_linesDecorations_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../viewParts/linesDecorations/linesDecorations.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js"); -/* harmony import */ var _viewParts_margin_margin_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../viewParts/margin/margin.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/margin/margin.js"); -/* harmony import */ var _viewParts_marginDecorations_marginDecorations_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../viewParts/marginDecorations/marginDecorations.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/marginDecorations/marginDecorations.js"); -/* harmony import */ var _viewParts_minimap_minimap_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../viewParts/minimap/minimap.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.js"); -/* harmony import */ var _viewParts_overlayWidgets_overlayWidgets_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../viewParts/overlayWidgets/overlayWidgets.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js"); -/* harmony import */ var _viewParts_overviewRuler_decorationsOverviewRuler_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../viewParts/overviewRuler/decorationsOverviewRuler.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js"); -/* harmony import */ var _viewParts_overviewRuler_overviewRuler_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../viewParts/overviewRuler/overviewRuler.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js"); -/* harmony import */ var _viewParts_rulers_rulers_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../viewParts/rulers/rulers.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.js"); -/* harmony import */ var _viewParts_scrollDecoration_scrollDecoration_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../viewParts/scrollDecoration/scrollDecoration.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js"); -/* harmony import */ var _viewParts_selections_selections_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../viewParts/selections/selections.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.js"); -/* harmony import */ var _viewParts_viewCursors_viewCursors_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../viewParts/viewCursors/viewCursors.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js"); -/* harmony import */ var _viewParts_viewZones_viewZones_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../viewParts/viewZones/viewZones.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewZones/viewZones.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../common/view/renderingContext.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/renderingContext.js"); -/* harmony import */ var _common_view_viewContext_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../common/view/viewContext.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/viewContext.js"); -/* harmony import */ var _common_viewLayout_viewLinesViewportData_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../../common/viewLayout/viewLinesViewportData.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLinesViewportData.js"); -/* harmony import */ var _common_viewModel_viewEventHandler_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../common/viewModel/viewEventHandler.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewEventHandler.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _controller_mouseTarget_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../controller/mouseTarget.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -class View extends _common_viewModel_viewEventHandler_js__WEBPACK_IMPORTED_MODULE_35__["ViewEventHandler"] { - constructor(commandDelegate, configuration, themeService, model, userInputEvents, overflowWidgetsDomNode) { - super(); - this._selections = [new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_1__["Selection"](1, 1, 1, 1)]; - this._renderAnimationFrame = null; - const viewController = new _viewController_js__WEBPACK_IMPORTED_MODULE_6__["ViewController"](configuration, model, userInputEvents, commandDelegate); - // The view context is passed on to most classes (basically to reduce param. counts in ctors) - this._context = new _common_view_viewContext_js__WEBPACK_IMPORTED_MODULE_33__["ViewContext"](configuration, themeService.getColorTheme(), model); - // Ensure the view is the first event handler in order to update the layout - this._context.addEventHandler(this); - this._register(themeService.onDidColorThemeChange(theme => { - this._context.theme.update(theme); - this._context.model.onDidColorThemeChange(); - this.render(true, false); - })); - this._viewParts = []; - // Keyboard handler - this._textAreaHandler = new _controller_textAreaHandler_js__WEBPACK_IMPORTED_MODULE_5__["TextAreaHandler"](this._context, viewController, this._createTextAreaHandlerHelper()); - this._viewParts.push(this._textAreaHandler); - // These two dom nodes must be constructed up front, since references are needed in the layout provider (scrolling & co.) - this._linesContent = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('div')); - this._linesContent.setClassName('lines-content' + ' monaco-editor-background'); - this._linesContent.setPosition('absolute'); - this.domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('div')); - this.domNode.setClassName(this._getEditorClassName()); - // Set role 'code' for better screen reader support https://github.com/microsoft/vscode/issues/93438 - this.domNode.setAttribute('role', 'code'); - this._overflowGuardContainer = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('div')); - _viewPart_js__WEBPACK_IMPORTED_MODULE_9__["PartFingerprints"].write(this._overflowGuardContainer, 3 /* OverflowGuard */); - this._overflowGuardContainer.setClassName('overflow-guard'); - this._scrollbar = new _viewParts_editorScrollbar_editorScrollbar_js__WEBPACK_IMPORTED_MODULE_13__["EditorScrollbar"](this._context, this._linesContent, this.domNode, this._overflowGuardContainer); - this._viewParts.push(this._scrollbar); - // View Lines - this._viewLines = new _viewParts_lines_viewLines_js__WEBPACK_IMPORTED_MODULE_17__["ViewLines"](this._context, this._linesContent); - // View Zones - this._viewZones = new _viewParts_viewZones_viewZones_js__WEBPACK_IMPORTED_MODULE_29__["ViewZones"](this._context); - this._viewParts.push(this._viewZones); - // Decorations overview ruler - const decorationsOverviewRuler = new _viewParts_overviewRuler_decorationsOverviewRuler_js__WEBPACK_IMPORTED_MODULE_23__["DecorationsOverviewRuler"](this._context); - this._viewParts.push(decorationsOverviewRuler); - const scrollDecoration = new _viewParts_scrollDecoration_scrollDecoration_js__WEBPACK_IMPORTED_MODULE_26__["ScrollDecorationViewPart"](this._context); - this._viewParts.push(scrollDecoration); - const contentViewOverlays = new _viewOverlays_js__WEBPACK_IMPORTED_MODULE_8__["ContentViewOverlays"](this._context); - this._viewParts.push(contentViewOverlays); - contentViewOverlays.addDynamicOverlay(new _viewParts_currentLineHighlight_currentLineHighlight_js__WEBPACK_IMPORTED_MODULE_11__["CurrentLineHighlightOverlay"](this._context)); - contentViewOverlays.addDynamicOverlay(new _viewParts_selections_selections_js__WEBPACK_IMPORTED_MODULE_27__["SelectionsOverlay"](this._context)); - contentViewOverlays.addDynamicOverlay(new _viewParts_indentGuides_indentGuides_js__WEBPACK_IMPORTED_MODULE_15__["IndentGuidesOverlay"](this._context)); - contentViewOverlays.addDynamicOverlay(new _viewParts_decorations_decorations_js__WEBPACK_IMPORTED_MODULE_12__["DecorationsOverlay"](this._context)); - const marginViewOverlays = new _viewOverlays_js__WEBPACK_IMPORTED_MODULE_8__["MarginViewOverlays"](this._context); - this._viewParts.push(marginViewOverlays); - marginViewOverlays.addDynamicOverlay(new _viewParts_currentLineHighlight_currentLineHighlight_js__WEBPACK_IMPORTED_MODULE_11__["CurrentLineMarginHighlightOverlay"](this._context)); - marginViewOverlays.addDynamicOverlay(new _viewParts_glyphMargin_glyphMargin_js__WEBPACK_IMPORTED_MODULE_14__["GlyphMarginOverlay"](this._context)); - marginViewOverlays.addDynamicOverlay(new _viewParts_marginDecorations_marginDecorations_js__WEBPACK_IMPORTED_MODULE_20__["MarginViewLineDecorationsOverlay"](this._context)); - marginViewOverlays.addDynamicOverlay(new _viewParts_linesDecorations_linesDecorations_js__WEBPACK_IMPORTED_MODULE_18__["LinesDecorationsOverlay"](this._context)); - marginViewOverlays.addDynamicOverlay(new _viewParts_lineNumbers_lineNumbers_js__WEBPACK_IMPORTED_MODULE_16__["LineNumbersOverlay"](this._context)); - const margin = new _viewParts_margin_margin_js__WEBPACK_IMPORTED_MODULE_19__["Margin"](this._context); - margin.getDomNode().appendChild(this._viewZones.marginDomNode); - margin.getDomNode().appendChild(marginViewOverlays.getDomNode()); - this._viewParts.push(margin); - // Content widgets - this._contentWidgets = new _viewParts_contentWidgets_contentWidgets_js__WEBPACK_IMPORTED_MODULE_10__["ViewContentWidgets"](this._context, this.domNode); - this._viewParts.push(this._contentWidgets); - this._viewCursors = new _viewParts_viewCursors_viewCursors_js__WEBPACK_IMPORTED_MODULE_28__["ViewCursors"](this._context); - this._viewParts.push(this._viewCursors); - // Overlay widgets - this._overlayWidgets = new _viewParts_overlayWidgets_overlayWidgets_js__WEBPACK_IMPORTED_MODULE_22__["ViewOverlayWidgets"](this._context); - this._viewParts.push(this._overlayWidgets); - const rulers = new _viewParts_rulers_rulers_js__WEBPACK_IMPORTED_MODULE_25__["Rulers"](this._context); - this._viewParts.push(rulers); - const minimap = new _viewParts_minimap_minimap_js__WEBPACK_IMPORTED_MODULE_21__["Minimap"](this._context); - this._viewParts.push(minimap); - // -------------- Wire dom nodes up - if (decorationsOverviewRuler) { - const overviewRulerData = this._scrollbar.getOverviewRulerLayoutInfo(); - overviewRulerData.parent.insertBefore(decorationsOverviewRuler.getDomNode(), overviewRulerData.insertBefore); - } - this._linesContent.appendChild(contentViewOverlays.getDomNode()); - this._linesContent.appendChild(rulers.domNode); - this._linesContent.appendChild(this._viewZones.domNode); - this._linesContent.appendChild(this._viewLines.getDomNode()); - this._linesContent.appendChild(this._contentWidgets.domNode); - this._linesContent.appendChild(this._viewCursors.getDomNode()); - this._overflowGuardContainer.appendChild(margin.getDomNode()); - this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()); - this._overflowGuardContainer.appendChild(scrollDecoration.getDomNode()); - this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea); - this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover); - this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()); - this._overflowGuardContainer.appendChild(minimap.getDomNode()); - this.domNode.appendChild(this._overflowGuardContainer); - if (overflowWidgetsDomNode) { - overflowWidgetsDomNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode); - } - else { - this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode); - } - this._applyLayout(); - // Pointer handler - this._pointerHandler = this._register(new _controller_pointerHandler_js__WEBPACK_IMPORTED_MODULE_4__["PointerHandler"](this._context, viewController, this._createPointerHandlerHelper())); - } - _flushAccumulatedAndRenderNow() { - this._renderNow(); - } - _createPointerHandlerHelper() { - return { - viewDomNode: this.domNode.domNode, - linesContentDomNode: this._linesContent.domNode, - focusTextArea: () => { - this.focus(); - }, - getLastRenderData: () => { - const lastViewCursorsRenderData = this._viewCursors.getLastRenderData() || []; - const lastTextareaPosition = this._textAreaHandler.getLastRenderData(); - return new _controller_mouseTarget_js__WEBPACK_IMPORTED_MODULE_37__["PointerHandlerLastRenderData"](lastViewCursorsRenderData, lastTextareaPosition); - }, - shouldSuppressMouseDownOnViewZone: (viewZoneId) => { - return this._viewZones.shouldSuppressMouseDownOnViewZone(viewZoneId); - }, - shouldSuppressMouseDownOnWidget: (widgetId) => { - return this._contentWidgets.shouldSuppressMouseDownOnWidget(widgetId); - }, - getPositionFromDOMInfo: (spanNode, offset) => { - this._flushAccumulatedAndRenderNow(); - return this._viewLines.getPositionFromDOMInfo(spanNode, offset); - }, - visibleRangeForPosition: (lineNumber, column) => { - this._flushAccumulatedAndRenderNow(); - return this._viewLines.visibleRangeForPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_30__["Position"](lineNumber, column)); - }, - getLineWidth: (lineNumber) => { - this._flushAccumulatedAndRenderNow(); - return this._viewLines.getLineWidth(lineNumber); - } - }; - } - _createTextAreaHandlerHelper() { - return { - visibleRangeForPositionRelativeToEditor: (lineNumber, column) => { - this._flushAccumulatedAndRenderNow(); - return this._viewLines.visibleRangeForPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_30__["Position"](lineNumber, column)); - } - }; - } - _applyLayout() { - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this.domNode.setWidth(layoutInfo.width); - this.domNode.setHeight(layoutInfo.height); - this._overflowGuardContainer.setWidth(layoutInfo.width); - this._overflowGuardContainer.setHeight(layoutInfo.height); - this._linesContent.setWidth(1000000); - this._linesContent.setHeight(1000000); - } - _getEditorClassName() { - const focused = this._textAreaHandler.isFocused() ? ' focused' : ''; - return this._context.configuration.options.get(114 /* editorClassName */) + ' ' + Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_36__["getThemeTypeSelector"])(this._context.theme.type) + focused; - } - // --- begin event handlers - handleEvents(events) { - super.handleEvents(events); - this._scheduleRender(); - } - onConfigurationChanged(e) { - this.domNode.setClassName(this._getEditorClassName()); - this._applyLayout(); - return false; - } - onCursorStateChanged(e) { - this._selections = e.selections; - return false; - } - onFocusChanged(e) { - this.domNode.setClassName(this._getEditorClassName()); - return false; - } - onThemeChanged(e) { - this.domNode.setClassName(this._getEditorClassName()); - return false; - } - // --- end event handlers - dispose() { - if (this._renderAnimationFrame !== null) { - this._renderAnimationFrame.dispose(); - this._renderAnimationFrame = null; - } - this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(); - this._context.removeEventHandler(this); - this._viewLines.dispose(); - // Destroy view parts - for (let i = 0, len = this._viewParts.length; i < len; i++) { - this._viewParts[i].dispose(); - } - super.dispose(); - } - _scheduleRender() { - if (this._renderAnimationFrame === null) { - this._renderAnimationFrame = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["runAtThisOrScheduleAtNextAnimationFrame"](this._onRenderScheduled.bind(this), 100); - } - } - _onRenderScheduled() { - this._renderAnimationFrame = null; - this._flushAccumulatedAndRenderNow(); - } - _renderNow() { - safeInvokeNoArg(() => this._actualRender()); - } - _getViewPartsToRender() { - let result = [], resultLen = 0; - for (let i = 0, len = this._viewParts.length; i < len; i++) { - const viewPart = this._viewParts[i]; - if (viewPart.shouldRender()) { - result[resultLen++] = viewPart; - } - } - return result; - } - _actualRender() { - if (!_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["isInDOM"](this.domNode.domNode)) { - return; - } - let viewPartsToRender = this._getViewPartsToRender(); - if (!this._viewLines.shouldRender() && viewPartsToRender.length === 0) { - // Nothing to render - return; - } - const partialViewportData = this._context.viewLayout.getLinesViewportData(); - this._context.model.setViewport(partialViewportData.startLineNumber, partialViewportData.endLineNumber, partialViewportData.centeredLineNumber); - const viewportData = new _common_viewLayout_viewLinesViewportData_js__WEBPACK_IMPORTED_MODULE_34__["ViewportData"](this._selections, partialViewportData, this._context.viewLayout.getWhitespaceViewportData(), this._context.model); - if (this._contentWidgets.shouldRender()) { - // Give the content widgets a chance to set their max width before a possible synchronous layout - this._contentWidgets.onBeforeRender(viewportData); - } - if (this._viewLines.shouldRender()) { - this._viewLines.renderText(viewportData); - this._viewLines.onDidRender(); - // Rendering of viewLines might cause scroll events to occur, so collect view parts to render again - viewPartsToRender = this._getViewPartsToRender(); - } - const renderingContext = new _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_32__["RenderingContext"](this._context.viewLayout, viewportData, this._viewLines); - // Render the rest of the parts - for (let i = 0, len = viewPartsToRender.length; i < len; i++) { - const viewPart = viewPartsToRender[i]; - viewPart.prepareRender(renderingContext); - } - for (let i = 0, len = viewPartsToRender.length; i < len; i++) { - const viewPart = viewPartsToRender[i]; - viewPart.render(renderingContext); - viewPart.onDidRender(); - } - } - // --- BEGIN CodeEditor helpers - delegateVerticalScrollbarMouseDown(browserEvent) { - this._scrollbar.delegateVerticalScrollbarMouseDown(browserEvent); - } - restoreState(scrollPosition) { - this._context.model.setScrollPosition({ scrollTop: scrollPosition.scrollTop }, 1 /* Immediate */); - this._context.model.tokenizeViewport(); - this._renderNow(); - this._viewLines.updateLineWidths(); - this._context.model.setScrollPosition({ scrollLeft: scrollPosition.scrollLeft }, 1 /* Immediate */); - } - getOffsetForColumn(modelLineNumber, modelColumn) { - const modelPosition = this._context.model.validateModelPosition({ - lineNumber: modelLineNumber, - column: modelColumn - }); - const viewPosition = this._context.model.coordinatesConverter.convertModelPositionToViewPosition(modelPosition); - this._flushAccumulatedAndRenderNow(); - const visibleRange = this._viewLines.visibleRangeForPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_30__["Position"](viewPosition.lineNumber, viewPosition.column)); - if (!visibleRange) { - return -1; - } - return visibleRange.left; - } - getTargetAtClientPoint(clientX, clientY) { - const mouseTarget = this._pointerHandler.getTargetAtClientPoint(clientX, clientY); - if (!mouseTarget) { - return null; - } - return _viewUserInputEvents_js__WEBPACK_IMPORTED_MODULE_7__["ViewUserInputEvents"].convertViewToModelMouseTarget(mouseTarget, this._context.model.coordinatesConverter); - } - createOverviewRuler(cssClassName) { - return new _viewParts_overviewRuler_overviewRuler_js__WEBPACK_IMPORTED_MODULE_24__["OverviewRuler"](this._context, cssClassName); - } - change(callback) { - this._viewZones.changeViewZones(callback); - this._scheduleRender(); - } - render(now, everything) { - if (everything) { - // Force everything to render... - this._viewLines.forceShouldRender(); - for (let i = 0, len = this._viewParts.length; i < len; i++) { - const viewPart = this._viewParts[i]; - viewPart.forceShouldRender(); - } - } - if (now) { - this._flushAccumulatedAndRenderNow(); - } - else { - this._scheduleRender(); - } - } - focus() { - this._textAreaHandler.focusTextArea(); - } - isFocused() { - return this._textAreaHandler.isFocused(); - } - setAriaOptions(options) { - this._textAreaHandler.setAriaOptions(options); - } - addContentWidget(widgetData) { - this._contentWidgets.addWidget(widgetData.widget); - this.layoutContentWidget(widgetData); - this._scheduleRender(); - } - layoutContentWidget(widgetData) { - let newRange = widgetData.position ? widgetData.position.range || null : null; - if (newRange === null) { - const newPosition = widgetData.position ? widgetData.position.position : null; - if (newPosition !== null) { - newRange = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_31__["Range"](newPosition.lineNumber, newPosition.column, newPosition.lineNumber, newPosition.column); - } - } - const newPreference = widgetData.position ? widgetData.position.preference : null; - this._contentWidgets.setWidgetPosition(widgetData.widget, newRange, newPreference); - this._scheduleRender(); - } - removeContentWidget(widgetData) { - this._contentWidgets.removeWidget(widgetData.widget); - this._scheduleRender(); - } - addOverlayWidget(widgetData) { - this._overlayWidgets.addWidget(widgetData.widget); - this.layoutOverlayWidget(widgetData); - this._scheduleRender(); - } - layoutOverlayWidget(widgetData) { - const newPreference = widgetData.position ? widgetData.position.preference : null; - const shouldRender = this._overlayWidgets.setWidgetPosition(widgetData.widget, newPreference); - if (shouldRender) { - this._scheduleRender(); - } - } - removeOverlayWidget(widgetData) { - this._overlayWidgets.removeWidget(widgetData.widget); - this._scheduleRender(); - } -} -function safeInvokeNoArg(func) { - try { - return func(); - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["onUnexpectedError"])(e); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewLayer.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/view/viewLayer.js ***! - \****************************************************************************/ -/*! exports provided: RenderedLinesCollection, VisibleLinesCollection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderedLinesCollection", function() { return RenderedLinesCollection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VisibleLinesCollection", function() { return VisibleLinesCollection; }); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _common_core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/stringBuilder.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/stringBuilder.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class RenderedLinesCollection { - constructor(createLine) { - this._createLine = createLine; - this._set(1, []); - } - flush() { - this._set(1, []); - } - _set(rendLineNumberStart, lines) { - this._lines = lines; - this._rendLineNumberStart = rendLineNumberStart; - } - _get() { - return { - rendLineNumberStart: this._rendLineNumberStart, - lines: this._lines - }; - } - /** - * @returns Inclusive line number that is inside this collection - */ - getStartLineNumber() { - return this._rendLineNumberStart; - } - /** - * @returns Inclusive line number that is inside this collection - */ - getEndLineNumber() { - return this._rendLineNumberStart + this._lines.length - 1; - } - getCount() { - return this._lines.length; - } - getLine(lineNumber) { - const lineIndex = lineNumber - this._rendLineNumberStart; - if (lineIndex < 0 || lineIndex >= this._lines.length) { - throw new Error('Illegal value for lineNumber'); - } - return this._lines[lineIndex]; - } - /** - * @returns Lines that were removed from this collection - */ - onLinesDeleted(deleteFromLineNumber, deleteToLineNumber) { - if (this.getCount() === 0) { - // no lines - return null; - } - const startLineNumber = this.getStartLineNumber(); - const endLineNumber = this.getEndLineNumber(); - if (deleteToLineNumber < startLineNumber) { - // deleting above the viewport - const deleteCnt = deleteToLineNumber - deleteFromLineNumber + 1; - this._rendLineNumberStart -= deleteCnt; - return null; - } - if (deleteFromLineNumber > endLineNumber) { - // deleted below the viewport - return null; - } - // Record what needs to be deleted - let deleteStartIndex = 0; - let deleteCount = 0; - for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { - const lineIndex = lineNumber - this._rendLineNumberStart; - if (deleteFromLineNumber <= lineNumber && lineNumber <= deleteToLineNumber) { - // this is a line to be deleted - if (deleteCount === 0) { - // this is the first line to be deleted - deleteStartIndex = lineIndex; - deleteCount = 1; - } - else { - deleteCount++; - } - } - } - // Adjust this._rendLineNumberStart for lines deleted above - if (deleteFromLineNumber < startLineNumber) { - // Something was deleted above - let deleteAboveCount = 0; - if (deleteToLineNumber < startLineNumber) { - // the entire deleted lines are above - deleteAboveCount = deleteToLineNumber - deleteFromLineNumber + 1; - } - else { - deleteAboveCount = startLineNumber - deleteFromLineNumber; - } - this._rendLineNumberStart -= deleteAboveCount; - } - const deleted = this._lines.splice(deleteStartIndex, deleteCount); - return deleted; - } - onLinesChanged(changeFromLineNumber, changeToLineNumber) { - if (this.getCount() === 0) { - // no lines - return false; - } - const startLineNumber = this.getStartLineNumber(); - const endLineNumber = this.getEndLineNumber(); - let someoneNotified = false; - for (let changedLineNumber = changeFromLineNumber; changedLineNumber <= changeToLineNumber; changedLineNumber++) { - if (changedLineNumber >= startLineNumber && changedLineNumber <= endLineNumber) { - // Notify the line - this._lines[changedLineNumber - this._rendLineNumberStart].onContentChanged(); - someoneNotified = true; - } - } - return someoneNotified; - } - onLinesInserted(insertFromLineNumber, insertToLineNumber) { - if (this.getCount() === 0) { - // no lines - return null; - } - const insertCnt = insertToLineNumber - insertFromLineNumber + 1; - const startLineNumber = this.getStartLineNumber(); - const endLineNumber = this.getEndLineNumber(); - if (insertFromLineNumber <= startLineNumber) { - // inserting above the viewport - this._rendLineNumberStart += insertCnt; - return null; - } - if (insertFromLineNumber > endLineNumber) { - // inserting below the viewport - return null; - } - if (insertCnt + insertFromLineNumber > endLineNumber) { - // insert inside the viewport in such a way that all remaining lines are pushed outside - const deleted = this._lines.splice(insertFromLineNumber - this._rendLineNumberStart, endLineNumber - insertFromLineNumber + 1); - return deleted; - } - // insert inside the viewport, push out some lines, but not all remaining lines - const newLines = []; - for (let i = 0; i < insertCnt; i++) { - newLines[i] = this._createLine(); - } - const insertIndex = insertFromLineNumber - this._rendLineNumberStart; - const beforeLines = this._lines.slice(0, insertIndex); - const afterLines = this._lines.slice(insertIndex, this._lines.length - insertCnt); - const deletedLines = this._lines.slice(this._lines.length - insertCnt, this._lines.length); - this._lines = beforeLines.concat(newLines).concat(afterLines); - return deletedLines; - } - onTokensChanged(ranges) { - if (this.getCount() === 0) { - // no lines - return false; - } - const startLineNumber = this.getStartLineNumber(); - const endLineNumber = this.getEndLineNumber(); - let notifiedSomeone = false; - for (let i = 0, len = ranges.length; i < len; i++) { - const rng = ranges[i]; - if (rng.toLineNumber < startLineNumber || rng.fromLineNumber > endLineNumber) { - // range outside viewport - continue; - } - const from = Math.max(startLineNumber, rng.fromLineNumber); - const to = Math.min(endLineNumber, rng.toLineNumber); - for (let lineNumber = from; lineNumber <= to; lineNumber++) { - const lineIndex = lineNumber - this._rendLineNumberStart; - this._lines[lineIndex].onTokensChanged(); - notifiedSomeone = true; - } - } - return notifiedSomeone; - } -} -class VisibleLinesCollection { - constructor(host) { - this._host = host; - this.domNode = this._createDomNode(); - this._linesCollection = new RenderedLinesCollection(() => this._host.createVisibleLine()); - } - _createDomNode() { - const domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__["createFastDomNode"])(document.createElement('div')); - domNode.setClassName('view-layer'); - domNode.setPosition('absolute'); - domNode.domNode.setAttribute('role', 'presentation'); - domNode.domNode.setAttribute('aria-hidden', 'true'); - return domNode; - } - // ---- begin view event handlers - onConfigurationChanged(e) { - if (e.hasChanged(117 /* layoutInfo */)) { - return true; - } - return false; - } - onFlushed(e) { - this._linesCollection.flush(); - // No need to clear the dom node because a full .innerHTML will occur in ViewLayerRenderer._render - return true; - } - onLinesChanged(e) { - return this._linesCollection.onLinesChanged(e.fromLineNumber, e.toLineNumber); - } - onLinesDeleted(e) { - const deleted = this._linesCollection.onLinesDeleted(e.fromLineNumber, e.toLineNumber); - if (deleted) { - // Remove from DOM - for (let i = 0, len = deleted.length; i < len; i++) { - const lineDomNode = deleted[i].getDomNode(); - if (lineDomNode) { - this.domNode.domNode.removeChild(lineDomNode); - } - } - } - return true; - } - onLinesInserted(e) { - const deleted = this._linesCollection.onLinesInserted(e.fromLineNumber, e.toLineNumber); - if (deleted) { - // Remove from DOM - for (let i = 0, len = deleted.length; i < len; i++) { - const lineDomNode = deleted[i].getDomNode(); - if (lineDomNode) { - this.domNode.domNode.removeChild(lineDomNode); - } - } - } - return true; - } - onScrollChanged(e) { - return e.scrollTopChanged; - } - onTokensChanged(e) { - return this._linesCollection.onTokensChanged(e.ranges); - } - onZonesChanged(e) { - return true; - } - // ---- end view event handlers - getStartLineNumber() { - return this._linesCollection.getStartLineNumber(); - } - getEndLineNumber() { - return this._linesCollection.getEndLineNumber(); - } - getVisibleLine(lineNumber) { - return this._linesCollection.getLine(lineNumber); - } - renderLines(viewportData) { - const inp = this._linesCollection._get(); - const renderer = new ViewLayerRenderer(this.domNode.domNode, this._host, viewportData); - const ctx = { - rendLineNumberStart: inp.rendLineNumberStart, - lines: inp.lines, - linesLength: inp.lines.length - }; - // Decide if this render will do a single update (single large .innerHTML) or many updates (inserting/removing dom nodes) - const resCtx = renderer.render(ctx, viewportData.startLineNumber, viewportData.endLineNumber, viewportData.relativeVerticalOffset); - this._linesCollection._set(resCtx.rendLineNumberStart, resCtx.lines); - } -} -class ViewLayerRenderer { - constructor(domNode, host, viewportData) { - this.domNode = domNode; - this.host = host; - this.viewportData = viewportData; - } - render(inContext, startLineNumber, stopLineNumber, deltaTop) { - const ctx = { - rendLineNumberStart: inContext.rendLineNumberStart, - lines: inContext.lines.slice(0), - linesLength: inContext.linesLength - }; - if ((ctx.rendLineNumberStart + ctx.linesLength - 1 < startLineNumber) || (stopLineNumber < ctx.rendLineNumberStart)) { - // There is no overlap whatsoever - ctx.rendLineNumberStart = startLineNumber; - ctx.linesLength = stopLineNumber - startLineNumber + 1; - ctx.lines = []; - for (let x = startLineNumber; x <= stopLineNumber; x++) { - ctx.lines[x - startLineNumber] = this.host.createVisibleLine(); - } - this._finishRendering(ctx, true, deltaTop); - return ctx; - } - // Update lines which will remain untouched - this._renderUntouchedLines(ctx, Math.max(startLineNumber - ctx.rendLineNumberStart, 0), Math.min(stopLineNumber - ctx.rendLineNumberStart, ctx.linesLength - 1), deltaTop, startLineNumber); - if (ctx.rendLineNumberStart > startLineNumber) { - // Insert lines before - const fromLineNumber = startLineNumber; - const toLineNumber = Math.min(stopLineNumber, ctx.rendLineNumberStart - 1); - if (fromLineNumber <= toLineNumber) { - this._insertLinesBefore(ctx, fromLineNumber, toLineNumber, deltaTop, startLineNumber); - ctx.linesLength += toLineNumber - fromLineNumber + 1; - } - } - else if (ctx.rendLineNumberStart < startLineNumber) { - // Remove lines before - const removeCnt = Math.min(ctx.linesLength, startLineNumber - ctx.rendLineNumberStart); - if (removeCnt > 0) { - this._removeLinesBefore(ctx, removeCnt); - ctx.linesLength -= removeCnt; - } - } - ctx.rendLineNumberStart = startLineNumber; - if (ctx.rendLineNumberStart + ctx.linesLength - 1 < stopLineNumber) { - // Insert lines after - const fromLineNumber = ctx.rendLineNumberStart + ctx.linesLength; - const toLineNumber = stopLineNumber; - if (fromLineNumber <= toLineNumber) { - this._insertLinesAfter(ctx, fromLineNumber, toLineNumber, deltaTop, startLineNumber); - ctx.linesLength += toLineNumber - fromLineNumber + 1; - } - } - else if (ctx.rendLineNumberStart + ctx.linesLength - 1 > stopLineNumber) { - // Remove lines after - const fromLineNumber = Math.max(0, stopLineNumber - ctx.rendLineNumberStart + 1); - const toLineNumber = ctx.linesLength - 1; - const removeCnt = toLineNumber - fromLineNumber + 1; - if (removeCnt > 0) { - this._removeLinesAfter(ctx, removeCnt); - ctx.linesLength -= removeCnt; - } - } - this._finishRendering(ctx, false, deltaTop); - return ctx; - } - _renderUntouchedLines(ctx, startIndex, endIndex, deltaTop, deltaLN) { - const rendLineNumberStart = ctx.rendLineNumberStart; - const lines = ctx.lines; - for (let i = startIndex; i <= endIndex; i++) { - const lineNumber = rendLineNumberStart + i; - lines[i].layoutLine(lineNumber, deltaTop[lineNumber - deltaLN]); - } - } - _insertLinesBefore(ctx, fromLineNumber, toLineNumber, deltaTop, deltaLN) { - const newLines = []; - let newLinesLen = 0; - for (let lineNumber = fromLineNumber; lineNumber <= toLineNumber; lineNumber++) { - newLines[newLinesLen++] = this.host.createVisibleLine(); - } - ctx.lines = newLines.concat(ctx.lines); - } - _removeLinesBefore(ctx, removeCount) { - for (let i = 0; i < removeCount; i++) { - const lineDomNode = ctx.lines[i].getDomNode(); - if (lineDomNode) { - this.domNode.removeChild(lineDomNode); - } - } - ctx.lines.splice(0, removeCount); - } - _insertLinesAfter(ctx, fromLineNumber, toLineNumber, deltaTop, deltaLN) { - const newLines = []; - let newLinesLen = 0; - for (let lineNumber = fromLineNumber; lineNumber <= toLineNumber; lineNumber++) { - newLines[newLinesLen++] = this.host.createVisibleLine(); - } - ctx.lines = ctx.lines.concat(newLines); - } - _removeLinesAfter(ctx, removeCount) { - const removeIndex = ctx.linesLength - removeCount; - for (let i = 0; i < removeCount; i++) { - const lineDomNode = ctx.lines[removeIndex + i].getDomNode(); - if (lineDomNode) { - this.domNode.removeChild(lineDomNode); - } - } - ctx.lines.splice(removeIndex, removeCount); - } - _finishRenderingNewLines(ctx, domNodeIsEmpty, newLinesHTML, wasNew) { - const lastChild = this.domNode.lastChild; - if (domNodeIsEmpty || !lastChild) { - this.domNode.innerHTML = newLinesHTML; - } - else { - lastChild.insertAdjacentHTML('afterend', newLinesHTML); - } - let currChild = this.domNode.lastChild; - for (let i = ctx.linesLength - 1; i >= 0; i--) { - const line = ctx.lines[i]; - if (wasNew[i]) { - line.setDomNode(currChild); - currChild = currChild.previousSibling; - } - } - } - _finishRenderingInvalidLines(ctx, invalidLinesHTML, wasInvalid) { - const hugeDomNode = document.createElement('div'); - hugeDomNode.innerHTML = invalidLinesHTML; - for (let i = 0; i < ctx.linesLength; i++) { - const line = ctx.lines[i]; - if (wasInvalid[i]) { - const source = hugeDomNode.firstChild; - const lineDomNode = line.getDomNode(); - lineDomNode.parentNode.replaceChild(source, lineDomNode); - line.setDomNode(source); - } - } - } - _finishRendering(ctx, domNodeIsEmpty, deltaTop) { - const sb = ViewLayerRenderer._sb; - const linesLength = ctx.linesLength; - const lines = ctx.lines; - const rendLineNumberStart = ctx.rendLineNumberStart; - const wasNew = []; - { - sb.reset(); - let hadNewLine = false; - for (let i = 0; i < linesLength; i++) { - const line = lines[i]; - wasNew[i] = false; - const lineDomNode = line.getDomNode(); - if (lineDomNode) { - // line is not new - continue; - } - const renderResult = line.renderLine(i + rendLineNumberStart, deltaTop[i], this.viewportData, sb); - if (!renderResult) { - // line does not need rendering - continue; - } - wasNew[i] = true; - hadNewLine = true; - } - if (hadNewLine) { - this._finishRenderingNewLines(ctx, domNodeIsEmpty, sb.build(), wasNew); - } - } - { - sb.reset(); - let hadInvalidLine = false; - const wasInvalid = []; - for (let i = 0; i < linesLength; i++) { - const line = lines[i]; - wasInvalid[i] = false; - if (wasNew[i]) { - // line was new - continue; - } - const renderResult = line.renderLine(i + rendLineNumberStart, deltaTop[i], this.viewportData, sb); - if (!renderResult) { - // line does not need rendering - continue; - } - wasInvalid[i] = true; - hadInvalidLine = true; - } - if (hadInvalidLine) { - this._finishRenderingInvalidLines(ctx, sb.build(), wasInvalid); - } - } - } -} -ViewLayerRenderer._sb = Object(_common_core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_1__["createStringBuilder"])(100000); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewOverlays.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/view/viewOverlays.js ***! - \*******************************************************************************/ -/*! exports provided: ViewOverlays, ViewOverlayLine, ContentViewOverlays, MarginViewOverlays */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewOverlays", function() { return ViewOverlays; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewOverlayLine", function() { return ViewOverlayLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentViewOverlays", function() { return ContentViewOverlays; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarginViewOverlays", function() { return MarginViewOverlays; }); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _config_configuration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config/configuration.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/config/configuration.js"); -/* harmony import */ var _viewLayer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./viewLayer.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewLayer.js"); -/* harmony import */ var _viewPart_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class ViewOverlays extends _viewPart_js__WEBPACK_IMPORTED_MODULE_3__["ViewPart"] { - constructor(context) { - super(context); - this._visibleLines = new _viewLayer_js__WEBPACK_IMPORTED_MODULE_2__["VisibleLinesCollection"](this); - this.domNode = this._visibleLines.domNode; - this._dynamicOverlays = []; - this._isFocused = false; - this.domNode.setClassName('view-overlays'); - } - shouldRender() { - if (super.shouldRender()) { - return true; - } - for (let i = 0, len = this._dynamicOverlays.length; i < len; i++) { - const dynamicOverlay = this._dynamicOverlays[i]; - if (dynamicOverlay.shouldRender()) { - return true; - } - } - return false; - } - dispose() { - super.dispose(); - for (let i = 0, len = this._dynamicOverlays.length; i < len; i++) { - const dynamicOverlay = this._dynamicOverlays[i]; - dynamicOverlay.dispose(); - } - this._dynamicOverlays = []; - } - getDomNode() { - return this.domNode; - } - // ---- begin IVisibleLinesHost - createVisibleLine() { - return new ViewOverlayLine(this._context.configuration, this._dynamicOverlays); - } - // ---- end IVisibleLinesHost - addDynamicOverlay(overlay) { - this._dynamicOverlays.push(overlay); - } - // ----- event handlers - onConfigurationChanged(e) { - this._visibleLines.onConfigurationChanged(e); - const startLineNumber = this._visibleLines.getStartLineNumber(); - const endLineNumber = this._visibleLines.getEndLineNumber(); - for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { - const line = this._visibleLines.getVisibleLine(lineNumber); - line.onConfigurationChanged(e); - } - return true; - } - onFlushed(e) { - return this._visibleLines.onFlushed(e); - } - onFocusChanged(e) { - this._isFocused = e.isFocused; - return true; - } - onLinesChanged(e) { - return this._visibleLines.onLinesChanged(e); - } - onLinesDeleted(e) { - return this._visibleLines.onLinesDeleted(e); - } - onLinesInserted(e) { - return this._visibleLines.onLinesInserted(e); - } - onScrollChanged(e) { - return this._visibleLines.onScrollChanged(e) || true; - } - onTokensChanged(e) { - return this._visibleLines.onTokensChanged(e); - } - onZonesChanged(e) { - return this._visibleLines.onZonesChanged(e); - } - // ----- end event handlers - prepareRender(ctx) { - const toRender = this._dynamicOverlays.filter(overlay => overlay.shouldRender()); - for (let i = 0, len = toRender.length; i < len; i++) { - const dynamicOverlay = toRender[i]; - dynamicOverlay.prepareRender(ctx); - dynamicOverlay.onDidRender(); - } - } - render(ctx) { - // Overwriting to bypass `shouldRender` flag - this._viewOverlaysRender(ctx); - this.domNode.toggleClassName('focused', this._isFocused); - } - _viewOverlaysRender(ctx) { - this._visibleLines.renderLines(ctx.viewportData); - } -} -class ViewOverlayLine { - constructor(configuration, dynamicOverlays) { - this._configuration = configuration; - this._lineHeight = this._configuration.options.get(51 /* lineHeight */); - this._dynamicOverlays = dynamicOverlays; - this._domNode = null; - this._renderedContent = null; - } - getDomNode() { - if (!this._domNode) { - return null; - } - return this._domNode.domNode; - } - setDomNode(domNode) { - this._domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__["createFastDomNode"])(domNode); - } - onContentChanged() { - // Nothing - } - onTokensChanged() { - // Nothing - } - onConfigurationChanged(e) { - this._lineHeight = this._configuration.options.get(51 /* lineHeight */); - } - renderLine(lineNumber, deltaTop, viewportData, sb) { - let result = ''; - for (let i = 0, len = this._dynamicOverlays.length; i < len; i++) { - const dynamicOverlay = this._dynamicOverlays[i]; - result += dynamicOverlay.render(viewportData.startLineNumber, lineNumber); - } - if (this._renderedContent === result) { - // No rendering needed - return false; - } - this._renderedContent = result; - sb.appendASCIIString('
    '); - sb.appendASCIIString(result); - sb.appendASCIIString('
    '); - return true; - } - layoutLine(lineNumber, deltaTop) { - if (this._domNode) { - this._domNode.setTop(deltaTop); - this._domNode.setHeight(this._lineHeight); - } - } -} -class ContentViewOverlays extends ViewOverlays { - constructor(context) { - super(context); - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._contentWidth = layoutInfo.contentWidth; - this.domNode.setHeight(0); - } - // --- begin event handlers - onConfigurationChanged(e) { - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._contentWidth = layoutInfo.contentWidth; - return super.onConfigurationChanged(e) || true; - } - onScrollChanged(e) { - return super.onScrollChanged(e) || e.scrollWidthChanged; - } - // --- end event handlers - _viewOverlaysRender(ctx) { - super._viewOverlaysRender(ctx); - this.domNode.setWidth(Math.max(ctx.scrollWidth, this._contentWidth)); - } -} -class MarginViewOverlays extends ViewOverlays { - constructor(context) { - super(context); - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._contentLeft = layoutInfo.contentLeft; - this.domNode.setClassName('margin-view-overlays'); - this.domNode.setWidth(1); - _config_configuration_js__WEBPACK_IMPORTED_MODULE_1__["Configuration"].applyFontInfo(this.domNode, options.get(36 /* fontInfo */)); - } - onConfigurationChanged(e) { - const options = this._context.configuration.options; - _config_configuration_js__WEBPACK_IMPORTED_MODULE_1__["Configuration"].applyFontInfo(this.domNode, options.get(36 /* fontInfo */)); - const layoutInfo = options.get(117 /* layoutInfo */); - this._contentLeft = layoutInfo.contentLeft; - return super.onConfigurationChanged(e) || true; - } - onScrollChanged(e) { - return super.onScrollChanged(e) || e.scrollHeightChanged; - } - _viewOverlaysRender(ctx) { - super._viewOverlaysRender(ctx); - const height = Math.min(ctx.scrollHeight, 1000000); - this.domNode.setHeight(height); - this.domNode.setWidth(this._contentLeft); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js ***! - \***************************************************************************/ -/*! exports provided: ViewPart, PartFingerprints */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewPart", function() { return ViewPart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PartFingerprints", function() { return PartFingerprints; }); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _common_viewModel_viewEventHandler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/viewModel/viewEventHandler.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewEventHandler.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class ViewPart extends _common_viewModel_viewEventHandler_js__WEBPACK_IMPORTED_MODULE_1__["ViewEventHandler"] { - constructor(context) { - super(); - this._context = context; - this._context.addEventHandler(this); - } - dispose() { - this._context.removeEventHandler(this); - super.dispose(); - } -} -class PartFingerprints { - static write(target, partId) { - if (target instanceof _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__["FastDomNode"]) { - target.setAttribute('data-mprt', String(partId)); - } - else { - target.setAttribute('data-mprt', String(partId)); - } - } - static read(target) { - const r = target.getAttribute('data-mprt'); - if (r === null) { - return 0 /* None */; - } - return parseInt(r, 10); - } - static collect(child, stopAt) { - let result = [], resultLen = 0; - while (child && child !== document.body) { - if (child === stopAt) { - break; - } - if (child.nodeType === child.ELEMENT_NODE) { - result[resultLen++] = this.read(child); - } - child = child.parentElement; - } - const r = new Uint8Array(resultLen); - for (let i = 0; i < resultLen; i++) { - r[i] = result[resultLen - i - 1]; - } - return r; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewUserInputEvents.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/view/viewUserInputEvents.js ***! - \**************************************************************************************/ -/*! exports provided: ViewUserInputEvents */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewUserInputEvents", function() { return ViewUserInputEvents; }); -/* harmony import */ var _controller_mouseTarget_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../controller/mouseTarget.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class ViewUserInputEvents { - constructor(coordinatesConverter) { - this.onKeyDown = null; - this.onKeyUp = null; - this.onContextMenu = null; - this.onMouseMove = null; - this.onMouseLeave = null; - this.onMouseDown = null; - this.onMouseUp = null; - this.onMouseDrag = null; - this.onMouseDrop = null; - this.onMouseWheel = null; - this._coordinatesConverter = coordinatesConverter; - } - emitKeyDown(e) { - if (this.onKeyDown) { - this.onKeyDown(e); - } - } - emitKeyUp(e) { - if (this.onKeyUp) { - this.onKeyUp(e); - } - } - emitContextMenu(e) { - if (this.onContextMenu) { - this.onContextMenu(this._convertViewToModelMouseEvent(e)); - } - } - emitMouseMove(e) { - if (this.onMouseMove) { - this.onMouseMove(this._convertViewToModelMouseEvent(e)); - } - } - emitMouseLeave(e) { - if (this.onMouseLeave) { - this.onMouseLeave(this._convertViewToModelMouseEvent(e)); - } - } - emitMouseDown(e) { - if (this.onMouseDown) { - this.onMouseDown(this._convertViewToModelMouseEvent(e)); - } - } - emitMouseUp(e) { - if (this.onMouseUp) { - this.onMouseUp(this._convertViewToModelMouseEvent(e)); - } - } - emitMouseDrag(e) { - if (this.onMouseDrag) { - this.onMouseDrag(this._convertViewToModelMouseEvent(e)); - } - } - emitMouseDrop(e) { - if (this.onMouseDrop) { - this.onMouseDrop(this._convertViewToModelMouseEvent(e)); - } - } - emitMouseWheel(e) { - if (this.onMouseWheel) { - this.onMouseWheel(e); - } - } - _convertViewToModelMouseEvent(e) { - if (e.target) { - return { - event: e.event, - target: this._convertViewToModelMouseTarget(e.target) - }; - } - return e; - } - _convertViewToModelMouseTarget(target) { - return ViewUserInputEvents.convertViewToModelMouseTarget(target, this._coordinatesConverter); - } - static convertViewToModelMouseTarget(target, coordinatesConverter) { - return new ExternalMouseTarget(target.element, target.type, target.mouseColumn, target.position ? coordinatesConverter.convertViewPositionToModelPosition(target.position) : null, target.range ? coordinatesConverter.convertViewRangeToModelRange(target.range) : null, target.detail); - } -} -class ExternalMouseTarget { - constructor(element, type, mouseColumn, position, range, detail) { - this.element = element; - this.type = type; - this.mouseColumn = mouseColumn; - this.position = position; - this.range = range; - this.detail = detail; - } - toString() { - return _controller_mouseTarget_js__WEBPACK_IMPORTED_MODULE_0__["MouseTarget"].toString(this); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js": -/*!*****************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js ***! - \*****************************************************************************************************/ -/*! exports provided: ViewContentWidgets */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewContentWidgets", function() { return ViewContentWidgets; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../view/viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class Coordinate { - constructor(top, left) { - this.top = top; - this.left = left; - } -} -class ViewContentWidgets extends _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__["ViewPart"] { - constructor(context, viewDomNode) { - super(context); - this._viewDomNode = viewDomNode; - this._widgets = {}; - this.domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(document.createElement('div')); - _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__["PartFingerprints"].write(this.domNode, 1 /* ContentWidgets */); - this.domNode.setClassName('contentWidgets'); - this.domNode.setPosition('absolute'); - this.domNode.setTop(0); - this.overflowingContentWidgetsDomNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(document.createElement('div')); - _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__["PartFingerprints"].write(this.overflowingContentWidgetsDomNode, 2 /* OverflowingContentWidgets */); - this.overflowingContentWidgetsDomNode.setClassName('overflowingContentWidgets'); - } - dispose() { - super.dispose(); - this._widgets = {}; - } - // --- begin event handlers - onConfigurationChanged(e) { - const keys = Object.keys(this._widgets); - for (const widgetId of keys) { - this._widgets[widgetId].onConfigurationChanged(e); - } - return true; - } - onDecorationsChanged(e) { - // true for inline decorations that can end up relayouting text - return true; - } - onFlushed(e) { - return true; - } - onLineMappingChanged(e) { - const keys = Object.keys(this._widgets); - for (const widgetId of keys) { - this._widgets[widgetId].onLineMappingChanged(e); - } - return true; - } - onLinesChanged(e) { - return true; - } - onLinesDeleted(e) { - return true; - } - onLinesInserted(e) { - return true; - } - onScrollChanged(e) { - return true; - } - onZonesChanged(e) { - return true; - } - // ---- end view event handlers - addWidget(_widget) { - const myWidget = new Widget(this._context, this._viewDomNode, _widget); - this._widgets[myWidget.id] = myWidget; - if (myWidget.allowEditorOverflow) { - this.overflowingContentWidgetsDomNode.appendChild(myWidget.domNode); - } - else { - this.domNode.appendChild(myWidget.domNode); - } - this.setShouldRender(); - } - setWidgetPosition(widget, range, preference) { - const myWidget = this._widgets[widget.getId()]; - myWidget.setPosition(range, preference); - this.setShouldRender(); - } - removeWidget(widget) { - const widgetId = widget.getId(); - if (this._widgets.hasOwnProperty(widgetId)) { - const myWidget = this._widgets[widgetId]; - delete this._widgets[widgetId]; - const domNode = myWidget.domNode.domNode; - domNode.parentNode.removeChild(domNode); - domNode.removeAttribute('monaco-visible-content-widget'); - this.setShouldRender(); - } - } - shouldSuppressMouseDownOnWidget(widgetId) { - if (this._widgets.hasOwnProperty(widgetId)) { - return this._widgets[widgetId].suppressMouseDown; - } - return false; - } - onBeforeRender(viewportData) { - const keys = Object.keys(this._widgets); - for (const widgetId of keys) { - this._widgets[widgetId].onBeforeRender(viewportData); - } - } - prepareRender(ctx) { - const keys = Object.keys(this._widgets); - for (const widgetId of keys) { - this._widgets[widgetId].prepareRender(ctx); - } - } - render(ctx) { - const keys = Object.keys(this._widgets); - for (const widgetId of keys) { - this._widgets[widgetId].render(ctx); - } - } -} -class Widget { - constructor(context, viewDomNode, actual) { - this._context = context; - this._viewDomNode = viewDomNode; - this._actual = actual; - this.domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(this._actual.getDomNode()); - this.id = this._actual.getId(); - this.allowEditorOverflow = this._actual.allowEditorOverflow || false; - this.suppressMouseDown = this._actual.suppressMouseDown || false; - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._fixedOverflowWidgets = options.get(30 /* fixedOverflowWidgets */); - this._contentWidth = layoutInfo.contentWidth; - this._contentLeft = layoutInfo.contentLeft; - this._lineHeight = options.get(51 /* lineHeight */); - this._range = null; - this._viewRange = null; - this._preference = []; - this._cachedDomNodeClientWidth = -1; - this._cachedDomNodeClientHeight = -1; - this._maxWidth = this._getMaxWidth(); - this._isVisible = false; - this._renderData = null; - this.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute'); - this.domNode.setVisibility('hidden'); - this.domNode.setAttribute('widgetId', this.id); - this.domNode.setMaxWidth(this._maxWidth); - } - onConfigurationChanged(e) { - const options = this._context.configuration.options; - this._lineHeight = options.get(51 /* lineHeight */); - if (e.hasChanged(117 /* layoutInfo */)) { - const layoutInfo = options.get(117 /* layoutInfo */); - this._contentLeft = layoutInfo.contentLeft; - this._contentWidth = layoutInfo.contentWidth; - this._maxWidth = this._getMaxWidth(); - } - } - onLineMappingChanged(e) { - this._setPosition(this._range); - } - _setPosition(range) { - this._range = range; - this._viewRange = null; - if (this._range) { - // Do not trust that widgets give a valid position - const validModelRange = this._context.model.validateModelRange(this._range); - if (this._context.model.coordinatesConverter.modelPositionIsVisible(validModelRange.getStartPosition()) || this._context.model.coordinatesConverter.modelPositionIsVisible(validModelRange.getEndPosition())) { - this._viewRange = this._context.model.coordinatesConverter.convertModelRangeToViewRange(validModelRange); - } - } - } - _getMaxWidth() { - return (this.allowEditorOverflow - ? window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth - : this._contentWidth); - } - setPosition(range, preference) { - this._setPosition(range); - this._preference = preference; - this._cachedDomNodeClientWidth = -1; - this._cachedDomNodeClientHeight = -1; - } - _layoutBoxInViewport(topLeft, bottomLeft, width, height, ctx) { - // Our visible box is split horizontally by the current line => 2 boxes - // a) the box above the line - const aboveLineTop = topLeft.top; - const heightAboveLine = aboveLineTop; - // b) the box under the line - const underLineTop = bottomLeft.top + this._lineHeight; - const heightUnderLine = ctx.viewportHeight - underLineTop; - const aboveTop = aboveLineTop - height; - const fitsAbove = (heightAboveLine >= height); - const belowTop = underLineTop; - const fitsBelow = (heightUnderLine >= height); - // And its left - let actualAboveLeft = topLeft.left; - let actualBelowLeft = bottomLeft.left; - if (actualAboveLeft + width > ctx.scrollLeft + ctx.viewportWidth) { - actualAboveLeft = ctx.scrollLeft + ctx.viewportWidth - width; - } - if (actualBelowLeft + width > ctx.scrollLeft + ctx.viewportWidth) { - actualBelowLeft = ctx.scrollLeft + ctx.viewportWidth - width; - } - if (actualAboveLeft < ctx.scrollLeft) { - actualAboveLeft = ctx.scrollLeft; - } - if (actualBelowLeft < ctx.scrollLeft) { - actualBelowLeft = ctx.scrollLeft; - } - return { - fitsAbove: fitsAbove, - aboveTop: aboveTop, - aboveLeft: actualAboveLeft, - fitsBelow: fitsBelow, - belowTop: belowTop, - belowLeft: actualBelowLeft, - }; - } - _layoutHorizontalSegmentInPage(windowSize, domNodePosition, left, width) { - // Initially, the limits are defined as the dom node limits - const MIN_LIMIT = Math.max(0, domNodePosition.left - width); - const MAX_LIMIT = Math.min(domNodePosition.left + domNodePosition.width + width, windowSize.width); - let absoluteLeft = domNodePosition.left + left - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["StandardWindow"].scrollX; - if (absoluteLeft + width > MAX_LIMIT) { - const delta = absoluteLeft - (MAX_LIMIT - width); - absoluteLeft -= delta; - left -= delta; - } - if (absoluteLeft < MIN_LIMIT) { - const delta = absoluteLeft - MIN_LIMIT; - absoluteLeft -= delta; - left -= delta; - } - return [left, absoluteLeft]; - } - _layoutBoxInPage(topLeft, bottomLeft, width, height, ctx) { - const aboveTop = topLeft.top - height; - const belowTop = bottomLeft.top + this._lineHeight; - const domNodePosition = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["getDomNodePagePosition"](this._viewDomNode.domNode); - const absoluteAboveTop = domNodePosition.top + aboveTop - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["StandardWindow"].scrollY; - const absoluteBelowTop = domNodePosition.top + belowTop - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["StandardWindow"].scrollY; - const windowSize = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["getClientArea"](document.body); - const [aboveLeft, absoluteAboveLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, topLeft.left - ctx.scrollLeft + this._contentLeft, width); - const [belowLeft, absoluteBelowLeft] = this._layoutHorizontalSegmentInPage(windowSize, domNodePosition, bottomLeft.left - ctx.scrollLeft + this._contentLeft, width); - // Leave some clearance to the top/bottom - const TOP_PADDING = 22; - const BOTTOM_PADDING = 22; - const fitsAbove = (absoluteAboveTop >= TOP_PADDING); - const fitsBelow = (absoluteBelowTop + height <= windowSize.height - BOTTOM_PADDING); - if (this._fixedOverflowWidgets) { - return { - fitsAbove, - aboveTop: Math.max(absoluteAboveTop, TOP_PADDING), - aboveLeft: absoluteAboveLeft, - fitsBelow, - belowTop: absoluteBelowTop, - belowLeft: absoluteBelowLeft - }; - } - return { - fitsAbove, - aboveTop: aboveTop, - aboveLeft, - fitsBelow, - belowTop, - belowLeft - }; - } - _prepareRenderWidgetAtExactPositionOverflowing(topLeft) { - return new Coordinate(topLeft.top, topLeft.left + this._contentLeft); - } - /** - * Compute `this._topLeft` - */ - _getTopAndBottomLeft(ctx) { - if (!this._viewRange) { - return [null, null]; - } - const visibleRangesForRange = ctx.linesVisibleRangesForRange(this._viewRange, false); - if (!visibleRangesForRange || visibleRangesForRange.length === 0) { - return [null, null]; - } - let firstLine = visibleRangesForRange[0]; - let lastLine = visibleRangesForRange[0]; - for (const visibleRangesForLine of visibleRangesForRange) { - if (visibleRangesForLine.lineNumber < firstLine.lineNumber) { - firstLine = visibleRangesForLine; - } - if (visibleRangesForLine.lineNumber > lastLine.lineNumber) { - lastLine = visibleRangesForLine; - } - } - let firstLineMinLeft = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; //firstLine.Constants.MAX_SAFE_SMALL_INTEGER; - for (const visibleRange of firstLine.ranges) { - if (visibleRange.left < firstLineMinLeft) { - firstLineMinLeft = visibleRange.left; - } - } - let lastLineMinLeft = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; //lastLine.Constants.MAX_SAFE_SMALL_INTEGER; - for (const visibleRange of lastLine.ranges) { - if (visibleRange.left < lastLineMinLeft) { - lastLineMinLeft = visibleRange.left; - } - } - const topForPosition = ctx.getVerticalOffsetForLineNumber(firstLine.lineNumber) - ctx.scrollTop; - const topLeft = new Coordinate(topForPosition, firstLineMinLeft); - const topForBottomLine = ctx.getVerticalOffsetForLineNumber(lastLine.lineNumber) - ctx.scrollTop; - const bottomLeft = new Coordinate(topForBottomLine, lastLineMinLeft); - return [topLeft, bottomLeft]; - } - _prepareRenderWidget(ctx) { - const [topLeft, bottomLeft] = this._getTopAndBottomLeft(ctx); - if (!topLeft || !bottomLeft) { - return null; - } - if (this._cachedDomNodeClientWidth === -1 || this._cachedDomNodeClientHeight === -1) { - const domNode = this.domNode.domNode; - this._cachedDomNodeClientWidth = domNode.clientWidth; - this._cachedDomNodeClientHeight = domNode.clientHeight; - } - let placement; - if (this.allowEditorOverflow) { - placement = this._layoutBoxInPage(topLeft, bottomLeft, this._cachedDomNodeClientWidth, this._cachedDomNodeClientHeight, ctx); - } - else { - placement = this._layoutBoxInViewport(topLeft, bottomLeft, this._cachedDomNodeClientWidth, this._cachedDomNodeClientHeight, ctx); - } - // Do two passes, first for perfect fit, second picks first option - if (this._preference) { - for (let pass = 1; pass <= 2; pass++) { - for (const pref of this._preference) { - // placement - if (pref === 1 /* ABOVE */) { - if (!placement) { - // Widget outside of viewport - return null; - } - if (pass === 2 || placement.fitsAbove) { - return new Coordinate(placement.aboveTop, placement.aboveLeft); - } - } - else if (pref === 2 /* BELOW */) { - if (!placement) { - // Widget outside of viewport - return null; - } - if (pass === 2 || placement.fitsBelow) { - return new Coordinate(placement.belowTop, placement.belowLeft); - } - } - else { - if (this.allowEditorOverflow) { - return this._prepareRenderWidgetAtExactPositionOverflowing(topLeft); - } - else { - return topLeft; - } - } - } - } - } - return null; - } - /** - * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly. - */ - onBeforeRender(viewportData) { - if (!this._viewRange || !this._preference) { - return; - } - if (this._viewRange.endLineNumber < viewportData.startLineNumber || this._viewRange.startLineNumber > viewportData.endLineNumber) { - // Outside of viewport - return; - } - this.domNode.setMaxWidth(this._maxWidth); - } - prepareRender(ctx) { - this._renderData = this._prepareRenderWidget(ctx); - } - render(ctx) { - if (!this._renderData) { - // This widget should be invisible - if (this._isVisible) { - this.domNode.removeAttribute('monaco-visible-content-widget'); - this._isVisible = false; - this.domNode.setVisibility('hidden'); - } - return; - } - // This widget should be visible - if (this.allowEditorOverflow) { - this.domNode.setTop(this._renderData.top); - this.domNode.setLeft(this._renderData.left); - } - else { - this.domNode.setTop(this._renderData.top + ctx.scrollTop - ctx.bigNumbersDelta); - this.domNode.setLeft(this._renderData.left); - } - if (!this._isVisible) { - this.domNode.setVisibility('inherit'); - this.domNode.setAttribute('monaco-visible-content-widget', 'true'); - this._isVisible = true; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.css": -/*!******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.css ***! - \******************************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_currentLineHighlight_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./currentLineHighlight.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.css"); -/* harmony import */ var _css_loader_dist_cjs_js_currentLineHighlight_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_currentLineHighlight_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_currentLineHighlight_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_currentLineHighlight_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js": -/*!*****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js ***! - \*****************************************************************************************************************/ -/*! exports provided: AbstractLineHighlightOverlay, CurrentLineHighlightOverlay, CurrentLineMarginHighlightOverlay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractLineHighlightOverlay", function() { return AbstractLineHighlightOverlay; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CurrentLineHighlightOverlay", function() { return CurrentLineHighlightOverlay; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CurrentLineMarginHighlightOverlay", function() { return CurrentLineMarginHighlightOverlay; }); -/* harmony import */ var _currentLineHighlight_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./currentLineHighlight.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.css"); -/* harmony import */ var _view_dynamicViewOverlay_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../view/dynamicViewOverlay.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/dynamicViewOverlay.js"); -/* harmony import */ var _common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -let isRenderedUsingBorder = true; -class AbstractLineHighlightOverlay extends _view_dynamicViewOverlay_js__WEBPACK_IMPORTED_MODULE_1__["DynamicViewOverlay"] { - constructor(context) { - super(); - this._context = context; - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._lineHeight = options.get(51 /* lineHeight */); - this._renderLineHighlight = options.get(77 /* renderLineHighlight */); - this._renderLineHightlightOnlyWhenFocus = options.get(78 /* renderLineHighlightOnlyWhenFocus */); - this._contentLeft = layoutInfo.contentLeft; - this._contentWidth = layoutInfo.contentWidth; - this._selectionIsEmpty = true; - this._focused = false; - this._cursorLineNumbers = []; - this._selections = []; - this._renderData = null; - this._context.addEventHandler(this); - } - dispose() { - this._context.removeEventHandler(this); - super.dispose(); - } - _readFromSelections() { - let hasChanged = false; - // Only render the first selection when using border - const renderSelections = isRenderedUsingBorder ? this._selections.slice(0, 1) : this._selections; - const cursorsLineNumbers = renderSelections.map(s => s.positionLineNumber); - cursorsLineNumbers.sort((a, b) => a - b); - if (!_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_3__["equals"](this._cursorLineNumbers, cursorsLineNumbers)) { - this._cursorLineNumbers = cursorsLineNumbers; - hasChanged = true; - } - const selectionIsEmpty = renderSelections.every(s => s.isEmpty()); - if (this._selectionIsEmpty !== selectionIsEmpty) { - this._selectionIsEmpty = selectionIsEmpty; - hasChanged = true; - } - return hasChanged; - } - // --- begin event handlers - onThemeChanged(e) { - return this._readFromSelections(); - } - onConfigurationChanged(e) { - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._lineHeight = options.get(51 /* lineHeight */); - this._renderLineHighlight = options.get(77 /* renderLineHighlight */); - this._renderLineHightlightOnlyWhenFocus = options.get(78 /* renderLineHighlightOnlyWhenFocus */); - this._contentLeft = layoutInfo.contentLeft; - this._contentWidth = layoutInfo.contentWidth; - return true; - } - onCursorStateChanged(e) { - this._selections = e.selections; - return this._readFromSelections(); - } - onFlushed(e) { - return true; - } - onLinesDeleted(e) { - return true; - } - onLinesInserted(e) { - return true; - } - onScrollChanged(e) { - return e.scrollWidthChanged || e.scrollTopChanged; - } - onZonesChanged(e) { - return true; - } - onFocusChanged(e) { - if (!this._renderLineHightlightOnlyWhenFocus) { - return false; - } - this._focused = e.isFocused; - return true; - } - // --- end event handlers - prepareRender(ctx) { - if (!this._shouldRenderThis()) { - this._renderData = null; - return; - } - const renderedLine = this._renderOne(ctx); - const visibleStartLineNumber = ctx.visibleRange.startLineNumber; - const visibleEndLineNumber = ctx.visibleRange.endLineNumber; - const len = this._cursorLineNumbers.length; - let index = 0; - const renderData = []; - for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) { - const lineIndex = lineNumber - visibleStartLineNumber; - while (index < len && this._cursorLineNumbers[index] < lineNumber) { - index++; - } - if (index < len && this._cursorLineNumbers[index] === lineNumber) { - renderData[lineIndex] = renderedLine; - } - else { - renderData[lineIndex] = ''; - } - } - this._renderData = renderData; - } - render(startLineNumber, lineNumber) { - if (!this._renderData) { - return ''; - } - const lineIndex = lineNumber - startLineNumber; - if (lineIndex >= this._renderData.length) { - return ''; - } - return this._renderData[lineIndex]; - } -} -class CurrentLineHighlightOverlay extends AbstractLineHighlightOverlay { - _renderOne(ctx) { - const className = 'current-line' + (this._shouldRenderOther() ? ' current-line-both' : ''); - return `
    `; - } - _shouldRenderThis() { - return ((this._renderLineHighlight === 'line' || this._renderLineHighlight === 'all') - && this._selectionIsEmpty - && (!this._renderLineHightlightOnlyWhenFocus || this._focused)); - } - _shouldRenderOther() { - return ((this._renderLineHighlight === 'gutter' || this._renderLineHighlight === 'all') - && (!this._renderLineHightlightOnlyWhenFocus || this._focused)); - } -} -class CurrentLineMarginHighlightOverlay extends AbstractLineHighlightOverlay { - _renderOne(ctx) { - const className = 'current-line current-line-margin' + (this._shouldRenderOther() ? ' current-line-margin-both' : ''); - return `
    `; - } - _shouldRenderThis() { - return ((this._renderLineHighlight === 'gutter' || this._renderLineHighlight === 'all') - && (!this._renderLineHightlightOnlyWhenFocus || this._focused)); - } - _shouldRenderOther() { - return ((this._renderLineHighlight === 'line' || this._renderLineHighlight === 'all') - && this._selectionIsEmpty - && (!this._renderLineHightlightOnlyWhenFocus || this._focused)); - } -} -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__["registerThemingParticipant"])((theme, collector) => { - isRenderedUsingBorder = false; - const lineHighlight = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorLineHighlight"]); - if (lineHighlight) { - collector.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${lineHighlight}; }`); - collector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${lineHighlight}; border: none; }`); - } - if (!lineHighlight || lineHighlight.isTransparent() || theme.defines(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorLineHighlightBorder"])) { - const lineHighlightBorder = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorLineHighlightBorder"]); - if (lineHighlightBorder) { - isRenderedUsingBorder = true; - collector.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${lineHighlightBorder}; }`); - collector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${lineHighlightBorder}; }`); - if (theme.type === 'hc') { - collector.addRule(`.monaco-editor .view-overlays .current-line { border-width: 1px; }`); - collector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }`); - } - } - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.css": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.css ***! - \************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_decorations_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./decorations.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.css"); -/* harmony import */ var _css_loader_dist_cjs_js_decorations_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_decorations_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_decorations_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_decorations_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.js ***! - \***********************************************************************************************/ -/*! exports provided: DecorationsOverlay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DecorationsOverlay", function() { return DecorationsOverlay; }); -/* harmony import */ var _decorations_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./decorations.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/decorations/decorations.css"); -/* harmony import */ var _view_dynamicViewOverlay_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../view/dynamicViewOverlay.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/dynamicViewOverlay.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/view/renderingContext.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/renderingContext.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class DecorationsOverlay extends _view_dynamicViewOverlay_js__WEBPACK_IMPORTED_MODULE_1__["DynamicViewOverlay"] { - constructor(context) { - super(); - this._context = context; - const options = this._context.configuration.options; - this._lineHeight = options.get(51 /* lineHeight */); - this._typicalHalfwidthCharacterWidth = options.get(36 /* fontInfo */).typicalHalfwidthCharacterWidth; - this._renderResult = null; - this._context.addEventHandler(this); - } - dispose() { - this._context.removeEventHandler(this); - this._renderResult = null; - super.dispose(); - } - // --- begin event handlers - onConfigurationChanged(e) { - const options = this._context.configuration.options; - this._lineHeight = options.get(51 /* lineHeight */); - this._typicalHalfwidthCharacterWidth = options.get(36 /* fontInfo */).typicalHalfwidthCharacterWidth; - return true; - } - onDecorationsChanged(e) { - return true; - } - onFlushed(e) { - return true; - } - onLinesChanged(e) { - return true; - } - onLinesDeleted(e) { - return true; - } - onLinesInserted(e) { - return true; - } - onScrollChanged(e) { - return e.scrollTopChanged || e.scrollWidthChanged; - } - onZonesChanged(e) { - return true; - } - // --- end event handlers - prepareRender(ctx) { - const _decorations = ctx.getDecorationsInViewport(); - // Keep only decorations with `className` - let decorations = [], decorationsLen = 0; - for (let i = 0, len = _decorations.length; i < len; i++) { - const d = _decorations[i]; - if (d.options.className) { - decorations[decorationsLen++] = d; - } - } - // Sort decorations for consistent render output - decorations = decorations.sort((a, b) => { - if (a.options.zIndex < b.options.zIndex) { - return -1; - } - if (a.options.zIndex > b.options.zIndex) { - return 1; - } - const aClassName = a.options.className; - const bClassName = b.options.className; - if (aClassName < bClassName) { - return -1; - } - if (aClassName > bClassName) { - return 1; - } - return _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].compareRangesUsingStarts(a.range, b.range); - }); - const visibleStartLineNumber = ctx.visibleRange.startLineNumber; - const visibleEndLineNumber = ctx.visibleRange.endLineNumber; - const output = []; - for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) { - const lineIndex = lineNumber - visibleStartLineNumber; - output[lineIndex] = ''; - } - // Render first whole line decorations and then regular decorations - this._renderWholeLineDecorations(ctx, decorations, output); - this._renderNormalDecorations(ctx, decorations, output); - this._renderResult = output; - } - _renderWholeLineDecorations(ctx, decorations, output) { - const lineHeight = String(this._lineHeight); - const visibleStartLineNumber = ctx.visibleRange.startLineNumber; - const visibleEndLineNumber = ctx.visibleRange.endLineNumber; - for (let i = 0, lenI = decorations.length; i < lenI; i++) { - const d = decorations[i]; - if (!d.options.isWholeLine) { - continue; - } - const decorationOutput = ('
    '); - const startLineNumber = Math.max(d.range.startLineNumber, visibleStartLineNumber); - const endLineNumber = Math.min(d.range.endLineNumber, visibleEndLineNumber); - for (let j = startLineNumber; j <= endLineNumber; j++) { - const lineIndex = j - visibleStartLineNumber; - output[lineIndex] += decorationOutput; - } - } - } - _renderNormalDecorations(ctx, decorations, output) { - const lineHeight = String(this._lineHeight); - const visibleStartLineNumber = ctx.visibleRange.startLineNumber; - let prevClassName = null; - let prevShowIfCollapsed = false; - let prevRange = null; - for (let i = 0, lenI = decorations.length; i < lenI; i++) { - const d = decorations[i]; - if (d.options.isWholeLine) { - continue; - } - const className = d.options.className; - const showIfCollapsed = Boolean(d.options.showIfCollapsed); - let range = d.range; - if (showIfCollapsed && range.endColumn === 1 && range.endLineNumber !== range.startLineNumber) { - range = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](range.startLineNumber, range.startColumn, range.endLineNumber - 1, this._context.model.getLineMaxColumn(range.endLineNumber - 1)); - } - if (prevClassName === className && prevShowIfCollapsed === showIfCollapsed && _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].areIntersectingOrTouching(prevRange, range)) { - // merge into previous decoration - prevRange = _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].plusRange(prevRange, range); - continue; - } - // flush previous decoration - if (prevClassName !== null) { - this._renderNormalDecoration(ctx, prevRange, prevClassName, prevShowIfCollapsed, lineHeight, visibleStartLineNumber, output); - } - prevClassName = className; - prevShowIfCollapsed = showIfCollapsed; - prevRange = range; - } - if (prevClassName !== null) { - this._renderNormalDecoration(ctx, prevRange, prevClassName, prevShowIfCollapsed, lineHeight, visibleStartLineNumber, output); - } - } - _renderNormalDecoration(ctx, range, className, showIfCollapsed, lineHeight, visibleStartLineNumber, output) { - const linesVisibleRanges = ctx.linesVisibleRangesForRange(range, /*TODO@Alex*/ className === 'findMatch'); - if (!linesVisibleRanges) { - return; - } - for (let j = 0, lenJ = linesVisibleRanges.length; j < lenJ; j++) { - const lineVisibleRanges = linesVisibleRanges[j]; - if (lineVisibleRanges.outsideRenderedLine) { - continue; - } - const lineIndex = lineVisibleRanges.lineNumber - visibleStartLineNumber; - if (showIfCollapsed && lineVisibleRanges.ranges.length === 1) { - const singleVisibleRange = lineVisibleRanges.ranges[0]; - if (singleVisibleRange.width === 0) { - // collapsed range case => make the decoration visible by faking its width - lineVisibleRanges.ranges[0] = new _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_3__["HorizontalRange"](singleVisibleRange.left, this._typicalHalfwidthCharacterWidth); - } - } - for (let k = 0, lenK = lineVisibleRanges.ranges.length; k < lenK; k++) { - const visibleRange = lineVisibleRanges.ranges[k]; - const decorationOutput = ('
    '); - output[lineIndex] += decorationOutput; - } - } - } - render(startLineNumber, lineNumber) { - if (!this._renderResult) { - return ''; - } - const lineIndex = lineNumber - startLineNumber; - if (lineIndex < 0 || lineIndex >= this._renderResult.length) { - return ''; - } - return this._renderResult[lineIndex]; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js": -/*!*******************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js ***! - \*******************************************************************************************************/ -/*! exports provided: EditorScrollbar */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorScrollbar", function() { return EditorScrollbar; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _base_browser_ui_scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/browser/ui/scrollbar/scrollableElement.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js"); -/* harmony import */ var _view_viewPart_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../view/viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -class EditorScrollbar extends _view_viewPart_js__WEBPACK_IMPORTED_MODULE_3__["ViewPart"] { - constructor(context, linesContent, viewDomNode, overflowGuardDomNode) { - super(context); - const options = this._context.configuration.options; - const scrollbar = options.get(84 /* scrollbar */); - const mouseWheelScrollSensitivity = options.get(58 /* mouseWheelScrollSensitivity */); - const fastScrollSensitivity = options.get(28 /* fastScrollSensitivity */); - const scrollPredominantAxis = options.get(87 /* scrollPredominantAxis */); - const scrollbarOptions = { - listenOnDomNode: viewDomNode.domNode, - className: 'editor-scrollable' + ' ' + Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__["getThemeTypeSelector"])(context.theme.type), - useShadows: false, - lazyRender: true, - vertical: scrollbar.vertical, - horizontal: scrollbar.horizontal, - verticalHasArrows: scrollbar.verticalHasArrows, - horizontalHasArrows: scrollbar.horizontalHasArrows, - verticalScrollbarSize: scrollbar.verticalScrollbarSize, - verticalSliderSize: scrollbar.verticalSliderSize, - horizontalScrollbarSize: scrollbar.horizontalScrollbarSize, - horizontalSliderSize: scrollbar.horizontalSliderSize, - handleMouseWheel: scrollbar.handleMouseWheel, - alwaysConsumeMouseWheel: scrollbar.alwaysConsumeMouseWheel, - arrowSize: scrollbar.arrowSize, - mouseWheelScrollSensitivity: mouseWheelScrollSensitivity, - fastScrollSensitivity: fastScrollSensitivity, - scrollPredominantAxis: scrollPredominantAxis, - }; - this.scrollbar = this._register(new _base_browser_ui_scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_2__["SmoothScrollableElement"](linesContent.domNode, scrollbarOptions, this._context.viewLayout.getScrollable())); - _view_viewPart_js__WEBPACK_IMPORTED_MODULE_3__["PartFingerprints"].write(this.scrollbar.getDomNode(), 5 /* ScrollableElement */); - this.scrollbarDomNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(this.scrollbar.getDomNode()); - this.scrollbarDomNode.setPosition('absolute'); - this._setLayout(); - // When having a zone widget that calls .focus() on one of its dom elements, - // the browser will try desperately to reveal that dom node, unexpectedly - // changing the .scrollTop of this.linesContent - const onBrowserDesperateReveal = (domNode, lookAtScrollTop, lookAtScrollLeft) => { - const newScrollPosition = {}; - if (lookAtScrollTop) { - const deltaTop = domNode.scrollTop; - if (deltaTop) { - newScrollPosition.scrollTop = this._context.viewLayout.getCurrentScrollTop() + deltaTop; - domNode.scrollTop = 0; - } - } - if (lookAtScrollLeft) { - const deltaLeft = domNode.scrollLeft; - if (deltaLeft) { - newScrollPosition.scrollLeft = this._context.viewLayout.getCurrentScrollLeft() + deltaLeft; - domNode.scrollLeft = 0; - } - } - this._context.model.setScrollPosition(newScrollPosition, 1 /* Immediate */); - }; - // I've seen this happen both on the view dom node & on the lines content dom node. - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](viewDomNode.domNode, 'scroll', (e) => onBrowserDesperateReveal(viewDomNode.domNode, true, true))); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](linesContent.domNode, 'scroll', (e) => onBrowserDesperateReveal(linesContent.domNode, true, false))); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](overflowGuardDomNode.domNode, 'scroll', (e) => onBrowserDesperateReveal(overflowGuardDomNode.domNode, true, false))); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](this.scrollbarDomNode.domNode, 'scroll', (e) => onBrowserDesperateReveal(this.scrollbarDomNode.domNode, true, false))); - } - dispose() { - super.dispose(); - } - _setLayout() { - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this.scrollbarDomNode.setLeft(layoutInfo.contentLeft); - const minimap = options.get(56 /* minimap */); - const side = minimap.side; - if (side === 'right') { - this.scrollbarDomNode.setWidth(layoutInfo.contentWidth + layoutInfo.minimap.minimapWidth); - } - else { - this.scrollbarDomNode.setWidth(layoutInfo.contentWidth); - } - this.scrollbarDomNode.setHeight(layoutInfo.height); - } - getOverviewRulerLayoutInfo() { - return this.scrollbar.getOverviewRulerLayoutInfo(); - } - getDomNode() { - return this.scrollbarDomNode; - } - delegateVerticalScrollbarMouseDown(browserEvent) { - this.scrollbar.delegateVerticalScrollbarMouseDown(browserEvent); - } - // --- begin event handlers - onConfigurationChanged(e) { - if (e.hasChanged(84 /* scrollbar */) - || e.hasChanged(58 /* mouseWheelScrollSensitivity */) - || e.hasChanged(28 /* fastScrollSensitivity */)) { - const options = this._context.configuration.options; - const scrollbar = options.get(84 /* scrollbar */); - const mouseWheelScrollSensitivity = options.get(58 /* mouseWheelScrollSensitivity */); - const fastScrollSensitivity = options.get(28 /* fastScrollSensitivity */); - const scrollPredominantAxis = options.get(87 /* scrollPredominantAxis */); - const newOpts = { - handleMouseWheel: scrollbar.handleMouseWheel, - mouseWheelScrollSensitivity: mouseWheelScrollSensitivity, - fastScrollSensitivity: fastScrollSensitivity, - scrollPredominantAxis: scrollPredominantAxis - }; - this.scrollbar.updateOptions(newOpts); - } - if (e.hasChanged(117 /* layoutInfo */)) { - this._setLayout(); - } - return true; - } - onScrollChanged(e) { - return true; - } - onThemeChanged(e) { - this.scrollbar.updateClassName('editor-scrollable' + ' ' + Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__["getThemeTypeSelector"])(this._context.theme.type)); - return true; - } - // --- end event handlers - prepareRender(ctx) { - // Nothing to do - } - render(ctx) { - this.scrollbar.renderNow(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.css": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.css ***! - \************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_glyphMargin_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./glyphMargin.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.css"); -/* harmony import */ var _css_loader_dist_cjs_js_glyphMargin_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_glyphMargin_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_glyphMargin_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_glyphMargin_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js ***! - \***********************************************************************************************/ -/*! exports provided: DecorationToRender, DedupOverlay, GlyphMarginOverlay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DecorationToRender", function() { return DecorationToRender; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DedupOverlay", function() { return DedupOverlay; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlyphMarginOverlay", function() { return GlyphMarginOverlay; }); -/* harmony import */ var _glyphMargin_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./glyphMargin.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.css"); -/* harmony import */ var _view_dynamicViewOverlay_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../view/dynamicViewOverlay.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/dynamicViewOverlay.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class DecorationToRender { - constructor(startLineNumber, endLineNumber, className) { - this.startLineNumber = +startLineNumber; - this.endLineNumber = +endLineNumber; - this.className = String(className); - } -} -class DedupOverlay extends _view_dynamicViewOverlay_js__WEBPACK_IMPORTED_MODULE_1__["DynamicViewOverlay"] { - _render(visibleStartLineNumber, visibleEndLineNumber, decorations) { - const output = []; - for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) { - const lineIndex = lineNumber - visibleStartLineNumber; - output[lineIndex] = []; - } - if (decorations.length === 0) { - return output; - } - decorations.sort((a, b) => { - if (a.className === b.className) { - if (a.startLineNumber === b.startLineNumber) { - return a.endLineNumber - b.endLineNumber; - } - return a.startLineNumber - b.startLineNumber; - } - return (a.className < b.className ? -1 : 1); - }); - let prevClassName = null; - let prevEndLineIndex = 0; - for (let i = 0, len = decorations.length; i < len; i++) { - const d = decorations[i]; - const className = d.className; - let startLineIndex = Math.max(d.startLineNumber, visibleStartLineNumber) - visibleStartLineNumber; - const endLineIndex = Math.min(d.endLineNumber, visibleEndLineNumber) - visibleStartLineNumber; - if (prevClassName === className) { - startLineIndex = Math.max(prevEndLineIndex + 1, startLineIndex); - prevEndLineIndex = Math.max(prevEndLineIndex, endLineIndex); - } - else { - prevClassName = className; - prevEndLineIndex = endLineIndex; - } - for (let i = startLineIndex; i <= prevEndLineIndex; i++) { - output[i].push(prevClassName); - } - } - return output; - } -} -class GlyphMarginOverlay extends DedupOverlay { - constructor(context) { - super(); - this._context = context; - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._lineHeight = options.get(51 /* lineHeight */); - this._glyphMargin = options.get(42 /* glyphMargin */); - this._glyphMarginLeft = layoutInfo.glyphMarginLeft; - this._glyphMarginWidth = layoutInfo.glyphMarginWidth; - this._renderResult = null; - this._context.addEventHandler(this); - } - dispose() { - this._context.removeEventHandler(this); - this._renderResult = null; - super.dispose(); - } - // --- begin event handlers - onConfigurationChanged(e) { - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._lineHeight = options.get(51 /* lineHeight */); - this._glyphMargin = options.get(42 /* glyphMargin */); - this._glyphMarginLeft = layoutInfo.glyphMarginLeft; - this._glyphMarginWidth = layoutInfo.glyphMarginWidth; - return true; - } - onDecorationsChanged(e) { - return true; - } - onFlushed(e) { - return true; - } - onLinesChanged(e) { - return true; - } - onLinesDeleted(e) { - return true; - } - onLinesInserted(e) { - return true; - } - onScrollChanged(e) { - return e.scrollTopChanged; - } - onZonesChanged(e) { - return true; - } - // --- end event handlers - _getDecorations(ctx) { - const decorations = ctx.getDecorationsInViewport(); - let r = [], rLen = 0; - for (let i = 0, len = decorations.length; i < len; i++) { - const d = decorations[i]; - const glyphMarginClassName = d.options.glyphMarginClassName; - if (glyphMarginClassName) { - r[rLen++] = new DecorationToRender(d.range.startLineNumber, d.range.endLineNumber, glyphMarginClassName); - } - } - return r; - } - prepareRender(ctx) { - if (!this._glyphMargin) { - this._renderResult = null; - return; - } - const visibleStartLineNumber = ctx.visibleRange.startLineNumber; - const visibleEndLineNumber = ctx.visibleRange.endLineNumber; - const toRender = this._render(visibleStartLineNumber, visibleEndLineNumber, this._getDecorations(ctx)); - const lineHeight = this._lineHeight.toString(); - const left = this._glyphMarginLeft.toString(); - const width = this._glyphMarginWidth.toString(); - const common = '" style="left:' + left + 'px;width:' + width + 'px' + ';height:' + lineHeight + 'px;">'; - const output = []; - for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) { - const lineIndex = lineNumber - visibleStartLineNumber; - const classNames = toRender[lineIndex]; - if (classNames.length === 0) { - output[lineIndex] = ''; - } - else { - output[lineIndex] = ('
    = 1) { - const leftMostVisiblePosition = ctx.visibleRangeForPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_2__["Position"](lineNumber, 1)); - let left = leftMostVisiblePosition ? leftMostVisiblePosition.left : 0; - for (let i = 1; i <= indent; i++) { - const className = (containsActiveIndentGuide && i === activeIndentLevel ? 'cigra' : 'cigr'); - result += `
    `; - left += indentWidth; - if (left > scrollWidth || (this._maxIndentLeft > 0 && left > this._maxIndentLeft)) { - break; - } - } - } - output[lineIndex] = result; - } - this._renderResult = output; - } - render(startLineNumber, lineNumber) { - if (!this._renderResult) { - return ''; - } - const lineIndex = lineNumber - startLineNumber; - if (lineIndex < 0 || lineIndex >= this._renderResult.length) { - return ''; - } - return this._renderResult[lineIndex]; - } -} -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__["registerThemingParticipant"])((theme, collector) => { - const editorIndentGuidesColor = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["editorIndentGuides"]); - if (editorIndentGuidesColor) { - collector.addRule(`.monaco-editor .lines-content .cigr { box-shadow: 1px 0 0 0 ${editorIndentGuidesColor} inset; }`); - } - const editorActiveIndentGuidesColor = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["editorActiveIndentGuides"]) || editorIndentGuidesColor; - if (editorActiveIndentGuidesColor) { - collector.addRule(`.monaco-editor .lines-content .cigra { box-shadow: 1px 0 0 0 ${editorActiveIndentGuidesColor} inset; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.css": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.css ***! - \************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_lineNumbers_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./lineNumbers.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.css"); -/* harmony import */ var _css_loader_dist_cjs_js_lineNumbers_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_lineNumbers_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_lineNumbers_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_lineNumbers_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js ***! - \***********************************************************************************************/ -/*! exports provided: LineNumbersOverlay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineNumbersOverlay", function() { return LineNumbersOverlay; }); -/* harmony import */ var _lineNumbers_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lineNumbers.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.css"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _view_dynamicViewOverlay_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../view/dynamicViewOverlay.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/dynamicViewOverlay.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -class LineNumbersOverlay extends _view_dynamicViewOverlay_js__WEBPACK_IMPORTED_MODULE_2__["DynamicViewOverlay"] { - constructor(context) { - super(); - this._context = context; - this._readConfig(); - this._lastCursorModelPosition = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](1, 1); - this._renderResult = null; - this._context.addEventHandler(this); - } - _readConfig() { - const options = this._context.configuration.options; - this._lineHeight = options.get(51 /* lineHeight */); - const lineNumbers = options.get(52 /* lineNumbers */); - this._renderLineNumbers = lineNumbers.renderType; - this._renderCustomLineNumbers = lineNumbers.renderFn; - this._renderFinalNewline = options.get(76 /* renderFinalNewline */); - const layoutInfo = options.get(117 /* layoutInfo */); - this._lineNumbersLeft = layoutInfo.lineNumbersLeft; - this._lineNumbersWidth = layoutInfo.lineNumbersWidth; - } - dispose() { - this._context.removeEventHandler(this); - this._renderResult = null; - super.dispose(); - } - // --- begin event handlers - onConfigurationChanged(e) { - this._readConfig(); - return true; - } - onCursorStateChanged(e) { - const primaryViewPosition = e.selections[0].getPosition(); - this._lastCursorModelPosition = this._context.model.coordinatesConverter.convertViewPositionToModelPosition(primaryViewPosition); - if (this._renderLineNumbers === 2 /* Relative */ || this._renderLineNumbers === 3 /* Interval */) { - return true; - } - return false; - } - onFlushed(e) { - return true; - } - onLinesChanged(e) { - return true; - } - onLinesDeleted(e) { - return true; - } - onLinesInserted(e) { - return true; - } - onScrollChanged(e) { - return e.scrollTopChanged; - } - onZonesChanged(e) { - return true; - } - // --- end event handlers - _getLineRenderLineNumber(viewLineNumber) { - const modelPosition = this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](viewLineNumber, 1)); - if (modelPosition.column !== 1) { - return ''; - } - const modelLineNumber = modelPosition.lineNumber; - if (this._renderCustomLineNumbers) { - return this._renderCustomLineNumbers(modelLineNumber); - } - if (this._renderLineNumbers === 2 /* Relative */) { - const diff = Math.abs(this._lastCursorModelPosition.lineNumber - modelLineNumber); - if (diff === 0) { - return '' + modelLineNumber + ''; - } - return String(diff); - } - if (this._renderLineNumbers === 3 /* Interval */) { - if (this._lastCursorModelPosition.lineNumber === modelLineNumber) { - return String(modelLineNumber); - } - if (modelLineNumber % 10 === 0) { - return String(modelLineNumber); - } - return ''; - } - return String(modelLineNumber); - } - prepareRender(ctx) { - if (this._renderLineNumbers === 0 /* Off */) { - this._renderResult = null; - return; - } - const lineHeightClassName = (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isLinux"] ? (this._lineHeight % 2 === 0 ? ' lh-even' : ' lh-odd') : ''); - const visibleStartLineNumber = ctx.visibleRange.startLineNumber; - const visibleEndLineNumber = ctx.visibleRange.endLineNumber; - const common = '
    '; - const lineCount = this._context.model.getLineCount(); - const output = []; - for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) { - const lineIndex = lineNumber - visibleStartLineNumber; - if (!this._renderFinalNewline) { - if (lineNumber === lineCount && this._context.model.getLineLength(lineNumber) === 0) { - // Do not render last (empty) line - output[lineIndex] = ''; - continue; - } - } - const renderLineNumber = this._getLineRenderLineNumber(lineNumber); - if (renderLineNumber) { - output[lineIndex] = (common - + renderLineNumber - + '
    '); - } - else { - output[lineIndex] = ''; - } - } - this._renderResult = output; - } - render(startLineNumber, lineNumber) { - if (!this._renderResult) { - return ''; - } - const lineIndex = lineNumber - startLineNumber; - if (lineIndex < 0 || lineIndex >= this._renderResult.length) { - return ''; - } - return this._renderResult[lineIndex]; - } -} -LineNumbersOverlay.CLASS_NAME = 'line-numbers'; -// theming -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_5__["registerThemingParticipant"])((theme, collector) => { - const lineNumbers = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["editorLineNumbers"]); - if (lineNumbers) { - collector.addRule(`.monaco-editor .line-numbers { color: ${lineNumbers}; }`); - } - const activeLineNumber = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["editorActiveLineNumber"]); - if (activeLineNumber) { - collector.addRule(`.monaco-editor .current-line ~ .line-numbers { color: ${activeLineNumber}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/rangeUtil.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/rangeUtil.js ***! - \***************************************************************************************/ -/*! exports provided: RangeUtil */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RangeUtil", function() { return RangeUtil; }); -/* harmony import */ var _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../common/view/renderingContext.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/renderingContext.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class FloatHorizontalRange { - constructor(left, width) { - this.left = left; - this.width = width; - } - toString() { - return `[${this.left},${this.width}]`; - } - static compare(a, b) { - return a.left - b.left; - } -} -class RangeUtil { - static _createRange() { - if (!this._handyReadyRange) { - this._handyReadyRange = document.createRange(); - } - return this._handyReadyRange; - } - static _detachRange(range, endNode) { - // Move range out of the span node, IE doesn't like having many ranges in - // the same spot and will act badly for lines containing dashes ('-') - range.selectNodeContents(endNode); - } - static _readClientRects(startElement, startOffset, endElement, endOffset, endNode) { - const range = this._createRange(); - try { - range.setStart(startElement, startOffset); - range.setEnd(endElement, endOffset); - return range.getClientRects(); - } - catch (e) { - // This is life ... - return null; - } - finally { - this._detachRange(range, endNode); - } - } - static _mergeAdjacentRanges(ranges) { - if (ranges.length === 1) { - // There is nothing to merge - return [new _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_0__["HorizontalRange"](ranges[0].left, ranges[0].width)]; - } - ranges.sort(FloatHorizontalRange.compare); - let result = [], resultLen = 0; - let prevLeft = ranges[0].left; - let prevWidth = ranges[0].width; - for (let i = 1, len = ranges.length; i < len; i++) { - const range = ranges[i]; - const myLeft = range.left; - const myWidth = range.width; - if (prevLeft + prevWidth + 0.9 /* account for browser's rounding errors*/ >= myLeft) { - prevWidth = Math.max(prevWidth, myLeft + myWidth - prevLeft); - } - else { - result[resultLen++] = new _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_0__["HorizontalRange"](prevLeft, prevWidth); - prevLeft = myLeft; - prevWidth = myWidth; - } - } - result[resultLen++] = new _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_0__["HorizontalRange"](prevLeft, prevWidth); - return result; - } - static _createHorizontalRangesFromClientRects(clientRects, clientRectDeltaLeft) { - if (!clientRects || clientRects.length === 0) { - return null; - } - // We go through FloatHorizontalRange because it has been observed in bi-di text - // that the clientRects are not coming in sorted from the browser - const result = []; - for (let i = 0, len = clientRects.length; i < len; i++) { - const clientRect = clientRects[i]; - result[i] = new FloatHorizontalRange(Math.max(0, clientRect.left - clientRectDeltaLeft), clientRect.width); - } - return this._mergeAdjacentRanges(result); - } - static readHorizontalRanges(domNode, startChildIndex, startOffset, endChildIndex, endOffset, clientRectDeltaLeft, endNode) { - // Panic check - const min = 0; - const max = domNode.children.length - 1; - if (min > max) { - return null; - } - startChildIndex = Math.min(max, Math.max(min, startChildIndex)); - endChildIndex = Math.min(max, Math.max(min, endChildIndex)); - if (startChildIndex === endChildIndex && startOffset === endOffset && startOffset === 0) { - // We must find the position at the beginning of a - // To cover cases of empty s, aboid using a range and use the 's bounding box - const clientRects = domNode.children[startChildIndex].getClientRects(); - return this._createHorizontalRangesFromClientRects(clientRects, clientRectDeltaLeft); - } - // If crossing over to a span only to select offset 0, then use the previous span's maximum offset - // Chrome is buggy and doesn't handle 0 offsets well sometimes. - if (startChildIndex !== endChildIndex) { - if (endChildIndex > 0 && endOffset === 0) { - endChildIndex--; - endOffset = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - } - } - let startElement = domNode.children[startChildIndex].firstChild; - let endElement = domNode.children[endChildIndex].firstChild; - if (!startElement || !endElement) { - // When having an empty (without any text content), try to move to the previous - if (!startElement && startOffset === 0 && startChildIndex > 0) { - startElement = domNode.children[startChildIndex - 1].firstChild; - startOffset = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - } - if (!endElement && endOffset === 0 && endChildIndex > 0) { - endElement = domNode.children[endChildIndex - 1].firstChild; - endOffset = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - } - } - if (!startElement || !endElement) { - return null; - } - startOffset = Math.min(startElement.textContent.length, Math.max(0, startOffset)); - endOffset = Math.min(endElement.textContent.length, Math.max(0, endOffset)); - const clientRects = this._readClientRects(startElement, startOffset, endElement, endOffset, endNode); - return this._createHorizontalRangesFromClientRects(clientRects, clientRectDeltaLeft); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLine.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLine.js ***! - \**************************************************************************************/ -/*! exports provided: DomReadingContext, ViewLineOptions, ViewLine */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DomReadingContext", function() { return DomReadingContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewLineOptions", function() { return ViewLineOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewLine", function() { return ViewLine; }); -/* harmony import */ var _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/browser/browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _rangeUtil_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./rangeUtil.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/rangeUtil.js"); -/* harmony import */ var _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/view/renderingContext.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/renderingContext.js"); -/* harmony import */ var _common_viewLayout_lineDecorations_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/viewLayout/lineDecorations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/lineDecorations.js"); -/* harmony import */ var _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/viewLayout/viewLineRenderer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLineRenderer.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -const canUseFastRenderedViewLine = (function () { - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isNative"]) { - // In VSCode we know very well when the zoom level changes - return true; - } - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isLinux"] || _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isFirefox"] || _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isSafari"]) { - // On Linux, it appears that zooming affects char widths (in pixels), which is unexpected. - // -- - // Even though we read character widths correctly, having read them at a specific zoom level - // does not mean they are the same at the current zoom level. - // -- - // This could be improved if we ever figure out how to get an event when browsers zoom, - // but until then we have to stick with reading client rects. - // -- - // The same has been observed with Firefox on Windows7 - // -- - // The same has been oversved with Safari - return false; - } - return true; -})(); -let monospaceAssumptionsAreValid = true; -const alwaysRenderInlineSelection = (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isEdge"]); -class DomReadingContext { - constructor(domNode, endNode) { - this._domNode = domNode; - this._clientRectDeltaLeft = 0; - this._clientRectDeltaLeftRead = false; - this.endNode = endNode; - } - get clientRectDeltaLeft() { - if (!this._clientRectDeltaLeftRead) { - this._clientRectDeltaLeftRead = true; - this._clientRectDeltaLeft = this._domNode.getBoundingClientRect().left; - } - return this._clientRectDeltaLeft; - } -} -class ViewLineOptions { - constructor(config, themeType) { - this.themeType = themeType; - const options = config.options; - const fontInfo = options.get(36 /* fontInfo */); - this.renderWhitespace = options.get(80 /* renderWhitespace */); - this.renderControlCharacters = options.get(74 /* renderControlCharacters */); - this.spaceWidth = fontInfo.spaceWidth; - this.middotWidth = fontInfo.middotWidth; - this.wsmiddotWidth = fontInfo.wsmiddotWidth; - this.useMonospaceOptimizations = (fontInfo.isMonospace - && !options.get(24 /* disableMonospaceOptimizations */)); - this.canUseHalfwidthRightwardsArrow = fontInfo.canUseHalfwidthRightwardsArrow; - this.lineHeight = options.get(51 /* lineHeight */); - this.stopRenderingLineAfter = options.get(95 /* stopRenderingLineAfter */); - this.fontLigatures = options.get(37 /* fontLigatures */); - } - equals(other) { - return (this.themeType === other.themeType - && this.renderWhitespace === other.renderWhitespace - && this.renderControlCharacters === other.renderControlCharacters - && this.spaceWidth === other.spaceWidth - && this.middotWidth === other.middotWidth - && this.wsmiddotWidth === other.wsmiddotWidth - && this.useMonospaceOptimizations === other.useMonospaceOptimizations - && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow - && this.lineHeight === other.lineHeight - && this.stopRenderingLineAfter === other.stopRenderingLineAfter - && this.fontLigatures === other.fontLigatures); - } -} -class ViewLine { - constructor(options) { - this._options = options; - this._isMaybeInvalid = true; - this._renderedViewLine = null; - } - // --- begin IVisibleLineData - getDomNode() { - if (this._renderedViewLine && this._renderedViewLine.domNode) { - return this._renderedViewLine.domNode.domNode; - } - return null; - } - setDomNode(domNode) { - if (this._renderedViewLine) { - this._renderedViewLine.domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(domNode); - } - else { - throw new Error('I have no rendered view line to set the dom node to...'); - } - } - onContentChanged() { - this._isMaybeInvalid = true; - } - onTokensChanged() { - this._isMaybeInvalid = true; - } - onDecorationsChanged() { - this._isMaybeInvalid = true; - } - onOptionsChanged(newOptions) { - this._isMaybeInvalid = true; - this._options = newOptions; - } - onSelectionChanged() { - if (alwaysRenderInlineSelection || this._options.themeType === _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__["HIGH_CONTRAST"] || this._options.renderWhitespace === 'selection') { - this._isMaybeInvalid = true; - return true; - } - return false; - } - renderLine(lineNumber, deltaTop, viewportData, sb) { - if (this._isMaybeInvalid === false) { - // it appears that nothing relevant has changed - return false; - } - this._isMaybeInvalid = false; - const lineData = viewportData.getViewLineRenderingData(lineNumber); - const options = this._options; - const actualInlineDecorations = _common_viewLayout_lineDecorations_js__WEBPACK_IMPORTED_MODULE_5__["LineDecoration"].filter(lineData.inlineDecorations, lineNumber, lineData.minColumn, lineData.maxColumn); - // Only send selection information when needed for rendering whitespace - let selectionsOnLine = null; - if (alwaysRenderInlineSelection || options.themeType === _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__["HIGH_CONTRAST"] || this._options.renderWhitespace === 'selection') { - const selections = viewportData.selections; - for (const selection of selections) { - if (selection.endLineNumber < lineNumber || selection.startLineNumber > lineNumber) { - // Selection does not intersect line - continue; - } - const startColumn = (selection.startLineNumber === lineNumber ? selection.startColumn : lineData.minColumn); - const endColumn = (selection.endLineNumber === lineNumber ? selection.endColumn : lineData.maxColumn); - if (startColumn < endColumn) { - if (options.themeType === _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__["HIGH_CONTRAST"] || this._options.renderWhitespace !== 'selection') { - actualInlineDecorations.push(new _common_viewLayout_lineDecorations_js__WEBPACK_IMPORTED_MODULE_5__["LineDecoration"](startColumn, endColumn, 'inline-selected-text', 0 /* Regular */)); - } - else { - if (!selectionsOnLine) { - selectionsOnLine = []; - } - selectionsOnLine.push(new _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_6__["LineRange"](startColumn - 1, endColumn - 1)); - } - } - } - } - const renderLineInput = new _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_6__["RenderLineInput"](options.useMonospaceOptimizations, options.canUseHalfwidthRightwardsArrow, lineData.content, lineData.continuesWithWrappedLine, lineData.isBasicASCII, lineData.containsRTL, lineData.minColumn - 1, lineData.tokens, actualInlineDecorations, lineData.tabSize, lineData.startVisibleColumn, options.spaceWidth, options.middotWidth, options.wsmiddotWidth, options.stopRenderingLineAfter, options.renderWhitespace, options.renderControlCharacters, options.fontLigatures !== _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_8__["EditorFontLigatures"].OFF, selectionsOnLine); - if (this._renderedViewLine && this._renderedViewLine.input.equals(renderLineInput)) { - // no need to do anything, we have the same render input - return false; - } - sb.appendASCIIString('
    '); - const output = Object(_common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_6__["renderViewLine"])(renderLineInput, sb); - sb.appendASCIIString('
    '); - let renderedViewLine = null; - if (monospaceAssumptionsAreValid && canUseFastRenderedViewLine && lineData.isBasicASCII && options.useMonospaceOptimizations && output.containsForeignElements === 0 /* None */) { - if (lineData.content.length < 300 && renderLineInput.lineTokens.getCount() < 100) { - // Browser rounding errors have been observed in Chrome and IE, so using the fast - // view line only for short lines. Please test before removing the length check... - // --- - // Another rounding error has been observed on Linux in VSCode, where width - // rounding errors add up to an observable large number... - // --- - // Also see another example of rounding errors on Windows in - // https://github.com/Microsoft/vscode/issues/33178 - renderedViewLine = new FastRenderedViewLine(this._renderedViewLine ? this._renderedViewLine.domNode : null, renderLineInput, output.characterMapping); - } - } - if (!renderedViewLine) { - renderedViewLine = createRenderedLine(this._renderedViewLine ? this._renderedViewLine.domNode : null, renderLineInput, output.characterMapping, output.containsRTL, output.containsForeignElements); - } - this._renderedViewLine = renderedViewLine; - return true; - } - layoutLine(lineNumber, deltaTop) { - if (this._renderedViewLine && this._renderedViewLine.domNode) { - this._renderedViewLine.domNode.setTop(deltaTop); - this._renderedViewLine.domNode.setHeight(this._options.lineHeight); - } - } - // --- end IVisibleLineData - getWidth() { - if (!this._renderedViewLine) { - return 0; - } - return this._renderedViewLine.getWidth(); - } - getWidthIsFast() { - if (!this._renderedViewLine) { - return true; - } - return this._renderedViewLine.getWidthIsFast(); - } - needsMonospaceFontCheck() { - if (!this._renderedViewLine) { - return false; - } - return (this._renderedViewLine instanceof FastRenderedViewLine); - } - monospaceAssumptionsAreValid() { - if (!this._renderedViewLine) { - return monospaceAssumptionsAreValid; - } - if (this._renderedViewLine instanceof FastRenderedViewLine) { - return this._renderedViewLine.monospaceAssumptionsAreValid(); - } - return monospaceAssumptionsAreValid; - } - onMonospaceAssumptionsInvalidated() { - if (this._renderedViewLine && this._renderedViewLine instanceof FastRenderedViewLine) { - this._renderedViewLine = this._renderedViewLine.toSlowRenderedLine(); - } - } - getVisibleRangesForRange(startColumn, endColumn, context) { - if (!this._renderedViewLine) { - return null; - } - startColumn = startColumn | 0; // @perf - endColumn = endColumn | 0; // @perf - startColumn = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, startColumn)); - endColumn = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, endColumn)); - const stopRenderingLineAfter = this._renderedViewLine.input.stopRenderingLineAfter | 0; // @perf - let outsideRenderedLine = false; - if (stopRenderingLineAfter !== -1 && startColumn > stopRenderingLineAfter + 1 && endColumn > stopRenderingLineAfter + 1) { - // This range is obviously not visible - outsideRenderedLine = true; - } - if (stopRenderingLineAfter !== -1 && startColumn > stopRenderingLineAfter + 1) { - startColumn = stopRenderingLineAfter + 1; - } - if (stopRenderingLineAfter !== -1 && endColumn > stopRenderingLineAfter + 1) { - endColumn = stopRenderingLineAfter + 1; - } - const horizontalRanges = this._renderedViewLine.getVisibleRangesForRange(startColumn, endColumn, context); - if (horizontalRanges && horizontalRanges.length > 0) { - return new _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_4__["VisibleRanges"](outsideRenderedLine, horizontalRanges); - } - return null; - } - getColumnOfNodeOffset(lineNumber, spanNode, offset) { - if (!this._renderedViewLine) { - return 1; - } - return this._renderedViewLine.getColumnOfNodeOffset(lineNumber, spanNode, offset); - } -} -ViewLine.CLASS_NAME = 'view-line'; -/** - * A rendered line which is guaranteed to contain only regular ASCII and is rendered with a monospace font. - */ -class FastRenderedViewLine { - constructor(domNode, renderLineInput, characterMapping) { - this.domNode = domNode; - this.input = renderLineInput; - this._characterMapping = characterMapping; - this._charWidth = renderLineInput.spaceWidth; - } - getWidth() { - return this._getCharPosition(this._characterMapping.length); - } - getWidthIsFast() { - return true; - } - monospaceAssumptionsAreValid() { - if (!this.domNode) { - return monospaceAssumptionsAreValid; - } - const expectedWidth = this.getWidth(); - const actualWidth = this.domNode.domNode.firstChild.offsetWidth; - if (Math.abs(expectedWidth - actualWidth) >= 2) { - // more than 2px off - console.warn(`monospace assumptions have been violated, therefore disabling monospace optimizations!`); - monospaceAssumptionsAreValid = false; - } - return monospaceAssumptionsAreValid; - } - toSlowRenderedLine() { - return createRenderedLine(this.domNode, this.input, this._characterMapping, false, 0 /* None */); - } - getVisibleRangesForRange(startColumn, endColumn, context) { - const startPosition = this._getCharPosition(startColumn); - const endPosition = this._getCharPosition(endColumn); - return [new _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_4__["HorizontalRange"](startPosition, endPosition - startPosition)]; - } - _getCharPosition(column) { - const charOffset = this._characterMapping.getAbsoluteOffsets(); - if (charOffset.length === 0) { - // No characters on this line - return 0; - } - return Math.round(this._charWidth * charOffset[column - 1]); - } - getColumnOfNodeOffset(lineNumber, spanNode, offset) { - const spanNodeTextContentLength = spanNode.textContent.length; - let spanIndex = -1; - while (spanNode) { - spanNode = spanNode.previousSibling; - spanIndex++; - } - const charOffset = this._characterMapping.partDataToCharOffset(spanIndex, spanNodeTextContentLength, offset); - return charOffset + 1; - } -} -/** - * Every time we render a line, we save what we have rendered in an instance of this class. - */ -class RenderedViewLine { - constructor(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements) { - this.domNode = domNode; - this.input = renderLineInput; - this._characterMapping = characterMapping; - this._isWhitespaceOnly = /^\s*$/.test(renderLineInput.lineContent); - this._containsForeignElements = containsForeignElements; - this._cachedWidth = -1; - this._pixelOffsetCache = null; - if (!containsRTL || this._characterMapping.length === 0 /* the line is empty */) { - this._pixelOffsetCache = new Int32Array(Math.max(2, this._characterMapping.length + 1)); - for (let column = 0, len = this._characterMapping.length; column <= len; column++) { - this._pixelOffsetCache[column] = -1; - } - } - } - // --- Reading from the DOM methods - _getReadingTarget(myDomNode) { - return myDomNode.domNode.firstChild; - } - /** - * Width of the line in pixels - */ - getWidth() { - if (!this.domNode) { - return 0; - } - if (this._cachedWidth === -1) { - this._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth; - } - return this._cachedWidth; - } - getWidthIsFast() { - if (this._cachedWidth === -1) { - return false; - } - return true; - } - /** - * Visible ranges for a model range - */ - getVisibleRangesForRange(startColumn, endColumn, context) { - if (!this.domNode) { - return null; - } - if (this._pixelOffsetCache !== null) { - // the text is LTR - const startOffset = this._readPixelOffset(this.domNode, startColumn, context); - if (startOffset === -1) { - return null; - } - const endOffset = this._readPixelOffset(this.domNode, endColumn, context); - if (endOffset === -1) { - return null; - } - return [new _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_4__["HorizontalRange"](startOffset, endOffset - startOffset)]; - } - return this._readVisibleRangesForRange(this.domNode, startColumn, endColumn, context); - } - _readVisibleRangesForRange(domNode, startColumn, endColumn, context) { - if (startColumn === endColumn) { - const pixelOffset = this._readPixelOffset(domNode, startColumn, context); - if (pixelOffset === -1) { - return null; - } - else { - return [new _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_4__["HorizontalRange"](pixelOffset, 0)]; - } - } - else { - return this._readRawVisibleRangesForRange(domNode, startColumn, endColumn, context); - } - } - _readPixelOffset(domNode, column, context) { - if (this._characterMapping.length === 0) { - // This line has no content - if (this._containsForeignElements === 0 /* None */) { - // We can assume the line is really empty - return 0; - } - if (this._containsForeignElements === 2 /* After */) { - // We have foreign elements after the (empty) line - return 0; - } - if (this._containsForeignElements === 1 /* Before */) { - // We have foreign elements before the (empty) line - return this.getWidth(); - } - // We have foreign elements before & after the (empty) line - const readingTarget = this._getReadingTarget(domNode); - if (readingTarget.firstChild) { - return readingTarget.firstChild.offsetWidth; - } - else { - return 0; - } - } - if (this._pixelOffsetCache !== null) { - // the text is LTR - const cachedPixelOffset = this._pixelOffsetCache[column]; - if (cachedPixelOffset !== -1) { - return cachedPixelOffset; - } - const result = this._actualReadPixelOffset(domNode, column, context); - this._pixelOffsetCache[column] = result; - return result; - } - return this._actualReadPixelOffset(domNode, column, context); - } - _actualReadPixelOffset(domNode, column, context) { - if (this._characterMapping.length === 0) { - // This line has no content - const r = _rangeUtil_js__WEBPACK_IMPORTED_MODULE_3__["RangeUtil"].readHorizontalRanges(this._getReadingTarget(domNode), 0, 0, 0, 0, context.clientRectDeltaLeft, context.endNode); - if (!r || r.length === 0) { - return -1; - } - return r[0].left; - } - if (column === this._characterMapping.length && this._isWhitespaceOnly && this._containsForeignElements === 0 /* None */) { - // This branch helps in the case of whitespace only lines which have a width set - return this.getWidth(); - } - const partData = this._characterMapping.charOffsetToPartData(column - 1); - const partIndex = _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_6__["CharacterMapping"].getPartIndex(partData); - const charOffsetInPart = _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_6__["CharacterMapping"].getCharIndex(partData); - const r = _rangeUtil_js__WEBPACK_IMPORTED_MODULE_3__["RangeUtil"].readHorizontalRanges(this._getReadingTarget(domNode), partIndex, charOffsetInPart, partIndex, charOffsetInPart, context.clientRectDeltaLeft, context.endNode); - if (!r || r.length === 0) { - return -1; - } - const result = r[0].left; - if (this.input.isBasicASCII) { - const charOffset = this._characterMapping.getAbsoluteOffsets(); - const expectedResult = Math.round(this.input.spaceWidth * charOffset[column - 1]); - if (Math.abs(expectedResult - result) <= 1) { - return expectedResult; - } - } - return result; - } - _readRawVisibleRangesForRange(domNode, startColumn, endColumn, context) { - if (startColumn === 1 && endColumn === this._characterMapping.length) { - // This branch helps IE with bidi text & gives a performance boost to other browsers when reading visible ranges for an entire line - return [new _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_4__["HorizontalRange"](0, this.getWidth())]; - } - const startPartData = this._characterMapping.charOffsetToPartData(startColumn - 1); - const startPartIndex = _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_6__["CharacterMapping"].getPartIndex(startPartData); - const startCharOffsetInPart = _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_6__["CharacterMapping"].getCharIndex(startPartData); - const endPartData = this._characterMapping.charOffsetToPartData(endColumn - 1); - const endPartIndex = _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_6__["CharacterMapping"].getPartIndex(endPartData); - const endCharOffsetInPart = _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_6__["CharacterMapping"].getCharIndex(endPartData); - return _rangeUtil_js__WEBPACK_IMPORTED_MODULE_3__["RangeUtil"].readHorizontalRanges(this._getReadingTarget(domNode), startPartIndex, startCharOffsetInPart, endPartIndex, endCharOffsetInPart, context.clientRectDeltaLeft, context.endNode); - } - /** - * Returns the column for the text found at a specific offset inside a rendered dom node - */ - getColumnOfNodeOffset(lineNumber, spanNode, offset) { - const spanNodeTextContentLength = spanNode.textContent.length; - let spanIndex = -1; - while (spanNode) { - spanNode = spanNode.previousSibling; - spanIndex++; - } - const charOffset = this._characterMapping.partDataToCharOffset(spanIndex, spanNodeTextContentLength, offset); - return charOffset + 1; - } -} -class WebKitRenderedViewLine extends RenderedViewLine { - _readVisibleRangesForRange(domNode, startColumn, endColumn, context) { - const output = super._readVisibleRangesForRange(domNode, startColumn, endColumn, context); - if (!output || output.length === 0 || startColumn === endColumn || (startColumn === 1 && endColumn === this._characterMapping.length)) { - return output; - } - // WebKit is buggy and returns an expanded range (to contain words in some cases) - // The last client rect is enlarged (I think) - if (!this.input.containsRTL) { - // This is an attempt to patch things up - // Find position of last column - const endPixelOffset = this._readPixelOffset(domNode, endColumn, context); - if (endPixelOffset !== -1) { - const lastRange = output[output.length - 1]; - if (lastRange.left < endPixelOffset) { - // Trim down the width of the last visible range to not go after the last column's position - lastRange.width = endPixelOffset - lastRange.left; - } - } - } - return output; - } -} -const createRenderedLine = (function () { - if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__["isWebKit"]) { - return createWebKitRenderedLine; - } - return createNormalRenderedLine; -})(); -function createWebKitRenderedLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements) { - return new WebKitRenderedViewLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements); -} -function createNormalRenderedLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements) { - return new RenderedViewLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLines.css": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLines.css ***! - \****************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_viewLines_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./viewLines.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLines.css"); -/* harmony import */ var _css_loader_dist_cjs_js_viewLines_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_viewLines_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_viewLines_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_viewLines_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLines.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLines.js ***! - \***************************************************************************************/ -/*! exports provided: ViewLines */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewLines", function() { return ViewLines; }); -/* harmony import */ var _viewLines_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./viewLines.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLines.css"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _config_configuration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../config/configuration.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/config/configuration.js"); -/* harmony import */ var _view_viewLayer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../view/viewLayer.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewLayer.js"); -/* harmony import */ var _view_viewPart_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../view/viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/* harmony import */ var _viewLine_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./viewLine.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLine.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../common/view/renderingContext.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/renderingContext.js"); -/* harmony import */ var _base_browser_ui_mouseCursor_mouseCursor_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../base/browser/ui/mouseCursor/mouseCursor.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - -class LastRenderedData { - constructor() { - this._currentVisibleRange = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"](1, 1, 1, 1); - } - getCurrentVisibleRange() { - return this._currentVisibleRange; - } - setCurrentVisibleRange(currentVisibleRange) { - this._currentVisibleRange = currentVisibleRange; - } -} -class HorizontalRevealRangeRequest { - constructor(lineNumber, startColumn, endColumn, startScrollTop, stopScrollTop, scrollType) { - this.lineNumber = lineNumber; - this.startColumn = startColumn; - this.endColumn = endColumn; - this.startScrollTop = startScrollTop; - this.stopScrollTop = stopScrollTop; - this.scrollType = scrollType; - this.type = 'range'; - this.minLineNumber = lineNumber; - this.maxLineNumber = lineNumber; - } -} -class HorizontalRevealSelectionsRequest { - constructor(selections, startScrollTop, stopScrollTop, scrollType) { - this.selections = selections; - this.startScrollTop = startScrollTop; - this.stopScrollTop = stopScrollTop; - this.scrollType = scrollType; - this.type = 'selections'; - let minLineNumber = selections[0].startLineNumber; - let maxLineNumber = selections[0].endLineNumber; - for (let i = 1, len = selections.length; i < len; i++) { - const selection = selections[i]; - minLineNumber = Math.min(minLineNumber, selection.startLineNumber); - maxLineNumber = Math.max(maxLineNumber, selection.endLineNumber); - } - this.minLineNumber = minLineNumber; - this.maxLineNumber = maxLineNumber; - } -} -class ViewLines extends _view_viewPart_js__WEBPACK_IMPORTED_MODULE_5__["ViewPart"] { - constructor(context, linesContent) { - super(context); - this._linesContent = linesContent; - this._textRangeRestingSpot = document.createElement('div'); - this._visibleLines = new _view_viewLayer_js__WEBPACK_IMPORTED_MODULE_4__["VisibleLinesCollection"](this); - this.domNode = this._visibleLines.domNode; - const conf = this._context.configuration; - const options = this._context.configuration.options; - const fontInfo = options.get(36 /* fontInfo */); - const wrappingInfo = options.get(118 /* wrappingInfo */); - this._lineHeight = options.get(51 /* lineHeight */); - this._typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth; - this._isViewportWrapping = wrappingInfo.isViewportWrapping; - this._revealHorizontalRightPadding = options.get(81 /* revealHorizontalRightPadding */); - this._cursorSurroundingLines = options.get(20 /* cursorSurroundingLines */); - this._cursorSurroundingLinesStyle = options.get(21 /* cursorSurroundingLinesStyle */); - this._canUseLayerHinting = !options.get(23 /* disableLayerHinting */); - this._viewLineOptions = new _viewLine_js__WEBPACK_IMPORTED_MODULE_6__["ViewLineOptions"](conf, this._context.theme.type); - _view_viewPart_js__WEBPACK_IMPORTED_MODULE_5__["PartFingerprints"].write(this.domNode, 7 /* ViewLines */); - this.domNode.setClassName(`view-lines ${_base_browser_ui_mouseCursor_mouseCursor_js__WEBPACK_IMPORTED_MODULE_10__["MOUSE_CURSOR_TEXT_CSS_CLASS_NAME"]}`); - _config_configuration_js__WEBPACK_IMPORTED_MODULE_3__["Configuration"].applyFontInfo(this.domNode, fontInfo); - // --- width & height - this._maxLineWidth = 0; - this._asyncUpdateLineWidths = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["RunOnceScheduler"](() => { - this._updateLineWidthsSlow(); - }, 200); - this._asyncCheckMonospaceFontAssumptions = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["RunOnceScheduler"](() => { - this._checkMonospaceFontAssumptions(); - }, 2000); - this._lastRenderedData = new LastRenderedData(); - this._horizontalRevealRequest = null; - } - dispose() { - this._asyncUpdateLineWidths.dispose(); - this._asyncCheckMonospaceFontAssumptions.dispose(); - super.dispose(); - } - getDomNode() { - return this.domNode; - } - // ---- begin IVisibleLinesHost - createVisibleLine() { - return new _viewLine_js__WEBPACK_IMPORTED_MODULE_6__["ViewLine"](this._viewLineOptions); - } - // ---- end IVisibleLinesHost - // ---- begin view event handlers - onConfigurationChanged(e) { - this._visibleLines.onConfigurationChanged(e); - if (e.hasChanged(118 /* wrappingInfo */)) { - this._maxLineWidth = 0; - } - const options = this._context.configuration.options; - const fontInfo = options.get(36 /* fontInfo */); - const wrappingInfo = options.get(118 /* wrappingInfo */); - this._lineHeight = options.get(51 /* lineHeight */); - this._typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth; - this._isViewportWrapping = wrappingInfo.isViewportWrapping; - this._revealHorizontalRightPadding = options.get(81 /* revealHorizontalRightPadding */); - this._cursorSurroundingLines = options.get(20 /* cursorSurroundingLines */); - this._cursorSurroundingLinesStyle = options.get(21 /* cursorSurroundingLinesStyle */); - this._canUseLayerHinting = !options.get(23 /* disableLayerHinting */); - _config_configuration_js__WEBPACK_IMPORTED_MODULE_3__["Configuration"].applyFontInfo(this.domNode, fontInfo); - this._onOptionsMaybeChanged(); - if (e.hasChanged(117 /* layoutInfo */)) { - this._maxLineWidth = 0; - } - return true; - } - _onOptionsMaybeChanged() { - const conf = this._context.configuration; - const newViewLineOptions = new _viewLine_js__WEBPACK_IMPORTED_MODULE_6__["ViewLineOptions"](conf, this._context.theme.type); - if (!this._viewLineOptions.equals(newViewLineOptions)) { - this._viewLineOptions = newViewLineOptions; - const startLineNumber = this._visibleLines.getStartLineNumber(); - const endLineNumber = this._visibleLines.getEndLineNumber(); - for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { - const line = this._visibleLines.getVisibleLine(lineNumber); - line.onOptionsChanged(this._viewLineOptions); - } - return true; - } - return false; - } - onCursorStateChanged(e) { - const rendStartLineNumber = this._visibleLines.getStartLineNumber(); - const rendEndLineNumber = this._visibleLines.getEndLineNumber(); - let r = false; - for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) { - r = this._visibleLines.getVisibleLine(lineNumber).onSelectionChanged() || r; - } - return r; - } - onDecorationsChanged(e) { - if (true /*e.inlineDecorationsChanged*/) { - const rendStartLineNumber = this._visibleLines.getStartLineNumber(); - const rendEndLineNumber = this._visibleLines.getEndLineNumber(); - for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) { - this._visibleLines.getVisibleLine(lineNumber).onDecorationsChanged(); - } - } - return true; - } - onFlushed(e) { - const shouldRender = this._visibleLines.onFlushed(e); - this._maxLineWidth = 0; - return shouldRender; - } - onLinesChanged(e) { - return this._visibleLines.onLinesChanged(e); - } - onLinesDeleted(e) { - return this._visibleLines.onLinesDeleted(e); - } - onLinesInserted(e) { - return this._visibleLines.onLinesInserted(e); - } - onRevealRangeRequest(e) { - // Using the future viewport here in order to handle multiple - // incoming reveal range requests that might all desire to be animated - const desiredScrollTop = this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(), e.source, e.range, e.selections, e.verticalType); - if (desiredScrollTop === -1) { - // marker to abort the reveal range request - return false; - } - // validate the new desired scroll top - let newScrollPosition = this._context.viewLayout.validateScrollPosition({ scrollTop: desiredScrollTop }); - if (e.revealHorizontal) { - if (e.range && e.range.startLineNumber !== e.range.endLineNumber) { - // Two or more lines? => scroll to base (That's how you see most of the two lines) - newScrollPosition = { - scrollTop: newScrollPosition.scrollTop, - scrollLeft: 0 - }; - } - else if (e.range) { - // We don't necessarily know the horizontal offset of this range since the line might not be in the view... - this._horizontalRevealRequest = new HorizontalRevealRangeRequest(e.range.startLineNumber, e.range.startColumn, e.range.endColumn, this._context.viewLayout.getCurrentScrollTop(), newScrollPosition.scrollTop, e.scrollType); - } - else if (e.selections && e.selections.length > 0) { - this._horizontalRevealRequest = new HorizontalRevealSelectionsRequest(e.selections, this._context.viewLayout.getCurrentScrollTop(), newScrollPosition.scrollTop, e.scrollType); - } - } - else { - this._horizontalRevealRequest = null; - } - const scrollTopDelta = Math.abs(this._context.viewLayout.getCurrentScrollTop() - newScrollPosition.scrollTop); - const scrollType = (scrollTopDelta <= this._lineHeight ? 1 /* Immediate */ : e.scrollType); - this._context.model.setScrollPosition(newScrollPosition, scrollType); - return true; - } - onScrollChanged(e) { - if (this._horizontalRevealRequest && e.scrollLeftChanged) { - // cancel any outstanding horizontal reveal request if someone else scrolls horizontally. - this._horizontalRevealRequest = null; - } - if (this._horizontalRevealRequest && e.scrollTopChanged) { - const min = Math.min(this._horizontalRevealRequest.startScrollTop, this._horizontalRevealRequest.stopScrollTop); - const max = Math.max(this._horizontalRevealRequest.startScrollTop, this._horizontalRevealRequest.stopScrollTop); - if (e.scrollTop < min || e.scrollTop > max) { - // cancel any outstanding horizontal reveal request if someone else scrolls vertically. - this._horizontalRevealRequest = null; - } - } - this.domNode.setWidth(e.scrollWidth); - return this._visibleLines.onScrollChanged(e) || true; - } - onTokensChanged(e) { - return this._visibleLines.onTokensChanged(e); - } - onZonesChanged(e) { - this._context.model.setMaxLineWidth(this._maxLineWidth); - return this._visibleLines.onZonesChanged(e); - } - onThemeChanged(e) { - return this._onOptionsMaybeChanged(); - } - // ---- end view event handlers - // ----------- HELPERS FOR OTHERS - getPositionFromDOMInfo(spanNode, offset) { - const viewLineDomNode = this._getViewLineDomNode(spanNode); - if (viewLineDomNode === null) { - // Couldn't find view line node - return null; - } - const lineNumber = this._getLineNumberFor(viewLineDomNode); - if (lineNumber === -1) { - // Couldn't find view line node - return null; - } - if (lineNumber < 1 || lineNumber > this._context.model.getLineCount()) { - // lineNumber is outside range - return null; - } - if (this._context.model.getLineMaxColumn(lineNumber) === 1) { - // Line is empty - return new _common_core_position_js__WEBPACK_IMPORTED_MODULE_7__["Position"](lineNumber, 1); - } - const rendStartLineNumber = this._visibleLines.getStartLineNumber(); - const rendEndLineNumber = this._visibleLines.getEndLineNumber(); - if (lineNumber < rendStartLineNumber || lineNumber > rendEndLineNumber) { - // Couldn't find line - return null; - } - let column = this._visibleLines.getVisibleLine(lineNumber).getColumnOfNodeOffset(lineNumber, spanNode, offset); - const minColumn = this._context.model.getLineMinColumn(lineNumber); - if (column < minColumn) { - column = minColumn; - } - return new _common_core_position_js__WEBPACK_IMPORTED_MODULE_7__["Position"](lineNumber, column); - } - _getViewLineDomNode(node) { - while (node && node.nodeType === 1) { - if (node.className === _viewLine_js__WEBPACK_IMPORTED_MODULE_6__["ViewLine"].CLASS_NAME) { - return node; - } - node = node.parentElement; - } - return null; - } - /** - * @returns the line number of this view line dom node. - */ - _getLineNumberFor(domNode) { - const startLineNumber = this._visibleLines.getStartLineNumber(); - const endLineNumber = this._visibleLines.getEndLineNumber(); - for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { - const line = this._visibleLines.getVisibleLine(lineNumber); - if (domNode === line.getDomNode()) { - return lineNumber; - } - } - return -1; - } - getLineWidth(lineNumber) { - const rendStartLineNumber = this._visibleLines.getStartLineNumber(); - const rendEndLineNumber = this._visibleLines.getEndLineNumber(); - if (lineNumber < rendStartLineNumber || lineNumber > rendEndLineNumber) { - // Couldn't find line - return -1; - } - return this._visibleLines.getVisibleLine(lineNumber).getWidth(); - } - linesVisibleRangesForRange(_range, includeNewLines) { - if (this.shouldRender()) { - // Cannot read from the DOM because it is dirty - // i.e. the model & the dom are out of sync, so I'd be reading something stale - return null; - } - const originalEndLineNumber = _range.endLineNumber; - const range = _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].intersectRanges(_range, this._lastRenderedData.getCurrentVisibleRange()); - if (!range) { - return null; - } - let visibleRanges = [], visibleRangesLen = 0; - const domReadingContext = new _viewLine_js__WEBPACK_IMPORTED_MODULE_6__["DomReadingContext"](this.domNode.domNode, this._textRangeRestingSpot); - let nextLineModelLineNumber = 0; - if (includeNewLines) { - nextLineModelLineNumber = this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_7__["Position"](range.startLineNumber, 1)).lineNumber; - } - const rendStartLineNumber = this._visibleLines.getStartLineNumber(); - const rendEndLineNumber = this._visibleLines.getEndLineNumber(); - for (let lineNumber = range.startLineNumber; lineNumber <= range.endLineNumber; lineNumber++) { - if (lineNumber < rendStartLineNumber || lineNumber > rendEndLineNumber) { - continue; - } - const startColumn = lineNumber === range.startLineNumber ? range.startColumn : 1; - const endColumn = lineNumber === range.endLineNumber ? range.endColumn : this._context.model.getLineMaxColumn(lineNumber); - const visibleRangesForLine = this._visibleLines.getVisibleLine(lineNumber).getVisibleRangesForRange(startColumn, endColumn, domReadingContext); - if (!visibleRangesForLine) { - continue; - } - if (includeNewLines && lineNumber < originalEndLineNumber) { - const currentLineModelLineNumber = nextLineModelLineNumber; - nextLineModelLineNumber = this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_7__["Position"](lineNumber + 1, 1)).lineNumber; - if (currentLineModelLineNumber !== nextLineModelLineNumber) { - visibleRangesForLine.ranges[visibleRangesForLine.ranges.length - 1].width += this._typicalHalfwidthCharacterWidth; - } - } - visibleRanges[visibleRangesLen++] = new _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_9__["LineVisibleRanges"](visibleRangesForLine.outsideRenderedLine, lineNumber, visibleRangesForLine.ranges); - } - if (visibleRangesLen === 0) { - return null; - } - return visibleRanges; - } - _visibleRangesForLineRange(lineNumber, startColumn, endColumn) { - if (this.shouldRender()) { - // Cannot read from the DOM because it is dirty - // i.e. the model & the dom are out of sync, so I'd be reading something stale - return null; - } - if (lineNumber < this._visibleLines.getStartLineNumber() || lineNumber > this._visibleLines.getEndLineNumber()) { - return null; - } - return this._visibleLines.getVisibleLine(lineNumber).getVisibleRangesForRange(startColumn, endColumn, new _viewLine_js__WEBPACK_IMPORTED_MODULE_6__["DomReadingContext"](this.domNode.domNode, this._textRangeRestingSpot)); - } - visibleRangeForPosition(position) { - const visibleRanges = this._visibleRangesForLineRange(position.lineNumber, position.column, position.column); - if (!visibleRanges) { - return null; - } - return new _common_view_renderingContext_js__WEBPACK_IMPORTED_MODULE_9__["HorizontalPosition"](visibleRanges.outsideRenderedLine, visibleRanges.ranges[0].left); - } - // --- implementation - updateLineWidths() { - this._updateLineWidths(false); - } - /** - * Updates the max line width if it is fast to compute. - * Returns true if all lines were taken into account. - * Returns false if some lines need to be reevaluated (in a slow fashion). - */ - _updateLineWidthsFast() { - return this._updateLineWidths(true); - } - _updateLineWidthsSlow() { - this._updateLineWidths(false); - } - _updateLineWidths(fast) { - const rendStartLineNumber = this._visibleLines.getStartLineNumber(); - const rendEndLineNumber = this._visibleLines.getEndLineNumber(); - let localMaxLineWidth = 1; - let allWidthsComputed = true; - for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) { - const visibleLine = this._visibleLines.getVisibleLine(lineNumber); - if (fast && !visibleLine.getWidthIsFast()) { - // Cannot compute width in a fast way for this line - allWidthsComputed = false; - continue; - } - localMaxLineWidth = Math.max(localMaxLineWidth, visibleLine.getWidth()); - } - if (allWidthsComputed && rendStartLineNumber === 1 && rendEndLineNumber === this._context.model.getLineCount()) { - // we know the max line width for all the lines - this._maxLineWidth = 0; - } - this._ensureMaxLineWidth(localMaxLineWidth); - return allWidthsComputed; - } - _checkMonospaceFontAssumptions() { - // Problems with monospace assumptions are more apparent for longer lines, - // as small rounding errors start to sum up, so we will select the longest - // line for a closer inspection - let longestLineNumber = -1; - let longestWidth = -1; - const rendStartLineNumber = this._visibleLines.getStartLineNumber(); - const rendEndLineNumber = this._visibleLines.getEndLineNumber(); - for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) { - const visibleLine = this._visibleLines.getVisibleLine(lineNumber); - if (visibleLine.needsMonospaceFontCheck()) { - const lineWidth = visibleLine.getWidth(); - if (lineWidth > longestWidth) { - longestWidth = lineWidth; - longestLineNumber = lineNumber; - } - } - } - if (longestLineNumber === -1) { - return; - } - if (!this._visibleLines.getVisibleLine(longestLineNumber).monospaceAssumptionsAreValid()) { - for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) { - const visibleLine = this._visibleLines.getVisibleLine(lineNumber); - visibleLine.onMonospaceAssumptionsInvalidated(); - } - } - } - prepareRender() { - throw new Error('Not supported'); - } - render() { - throw new Error('Not supported'); - } - renderText(viewportData) { - // (1) render lines - ensures lines are in the DOM - this._visibleLines.renderLines(viewportData); - this._lastRenderedData.setCurrentVisibleRange(viewportData.visibleRange); - this.domNode.setWidth(this._context.viewLayout.getScrollWidth()); - this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(), 1000000)); - // (2) compute horizontal scroll position: - // - this must happen after the lines are in the DOM since it might need a line that rendered just now - // - it might change `scrollWidth` and `scrollLeft` - if (this._horizontalRevealRequest) { - const horizontalRevealRequest = this._horizontalRevealRequest; - // Check that we have the line that contains the horizontal range in the viewport - if (viewportData.startLineNumber <= horizontalRevealRequest.minLineNumber && horizontalRevealRequest.maxLineNumber <= viewportData.endLineNumber) { - this._horizontalRevealRequest = null; - // allow `visibleRangesForRange2` to work - this.onDidRender(); - // compute new scroll position - const newScrollLeft = this._computeScrollLeftToReveal(horizontalRevealRequest); - if (newScrollLeft) { - if (!this._isViewportWrapping) { - // ensure `scrollWidth` is large enough - this._ensureMaxLineWidth(newScrollLeft.maxHorizontalOffset); - } - // set `scrollLeft` - this._context.model.setScrollPosition({ - scrollLeft: newScrollLeft.scrollLeft - }, horizontalRevealRequest.scrollType); - } - } - } - // Update max line width (not so important, it is just so the horizontal scrollbar doesn't get too small) - if (!this._updateLineWidthsFast()) { - // Computing the width of some lines would be slow => delay it - this._asyncUpdateLineWidths.schedule(); - } - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isLinux"] && !this._asyncCheckMonospaceFontAssumptions.isScheduled()) { - const rendStartLineNumber = this._visibleLines.getStartLineNumber(); - const rendEndLineNumber = this._visibleLines.getEndLineNumber(); - for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) { - const visibleLine = this._visibleLines.getVisibleLine(lineNumber); - if (visibleLine.needsMonospaceFontCheck()) { - this._asyncCheckMonospaceFontAssumptions.schedule(); - break; - } - } - } - // (3) handle scrolling - this._linesContent.setLayerHinting(this._canUseLayerHinting); - this._linesContent.setContain('strict'); - const adjustedScrollTop = this._context.viewLayout.getCurrentScrollTop() - viewportData.bigNumbersDelta; - this._linesContent.setTop(-adjustedScrollTop); - this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft()); - } - // --- width - _ensureMaxLineWidth(lineWidth) { - const iLineWidth = Math.ceil(lineWidth); - if (this._maxLineWidth < iLineWidth) { - this._maxLineWidth = iLineWidth; - this._context.model.setMaxLineWidth(this._maxLineWidth); - } - } - _computeScrollTopToRevealRange(viewport, source, range, selections, verticalType) { - const viewportStartY = viewport.top; - const viewportHeight = viewport.height; - const viewportEndY = viewportStartY + viewportHeight; - let boxIsSingleRange; - let boxStartY; - let boxEndY; - // Have a box that includes one extra line height (for the horizontal scrollbar) - if (selections && selections.length > 0) { - let minLineNumber = selections[0].startLineNumber; - let maxLineNumber = selections[0].endLineNumber; - for (let i = 1, len = selections.length; i < len; i++) { - const selection = selections[i]; - minLineNumber = Math.min(minLineNumber, selection.startLineNumber); - maxLineNumber = Math.max(maxLineNumber, selection.endLineNumber); - } - boxIsSingleRange = false; - boxStartY = this._context.viewLayout.getVerticalOffsetForLineNumber(minLineNumber); - boxEndY = this._context.viewLayout.getVerticalOffsetForLineNumber(maxLineNumber) + this._lineHeight; - } - else if (range) { - boxIsSingleRange = true; - boxStartY = this._context.viewLayout.getVerticalOffsetForLineNumber(range.startLineNumber); - boxEndY = this._context.viewLayout.getVerticalOffsetForLineNumber(range.endLineNumber) + this._lineHeight; - } - else { - return -1; - } - const shouldIgnoreScrollOff = source === 'mouse' && this._cursorSurroundingLinesStyle === 'default'; - if (!shouldIgnoreScrollOff) { - const context = Math.min((viewportHeight / this._lineHeight) / 2, this._cursorSurroundingLines); - boxStartY -= context * this._lineHeight; - boxEndY += Math.max(0, (context - 1)) * this._lineHeight; - } - if (verticalType === 0 /* Simple */ || verticalType === 4 /* Bottom */) { - // Reveal one line more when the last line would be covered by the scrollbar - arrow down case or revealing a line explicitly at bottom - boxEndY += this._lineHeight; - } - let newScrollTop; - if (boxEndY - boxStartY > viewportHeight) { - // the box is larger than the viewport ... scroll to its top - if (!boxIsSingleRange) { - // do not reveal multiple cursors if there are more than fit the viewport - return -1; - } - newScrollTop = boxStartY; - } - else if (verticalType === 5 /* NearTop */ || verticalType === 6 /* NearTopIfOutsideViewport */) { - if (verticalType === 6 /* NearTopIfOutsideViewport */ && viewportStartY <= boxStartY && boxEndY <= viewportEndY) { - // Box is already in the viewport... do nothing - newScrollTop = viewportStartY; - } - else { - // We want a gap that is 20% of the viewport, but with a minimum of 5 lines - const desiredGapAbove = Math.max(5 * this._lineHeight, viewportHeight * 0.2); - // Try to scroll just above the box with the desired gap - const desiredScrollTop = boxStartY - desiredGapAbove; - // But ensure that the box is not pushed out of viewport - const minScrollTop = boxEndY - viewportHeight; - newScrollTop = Math.max(minScrollTop, desiredScrollTop); - } - } - else if (verticalType === 1 /* Center */ || verticalType === 2 /* CenterIfOutsideViewport */) { - if (verticalType === 2 /* CenterIfOutsideViewport */ && viewportStartY <= boxStartY && boxEndY <= viewportEndY) { - // Box is already in the viewport... do nothing - newScrollTop = viewportStartY; - } - else { - // Box is outside the viewport... center it - const boxMiddleY = (boxStartY + boxEndY) / 2; - newScrollTop = Math.max(0, boxMiddleY - viewportHeight / 2); - } - } - else { - newScrollTop = this._computeMinimumScrolling(viewportStartY, viewportEndY, boxStartY, boxEndY, verticalType === 3 /* Top */, verticalType === 4 /* Bottom */); - } - return newScrollTop; - } - _computeScrollLeftToReveal(horizontalRevealRequest) { - const viewport = this._context.viewLayout.getCurrentViewport(); - const viewportStartX = viewport.left; - const viewportEndX = viewportStartX + viewport.width; - let boxStartX = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - let boxEndX = 0; - if (horizontalRevealRequest.type === 'range') { - const visibleRanges = this._visibleRangesForLineRange(horizontalRevealRequest.lineNumber, horizontalRevealRequest.startColumn, horizontalRevealRequest.endColumn); - if (!visibleRanges) { - return null; - } - for (const visibleRange of visibleRanges.ranges) { - boxStartX = Math.min(boxStartX, visibleRange.left); - boxEndX = Math.max(boxEndX, visibleRange.left + visibleRange.width); - } - } - else { - for (const selection of horizontalRevealRequest.selections) { - if (selection.startLineNumber !== selection.endLineNumber) { - return null; - } - const visibleRanges = this._visibleRangesForLineRange(selection.startLineNumber, selection.startColumn, selection.endColumn); - if (!visibleRanges) { - return null; - } - for (const visibleRange of visibleRanges.ranges) { - boxStartX = Math.min(boxStartX, visibleRange.left); - boxEndX = Math.max(boxEndX, visibleRange.left + visibleRange.width); - } - } - } - boxStartX = Math.max(0, boxStartX - ViewLines.HORIZONTAL_EXTRA_PX); - boxEndX += this._revealHorizontalRightPadding; - if (horizontalRevealRequest.type === 'selections' && boxEndX - boxStartX > viewport.width) { - return null; - } - const newScrollLeft = this._computeMinimumScrolling(viewportStartX, viewportEndX, boxStartX, boxEndX); - return { - scrollLeft: newScrollLeft, - maxHorizontalOffset: boxEndX - }; - } - _computeMinimumScrolling(viewportStart, viewportEnd, boxStart, boxEnd, revealAtStart, revealAtEnd) { - viewportStart = viewportStart | 0; - viewportEnd = viewportEnd | 0; - boxStart = boxStart | 0; - boxEnd = boxEnd | 0; - revealAtStart = !!revealAtStart; - revealAtEnd = !!revealAtEnd; - const viewportLength = viewportEnd - viewportStart; - const boxLength = boxEnd - boxStart; - if (boxLength < viewportLength) { - // The box would fit in the viewport - if (revealAtStart) { - return boxStart; - } - if (revealAtEnd) { - return Math.max(0, boxEnd - viewportLength); - } - if (boxStart < viewportStart) { - // The box is above the viewport - return boxStart; - } - else if (boxEnd > viewportEnd) { - // The box is below the viewport - return Math.max(0, boxEnd - viewportLength); - } - } - else { - // The box would not fit in the viewport - // Reveal the beginning of the box - return boxStart; - } - return viewportStart; - } -} -/** - * Adds this amount of pixels to the right of lines (no-one wants to type near the edge of the viewport) - */ -ViewLines.HORIZONTAL_EXTRA_PX = 30; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.css": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.css ***! - \**********************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_linesDecorations_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./linesDecorations.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.css"); -/* harmony import */ var _css_loader_dist_cjs_js_linesDecorations_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_linesDecorations_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_linesDecorations_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_linesDecorations_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js": -/*!*********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js ***! - \*********************************************************************************************************/ -/*! exports provided: LinesDecorationsOverlay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinesDecorationsOverlay", function() { return LinesDecorationsOverlay; }); -/* harmony import */ var _linesDecorations_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linesDecorations.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.css"); -/* harmony import */ var _glyphMargin_glyphMargin_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../glyphMargin/glyphMargin.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class LinesDecorationsOverlay extends _glyphMargin_glyphMargin_js__WEBPACK_IMPORTED_MODULE_1__["DedupOverlay"] { - constructor(context) { - super(); - this._context = context; - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._decorationsLeft = layoutInfo.decorationsLeft; - this._decorationsWidth = layoutInfo.decorationsWidth; - this._renderResult = null; - this._context.addEventHandler(this); - } - dispose() { - this._context.removeEventHandler(this); - this._renderResult = null; - super.dispose(); - } - // --- begin event handlers - onConfigurationChanged(e) { - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._decorationsLeft = layoutInfo.decorationsLeft; - this._decorationsWidth = layoutInfo.decorationsWidth; - return true; - } - onDecorationsChanged(e) { - return true; - } - onFlushed(e) { - return true; - } - onLinesChanged(e) { - return true; - } - onLinesDeleted(e) { - return true; - } - onLinesInserted(e) { - return true; - } - onScrollChanged(e) { - return e.scrollTopChanged; - } - onZonesChanged(e) { - return true; - } - // --- end event handlers - _getDecorations(ctx) { - const decorations = ctx.getDecorationsInViewport(); - let r = [], rLen = 0; - for (let i = 0, len = decorations.length; i < len; i++) { - const d = decorations[i]; - const linesDecorationsClassName = d.options.linesDecorationsClassName; - if (linesDecorationsClassName) { - r[rLen++] = new _glyphMargin_glyphMargin_js__WEBPACK_IMPORTED_MODULE_1__["DecorationToRender"](d.range.startLineNumber, d.range.endLineNumber, linesDecorationsClassName); - } - const firstLineDecorationClassName = d.options.firstLineDecorationClassName; - if (firstLineDecorationClassName) { - r[rLen++] = new _glyphMargin_glyphMargin_js__WEBPACK_IMPORTED_MODULE_1__["DecorationToRender"](d.range.startLineNumber, d.range.startLineNumber, firstLineDecorationClassName); - } - } - return r; - } - prepareRender(ctx) { - const visibleStartLineNumber = ctx.visibleRange.startLineNumber; - const visibleEndLineNumber = ctx.visibleRange.endLineNumber; - const toRender = this._render(visibleStartLineNumber, visibleEndLineNumber, this._getDecorations(ctx)); - const left = this._decorationsLeft.toString(); - const width = this._decorationsWidth.toString(); - const common = '" style="left:' + left + 'px;width:' + width + 'px;">
    '; - const output = []; - for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) { - const lineIndex = lineNumber - visibleStartLineNumber; - const classNames = toRender[lineIndex]; - let lineOutput = ''; - for (let i = 0, len = classNames.length; i < len; i++) { - lineOutput += '
    '; - } - output[lineIndex] = lineOutput; - } - this._renderResult = output; - } - render(startLineNumber, lineNumber) { - if (!this._renderResult) { - return ''; - } - return this._renderResult[lineNumber - startLineNumber]; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.css": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.css ***! - \****************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_minimap_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./minimap.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.css"); -/* harmony import */ var _css_loader_dist_cjs_js_minimap_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_minimap_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_minimap_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_minimap_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.js ***! - \***************************************************************************************/ -/*! exports provided: Minimap */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Minimap", function() { return Minimap; }); -/* harmony import */ var _minimap_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./minimap.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimap.css"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../base/browser/globalMouseMoveMonitor.js */ "./node_modules/monaco-editor/esm/vs/base/browser/globalMouseMoveMonitor.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _view_viewLayer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../view/viewLayer.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewLayer.js"); -/* harmony import */ var _view_viewPart_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../view/viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/* harmony import */ var _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../common/config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_rgba_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../common/core/rgba.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/rgba.js"); -/* harmony import */ var _common_viewModel_minimapTokensColorTracker_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../common/viewModel/minimapTokensColorTracker.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/minimapTokensColorTracker.js"); -/* harmony import */ var _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../common/viewModel/viewModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModel.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../../base/browser/touch.js */ "./node_modules/monaco-editor/esm/vs/base/browser/touch.js"); -/* harmony import */ var _minimapCharRendererFactory_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./minimapCharRendererFactory.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.js"); -/* harmony import */ var _common_model_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../common/model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/* harmony import */ var _base_common_functional_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../../base/common/functional.js */ "./node_modules/monaco-editor/esm/vs/base/common/functional.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - - - - - -/** - * The orthogonal distance to the slider at which dragging "resets". This implements "snapping" - */ -const MOUSE_DRAG_RESET_DISTANCE = 140; -const GUTTER_DECORATION_WIDTH = 2; -class MinimapOptions { - constructor(configuration, theme, tokensColorTracker) { - const options = configuration.options; - const pixelRatio = options.get(115 /* pixelRatio */); - const layoutInfo = options.get(117 /* layoutInfo */); - const minimapLayout = layoutInfo.minimap; - const fontInfo = options.get(36 /* fontInfo */); - const minimapOpts = options.get(56 /* minimap */); - this.renderMinimap = minimapLayout.renderMinimap; - this.size = minimapOpts.size; - this.minimapHeightIsEditorHeight = minimapLayout.minimapHeightIsEditorHeight; - this.scrollBeyondLastLine = options.get(86 /* scrollBeyondLastLine */); - this.showSlider = minimapOpts.showSlider; - this.pixelRatio = pixelRatio; - this.typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth; - this.lineHeight = options.get(51 /* lineHeight */); - this.minimapLeft = minimapLayout.minimapLeft; - this.minimapWidth = minimapLayout.minimapWidth; - this.minimapHeight = layoutInfo.height; - this.canvasInnerWidth = minimapLayout.minimapCanvasInnerWidth; - this.canvasInnerHeight = minimapLayout.minimapCanvasInnerHeight; - this.canvasOuterWidth = minimapLayout.minimapCanvasOuterWidth; - this.canvasOuterHeight = minimapLayout.minimapCanvasOuterHeight; - this.isSampling = minimapLayout.minimapIsSampling; - this.editorHeight = layoutInfo.height; - this.fontScale = minimapLayout.minimapScale; - this.minimapLineHeight = minimapLayout.minimapLineHeight; - this.minimapCharWidth = 1 /* BASE_CHAR_WIDTH */ * this.fontScale; - this.charRenderer = Object(_base_common_functional_js__WEBPACK_IMPORTED_MODULE_20__["once"])(() => _minimapCharRendererFactory_js__WEBPACK_IMPORTED_MODULE_18__["MinimapCharRendererFactory"].create(this.fontScale, fontInfo.fontFamily)); - this.backgroundColor = MinimapOptions._getMinimapBackground(theme, tokensColorTracker); - } - static _getMinimapBackground(theme, tokensColorTracker) { - const themeColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["minimapBackground"]); - if (themeColor) { - return new _common_core_rgba_js__WEBPACK_IMPORTED_MODULE_11__["RGBA8"](themeColor.rgba.r, themeColor.rgba.g, themeColor.rgba.b, themeColor.rgba.a); - } - return tokensColorTracker.getColor(2 /* DefaultBackground */); - } - equals(other) { - return (this.renderMinimap === other.renderMinimap - && this.size === other.size - && this.minimapHeightIsEditorHeight === other.minimapHeightIsEditorHeight - && this.scrollBeyondLastLine === other.scrollBeyondLastLine - && this.showSlider === other.showSlider - && this.pixelRatio === other.pixelRatio - && this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth - && this.lineHeight === other.lineHeight - && this.minimapLeft === other.minimapLeft - && this.minimapWidth === other.minimapWidth - && this.minimapHeight === other.minimapHeight - && this.canvasInnerWidth === other.canvasInnerWidth - && this.canvasInnerHeight === other.canvasInnerHeight - && this.canvasOuterWidth === other.canvasOuterWidth - && this.canvasOuterHeight === other.canvasOuterHeight - && this.isSampling === other.isSampling - && this.editorHeight === other.editorHeight - && this.fontScale === other.fontScale - && this.minimapLineHeight === other.minimapLineHeight - && this.minimapCharWidth === other.minimapCharWidth - && this.backgroundColor && this.backgroundColor.equals(other.backgroundColor)); - } -} -class MinimapLayout { - constructor(scrollTop, scrollHeight, sliderNeeded, computedSliderRatio, sliderTop, sliderHeight, startLineNumber, endLineNumber) { - this.scrollTop = scrollTop; - this.scrollHeight = scrollHeight; - this.sliderNeeded = sliderNeeded; - this._computedSliderRatio = computedSliderRatio; - this.sliderTop = sliderTop; - this.sliderHeight = sliderHeight; - this.startLineNumber = startLineNumber; - this.endLineNumber = endLineNumber; - } - /** - * Compute a desired `scrollPosition` such that the slider moves by `delta`. - */ - getDesiredScrollTopFromDelta(delta) { - const desiredSliderPosition = this.sliderTop + delta; - return Math.round(desiredSliderPosition / this._computedSliderRatio); - } - getDesiredScrollTopFromTouchLocation(pageY) { - return Math.round((pageY - this.sliderHeight / 2) / this._computedSliderRatio); - } - static create(options, viewportStartLineNumber, viewportEndLineNumber, viewportHeight, viewportContainsWhitespaceGaps, lineCount, realLineCount, scrollTop, scrollHeight, previousLayout) { - const pixelRatio = options.pixelRatio; - const minimapLineHeight = options.minimapLineHeight; - const minimapLinesFitting = Math.floor(options.canvasInnerHeight / minimapLineHeight); - const lineHeight = options.lineHeight; - if (options.minimapHeightIsEditorHeight) { - const logicalScrollHeight = (realLineCount * options.lineHeight - + (options.scrollBeyondLastLine ? viewportHeight - options.lineHeight : 0)); - const sliderHeight = Math.max(1, Math.floor(viewportHeight * viewportHeight / logicalScrollHeight)); - const maxMinimapSliderTop = Math.max(0, options.minimapHeight - sliderHeight); - // The slider can move from 0 to `maxMinimapSliderTop` - // in the same way `scrollTop` can move from 0 to `scrollHeight` - `viewportHeight`. - const computedSliderRatio = (maxMinimapSliderTop) / (scrollHeight - viewportHeight); - const sliderTop = (scrollTop * computedSliderRatio); - const sliderNeeded = (maxMinimapSliderTop > 0); - const maxLinesFitting = Math.floor(options.canvasInnerHeight / options.minimapLineHeight); - return new MinimapLayout(scrollTop, scrollHeight, sliderNeeded, computedSliderRatio, sliderTop, sliderHeight, 1, Math.min(lineCount, maxLinesFitting)); - } - // The visible line count in a viewport can change due to a number of reasons: - // a) with the same viewport width, different scroll positions can result in partial lines being visible: - // e.g. for a line height of 20, and a viewport height of 600 - // * scrollTop = 0 => visible lines are [1, 30] - // * scrollTop = 10 => visible lines are [1, 31] (with lines 1 and 31 partially visible) - // * scrollTop = 20 => visible lines are [2, 31] - // b) whitespace gaps might make their way in the viewport (which results in a decrease in the visible line count) - // c) we could be in the scroll beyond last line case (which also results in a decrease in the visible line count, down to possibly only one line being visible) - // We must first establish a desirable slider height. - let sliderHeight; - if (viewportContainsWhitespaceGaps && viewportEndLineNumber !== lineCount) { - // case b) from above: there are whitespace gaps in the viewport. - // In this case, the height of the slider directly reflects the visible line count. - const viewportLineCount = viewportEndLineNumber - viewportStartLineNumber + 1; - sliderHeight = Math.floor(viewportLineCount * minimapLineHeight / pixelRatio); - } - else { - // The slider has a stable height - const expectedViewportLineCount = viewportHeight / lineHeight; - sliderHeight = Math.floor(expectedViewportLineCount * minimapLineHeight / pixelRatio); - } - let maxMinimapSliderTop; - if (options.scrollBeyondLastLine) { - // The minimap slider, when dragged all the way down, will contain the last line at its top - maxMinimapSliderTop = (lineCount - 1) * minimapLineHeight / pixelRatio; - } - else { - // The minimap slider, when dragged all the way down, will contain the last line at its bottom - maxMinimapSliderTop = Math.max(0, lineCount * minimapLineHeight / pixelRatio - sliderHeight); - } - maxMinimapSliderTop = Math.min(options.minimapHeight - sliderHeight, maxMinimapSliderTop); - // The slider can move from 0 to `maxMinimapSliderTop` - // in the same way `scrollTop` can move from 0 to `scrollHeight` - `viewportHeight`. - const computedSliderRatio = (maxMinimapSliderTop) / (scrollHeight - viewportHeight); - const sliderTop = (scrollTop * computedSliderRatio); - let extraLinesAtTheBottom = 0; - if (options.scrollBeyondLastLine) { - const expectedViewportLineCount = viewportHeight / lineHeight; - extraLinesAtTheBottom = expectedViewportLineCount - 1; - } - if (minimapLinesFitting >= lineCount + extraLinesAtTheBottom) { - // All lines fit in the minimap - const startLineNumber = 1; - const endLineNumber = lineCount; - const sliderNeeded = (maxMinimapSliderTop > 0); - return new MinimapLayout(scrollTop, scrollHeight, sliderNeeded, computedSliderRatio, sliderTop, sliderHeight, startLineNumber, endLineNumber); - } - else { - let startLineNumber = Math.max(1, Math.floor(viewportStartLineNumber - sliderTop * pixelRatio / minimapLineHeight)); - // Avoid flickering caused by a partial viewport start line - // by being consistent w.r.t. the previous layout decision - if (previousLayout && previousLayout.scrollHeight === scrollHeight) { - if (previousLayout.scrollTop > scrollTop) { - // Scrolling up => never increase `startLineNumber` - startLineNumber = Math.min(startLineNumber, previousLayout.startLineNumber); - } - if (previousLayout.scrollTop < scrollTop) { - // Scrolling down => never decrease `startLineNumber` - startLineNumber = Math.max(startLineNumber, previousLayout.startLineNumber); - } - } - const endLineNumber = Math.min(lineCount, startLineNumber + minimapLinesFitting - 1); - return new MinimapLayout(scrollTop, scrollHeight, true, computedSliderRatio, sliderTop, sliderHeight, startLineNumber, endLineNumber); - } - } -} -class MinimapLine { - constructor(dy) { - this.dy = dy; - } - onContentChanged() { - this.dy = -1; - } - onTokensChanged() { - this.dy = -1; - } -} -MinimapLine.INVALID = new MinimapLine(-1); -class RenderData { - constructor(renderedLayout, imageData, lines) { - this.renderedLayout = renderedLayout; - this._imageData = imageData; - this._renderedLines = new _view_viewLayer_js__WEBPACK_IMPORTED_MODULE_7__["RenderedLinesCollection"](() => MinimapLine.INVALID); - this._renderedLines._set(renderedLayout.startLineNumber, lines); - } - /** - * Check if the current RenderData matches accurately the new desired layout and no painting is needed. - */ - linesEquals(layout) { - if (!this.scrollEquals(layout)) { - return false; - } - const tmp = this._renderedLines._get(); - const lines = tmp.lines; - for (let i = 0, len = lines.length; i < len; i++) { - if (lines[i].dy === -1) { - // This line is invalid - return false; - } - } - return true; - } - /** - * Check if the current RenderData matches the new layout's scroll position - */ - scrollEquals(layout) { - return this.renderedLayout.startLineNumber === layout.startLineNumber - && this.renderedLayout.endLineNumber === layout.endLineNumber; - } - _get() { - const tmp = this._renderedLines._get(); - return { - imageData: this._imageData, - rendLineNumberStart: tmp.rendLineNumberStart, - lines: tmp.lines - }; - } - onLinesChanged(changeFromLineNumber, changeToLineNumber) { - return this._renderedLines.onLinesChanged(changeFromLineNumber, changeToLineNumber); - } - onLinesDeleted(deleteFromLineNumber, deleteToLineNumber) { - this._renderedLines.onLinesDeleted(deleteFromLineNumber, deleteToLineNumber); - } - onLinesInserted(insertFromLineNumber, insertToLineNumber) { - this._renderedLines.onLinesInserted(insertFromLineNumber, insertToLineNumber); - } - onTokensChanged(ranges) { - return this._renderedLines.onTokensChanged(ranges); - } -} -/** - * Some sort of double buffering. - * - * Keeps two buffers around that will be rotated for painting. - * Always gives a buffer that is filled with the background color. - */ -class MinimapBuffers { - constructor(ctx, WIDTH, HEIGHT, background) { - this._backgroundFillData = MinimapBuffers._createBackgroundFillData(WIDTH, HEIGHT, background); - this._buffers = [ - ctx.createImageData(WIDTH, HEIGHT), - ctx.createImageData(WIDTH, HEIGHT) - ]; - this._lastUsedBuffer = 0; - } - getBuffer() { - // rotate buffers - this._lastUsedBuffer = 1 - this._lastUsedBuffer; - const result = this._buffers[this._lastUsedBuffer]; - // fill with background color - result.data.set(this._backgroundFillData); - return result; - } - static _createBackgroundFillData(WIDTH, HEIGHT, background) { - const backgroundR = background.r; - const backgroundG = background.g; - const backgroundB = background.b; - const result = new Uint8ClampedArray(WIDTH * HEIGHT * 4); - let offset = 0; - for (let i = 0; i < HEIGHT; i++) { - for (let j = 0; j < WIDTH; j++) { - result[offset] = backgroundR; - result[offset + 1] = backgroundG; - result[offset + 2] = backgroundB; - result[offset + 3] = 255; - offset += 4; - } - } - return result; - } -} -class MinimapSamplingState { - constructor(samplingRatio, minimapLines) { - this.samplingRatio = samplingRatio; - this.minimapLines = minimapLines; - } - static compute(options, viewLineCount, oldSamplingState) { - if (options.renderMinimap === 0 /* None */ || !options.isSampling) { - return [null, []]; - } - // ratio is intentionally not part of the layout to avoid the layout changing all the time - // so we need to recompute it again... - const pixelRatio = options.pixelRatio; - const lineHeight = options.lineHeight; - const scrollBeyondLastLine = options.scrollBeyondLastLine; - const { minimapLineCount } = _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_9__["EditorLayoutInfoComputer"].computeContainedMinimapLineCount({ - viewLineCount: viewLineCount, - scrollBeyondLastLine: scrollBeyondLastLine, - height: options.editorHeight, - lineHeight: lineHeight, - pixelRatio: pixelRatio - }); - const ratio = viewLineCount / minimapLineCount; - const halfRatio = ratio / 2; - if (!oldSamplingState || oldSamplingState.minimapLines.length === 0) { - let result = []; - result[0] = 1; - if (minimapLineCount > 1) { - for (let i = 0, lastIndex = minimapLineCount - 1; i < lastIndex; i++) { - result[i] = Math.round(i * ratio + halfRatio); - } - result[minimapLineCount - 1] = viewLineCount; - } - return [new MinimapSamplingState(ratio, result), []]; - } - const oldMinimapLines = oldSamplingState.minimapLines; - const oldLength = oldMinimapLines.length; - let result = []; - let oldIndex = 0; - let oldDeltaLineCount = 0; - let minViewLineNumber = 1; - const MAX_EVENT_COUNT = 10; // generate at most 10 events, if there are more than 10 changes, just flush all previous data - let events = []; - let lastEvent = null; - for (let i = 0; i < minimapLineCount; i++) { - const fromViewLineNumber = Math.max(minViewLineNumber, Math.round(i * ratio)); - const toViewLineNumber = Math.max(fromViewLineNumber, Math.round((i + 1) * ratio)); - while (oldIndex < oldLength && oldMinimapLines[oldIndex] < fromViewLineNumber) { - if (events.length < MAX_EVENT_COUNT) { - const oldMinimapLineNumber = oldIndex + 1 + oldDeltaLineCount; - if (lastEvent && lastEvent.type === 'deleted' && lastEvent._oldIndex === oldIndex - 1) { - lastEvent.deleteToLineNumber++; - } - else { - lastEvent = { type: 'deleted', _oldIndex: oldIndex, deleteFromLineNumber: oldMinimapLineNumber, deleteToLineNumber: oldMinimapLineNumber }; - events.push(lastEvent); - } - oldDeltaLineCount--; - } - oldIndex++; - } - let selectedViewLineNumber; - if (oldIndex < oldLength && oldMinimapLines[oldIndex] <= toViewLineNumber) { - // reuse the old sampled line - selectedViewLineNumber = oldMinimapLines[oldIndex]; - oldIndex++; - } - else { - if (i === 0) { - selectedViewLineNumber = 1; - } - else if (i + 1 === minimapLineCount) { - selectedViewLineNumber = viewLineCount; - } - else { - selectedViewLineNumber = Math.round(i * ratio + halfRatio); - } - if (events.length < MAX_EVENT_COUNT) { - const oldMinimapLineNumber = oldIndex + 1 + oldDeltaLineCount; - if (lastEvent && lastEvent.type === 'inserted' && lastEvent._i === i - 1) { - lastEvent.insertToLineNumber++; - } - else { - lastEvent = { type: 'inserted', _i: i, insertFromLineNumber: oldMinimapLineNumber, insertToLineNumber: oldMinimapLineNumber }; - events.push(lastEvent); - } - oldDeltaLineCount++; - } - } - result[i] = selectedViewLineNumber; - minViewLineNumber = selectedViewLineNumber; - } - if (events.length < MAX_EVENT_COUNT) { - while (oldIndex < oldLength) { - const oldMinimapLineNumber = oldIndex + 1 + oldDeltaLineCount; - if (lastEvent && lastEvent.type === 'deleted' && lastEvent._oldIndex === oldIndex - 1) { - lastEvent.deleteToLineNumber++; - } - else { - lastEvent = { type: 'deleted', _oldIndex: oldIndex, deleteFromLineNumber: oldMinimapLineNumber, deleteToLineNumber: oldMinimapLineNumber }; - events.push(lastEvent); - } - oldDeltaLineCount--; - oldIndex++; - } - } - else { - // too many events, just give up - events = [{ type: 'flush' }]; - } - return [new MinimapSamplingState(ratio, result), events]; - } - modelLineToMinimapLine(lineNumber) { - return Math.min(this.minimapLines.length, Math.max(1, Math.round(lineNumber / this.samplingRatio))); - } - /** - * Will return null if the model line ranges are not intersecting with a sampled model line. - */ - modelLineRangeToMinimapLineRange(fromLineNumber, toLineNumber) { - let fromLineIndex = this.modelLineToMinimapLine(fromLineNumber) - 1; - while (fromLineIndex > 0 && this.minimapLines[fromLineIndex - 1] >= fromLineNumber) { - fromLineIndex--; - } - let toLineIndex = this.modelLineToMinimapLine(toLineNumber) - 1; - while (toLineIndex + 1 < this.minimapLines.length && this.minimapLines[toLineIndex + 1] <= toLineNumber) { - toLineIndex++; - } - if (fromLineIndex === toLineIndex) { - const sampledLineNumber = this.minimapLines[fromLineIndex]; - if (sampledLineNumber < fromLineNumber || sampledLineNumber > toLineNumber) { - // This line is not part of the sampled lines ==> nothing to do - return null; - } - } - return [fromLineIndex + 1, toLineIndex + 1]; - } - /** - * Will always return a range, even if it is not intersecting with a sampled model line. - */ - decorationLineRangeToMinimapLineRange(startLineNumber, endLineNumber) { - let minimapLineStart = this.modelLineToMinimapLine(startLineNumber); - let minimapLineEnd = this.modelLineToMinimapLine(endLineNumber); - if (startLineNumber !== endLineNumber && minimapLineEnd === minimapLineStart) { - if (minimapLineEnd === this.minimapLines.length) { - if (minimapLineStart > 1) { - minimapLineStart--; - } - } - else { - minimapLineEnd++; - } - } - return [minimapLineStart, minimapLineEnd]; - } - onLinesDeleted(e) { - // have the mapping be sticky - const deletedLineCount = e.toLineNumber - e.fromLineNumber + 1; - let changeStartIndex = this.minimapLines.length; - let changeEndIndex = 0; - for (let i = this.minimapLines.length - 1; i >= 0; i--) { - if (this.minimapLines[i] < e.fromLineNumber) { - break; - } - if (this.minimapLines[i] <= e.toLineNumber) { - // this line got deleted => move to previous available - this.minimapLines[i] = Math.max(1, e.fromLineNumber - 1); - changeStartIndex = Math.min(changeStartIndex, i); - changeEndIndex = Math.max(changeEndIndex, i); - } - else { - this.minimapLines[i] -= deletedLineCount; - } - } - return [changeStartIndex, changeEndIndex]; - } - onLinesInserted(e) { - // have the mapping be sticky - const insertedLineCount = e.toLineNumber - e.fromLineNumber + 1; - for (let i = this.minimapLines.length - 1; i >= 0; i--) { - if (this.minimapLines[i] < e.fromLineNumber) { - break; - } - this.minimapLines[i] += insertedLineCount; - } - } -} -class Minimap extends _view_viewPart_js__WEBPACK_IMPORTED_MODULE_8__["ViewPart"] { - constructor(context) { - super(context); - this.tokensColorTracker = _common_viewModel_minimapTokensColorTracker_js__WEBPACK_IMPORTED_MODULE_12__["MinimapTokensColorTracker"].getInstance(); - this._selections = []; - this._minimapSelections = null; - this.options = new MinimapOptions(this._context.configuration, this._context.theme, this.tokensColorTracker); - const [samplingState,] = MinimapSamplingState.compute(this.options, this._context.model.getLineCount(), null); - this._samplingState = samplingState; - this._shouldCheckSampling = false; - this._actual = new InnerMinimap(context.theme, this); - } - dispose() { - this._actual.dispose(); - super.dispose(); - } - getDomNode() { - return this._actual.getDomNode(); - } - _onOptionsMaybeChanged() { - const opts = new MinimapOptions(this._context.configuration, this._context.theme, this.tokensColorTracker); - if (this.options.equals(opts)) { - return false; - } - this.options = opts; - this._recreateLineSampling(); - this._actual.onDidChangeOptions(); - return true; - } - // ---- begin view event handlers - onConfigurationChanged(e) { - return this._onOptionsMaybeChanged(); - } - onCursorStateChanged(e) { - this._selections = e.selections; - this._minimapSelections = null; - return this._actual.onSelectionChanged(); - } - onDecorationsChanged(e) { - if (e.affectsMinimap) { - return this._actual.onDecorationsChanged(); - } - return false; - } - onFlushed(e) { - if (this._samplingState) { - this._shouldCheckSampling = true; - } - return this._actual.onFlushed(); - } - onLinesChanged(e) { - if (this._samplingState) { - const minimapLineRange = this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber, e.toLineNumber); - if (minimapLineRange) { - return this._actual.onLinesChanged(minimapLineRange[0], minimapLineRange[1]); - } - else { - return false; - } - } - else { - return this._actual.onLinesChanged(e.fromLineNumber, e.toLineNumber); - } - } - onLinesDeleted(e) { - if (this._samplingState) { - const [changeStartIndex, changeEndIndex] = this._samplingState.onLinesDeleted(e); - if (changeStartIndex <= changeEndIndex) { - this._actual.onLinesChanged(changeStartIndex + 1, changeEndIndex + 1); - } - this._shouldCheckSampling = true; - return true; - } - else { - return this._actual.onLinesDeleted(e.fromLineNumber, e.toLineNumber); - } - } - onLinesInserted(e) { - if (this._samplingState) { - this._samplingState.onLinesInserted(e); - this._shouldCheckSampling = true; - return true; - } - else { - return this._actual.onLinesInserted(e.fromLineNumber, e.toLineNumber); - } - } - onScrollChanged(e) { - return this._actual.onScrollChanged(); - } - onThemeChanged(e) { - this._context.model.invalidateMinimapColorCache(); - this._actual.onThemeChanged(); - this._onOptionsMaybeChanged(); - return true; - } - onTokensChanged(e) { - if (this._samplingState) { - let ranges = []; - for (const range of e.ranges) { - const minimapLineRange = this._samplingState.modelLineRangeToMinimapLineRange(range.fromLineNumber, range.toLineNumber); - if (minimapLineRange) { - ranges.push({ fromLineNumber: minimapLineRange[0], toLineNumber: minimapLineRange[1] }); - } - } - if (ranges.length) { - return this._actual.onTokensChanged(ranges); - } - else { - return false; - } - } - else { - return this._actual.onTokensChanged(e.ranges); - } - } - onTokensColorsChanged(e) { - return this._actual.onTokensColorsChanged(); - } - onZonesChanged(e) { - return this._actual.onZonesChanged(); - } - // --- end event handlers - prepareRender(ctx) { - if (this._shouldCheckSampling) { - this._shouldCheckSampling = false; - this._recreateLineSampling(); - } - } - render(ctx) { - let viewportStartLineNumber = ctx.visibleRange.startLineNumber; - let viewportEndLineNumber = ctx.visibleRange.endLineNumber; - if (this._samplingState) { - viewportStartLineNumber = this._samplingState.modelLineToMinimapLine(viewportStartLineNumber); - viewportEndLineNumber = this._samplingState.modelLineToMinimapLine(viewportEndLineNumber); - } - const minimapCtx = { - viewportContainsWhitespaceGaps: (ctx.viewportData.whitespaceViewportData.length > 0), - scrollWidth: ctx.scrollWidth, - scrollHeight: ctx.scrollHeight, - viewportStartLineNumber: viewportStartLineNumber, - viewportEndLineNumber: viewportEndLineNumber, - scrollTop: ctx.scrollTop, - scrollLeft: ctx.scrollLeft, - viewportWidth: ctx.viewportWidth, - viewportHeight: ctx.viewportHeight, - }; - this._actual.render(minimapCtx); - } - //#region IMinimapModel - _recreateLineSampling() { - this._minimapSelections = null; - const wasSampling = Boolean(this._samplingState); - const [samplingState, events] = MinimapSamplingState.compute(this.options, this._context.model.getLineCount(), this._samplingState); - this._samplingState = samplingState; - if (wasSampling && this._samplingState) { - // was sampling, is sampling - for (const event of events) { - switch (event.type) { - case 'deleted': - this._actual.onLinesDeleted(event.deleteFromLineNumber, event.deleteToLineNumber); - break; - case 'inserted': - this._actual.onLinesInserted(event.insertFromLineNumber, event.insertToLineNumber); - break; - case 'flush': - this._actual.onFlushed(); - break; - } - } - } - } - getLineCount() { - if (this._samplingState) { - return this._samplingState.minimapLines.length; - } - return this._context.model.getLineCount(); - } - getRealLineCount() { - return this._context.model.getLineCount(); - } - getLineContent(lineNumber) { - if (this._samplingState) { - return this._context.model.getLineContent(this._samplingState.minimapLines[lineNumber - 1]); - } - return this._context.model.getLineContent(lineNumber); - } - getMinimapLinesRenderingData(startLineNumber, endLineNumber, needed) { - if (this._samplingState) { - let result = []; - for (let lineIndex = 0, lineCount = endLineNumber - startLineNumber + 1; lineIndex < lineCount; lineIndex++) { - if (needed[lineIndex]) { - result[lineIndex] = this._context.model.getViewLineData(this._samplingState.minimapLines[startLineNumber + lineIndex - 1]); - } - else { - result[lineIndex] = null; - } - } - return result; - } - return this._context.model.getMinimapLinesRenderingData(startLineNumber, endLineNumber, needed).data; - } - getSelections() { - if (this._minimapSelections === null) { - if (this._samplingState) { - this._minimapSelections = []; - for (const selection of this._selections) { - const [minimapLineStart, minimapLineEnd] = this._samplingState.decorationLineRangeToMinimapLineRange(selection.startLineNumber, selection.endLineNumber); - this._minimapSelections.push(new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_16__["Selection"](minimapLineStart, selection.startColumn, minimapLineEnd, selection.endColumn)); - } - } - else { - this._minimapSelections = this._selections; - } - } - return this._minimapSelections; - } - getMinimapDecorationsInViewport(startLineNumber, endLineNumber) { - let visibleRange; - if (this._samplingState) { - const modelStartLineNumber = this._samplingState.minimapLines[startLineNumber - 1]; - const modelEndLineNumber = this._samplingState.minimapLines[endLineNumber - 1]; - visibleRange = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__["Range"](modelStartLineNumber, 1, modelEndLineNumber, this._context.model.getLineMaxColumn(modelEndLineNumber)); - } - else { - visibleRange = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__["Range"](startLineNumber, 1, endLineNumber, this._context.model.getLineMaxColumn(endLineNumber)); - } - const decorations = this._context.model.getDecorationsInViewport(visibleRange); - if (this._samplingState) { - let result = []; - for (const decoration of decorations) { - if (!decoration.options.minimap) { - continue; - } - const range = decoration.range; - const minimapStartLineNumber = this._samplingState.modelLineToMinimapLine(range.startLineNumber); - const minimapEndLineNumber = this._samplingState.modelLineToMinimapLine(range.endLineNumber); - result.push(new _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_13__["ViewModelDecoration"](new _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__["Range"](minimapStartLineNumber, range.startColumn, minimapEndLineNumber, range.endColumn), decoration.options)); - } - return result; - } - return decorations; - } - getOptions() { - return this._context.model.getTextModelOptions(); - } - revealLineNumber(lineNumber) { - if (this._samplingState) { - lineNumber = this._samplingState.minimapLines[lineNumber - 1]; - } - this._context.model.revealRange('mouse', false, new _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__["Range"](lineNumber, 1, lineNumber, 1), 1 /* Center */, 0 /* Smooth */); - } - setScrollTop(scrollTop) { - this._context.model.setScrollPosition({ - scrollTop: scrollTop - }, 1 /* Immediate */); - } -} -class InnerMinimap extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["Disposable"] { - constructor(theme, model) { - super(); - this._renderDecorations = false; - this._gestureInProgress = false; - this._theme = theme; - this._model = model; - this._lastRenderData = null; - this._buffers = null; - this._selectionColor = this._theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["minimapSelection"]); - this._domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('div')); - _view_viewPart_js__WEBPACK_IMPORTED_MODULE_8__["PartFingerprints"].write(this._domNode, 8 /* Minimap */); - this._domNode.setClassName(this._getMinimapDomNodeClassName()); - this._domNode.setPosition('absolute'); - this._domNode.setAttribute('role', 'presentation'); - this._domNode.setAttribute('aria-hidden', 'true'); - this._shadow = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('div')); - this._shadow.setClassName('minimap-shadow-hidden'); - this._domNode.appendChild(this._shadow); - this._canvas = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('canvas')); - this._canvas.setPosition('absolute'); - this._canvas.setLeft(0); - this._domNode.appendChild(this._canvas); - this._decorationsCanvas = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('canvas')); - this._decorationsCanvas.setPosition('absolute'); - this._decorationsCanvas.setClassName('minimap-decorations-layer'); - this._decorationsCanvas.setLeft(0); - this._domNode.appendChild(this._decorationsCanvas); - this._slider = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('div')); - this._slider.setPosition('absolute'); - this._slider.setClassName('minimap-slider'); - this._slider.setLayerHinting(true); - this._slider.setContain('strict'); - this._domNode.appendChild(this._slider); - this._sliderHorizontal = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('div')); - this._sliderHorizontal.setPosition('absolute'); - this._sliderHorizontal.setClassName('minimap-slider-horizontal'); - this._slider.appendChild(this._sliderHorizontal); - this._applyLayout(); - this._mouseDownListener = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](this._domNode.domNode, 'mousedown', (e) => { - e.preventDefault(); - const renderMinimap = this._model.options.renderMinimap; - if (renderMinimap === 0 /* None */) { - return; - } - if (!this._lastRenderData) { - return; - } - if (this._model.options.size !== 'proportional') { - if (e.leftButton && this._lastRenderData) { - // pretend the click occured in the center of the slider - const position = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["getDomNodePagePosition"](this._slider.domNode); - const initialPosY = position.top + position.height / 2; - this._startSliderDragging(e.buttons, e.posx, initialPosY, e.posy, this._lastRenderData.renderedLayout); - } - return; - } - const minimapLineHeight = this._model.options.minimapLineHeight; - const internalOffsetY = (this._model.options.canvasInnerHeight / this._model.options.canvasOuterHeight) * e.browserEvent.offsetY; - const lineIndex = Math.floor(internalOffsetY / minimapLineHeight); - let lineNumber = lineIndex + this._lastRenderData.renderedLayout.startLineNumber; - lineNumber = Math.min(lineNumber, this._model.getLineCount()); - this._model.revealLineNumber(lineNumber); - }); - this._sliderMouseMoveMonitor = new _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_3__["GlobalMouseMoveMonitor"](); - this._sliderMouseDownListener = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](this._slider.domNode, 'mousedown', (e) => { - e.preventDefault(); - e.stopPropagation(); - if (e.leftButton && this._lastRenderData) { - this._startSliderDragging(e.buttons, e.posx, e.posy, e.posy, this._lastRenderData.renderedLayout); - } - }); - this._gestureDisposable = _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_17__["Gesture"].addTarget(this._domNode.domNode); - this._sliderTouchStartListener = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](this._domNode.domNode, _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_17__["EventType"].Start, (e) => { - e.preventDefault(); - e.stopPropagation(); - if (this._lastRenderData) { - this._slider.toggleClassName('active', true); - this._gestureInProgress = true; - this.scrollDueToTouchEvent(e); - } - }, { passive: false }); - this._sliderTouchMoveListener = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](this._domNode.domNode, _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_17__["EventType"].Change, (e) => { - e.preventDefault(); - e.stopPropagation(); - if (this._lastRenderData && this._gestureInProgress) { - this.scrollDueToTouchEvent(e); - } - }, { passive: false }); - this._sliderTouchEndListener = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](this._domNode.domNode, _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_17__["EventType"].End, (e) => { - e.preventDefault(); - e.stopPropagation(); - this._gestureInProgress = false; - this._slider.toggleClassName('active', false); - }); - } - _startSliderDragging(initialButtons, initialPosX, initialPosY, posy, initialSliderState) { - this._slider.toggleClassName('active', true); - const handleMouseMove = (posy, posx) => { - const mouseOrthogonalDelta = Math.abs(posx - initialPosX); - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_5__["isWindows"] && mouseOrthogonalDelta > MOUSE_DRAG_RESET_DISTANCE) { - // The mouse has wondered away from the scrollbar => reset dragging - this._model.setScrollTop(initialSliderState.scrollTop); - return; - } - const mouseDelta = posy - initialPosY; - this._model.setScrollTop(initialSliderState.getDesiredScrollTopFromDelta(mouseDelta)); - }; - if (posy !== initialPosY) { - handleMouseMove(posy, initialPosX); - } - this._sliderMouseMoveMonitor.startMonitoring(this._slider.domNode, initialButtons, _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_3__["standardMouseMoveMerger"], (mouseMoveData) => handleMouseMove(mouseMoveData.posy, mouseMoveData.posx), () => { - this._slider.toggleClassName('active', false); - }); - } - scrollDueToTouchEvent(touch) { - const startY = this._domNode.domNode.getBoundingClientRect().top; - const scrollTop = this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(touch.pageY - startY); - this._model.setScrollTop(scrollTop); - } - dispose() { - this._mouseDownListener.dispose(); - this._sliderMouseMoveMonitor.dispose(); - this._sliderMouseDownListener.dispose(); - this._gestureDisposable.dispose(); - this._sliderTouchStartListener.dispose(); - this._sliderTouchMoveListener.dispose(); - this._sliderTouchEndListener.dispose(); - super.dispose(); - } - _getMinimapDomNodeClassName() { - if (this._model.options.showSlider === 'always') { - return 'minimap slider-always'; - } - return 'minimap slider-mouseover'; - } - getDomNode() { - return this._domNode; - } - _applyLayout() { - this._domNode.setLeft(this._model.options.minimapLeft); - this._domNode.setWidth(this._model.options.minimapWidth); - this._domNode.setHeight(this._model.options.minimapHeight); - this._shadow.setHeight(this._model.options.minimapHeight); - this._canvas.setWidth(this._model.options.canvasOuterWidth); - this._canvas.setHeight(this._model.options.canvasOuterHeight); - this._canvas.domNode.width = this._model.options.canvasInnerWidth; - this._canvas.domNode.height = this._model.options.canvasInnerHeight; - this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth); - this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight); - this._decorationsCanvas.domNode.width = this._model.options.canvasInnerWidth; - this._decorationsCanvas.domNode.height = this._model.options.canvasInnerHeight; - this._slider.setWidth(this._model.options.minimapWidth); - } - _getBuffer() { - if (!this._buffers) { - if (this._model.options.canvasInnerWidth > 0 && this._model.options.canvasInnerHeight > 0) { - this._buffers = new MinimapBuffers(this._canvas.domNode.getContext('2d'), this._model.options.canvasInnerWidth, this._model.options.canvasInnerHeight, this._model.options.backgroundColor); - } - } - return this._buffers ? this._buffers.getBuffer() : null; - } - // ---- begin view event handlers - onDidChangeOptions() { - this._lastRenderData = null; - this._buffers = null; - this._applyLayout(); - this._domNode.setClassName(this._getMinimapDomNodeClassName()); - } - onSelectionChanged() { - this._renderDecorations = true; - return true; - } - onDecorationsChanged() { - this._renderDecorations = true; - return true; - } - onFlushed() { - this._lastRenderData = null; - return true; - } - onLinesChanged(changeFromLineNumber, changeToLineNumber) { - if (this._lastRenderData) { - return this._lastRenderData.onLinesChanged(changeFromLineNumber, changeToLineNumber); - } - return false; - } - onLinesDeleted(deleteFromLineNumber, deleteToLineNumber) { - if (this._lastRenderData) { - this._lastRenderData.onLinesDeleted(deleteFromLineNumber, deleteToLineNumber); - } - return true; - } - onLinesInserted(insertFromLineNumber, insertToLineNumber) { - if (this._lastRenderData) { - this._lastRenderData.onLinesInserted(insertFromLineNumber, insertToLineNumber); - } - return true; - } - onScrollChanged() { - this._renderDecorations = true; - return true; - } - onThemeChanged() { - this._selectionColor = this._theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["minimapSelection"]); - this._renderDecorations = true; - return true; - } - onTokensChanged(ranges) { - if (this._lastRenderData) { - return this._lastRenderData.onTokensChanged(ranges); - } - return false; - } - onTokensColorsChanged() { - this._lastRenderData = null; - this._buffers = null; - return true; - } - onZonesChanged() { - this._lastRenderData = null; - return true; - } - // --- end event handlers - render(renderingCtx) { - const renderMinimap = this._model.options.renderMinimap; - if (renderMinimap === 0 /* None */) { - this._shadow.setClassName('minimap-shadow-hidden'); - this._sliderHorizontal.setWidth(0); - this._sliderHorizontal.setHeight(0); - return; - } - if (renderingCtx.scrollLeft + renderingCtx.viewportWidth >= renderingCtx.scrollWidth) { - this._shadow.setClassName('minimap-shadow-hidden'); - } - else { - this._shadow.setClassName('minimap-shadow-visible'); - } - const layout = MinimapLayout.create(this._model.options, renderingCtx.viewportStartLineNumber, renderingCtx.viewportEndLineNumber, renderingCtx.viewportHeight, renderingCtx.viewportContainsWhitespaceGaps, this._model.getLineCount(), this._model.getRealLineCount(), renderingCtx.scrollTop, renderingCtx.scrollHeight, this._lastRenderData ? this._lastRenderData.renderedLayout : null); - this._slider.setDisplay(layout.sliderNeeded ? 'block' : 'none'); - this._slider.setTop(layout.sliderTop); - this._slider.setHeight(layout.sliderHeight); - // Compute horizontal slider coordinates - const scrollLeftChars = renderingCtx.scrollLeft / this._model.options.typicalHalfwidthCharacterWidth; - const horizontalSliderLeft = Math.min(this._model.options.minimapWidth, Math.round(scrollLeftChars * this._model.options.minimapCharWidth / this._model.options.pixelRatio)); - this._sliderHorizontal.setLeft(horizontalSliderLeft); - this._sliderHorizontal.setWidth(this._model.options.minimapWidth - horizontalSliderLeft); - this._sliderHorizontal.setTop(0); - this._sliderHorizontal.setHeight(layout.sliderHeight); - this.renderDecorations(layout); - this._lastRenderData = this.renderLines(layout); - } - renderDecorations(layout) { - if (this._renderDecorations) { - this._renderDecorations = false; - const selections = this._model.getSelections(); - const decorations = this._model.getMinimapDecorationsInViewport(layout.startLineNumber, layout.endLineNumber); - const { canvasInnerWidth, canvasInnerHeight } = this._model.options; - const lineHeight = this._model.options.minimapLineHeight; - const characterWidth = this._model.options.minimapCharWidth; - const tabSize = this._model.getOptions().tabSize; - const canvasContext = this._decorationsCanvas.domNode.getContext('2d'); - canvasContext.clearRect(0, 0, canvasInnerWidth, canvasInnerHeight); - const lineOffsetMap = new Map(); - for (let i = 0; i < selections.length; i++) { - const selection = selections[i]; - for (let line = selection.startLineNumber; line <= selection.endLineNumber; line++) { - this.renderDecorationOnLine(canvasContext, lineOffsetMap, selection, this._selectionColor, layout, line, lineHeight, lineHeight, tabSize, characterWidth); - } - } - // Loop over decorations, ignoring those that don't have the minimap property set and rendering rectangles for each line the decoration spans - for (let i = 0; i < decorations.length; i++) { - const decoration = decorations[i]; - if (!decoration.options.minimap) { - continue; - } - const decorationColor = decoration.options.minimap.getColor(this._theme); - for (let line = decoration.range.startLineNumber; line <= decoration.range.endLineNumber; line++) { - switch (decoration.options.minimap.position) { - case _common_model_js__WEBPACK_IMPORTED_MODULE_19__["MinimapPosition"].Inline: - this.renderDecorationOnLine(canvasContext, lineOffsetMap, decoration.range, decorationColor, layout, line, lineHeight, lineHeight, tabSize, characterWidth); - continue; - case _common_model_js__WEBPACK_IMPORTED_MODULE_19__["MinimapPosition"].Gutter: - const y = (line - layout.startLineNumber) * lineHeight; - const x = 2; - this.renderDecoration(canvasContext, decorationColor, x, y, GUTTER_DECORATION_WIDTH, lineHeight); - continue; - } - } - } - } - } - renderDecorationOnLine(canvasContext, lineOffsetMap, decorationRange, decorationColor, layout, lineNumber, height, lineHeight, tabSize, charWidth) { - const y = (lineNumber - layout.startLineNumber) * lineHeight; - // Skip rendering the line if it's vertically outside our viewport - if (y + height < 0 || y > this._model.options.canvasInnerHeight) { - return; - } - // Cache line offset data so that it is only read once per line - let lineIndexToXOffset = lineOffsetMap.get(lineNumber); - const isFirstDecorationForLine = !lineIndexToXOffset; - if (!lineIndexToXOffset) { - const lineData = this._model.getLineContent(lineNumber); - lineIndexToXOffset = [_common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_9__["MINIMAP_GUTTER_WIDTH"]]; - for (let i = 1; i < lineData.length + 1; i++) { - const charCode = lineData.charCodeAt(i - 1); - const dx = charCode === 9 /* Tab */ - ? tabSize * charWidth - : _base_common_strings_js__WEBPACK_IMPORTED_MODULE_6__["isFullWidthCharacter"](charCode) - ? 2 * charWidth - : charWidth; - lineIndexToXOffset[i] = lineIndexToXOffset[i - 1] + dx; - } - lineOffsetMap.set(lineNumber, lineIndexToXOffset); - } - const { startColumn, endColumn, startLineNumber, endLineNumber } = decorationRange; - const x = startLineNumber === lineNumber ? lineIndexToXOffset[startColumn - 1] : _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_9__["MINIMAP_GUTTER_WIDTH"]; - const endColumnForLine = endLineNumber > lineNumber ? lineIndexToXOffset.length - 1 : endColumn - 1; - if (endColumnForLine > 0) { - // If the decoration starts at the last character of the column and spans over it, ensure it has a width - const width = lineIndexToXOffset[endColumnForLine] - x || 2; - this.renderDecoration(canvasContext, decorationColor, x, y, width, height); - } - if (isFirstDecorationForLine) { - this.renderLineHighlight(canvasContext, decorationColor, y, height); - } - } - renderLineHighlight(canvasContext, decorationColor, y, height) { - canvasContext.fillStyle = decorationColor && decorationColor.transparent(0.5).toString() || ''; - canvasContext.fillRect(_common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_9__["MINIMAP_GUTTER_WIDTH"], y, canvasContext.canvas.width, height); - } - renderDecoration(canvasContext, decorationColor, x, y, width, height) { - canvasContext.fillStyle = decorationColor && decorationColor.toString() || ''; - canvasContext.fillRect(x, y, width, height); - } - renderLines(layout) { - const startLineNumber = layout.startLineNumber; - const endLineNumber = layout.endLineNumber; - const minimapLineHeight = this._model.options.minimapLineHeight; - // Check if nothing changed w.r.t. lines from last frame - if (this._lastRenderData && this._lastRenderData.linesEquals(layout)) { - const _lastData = this._lastRenderData._get(); - // Nice!! Nothing changed from last frame - return new RenderData(layout, _lastData.imageData, _lastData.lines); - } - // Oh well!! We need to repaint some lines... - const imageData = this._getBuffer(); - if (!imageData) { - // 0 width or 0 height canvas, nothing to do - return null; - } - // Render untouched lines by using last rendered data. - let [_dirtyY1, _dirtyY2, needed] = InnerMinimap._renderUntouchedLines(imageData, startLineNumber, endLineNumber, minimapLineHeight, this._lastRenderData); - // Fetch rendering info from view model for rest of lines that need rendering. - const lineInfo = this._model.getMinimapLinesRenderingData(startLineNumber, endLineNumber, needed); - const tabSize = this._model.getOptions().tabSize; - const background = this._model.options.backgroundColor; - const tokensColorTracker = this._model.tokensColorTracker; - const useLighterFont = tokensColorTracker.backgroundIsLight(); - const renderMinimap = this._model.options.renderMinimap; - const charRenderer = this._model.options.charRenderer(); - const fontScale = this._model.options.fontScale; - const minimapCharWidth = this._model.options.minimapCharWidth; - const baseCharHeight = (renderMinimap === 1 /* Text */ ? 2 /* BASE_CHAR_HEIGHT */ : 2 /* BASE_CHAR_HEIGHT */ + 1); - const renderMinimapLineHeight = baseCharHeight * fontScale; - const innerLinePadding = (minimapLineHeight > renderMinimapLineHeight ? Math.floor((minimapLineHeight - renderMinimapLineHeight) / 2) : 0); - // Render the rest of lines - let dy = 0; - const renderedLines = []; - for (let lineIndex = 0, lineCount = endLineNumber - startLineNumber + 1; lineIndex < lineCount; lineIndex++) { - if (needed[lineIndex]) { - InnerMinimap._renderLine(imageData, background, useLighterFont, renderMinimap, minimapCharWidth, tokensColorTracker, charRenderer, dy, innerLinePadding, tabSize, lineInfo[lineIndex], fontScale, minimapLineHeight); - } - renderedLines[lineIndex] = new MinimapLine(dy); - dy += minimapLineHeight; - } - const dirtyY1 = (_dirtyY1 === -1 ? 0 : _dirtyY1); - const dirtyY2 = (_dirtyY2 === -1 ? imageData.height : _dirtyY2); - const dirtyHeight = dirtyY2 - dirtyY1; - // Finally, paint to the canvas - const ctx = this._canvas.domNode.getContext('2d'); - ctx.putImageData(imageData, 0, 0, 0, dirtyY1, imageData.width, dirtyHeight); - // Save rendered data for reuse on next frame if possible - return new RenderData(layout, imageData, renderedLines); - } - static _renderUntouchedLines(target, startLineNumber, endLineNumber, minimapLineHeight, lastRenderData) { - const needed = []; - if (!lastRenderData) { - for (let i = 0, len = endLineNumber - startLineNumber + 1; i < len; i++) { - needed[i] = true; - } - return [-1, -1, needed]; - } - const _lastData = lastRenderData._get(); - const lastTargetData = _lastData.imageData.data; - const lastStartLineNumber = _lastData.rendLineNumberStart; - const lastLines = _lastData.lines; - const lastLinesLength = lastLines.length; - const WIDTH = target.width; - const targetData = target.data; - const maxDestPixel = (endLineNumber - startLineNumber + 1) * minimapLineHeight * WIDTH * 4; - let dirtyPixel1 = -1; // the pixel offset up to which all the data is equal to the prev frame - let dirtyPixel2 = -1; // the pixel offset after which all the data is equal to the prev frame - let copySourceStart = -1; - let copySourceEnd = -1; - let copyDestStart = -1; - let copyDestEnd = -1; - let dest_dy = 0; - for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { - const lineIndex = lineNumber - startLineNumber; - const lastLineIndex = lineNumber - lastStartLineNumber; - const source_dy = (lastLineIndex >= 0 && lastLineIndex < lastLinesLength ? lastLines[lastLineIndex].dy : -1); - if (source_dy === -1) { - needed[lineIndex] = true; - dest_dy += minimapLineHeight; - continue; - } - const sourceStart = source_dy * WIDTH * 4; - const sourceEnd = (source_dy + minimapLineHeight) * WIDTH * 4; - const destStart = dest_dy * WIDTH * 4; - const destEnd = (dest_dy + minimapLineHeight) * WIDTH * 4; - if (copySourceEnd === sourceStart && copyDestEnd === destStart) { - // contiguous zone => extend copy request - copySourceEnd = sourceEnd; - copyDestEnd = destEnd; - } - else { - if (copySourceStart !== -1) { - // flush existing copy request - targetData.set(lastTargetData.subarray(copySourceStart, copySourceEnd), copyDestStart); - if (dirtyPixel1 === -1 && copySourceStart === 0 && copySourceStart === copyDestStart) { - dirtyPixel1 = copySourceEnd; - } - if (dirtyPixel2 === -1 && copySourceEnd === maxDestPixel && copySourceStart === copyDestStart) { - dirtyPixel2 = copySourceStart; - } - } - copySourceStart = sourceStart; - copySourceEnd = sourceEnd; - copyDestStart = destStart; - copyDestEnd = destEnd; - } - needed[lineIndex] = false; - dest_dy += minimapLineHeight; - } - if (copySourceStart !== -1) { - // flush existing copy request - targetData.set(lastTargetData.subarray(copySourceStart, copySourceEnd), copyDestStart); - if (dirtyPixel1 === -1 && copySourceStart === 0 && copySourceStart === copyDestStart) { - dirtyPixel1 = copySourceEnd; - } - if (dirtyPixel2 === -1 && copySourceEnd === maxDestPixel && copySourceStart === copyDestStart) { - dirtyPixel2 = copySourceStart; - } - } - const dirtyY1 = (dirtyPixel1 === -1 ? -1 : dirtyPixel1 / (WIDTH * 4)); - const dirtyY2 = (dirtyPixel2 === -1 ? -1 : dirtyPixel2 / (WIDTH * 4)); - return [dirtyY1, dirtyY2, needed]; - } - static _renderLine(target, backgroundColor, useLighterFont, renderMinimap, charWidth, colorTracker, minimapCharRenderer, dy, innerLinePadding, tabSize, lineData, fontScale, minimapLineHeight) { - const content = lineData.content; - const tokens = lineData.tokens; - const maxDx = target.width - charWidth; - const force1pxHeight = (minimapLineHeight === 1); - let dx = _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_9__["MINIMAP_GUTTER_WIDTH"]; - let charIndex = 0; - let tabsCharDelta = 0; - for (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) { - const tokenEndIndex = tokens.getEndOffset(tokenIndex); - const tokenColorId = tokens.getForeground(tokenIndex); - const tokenColor = colorTracker.getColor(tokenColorId); - for (; charIndex < tokenEndIndex; charIndex++) { - if (dx > maxDx) { - // hit edge of minimap - return; - } - const charCode = content.charCodeAt(charIndex); - if (charCode === 9 /* Tab */) { - const insertSpacesCount = tabSize - (charIndex + tabsCharDelta) % tabSize; - tabsCharDelta += insertSpacesCount - 1; - // No need to render anything since tab is invisible - dx += insertSpacesCount * charWidth; - } - else if (charCode === 32 /* Space */) { - // No need to render anything since space is invisible - dx += charWidth; - } - else { - // Render twice for a full width character - const count = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_6__["isFullWidthCharacter"](charCode) ? 2 : 1; - for (let i = 0; i < count; i++) { - if (renderMinimap === 2 /* Blocks */) { - minimapCharRenderer.blockRenderChar(target, dx, dy + innerLinePadding, tokenColor, backgroundColor, useLighterFont, force1pxHeight); - } - else { // RenderMinimap.Text - minimapCharRenderer.renderChar(target, dx, dy + innerLinePadding, charCode, tokenColor, backgroundColor, fontScale, useLighterFont, force1pxHeight); - } - dx += charWidth; - if (dx > maxDx) { - // hit edge of minimap - return; - } - } - } - } - } - } -} -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_15__["registerThemingParticipant"])((theme, collector) => { - const minimapBackgroundValue = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["minimapBackground"]); - if (minimapBackgroundValue) { - collector.addRule(`.monaco-editor .minimap > canvas { opacity: ${minimapBackgroundValue.rgba.a}; will-change: opacity; }`); - } - const sliderBackground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["minimapSliderBackground"]); - if (sliderBackground) { - collector.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${sliderBackground}; }`); - } - const sliderHoverBackground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["minimapSliderHoverBackground"]); - if (sliderHoverBackground) { - collector.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${sliderHoverBackground}; }`); - } - const sliderActiveBackground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["minimapSliderActiveBackground"]); - if (sliderActiveBackground) { - collector.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${sliderActiveBackground}; }`); - } - const shadow = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["scrollbarShadow"]); - if (shadow) { - collector.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${shadow} -6px 0 6px -6px inset; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharRenderer.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharRenderer.js ***! - \***************************************************************************************************/ -/*! exports provided: MinimapCharRenderer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinimapCharRenderer", function() { return MinimapCharRenderer; }); -/* harmony import */ var _minimapCharSheet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./minimapCharSheet.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharSheet.js"); -/* harmony import */ var _base_common_uint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/common/uint.js */ "./node_modules/monaco-editor/esm/vs/base/common/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class MinimapCharRenderer { - constructor(charData, scale) { - this.scale = scale; - this.charDataNormal = MinimapCharRenderer.soften(charData, 12 / 15); - this.charDataLight = MinimapCharRenderer.soften(charData, 50 / 60); - } - static soften(input, ratio) { - let result = new Uint8ClampedArray(input.length); - for (let i = 0, len = input.length; i < len; i++) { - result[i] = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_1__["toUint8"])(input[i] * ratio); - } - return result; - } - renderChar(target, dx, dy, chCode, color, backgroundColor, fontScale, useLighterFont, force1pxHeight) { - const charWidth = 1 /* BASE_CHAR_WIDTH */ * this.scale; - const charHeight = 2 /* BASE_CHAR_HEIGHT */ * this.scale; - const renderHeight = (force1pxHeight ? 1 : charHeight); - if (dx + charWidth > target.width || dy + renderHeight > target.height) { - console.warn('bad render request outside image data'); - return; - } - const charData = useLighterFont ? this.charDataLight : this.charDataNormal; - const charIndex = Object(_minimapCharSheet_js__WEBPACK_IMPORTED_MODULE_0__["getCharIndex"])(chCode, fontScale); - const destWidth = target.width * 4 /* RGBA_CHANNELS_CNT */; - const backgroundR = backgroundColor.r; - const backgroundG = backgroundColor.g; - const backgroundB = backgroundColor.b; - const deltaR = color.r - backgroundR; - const deltaG = color.g - backgroundG; - const deltaB = color.b - backgroundB; - const dest = target.data; - let sourceOffset = charIndex * charWidth * charHeight; - let row = dy * destWidth + dx * 4 /* RGBA_CHANNELS_CNT */; - for (let y = 0; y < renderHeight; y++) { - let column = row; - for (let x = 0; x < charWidth; x++) { - const c = charData[sourceOffset++] / 255; - dest[column++] = backgroundR + deltaR * c; - dest[column++] = backgroundG + deltaG * c; - dest[column++] = backgroundB + deltaB * c; - column++; - } - row += destWidth; - } - } - blockRenderChar(target, dx, dy, color, backgroundColor, useLighterFont, force1pxHeight) { - const charWidth = 1 /* BASE_CHAR_WIDTH */ * this.scale; - const charHeight = 2 /* BASE_CHAR_HEIGHT */ * this.scale; - const renderHeight = (force1pxHeight ? 1 : charHeight); - if (dx + charWidth > target.width || dy + renderHeight > target.height) { - console.warn('bad render request outside image data'); - return; - } - const destWidth = target.width * 4 /* RGBA_CHANNELS_CNT */; - const c = 0.5; - const backgroundR = backgroundColor.r; - const backgroundG = backgroundColor.g; - const backgroundB = backgroundColor.b; - const deltaR = color.r - backgroundR; - const deltaG = color.g - backgroundG; - const deltaB = color.b - backgroundB; - const colorR = backgroundR + deltaR * c; - const colorG = backgroundG + deltaG * c; - const colorB = backgroundB + deltaB * c; - const dest = target.data; - let row = dy * destWidth + dx * 4 /* RGBA_CHANNELS_CNT */; - for (let y = 0; y < renderHeight; y++) { - let column = row; - for (let x = 0; x < charWidth; x++) { - dest[column++] = colorR; - dest[column++] = colorG; - dest[column++] = colorB; - column++; - } - row += destWidth; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.js": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.js ***! - \**********************************************************************************************************/ -/*! exports provided: MinimapCharRendererFactory */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinimapCharRendererFactory", function() { return MinimapCharRendererFactory; }); -/* harmony import */ var _minimapCharRenderer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./minimapCharRenderer.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharRenderer.js"); -/* harmony import */ var _minimapCharSheet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./minimapCharSheet.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharSheet.js"); -/* harmony import */ var _minimapPreBaked_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./minimapPreBaked.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapPreBaked.js"); -/* harmony import */ var _base_common_uint_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../base/common/uint.js */ "./node_modules/monaco-editor/esm/vs/base/common/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -/** - * Creates character renderers. It takes a 'scale' that determines how large - * characters should be drawn. Using this, it draws data into a canvas and - * then downsamples the characters as necessary for the current display. - * This makes rendering more efficient, rather than drawing a full (tiny) - * font, or downsampling in real-time. - */ -class MinimapCharRendererFactory { - /** - * Creates a new character renderer factory with the given scale. - */ - static create(scale, fontFamily) { - // renderers are immutable. By default we'll 'create' a new minimap - // character renderer whenever we switch editors, no need to do extra work. - if (this.lastCreated && scale === this.lastCreated.scale && fontFamily === this.lastFontFamily) { - return this.lastCreated; - } - let factory; - if (_minimapPreBaked_js__WEBPACK_IMPORTED_MODULE_2__["prebakedMiniMaps"][scale]) { - factory = new _minimapCharRenderer_js__WEBPACK_IMPORTED_MODULE_0__["MinimapCharRenderer"](_minimapPreBaked_js__WEBPACK_IMPORTED_MODULE_2__["prebakedMiniMaps"][scale](), scale); - } - else { - factory = MinimapCharRendererFactory.createFromSampleData(MinimapCharRendererFactory.createSampleData(fontFamily).data, scale); - } - this.lastFontFamily = fontFamily; - this.lastCreated = factory; - return factory; - } - /** - * Creates the font sample data, writing to a canvas. - */ - static createSampleData(fontFamily) { - const canvas = document.createElement('canvas'); - const ctx = canvas.getContext('2d'); - canvas.style.height = `${16 /* SAMPLED_CHAR_HEIGHT */}px`; - canvas.height = 16 /* SAMPLED_CHAR_HEIGHT */; - canvas.width = 96 /* CHAR_COUNT */ * 10 /* SAMPLED_CHAR_WIDTH */; - canvas.style.width = 96 /* CHAR_COUNT */ * 10 /* SAMPLED_CHAR_WIDTH */ + 'px'; - ctx.fillStyle = '#ffffff'; - ctx.font = `bold ${16 /* SAMPLED_CHAR_HEIGHT */}px ${fontFamily}`; - ctx.textBaseline = 'middle'; - let x = 0; - for (const code of _minimapCharSheet_js__WEBPACK_IMPORTED_MODULE_1__["allCharCodes"]) { - ctx.fillText(String.fromCharCode(code), x, 16 /* SAMPLED_CHAR_HEIGHT */ / 2); - x += 10 /* SAMPLED_CHAR_WIDTH */; - } - return ctx.getImageData(0, 0, 96 /* CHAR_COUNT */ * 10 /* SAMPLED_CHAR_WIDTH */, 16 /* SAMPLED_CHAR_HEIGHT */); - } - /** - * Creates a character renderer from the canvas sample data. - */ - static createFromSampleData(source, scale) { - const expectedLength = 16 /* SAMPLED_CHAR_HEIGHT */ * 10 /* SAMPLED_CHAR_WIDTH */ * 4 /* RGBA_CHANNELS_CNT */ * 96 /* CHAR_COUNT */; - if (source.length !== expectedLength) { - throw new Error('Unexpected source in MinimapCharRenderer'); - } - let charData = MinimapCharRendererFactory._downsample(source, scale); - return new _minimapCharRenderer_js__WEBPACK_IMPORTED_MODULE_0__["MinimapCharRenderer"](charData, scale); - } - static _downsampleChar(source, sourceOffset, dest, destOffset, scale) { - const width = 1 /* BASE_CHAR_WIDTH */ * scale; - const height = 2 /* BASE_CHAR_HEIGHT */ * scale; - let targetIndex = destOffset; - let brightest = 0; - // This is essentially an ad-hoc rescaling algorithm. Standard approaches - // like bicubic interpolation are awesome for scaling between image sizes, - // but don't work so well when scaling to very small pixel values, we end - // up with blurry, indistinct forms. - // - // The approach taken here is simply mapping each source pixel to the target - // pixels, and taking the weighted values for all pixels in each, and then - // averaging them out. Finally we apply an intensity boost in _downsample, - // since when scaling to the smallest pixel sizes there's more black space - // which causes characters to be much less distinct. - for (let y = 0; y < height; y++) { - // 1. For this destination pixel, get the source pixels we're sampling - // from (x1, y1) to the next pixel (x2, y2) - const sourceY1 = (y / height) * 16 /* SAMPLED_CHAR_HEIGHT */; - const sourceY2 = ((y + 1) / height) * 16 /* SAMPLED_CHAR_HEIGHT */; - for (let x = 0; x < width; x++) { - const sourceX1 = (x / width) * 10 /* SAMPLED_CHAR_WIDTH */; - const sourceX2 = ((x + 1) / width) * 10 /* SAMPLED_CHAR_WIDTH */; - // 2. Sample all of them, summing them up and weighting them. Similar - // to bilinear interpolation. - let value = 0; - let samples = 0; - for (let sy = sourceY1; sy < sourceY2; sy++) { - const sourceRow = sourceOffset + Math.floor(sy) * 3840 /* RGBA_SAMPLED_ROW_WIDTH */; - const yBalance = 1 - (sy - Math.floor(sy)); - for (let sx = sourceX1; sx < sourceX2; sx++) { - const xBalance = 1 - (sx - Math.floor(sx)); - const sourceIndex = sourceRow + Math.floor(sx) * 4 /* RGBA_CHANNELS_CNT */; - const weight = xBalance * yBalance; - samples += weight; - value += ((source[sourceIndex] * source[sourceIndex + 3]) / 255) * weight; - } - } - const final = value / samples; - brightest = Math.max(brightest, final); - dest[targetIndex++] = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_3__["toUint8"])(final); - } - } - return brightest; - } - static _downsample(data, scale) { - const pixelsPerCharacter = 2 /* BASE_CHAR_HEIGHT */ * scale * 1 /* BASE_CHAR_WIDTH */ * scale; - const resultLen = pixelsPerCharacter * 96 /* CHAR_COUNT */; - const result = new Uint8ClampedArray(resultLen); - let resultOffset = 0; - let sourceOffset = 0; - let brightest = 0; - for (let charIndex = 0; charIndex < 96 /* CHAR_COUNT */; charIndex++) { - brightest = Math.max(brightest, this._downsampleChar(data, sourceOffset, result, resultOffset, scale)); - resultOffset += pixelsPerCharacter; - sourceOffset += 10 /* SAMPLED_CHAR_WIDTH */ * 4 /* RGBA_CHANNELS_CNT */; - } - if (brightest > 0) { - const adjust = 255 / brightest; - for (let i = 0; i < resultLen; i++) { - result[i] *= adjust; - } - } - return result; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharSheet.js": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapCharSheet.js ***! - \************************************************************************************************/ -/*! exports provided: allCharCodes, getCharIndex */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "allCharCodes", function() { return allCharCodes; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCharIndex", function() { return getCharIndex; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -const allCharCodes = (() => { - const v = []; - for (let i = 32 /* START_CH_CODE */; i <= 126 /* END_CH_CODE */; i++) { - v.push(i); - } - v.push(65533 /* UNKNOWN_CODE */); - return v; -})(); -const getCharIndex = (chCode, fontScale) => { - chCode -= 32 /* START_CH_CODE */; - if (chCode < 0 || chCode > 96 /* CHAR_COUNT */) { - if (fontScale <= 2) { - // for smaller scales, we can get away with using any ASCII character... - return (chCode + 96 /* CHAR_COUNT */) % 96 /* CHAR_COUNT */; - } - return 96 /* CHAR_COUNT */ - 1; // unknown symbol - } - return chCode; -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapPreBaked.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/minimap/minimapPreBaked.js ***! - \***********************************************************************************************/ -/*! exports provided: prebakedMiniMaps */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prebakedMiniMaps", function() { return prebakedMiniMaps; }); -/* harmony import */ var _base_common_functional_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/common/functional.js */ "./node_modules/monaco-editor/esm/vs/base/common/functional.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const charTable = { - '0': 0, - '1': 1, - '2': 2, - '3': 3, - '4': 4, - '5': 5, - '6': 6, - '7': 7, - '8': 8, - '9': 9, - A: 10, - B: 11, - C: 12, - D: 13, - E: 14, - F: 15 -}; -const decodeData = (str) => { - const output = new Uint8ClampedArray(str.length / 2); - for (let i = 0; i < str.length; i += 2) { - output[i >> 1] = (charTable[str[i]] << 4) | (charTable[str[i + 1]] & 0xF); - } - return output; -}; -/* -const encodeData = (data: Uint8ClampedArray, length: string) => { - const chars = '0123456789ABCDEF'; - let output = ''; - for (let i = 0; i < data.length; i++) { - output += chars[data[i] >> 4] + chars[data[i] & 0xf]; - } - return output; -}; -*/ -/** - * Map of minimap scales to prebaked sample data at those scales. We don't - * sample much larger data, because then font family becomes visible, which - * is use-configurable. - */ -const prebakedMiniMaps = { - 1: Object(_base_common_functional_js__WEBPACK_IMPORTED_MODULE_0__["once"])(() => decodeData('0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792')), - 2: Object(_base_common_functional_js__WEBPACK_IMPORTED_MODULE_0__["once"])(() => decodeData('000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126')) -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.css": -/*!******************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.css ***! - \******************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_overlayWidgets_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./overlayWidgets.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.css"); -/* harmony import */ var _css_loader_dist_cjs_js_overlayWidgets_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_overlayWidgets_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_overlayWidgets_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_overlayWidgets_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js": -/*!*****************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js ***! - \*****************************************************************************************************/ -/*! exports provided: ViewOverlayWidgets */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewOverlayWidgets", function() { return ViewOverlayWidgets; }); -/* harmony import */ var _overlayWidgets_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./overlayWidgets.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.css"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../view/viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class ViewOverlayWidgets extends _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__["ViewPart"] { - constructor(context) { - super(context); - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._widgets = {}; - this._verticalScrollbarWidth = layoutInfo.verticalScrollbarWidth; - this._minimapWidth = layoutInfo.minimap.minimapWidth; - this._horizontalScrollbarHeight = layoutInfo.horizontalScrollbarHeight; - this._editorHeight = layoutInfo.height; - this._editorWidth = layoutInfo.width; - this._domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(document.createElement('div')); - _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__["PartFingerprints"].write(this._domNode, 4 /* OverlayWidgets */); - this._domNode.setClassName('overlayWidgets'); - } - dispose() { - super.dispose(); - this._widgets = {}; - } - getDomNode() { - return this._domNode; - } - // ---- begin view event handlers - onConfigurationChanged(e) { - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._verticalScrollbarWidth = layoutInfo.verticalScrollbarWidth; - this._minimapWidth = layoutInfo.minimap.minimapWidth; - this._horizontalScrollbarHeight = layoutInfo.horizontalScrollbarHeight; - this._editorHeight = layoutInfo.height; - this._editorWidth = layoutInfo.width; - return true; - } - // ---- end view event handlers - addWidget(widget) { - const domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(widget.getDomNode()); - this._widgets[widget.getId()] = { - widget: widget, - preference: null, - domNode: domNode - }; - // This is sync because a widget wants to be in the dom - domNode.setPosition('absolute'); - domNode.setAttribute('widgetId', widget.getId()); - this._domNode.appendChild(domNode); - this.setShouldRender(); - } - setWidgetPosition(widget, preference) { - const widgetData = this._widgets[widget.getId()]; - if (widgetData.preference === preference) { - return false; - } - widgetData.preference = preference; - this.setShouldRender(); - return true; - } - removeWidget(widget) { - const widgetId = widget.getId(); - if (this._widgets.hasOwnProperty(widgetId)) { - const widgetData = this._widgets[widgetId]; - const domNode = widgetData.domNode.domNode; - delete this._widgets[widgetId]; - domNode.parentNode.removeChild(domNode); - this.setShouldRender(); - } - } - _renderWidget(widgetData) { - const domNode = widgetData.domNode; - if (widgetData.preference === null) { - domNode.unsetTop(); - return; - } - if (widgetData.preference === 0 /* TOP_RIGHT_CORNER */) { - domNode.setTop(0); - domNode.setRight((2 * this._verticalScrollbarWidth) + this._minimapWidth); - } - else if (widgetData.preference === 1 /* BOTTOM_RIGHT_CORNER */) { - const widgetHeight = domNode.domNode.clientHeight; - domNode.setTop((this._editorHeight - widgetHeight - 2 * this._horizontalScrollbarHeight)); - domNode.setRight((2 * this._verticalScrollbarWidth) + this._minimapWidth); - } - else if (widgetData.preference === 2 /* TOP_CENTER */) { - domNode.setTop(0); - domNode.domNode.style.right = '50%'; - } - } - prepareRender(ctx) { - // Nothing to read - } - render(ctx) { - this._domNode.setWidth(this._editorWidth); - const keys = Object.keys(this._widgets); - for (let i = 0, len = keys.length; i < len; i++) { - const widgetId = keys[i]; - this._renderWidget(this._widgets[widgetId]); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js": -/*!**************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js ***! - \**************************************************************************************************************/ -/*! exports provided: DecorationsOverviewRuler */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DecorationsOverviewRuler", function() { return DecorationsOverviewRuler; }); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../view/viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -class Settings { - constructor(config, theme) { - const options = config.options; - this.lineHeight = options.get(51 /* lineHeight */); - this.pixelRatio = options.get(115 /* pixelRatio */); - this.overviewRulerLanes = options.get(65 /* overviewRulerLanes */); - this.renderBorder = options.get(64 /* overviewRulerBorder */); - const borderColor = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["editorOverviewRulerBorder"]); - this.borderColor = borderColor ? borderColor.toString() : null; - this.hideCursor = options.get(44 /* hideCursorInOverviewRuler */); - const cursorColor = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["editorCursorForeground"]); - this.cursorColor = cursorColor ? cursorColor.transparent(0.7).toString() : null; - this.themeType = theme.type; - const minimapOpts = options.get(56 /* minimap */); - const minimapEnabled = minimapOpts.enabled; - const minimapSide = minimapOpts.side; - const backgroundColor = minimapEnabled - ? theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["editorOverviewRulerBackground"]) || _common_modes_js__WEBPACK_IMPORTED_MODULE_4__["TokenizationRegistry"].getDefaultBackground() - : null; - if (backgroundColor === null || minimapSide === 'left') { - this.backgroundColor = null; - } - else { - this.backgroundColor = _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].Format.CSS.formatHex(backgroundColor); - } - const layoutInfo = options.get(117 /* layoutInfo */); - const position = layoutInfo.overviewRuler; - this.top = position.top; - this.right = position.right; - this.domWidth = position.width; - this.domHeight = position.height; - if (this.overviewRulerLanes === 0) { - // overview ruler is off - this.canvasWidth = 0; - this.canvasHeight = 0; - } - else { - this.canvasWidth = (this.domWidth * this.pixelRatio) | 0; - this.canvasHeight = (this.domHeight * this.pixelRatio) | 0; - } - const [x, w] = this._initLanes(1, this.canvasWidth, this.overviewRulerLanes); - this.x = x; - this.w = w; - } - _initLanes(canvasLeftOffset, canvasWidth, laneCount) { - const remainingWidth = canvasWidth - canvasLeftOffset; - if (laneCount >= 3) { - const leftWidth = Math.floor(remainingWidth / 3); - const rightWidth = Math.floor(remainingWidth / 3); - const centerWidth = remainingWidth - leftWidth - rightWidth; - const leftOffset = canvasLeftOffset; - const centerOffset = leftOffset + leftWidth; - const rightOffset = leftOffset + leftWidth + centerWidth; - return [ - [ - 0, - leftOffset, - centerOffset, - leftOffset, - rightOffset, - leftOffset, - centerOffset, - leftOffset, - ], [ - 0, - leftWidth, - centerWidth, - leftWidth + centerWidth, - rightWidth, - leftWidth + centerWidth + rightWidth, - centerWidth + rightWidth, - leftWidth + centerWidth + rightWidth, - ] - ]; - } - else if (laneCount === 2) { - const leftWidth = Math.floor(remainingWidth / 2); - const rightWidth = remainingWidth - leftWidth; - const leftOffset = canvasLeftOffset; - const rightOffset = leftOffset + leftWidth; - return [ - [ - 0, - leftOffset, - leftOffset, - leftOffset, - rightOffset, - leftOffset, - leftOffset, - leftOffset, - ], [ - 0, - leftWidth, - leftWidth, - leftWidth, - rightWidth, - leftWidth + rightWidth, - leftWidth + rightWidth, - leftWidth + rightWidth, - ] - ]; - } - else { - const offset = canvasLeftOffset; - const width = remainingWidth; - return [ - [ - 0, - offset, - offset, - offset, - offset, - offset, - offset, - offset, - ], [ - 0, - width, - width, - width, - width, - width, - width, - width, - ] - ]; - } - } - equals(other) { - return (this.lineHeight === other.lineHeight - && this.pixelRatio === other.pixelRatio - && this.overviewRulerLanes === other.overviewRulerLanes - && this.renderBorder === other.renderBorder - && this.borderColor === other.borderColor - && this.hideCursor === other.hideCursor - && this.cursorColor === other.cursorColor - && this.themeType === other.themeType - && this.backgroundColor === other.backgroundColor - && this.top === other.top - && this.right === other.right - && this.domWidth === other.domWidth - && this.domHeight === other.domHeight - && this.canvasWidth === other.canvasWidth - && this.canvasHeight === other.canvasHeight); - } -} -class DecorationsOverviewRuler extends _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__["ViewPart"] { - constructor(context) { - super(context); - this._domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__["createFastDomNode"])(document.createElement('canvas')); - this._domNode.setClassName('decorationsOverviewRuler'); - this._domNode.setPosition('absolute'); - this._domNode.setLayerHinting(true); - this._domNode.setContain('strict'); - this._domNode.setAttribute('aria-hidden', 'true'); - this._updateSettings(false); - this._tokensColorTrackerListener = _common_modes_js__WEBPACK_IMPORTED_MODULE_4__["TokenizationRegistry"].onDidChange((e) => { - if (e.changedColorMap) { - this._updateSettings(true); - } - }); - this._cursorPositions = []; - } - dispose() { - super.dispose(); - this._tokensColorTrackerListener.dispose(); - } - _updateSettings(renderNow) { - const newSettings = new Settings(this._context.configuration, this._context.theme); - if (this._settings && this._settings.equals(newSettings)) { - // nothing to do - return false; - } - this._settings = newSettings; - this._domNode.setTop(this._settings.top); - this._domNode.setRight(this._settings.right); - this._domNode.setWidth(this._settings.domWidth); - this._domNode.setHeight(this._settings.domHeight); - this._domNode.domNode.width = this._settings.canvasWidth; - this._domNode.domNode.height = this._settings.canvasHeight; - if (renderNow) { - this._render(); - } - return true; - } - // ---- begin view event handlers - onConfigurationChanged(e) { - return this._updateSettings(false); - } - onCursorStateChanged(e) { - this._cursorPositions = []; - for (let i = 0, len = e.selections.length; i < len; i++) { - this._cursorPositions[i] = e.selections[i].getPosition(); - } - this._cursorPositions.sort(_common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"].compare); - return true; - } - onDecorationsChanged(e) { - if (e.affectsOverviewRuler) { - return true; - } - return false; - } - onFlushed(e) { - return true; - } - onScrollChanged(e) { - return e.scrollHeightChanged; - } - onZonesChanged(e) { - return true; - } - onThemeChanged(e) { - // invalidate color cache - this._context.model.invalidateOverviewRulerColorCache(); - return this._updateSettings(false); - } - // ---- end view event handlers - getDomNode() { - return this._domNode.domNode; - } - prepareRender(ctx) { - // Nothing to read - } - render(editorCtx) { - this._render(); - } - _render() { - if (this._settings.overviewRulerLanes === 0) { - // overview ruler is off - this._domNode.setBackgroundColor(this._settings.backgroundColor ? this._settings.backgroundColor : ''); - return; - } - const canvasWidth = this._settings.canvasWidth; - const canvasHeight = this._settings.canvasHeight; - const lineHeight = this._settings.lineHeight; - const viewLayout = this._context.viewLayout; - const outerHeight = this._context.viewLayout.getScrollHeight(); - const heightRatio = canvasHeight / outerHeight; - const decorations = this._context.model.getAllOverviewRulerDecorations(this._context.theme); - const minDecorationHeight = (6 /* MIN_DECORATION_HEIGHT */ * this._settings.pixelRatio) | 0; - const halfMinDecorationHeight = (minDecorationHeight / 2) | 0; - const canvasCtx = this._domNode.domNode.getContext('2d'); - if (this._settings.backgroundColor === null) { - canvasCtx.clearRect(0, 0, canvasWidth, canvasHeight); - } - else { - canvasCtx.fillStyle = this._settings.backgroundColor; - canvasCtx.fillRect(0, 0, canvasWidth, canvasHeight); - } - const x = this._settings.x; - const w = this._settings.w; - // Avoid flickering by always rendering the colors in the same order - // colors that don't use transparency will be sorted last (they start with #) - const colors = Object.keys(decorations); - colors.sort(); - for (let cIndex = 0, cLen = colors.length; cIndex < cLen; cIndex++) { - const color = colors[cIndex]; - const colorDecorations = decorations[color]; - canvasCtx.fillStyle = color; - let prevLane = 0; - let prevY1 = 0; - let prevY2 = 0; - for (let i = 0, len = colorDecorations.length; i < len; i++) { - const lane = colorDecorations[3 * i]; - const startLineNumber = colorDecorations[3 * i + 1]; - const endLineNumber = colorDecorations[3 * i + 2]; - let y1 = (viewLayout.getVerticalOffsetForLineNumber(startLineNumber) * heightRatio) | 0; - let y2 = ((viewLayout.getVerticalOffsetForLineNumber(endLineNumber) + lineHeight) * heightRatio) | 0; - const height = y2 - y1; - if (height < minDecorationHeight) { - let yCenter = ((y1 + y2) / 2) | 0; - if (yCenter < halfMinDecorationHeight) { - yCenter = halfMinDecorationHeight; - } - else if (yCenter + halfMinDecorationHeight > canvasHeight) { - yCenter = canvasHeight - halfMinDecorationHeight; - } - y1 = yCenter - halfMinDecorationHeight; - y2 = yCenter + halfMinDecorationHeight; - } - if (y1 > prevY2 + 1 || lane !== prevLane) { - // flush prev - if (i !== 0) { - canvasCtx.fillRect(x[prevLane], prevY1, w[prevLane], prevY2 - prevY1); - } - prevLane = lane; - prevY1 = y1; - prevY2 = y2; - } - else { - // merge into prev - if (y2 > prevY2) { - prevY2 = y2; - } - } - } - canvasCtx.fillRect(x[prevLane], prevY1, w[prevLane], prevY2 - prevY1); - } - // Draw cursors - if (!this._settings.hideCursor && this._settings.cursorColor) { - const cursorHeight = (2 * this._settings.pixelRatio) | 0; - const halfCursorHeight = (cursorHeight / 2) | 0; - const cursorX = this._settings.x[7 /* Full */]; - const cursorW = this._settings.w[7 /* Full */]; - canvasCtx.fillStyle = this._settings.cursorColor; - let prevY1 = -100; - let prevY2 = -100; - for (let i = 0, len = this._cursorPositions.length; i < len; i++) { - const cursor = this._cursorPositions[i]; - let yCenter = (viewLayout.getVerticalOffsetForLineNumber(cursor.lineNumber) * heightRatio) | 0; - if (yCenter < halfCursorHeight) { - yCenter = halfCursorHeight; - } - else if (yCenter + halfCursorHeight > canvasHeight) { - yCenter = canvasHeight - halfCursorHeight; - } - const y1 = yCenter - halfCursorHeight; - const y2 = y1 + cursorHeight; - if (y1 > prevY2 + 1) { - // flush prev - if (i !== 0) { - canvasCtx.fillRect(cursorX, prevY1, cursorW, prevY2 - prevY1); - } - prevY1 = y1; - prevY2 = y2; - } - else { - // merge into prev - if (y2 > prevY2) { - prevY2 = y2; - } - } - } - canvasCtx.fillRect(cursorX, prevY1, cursorW, prevY2 - prevY1); - } - if (this._settings.renderBorder && this._settings.borderColor && this._settings.overviewRulerLanes > 0) { - canvasCtx.beginPath(); - canvasCtx.lineWidth = 1; - canvasCtx.strokeStyle = this._settings.borderColor; - canvasCtx.moveTo(0, 0); - canvasCtx.lineTo(0, canvasHeight); - canvasCtx.stroke(); - canvasCtx.moveTo(0, 0); - canvasCtx.lineTo(canvasWidth, 0); - canvasCtx.stroke(); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js ***! - \***************************************************************************************************/ -/*! exports provided: OverviewRuler */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewRuler", function() { return OverviewRuler; }); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _common_view_overviewZoneManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/view/overviewZoneManager.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/overviewZoneManager.js"); -/* harmony import */ var _common_viewModel_viewEventHandler_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/viewModel/viewEventHandler.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewEventHandler.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class OverviewRuler extends _common_viewModel_viewEventHandler_js__WEBPACK_IMPORTED_MODULE_2__["ViewEventHandler"] { - constructor(context, cssClassName) { - super(); - this._context = context; - const options = this._context.configuration.options; - this._domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__["createFastDomNode"])(document.createElement('canvas')); - this._domNode.setClassName(cssClassName); - this._domNode.setPosition('absolute'); - this._domNode.setLayerHinting(true); - this._domNode.setContain('strict'); - this._zoneManager = new _common_view_overviewZoneManager_js__WEBPACK_IMPORTED_MODULE_1__["OverviewZoneManager"]((lineNumber) => this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber)); - this._zoneManager.setDOMWidth(0); - this._zoneManager.setDOMHeight(0); - this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()); - this._zoneManager.setLineHeight(options.get(51 /* lineHeight */)); - this._zoneManager.setPixelRatio(options.get(115 /* pixelRatio */)); - this._context.addEventHandler(this); - } - dispose() { - this._context.removeEventHandler(this); - super.dispose(); - } - // ---- begin view event handlers - onConfigurationChanged(e) { - const options = this._context.configuration.options; - if (e.hasChanged(51 /* lineHeight */)) { - this._zoneManager.setLineHeight(options.get(51 /* lineHeight */)); - this._render(); - } - if (e.hasChanged(115 /* pixelRatio */)) { - this._zoneManager.setPixelRatio(options.get(115 /* pixelRatio */)); - this._domNode.setWidth(this._zoneManager.getDOMWidth()); - this._domNode.setHeight(this._zoneManager.getDOMHeight()); - this._domNode.domNode.width = this._zoneManager.getCanvasWidth(); - this._domNode.domNode.height = this._zoneManager.getCanvasHeight(); - this._render(); - } - return true; - } - onFlushed(e) { - this._render(); - return true; - } - onScrollChanged(e) { - if (e.scrollHeightChanged) { - this._zoneManager.setOuterHeight(e.scrollHeight); - this._render(); - } - return true; - } - onZonesChanged(e) { - this._render(); - return true; - } - // ---- end view event handlers - getDomNode() { - return this._domNode.domNode; - } - setLayout(position) { - this._domNode.setTop(position.top); - this._domNode.setRight(position.right); - let hasChanged = false; - hasChanged = this._zoneManager.setDOMWidth(position.width) || hasChanged; - hasChanged = this._zoneManager.setDOMHeight(position.height) || hasChanged; - if (hasChanged) { - this._domNode.setWidth(this._zoneManager.getDOMWidth()); - this._domNode.setHeight(this._zoneManager.getDOMHeight()); - this._domNode.domNode.width = this._zoneManager.getCanvasWidth(); - this._domNode.domNode.height = this._zoneManager.getCanvasHeight(); - this._render(); - } - } - setZones(zones) { - this._zoneManager.setZones(zones); - this._render(); - } - _render() { - if (this._zoneManager.getOuterHeight() === 0) { - return false; - } - const width = this._zoneManager.getCanvasWidth(); - const height = this._zoneManager.getCanvasHeight(); - const colorZones = this._zoneManager.resolveColorZones(); - const id2Color = this._zoneManager.getId2Color(); - const ctx = this._domNode.domNode.getContext('2d'); - ctx.clearRect(0, 0, width, height); - if (colorZones.length > 0) { - this._renderOneLane(ctx, colorZones, id2Color, width); - } - return true; - } - _renderOneLane(ctx, colorZones, id2Color, width) { - let currentColorId = 0; - let currentFrom = 0; - let currentTo = 0; - for (const zone of colorZones) { - const zoneColorId = zone.colorId; - const zoneFrom = zone.from; - const zoneTo = zone.to; - if (zoneColorId !== currentColorId) { - ctx.fillRect(0, currentFrom, width, currentTo - currentFrom); - currentColorId = zoneColorId; - ctx.fillStyle = id2Color[currentColorId]; - currentFrom = zoneFrom; - currentTo = zoneTo; - } - else { - if (currentTo >= zoneFrom) { - currentTo = Math.max(currentTo, zoneTo); - } - else { - ctx.fillRect(0, currentFrom, width, currentTo - currentFrom); - currentFrom = zoneFrom; - currentTo = zoneTo; - } - } - } - ctx.fillRect(0, currentFrom, width, currentTo - currentFrom); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.css": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.css ***! - \**************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_rulers_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./rulers.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.css"); -/* harmony import */ var _css_loader_dist_cjs_js_rulers_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_rulers_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_rulers_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_rulers_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.js ***! - \*************************************************************************************/ -/*! exports provided: Rulers */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rulers", function() { return Rulers; }); -/* harmony import */ var _rulers_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rulers.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/rulers/rulers.css"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../view/viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/* harmony import */ var _common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -class Rulers extends _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__["ViewPart"] { - constructor(context) { - super(context); - this.domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(document.createElement('div')); - this.domNode.setAttribute('role', 'presentation'); - this.domNode.setAttribute('aria-hidden', 'true'); - this.domNode.setClassName('view-rulers'); - this._renderedRulers = []; - const options = this._context.configuration.options; - this._rulers = options.get(83 /* rulers */); - this._typicalHalfwidthCharacterWidth = options.get(36 /* fontInfo */).typicalHalfwidthCharacterWidth; - } - dispose() { - super.dispose(); - } - // --- begin event handlers - onConfigurationChanged(e) { - const options = this._context.configuration.options; - this._rulers = options.get(83 /* rulers */); - this._typicalHalfwidthCharacterWidth = options.get(36 /* fontInfo */).typicalHalfwidthCharacterWidth; - return true; - } - onScrollChanged(e) { - return e.scrollHeightChanged; - } - // --- end event handlers - prepareRender(ctx) { - // Nothing to read - } - _ensureRulersCount() { - const currentCount = this._renderedRulers.length; - const desiredCount = this._rulers.length; - if (currentCount === desiredCount) { - // Nothing to do - return; - } - if (currentCount < desiredCount) { - const { tabSize } = this._context.model.getTextModelOptions(); - const rulerWidth = tabSize; - let addCount = desiredCount - currentCount; - while (addCount > 0) { - const node = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(document.createElement('div')); - node.setClassName('view-ruler'); - node.setWidth(rulerWidth); - this.domNode.appendChild(node); - this._renderedRulers.push(node); - addCount--; - } - return; - } - let removeCount = currentCount - desiredCount; - while (removeCount > 0) { - const node = this._renderedRulers.pop(); - this.domNode.removeChild(node); - removeCount--; - } - } - render(ctx) { - this._ensureRulersCount(); - for (let i = 0, len = this._rulers.length; i < len; i++) { - const node = this._renderedRulers[i]; - const ruler = this._rulers[i]; - node.setBoxShadow(ruler.color ? `1px 0 0 0 ${ruler.color} inset` : ``); - node.setHeight(Math.min(ctx.scrollHeight, 1000000)); - node.setLeft(ruler.column * this._typicalHalfwidthCharacterWidth); - } - } -} -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__["registerThemingParticipant"])((theme, collector) => { - const rulerColor = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["editorRuler"]); - if (rulerColor) { - collector.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${rulerColor} inset; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css ***! - \**********************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_scrollDecoration_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./scrollDecoration.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css"); -/* harmony import */ var _css_loader_dist_cjs_js_scrollDecoration_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_scrollDecoration_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_scrollDecoration_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_scrollDecoration_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js": -/*!*********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js ***! - \*********************************************************************************************************/ -/*! exports provided: ScrollDecorationViewPart */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollDecorationViewPart", function() { return ScrollDecorationViewPart; }); -/* harmony import */ var _scrollDecoration_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scrollDecoration.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.css"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../view/viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -class ScrollDecorationViewPart extends _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__["ViewPart"] { - constructor(context) { - super(context); - this._scrollTop = 0; - this._width = 0; - this._updateWidth(); - this._shouldShow = false; - const options = this._context.configuration.options; - const scrollbar = options.get(84 /* scrollbar */); - this._useShadows = scrollbar.useShadows; - this._domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(document.createElement('div')); - this._domNode.setAttribute('role', 'presentation'); - this._domNode.setAttribute('aria-hidden', 'true'); - } - dispose() { - super.dispose(); - } - _updateShouldShow() { - const newShouldShow = (this._useShadows && this._scrollTop > 0); - if (this._shouldShow !== newShouldShow) { - this._shouldShow = newShouldShow; - return true; - } - return false; - } - getDomNode() { - return this._domNode; - } - _updateWidth() { - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - if (layoutInfo.minimap.renderMinimap === 0 || (layoutInfo.minimap.minimapWidth > 0 && layoutInfo.minimap.minimapLeft === 0)) { - this._width = layoutInfo.width; - } - else { - this._width = layoutInfo.width - layoutInfo.minimap.minimapWidth - layoutInfo.verticalScrollbarWidth; - } - } - // --- begin event handlers - onConfigurationChanged(e) { - const options = this._context.configuration.options; - const scrollbar = options.get(84 /* scrollbar */); - this._useShadows = scrollbar.useShadows; - this._updateWidth(); - this._updateShouldShow(); - return true; - } - onScrollChanged(e) { - this._scrollTop = e.scrollTop; - return this._updateShouldShow(); - } - // --- end event handlers - prepareRender(ctx) { - // Nothing to read - } - render(ctx) { - this._domNode.setWidth(this._width); - this._domNode.setClassName(this._shouldShow ? 'scroll-decoration' : ''); - } -} -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__["registerThemingParticipant"])((theme, collector) => { - const shadow = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["scrollbarShadow"]); - if (shadow) { - collector.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${shadow} 0 6px 6px -6px inset; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.css": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.css ***! - \**********************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_selections_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./selections.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.css"); -/* harmony import */ var _css_loader_dist_cjs_js_selections_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_selections_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_selections_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_selections_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.js ***! - \*********************************************************************************************/ -/*! exports provided: SelectionsOverlay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionsOverlay", function() { return SelectionsOverlay; }); -/* harmony import */ var _selections_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selections.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/selections/selections.css"); -/* harmony import */ var _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _view_dynamicViewOverlay_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../view/dynamicViewOverlay.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/dynamicViewOverlay.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -class HorizontalRangeWithStyle { - constructor(other) { - this.left = other.left; - this.width = other.width; - this.startStyle = null; - this.endStyle = null; - } -} -class LineVisibleRangesWithStyle { - constructor(lineNumber, ranges) { - this.lineNumber = lineNumber; - this.ranges = ranges; - } -} -function toStyledRange(item) { - return new HorizontalRangeWithStyle(item); -} -function toStyled(item) { - return new LineVisibleRangesWithStyle(item.lineNumber, item.ranges.map(toStyledRange)); -} -// TODO@Alex: Remove this once IE11 fixes Bug #524217 -// The problem in IE11 is that it does some sort of auto-zooming to accomodate for displays with different pixel density. -// Unfortunately, this auto-zooming is buggy around dealing with rounded borders -const isIEWithZoomingIssuesNearRoundedBorders = _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_1__["isEdge"]; -class SelectionsOverlay extends _view_dynamicViewOverlay_js__WEBPACK_IMPORTED_MODULE_2__["DynamicViewOverlay"] { - constructor(context) { - super(); - this._previousFrameVisibleRangesWithStyle = []; - this._context = context; - const options = this._context.configuration.options; - this._lineHeight = options.get(51 /* lineHeight */); - this._roundedSelection = options.get(82 /* roundedSelection */); - this._typicalHalfwidthCharacterWidth = options.get(36 /* fontInfo */).typicalHalfwidthCharacterWidth; - this._selections = []; - this._renderResult = null; - this._context.addEventHandler(this); - } - dispose() { - this._context.removeEventHandler(this); - this._renderResult = null; - super.dispose(); - } - // --- begin event handlers - onConfigurationChanged(e) { - const options = this._context.configuration.options; - this._lineHeight = options.get(51 /* lineHeight */); - this._roundedSelection = options.get(82 /* roundedSelection */); - this._typicalHalfwidthCharacterWidth = options.get(36 /* fontInfo */).typicalHalfwidthCharacterWidth; - return true; - } - onCursorStateChanged(e) { - this._selections = e.selections.slice(0); - return true; - } - onDecorationsChanged(e) { - // true for inline decorations that can end up relayouting text - return true; //e.inlineDecorationsChanged; - } - onFlushed(e) { - return true; - } - onLinesChanged(e) { - return true; - } - onLinesDeleted(e) { - return true; - } - onLinesInserted(e) { - return true; - } - onScrollChanged(e) { - return e.scrollTopChanged; - } - onZonesChanged(e) { - return true; - } - // --- end event handlers - _visibleRangesHaveGaps(linesVisibleRanges) { - for (let i = 0, len = linesVisibleRanges.length; i < len; i++) { - const lineVisibleRanges = linesVisibleRanges[i]; - if (lineVisibleRanges.ranges.length > 1) { - // There are two ranges on the same line - return true; - } - } - return false; - } - _enrichVisibleRangesWithStyle(viewport, linesVisibleRanges, previousFrame) { - const epsilon = this._typicalHalfwidthCharacterWidth / 4; - let previousFrameTop = null; - let previousFrameBottom = null; - if (previousFrame && previousFrame.length > 0 && linesVisibleRanges.length > 0) { - const topLineNumber = linesVisibleRanges[0].lineNumber; - if (topLineNumber === viewport.startLineNumber) { - for (let i = 0; !previousFrameTop && i < previousFrame.length; i++) { - if (previousFrame[i].lineNumber === topLineNumber) { - previousFrameTop = previousFrame[i].ranges[0]; - } - } - } - const bottomLineNumber = linesVisibleRanges[linesVisibleRanges.length - 1].lineNumber; - if (bottomLineNumber === viewport.endLineNumber) { - for (let i = previousFrame.length - 1; !previousFrameBottom && i >= 0; i--) { - if (previousFrame[i].lineNumber === bottomLineNumber) { - previousFrameBottom = previousFrame[i].ranges[0]; - } - } - } - if (previousFrameTop && !previousFrameTop.startStyle) { - previousFrameTop = null; - } - if (previousFrameBottom && !previousFrameBottom.startStyle) { - previousFrameBottom = null; - } - } - for (let i = 0, len = linesVisibleRanges.length; i < len; i++) { - // We know for a fact that there is precisely one range on each line - const curLineRange = linesVisibleRanges[i].ranges[0]; - const curLeft = curLineRange.left; - const curRight = curLineRange.left + curLineRange.width; - const startStyle = { - top: 0 /* EXTERN */, - bottom: 0 /* EXTERN */ - }; - const endStyle = { - top: 0 /* EXTERN */, - bottom: 0 /* EXTERN */ - }; - if (i > 0) { - // Look above - const prevLeft = linesVisibleRanges[i - 1].ranges[0].left; - const prevRight = linesVisibleRanges[i - 1].ranges[0].left + linesVisibleRanges[i - 1].ranges[0].width; - if (abs(curLeft - prevLeft) < epsilon) { - startStyle.top = 2 /* FLAT */; - } - else if (curLeft > prevLeft) { - startStyle.top = 1 /* INTERN */; - } - if (abs(curRight - prevRight) < epsilon) { - endStyle.top = 2 /* FLAT */; - } - else if (prevLeft < curRight && curRight < prevRight) { - endStyle.top = 1 /* INTERN */; - } - } - else if (previousFrameTop) { - // Accept some hiccups near the viewport edges to save on repaints - startStyle.top = previousFrameTop.startStyle.top; - endStyle.top = previousFrameTop.endStyle.top; - } - if (i + 1 < len) { - // Look below - const nextLeft = linesVisibleRanges[i + 1].ranges[0].left; - const nextRight = linesVisibleRanges[i + 1].ranges[0].left + linesVisibleRanges[i + 1].ranges[0].width; - if (abs(curLeft - nextLeft) < epsilon) { - startStyle.bottom = 2 /* FLAT */; - } - else if (nextLeft < curLeft && curLeft < nextRight) { - startStyle.bottom = 1 /* INTERN */; - } - if (abs(curRight - nextRight) < epsilon) { - endStyle.bottom = 2 /* FLAT */; - } - else if (curRight < nextRight) { - endStyle.bottom = 1 /* INTERN */; - } - } - else if (previousFrameBottom) { - // Accept some hiccups near the viewport edges to save on repaints - startStyle.bottom = previousFrameBottom.startStyle.bottom; - endStyle.bottom = previousFrameBottom.endStyle.bottom; - } - curLineRange.startStyle = startStyle; - curLineRange.endStyle = endStyle; - } - } - _getVisibleRangesWithStyle(selection, ctx, previousFrame) { - const _linesVisibleRanges = ctx.linesVisibleRangesForRange(selection, true) || []; - const linesVisibleRanges = _linesVisibleRanges.map(toStyled); - const visibleRangesHaveGaps = this._visibleRangesHaveGaps(linesVisibleRanges); - if (!isIEWithZoomingIssuesNearRoundedBorders && !visibleRangesHaveGaps && this._roundedSelection) { - this._enrichVisibleRangesWithStyle(ctx.visibleRange, linesVisibleRanges, previousFrame); - } - // The visible ranges are sorted TOP-BOTTOM and LEFT-RIGHT - return linesVisibleRanges; - } - _createSelectionPiece(top, height, className, left, width) { - return ('
    '); - } - _actualRenderOneSelection(output2, visibleStartLineNumber, hasMultipleSelections, visibleRanges) { - if (visibleRanges.length === 0) { - return; - } - const visibleRangesHaveStyle = !!visibleRanges[0].ranges[0].startStyle; - const fullLineHeight = (this._lineHeight).toString(); - const reducedLineHeight = (this._lineHeight - 1).toString(); - const firstLineNumber = visibleRanges[0].lineNumber; - const lastLineNumber = visibleRanges[visibleRanges.length - 1].lineNumber; - for (let i = 0, len = visibleRanges.length; i < len; i++) { - const lineVisibleRanges = visibleRanges[i]; - const lineNumber = lineVisibleRanges.lineNumber; - const lineIndex = lineNumber - visibleStartLineNumber; - const lineHeight = hasMultipleSelections ? (lineNumber === lastLineNumber || lineNumber === firstLineNumber ? reducedLineHeight : fullLineHeight) : fullLineHeight; - const top = hasMultipleSelections ? (lineNumber === firstLineNumber ? 1 : 0) : 0; - let innerCornerOutput = ''; - let restOfSelectionOutput = ''; - for (let j = 0, lenJ = lineVisibleRanges.ranges.length; j < lenJ; j++) { - const visibleRange = lineVisibleRanges.ranges[j]; - if (visibleRangesHaveStyle) { - const startStyle = visibleRange.startStyle; - const endStyle = visibleRange.endStyle; - if (startStyle.top === 1 /* INTERN */ || startStyle.bottom === 1 /* INTERN */) { - // Reverse rounded corner to the left - // First comes the selection (blue layer) - innerCornerOutput += this._createSelectionPiece(top, lineHeight, SelectionsOverlay.SELECTION_CLASS_NAME, visibleRange.left - SelectionsOverlay.ROUNDED_PIECE_WIDTH, SelectionsOverlay.ROUNDED_PIECE_WIDTH); - // Second comes the background (white layer) with inverse border radius - let className = SelectionsOverlay.EDITOR_BACKGROUND_CLASS_NAME; - if (startStyle.top === 1 /* INTERN */) { - className += ' ' + SelectionsOverlay.SELECTION_TOP_RIGHT; - } - if (startStyle.bottom === 1 /* INTERN */) { - className += ' ' + SelectionsOverlay.SELECTION_BOTTOM_RIGHT; - } - innerCornerOutput += this._createSelectionPiece(top, lineHeight, className, visibleRange.left - SelectionsOverlay.ROUNDED_PIECE_WIDTH, SelectionsOverlay.ROUNDED_PIECE_WIDTH); - } - if (endStyle.top === 1 /* INTERN */ || endStyle.bottom === 1 /* INTERN */) { - // Reverse rounded corner to the right - // First comes the selection (blue layer) - innerCornerOutput += this._createSelectionPiece(top, lineHeight, SelectionsOverlay.SELECTION_CLASS_NAME, visibleRange.left + visibleRange.width, SelectionsOverlay.ROUNDED_PIECE_WIDTH); - // Second comes the background (white layer) with inverse border radius - let className = SelectionsOverlay.EDITOR_BACKGROUND_CLASS_NAME; - if (endStyle.top === 1 /* INTERN */) { - className += ' ' + SelectionsOverlay.SELECTION_TOP_LEFT; - } - if (endStyle.bottom === 1 /* INTERN */) { - className += ' ' + SelectionsOverlay.SELECTION_BOTTOM_LEFT; - } - innerCornerOutput += this._createSelectionPiece(top, lineHeight, className, visibleRange.left + visibleRange.width, SelectionsOverlay.ROUNDED_PIECE_WIDTH); - } - } - let className = SelectionsOverlay.SELECTION_CLASS_NAME; - if (visibleRangesHaveStyle) { - const startStyle = visibleRange.startStyle; - const endStyle = visibleRange.endStyle; - if (startStyle.top === 0 /* EXTERN */) { - className += ' ' + SelectionsOverlay.SELECTION_TOP_LEFT; - } - if (startStyle.bottom === 0 /* EXTERN */) { - className += ' ' + SelectionsOverlay.SELECTION_BOTTOM_LEFT; - } - if (endStyle.top === 0 /* EXTERN */) { - className += ' ' + SelectionsOverlay.SELECTION_TOP_RIGHT; - } - if (endStyle.bottom === 0 /* EXTERN */) { - className += ' ' + SelectionsOverlay.SELECTION_BOTTOM_RIGHT; - } - } - restOfSelectionOutput += this._createSelectionPiece(top, lineHeight, className, visibleRange.left, visibleRange.width); - } - output2[lineIndex][0] += innerCornerOutput; - output2[lineIndex][1] += restOfSelectionOutput; - } - } - prepareRender(ctx) { - // Build HTML for inner corners separate from HTML for the rest of selections, - // as the inner corner HTML can interfere with that of other selections. - // In final render, make sure to place the inner corner HTML before the rest of selection HTML. See issue #77777. - const output = []; - const visibleStartLineNumber = ctx.visibleRange.startLineNumber; - const visibleEndLineNumber = ctx.visibleRange.endLineNumber; - for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) { - const lineIndex = lineNumber - visibleStartLineNumber; - output[lineIndex] = ['', '']; - } - const thisFrameVisibleRangesWithStyle = []; - for (let i = 0, len = this._selections.length; i < len; i++) { - const selection = this._selections[i]; - if (selection.isEmpty()) { - thisFrameVisibleRangesWithStyle[i] = null; - continue; - } - const visibleRangesWithStyle = this._getVisibleRangesWithStyle(selection, ctx, this._previousFrameVisibleRangesWithStyle[i]); - thisFrameVisibleRangesWithStyle[i] = visibleRangesWithStyle; - this._actualRenderOneSelection(output, visibleStartLineNumber, this._selections.length > 1, visibleRangesWithStyle); - } - this._previousFrameVisibleRangesWithStyle = thisFrameVisibleRangesWithStyle; - this._renderResult = output.map(([internalCorners, restOfSelection]) => internalCorners + restOfSelection); - } - render(startLineNumber, lineNumber) { - if (!this._renderResult) { - return ''; - } - const lineIndex = lineNumber - startLineNumber; - if (lineIndex < 0 || lineIndex >= this._renderResult.length) { - return ''; - } - return this._renderResult[lineIndex]; - } -} -SelectionsOverlay.SELECTION_CLASS_NAME = 'selected-text'; -SelectionsOverlay.SELECTION_TOP_LEFT = 'top-left-radius'; -SelectionsOverlay.SELECTION_BOTTOM_LEFT = 'bottom-left-radius'; -SelectionsOverlay.SELECTION_TOP_RIGHT = 'top-right-radius'; -SelectionsOverlay.SELECTION_BOTTOM_RIGHT = 'bottom-right-radius'; -SelectionsOverlay.EDITOR_BACKGROUND_CLASS_NAME = 'monaco-editor-background'; -SelectionsOverlay.ROUNDED_PIECE_WIDTH = 10; -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__["registerThemingParticipant"])((theme, collector) => { - const editorSelectionColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["editorSelectionBackground"]); - if (editorSelectionColor) { - collector.addRule(`.monaco-editor .focused .selected-text { background-color: ${editorSelectionColor}; }`); - } - const editorInactiveSelectionColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["editorInactiveSelection"]); - if (editorInactiveSelectionColor) { - collector.addRule(`.monaco-editor .selected-text { background-color: ${editorInactiveSelectionColor}; }`); - } - const editorSelectionForegroundColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["editorSelectionForeground"]); - if (editorSelectionForegroundColor && !editorSelectionForegroundColor.isTransparent()) { - collector.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${editorSelectionForegroundColor}; }`); - } -}); -function abs(n) { - return n < 0 ? -n : n; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js ***! - \**********************************************************************************************/ -/*! exports provided: ViewCursor */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewCursor", function() { return ViewCursor; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _config_configuration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../config/configuration.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/config/configuration.js"); -/* harmony import */ var _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_browser_ui_mouseCursor_mouseCursor_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../base/browser/ui/mouseCursor/mouseCursor.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - -class ViewCursorRenderData { - constructor(top, left, width, height, textContent, textContentClassName) { - this.top = top; - this.left = left; - this.width = width; - this.height = height; - this.textContent = textContent; - this.textContentClassName = textContentClassName; - } -} -class ViewCursor { - constructor(context) { - this._context = context; - const options = this._context.configuration.options; - const fontInfo = options.get(36 /* fontInfo */); - this._cursorStyle = options.get(19 /* cursorStyle */); - this._lineHeight = options.get(51 /* lineHeight */); - this._typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth; - this._lineCursorWidth = Math.min(options.get(22 /* cursorWidth */), this._typicalHalfwidthCharacterWidth); - this._isVisible = true; - // Create the dom node - this._domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(document.createElement('div')); - this._domNode.setClassName(`cursor ${_base_browser_ui_mouseCursor_mouseCursor_js__WEBPACK_IMPORTED_MODULE_7__["MOUSE_CURSOR_TEXT_CSS_CLASS_NAME"]}`); - this._domNode.setHeight(this._lineHeight); - this._domNode.setTop(0); - this._domNode.setLeft(0); - _config_configuration_js__WEBPACK_IMPORTED_MODULE_3__["Configuration"].applyFontInfo(this._domNode, fontInfo); - this._domNode.setDisplay('none'); - this._position = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"](1, 1); - this._lastRenderedContent = ''; - this._renderData = null; - } - getDomNode() { - return this._domNode; - } - getPosition() { - return this._position; - } - show() { - if (!this._isVisible) { - this._domNode.setVisibility('inherit'); - this._isVisible = true; - } - } - hide() { - if (this._isVisible) { - this._domNode.setVisibility('hidden'); - this._isVisible = false; - } - } - onConfigurationChanged(e) { - const options = this._context.configuration.options; - const fontInfo = options.get(36 /* fontInfo */); - this._cursorStyle = options.get(19 /* cursorStyle */); - this._lineHeight = options.get(51 /* lineHeight */); - this._typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth; - this._lineCursorWidth = Math.min(options.get(22 /* cursorWidth */), this._typicalHalfwidthCharacterWidth); - _config_configuration_js__WEBPACK_IMPORTED_MODULE_3__["Configuration"].applyFontInfo(this._domNode, fontInfo); - return true; - } - onCursorPositionChanged(position) { - this._position = position; - return true; - } - _prepareRender(ctx) { - let textContent = ''; - if (this._cursorStyle === _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["TextEditorCursorStyle"].Line || this._cursorStyle === _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["TextEditorCursorStyle"].LineThin) { - const visibleRange = ctx.visibleRangeForPosition(this._position); - if (!visibleRange || visibleRange.outsideRenderedLine) { - // Outside viewport - return null; - } - let width; - if (this._cursorStyle === _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["TextEditorCursorStyle"].Line) { - width = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["computeScreenAwareSize"](this._lineCursorWidth > 0 ? this._lineCursorWidth : 2); - if (width > 2) { - const lineContent = this._context.model.getLineContent(this._position.lineNumber); - const nextCharLength = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["nextCharLength"](lineContent, this._position.column - 1); - textContent = lineContent.substr(this._position.column - 1, nextCharLength); - } - } - else { - width = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["computeScreenAwareSize"](1); - } - let left = visibleRange.left; - if (width >= 2 && left >= 1) { - // try to center cursor - left -= 1; - } - const top = ctx.getVerticalOffsetForLineNumber(this._position.lineNumber) - ctx.bigNumbersDelta; - return new ViewCursorRenderData(top, left, width, this._lineHeight, textContent, ''); - } - const lineContent = this._context.model.getLineContent(this._position.lineNumber); - const nextCharLength = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["nextCharLength"](lineContent, this._position.column - 1); - const visibleRangeForCharacter = ctx.linesVisibleRangesForRange(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](this._position.lineNumber, this._position.column, this._position.lineNumber, this._position.column + nextCharLength), false); - if (!visibleRangeForCharacter || visibleRangeForCharacter.length === 0) { - // Outside viewport - return null; - } - const firstVisibleRangeForCharacter = visibleRangeForCharacter[0]; - if (firstVisibleRangeForCharacter.outsideRenderedLine || firstVisibleRangeForCharacter.ranges.length === 0) { - // Outside viewport - return null; - } - const range = firstVisibleRangeForCharacter.ranges[0]; - const width = range.width < 1 ? this._typicalHalfwidthCharacterWidth : range.width; - let textContentClassName = ''; - if (this._cursorStyle === _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["TextEditorCursorStyle"].Block) { - const lineData = this._context.model.getViewLineData(this._position.lineNumber); - textContent = lineContent.substr(this._position.column - 1, nextCharLength); - const tokenIndex = lineData.tokens.findTokenIndexAtOffset(this._position.column - 1); - textContentClassName = lineData.tokens.getClassName(tokenIndex); - } - let top = ctx.getVerticalOffsetForLineNumber(this._position.lineNumber) - ctx.bigNumbersDelta; - let height = this._lineHeight; - // Underline might interfere with clicking - if (this._cursorStyle === _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["TextEditorCursorStyle"].Underline || this._cursorStyle === _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["TextEditorCursorStyle"].UnderlineThin) { - top += this._lineHeight - 2; - height = 2; - } - return new ViewCursorRenderData(top, range.left, width, height, textContent, textContentClassName); - } - prepareRender(ctx) { - this._renderData = this._prepareRender(ctx); - } - render(ctx) { - if (!this._renderData) { - this._domNode.setDisplay('none'); - return null; - } - if (this._lastRenderedContent !== this._renderData.textContent) { - this._lastRenderedContent = this._renderData.textContent; - this._domNode.domNode.textContent = this._lastRenderedContent; - } - this._domNode.setClassName(`cursor ${_base_browser_ui_mouseCursor_mouseCursor_js__WEBPACK_IMPORTED_MODULE_7__["MOUSE_CURSOR_TEXT_CSS_CLASS_NAME"]} ${this._renderData.textContentClassName}`); - this._domNode.setDisplay('block'); - this._domNode.setTop(this._renderData.top); - this._domNode.setLeft(this._renderData.left); - this._domNode.setWidth(this._renderData.width); - this._domNode.setLineHeight(this._renderData.height); - this._domNode.setHeight(this._renderData.height); - return { - domNode: this._domNode.domNode, - position: this._position, - contentLeft: this._renderData.left, - height: this._renderData.height, - width: 2 - }; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.css": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.css ***! - \************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_viewCursors_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./viewCursors.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.css"); -/* harmony import */ var _css_loader_dist_cjs_js_viewCursors_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_viewCursors_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_viewCursors_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_viewCursors_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js ***! - \***********************************************************************************************/ -/*! exports provided: ViewCursors */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewCursors", function() { return ViewCursors; }); -/* harmony import */ var _viewCursors_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./viewCursors.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.css"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _view_viewPart_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../view/viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/* harmony import */ var _viewCursor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./viewCursor.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js"); -/* harmony import */ var _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - -class ViewCursors extends _view_viewPart_js__WEBPACK_IMPORTED_MODULE_3__["ViewPart"] { - constructor(context) { - super(context); - const options = this._context.configuration.options; - this._readOnly = options.get(72 /* readOnly */); - this._cursorBlinking = options.get(17 /* cursorBlinking */); - this._cursorStyle = options.get(19 /* cursorStyle */); - this._cursorSmoothCaretAnimation = options.get(18 /* cursorSmoothCaretAnimation */); - this._selectionIsEmpty = true; - this._isVisible = false; - this._primaryCursor = new _viewCursor_js__WEBPACK_IMPORTED_MODULE_4__["ViewCursor"](this._context); - this._secondaryCursors = []; - this._renderData = []; - this._domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_1__["createFastDomNode"])(document.createElement('div')); - this._domNode.setAttribute('role', 'presentation'); - this._domNode.setAttribute('aria-hidden', 'true'); - this._updateDomClassName(); - this._domNode.appendChild(this._primaryCursor.getDomNode()); - this._startCursorBlinkAnimation = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["TimeoutTimer"](); - this._cursorFlatBlinkInterval = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["IntervalTimer"](); - this._blinkingEnabled = false; - this._editorHasFocus = false; - this._updateBlinking(); - } - dispose() { - super.dispose(); - this._startCursorBlinkAnimation.dispose(); - this._cursorFlatBlinkInterval.dispose(); - } - getDomNode() { - return this._domNode; - } - // --- begin event handlers - onConfigurationChanged(e) { - const options = this._context.configuration.options; - this._readOnly = options.get(72 /* readOnly */); - this._cursorBlinking = options.get(17 /* cursorBlinking */); - this._cursorStyle = options.get(19 /* cursorStyle */); - this._cursorSmoothCaretAnimation = options.get(18 /* cursorSmoothCaretAnimation */); - this._updateBlinking(); - this._updateDomClassName(); - this._primaryCursor.onConfigurationChanged(e); - for (let i = 0, len = this._secondaryCursors.length; i < len; i++) { - this._secondaryCursors[i].onConfigurationChanged(e); - } - return true; - } - _onCursorPositionChanged(position, secondaryPositions) { - this._primaryCursor.onCursorPositionChanged(position); - this._updateBlinking(); - if (this._secondaryCursors.length < secondaryPositions.length) { - // Create new cursors - const addCnt = secondaryPositions.length - this._secondaryCursors.length; - for (let i = 0; i < addCnt; i++) { - const newCursor = new _viewCursor_js__WEBPACK_IMPORTED_MODULE_4__["ViewCursor"](this._context); - this._domNode.domNode.insertBefore(newCursor.getDomNode().domNode, this._primaryCursor.getDomNode().domNode.nextSibling); - this._secondaryCursors.push(newCursor); - } - } - else if (this._secondaryCursors.length > secondaryPositions.length) { - // Remove some cursors - const removeCnt = this._secondaryCursors.length - secondaryPositions.length; - for (let i = 0; i < removeCnt; i++) { - this._domNode.removeChild(this._secondaryCursors[0].getDomNode()); - this._secondaryCursors.splice(0, 1); - } - } - for (let i = 0; i < secondaryPositions.length; i++) { - this._secondaryCursors[i].onCursorPositionChanged(secondaryPositions[i]); - } - } - onCursorStateChanged(e) { - const positions = []; - for (let i = 0, len = e.selections.length; i < len; i++) { - positions[i] = e.selections[i].getPosition(); - } - this._onCursorPositionChanged(positions[0], positions.slice(1)); - const selectionIsEmpty = e.selections[0].isEmpty(); - if (this._selectionIsEmpty !== selectionIsEmpty) { - this._selectionIsEmpty = selectionIsEmpty; - this._updateDomClassName(); - } - return true; - } - onDecorationsChanged(e) { - // true for inline decorations that can end up relayouting text - return true; - } - onFlushed(e) { - return true; - } - onFocusChanged(e) { - this._editorHasFocus = e.isFocused; - this._updateBlinking(); - return false; - } - onLinesChanged(e) { - return true; - } - onLinesDeleted(e) { - return true; - } - onLinesInserted(e) { - return true; - } - onScrollChanged(e) { - return true; - } - onTokensChanged(e) { - const shouldRender = (position) => { - for (let i = 0, len = e.ranges.length; i < len; i++) { - if (e.ranges[i].fromLineNumber <= position.lineNumber && position.lineNumber <= e.ranges[i].toLineNumber) { - return true; - } - } - return false; - }; - if (shouldRender(this._primaryCursor.getPosition())) { - return true; - } - for (const secondaryCursor of this._secondaryCursors) { - if (shouldRender(secondaryCursor.getPosition())) { - return true; - } - } - return false; - } - onZonesChanged(e) { - return true; - } - // --- end event handlers - // ---- blinking logic - _getCursorBlinking() { - if (!this._editorHasFocus) { - return 0 /* Hidden */; - } - if (this._readOnly) { - return 5 /* Solid */; - } - return this._cursorBlinking; - } - _updateBlinking() { - this._startCursorBlinkAnimation.cancel(); - this._cursorFlatBlinkInterval.cancel(); - const blinkingStyle = this._getCursorBlinking(); - // hidden and solid are special as they involve no animations - const isHidden = (blinkingStyle === 0 /* Hidden */); - const isSolid = (blinkingStyle === 5 /* Solid */); - if (isHidden) { - this._hide(); - } - else { - this._show(); - } - this._blinkingEnabled = false; - this._updateDomClassName(); - if (!isHidden && !isSolid) { - if (blinkingStyle === 1 /* Blink */) { - // flat blinking is handled by JavaScript to save battery life due to Chromium step timing issue https://bugs.chromium.org/p/chromium/issues/detail?id=361587 - this._cursorFlatBlinkInterval.cancelAndSet(() => { - if (this._isVisible) { - this._hide(); - } - else { - this._show(); - } - }, ViewCursors.BLINK_INTERVAL); - } - else { - this._startCursorBlinkAnimation.setIfNotSet(() => { - this._blinkingEnabled = true; - this._updateDomClassName(); - }, ViewCursors.BLINK_INTERVAL); - } - } - } - // --- end blinking logic - _updateDomClassName() { - this._domNode.setClassName(this._getClassName()); - } - _getClassName() { - let result = 'cursors-layer'; - if (!this._selectionIsEmpty) { - result += ' has-selection'; - } - switch (this._cursorStyle) { - case _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["TextEditorCursorStyle"].Line: - result += ' cursor-line-style'; - break; - case _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["TextEditorCursorStyle"].Block: - result += ' cursor-block-style'; - break; - case _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["TextEditorCursorStyle"].Underline: - result += ' cursor-underline-style'; - break; - case _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["TextEditorCursorStyle"].LineThin: - result += ' cursor-line-thin-style'; - break; - case _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["TextEditorCursorStyle"].BlockOutline: - result += ' cursor-block-outline-style'; - break; - case _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["TextEditorCursorStyle"].UnderlineThin: - result += ' cursor-underline-thin-style'; - break; - default: - result += ' cursor-line-style'; - } - if (this._blinkingEnabled) { - switch (this._getCursorBlinking()) { - case 1 /* Blink */: - result += ' cursor-blink'; - break; - case 2 /* Smooth */: - result += ' cursor-smooth'; - break; - case 3 /* Phase */: - result += ' cursor-phase'; - break; - case 4 /* Expand */: - result += ' cursor-expand'; - break; - case 5 /* Solid */: - result += ' cursor-solid'; - break; - default: - result += ' cursor-solid'; - } - } - else { - result += ' cursor-solid'; - } - if (this._cursorSmoothCaretAnimation) { - result += ' cursor-smooth-caret-animation'; - } - return result; - } - _show() { - this._primaryCursor.show(); - for (let i = 0, len = this._secondaryCursors.length; i < len; i++) { - this._secondaryCursors[i].show(); - } - this._isVisible = true; - } - _hide() { - this._primaryCursor.hide(); - for (let i = 0, len = this._secondaryCursors.length; i < len; i++) { - this._secondaryCursors[i].hide(); - } - this._isVisible = false; - } - // ---- IViewPart implementation - prepareRender(ctx) { - this._primaryCursor.prepareRender(ctx); - for (let i = 0, len = this._secondaryCursors.length; i < len; i++) { - this._secondaryCursors[i].prepareRender(ctx); - } - } - render(ctx) { - let renderData = [], renderDataLen = 0; - const primaryRenderData = this._primaryCursor.render(ctx); - if (primaryRenderData) { - renderData[renderDataLen++] = primaryRenderData; - } - for (let i = 0, len = this._secondaryCursors.length; i < len; i++) { - const secondaryRenderData = this._secondaryCursors[i].render(ctx); - if (secondaryRenderData) { - renderData[renderDataLen++] = secondaryRenderData; - } - } - this._renderData = renderData; - } - getLastRenderData() { - return this._renderData; - } -} -ViewCursors.BLINK_INTERVAL = 500; -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__["registerThemingParticipant"])((theme, collector) => { - const caret = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["editorCursorForeground"]); - if (caret) { - let caretBackground = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["editorCursorBackground"]); - if (!caretBackground) { - caretBackground = caret.opposite(); - } - collector.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${caret}; border-color: ${caret}; color: ${caretBackground}; }`); - if (theme.type === 'hc') { - collector.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${caretBackground}; border-right: 1px solid ${caretBackground}; }`); - } - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewZones/viewZones.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/viewParts/viewZones/viewZones.js ***! - \*******************************************************************************************/ -/*! exports provided: ViewZones */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewZones", function() { return ViewZones; }); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../view/viewPart.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewPart.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -const invalidFunc = () => { throw new Error(`Invalid change accessor`); }; -class ViewZones extends _view_viewPart_js__WEBPACK_IMPORTED_MODULE_2__["ViewPart"] { - constructor(context) { - super(context); - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._lineHeight = options.get(51 /* lineHeight */); - this._contentWidth = layoutInfo.contentWidth; - this._contentLeft = layoutInfo.contentLeft; - this.domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__["createFastDomNode"])(document.createElement('div')); - this.domNode.setClassName('view-zones'); - this.domNode.setPosition('absolute'); - this.domNode.setAttribute('role', 'presentation'); - this.domNode.setAttribute('aria-hidden', 'true'); - this.marginDomNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__["createFastDomNode"])(document.createElement('div')); - this.marginDomNode.setClassName('margin-view-zones'); - this.marginDomNode.setPosition('absolute'); - this.marginDomNode.setAttribute('role', 'presentation'); - this.marginDomNode.setAttribute('aria-hidden', 'true'); - this._zones = {}; - } - dispose() { - super.dispose(); - this._zones = {}; - } - // ---- begin view event handlers - _recomputeWhitespacesProps() { - const whitespaces = this._context.viewLayout.getWhitespaces(); - const oldWhitespaces = new Map(); - for (const whitespace of whitespaces) { - oldWhitespaces.set(whitespace.id, whitespace); - } - let hadAChange = false; - this._context.model.changeWhitespace((whitespaceAccessor) => { - const keys = Object.keys(this._zones); - for (let i = 0, len = keys.length; i < len; i++) { - const id = keys[i]; - const zone = this._zones[id]; - const props = this._computeWhitespaceProps(zone.delegate); - const oldWhitespace = oldWhitespaces.get(id); - if (oldWhitespace && (oldWhitespace.afterLineNumber !== props.afterViewLineNumber || oldWhitespace.height !== props.heightInPx)) { - whitespaceAccessor.changeOneWhitespace(id, props.afterViewLineNumber, props.heightInPx); - this._safeCallOnComputedHeight(zone.delegate, props.heightInPx); - hadAChange = true; - } - } - }); - return hadAChange; - } - onConfigurationChanged(e) { - const options = this._context.configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this._lineHeight = options.get(51 /* lineHeight */); - this._contentWidth = layoutInfo.contentWidth; - this._contentLeft = layoutInfo.contentLeft; - if (e.hasChanged(51 /* lineHeight */)) { - this._recomputeWhitespacesProps(); - } - return true; - } - onLineMappingChanged(e) { - return this._recomputeWhitespacesProps(); - } - onLinesDeleted(e) { - return true; - } - onScrollChanged(e) { - return e.scrollTopChanged || e.scrollWidthChanged; - } - onZonesChanged(e) { - return true; - } - onLinesInserted(e) { - return true; - } - // ---- end view event handlers - _getZoneOrdinal(zone) { - if (typeof zone.afterColumn !== 'undefined') { - return zone.afterColumn; - } - return 10000; - } - _computeWhitespaceProps(zone) { - if (zone.afterLineNumber === 0) { - return { - afterViewLineNumber: 0, - heightInPx: this._heightInPixels(zone), - minWidthInPx: this._minWidthInPixels(zone) - }; - } - let zoneAfterModelPosition; - if (typeof zone.afterColumn !== 'undefined') { - zoneAfterModelPosition = this._context.model.validateModelPosition({ - lineNumber: zone.afterLineNumber, - column: zone.afterColumn - }); - } - else { - const validAfterLineNumber = this._context.model.validateModelPosition({ - lineNumber: zone.afterLineNumber, - column: 1 - }).lineNumber; - zoneAfterModelPosition = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](validAfterLineNumber, this._context.model.getModelLineMaxColumn(validAfterLineNumber)); - } - let zoneBeforeModelPosition; - if (zoneAfterModelPosition.column === this._context.model.getModelLineMaxColumn(zoneAfterModelPosition.lineNumber)) { - zoneBeforeModelPosition = this._context.model.validateModelPosition({ - lineNumber: zoneAfterModelPosition.lineNumber + 1, - column: 1 - }); - } - else { - zoneBeforeModelPosition = this._context.model.validateModelPosition({ - lineNumber: zoneAfterModelPosition.lineNumber, - column: zoneAfterModelPosition.column + 1 - }); - } - const viewPosition = this._context.model.coordinatesConverter.convertModelPositionToViewPosition(zoneAfterModelPosition); - const isVisible = this._context.model.coordinatesConverter.modelPositionIsVisible(zoneBeforeModelPosition); - return { - afterViewLineNumber: viewPosition.lineNumber, - heightInPx: (isVisible ? this._heightInPixels(zone) : 0), - minWidthInPx: this._minWidthInPixels(zone) - }; - } - changeViewZones(callback) { - let zonesHaveChanged = false; - this._context.model.changeWhitespace((whitespaceAccessor) => { - const changeAccessor = { - addZone: (zone) => { - zonesHaveChanged = true; - return this._addZone(whitespaceAccessor, zone); - }, - removeZone: (id) => { - if (!id) { - return; - } - zonesHaveChanged = this._removeZone(whitespaceAccessor, id) || zonesHaveChanged; - }, - layoutZone: (id) => { - if (!id) { - return; - } - zonesHaveChanged = this._layoutZone(whitespaceAccessor, id) || zonesHaveChanged; - } - }; - safeInvoke1Arg(callback, changeAccessor); - // Invalidate changeAccessor - changeAccessor.addZone = invalidFunc; - changeAccessor.removeZone = invalidFunc; - changeAccessor.layoutZone = invalidFunc; - }); - return zonesHaveChanged; - } - _addZone(whitespaceAccessor, zone) { - const props = this._computeWhitespaceProps(zone); - const whitespaceId = whitespaceAccessor.insertWhitespace(props.afterViewLineNumber, this._getZoneOrdinal(zone), props.heightInPx, props.minWidthInPx); - const myZone = { - whitespaceId: whitespaceId, - delegate: zone, - isVisible: false, - domNode: Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__["createFastDomNode"])(zone.domNode), - marginDomNode: zone.marginDomNode ? Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_0__["createFastDomNode"])(zone.marginDomNode) : null - }; - this._safeCallOnComputedHeight(myZone.delegate, props.heightInPx); - myZone.domNode.setPosition('absolute'); - myZone.domNode.domNode.style.width = '100%'; - myZone.domNode.setDisplay('none'); - myZone.domNode.setAttribute('monaco-view-zone', myZone.whitespaceId); - this.domNode.appendChild(myZone.domNode); - if (myZone.marginDomNode) { - myZone.marginDomNode.setPosition('absolute'); - myZone.marginDomNode.domNode.style.width = '100%'; - myZone.marginDomNode.setDisplay('none'); - myZone.marginDomNode.setAttribute('monaco-view-zone', myZone.whitespaceId); - this.marginDomNode.appendChild(myZone.marginDomNode); - } - this._zones[myZone.whitespaceId] = myZone; - this.setShouldRender(); - return myZone.whitespaceId; - } - _removeZone(whitespaceAccessor, id) { - if (this._zones.hasOwnProperty(id)) { - const zone = this._zones[id]; - delete this._zones[id]; - whitespaceAccessor.removeWhitespace(zone.whitespaceId); - zone.domNode.removeAttribute('monaco-visible-view-zone'); - zone.domNode.removeAttribute('monaco-view-zone'); - zone.domNode.domNode.parentNode.removeChild(zone.domNode.domNode); - if (zone.marginDomNode) { - zone.marginDomNode.removeAttribute('monaco-visible-view-zone'); - zone.marginDomNode.removeAttribute('monaco-view-zone'); - zone.marginDomNode.domNode.parentNode.removeChild(zone.marginDomNode.domNode); - } - this.setShouldRender(); - return true; - } - return false; - } - _layoutZone(whitespaceAccessor, id) { - if (this._zones.hasOwnProperty(id)) { - const zone = this._zones[id]; - const props = this._computeWhitespaceProps(zone.delegate); - // const newOrdinal = this._getZoneOrdinal(zone.delegate); - whitespaceAccessor.changeOneWhitespace(zone.whitespaceId, props.afterViewLineNumber, props.heightInPx); - // TODO@Alex: change `newOrdinal` too - this._safeCallOnComputedHeight(zone.delegate, props.heightInPx); - this.setShouldRender(); - return true; - } - return false; - } - shouldSuppressMouseDownOnViewZone(id) { - if (this._zones.hasOwnProperty(id)) { - const zone = this._zones[id]; - return Boolean(zone.delegate.suppressMouseDown); - } - return false; - } - _heightInPixels(zone) { - if (typeof zone.heightInPx === 'number') { - return zone.heightInPx; - } - if (typeof zone.heightInLines === 'number') { - return this._lineHeight * zone.heightInLines; - } - return this._lineHeight; - } - _minWidthInPixels(zone) { - if (typeof zone.minWidthInPx === 'number') { - return zone.minWidthInPx; - } - return 0; - } - _safeCallOnComputedHeight(zone, height) { - if (typeof zone.onComputedHeight === 'function') { - try { - zone.onComputedHeight(height); - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"])(e); - } - } - } - _safeCallOnDomNodeTop(zone, top) { - if (typeof zone.onDomNodeTop === 'function') { - try { - zone.onDomNodeTop(top); - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"])(e); - } - } - } - prepareRender(ctx) { - // Nothing to read - } - render(ctx) { - const visibleWhitespaces = ctx.viewportData.whitespaceViewportData; - const visibleZones = {}; - let hasVisibleZone = false; - for (let i = 0, len = visibleWhitespaces.length; i < len; i++) { - visibleZones[visibleWhitespaces[i].id] = visibleWhitespaces[i]; - hasVisibleZone = true; - } - const keys = Object.keys(this._zones); - for (let i = 0, len = keys.length; i < len; i++) { - const id = keys[i]; - const zone = this._zones[id]; - let newTop = 0; - let newHeight = 0; - let newDisplay = 'none'; - if (visibleZones.hasOwnProperty(id)) { - newTop = visibleZones[id].verticalOffset - ctx.bigNumbersDelta; - newHeight = visibleZones[id].height; - newDisplay = 'block'; - // zone is visible - if (!zone.isVisible) { - zone.domNode.setAttribute('monaco-visible-view-zone', 'true'); - zone.isVisible = true; - } - this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(visibleZones[id].verticalOffset)); - } - else { - if (zone.isVisible) { - zone.domNode.removeAttribute('monaco-visible-view-zone'); - zone.isVisible = false; - } - this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(-1000000)); - } - zone.domNode.setTop(newTop); - zone.domNode.setHeight(newHeight); - zone.domNode.setDisplay(newDisplay); - if (zone.marginDomNode) { - zone.marginDomNode.setTop(newTop); - zone.marginDomNode.setHeight(newHeight); - zone.marginDomNode.setDisplay(newDisplay); - } - } - if (hasVisibleZone) { - this.domNode.setWidth(Math.max(ctx.scrollWidth, this._contentWidth)); - this.marginDomNode.setWidth(this._contentLeft); - } - } -} -function safeInvoke1Arg(func, arg1) { - try { - return func(arg1); - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"])(e); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js ***! - \*************************************************************************************/ -/*! exports provided: CodeEditorWidget, BooleanEventEmitter, EditorModeContext */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditorWidget", function() { return CodeEditorWidget; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BooleanEventEmitter", function() { return BooleanEventEmitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorModeContext", function() { return EditorModeContext; }); -/* harmony import */ var _media_editor_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/editor.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/media/editor.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_network_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _config_configuration_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../config/configuration.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/config/configuration.js"); -/* harmony import */ var _editorExtensions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _view_viewImpl_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../view/viewImpl.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewImpl.js"); -/* harmony import */ var _view_viewUserInputEvents_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../view/viewUserInputEvents.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/viewUserInputEvents.js"); -/* harmony import */ var _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../common/config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _common_controller_cursor_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../common/controller/cursor.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursor.js"); -/* harmony import */ var _common_controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../common/controller/cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_editorAction_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../common/editorAction.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorAction.js"); -/* harmony import */ var _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../common/editorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorCommon.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../common/view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _common_viewModel_viewModelImpl_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../common/viewModel/viewModelImpl.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelImpl.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_instantiation_common_serviceCollection_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../../platform/instantiation/common/serviceCollection.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../../platform/accessibility/common/accessibility.js */ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _common_viewModel_monospaceLineBreaksComputer_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../common/viewModel/monospaceLineBreaksComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js"); -/* harmony import */ var _view_domLineBreaksComputer_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../view/domLineBreaksComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/view/domLineBreaksComputer.js"); -/* harmony import */ var _common_controller_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../common/controller/cursorWordOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorWordOperations.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -let EDITOR_ID = 0; -class ModelData { - constructor(model, viewModel, view, hasRealView, listenersToRemove) { - this.model = model; - this.viewModel = viewModel; - this.view = view; - this.hasRealView = hasRealView; - this.listenersToRemove = listenersToRemove; - } - dispose() { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["dispose"])(this.listenersToRemove); - this.model.onBeforeDetached(); - if (this.hasRealView) { - this.view.dispose(); - } - this.viewModel.dispose(); - } -} -let CodeEditorWidget = class CodeEditorWidget extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["Disposable"] { - constructor(domElement, options, codeEditorWidgetOptions, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService) { - super(); - //#region Eventing - this._onDidDispose = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidDispose = this._onDidDispose.event; - this._onDidChangeModelContent = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidChangeModelContent = this._onDidChangeModelContent.event; - this._onDidChangeModelLanguage = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidChangeModelLanguage = this._onDidChangeModelLanguage.event; - this._onDidChangeModelLanguageConfiguration = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidChangeModelLanguageConfiguration = this._onDidChangeModelLanguageConfiguration.event; - this._onDidChangeModelOptions = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidChangeModelOptions = this._onDidChangeModelOptions.event; - this._onDidChangeModelDecorations = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidChangeModelDecorations = this._onDidChangeModelDecorations.event; - this._onDidChangeConfiguration = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidChangeConfiguration = this._onDidChangeConfiguration.event; - this._onDidChangeModel = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidChangeModel = this._onDidChangeModel.event; - this._onDidChangeCursorPosition = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidChangeCursorPosition = this._onDidChangeCursorPosition.event; - this._onDidChangeCursorSelection = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidChangeCursorSelection = this._onDidChangeCursorSelection.event; - this._onDidAttemptReadOnlyEdit = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidAttemptReadOnlyEdit = this._onDidAttemptReadOnlyEdit.event; - this._onDidLayoutChange = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidLayoutChange = this._onDidLayoutChange.event; - this._editorTextFocus = this._register(new BooleanEventEmitter()); - this.onDidFocusEditorText = this._editorTextFocus.onDidChangeToTrue; - this.onDidBlurEditorText = this._editorTextFocus.onDidChangeToFalse; - this._editorWidgetFocus = this._register(new BooleanEventEmitter()); - this.onDidFocusEditorWidget = this._editorWidgetFocus.onDidChangeToTrue; - this.onDidBlurEditorWidget = this._editorWidgetFocus.onDidChangeToFalse; - this._onWillType = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onWillType = this._onWillType.event; - this._onDidType = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidType = this._onDidType.event; - this._onDidCompositionStart = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidCompositionStart = this._onDidCompositionStart.event; - this._onDidCompositionEnd = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidCompositionEnd = this._onDidCompositionEnd.event; - this._onDidPaste = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidPaste = this._onDidPaste.event; - this._onMouseUp = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onMouseUp = this._onMouseUp.event; - this._onMouseDown = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onMouseDown = this._onMouseDown.event; - this._onMouseDrag = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onMouseDrag = this._onMouseDrag.event; - this._onMouseDrop = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onMouseDrop = this._onMouseDrop.event; - this._onContextMenu = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onContextMenu = this._onContextMenu.event; - this._onMouseMove = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onMouseMove = this._onMouseMove.event; - this._onMouseLeave = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onMouseLeave = this._onMouseLeave.event; - this._onMouseWheel = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onMouseWheel = this._onMouseWheel.event; - this._onKeyUp = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onKeyUp = this._onKeyUp.event; - this._onKeyDown = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onKeyDown = this._onKeyDown.event; - this._onDidContentSizeChange = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidContentSizeChange = this._onDidContentSizeChange.event; - this._onDidScrollChange = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidScrollChange = this._onDidScrollChange.event; - this._onDidChangeViewZones = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidChangeViewZones = this._onDidChangeViewZones.event; - options = options || {}; - this._domElement = domElement; - this._overflowWidgetsDomNode = options.overflowWidgetsDomNode; - this._id = (++EDITOR_ID); - this._decorationTypeKeysToIds = {}; - this._decorationTypeSubtypes = {}; - this.isSimpleWidget = codeEditorWidgetOptions.isSimpleWidget || false; - this._telemetryData = codeEditorWidgetOptions.telemetryData; - this._configuration = this._register(this._createConfiguration(options, accessibilityService)); - this._register(this._configuration.onDidChange((e) => { - this._onDidChangeConfiguration.fire(e); - const options = this._configuration.options; - if (e.hasChanged(117 /* layoutInfo */)) { - const layoutInfo = options.get(117 /* layoutInfo */); - this._onDidLayoutChange.fire(layoutInfo); - } - })); - this._contextKeyService = this._register(contextKeyService.createScoped(this._domElement)); - this._notificationService = notificationService; - this._codeEditorService = codeEditorService; - this._commandService = commandService; - this._themeService = themeService; - this._register(new EditorContextKeysManager(this, this._contextKeyService)); - this._register(new EditorModeContext(this, this._contextKeyService)); - this._instantiationService = instantiationService.createChild(new _platform_instantiation_common_serviceCollection_js__WEBPACK_IMPORTED_MODULE_28__["ServiceCollection"]([_platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_26__["IContextKeyService"], this._contextKeyService])); - this._modelData = null; - this._contributions = {}; - this._actions = {}; - this._focusTracker = new CodeEditorWidgetFocusTracker(domElement); - this._focusTracker.onChange(() => { - this._editorWidgetFocus.setValue(this._focusTracker.hasFocus()); - }); - this._contentWidgets = {}; - this._overlayWidgets = {}; - let contributions; - if (Array.isArray(codeEditorWidgetOptions.contributions)) { - contributions = codeEditorWidgetOptions.contributions; - } - else { - contributions = _editorExtensions_js__WEBPACK_IMPORTED_MODULE_8__["EditorExtensionsRegistry"].getEditorContributions(); - } - for (const desc of contributions) { - try { - const contribution = this._instantiationService.createInstance(desc.ctor, this); - this._contributions[desc.id] = contribution; - } - catch (err) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["onUnexpectedError"])(err); - } - } - _editorExtensions_js__WEBPACK_IMPORTED_MODULE_8__["EditorExtensionsRegistry"].getEditorActions().forEach((action) => { - const internalAction = new _common_editorAction_js__WEBPACK_IMPORTED_MODULE_18__["InternalEditorAction"](action.id, action.label, action.alias, Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_32__["withNullAsUndefined"])(action.precondition), () => { - return this._instantiationService.invokeFunction((accessor) => { - return Promise.resolve(action.runEditorCommand(accessor, this, null)); - }); - }, this._contextKeyService); - this._actions[internalAction.id] = internalAction; - }); - this._codeEditorService.addCodeEditor(this); - } - _createConfiguration(options, accessibilityService) { - return new _config_configuration_js__WEBPACK_IMPORTED_MODULE_7__["Configuration"](this.isSimpleWidget, options, this._domElement, accessibilityService); - } - getId() { - return this.getEditorType() + ':' + this._id; - } - getEditorType() { - return _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_19__["EditorType"].ICodeEditor; - } - dispose() { - this._codeEditorService.removeCodeEditor(this); - this._focusTracker.dispose(); - const keys = Object.keys(this._contributions); - for (let i = 0, len = keys.length; i < len; i++) { - const contributionId = keys[i]; - this._contributions[contributionId].dispose(); - } - this._removeDecorationTypes(); - this._postDetachModelCleanup(this._detachModel()); - this._onDidDispose.fire(); - super.dispose(); - } - invokeWithinContext(fn) { - return this._instantiationService.invokeFunction(fn); - } - updateOptions(newOptions) { - this._configuration.updateOptions(newOptions); - } - getOptions() { - return this._configuration.options; - } - getOption(id) { - return this._configuration.options.get(id); - } - getRawOptions() { - return this._configuration.getRawOptions(); - } - getOverflowWidgetsDomNode() { - return this._overflowWidgetsDomNode; - } - getConfiguredWordAtPosition(position) { - if (!this._modelData) { - return null; - } - return _common_controller_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_35__["WordOperations"].getWordAtPosition(this._modelData.model, this._configuration.options.get(105 /* wordSeparators */), position); - } - getValue(options = null) { - if (!this._modelData) { - return ''; - } - const preserveBOM = (options && options.preserveBOM) ? true : false; - let eolPreference = 0 /* TextDefined */; - if (options && options.lineEnding && options.lineEnding === '\n') { - eolPreference = 1 /* LF */; - } - else if (options && options.lineEnding && options.lineEnding === '\r\n') { - eolPreference = 2 /* CRLF */; - } - return this._modelData.model.getValue(eolPreference, preserveBOM); - } - setValue(newValue) { - if (!this._modelData) { - return; - } - this._modelData.model.setValue(newValue); - } - getModel() { - if (!this._modelData) { - return null; - } - return this._modelData.model; - } - setModel(_model = null) { - const model = _model; - if (this._modelData === null && model === null) { - // Current model is the new model - return; - } - if (this._modelData && this._modelData.model === model) { - // Current model is the new model - return; - } - const hasTextFocus = this.hasTextFocus(); - const detachedModel = this._detachModel(); - this._attachModel(model); - if (hasTextFocus && this.hasModel()) { - this.focus(); - } - const e = { - oldModelUrl: detachedModel ? detachedModel.uri : null, - newModelUrl: model ? model.uri : null - }; - this._removeDecorationTypes(); - this._onDidChangeModel.fire(e); - this._postDetachModelCleanup(detachedModel); - } - _removeDecorationTypes() { - this._decorationTypeKeysToIds = {}; - if (this._decorationTypeSubtypes) { - for (let decorationType in this._decorationTypeSubtypes) { - const subTypes = this._decorationTypeSubtypes[decorationType]; - for (let subType in subTypes) { - this._removeDecorationType(decorationType + '-' + subType); - } - } - this._decorationTypeSubtypes = {}; - } - } - getVisibleRanges() { - if (!this._modelData) { - return []; - } - return this._modelData.viewModel.getVisibleRanges(); - } - getVisibleRangesPlusViewportAboveBelow() { - if (!this._modelData) { - return []; - } - return this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow(); - } - getWhitespaces() { - if (!this._modelData) { - return []; - } - return this._modelData.viewModel.viewLayout.getWhitespaces(); - } - static _getVerticalOffsetForPosition(modelData, modelLineNumber, modelColumn) { - const modelPosition = modelData.model.validatePosition({ - lineNumber: modelLineNumber, - column: modelColumn - }); - const viewPosition = modelData.viewModel.coordinatesConverter.convertModelPositionToViewPosition(modelPosition); - return modelData.viewModel.viewLayout.getVerticalOffsetForLineNumber(viewPosition.lineNumber); - } - getTopForLineNumber(lineNumber) { - if (!this._modelData) { - return -1; - } - return CodeEditorWidget._getVerticalOffsetForPosition(this._modelData, lineNumber, 1); - } - getTopForPosition(lineNumber, column) { - if (!this._modelData) { - return -1; - } - return CodeEditorWidget._getVerticalOffsetForPosition(this._modelData, lineNumber, column); - } - setHiddenAreas(ranges) { - if (this._modelData) { - this._modelData.viewModel.setHiddenAreas(ranges.map(r => _common_core_range_js__WEBPACK_IMPORTED_MODULE_16__["Range"].lift(r))); - } - } - getVisibleColumnFromPosition(rawPosition) { - if (!this._modelData) { - return rawPosition.column; - } - const position = this._modelData.model.validatePosition(rawPosition); - const tabSize = this._modelData.model.getOptions().tabSize; - return _common_controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_14__["CursorColumns"].visibleColumnFromColumn(this._modelData.model.getLineContent(position.lineNumber), position.column, tabSize) + 1; - } - getPosition() { - if (!this._modelData) { - return null; - } - return this._modelData.viewModel.getPosition(); - } - setPosition(position) { - if (!this._modelData) { - return; - } - if (!_common_core_position_js__WEBPACK_IMPORTED_MODULE_15__["Position"].isIPosition(position)) { - throw new Error('Invalid arguments'); - } - this._modelData.viewModel.setSelections('api', [{ - selectionStartLineNumber: position.lineNumber, - selectionStartColumn: position.column, - positionLineNumber: position.lineNumber, - positionColumn: position.column - }]); - } - _sendRevealRange(modelRange, verticalType, revealHorizontal, scrollType) { - if (!this._modelData) { - return; - } - if (!_common_core_range_js__WEBPACK_IMPORTED_MODULE_16__["Range"].isIRange(modelRange)) { - throw new Error('Invalid arguments'); - } - const validatedModelRange = this._modelData.model.validateRange(modelRange); - const viewRange = this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(validatedModelRange); - this._modelData.viewModel.revealRange('api', revealHorizontal, viewRange, verticalType, scrollType); - } - revealLine(lineNumber, scrollType = 0 /* Smooth */) { - this._revealLine(lineNumber, 0 /* Simple */, scrollType); - } - revealLineInCenter(lineNumber, scrollType = 0 /* Smooth */) { - this._revealLine(lineNumber, 1 /* Center */, scrollType); - } - revealLineInCenterIfOutsideViewport(lineNumber, scrollType = 0 /* Smooth */) { - this._revealLine(lineNumber, 2 /* CenterIfOutsideViewport */, scrollType); - } - revealLineNearTop(lineNumber, scrollType = 0 /* Smooth */) { - this._revealLine(lineNumber, 5 /* NearTop */, scrollType); - } - _revealLine(lineNumber, revealType, scrollType) { - if (typeof lineNumber !== 'number') { - throw new Error('Invalid arguments'); - } - this._sendRevealRange(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_16__["Range"](lineNumber, 1, lineNumber, 1), revealType, false, scrollType); - } - revealPosition(position, scrollType = 0 /* Smooth */) { - this._revealPosition(position, 0 /* Simple */, true, scrollType); - } - revealPositionInCenter(position, scrollType = 0 /* Smooth */) { - this._revealPosition(position, 1 /* Center */, true, scrollType); - } - revealPositionInCenterIfOutsideViewport(position, scrollType = 0 /* Smooth */) { - this._revealPosition(position, 2 /* CenterIfOutsideViewport */, true, scrollType); - } - revealPositionNearTop(position, scrollType = 0 /* Smooth */) { - this._revealPosition(position, 5 /* NearTop */, true, scrollType); - } - _revealPosition(position, verticalType, revealHorizontal, scrollType) { - if (!_common_core_position_js__WEBPACK_IMPORTED_MODULE_15__["Position"].isIPosition(position)) { - throw new Error('Invalid arguments'); - } - this._sendRevealRange(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_16__["Range"](position.lineNumber, position.column, position.lineNumber, position.column), verticalType, revealHorizontal, scrollType); - } - getSelection() { - if (!this._modelData) { - return null; - } - return this._modelData.viewModel.getSelection(); - } - getSelections() { - if (!this._modelData) { - return null; - } - return this._modelData.viewModel.getSelections(); - } - setSelection(something) { - const isSelection = _common_core_selection_js__WEBPACK_IMPORTED_MODULE_17__["Selection"].isISelection(something); - const isRange = _common_core_range_js__WEBPACK_IMPORTED_MODULE_16__["Range"].isIRange(something); - if (!isSelection && !isRange) { - throw new Error('Invalid arguments'); - } - if (isSelection) { - this._setSelectionImpl(something); - } - else if (isRange) { - // act as if it was an IRange - const selection = { - selectionStartLineNumber: something.startLineNumber, - selectionStartColumn: something.startColumn, - positionLineNumber: something.endLineNumber, - positionColumn: something.endColumn - }; - this._setSelectionImpl(selection); - } - } - _setSelectionImpl(sel) { - if (!this._modelData) { - return; - } - const selection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_17__["Selection"](sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); - this._modelData.viewModel.setSelections('api', [selection]); - } - revealLines(startLineNumber, endLineNumber, scrollType = 0 /* Smooth */) { - this._revealLines(startLineNumber, endLineNumber, 0 /* Simple */, scrollType); - } - revealLinesInCenter(startLineNumber, endLineNumber, scrollType = 0 /* Smooth */) { - this._revealLines(startLineNumber, endLineNumber, 1 /* Center */, scrollType); - } - revealLinesInCenterIfOutsideViewport(startLineNumber, endLineNumber, scrollType = 0 /* Smooth */) { - this._revealLines(startLineNumber, endLineNumber, 2 /* CenterIfOutsideViewport */, scrollType); - } - revealLinesNearTop(startLineNumber, endLineNumber, scrollType = 0 /* Smooth */) { - this._revealLines(startLineNumber, endLineNumber, 5 /* NearTop */, scrollType); - } - _revealLines(startLineNumber, endLineNumber, verticalType, scrollType) { - if (typeof startLineNumber !== 'number' || typeof endLineNumber !== 'number') { - throw new Error('Invalid arguments'); - } - this._sendRevealRange(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_16__["Range"](startLineNumber, 1, endLineNumber, 1), verticalType, false, scrollType); - } - revealRange(range, scrollType = 0 /* Smooth */, revealVerticalInCenter = false, revealHorizontal = true) { - this._revealRange(range, revealVerticalInCenter ? 1 /* Center */ : 0 /* Simple */, revealHorizontal, scrollType); - } - revealRangeInCenter(range, scrollType = 0 /* Smooth */) { - this._revealRange(range, 1 /* Center */, true, scrollType); - } - revealRangeInCenterIfOutsideViewport(range, scrollType = 0 /* Smooth */) { - this._revealRange(range, 2 /* CenterIfOutsideViewport */, true, scrollType); - } - revealRangeNearTop(range, scrollType = 0 /* Smooth */) { - this._revealRange(range, 5 /* NearTop */, true, scrollType); - } - revealRangeNearTopIfOutsideViewport(range, scrollType = 0 /* Smooth */) { - this._revealRange(range, 6 /* NearTopIfOutsideViewport */, true, scrollType); - } - revealRangeAtTop(range, scrollType = 0 /* Smooth */) { - this._revealRange(range, 3 /* Top */, true, scrollType); - } - _revealRange(range, verticalType, revealHorizontal, scrollType) { - if (!_common_core_range_js__WEBPACK_IMPORTED_MODULE_16__["Range"].isIRange(range)) { - throw new Error('Invalid arguments'); - } - this._sendRevealRange(_common_core_range_js__WEBPACK_IMPORTED_MODULE_16__["Range"].lift(range), verticalType, revealHorizontal, scrollType); - } - setSelections(ranges, source = 'api') { - if (!this._modelData) { - return; - } - if (!ranges || ranges.length === 0) { - throw new Error('Invalid arguments'); - } - for (let i = 0, len = ranges.length; i < len; i++) { - if (!_common_core_selection_js__WEBPACK_IMPORTED_MODULE_17__["Selection"].isISelection(ranges[i])) { - throw new Error('Invalid arguments'); - } - } - this._modelData.viewModel.setSelections(source, ranges); - } - getContentWidth() { - if (!this._modelData) { - return -1; - } - return this._modelData.viewModel.viewLayout.getContentWidth(); - } - getScrollWidth() { - if (!this._modelData) { - return -1; - } - return this._modelData.viewModel.viewLayout.getScrollWidth(); - } - getScrollLeft() { - if (!this._modelData) { - return -1; - } - return this._modelData.viewModel.viewLayout.getCurrentScrollLeft(); - } - getContentHeight() { - if (!this._modelData) { - return -1; - } - return this._modelData.viewModel.viewLayout.getContentHeight(); - } - getScrollHeight() { - if (!this._modelData) { - return -1; - } - return this._modelData.viewModel.viewLayout.getScrollHeight(); - } - getScrollTop() { - if (!this._modelData) { - return -1; - } - return this._modelData.viewModel.viewLayout.getCurrentScrollTop(); - } - setScrollLeft(newScrollLeft, scrollType = 1 /* Immediate */) { - if (!this._modelData) { - return; - } - if (typeof newScrollLeft !== 'number') { - throw new Error('Invalid arguments'); - } - this._modelData.viewModel.setScrollPosition({ - scrollLeft: newScrollLeft - }, scrollType); - } - setScrollTop(newScrollTop, scrollType = 1 /* Immediate */) { - if (!this._modelData) { - return; - } - if (typeof newScrollTop !== 'number') { - throw new Error('Invalid arguments'); - } - this._modelData.viewModel.setScrollPosition({ - scrollTop: newScrollTop - }, scrollType); - } - setScrollPosition(position, scrollType = 1 /* Immediate */) { - if (!this._modelData) { - return; - } - this._modelData.viewModel.setScrollPosition(position, scrollType); - } - saveViewState() { - if (!this._modelData) { - return null; - } - const contributionsState = {}; - const keys = Object.keys(this._contributions); - for (const id of keys) { - const contribution = this._contributions[id]; - if (typeof contribution.saveViewState === 'function') { - contributionsState[id] = contribution.saveViewState(); - } - } - const cursorState = this._modelData.viewModel.saveCursorState(); - const viewState = this._modelData.viewModel.saveState(); - return { - cursorState: cursorState, - viewState: viewState, - contributionsState: contributionsState - }; - } - restoreViewState(s) { - if (!this._modelData || !this._modelData.hasRealView) { - return; - } - const codeEditorState = s; - if (codeEditorState && codeEditorState.cursorState && codeEditorState.viewState) { - const cursorState = codeEditorState.cursorState; - if (Array.isArray(cursorState)) { - this._modelData.viewModel.restoreCursorState(cursorState); - } - else { - // Backwards compatibility - this._modelData.viewModel.restoreCursorState([cursorState]); - } - const contributionsState = codeEditorState.contributionsState || {}; - const keys = Object.keys(this._contributions); - for (let i = 0, len = keys.length; i < len; i++) { - const id = keys[i]; - const contribution = this._contributions[id]; - if (typeof contribution.restoreViewState === 'function') { - contribution.restoreViewState(contributionsState[id]); - } - } - const reducedState = this._modelData.viewModel.reduceRestoreState(codeEditorState.viewState); - this._modelData.view.restoreState(reducedState); - } - } - getContribution(id) { - return (this._contributions[id] || null); - } - getActions() { - const result = []; - const keys = Object.keys(this._actions); - for (let i = 0, len = keys.length; i < len; i++) { - const id = keys[i]; - result.push(this._actions[id]); - } - return result; - } - getSupportedActions() { - let result = this.getActions(); - result = result.filter(action => action.isSupported()); - return result; - } - getAction(id) { - return this._actions[id] || null; - } - trigger(source, handlerId, payload) { - payload = payload || {}; - switch (handlerId) { - case "compositionStart" /* CompositionStart */: - this._startComposition(); - return; - case "compositionEnd" /* CompositionEnd */: - this._endComposition(source); - return; - case "type" /* Type */: { - const args = payload; - this._type(source, args.text || ''); - return; - } - case "replacePreviousChar" /* ReplacePreviousChar */: { - const args = payload; - this._replacePreviousChar(source, args.text || '', args.replaceCharCnt || 0); - return; - } - case "paste" /* Paste */: { - const args = payload; - this._paste(source, args.text || '', args.pasteOnNewLine || false, args.multicursorText || null, args.mode || null); - return; - } - case "cut" /* Cut */: - this._cut(source); - return; - } - const action = this.getAction(handlerId); - if (action) { - Promise.resolve(action.run()).then(undefined, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["onUnexpectedError"]); - return; - } - if (!this._modelData) { - return; - } - if (this._triggerEditorCommand(source, handlerId, payload)) { - return; - } - } - _startComposition() { - if (!this._modelData) { - return; - } - this._modelData.viewModel.startComposition(); - this._onDidCompositionStart.fire(); - } - _endComposition(source) { - if (!this._modelData) { - return; - } - this._modelData.viewModel.endComposition(source); - this._onDidCompositionEnd.fire(); - } - _type(source, text) { - if (!this._modelData || text.length === 0) { - return; - } - if (source === 'keyboard') { - this._onWillType.fire(text); - } - this._modelData.viewModel.type(text, source); - if (source === 'keyboard') { - this._onDidType.fire(text); - } - } - _replacePreviousChar(source, text, replaceCharCnt) { - if (!this._modelData) { - return; - } - this._modelData.viewModel.replacePreviousChar(text, replaceCharCnt, source); - } - _paste(source, text, pasteOnNewLine, multicursorText, mode) { - if (!this._modelData || text.length === 0) { - return; - } - const startPosition = this._modelData.viewModel.getSelection().getStartPosition(); - this._modelData.viewModel.paste(text, pasteOnNewLine, multicursorText, source); - const endPosition = this._modelData.viewModel.getSelection().getStartPosition(); - if (source === 'keyboard') { - this._onDidPaste.fire({ - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_16__["Range"](startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column), - mode: mode - }); - } - } - _cut(source) { - if (!this._modelData) { - return; - } - this._modelData.viewModel.cut(source); - } - _triggerEditorCommand(source, handlerId, payload) { - const command = _editorExtensions_js__WEBPACK_IMPORTED_MODULE_8__["EditorExtensionsRegistry"].getEditorCommand(handlerId); - if (command) { - payload = payload || {}; - payload.source = source; - this._instantiationService.invokeFunction((accessor) => { - Promise.resolve(command.runEditorCommand(accessor, this, payload)).then(undefined, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["onUnexpectedError"]); - }); - return true; - } - return false; - } - _getViewModel() { - if (!this._modelData) { - return null; - } - return this._modelData.viewModel; - } - pushUndoStop() { - if (!this._modelData) { - return false; - } - if (this._configuration.options.get(72 /* readOnly */)) { - // read only editor => sorry! - return false; - } - this._modelData.model.pushStackElement(); - return true; - } - executeEdits(source, edits, endCursorState) { - if (!this._modelData) { - return false; - } - if (this._configuration.options.get(72 /* readOnly */)) { - // read only editor => sorry! - return false; - } - let cursorStateComputer; - if (!endCursorState) { - cursorStateComputer = () => null; - } - else if (Array.isArray(endCursorState)) { - cursorStateComputer = () => endCursorState; - } - else { - cursorStateComputer = endCursorState; - } - this._modelData.viewModel.executeEdits(source, edits, cursorStateComputer); - return true; - } - executeCommand(source, command) { - if (!this._modelData) { - return; - } - this._modelData.viewModel.executeCommand(command, source); - } - executeCommands(source, commands) { - if (!this._modelData) { - return; - } - this._modelData.viewModel.executeCommands(commands, source); - } - changeDecorations(callback) { - if (!this._modelData) { - // callback will not be called - return null; - } - return this._modelData.model.changeDecorations(callback, this._id); - } - getLineDecorations(lineNumber) { - if (!this._modelData) { - return null; - } - return this._modelData.model.getLineDecorations(lineNumber, this._id, Object(_common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_12__["filterValidationDecorations"])(this._configuration.options)); - } - deltaDecorations(oldDecorations, newDecorations) { - if (!this._modelData) { - return []; - } - if (oldDecorations.length === 0 && newDecorations.length === 0) { - return oldDecorations; - } - return this._modelData.model.deltaDecorations(oldDecorations, newDecorations, this._id); - } - removeDecorations(decorationTypeKey) { - // remove decorations for type and sub type - const oldDecorationsIds = this._decorationTypeKeysToIds[decorationTypeKey]; - if (oldDecorationsIds) { - this.deltaDecorations(oldDecorationsIds, []); - } - if (this._decorationTypeKeysToIds.hasOwnProperty(decorationTypeKey)) { - delete this._decorationTypeKeysToIds[decorationTypeKey]; - } - if (this._decorationTypeSubtypes.hasOwnProperty(decorationTypeKey)) { - delete this._decorationTypeSubtypes[decorationTypeKey]; - } - } - getLayoutInfo() { - const options = this._configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - return layoutInfo; - } - createOverviewRuler(cssClassName) { - if (!this._modelData || !this._modelData.hasRealView) { - return null; - } - return this._modelData.view.createOverviewRuler(cssClassName); - } - getContainerDomNode() { - return this._domElement; - } - getDomNode() { - if (!this._modelData || !this._modelData.hasRealView) { - return null; - } - return this._modelData.view.domNode.domNode; - } - delegateVerticalScrollbarMouseDown(browserEvent) { - if (!this._modelData || !this._modelData.hasRealView) { - return; - } - this._modelData.view.delegateVerticalScrollbarMouseDown(browserEvent); - } - layout(dimension) { - this._configuration.observeReferenceElement(dimension); - this.render(); - } - focus() { - if (!this._modelData || !this._modelData.hasRealView) { - return; - } - this._modelData.view.focus(); - } - hasTextFocus() { - if (!this._modelData || !this._modelData.hasRealView) { - return false; - } - return this._modelData.view.isFocused(); - } - hasWidgetFocus() { - return this._focusTracker && this._focusTracker.hasFocus(); - } - addContentWidget(widget) { - const widgetData = { - widget: widget, - position: widget.getPosition() - }; - if (this._contentWidgets.hasOwnProperty(widget.getId())) { - console.warn('Overwriting a content widget with the same id.'); - } - this._contentWidgets[widget.getId()] = widgetData; - if (this._modelData && this._modelData.hasRealView) { - this._modelData.view.addContentWidget(widgetData); - } - } - layoutContentWidget(widget) { - const widgetId = widget.getId(); - if (this._contentWidgets.hasOwnProperty(widgetId)) { - const widgetData = this._contentWidgets[widgetId]; - widgetData.position = widget.getPosition(); - if (this._modelData && this._modelData.hasRealView) { - this._modelData.view.layoutContentWidget(widgetData); - } - } - } - removeContentWidget(widget) { - const widgetId = widget.getId(); - if (this._contentWidgets.hasOwnProperty(widgetId)) { - const widgetData = this._contentWidgets[widgetId]; - delete this._contentWidgets[widgetId]; - if (this._modelData && this._modelData.hasRealView) { - this._modelData.view.removeContentWidget(widgetData); - } - } - } - addOverlayWidget(widget) { - const widgetData = { - widget: widget, - position: widget.getPosition() - }; - if (this._overlayWidgets.hasOwnProperty(widget.getId())) { - console.warn('Overwriting an overlay widget with the same id.'); - } - this._overlayWidgets[widget.getId()] = widgetData; - if (this._modelData && this._modelData.hasRealView) { - this._modelData.view.addOverlayWidget(widgetData); - } - } - layoutOverlayWidget(widget) { - const widgetId = widget.getId(); - if (this._overlayWidgets.hasOwnProperty(widgetId)) { - const widgetData = this._overlayWidgets[widgetId]; - widgetData.position = widget.getPosition(); - if (this._modelData && this._modelData.hasRealView) { - this._modelData.view.layoutOverlayWidget(widgetData); - } - } - } - removeOverlayWidget(widget) { - const widgetId = widget.getId(); - if (this._overlayWidgets.hasOwnProperty(widgetId)) { - const widgetData = this._overlayWidgets[widgetId]; - delete this._overlayWidgets[widgetId]; - if (this._modelData && this._modelData.hasRealView) { - this._modelData.view.removeOverlayWidget(widgetData); - } - } - } - changeViewZones(callback) { - if (!this._modelData || !this._modelData.hasRealView) { - return; - } - this._modelData.view.change(callback); - } - getTargetAtClientPoint(clientX, clientY) { - if (!this._modelData || !this._modelData.hasRealView) { - return null; - } - return this._modelData.view.getTargetAtClientPoint(clientX, clientY); - } - getScrolledVisiblePosition(rawPosition) { - if (!this._modelData || !this._modelData.hasRealView) { - return null; - } - const position = this._modelData.model.validatePosition(rawPosition); - const options = this._configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - const top = CodeEditorWidget._getVerticalOffsetForPosition(this._modelData, position.lineNumber, position.column) - this.getScrollTop(); - const left = this._modelData.view.getOffsetForColumn(position.lineNumber, position.column) + layoutInfo.glyphMarginWidth + layoutInfo.lineNumbersWidth + layoutInfo.decorationsWidth - this.getScrollLeft(); - return { - top: top, - left: left, - height: options.get(51 /* lineHeight */) - }; - } - getOffsetForColumn(lineNumber, column) { - if (!this._modelData || !this._modelData.hasRealView) { - return -1; - } - return this._modelData.view.getOffsetForColumn(lineNumber, column); - } - render(forceRedraw = false) { - if (!this._modelData || !this._modelData.hasRealView) { - return; - } - this._modelData.view.render(true, forceRedraw); - } - setAriaOptions(options) { - if (!this._modelData || !this._modelData.hasRealView) { - return; - } - this._modelData.view.setAriaOptions(options); - } - applyFontInfo(target) { - _config_configuration_js__WEBPACK_IMPORTED_MODULE_7__["Configuration"].applyFontInfoSlow(target, this._configuration.options.get(36 /* fontInfo */)); - } - _attachModel(model) { - if (!model) { - this._modelData = null; - return; - } - const listenersToRemove = []; - this._domElement.setAttribute('data-mode-id', model.getLanguageIdentifier().language); - this._configuration.setIsDominatedByLongLines(model.isDominatedByLongLines()); - this._configuration.setMaxLineNumber(model.getLineCount()); - model.onBeforeAttached(); - const viewModel = new _common_viewModel_viewModelImpl_js__WEBPACK_IMPORTED_MODULE_24__["ViewModel"](this._id, this._configuration, model, _view_domLineBreaksComputer_js__WEBPACK_IMPORTED_MODULE_34__["DOMLineBreaksComputerFactory"].create(), _common_viewModel_monospaceLineBreaksComputer_js__WEBPACK_IMPORTED_MODULE_33__["MonospaceLineBreaksComputerFactory"].create(this._configuration.options), (callback) => _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["scheduleAtNextAnimationFrame"](callback)); - listenersToRemove.push(model.onDidChangeDecorations((e) => this._onDidChangeModelDecorations.fire(e))); - listenersToRemove.push(model.onDidChangeLanguage((e) => { - this._domElement.setAttribute('data-mode-id', model.getLanguageIdentifier().language); - this._onDidChangeModelLanguage.fire(e); - })); - listenersToRemove.push(model.onDidChangeLanguageConfiguration((e) => this._onDidChangeModelLanguageConfiguration.fire(e))); - listenersToRemove.push(model.onDidChangeContent((e) => this._onDidChangeModelContent.fire(e))); - listenersToRemove.push(model.onDidChangeOptions((e) => this._onDidChangeModelOptions.fire(e))); - // Someone might destroy the model from under the editor, so prevent any exceptions by setting a null model - listenersToRemove.push(model.onWillDispose(() => this.setModel(null))); - listenersToRemove.push(viewModel.onEvent((e) => { - switch (e.kind) { - case 0 /* ContentSizeChanged */: - this._onDidContentSizeChange.fire(e); - break; - case 1 /* FocusChanged */: - this._editorTextFocus.setValue(e.hasFocus); - break; - case 2 /* ScrollChanged */: - this._onDidScrollChange.fire(e); - break; - case 3 /* ViewZonesChanged */: - this._onDidChangeViewZones.fire(); - break; - case 4 /* ReadOnlyEditAttempt */: - this._onDidAttemptReadOnlyEdit.fire(); - break; - case 5 /* CursorStateChanged */: { - if (e.reachedMaxCursorCount) { - this._notificationService.warn(_nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('cursors.maximum', "The number of cursors has been limited to {0}.", _common_controller_cursor_js__WEBPACK_IMPORTED_MODULE_13__["Cursor"].MAX_CURSOR_COUNT)); - } - const positions = []; - for (let i = 0, len = e.selections.length; i < len; i++) { - positions[i] = e.selections[i].getPosition(); - } - const e1 = { - position: positions[0], - secondaryPositions: positions.slice(1), - reason: e.reason, - source: e.source - }; - this._onDidChangeCursorPosition.fire(e1); - const e2 = { - selection: e.selections[0], - secondarySelections: e.selections.slice(1), - modelVersionId: e.modelVersionId, - oldSelections: e.oldSelections, - oldModelVersionId: e.oldModelVersionId, - source: e.source, - reason: e.reason - }; - this._onDidChangeCursorSelection.fire(e2); - break; - } - } - })); - const [view, hasRealView] = this._createView(viewModel); - if (hasRealView) { - this._domElement.appendChild(view.domNode.domNode); - let keys = Object.keys(this._contentWidgets); - for (let i = 0, len = keys.length; i < len; i++) { - const widgetId = keys[i]; - view.addContentWidget(this._contentWidgets[widgetId]); - } - keys = Object.keys(this._overlayWidgets); - for (let i = 0, len = keys.length; i < len; i++) { - const widgetId = keys[i]; - view.addOverlayWidget(this._overlayWidgets[widgetId]); - } - view.render(false, true); - view.domNode.domNode.setAttribute('data-uri', model.uri.toString()); - } - this._modelData = new ModelData(model, viewModel, view, hasRealView, listenersToRemove); - } - _createView(viewModel) { - let commandDelegate; - if (this.isSimpleWidget) { - commandDelegate = { - paste: (text, pasteOnNewLine, multicursorText, mode) => { - this._paste('keyboard', text, pasteOnNewLine, multicursorText, mode); - }, - type: (text) => { - this._type('keyboard', text); - }, - replacePreviousChar: (text, replaceCharCnt) => { - this._replacePreviousChar('keyboard', text, replaceCharCnt); - }, - startComposition: () => { - this._startComposition(); - }, - endComposition: () => { - this._endComposition('keyboard'); - }, - cut: () => { - this._cut('keyboard'); - } - }; - } - else { - commandDelegate = { - paste: (text, pasteOnNewLine, multicursorText, mode) => { - const payload = { text, pasteOnNewLine, multicursorText, mode }; - this._commandService.executeCommand("paste" /* Paste */, payload); - }, - type: (text) => { - const payload = { text }; - this._commandService.executeCommand("type" /* Type */, payload); - }, - replacePreviousChar: (text, replaceCharCnt) => { - const payload = { text, replaceCharCnt }; - this._commandService.executeCommand("replacePreviousChar" /* ReplacePreviousChar */, payload); - }, - startComposition: () => { - this._commandService.executeCommand("compositionStart" /* CompositionStart */, {}); - }, - endComposition: () => { - this._commandService.executeCommand("compositionEnd" /* CompositionEnd */, {}); - }, - cut: () => { - this._commandService.executeCommand("cut" /* Cut */, {}); - } - }; - } - const viewUserInputEvents = new _view_viewUserInputEvents_js__WEBPACK_IMPORTED_MODULE_11__["ViewUserInputEvents"](viewModel.coordinatesConverter); - viewUserInputEvents.onKeyDown = (e) => this._onKeyDown.fire(e); - viewUserInputEvents.onKeyUp = (e) => this._onKeyUp.fire(e); - viewUserInputEvents.onContextMenu = (e) => this._onContextMenu.fire(e); - viewUserInputEvents.onMouseMove = (e) => this._onMouseMove.fire(e); - viewUserInputEvents.onMouseLeave = (e) => this._onMouseLeave.fire(e); - viewUserInputEvents.onMouseDown = (e) => this._onMouseDown.fire(e); - viewUserInputEvents.onMouseUp = (e) => this._onMouseUp.fire(e); - viewUserInputEvents.onMouseDrag = (e) => this._onMouseDrag.fire(e); - viewUserInputEvents.onMouseDrop = (e) => this._onMouseDrop.fire(e); - viewUserInputEvents.onMouseWheel = (e) => this._onMouseWheel.fire(e); - const view = new _view_viewImpl_js__WEBPACK_IMPORTED_MODULE_10__["View"](commandDelegate, this._configuration, this._themeService, viewModel, viewUserInputEvents, this._overflowWidgetsDomNode); - return [view, true]; - } - _postDetachModelCleanup(detachedModel) { - if (detachedModel) { - detachedModel.removeAllDecorationsWithOwnerId(this._id); - } - } - _detachModel() { - if (!this._modelData) { - return null; - } - const model = this._modelData.model; - const removeDomNode = this._modelData.hasRealView ? this._modelData.view.domNode.domNode : null; - this._modelData.dispose(); - this._modelData = null; - this._domElement.removeAttribute('data-mode-id'); - if (removeDomNode && this._domElement.contains(removeDomNode)) { - this._domElement.removeChild(removeDomNode); - } - return model; - } - _removeDecorationType(key) { - this._codeEditorService.removeDecorationType(key); - } - hasModel() { - return (this._modelData !== null); - } -}; -CodeEditorWidget = __decorate([ - __param(3, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_27__["IInstantiationService"]), - __param(4, _services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_9__["ICodeEditorService"]), - __param(5, _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_25__["ICommandService"]), - __param(6, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_26__["IContextKeyService"]), - __param(7, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_30__["IThemeService"]), - __param(8, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_29__["INotificationService"]), - __param(9, _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_31__["IAccessibilityService"]) -], CodeEditorWidget); - -class BooleanEventEmitter extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["Disposable"] { - constructor() { - super(); - this._onDidChangeToTrue = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidChangeToTrue = this._onDidChangeToTrue.event; - this._onDidChangeToFalse = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onDidChangeToFalse = this._onDidChangeToFalse.event; - this._value = 0 /* NotSet */; - } - setValue(_value) { - const value = (_value ? 2 /* True */ : 1 /* False */); - if (this._value === value) { - return; - } - this._value = value; - if (this._value === 2 /* True */) { - this._onDidChangeToTrue.fire(); - } - else if (this._value === 1 /* False */) { - this._onDidChangeToFalse.fire(); - } - } -} -class EditorContextKeysManager extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["Disposable"] { - constructor(editor, contextKeyService) { - super(); - this._editor = editor; - contextKeyService.createKey('editorId', editor.getId()); - this._editorSimpleInput = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].editorSimpleInput.bindTo(contextKeyService); - this._editorFocus = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].focus.bindTo(contextKeyService); - this._textInputFocus = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].textInputFocus.bindTo(contextKeyService); - this._editorTextFocus = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].editorTextFocus.bindTo(contextKeyService); - this._editorTabMovesFocus = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].tabMovesFocus.bindTo(contextKeyService); - this._editorReadonly = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].readOnly.bindTo(contextKeyService); - this._editorColumnSelection = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].columnSelection.bindTo(contextKeyService); - this._hasMultipleSelections = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasMultipleSelections.bindTo(contextKeyService); - this._hasNonEmptySelection = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasNonEmptySelection.bindTo(contextKeyService); - this._canUndo = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].canUndo.bindTo(contextKeyService); - this._canRedo = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].canRedo.bindTo(contextKeyService); - this._register(this._editor.onDidChangeConfiguration(() => this._updateFromConfig())); - this._register(this._editor.onDidChangeCursorSelection(() => this._updateFromSelection())); - this._register(this._editor.onDidFocusEditorWidget(() => this._updateFromFocus())); - this._register(this._editor.onDidBlurEditorWidget(() => this._updateFromFocus())); - this._register(this._editor.onDidFocusEditorText(() => this._updateFromFocus())); - this._register(this._editor.onDidBlurEditorText(() => this._updateFromFocus())); - this._register(this._editor.onDidChangeModel(() => this._updateFromModel())); - this._register(this._editor.onDidChangeConfiguration(() => this._updateFromModel())); - this._updateFromConfig(); - this._updateFromSelection(); - this._updateFromFocus(); - this._updateFromModel(); - this._editorSimpleInput.set(this._editor.isSimpleWidget); - } - _updateFromConfig() { - const options = this._editor.getOptions(); - this._editorTabMovesFocus.set(options.get(116 /* tabFocusMode */)); - this._editorReadonly.set(options.get(72 /* readOnly */)); - this._editorColumnSelection.set(options.get(13 /* columnSelection */)); - } - _updateFromSelection() { - const selections = this._editor.getSelections(); - if (!selections) { - this._hasMultipleSelections.reset(); - this._hasNonEmptySelection.reset(); - } - else { - this._hasMultipleSelections.set(selections.length > 1); - this._hasNonEmptySelection.set(selections.some(s => !s.isEmpty())); - } - } - _updateFromFocus() { - this._editorFocus.set(this._editor.hasWidgetFocus() && !this._editor.isSimpleWidget); - this._editorTextFocus.set(this._editor.hasTextFocus() && !this._editor.isSimpleWidget); - this._textInputFocus.set(this._editor.hasTextFocus()); - } - _updateFromModel() { - const model = this._editor.getModel(); - this._canUndo.set(Boolean(model && model.canUndo())); - this._canRedo.set(Boolean(model && model.canRedo())); - } -} -class EditorModeContext extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["Disposable"] { - constructor(_editor, _contextKeyService) { - super(); - this._editor = _editor; - this._contextKeyService = _contextKeyService; - this._langId = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].languageId.bindTo(_contextKeyService); - this._hasCompletionItemProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasCompletionItemProvider.bindTo(_contextKeyService); - this._hasCodeActionsProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasCodeActionsProvider.bindTo(_contextKeyService); - this._hasCodeLensProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasCodeLensProvider.bindTo(_contextKeyService); - this._hasDefinitionProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasDefinitionProvider.bindTo(_contextKeyService); - this._hasDeclarationProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasDeclarationProvider.bindTo(_contextKeyService); - this._hasImplementationProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasImplementationProvider.bindTo(_contextKeyService); - this._hasTypeDefinitionProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasTypeDefinitionProvider.bindTo(_contextKeyService); - this._hasHoverProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasHoverProvider.bindTo(_contextKeyService); - this._hasDocumentHighlightProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasDocumentHighlightProvider.bindTo(_contextKeyService); - this._hasDocumentSymbolProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasDocumentSymbolProvider.bindTo(_contextKeyService); - this._hasReferenceProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasReferenceProvider.bindTo(_contextKeyService); - this._hasRenameProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasRenameProvider.bindTo(_contextKeyService); - this._hasSignatureHelpProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasSignatureHelpProvider.bindTo(_contextKeyService); - this._hasDocumentFormattingProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasDocumentFormattingProvider.bindTo(_contextKeyService); - this._hasDocumentSelectionFormattingProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasDocumentSelectionFormattingProvider.bindTo(_contextKeyService); - this._hasMultipleDocumentFormattingProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasMultipleDocumentFormattingProvider.bindTo(_contextKeyService); - this._hasMultipleDocumentSelectionFormattingProvider = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].hasMultipleDocumentSelectionFormattingProvider.bindTo(_contextKeyService); - this._isInWalkThrough = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_20__["EditorContextKeys"].isInWalkThroughSnippet.bindTo(_contextKeyService); - const update = () => this._update(); - // update when model/mode changes - this._register(_editor.onDidChangeModel(update)); - this._register(_editor.onDidChangeModelLanguage(update)); - // update when registries change - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["CompletionProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["CodeActionProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["CodeLensProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DefinitionProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DeclarationProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["ImplementationProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["TypeDefinitionProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["HoverProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DocumentHighlightProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DocumentSymbolProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["ReferenceProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["RenameProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DocumentFormattingEditProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DocumentRangeFormattingEditProviderRegistry"].onDidChange(update)); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["SignatureHelpProviderRegistry"].onDidChange(update)); - update(); - } - dispose() { - super.dispose(); - } - reset() { - this._contextKeyService.bufferChangeEvents(() => { - this._langId.reset(); - this._hasCompletionItemProvider.reset(); - this._hasCodeActionsProvider.reset(); - this._hasCodeLensProvider.reset(); - this._hasDefinitionProvider.reset(); - this._hasDeclarationProvider.reset(); - this._hasImplementationProvider.reset(); - this._hasTypeDefinitionProvider.reset(); - this._hasHoverProvider.reset(); - this._hasDocumentHighlightProvider.reset(); - this._hasDocumentSymbolProvider.reset(); - this._hasReferenceProvider.reset(); - this._hasRenameProvider.reset(); - this._hasDocumentFormattingProvider.reset(); - this._hasDocumentSelectionFormattingProvider.reset(); - this._hasSignatureHelpProvider.reset(); - this._isInWalkThrough.reset(); - }); - } - _update() { - const model = this._editor.getModel(); - if (!model) { - this.reset(); - return; - } - this._contextKeyService.bufferChangeEvents(() => { - this._langId.set(model.getLanguageIdentifier().language); - this._hasCompletionItemProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["CompletionProviderRegistry"].has(model)); - this._hasCodeActionsProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["CodeActionProviderRegistry"].has(model)); - this._hasCodeLensProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["CodeLensProviderRegistry"].has(model)); - this._hasDefinitionProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DefinitionProviderRegistry"].has(model)); - this._hasDeclarationProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DeclarationProviderRegistry"].has(model)); - this._hasImplementationProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["ImplementationProviderRegistry"].has(model)); - this._hasTypeDefinitionProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["TypeDefinitionProviderRegistry"].has(model)); - this._hasHoverProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["HoverProviderRegistry"].has(model)); - this._hasDocumentHighlightProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DocumentHighlightProviderRegistry"].has(model)); - this._hasDocumentSymbolProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DocumentSymbolProviderRegistry"].has(model)); - this._hasReferenceProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["ReferenceProviderRegistry"].has(model)); - this._hasRenameProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["RenameProviderRegistry"].has(model)); - this._hasSignatureHelpProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["SignatureHelpProviderRegistry"].has(model)); - this._hasDocumentFormattingProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DocumentFormattingEditProviderRegistry"].has(model) || _common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DocumentRangeFormattingEditProviderRegistry"].has(model)); - this._hasDocumentSelectionFormattingProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DocumentRangeFormattingEditProviderRegistry"].has(model)); - this._hasMultipleDocumentFormattingProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DocumentFormattingEditProviderRegistry"].all(model).length + _common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DocumentRangeFormattingEditProviderRegistry"].all(model).length > 1); - this._hasMultipleDocumentSelectionFormattingProvider.set(_common_modes_js__WEBPACK_IMPORTED_MODULE_21__["DocumentRangeFormattingEditProviderRegistry"].all(model).length > 1); - this._isInWalkThrough.set(model.uri.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_6__["Schemas"].walkThroughSnippet); - }); - } -} -class CodeEditorWidgetFocusTracker extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["Disposable"] { - constructor(domElement) { - super(); - this._onChange = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Emitter"]()); - this.onChange = this._onChange.event; - this._hasFocus = false; - this._domFocusTracker = this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["trackFocus"](domElement)); - this._register(this._domFocusTracker.onDidFocus(() => { - this._hasFocus = true; - this._onChange.fire(undefined); - })); - this._register(this._domFocusTracker.onDidBlur(() => { - this._hasFocus = false; - this._onChange.fire(undefined); - })); - } - hasFocus() { - return this._hasFocus; - } -} -const squigglyStart = encodeURIComponent(``); -function getSquigglySVGData(color) { - return squigglyStart + encodeURIComponent(color.toString()) + squigglyEnd; -} -const dotdotdotStart = encodeURIComponent(``); -function getDotDotDotSVGData(color) { - return dotdotdotStart + encodeURIComponent(color.toString()) + dotdotdotEnd; -} -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_30__["registerThemingParticipant"])((theme, collector) => { - const errorBorderColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_23__["editorErrorBorder"]); - if (errorBorderColor) { - collector.addRule(`.monaco-editor .${"squiggly-error" /* EditorErrorDecoration */} { border-bottom: 4px double ${errorBorderColor}; }`); - } - const errorForeground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_23__["editorErrorForeground"]); - if (errorForeground) { - collector.addRule(`.monaco-editor .${"squiggly-error" /* EditorErrorDecoration */} { background: url("data:image/svg+xml,${getSquigglySVGData(errorForeground)}") repeat-x bottom left; }`); - } - const warningBorderColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_23__["editorWarningBorder"]); - if (warningBorderColor) { - collector.addRule(`.monaco-editor .${"squiggly-warning" /* EditorWarningDecoration */} { border-bottom: 4px double ${warningBorderColor}; }`); - } - const warningForeground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_23__["editorWarningForeground"]); - if (warningForeground) { - collector.addRule(`.monaco-editor .${"squiggly-warning" /* EditorWarningDecoration */} { background: url("data:image/svg+xml,${getSquigglySVGData(warningForeground)}") repeat-x bottom left; }`); - } - const infoBorderColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_23__["editorInfoBorder"]); - if (infoBorderColor) { - collector.addRule(`.monaco-editor .${"squiggly-info" /* EditorInfoDecoration */} { border-bottom: 4px double ${infoBorderColor}; }`); - } - const infoForeground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_23__["editorInfoForeground"]); - if (infoForeground) { - collector.addRule(`.monaco-editor .${"squiggly-info" /* EditorInfoDecoration */} { background: url("data:image/svg+xml,${getSquigglySVGData(infoForeground)}") repeat-x bottom left; }`); - } - const hintBorderColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_23__["editorHintBorder"]); - if (hintBorderColor) { - collector.addRule(`.monaco-editor .${"squiggly-hint" /* EditorHintDecoration */} { border-bottom: 2px dotted ${hintBorderColor}; }`); - } - const hintForeground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_23__["editorHintForeground"]); - if (hintForeground) { - collector.addRule(`.monaco-editor .${"squiggly-hint" /* EditorHintDecoration */} { background: url("data:image/svg+xml,${getDotDotDotSVGData(hintForeground)}") no-repeat bottom left; }`); - } - const unnecessaryForeground = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_22__["editorUnnecessaryCodeOpacity"]); - if (unnecessaryForeground) { - collector.addRule(`.monaco-editor.showUnused .${"squiggly-inline-unnecessary" /* EditorUnnecessaryInlineDecoration */} { opacity: ${unnecessaryForeground.rgba.a}; }`); - } - const unnecessaryBorder = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_22__["editorUnnecessaryCodeBorder"]); - if (unnecessaryBorder) { - collector.addRule(`.monaco-editor.showUnused .${"squiggly-unnecessary" /* EditorUnnecessaryDecoration */} { border-bottom: 2px dashed ${unnecessaryBorder}; }`); - } - const deprecatedForeground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_23__["editorForeground"]) || 'inherit'; - collector.addRule(`.monaco-editor.showDeprecated .${"squiggly-inline-deprecated" /* EditorDeprecatedInlineDecoration */} { text-decoration: line-through; text-decoration-color: ${deprecatedForeground}}`); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditorWidget.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditorWidget.js ***! - \*************************************************************************************/ -/*! exports provided: DiffEditorWidget, createDecoration, DECORATIONS, DiffEditorWidgetSideBySide, isChangeOrInsert, isChangeOrDelete */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffEditorWidget", function() { return DiffEditorWidget; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDecoration", function() { return createDecoration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DECORATIONS", function() { return DECORATIONS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffEditorWidgetSideBySide", function() { return DiffEditorWidgetSideBySide; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isChangeOrInsert", function() { return isChangeOrInsert; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isChangeOrDelete", function() { return isChangeOrDelete; }); -/* harmony import */ var _media_diffEditor_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/diffEditor.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/media/diffEditor.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _base_browser_ui_sash_sash_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/browser/ui/sash/sash.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/sash/sash.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_objects_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _config_configuration_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../config/configuration.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/config/configuration.js"); -/* harmony import */ var _core_editorState_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../core/editorState.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/core/editorState.js"); -/* harmony import */ var _services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _codeEditorWidget_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./codeEditorWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js"); -/* harmony import */ var _diffReview_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./diffReview.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/diffReview.js"); -/* harmony import */ var _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../common/config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../common/core/stringBuilder.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/stringBuilder.js"); -/* harmony import */ var _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../common/editorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorCommon.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../common/services/editorWorkerService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerService.js"); -/* harmony import */ var _common_view_overviewZoneManager_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../common/view/overviewZoneManager.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/overviewZoneManager.js"); -/* harmony import */ var _common_viewLayout_lineDecorations_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../common/viewLayout/lineDecorations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/lineDecorations.js"); -/* harmony import */ var _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../common/viewLayout/viewLineRenderer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLineRenderer.js"); -/* harmony import */ var _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../common/viewModel/viewModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModel.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_instantiation_common_serviceCollection_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../../platform/instantiation/common/serviceCollection.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../../platform/contextview/browser/contextView.js */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextView.js"); -/* harmony import */ var _inlineDiffMargin_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./inlineDiffMargin.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/inlineDiffMargin.js"); -/* harmony import */ var _platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../../platform/clipboard/common/clipboardService.js */ "./node_modules/monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js"); -/* harmony import */ var _editorExtensions_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../../platform/progress/common/progress.js */ "./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js"); -/* harmony import */ var _config_elementSizeObserver_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../config/elementSizeObserver.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/config/elementSizeObserver.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/* harmony import */ var _base_browser_ui_mouseCursor_mouseCursor_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../../../base/browser/ui/mouseCursor/mouseCursor.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -class VisualEditorState { - constructor(_contextMenuService, _clipboardService) { - this._contextMenuService = _contextMenuService; - this._clipboardService = _clipboardService; - this._zones = []; - this.inlineDiffMargins = []; - this._zonesMap = {}; - this._decorations = []; - } - getForeignViewZones(allViewZones) { - return allViewZones.filter((z) => !this._zonesMap[String(z.id)]); - } - clean(editor) { - // (1) View zones - if (this._zones.length > 0) { - editor.changeViewZones((viewChangeAccessor) => { - for (let i = 0, length = this._zones.length; i < length; i++) { - viewChangeAccessor.removeZone(this._zones[i]); - } - }); - } - this._zones = []; - this._zonesMap = {}; - // (2) Model decorations - this._decorations = editor.deltaDecorations(this._decorations, []); - } - apply(editor, overviewRuler, newDecorations, restoreScrollState) { - const scrollState = restoreScrollState ? _core_editorState_js__WEBPACK_IMPORTED_MODULE_10__["StableEditorScrollState"].capture(editor) : null; - // view zones - editor.changeViewZones((viewChangeAccessor) => { - for (let i = 0, length = this._zones.length; i < length; i++) { - viewChangeAccessor.removeZone(this._zones[i]); - } - for (let i = 0, length = this.inlineDiffMargins.length; i < length; i++) { - this.inlineDiffMargins[i].dispose(); - } - this._zones = []; - this._zonesMap = {}; - this.inlineDiffMargins = []; - for (let i = 0, length = newDecorations.zones.length; i < length; i++) { - const viewZone = newDecorations.zones[i]; - viewZone.suppressMouseDown = true; - let zoneId = viewChangeAccessor.addZone(viewZone); - this._zones.push(zoneId); - this._zonesMap[String(zoneId)] = true; - if (newDecorations.zones[i].diff && viewZone.marginDomNode) { - viewZone.suppressMouseDown = false; - this.inlineDiffMargins.push(new _inlineDiffMargin_js__WEBPACK_IMPORTED_MODULE_31__["InlineDiffMargin"](zoneId, viewZone.marginDomNode, editor, newDecorations.zones[i].diff, this._contextMenuService, this._clipboardService)); - } - } - }); - if (scrollState) { - scrollState.restore(editor); - } - // decorations - this._decorations = editor.deltaDecorations(this._decorations, newDecorations.decorations); - // overview ruler - if (overviewRuler) { - overviewRuler.setZones(newDecorations.overviewZones); - } - } -} -let DIFF_EDITOR_ID = 0; -const diffInsertIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_37__["registerIcon"])('diff-insert', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_37__["Codicon"].add); -const diffRemoveIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_37__["registerIcon"])('diff-remove', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_37__["Codicon"].remove); -let DiffEditorWidget = class DiffEditorWidget extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["Disposable"] { - constructor(domElement, options, clipboardService, editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, notificationService, contextMenuService, _editorProgressService) { - super(); - this._editorProgressService = _editorProgressService; - this._onDidDispose = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidDispose = this._onDidDispose.event; - this._onDidUpdateDiff = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidUpdateDiff = this._onDidUpdateDiff.event; - this._onDidContentSizeChange = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this._lastOriginalWarning = null; - this._lastModifiedWarning = null; - this._editorWorkerService = editorWorkerService; - this._codeEditorService = codeEditorService; - this._contextKeyService = this._register(contextKeyService.createScoped(domElement)); - this._contextKeyService.createKey('isInDiffEditor', true); - this._themeService = themeService; - this._notificationService = notificationService; - this.id = (++DIFF_EDITOR_ID); - this._state = 0 /* Idle */; - this._updatingDiffProgress = null; - this._domElement = domElement; - options = options || {}; - // renderSideBySide - this._renderSideBySide = true; - if (typeof options.renderSideBySide !== 'undefined') { - this._renderSideBySide = options.renderSideBySide; - } - // maxComputationTime - this._maxComputationTime = 5000; - if (typeof options.maxComputationTime !== 'undefined') { - this._maxComputationTime = options.maxComputationTime; - } - // ignoreTrimWhitespace - this._ignoreTrimWhitespace = true; - if (typeof options.ignoreTrimWhitespace !== 'undefined') { - this._ignoreTrimWhitespace = options.ignoreTrimWhitespace; - } - // renderIndicators - this._renderIndicators = true; - if (typeof options.renderIndicators !== 'undefined') { - this._renderIndicators = options.renderIndicators; - } - this._originalIsEditable = false; - if (typeof options.originalEditable !== 'undefined') { - this._originalIsEditable = Boolean(options.originalEditable); - } - this._originalCodeLens = false; - if (typeof options.originalCodeLens !== 'undefined') { - this._originalCodeLens = Boolean(options.originalCodeLens); - } - this._modifiedCodeLens = false; - if (typeof options.modifiedCodeLens !== 'undefined') { - this._modifiedCodeLens = Boolean(options.modifiedCodeLens); - } - this._updateDecorationsRunner = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_5__["RunOnceScheduler"](() => this._updateDecorations(), 0)); - this._containerDomElement = document.createElement('div'); - this._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getColorTheme(), this._renderSideBySide); - this._containerDomElement.style.position = 'relative'; - this._containerDomElement.style.height = '100%'; - this._domElement.appendChild(this._containerDomElement); - this._overviewViewportDomElement = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_3__["createFastDomNode"])(document.createElement('div')); - this._overviewViewportDomElement.setClassName('diffViewport'); - this._overviewViewportDomElement.setPosition('absolute'); - this._overviewDomElement = document.createElement('div'); - this._overviewDomElement.className = 'diffOverview'; - this._overviewDomElement.style.position = 'absolute'; - this._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addStandardDisposableListener"](this._overviewDomElement, 'mousedown', (e) => { - this.modifiedEditor.delegateVerticalScrollbarMouseDown(e); - })); - this._containerDomElement.appendChild(this._overviewDomElement); - // Create left side - this._originalDomNode = document.createElement('div'); - this._originalDomNode.className = 'editor original'; - this._originalDomNode.style.position = 'absolute'; - this._originalDomNode.style.height = '100%'; - this._containerDomElement.appendChild(this._originalDomNode); - // Create right side - this._modifiedDomNode = document.createElement('div'); - this._modifiedDomNode.className = 'editor modified'; - this._modifiedDomNode.style.position = 'absolute'; - this._modifiedDomNode.style.height = '100%'; - this._containerDomElement.appendChild(this._modifiedDomNode); - this._beginUpdateDecorationsTimeout = -1; - this._currentlyChangingViewZones = false; - this._diffComputationToken = 0; - this._originalEditorState = new VisualEditorState(contextMenuService, clipboardService); - this._modifiedEditorState = new VisualEditorState(contextMenuService, clipboardService); - this._isVisible = true; - this._isHandlingScrollEvent = false; - this._elementSizeObserver = this._register(new _config_elementSizeObserver_js__WEBPACK_IMPORTED_MODULE_36__["ElementSizeObserver"](this._containerDomElement, undefined, () => this._onDidContainerSizeChanged())); - if (options.automaticLayout) { - this._elementSizeObserver.startObserving(); - } - this._diffComputationResult = null; - const leftContextKeyService = this._contextKeyService.createScoped(); - const leftServices = new _platform_instantiation_common_serviceCollection_js__WEBPACK_IMPORTED_MODULE_26__["ServiceCollection"](); - leftServices.set(_platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_24__["IContextKeyService"], leftContextKeyService); - const leftScopedInstantiationService = instantiationService.createChild(leftServices); - const rightContextKeyService = this._contextKeyService.createScoped(); - const rightServices = new _platform_instantiation_common_serviceCollection_js__WEBPACK_IMPORTED_MODULE_26__["ServiceCollection"](); - rightServices.set(_platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_24__["IContextKeyService"], rightContextKeyService); - const rightScopedInstantiationService = instantiationService.createChild(rightServices); - this.originalEditor = this._createLeftHandSideEditor(options, leftScopedInstantiationService, leftContextKeyService); - this.modifiedEditor = this._createRightHandSideEditor(options, rightScopedInstantiationService, rightContextKeyService); - this._originalOverviewRuler = null; - this._modifiedOverviewRuler = null; - this._reviewPane = new _diffReview_js__WEBPACK_IMPORTED_MODULE_13__["DiffReview"](this); - this._containerDomElement.appendChild(this._reviewPane.domNode.domNode); - this._containerDomElement.appendChild(this._reviewPane.shadow.domNode); - this._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode); - // enableSplitViewResizing - this._enableSplitViewResizing = true; - if (typeof options.enableSplitViewResizing !== 'undefined') { - this._enableSplitViewResizing = options.enableSplitViewResizing; - } - if (this._renderSideBySide) { - this._setStrategy(new DiffEditorWidgetSideBySide(this._createDataSource(), this._enableSplitViewResizing)); - } - else { - this._setStrategy(new DiffEditorWidgetInline(this._createDataSource(), this._enableSplitViewResizing)); - } - this._register(themeService.onDidColorThemeChange(t => { - if (this._strategy && this._strategy.applyColors(t)) { - this._updateDecorationsRunner.schedule(); - } - this._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getColorTheme(), this._renderSideBySide); - })); - const contributions = _editorExtensions_js__WEBPACK_IMPORTED_MODULE_33__["EditorExtensionsRegistry"].getDiffEditorContributions(); - for (const desc of contributions) { - try { - this._register(instantiationService.createInstance(desc.ctor, this)); - } - catch (err) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_34__["onUnexpectedError"])(err); - } - } - this._codeEditorService.addDiffEditor(this); - } - _setState(newState) { - if (this._state === newState) { - return; - } - this._state = newState; - if (this._updatingDiffProgress) { - this._updatingDiffProgress.done(); - this._updatingDiffProgress = null; - } - if (this._state === 1 /* ComputingDiff */) { - this._updatingDiffProgress = this._editorProgressService.show(true, 1000); - } - } - diffReviewNext() { - this._reviewPane.next(); - } - diffReviewPrev() { - this._reviewPane.prev(); - } - static _getClassName(theme, renderSideBySide) { - let result = 'monaco-diff-editor monaco-editor-background '; - if (renderSideBySide) { - result += 'side-by-side '; - } - result += Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_29__["getThemeTypeSelector"])(theme.type); - return result; - } - _recreateOverviewRulers() { - if (this._originalOverviewRuler) { - this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()); - this._originalOverviewRuler.dispose(); - } - if (this.originalEditor.hasModel()) { - this._originalOverviewRuler = this.originalEditor.createOverviewRuler('original diffOverviewRuler'); - this._overviewDomElement.appendChild(this._originalOverviewRuler.getDomNode()); - } - if (this._modifiedOverviewRuler) { - this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()); - this._modifiedOverviewRuler.dispose(); - } - if (this.modifiedEditor.hasModel()) { - this._modifiedOverviewRuler = this.modifiedEditor.createOverviewRuler('modified diffOverviewRuler'); - this._overviewDomElement.appendChild(this._modifiedOverviewRuler.getDomNode()); - } - this._layoutOverviewRulers(); - } - _createLeftHandSideEditor(options, instantiationService, contextKeyService) { - const editor = this._createInnerEditor(instantiationService, this._originalDomNode, this._adjustOptionsForLeftHandSide(options, this._originalIsEditable, this._originalCodeLens)); - this._register(editor.onDidScrollChange((e) => { - if (this._isHandlingScrollEvent) { - return; - } - if (!e.scrollTopChanged && !e.scrollLeftChanged && !e.scrollHeightChanged) { - return; - } - this._isHandlingScrollEvent = true; - this.modifiedEditor.setScrollPosition({ - scrollLeft: e.scrollLeft, - scrollTop: e.scrollTop - }); - this._isHandlingScrollEvent = false; - this._layoutOverviewViewport(); - })); - this._register(editor.onDidChangeViewZones(() => { - this._onViewZonesChanged(); - })); - this._register(editor.onDidChangeModelContent(() => { - if (this._isVisible) { - this._beginUpdateDecorationsSoon(); - } - })); - const isInDiffLeftEditorKey = contextKeyService.createKey('isInDiffLeftEditor', undefined); - this._register(editor.onDidFocusEditorWidget(() => isInDiffLeftEditorKey.set(true))); - this._register(editor.onDidBlurEditorWidget(() => isInDiffLeftEditorKey.set(false))); - this._register(editor.onDidContentSizeChange(e => { - const width = this.originalEditor.getContentWidth() + this.modifiedEditor.getContentWidth() + DiffEditorWidget.ONE_OVERVIEW_WIDTH; - const height = Math.max(this.modifiedEditor.getContentHeight(), this.originalEditor.getContentHeight()); - this._onDidContentSizeChange.fire({ - contentHeight: height, - contentWidth: width, - contentHeightChanged: e.contentHeightChanged, - contentWidthChanged: e.contentWidthChanged - }); - })); - return editor; - } - _createRightHandSideEditor(options, instantiationService, contextKeyService) { - const editor = this._createInnerEditor(instantiationService, this._modifiedDomNode, this._adjustOptionsForRightHandSide(options, this._modifiedCodeLens)); - this._register(editor.onDidScrollChange((e) => { - if (this._isHandlingScrollEvent) { - return; - } - if (!e.scrollTopChanged && !e.scrollLeftChanged && !e.scrollHeightChanged) { - return; - } - this._isHandlingScrollEvent = true; - this.originalEditor.setScrollPosition({ - scrollLeft: e.scrollLeft, - scrollTop: e.scrollTop - }); - this._isHandlingScrollEvent = false; - this._layoutOverviewViewport(); - })); - this._register(editor.onDidChangeViewZones(() => { - this._onViewZonesChanged(); - })); - this._register(editor.onDidChangeConfiguration((e) => { - if (e.hasChanged(36 /* fontInfo */) && editor.getModel()) { - this._onViewZonesChanged(); - } - })); - this._register(editor.onDidChangeModelContent(() => { - if (this._isVisible) { - this._beginUpdateDecorationsSoon(); - } - })); - this._register(editor.onDidChangeModelOptions((e) => { - if (e.tabSize) { - this._updateDecorationsRunner.schedule(); - } - })); - const isInDiffRightEditorKey = contextKeyService.createKey('isInDiffRightEditor', undefined); - this._register(editor.onDidFocusEditorWidget(() => isInDiffRightEditorKey.set(true))); - this._register(editor.onDidBlurEditorWidget(() => isInDiffRightEditorKey.set(false))); - this._register(editor.onDidContentSizeChange(e => { - const width = this.originalEditor.getContentWidth() + this.modifiedEditor.getContentWidth() + DiffEditorWidget.ONE_OVERVIEW_WIDTH; - const height = Math.max(this.modifiedEditor.getContentHeight(), this.originalEditor.getContentHeight()); - this._onDidContentSizeChange.fire({ - contentHeight: height, - contentWidth: width, - contentHeightChanged: e.contentHeightChanged, - contentWidthChanged: e.contentWidthChanged - }); - })); - return editor; - } - _createInnerEditor(instantiationService, container, options) { - return instantiationService.createInstance(_codeEditorWidget_js__WEBPACK_IMPORTED_MODULE_12__["CodeEditorWidget"], container, options, {}); - } - dispose() { - this._codeEditorService.removeDiffEditor(this); - if (this._beginUpdateDecorationsTimeout !== -1) { - window.clearTimeout(this._beginUpdateDecorationsTimeout); - this._beginUpdateDecorationsTimeout = -1; - } - this._cleanViewZonesAndDecorations(); - if (this._originalOverviewRuler) { - this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()); - this._originalOverviewRuler.dispose(); - } - if (this._modifiedOverviewRuler) { - this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()); - this._modifiedOverviewRuler.dispose(); - } - this._overviewDomElement.removeChild(this._overviewViewportDomElement.domNode); - this._containerDomElement.removeChild(this._overviewDomElement); - this._containerDomElement.removeChild(this._originalDomNode); - this.originalEditor.dispose(); - this._containerDomElement.removeChild(this._modifiedDomNode); - this.modifiedEditor.dispose(); - this._strategy.dispose(); - this._containerDomElement.removeChild(this._reviewPane.domNode.domNode); - this._containerDomElement.removeChild(this._reviewPane.shadow.domNode); - this._containerDomElement.removeChild(this._reviewPane.actionBarContainer.domNode); - this._reviewPane.dispose(); - this._domElement.removeChild(this._containerDomElement); - this._onDidDispose.fire(); - super.dispose(); - } - //------------ begin IDiffEditor methods - getId() { - return this.getEditorType() + ':' + this.id; - } - getEditorType() { - return _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_17__["EditorType"].IDiffEditor; - } - getLineChanges() { - if (!this._diffComputationResult) { - return null; - } - return this._diffComputationResult.changes; - } - getOriginalEditor() { - return this.originalEditor; - } - getModifiedEditor() { - return this.modifiedEditor; - } - updateOptions(newOptions) { - // Handle side by side - let renderSideBySideChanged = false; - if (typeof newOptions.renderSideBySide !== 'undefined') { - if (this._renderSideBySide !== newOptions.renderSideBySide) { - this._renderSideBySide = newOptions.renderSideBySide; - renderSideBySideChanged = true; - } - } - if (typeof newOptions.maxComputationTime !== 'undefined') { - this._maxComputationTime = newOptions.maxComputationTime; - if (this._isVisible) { - this._beginUpdateDecorationsSoon(); - } - } - let beginUpdateDecorations = false; - if (typeof newOptions.ignoreTrimWhitespace !== 'undefined') { - if (this._ignoreTrimWhitespace !== newOptions.ignoreTrimWhitespace) { - this._ignoreTrimWhitespace = newOptions.ignoreTrimWhitespace; - // Begin comparing - beginUpdateDecorations = true; - } - } - if (typeof newOptions.renderIndicators !== 'undefined') { - if (this._renderIndicators !== newOptions.renderIndicators) { - this._renderIndicators = newOptions.renderIndicators; - beginUpdateDecorations = true; - } - } - if (beginUpdateDecorations) { - this._beginUpdateDecorations(); - } - if (typeof newOptions.originalEditable !== 'undefined') { - this._originalIsEditable = Boolean(newOptions.originalEditable); - } - if (typeof newOptions.originalCodeLens !== 'undefined') { - this._originalCodeLens = Boolean(newOptions.originalCodeLens); - } - if (typeof newOptions.modifiedCodeLens !== 'undefined') { - this._modifiedCodeLens = Boolean(newOptions.modifiedCodeLens); - } - this.modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(newOptions, this._modifiedCodeLens)); - this.originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(newOptions, this._originalIsEditable, this._originalCodeLens)); - // enableSplitViewResizing - if (typeof newOptions.enableSplitViewResizing !== 'undefined') { - this._enableSplitViewResizing = newOptions.enableSplitViewResizing; - } - this._strategy.setEnableSplitViewResizing(this._enableSplitViewResizing); - // renderSideBySide - if (renderSideBySideChanged) { - if (this._renderSideBySide) { - this._setStrategy(new DiffEditorWidgetSideBySide(this._createDataSource(), this._enableSplitViewResizing)); - } - else { - this._setStrategy(new DiffEditorWidgetInline(this._createDataSource(), this._enableSplitViewResizing)); - } - // Update class name - this._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getColorTheme(), this._renderSideBySide); - } - } - getModel() { - return { - original: this.originalEditor.getModel(), - modified: this.modifiedEditor.getModel() - }; - } - setModel(model) { - // Guard us against partial null model - if (model && (!model.original || !model.modified)) { - throw new Error(!model.original ? 'DiffEditorWidget.setModel: Original model is null' : 'DiffEditorWidget.setModel: Modified model is null'); - } - // Remove all view zones & decorations - this._cleanViewZonesAndDecorations(); - // Update code editor models - this.originalEditor.setModel(model ? model.original : null); - this.modifiedEditor.setModel(model ? model.modified : null); - this._updateDecorationsRunner.cancel(); - // this.originalEditor.onDidChangeModelOptions - if (model) { - this.originalEditor.setScrollTop(0); - this.modifiedEditor.setScrollTop(0); - } - // Disable any diff computations that will come in - this._diffComputationResult = null; - this._diffComputationToken++; - this._setState(0 /* Idle */); - if (model) { - this._recreateOverviewRulers(); - // Begin comparing - this._beginUpdateDecorations(); - } - this._layoutOverviewViewport(); - } - getDomNode() { - return this._domElement; - } - getVisibleColumnFromPosition(position) { - return this.modifiedEditor.getVisibleColumnFromPosition(position); - } - getPosition() { - return this.modifiedEditor.getPosition(); - } - setPosition(position) { - this.modifiedEditor.setPosition(position); - } - revealLine(lineNumber, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealLine(lineNumber, scrollType); - } - revealLineInCenter(lineNumber, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealLineInCenter(lineNumber, scrollType); - } - revealLineInCenterIfOutsideViewport(lineNumber, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealLineInCenterIfOutsideViewport(lineNumber, scrollType); - } - revealLineNearTop(lineNumber, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealLineNearTop(lineNumber, scrollType); - } - revealPosition(position, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealPosition(position, scrollType); - } - revealPositionInCenter(position, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealPositionInCenter(position, scrollType); - } - revealPositionInCenterIfOutsideViewport(position, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealPositionInCenterIfOutsideViewport(position, scrollType); - } - revealPositionNearTop(position, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealPositionNearTop(position, scrollType); - } - getSelection() { - return this.modifiedEditor.getSelection(); - } - getSelections() { - return this.modifiedEditor.getSelections(); - } - setSelection(something) { - this.modifiedEditor.setSelection(something); - } - setSelections(ranges) { - this.modifiedEditor.setSelections(ranges); - } - revealLines(startLineNumber, endLineNumber, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealLines(startLineNumber, endLineNumber, scrollType); - } - revealLinesInCenter(startLineNumber, endLineNumber, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealLinesInCenter(startLineNumber, endLineNumber, scrollType); - } - revealLinesInCenterIfOutsideViewport(startLineNumber, endLineNumber, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealLinesInCenterIfOutsideViewport(startLineNumber, endLineNumber, scrollType); - } - revealLinesNearTop(startLineNumber, endLineNumber, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealLinesNearTop(startLineNumber, endLineNumber, scrollType); - } - revealRange(range, scrollType = 0 /* Smooth */, revealVerticalInCenter = false, revealHorizontal = true) { - this.modifiedEditor.revealRange(range, scrollType, revealVerticalInCenter, revealHorizontal); - } - revealRangeInCenter(range, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealRangeInCenter(range, scrollType); - } - revealRangeInCenterIfOutsideViewport(range, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealRangeInCenterIfOutsideViewport(range, scrollType); - } - revealRangeNearTop(range, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealRangeNearTop(range, scrollType); - } - revealRangeNearTopIfOutsideViewport(range, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealRangeNearTopIfOutsideViewport(range, scrollType); - } - revealRangeAtTop(range, scrollType = 0 /* Smooth */) { - this.modifiedEditor.revealRangeAtTop(range, scrollType); - } - getSupportedActions() { - return this.modifiedEditor.getSupportedActions(); - } - saveViewState() { - let originalViewState = this.originalEditor.saveViewState(); - let modifiedViewState = this.modifiedEditor.saveViewState(); - return { - original: originalViewState, - modified: modifiedViewState - }; - } - restoreViewState(s) { - if (s.original && s.modified) { - let diffEditorState = s; - this.originalEditor.restoreViewState(diffEditorState.original); - this.modifiedEditor.restoreViewState(diffEditorState.modified); - } - } - layout(dimension) { - this._elementSizeObserver.observe(dimension); - } - focus() { - this.modifiedEditor.focus(); - } - hasTextFocus() { - return this.originalEditor.hasTextFocus() || this.modifiedEditor.hasTextFocus(); - } - trigger(source, handlerId, payload) { - this.modifiedEditor.trigger(source, handlerId, payload); - } - changeDecorations(callback) { - return this.modifiedEditor.changeDecorations(callback); - } - //------------ end IDiffEditor methods - //------------ begin layouting methods - _onDidContainerSizeChanged() { - this._doLayout(); - } - _getReviewHeight() { - return this._reviewPane.isVisible() ? this._elementSizeObserver.getHeight() : 0; - } - _layoutOverviewRulers() { - if (!this._originalOverviewRuler || !this._modifiedOverviewRuler) { - return; - } - const height = this._elementSizeObserver.getHeight(); - const reviewHeight = this._getReviewHeight(); - let freeSpace = DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH - 2 * DiffEditorWidget.ONE_OVERVIEW_WIDTH; - let layoutInfo = this.modifiedEditor.getLayoutInfo(); - if (layoutInfo) { - this._originalOverviewRuler.setLayout({ - top: 0, - width: DiffEditorWidget.ONE_OVERVIEW_WIDTH, - right: freeSpace + DiffEditorWidget.ONE_OVERVIEW_WIDTH, - height: (height - reviewHeight) - }); - this._modifiedOverviewRuler.setLayout({ - top: 0, - right: 0, - width: DiffEditorWidget.ONE_OVERVIEW_WIDTH, - height: (height - reviewHeight) - }); - } - } - //------------ end layouting methods - _onViewZonesChanged() { - if (this._currentlyChangingViewZones) { - return; - } - this._updateDecorationsRunner.schedule(); - } - _beginUpdateDecorationsSoon() { - // Clear previous timeout if necessary - if (this._beginUpdateDecorationsTimeout !== -1) { - window.clearTimeout(this._beginUpdateDecorationsTimeout); - this._beginUpdateDecorationsTimeout = -1; - } - this._beginUpdateDecorationsTimeout = window.setTimeout(() => this._beginUpdateDecorations(), DiffEditorWidget.UPDATE_DIFF_DECORATIONS_DELAY); - } - static _equals(a, b) { - if (!a && !b) { - return true; - } - if (!a || !b) { - return false; - } - return (a.toString() === b.toString()); - } - _beginUpdateDecorations() { - this._beginUpdateDecorationsTimeout = -1; - const currentOriginalModel = this.originalEditor.getModel(); - const currentModifiedModel = this.modifiedEditor.getModel(); - if (!currentOriginalModel || !currentModifiedModel) { - return; - } - // Prevent old diff requests to come if a new request has been initiated - // The best method would be to call cancel on the Promise, but this is not - // yet supported, so using tokens for now. - this._diffComputationToken++; - let currentToken = this._diffComputationToken; - this._setState(1 /* ComputingDiff */); - if (!this._editorWorkerService.canComputeDiff(currentOriginalModel.uri, currentModifiedModel.uri)) { - if (!DiffEditorWidget._equals(currentOriginalModel.uri, this._lastOriginalWarning) - || !DiffEditorWidget._equals(currentModifiedModel.uri, this._lastModifiedWarning)) { - this._lastOriginalWarning = currentOriginalModel.uri; - this._lastModifiedWarning = currentModifiedModel.uri; - this._notificationService.warn(_nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]("diff.tooLarge", "Cannot compare files because one file is too large.")); - } - return; - } - this._editorWorkerService.computeDiff(currentOriginalModel.uri, currentModifiedModel.uri, this._ignoreTrimWhitespace, this._maxComputationTime).then((result) => { - if (currentToken === this._diffComputationToken - && currentOriginalModel === this.originalEditor.getModel() - && currentModifiedModel === this.modifiedEditor.getModel()) { - this._setState(2 /* DiffComputed */); - this._diffComputationResult = result; - this._updateDecorationsRunner.schedule(); - this._onDidUpdateDiff.fire(); - } - }, (error) => { - if (currentToken === this._diffComputationToken - && currentOriginalModel === this.originalEditor.getModel() - && currentModifiedModel === this.modifiedEditor.getModel()) { - this._setState(2 /* DiffComputed */); - this._diffComputationResult = null; - this._updateDecorationsRunner.schedule(); - } - }); - } - _cleanViewZonesAndDecorations() { - this._originalEditorState.clean(this.originalEditor); - this._modifiedEditorState.clean(this.modifiedEditor); - } - _updateDecorations() { - if (!this.originalEditor.getModel() || !this.modifiedEditor.getModel() || !this._originalOverviewRuler || !this._modifiedOverviewRuler) { - return; - } - const lineChanges = (this._diffComputationResult ? this._diffComputationResult.changes : []); - let foreignOriginal = this._originalEditorState.getForeignViewZones(this.originalEditor.getWhitespaces()); - let foreignModified = this._modifiedEditorState.getForeignViewZones(this.modifiedEditor.getWhitespaces()); - let diffDecorations = this._strategy.getEditorsDiffDecorations(lineChanges, this._ignoreTrimWhitespace, this._renderIndicators, foreignOriginal, foreignModified, this.originalEditor, this.modifiedEditor); - try { - this._currentlyChangingViewZones = true; - this._originalEditorState.apply(this.originalEditor, this._originalOverviewRuler, diffDecorations.original, false); - this._modifiedEditorState.apply(this.modifiedEditor, this._modifiedOverviewRuler, diffDecorations.modified, true); - } - finally { - this._currentlyChangingViewZones = false; - } - } - _adjustOptionsForSubEditor(options) { - let clonedOptions = _base_common_objects_js__WEBPACK_IMPORTED_MODULE_8__["deepClone"](options || {}); - clonedOptions.inDiffEditor = true; - clonedOptions.wordWrap = 'off'; - clonedOptions.wordWrapMinified = false; - clonedOptions.automaticLayout = false; - clonedOptions.scrollbar = clonedOptions.scrollbar || {}; - clonedOptions.scrollbar.vertical = 'visible'; - clonedOptions.folding = false; - clonedOptions.codeLens = false; - clonedOptions.fixedOverflowWidgets = true; - clonedOptions.overflowWidgetsDomNode = options.overflowWidgetsDomNode; - // clonedOptions.lineDecorationsWidth = '2ch'; - if (!clonedOptions.minimap) { - clonedOptions.minimap = {}; - } - clonedOptions.minimap.enabled = false; - return clonedOptions; - } - _adjustOptionsForLeftHandSide(options, isEditable, isCodeLensEnabled) { - let result = this._adjustOptionsForSubEditor(options); - if (isCodeLensEnabled) { - result.codeLens = true; - } - result.readOnly = !isEditable; - result.extraEditorClassName = 'original-in-monaco-diff-editor'; - return result; - } - _adjustOptionsForRightHandSide(options, isCodeLensEnabled) { - let result = this._adjustOptionsForSubEditor(options); - if (isCodeLensEnabled) { - result.codeLens = true; - } - result.revealHorizontalRightPadding = _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_14__["EditorOptions"].revealHorizontalRightPadding.defaultValue + DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH; - result.scrollbar.verticalHasArrows = false; - result.extraEditorClassName = 'modified-in-monaco-diff-editor'; - return result; - } - doLayout() { - this._elementSizeObserver.observe(); - this._doLayout(); - } - _doLayout() { - const width = this._elementSizeObserver.getWidth(); - const height = this._elementSizeObserver.getHeight(); - const reviewHeight = this._getReviewHeight(); - let splitPoint = this._strategy.layout(); - this._originalDomNode.style.width = splitPoint + 'px'; - this._originalDomNode.style.left = '0px'; - this._modifiedDomNode.style.width = (width - splitPoint) + 'px'; - this._modifiedDomNode.style.left = splitPoint + 'px'; - this._overviewDomElement.style.top = '0px'; - this._overviewDomElement.style.height = (height - reviewHeight) + 'px'; - this._overviewDomElement.style.width = DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH + 'px'; - this._overviewDomElement.style.left = (width - DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH) + 'px'; - this._overviewViewportDomElement.setWidth(DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH); - this._overviewViewportDomElement.setHeight(30); - this.originalEditor.layout({ width: splitPoint, height: (height - reviewHeight) }); - this.modifiedEditor.layout({ width: width - splitPoint - DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH, height: (height - reviewHeight) }); - if (this._originalOverviewRuler || this._modifiedOverviewRuler) { - this._layoutOverviewRulers(); - } - this._reviewPane.layout(height - reviewHeight, width, reviewHeight); - this._layoutOverviewViewport(); - } - _layoutOverviewViewport() { - let layout = this._computeOverviewViewport(); - if (!layout) { - this._overviewViewportDomElement.setTop(0); - this._overviewViewportDomElement.setHeight(0); - } - else { - this._overviewViewportDomElement.setTop(layout.top); - this._overviewViewportDomElement.setHeight(layout.height); - } - } - _computeOverviewViewport() { - let layoutInfo = this.modifiedEditor.getLayoutInfo(); - if (!layoutInfo) { - return null; - } - let scrollTop = this.modifiedEditor.getScrollTop(); - let scrollHeight = this.modifiedEditor.getScrollHeight(); - let computedAvailableSize = Math.max(0, layoutInfo.height); - let computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * 0); - let computedRatio = scrollHeight > 0 ? (computedRepresentableSize / scrollHeight) : 0; - let computedSliderSize = Math.max(0, Math.floor(layoutInfo.height * computedRatio)); - let computedSliderPosition = Math.floor(scrollTop * computedRatio); - return { - height: computedSliderSize, - top: computedSliderPosition - }; - } - _createDataSource() { - return { - getWidth: () => { - return this._elementSizeObserver.getWidth(); - }, - getHeight: () => { - return (this._elementSizeObserver.getHeight() - this._getReviewHeight()); - }, - getContainerDomNode: () => { - return this._containerDomElement; - }, - relayoutEditors: () => { - this._doLayout(); - }, - getOriginalEditor: () => { - return this.originalEditor; - }, - getModifiedEditor: () => { - return this.modifiedEditor; - } - }; - } - _setStrategy(newStrategy) { - if (this._strategy) { - this._strategy.dispose(); - } - this._strategy = newStrategy; - newStrategy.applyColors(this._themeService.getColorTheme()); - if (this._diffComputationResult) { - this._updateDecorations(); - } - // Just do a layout, the strategy might need it - this._doLayout(); - } - _getLineChangeAtOrBeforeLineNumber(lineNumber, startLineNumberExtractor) { - const lineChanges = (this._diffComputationResult ? this._diffComputationResult.changes : []); - if (lineChanges.length === 0 || lineNumber < startLineNumberExtractor(lineChanges[0])) { - // There are no changes or `lineNumber` is before the first change - return null; - } - let min = 0, max = lineChanges.length - 1; - while (min < max) { - let mid = Math.floor((min + max) / 2); - let midStart = startLineNumberExtractor(lineChanges[mid]); - let midEnd = (mid + 1 <= max ? startLineNumberExtractor(lineChanges[mid + 1]) : 1073741824 /* MAX_SAFE_SMALL_INTEGER */); - if (lineNumber < midStart) { - max = mid - 1; - } - else if (lineNumber >= midEnd) { - min = mid + 1; - } - else { - // HIT! - min = mid; - max = mid; - } - } - return lineChanges[min]; - } - _getEquivalentLineForOriginalLineNumber(lineNumber) { - let lineChange = this._getLineChangeAtOrBeforeLineNumber(lineNumber, (lineChange) => lineChange.originalStartLineNumber); - if (!lineChange) { - return lineNumber; - } - let originalEquivalentLineNumber = lineChange.originalStartLineNumber + (lineChange.originalEndLineNumber > 0 ? -1 : 0); - let modifiedEquivalentLineNumber = lineChange.modifiedStartLineNumber + (lineChange.modifiedEndLineNumber > 0 ? -1 : 0); - let lineChangeOriginalLength = (lineChange.originalEndLineNumber > 0 ? (lineChange.originalEndLineNumber - lineChange.originalStartLineNumber + 1) : 0); - let lineChangeModifiedLength = (lineChange.modifiedEndLineNumber > 0 ? (lineChange.modifiedEndLineNumber - lineChange.modifiedStartLineNumber + 1) : 0); - let delta = lineNumber - originalEquivalentLineNumber; - if (delta <= lineChangeOriginalLength) { - return modifiedEquivalentLineNumber + Math.min(delta, lineChangeModifiedLength); - } - return modifiedEquivalentLineNumber + lineChangeModifiedLength - lineChangeOriginalLength + delta; - } - _getEquivalentLineForModifiedLineNumber(lineNumber) { - let lineChange = this._getLineChangeAtOrBeforeLineNumber(lineNumber, (lineChange) => lineChange.modifiedStartLineNumber); - if (!lineChange) { - return lineNumber; - } - let originalEquivalentLineNumber = lineChange.originalStartLineNumber + (lineChange.originalEndLineNumber > 0 ? -1 : 0); - let modifiedEquivalentLineNumber = lineChange.modifiedStartLineNumber + (lineChange.modifiedEndLineNumber > 0 ? -1 : 0); - let lineChangeOriginalLength = (lineChange.originalEndLineNumber > 0 ? (lineChange.originalEndLineNumber - lineChange.originalStartLineNumber + 1) : 0); - let lineChangeModifiedLength = (lineChange.modifiedEndLineNumber > 0 ? (lineChange.modifiedEndLineNumber - lineChange.modifiedStartLineNumber + 1) : 0); - let delta = lineNumber - modifiedEquivalentLineNumber; - if (delta <= lineChangeModifiedLength) { - return originalEquivalentLineNumber + Math.min(delta, lineChangeOriginalLength); - } - return originalEquivalentLineNumber + lineChangeOriginalLength - lineChangeModifiedLength + delta; - } - getDiffLineInformationForOriginal(lineNumber) { - if (!this._diffComputationResult) { - // Cannot answer that which I don't know - return null; - } - return { - equivalentLineNumber: this._getEquivalentLineForOriginalLineNumber(lineNumber) - }; - } - getDiffLineInformationForModified(lineNumber) { - if (!this._diffComputationResult) { - // Cannot answer that which I don't know - return null; - } - return { - equivalentLineNumber: this._getEquivalentLineForModifiedLineNumber(lineNumber) - }; - } -}; -DiffEditorWidget.ONE_OVERVIEW_WIDTH = 15; -DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH = 30; -DiffEditorWidget.UPDATE_DIFF_DECORATIONS_DELAY = 200; // ms -DiffEditorWidget = __decorate([ - __param(2, _platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_32__["IClipboardService"]), - __param(3, _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_19__["IEditorWorkerService"]), - __param(4, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_24__["IContextKeyService"]), - __param(5, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_25__["IInstantiationService"]), - __param(6, _services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_11__["ICodeEditorService"]), - __param(7, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_29__["IThemeService"]), - __param(8, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_27__["INotificationService"]), - __param(9, _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_30__["IContextMenuService"]), - __param(10, _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_35__["IEditorProgressService"]) -], DiffEditorWidget); - -class DiffEditorWidgetStyle extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["Disposable"] { - constructor(dataSource) { - super(); - this._dataSource = dataSource; - this._insertColor = null; - this._removeColor = null; - } - applyColors(theme) { - let newInsertColor = (theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["diffInserted"]) || _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["defaultInsertColor"]).transparent(2); - let newRemoveColor = (theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["diffRemoved"]) || _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["defaultRemoveColor"]).transparent(2); - let hasChanges = !newInsertColor.equals(this._insertColor) || !newRemoveColor.equals(this._removeColor); - this._insertColor = newInsertColor; - this._removeColor = newRemoveColor; - return hasChanges; - } - getEditorsDiffDecorations(lineChanges, ignoreTrimWhitespace, renderIndicators, originalWhitespaces, modifiedWhitespaces, originalEditor, modifiedEditor) { - // Get view zones - modifiedWhitespaces = modifiedWhitespaces.sort((a, b) => { - return a.afterLineNumber - b.afterLineNumber; - }); - originalWhitespaces = originalWhitespaces.sort((a, b) => { - return a.afterLineNumber - b.afterLineNumber; - }); - let zones = this._getViewZones(lineChanges, originalWhitespaces, modifiedWhitespaces, originalEditor, modifiedEditor, renderIndicators); - // Get decorations & overview ruler zones - let originalDecorations = this._getOriginalEditorDecorations(lineChanges, ignoreTrimWhitespace, renderIndicators, originalEditor, modifiedEditor); - let modifiedDecorations = this._getModifiedEditorDecorations(lineChanges, ignoreTrimWhitespace, renderIndicators, originalEditor, modifiedEditor); - return { - original: { - decorations: originalDecorations.decorations, - overviewZones: originalDecorations.overviewZones, - zones: zones.original - }, - modified: { - decorations: modifiedDecorations.decorations, - overviewZones: modifiedDecorations.overviewZones, - zones: zones.modified - } - }; - } -} -class ForeignViewZonesIterator { - constructor(source) { - this._source = source; - this._index = -1; - this.current = null; - this.advance(); - } - advance() { - this._index++; - if (this._index < this._source.length) { - this.current = this._source[this._index]; - } - else { - this.current = null; - } - } -} -class ViewZonesComputer { - constructor(lineChanges, originalForeignVZ, originalLineHeight, modifiedForeignVZ, modifiedLineHeight) { - this.lineChanges = lineChanges; - this.originalForeignVZ = originalForeignVZ; - this.originalLineHeight = originalLineHeight; - this.modifiedForeignVZ = modifiedForeignVZ; - this.modifiedLineHeight = modifiedLineHeight; - } - getViewZones() { - let result = { - original: [], - modified: [] - }; - let lineChangeModifiedLength = 0; - let lineChangeOriginalLength = 0; - let originalEquivalentLineNumber = 0; - let modifiedEquivalentLineNumber = 0; - let originalEndEquivalentLineNumber = 0; - let modifiedEndEquivalentLineNumber = 0; - let sortMyViewZones = (a, b) => { - return a.afterLineNumber - b.afterLineNumber; - }; - let addAndCombineIfPossible = (destination, item) => { - if (item.domNode === null && destination.length > 0) { - let lastItem = destination[destination.length - 1]; - if (lastItem.afterLineNumber === item.afterLineNumber && lastItem.domNode === null) { - lastItem.heightInLines += item.heightInLines; - return; - } - } - destination.push(item); - }; - let modifiedForeignVZ = new ForeignViewZonesIterator(this.modifiedForeignVZ); - let originalForeignVZ = new ForeignViewZonesIterator(this.originalForeignVZ); - // In order to include foreign view zones after the last line change, the for loop will iterate once more after the end of the `lineChanges` array - for (let i = 0, length = this.lineChanges.length; i <= length; i++) { - let lineChange = (i < length ? this.lineChanges[i] : null); - if (lineChange !== null) { - originalEquivalentLineNumber = lineChange.originalStartLineNumber + (lineChange.originalEndLineNumber > 0 ? -1 : 0); - modifiedEquivalentLineNumber = lineChange.modifiedStartLineNumber + (lineChange.modifiedEndLineNumber > 0 ? -1 : 0); - lineChangeOriginalLength = (lineChange.originalEndLineNumber > 0 ? (lineChange.originalEndLineNumber - lineChange.originalStartLineNumber + 1) : 0); - lineChangeModifiedLength = (lineChange.modifiedEndLineNumber > 0 ? (lineChange.modifiedEndLineNumber - lineChange.modifiedStartLineNumber + 1) : 0); - originalEndEquivalentLineNumber = Math.max(lineChange.originalStartLineNumber, lineChange.originalEndLineNumber); - modifiedEndEquivalentLineNumber = Math.max(lineChange.modifiedStartLineNumber, lineChange.modifiedEndLineNumber); - } - else { - // Increase to very large value to get the producing tests of foreign view zones running - originalEquivalentLineNumber += 10000000 + lineChangeOriginalLength; - modifiedEquivalentLineNumber += 10000000 + lineChangeModifiedLength; - originalEndEquivalentLineNumber = originalEquivalentLineNumber; - modifiedEndEquivalentLineNumber = modifiedEquivalentLineNumber; - } - // Each step produces view zones, and after producing them, we try to cancel them out, to avoid empty-empty view zone cases - let stepOriginal = []; - let stepModified = []; - // ---------------------------- PRODUCE VIEW ZONES - // [PRODUCE] View zone(s) in original-side due to foreign view zone(s) in modified-side - while (modifiedForeignVZ.current && modifiedForeignVZ.current.afterLineNumber <= modifiedEndEquivalentLineNumber) { - let viewZoneLineNumber; - if (modifiedForeignVZ.current.afterLineNumber <= modifiedEquivalentLineNumber) { - viewZoneLineNumber = originalEquivalentLineNumber - modifiedEquivalentLineNumber + modifiedForeignVZ.current.afterLineNumber; - } - else { - viewZoneLineNumber = originalEndEquivalentLineNumber; - } - let marginDomNode = null; - if (lineChange && lineChange.modifiedStartLineNumber <= modifiedForeignVZ.current.afterLineNumber && modifiedForeignVZ.current.afterLineNumber <= lineChange.modifiedEndLineNumber) { - marginDomNode = this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(); - } - stepOriginal.push({ - afterLineNumber: viewZoneLineNumber, - heightInLines: modifiedForeignVZ.current.height / this.modifiedLineHeight, - domNode: null, - marginDomNode: marginDomNode - }); - modifiedForeignVZ.advance(); - } - // [PRODUCE] View zone(s) in modified-side due to foreign view zone(s) in original-side - while (originalForeignVZ.current && originalForeignVZ.current.afterLineNumber <= originalEndEquivalentLineNumber) { - let viewZoneLineNumber; - if (originalForeignVZ.current.afterLineNumber <= originalEquivalentLineNumber) { - viewZoneLineNumber = modifiedEquivalentLineNumber - originalEquivalentLineNumber + originalForeignVZ.current.afterLineNumber; - } - else { - viewZoneLineNumber = modifiedEndEquivalentLineNumber; - } - stepModified.push({ - afterLineNumber: viewZoneLineNumber, - heightInLines: originalForeignVZ.current.height / this.originalLineHeight, - domNode: null - }); - originalForeignVZ.advance(); - } - if (lineChange !== null && isChangeOrInsert(lineChange)) { - let r = this._produceOriginalFromDiff(lineChange, lineChangeOriginalLength, lineChangeModifiedLength); - if (r) { - stepOriginal.push(r); - } - } - if (lineChange !== null && isChangeOrDelete(lineChange)) { - let r = this._produceModifiedFromDiff(lineChange, lineChangeOriginalLength, lineChangeModifiedLength); - if (r) { - stepModified.push(r); - } - } - // ---------------------------- END PRODUCE VIEW ZONES - // ---------------------------- EMIT MINIMAL VIEW ZONES - // [CANCEL & EMIT] Try to cancel view zones out - let stepOriginalIndex = 0; - let stepModifiedIndex = 0; - stepOriginal = stepOriginal.sort(sortMyViewZones); - stepModified = stepModified.sort(sortMyViewZones); - while (stepOriginalIndex < stepOriginal.length && stepModifiedIndex < stepModified.length) { - let original = stepOriginal[stepOriginalIndex]; - let modified = stepModified[stepModifiedIndex]; - let originalDelta = original.afterLineNumber - originalEquivalentLineNumber; - let modifiedDelta = modified.afterLineNumber - modifiedEquivalentLineNumber; - if (originalDelta < modifiedDelta) { - addAndCombineIfPossible(result.original, original); - stepOriginalIndex++; - } - else if (modifiedDelta < originalDelta) { - addAndCombineIfPossible(result.modified, modified); - stepModifiedIndex++; - } - else if (original.shouldNotShrink) { - addAndCombineIfPossible(result.original, original); - stepOriginalIndex++; - } - else if (modified.shouldNotShrink) { - addAndCombineIfPossible(result.modified, modified); - stepModifiedIndex++; - } - else { - if (original.heightInLines >= modified.heightInLines) { - // modified view zone gets removed - original.heightInLines -= modified.heightInLines; - stepModifiedIndex++; - } - else { - // original view zone gets removed - modified.heightInLines -= original.heightInLines; - stepOriginalIndex++; - } - } - } - // [EMIT] Remaining original view zones - while (stepOriginalIndex < stepOriginal.length) { - addAndCombineIfPossible(result.original, stepOriginal[stepOriginalIndex]); - stepOriginalIndex++; - } - // [EMIT] Remaining modified view zones - while (stepModifiedIndex < stepModified.length) { - addAndCombineIfPossible(result.modified, stepModified[stepModifiedIndex]); - stepModifiedIndex++; - } - // ---------------------------- END EMIT MINIMAL VIEW ZONES - } - return { - original: ViewZonesComputer._ensureDomNodes(result.original), - modified: ViewZonesComputer._ensureDomNodes(result.modified), - }; - } - static _ensureDomNodes(zones) { - return zones.map((z) => { - if (!z.domNode) { - z.domNode = createFakeLinesDiv(); - } - return z; - }); - } -} -function createDecoration(startLineNumber, startColumn, endLineNumber, endColumn, options) { - return { - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_15__["Range"](startLineNumber, startColumn, endLineNumber, endColumn), - options: options - }; -} -const DECORATIONS = { - charDelete: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_18__["ModelDecorationOptions"].register({ - className: 'char-delete' - }), - charDeleteWholeLine: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_18__["ModelDecorationOptions"].register({ - className: 'char-delete', - isWholeLine: true - }), - charInsert: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_18__["ModelDecorationOptions"].register({ - className: 'char-insert' - }), - charInsertWholeLine: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_18__["ModelDecorationOptions"].register({ - className: 'char-insert', - isWholeLine: true - }), - lineInsert: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_18__["ModelDecorationOptions"].register({ - className: 'line-insert', - marginClassName: 'line-insert', - isWholeLine: true - }), - lineInsertWithSign: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_18__["ModelDecorationOptions"].register({ - className: 'line-insert', - linesDecorationsClassName: 'insert-sign ' + diffInsertIcon.classNames, - marginClassName: 'line-insert', - isWholeLine: true - }), - lineDelete: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_18__["ModelDecorationOptions"].register({ - className: 'line-delete', - marginClassName: 'line-delete', - isWholeLine: true - }), - lineDeleteWithSign: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_18__["ModelDecorationOptions"].register({ - className: 'line-delete', - linesDecorationsClassName: 'delete-sign ' + diffRemoveIcon.classNames, - marginClassName: 'line-delete', - isWholeLine: true - }), - lineDeleteMargin: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_18__["ModelDecorationOptions"].register({ - marginClassName: 'line-delete', - }) -}; -class DiffEditorWidgetSideBySide extends DiffEditorWidgetStyle { - constructor(dataSource, enableSplitViewResizing) { - super(dataSource); - this._disableSash = (enableSplitViewResizing === false); - this._sashRatio = null; - this._sashPosition = null; - this._startSashPosition = null; - this._sash = this._register(new _base_browser_ui_sash_sash_js__WEBPACK_IMPORTED_MODULE_4__["Sash"](this._dataSource.getContainerDomNode(), this, { orientation: 0 /* VERTICAL */ })); - if (this._disableSash) { - this._sash.state = 0 /* Disabled */; - } - this._sash.onDidStart(() => this.onSashDragStart()); - this._sash.onDidChange((e) => this.onSashDrag(e)); - this._sash.onDidEnd(() => this.onSashDragEnd()); - this._sash.onDidReset(() => this.onSashReset()); - } - setEnableSplitViewResizing(enableSplitViewResizing) { - let newDisableSash = (enableSplitViewResizing === false); - if (this._disableSash !== newDisableSash) { - this._disableSash = newDisableSash; - this._sash.state = this._disableSash ? 0 /* Disabled */ : 3 /* Enabled */; - } - } - layout(sashRatio = this._sashRatio) { - let w = this._dataSource.getWidth(); - let contentWidth = w - DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH; - let sashPosition = Math.floor((sashRatio || 0.5) * contentWidth); - let midPoint = Math.floor(0.5 * contentWidth); - sashPosition = this._disableSash ? midPoint : sashPosition || midPoint; - if (contentWidth > DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH * 2) { - if (sashPosition < DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH) { - sashPosition = DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH; - } - if (sashPosition > contentWidth - DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH) { - sashPosition = contentWidth - DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH; - } - } - else { - sashPosition = midPoint; - } - if (this._sashPosition !== sashPosition) { - this._sashPosition = sashPosition; - this._sash.layout(); - } - return this._sashPosition; - } - onSashDragStart() { - this._startSashPosition = this._sashPosition; - } - onSashDrag(e) { - let w = this._dataSource.getWidth(); - let contentWidth = w - DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH; - let sashPosition = this.layout((this._startSashPosition + (e.currentX - e.startX)) / contentWidth); - this._sashRatio = sashPosition / contentWidth; - this._dataSource.relayoutEditors(); - } - onSashDragEnd() { - this._sash.layout(); - } - onSashReset() { - this._sashRatio = 0.5; - this._dataSource.relayoutEditors(); - this._sash.layout(); - } - getVerticalSashTop(sash) { - return 0; - } - getVerticalSashLeft(sash) { - return this._sashPosition; - } - getVerticalSashHeight(sash) { - return this._dataSource.getHeight(); - } - _getViewZones(lineChanges, originalForeignVZ, modifiedForeignVZ, originalEditor, modifiedEditor) { - let c = new SideBySideViewZonesComputer(lineChanges, originalForeignVZ, originalEditor.getOption(51 /* lineHeight */), modifiedForeignVZ, modifiedEditor.getOption(51 /* lineHeight */)); - return c.getViewZones(); - } - _getOriginalEditorDecorations(lineChanges, ignoreTrimWhitespace, renderIndicators, originalEditor, modifiedEditor) { - const overviewZoneColor = String(this._removeColor); - let result = { - decorations: [], - overviewZones: [] - }; - let originalModel = originalEditor.getModel(); - for (let i = 0, length = lineChanges.length; i < length; i++) { - let lineChange = lineChanges[i]; - if (isChangeOrDelete(lineChange)) { - result.decorations.push({ - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_15__["Range"](lineChange.originalStartLineNumber, 1, lineChange.originalEndLineNumber, 1073741824 /* MAX_SAFE_SMALL_INTEGER */), - options: (renderIndicators ? DECORATIONS.lineDeleteWithSign : DECORATIONS.lineDelete) - }); - if (!isChangeOrInsert(lineChange) || !lineChange.charChanges) { - result.decorations.push(createDecoration(lineChange.originalStartLineNumber, 1, lineChange.originalEndLineNumber, 1073741824 /* MAX_SAFE_SMALL_INTEGER */, DECORATIONS.charDeleteWholeLine)); - } - result.overviewZones.push(new _common_view_overviewZoneManager_js__WEBPACK_IMPORTED_MODULE_20__["OverviewRulerZone"](lineChange.originalStartLineNumber, lineChange.originalEndLineNumber, overviewZoneColor)); - if (lineChange.charChanges) { - for (let j = 0, lengthJ = lineChange.charChanges.length; j < lengthJ; j++) { - let charChange = lineChange.charChanges[j]; - if (isChangeOrDelete(charChange)) { - if (ignoreTrimWhitespace) { - for (let lineNumber = charChange.originalStartLineNumber; lineNumber <= charChange.originalEndLineNumber; lineNumber++) { - let startColumn; - let endColumn; - if (lineNumber === charChange.originalStartLineNumber) { - startColumn = charChange.originalStartColumn; - } - else { - startColumn = originalModel.getLineFirstNonWhitespaceColumn(lineNumber); - } - if (lineNumber === charChange.originalEndLineNumber) { - endColumn = charChange.originalEndColumn; - } - else { - endColumn = originalModel.getLineLastNonWhitespaceColumn(lineNumber); - } - result.decorations.push(createDecoration(lineNumber, startColumn, lineNumber, endColumn, DECORATIONS.charDelete)); - } - } - else { - result.decorations.push(createDecoration(charChange.originalStartLineNumber, charChange.originalStartColumn, charChange.originalEndLineNumber, charChange.originalEndColumn, DECORATIONS.charDelete)); - } - } - } - } - } - } - return result; - } - _getModifiedEditorDecorations(lineChanges, ignoreTrimWhitespace, renderIndicators, originalEditor, modifiedEditor) { - const overviewZoneColor = String(this._insertColor); - let result = { - decorations: [], - overviewZones: [] - }; - let modifiedModel = modifiedEditor.getModel(); - for (let i = 0, length = lineChanges.length; i < length; i++) { - let lineChange = lineChanges[i]; - if (isChangeOrInsert(lineChange)) { - result.decorations.push({ - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_15__["Range"](lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, 1073741824 /* MAX_SAFE_SMALL_INTEGER */), - options: (renderIndicators ? DECORATIONS.lineInsertWithSign : DECORATIONS.lineInsert) - }); - if (!isChangeOrDelete(lineChange) || !lineChange.charChanges) { - result.decorations.push(createDecoration(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, 1073741824 /* MAX_SAFE_SMALL_INTEGER */, DECORATIONS.charInsertWholeLine)); - } - result.overviewZones.push(new _common_view_overviewZoneManager_js__WEBPACK_IMPORTED_MODULE_20__["OverviewRulerZone"](lineChange.modifiedStartLineNumber, lineChange.modifiedEndLineNumber, overviewZoneColor)); - if (lineChange.charChanges) { - for (let j = 0, lengthJ = lineChange.charChanges.length; j < lengthJ; j++) { - let charChange = lineChange.charChanges[j]; - if (isChangeOrInsert(charChange)) { - if (ignoreTrimWhitespace) { - for (let lineNumber = charChange.modifiedStartLineNumber; lineNumber <= charChange.modifiedEndLineNumber; lineNumber++) { - let startColumn; - let endColumn; - if (lineNumber === charChange.modifiedStartLineNumber) { - startColumn = charChange.modifiedStartColumn; - } - else { - startColumn = modifiedModel.getLineFirstNonWhitespaceColumn(lineNumber); - } - if (lineNumber === charChange.modifiedEndLineNumber) { - endColumn = charChange.modifiedEndColumn; - } - else { - endColumn = modifiedModel.getLineLastNonWhitespaceColumn(lineNumber); - } - result.decorations.push(createDecoration(lineNumber, startColumn, lineNumber, endColumn, DECORATIONS.charInsert)); - } - } - else { - result.decorations.push(createDecoration(charChange.modifiedStartLineNumber, charChange.modifiedStartColumn, charChange.modifiedEndLineNumber, charChange.modifiedEndColumn, DECORATIONS.charInsert)); - } - } - } - } - } - } - return result; - } -} -DiffEditorWidgetSideBySide.MINIMUM_EDITOR_WIDTH = 100; -class SideBySideViewZonesComputer extends ViewZonesComputer { - constructor(lineChanges, originalForeignVZ, originalLineHeight, modifiedForeignVZ, modifiedLineHeight) { - super(lineChanges, originalForeignVZ, originalLineHeight, modifiedForeignVZ, modifiedLineHeight); - } - _createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion() { - return null; - } - _produceOriginalFromDiff(lineChange, lineChangeOriginalLength, lineChangeModifiedLength) { - if (lineChangeModifiedLength > lineChangeOriginalLength) { - return { - afterLineNumber: Math.max(lineChange.originalStartLineNumber, lineChange.originalEndLineNumber), - heightInLines: (lineChangeModifiedLength - lineChangeOriginalLength), - domNode: null - }; - } - return null; - } - _produceModifiedFromDiff(lineChange, lineChangeOriginalLength, lineChangeModifiedLength) { - if (lineChangeOriginalLength > lineChangeModifiedLength) { - return { - afterLineNumber: Math.max(lineChange.modifiedStartLineNumber, lineChange.modifiedEndLineNumber), - heightInLines: (lineChangeOriginalLength - lineChangeModifiedLength), - domNode: null - }; - } - return null; - } -} -class DiffEditorWidgetInline extends DiffEditorWidgetStyle { - constructor(dataSource, enableSplitViewResizing) { - super(dataSource); - this.decorationsLeft = dataSource.getOriginalEditor().getLayoutInfo().decorationsLeft; - this._register(dataSource.getOriginalEditor().onDidLayoutChange((layoutInfo) => { - if (this.decorationsLeft !== layoutInfo.decorationsLeft) { - this.decorationsLeft = layoutInfo.decorationsLeft; - dataSource.relayoutEditors(); - } - })); - } - setEnableSplitViewResizing(enableSplitViewResizing) { - // Nothing to do.. - } - _getViewZones(lineChanges, originalForeignVZ, modifiedForeignVZ, originalEditor, modifiedEditor, renderIndicators) { - let computer = new InlineViewZonesComputer(lineChanges, originalForeignVZ, modifiedForeignVZ, originalEditor, modifiedEditor, renderIndicators); - return computer.getViewZones(); - } - _getOriginalEditorDecorations(lineChanges, ignoreTrimWhitespace, renderIndicators, originalEditor, modifiedEditor) { - const overviewZoneColor = String(this._removeColor); - let result = { - decorations: [], - overviewZones: [] - }; - for (let i = 0, length = lineChanges.length; i < length; i++) { - let lineChange = lineChanges[i]; - // Add overview zones in the overview ruler - if (isChangeOrDelete(lineChange)) { - result.decorations.push({ - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_15__["Range"](lineChange.originalStartLineNumber, 1, lineChange.originalEndLineNumber, 1073741824 /* MAX_SAFE_SMALL_INTEGER */), - options: DECORATIONS.lineDeleteMargin - }); - result.overviewZones.push(new _common_view_overviewZoneManager_js__WEBPACK_IMPORTED_MODULE_20__["OverviewRulerZone"](lineChange.originalStartLineNumber, lineChange.originalEndLineNumber, overviewZoneColor)); - } - } - return result; - } - _getModifiedEditorDecorations(lineChanges, ignoreTrimWhitespace, renderIndicators, originalEditor, modifiedEditor) { - const overviewZoneColor = String(this._insertColor); - let result = { - decorations: [], - overviewZones: [] - }; - let modifiedModel = modifiedEditor.getModel(); - for (let i = 0, length = lineChanges.length; i < length; i++) { - let lineChange = lineChanges[i]; - // Add decorations & overview zones - if (isChangeOrInsert(lineChange)) { - result.decorations.push({ - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_15__["Range"](lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, 1073741824 /* MAX_SAFE_SMALL_INTEGER */), - options: (renderIndicators ? DECORATIONS.lineInsertWithSign : DECORATIONS.lineInsert) - }); - result.overviewZones.push(new _common_view_overviewZoneManager_js__WEBPACK_IMPORTED_MODULE_20__["OverviewRulerZone"](lineChange.modifiedStartLineNumber, lineChange.modifiedEndLineNumber, overviewZoneColor)); - if (lineChange.charChanges) { - for (let j = 0, lengthJ = lineChange.charChanges.length; j < lengthJ; j++) { - let charChange = lineChange.charChanges[j]; - if (isChangeOrInsert(charChange)) { - if (ignoreTrimWhitespace) { - for (let lineNumber = charChange.modifiedStartLineNumber; lineNumber <= charChange.modifiedEndLineNumber; lineNumber++) { - let startColumn; - let endColumn; - if (lineNumber === charChange.modifiedStartLineNumber) { - startColumn = charChange.modifiedStartColumn; - } - else { - startColumn = modifiedModel.getLineFirstNonWhitespaceColumn(lineNumber); - } - if (lineNumber === charChange.modifiedEndLineNumber) { - endColumn = charChange.modifiedEndColumn; - } - else { - endColumn = modifiedModel.getLineLastNonWhitespaceColumn(lineNumber); - } - result.decorations.push(createDecoration(lineNumber, startColumn, lineNumber, endColumn, DECORATIONS.charInsert)); - } - } - else { - result.decorations.push(createDecoration(charChange.modifiedStartLineNumber, charChange.modifiedStartColumn, charChange.modifiedEndLineNumber, charChange.modifiedEndColumn, DECORATIONS.charInsert)); - } - } - } - } - else { - result.decorations.push(createDecoration(lineChange.modifiedStartLineNumber, 1, lineChange.modifiedEndLineNumber, 1073741824 /* MAX_SAFE_SMALL_INTEGER */, DECORATIONS.charInsertWholeLine)); - } - } - } - return result; - } - layout() { - // An editor should not be smaller than 5px - return Math.max(5, this.decorationsLeft); - } -} -class InlineViewZonesComputer extends ViewZonesComputer { - constructor(lineChanges, originalForeignVZ, modifiedForeignVZ, originalEditor, modifiedEditor, renderIndicators) { - super(lineChanges, originalForeignVZ, originalEditor.getOption(51 /* lineHeight */), modifiedForeignVZ, modifiedEditor.getOption(51 /* lineHeight */)); - this.originalModel = originalEditor.getModel(); - this.modifiedEditorOptions = modifiedEditor.getOptions(); - this.modifiedEditorTabSize = modifiedEditor.getModel().getOptions().tabSize; - this.renderIndicators = renderIndicators; - } - _createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion() { - let result = document.createElement('div'); - result.className = 'inline-added-margin-view-zone'; - return result; - } - _produceOriginalFromDiff(lineChange, lineChangeOriginalLength, lineChangeModifiedLength) { - let marginDomNode = document.createElement('div'); - marginDomNode.className = 'inline-added-margin-view-zone'; - return { - afterLineNumber: Math.max(lineChange.originalStartLineNumber, lineChange.originalEndLineNumber), - heightInLines: lineChangeModifiedLength, - domNode: document.createElement('div'), - marginDomNode: marginDomNode - }; - } - _produceModifiedFromDiff(lineChange, lineChangeOriginalLength, lineChangeModifiedLength) { - let decorations = []; - if (lineChange.charChanges) { - for (let j = 0, lengthJ = lineChange.charChanges.length; j < lengthJ; j++) { - let charChange = lineChange.charChanges[j]; - if (isChangeOrDelete(charChange)) { - decorations.push(new _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_23__["InlineDecoration"](new _common_core_range_js__WEBPACK_IMPORTED_MODULE_15__["Range"](charChange.originalStartLineNumber, charChange.originalStartColumn, charChange.originalEndLineNumber, charChange.originalEndColumn), 'char-delete', 0 /* Regular */)); - } - } - } - let sb = Object(_common_core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_16__["createStringBuilder"])(10000); - let marginHTML = []; - const layoutInfo = this.modifiedEditorOptions.get(117 /* layoutInfo */); - const fontInfo = this.modifiedEditorOptions.get(36 /* fontInfo */); - const lineDecorationsWidth = layoutInfo.decorationsWidth; - let lineHeight = this.modifiedEditorOptions.get(51 /* lineHeight */); - const typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth; - let maxCharsPerLine = 0; - const originalContent = []; - for (let lineNumber = lineChange.originalStartLineNumber; lineNumber <= lineChange.originalEndLineNumber; lineNumber++) { - maxCharsPerLine = Math.max(maxCharsPerLine, this._renderOriginalLine(lineNumber - lineChange.originalStartLineNumber, this.originalModel, this.modifiedEditorOptions, this.modifiedEditorTabSize, lineNumber, decorations, sb)); - originalContent.push(this.originalModel.getLineContent(lineNumber)); - if (this.renderIndicators) { - let index = lineNumber - lineChange.originalStartLineNumber; - marginHTML = marginHTML.concat([ - `
    ` - ]); - } - } - maxCharsPerLine += this.modifiedEditorOptions.get(85 /* scrollBeyondLastColumn */); - let domNode = document.createElement('div'); - domNode.className = `view-lines line-delete ${_base_browser_ui_mouseCursor_mouseCursor_js__WEBPACK_IMPORTED_MODULE_38__["MOUSE_CURSOR_TEXT_CSS_CLASS_NAME"]}`; - domNode.innerHTML = sb.build(); - _config_configuration_js__WEBPACK_IMPORTED_MODULE_9__["Configuration"].applyFontInfoSlow(domNode, fontInfo); - let marginDomNode = document.createElement('div'); - marginDomNode.className = 'inline-deleted-margin-view-zone'; - marginDomNode.innerHTML = marginHTML.join(''); - _config_configuration_js__WEBPACK_IMPORTED_MODULE_9__["Configuration"].applyFontInfoSlow(marginDomNode, fontInfo); - return { - shouldNotShrink: true, - afterLineNumber: (lineChange.modifiedEndLineNumber === 0 ? lineChange.modifiedStartLineNumber : lineChange.modifiedStartLineNumber - 1), - heightInLines: lineChangeOriginalLength, - minWidthInPx: (maxCharsPerLine * typicalHalfwidthCharacterWidth), - domNode: domNode, - marginDomNode: marginDomNode, - diff: { - originalStartLineNumber: lineChange.originalStartLineNumber, - originalEndLineNumber: lineChange.originalEndLineNumber, - modifiedStartLineNumber: lineChange.modifiedStartLineNumber, - modifiedEndLineNumber: lineChange.modifiedEndLineNumber, - originalContent: originalContent - } - }; - } - _renderOriginalLine(count, originalModel, options, tabSize, lineNumber, decorations, sb) { - const lineTokens = originalModel.getLineTokens(lineNumber); - const lineContent = lineTokens.getLineContent(); - const fontInfo = options.get(36 /* fontInfo */); - const actualDecorations = _common_viewLayout_lineDecorations_js__WEBPACK_IMPORTED_MODULE_21__["LineDecoration"].filter(decorations, lineNumber, 1, lineContent.length + 1); - sb.appendASCIIString('
    '); - const isBasicASCII = _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_23__["ViewLineRenderingData"].isBasicASCII(lineContent, originalModel.mightContainNonBasicASCII()); - const containsRTL = _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_23__["ViewLineRenderingData"].containsRTL(lineContent, isBasicASCII, originalModel.mightContainRTL()); - const output = Object(_common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_22__["renderViewLine"])(new _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_22__["RenderLineInput"]((fontInfo.isMonospace && !options.get(24 /* disableMonospaceOptimizations */)), fontInfo.canUseHalfwidthRightwardsArrow, lineContent, false, isBasicASCII, containsRTL, 0, lineTokens, actualDecorations, tabSize, 0, fontInfo.spaceWidth, fontInfo.middotWidth, fontInfo.wsmiddotWidth, options.get(95 /* stopRenderingLineAfter */), options.get(80 /* renderWhitespace */), options.get(74 /* renderControlCharacters */), options.get(37 /* fontLigatures */) !== _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_14__["EditorFontLigatures"].OFF, null // Send no selections, original line cannot be selected - ), sb); - sb.appendASCIIString('
    '); - const absoluteOffsets = output.characterMapping.getAbsoluteOffsets(); - return absoluteOffsets.length > 0 ? absoluteOffsets[absoluteOffsets.length - 1] : 0; - } -} -function isChangeOrInsert(lineChange) { - return lineChange.modifiedEndLineNumber > 0; -} -function isChangeOrDelete(lineChange) { - return lineChange.originalEndLineNumber > 0; -} -function createFakeLinesDiv() { - let r = document.createElement('div'); - r.className = 'diagonal-fill'; - return r; -} -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_29__["registerThemingParticipant"])((theme, collector) => { - const added = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["diffInserted"]); - if (added) { - collector.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { background-color: ${added}; }`); - collector.addRule(`.monaco-diff-editor .line-insert, .monaco-diff-editor .char-insert { background-color: ${added}; }`); - collector.addRule(`.monaco-editor .inline-added-margin-view-zone { background-color: ${added}; }`); - } - const removed = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["diffRemoved"]); - if (removed) { - collector.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { background-color: ${removed}; }`); - collector.addRule(`.monaco-diff-editor .line-delete, .monaco-diff-editor .char-delete { background-color: ${removed}; }`); - collector.addRule(`.monaco-editor .inline-deleted-margin-view-zone { background-color: ${removed}; }`); - } - const addedOutline = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["diffInsertedOutline"]); - if (addedOutline) { - collector.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${theme.type === 'hc' ? 'dashed' : 'solid'} ${addedOutline}; }`); - } - const removedOutline = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["diffRemovedOutline"]); - if (removedOutline) { - collector.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${theme.type === 'hc' ? 'dashed' : 'solid'} ${removedOutline}; }`); - } - const shadow = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["scrollbarShadow"]); - if (shadow) { - collector.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${shadow}; }`); - } - const border = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["diffBorder"]); - if (border) { - collector.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${border}; }`); - } - const scrollbarSliderBackgroundColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["scrollbarSliderBackground"]); - if (scrollbarSliderBackgroundColor) { - collector.addRule(` - .monaco-diff-editor .diffViewport { - background: ${scrollbarSliderBackgroundColor}; - } - `); - } - const scrollbarSliderHoverBackgroundColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["scrollbarSliderHoverBackground"]); - if (scrollbarSliderHoverBackgroundColor) { - collector.addRule(` - .monaco-diff-editor .diffViewport:hover { - background: ${scrollbarSliderHoverBackgroundColor}; - } - `); - } - const scrollbarSliderActiveBackgroundColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["scrollbarSliderActiveBackground"]); - if (scrollbarSliderActiveBackgroundColor) { - collector.addRule(` - .monaco-diff-editor .diffViewport:active { - background: ${scrollbarSliderActiveBackgroundColor}; - } - `); - } - const diffDiagonalFillColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_28__["diffDiagonalFill"]); - collector.addRule(` - .monaco-editor .diagonal-fill { - background-image: linear-gradient( - -45deg, - ${diffDiagonalFillColor} 12.5%, - #0000 12.5%, #0000 50%, - ${diffDiagonalFillColor} 50%, ${diffDiagonalFillColor} 62.5%, - #0000 62.5%, #0000 100% - ); - background-size: 8px 8px; - } - `); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/diffNavigator.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/widget/diffNavigator.js ***! - \**********************************************************************************/ -/*! exports provided: DiffNavigator */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffNavigator", function() { return DiffNavigator; }); -/* harmony import */ var _base_common_assert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/assert.js */ "./node_modules/monaco-editor/esm/vs/base/common/assert.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -const defaultOptions = { - followsCaret: true, - ignoreCharChanges: true, - alwaysRevealFirst: true -}; -/** - * Create a new diff navigator for the provided diff editor. - */ -class DiffNavigator extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor(editor, options = {}) { - super(); - this._onDidUpdate = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this._editor = editor; - this._options = _base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__["mixin"](options, defaultOptions, false); - this.disposed = false; - this.nextIdx = -1; - this.ranges = []; - this.ignoreSelectionChange = false; - this.revealFirst = Boolean(this._options.alwaysRevealFirst); - // hook up to diff editor for diff, disposal, and caret move - this._register(this._editor.onDidDispose(() => this.dispose())); - this._register(this._editor.onDidUpdateDiff(() => this._onDiffUpdated())); - if (this._options.followsCaret) { - this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition((e) => { - if (this.ignoreSelectionChange) { - return; - } - this.nextIdx = -1; - })); - } - if (this._options.alwaysRevealFirst) { - this._register(this._editor.getModifiedEditor().onDidChangeModel((e) => { - this.revealFirst = true; - })); - } - // init things - this._init(); - } - _init() { - let changes = this._editor.getLineChanges(); - if (!changes) { - return; - } - } - _onDiffUpdated() { - this._init(); - this._compute(this._editor.getLineChanges()); - if (this.revealFirst) { - // Only reveal first on first non-null changes - if (this._editor.getLineChanges() !== null) { - this.revealFirst = false; - this.nextIdx = -1; - this.next(1 /* Immediate */); - } - } - } - _compute(lineChanges) { - // new ranges - this.ranges = []; - if (lineChanges) { - // create ranges from changes - lineChanges.forEach((lineChange) => { - if (!this._options.ignoreCharChanges && lineChange.charChanges) { - lineChange.charChanges.forEach((charChange) => { - this.ranges.push({ - rhs: true, - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](charChange.modifiedStartLineNumber, charChange.modifiedStartColumn, charChange.modifiedEndLineNumber, charChange.modifiedEndColumn) - }); - }); - } - else { - this.ranges.push({ - rhs: true, - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](lineChange.modifiedStartLineNumber, 1, lineChange.modifiedStartLineNumber, 1) - }); - } - }); - } - // sort - this.ranges.sort((left, right) => { - if (left.range.getStartPosition().isBeforeOrEqual(right.range.getStartPosition())) { - return -1; - } - else if (right.range.getStartPosition().isBeforeOrEqual(left.range.getStartPosition())) { - return 1; - } - else { - return 0; - } - }); - this._onDidUpdate.fire(this); - } - _initIdx(fwd) { - let found = false; - let position = this._editor.getPosition(); - if (!position) { - this.nextIdx = 0; - return; - } - for (let i = 0, len = this.ranges.length; i < len && !found; i++) { - let range = this.ranges[i].range; - if (position.isBeforeOrEqual(range.getStartPosition())) { - this.nextIdx = i + (fwd ? 0 : -1); - found = true; - } - } - if (!found) { - // after the last change - this.nextIdx = fwd ? 0 : this.ranges.length - 1; - } - if (this.nextIdx < 0) { - this.nextIdx = this.ranges.length - 1; - } - } - _move(fwd, scrollType) { - _base_common_assert_js__WEBPACK_IMPORTED_MODULE_0__["ok"](!this.disposed, 'Illegal State - diff navigator has been disposed'); - if (!this.canNavigate()) { - return; - } - if (this.nextIdx === -1) { - this._initIdx(fwd); - } - else if (fwd) { - this.nextIdx += 1; - if (this.nextIdx >= this.ranges.length) { - this.nextIdx = 0; - } - } - else { - this.nextIdx -= 1; - if (this.nextIdx < 0) { - this.nextIdx = this.ranges.length - 1; - } - } - let info = this.ranges[this.nextIdx]; - this.ignoreSelectionChange = true; - try { - let pos = info.range.getStartPosition(); - this._editor.setPosition(pos); - this._editor.revealPositionInCenter(pos, scrollType); - } - finally { - this.ignoreSelectionChange = false; - } - } - canNavigate() { - return this.ranges && this.ranges.length > 0; - } - next(scrollType = 0 /* Smooth */) { - this._move(true, scrollType); - } - previous(scrollType = 0 /* Smooth */) { - this._move(false, scrollType); - } - dispose() { - super.dispose(); - this.ranges = []; - this.disposed = true; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/diffReview.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/widget/diffReview.js ***! - \*******************************************************************************/ -/*! exports provided: DiffReview */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffReview", function() { return DiffReview; }); -/* harmony import */ var _media_diffReview_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/diffReview.css */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/media/diffReview.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _base_browser_ui_actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/browser/ui/actionbar/actionbar.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js"); -/* harmony import */ var _base_browser_ui_scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/browser/ui/scrollbar/scrollableElement.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js"); -/* harmony import */ var _base_common_actions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _config_configuration_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config/configuration.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/config/configuration.js"); -/* harmony import */ var _editorExtensions_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../common/config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _common_core_lineTokens_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../common/core/lineTokens.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/lineTokens.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../common/view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/* harmony import */ var _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../common/viewLayout/viewLineRenderer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLineRenderer.js"); -/* harmony import */ var _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../common/viewModel/viewModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModel.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - - - - - -const DIFF_LINES_PADDING = 3; -class DiffEntry { - constructor(originalLineStart, originalLineEnd, modifiedLineStart, modifiedLineEnd) { - this.originalLineStart = originalLineStart; - this.originalLineEnd = originalLineEnd; - this.modifiedLineStart = modifiedLineStart; - this.modifiedLineEnd = modifiedLineEnd; - } - getType() { - if (this.originalLineStart === 0) { - return 1 /* Insert */; - } - if (this.modifiedLineStart === 0) { - return 2 /* Delete */; - } - return 0 /* Equal */; - } -} -class Diff { - constructor(entries) { - this.entries = entries; - } -} -const diffReviewInsertIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_20__["registerIcon"])('diff-review-insert', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_20__["Codicon"].add); -const diffReviewRemoveIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_20__["registerIcon"])('diff-review-remove', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_20__["Codicon"].remove); -const diffReviewCloseIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_20__["registerIcon"])('diff-review-close', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_20__["Codicon"].close); -class DiffReview extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["Disposable"] { - constructor(diffEditor) { - super(); - this._width = 0; - this._diffEditor = diffEditor; - this._isVisible = false; - this.shadow = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_3__["createFastDomNode"])(document.createElement('div')); - this.shadow.setClassName('diff-review-shadow'); - this.actionBarContainer = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_3__["createFastDomNode"])(document.createElement('div')); - this.actionBarContainer.setClassName('diff-review-actions'); - this._actionBar = this._register(new _base_browser_ui_actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_4__["ActionBar"](this.actionBarContainer.domNode)); - this._actionBar.push(new _base_common_actions_js__WEBPACK_IMPORTED_MODULE_6__["Action"]('diffreview.close', _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.close', "Close"), 'close-diff-review ' + diffReviewCloseIcon.classNames, true, () => { - this.hide(); - return Promise.resolve(null); - }), { label: false, icon: true }); - this.domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_3__["createFastDomNode"])(document.createElement('div')); - this.domNode.setClassName('diff-review monaco-editor-background'); - this._content = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_3__["createFastDomNode"])(document.createElement('div')); - this._content.setClassName('diff-review-content'); - this._content.setAttribute('role', 'code'); - this.scrollbar = this._register(new _base_browser_ui_scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_5__["DomScrollableElement"](this._content.domNode, {})); - this.domNode.domNode.appendChild(this.scrollbar.getDomNode()); - this._register(diffEditor.onDidUpdateDiff(() => { - if (!this._isVisible) { - return; - } - this._diffs = this._compute(); - this._render(); - })); - this._register(diffEditor.getModifiedEditor().onDidChangeCursorPosition(() => { - if (!this._isVisible) { - return; - } - this._render(); - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addStandardDisposableListener"](this.domNode.domNode, 'click', (e) => { - e.preventDefault(); - let row = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["findParentWithClass"](e.target, 'diff-review-row'); - if (row) { - this._goToRow(row); - } - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addStandardDisposableListener"](this.domNode.domNode, 'keydown', (e) => { - if (e.equals(18 /* DownArrow */) - || e.equals(2048 /* CtrlCmd */ | 18 /* DownArrow */) - || e.equals(512 /* Alt */ | 18 /* DownArrow */)) { - e.preventDefault(); - this._goToRow(this._getNextRow()); - } - if (e.equals(16 /* UpArrow */) - || e.equals(2048 /* CtrlCmd */ | 16 /* UpArrow */) - || e.equals(512 /* Alt */ | 16 /* UpArrow */)) { - e.preventDefault(); - this._goToRow(this._getPrevRow()); - } - if (e.equals(9 /* Escape */) - || e.equals(2048 /* CtrlCmd */ | 9 /* Escape */) - || e.equals(512 /* Alt */ | 9 /* Escape */) - || e.equals(1024 /* Shift */ | 9 /* Escape */)) { - e.preventDefault(); - this.hide(); - } - if (e.equals(10 /* Space */) - || e.equals(3 /* Enter */)) { - e.preventDefault(); - this.accept(); - } - })); - this._diffs = []; - this._currentDiff = null; - } - prev() { - let index = 0; - if (!this._isVisible) { - this._diffs = this._compute(); - } - if (this._isVisible) { - let currentIndex = -1; - for (let i = 0, len = this._diffs.length; i < len; i++) { - if (this._diffs[i] === this._currentDiff) { - currentIndex = i; - break; - } - } - index = (this._diffs.length + currentIndex - 1); - } - else { - index = this._findDiffIndex(this._diffEditor.getPosition()); - } - if (this._diffs.length === 0) { - // Nothing to do - return; - } - index = index % this._diffs.length; - const entries = this._diffs[index].entries; - this._diffEditor.setPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_13__["Position"](entries[0].modifiedLineStart, 1)); - this._diffEditor.setSelection({ startColumn: 1, startLineNumber: entries[0].modifiedLineStart, endColumn: 1073741824 /* MAX_SAFE_SMALL_INTEGER */, endLineNumber: entries[entries.length - 1].modifiedLineEnd }); - this._isVisible = true; - this._diffEditor.doLayout(); - this._render(); - this._goToRow(this._getNextRow()); - } - next() { - let index = 0; - if (!this._isVisible) { - this._diffs = this._compute(); - } - if (this._isVisible) { - let currentIndex = -1; - for (let i = 0, len = this._diffs.length; i < len; i++) { - if (this._diffs[i] === this._currentDiff) { - currentIndex = i; - break; - } - } - index = (currentIndex + 1); - } - else { - index = this._findDiffIndex(this._diffEditor.getPosition()); - } - if (this._diffs.length === 0) { - // Nothing to do - return; - } - index = index % this._diffs.length; - const entries = this._diffs[index].entries; - this._diffEditor.setPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_13__["Position"](entries[0].modifiedLineStart, 1)); - this._diffEditor.setSelection({ startColumn: 1, startLineNumber: entries[0].modifiedLineStart, endColumn: 1073741824 /* MAX_SAFE_SMALL_INTEGER */, endLineNumber: entries[entries.length - 1].modifiedLineEnd }); - this._isVisible = true; - this._diffEditor.doLayout(); - this._render(); - this._goToRow(this._getNextRow()); - } - accept() { - let jumpToLineNumber = -1; - let current = this._getCurrentFocusedRow(); - if (current) { - let lineNumber = parseInt(current.getAttribute('data-line'), 10); - if (!isNaN(lineNumber)) { - jumpToLineNumber = lineNumber; - } - } - this.hide(); - if (jumpToLineNumber !== -1) { - this._diffEditor.setPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_13__["Position"](jumpToLineNumber, 1)); - this._diffEditor.revealPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_13__["Position"](jumpToLineNumber, 1), 1 /* Immediate */); - } - } - hide() { - this._isVisible = false; - this._diffEditor.updateOptions({ readOnly: false }); - this._diffEditor.focus(); - this._diffEditor.doLayout(); - this._render(); - } - _getPrevRow() { - let current = this._getCurrentFocusedRow(); - if (!current) { - return this._getFirstRow(); - } - if (current.previousElementSibling) { - return current.previousElementSibling; - } - return current; - } - _getNextRow() { - let current = this._getCurrentFocusedRow(); - if (!current) { - return this._getFirstRow(); - } - if (current.nextElementSibling) { - return current.nextElementSibling; - } - return current; - } - _getFirstRow() { - return this.domNode.domNode.querySelector('.diff-review-row'); - } - _getCurrentFocusedRow() { - let result = document.activeElement; - if (result && /diff-review-row/.test(result.className)) { - return result; - } - return null; - } - _goToRow(row) { - let prev = this._getCurrentFocusedRow(); - row.tabIndex = 0; - row.focus(); - if (prev && prev !== row) { - prev.tabIndex = -1; - } - this.scrollbar.scanDomNode(); - } - isVisible() { - return this._isVisible; - } - layout(top, width, height) { - this._width = width; - this.shadow.setTop(top - 6); - this.shadow.setWidth(width); - this.shadow.setHeight(this._isVisible ? 6 : 0); - this.domNode.setTop(top); - this.domNode.setWidth(width); - this.domNode.setHeight(height); - this._content.setHeight(height); - this._content.setWidth(width); - if (this._isVisible) { - this.actionBarContainer.setAttribute('aria-hidden', 'false'); - this.actionBarContainer.setDisplay('block'); - } - else { - this.actionBarContainer.setAttribute('aria-hidden', 'true'); - this.actionBarContainer.setDisplay('none'); - } - } - _compute() { - const lineChanges = this._diffEditor.getLineChanges(); - if (!lineChanges || lineChanges.length === 0) { - return []; - } - const originalModel = this._diffEditor.getOriginalEditor().getModel(); - const modifiedModel = this._diffEditor.getModifiedEditor().getModel(); - if (!originalModel || !modifiedModel) { - return []; - } - return DiffReview._mergeAdjacent(lineChanges, originalModel.getLineCount(), modifiedModel.getLineCount()); - } - static _mergeAdjacent(lineChanges, originalLineCount, modifiedLineCount) { - if (!lineChanges || lineChanges.length === 0) { - return []; - } - let diffs = [], diffsLength = 0; - for (let i = 0, len = lineChanges.length; i < len; i++) { - const lineChange = lineChanges[i]; - const originalStart = lineChange.originalStartLineNumber; - const originalEnd = lineChange.originalEndLineNumber; - const modifiedStart = lineChange.modifiedStartLineNumber; - const modifiedEnd = lineChange.modifiedEndLineNumber; - let r = [], rLength = 0; - // Emit before anchors - { - const originalEqualAbove = (originalEnd === 0 ? originalStart : originalStart - 1); - const modifiedEqualAbove = (modifiedEnd === 0 ? modifiedStart : modifiedStart - 1); - // Make sure we don't step into the previous diff - let minOriginal = 1; - let minModified = 1; - if (i > 0) { - const prevLineChange = lineChanges[i - 1]; - if (prevLineChange.originalEndLineNumber === 0) { - minOriginal = prevLineChange.originalStartLineNumber + 1; - } - else { - minOriginal = prevLineChange.originalEndLineNumber + 1; - } - if (prevLineChange.modifiedEndLineNumber === 0) { - minModified = prevLineChange.modifiedStartLineNumber + 1; - } - else { - minModified = prevLineChange.modifiedEndLineNumber + 1; - } - } - let fromOriginal = originalEqualAbove - DIFF_LINES_PADDING + 1; - let fromModified = modifiedEqualAbove - DIFF_LINES_PADDING + 1; - if (fromOriginal < minOriginal) { - const delta = minOriginal - fromOriginal; - fromOriginal = fromOriginal + delta; - fromModified = fromModified + delta; - } - if (fromModified < minModified) { - const delta = minModified - fromModified; - fromOriginal = fromOriginal + delta; - fromModified = fromModified + delta; - } - r[rLength++] = new DiffEntry(fromOriginal, originalEqualAbove, fromModified, modifiedEqualAbove); - } - // Emit deleted lines - { - if (originalEnd !== 0) { - r[rLength++] = new DiffEntry(originalStart, originalEnd, 0, 0); - } - } - // Emit inserted lines - { - if (modifiedEnd !== 0) { - r[rLength++] = new DiffEntry(0, 0, modifiedStart, modifiedEnd); - } - } - // Emit after anchors - { - const originalEqualBelow = (originalEnd === 0 ? originalStart + 1 : originalEnd + 1); - const modifiedEqualBelow = (modifiedEnd === 0 ? modifiedStart + 1 : modifiedEnd + 1); - // Make sure we don't step into the next diff - let maxOriginal = originalLineCount; - let maxModified = modifiedLineCount; - if (i + 1 < len) { - const nextLineChange = lineChanges[i + 1]; - if (nextLineChange.originalEndLineNumber === 0) { - maxOriginal = nextLineChange.originalStartLineNumber; - } - else { - maxOriginal = nextLineChange.originalStartLineNumber - 1; - } - if (nextLineChange.modifiedEndLineNumber === 0) { - maxModified = nextLineChange.modifiedStartLineNumber; - } - else { - maxModified = nextLineChange.modifiedStartLineNumber - 1; - } - } - let toOriginal = originalEqualBelow + DIFF_LINES_PADDING - 1; - let toModified = modifiedEqualBelow + DIFF_LINES_PADDING - 1; - if (toOriginal > maxOriginal) { - const delta = maxOriginal - toOriginal; - toOriginal = toOriginal + delta; - toModified = toModified + delta; - } - if (toModified > maxModified) { - const delta = maxModified - toModified; - toOriginal = toOriginal + delta; - toModified = toModified + delta; - } - r[rLength++] = new DiffEntry(originalEqualBelow, toOriginal, modifiedEqualBelow, toModified); - } - diffs[diffsLength++] = new Diff(r); - } - // Merge adjacent diffs - let curr = diffs[0].entries; - let r = [], rLength = 0; - for (let i = 1, len = diffs.length; i < len; i++) { - const thisDiff = diffs[i].entries; - const currLast = curr[curr.length - 1]; - const thisFirst = thisDiff[0]; - if (currLast.getType() === 0 /* Equal */ - && thisFirst.getType() === 0 /* Equal */ - && thisFirst.originalLineStart <= currLast.originalLineEnd) { - // We are dealing with equal lines that overlap - curr[curr.length - 1] = new DiffEntry(currLast.originalLineStart, thisFirst.originalLineEnd, currLast.modifiedLineStart, thisFirst.modifiedLineEnd); - curr = curr.concat(thisDiff.slice(1)); - continue; - } - r[rLength++] = new Diff(curr); - curr = thisDiff; - } - r[rLength++] = new Diff(curr); - return r; - } - _findDiffIndex(pos) { - const lineNumber = pos.lineNumber; - for (let i = 0, len = this._diffs.length; i < len; i++) { - const diff = this._diffs[i].entries; - const lastModifiedLine = diff[diff.length - 1].modifiedLineEnd; - if (lineNumber <= lastModifiedLine) { - return i; - } - } - return 0; - } - _render() { - const originalOptions = this._diffEditor.getOriginalEditor().getOptions(); - const modifiedOptions = this._diffEditor.getModifiedEditor().getOptions(); - const originalModel = this._diffEditor.getOriginalEditor().getModel(); - const modifiedModel = this._diffEditor.getModifiedEditor().getModel(); - const originalModelOpts = originalModel.getOptions(); - const modifiedModelOpts = modifiedModel.getOptions(); - if (!this._isVisible || !originalModel || !modifiedModel) { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["clearNode"](this._content.domNode); - this._currentDiff = null; - this.scrollbar.scanDomNode(); - return; - } - this._diffEditor.updateOptions({ readOnly: true }); - const diffIndex = this._findDiffIndex(this._diffEditor.getPosition()); - if (this._diffs[diffIndex] === this._currentDiff) { - return; - } - this._currentDiff = this._diffs[diffIndex]; - const diffs = this._diffs[diffIndex].entries; - let container = document.createElement('div'); - container.className = 'diff-review-table'; - container.setAttribute('role', 'list'); - container.setAttribute('aria-label', 'Difference review. Use "Stage | Unstage | Revert Selected Ranges" commands'); - _config_configuration_js__WEBPACK_IMPORTED_MODULE_8__["Configuration"].applyFontInfoSlow(container, modifiedOptions.get(36 /* fontInfo */)); - let minOriginalLine = 0; - let maxOriginalLine = 0; - let minModifiedLine = 0; - let maxModifiedLine = 0; - for (let i = 0, len = diffs.length; i < len; i++) { - const diffEntry = diffs[i]; - const originalLineStart = diffEntry.originalLineStart; - const originalLineEnd = diffEntry.originalLineEnd; - const modifiedLineStart = diffEntry.modifiedLineStart; - const modifiedLineEnd = diffEntry.modifiedLineEnd; - if (originalLineStart !== 0 && ((minOriginalLine === 0 || originalLineStart < minOriginalLine))) { - minOriginalLine = originalLineStart; - } - if (originalLineEnd !== 0 && ((maxOriginalLine === 0 || originalLineEnd > maxOriginalLine))) { - maxOriginalLine = originalLineEnd; - } - if (modifiedLineStart !== 0 && ((minModifiedLine === 0 || modifiedLineStart < minModifiedLine))) { - minModifiedLine = modifiedLineStart; - } - if (modifiedLineEnd !== 0 && ((maxModifiedLine === 0 || modifiedLineEnd > maxModifiedLine))) { - maxModifiedLine = modifiedLineEnd; - } - } - let header = document.createElement('div'); - header.className = 'diff-review-row'; - let cell = document.createElement('div'); - cell.className = 'diff-review-cell diff-review-summary'; - const originalChangedLinesCnt = maxOriginalLine - minOriginalLine + 1; - const modifiedChangedLinesCnt = maxModifiedLine - minModifiedLine + 1; - cell.appendChild(document.createTextNode(`${diffIndex + 1}/${this._diffs.length}: @@ -${minOriginalLine},${originalChangedLinesCnt} +${minModifiedLine},${modifiedChangedLinesCnt} @@`)); - header.setAttribute('data-line', String(minModifiedLine)); - const getAriaLines = (lines) => { - if (lines === 0) { - return _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('no_lines_changed', "no lines changed"); - } - else if (lines === 1) { - return _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('one_line_changed', "1 line changed"); - } - else { - return _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('more_lines_changed', "{0} lines changed", lines); - } - }; - const originalChangedLinesCntAria = getAriaLines(originalChangedLinesCnt); - const modifiedChangedLinesCntAria = getAriaLines(modifiedChangedLinesCnt); - header.setAttribute('aria-label', _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]({ - key: 'header', - comment: [ - 'This is the ARIA label for a git diff header.', - 'A git diff header looks like this: @@ -154,12 +159,39 @@.', - 'That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.', - 'Variables 0 and 1 refer to the diff index out of total number of diffs.', - 'Variables 2 and 4 will be numbers (a line number).', - 'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.' - ] - }, "Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}", (diffIndex + 1), this._diffs.length, minOriginalLine, originalChangedLinesCntAria, minModifiedLine, modifiedChangedLinesCntAria)); - header.appendChild(cell); - // @@ -504,7 +517,7 @@ - header.setAttribute('role', 'listitem'); - container.appendChild(header); - const lineHeight = modifiedOptions.get(51 /* lineHeight */); - let modLine = minModifiedLine; - for (let i = 0, len = diffs.length; i < len; i++) { - const diffEntry = diffs[i]; - DiffReview._renderSection(container, diffEntry, modLine, lineHeight, this._width, originalOptions, originalModel, originalModelOpts, modifiedOptions, modifiedModel, modifiedModelOpts); - if (diffEntry.modifiedLineStart !== 0) { - modLine = diffEntry.modifiedLineEnd; - } - } - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["clearNode"](this._content.domNode); - this._content.domNode.appendChild(container); - this.scrollbar.scanDomNode(); - } - static _renderSection(dest, diffEntry, modLine, lineHeight, width, originalOptions, originalModel, originalModelOpts, modifiedOptions, modifiedModel, modifiedModelOpts) { - const type = diffEntry.getType(); - let rowClassName = 'diff-review-row'; - let lineNumbersExtraClassName = ''; - const spacerClassName = 'diff-review-spacer'; - let spacerIcon = null; - switch (type) { - case 1 /* Insert */: - rowClassName = 'diff-review-row line-insert'; - lineNumbersExtraClassName = ' char-insert'; - spacerIcon = diffReviewInsertIcon; - break; - case 2 /* Delete */: - rowClassName = 'diff-review-row line-delete'; - lineNumbersExtraClassName = ' char-delete'; - spacerIcon = diffReviewRemoveIcon; - break; - } - const originalLineStart = diffEntry.originalLineStart; - const originalLineEnd = diffEntry.originalLineEnd; - const modifiedLineStart = diffEntry.modifiedLineStart; - const modifiedLineEnd = diffEntry.modifiedLineEnd; - const cnt = Math.max(modifiedLineEnd - modifiedLineStart, originalLineEnd - originalLineStart); - const originalLayoutInfo = originalOptions.get(117 /* layoutInfo */); - const originalLineNumbersWidth = originalLayoutInfo.glyphMarginWidth + originalLayoutInfo.lineNumbersWidth; - const modifiedLayoutInfo = modifiedOptions.get(117 /* layoutInfo */); - const modifiedLineNumbersWidth = 10 + modifiedLayoutInfo.glyphMarginWidth + modifiedLayoutInfo.lineNumbersWidth; - for (let i = 0; i <= cnt; i++) { - const originalLine = (originalLineStart === 0 ? 0 : originalLineStart + i); - const modifiedLine = (modifiedLineStart === 0 ? 0 : modifiedLineStart + i); - const row = document.createElement('div'); - row.style.minWidth = width + 'px'; - row.className = rowClassName; - row.setAttribute('role', 'listitem'); - if (modifiedLine !== 0) { - modLine = modifiedLine; - } - row.setAttribute('data-line', String(modLine)); - let cell = document.createElement('div'); - cell.className = 'diff-review-cell'; - cell.style.height = `${lineHeight}px`; - row.appendChild(cell); - const originalLineNumber = document.createElement('span'); - originalLineNumber.style.width = (originalLineNumbersWidth + 'px'); - originalLineNumber.style.minWidth = (originalLineNumbersWidth + 'px'); - originalLineNumber.className = 'diff-review-line-number' + lineNumbersExtraClassName; - if (originalLine !== 0) { - originalLineNumber.appendChild(document.createTextNode(String(originalLine))); - } - else { - originalLineNumber.innerText = '\u00a0'; - } - cell.appendChild(originalLineNumber); - const modifiedLineNumber = document.createElement('span'); - modifiedLineNumber.style.width = (modifiedLineNumbersWidth + 'px'); - modifiedLineNumber.style.minWidth = (modifiedLineNumbersWidth + 'px'); - modifiedLineNumber.style.paddingRight = '10px'; - modifiedLineNumber.className = 'diff-review-line-number' + lineNumbersExtraClassName; - if (modifiedLine !== 0) { - modifiedLineNumber.appendChild(document.createTextNode(String(modifiedLine))); - } - else { - modifiedLineNumber.innerText = '\u00a0'; - } - cell.appendChild(modifiedLineNumber); - const spacer = document.createElement('span'); - spacer.className = spacerClassName; - if (spacerIcon) { - const spacerCodicon = document.createElement('span'); - spacerCodicon.className = spacerIcon.classNames; - spacerCodicon.innerText = '\u00a0\u00a0'; - spacer.appendChild(spacerCodicon); - } - else { - spacer.innerText = '\u00a0\u00a0'; - } - cell.appendChild(spacer); - let lineContent; - if (modifiedLine !== 0) { - cell.insertAdjacentHTML('beforeend', this._renderLine(modifiedModel, modifiedOptions, modifiedModelOpts.tabSize, modifiedLine)); - lineContent = modifiedModel.getLineContent(modifiedLine); - } - else { - cell.insertAdjacentHTML('beforeend', this._renderLine(originalModel, originalOptions, originalModelOpts.tabSize, originalLine)); - lineContent = originalModel.getLineContent(originalLine); - } - if (lineContent.length === 0) { - lineContent = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('blankLine', "blank"); - } - let ariaLabel = ''; - switch (type) { - case 0 /* Equal */: - if (originalLine === modifiedLine) { - ariaLabel = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]({ key: 'unchangedLine', comment: ['The placholders are contents of the line and should not be translated.'] }, "{0} unchanged line {1}", lineContent, originalLine); - } - else { - ariaLabel = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('equalLine', "{0} original line {1} modified line {2}", lineContent, originalLine, modifiedLine); - } - break; - case 1 /* Insert */: - ariaLabel = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('insertLine', "+ {0} modified line {1}", lineContent, modifiedLine); - break; - case 2 /* Delete */: - ariaLabel = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('deleteLine', "- {0} original line {1}", lineContent, originalLine); - break; - } - row.setAttribute('aria-label', ariaLabel); - dest.appendChild(row); - } - } - static _renderLine(model, options, tabSize, lineNumber) { - const lineContent = model.getLineContent(lineNumber); - const fontInfo = options.get(36 /* fontInfo */); - const defaultMetadata = ((0 /* None */ << 11 /* FONT_STYLE_OFFSET */) - | (1 /* DefaultForeground */ << 14 /* FOREGROUND_OFFSET */) - | (2 /* DefaultBackground */ << 23 /* BACKGROUND_OFFSET */)) >>> 0; - const tokens = new Uint32Array(2); - tokens[0] = lineContent.length; - tokens[1] = defaultMetadata; - const lineTokens = new _common_core_lineTokens_js__WEBPACK_IMPORTED_MODULE_12__["LineTokens"](tokens, lineContent); - const isBasicASCII = _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_16__["ViewLineRenderingData"].isBasicASCII(lineContent, model.mightContainNonBasicASCII()); - const containsRTL = _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_16__["ViewLineRenderingData"].containsRTL(lineContent, isBasicASCII, model.mightContainRTL()); - const r = Object(_common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_15__["renderViewLine2"])(new _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_15__["RenderLineInput"]((fontInfo.isMonospace && !options.get(24 /* disableMonospaceOptimizations */)), fontInfo.canUseHalfwidthRightwardsArrow, lineContent, false, isBasicASCII, containsRTL, 0, lineTokens, [], tabSize, 0, fontInfo.spaceWidth, fontInfo.middotWidth, fontInfo.wsmiddotWidth, options.get(95 /* stopRenderingLineAfter */), options.get(80 /* renderWhitespace */), options.get(74 /* renderControlCharacters */), options.get(37 /* fontLigatures */) !== _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_11__["EditorFontLigatures"].OFF, null)); - return r.html; - } -} -// theming -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_19__["registerThemingParticipant"])((theme, collector) => { - const lineNumbers = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["editorLineNumbers"]); - if (lineNumbers) { - collector.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${lineNumbers}; }`); - } - const shadow = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_18__["scrollbarShadow"]); - if (shadow) { - collector.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${shadow} 0 -6px 6px -6px inset; }`); - } -}); -class DiffReviewNext extends _editorExtensions_js__WEBPACK_IMPORTED_MODULE_9__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.diffReview.next', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('editor.action.diffReview.next', "Go to Next Difference"), - alias: 'Go to Next Difference', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].has('isInDiffEditor'), - kbOpts: { - kbExpr: null, - primary: 65 /* F7 */, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - const diffEditor = findFocusedDiffEditor(accessor); - if (diffEditor) { - diffEditor.diffReviewNext(); - } - } -} -class DiffReviewPrev extends _editorExtensions_js__WEBPACK_IMPORTED_MODULE_9__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.diffReview.prev', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('editor.action.diffReview.prev', "Go to Previous Difference"), - alias: 'Go to Previous Difference', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].has('isInDiffEditor'), - kbOpts: { - kbExpr: null, - primary: 1024 /* Shift */ | 65 /* F7 */, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - const diffEditor = findFocusedDiffEditor(accessor); - if (diffEditor) { - diffEditor.diffReviewPrev(); - } - } -} -function findFocusedDiffEditor(accessor) { - const codeEditorService = accessor.get(_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_10__["ICodeEditorService"]); - const diffEditors = codeEditorService.listDiffEditors(); - const activeCodeEditor = codeEditorService.getActiveCodeEditor(); - if (!activeCodeEditor) { - return null; - } - for (let i = 0, len = diffEditors.length; i < len; i++) { - const diffEditor = diffEditors[i]; - if (diffEditor.getModifiedEditor().getId() === activeCodeEditor.getId() || diffEditor.getOriginalEditor().getId() === activeCodeEditor.getId()) { - return diffEditor; - } - } - return null; -} -Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_9__["registerEditorAction"])(DiffReviewNext); -Object(_editorExtensions_js__WEBPACK_IMPORTED_MODULE_9__["registerEditorAction"])(DiffReviewPrev); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/embeddedCodeEditorWidget.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/widget/embeddedCodeEditorWidget.js ***! - \*********************************************************************************************/ -/*! exports provided: EmbeddedCodeEditorWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmbeddedCodeEditorWidget", function() { return EmbeddedCodeEditorWidget; }); -/* harmony import */ var _base_common_objects_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _codeEditorWidget_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./codeEditorWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/accessibility/common/accessibility.js */ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - -let EmbeddedCodeEditorWidget = class EmbeddedCodeEditorWidget extends _codeEditorWidget_js__WEBPACK_IMPORTED_MODULE_2__["CodeEditorWidget"] { - constructor(domElement, options, parentEditor, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService) { - super(domElement, Object.assign(Object.assign({}, parentEditor.getRawOptions()), { overflowWidgetsDomNode: parentEditor.getOverflowWidgetsDomNode() }), {}, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService); - this._parentEditor = parentEditor; - this._overwriteOptions = options; - // Overwrite parent's options - super.updateOptions(this._overwriteOptions); - this._register(parentEditor.onDidChangeConfiguration((e) => this._onParentConfigurationChanged(e))); - } - getParentEditor() { - return this._parentEditor; - } - _onParentConfigurationChanged(e) { - super.updateOptions(this._parentEditor.getRawOptions()); - super.updateOptions(this._overwriteOptions); - } - updateOptions(newOptions) { - _base_common_objects_js__WEBPACK_IMPORTED_MODULE_0__["mixin"](this._overwriteOptions, newOptions, true); - super.updateOptions(this._overwriteOptions); - } -}; -EmbeddedCodeEditorWidget = __decorate([ - __param(3, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_5__["IInstantiationService"]), - __param(4, _services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_1__["ICodeEditorService"]), - __param(5, _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_3__["ICommandService"]), - __param(6, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["IContextKeyService"]), - __param(7, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__["IThemeService"]), - __param(8, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_6__["INotificationService"]), - __param(9, _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_8__["IAccessibilityService"]) -], EmbeddedCodeEditorWidget); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/inlineDiffMargin.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/widget/inlineDiffMargin.js ***! - \*************************************************************************************/ -/*! exports provided: InlineDiffMargin */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InlineDiffMargin", function() { return InlineDiffMargin; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_actions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - -class InlineDiffMargin extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(_viewZoneId, _marginDomNode, editor, diff, _contextMenuService, _clipboardService) { - super(); - this._viewZoneId = _viewZoneId; - this._marginDomNode = _marginDomNode; - this.editor = editor; - this.diff = diff; - this._contextMenuService = _contextMenuService; - this._clipboardService = _clipboardService; - this._visibility = false; - // make sure the diff margin shows above overlay. - this._marginDomNode.style.zIndex = '10'; - this._diffActions = document.createElement('div'); - this._diffActions.className = _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].lightBulb.classNames + ' lightbulb-glyph'; - this._diffActions.style.position = 'absolute'; - const lineHeight = editor.getOption(51 /* lineHeight */); - const lineFeed = editor.getModel().getEOL(); - this._diffActions.style.right = '0px'; - this._diffActions.style.visibility = 'hidden'; - this._diffActions.style.height = `${lineHeight}px`; - this._diffActions.style.lineHeight = `${lineHeight}px`; - this._marginDomNode.appendChild(this._diffActions); - const actions = []; - // default action - actions.push(new _base_common_actions_js__WEBPACK_IMPORTED_MODULE_2__["Action"]('diff.clipboard.copyDeletedContent', diff.originalEndLineNumber > diff.modifiedStartLineNumber - ? _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('diff.clipboard.copyDeletedLinesContent.label', "Copy deleted lines") - : _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('diff.clipboard.copyDeletedLinesContent.single.label', "Copy deleted line"), undefined, true, () => __awaiter(this, void 0, void 0, function* () { - yield this._clipboardService.writeText(diff.originalContent.join(lineFeed) + lineFeed); - }))); - let currentLineNumberOffset = 0; - let copyLineAction = undefined; - if (diff.originalEndLineNumber > diff.modifiedStartLineNumber) { - copyLineAction = new _base_common_actions_js__WEBPACK_IMPORTED_MODULE_2__["Action"]('diff.clipboard.copyDeletedLineContent', _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('diff.clipboard.copyDeletedLineContent.label', "Copy deleted line ({0})", diff.originalStartLineNumber), undefined, true, () => __awaiter(this, void 0, void 0, function* () { - yield this._clipboardService.writeText(diff.originalContent[currentLineNumberOffset]); - })); - actions.push(copyLineAction); - } - const readOnly = editor.getOption(72 /* readOnly */); - if (!readOnly) { - actions.push(new _base_common_actions_js__WEBPACK_IMPORTED_MODULE_2__["Action"]('diff.inline.revertChange', _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('diff.inline.revertChange.label', "Revert this change"), undefined, true, () => __awaiter(this, void 0, void 0, function* () { - if (diff.modifiedEndLineNumber === 0) { - // deletion only - const column = editor.getModel().getLineMaxColumn(diff.modifiedStartLineNumber); - editor.executeEdits('diffEditor', [ - { - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](diff.modifiedStartLineNumber, column, diff.modifiedStartLineNumber, column), - text: lineFeed + diff.originalContent.join(lineFeed) - } - ]); - } - else { - const column = editor.getModel().getLineMaxColumn(diff.modifiedEndLineNumber); - editor.executeEdits('diffEditor', [ - { - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](diff.modifiedStartLineNumber, 1, diff.modifiedEndLineNumber, column), - text: diff.originalContent.join(lineFeed) - } - ]); - } - }))); - } - const showContextMenu = (x, y) => { - this._contextMenuService.showContextMenu({ - getAnchor: () => { - return { - x, - y - }; - }, - getActions: () => { - if (copyLineAction) { - copyLineAction.label = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('diff.clipboard.copyDeletedLineContent.label', "Copy deleted line ({0})", diff.originalStartLineNumber + currentLineNumberOffset); - } - return actions; - }, - autoSelectFirstItem: true - }); - }; - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](this._diffActions, 'mousedown', e => { - const { top, height } = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["getDomNodePagePosition"](this._diffActions); - let pad = Math.floor(lineHeight / 3); - e.preventDefault(); - showContextMenu(e.posx, top + height + pad); - })); - this._register(editor.onMouseMove((e) => { - if (e.target.type === 8 /* CONTENT_VIEW_ZONE */ || e.target.type === 5 /* GUTTER_VIEW_ZONE */) { - const viewZoneId = e.target.detail.viewZoneId; - if (viewZoneId === this._viewZoneId) { - this.visibility = true; - currentLineNumberOffset = this._updateLightBulbPosition(this._marginDomNode, e.event.browserEvent.y, lineHeight); - } - else { - this.visibility = false; - } - } - else { - this.visibility = false; - } - })); - this._register(editor.onMouseDown((e) => { - if (!e.event.rightButton) { - return; - } - if (e.target.type === 8 /* CONTENT_VIEW_ZONE */ || e.target.type === 5 /* GUTTER_VIEW_ZONE */) { - const viewZoneId = e.target.detail.viewZoneId; - if (viewZoneId === this._viewZoneId) { - e.event.preventDefault(); - currentLineNumberOffset = this._updateLightBulbPosition(this._marginDomNode, e.event.browserEvent.y, lineHeight); - showContextMenu(e.event.posx, e.event.posy + lineHeight); - } - } - })); - } - get visibility() { - return this._visibility; - } - set visibility(_visibility) { - if (this._visibility !== _visibility) { - this._visibility = _visibility; - if (_visibility) { - this._diffActions.style.visibility = 'visible'; - } - else { - this._diffActions.style.visibility = 'hidden'; - } - } - } - _updateLightBulbPosition(marginDomNode, y, lineHeight) { - const { top } = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["getDomNodePagePosition"](marginDomNode); - const offset = y - top; - const lineNumberOffset = Math.floor(offset / lineHeight); - const newTop = lineNumberOffset * lineHeight; - this._diffActions.style.top = `${newTop}px`; - return lineNumberOffset; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/media/diffEditor.css": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/widget/media/diffEditor.css ***! - \**************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_diffEditor_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./diffEditor.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/widget/media/diffEditor.css"); -/* harmony import */ var _css_loader_dist_cjs_js_diffEditor_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_diffEditor_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_diffEditor_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_diffEditor_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/media/diffReview.css": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/widget/media/diffReview.css ***! - \**************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_diffReview_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./diffReview.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/widget/media/diffReview.css"); -/* harmony import */ var _css_loader_dist_cjs_js_diffReview_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_diffReview_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_diffReview_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_diffReview_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/media/editor.css": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/browser/widget/media/editor.css ***! - \**********************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_editor_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./editor.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/browser/widget/media/editor.css"); -/* harmony import */ var _css_loader_dist_cjs_js_editor_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_editor_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_editor_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_editor_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/commands/replaceCommand.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/commands/replaceCommand.js ***! - \************************************************************************************/ -/*! exports provided: ReplaceCommand, ReplaceCommandThatSelectsText, ReplaceCommandWithoutChangingPosition, ReplaceCommandWithOffsetCursorState, ReplaceCommandThatPreservesSelection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaceCommand", function() { return ReplaceCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaceCommandThatSelectsText", function() { return ReplaceCommandThatSelectsText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaceCommandWithoutChangingPosition", function() { return ReplaceCommandWithoutChangingPosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaceCommandWithOffsetCursorState", function() { return ReplaceCommandWithOffsetCursorState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaceCommandThatPreservesSelection", function() { return ReplaceCommandThatPreservesSelection; }); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class ReplaceCommand { - constructor(range, text, insertsAutoWhitespace = false) { - this._range = range; - this._text = text; - this.insertsAutoWhitespace = insertsAutoWhitespace; - } - getEditOperations(model, builder) { - builder.addTrackedEditOperation(this._range, this._text); - } - computeCursorState(model, helper) { - let inverseEditOperations = helper.getInverseEditOperations(); - let srcRange = inverseEditOperations[0].range; - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_0__["Selection"](srcRange.endLineNumber, srcRange.endColumn, srcRange.endLineNumber, srcRange.endColumn); - } -} -class ReplaceCommandThatSelectsText { - constructor(range, text) { - this._range = range; - this._text = text; - } - getEditOperations(model, builder) { - builder.addTrackedEditOperation(this._range, this._text); - } - computeCursorState(model, helper) { - const inverseEditOperations = helper.getInverseEditOperations(); - const srcRange = inverseEditOperations[0].range; - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_0__["Selection"](srcRange.startLineNumber, srcRange.startColumn, srcRange.endLineNumber, srcRange.endColumn); - } -} -class ReplaceCommandWithoutChangingPosition { - constructor(range, text, insertsAutoWhitespace = false) { - this._range = range; - this._text = text; - this.insertsAutoWhitespace = insertsAutoWhitespace; - } - getEditOperations(model, builder) { - builder.addTrackedEditOperation(this._range, this._text); - } - computeCursorState(model, helper) { - let inverseEditOperations = helper.getInverseEditOperations(); - let srcRange = inverseEditOperations[0].range; - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_0__["Selection"](srcRange.startLineNumber, srcRange.startColumn, srcRange.startLineNumber, srcRange.startColumn); - } -} -class ReplaceCommandWithOffsetCursorState { - constructor(range, text, lineNumberDeltaOffset, columnDeltaOffset, insertsAutoWhitespace = false) { - this._range = range; - this._text = text; - this._columnDeltaOffset = columnDeltaOffset; - this._lineNumberDeltaOffset = lineNumberDeltaOffset; - this.insertsAutoWhitespace = insertsAutoWhitespace; - } - getEditOperations(model, builder) { - builder.addTrackedEditOperation(this._range, this._text); - } - computeCursorState(model, helper) { - let inverseEditOperations = helper.getInverseEditOperations(); - let srcRange = inverseEditOperations[0].range; - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_0__["Selection"](srcRange.endLineNumber + this._lineNumberDeltaOffset, srcRange.endColumn + this._columnDeltaOffset, srcRange.endLineNumber + this._lineNumberDeltaOffset, srcRange.endColumn + this._columnDeltaOffset); - } -} -class ReplaceCommandThatPreservesSelection { - constructor(editRange, text, initialSelection, forceMoveMarkers = false) { - this._range = editRange; - this._text = text; - this._initialSelection = initialSelection; - this._forceMoveMarkers = forceMoveMarkers; - this._selectionId = null; - } - getEditOperations(model, builder) { - builder.addTrackedEditOperation(this._range, this._text, this._forceMoveMarkers); - this._selectionId = builder.trackSelection(this._initialSelection); - } - computeCursorState(model, helper) { - return helper.getTrackedSelection(this._selectionId); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/commands/shiftCommand.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/commands/shiftCommand.js ***! - \**********************************************************************************/ -/*! exports provided: cachedStringRepeat, ShiftCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cachedStringRepeat", function() { return cachedStringRepeat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ShiftCommand", function() { return ShiftCommand; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../controller/cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -const repeatCache = Object.create(null); -function cachedStringRepeat(str, count) { - if (!repeatCache[str]) { - repeatCache[str] = ['', str]; - } - const cache = repeatCache[str]; - for (let i = cache.length; i <= count; i++) { - cache[i] = cache[i - 1] + str; - } - return cache[count]; -} -class ShiftCommand { - constructor(range, opts) { - this._opts = opts; - this._selection = range; - this._selectionId = null; - this._useLastEditRangeForCursorEndPosition = false; - this._selectionStartColumnStaysPut = false; - } - static unshiftIndent(line, column, tabSize, indentSize, insertSpaces) { - // Determine the visible column where the content starts - const contentStartVisibleColumn = _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorColumns"].visibleColumnFromColumn(line, column, tabSize); - if (insertSpaces) { - const indent = cachedStringRepeat(' ', indentSize); - const desiredTabStop = _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorColumns"].prevIndentTabStop(contentStartVisibleColumn, indentSize); - const indentCount = desiredTabStop / indentSize; // will be an integer - return cachedStringRepeat(indent, indentCount); - } - else { - const indent = '\t'; - const desiredTabStop = _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorColumns"].prevRenderTabStop(contentStartVisibleColumn, tabSize); - const indentCount = desiredTabStop / tabSize; // will be an integer - return cachedStringRepeat(indent, indentCount); - } - } - static shiftIndent(line, column, tabSize, indentSize, insertSpaces) { - // Determine the visible column where the content starts - const contentStartVisibleColumn = _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorColumns"].visibleColumnFromColumn(line, column, tabSize); - if (insertSpaces) { - const indent = cachedStringRepeat(' ', indentSize); - const desiredTabStop = _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorColumns"].nextIndentTabStop(contentStartVisibleColumn, indentSize); - const indentCount = desiredTabStop / indentSize; // will be an integer - return cachedStringRepeat(indent, indentCount); - } - else { - const indent = '\t'; - const desiredTabStop = _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorColumns"].nextRenderTabStop(contentStartVisibleColumn, tabSize); - const indentCount = desiredTabStop / tabSize; // will be an integer - return cachedStringRepeat(indent, indentCount); - } - } - _addEditOperation(builder, range, text) { - if (this._useLastEditRangeForCursorEndPosition) { - builder.addTrackedEditOperation(range, text); - } - else { - builder.addEditOperation(range, text); - } - } - getEditOperations(model, builder) { - const startLine = this._selection.startLineNumber; - let endLine = this._selection.endLineNumber; - if (this._selection.endColumn === 1 && startLine !== endLine) { - endLine = endLine - 1; - } - const { tabSize, indentSize, insertSpaces } = this._opts; - const shouldIndentEmptyLines = (startLine === endLine); - if (this._opts.useTabStops) { - // if indenting or outdenting on a whitespace only line - if (this._selection.isEmpty()) { - if (/^\s*$/.test(model.getLineContent(startLine))) { - this._useLastEditRangeForCursorEndPosition = true; - } - } - // keep track of previous line's "miss-alignment" - let previousLineExtraSpaces = 0, extraSpaces = 0; - for (let lineNumber = startLine; lineNumber <= endLine; lineNumber++, previousLineExtraSpaces = extraSpaces) { - extraSpaces = 0; - let lineText = model.getLineContent(lineNumber); - let indentationEndIndex = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["firstNonWhitespaceIndex"](lineText); - if (this._opts.isUnshift && (lineText.length === 0 || indentationEndIndex === 0)) { - // empty line or line with no leading whitespace => nothing to do - continue; - } - if (!shouldIndentEmptyLines && !this._opts.isUnshift && lineText.length === 0) { - // do not indent empty lines => nothing to do - continue; - } - if (indentationEndIndex === -1) { - // the entire line is whitespace - indentationEndIndex = lineText.length; - } - if (lineNumber > 1) { - let contentStartVisibleColumn = _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorColumns"].visibleColumnFromColumn(lineText, indentationEndIndex + 1, tabSize); - if (contentStartVisibleColumn % indentSize !== 0) { - // The current line is "miss-aligned", so let's see if this is expected... - // This can only happen when it has trailing commas in the indent - if (model.isCheapToTokenize(lineNumber - 1)) { - let enterAction = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_4__["LanguageConfigurationRegistry"].getEnterAction(this._opts.autoIndent, model, new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](lineNumber - 1, model.getLineMaxColumn(lineNumber - 1), lineNumber - 1, model.getLineMaxColumn(lineNumber - 1))); - if (enterAction) { - extraSpaces = previousLineExtraSpaces; - if (enterAction.appendText) { - for (let j = 0, lenJ = enterAction.appendText.length; j < lenJ && extraSpaces < indentSize; j++) { - if (enterAction.appendText.charCodeAt(j) === 32 /* Space */) { - extraSpaces++; - } - else { - break; - } - } - } - if (enterAction.removeText) { - extraSpaces = Math.max(0, extraSpaces - enterAction.removeText); - } - // Act as if `prefixSpaces` is not part of the indentation - for (let j = 0; j < extraSpaces; j++) { - if (indentationEndIndex === 0 || lineText.charCodeAt(indentationEndIndex - 1) !== 32 /* Space */) { - break; - } - indentationEndIndex--; - } - } - } - } - } - if (this._opts.isUnshift && indentationEndIndex === 0) { - // line with no leading whitespace => nothing to do - continue; - } - let desiredIndent; - if (this._opts.isUnshift) { - desiredIndent = ShiftCommand.unshiftIndent(lineText, indentationEndIndex + 1, tabSize, indentSize, insertSpaces); - } - else { - desiredIndent = ShiftCommand.shiftIndent(lineText, indentationEndIndex + 1, tabSize, indentSize, insertSpaces); - } - this._addEditOperation(builder, new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](lineNumber, 1, lineNumber, indentationEndIndex + 1), desiredIndent); - if (lineNumber === startLine && !this._selection.isEmpty()) { - // Force the startColumn to stay put because we're inserting after it - this._selectionStartColumnStaysPut = (this._selection.startColumn <= indentationEndIndex + 1); - } - } - } - else { - // if indenting or outdenting on a whitespace only line - if (!this._opts.isUnshift && this._selection.isEmpty() && model.getLineLength(startLine) === 0) { - this._useLastEditRangeForCursorEndPosition = true; - } - const oneIndent = (insertSpaces ? cachedStringRepeat(' ', indentSize) : '\t'); - for (let lineNumber = startLine; lineNumber <= endLine; lineNumber++) { - const lineText = model.getLineContent(lineNumber); - let indentationEndIndex = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["firstNonWhitespaceIndex"](lineText); - if (this._opts.isUnshift && (lineText.length === 0 || indentationEndIndex === 0)) { - // empty line or line with no leading whitespace => nothing to do - continue; - } - if (!shouldIndentEmptyLines && !this._opts.isUnshift && lineText.length === 0) { - // do not indent empty lines => nothing to do - continue; - } - if (indentationEndIndex === -1) { - // the entire line is whitespace - indentationEndIndex = lineText.length; - } - if (this._opts.isUnshift && indentationEndIndex === 0) { - // line with no leading whitespace => nothing to do - continue; - } - if (this._opts.isUnshift) { - indentationEndIndex = Math.min(indentationEndIndex, indentSize); - for (let i = 0; i < indentationEndIndex; i++) { - const chr = lineText.charCodeAt(i); - if (chr === 9 /* Tab */) { - indentationEndIndex = i + 1; - break; - } - } - this._addEditOperation(builder, new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](lineNumber, 1, lineNumber, indentationEndIndex + 1), ''); - } - else { - this._addEditOperation(builder, new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](lineNumber, 1, lineNumber, 1), oneIndent); - if (lineNumber === startLine && !this._selection.isEmpty()) { - // Force the startColumn to stay put because we're inserting after it - this._selectionStartColumnStaysPut = (this._selection.startColumn === 1); - } - } - } - } - this._selectionId = builder.trackSelection(this._selection); - } - computeCursorState(model, helper) { - if (this._useLastEditRangeForCursorEndPosition) { - let lastOp = helper.getInverseEditOperations()[0]; - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_3__["Selection"](lastOp.range.endLineNumber, lastOp.range.endColumn, lastOp.range.endLineNumber, lastOp.range.endColumn); - } - const result = helper.getTrackedSelection(this._selectionId); - if (this._selectionStartColumnStaysPut) { - // The selection start should not move - let initialStartColumn = this._selection.startColumn; - let resultStartColumn = result.startColumn; - if (resultStartColumn <= initialStartColumn) { - return result; - } - if (result.getDirection() === 0 /* LTR */) { - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_3__["Selection"](result.startLineNumber, initialStartColumn, result.endLineNumber, result.endColumn); - } - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_3__["Selection"](result.endLineNumber, result.endColumn, result.startLineNumber, initialStartColumn); - } - return result; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/commands/surroundSelectionCommand.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/commands/surroundSelectionCommand.js ***! - \**********************************************************************************************/ -/*! exports provided: SurroundSelectionCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurroundSelectionCommand", function() { return SurroundSelectionCommand; }); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class SurroundSelectionCommand { - constructor(range, charBeforeSelection, charAfterSelection) { - this._range = range; - this._charBeforeSelection = charBeforeSelection; - this._charAfterSelection = charAfterSelection; - } - getEditOperations(model, builder) { - builder.addTrackedEditOperation(new _core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](this._range.startLineNumber, this._range.startColumn, this._range.startLineNumber, this._range.startColumn), this._charBeforeSelection); - builder.addTrackedEditOperation(new _core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](this._range.endLineNumber, this._range.endColumn, this._range.endLineNumber, this._range.endColumn), this._charAfterSelection); - } - computeCursorState(model, helper) { - let inverseEditOperations = helper.getInverseEditOperations(); - let firstOperationRange = inverseEditOperations[0].range; - let secondOperationRange = inverseEditOperations[1].range; - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_1__["Selection"](firstOperationRange.endLineNumber, firstOperationRange.endColumn, secondOperationRange.endLineNumber, secondOperationRange.endColumn - this._charAfterSelection.length); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/commands/trimTrailingWhitespaceCommand.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/commands/trimTrailingWhitespaceCommand.js ***! - \***************************************************************************************************/ -/*! exports provided: TrimTrailingWhitespaceCommand, trimTrailingWhitespace */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrimTrailingWhitespaceCommand", function() { return TrimTrailingWhitespaceCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trimTrailingWhitespace", function() { return trimTrailingWhitespace; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _core_editOperation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/editOperation.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class TrimTrailingWhitespaceCommand { - constructor(selection, cursors) { - this._selection = selection; - this._cursors = cursors; - this._selectionId = null; - } - getEditOperations(model, builder) { - let ops = trimTrailingWhitespace(model, this._cursors); - for (let i = 0, len = ops.length; i < len; i++) { - let op = ops[i]; - builder.addEditOperation(op.range, op.text); - } - this._selectionId = builder.trackSelection(this._selection); - } - computeCursorState(model, helper) { - return helper.getTrackedSelection(this._selectionId); - } -} -/** - * Generate commands for trimming trailing whitespace on a model and ignore lines on which cursors are sitting. - */ -function trimTrailingWhitespace(model, cursors) { - // Sort cursors ascending - cursors.sort((a, b) => { - if (a.lineNumber === b.lineNumber) { - return a.column - b.column; - } - return a.lineNumber - b.lineNumber; - }); - // Reduce multiple cursors on the same line and only keep the last one on the line - for (let i = cursors.length - 2; i >= 0; i--) { - if (cursors[i].lineNumber === cursors[i + 1].lineNumber) { - // Remove cursor at `i` - cursors.splice(i, 1); - } - } - let r = []; - let rLen = 0; - let cursorIndex = 0; - let cursorLen = cursors.length; - for (let lineNumber = 1, lineCount = model.getLineCount(); lineNumber <= lineCount; lineNumber++) { - let lineContent = model.getLineContent(lineNumber); - let maxLineColumn = lineContent.length + 1; - let minEditColumn = 0; - if (cursorIndex < cursorLen && cursors[cursorIndex].lineNumber === lineNumber) { - minEditColumn = cursors[cursorIndex].column; - cursorIndex++; - if (minEditColumn === maxLineColumn) { - // The cursor is at the end of the line => no edits for sure on this line - continue; - } - } - if (lineContent.length === 0) { - continue; - } - let lastNonWhitespaceIndex = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["lastNonWhitespaceIndex"](lineContent); - let fromColumn = 0; - if (lastNonWhitespaceIndex === -1) { - // Entire line is whitespace - fromColumn = 1; - } - else if (lastNonWhitespaceIndex !== lineContent.length - 1) { - // There is trailing whitespace - fromColumn = lastNonWhitespaceIndex + 2; - } - else { - // There is no trailing whitespace - continue; - } - fromColumn = Math.max(minEditColumn, fromColumn); - r[rLen++] = _core_editOperation_js__WEBPACK_IMPORTED_MODULE_1__["EditOperation"].delete(new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](lineNumber, fromColumn, lineNumber, maxLineColumn)); - } - return r; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/config/commonEditorConfig.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/config/commonEditorConfig.js ***! - \**************************************************************************************/ -/*! exports provided: TabFocus, ComputedEditorOptions, CommonEditorConfiguration, editorConfigurationBaseNode, isEditorConfigurationKey, isDiffEditorConfigurationKey */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TabFocus", function() { return TabFocus; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComputedEditorOptions", function() { return ComputedEditorOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommonEditorConfiguration", function() { return CommonEditorConfiguration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorConfigurationBaseNode", function() { return editorConfigurationBaseNode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditorConfigurationKey", function() { return isEditorConfigurationKey; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDiffEditorConfigurationKey", function() { return isDiffEditorConfigurationKey; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _editorZoom_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editorZoom.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorZoom.js"); -/* harmony import */ var _fontInfo_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./fontInfo.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/fontInfo.js"); -/* harmony import */ var _platform_configuration_common_configurationRegistry_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/configuration/common/configurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js"); -/* harmony import */ var _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _base_common_collections_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/common/collections.js */ "./node_modules/monaco-editor/esm/vs/base/common/collections.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - -const TabFocus = new class { - constructor() { - this._tabFocus = false; - this._onDidChangeTabFocus = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"](); - this.onDidChangeTabFocus = this._onDidChangeTabFocus.event; - } - getTabFocusMode() { - return this._tabFocus; - } - setTabFocusMode(tabFocusMode) { - if (this._tabFocus === tabFocusMode) { - return; - } - this._tabFocus = tabFocusMode; - this._onDidChangeTabFocus.fire(this._tabFocus); - } -}; -const hasOwnProperty = Object.hasOwnProperty; -class ComputedEditorOptions { - constructor() { - this._values = []; - } - _read(id) { - return this._values[id]; - } - get(id) { - return this._values[id]; - } - _write(id, value) { - this._values[id] = value; - } -} -class RawEditorOptions { - constructor() { - this._values = []; - } - _read(id) { - return this._values[id]; - } - _write(id, value) { - this._values[id] = value; - } -} -class EditorConfiguration2 { - static readOptions(_options) { - const options = _options; - const result = new RawEditorOptions(); - for (const editorOption of _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["editorOptionsRegistry"]) { - const value = (editorOption.name === '_never_' ? undefined : options[editorOption.name]); - result._write(editorOption.id, value); - } - return result; - } - static validateOptions(options) { - const result = new _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["ValidatedEditorOptions"](); - for (const editorOption of _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["editorOptionsRegistry"]) { - result._write(editorOption.id, editorOption.validate(options._read(editorOption.id))); - } - return result; - } - static computeOptions(options, env) { - const result = new ComputedEditorOptions(); - for (const editorOption of _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["editorOptionsRegistry"]) { - result._write(editorOption.id, editorOption.compute(env, result, options._read(editorOption.id))); - } - return result; - } - static _deepEquals(a, b) { - if (typeof a !== 'object' || typeof b !== 'object') { - return (a === b); - } - if (Array.isArray(a) || Array.isArray(b)) { - return (Array.isArray(a) && Array.isArray(b) ? _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_4__["equals"](a, b) : false); - } - for (let key in a) { - if (!EditorConfiguration2._deepEquals(a[key], b[key])) { - return false; - } - } - return true; - } - static checkEquals(a, b) { - const result = []; - let somethingChanged = false; - for (const editorOption of _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["editorOptionsRegistry"]) { - const changed = !EditorConfiguration2._deepEquals(a._read(editorOption.id), b._read(editorOption.id)); - result[editorOption.id] = changed; - if (changed) { - somethingChanged = true; - } - } - return (somethingChanged ? new _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["ConfigurationChangedEvent"](result) : null); - } -} -/** - * Compatibility with old options - */ -function migrateOptions(options) { - const wordWrap = options.wordWrap; - if (wordWrap === true) { - options.wordWrap = 'on'; - } - else if (wordWrap === false) { - options.wordWrap = 'off'; - } - const lineNumbers = options.lineNumbers; - if (lineNumbers === true) { - options.lineNumbers = 'on'; - } - else if (lineNumbers === false) { - options.lineNumbers = 'off'; - } - const autoClosingBrackets = options.autoClosingBrackets; - if (autoClosingBrackets === false) { - options.autoClosingBrackets = 'never'; - options.autoClosingQuotes = 'never'; - options.autoSurround = 'never'; - } - const cursorBlinking = options.cursorBlinking; - if (cursorBlinking === 'visible') { - options.cursorBlinking = 'solid'; - } - const renderWhitespace = options.renderWhitespace; - if (renderWhitespace === true) { - options.renderWhitespace = 'boundary'; - } - else if (renderWhitespace === false) { - options.renderWhitespace = 'none'; - } - const renderLineHighlight = options.renderLineHighlight; - if (renderLineHighlight === true) { - options.renderLineHighlight = 'line'; - } - else if (renderLineHighlight === false) { - options.renderLineHighlight = 'none'; - } - const acceptSuggestionOnEnter = options.acceptSuggestionOnEnter; - if (acceptSuggestionOnEnter === true) { - options.acceptSuggestionOnEnter = 'on'; - } - else if (acceptSuggestionOnEnter === false) { - options.acceptSuggestionOnEnter = 'off'; - } - const tabCompletion = options.tabCompletion; - if (tabCompletion === false) { - options.tabCompletion = 'off'; - } - else if (tabCompletion === true) { - options.tabCompletion = 'onlySnippets'; - } - const suggest = options.suggest; - if (suggest && typeof suggest.filteredTypes === 'object' && suggest.filteredTypes) { - const mapping = {}; - mapping['method'] = 'showMethods'; - mapping['function'] = 'showFunctions'; - mapping['constructor'] = 'showConstructors'; - mapping['field'] = 'showFields'; - mapping['variable'] = 'showVariables'; - mapping['class'] = 'showClasses'; - mapping['struct'] = 'showStructs'; - mapping['interface'] = 'showInterfaces'; - mapping['module'] = 'showModules'; - mapping['property'] = 'showProperties'; - mapping['event'] = 'showEvents'; - mapping['operator'] = 'showOperators'; - mapping['unit'] = 'showUnits'; - mapping['value'] = 'showValues'; - mapping['constant'] = 'showConstants'; - mapping['enum'] = 'showEnums'; - mapping['enumMember'] = 'showEnumMembers'; - mapping['keyword'] = 'showKeywords'; - mapping['text'] = 'showWords'; - mapping['color'] = 'showColors'; - mapping['file'] = 'showFiles'; - mapping['reference'] = 'showReferences'; - mapping['folder'] = 'showFolders'; - mapping['typeParameter'] = 'showTypeParameters'; - mapping['snippet'] = 'showSnippets'; - Object(_base_common_collections_js__WEBPACK_IMPORTED_MODULE_10__["forEach"])(mapping, entry => { - const value = suggest.filteredTypes[entry.key]; - if (value === false) { - suggest[entry.value] = value; - } - }); - // delete (suggest).filteredTypes; - } - const hover = options.hover; - if (hover === true) { - options.hover = { - enabled: true - }; - } - else if (hover === false) { - options.hover = { - enabled: false - }; - } - const parameterHints = options.parameterHints; - if (parameterHints === true) { - options.parameterHints = { - enabled: true - }; - } - else if (parameterHints === false) { - options.parameterHints = { - enabled: false - }; - } - const autoIndent = options.autoIndent; - if (autoIndent === true) { - options.autoIndent = 'full'; - } - else if (autoIndent === false) { - options.autoIndent = 'advanced'; - } - const matchBrackets = options.matchBrackets; - if (matchBrackets === true) { - options.matchBrackets = 'always'; - } - else if (matchBrackets === false) { - options.matchBrackets = 'never'; - } -} -function deepCloneAndMigrateOptions(_options) { - const options = _base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__["deepClone"](_options); - migrateOptions(options); - return options; -} -class CommonEditorConfiguration extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor(isSimpleWidget, _options) { - super(); - this._onDidChange = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidChange = this._onDidChange.event; - this._onDidChangeFast = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidChangeFast = this._onDidChangeFast.event; - this.isSimpleWidget = isSimpleWidget; - this._isDominatedByLongLines = false; - this._computeOptionsMemory = new _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["ComputeOptionsMemory"](); - this._viewLineCount = 1; - this._lineNumbersDigitCount = 1; - this._rawOptions = deepCloneAndMigrateOptions(_options); - this._readOptions = EditorConfiguration2.readOptions(this._rawOptions); - this._validatedOptions = EditorConfiguration2.validateOptions(this._readOptions); - this._register(_editorZoom_js__WEBPACK_IMPORTED_MODULE_6__["EditorZoom"].onDidChangeZoomLevel(_ => this._recomputeOptions())); - this._register(TabFocus.onDidChangeTabFocus(_ => this._recomputeOptions())); - } - observeReferenceElement(dimension) { - } - dispose() { - super.dispose(); - } - _recomputeOptions() { - const oldOptions = this.options; - const newOptions = this._computeInternalOptions(); - if (!oldOptions) { - this.options = newOptions; - } - else { - const changeEvent = EditorConfiguration2.checkEquals(oldOptions, newOptions); - if (changeEvent === null) { - // nothing changed! - return; - } - this.options = newOptions; - this._onDidChangeFast.fire(changeEvent); - this._onDidChange.fire(changeEvent); - } - } - getRawOptions() { - return this._rawOptions; - } - _computeInternalOptions() { - const partialEnv = this._getEnvConfiguration(); - const bareFontInfo = _fontInfo_js__WEBPACK_IMPORTED_MODULE_7__["BareFontInfo"].createFromValidatedSettings(this._validatedOptions, partialEnv.zoomLevel, this.isSimpleWidget); - const env = { - memory: this._computeOptionsMemory, - outerWidth: partialEnv.outerWidth, - outerHeight: partialEnv.outerHeight, - fontInfo: this.readConfiguration(bareFontInfo), - extraEditorClassName: partialEnv.extraEditorClassName, - isDominatedByLongLines: this._isDominatedByLongLines, - viewLineCount: this._viewLineCount, - lineNumbersDigitCount: this._lineNumbersDigitCount, - emptySelectionClipboard: partialEnv.emptySelectionClipboard, - pixelRatio: partialEnv.pixelRatio, - tabFocusMode: TabFocus.getTabFocusMode(), - accessibilitySupport: partialEnv.accessibilitySupport - }; - return EditorConfiguration2.computeOptions(this._validatedOptions, env); - } - static _subsetEquals(base, subset) { - for (const key in subset) { - if (hasOwnProperty.call(subset, key)) { - const subsetValue = subset[key]; - const baseValue = base[key]; - if (baseValue === subsetValue) { - continue; - } - if (Array.isArray(baseValue) && Array.isArray(subsetValue)) { - if (!_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_4__["equals"](baseValue, subsetValue)) { - return false; - } - continue; - } - if (baseValue && typeof baseValue === 'object' && subsetValue && typeof subsetValue === 'object') { - if (!this._subsetEquals(baseValue, subsetValue)) { - return false; - } - continue; - } - return false; - } - } - return true; - } - updateOptions(_newOptions) { - if (typeof _newOptions === 'undefined') { - return; - } - const newOptions = deepCloneAndMigrateOptions(_newOptions); - if (CommonEditorConfiguration._subsetEquals(this._rawOptions, newOptions)) { - return; - } - this._rawOptions = _base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__["mixin"](this._rawOptions, newOptions || {}); - this._readOptions = EditorConfiguration2.readOptions(this._rawOptions); - this._validatedOptions = EditorConfiguration2.validateOptions(this._readOptions); - this._recomputeOptions(); - } - setIsDominatedByLongLines(isDominatedByLongLines) { - this._isDominatedByLongLines = isDominatedByLongLines; - this._recomputeOptions(); - } - setMaxLineNumber(maxLineNumber) { - const lineNumbersDigitCount = CommonEditorConfiguration._digitCount(maxLineNumber); - if (this._lineNumbersDigitCount === lineNumbersDigitCount) { - return; - } - this._lineNumbersDigitCount = lineNumbersDigitCount; - this._recomputeOptions(); - } - setViewLineCount(viewLineCount) { - if (this._viewLineCount === viewLineCount) { - return; - } - this._viewLineCount = viewLineCount; - this._recomputeOptions(); - } - static _digitCount(n) { - let r = 0; - while (n) { - n = Math.floor(n / 10); - r++; - } - return r ? r : 1; - } -} -const editorConfigurationBaseNode = Object.freeze({ - id: 'editor', - order: 5, - type: 'object', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorConfigurationTitle', "Editor"), - scope: 5 /* LANGUAGE_OVERRIDABLE */, -}); -const configurationRegistry = _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_9__["Registry"].as(_platform_configuration_common_configurationRegistry_js__WEBPACK_IMPORTED_MODULE_8__["Extensions"].Configuration); -const editorConfiguration = Object.assign(Object.assign({}, editorConfigurationBaseNode), { properties: { - 'editor.tabSize': { - type: 'number', - default: _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["EDITOR_MODEL_DEFAULTS"].tabSize, - minimum: 1, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('tabSize', "The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.") - }, - // 'editor.indentSize': { - // 'anyOf': [ - // { - // type: 'string', - // enum: ['tabSize'] - // }, - // { - // type: 'number', - // minimum: 1 - // } - // ], - // default: 'tabSize', - // markdownDescription: nls.localize('indentSize', "The number of spaces used for indentation or 'tabSize' to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.") - // }, - 'editor.insertSpaces': { - type: 'boolean', - default: _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["EDITOR_MODEL_DEFAULTS"].insertSpaces, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('insertSpaces', "Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.") - }, - 'editor.detectIndentation': { - type: 'boolean', - default: _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["EDITOR_MODEL_DEFAULTS"].detectIndentation, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('detectIndentation', "Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.") - }, - 'editor.trimAutoWhitespace': { - type: 'boolean', - default: _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["EDITOR_MODEL_DEFAULTS"].trimAutoWhitespace, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('trimAutoWhitespace', "Remove trailing auto inserted whitespace.") - }, - 'editor.largeFileOptimizations': { - type: 'boolean', - default: _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["EDITOR_MODEL_DEFAULTS"].largeFileOptimizations, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('largeFileOptimizations', "Special handling for large files to disable certain memory intensive features.") - }, - 'editor.wordBasedSuggestions': { - type: 'boolean', - default: true, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wordBasedSuggestions', "Controls whether completions should be computed based on words in the document.") - }, - 'editor.semanticHighlighting.enabled': { - enum: [true, false, 'configuredByTheme'], - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('semanticHighlighting.true', 'Semantic highlighting enabled for all color themes.'), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('semanticHighlighting.false', 'Semantic highlighting disabled for all color themes.'), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('semanticHighlighting.configuredByTheme', 'Semantic highlighting is configured by the current color theme\'s `semanticHighlighting` setting.') - ], - default: 'configuredByTheme', - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('semanticHighlighting.enabled', "Controls whether the semanticHighlighting is shown for the languages that support it.") - }, - 'editor.stablePeek': { - type: 'boolean', - default: false, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('stablePeek', "Keep peek editors open even when double clicking their content or when hitting `Escape`.") - }, - 'editor.maxTokenizationLineLength': { - type: 'integer', - default: 20000, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('maxTokenizationLineLength', "Lines above this length will not be tokenized for performance reasons") - }, - 'diffEditor.maxComputationTime': { - type: 'number', - default: 5000, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('maxComputationTime', "Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.") - }, - 'diffEditor.renderSideBySide': { - type: 'boolean', - default: true, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('sideBySide', "Controls whether the diff editor shows the diff side by side or inline.") - }, - 'diffEditor.ignoreTrimWhitespace': { - type: 'boolean', - default: true, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('ignoreTrimWhitespace', "When enabled, the diff editor ignores changes in leading or trailing whitespace.") - }, - 'diffEditor.renderIndicators': { - type: 'boolean', - default: true, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('renderIndicators', "Controls whether the diff editor shows +/- indicators for added/removed changes.") - }, - 'diffEditor.codeLens': { - type: 'boolean', - default: false, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('codeLens', "Controls whether the editor shows CodeLens.") - } - } }); -function isConfigurationPropertySchema(x) { - return (typeof x.type !== 'undefined' || typeof x.anyOf !== 'undefined'); -} -// Add properties from the Editor Option Registry -for (const editorOption of _editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["editorOptionsRegistry"]) { - const schema = editorOption.schema; - if (typeof schema !== 'undefined') { - if (isConfigurationPropertySchema(schema)) { - // This is a single schema contribution - editorConfiguration.properties[`editor.${editorOption.name}`] = schema; - } - else { - for (let key in schema) { - if (hasOwnProperty.call(schema, key)) { - editorConfiguration.properties[key] = schema[key]; - } - } - } - } -} -let cachedEditorConfigurationKeys = null; -function getEditorConfigurationKeys() { - if (cachedEditorConfigurationKeys === null) { - cachedEditorConfigurationKeys = Object.create(null); - Object.keys(editorConfiguration.properties).forEach((prop) => { - cachedEditorConfigurationKeys[prop] = true; - }); - } - return cachedEditorConfigurationKeys; -} -function isEditorConfigurationKey(key) { - const editorConfigurationKeys = getEditorConfigurationKeys(); - return (editorConfigurationKeys[`editor.${key}`] || false); -} -function isDiffEditorConfigurationKey(key) { - const editorConfigurationKeys = getEditorConfigurationKeys(); - return (editorConfigurationKeys[`diffEditor.${key}`] || false); -} -configurationRegistry.registerConfiguration(editorConfiguration); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js ***! - \*********************************************************************************/ -/*! exports provided: MINIMAP_GUTTER_WIDTH, ConfigurationChangedEvent, ValidatedEditorOptions, ComputeOptionsMemory, TextEditorCursorStyle, EditorFontLigatures, EditorLayoutInfoComputer, filterValidationDecorations, EDITOR_FONT_DEFAULTS, EDITOR_MODEL_DEFAULTS, editorOptionsRegistry, EditorOptions */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MINIMAP_GUTTER_WIDTH", function() { return MINIMAP_GUTTER_WIDTH; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConfigurationChangedEvent", function() { return ConfigurationChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValidatedEditorOptions", function() { return ValidatedEditorOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComputeOptionsMemory", function() { return ComputeOptionsMemory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorStyle", function() { return TextEditorCursorStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorFontLigatures", function() { return EditorFontLigatures; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorLayoutInfoComputer", function() { return EditorLayoutInfoComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterValidationDecorations", function() { return filterValidationDecorations; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EDITOR_FONT_DEFAULTS", function() { return EDITOR_FONT_DEFAULTS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EDITOR_MODEL_DEFAULTS", function() { return EDITOR_MODEL_DEFAULTS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorOptionsRegistry", function() { return editorOptionsRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorOptions", function() { return EditorOptions; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/wordHelper.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -/** - * @internal - * The width of the minimap gutter, in pixels. - */ -const MINIMAP_GUTTER_WIDTH = 8; -//#endregion -/** - * An event describing that the configuration of the editor has changed. - */ -class ConfigurationChangedEvent { - /** - * @internal - */ - constructor(values) { - this._values = values; - } - hasChanged(id) { - return this._values[id]; - } -} -/** - * @internal - */ -class ValidatedEditorOptions { - constructor() { - this._values = []; - } - _read(option) { - return this._values[option]; - } - get(id) { - return this._values[id]; - } - _write(option, value) { - this._values[option] = value; - } -} -/** - * @internal - */ -class ComputeOptionsMemory { - constructor() { - this.stableMinimapLayoutInput = null; - this.stableFitMaxMinimapScale = 0; - this.stableFitRemainingWidth = 0; - } -} -/** - * @internal - */ -class BaseEditorOption { - constructor(id, name, defaultValue, schema) { - this.id = id; - this.name = name; - this.defaultValue = defaultValue; - this.schema = schema; - } - compute(env, options, value) { - return value; - } -} -/** - * @internal - */ -class ComputedEditorOption { - constructor(id, deps = null) { - this.schema = undefined; - this.id = id; - this.name = '_never_'; - this.defaultValue = undefined; - this.deps = deps; - } - validate(input) { - return this.defaultValue; - } -} -class SimpleEditorOption { - constructor(id, name, defaultValue, schema) { - this.id = id; - this.name = name; - this.defaultValue = defaultValue; - this.schema = schema; - } - validate(input) { - if (typeof input === 'undefined') { - return this.defaultValue; - } - return input; - } - compute(env, options, value) { - return value; - } -} -class EditorBooleanOption extends SimpleEditorOption { - static boolean(value, defaultValue) { - if (typeof value === 'undefined') { - return defaultValue; - } - if (value === 'false') { - // treat the string 'false' as false - return false; - } - return Boolean(value); - } - constructor(id, name, defaultValue, schema = undefined) { - if (typeof schema !== 'undefined') { - schema.type = 'boolean'; - schema.default = defaultValue; - } - super(id, name, defaultValue, schema); - } - validate(input) { - return EditorBooleanOption.boolean(input, this.defaultValue); - } -} -class EditorIntOption extends SimpleEditorOption { - constructor(id, name, defaultValue, minimum, maximum, schema = undefined) { - if (typeof schema !== 'undefined') { - schema.type = 'integer'; - schema.default = defaultValue; - schema.minimum = minimum; - schema.maximum = maximum; - } - super(id, name, defaultValue, schema); - this.minimum = minimum; - this.maximum = maximum; - } - static clampedInt(value, defaultValue, minimum, maximum) { - if (typeof value === 'undefined') { - return defaultValue; - } - let r = parseInt(value, 10); - if (isNaN(r)) { - return defaultValue; - } - r = Math.max(minimum, r); - r = Math.min(maximum, r); - return r | 0; - } - validate(input) { - return EditorIntOption.clampedInt(input, this.defaultValue, this.minimum, this.maximum); - } -} -class EditorFloatOption extends SimpleEditorOption { - constructor(id, name, defaultValue, validationFn, schema) { - if (typeof schema !== 'undefined') { - schema.type = 'number'; - schema.default = defaultValue; - } - super(id, name, defaultValue, schema); - this.validationFn = validationFn; - } - static clamp(n, min, max) { - if (n < min) { - return min; - } - if (n > max) { - return max; - } - return n; - } - static float(value, defaultValue) { - if (typeof value === 'number') { - return value; - } - if (typeof value === 'undefined') { - return defaultValue; - } - const r = parseFloat(value); - return (isNaN(r) ? defaultValue : r); - } - validate(input) { - return this.validationFn(EditorFloatOption.float(input, this.defaultValue)); - } -} -class EditorStringOption extends SimpleEditorOption { - static string(value, defaultValue) { - if (typeof value !== 'string') { - return defaultValue; - } - return value; - } - constructor(id, name, defaultValue, schema = undefined) { - if (typeof schema !== 'undefined') { - schema.type = 'string'; - schema.default = defaultValue; - } - super(id, name, defaultValue, schema); - } - validate(input) { - return EditorStringOption.string(input, this.defaultValue); - } -} -class EditorStringEnumOption extends SimpleEditorOption { - constructor(id, name, defaultValue, allowedValues, schema = undefined) { - if (typeof schema !== 'undefined') { - schema.type = 'string'; - schema.enum = allowedValues; - schema.default = defaultValue; - } - super(id, name, defaultValue, schema); - this._allowedValues = allowedValues; - } - static stringSet(value, defaultValue, allowedValues) { - if (typeof value !== 'string') { - return defaultValue; - } - if (allowedValues.indexOf(value) === -1) { - return defaultValue; - } - return value; - } - validate(input) { - return EditorStringEnumOption.stringSet(input, this.defaultValue, this._allowedValues); - } -} -class EditorEnumOption extends BaseEditorOption { - constructor(id, name, defaultValue, defaultStringValue, allowedValues, convert, schema = undefined) { - if (typeof schema !== 'undefined') { - schema.type = 'string'; - schema.enum = allowedValues; - schema.default = defaultStringValue; - } - super(id, name, defaultValue, schema); - this._allowedValues = allowedValues; - this._convert = convert; - } - validate(input) { - if (typeof input !== 'string') { - return this.defaultValue; - } - if (this._allowedValues.indexOf(input) === -1) { - return this.defaultValue; - } - return this._convert(input); - } -} -//#endregion -//#region autoIndent -function _autoIndentFromString(autoIndent) { - switch (autoIndent) { - case 'none': return 0 /* None */; - case 'keep': return 1 /* Keep */; - case 'brackets': return 2 /* Brackets */; - case 'advanced': return 3 /* Advanced */; - case 'full': return 4 /* Full */; - } -} -//#endregion -//#region accessibilitySupport -class EditorAccessibilitySupport extends BaseEditorOption { - constructor() { - super(2 /* accessibilitySupport */, 'accessibilitySupport', 0 /* Unknown */, { - type: 'string', - enum: ['auto', 'on', 'off'], - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('accessibilitySupport.auto', "The editor will use platform APIs to detect when a Screen Reader is attached."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('accessibilitySupport.on', "The editor will be permanently optimized for usage with a Screen Reader."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('accessibilitySupport.off', "The editor will never be optimized for usage with a Screen Reader."), - ], - default: 'auto', - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('accessibilitySupport', "Controls whether the editor should run in a mode where it is optimized for screen readers.") - }); - } - validate(input) { - switch (input) { - case 'auto': return 0 /* Unknown */; - case 'off': return 1 /* Disabled */; - case 'on': return 2 /* Enabled */; - } - return this.defaultValue; - } - compute(env, options, value) { - if (value === 0 /* Unknown */) { - // The editor reads the `accessibilitySupport` from the environment - return env.accessibilitySupport; - } - return value; - } -} -class EditorComments extends BaseEditorOption { - constructor() { - const defaults = { - insertSpace: true, - ignoreEmptyLines: true, - }; - super(14 /* comments */, 'comments', defaults, { - 'editor.comments.insertSpace': { - type: 'boolean', - default: defaults.insertSpace, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('comments.insertSpace', "Controls whether a space character is inserted when commenting.") - }, - 'editor.comments.ignoreEmptyLines': { - type: 'boolean', - default: defaults.ignoreEmptyLines, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('comments.ignoreEmptyLines', 'Controls if empty lines should be ignored with toggle, add or remove actions for line comments.') - }, - }); - } - validate(_input) { - if (!_input || typeof _input !== 'object') { - return this.defaultValue; - } - const input = _input; - return { - insertSpace: EditorBooleanOption.boolean(input.insertSpace, this.defaultValue.insertSpace), - ignoreEmptyLines: EditorBooleanOption.boolean(input.ignoreEmptyLines, this.defaultValue.ignoreEmptyLines), - }; - } -} -function _cursorBlinkingStyleFromString(cursorBlinkingStyle) { - switch (cursorBlinkingStyle) { - case 'blink': return 1 /* Blink */; - case 'smooth': return 2 /* Smooth */; - case 'phase': return 3 /* Phase */; - case 'expand': return 4 /* Expand */; - case 'solid': return 5 /* Solid */; - } -} -//#endregion -//#region cursorStyle -/** - * The style in which the editor's cursor should be rendered. - */ -var TextEditorCursorStyle; -(function (TextEditorCursorStyle) { - /** - * As a vertical line (sitting between two characters). - */ - TextEditorCursorStyle[TextEditorCursorStyle["Line"] = 1] = "Line"; - /** - * As a block (sitting on top of a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["Block"] = 2] = "Block"; - /** - * As a horizontal line (sitting under a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["Underline"] = 3] = "Underline"; - /** - * As a thin vertical line (sitting between two characters). - */ - TextEditorCursorStyle[TextEditorCursorStyle["LineThin"] = 4] = "LineThin"; - /** - * As an outlined block (sitting on top of a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["BlockOutline"] = 5] = "BlockOutline"; - /** - * As a thin horizontal line (sitting under a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["UnderlineThin"] = 6] = "UnderlineThin"; -})(TextEditorCursorStyle || (TextEditorCursorStyle = {})); -function _cursorStyleFromString(cursorStyle) { - switch (cursorStyle) { - case 'line': return TextEditorCursorStyle.Line; - case 'block': return TextEditorCursorStyle.Block; - case 'underline': return TextEditorCursorStyle.Underline; - case 'line-thin': return TextEditorCursorStyle.LineThin; - case 'block-outline': return TextEditorCursorStyle.BlockOutline; - case 'underline-thin': return TextEditorCursorStyle.UnderlineThin; - } -} -//#endregion -//#region editorClassName -class EditorClassName extends ComputedEditorOption { - constructor() { - super(114 /* editorClassName */, [57 /* mouseStyle */, 27 /* extraEditorClassName */]); - } - compute(env, options, _) { - const classNames = ['monaco-editor']; - if (options.get(27 /* extraEditorClassName */)) { - classNames.push(options.get(27 /* extraEditorClassName */)); - } - if (env.extraEditorClassName) { - classNames.push(env.extraEditorClassName); - } - if (options.get(57 /* mouseStyle */) === 'default') { - classNames.push('mouse-default'); - } - else if (options.get(57 /* mouseStyle */) === 'copy') { - classNames.push('mouse-copy'); - } - if (options.get(92 /* showUnused */)) { - classNames.push('showUnused'); - } - if (options.get(113 /* showDeprecated */)) { - classNames.push('showDeprecated'); - } - return classNames.join(' '); - } -} -//#endregion -//#region emptySelectionClipboard -class EditorEmptySelectionClipboard extends EditorBooleanOption { - constructor() { - super(26 /* emptySelectionClipboard */, 'emptySelectionClipboard', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('emptySelectionClipboard', "Controls whether copying without a selection copies the current line.") }); - } - compute(env, options, value) { - return value && env.emptySelectionClipboard; - } -} -class EditorFind extends BaseEditorOption { - constructor() { - const defaults = { - cursorMoveOnType: true, - seedSearchStringFromSelection: true, - autoFindInSelection: 'never', - globalFindClipboard: false, - addExtraSpaceOnTop: true, - loop: true - }; - super(29 /* find */, 'find', defaults, { - 'editor.find.cursorMoveOnType': { - type: 'boolean', - default: defaults.cursorMoveOnType, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('find.cursorMoveOnType', "Controls whether the cursor should jump to find matches while typing.") - }, - 'editor.find.seedSearchStringFromSelection': { - type: 'boolean', - default: defaults.seedSearchStringFromSelection, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('find.seedSearchStringFromSelection', "Controls whether the search string in the Find Widget is seeded from the editor selection.") - }, - 'editor.find.autoFindInSelection': { - type: 'string', - enum: ['never', 'always', 'multiline'], - default: defaults.autoFindInSelection, - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.find.autoFindInSelection.never', 'Never turn on Find in selection automatically (default)'), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.find.autoFindInSelection.always', 'Always turn on Find in selection automatically'), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.find.autoFindInSelection.multiline', 'Turn on Find in selection automatically when multiple lines of content are selected.') - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('find.autoFindInSelection', "Controls the condition for turning on find in selection automatically.") - }, - 'editor.find.globalFindClipboard': { - type: 'boolean', - default: defaults.globalFindClipboard, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('find.globalFindClipboard', "Controls whether the Find Widget should read or modify the shared find clipboard on macOS."), - included: _base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isMacintosh"] - }, - 'editor.find.addExtraSpaceOnTop': { - type: 'boolean', - default: defaults.addExtraSpaceOnTop, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('find.addExtraSpaceOnTop', "Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.") - }, - 'editor.find.loop': { - type: 'boolean', - default: defaults.loop, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('find.loop', "Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.") - }, - }); - } - validate(_input) { - if (!_input || typeof _input !== 'object') { - return this.defaultValue; - } - const input = _input; - return { - cursorMoveOnType: EditorBooleanOption.boolean(input.cursorMoveOnType, this.defaultValue.cursorMoveOnType), - seedSearchStringFromSelection: EditorBooleanOption.boolean(input.seedSearchStringFromSelection, this.defaultValue.seedSearchStringFromSelection), - autoFindInSelection: typeof _input.autoFindInSelection === 'boolean' - ? (_input.autoFindInSelection ? 'always' : 'never') - : EditorStringEnumOption.stringSet(input.autoFindInSelection, this.defaultValue.autoFindInSelection, ['never', 'always', 'multiline']), - globalFindClipboard: EditorBooleanOption.boolean(input.globalFindClipboard, this.defaultValue.globalFindClipboard), - addExtraSpaceOnTop: EditorBooleanOption.boolean(input.addExtraSpaceOnTop, this.defaultValue.addExtraSpaceOnTop), - loop: EditorBooleanOption.boolean(input.loop, this.defaultValue.loop), - }; - } -} -//#endregion -//#region fontLigatures -/** - * @internal - */ -class EditorFontLigatures extends BaseEditorOption { - constructor() { - super(37 /* fontLigatures */, 'fontLigatures', EditorFontLigatures.OFF, { - anyOf: [ - { - type: 'boolean', - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('fontLigatures', "Enables/Disables font ligatures."), - }, - { - type: 'string', - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('fontFeatureSettings', "Explicit font-feature-settings.") - } - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('fontLigaturesGeneral', "Configures font ligatures or font features."), - default: false - }); - } - validate(input) { - if (typeof input === 'undefined') { - return this.defaultValue; - } - if (typeof input === 'string') { - if (input === 'false') { - return EditorFontLigatures.OFF; - } - if (input === 'true') { - return EditorFontLigatures.ON; - } - return input; - } - if (Boolean(input)) { - return EditorFontLigatures.ON; - } - return EditorFontLigatures.OFF; - } -} -EditorFontLigatures.OFF = '"liga" off, "calt" off'; -EditorFontLigatures.ON = '"liga" on, "calt" on'; -//#endregion -//#region fontInfo -class EditorFontInfo extends ComputedEditorOption { - constructor() { - super(36 /* fontInfo */); - } - compute(env, options, _) { - return env.fontInfo; - } -} -//#endregion -//#region fontSize -class EditorFontSize extends SimpleEditorOption { - constructor() { - super(38 /* fontSize */, 'fontSize', EDITOR_FONT_DEFAULTS.fontSize, { - type: 'number', - minimum: 6, - maximum: 100, - default: EDITOR_FONT_DEFAULTS.fontSize, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('fontSize', "Controls the font size in pixels.") - }); - } - validate(input) { - let r = EditorFloatOption.float(input, this.defaultValue); - if (r === 0) { - return EDITOR_FONT_DEFAULTS.fontSize; - } - return EditorFloatOption.clamp(r, 6, 100); - } - compute(env, options, value) { - // The final fontSize respects the editor zoom level. - // So take the result from env.fontInfo - return env.fontInfo.fontSize; - } -} -//#endregion -//#region fontWeight -class EditorFontWeight extends BaseEditorOption { - constructor() { - super(39 /* fontWeight */, 'fontWeight', EDITOR_FONT_DEFAULTS.fontWeight, { - anyOf: [ - { - type: 'number', - minimum: EditorFontWeight.MINIMUM_VALUE, - maximum: EditorFontWeight.MAXIMUM_VALUE, - errorMessage: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('fontWeightErrorMessage', "Only \"normal\" and \"bold\" keywords or numbers between 1 and 1000 are allowed.") - }, - { - type: 'string', - pattern: '^(normal|bold|1000|[1-9][0-9]{0,2})$' - }, - { - enum: EditorFontWeight.SUGGESTION_VALUES - } - ], - default: EDITOR_FONT_DEFAULTS.fontWeight, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('fontWeight', "Controls the font weight. Accepts \"normal\" and \"bold\" keywords or numbers between 1 and 1000.") - }); - } - validate(input) { - if (input === 'normal' || input === 'bold') { - return input; - } - return String(EditorIntOption.clampedInt(input, EDITOR_FONT_DEFAULTS.fontWeight, EditorFontWeight.MINIMUM_VALUE, EditorFontWeight.MAXIMUM_VALUE)); - } -} -EditorFontWeight.SUGGESTION_VALUES = ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900']; -EditorFontWeight.MINIMUM_VALUE = 1; -EditorFontWeight.MAXIMUM_VALUE = 1000; -class EditorGoToLocation extends BaseEditorOption { - constructor() { - const defaults = { - multiple: 'peek', - multipleDefinitions: 'peek', - multipleTypeDefinitions: 'peek', - multipleDeclarations: 'peek', - multipleImplementations: 'peek', - multipleReferences: 'peek', - alternativeDefinitionCommand: 'editor.action.goToReferences', - alternativeTypeDefinitionCommand: 'editor.action.goToReferences', - alternativeDeclarationCommand: 'editor.action.goToReferences', - alternativeImplementationCommand: '', - alternativeReferenceCommand: '', - }; - const jsonSubset = { - type: 'string', - enum: ['peek', 'gotoAndPeek', 'goto'], - default: defaults.multiple, - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.gotoLocation.multiple.peek', 'Show peek view of the results (default)'), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.gotoLocation.multiple.gotoAndPeek', 'Go to the primary result and show a peek view'), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.gotoLocation.multiple.goto', 'Go to the primary result and enable peek-less navigation to others') - ] - }; - super(43 /* gotoLocation */, 'gotoLocation', defaults, { - 'editor.gotoLocation.multiple': { - deprecationMessage: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.gotoLocation.multiple.deprecated', "This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead."), - }, - 'editor.gotoLocation.multipleDefinitions': Object.assign({ description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.editor.gotoLocation.multipleDefinitions', "Controls the behavior the 'Go to Definition'-command when multiple target locations exist.") }, jsonSubset), - 'editor.gotoLocation.multipleTypeDefinitions': Object.assign({ description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.editor.gotoLocation.multipleTypeDefinitions', "Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.") }, jsonSubset), - 'editor.gotoLocation.multipleDeclarations': Object.assign({ description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.editor.gotoLocation.multipleDeclarations', "Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.") }, jsonSubset), - 'editor.gotoLocation.multipleImplementations': Object.assign({ description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.editor.gotoLocation.multipleImplemenattions', "Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.") }, jsonSubset), - 'editor.gotoLocation.multipleReferences': Object.assign({ description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.editor.gotoLocation.multipleReferences', "Controls the behavior the 'Go to References'-command when multiple target locations exist.") }, jsonSubset), - 'editor.gotoLocation.alternativeDefinitionCommand': { - type: 'string', - default: defaults.alternativeDefinitionCommand, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('alternativeDefinitionCommand', "Alternative command id that is being executed when the result of 'Go to Definition' is the current location.") - }, - 'editor.gotoLocation.alternativeTypeDefinitionCommand': { - type: 'string', - default: defaults.alternativeTypeDefinitionCommand, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('alternativeTypeDefinitionCommand', "Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.") - }, - 'editor.gotoLocation.alternativeDeclarationCommand': { - type: 'string', - default: defaults.alternativeDeclarationCommand, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('alternativeDeclarationCommand', "Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.") - }, - 'editor.gotoLocation.alternativeImplementationCommand': { - type: 'string', - default: defaults.alternativeImplementationCommand, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('alternativeImplementationCommand', "Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.") - }, - 'editor.gotoLocation.alternativeReferenceCommand': { - type: 'string', - default: defaults.alternativeReferenceCommand, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('alternativeReferenceCommand', "Alternative command id that is being executed when the result of 'Go to Reference' is the current location.") - }, - }); - } - validate(_input) { - var _a, _b, _c, _d, _e; - if (!_input || typeof _input !== 'object') { - return this.defaultValue; - } - const input = _input; - return { - multiple: EditorStringEnumOption.stringSet(input.multiple, this.defaultValue.multiple, ['peek', 'gotoAndPeek', 'goto']), - multipleDefinitions: (_a = input.multipleDefinitions) !== null && _a !== void 0 ? _a : EditorStringEnumOption.stringSet(input.multipleDefinitions, 'peek', ['peek', 'gotoAndPeek', 'goto']), - multipleTypeDefinitions: (_b = input.multipleTypeDefinitions) !== null && _b !== void 0 ? _b : EditorStringEnumOption.stringSet(input.multipleTypeDefinitions, 'peek', ['peek', 'gotoAndPeek', 'goto']), - multipleDeclarations: (_c = input.multipleDeclarations) !== null && _c !== void 0 ? _c : EditorStringEnumOption.stringSet(input.multipleDeclarations, 'peek', ['peek', 'gotoAndPeek', 'goto']), - multipleImplementations: (_d = input.multipleImplementations) !== null && _d !== void 0 ? _d : EditorStringEnumOption.stringSet(input.multipleImplementations, 'peek', ['peek', 'gotoAndPeek', 'goto']), - multipleReferences: (_e = input.multipleReferences) !== null && _e !== void 0 ? _e : EditorStringEnumOption.stringSet(input.multipleReferences, 'peek', ['peek', 'gotoAndPeek', 'goto']), - alternativeDefinitionCommand: EditorStringOption.string(input.alternativeDefinitionCommand, this.defaultValue.alternativeDefinitionCommand), - alternativeTypeDefinitionCommand: EditorStringOption.string(input.alternativeTypeDefinitionCommand, this.defaultValue.alternativeTypeDefinitionCommand), - alternativeDeclarationCommand: EditorStringOption.string(input.alternativeDeclarationCommand, this.defaultValue.alternativeDeclarationCommand), - alternativeImplementationCommand: EditorStringOption.string(input.alternativeImplementationCommand, this.defaultValue.alternativeImplementationCommand), - alternativeReferenceCommand: EditorStringOption.string(input.alternativeReferenceCommand, this.defaultValue.alternativeReferenceCommand), - }; - } -} -class EditorHover extends BaseEditorOption { - constructor() { - const defaults = { - enabled: true, - delay: 300, - sticky: true - }; - super(46 /* hover */, 'hover', defaults, { - 'editor.hover.enabled': { - type: 'boolean', - default: defaults.enabled, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('hover.enabled', "Controls whether the hover is shown.") - }, - 'editor.hover.delay': { - type: 'number', - default: defaults.delay, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('hover.delay', "Controls the delay in milliseconds after which the hover is shown.") - }, - 'editor.hover.sticky': { - type: 'boolean', - default: defaults.sticky, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('hover.sticky', "Controls whether the hover should remain visible when mouse is moved over it.") - }, - }); - } - validate(_input) { - if (!_input || typeof _input !== 'object') { - return this.defaultValue; - } - const input = _input; - return { - enabled: EditorBooleanOption.boolean(input.enabled, this.defaultValue.enabled), - delay: EditorIntOption.clampedInt(input.delay, this.defaultValue.delay, 0, 10000), - sticky: EditorBooleanOption.boolean(input.sticky, this.defaultValue.sticky) - }; - } -} -/** - * @internal - */ -class EditorLayoutInfoComputer extends ComputedEditorOption { - constructor() { - super(117 /* layoutInfo */, [ - 42 /* glyphMargin */, 50 /* lineDecorationsWidth */, 31 /* folding */, - 56 /* minimap */, 84 /* scrollbar */, 52 /* lineNumbers */, - 53 /* lineNumbersMinChars */, 86 /* scrollBeyondLastLine */, - 106 /* wordWrap */, 109 /* wordWrapColumn */, 110 /* wordWrapMinified */, - 2 /* accessibilitySupport */ - ]); - } - compute(env, options, _) { - return EditorLayoutInfoComputer.computeLayout(options, { - memory: env.memory, - outerWidth: env.outerWidth, - outerHeight: env.outerHeight, - isDominatedByLongLines: env.isDominatedByLongLines, - lineHeight: env.fontInfo.lineHeight, - viewLineCount: env.viewLineCount, - lineNumbersDigitCount: env.lineNumbersDigitCount, - typicalHalfwidthCharacterWidth: env.fontInfo.typicalHalfwidthCharacterWidth, - maxDigitWidth: env.fontInfo.maxDigitWidth, - pixelRatio: env.pixelRatio - }); - } - static computeContainedMinimapLineCount(input) { - const typicalViewportLineCount = input.height / input.lineHeight; - const extraLinesBeyondLastLine = input.scrollBeyondLastLine ? (typicalViewportLineCount - 1) : 0; - const desiredRatio = (input.viewLineCount + extraLinesBeyondLastLine) / (input.pixelRatio * input.height); - const minimapLineCount = Math.floor(input.viewLineCount / desiredRatio); - return { typicalViewportLineCount, extraLinesBeyondLastLine, desiredRatio, minimapLineCount }; - } - static _computeMinimapLayout(input, memory) { - const outerWidth = input.outerWidth; - const outerHeight = input.outerHeight; - const pixelRatio = input.pixelRatio; - if (!input.minimap.enabled) { - return { - renderMinimap: 0 /* None */, - minimapLeft: 0, - minimapWidth: 0, - minimapHeightIsEditorHeight: false, - minimapIsSampling: false, - minimapScale: 1, - minimapLineHeight: 1, - minimapCanvasInnerWidth: 0, - minimapCanvasInnerHeight: Math.floor(pixelRatio * outerHeight), - minimapCanvasOuterWidth: 0, - minimapCanvasOuterHeight: outerHeight, - }; - } - // Can use memory if only the `viewLineCount` and `remainingWidth` have changed - const stableMinimapLayoutInput = memory.stableMinimapLayoutInput; - const couldUseMemory = (stableMinimapLayoutInput - // && input.outerWidth === lastMinimapLayoutInput.outerWidth !!! INTENTIONAL OMITTED - && input.outerHeight === stableMinimapLayoutInput.outerHeight - && input.lineHeight === stableMinimapLayoutInput.lineHeight - && input.typicalHalfwidthCharacterWidth === stableMinimapLayoutInput.typicalHalfwidthCharacterWidth - && input.pixelRatio === stableMinimapLayoutInput.pixelRatio - && input.scrollBeyondLastLine === stableMinimapLayoutInput.scrollBeyondLastLine - && input.minimap.enabled === stableMinimapLayoutInput.minimap.enabled - && input.minimap.side === stableMinimapLayoutInput.minimap.side - && input.minimap.size === stableMinimapLayoutInput.minimap.size - && input.minimap.showSlider === stableMinimapLayoutInput.minimap.showSlider - && input.minimap.renderCharacters === stableMinimapLayoutInput.minimap.renderCharacters - && input.minimap.maxColumn === stableMinimapLayoutInput.minimap.maxColumn - && input.minimap.scale === stableMinimapLayoutInput.minimap.scale - && input.verticalScrollbarWidth === stableMinimapLayoutInput.verticalScrollbarWidth - // && input.viewLineCount === lastMinimapLayoutInput.viewLineCount !!! INTENTIONAL OMITTED - // && input.remainingWidth === lastMinimapLayoutInput.remainingWidth !!! INTENTIONAL OMITTED - && input.isViewportWrapping === stableMinimapLayoutInput.isViewportWrapping); - const lineHeight = input.lineHeight; - const typicalHalfwidthCharacterWidth = input.typicalHalfwidthCharacterWidth; - const scrollBeyondLastLine = input.scrollBeyondLastLine; - const minimapRenderCharacters = input.minimap.renderCharacters; - let minimapScale = (pixelRatio >= 2 ? Math.round(input.minimap.scale * 2) : input.minimap.scale); - const minimapMaxColumn = input.minimap.maxColumn; - const minimapSize = input.minimap.size; - const minimapSide = input.minimap.side; - const verticalScrollbarWidth = input.verticalScrollbarWidth; - const viewLineCount = input.viewLineCount; - const remainingWidth = input.remainingWidth; - const isViewportWrapping = input.isViewportWrapping; - const baseCharHeight = minimapRenderCharacters ? 2 : 3; - let minimapCanvasInnerHeight = Math.floor(pixelRatio * outerHeight); - const minimapCanvasOuterHeight = minimapCanvasInnerHeight / pixelRatio; - let minimapHeightIsEditorHeight = false; - let minimapIsSampling = false; - let minimapLineHeight = baseCharHeight * minimapScale; - let minimapCharWidth = minimapScale / pixelRatio; - let minimapWidthMultiplier = 1; - if (minimapSize === 'fill' || minimapSize === 'fit') { - const { typicalViewportLineCount, extraLinesBeyondLastLine, desiredRatio, minimapLineCount } = EditorLayoutInfoComputer.computeContainedMinimapLineCount({ - viewLineCount: viewLineCount, - scrollBeyondLastLine: scrollBeyondLastLine, - height: outerHeight, - lineHeight: lineHeight, - pixelRatio: pixelRatio - }); - // ratio is intentionally not part of the layout to avoid the layout changing all the time - // when doing sampling - const ratio = viewLineCount / minimapLineCount; - if (ratio > 1) { - minimapHeightIsEditorHeight = true; - minimapIsSampling = true; - minimapScale = 1; - minimapLineHeight = 1; - minimapCharWidth = minimapScale / pixelRatio; - } - else { - let fitBecomesFill = false; - let maxMinimapScale = minimapScale + 1; - if (minimapSize === 'fit') { - const effectiveMinimapHeight = Math.ceil((viewLineCount + extraLinesBeyondLastLine) * minimapLineHeight); - if (isViewportWrapping && couldUseMemory && remainingWidth <= memory.stableFitRemainingWidth) { - // There is a loop when using `fit` and viewport wrapping: - // - view line count impacts minimap layout - // - minimap layout impacts viewport width - // - viewport width impacts view line count - // To break the loop, once we go to a smaller minimap scale, we try to stick with it. - fitBecomesFill = true; - maxMinimapScale = memory.stableFitMaxMinimapScale; - } - else { - fitBecomesFill = (effectiveMinimapHeight > minimapCanvasInnerHeight); - if (isViewportWrapping && fitBecomesFill) { - // remember for next time - memory.stableMinimapLayoutInput = input; - memory.stableFitRemainingWidth = remainingWidth; - } - else { - memory.stableMinimapLayoutInput = null; - memory.stableFitRemainingWidth = 0; - } - } - } - if (minimapSize === 'fill' || fitBecomesFill) { - minimapHeightIsEditorHeight = true; - const configuredMinimapScale = minimapScale; - minimapLineHeight = Math.min(lineHeight * pixelRatio, Math.max(1, Math.floor(1 / desiredRatio))); - minimapScale = Math.min(maxMinimapScale, Math.max(1, Math.floor(minimapLineHeight / baseCharHeight))); - if (minimapScale > configuredMinimapScale) { - minimapWidthMultiplier = Math.min(2, minimapScale / configuredMinimapScale); - } - minimapCharWidth = minimapScale / pixelRatio / minimapWidthMultiplier; - minimapCanvasInnerHeight = Math.ceil((Math.max(typicalViewportLineCount, viewLineCount + extraLinesBeyondLastLine)) * minimapLineHeight); - if (isViewportWrapping && fitBecomesFill) { - memory.stableFitMaxMinimapScale = minimapScale; - } - } - } - } - // Given: - // (leaving 2px for the cursor to have space after the last character) - // viewportColumn = (contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth - // minimapWidth = viewportColumn * minimapCharWidth - // contentWidth = remainingWidth - minimapWidth - // What are good values for contentWidth and minimapWidth ? - // minimapWidth = ((contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth) * minimapCharWidth - // typicalHalfwidthCharacterWidth * minimapWidth = (contentWidth - verticalScrollbarWidth - 2) * minimapCharWidth - // typicalHalfwidthCharacterWidth * minimapWidth = (remainingWidth - minimapWidth - verticalScrollbarWidth - 2) * minimapCharWidth - // (typicalHalfwidthCharacterWidth + minimapCharWidth) * minimapWidth = (remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth - // minimapWidth = ((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth) - const minimapMaxWidth = Math.floor(minimapMaxColumn * minimapCharWidth); - const minimapWidth = Math.min(minimapMaxWidth, Math.max(0, Math.floor(((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth))) + MINIMAP_GUTTER_WIDTH); - let minimapCanvasInnerWidth = Math.floor(pixelRatio * minimapWidth); - const minimapCanvasOuterWidth = minimapCanvasInnerWidth / pixelRatio; - minimapCanvasInnerWidth = Math.floor(minimapCanvasInnerWidth * minimapWidthMultiplier); - const renderMinimap = (minimapRenderCharacters ? 1 /* Text */ : 2 /* Blocks */); - const minimapLeft = (minimapSide === 'left' ? 0 : (outerWidth - minimapWidth - verticalScrollbarWidth)); - return { - renderMinimap, - minimapLeft, - minimapWidth, - minimapHeightIsEditorHeight, - minimapIsSampling, - minimapScale, - minimapLineHeight, - minimapCanvasInnerWidth, - minimapCanvasInnerHeight, - minimapCanvasOuterWidth, - minimapCanvasOuterHeight, - }; - } - static computeLayout(options, env) { - const outerWidth = env.outerWidth | 0; - const outerHeight = env.outerHeight | 0; - const lineHeight = env.lineHeight | 0; - const lineNumbersDigitCount = env.lineNumbersDigitCount | 0; - const typicalHalfwidthCharacterWidth = env.typicalHalfwidthCharacterWidth; - const maxDigitWidth = env.maxDigitWidth; - const pixelRatio = env.pixelRatio; - const viewLineCount = env.viewLineCount; - const wordWrap = options.get(106 /* wordWrap */); - const wordWrapColumn = options.get(109 /* wordWrapColumn */); - const wordWrapMinified = options.get(110 /* wordWrapMinified */); - const accessibilitySupport = options.get(2 /* accessibilitySupport */); - const isDominatedByLongLines = env.isDominatedByLongLines; - const showGlyphMargin = options.get(42 /* glyphMargin */); - const showLineNumbers = (options.get(52 /* lineNumbers */).renderType !== 0 /* Off */); - const lineNumbersMinChars = options.get(53 /* lineNumbersMinChars */); - const scrollBeyondLastLine = options.get(86 /* scrollBeyondLastLine */); - const minimap = options.get(56 /* minimap */); - const scrollbar = options.get(84 /* scrollbar */); - const verticalScrollbarWidth = scrollbar.verticalScrollbarSize; - const verticalScrollbarHasArrows = scrollbar.verticalHasArrows; - const scrollbarArrowSize = scrollbar.arrowSize; - const horizontalScrollbarHeight = scrollbar.horizontalScrollbarSize; - const rawLineDecorationsWidth = options.get(50 /* lineDecorationsWidth */); - const folding = options.get(31 /* folding */); - let lineDecorationsWidth; - if (typeof rawLineDecorationsWidth === 'string' && /^\d+(\.\d+)?ch$/.test(rawLineDecorationsWidth)) { - const multiple = parseFloat(rawLineDecorationsWidth.substr(0, rawLineDecorationsWidth.length - 2)); - lineDecorationsWidth = EditorIntOption.clampedInt(multiple * typicalHalfwidthCharacterWidth, 0, 0, 1000); - } - else { - lineDecorationsWidth = EditorIntOption.clampedInt(rawLineDecorationsWidth, 0, 0, 1000); - } - if (folding) { - lineDecorationsWidth += 16; - } - let lineNumbersWidth = 0; - if (showLineNumbers) { - const digitCount = Math.max(lineNumbersDigitCount, lineNumbersMinChars); - lineNumbersWidth = Math.round(digitCount * maxDigitWidth); - } - let glyphMarginWidth = 0; - if (showGlyphMargin) { - glyphMarginWidth = lineHeight; - } - let glyphMarginLeft = 0; - let lineNumbersLeft = glyphMarginLeft + glyphMarginWidth; - let decorationsLeft = lineNumbersLeft + lineNumbersWidth; - let contentLeft = decorationsLeft + lineDecorationsWidth; - const remainingWidth = outerWidth - glyphMarginWidth - lineNumbersWidth - lineDecorationsWidth; - let isWordWrapMinified = false; - let isViewportWrapping = false; - let wrappingColumn = -1; - if (accessibilitySupport !== 2 /* Enabled */) { - // See https://github.com/Microsoft/vscode/issues/27766 - // Never enable wrapping when a screen reader is attached - // because arrow down etc. will not move the cursor in the way - // a screen reader expects. - if (wordWrapMinified && isDominatedByLongLines) { - // Force viewport width wrapping if model is dominated by long lines - isWordWrapMinified = true; - isViewportWrapping = true; - } - else if (wordWrap === 'on' || wordWrap === 'bounded') { - isViewportWrapping = true; - } - else if (wordWrap === 'wordWrapColumn') { - wrappingColumn = wordWrapColumn; - } - } - const minimapLayout = EditorLayoutInfoComputer._computeMinimapLayout({ - outerWidth: outerWidth, - outerHeight: outerHeight, - lineHeight: lineHeight, - typicalHalfwidthCharacterWidth: typicalHalfwidthCharacterWidth, - pixelRatio: pixelRatio, - scrollBeyondLastLine: scrollBeyondLastLine, - minimap: minimap, - verticalScrollbarWidth: verticalScrollbarWidth, - viewLineCount: viewLineCount, - remainingWidth: remainingWidth, - isViewportWrapping: isViewportWrapping, - }, env.memory || new ComputeOptionsMemory()); - if (minimapLayout.renderMinimap !== 0 /* None */ && minimapLayout.minimapLeft === 0) { - // the minimap is rendered to the left, so move everything to the right - glyphMarginLeft += minimapLayout.minimapWidth; - lineNumbersLeft += minimapLayout.minimapWidth; - decorationsLeft += minimapLayout.minimapWidth; - contentLeft += minimapLayout.minimapWidth; - } - const contentWidth = remainingWidth - minimapLayout.minimapWidth; - // (leaving 2px for the cursor to have space after the last character) - const viewportColumn = Math.max(1, Math.floor((contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth)); - const verticalArrowSize = (verticalScrollbarHasArrows ? scrollbarArrowSize : 0); - if (isViewportWrapping) { - // compute the actual wrappingColumn - wrappingColumn = Math.max(1, viewportColumn); - if (wordWrap === 'bounded') { - wrappingColumn = Math.min(wrappingColumn, wordWrapColumn); - } - } - return { - width: outerWidth, - height: outerHeight, - glyphMarginLeft: glyphMarginLeft, - glyphMarginWidth: glyphMarginWidth, - lineNumbersLeft: lineNumbersLeft, - lineNumbersWidth: lineNumbersWidth, - decorationsLeft: decorationsLeft, - decorationsWidth: lineDecorationsWidth, - contentLeft: contentLeft, - contentWidth: contentWidth, - minimap: minimapLayout, - viewportColumn: viewportColumn, - isWordWrapMinified: isWordWrapMinified, - isViewportWrapping: isViewportWrapping, - wrappingColumn: wrappingColumn, - verticalScrollbarWidth: verticalScrollbarWidth, - horizontalScrollbarHeight: horizontalScrollbarHeight, - overviewRuler: { - top: verticalArrowSize, - width: verticalScrollbarWidth, - height: (outerHeight - 2 * verticalArrowSize), - right: 0 - } - }; - } -} -class EditorLightbulb extends BaseEditorOption { - constructor() { - const defaults = { enabled: true }; - super(49 /* lightbulb */, 'lightbulb', defaults, { - 'editor.lightbulb.enabled': { - type: 'boolean', - default: defaults.enabled, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('codeActions', "Enables the code action lightbulb in the editor.") - }, - }); - } - validate(_input) { - if (!_input || typeof _input !== 'object') { - return this.defaultValue; - } - const input = _input; - return { - enabled: EditorBooleanOption.boolean(input.enabled, this.defaultValue.enabled) - }; - } -} -//#endregion -//#region lineHeight -class EditorLineHeight extends EditorIntOption { - constructor() { - super(51 /* lineHeight */, 'lineHeight', EDITOR_FONT_DEFAULTS.lineHeight, 0, 150, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lineHeight', "Controls the line height. Use 0 to compute the line height from the font size.") }); - } - compute(env, options, value) { - // The lineHeight is computed from the fontSize if it is 0. - // Moreover, the final lineHeight respects the editor zoom level. - // So take the result from env.fontInfo - return env.fontInfo.lineHeight; - } -} -class EditorMinimap extends BaseEditorOption { - constructor() { - const defaults = { - enabled: true, - size: 'proportional', - side: 'right', - showSlider: 'mouseover', - renderCharacters: true, - maxColumn: 120, - scale: 1, - }; - super(56 /* minimap */, 'minimap', defaults, { - 'editor.minimap.enabled': { - type: 'boolean', - default: defaults.enabled, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('minimap.enabled', "Controls whether the minimap is shown.") - }, - 'editor.minimap.size': { - type: 'string', - enum: ['proportional', 'fill', 'fit'], - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('minimap.size.proportional', "The minimap has the same size as the editor contents (and might scroll)."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('minimap.size.fill', "The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('minimap.size.fit', "The minimap will shrink as necessary to never be larger than the editor (no scrolling)."), - ], - default: defaults.size, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('minimap.size', "Controls the size of the minimap.") - }, - 'editor.minimap.side': { - type: 'string', - enum: ['left', 'right'], - default: defaults.side, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('minimap.side', "Controls the side where to render the minimap.") - }, - 'editor.minimap.showSlider': { - type: 'string', - enum: ['always', 'mouseover'], - default: defaults.showSlider, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('minimap.showSlider', "Controls when the minimap slider is shown.") - }, - 'editor.minimap.scale': { - type: 'number', - default: defaults.scale, - minimum: 1, - maximum: 3, - enum: [1, 2, 3], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('minimap.scale', "Scale of content drawn in the minimap: 1, 2 or 3.") - }, - 'editor.minimap.renderCharacters': { - type: 'boolean', - default: defaults.renderCharacters, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('minimap.renderCharacters', "Render the actual characters on a line as opposed to color blocks.") - }, - 'editor.minimap.maxColumn': { - type: 'number', - default: defaults.maxColumn, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('minimap.maxColumn', "Limit the width of the minimap to render at most a certain number of columns.") - } - }); - } - validate(_input) { - if (!_input || typeof _input !== 'object') { - return this.defaultValue; - } - const input = _input; - return { - enabled: EditorBooleanOption.boolean(input.enabled, this.defaultValue.enabled), - size: EditorStringEnumOption.stringSet(input.size, this.defaultValue.size, ['proportional', 'fill', 'fit']), - side: EditorStringEnumOption.stringSet(input.side, this.defaultValue.side, ['right', 'left']), - showSlider: EditorStringEnumOption.stringSet(input.showSlider, this.defaultValue.showSlider, ['always', 'mouseover']), - renderCharacters: EditorBooleanOption.boolean(input.renderCharacters, this.defaultValue.renderCharacters), - scale: EditorIntOption.clampedInt(input.scale, 1, 1, 3), - maxColumn: EditorIntOption.clampedInt(input.maxColumn, this.defaultValue.maxColumn, 1, 10000), - }; - } -} -//#endregion -//#region multiCursorModifier -function _multiCursorModifierFromString(multiCursorModifier) { - if (multiCursorModifier === 'ctrlCmd') { - return (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isMacintosh"] ? 'metaKey' : 'ctrlKey'); - } - return 'altKey'; -} -class EditorPadding extends BaseEditorOption { - constructor() { - super(66 /* padding */, 'padding', { top: 0, bottom: 0 }, { - 'editor.padding.top': { - type: 'number', - default: 0, - minimum: 0, - maximum: 1000, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('padding.top', "Controls the amount of space between the top edge of the editor and the first line.") - }, - 'editor.padding.bottom': { - type: 'number', - default: 0, - minimum: 0, - maximum: 1000, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('padding.bottom', "Controls the amount of space between the bottom edge of the editor and the last line.") - } - }); - } - validate(_input) { - if (!_input || typeof _input !== 'object') { - return this.defaultValue; - } - const input = _input; - return { - top: EditorIntOption.clampedInt(input.top, 0, 0, 1000), - bottom: EditorIntOption.clampedInt(input.bottom, 0, 0, 1000) - }; - } -} -class EditorParameterHints extends BaseEditorOption { - constructor() { - const defaults = { - enabled: true, - cycle: false - }; - super(67 /* parameterHints */, 'parameterHints', defaults, { - 'editor.parameterHints.enabled': { - type: 'boolean', - default: defaults.enabled, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('parameterHints.enabled', "Enables a pop-up that shows parameter documentation and type information as you type.") - }, - 'editor.parameterHints.cycle': { - type: 'boolean', - default: defaults.cycle, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('parameterHints.cycle', "Controls whether the parameter hints menu cycles or closes when reaching the end of the list.") - }, - }); - } - validate(_input) { - if (!_input || typeof _input !== 'object') { - return this.defaultValue; - } - const input = _input; - return { - enabled: EditorBooleanOption.boolean(input.enabled, this.defaultValue.enabled), - cycle: EditorBooleanOption.boolean(input.cycle, this.defaultValue.cycle) - }; - } -} -//#endregion -//#region pixelRatio -class EditorPixelRatio extends ComputedEditorOption { - constructor() { - super(115 /* pixelRatio */); - } - compute(env, options, _) { - return env.pixelRatio; - } -} -class EditorQuickSuggestions extends BaseEditorOption { - constructor() { - const defaults = { - other: true, - comments: false, - strings: false - }; - super(70 /* quickSuggestions */, 'quickSuggestions', defaults, { - anyOf: [ - { - type: 'boolean', - }, - { - type: 'object', - properties: { - strings: { - type: 'boolean', - default: defaults.strings, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('quickSuggestions.strings', "Enable quick suggestions inside strings.") - }, - comments: { - type: 'boolean', - default: defaults.comments, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('quickSuggestions.comments', "Enable quick suggestions inside comments.") - }, - other: { - type: 'boolean', - default: defaults.other, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('quickSuggestions.other', "Enable quick suggestions outside of strings and comments.") - }, - } - } - ], - default: defaults, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('quickSuggestions', "Controls whether suggestions should automatically show up while typing.") - }); - this.defaultValue = defaults; - } - validate(_input) { - if (typeof _input === 'boolean') { - return _input; - } - if (_input && typeof _input === 'object') { - const input = _input; - const opts = { - other: EditorBooleanOption.boolean(input.other, this.defaultValue.other), - comments: EditorBooleanOption.boolean(input.comments, this.defaultValue.comments), - strings: EditorBooleanOption.boolean(input.strings, this.defaultValue.strings), - }; - if (opts.other && opts.comments && opts.strings) { - return true; // all on - } - else if (!opts.other && !opts.comments && !opts.strings) { - return false; // all off - } - else { - return opts; - } - } - return this.defaultValue; - } -} -class EditorRenderLineNumbersOption extends BaseEditorOption { - constructor() { - super(52 /* lineNumbers */, 'lineNumbers', { renderType: 1 /* On */, renderFn: null }, { - type: 'string', - enum: ['off', 'on', 'relative', 'interval'], - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lineNumbers.off', "Line numbers are not rendered."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lineNumbers.on', "Line numbers are rendered as absolute number."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lineNumbers.relative', "Line numbers are rendered as distance in lines to cursor position."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lineNumbers.interval', "Line numbers are rendered every 10 lines.") - ], - default: 'on', - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lineNumbers', "Controls the display of line numbers.") - }); - } - validate(lineNumbers) { - let renderType = this.defaultValue.renderType; - let renderFn = this.defaultValue.renderFn; - if (typeof lineNumbers !== 'undefined') { - if (typeof lineNumbers === 'function') { - renderType = 4 /* Custom */; - renderFn = lineNumbers; - } - else if (lineNumbers === 'interval') { - renderType = 3 /* Interval */; - } - else if (lineNumbers === 'relative') { - renderType = 2 /* Relative */; - } - else if (lineNumbers === 'on') { - renderType = 1 /* On */; - } - else { - renderType = 0 /* Off */; - } - } - return { - renderType, - renderFn - }; - } -} -//#endregion -//#region renderValidationDecorations -/** - * @internal - */ -function filterValidationDecorations(options) { - const renderValidationDecorations = options.get(79 /* renderValidationDecorations */); - if (renderValidationDecorations === 'editable') { - return options.get(72 /* readOnly */); - } - return renderValidationDecorations === 'on' ? false : true; -} -class EditorRulers extends BaseEditorOption { - constructor() { - const defaults = []; - const columnSchema = { type: 'number', description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('rulers.size', "Number of monospace characters at which this editor ruler will render.") }; - super(83 /* rulers */, 'rulers', defaults, { - type: 'array', - items: { - anyOf: [ - columnSchema, - { - type: [ - 'object' - ], - properties: { - column: columnSchema, - color: { - type: 'string', - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('rulers.color', "Color of this editor ruler."), - format: 'color-hex' - } - } - } - ] - }, - default: defaults, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('rulers', "Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.") - }); - } - validate(input) { - if (Array.isArray(input)) { - let rulers = []; - for (let _element of input) { - if (typeof _element === 'number') { - rulers.push({ - column: EditorIntOption.clampedInt(_element, 0, 0, 10000), - color: null - }); - } - else if (_element && typeof _element === 'object') { - const element = _element; - rulers.push({ - column: EditorIntOption.clampedInt(element.column, 0, 0, 10000), - color: element.color - }); - } - } - rulers.sort((a, b) => a.column - b.column); - return rulers; - } - return this.defaultValue; - } -} -function _scrollbarVisibilityFromString(visibility, defaultValue) { - if (typeof visibility !== 'string') { - return defaultValue; - } - switch (visibility) { - case 'hidden': return 2 /* Hidden */; - case 'visible': return 3 /* Visible */; - default: return 1 /* Auto */; - } -} -class EditorScrollbar extends BaseEditorOption { - constructor() { - super(84 /* scrollbar */, 'scrollbar', { - vertical: 1 /* Auto */, - horizontal: 1 /* Auto */, - arrowSize: 11, - useShadows: true, - verticalHasArrows: false, - horizontalHasArrows: false, - horizontalScrollbarSize: 12, - horizontalSliderSize: 12, - verticalScrollbarSize: 14, - verticalSliderSize: 14, - handleMouseWheel: true, - alwaysConsumeMouseWheel: true - }); - } - validate(_input) { - if (!_input || typeof _input !== 'object') { - return this.defaultValue; - } - const input = _input; - const horizontalScrollbarSize = EditorIntOption.clampedInt(input.horizontalScrollbarSize, this.defaultValue.horizontalScrollbarSize, 0, 1000); - const verticalScrollbarSize = EditorIntOption.clampedInt(input.verticalScrollbarSize, this.defaultValue.verticalScrollbarSize, 0, 1000); - return { - arrowSize: EditorIntOption.clampedInt(input.arrowSize, this.defaultValue.arrowSize, 0, 1000), - vertical: _scrollbarVisibilityFromString(input.vertical, this.defaultValue.vertical), - horizontal: _scrollbarVisibilityFromString(input.horizontal, this.defaultValue.horizontal), - useShadows: EditorBooleanOption.boolean(input.useShadows, this.defaultValue.useShadows), - verticalHasArrows: EditorBooleanOption.boolean(input.verticalHasArrows, this.defaultValue.verticalHasArrows), - horizontalHasArrows: EditorBooleanOption.boolean(input.horizontalHasArrows, this.defaultValue.horizontalHasArrows), - handleMouseWheel: EditorBooleanOption.boolean(input.handleMouseWheel, this.defaultValue.handleMouseWheel), - alwaysConsumeMouseWheel: EditorBooleanOption.boolean(input.alwaysConsumeMouseWheel, this.defaultValue.alwaysConsumeMouseWheel), - horizontalScrollbarSize: horizontalScrollbarSize, - horizontalSliderSize: EditorIntOption.clampedInt(input.horizontalSliderSize, horizontalScrollbarSize, 0, 1000), - verticalScrollbarSize: verticalScrollbarSize, - verticalSliderSize: EditorIntOption.clampedInt(input.verticalSliderSize, verticalScrollbarSize, 0, 1000), - }; - } -} -class EditorSuggest extends BaseEditorOption { - constructor() { - const defaults = { - insertMode: 'insert', - filterGraceful: true, - snippetsPreventQuickSuggestions: true, - localityBonus: false, - shareSuggestSelections: false, - showIcons: true, - maxVisibleSuggestions: 12, - showMethods: true, - showFunctions: true, - showConstructors: true, - showFields: true, - showVariables: true, - showClasses: true, - showStructs: true, - showInterfaces: true, - showModules: true, - showProperties: true, - showEvents: true, - showOperators: true, - showUnits: true, - showValues: true, - showConstants: true, - showEnums: true, - showEnumMembers: true, - showKeywords: true, - showWords: true, - showColors: true, - showFiles: true, - showReferences: true, - showFolders: true, - showTypeParameters: true, - showSnippets: true, - showUsers: true, - showIssues: true, - statusBar: { - visible: false - } - }; - super(96 /* suggest */, 'suggest', defaults, { - 'editor.suggest.insertMode': { - type: 'string', - enum: ['insert', 'replace'], - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggest.insertMode.insert', "Insert suggestion without overwriting text right of the cursor."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggest.insertMode.replace', "Insert suggestion and overwrite text right of the cursor."), - ], - default: defaults.insertMode, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggest.insertMode', "Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.") - }, - 'editor.suggest.filterGraceful': { - type: 'boolean', - default: defaults.filterGraceful, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggest.filterGraceful', "Controls whether filtering and sorting suggestions accounts for small typos.") - }, - 'editor.suggest.localityBonus': { - type: 'boolean', - default: defaults.localityBonus, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggest.localityBonus', "Controls whether sorting favours words that appear close to the cursor.") - }, - 'editor.suggest.shareSuggestSelections': { - type: 'boolean', - default: defaults.shareSuggestSelections, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggest.shareSuggestSelections', "Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).") - }, - 'editor.suggest.snippetsPreventQuickSuggestions': { - type: 'boolean', - default: defaults.snippetsPreventQuickSuggestions, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggest.snippetsPreventQuickSuggestions', "Controls whether an active snippet prevents quick suggestions.") - }, - 'editor.suggest.showIcons': { - type: 'boolean', - default: defaults.showIcons, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggest.showIcons', "Controls whether to show or hide icons in suggestions.") - }, - 'editor.suggest.maxVisibleSuggestions': { - type: 'number', - default: defaults.maxVisibleSuggestions, - minimum: 1, - maximum: 15, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggest.maxVisibleSuggestions', "Controls how many suggestions IntelliSense will show before showing a scrollbar (maximum 15).") - }, - 'editor.suggest.filteredTypes': { - type: 'object', - deprecationMessage: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('deprecated', "This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.") - }, - 'editor.suggest.showMethods': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showMethods', "When enabled IntelliSense shows `method`-suggestions.") - }, - 'editor.suggest.showFunctions': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showFunctions', "When enabled IntelliSense shows `function`-suggestions.") - }, - 'editor.suggest.showConstructors': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showConstructors', "When enabled IntelliSense shows `constructor`-suggestions.") - }, - 'editor.suggest.showFields': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showFields', "When enabled IntelliSense shows `field`-suggestions.") - }, - 'editor.suggest.showVariables': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showVariables', "When enabled IntelliSense shows `variable`-suggestions.") - }, - 'editor.suggest.showClasses': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showClasss', "When enabled IntelliSense shows `class`-suggestions.") - }, - 'editor.suggest.showStructs': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showStructs', "When enabled IntelliSense shows `struct`-suggestions.") - }, - 'editor.suggest.showInterfaces': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showInterfaces', "When enabled IntelliSense shows `interface`-suggestions.") - }, - 'editor.suggest.showModules': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showModules', "When enabled IntelliSense shows `module`-suggestions.") - }, - 'editor.suggest.showProperties': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showPropertys', "When enabled IntelliSense shows `property`-suggestions.") - }, - 'editor.suggest.showEvents': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showEvents', "When enabled IntelliSense shows `event`-suggestions.") - }, - 'editor.suggest.showOperators': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showOperators', "When enabled IntelliSense shows `operator`-suggestions.") - }, - 'editor.suggest.showUnits': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showUnits', "When enabled IntelliSense shows `unit`-suggestions.") - }, - 'editor.suggest.showValues': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showValues', "When enabled IntelliSense shows `value`-suggestions.") - }, - 'editor.suggest.showConstants': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showConstants', "When enabled IntelliSense shows `constant`-suggestions.") - }, - 'editor.suggest.showEnums': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showEnums', "When enabled IntelliSense shows `enum`-suggestions.") - }, - 'editor.suggest.showEnumMembers': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showEnumMembers', "When enabled IntelliSense shows `enumMember`-suggestions.") - }, - 'editor.suggest.showKeywords': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showKeywords', "When enabled IntelliSense shows `keyword`-suggestions.") - }, - 'editor.suggest.showWords': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showTexts', "When enabled IntelliSense shows `text`-suggestions.") - }, - 'editor.suggest.showColors': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showColors', "When enabled IntelliSense shows `color`-suggestions.") - }, - 'editor.suggest.showFiles': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showFiles', "When enabled IntelliSense shows `file`-suggestions.") - }, - 'editor.suggest.showReferences': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showReferences', "When enabled IntelliSense shows `reference`-suggestions.") - }, - 'editor.suggest.showCustomcolors': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showCustomcolors', "When enabled IntelliSense shows `customcolor`-suggestions.") - }, - 'editor.suggest.showFolders': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showFolders', "When enabled IntelliSense shows `folder`-suggestions.") - }, - 'editor.suggest.showTypeParameters': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showTypeParameters', "When enabled IntelliSense shows `typeParameter`-suggestions.") - }, - 'editor.suggest.showSnippets': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showSnippets', "When enabled IntelliSense shows `snippet`-suggestions.") - }, - 'editor.suggest.showUsers': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showUsers', "When enabled IntelliSense shows `user`-suggestions.") - }, - 'editor.suggest.showIssues': { - type: 'boolean', - default: true, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.showIssues', "When enabled IntelliSense shows `issues`-suggestions.") - }, - 'editor.suggest.statusBar.visible': { - type: 'boolean', - default: false, - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.suggest.statusBar.visible', "Controls the visibility of the status bar at the bottom of the suggest widget.") - } - }); - } - validate(_input) { - var _a; - if (!_input || typeof _input !== 'object') { - return this.defaultValue; - } - const input = _input; - return { - insertMode: EditorStringEnumOption.stringSet(input.insertMode, this.defaultValue.insertMode, ['insert', 'replace']), - filterGraceful: EditorBooleanOption.boolean(input.filterGraceful, this.defaultValue.filterGraceful), - snippetsPreventQuickSuggestions: EditorBooleanOption.boolean(input.snippetsPreventQuickSuggestions, this.defaultValue.filterGraceful), - localityBonus: EditorBooleanOption.boolean(input.localityBonus, this.defaultValue.localityBonus), - shareSuggestSelections: EditorBooleanOption.boolean(input.shareSuggestSelections, this.defaultValue.shareSuggestSelections), - showIcons: EditorBooleanOption.boolean(input.showIcons, this.defaultValue.showIcons), - maxVisibleSuggestions: EditorIntOption.clampedInt(input.maxVisibleSuggestions, this.defaultValue.maxVisibleSuggestions, 1, 15), - showMethods: EditorBooleanOption.boolean(input.showMethods, this.defaultValue.showMethods), - showFunctions: EditorBooleanOption.boolean(input.showFunctions, this.defaultValue.showFunctions), - showConstructors: EditorBooleanOption.boolean(input.showConstructors, this.defaultValue.showConstructors), - showFields: EditorBooleanOption.boolean(input.showFields, this.defaultValue.showFields), - showVariables: EditorBooleanOption.boolean(input.showVariables, this.defaultValue.showVariables), - showClasses: EditorBooleanOption.boolean(input.showClasses, this.defaultValue.showClasses), - showStructs: EditorBooleanOption.boolean(input.showStructs, this.defaultValue.showStructs), - showInterfaces: EditorBooleanOption.boolean(input.showInterfaces, this.defaultValue.showInterfaces), - showModules: EditorBooleanOption.boolean(input.showModules, this.defaultValue.showModules), - showProperties: EditorBooleanOption.boolean(input.showProperties, this.defaultValue.showProperties), - showEvents: EditorBooleanOption.boolean(input.showEvents, this.defaultValue.showEvents), - showOperators: EditorBooleanOption.boolean(input.showOperators, this.defaultValue.showOperators), - showUnits: EditorBooleanOption.boolean(input.showUnits, this.defaultValue.showUnits), - showValues: EditorBooleanOption.boolean(input.showValues, this.defaultValue.showValues), - showConstants: EditorBooleanOption.boolean(input.showConstants, this.defaultValue.showConstants), - showEnums: EditorBooleanOption.boolean(input.showEnums, this.defaultValue.showEnums), - showEnumMembers: EditorBooleanOption.boolean(input.showEnumMembers, this.defaultValue.showEnumMembers), - showKeywords: EditorBooleanOption.boolean(input.showKeywords, this.defaultValue.showKeywords), - showWords: EditorBooleanOption.boolean(input.showWords, this.defaultValue.showWords), - showColors: EditorBooleanOption.boolean(input.showColors, this.defaultValue.showColors), - showFiles: EditorBooleanOption.boolean(input.showFiles, this.defaultValue.showFiles), - showReferences: EditorBooleanOption.boolean(input.showReferences, this.defaultValue.showReferences), - showFolders: EditorBooleanOption.boolean(input.showFolders, this.defaultValue.showFolders), - showTypeParameters: EditorBooleanOption.boolean(input.showTypeParameters, this.defaultValue.showTypeParameters), - showSnippets: EditorBooleanOption.boolean(input.showSnippets, this.defaultValue.showSnippets), - showUsers: EditorBooleanOption.boolean(input.showUsers, this.defaultValue.showUsers), - showIssues: EditorBooleanOption.boolean(input.showIssues, this.defaultValue.showIssues), - statusBar: { - visible: EditorBooleanOption.boolean((_a = input.statusBar) === null || _a === void 0 ? void 0 : _a.visible, !!this.defaultValue.statusBar.visible) - } - }; - } -} -//#endregion -//#region tabFocusMode -class EditorTabFocusMode extends ComputedEditorOption { - constructor() { - super(116 /* tabFocusMode */, [72 /* readOnly */]); - } - compute(env, options, _) { - const readOnly = options.get(72 /* readOnly */); - return (readOnly ? true : env.tabFocusMode); - } -} -function _wrappingIndentFromString(wrappingIndent) { - switch (wrappingIndent) { - case 'none': return 0 /* None */; - case 'same': return 1 /* Same */; - case 'indent': return 2 /* Indent */; - case 'deepIndent': return 3 /* DeepIndent */; - } -} -class EditorWrappingInfoComputer extends ComputedEditorOption { - constructor() { - super(118 /* wrappingInfo */, [117 /* layoutInfo */]); - } - compute(env, options, _) { - const layoutInfo = options.get(117 /* layoutInfo */); - return { - isDominatedByLongLines: env.isDominatedByLongLines, - isWordWrapMinified: layoutInfo.isWordWrapMinified, - isViewportWrapping: layoutInfo.isViewportWrapping, - wrappingColumn: layoutInfo.wrappingColumn, - }; - } -} -//#endregion -const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \'Courier New\', monospace'; -const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \'Courier New\', monospace'; -const DEFAULT_LINUX_FONT_FAMILY = '\'Droid Sans Mono\', \'monospace\', monospace, \'Droid Sans Fallback\''; -/** - * @internal - */ -const EDITOR_FONT_DEFAULTS = { - fontFamily: (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isMacintosh"] ? DEFAULT_MAC_FONT_FAMILY : (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isLinux"] ? DEFAULT_LINUX_FONT_FAMILY : DEFAULT_WINDOWS_FONT_FAMILY)), - fontWeight: 'normal', - fontSize: (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isMacintosh"] ? 12 : 14), - lineHeight: 0, - letterSpacing: 0, -}; -/** - * @internal - */ -const EDITOR_MODEL_DEFAULTS = { - tabSize: 4, - indentSize: 4, - insertSpaces: true, - detectIndentation: true, - trimAutoWhitespace: true, - largeFileOptimizations: true -}; -/** - * @internal - */ -const editorOptionsRegistry = []; -function register(option) { - editorOptionsRegistry[option.id] = option; - return option; -} -/** - * WORKAROUND: TS emits "any" for complex editor options values (anything except string, bool, enum, etc. ends up being "any") - * @monacodtsreplace - * /accessibilitySupport, any/accessibilitySupport, AccessibilitySupport/ - * /comments, any/comments, EditorCommentsOptions/ - * /find, any/find, EditorFindOptions/ - * /fontInfo, any/fontInfo, FontInfo/ - * /gotoLocation, any/gotoLocation, GoToLocationOptions/ - * /hover, any/hover, EditorHoverOptions/ - * /lightbulb, any/lightbulb, EditorLightbulbOptions/ - * /minimap, any/minimap, EditorMinimapOptions/ - * /parameterHints, any/parameterHints, InternalParameterHintOptions/ - * /quickSuggestions, any/quickSuggestions, ValidQuickSuggestionsOptions/ - * /suggest, any/suggest, InternalSuggestOptions/ - */ -const EditorOptions = { - acceptSuggestionOnCommitCharacter: register(new EditorBooleanOption(0 /* acceptSuggestionOnCommitCharacter */, 'acceptSuggestionOnCommitCharacter', true, { markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('acceptSuggestionOnCommitCharacter', "Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.") })), - acceptSuggestionOnEnter: register(new EditorStringEnumOption(1 /* acceptSuggestionOnEnter */, 'acceptSuggestionOnEnter', 'on', ['on', 'smart', 'off'], { - markdownEnumDescriptions: [ - '', - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('acceptSuggestionOnEnterSmart', "Only accept a suggestion with `Enter` when it makes a textual change."), - '' - ], - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('acceptSuggestionOnEnter', "Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.") - })), - accessibilitySupport: register(new EditorAccessibilitySupport()), - accessibilityPageSize: register(new EditorIntOption(3 /* accessibilityPageSize */, 'accessibilityPageSize', 10, 1, 1073741824 /* MAX_SAFE_SMALL_INTEGER */, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('accessibilityPageSize', "Controls the number of lines in the editor that can be read out by a screen reader. Warning: this has a performance implication for numbers larger than the default.") })), - ariaLabel: register(new EditorStringOption(4 /* ariaLabel */, 'ariaLabel', _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorViewAccessibleLabel', "Editor content"))), - autoClosingBrackets: register(new EditorStringEnumOption(5 /* autoClosingBrackets */, 'autoClosingBrackets', 'languageDefined', ['always', 'languageDefined', 'beforeWhitespace', 'never'], { - enumDescriptions: [ - '', - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoClosingBrackets.languageDefined', "Use language configurations to determine when to autoclose brackets."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoClosingBrackets.beforeWhitespace', "Autoclose brackets only when the cursor is to the left of whitespace."), - '', - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('autoClosingBrackets', "Controls whether the editor should automatically close brackets after the user adds an opening bracket.") - })), - autoClosingOvertype: register(new EditorStringEnumOption(6 /* autoClosingOvertype */, 'autoClosingOvertype', 'auto', ['always', 'auto', 'never'], { - enumDescriptions: [ - '', - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoClosingOvertype.auto', "Type over closing quotes or brackets only if they were automatically inserted."), - '', - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('autoClosingOvertype', "Controls whether the editor should type over closing quotes or brackets.") - })), - autoClosingQuotes: register(new EditorStringEnumOption(7 /* autoClosingQuotes */, 'autoClosingQuotes', 'languageDefined', ['always', 'languageDefined', 'beforeWhitespace', 'never'], { - enumDescriptions: [ - '', - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoClosingQuotes.languageDefined', "Use language configurations to determine when to autoclose quotes."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoClosingQuotes.beforeWhitespace', "Autoclose quotes only when the cursor is to the left of whitespace."), - '', - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('autoClosingQuotes', "Controls whether the editor should automatically close quotes after the user adds an opening quote.") - })), - autoIndent: register(new EditorEnumOption(8 /* autoIndent */, 'autoIndent', 4 /* Full */, 'full', ['none', 'keep', 'brackets', 'advanced', 'full'], _autoIndentFromString, { - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoIndent.none', "The editor will not insert indentation automatically."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoIndent.keep', "The editor will keep the current line's indentation."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoIndent.brackets', "The editor will keep the current line's indentation and honor language defined brackets."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoIndent.advanced', "The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoIndent.full', "The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages."), - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('autoIndent', "Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.") - })), - automaticLayout: register(new EditorBooleanOption(9 /* automaticLayout */, 'automaticLayout', false)), - autoSurround: register(new EditorStringEnumOption(10 /* autoSurround */, 'autoSurround', 'languageDefined', ['languageDefined', 'quotes', 'brackets', 'never'], { - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoSurround.languageDefined', "Use language configurations to determine when to automatically surround selections."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoSurround.quotes', "Surround with quotes but not brackets."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.autoSurround.brackets', "Surround with brackets but not quotes."), - '' - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('autoSurround', "Controls whether the editor should automatically surround selections.") - })), - codeLens: register(new EditorBooleanOption(11 /* codeLens */, 'codeLens', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('codeLens', "Controls whether the editor shows CodeLens.") })), - colorDecorators: register(new EditorBooleanOption(12 /* colorDecorators */, 'colorDecorators', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('colorDecorators', "Controls whether the editor should render the inline color decorators and color picker.") })), - columnSelection: register(new EditorBooleanOption(13 /* columnSelection */, 'columnSelection', false, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('columnSelection', "Enable that the selection with the mouse and keys is doing column selection.") })), - comments: register(new EditorComments()), - contextmenu: register(new EditorBooleanOption(15 /* contextmenu */, 'contextmenu', true)), - copyWithSyntaxHighlighting: register(new EditorBooleanOption(16 /* copyWithSyntaxHighlighting */, 'copyWithSyntaxHighlighting', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('copyWithSyntaxHighlighting', "Controls whether syntax highlighting should be copied into the clipboard.") })), - cursorBlinking: register(new EditorEnumOption(17 /* cursorBlinking */, 'cursorBlinking', 1 /* Blink */, 'blink', ['blink', 'smooth', 'phase', 'expand', 'solid'], _cursorBlinkingStyleFromString, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('cursorBlinking', "Control the cursor animation style.") })), - cursorSmoothCaretAnimation: register(new EditorBooleanOption(18 /* cursorSmoothCaretAnimation */, 'cursorSmoothCaretAnimation', false, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('cursorSmoothCaretAnimation', "Controls whether the smooth caret animation should be enabled.") })), - cursorStyle: register(new EditorEnumOption(19 /* cursorStyle */, 'cursorStyle', TextEditorCursorStyle.Line, 'line', ['line', 'block', 'underline', 'line-thin', 'block-outline', 'underline-thin'], _cursorStyleFromString, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('cursorStyle', "Controls the cursor style.") })), - cursorSurroundingLines: register(new EditorIntOption(20 /* cursorSurroundingLines */, 'cursorSurroundingLines', 0, 0, 1073741824 /* MAX_SAFE_SMALL_INTEGER */, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('cursorSurroundingLines', "Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or `scrollOffset` in some other editors.") })), - cursorSurroundingLinesStyle: register(new EditorStringEnumOption(21 /* cursorSurroundingLinesStyle */, 'cursorSurroundingLinesStyle', 'default', ['default', 'all'], { - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('cursorSurroundingLinesStyle.default', "`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('cursorSurroundingLinesStyle.all', "`cursorSurroundingLines` is enforced always.") - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('cursorSurroundingLinesStyle', "Controls when `cursorSurroundingLines` should be enforced.") - })), - cursorWidth: register(new EditorIntOption(22 /* cursorWidth */, 'cursorWidth', 0, 0, 1073741824 /* MAX_SAFE_SMALL_INTEGER */, { markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('cursorWidth', "Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.") })), - disableLayerHinting: register(new EditorBooleanOption(23 /* disableLayerHinting */, 'disableLayerHinting', false)), - disableMonospaceOptimizations: register(new EditorBooleanOption(24 /* disableMonospaceOptimizations */, 'disableMonospaceOptimizations', false)), - dragAndDrop: register(new EditorBooleanOption(25 /* dragAndDrop */, 'dragAndDrop', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('dragAndDrop', "Controls whether the editor should allow moving selections via drag and drop.") })), - emptySelectionClipboard: register(new EditorEmptySelectionClipboard()), - extraEditorClassName: register(new EditorStringOption(27 /* extraEditorClassName */, 'extraEditorClassName', '')), - fastScrollSensitivity: register(new EditorFloatOption(28 /* fastScrollSensitivity */, 'fastScrollSensitivity', 5, x => (x <= 0 ? 5 : x), { markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('fastScrollSensitivity', "Scrolling speed multiplier when pressing `Alt`.") })), - find: register(new EditorFind()), - fixedOverflowWidgets: register(new EditorBooleanOption(30 /* fixedOverflowWidgets */, 'fixedOverflowWidgets', false)), - folding: register(new EditorBooleanOption(31 /* folding */, 'folding', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('folding', "Controls whether the editor has code folding enabled.") })), - foldingStrategy: register(new EditorStringEnumOption(32 /* foldingStrategy */, 'foldingStrategy', 'auto', ['auto', 'indentation'], { - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('foldingStrategy.auto', "Use a language-specific folding strategy if available, else the indentation-based one."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('foldingStrategy.indentation', "Use the indentation-based folding strategy."), - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('foldingStrategy', "Controls the strategy for computing folding ranges.") - })), - foldingHighlight: register(new EditorBooleanOption(33 /* foldingHighlight */, 'foldingHighlight', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('foldingHighlight', "Controls whether the editor should highlight folded ranges.") })), - unfoldOnClickAfterEndOfLine: register(new EditorBooleanOption(34 /* unfoldOnClickAfterEndOfLine */, 'unfoldOnClickAfterEndOfLine', false, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('unfoldOnClickAfterEndOfLine', "Controls whether clicking on the empty content after a folded line will unfold the line.") })), - fontFamily: register(new EditorStringOption(35 /* fontFamily */, 'fontFamily', EDITOR_FONT_DEFAULTS.fontFamily, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('fontFamily', "Controls the font family.") })), - fontInfo: register(new EditorFontInfo()), - fontLigatures2: register(new EditorFontLigatures()), - fontSize: register(new EditorFontSize()), - fontWeight: register(new EditorFontWeight()), - formatOnPaste: register(new EditorBooleanOption(40 /* formatOnPaste */, 'formatOnPaste', false, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('formatOnPaste', "Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.") })), - formatOnType: register(new EditorBooleanOption(41 /* formatOnType */, 'formatOnType', false, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('formatOnType', "Controls whether the editor should automatically format the line after typing.") })), - glyphMargin: register(new EditorBooleanOption(42 /* glyphMargin */, 'glyphMargin', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('glyphMargin', "Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.") })), - gotoLocation: register(new EditorGoToLocation()), - hideCursorInOverviewRuler: register(new EditorBooleanOption(44 /* hideCursorInOverviewRuler */, 'hideCursorInOverviewRuler', false, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('hideCursorInOverviewRuler', "Controls whether the cursor should be hidden in the overview ruler.") })), - highlightActiveIndentGuide: register(new EditorBooleanOption(45 /* highlightActiveIndentGuide */, 'highlightActiveIndentGuide', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('highlightActiveIndentGuide', "Controls whether the editor should highlight the active indent guide.") })), - hover: register(new EditorHover()), - inDiffEditor: register(new EditorBooleanOption(47 /* inDiffEditor */, 'inDiffEditor', false)), - letterSpacing: register(new EditorFloatOption(48 /* letterSpacing */, 'letterSpacing', EDITOR_FONT_DEFAULTS.letterSpacing, x => EditorFloatOption.clamp(x, -5, 20), { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('letterSpacing', "Controls the letter spacing in pixels.") })), - lightbulb: register(new EditorLightbulb()), - lineDecorationsWidth: register(new SimpleEditorOption(50 /* lineDecorationsWidth */, 'lineDecorationsWidth', 10)), - lineHeight: register(new EditorLineHeight()), - lineNumbers: register(new EditorRenderLineNumbersOption()), - lineNumbersMinChars: register(new EditorIntOption(53 /* lineNumbersMinChars */, 'lineNumbersMinChars', 5, 1, 300)), - links: register(new EditorBooleanOption(54 /* links */, 'links', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('links', "Controls whether the editor should detect links and make them clickable.") })), - matchBrackets: register(new EditorStringEnumOption(55 /* matchBrackets */, 'matchBrackets', 'always', ['always', 'near', 'never'], { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('matchBrackets', "Highlight matching brackets.") })), - minimap: register(new EditorMinimap()), - mouseStyle: register(new EditorStringEnumOption(57 /* mouseStyle */, 'mouseStyle', 'text', ['text', 'default', 'copy'])), - mouseWheelScrollSensitivity: register(new EditorFloatOption(58 /* mouseWheelScrollSensitivity */, 'mouseWheelScrollSensitivity', 1, x => (x === 0 ? 1 : x), { markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('mouseWheelScrollSensitivity', "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.") })), - mouseWheelZoom: register(new EditorBooleanOption(59 /* mouseWheelZoom */, 'mouseWheelZoom', false, { markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('mouseWheelZoom', "Zoom the font of the editor when using mouse wheel and holding `Ctrl`.") })), - multiCursorMergeOverlapping: register(new EditorBooleanOption(60 /* multiCursorMergeOverlapping */, 'multiCursorMergeOverlapping', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('multiCursorMergeOverlapping', "Merge multiple cursors when they are overlapping.") })), - multiCursorModifier: register(new EditorEnumOption(61 /* multiCursorModifier */, 'multiCursorModifier', 'altKey', 'alt', ['ctrlCmd', 'alt'], _multiCursorModifierFromString, { - markdownEnumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('multiCursorModifier.ctrlCmd', "Maps to `Control` on Windows and Linux and to `Command` on macOS."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('multiCursorModifier.alt', "Maps to `Alt` on Windows and Linux and to `Option` on macOS.") - ], - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ - key: 'multiCursorModifier', - comment: [ - '- `ctrlCmd` refers to a value the setting can take and should not be localized.', - '- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized.' - ] - }, "The modifier to be used to add multiple cursors with the mouse. The Go To Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).") - })), - multiCursorPaste: register(new EditorStringEnumOption(62 /* multiCursorPaste */, 'multiCursorPaste', 'spread', ['spread', 'full'], { - markdownEnumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('multiCursorPaste.spread', "Each cursor pastes a single line of the text."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('multiCursorPaste.full', "Each cursor pastes the full text.") - ], - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('multiCursorPaste', "Controls pasting when the line count of the pasted text matches the cursor count.") - })), - occurrencesHighlight: register(new EditorBooleanOption(63 /* occurrencesHighlight */, 'occurrencesHighlight', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('occurrencesHighlight', "Controls whether the editor should highlight semantic symbol occurrences.") })), - overviewRulerBorder: register(new EditorBooleanOption(64 /* overviewRulerBorder */, 'overviewRulerBorder', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('overviewRulerBorder', "Controls whether a border should be drawn around the overview ruler.") })), - overviewRulerLanes: register(new EditorIntOption(65 /* overviewRulerLanes */, 'overviewRulerLanes', 3, 0, 3)), - padding: register(new EditorPadding()), - parameterHints: register(new EditorParameterHints()), - peekWidgetDefaultFocus: register(new EditorStringEnumOption(68 /* peekWidgetDefaultFocus */, 'peekWidgetDefaultFocus', 'tree', ['tree', 'editor'], { - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('peekWidgetDefaultFocus.tree', "Focus the tree when opening peek"), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('peekWidgetDefaultFocus.editor', "Focus the editor when opening peek") - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('peekWidgetDefaultFocus', "Controls whether to focus the inline editor or the tree in the peek widget.") - })), - definitionLinkOpensInPeek: register(new EditorBooleanOption(69 /* definitionLinkOpensInPeek */, 'definitionLinkOpensInPeek', false, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('definitionLinkOpensInPeek', "Controls whether the Go to Definition mouse gesture always opens the peek widget.") })), - quickSuggestions: register(new EditorQuickSuggestions()), - quickSuggestionsDelay: register(new EditorIntOption(71 /* quickSuggestionsDelay */, 'quickSuggestionsDelay', 10, 0, 1073741824 /* MAX_SAFE_SMALL_INTEGER */, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('quickSuggestionsDelay', "Controls the delay in milliseconds after which quick suggestions will show up.") })), - readOnly: register(new EditorBooleanOption(72 /* readOnly */, 'readOnly', false)), - renameOnType: register(new EditorBooleanOption(73 /* renameOnType */, 'renameOnType', false, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('renameOnType', "Controls whether the editor auto renames on type.") })), - renderControlCharacters: register(new EditorBooleanOption(74 /* renderControlCharacters */, 'renderControlCharacters', false, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('renderControlCharacters', "Controls whether the editor should render control characters.") })), - renderIndentGuides: register(new EditorBooleanOption(75 /* renderIndentGuides */, 'renderIndentGuides', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('renderIndentGuides', "Controls whether the editor should render indent guides.") })), - renderFinalNewline: register(new EditorBooleanOption(76 /* renderFinalNewline */, 'renderFinalNewline', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('renderFinalNewline', "Render last line number when the file ends with a newline.") })), - renderLineHighlight: register(new EditorStringEnumOption(77 /* renderLineHighlight */, 'renderLineHighlight', 'line', ['none', 'gutter', 'line', 'all'], { - enumDescriptions: [ - '', - '', - '', - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('renderLineHighlight.all', "Highlights both the gutter and the current line."), - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('renderLineHighlight', "Controls how the editor should render the current line highlight.") - })), - renderLineHighlightOnlyWhenFocus: register(new EditorBooleanOption(78 /* renderLineHighlightOnlyWhenFocus */, 'renderLineHighlightOnlyWhenFocus', false, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('renderLineHighlightOnlyWhenFocus', "Controls if the editor should render the current line highlight only when the editor is focused") })), - renderValidationDecorations: register(new EditorStringEnumOption(79 /* renderValidationDecorations */, 'renderValidationDecorations', 'editable', ['editable', 'on', 'off'])), - renderWhitespace: register(new EditorStringEnumOption(80 /* renderWhitespace */, 'renderWhitespace', 'selection', ['none', 'boundary', 'selection', 'trailing', 'all'], { - enumDescriptions: [ - '', - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('renderWhitespace.boundary', "Render whitespace characters except for single spaces between words."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('renderWhitespace.selection', "Render whitespace characters only on selected text."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('renderWhitespace.trailing', "Render only trailing whitespace characters"), - '' - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('renderWhitespace', "Controls how the editor should render whitespace characters.") - })), - revealHorizontalRightPadding: register(new EditorIntOption(81 /* revealHorizontalRightPadding */, 'revealHorizontalRightPadding', 30, 0, 1000)), - roundedSelection: register(new EditorBooleanOption(82 /* roundedSelection */, 'roundedSelection', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('roundedSelection', "Controls whether selections should have rounded corners.") })), - rulers: register(new EditorRulers()), - scrollbar: register(new EditorScrollbar()), - scrollBeyondLastColumn: register(new EditorIntOption(85 /* scrollBeyondLastColumn */, 'scrollBeyondLastColumn', 5, 0, 1073741824 /* MAX_SAFE_SMALL_INTEGER */, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('scrollBeyondLastColumn', "Controls the number of extra characters beyond which the editor will scroll horizontally.") })), - scrollBeyondLastLine: register(new EditorBooleanOption(86 /* scrollBeyondLastLine */, 'scrollBeyondLastLine', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('scrollBeyondLastLine', "Controls whether the editor will scroll beyond the last line.") })), - scrollPredominantAxis: register(new EditorBooleanOption(87 /* scrollPredominantAxis */, 'scrollPredominantAxis', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('scrollPredominantAxis', "Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.") })), - selectionClipboard: register(new EditorBooleanOption(88 /* selectionClipboard */, 'selectionClipboard', true, { - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('selectionClipboard', "Controls whether the Linux primary clipboard should be supported."), - included: _base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isLinux"] - })), - selectionHighlight: register(new EditorBooleanOption(89 /* selectionHighlight */, 'selectionHighlight', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('selectionHighlight', "Controls whether the editor should highlight matches similar to the selection.") })), - selectOnLineNumbers: register(new EditorBooleanOption(90 /* selectOnLineNumbers */, 'selectOnLineNumbers', true)), - showFoldingControls: register(new EditorStringEnumOption(91 /* showFoldingControls */, 'showFoldingControls', 'mouseover', ['always', 'mouseover'], { - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('showFoldingControls.always', "Always show the folding controls."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('showFoldingControls.mouseover', "Only show the folding controls when the mouse is over the gutter."), - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('showFoldingControls', "Controls when the folding controls on the gutter are shown.") - })), - showUnused: register(new EditorBooleanOption(92 /* showUnused */, 'showUnused', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('showUnused', "Controls fading out of unused code.") })), - showDeprecated: register(new EditorBooleanOption(113 /* showDeprecated */, 'showDeprecated', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('showDeprecated', "Controls strikethrough deprecated variables.") })), - snippetSuggestions: register(new EditorStringEnumOption(93 /* snippetSuggestions */, 'snippetSuggestions', 'inline', ['top', 'bottom', 'inline', 'none'], { - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('snippetSuggestions.top', "Show snippet suggestions on top of other suggestions."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('snippetSuggestions.bottom', "Show snippet suggestions below other suggestions."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('snippetSuggestions.inline', "Show snippets suggestions with other suggestions."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('snippetSuggestions.none', "Do not show snippet suggestions."), - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('snippetSuggestions', "Controls whether snippets are shown with other suggestions and how they are sorted.") - })), - smoothScrolling: register(new EditorBooleanOption(94 /* smoothScrolling */, 'smoothScrolling', false, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('smoothScrolling', "Controls whether the editor will scroll using an animation.") })), - stopRenderingLineAfter: register(new EditorIntOption(95 /* stopRenderingLineAfter */, 'stopRenderingLineAfter', 10000, -1, 1073741824 /* MAX_SAFE_SMALL_INTEGER */)), - suggest: register(new EditorSuggest()), - suggestFontSize: register(new EditorIntOption(97 /* suggestFontSize */, 'suggestFontSize', 0, 0, 1000, { markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggestFontSize', "Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.") })), - suggestLineHeight: register(new EditorIntOption(98 /* suggestLineHeight */, 'suggestLineHeight', 0, 0, 1000, { markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggestLineHeight', "Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used.") })), - suggestOnTriggerCharacters: register(new EditorBooleanOption(99 /* suggestOnTriggerCharacters */, 'suggestOnTriggerCharacters', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggestOnTriggerCharacters', "Controls whether suggestions should automatically show up when typing trigger characters.") })), - suggestSelection: register(new EditorStringEnumOption(100 /* suggestSelection */, 'suggestSelection', 'recentlyUsed', ['first', 'recentlyUsed', 'recentlyUsedByPrefix'], { - markdownEnumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggestSelection.first', "Always select the first suggestion."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggestSelection.recentlyUsed', "Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggestSelection.recentlyUsedByPrefix', "Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`."), - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('suggestSelection', "Controls how suggestions are pre-selected when showing the suggest list.") - })), - tabCompletion: register(new EditorStringEnumOption(101 /* tabCompletion */, 'tabCompletion', 'off', ['on', 'off', 'onlySnippets'], { - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('tabCompletion.on', "Tab complete will insert the best matching suggestion when pressing tab."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('tabCompletion.off', "Disable tab completions."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('tabCompletion.onlySnippets', "Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled."), - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('tabCompletion', "Enables tab completions.") - })), - tabIndex: register(new EditorIntOption(102 /* tabIndex */, 'tabIndex', 0, -1, 1073741824 /* MAX_SAFE_SMALL_INTEGER */)), - unusualLineTerminators: register(new EditorStringEnumOption(103 /* unusualLineTerminators */, 'unusualLineTerminators', 'prompt', ['off', 'prompt', 'auto'], { - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('unusualLineTerminators.off', "Unusual line terminators are ignored."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('unusualLineTerminators.prompt', "Unusual line terminators prompt to be removed."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('unusualLineTerminators.auto', "Unusual line terminators are automatically removed."), - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('unusualLineTerminators', "Remove unusual line terminators that might cause problems.") - })), - useTabStops: register(new EditorBooleanOption(104 /* useTabStops */, 'useTabStops', true, { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('useTabStops', "Inserting and deleting whitespace follows tab stops.") })), - wordSeparators: register(new EditorStringOption(105 /* wordSeparators */, 'wordSeparators', _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_2__["USUAL_WORD_SEPARATORS"], { description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wordSeparators', "Characters that will be used as word separators when doing word related navigations or operations.") })), - wordWrap: register(new EditorStringEnumOption(106 /* wordWrap */, 'wordWrap', 'off', ['off', 'on', 'wordWrapColumn', 'bounded'], { - markdownEnumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wordWrap.off', "Lines will never wrap."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wordWrap.on', "Lines will wrap at the viewport width."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ - key: 'wordWrap.wordWrapColumn', - comment: [ - '- `editor.wordWrapColumn` refers to a different setting and should not be localized.' - ] - }, "Lines will wrap at `#editor.wordWrapColumn#`."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ - key: 'wordWrap.bounded', - comment: [ - '- viewport means the edge of the visible window size.', - '- `editor.wordWrapColumn` refers to a different setting and should not be localized.' - ] - }, "Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`."), - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ - key: 'wordWrap', - comment: [ - '- \'off\', \'on\', \'wordWrapColumn\' and \'bounded\' refer to values the setting can take and should not be localized.', - '- `editor.wordWrapColumn` refers to a different setting and should not be localized.' - ] - }, "Controls how lines should wrap.") - })), - wordWrapBreakAfterCharacters: register(new EditorStringOption(107 /* wordWrapBreakAfterCharacters */, 'wordWrapBreakAfterCharacters', ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」')), - wordWrapBreakBeforeCharacters: register(new EditorStringOption(108 /* wordWrapBreakBeforeCharacters */, 'wordWrapBreakBeforeCharacters', '([{‘“〈《「『【〔([{「£¥$£¥++')), - wordWrapColumn: register(new EditorIntOption(109 /* wordWrapColumn */, 'wordWrapColumn', 80, 1, 1073741824 /* MAX_SAFE_SMALL_INTEGER */, { - markdownDescription: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ - key: 'wordWrapColumn', - comment: [ - '- `editor.wordWrap` refers to a different setting and should not be localized.', - '- \'wordWrapColumn\' and \'bounded\' refer to values the different setting can take and should not be localized.' - ] - }, "Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.") - })), - wordWrapMinified: register(new EditorBooleanOption(110 /* wordWrapMinified */, 'wordWrapMinified', true)), - wrappingIndent: register(new EditorEnumOption(111 /* wrappingIndent */, 'wrappingIndent', 1 /* Same */, 'same', ['none', 'same', 'indent', 'deepIndent'], _wrappingIndentFromString, { - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wrappingIndent.none', "No indentation. Wrapped lines begin at column 1."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wrappingIndent.same', "Wrapped lines get the same indentation as the parent."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wrappingIndent.indent', "Wrapped lines get +1 indentation toward the parent."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wrappingIndent.deepIndent', "Wrapped lines get +2 indentation toward the parent."), - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wrappingIndent', "Controls the indentation of wrapped lines."), - })), - wrappingStrategy: register(new EditorStringEnumOption(112 /* wrappingStrategy */, 'wrappingStrategy', 'simple', ['simple', 'advanced'], { - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wrappingStrategy.simple', "Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wrappingStrategy.advanced', "Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.") - ], - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wrappingStrategy', "Controls the algorithm that computes wrapping points.") - })), - // Leave these at the end (because they have dependencies!) - editorClassName: register(new EditorClassName()), - pixelRatio: register(new EditorPixelRatio()), - tabFocusMode: register(new EditorTabFocusMode()), - layoutInfo: register(new EditorLayoutInfoComputer()), - wrappingInfo: register(new EditorWrappingInfoComputer()) -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorZoom.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/config/editorZoom.js ***! - \******************************************************************************/ -/*! exports provided: EditorZoom */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorZoom", function() { return EditorZoom; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const EditorZoom = new class { - constructor() { - this._zoomLevel = 0; - this._onDidChangeZoomLevel = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this.onDidChangeZoomLevel = this._onDidChangeZoomLevel.event; - } - getZoomLevel() { - return this._zoomLevel; - } - setZoomLevel(zoomLevel) { - zoomLevel = Math.min(Math.max(-5, zoomLevel), 20); - if (this._zoomLevel === zoomLevel) { - return; - } - this._zoomLevel = zoomLevel; - this._onDidChangeZoomLevel.fire(this._zoomLevel); - } -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/config/fontInfo.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/config/fontInfo.js ***! - \****************************************************************************/ -/*! exports provided: BareFontInfo, FontInfo */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BareFontInfo", function() { return BareFontInfo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontInfo", function() { return FontInfo; }); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _editorZoom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./editorZoom.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorZoom.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -/** - * Determined from empirical observations. - * @internal - */ -const GOLDEN_LINE_HEIGHT_RATIO = _base_common_platform_js__WEBPACK_IMPORTED_MODULE_0__["isMacintosh"] ? 1.5 : 1.35; -/** - * @internal - */ -const MINIMUM_LINE_HEIGHT = 8; -class BareFontInfo { - /** - * @internal - */ - constructor(opts) { - this.zoomLevel = opts.zoomLevel; - this.fontFamily = String(opts.fontFamily); - this.fontWeight = String(opts.fontWeight); - this.fontSize = opts.fontSize; - this.fontFeatureSettings = opts.fontFeatureSettings; - this.lineHeight = opts.lineHeight | 0; - this.letterSpacing = opts.letterSpacing; - } - /** - * @internal - */ - static createFromValidatedSettings(options, zoomLevel, ignoreEditorZoom) { - const fontFamily = options.get(35 /* fontFamily */); - const fontWeight = options.get(39 /* fontWeight */); - const fontSize = options.get(38 /* fontSize */); - const fontFeatureSettings = options.get(37 /* fontLigatures */); - const lineHeight = options.get(51 /* lineHeight */); - const letterSpacing = options.get(48 /* letterSpacing */); - return BareFontInfo._create(fontFamily, fontWeight, fontSize, fontFeatureSettings, lineHeight, letterSpacing, zoomLevel, ignoreEditorZoom); - } - /** - * @internal - */ - static _create(fontFamily, fontWeight, fontSize, fontFeatureSettings, lineHeight, letterSpacing, zoomLevel, ignoreEditorZoom) { - if (lineHeight === 0) { - lineHeight = Math.round(GOLDEN_LINE_HEIGHT_RATIO * fontSize); - } - else if (lineHeight < MINIMUM_LINE_HEIGHT) { - lineHeight = MINIMUM_LINE_HEIGHT; - } - const editorZoomLevelMultiplier = 1 + (ignoreEditorZoom ? 0 : _editorZoom_js__WEBPACK_IMPORTED_MODULE_1__["EditorZoom"].getZoomLevel() * 0.1); - fontSize *= editorZoomLevelMultiplier; - lineHeight *= editorZoomLevelMultiplier; - return new BareFontInfo({ - zoomLevel: zoomLevel, - fontFamily: fontFamily, - fontWeight: fontWeight, - fontSize: fontSize, - fontFeatureSettings: fontFeatureSettings, - lineHeight: lineHeight, - letterSpacing: letterSpacing - }); - } - /** - * @internal - */ - getId() { - return this.zoomLevel + '-' + this.fontFamily + '-' + this.fontWeight + '-' + this.fontSize + '-' + this.fontFeatureSettings + '-' + this.lineHeight + '-' + this.letterSpacing; - } - /** - * @internal - */ - getMassagedFontFamily() { - if (/[,"']/.test(this.fontFamily)) { - // Looks like the font family might be already escaped - return this.fontFamily; - } - if (/[+ ]/.test(this.fontFamily)) { - // Wrap a font family using + or with quotes - return `"${this.fontFamily}"`; - } - return this.fontFamily; - } -} -class FontInfo extends BareFontInfo { - /** - * @internal - */ - constructor(opts, isTrusted) { - super(opts); - this.isTrusted = isTrusted; - this.isMonospace = opts.isMonospace; - this.typicalHalfwidthCharacterWidth = opts.typicalHalfwidthCharacterWidth; - this.typicalFullwidthCharacterWidth = opts.typicalFullwidthCharacterWidth; - this.canUseHalfwidthRightwardsArrow = opts.canUseHalfwidthRightwardsArrow; - this.spaceWidth = opts.spaceWidth; - this.middotWidth = opts.middotWidth; - this.wsmiddotWidth = opts.wsmiddotWidth; - this.maxDigitWidth = opts.maxDigitWidth; - } - /** - * @internal - */ - equals(other) { - return (this.fontFamily === other.fontFamily - && this.fontWeight === other.fontWeight - && this.fontSize === other.fontSize - && this.fontFeatureSettings === other.fontFeatureSettings - && this.lineHeight === other.lineHeight - && this.letterSpacing === other.letterSpacing - && this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth - && this.typicalFullwidthCharacterWidth === other.typicalFullwidthCharacterWidth - && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow - && this.spaceWidth === other.spaceWidth - && this.middotWidth === other.middotWidth - && this.wsmiddotWidth === other.wsmiddotWidth - && this.maxDigitWidth === other.maxDigitWidth); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursor.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/controller/cursor.js ***! - \******************************************************************************/ -/*! exports provided: CursorModelState, Cursor */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorModelState", function() { return CursorModelState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cursor", function() { return Cursor; }); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _cursorCollection_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cursorCollection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCollection.js"); -/* harmony import */ var _cursorCommon_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _cursorDeleteOperations_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cursorDeleteOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorDeleteOperations.js"); -/* harmony import */ var _cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cursorTypeOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorTypeOperations.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../view/viewEvents.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/viewEvents.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _viewModel_viewModelEventDispatcher_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../viewModel/viewModelEventDispatcher.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelEventDispatcher.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - -/** - * A snapshot of the cursor and the model state - */ -class CursorModelState { - constructor(model, cursor) { - this.modelVersionId = model.getVersionId(); - this.cursorState = cursor.getCursorStates(); - } - equals(other) { - if (!other) { - return false; - } - if (this.modelVersionId !== other.modelVersionId) { - return false; - } - if (this.cursorState.length !== other.cursorState.length) { - return false; - } - for (let i = 0, len = this.cursorState.length; i < len; i++) { - if (!this.cursorState[i].equals(other.cursorState[i])) { - return false; - } - } - return true; - } -} -class AutoClosedAction { - constructor(model, autoClosedCharactersDecorations, autoClosedEnclosingDecorations) { - this._model = model; - this._autoClosedCharactersDecorations = autoClosedCharactersDecorations; - this._autoClosedEnclosingDecorations = autoClosedEnclosingDecorations; - } - static getAllAutoClosedCharacters(autoClosedActions) { - let autoClosedCharacters = []; - for (const autoClosedAction of autoClosedActions) { - autoClosedCharacters = autoClosedCharacters.concat(autoClosedAction.getAutoClosedCharactersRanges()); - } - return autoClosedCharacters; - } - dispose() { - this._autoClosedCharactersDecorations = this._model.deltaDecorations(this._autoClosedCharactersDecorations, []); - this._autoClosedEnclosingDecorations = this._model.deltaDecorations(this._autoClosedEnclosingDecorations, []); - } - getAutoClosedCharactersRanges() { - let result = []; - for (let i = 0; i < this._autoClosedCharactersDecorations.length; i++) { - const decorationRange = this._model.getDecorationRange(this._autoClosedCharactersDecorations[i]); - if (decorationRange) { - result.push(decorationRange); - } - } - return result; - } - isValid(selections) { - let enclosingRanges = []; - for (let i = 0; i < this._autoClosedEnclosingDecorations.length; i++) { - const decorationRange = this._model.getDecorationRange(this._autoClosedEnclosingDecorations[i]); - if (decorationRange) { - enclosingRanges.push(decorationRange); - if (decorationRange.startLineNumber !== decorationRange.endLineNumber) { - // Stop tracking if the range becomes multiline... - return false; - } - } - } - enclosingRanges.sort(_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts); - selections.sort(_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts); - for (let i = 0; i < selections.length; i++) { - if (i >= enclosingRanges.length) { - return false; - } - if (!enclosingRanges[i].strictContainsRange(selections[i])) { - return false; - } - } - return true; - } -} -class Cursor extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["Disposable"] { - constructor(model, viewModel, coordinatesConverter, cursorConfig) { - super(); - this._model = model; - this._knownModelVersionId = this._model.getVersionId(); - this._viewModel = viewModel; - this._coordinatesConverter = coordinatesConverter; - this.context = new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_3__["CursorContext"](this._model, this._coordinatesConverter, cursorConfig); - this._cursors = new _cursorCollection_js__WEBPACK_IMPORTED_MODULE_2__["CursorCollection"](this.context); - this._hasFocus = false; - this._isHandling = false; - this._isDoingComposition = false; - this._selectionsWhenCompositionStarted = null; - this._columnSelectData = null; - this._autoClosedActions = []; - this._prevEditOperationType = 0 /* Other */; - } - dispose() { - this._cursors.dispose(); - this._autoClosedActions = Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["dispose"])(this._autoClosedActions); - super.dispose(); - } - updateConfiguration(cursorConfig) { - this.context = new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_3__["CursorContext"](this._model, this._coordinatesConverter, cursorConfig); - this._cursors.updateContext(this.context); - } - onLineMappingChanged(eventsCollector) { - if (this._knownModelVersionId !== this._model.getVersionId()) { - // There are model change events that I didn't yet receive. - // - // This can happen when editing the model, and the view model receives the change events first, - // and the view model emits line mapping changed events, all before the cursor gets a chance to - // recover from markers. - // - // The model change listener above will be called soon and we'll ensure a valid cursor state there. - return; - } - // Ensure valid state - this.setStates(eventsCollector, 'viewModel', 0 /* NotSet */, this.getCursorStates()); - } - setHasFocus(hasFocus) { - this._hasFocus = hasFocus; - } - _validateAutoClosedActions() { - if (this._autoClosedActions.length > 0) { - let selections = this._cursors.getSelections(); - for (let i = 0; i < this._autoClosedActions.length; i++) { - const autoClosedAction = this._autoClosedActions[i]; - if (!autoClosedAction.isValid(selections)) { - autoClosedAction.dispose(); - this._autoClosedActions.splice(i, 1); - i--; - } - } - } - } - // ------ some getters/setters - getPrimaryCursorState() { - return this._cursors.getPrimaryCursor(); - } - getLastAddedCursorIndex() { - return this._cursors.getLastAddedCursorIndex(); - } - getCursorStates() { - return this._cursors.getAll(); - } - setStates(eventsCollector, source, reason, states) { - let reachedMaxCursorCount = false; - if (states !== null && states.length > Cursor.MAX_CURSOR_COUNT) { - states = states.slice(0, Cursor.MAX_CURSOR_COUNT); - reachedMaxCursorCount = true; - } - const oldState = new CursorModelState(this._model, this); - this._cursors.setStates(states); - this._cursors.normalize(); - this._columnSelectData = null; - this._validateAutoClosedActions(); - return this._emitStateChangedIfNecessary(eventsCollector, source, reason, oldState, reachedMaxCursorCount); - } - setCursorColumnSelectData(columnSelectData) { - this._columnSelectData = columnSelectData; - } - revealPrimary(eventsCollector, source, revealHorizontal, scrollType) { - const viewPositions = this._cursors.getViewPositions(); - if (viewPositions.length > 1) { - this._emitCursorRevealRange(eventsCollector, source, null, this._cursors.getViewSelections(), 0 /* Simple */, revealHorizontal, scrollType); - return; - } - else { - const viewPosition = viewPositions[0]; - const viewRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](viewPosition.lineNumber, viewPosition.column, viewPosition.lineNumber, viewPosition.column); - this._emitCursorRevealRange(eventsCollector, source, viewRange, null, 0 /* Simple */, revealHorizontal, scrollType); - } - } - _revealPrimaryCursor(eventsCollector, source, verticalType, revealHorizontal, scrollType) { - const viewPositions = this._cursors.getViewPositions(); - if (viewPositions.length > 1) { - this._emitCursorRevealRange(eventsCollector, source, null, this._cursors.getViewSelections(), verticalType, revealHorizontal, scrollType); - } - else { - const viewPosition = viewPositions[0]; - const viewRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](viewPosition.lineNumber, viewPosition.column, viewPosition.lineNumber, viewPosition.column); - this._emitCursorRevealRange(eventsCollector, source, viewRange, null, verticalType, revealHorizontal, scrollType); - } - } - _emitCursorRevealRange(eventsCollector, source, viewRange, viewSelections, verticalType, revealHorizontal, scrollType) { - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_8__["ViewRevealRangeRequestEvent"](source, viewRange, viewSelections, verticalType, revealHorizontal, scrollType)); - } - saveState() { - let result = []; - const selections = this._cursors.getSelections(); - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - result.push({ - inSelectionMode: !selection.isEmpty(), - selectionStart: { - lineNumber: selection.selectionStartLineNumber, - column: selection.selectionStartColumn, - }, - position: { - lineNumber: selection.positionLineNumber, - column: selection.positionColumn, - } - }); - } - return result; - } - restoreState(eventsCollector, states) { - let desiredSelections = []; - for (let i = 0, len = states.length; i < len; i++) { - const state = states[i]; - let positionLineNumber = 1; - let positionColumn = 1; - // Avoid missing properties on the literal - if (state.position && state.position.lineNumber) { - positionLineNumber = state.position.lineNumber; - } - if (state.position && state.position.column) { - positionColumn = state.position.column; - } - let selectionStartLineNumber = positionLineNumber; - let selectionStartColumn = positionColumn; - // Avoid missing properties on the literal - if (state.selectionStart && state.selectionStart.lineNumber) { - selectionStartLineNumber = state.selectionStart.lineNumber; - } - if (state.selectionStart && state.selectionStart.column) { - selectionStartColumn = state.selectionStart.column; - } - desiredSelections.push({ - selectionStartLineNumber: selectionStartLineNumber, - selectionStartColumn: selectionStartColumn, - positionLineNumber: positionLineNumber, - positionColumn: positionColumn - }); - } - this.setStates(eventsCollector, 'restoreState', 0 /* NotSet */, _cursorCommon_js__WEBPACK_IMPORTED_MODULE_3__["CursorState"].fromModelSelections(desiredSelections)); - this.revealPrimary(eventsCollector, 'restoreState', true, 1 /* Immediate */); - } - onModelContentChanged(eventsCollector, e) { - this._knownModelVersionId = e.versionId; - if (this._isHandling) { - return; - } - const hadFlushEvent = e.containsEvent(1 /* Flush */); - this._prevEditOperationType = 0 /* Other */; - if (hadFlushEvent) { - // a model.setValue() was called - this._cursors.dispose(); - this._cursors = new _cursorCollection_js__WEBPACK_IMPORTED_MODULE_2__["CursorCollection"](this.context); - this._validateAutoClosedActions(); - this._emitStateChangedIfNecessary(eventsCollector, 'model', 1 /* ContentFlush */, null, false); - } - else { - if (this._hasFocus && e.resultingSelection && e.resultingSelection.length > 0) { - const cursorState = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_3__["CursorState"].fromModelSelections(e.resultingSelection); - if (this.setStates(eventsCollector, 'modelChange', e.isUndoing ? 5 /* Undo */ : e.isRedoing ? 6 /* Redo */ : 2 /* RecoverFromMarkers */, cursorState)) { - this._revealPrimaryCursor(eventsCollector, 'modelChange', 0 /* Simple */, true, 0 /* Smooth */); - } - } - else { - const selectionsFromMarkers = this._cursors.readSelectionFromMarkers(); - this.setStates(eventsCollector, 'modelChange', 2 /* RecoverFromMarkers */, _cursorCommon_js__WEBPACK_IMPORTED_MODULE_3__["CursorState"].fromModelSelections(selectionsFromMarkers)); - } - } - } - getSelection() { - return this._cursors.getPrimaryCursor().modelState.selection; - } - getTopMostViewPosition() { - return this._cursors.getTopMostViewPosition(); - } - getBottomMostViewPosition() { - return this._cursors.getBottomMostViewPosition(); - } - getCursorColumnSelectData() { - if (this._columnSelectData) { - return this._columnSelectData; - } - const primaryCursor = this._cursors.getPrimaryCursor(); - const viewSelectionStart = primaryCursor.viewState.selectionStart.getStartPosition(); - const viewPosition = primaryCursor.viewState.position; - return { - isReal: false, - fromViewLineNumber: viewSelectionStart.lineNumber, - fromViewVisualColumn: _cursorCommon_js__WEBPACK_IMPORTED_MODULE_3__["CursorColumns"].visibleColumnFromColumn2(this.context.cursorConfig, this._viewModel, viewSelectionStart), - toViewLineNumber: viewPosition.lineNumber, - toViewVisualColumn: _cursorCommon_js__WEBPACK_IMPORTED_MODULE_3__["CursorColumns"].visibleColumnFromColumn2(this.context.cursorConfig, this._viewModel, viewPosition), - }; - } - getSelections() { - return this._cursors.getSelections(); - } - setSelections(eventsCollector, source, selections) { - this.setStates(eventsCollector, source, 0 /* NotSet */, _cursorCommon_js__WEBPACK_IMPORTED_MODULE_3__["CursorState"].fromModelSelections(selections)); - } - getPrevEditOperationType() { - return this._prevEditOperationType; - } - setPrevEditOperationType(type) { - this._prevEditOperationType = type; - } - // ------ auxiliary handling logic - _pushAutoClosedAction(autoClosedCharactersRanges, autoClosedEnclosingRanges) { - let autoClosedCharactersDeltaDecorations = []; - let autoClosedEnclosingDeltaDecorations = []; - for (let i = 0, len = autoClosedCharactersRanges.length; i < len; i++) { - autoClosedCharactersDeltaDecorations.push({ - range: autoClosedCharactersRanges[i], - options: { - inlineClassName: 'auto-closed-character', - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */ - } - }); - autoClosedEnclosingDeltaDecorations.push({ - range: autoClosedEnclosingRanges[i], - options: { - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */ - } - }); - } - const autoClosedCharactersDecorations = this._model.deltaDecorations([], autoClosedCharactersDeltaDecorations); - const autoClosedEnclosingDecorations = this._model.deltaDecorations([], autoClosedEnclosingDeltaDecorations); - this._autoClosedActions.push(new AutoClosedAction(this._model, autoClosedCharactersDecorations, autoClosedEnclosingDecorations)); - } - _executeEditOperation(opResult) { - if (!opResult) { - // Nothing to execute - return; - } - if (opResult.shouldPushStackElementBefore) { - this._model.pushStackElement(); - } - const result = CommandExecutor.executeCommands(this._model, this._cursors.getSelections(), opResult.commands); - if (result) { - // The commands were applied correctly - this._interpretCommandResult(result); - // Check for auto-closing closed characters - let autoClosedCharactersRanges = []; - let autoClosedEnclosingRanges = []; - for (let i = 0; i < opResult.commands.length; i++) { - const command = opResult.commands[i]; - if (command instanceof _cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_5__["TypeWithAutoClosingCommand"] && command.enclosingRange && command.closeCharacterRange) { - autoClosedCharactersRanges.push(command.closeCharacterRange); - autoClosedEnclosingRanges.push(command.enclosingRange); - } - } - if (autoClosedCharactersRanges.length > 0) { - this._pushAutoClosedAction(autoClosedCharactersRanges, autoClosedEnclosingRanges); - } - this._prevEditOperationType = opResult.type; - } - if (opResult.shouldPushStackElementAfter) { - this._model.pushStackElement(); - } - } - _interpretCommandResult(cursorState) { - if (!cursorState || cursorState.length === 0) { - cursorState = this._cursors.readSelectionFromMarkers(); - } - this._columnSelectData = null; - this._cursors.setSelections(cursorState); - this._cursors.normalize(); - } - // ----------------------------------------------------------------------------------------------------------- - // ----- emitting events - _emitStateChangedIfNecessary(eventsCollector, source, reason, oldState, reachedMaxCursorCount) { - const newState = new CursorModelState(this._model, this); - if (newState.equals(oldState)) { - return false; - } - const selections = this._cursors.getSelections(); - const viewSelections = this._cursors.getViewSelections(); - // Let the view get the event first. - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_8__["ViewCursorStateChangedEvent"](viewSelections, selections)); - // Only after the view has been notified, let the rest of the world know... - if (!oldState - || oldState.cursorState.length !== newState.cursorState.length - || newState.cursorState.some((newCursorState, i) => !newCursorState.modelState.equals(oldState.cursorState[i].modelState))) { - const oldSelections = oldState ? oldState.cursorState.map(s => s.modelState.selection) : null; - const oldModelVersionId = oldState ? oldState.modelVersionId : 0; - eventsCollector.emitOutgoingEvent(new _viewModel_viewModelEventDispatcher_js__WEBPACK_IMPORTED_MODULE_10__["CursorStateChangedEvent"](oldSelections, selections, oldModelVersionId, newState.modelVersionId, source || 'keyboard', reason, reachedMaxCursorCount)); - } - return true; - } - // ----------------------------------------------------------------------------------------------------------- - // ----- handlers beyond this point - _findAutoClosingPairs(edits) { - if (!edits.length) { - return null; - } - let indices = []; - for (let i = 0, len = edits.length; i < len; i++) { - const edit = edits[i]; - if (!edit.text || edit.text.indexOf('\n') >= 0) { - return null; - } - const m = edit.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/); - if (!m) { - return null; - } - const closeChar = m[1]; - const autoClosingPairsCandidates = this.context.cursorConfig.autoClosingPairsClose2.get(closeChar); - if (!autoClosingPairsCandidates || autoClosingPairsCandidates.length !== 1) { - return null; - } - const openChar = autoClosingPairsCandidates[0].open; - const closeCharIndex = edit.text.length - m[2].length - 1; - const openCharIndex = edit.text.lastIndexOf(openChar, closeCharIndex - 1); - if (openCharIndex === -1) { - return null; - } - indices.push([openCharIndex, closeCharIndex]); - } - return indices; - } - executeEdits(eventsCollector, source, edits, cursorStateComputer) { - let autoClosingIndices = null; - if (source === 'snippet') { - autoClosingIndices = this._findAutoClosingPairs(edits); - } - if (autoClosingIndices) { - edits[0]._isTracked = true; - } - let autoClosedCharactersRanges = []; - let autoClosedEnclosingRanges = []; - const selections = this._model.pushEditOperations(this.getSelections(), edits, (undoEdits) => { - if (autoClosingIndices) { - for (let i = 0, len = autoClosingIndices.length; i < len; i++) { - const [openCharInnerIndex, closeCharInnerIndex] = autoClosingIndices[i]; - const undoEdit = undoEdits[i]; - const lineNumber = undoEdit.range.startLineNumber; - const openCharIndex = undoEdit.range.startColumn - 1 + openCharInnerIndex; - const closeCharIndex = undoEdit.range.startColumn - 1 + closeCharInnerIndex; - autoClosedCharactersRanges.push(new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](lineNumber, closeCharIndex + 1, lineNumber, closeCharIndex + 2)); - autoClosedEnclosingRanges.push(new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](lineNumber, openCharIndex + 1, lineNumber, closeCharIndex + 2)); - } - } - const selections = cursorStateComputer(undoEdits); - if (selections) { - // Don't recover the selection from markers because - // we know what it should be. - this._isHandling = true; - } - return selections; - }); - if (selections) { - this._isHandling = false; - this.setSelections(eventsCollector, source, selections); - } - if (autoClosedCharactersRanges.length > 0) { - this._pushAutoClosedAction(autoClosedCharactersRanges, autoClosedEnclosingRanges); - } - } - _executeEdit(callback, eventsCollector, source, cursorChangeReason = 0 /* NotSet */) { - if (this.context.cursorConfig.readOnly) { - // we cannot edit when read only... - return; - } - const oldState = new CursorModelState(this._model, this); - this._cursors.stopTrackingSelections(); - this._isHandling = true; - try { - this._cursors.ensureValidState(); - callback(); - } - catch (err) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(err); - } - this._isHandling = false; - this._cursors.startTrackingSelections(); - this._validateAutoClosedActions(); - if (this._emitStateChangedIfNecessary(eventsCollector, source, cursorChangeReason, oldState, false)) { - this._revealPrimaryCursor(eventsCollector, source, 0 /* Simple */, true, 0 /* Smooth */); - } - } - setIsDoingComposition(isDoingComposition) { - this._isDoingComposition = isDoingComposition; - } - startComposition(eventsCollector) { - this._selectionsWhenCompositionStarted = this.getSelections().slice(0); - } - endComposition(eventsCollector, source) { - this._executeEdit(() => { - if (source === 'keyboard') { - // composition finishes, let's check if we need to auto complete if necessary. - const autoClosedCharacters = AutoClosedAction.getAllAutoClosedCharacters(this._autoClosedActions); - this._executeEditOperation(_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_5__["TypeOperations"].compositionEndWithInterceptors(this._prevEditOperationType, this.context.cursorConfig, this._model, this._selectionsWhenCompositionStarted, this.getSelections(), autoClosedCharacters)); - this._selectionsWhenCompositionStarted = null; - } - }, eventsCollector, source); - } - type(eventsCollector, text, source) { - this._executeEdit(() => { - if (source === 'keyboard') { - // If this event is coming straight from the keyboard, look for electric characters and enter - const len = text.length; - let offset = 0; - while (offset < len) { - const charLength = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["nextCharLength"](text, offset); - const chr = text.substr(offset, charLength); - // Here we must interpret each typed character individually - const autoClosedCharacters = AutoClosedAction.getAllAutoClosedCharacters(this._autoClosedActions); - this._executeEditOperation(_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_5__["TypeOperations"].typeWithInterceptors(this._isDoingComposition, this._prevEditOperationType, this.context.cursorConfig, this._model, this.getSelections(), autoClosedCharacters, chr)); - offset += charLength; - } - } - else { - this._executeEditOperation(_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_5__["TypeOperations"].typeWithoutInterceptors(this._prevEditOperationType, this.context.cursorConfig, this._model, this.getSelections(), text)); - } - }, eventsCollector, source); - } - replacePreviousChar(eventsCollector, text, replaceCharCnt, source) { - this._executeEdit(() => { - this._executeEditOperation(_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_5__["TypeOperations"].replacePreviousChar(this._prevEditOperationType, this.context.cursorConfig, this._model, this.getSelections(), text, replaceCharCnt)); - }, eventsCollector, source); - } - paste(eventsCollector, text, pasteOnNewLine, multicursorText, source) { - this._executeEdit(() => { - this._executeEditOperation(_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_5__["TypeOperations"].paste(this.context.cursorConfig, this._model, this.getSelections(), text, pasteOnNewLine, multicursorText || [])); - }, eventsCollector, source, 4 /* Paste */); - } - cut(eventsCollector, source) { - this._executeEdit(() => { - this._executeEditOperation(_cursorDeleteOperations_js__WEBPACK_IMPORTED_MODULE_4__["DeleteOperations"].cut(this.context.cursorConfig, this._model, this.getSelections())); - }, eventsCollector, source); - } - executeCommand(eventsCollector, command, source) { - this._executeEdit(() => { - this._cursors.killSecondaryCursors(); - this._executeEditOperation(new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_3__["EditOperationResult"](0 /* Other */, [command], { - shouldPushStackElementBefore: false, - shouldPushStackElementAfter: false - })); - }, eventsCollector, source); - } - executeCommands(eventsCollector, commands, source) { - this._executeEdit(() => { - this._executeEditOperation(new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_3__["EditOperationResult"](0 /* Other */, commands, { - shouldPushStackElementBefore: false, - shouldPushStackElementAfter: false - })); - }, eventsCollector, source); - } -} -Cursor.MAX_CURSOR_COUNT = 10000; -class CommandExecutor { - static executeCommands(model, selectionsBefore, commands) { - const ctx = { - model: model, - selectionsBefore: selectionsBefore, - trackedRanges: [], - trackedRangesDirection: [] - }; - const result = this._innerExecuteCommands(ctx, commands); - for (let i = 0, len = ctx.trackedRanges.length; i < len; i++) { - ctx.model._setTrackedRange(ctx.trackedRanges[i], null, 0 /* AlwaysGrowsWhenTypingAtEdges */); - } - return result; - } - static _innerExecuteCommands(ctx, commands) { - if (this._arrayIsEmpty(commands)) { - return null; - } - const commandsData = this._getEditOperations(ctx, commands); - if (commandsData.operations.length === 0) { - return null; - } - const rawOperations = commandsData.operations; - const loserCursorsMap = this._getLoserCursorMap(rawOperations); - if (loserCursorsMap.hasOwnProperty('0')) { - // These commands are very messed up - console.warn('Ignoring commands'); - return null; - } - // Remove operations belonging to losing cursors - let filteredOperations = []; - for (let i = 0, len = rawOperations.length; i < len; i++) { - if (!loserCursorsMap.hasOwnProperty(rawOperations[i].identifier.major.toString())) { - filteredOperations.push(rawOperations[i]); - } - } - // TODO@Alex: find a better way to do this. - // give the hint that edit operations are tracked to the model - if (commandsData.hadTrackedEditOperation && filteredOperations.length > 0) { - filteredOperations[0]._isTracked = true; - } - let selectionsAfter = ctx.model.pushEditOperations(ctx.selectionsBefore, filteredOperations, (inverseEditOperations) => { - let groupedInverseEditOperations = []; - for (let i = 0; i < ctx.selectionsBefore.length; i++) { - groupedInverseEditOperations[i] = []; - } - for (const op of inverseEditOperations) { - if (!op.identifier) { - // perhaps auto whitespace trim edits - continue; - } - groupedInverseEditOperations[op.identifier.major].push(op); - } - const minorBasedSorter = (a, b) => { - return a.identifier.minor - b.identifier.minor; - }; - let cursorSelections = []; - for (let i = 0; i < ctx.selectionsBefore.length; i++) { - if (groupedInverseEditOperations[i].length > 0) { - groupedInverseEditOperations[i].sort(minorBasedSorter); - cursorSelections[i] = commands[i].computeCursorState(ctx.model, { - getInverseEditOperations: () => { - return groupedInverseEditOperations[i]; - }, - getTrackedSelection: (id) => { - const idx = parseInt(id, 10); - const range = ctx.model._getTrackedRange(ctx.trackedRanges[idx]); - if (ctx.trackedRangesDirection[idx] === 0 /* LTR */) { - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); - } - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](range.endLineNumber, range.endColumn, range.startLineNumber, range.startColumn); - } - }); - } - else { - cursorSelections[i] = ctx.selectionsBefore[i]; - } - } - return cursorSelections; - }); - if (!selectionsAfter) { - selectionsAfter = ctx.selectionsBefore; - } - // Extract losing cursors - let losingCursors = []; - for (let losingCursorIndex in loserCursorsMap) { - if (loserCursorsMap.hasOwnProperty(losingCursorIndex)) { - losingCursors.push(parseInt(losingCursorIndex, 10)); - } - } - // Sort losing cursors descending - losingCursors.sort((a, b) => { - return b - a; - }); - // Remove losing cursors - for (const losingCursor of losingCursors) { - selectionsAfter.splice(losingCursor, 1); - } - return selectionsAfter; - } - static _arrayIsEmpty(commands) { - for (let i = 0, len = commands.length; i < len; i++) { - if (commands[i]) { - return false; - } - } - return true; - } - static _getEditOperations(ctx, commands) { - let operations = []; - let hadTrackedEditOperation = false; - for (let i = 0, len = commands.length; i < len; i++) { - const command = commands[i]; - if (command) { - const r = this._getEditOperationsFromCommand(ctx, i, command); - operations = operations.concat(r.operations); - hadTrackedEditOperation = hadTrackedEditOperation || r.hadTrackedEditOperation; - } - } - return { - operations: operations, - hadTrackedEditOperation: hadTrackedEditOperation - }; - } - static _getEditOperationsFromCommand(ctx, majorIdentifier, command) { - // This method acts as a transaction, if the command fails - // everything it has done is ignored - let operations = []; - let operationMinor = 0; - const addEditOperation = (range, text, forceMoveMarkers = false) => { - if (_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].isEmpty(range) && text === '') { - // This command wants to add a no-op => no thank you - return; - } - operations.push({ - identifier: { - major: majorIdentifier, - minor: operationMinor++ - }, - range: range, - text: text, - forceMoveMarkers: forceMoveMarkers, - isAutoWhitespaceEdit: command.insertsAutoWhitespace - }); - }; - let hadTrackedEditOperation = false; - const addTrackedEditOperation = (selection, text, forceMoveMarkers) => { - hadTrackedEditOperation = true; - addEditOperation(selection, text, forceMoveMarkers); - }; - const trackSelection = (_selection, trackPreviousOnEmpty) => { - const selection = _core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"].liftSelection(_selection); - let stickiness; - if (selection.isEmpty()) { - if (typeof trackPreviousOnEmpty === 'boolean') { - if (trackPreviousOnEmpty) { - stickiness = 2 /* GrowsOnlyWhenTypingBefore */; - } - else { - stickiness = 3 /* GrowsOnlyWhenTypingAfter */; - } - } - else { - // Try to lock it with surrounding text - const maxLineColumn = ctx.model.getLineMaxColumn(selection.startLineNumber); - if (selection.startColumn === maxLineColumn) { - stickiness = 2 /* GrowsOnlyWhenTypingBefore */; - } - else { - stickiness = 3 /* GrowsOnlyWhenTypingAfter */; - } - } - } - else { - stickiness = 1 /* NeverGrowsWhenTypingAtEdges */; - } - const l = ctx.trackedRanges.length; - const id = ctx.model._setTrackedRange(null, selection, stickiness); - ctx.trackedRanges[l] = id; - ctx.trackedRangesDirection[l] = selection.getDirection(); - return l.toString(); - }; - const editOperationBuilder = { - addEditOperation: addEditOperation, - addTrackedEditOperation: addTrackedEditOperation, - trackSelection: trackSelection - }; - try { - command.getEditOperations(ctx.model, editOperationBuilder); - } - catch (e) { - // TODO@Alex use notification service if this should be user facing - // e.friendlyMessage = nls.localize('corrupt.commands', "Unexpected exception while executing command."); - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - return { - operations: [], - hadTrackedEditOperation: false - }; - } - return { - operations: operations, - hadTrackedEditOperation: hadTrackedEditOperation - }; - } - static _getLoserCursorMap(operations) { - // This is destructive on the array - operations = operations.slice(0); - // Sort operations with last one first - operations.sort((a, b) => { - // Note the minus! - return -(_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingEnds(a.range, b.range)); - }); - // Operations can not overlap! - let loserCursorsMap = {}; - for (let i = 1; i < operations.length; i++) { - const previousOp = operations[i - 1]; - const currentOp = operations[i]; - if (_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].getStartPosition(previousOp.range).isBefore(_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].getEndPosition(currentOp.range))) { - let loserMajor; - if (previousOp.identifier.major > currentOp.identifier.major) { - // previousOp loses the battle - loserMajor = previousOp.identifier.major; - } - else { - loserMajor = currentOp.identifier.major; - } - loserCursorsMap[loserMajor.toString()] = true; - for (let j = 0; j < operations.length; j++) { - if (operations[j].identifier.major === loserMajor) { - operations.splice(j, 1); - if (j < i) { - i--; - } - j--; - } - } - if (i > 0) { - i--; - } - } - } - return loserCursorsMap; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCollection.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCollection.js ***! - \****************************************************************************************/ -/*! exports provided: CursorCollection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorCollection", function() { return CursorCollection; }); -/* harmony import */ var _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _oneCursor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./oneCursor.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/oneCursor.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class CursorCollection { - constructor(context) { - this.context = context; - this.primaryCursor = new _oneCursor_js__WEBPACK_IMPORTED_MODULE_1__["OneCursor"](context); - this.secondaryCursors = []; - this.lastAddedCursorIndex = 0; - } - dispose() { - this.primaryCursor.dispose(this.context); - this.killSecondaryCursors(); - } - startTrackingSelections() { - this.primaryCursor.startTrackingSelection(this.context); - for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { - this.secondaryCursors[i].startTrackingSelection(this.context); - } - } - stopTrackingSelections() { - this.primaryCursor.stopTrackingSelection(this.context); - for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { - this.secondaryCursors[i].stopTrackingSelection(this.context); - } - } - updateContext(context) { - this.context = context; - } - ensureValidState() { - this.primaryCursor.ensureValidState(this.context); - for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { - this.secondaryCursors[i].ensureValidState(this.context); - } - } - readSelectionFromMarkers() { - let result = []; - result[0] = this.primaryCursor.readSelectionFromMarkers(this.context); - for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { - result[i + 1] = this.secondaryCursors[i].readSelectionFromMarkers(this.context); - } - return result; - } - getAll() { - let result = []; - result[0] = this.primaryCursor.asCursorState(); - for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { - result[i + 1] = this.secondaryCursors[i].asCursorState(); - } - return result; - } - getViewPositions() { - let result = []; - result[0] = this.primaryCursor.viewState.position; - for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { - result[i + 1] = this.secondaryCursors[i].viewState.position; - } - return result; - } - getTopMostViewPosition() { - let result = this.primaryCursor.viewState.position; - for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { - const viewPosition = this.secondaryCursors[i].viewState.position; - if (viewPosition.isBefore(result)) { - result = viewPosition; - } - } - return result; - } - getBottomMostViewPosition() { - let result = this.primaryCursor.viewState.position; - for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { - const viewPosition = this.secondaryCursors[i].viewState.position; - if (result.isBeforeOrEqual(viewPosition)) { - result = viewPosition; - } - } - return result; - } - getSelections() { - let result = []; - result[0] = this.primaryCursor.modelState.selection; - for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { - result[i + 1] = this.secondaryCursors[i].modelState.selection; - } - return result; - } - getViewSelections() { - let result = []; - result[0] = this.primaryCursor.viewState.selection; - for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { - result[i + 1] = this.secondaryCursors[i].viewState.selection; - } - return result; - } - setSelections(selections) { - this.setStates(_cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorState"].fromModelSelections(selections)); - } - getPrimaryCursor() { - return this.primaryCursor.asCursorState(); - } - setStates(states) { - if (states === null) { - return; - } - this.primaryCursor.setState(this.context, states[0].modelState, states[0].viewState); - this._setSecondaryStates(states.slice(1)); - } - /** - * Creates or disposes secondary cursors as necessary to match the number of `secondarySelections`. - */ - _setSecondaryStates(secondaryStates) { - const secondaryCursorsLength = this.secondaryCursors.length; - const secondaryStatesLength = secondaryStates.length; - if (secondaryCursorsLength < secondaryStatesLength) { - let createCnt = secondaryStatesLength - secondaryCursorsLength; - for (let i = 0; i < createCnt; i++) { - this._addSecondaryCursor(); - } - } - else if (secondaryCursorsLength > secondaryStatesLength) { - let removeCnt = secondaryCursorsLength - secondaryStatesLength; - for (let i = 0; i < removeCnt; i++) { - this._removeSecondaryCursor(this.secondaryCursors.length - 1); - } - } - for (let i = 0; i < secondaryStatesLength; i++) { - this.secondaryCursors[i].setState(this.context, secondaryStates[i].modelState, secondaryStates[i].viewState); - } - } - killSecondaryCursors() { - this._setSecondaryStates([]); - } - _addSecondaryCursor() { - this.secondaryCursors.push(new _oneCursor_js__WEBPACK_IMPORTED_MODULE_1__["OneCursor"](this.context)); - this.lastAddedCursorIndex = this.secondaryCursors.length; - } - getLastAddedCursorIndex() { - if (this.secondaryCursors.length === 0 || this.lastAddedCursorIndex === 0) { - return 0; - } - return this.lastAddedCursorIndex; - } - _removeSecondaryCursor(removeIndex) { - if (this.lastAddedCursorIndex >= removeIndex + 1) { - this.lastAddedCursorIndex--; - } - this.secondaryCursors[removeIndex].dispose(this.context); - this.secondaryCursors.splice(removeIndex, 1); - } - _getAll() { - let result = []; - result[0] = this.primaryCursor; - for (let i = 0, len = this.secondaryCursors.length; i < len; i++) { - result[i + 1] = this.secondaryCursors[i]; - } - return result; - } - normalize() { - if (this.secondaryCursors.length === 0) { - return; - } - let cursors = this._getAll(); - let sortedCursors = []; - for (let i = 0, len = cursors.length; i < len; i++) { - sortedCursors.push({ - index: i, - selection: cursors[i].modelState.selection, - }); - } - sortedCursors.sort((a, b) => { - if (a.selection.startLineNumber === b.selection.startLineNumber) { - return a.selection.startColumn - b.selection.startColumn; - } - return a.selection.startLineNumber - b.selection.startLineNumber; - }); - for (let sortedCursorIndex = 0; sortedCursorIndex < sortedCursors.length - 1; sortedCursorIndex++) { - const current = sortedCursors[sortedCursorIndex]; - const next = sortedCursors[sortedCursorIndex + 1]; - const currentSelection = current.selection; - const nextSelection = next.selection; - if (!this.context.cursorConfig.multiCursorMergeOverlapping) { - continue; - } - let shouldMergeCursors; - if (nextSelection.isEmpty() || currentSelection.isEmpty()) { - // Merge touching cursors if one of them is collapsed - shouldMergeCursors = nextSelection.getStartPosition().isBeforeOrEqual(currentSelection.getEndPosition()); - } - else { - // Merge only overlapping cursors (i.e. allow touching ranges) - shouldMergeCursors = nextSelection.getStartPosition().isBefore(currentSelection.getEndPosition()); - } - if (shouldMergeCursors) { - const winnerSortedCursorIndex = current.index < next.index ? sortedCursorIndex : sortedCursorIndex + 1; - const looserSortedCursorIndex = current.index < next.index ? sortedCursorIndex + 1 : sortedCursorIndex; - const looserIndex = sortedCursors[looserSortedCursorIndex].index; - const winnerIndex = sortedCursors[winnerSortedCursorIndex].index; - const looserSelection = sortedCursors[looserSortedCursorIndex].selection; - const winnerSelection = sortedCursors[winnerSortedCursorIndex].selection; - if (!looserSelection.equalsSelection(winnerSelection)) { - const resultingRange = looserSelection.plusRange(winnerSelection); - const looserSelectionIsLTR = (looserSelection.selectionStartLineNumber === looserSelection.startLineNumber && looserSelection.selectionStartColumn === looserSelection.startColumn); - const winnerSelectionIsLTR = (winnerSelection.selectionStartLineNumber === winnerSelection.startLineNumber && winnerSelection.selectionStartColumn === winnerSelection.startColumn); - // Give more importance to the last added cursor (think Ctrl-dragging + hitting another cursor) - let resultingSelectionIsLTR; - if (looserIndex === this.lastAddedCursorIndex) { - resultingSelectionIsLTR = looserSelectionIsLTR; - this.lastAddedCursorIndex = winnerIndex; - } - else { - // Winner takes it all - resultingSelectionIsLTR = winnerSelectionIsLTR; - } - let resultingSelection; - if (resultingSelectionIsLTR) { - resultingSelection = new _core_selection_js__WEBPACK_IMPORTED_MODULE_2__["Selection"](resultingRange.startLineNumber, resultingRange.startColumn, resultingRange.endLineNumber, resultingRange.endColumn); - } - else { - resultingSelection = new _core_selection_js__WEBPACK_IMPORTED_MODULE_2__["Selection"](resultingRange.endLineNumber, resultingRange.endColumn, resultingRange.startLineNumber, resultingRange.startColumn); - } - sortedCursors[winnerSortedCursorIndex].selection = resultingSelection; - const resultingState = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorState"].fromModelSelection(resultingSelection); - cursors[winnerIndex].setState(this.context, resultingState.modelState, resultingState.viewState); - } - for (const sortedCursor of sortedCursors) { - if (sortedCursor.index > looserIndex) { - sortedCursor.index--; - } - } - cursors.splice(looserIndex, 1); - sortedCursors.splice(looserSortedCursorIndex, 1); - this._removeSecondaryCursor(looserIndex - 1); - sortedCursorIndex--; - } - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorColumnSelection.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorColumnSelection.js ***! - \*********************************************************************************************/ -/*! exports provided: ColumnSelection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnSelection", function() { return ColumnSelection; }); -/* harmony import */ var _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class ColumnSelection { - static columnSelect(config, model, fromLineNumber, fromVisibleColumn, toLineNumber, toVisibleColumn) { - let lineCount = Math.abs(toLineNumber - fromLineNumber) + 1; - let reversed = (fromLineNumber > toLineNumber); - let isRTL = (fromVisibleColumn > toVisibleColumn); - let isLTR = (fromVisibleColumn < toVisibleColumn); - let result = []; - // console.log(`fromVisibleColumn: ${fromVisibleColumn}, toVisibleColumn: ${toVisibleColumn}`); - for (let i = 0; i < lineCount; i++) { - let lineNumber = fromLineNumber + (reversed ? -i : i); - let startColumn = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorColumns"].columnFromVisibleColumn2(config, model, lineNumber, fromVisibleColumn); - let endColumn = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorColumns"].columnFromVisibleColumn2(config, model, lineNumber, toVisibleColumn); - let visibleStartColumn = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorColumns"].visibleColumnFromColumn2(config, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](lineNumber, startColumn)); - let visibleEndColumn = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorColumns"].visibleColumnFromColumn2(config, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](lineNumber, endColumn)); - // console.log(`lineNumber: ${lineNumber}: visibleStartColumn: ${visibleStartColumn}, visibleEndColumn: ${visibleEndColumn}`); - if (isLTR) { - if (visibleStartColumn > toVisibleColumn) { - continue; - } - if (visibleEndColumn < fromVisibleColumn) { - continue; - } - } - if (isRTL) { - if (visibleEndColumn > fromVisibleColumn) { - continue; - } - if (visibleStartColumn < toVisibleColumn) { - continue; - } - } - result.push(new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["SingleCursorState"](new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](lineNumber, startColumn, lineNumber, startColumn), 0, new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](lineNumber, endColumn), 0)); - } - if (result.length === 0) { - // We are after all the lines, so add cursor at the end of each line - for (let i = 0; i < lineCount; i++) { - const lineNumber = fromLineNumber + (reversed ? -i : i); - const maxColumn = model.getLineMaxColumn(lineNumber); - result.push(new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["SingleCursorState"](new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](lineNumber, maxColumn, lineNumber, maxColumn), 0, new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](lineNumber, maxColumn), 0)); - } - } - return { - viewStates: result, - reversed: reversed, - fromLineNumber: fromLineNumber, - fromVisualColumn: fromVisibleColumn, - toLineNumber: toLineNumber, - toVisualColumn: toVisibleColumn - }; - } - static columnSelectLeft(config, model, prevColumnSelectData) { - let toViewVisualColumn = prevColumnSelectData.toViewVisualColumn; - if (toViewVisualColumn > 1) { - toViewVisualColumn--; - } - return ColumnSelection.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, prevColumnSelectData.toViewLineNumber, toViewVisualColumn); - } - static columnSelectRight(config, model, prevColumnSelectData) { - let maxVisualViewColumn = 0; - const minViewLineNumber = Math.min(prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.toViewLineNumber); - const maxViewLineNumber = Math.max(prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.toViewLineNumber); - for (let lineNumber = minViewLineNumber; lineNumber <= maxViewLineNumber; lineNumber++) { - const lineMaxViewColumn = model.getLineMaxColumn(lineNumber); - const lineMaxVisualViewColumn = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorColumns"].visibleColumnFromColumn2(config, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](lineNumber, lineMaxViewColumn)); - maxVisualViewColumn = Math.max(maxVisualViewColumn, lineMaxVisualViewColumn); - } - let toViewVisualColumn = prevColumnSelectData.toViewVisualColumn; - if (toViewVisualColumn < maxVisualViewColumn) { - toViewVisualColumn++; - } - return this.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, prevColumnSelectData.toViewLineNumber, toViewVisualColumn); - } - static columnSelectUp(config, model, prevColumnSelectData, isPaged) { - const linesCount = isPaged ? config.pageSize : 1; - const toViewLineNumber = Math.max(1, prevColumnSelectData.toViewLineNumber - linesCount); - return this.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, toViewLineNumber, prevColumnSelectData.toViewVisualColumn); - } - static columnSelectDown(config, model, prevColumnSelectData, isPaged) { - const linesCount = isPaged ? config.pageSize : 1; - const toViewLineNumber = Math.min(model.getLineCount(), prevColumnSelectData.toViewLineNumber + linesCount); - return this.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, toViewLineNumber, prevColumnSelectData.toViewVisualColumn); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js ***! - \************************************************************************************/ -/*! exports provided: CursorConfiguration, SingleCursorState, CursorContext, PartialModelCursorState, PartialViewCursorState, CursorState, EditOperationResult, CursorColumns, isQuote */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorConfiguration", function() { return CursorConfiguration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SingleCursorState", function() { return SingleCursorState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorContext", function() { return CursorContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PartialModelCursorState", function() { return PartialModelCursorState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PartialViewCursorState", function() { return PartialViewCursorState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorState", function() { return CursorState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditOperationResult", function() { return EditOperationResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorColumns", function() { return CursorColumns; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isQuote", function() { return isQuote; }); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _model_textModel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -const autoCloseAlways = () => true; -const autoCloseNever = () => false; -const autoCloseBeforeWhitespace = (chr) => (chr === ' ' || chr === '\t'); -function appendEntry(target, key, value) { - if (target.has(key)) { - target.get(key).push(value); - } - else { - target.set(key, [value]); - } -} -class CursorConfiguration { - constructor(languageIdentifier, modelOptions, configuration) { - this._languageIdentifier = languageIdentifier; - const options = configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - this.readOnly = options.get(72 /* readOnly */); - this.tabSize = modelOptions.tabSize; - this.indentSize = modelOptions.indentSize; - this.insertSpaces = modelOptions.insertSpaces; - this.lineHeight = options.get(51 /* lineHeight */); - this.pageSize = Math.max(1, Math.floor(layoutInfo.height / this.lineHeight) - 2); - this.useTabStops = options.get(104 /* useTabStops */); - this.wordSeparators = options.get(105 /* wordSeparators */); - this.emptySelectionClipboard = options.get(26 /* emptySelectionClipboard */); - this.copyWithSyntaxHighlighting = options.get(16 /* copyWithSyntaxHighlighting */); - this.multiCursorMergeOverlapping = options.get(60 /* multiCursorMergeOverlapping */); - this.multiCursorPaste = options.get(62 /* multiCursorPaste */); - this.autoClosingBrackets = options.get(5 /* autoClosingBrackets */); - this.autoClosingQuotes = options.get(7 /* autoClosingQuotes */); - this.autoClosingOvertype = options.get(6 /* autoClosingOvertype */); - this.autoSurround = options.get(10 /* autoSurround */); - this.autoIndent = options.get(8 /* autoIndent */); - this.autoClosingPairsOpen2 = new Map(); - this.autoClosingPairsClose2 = new Map(); - this.surroundingPairs = {}; - this._electricChars = null; - this.shouldAutoCloseBefore = { - quote: CursorConfiguration._getShouldAutoClose(languageIdentifier, this.autoClosingQuotes), - bracket: CursorConfiguration._getShouldAutoClose(languageIdentifier, this.autoClosingBrackets) - }; - let autoClosingPairs = CursorConfiguration._getAutoClosingPairs(languageIdentifier); - if (autoClosingPairs) { - for (const pair of autoClosingPairs) { - appendEntry(this.autoClosingPairsOpen2, pair.open.charAt(pair.open.length - 1), pair); - if (pair.close.length === 1) { - appendEntry(this.autoClosingPairsClose2, pair.close, pair); - } - } - } - let surroundingPairs = CursorConfiguration._getSurroundingPairs(languageIdentifier); - if (surroundingPairs) { - for (const pair of surroundingPairs) { - this.surroundingPairs[pair.open] = pair.close; - } - } - } - static shouldRecreate(e) { - return (e.hasChanged(117 /* layoutInfo */) - || e.hasChanged(105 /* wordSeparators */) - || e.hasChanged(26 /* emptySelectionClipboard */) - || e.hasChanged(60 /* multiCursorMergeOverlapping */) - || e.hasChanged(62 /* multiCursorPaste */) - || e.hasChanged(5 /* autoClosingBrackets */) - || e.hasChanged(7 /* autoClosingQuotes */) - || e.hasChanged(6 /* autoClosingOvertype */) - || e.hasChanged(10 /* autoSurround */) - || e.hasChanged(104 /* useTabStops */) - || e.hasChanged(51 /* lineHeight */) - || e.hasChanged(72 /* readOnly */)); - } - get electricChars() { - if (!this._electricChars) { - this._electricChars = {}; - let electricChars = CursorConfiguration._getElectricCharacters(this._languageIdentifier); - if (electricChars) { - for (const char of electricChars) { - this._electricChars[char] = true; - } - } - } - return this._electricChars; - } - normalizeIndentation(str) { - return _model_textModel_js__WEBPACK_IMPORTED_MODULE_5__["TextModel"].normalizeIndentation(str, this.indentSize, this.insertSpaces); - } - static _getElectricCharacters(languageIdentifier) { - try { - return _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_6__["LanguageConfigurationRegistry"].getElectricCharacters(languageIdentifier.id); - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - return null; - } - } - static _getAutoClosingPairs(languageIdentifier) { - try { - return _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_6__["LanguageConfigurationRegistry"].getAutoClosingPairs(languageIdentifier.id); - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - return null; - } - } - static _getShouldAutoClose(languageIdentifier, autoCloseConfig) { - switch (autoCloseConfig) { - case 'beforeWhitespace': - return autoCloseBeforeWhitespace; - case 'languageDefined': - return CursorConfiguration._getLanguageDefinedShouldAutoClose(languageIdentifier); - case 'always': - return autoCloseAlways; - case 'never': - return autoCloseNever; - } - } - static _getLanguageDefinedShouldAutoClose(languageIdentifier) { - try { - const autoCloseBeforeSet = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_6__["LanguageConfigurationRegistry"].getAutoCloseBeforeSet(languageIdentifier.id); - return c => autoCloseBeforeSet.indexOf(c) !== -1; - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - return autoCloseNever; - } - } - static _getSurroundingPairs(languageIdentifier) { - try { - return _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_6__["LanguageConfigurationRegistry"].getSurroundingPairs(languageIdentifier.id); - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - return null; - } - } -} -/** - * Represents the cursor state on either the model or on the view model. - */ -class SingleCursorState { - constructor(selectionStart, selectionStartLeftoverVisibleColumns, position, leftoverVisibleColumns) { - this.selectionStart = selectionStart; - this.selectionStartLeftoverVisibleColumns = selectionStartLeftoverVisibleColumns; - this.position = position; - this.leftoverVisibleColumns = leftoverVisibleColumns; - this.selection = SingleCursorState._computeSelection(this.selectionStart, this.position); - } - equals(other) { - return (this.selectionStartLeftoverVisibleColumns === other.selectionStartLeftoverVisibleColumns - && this.leftoverVisibleColumns === other.leftoverVisibleColumns - && this.position.equals(other.position) - && this.selectionStart.equalsRange(other.selectionStart)); - } - hasSelection() { - return (!this.selection.isEmpty() || !this.selectionStart.isEmpty()); - } - move(inSelectionMode, lineNumber, column, leftoverVisibleColumns) { - if (inSelectionMode) { - // move just position - return new SingleCursorState(this.selectionStart, this.selectionStartLeftoverVisibleColumns, new _core_position_js__WEBPACK_IMPORTED_MODULE_2__["Position"](lineNumber, column), leftoverVisibleColumns); - } - else { - // move everything - return new SingleCursorState(new _core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](lineNumber, column, lineNumber, column), leftoverVisibleColumns, new _core_position_js__WEBPACK_IMPORTED_MODULE_2__["Position"](lineNumber, column), leftoverVisibleColumns); - } - } - static _computeSelection(selectionStart, position) { - let startLineNumber, startColumn, endLineNumber, endColumn; - if (selectionStart.isEmpty()) { - startLineNumber = selectionStart.startLineNumber; - startColumn = selectionStart.startColumn; - endLineNumber = position.lineNumber; - endColumn = position.column; - } - else { - if (position.isBeforeOrEqual(selectionStart.getStartPosition())) { - startLineNumber = selectionStart.endLineNumber; - startColumn = selectionStart.endColumn; - endLineNumber = position.lineNumber; - endColumn = position.column; - } - else { - startLineNumber = selectionStart.startLineNumber; - startColumn = selectionStart.startColumn; - endLineNumber = position.lineNumber; - endColumn = position.column; - } - } - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_4__["Selection"](startLineNumber, startColumn, endLineNumber, endColumn); - } -} -class CursorContext { - constructor(model, coordinatesConverter, cursorConfig) { - this.model = model; - this.coordinatesConverter = coordinatesConverter; - this.cursorConfig = cursorConfig; - } -} -class PartialModelCursorState { - constructor(modelState) { - this.modelState = modelState; - this.viewState = null; - } -} -class PartialViewCursorState { - constructor(viewState) { - this.modelState = null; - this.viewState = viewState; - } -} -class CursorState { - constructor(modelState, viewState) { - this.modelState = modelState; - this.viewState = viewState; - } - static fromModelState(modelState) { - return new PartialModelCursorState(modelState); - } - static fromViewState(viewState) { - return new PartialViewCursorState(viewState); - } - static fromModelSelection(modelSelection) { - const selectionStartLineNumber = modelSelection.selectionStartLineNumber; - const selectionStartColumn = modelSelection.selectionStartColumn; - const positionLineNumber = modelSelection.positionLineNumber; - const positionColumn = modelSelection.positionColumn; - const modelState = new SingleCursorState(new _core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](selectionStartLineNumber, selectionStartColumn, selectionStartLineNumber, selectionStartColumn), 0, new _core_position_js__WEBPACK_IMPORTED_MODULE_2__["Position"](positionLineNumber, positionColumn), 0); - return CursorState.fromModelState(modelState); - } - static fromModelSelections(modelSelections) { - let states = []; - for (let i = 0, len = modelSelections.length; i < len; i++) { - states[i] = this.fromModelSelection(modelSelections[i]); - } - return states; - } - equals(other) { - return (this.viewState.equals(other.viewState) && this.modelState.equals(other.modelState)); - } -} -class EditOperationResult { - constructor(type, commands, opts) { - this.type = type; - this.commands = commands; - this.shouldPushStackElementBefore = opts.shouldPushStackElementBefore; - this.shouldPushStackElementAfter = opts.shouldPushStackElementAfter; - } -} -/** - * Common operations that work and make sense both on the model and on the view model. - */ -class CursorColumns { - static visibleColumnFromColumn(lineContent, column, tabSize) { - const lineContentLength = lineContent.length; - const endOffset = column - 1 < lineContentLength ? column - 1 : lineContentLength; - let result = 0; - let i = 0; - while (i < endOffset) { - const codePoint = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["getNextCodePoint"](lineContent, endOffset, i); - i += (codePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - if (codePoint === 9 /* Tab */) { - result = CursorColumns.nextRenderTabStop(result, tabSize); - } - else { - let graphemeBreakType = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["getGraphemeBreakType"](codePoint); - while (i < endOffset) { - const nextCodePoint = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["getNextCodePoint"](lineContent, endOffset, i); - const nextGraphemeBreakType = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["getGraphemeBreakType"](nextCodePoint); - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["breakBetweenGraphemeBreakType"](graphemeBreakType, nextGraphemeBreakType)) { - break; - } - i += (nextCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - graphemeBreakType = nextGraphemeBreakType; - } - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["isFullWidthCharacter"](codePoint) || _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["isEmojiImprecise"](codePoint)) { - result = result + 2; - } - else { - result = result + 1; - } - } - } - return result; - } - static visibleColumnFromColumn2(config, model, position) { - return this.visibleColumnFromColumn(model.getLineContent(position.lineNumber), position.column, config.tabSize); - } - static columnFromVisibleColumn(lineContent, visibleColumn, tabSize) { - if (visibleColumn <= 0) { - return 1; - } - const lineLength = lineContent.length; - let beforeVisibleColumn = 0; - let beforeColumn = 1; - let i = 0; - while (i < lineLength) { - const codePoint = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["getNextCodePoint"](lineContent, lineLength, i); - i += (codePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - let afterVisibleColumn; - if (codePoint === 9 /* Tab */) { - afterVisibleColumn = CursorColumns.nextRenderTabStop(beforeVisibleColumn, tabSize); - } - else { - let graphemeBreakType = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["getGraphemeBreakType"](codePoint); - while (i < lineLength) { - const nextCodePoint = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["getNextCodePoint"](lineContent, lineLength, i); - const nextGraphemeBreakType = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["getGraphemeBreakType"](nextCodePoint); - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["breakBetweenGraphemeBreakType"](graphemeBreakType, nextGraphemeBreakType)) { - break; - } - i += (nextCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - graphemeBreakType = nextGraphemeBreakType; - } - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["isFullWidthCharacter"](codePoint) || _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["isEmojiImprecise"](codePoint)) { - afterVisibleColumn = beforeVisibleColumn + 2; - } - else { - afterVisibleColumn = beforeVisibleColumn + 1; - } - } - const afterColumn = i + 1; - if (afterVisibleColumn >= visibleColumn) { - const beforeDelta = visibleColumn - beforeVisibleColumn; - const afterDelta = afterVisibleColumn - visibleColumn; - if (afterDelta < beforeDelta) { - return afterColumn; - } - else { - return beforeColumn; - } - } - beforeVisibleColumn = afterVisibleColumn; - beforeColumn = afterColumn; - } - // walked the entire string - return lineLength + 1; - } - static columnFromVisibleColumn2(config, model, lineNumber, visibleColumn) { - let result = this.columnFromVisibleColumn(model.getLineContent(lineNumber), visibleColumn, config.tabSize); - let minColumn = model.getLineMinColumn(lineNumber); - if (result < minColumn) { - return minColumn; - } - let maxColumn = model.getLineMaxColumn(lineNumber); - if (result > maxColumn) { - return maxColumn; - } - return result; - } - /** - * ATTENTION: This works with 0-based columns (as oposed to the regular 1-based columns) - */ - static nextRenderTabStop(visibleColumn, tabSize) { - return visibleColumn + tabSize - visibleColumn % tabSize; - } - /** - * ATTENTION: This works with 0-based columns (as oposed to the regular 1-based columns) - */ - static nextIndentTabStop(visibleColumn, indentSize) { - return visibleColumn + indentSize - visibleColumn % indentSize; - } - /** - * ATTENTION: This works with 0-based columns (as oposed to the regular 1-based columns) - */ - static prevRenderTabStop(column, tabSize) { - return column - 1 - (column - 1) % tabSize; - } - /** - * ATTENTION: This works with 0-based columns (as oposed to the regular 1-based columns) - */ - static prevIndentTabStop(column, indentSize) { - return column - 1 - (column - 1) % indentSize; - } -} -function isQuote(ch) { - return (ch === '\'' || ch === '"' || ch === '`'); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorDeleteOperations.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorDeleteOperations.js ***! - \**********************************************************************************************/ -/*! exports provided: DeleteOperations */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteOperations", function() { return DeleteOperations; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands/replaceCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/common/commands/replaceCommand.js"); -/* harmony import */ var _cursorCommon_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cursorMoveOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorMoveOperations.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -class DeleteOperations { - static deleteRight(prevEditOperationType, config, model, selections) { - let commands = []; - let shouldPushStackElementBefore = (prevEditOperationType !== 3 /* DeletingRight */); - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - let deleteSelection = selection; - if (deleteSelection.isEmpty()) { - let position = selection.getPosition(); - let rightOfPosition = _cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_3__["MoveOperations"].right(config, model, position.lineNumber, position.column); - deleteSelection = new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](rightOfPosition.lineNumber, rightOfPosition.column, position.lineNumber, position.column); - } - if (deleteSelection.isEmpty()) { - // Probably at end of file => ignore - commands[i] = null; - continue; - } - if (deleteSelection.startLineNumber !== deleteSelection.endLineNumber) { - shouldPushStackElementBefore = true; - } - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_1__["ReplaceCommand"](deleteSelection, ''); - } - return [shouldPushStackElementBefore, commands]; - } - static _isAutoClosingPairDelete(config, model, selections) { - if (config.autoClosingBrackets === 'never' && config.autoClosingQuotes === 'never') { - return false; - } - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - const position = selection.getPosition(); - if (!selection.isEmpty()) { - return false; - } - const lineText = model.getLineContent(position.lineNumber); - const character = lineText[position.column - 2]; - const autoClosingPairCandidates = config.autoClosingPairsOpen2.get(character); - if (!autoClosingPairCandidates) { - return false; - } - if (Object(_cursorCommon_js__WEBPACK_IMPORTED_MODULE_2__["isQuote"])(character)) { - if (config.autoClosingQuotes === 'never') { - return false; - } - } - else { - if (config.autoClosingBrackets === 'never') { - return false; - } - } - const afterCharacter = lineText[position.column - 1]; - let foundAutoClosingPair = false; - for (const autoClosingPairCandidate of autoClosingPairCandidates) { - if (autoClosingPairCandidate.open === character && autoClosingPairCandidate.close === afterCharacter) { - foundAutoClosingPair = true; - } - } - if (!foundAutoClosingPair) { - return false; - } - } - return true; - } - static _runAutoClosingPairDelete(config, model, selections) { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - const position = selections[i].getPosition(); - const deleteSelection = new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](position.lineNumber, position.column - 1, position.lineNumber, position.column + 1); - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_1__["ReplaceCommand"](deleteSelection, ''); - } - return [true, commands]; - } - static deleteLeft(prevEditOperationType, config, model, selections) { - if (this._isAutoClosingPairDelete(config, model, selections)) { - return this._runAutoClosingPairDelete(config, model, selections); - } - let commands = []; - let shouldPushStackElementBefore = (prevEditOperationType !== 2 /* DeletingLeft */); - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - let deleteSelection = selection; - if (deleteSelection.isEmpty()) { - let position = selection.getPosition(); - if (config.useTabStops && position.column > 1) { - let lineContent = model.getLineContent(position.lineNumber); - let firstNonWhitespaceIndex = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["firstNonWhitespaceIndex"](lineContent); - let lastIndentationColumn = (firstNonWhitespaceIndex === -1 - ? /* entire string is whitespace */ lineContent.length + 1 - : firstNonWhitespaceIndex + 1); - if (position.column <= lastIndentationColumn) { - let fromVisibleColumn = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_2__["CursorColumns"].visibleColumnFromColumn2(config, model, position); - let toVisibleColumn = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_2__["CursorColumns"].prevIndentTabStop(fromVisibleColumn, config.indentSize); - let toColumn = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_2__["CursorColumns"].columnFromVisibleColumn2(config, model, position.lineNumber, toVisibleColumn); - deleteSelection = new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](position.lineNumber, toColumn, position.lineNumber, position.column); - } - else { - deleteSelection = new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](position.lineNumber, position.column - 1, position.lineNumber, position.column); - } - } - else { - let leftOfPosition = _cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_3__["MoveOperations"].left(config, model, position.lineNumber, position.column); - deleteSelection = new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](leftOfPosition.lineNumber, leftOfPosition.column, position.lineNumber, position.column); - } - } - if (deleteSelection.isEmpty()) { - // Probably at beginning of file => ignore - commands[i] = null; - continue; - } - if (deleteSelection.startLineNumber !== deleteSelection.endLineNumber) { - shouldPushStackElementBefore = true; - } - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_1__["ReplaceCommand"](deleteSelection, ''); - } - return [shouldPushStackElementBefore, commands]; - } - static cut(config, model, selections) { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - if (selection.isEmpty()) { - if (config.emptySelectionClipboard) { - // This is a full line cut - let position = selection.getPosition(); - let startLineNumber, startColumn, endLineNumber, endColumn; - if (position.lineNumber < model.getLineCount()) { - // Cutting a line in the middle of the model - startLineNumber = position.lineNumber; - startColumn = 1; - endLineNumber = position.lineNumber + 1; - endColumn = 1; - } - else if (position.lineNumber > 1) { - // Cutting the last line & there are more than 1 lines in the model - startLineNumber = position.lineNumber - 1; - startColumn = model.getLineMaxColumn(position.lineNumber - 1); - endLineNumber = position.lineNumber; - endColumn = model.getLineMaxColumn(position.lineNumber); - } - else { - // Cutting the single line that the model contains - startLineNumber = position.lineNumber; - startColumn = 1; - endLineNumber = position.lineNumber; - endColumn = model.getLineMaxColumn(position.lineNumber); - } - let deleteSelection = new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](startLineNumber, startColumn, endLineNumber, endColumn); - if (!deleteSelection.isEmpty()) { - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_1__["ReplaceCommand"](deleteSelection, ''); - } - else { - commands[i] = null; - } - } - else { - // Cannot cut empty selection - commands[i] = null; - } - } - else { - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_1__["ReplaceCommand"](selection, ''); - } - } - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_2__["EditOperationResult"](0 /* Other */, commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: true - }); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorMoveCommands.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorMoveCommands.js ***! - \******************************************************************************************/ -/*! exports provided: CursorMoveCommands, CursorMove */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorMoveCommands", function() { return CursorMoveCommands; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorMove", function() { return CursorMove; }); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cursorMoveOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorMoveOperations.js"); -/* harmony import */ var _cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cursorWordOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorWordOperations.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -class CursorMoveCommands { - static addCursorDown(viewModel, cursors, useLogicalLine) { - let result = [], resultLen = 0; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - result[resultLen++] = new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"](cursor.modelState, cursor.viewState); - if (useLogicalLine) { - result[resultLen++] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].translateDown(viewModel.cursorConfig, viewModel.model, cursor.modelState)); - } - else { - result[resultLen++] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].translateDown(viewModel.cursorConfig, viewModel, cursor.viewState)); - } - } - return result; - } - static addCursorUp(viewModel, cursors, useLogicalLine) { - let result = [], resultLen = 0; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - result[resultLen++] = new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"](cursor.modelState, cursor.viewState); - if (useLogicalLine) { - result[resultLen++] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].translateUp(viewModel.cursorConfig, viewModel.model, cursor.modelState)); - } - else { - result[resultLen++] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].translateUp(viewModel.cursorConfig, viewModel, cursor.viewState)); - } - } - return result; - } - static moveToBeginningOfLine(viewModel, cursors, inSelectionMode) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - result[i] = this._moveToLineStart(viewModel, cursor, inSelectionMode); - } - return result; - } - static _moveToLineStart(viewModel, cursor, inSelectionMode) { - const currentViewStateColumn = cursor.viewState.position.column; - const currentModelStateColumn = cursor.modelState.position.column; - const isFirstLineOfWrappedLine = currentViewStateColumn === currentModelStateColumn; - const currentViewStatelineNumber = cursor.viewState.position.lineNumber; - const firstNonBlankColumn = viewModel.getLineFirstNonWhitespaceColumn(currentViewStatelineNumber); - const isBeginningOfViewLine = currentViewStateColumn === firstNonBlankColumn; - if (!isFirstLineOfWrappedLine && !isBeginningOfViewLine) { - return this._moveToLineStartByView(viewModel, cursor, inSelectionMode); - } - else { - return this._moveToLineStartByModel(viewModel, cursor, inSelectionMode); - } - } - static _moveToLineStartByView(viewModel, cursor, inSelectionMode) { - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveToBeginningOfLine(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode)); - } - static _moveToLineStartByModel(viewModel, cursor, inSelectionMode) { - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveToBeginningOfLine(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode)); - } - static moveToEndOfLine(viewModel, cursors, inSelectionMode, sticky) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - result[i] = this._moveToLineEnd(viewModel, cursor, inSelectionMode, sticky); - } - return result; - } - static _moveToLineEnd(viewModel, cursor, inSelectionMode, sticky) { - const viewStatePosition = cursor.viewState.position; - const viewModelMaxColumn = viewModel.getLineMaxColumn(viewStatePosition.lineNumber); - const isEndOfViewLine = viewStatePosition.column === viewModelMaxColumn; - const modelStatePosition = cursor.modelState.position; - const modelMaxColumn = viewModel.model.getLineMaxColumn(modelStatePosition.lineNumber); - const isEndLineOfWrappedLine = viewModelMaxColumn - viewStatePosition.column === modelMaxColumn - modelStatePosition.column; - if (isEndOfViewLine || isEndLineOfWrappedLine) { - return this._moveToLineEndByModel(viewModel, cursor, inSelectionMode, sticky); - } - else { - return this._moveToLineEndByView(viewModel, cursor, inSelectionMode, sticky); - } - } - static _moveToLineEndByView(viewModel, cursor, inSelectionMode, sticky) { - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveToEndOfLine(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, sticky)); - } - static _moveToLineEndByModel(viewModel, cursor, inSelectionMode, sticky) { - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveToEndOfLine(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode, sticky)); - } - static expandLineSelection(viewModel, cursors) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const startLineNumber = cursor.modelState.selection.startLineNumber; - const lineCount = viewModel.model.getLineCount(); - let endLineNumber = cursor.modelState.selection.endLineNumber; - let endColumn; - if (endLineNumber === lineCount) { - endColumn = viewModel.model.getLineMaxColumn(lineCount); - } - else { - endLineNumber++; - endColumn = 1; - } - result[i] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["SingleCursorState"](new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](startLineNumber, 1, startLineNumber, 1), 0, new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](endLineNumber, endColumn), 0)); - } - return result; - } - static moveToBeginningOfBuffer(viewModel, cursors, inSelectionMode) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - result[i] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveToBeginningOfBuffer(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode)); - } - return result; - } - static moveToEndOfBuffer(viewModel, cursors, inSelectionMode) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - result[i] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveToEndOfBuffer(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode)); - } - return result; - } - static selectAll(viewModel, cursor) { - const lineCount = viewModel.model.getLineCount(); - const maxColumn = viewModel.model.getLineMaxColumn(lineCount); - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["SingleCursorState"](new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](1, 1, 1, 1), 0, new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](lineCount, maxColumn), 0)); - } - static line(viewModel, cursor, inSelectionMode, _position, _viewPosition) { - const position = viewModel.model.validatePosition(_position); - const viewPosition = (_viewPosition - ? viewModel.coordinatesConverter.validateViewPosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](_viewPosition.lineNumber, _viewPosition.column), position) - : viewModel.coordinatesConverter.convertModelPositionToViewPosition(position)); - if (!inSelectionMode || !cursor.modelState.hasSelection()) { - // Entering line selection for the first time - const lineCount = viewModel.model.getLineCount(); - let selectToLineNumber = position.lineNumber + 1; - let selectToColumn = 1; - if (selectToLineNumber > lineCount) { - selectToLineNumber = lineCount; - selectToColumn = viewModel.model.getLineMaxColumn(selectToLineNumber); - } - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["SingleCursorState"](new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](position.lineNumber, 1, selectToLineNumber, selectToColumn), 0, new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](selectToLineNumber, selectToColumn), 0)); - } - // Continuing line selection - const enteringLineNumber = cursor.modelState.selectionStart.getStartPosition().lineNumber; - if (position.lineNumber < enteringLineNumber) { - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(cursor.viewState.move(cursor.modelState.hasSelection(), viewPosition.lineNumber, 1, 0)); - } - else if (position.lineNumber > enteringLineNumber) { - const lineCount = viewModel.getLineCount(); - let selectToViewLineNumber = viewPosition.lineNumber + 1; - let selectToViewColumn = 1; - if (selectToViewLineNumber > lineCount) { - selectToViewLineNumber = lineCount; - selectToViewColumn = viewModel.getLineMaxColumn(selectToViewLineNumber); - } - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(cursor.viewState.move(cursor.modelState.hasSelection(), selectToViewLineNumber, selectToViewColumn, 0)); - } - else { - const endPositionOfSelectionStart = cursor.modelState.selectionStart.getEndPosition(); - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(cursor.modelState.move(cursor.modelState.hasSelection(), endPositionOfSelectionStart.lineNumber, endPositionOfSelectionStart.column, 0)); - } - } - static word(viewModel, cursor, inSelectionMode, _position) { - const position = viewModel.model.validatePosition(_position); - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_3__["WordOperations"].word(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode, position)); - } - static cancelSelection(viewModel, cursor) { - if (!cursor.modelState.hasSelection()) { - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"](cursor.modelState, cursor.viewState); - } - const lineNumber = cursor.viewState.position.lineNumber; - const column = cursor.viewState.position.column; - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["SingleCursorState"](new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](lineNumber, column, lineNumber, column), 0, new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](lineNumber, column), 0)); - } - static moveTo(viewModel, cursor, inSelectionMode, _position, _viewPosition) { - const position = viewModel.model.validatePosition(_position); - const viewPosition = (_viewPosition - ? viewModel.coordinatesConverter.validateViewPosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](_viewPosition.lineNumber, _viewPosition.column), position) - : viewModel.coordinatesConverter.convertModelPositionToViewPosition(position)); - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(cursor.viewState.move(inSelectionMode, viewPosition.lineNumber, viewPosition.column, 0)); - } - static simpleMove(viewModel, cursors, direction, inSelectionMode, value, unit) { - switch (direction) { - case 0 /* Left */: { - if (unit === 4 /* HalfLine */) { - // Move left by half the current line length - return this._moveHalfLineLeft(viewModel, cursors, inSelectionMode); - } - else { - // Move left by `moveParams.value` columns - return this._moveLeft(viewModel, cursors, inSelectionMode, value); - } - } - case 1 /* Right */: { - if (unit === 4 /* HalfLine */) { - // Move right by half the current line length - return this._moveHalfLineRight(viewModel, cursors, inSelectionMode); - } - else { - // Move right by `moveParams.value` columns - return this._moveRight(viewModel, cursors, inSelectionMode, value); - } - } - case 2 /* Up */: { - if (unit === 2 /* WrappedLine */) { - // Move up by view lines - return this._moveUpByViewLines(viewModel, cursors, inSelectionMode, value); - } - else { - // Move up by model lines - return this._moveUpByModelLines(viewModel, cursors, inSelectionMode, value); - } - } - case 3 /* Down */: { - if (unit === 2 /* WrappedLine */) { - // Move down by view lines - return this._moveDownByViewLines(viewModel, cursors, inSelectionMode, value); - } - else { - // Move down by model lines - return this._moveDownByModelLines(viewModel, cursors, inSelectionMode, value); - } - } - case 4 /* WrappedLineStart */: { - // Move to the beginning of the current view line - return this._moveToViewMinColumn(viewModel, cursors, inSelectionMode); - } - case 5 /* WrappedLineFirstNonWhitespaceCharacter */: { - // Move to the first non-whitespace column of the current view line - return this._moveToViewFirstNonWhitespaceColumn(viewModel, cursors, inSelectionMode); - } - case 6 /* WrappedLineColumnCenter */: { - // Move to the "center" of the current view line - return this._moveToViewCenterColumn(viewModel, cursors, inSelectionMode); - } - case 7 /* WrappedLineEnd */: { - // Move to the end of the current view line - return this._moveToViewMaxColumn(viewModel, cursors, inSelectionMode); - } - case 8 /* WrappedLineLastNonWhitespaceCharacter */: { - // Move to the last non-whitespace column of the current view line - return this._moveToViewLastNonWhitespaceColumn(viewModel, cursors, inSelectionMode); - } - default: - return null; - } - } - static viewportMove(viewModel, cursors, direction, inSelectionMode, value) { - const visibleViewRange = viewModel.getCompletelyVisibleViewRange(); - const visibleModelRange = viewModel.coordinatesConverter.convertViewRangeToModelRange(visibleViewRange); - switch (direction) { - case 9 /* ViewPortTop */: { - // Move to the nth line start in the viewport (from the top) - const modelLineNumber = this._firstLineNumberInRange(viewModel.model, visibleModelRange, value); - const modelColumn = viewModel.model.getLineFirstNonWhitespaceColumn(modelLineNumber); - return [this._moveToModelPosition(viewModel, cursors[0], inSelectionMode, modelLineNumber, modelColumn)]; - } - case 11 /* ViewPortBottom */: { - // Move to the nth line start in the viewport (from the bottom) - const modelLineNumber = this._lastLineNumberInRange(viewModel.model, visibleModelRange, value); - const modelColumn = viewModel.model.getLineFirstNonWhitespaceColumn(modelLineNumber); - return [this._moveToModelPosition(viewModel, cursors[0], inSelectionMode, modelLineNumber, modelColumn)]; - } - case 10 /* ViewPortCenter */: { - // Move to the line start in the viewport center - const modelLineNumber = Math.round((visibleModelRange.startLineNumber + visibleModelRange.endLineNumber) / 2); - const modelColumn = viewModel.model.getLineFirstNonWhitespaceColumn(modelLineNumber); - return [this._moveToModelPosition(viewModel, cursors[0], inSelectionMode, modelLineNumber, modelColumn)]; - } - case 12 /* ViewPortIfOutside */: { - // Move to a position inside the viewport - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - result[i] = this.findPositionInViewportIfOutside(viewModel, cursor, visibleViewRange, inSelectionMode); - } - return result; - } - default: - return null; - } - } - static findPositionInViewportIfOutside(viewModel, cursor, visibleViewRange, inSelectionMode) { - let viewLineNumber = cursor.viewState.position.lineNumber; - if (visibleViewRange.startLineNumber <= viewLineNumber && viewLineNumber <= visibleViewRange.endLineNumber - 1) { - // Nothing to do, cursor is in viewport - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"](cursor.modelState, cursor.viewState); - } - else { - if (viewLineNumber > visibleViewRange.endLineNumber - 1) { - viewLineNumber = visibleViewRange.endLineNumber - 1; - } - if (viewLineNumber < visibleViewRange.startLineNumber) { - viewLineNumber = visibleViewRange.startLineNumber; - } - const viewColumn = viewModel.getLineFirstNonWhitespaceColumn(viewLineNumber); - return this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn); - } - } - /** - * Find the nth line start included in the range (from the start). - */ - static _firstLineNumberInRange(model, range, count) { - let startLineNumber = range.startLineNumber; - if (range.startColumn !== model.getLineMinColumn(startLineNumber)) { - // Move on to the second line if the first line start is not included in the range - startLineNumber++; - } - return Math.min(range.endLineNumber, startLineNumber + count - 1); - } - /** - * Find the nth line start included in the range (from the end). - */ - static _lastLineNumberInRange(model, range, count) { - let startLineNumber = range.startLineNumber; - if (range.startColumn !== model.getLineMinColumn(startLineNumber)) { - // Move on to the second line if the first line start is not included in the range - startLineNumber++; - } - return Math.max(startLineNumber, range.endLineNumber - count + 1); - } - static _moveLeft(viewModel, cursors, inSelectionMode, noOfColumns) { - const hasMultipleCursors = (cursors.length > 1); - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const skipWrappingPointStop = hasMultipleCursors || !cursor.viewState.hasSelection(); - let newViewState = _cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveLeft(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, noOfColumns); - if (skipWrappingPointStop && noOfColumns === 1 && newViewState.position.lineNumber !== cursor.viewState.position.lineNumber) { - // moved over to the previous view line - const newViewModelPosition = viewModel.coordinatesConverter.convertViewPositionToModelPosition(newViewState.position); - if (newViewModelPosition.lineNumber === cursor.modelState.position.lineNumber) { - // stayed on the same model line => pass wrapping point where 2 view positions map to a single model position - newViewState = _cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveLeft(viewModel.cursorConfig, viewModel, newViewState, inSelectionMode, 1); - } - } - result[i] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(newViewState); - } - return result; - } - static _moveHalfLineLeft(viewModel, cursors, inSelectionMode) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const viewLineNumber = cursor.viewState.position.lineNumber; - const halfLine = Math.round(viewModel.getLineContent(viewLineNumber).length / 2); - result[i] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveLeft(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, halfLine)); - } - return result; - } - static _moveRight(viewModel, cursors, inSelectionMode, noOfColumns) { - const hasMultipleCursors = (cursors.length > 1); - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const skipWrappingPointStop = hasMultipleCursors || !cursor.viewState.hasSelection(); - let newViewState = _cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveRight(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, noOfColumns); - if (skipWrappingPointStop && noOfColumns === 1 && newViewState.position.lineNumber !== cursor.viewState.position.lineNumber) { - // moved over to the next view line - const newViewModelPosition = viewModel.coordinatesConverter.convertViewPositionToModelPosition(newViewState.position); - if (newViewModelPosition.lineNumber === cursor.modelState.position.lineNumber) { - // stayed on the same model line => pass wrapping point where 2 view positions map to a single model position - newViewState = _cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveRight(viewModel.cursorConfig, viewModel, newViewState, inSelectionMode, 1); - } - } - result[i] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(newViewState); - } - return result; - } - static _moveHalfLineRight(viewModel, cursors, inSelectionMode) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const viewLineNumber = cursor.viewState.position.lineNumber; - const halfLine = Math.round(viewModel.getLineContent(viewLineNumber).length / 2); - result[i] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveRight(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, halfLine)); - } - return result; - } - static _moveDownByViewLines(viewModel, cursors, inSelectionMode, linesCount) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - result[i] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveDown(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, linesCount)); - } - return result; - } - static _moveDownByModelLines(viewModel, cursors, inSelectionMode, linesCount) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - result[i] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveDown(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode, linesCount)); - } - return result; - } - static _moveUpByViewLines(viewModel, cursors, inSelectionMode, linesCount) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - result[i] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveUp(viewModel.cursorConfig, viewModel, cursor.viewState, inSelectionMode, linesCount)); - } - return result; - } - static _moveUpByModelLines(viewModel, cursors, inSelectionMode, linesCount) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - result[i] = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_2__["MoveOperations"].moveUp(viewModel.cursorConfig, viewModel.model, cursor.modelState, inSelectionMode, linesCount)); - } - return result; - } - static _moveToViewPosition(viewModel, cursor, inSelectionMode, toViewLineNumber, toViewColumn) { - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromViewState(cursor.viewState.move(inSelectionMode, toViewLineNumber, toViewColumn, 0)); - } - static _moveToModelPosition(viewModel, cursor, inSelectionMode, toModelLineNumber, toModelColumn) { - return _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["CursorState"].fromModelState(cursor.modelState.move(inSelectionMode, toModelLineNumber, toModelColumn, 0)); - } - static _moveToViewMinColumn(viewModel, cursors, inSelectionMode) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const viewLineNumber = cursor.viewState.position.lineNumber; - const viewColumn = viewModel.getLineMinColumn(viewLineNumber); - result[i] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn); - } - return result; - } - static _moveToViewFirstNonWhitespaceColumn(viewModel, cursors, inSelectionMode) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const viewLineNumber = cursor.viewState.position.lineNumber; - const viewColumn = viewModel.getLineFirstNonWhitespaceColumn(viewLineNumber); - result[i] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn); - } - return result; - } - static _moveToViewCenterColumn(viewModel, cursors, inSelectionMode) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const viewLineNumber = cursor.viewState.position.lineNumber; - const viewColumn = Math.round((viewModel.getLineMaxColumn(viewLineNumber) + viewModel.getLineMinColumn(viewLineNumber)) / 2); - result[i] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn); - } - return result; - } - static _moveToViewMaxColumn(viewModel, cursors, inSelectionMode) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const viewLineNumber = cursor.viewState.position.lineNumber; - const viewColumn = viewModel.getLineMaxColumn(viewLineNumber); - result[i] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn); - } - return result; - } - static _moveToViewLastNonWhitespaceColumn(viewModel, cursors, inSelectionMode) { - let result = []; - for (let i = 0, len = cursors.length; i < len; i++) { - const cursor = cursors[i]; - const viewLineNumber = cursor.viewState.position.lineNumber; - const viewColumn = viewModel.getLineLastNonWhitespaceColumn(viewLineNumber); - result[i] = this._moveToViewPosition(viewModel, cursor, inSelectionMode, viewLineNumber, viewColumn); - } - return result; - } -} -var CursorMove; -(function (CursorMove) { - const isCursorMoveArgs = function (arg) { - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_0__["isObject"](arg)) { - return false; - } - let cursorMoveArg = arg; - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_0__["isString"](cursorMoveArg.to)) { - return false; - } - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_0__["isUndefined"](cursorMoveArg.select) && !_base_common_types_js__WEBPACK_IMPORTED_MODULE_0__["isBoolean"](cursorMoveArg.select)) { - return false; - } - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_0__["isUndefined"](cursorMoveArg.by) && !_base_common_types_js__WEBPACK_IMPORTED_MODULE_0__["isString"](cursorMoveArg.by)) { - return false; - } - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_0__["isUndefined"](cursorMoveArg.value) && !_base_common_types_js__WEBPACK_IMPORTED_MODULE_0__["isNumber"](cursorMoveArg.value)) { - return false; - } - return true; - }; - CursorMove.description = { - description: 'Move cursor to a logical position in the view', - args: [ - { - name: 'Cursor move argument object', - description: `Property-value pairs that can be passed through this argument: - * 'to': A mandatory logical position value providing where to move the cursor. - \`\`\` - 'left', 'right', 'up', 'down' - 'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter' - 'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter' - 'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside' - \`\`\` - * 'by': Unit to move. Default is computed based on 'to' value. - \`\`\` - 'line', 'wrappedLine', 'character', 'halfLine' - \`\`\` - * 'value': Number of units to move. Default is '1'. - * 'select': If 'true' makes the selection. Default is 'false'. - `, - constraint: isCursorMoveArgs, - schema: { - 'type': 'object', - 'required': ['to'], - 'properties': { - 'to': { - 'type': 'string', - 'enum': ['left', 'right', 'up', 'down', 'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter', 'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter', 'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'] - }, - 'by': { - 'type': 'string', - 'enum': ['line', 'wrappedLine', 'character', 'halfLine'] - }, - 'value': { - 'type': 'number', - 'default': 1 - }, - 'select': { - 'type': 'boolean', - 'default': false - } - } - } - } - ] - }; - /** - * Positions in the view for cursor move command. - */ - CursorMove.RawDirection = { - Left: 'left', - Right: 'right', - Up: 'up', - Down: 'down', - WrappedLineStart: 'wrappedLineStart', - WrappedLineFirstNonWhitespaceCharacter: 'wrappedLineFirstNonWhitespaceCharacter', - WrappedLineColumnCenter: 'wrappedLineColumnCenter', - WrappedLineEnd: 'wrappedLineEnd', - WrappedLineLastNonWhitespaceCharacter: 'wrappedLineLastNonWhitespaceCharacter', - ViewPortTop: 'viewPortTop', - ViewPortCenter: 'viewPortCenter', - ViewPortBottom: 'viewPortBottom', - ViewPortIfOutside: 'viewPortIfOutside' - }; - /** - * Units for Cursor move 'by' argument - */ - CursorMove.RawUnit = { - Line: 'line', - WrappedLine: 'wrappedLine', - Character: 'character', - HalfLine: 'halfLine' - }; - function parse(args) { - if (!args.to) { - // illegal arguments - return null; - } - let direction; - switch (args.to) { - case CursorMove.RawDirection.Left: - direction = 0 /* Left */; - break; - case CursorMove.RawDirection.Right: - direction = 1 /* Right */; - break; - case CursorMove.RawDirection.Up: - direction = 2 /* Up */; - break; - case CursorMove.RawDirection.Down: - direction = 3 /* Down */; - break; - case CursorMove.RawDirection.WrappedLineStart: - direction = 4 /* WrappedLineStart */; - break; - case CursorMove.RawDirection.WrappedLineFirstNonWhitespaceCharacter: - direction = 5 /* WrappedLineFirstNonWhitespaceCharacter */; - break; - case CursorMove.RawDirection.WrappedLineColumnCenter: - direction = 6 /* WrappedLineColumnCenter */; - break; - case CursorMove.RawDirection.WrappedLineEnd: - direction = 7 /* WrappedLineEnd */; - break; - case CursorMove.RawDirection.WrappedLineLastNonWhitespaceCharacter: - direction = 8 /* WrappedLineLastNonWhitespaceCharacter */; - break; - case CursorMove.RawDirection.ViewPortTop: - direction = 9 /* ViewPortTop */; - break; - case CursorMove.RawDirection.ViewPortBottom: - direction = 11 /* ViewPortBottom */; - break; - case CursorMove.RawDirection.ViewPortCenter: - direction = 10 /* ViewPortCenter */; - break; - case CursorMove.RawDirection.ViewPortIfOutside: - direction = 12 /* ViewPortIfOutside */; - break; - default: - // illegal arguments - return null; - } - let unit = 0 /* None */; - switch (args.by) { - case CursorMove.RawUnit.Line: - unit = 1 /* Line */; - break; - case CursorMove.RawUnit.WrappedLine: - unit = 2 /* WrappedLine */; - break; - case CursorMove.RawUnit.Character: - unit = 3 /* Character */; - break; - case CursorMove.RawUnit.HalfLine: - unit = 4 /* HalfLine */; - break; - } - return { - direction: direction, - unit: unit, - select: (!!args.select), - value: (args.value || 1) - }; - } - CursorMove.parse = parse; -})(CursorMove || (CursorMove = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorMoveOperations.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorMoveOperations.js ***! - \********************************************************************************************/ -/*! exports provided: CursorPosition, MoveOperations */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorPosition", function() { return CursorPosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MoveOperations", function() { return MoveOperations; }); -/* harmony import */ var _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class CursorPosition { - constructor(lineNumber, column, leftoverVisibleColumns) { - this.lineNumber = lineNumber; - this.column = column; - this.leftoverVisibleColumns = leftoverVisibleColumns; - } -} -class MoveOperations { - static leftPosition(model, lineNumber, column) { - if (column > model.getLineMinColumn(lineNumber)) { - column = column - _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["prevCharLength"](model.getLineContent(lineNumber), column - 1); - } - else if (lineNumber > 1) { - lineNumber = lineNumber - 1; - column = model.getLineMaxColumn(lineNumber); - } - return new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](lineNumber, column); - } - static left(config, model, lineNumber, column) { - const pos = MoveOperations.leftPosition(model, lineNumber, column); - return new CursorPosition(pos.lineNumber, pos.column, 0); - } - static moveLeft(config, model, cursor, inSelectionMode, noOfColumns) { - let lineNumber, column; - if (cursor.hasSelection() && !inSelectionMode) { - // If we are in selection mode, move left without selection cancels selection and puts cursor at the beginning of the selection - lineNumber = cursor.selection.startLineNumber; - column = cursor.selection.startColumn; - } - else { - let r = MoveOperations.left(config, model, cursor.position.lineNumber, cursor.position.column - (noOfColumns - 1)); - lineNumber = r.lineNumber; - column = r.column; - } - return cursor.move(inSelectionMode, lineNumber, column, 0); - } - static rightPosition(model, lineNumber, column) { - if (column < model.getLineMaxColumn(lineNumber)) { - column = column + _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["nextCharLength"](model.getLineContent(lineNumber), column - 1); - } - else if (lineNumber < model.getLineCount()) { - lineNumber = lineNumber + 1; - column = model.getLineMinColumn(lineNumber); - } - return new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](lineNumber, column); - } - static right(config, model, lineNumber, column) { - const pos = MoveOperations.rightPosition(model, lineNumber, column); - return new CursorPosition(pos.lineNumber, pos.column, 0); - } - static moveRight(config, model, cursor, inSelectionMode, noOfColumns) { - let lineNumber, column; - if (cursor.hasSelection() && !inSelectionMode) { - // If we are in selection mode, move right without selection cancels selection and puts cursor at the end of the selection - lineNumber = cursor.selection.endLineNumber; - column = cursor.selection.endColumn; - } - else { - let r = MoveOperations.right(config, model, cursor.position.lineNumber, cursor.position.column + (noOfColumns - 1)); - lineNumber = r.lineNumber; - column = r.column; - } - return cursor.move(inSelectionMode, lineNumber, column, 0); - } - static down(config, model, lineNumber, column, leftoverVisibleColumns, count, allowMoveOnLastLine) { - const currentVisibleColumn = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorColumns"].visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize) + leftoverVisibleColumns; - const lineCount = model.getLineCount(); - const wasOnLastPosition = (lineNumber === lineCount && column === model.getLineMaxColumn(lineNumber)); - lineNumber = lineNumber + count; - if (lineNumber > lineCount) { - lineNumber = lineCount; - if (allowMoveOnLastLine) { - column = model.getLineMaxColumn(lineNumber); - } - else { - column = Math.min(model.getLineMaxColumn(lineNumber), column); - } - } - else { - column = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorColumns"].columnFromVisibleColumn2(config, model, lineNumber, currentVisibleColumn); - } - if (wasOnLastPosition) { - leftoverVisibleColumns = 0; - } - else { - leftoverVisibleColumns = currentVisibleColumn - _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorColumns"].visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize); - } - return new CursorPosition(lineNumber, column, leftoverVisibleColumns); - } - static moveDown(config, model, cursor, inSelectionMode, linesCount) { - let lineNumber, column; - if (cursor.hasSelection() && !inSelectionMode) { - // If we are in selection mode, move down acts relative to the end of selection - lineNumber = cursor.selection.endLineNumber; - column = cursor.selection.endColumn; - } - else { - lineNumber = cursor.position.lineNumber; - column = cursor.position.column; - } - let r = MoveOperations.down(config, model, lineNumber, column, cursor.leftoverVisibleColumns, linesCount, true); - return cursor.move(inSelectionMode, r.lineNumber, r.column, r.leftoverVisibleColumns); - } - static translateDown(config, model, cursor) { - let selection = cursor.selection; - let selectionStart = MoveOperations.down(config, model, selection.selectionStartLineNumber, selection.selectionStartColumn, cursor.selectionStartLeftoverVisibleColumns, 1, false); - let position = MoveOperations.down(config, model, selection.positionLineNumber, selection.positionColumn, cursor.leftoverVisibleColumns, 1, false); - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["SingleCursorState"](new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](selectionStart.lineNumber, selectionStart.column, selectionStart.lineNumber, selectionStart.column), selectionStart.leftoverVisibleColumns, new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](position.lineNumber, position.column), position.leftoverVisibleColumns); - } - static up(config, model, lineNumber, column, leftoverVisibleColumns, count, allowMoveOnFirstLine) { - const currentVisibleColumn = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorColumns"].visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize) + leftoverVisibleColumns; - const wasOnFirstPosition = (lineNumber === 1 && column === 1); - lineNumber = lineNumber - count; - if (lineNumber < 1) { - lineNumber = 1; - if (allowMoveOnFirstLine) { - column = model.getLineMinColumn(lineNumber); - } - else { - column = Math.min(model.getLineMaxColumn(lineNumber), column); - } - } - else { - column = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorColumns"].columnFromVisibleColumn2(config, model, lineNumber, currentVisibleColumn); - } - if (wasOnFirstPosition) { - leftoverVisibleColumns = 0; - } - else { - leftoverVisibleColumns = currentVisibleColumn - _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorColumns"].visibleColumnFromColumn(model.getLineContent(lineNumber), column, config.tabSize); - } - return new CursorPosition(lineNumber, column, leftoverVisibleColumns); - } - static moveUp(config, model, cursor, inSelectionMode, linesCount) { - let lineNumber, column; - if (cursor.hasSelection() && !inSelectionMode) { - // If we are in selection mode, move up acts relative to the beginning of selection - lineNumber = cursor.selection.startLineNumber; - column = cursor.selection.startColumn; - } - else { - lineNumber = cursor.position.lineNumber; - column = cursor.position.column; - } - let r = MoveOperations.up(config, model, lineNumber, column, cursor.leftoverVisibleColumns, linesCount, true); - return cursor.move(inSelectionMode, r.lineNumber, r.column, r.leftoverVisibleColumns); - } - static translateUp(config, model, cursor) { - let selection = cursor.selection; - let selectionStart = MoveOperations.up(config, model, selection.selectionStartLineNumber, selection.selectionStartColumn, cursor.selectionStartLeftoverVisibleColumns, 1, false); - let position = MoveOperations.up(config, model, selection.positionLineNumber, selection.positionColumn, cursor.leftoverVisibleColumns, 1, false); - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["SingleCursorState"](new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](selectionStart.lineNumber, selectionStart.column, selectionStart.lineNumber, selectionStart.column), selectionStart.leftoverVisibleColumns, new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](position.lineNumber, position.column), position.leftoverVisibleColumns); - } - static moveToBeginningOfLine(config, model, cursor, inSelectionMode) { - let lineNumber = cursor.position.lineNumber; - let minColumn = model.getLineMinColumn(lineNumber); - let firstNonBlankColumn = model.getLineFirstNonWhitespaceColumn(lineNumber) || minColumn; - let column; - let relevantColumnNumber = cursor.position.column; - if (relevantColumnNumber === firstNonBlankColumn) { - column = minColumn; - } - else { - column = firstNonBlankColumn; - } - return cursor.move(inSelectionMode, lineNumber, column, 0); - } - static moveToEndOfLine(config, model, cursor, inSelectionMode, sticky) { - let lineNumber = cursor.position.lineNumber; - let maxColumn = model.getLineMaxColumn(lineNumber); - return cursor.move(inSelectionMode, lineNumber, maxColumn, sticky ? 1073741824 /* MAX_SAFE_SMALL_INTEGER */ - maxColumn : 0); - } - static moveToBeginningOfBuffer(config, model, cursor, inSelectionMode) { - return cursor.move(inSelectionMode, 1, 1, 0); - } - static moveToEndOfBuffer(config, model, cursor, inSelectionMode) { - let lastLineNumber = model.getLineCount(); - let lastColumn = model.getLineMaxColumn(lastLineNumber); - return cursor.move(inSelectionMode, lastLineNumber, lastColumn, 0); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorTypeOperations.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorTypeOperations.js ***! - \********************************************************************************************/ -/*! exports provided: TypeOperations, TypeWithAutoClosingCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TypeOperations", function() { return TypeOperations; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TypeWithAutoClosingCommand", function() { return TypeWithAutoClosingCommand; }); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands/replaceCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/common/commands/replaceCommand.js"); -/* harmony import */ var _commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands/shiftCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/common/commands/shiftCommand.js"); -/* harmony import */ var _commands_surroundSelectionCommand_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../commands/surroundSelectionCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/common/commands/surroundSelectionCommand.js"); -/* harmony import */ var _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./wordCharacterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/wordCharacterClassifier.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _modes_languageConfiguration_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modes/languageConfiguration.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfiguration.js"); -/* harmony import */ var _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - -class TypeOperations { - static indent(config, model, selections) { - if (model === null || selections === null) { - return []; - } - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - commands[i] = new _commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_3__["ShiftCommand"](selections[i], { - isUnshift: false, - tabSize: config.tabSize, - indentSize: config.indentSize, - insertSpaces: config.insertSpaces, - useTabStops: config.useTabStops, - autoIndent: config.autoIndent - }); - } - return commands; - } - static outdent(config, model, selections) { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - commands[i] = new _commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_3__["ShiftCommand"](selections[i], { - isUnshift: true, - tabSize: config.tabSize, - indentSize: config.indentSize, - insertSpaces: config.insertSpaces, - useTabStops: config.useTabStops, - autoIndent: config.autoIndent - }); - } - return commands; - } - static shiftIndent(config, indentation, count) { - count = count || 1; - return _commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_3__["ShiftCommand"].shiftIndent(indentation, indentation.length + count, config.tabSize, config.indentSize, config.insertSpaces); - } - static unshiftIndent(config, indentation, count) { - count = count || 1; - return _commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_3__["ShiftCommand"].unshiftIndent(indentation, indentation.length + count, config.tabSize, config.indentSize, config.insertSpaces); - } - static _distributedPaste(config, model, selections, text) { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](selections[i], text[i]); - } - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["EditOperationResult"](0 /* Other */, commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: true - }); - } - static _simplePaste(config, model, selections, text, pasteOnNewLine) { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - let position = selection.getPosition(); - if (pasteOnNewLine && !selection.isEmpty()) { - pasteOnNewLine = false; - } - if (pasteOnNewLine && text.indexOf('\n') !== text.length - 1) { - pasteOnNewLine = false; - } - if (pasteOnNewLine) { - // Paste entire line at the beginning of line - let typeSelection = new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](position.lineNumber, 1, position.lineNumber, 1); - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommandThatPreservesSelection"](typeSelection, text, selection, true); - } - else { - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](selection, text); - } - } - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["EditOperationResult"](0 /* Other */, commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: true - }); - } - static _distributePasteToCursors(config, selections, text, pasteOnNewLine, multicursorText) { - if (pasteOnNewLine) { - return null; - } - if (selections.length === 1) { - return null; - } - if (multicursorText && multicursorText.length === selections.length) { - return multicursorText; - } - if (config.multiCursorPaste === 'spread') { - // Try to spread the pasted text in case the line count matches the cursor count - // Remove trailing \n if present - if (text.charCodeAt(text.length - 1) === 10 /* LineFeed */) { - text = text.substr(0, text.length - 1); - } - // Remove trailing \r if present - if (text.charCodeAt(text.length - 1) === 13 /* CarriageReturn */) { - text = text.substr(0, text.length - 1); - } - let lines = text.split(/\r\n|\r|\n/); - if (lines.length === selections.length) { - return lines; - } - } - return null; - } - static paste(config, model, selections, text, pasteOnNewLine, multicursorText) { - const distributedPaste = this._distributePasteToCursors(config, selections, text, pasteOnNewLine, multicursorText); - if (distributedPaste) { - selections = selections.sort(_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].compareRangesUsingStarts); - return this._distributedPaste(config, model, selections, distributedPaste); - } - else { - return this._simplePaste(config, model, selections, text, pasteOnNewLine); - } - } - static _goodIndentForLine(config, model, lineNumber) { - let action = null; - let indentation = ''; - const expectedIndentAction = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__["LanguageConfigurationRegistry"].getInheritIndentForLine(config.autoIndent, model, lineNumber, false); - if (expectedIndentAction) { - action = expectedIndentAction.action; - indentation = expectedIndentAction.indentation; - } - else if (lineNumber > 1) { - let lastLineNumber; - for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) { - const lineText = model.getLineContent(lastLineNumber); - const nonWhitespaceIdx = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["lastNonWhitespaceIndex"](lineText); - if (nonWhitespaceIdx >= 0) { - break; - } - } - if (lastLineNumber < 1) { - // No previous line with content found - return null; - } - const maxColumn = model.getLineMaxColumn(lastLineNumber); - const expectedEnterAction = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__["LanguageConfigurationRegistry"].getEnterAction(config.autoIndent, model, new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](lastLineNumber, maxColumn, lastLineNumber, maxColumn)); - if (expectedEnterAction) { - indentation = expectedEnterAction.indentation + expectedEnterAction.appendText; - } - } - if (action) { - if (action === _modes_languageConfiguration_js__WEBPACK_IMPORTED_MODULE_9__["IndentAction"].Indent) { - indentation = TypeOperations.shiftIndent(config, indentation); - } - if (action === _modes_languageConfiguration_js__WEBPACK_IMPORTED_MODULE_9__["IndentAction"].Outdent) { - indentation = TypeOperations.unshiftIndent(config, indentation); - } - indentation = config.normalizeIndentation(indentation); - } - if (!indentation) { - return null; - } - return indentation; - } - static _replaceJumpToNextIndent(config, model, selection, insertsAutoWhitespace) { - let typeText = ''; - let position = selection.getStartPosition(); - if (config.insertSpaces) { - let visibleColumnFromColumn = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["CursorColumns"].visibleColumnFromColumn2(config, model, position); - let indentSize = config.indentSize; - let spacesCnt = indentSize - (visibleColumnFromColumn % indentSize); - for (let i = 0; i < spacesCnt; i++) { - typeText += ' '; - } - } - else { - typeText = '\t'; - } - return new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](selection, typeText, insertsAutoWhitespace); - } - static tab(config, model, selections) { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - if (selection.isEmpty()) { - let lineText = model.getLineContent(selection.startLineNumber); - if (/^\s*$/.test(lineText) && model.isCheapToTokenize(selection.startLineNumber)) { - let goodIndent = this._goodIndentForLine(config, model, selection.startLineNumber); - goodIndent = goodIndent || '\t'; - let possibleTypeText = config.normalizeIndentation(goodIndent); - if (!_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["startsWith"](lineText, possibleTypeText)) { - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](selection.startLineNumber, 1, selection.startLineNumber, lineText.length + 1), possibleTypeText, true); - continue; - } - } - commands[i] = this._replaceJumpToNextIndent(config, model, selection, true); - } - else { - if (selection.startLineNumber === selection.endLineNumber) { - let lineMaxColumn = model.getLineMaxColumn(selection.startLineNumber); - if (selection.startColumn !== 1 || selection.endColumn !== lineMaxColumn) { - // This is a single line selection that is not the entire line - commands[i] = this._replaceJumpToNextIndent(config, model, selection, false); - continue; - } - } - commands[i] = new _commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_3__["ShiftCommand"](selection, { - isUnshift: false, - tabSize: config.tabSize, - indentSize: config.indentSize, - insertSpaces: config.insertSpaces, - useTabStops: config.useTabStops, - autoIndent: config.autoIndent - }); - } - } - return commands; - } - static replacePreviousChar(prevEditOperationType, config, model, selections, txt, replaceCharCnt) { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - if (!selection.isEmpty()) { - // looks like https://github.com/Microsoft/vscode/issues/2773 - // where a cursor operation occurred before a canceled composition - // => ignore composition - commands[i] = null; - continue; - } - const pos = selection.getPosition(); - const startColumn = Math.max(1, pos.column - replaceCharCnt); - const range = new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](pos.lineNumber, startColumn, pos.lineNumber, pos.column); - const oldText = model.getValueInRange(range); - if (oldText === txt) { - // => ignore composition that doesn't do anything - commands[i] = null; - continue; - } - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](range, txt); - } - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["EditOperationResult"](1 /* Typing */, commands, { - shouldPushStackElementBefore: (prevEditOperationType !== 1 /* Typing */), - shouldPushStackElementAfter: false - }); - } - static _typeCommand(range, text, keepPosition) { - if (keepPosition) { - return new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommandWithoutChangingPosition"](range, text, true); - } - else { - return new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](range, text, true); - } - } - static _enter(config, model, keepPosition, range) { - if (config.autoIndent === 0 /* None */) { - return TypeOperations._typeCommand(range, '\n', keepPosition); - } - if (!model.isCheapToTokenize(range.getStartPosition().lineNumber) || config.autoIndent === 1 /* Keep */) { - let lineText = model.getLineContent(range.startLineNumber); - let indentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["getLeadingWhitespace"](lineText).substring(0, range.startColumn - 1); - return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(indentation), keepPosition); - } - const r = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__["LanguageConfigurationRegistry"].getEnterAction(config.autoIndent, model, range); - if (r) { - if (r.indentAction === _modes_languageConfiguration_js__WEBPACK_IMPORTED_MODULE_9__["IndentAction"].None) { - // Nothing special - return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(r.indentation + r.appendText), keepPosition); - } - else if (r.indentAction === _modes_languageConfiguration_js__WEBPACK_IMPORTED_MODULE_9__["IndentAction"].Indent) { - // Indent once - return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(r.indentation + r.appendText), keepPosition); - } - else if (r.indentAction === _modes_languageConfiguration_js__WEBPACK_IMPORTED_MODULE_9__["IndentAction"].IndentOutdent) { - // Ultra special - const normalIndent = config.normalizeIndentation(r.indentation); - const increasedIndent = config.normalizeIndentation(r.indentation + r.appendText); - const typeText = '\n' + increasedIndent + '\n' + normalIndent; - if (keepPosition) { - return new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommandWithoutChangingPosition"](range, typeText, true); - } - else { - return new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommandWithOffsetCursorState"](range, typeText, -1, increasedIndent.length - normalIndent.length, true); - } - } - else if (r.indentAction === _modes_languageConfiguration_js__WEBPACK_IMPORTED_MODULE_9__["IndentAction"].Outdent) { - const actualIndentation = TypeOperations.unshiftIndent(config, r.indentation); - return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(actualIndentation + r.appendText), keepPosition); - } - } - const lineText = model.getLineContent(range.startLineNumber); - const indentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["getLeadingWhitespace"](lineText).substring(0, range.startColumn - 1); - if (config.autoIndent >= 4 /* Full */) { - const ir = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__["LanguageConfigurationRegistry"].getIndentForEnter(config.autoIndent, model, range, { - unshiftIndent: (indent) => { - return TypeOperations.unshiftIndent(config, indent); - }, - shiftIndent: (indent) => { - return TypeOperations.shiftIndent(config, indent); - }, - normalizeIndentation: (indent) => { - return config.normalizeIndentation(indent); - } - }); - if (ir) { - let oldEndViewColumn = _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["CursorColumns"].visibleColumnFromColumn2(config, model, range.getEndPosition()); - const oldEndColumn = range.endColumn; - let beforeText = '\n'; - if (indentation !== config.normalizeIndentation(ir.beforeEnter)) { - beforeText = config.normalizeIndentation(ir.beforeEnter) + lineText.substring(indentation.length, range.startColumn - 1) + '\n'; - range = new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](range.startLineNumber, 1, range.endLineNumber, range.endColumn); - } - const newLineContent = model.getLineContent(range.endLineNumber); - const firstNonWhitespace = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](newLineContent); - if (firstNonWhitespace >= 0) { - range = range.setEndPosition(range.endLineNumber, Math.max(range.endColumn, firstNonWhitespace + 1)); - } - else { - range = range.setEndPosition(range.endLineNumber, model.getLineMaxColumn(range.endLineNumber)); - } - if (keepPosition) { - return new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommandWithoutChangingPosition"](range, beforeText + config.normalizeIndentation(ir.afterEnter), true); - } - else { - let offset = 0; - if (oldEndColumn <= firstNonWhitespace + 1) { - if (!config.insertSpaces) { - oldEndViewColumn = Math.ceil(oldEndViewColumn / config.indentSize); - } - offset = Math.min(oldEndViewColumn + 1 - config.normalizeIndentation(ir.afterEnter).length - 1, 0); - } - return new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommandWithOffsetCursorState"](range, beforeText + config.normalizeIndentation(ir.afterEnter), 0, offset, true); - } - } - } - return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(indentation), keepPosition); - } - static _isAutoIndentType(config, model, selections) { - if (config.autoIndent < 4 /* Full */) { - return false; - } - for (let i = 0, len = selections.length; i < len; i++) { - if (!model.isCheapToTokenize(selections[i].getEndPosition().lineNumber)) { - return false; - } - } - return true; - } - static _runAutoIndentType(config, model, range, ch) { - const currentIndentation = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__["LanguageConfigurationRegistry"].getIndentationAtPosition(model, range.startLineNumber, range.startColumn); - const actualIndentation = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__["LanguageConfigurationRegistry"].getIndentActionForType(config.autoIndent, model, range, ch, { - shiftIndent: (indentation) => { - return TypeOperations.shiftIndent(config, indentation); - }, - unshiftIndent: (indentation) => { - return TypeOperations.unshiftIndent(config, indentation); - }, - }); - if (actualIndentation === null) { - return null; - } - if (actualIndentation !== config.normalizeIndentation(currentIndentation)) { - const firstNonWhitespace = model.getLineFirstNonWhitespaceColumn(range.startLineNumber); - if (firstNonWhitespace === 0) { - return TypeOperations._typeCommand(new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](range.startLineNumber, 0, range.endLineNumber, range.endColumn), config.normalizeIndentation(actualIndentation) + ch, false); - } - else { - return TypeOperations._typeCommand(new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](range.startLineNumber, 0, range.endLineNumber, range.endColumn), config.normalizeIndentation(actualIndentation) + - model.getLineContent(range.startLineNumber).substring(firstNonWhitespace - 1, range.startColumn - 1) + ch, false); - } - } - return null; - } - static _isAutoClosingOvertype(config, model, selections, autoClosedCharacters, ch) { - if (config.autoClosingOvertype === 'never') { - return false; - } - if (!config.autoClosingPairsClose2.has(ch)) { - return false; - } - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - if (!selection.isEmpty()) { - return false; - } - const position = selection.getPosition(); - const lineText = model.getLineContent(position.lineNumber); - const afterCharacter = lineText.charAt(position.column - 1); - if (afterCharacter !== ch) { - return false; - } - // Do not over-type quotes after a backslash - const chIsQuote = Object(_cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["isQuote"])(ch); - const beforeCharacter = position.column > 2 ? lineText.charCodeAt(position.column - 2) : 0 /* Null */; - if (beforeCharacter === 92 /* Backslash */ && chIsQuote) { - return false; - } - // Must over-type a closing character typed by the editor - if (config.autoClosingOvertype === 'auto') { - let found = false; - for (let j = 0, lenJ = autoClosedCharacters.length; j < lenJ; j++) { - const autoClosedCharacter = autoClosedCharacters[j]; - if (position.lineNumber === autoClosedCharacter.startLineNumber && position.column === autoClosedCharacter.startColumn) { - found = true; - break; - } - } - if (!found) { - return false; - } - } - } - return true; - } - static _runAutoClosingOvertype(prevEditOperationType, config, model, selections, ch) { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - const position = selection.getPosition(); - const typeSelection = new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](position.lineNumber, position.column, position.lineNumber, position.column + 1); - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](typeSelection, ch); - } - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["EditOperationResult"](1 /* Typing */, commands, { - shouldPushStackElementBefore: (prevEditOperationType !== 1 /* Typing */), - shouldPushStackElementAfter: false - }); - } - static _autoClosingPairIsSymmetric(autoClosingPair) { - const { open, close } = autoClosingPair; - return (open.indexOf(close) >= 0 || close.indexOf(open) >= 0); - } - static _isBeforeClosingBrace(config, autoClosingPair, characterAfter) { - const otherAutoClosingPairs = config.autoClosingPairsClose2.get(characterAfter); - if (!otherAutoClosingPairs) { - return false; - } - const thisBraceIsSymmetric = TypeOperations._autoClosingPairIsSymmetric(autoClosingPair); - for (const otherAutoClosingPair of otherAutoClosingPairs) { - const otherBraceIsSymmetric = TypeOperations._autoClosingPairIsSymmetric(otherAutoClosingPair); - if (!thisBraceIsSymmetric && otherBraceIsSymmetric) { - continue; - } - return true; - } - return false; - } - static _findAutoClosingPairOpen(config, model, positions, ch) { - const autoClosingPairCandidates = config.autoClosingPairsOpen2.get(ch); - if (!autoClosingPairCandidates) { - return null; - } - // Determine which auto-closing pair it is - let autoClosingPair = null; - for (const autoClosingPairCandidate of autoClosingPairCandidates) { - if (autoClosingPair === null || autoClosingPairCandidate.open.length > autoClosingPair.open.length) { - let candidateIsMatch = true; - for (const position of positions) { - const relevantText = model.getValueInRange(new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](position.lineNumber, position.column - autoClosingPairCandidate.open.length + 1, position.lineNumber, position.column)); - if (relevantText + ch !== autoClosingPairCandidate.open) { - candidateIsMatch = false; - break; - } - } - if (candidateIsMatch) { - autoClosingPair = autoClosingPairCandidate; - } - } - } - return autoClosingPair; - } - static _isAutoClosingOpenCharType(config, model, selections, ch, insertOpenCharacter) { - const chIsQuote = Object(_cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["isQuote"])(ch); - const autoCloseConfig = chIsQuote ? config.autoClosingQuotes : config.autoClosingBrackets; - if (autoCloseConfig === 'never') { - return null; - } - const autoClosingPair = this._findAutoClosingPairOpen(config, model, selections.map(s => s.getPosition()), ch); - if (!autoClosingPair) { - return null; - } - const shouldAutoCloseBefore = chIsQuote ? config.shouldAutoCloseBefore.quote : config.shouldAutoCloseBefore.bracket; - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - if (!selection.isEmpty()) { - return null; - } - const position = selection.getPosition(); - const lineText = model.getLineContent(position.lineNumber); - // Only consider auto closing the pair if a space follows or if another autoclosed pair follows - if (lineText.length > position.column - 1) { - const characterAfter = lineText.charAt(position.column - 1); - const isBeforeCloseBrace = TypeOperations._isBeforeClosingBrace(config, autoClosingPair, characterAfter); - if (!isBeforeCloseBrace && !shouldAutoCloseBefore(characterAfter)) { - return null; - } - } - if (!model.isCheapToTokenize(position.lineNumber)) { - // Do not force tokenization - return null; - } - // Do not auto-close ' or " after a word character - if (autoClosingPair.open.length === 1 && chIsQuote && autoCloseConfig !== 'always') { - const wordSeparators = Object(_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_6__["getMapForWordSeparators"])(config.wordSeparators); - if (insertOpenCharacter && position.column > 1 && wordSeparators.get(lineText.charCodeAt(position.column - 2)) === 0 /* Regular */) { - return null; - } - if (!insertOpenCharacter && position.column > 2 && wordSeparators.get(lineText.charCodeAt(position.column - 3)) === 0 /* Regular */) { - return null; - } - } - model.forceTokenization(position.lineNumber); - const lineTokens = model.getLineTokens(position.lineNumber); - let shouldAutoClosePair = false; - try { - shouldAutoClosePair = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__["LanguageConfigurationRegistry"].shouldAutoClosePair(autoClosingPair, lineTokens, insertOpenCharacter ? position.column : position.column - 1); - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - } - if (!shouldAutoClosePair) { - return null; - } - } - return autoClosingPair; - } - static _runAutoClosingOpenCharType(prevEditOperationType, config, model, selections, ch, insertOpenCharacter, autoClosingPair) { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - commands[i] = new TypeWithAutoClosingCommand(selection, ch, insertOpenCharacter, autoClosingPair.close); - } - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["EditOperationResult"](1 /* Typing */, commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: false - }); - } - static _shouldSurroundChar(config, ch) { - if (Object(_cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["isQuote"])(ch)) { - return (config.autoSurround === 'quotes' || config.autoSurround === 'languageDefined'); - } - else { - // Character is a bracket - return (config.autoSurround === 'brackets' || config.autoSurround === 'languageDefined'); - } - } - static _isSurroundSelectionType(config, model, selections, ch) { - if (!TypeOperations._shouldSurroundChar(config, ch) || !config.surroundingPairs.hasOwnProperty(ch)) { - return false; - } - const isTypingAQuoteCharacter = Object(_cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["isQuote"])(ch); - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - if (selection.isEmpty()) { - return false; - } - let selectionContainsOnlyWhitespace = true; - for (let lineNumber = selection.startLineNumber; lineNumber <= selection.endLineNumber; lineNumber++) { - const lineText = model.getLineContent(lineNumber); - const startIndex = (lineNumber === selection.startLineNumber ? selection.startColumn - 1 : 0); - const endIndex = (lineNumber === selection.endLineNumber ? selection.endColumn - 1 : lineText.length); - const selectedText = lineText.substring(startIndex, endIndex); - if (/[^ \t]/.test(selectedText)) { - // this selected text contains something other than whitespace - selectionContainsOnlyWhitespace = false; - break; - } - } - if (selectionContainsOnlyWhitespace) { - return false; - } - if (isTypingAQuoteCharacter && selection.startLineNumber === selection.endLineNumber && selection.startColumn + 1 === selection.endColumn) { - const selectionText = model.getValueInRange(selection); - if (Object(_cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["isQuote"])(selectionText)) { - // Typing a quote character on top of another quote character - // => disable surround selection type - return false; - } - } - } - return true; - } - static _runSurroundSelectionType(prevEditOperationType, config, model, selections, ch) { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - const selection = selections[i]; - const closeCharacter = config.surroundingPairs[ch]; - commands[i] = new _commands_surroundSelectionCommand_js__WEBPACK_IMPORTED_MODULE_4__["SurroundSelectionCommand"](selection, ch, closeCharacter); - } - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["EditOperationResult"](0 /* Other */, commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: true - }); - } - static _isTypeInterceptorElectricChar(config, model, selections) { - if (selections.length === 1 && model.isCheapToTokenize(selections[0].getEndPosition().lineNumber)) { - return true; - } - return false; - } - static _typeInterceptorElectricChar(prevEditOperationType, config, model, selection, ch) { - if (!config.electricChars.hasOwnProperty(ch) || !selection.isEmpty()) { - return null; - } - let position = selection.getPosition(); - model.forceTokenization(position.lineNumber); - let lineTokens = model.getLineTokens(position.lineNumber); - let electricAction; - try { - electricAction = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__["LanguageConfigurationRegistry"].onElectricCharacter(ch, lineTokens, position.column); - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - return null; - } - if (!electricAction) { - return null; - } - if (electricAction.matchOpenBracket) { - let endColumn = (lineTokens.getLineContent() + ch).lastIndexOf(electricAction.matchOpenBracket) + 1; - let match = model.findMatchingBracketUp(electricAction.matchOpenBracket, { - lineNumber: position.lineNumber, - column: endColumn - }); - if (match) { - if (match.startLineNumber === position.lineNumber) { - // matched something on the same line => no change in indentation - return null; - } - let matchLine = model.getLineContent(match.startLineNumber); - let matchLineIndentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["getLeadingWhitespace"](matchLine); - let newIndentation = config.normalizeIndentation(matchLineIndentation); - let lineText = model.getLineContent(position.lineNumber); - let lineFirstNonBlankColumn = model.getLineFirstNonWhitespaceColumn(position.lineNumber) || position.column; - let prefix = lineText.substring(lineFirstNonBlankColumn - 1, position.column - 1); - let typeText = newIndentation + prefix + ch; - let typeSelection = new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](position.lineNumber, 1, position.lineNumber, position.column); - const command = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](typeSelection, typeText); - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["EditOperationResult"](1 /* Typing */, [command], { - shouldPushStackElementBefore: false, - shouldPushStackElementAfter: true - }); - } - } - return null; - } - /** - * This is very similar with typing, but the character is already in the text buffer! - */ - static compositionEndWithInterceptors(prevEditOperationType, config, model, selectionsWhenCompositionStarted, selections, autoClosedCharacters) { - if (!selectionsWhenCompositionStarted || _core_selection_js__WEBPACK_IMPORTED_MODULE_8__["Selection"].selectionsArrEqual(selectionsWhenCompositionStarted, selections)) { - // no content was typed - return null; - } - let ch = null; - // extract last typed character - for (const selection of selections) { - if (!selection.isEmpty()) { - return null; - } - const position = selection.getPosition(); - const currentChar = model.getValueInRange(new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](position.lineNumber, position.column - 1, position.lineNumber, position.column)); - if (ch === null) { - ch = currentChar; - } - else if (ch !== currentChar) { - return null; - } - } - if (!ch) { - return null; - } - if (this._isAutoClosingOvertype(config, model, selections, autoClosedCharacters, ch)) { - // Unfortunately, the close character is at this point "doubled", so we need to delete it... - const commands = selections.map(s => new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](s.positionLineNumber, s.positionColumn, s.positionLineNumber, s.positionColumn + 1), '', false)); - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["EditOperationResult"](1 /* Typing */, commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: false - }); - } - const autoClosingPairOpenCharType = this._isAutoClosingOpenCharType(config, model, selections, ch, false); - if (autoClosingPairOpenCharType) { - return this._runAutoClosingOpenCharType(prevEditOperationType, config, model, selections, ch, false, autoClosingPairOpenCharType); - } - return null; - } - static typeWithInterceptors(isDoingComposition, prevEditOperationType, config, model, selections, autoClosedCharacters, ch) { - if (!isDoingComposition && ch === '\n') { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - commands[i] = TypeOperations._enter(config, model, false, selections[i]); - } - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["EditOperationResult"](1 /* Typing */, commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: false, - }); - } - if (!isDoingComposition && this._isAutoIndentType(config, model, selections)) { - let commands = []; - let autoIndentFails = false; - for (let i = 0, len = selections.length; i < len; i++) { - commands[i] = this._runAutoIndentType(config, model, selections[i], ch); - if (!commands[i]) { - autoIndentFails = true; - break; - } - } - if (!autoIndentFails) { - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["EditOperationResult"](1 /* Typing */, commands, { - shouldPushStackElementBefore: true, - shouldPushStackElementAfter: false, - }); - } - } - if (!isDoingComposition && this._isAutoClosingOvertype(config, model, selections, autoClosedCharacters, ch)) { - return this._runAutoClosingOvertype(prevEditOperationType, config, model, selections, ch); - } - if (!isDoingComposition) { - const autoClosingPairOpenCharType = this._isAutoClosingOpenCharType(config, model, selections, ch, true); - if (autoClosingPairOpenCharType) { - return this._runAutoClosingOpenCharType(prevEditOperationType, config, model, selections, ch, true, autoClosingPairOpenCharType); - } - } - if (this._isSurroundSelectionType(config, model, selections, ch)) { - return this._runSurroundSelectionType(prevEditOperationType, config, model, selections, ch); - } - // Electric characters make sense only when dealing with a single cursor, - // as multiple cursors typing brackets for example would interfer with bracket matching - if (!isDoingComposition && this._isTypeInterceptorElectricChar(config, model, selections)) { - const r = this._typeInterceptorElectricChar(prevEditOperationType, config, model, selections[0], ch); - if (r) { - return r; - } - } - // A simple character type - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](selections[i], ch); - } - let shouldPushStackElementBefore = (prevEditOperationType !== 1 /* Typing */); - if (ch === ' ') { - shouldPushStackElementBefore = true; - } - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["EditOperationResult"](1 /* Typing */, commands, { - shouldPushStackElementBefore: shouldPushStackElementBefore, - shouldPushStackElementAfter: false - }); - } - static typeWithoutInterceptors(prevEditOperationType, config, model, selections, str) { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](selections[i], str); - } - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_5__["EditOperationResult"](1 /* Typing */, commands, { - shouldPushStackElementBefore: (prevEditOperationType !== 1 /* Typing */), - shouldPushStackElementAfter: false - }); - } - static lineInsertBefore(config, model, selections) { - if (model === null || selections === null) { - return []; - } - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - let lineNumber = selections[i].positionLineNumber; - if (lineNumber === 1) { - commands[i] = new _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommandWithoutChangingPosition"](new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](1, 1, 1, 1), '\n'); - } - else { - lineNumber--; - let column = model.getLineMaxColumn(lineNumber); - commands[i] = this._enter(config, model, false, new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](lineNumber, column, lineNumber, column)); - } - } - return commands; - } - static lineInsertAfter(config, model, selections) { - if (model === null || selections === null) { - return []; - } - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - const lineNumber = selections[i].positionLineNumber; - let column = model.getLineMaxColumn(lineNumber); - commands[i] = this._enter(config, model, false, new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](lineNumber, column, lineNumber, column)); - } - return commands; - } - static lineBreakInsert(config, model, selections) { - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - commands[i] = this._enter(config, model, true, selections[i]); - } - return commands; - } -} -class TypeWithAutoClosingCommand extends _commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommandWithOffsetCursorState"] { - constructor(selection, openCharacter, insertOpenCharacter, closeCharacter) { - super(selection, (insertOpenCharacter ? openCharacter : '') + closeCharacter, 0, -closeCharacter.length); - this._openCharacter = openCharacter; - this._closeCharacter = closeCharacter; - this.closeCharacterRange = null; - this.enclosingRange = null; - } - computeCursorState(model, helper) { - let inverseEditOperations = helper.getInverseEditOperations(); - let range = inverseEditOperations[0].range; - this.closeCharacterRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](range.startLineNumber, range.endColumn - this._closeCharacter.length, range.endLineNumber, range.endColumn); - this.enclosingRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](range.startLineNumber, range.endColumn - this._openCharacter.length - this._closeCharacter.length, range.endLineNumber, range.endColumn); - return super.computeCursorState(model, helper); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorWordOperations.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorWordOperations.js ***! - \********************************************************************************************/ -/*! exports provided: WordOperations, WordPartOperations */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WordOperations", function() { return WordOperations; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WordPartOperations", function() { return WordPartOperations; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./wordCharacterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/wordCharacterClassifier.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -class WordOperations { - static _createWord(lineContent, wordType, nextCharClass, start, end) { - // console.log('WORD ==> ' + start + ' => ' + end + ':::: <<<' + lineContent.substring(start, end) + '>>>'); - return { start: start, end: end, wordType: wordType, nextCharClass: nextCharClass }; - } - static _findPreviousWordOnLine(wordSeparators, model, position) { - let lineContent = model.getLineContent(position.lineNumber); - return this._doFindPreviousWordOnLine(lineContent, wordSeparators, position); - } - static _doFindPreviousWordOnLine(lineContent, wordSeparators, position) { - let wordType = 0 /* None */; - for (let chIndex = position.column - 2; chIndex >= 0; chIndex--) { - let chCode = lineContent.charCodeAt(chIndex); - let chClass = wordSeparators.get(chCode); - if (chClass === 0 /* Regular */) { - if (wordType === 2 /* Separator */) { - return this._createWord(lineContent, wordType, chClass, chIndex + 1, this._findEndOfWord(lineContent, wordSeparators, wordType, chIndex + 1)); - } - wordType = 1 /* Regular */; - } - else if (chClass === 2 /* WordSeparator */) { - if (wordType === 1 /* Regular */) { - return this._createWord(lineContent, wordType, chClass, chIndex + 1, this._findEndOfWord(lineContent, wordSeparators, wordType, chIndex + 1)); - } - wordType = 2 /* Separator */; - } - else if (chClass === 1 /* Whitespace */) { - if (wordType !== 0 /* None */) { - return this._createWord(lineContent, wordType, chClass, chIndex + 1, this._findEndOfWord(lineContent, wordSeparators, wordType, chIndex + 1)); - } - } - } - if (wordType !== 0 /* None */) { - return this._createWord(lineContent, wordType, 1 /* Whitespace */, 0, this._findEndOfWord(lineContent, wordSeparators, wordType, 0)); - } - return null; - } - static _findEndOfWord(lineContent, wordSeparators, wordType, startIndex) { - let len = lineContent.length; - for (let chIndex = startIndex; chIndex < len; chIndex++) { - let chCode = lineContent.charCodeAt(chIndex); - let chClass = wordSeparators.get(chCode); - if (chClass === 1 /* Whitespace */) { - return chIndex; - } - if (wordType === 1 /* Regular */ && chClass === 2 /* WordSeparator */) { - return chIndex; - } - if (wordType === 2 /* Separator */ && chClass === 0 /* Regular */) { - return chIndex; - } - } - return len; - } - static _findNextWordOnLine(wordSeparators, model, position) { - let lineContent = model.getLineContent(position.lineNumber); - return this._doFindNextWordOnLine(lineContent, wordSeparators, position); - } - static _doFindNextWordOnLine(lineContent, wordSeparators, position) { - let wordType = 0 /* None */; - let len = lineContent.length; - for (let chIndex = position.column - 1; chIndex < len; chIndex++) { - let chCode = lineContent.charCodeAt(chIndex); - let chClass = wordSeparators.get(chCode); - if (chClass === 0 /* Regular */) { - if (wordType === 2 /* Separator */) { - return this._createWord(lineContent, wordType, chClass, this._findStartOfWord(lineContent, wordSeparators, wordType, chIndex - 1), chIndex); - } - wordType = 1 /* Regular */; - } - else if (chClass === 2 /* WordSeparator */) { - if (wordType === 1 /* Regular */) { - return this._createWord(lineContent, wordType, chClass, this._findStartOfWord(lineContent, wordSeparators, wordType, chIndex - 1), chIndex); - } - wordType = 2 /* Separator */; - } - else if (chClass === 1 /* Whitespace */) { - if (wordType !== 0 /* None */) { - return this._createWord(lineContent, wordType, chClass, this._findStartOfWord(lineContent, wordSeparators, wordType, chIndex - 1), chIndex); - } - } - } - if (wordType !== 0 /* None */) { - return this._createWord(lineContent, wordType, 1 /* Whitespace */, this._findStartOfWord(lineContent, wordSeparators, wordType, len - 1), len); - } - return null; - } - static _findStartOfWord(lineContent, wordSeparators, wordType, startIndex) { - for (let chIndex = startIndex; chIndex >= 0; chIndex--) { - let chCode = lineContent.charCodeAt(chIndex); - let chClass = wordSeparators.get(chCode); - if (chClass === 1 /* Whitespace */) { - return chIndex + 1; - } - if (wordType === 1 /* Regular */ && chClass === 2 /* WordSeparator */) { - return chIndex + 1; - } - if (wordType === 2 /* Separator */ && chClass === 0 /* Regular */) { - return chIndex + 1; - } - } - return 0; - } - static moveWordLeft(wordSeparators, model, position, wordNavigationType) { - let lineNumber = position.lineNumber; - let column = position.column; - if (column === 1) { - if (lineNumber > 1) { - lineNumber = lineNumber - 1; - column = model.getLineMaxColumn(lineNumber); - } - } - let prevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column)); - if (wordNavigationType === 0 /* WordStart */) { - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1); - } - if (wordNavigationType === 1 /* WordStartFast */) { - if (prevWordOnLine - && prevWordOnLine.wordType === 2 /* Separator */ - && prevWordOnLine.end - prevWordOnLine.start === 1 - && prevWordOnLine.nextCharClass === 0 /* Regular */) { - // Skip over a word made up of one single separator and followed by a regular character - prevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, prevWordOnLine.start + 1)); - } - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1); - } - if (wordNavigationType === 3 /* WordAccessibility */) { - while (prevWordOnLine - && prevWordOnLine.wordType === 2 /* Separator */) { - // Skip over words made up of only separators - prevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, prevWordOnLine.start + 1)); - } - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, prevWordOnLine ? prevWordOnLine.start + 1 : 1); - } - // We are stopping at the ending of words - if (prevWordOnLine && column <= prevWordOnLine.end + 1) { - prevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, prevWordOnLine.start + 1)); - } - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, prevWordOnLine ? prevWordOnLine.end + 1 : 1); - } - static _moveWordPartLeft(model, position) { - const lineNumber = position.lineNumber; - const maxColumn = model.getLineMaxColumn(lineNumber); - if (position.column === 1) { - return (lineNumber > 1 ? new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber - 1, model.getLineMaxColumn(lineNumber - 1)) : position); - } - const lineContent = model.getLineContent(lineNumber); - for (let column = position.column - 1; column > 1; column--) { - const left = lineContent.charCodeAt(column - 2); - const right = lineContent.charCodeAt(column - 1); - if (left === 95 /* Underline */ && right !== 95 /* Underline */) { - // snake_case_variables - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - } - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isLowerAsciiLetter"](left) && _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isUpperAsciiLetter"](right)) { - // camelCaseVariables - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - } - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isUpperAsciiLetter"](left) && _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isUpperAsciiLetter"](right)) { - // thisIsACamelCaseWithOneLetterWords - if (column + 1 < maxColumn) { - const rightRight = lineContent.charCodeAt(column); - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isLowerAsciiLetter"](rightRight)) { - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - } - } - } - } - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, 1); - } - static moveWordRight(wordSeparators, model, position, wordNavigationType) { - let lineNumber = position.lineNumber; - let column = position.column; - let movedDown = false; - if (column === model.getLineMaxColumn(lineNumber)) { - if (lineNumber < model.getLineCount()) { - movedDown = true; - lineNumber = lineNumber + 1; - column = 1; - } - } - let nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column)); - if (wordNavigationType === 2 /* WordEnd */) { - if (nextWordOnLine && nextWordOnLine.wordType === 2 /* Separator */) { - if (nextWordOnLine.end - nextWordOnLine.start === 1 && nextWordOnLine.nextCharClass === 0 /* Regular */) { - // Skip over a word made up of one single separator and followed by a regular character - nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, nextWordOnLine.end + 1)); - } - } - if (nextWordOnLine) { - column = nextWordOnLine.end + 1; - } - else { - column = model.getLineMaxColumn(lineNumber); - } - } - else if (wordNavigationType === 3 /* WordAccessibility */) { - if (movedDown) { - // If we move to the next line, pretend that the cursor is right before the first character. - // This is needed when the first word starts right at the first character - and in order not to miss it, - // we need to start before. - column = 0; - } - while (nextWordOnLine - && (nextWordOnLine.wordType === 2 /* Separator */ - || nextWordOnLine.start + 1 <= column)) { - // Skip over a word made up of one single separator - // Also skip over word if it begins before current cursor position to ascertain we're moving forward at least 1 character. - nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, nextWordOnLine.end + 1)); - } - if (nextWordOnLine) { - column = nextWordOnLine.start + 1; - } - else { - column = model.getLineMaxColumn(lineNumber); - } - } - else { - if (nextWordOnLine && !movedDown && column >= nextWordOnLine.start + 1) { - nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, nextWordOnLine.end + 1)); - } - if (nextWordOnLine) { - column = nextWordOnLine.start + 1; - } - else { - column = model.getLineMaxColumn(lineNumber); - } - } - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - } - static _moveWordPartRight(model, position) { - const lineNumber = position.lineNumber; - const maxColumn = model.getLineMaxColumn(lineNumber); - if (position.column === maxColumn) { - return (lineNumber < model.getLineCount() ? new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber + 1, 1) : position); - } - const lineContent = model.getLineContent(lineNumber); - for (let column = position.column + 1; column < maxColumn; column++) { - const left = lineContent.charCodeAt(column - 2); - const right = lineContent.charCodeAt(column - 1); - if (left !== 95 /* Underline */ && right === 95 /* Underline */) { - // snake_case_variables - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - } - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isLowerAsciiLetter"](left) && _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isUpperAsciiLetter"](right)) { - // camelCaseVariables - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - } - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isUpperAsciiLetter"](left) && _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isUpperAsciiLetter"](right)) { - // thisIsACamelCaseWithOneLetterWords - if (column + 1 < maxColumn) { - const rightRight = lineContent.charCodeAt(column); - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isLowerAsciiLetter"](rightRight)) { - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - } - } - } - } - return new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, maxColumn); - } - static _deleteWordLeftWhitespace(model, position) { - const lineContent = model.getLineContent(position.lineNumber); - const startIndex = position.column - 2; - const lastNonWhitespace = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["lastNonWhitespaceIndex"](lineContent, startIndex); - if (lastNonWhitespace + 1 < startIndex) { - return new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](position.lineNumber, lastNonWhitespace + 2, position.lineNumber, position.column); - } - return null; - } - static deleteWordLeft(wordSeparators, model, selection, whitespaceHeuristics, wordNavigationType) { - if (!selection.isEmpty()) { - return selection; - } - const position = new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](selection.positionLineNumber, selection.positionColumn); - let lineNumber = position.lineNumber; - let column = position.column; - if (lineNumber === 1 && column === 1) { - // Ignore deleting at beginning of file - return null; - } - if (whitespaceHeuristics) { - let r = this._deleteWordLeftWhitespace(model, position); - if (r) { - return r; - } - } - let prevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, position); - if (wordNavigationType === 0 /* WordStart */) { - if (prevWordOnLine) { - column = prevWordOnLine.start + 1; - } - else { - if (column > 1) { - column = 1; - } - else { - lineNumber--; - column = model.getLineMaxColumn(lineNumber); - } - } - } - else { - if (prevWordOnLine && column <= prevWordOnLine.end + 1) { - prevWordOnLine = WordOperations._findPreviousWordOnLine(wordSeparators, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, prevWordOnLine.start + 1)); - } - if (prevWordOnLine) { - column = prevWordOnLine.end + 1; - } - else { - if (column > 1) { - column = 1; - } - else { - lineNumber--; - column = model.getLineMaxColumn(lineNumber); - } - } - } - return new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](lineNumber, column, position.lineNumber, position.column); - } - static _deleteWordPartLeft(model, selection) { - if (!selection.isEmpty()) { - return selection; - } - const pos = selection.getPosition(); - const toPosition = WordOperations._moveWordPartLeft(model, pos); - return new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](pos.lineNumber, pos.column, toPosition.lineNumber, toPosition.column); - } - static _findFirstNonWhitespaceChar(str, startIndex) { - let len = str.length; - for (let chIndex = startIndex; chIndex < len; chIndex++) { - let ch = str.charAt(chIndex); - if (ch !== ' ' && ch !== '\t') { - return chIndex; - } - } - return len; - } - static _deleteWordRightWhitespace(model, position) { - const lineContent = model.getLineContent(position.lineNumber); - const startIndex = position.column - 1; - const firstNonWhitespace = this._findFirstNonWhitespaceChar(lineContent, startIndex); - if (startIndex + 1 < firstNonWhitespace) { - // bingo - return new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](position.lineNumber, position.column, position.lineNumber, firstNonWhitespace + 1); - } - return null; - } - static deleteWordRight(wordSeparators, model, selection, whitespaceHeuristics, wordNavigationType) { - if (!selection.isEmpty()) { - return selection; - } - const position = new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](selection.positionLineNumber, selection.positionColumn); - let lineNumber = position.lineNumber; - let column = position.column; - const lineCount = model.getLineCount(); - const maxColumn = model.getLineMaxColumn(lineNumber); - if (lineNumber === lineCount && column === maxColumn) { - // Ignore deleting at end of file - return null; - } - if (whitespaceHeuristics) { - let r = this._deleteWordRightWhitespace(model, position); - if (r) { - return r; - } - } - let nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, position); - if (wordNavigationType === 2 /* WordEnd */) { - if (nextWordOnLine) { - column = nextWordOnLine.end + 1; - } - else { - if (column < maxColumn || lineNumber === lineCount) { - column = maxColumn; - } - else { - lineNumber++; - nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, 1)); - if (nextWordOnLine) { - column = nextWordOnLine.start + 1; - } - else { - column = model.getLineMaxColumn(lineNumber); - } - } - } - } - else { - if (nextWordOnLine && column >= nextWordOnLine.start + 1) { - nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, nextWordOnLine.end + 1)); - } - if (nextWordOnLine) { - column = nextWordOnLine.start + 1; - } - else { - if (column < maxColumn || lineNumber === lineCount) { - column = maxColumn; - } - else { - lineNumber++; - nextWordOnLine = WordOperations._findNextWordOnLine(wordSeparators, model, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, 1)); - if (nextWordOnLine) { - column = nextWordOnLine.start + 1; - } - else { - column = model.getLineMaxColumn(lineNumber); - } - } - } - } - return new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](lineNumber, column, position.lineNumber, position.column); - } - static _deleteWordPartRight(model, selection) { - if (!selection.isEmpty()) { - return selection; - } - const pos = selection.getPosition(); - const toPosition = WordOperations._moveWordPartRight(model, pos); - return new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](pos.lineNumber, pos.column, toPosition.lineNumber, toPosition.column); - } - static _createWordAtPosition(model, lineNumber, word) { - const range = new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](lineNumber, word.start + 1, lineNumber, word.end + 1); - return { - word: model.getValueInRange(range), - startColumn: range.startColumn, - endColumn: range.endColumn - }; - } - static getWordAtPosition(model, _wordSeparators, position) { - const wordSeparators = Object(_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_2__["getMapForWordSeparators"])(_wordSeparators); - const prevWord = WordOperations._findPreviousWordOnLine(wordSeparators, model, position); - if (prevWord && prevWord.wordType === 1 /* Regular */ && prevWord.start <= position.column - 1 && position.column - 1 <= prevWord.end) { - return WordOperations._createWordAtPosition(model, position.lineNumber, prevWord); - } - const nextWord = WordOperations._findNextWordOnLine(wordSeparators, model, position); - if (nextWord && nextWord.wordType === 1 /* Regular */ && nextWord.start <= position.column - 1 && position.column - 1 <= nextWord.end) { - return WordOperations._createWordAtPosition(model, position.lineNumber, nextWord); - } - return null; - } - static word(config, model, cursor, inSelectionMode, position) { - const wordSeparators = Object(_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_2__["getMapForWordSeparators"])(config.wordSeparators); - let prevWord = WordOperations._findPreviousWordOnLine(wordSeparators, model, position); - let nextWord = WordOperations._findNextWordOnLine(wordSeparators, model, position); - if (!inSelectionMode) { - // Entering word selection for the first time - let startColumn; - let endColumn; - if (prevWord && prevWord.wordType === 1 /* Regular */ && prevWord.start <= position.column - 1 && position.column - 1 <= prevWord.end) { - // isTouchingPrevWord - startColumn = prevWord.start + 1; - endColumn = prevWord.end + 1; - } - else if (nextWord && nextWord.wordType === 1 /* Regular */ && nextWord.start <= position.column - 1 && position.column - 1 <= nextWord.end) { - // isTouchingNextWord - startColumn = nextWord.start + 1; - endColumn = nextWord.end + 1; - } - else { - if (prevWord) { - startColumn = prevWord.end + 1; - } - else { - startColumn = 1; - } - if (nextWord) { - endColumn = nextWord.start + 1; - } - else { - endColumn = model.getLineMaxColumn(position.lineNumber); - } - } - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_1__["SingleCursorState"](new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](position.lineNumber, startColumn, position.lineNumber, endColumn), 0, new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](position.lineNumber, endColumn), 0); - } - let startColumn; - let endColumn; - if (prevWord && prevWord.wordType === 1 /* Regular */ && prevWord.start < position.column - 1 && position.column - 1 < prevWord.end) { - // isInsidePrevWord - startColumn = prevWord.start + 1; - endColumn = prevWord.end + 1; - } - else if (nextWord && nextWord.wordType === 1 /* Regular */ && nextWord.start < position.column - 1 && position.column - 1 < nextWord.end) { - // isInsideNextWord - startColumn = nextWord.start + 1; - endColumn = nextWord.end + 1; - } - else { - startColumn = position.column; - endColumn = position.column; - } - let lineNumber = position.lineNumber; - let column; - if (cursor.selectionStart.containsPosition(position)) { - column = cursor.selectionStart.endColumn; - } - else if (position.isBeforeOrEqual(cursor.selectionStart.getStartPosition())) { - column = startColumn; - let possiblePosition = new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - if (cursor.selectionStart.containsPosition(possiblePosition)) { - column = cursor.selectionStart.endColumn; - } - } - else { - column = endColumn; - let possiblePosition = new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - if (cursor.selectionStart.containsPosition(possiblePosition)) { - column = cursor.selectionStart.startColumn; - } - } - return cursor.move(true, lineNumber, column, 0); - } -} -class WordPartOperations extends WordOperations { - static deleteWordPartLeft(wordSeparators, model, selection, whitespaceHeuristics) { - const candidates = enforceDefined([ - WordOperations.deleteWordLeft(wordSeparators, model, selection, whitespaceHeuristics, 0 /* WordStart */), - WordOperations.deleteWordLeft(wordSeparators, model, selection, whitespaceHeuristics, 2 /* WordEnd */), - WordOperations._deleteWordPartLeft(model, selection) - ]); - candidates.sort(_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].compareRangesUsingEnds); - return candidates[2]; - } - static deleteWordPartRight(wordSeparators, model, selection, whitespaceHeuristics) { - const candidates = enforceDefined([ - WordOperations.deleteWordRight(wordSeparators, model, selection, whitespaceHeuristics, 0 /* WordStart */), - WordOperations.deleteWordRight(wordSeparators, model, selection, whitespaceHeuristics, 2 /* WordEnd */), - WordOperations._deleteWordPartRight(model, selection) - ]); - candidates.sort(_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].compareRangesUsingStarts); - return candidates[0]; - } - static moveWordPartLeft(wordSeparators, model, position) { - const candidates = enforceDefined([ - WordOperations.moveWordLeft(wordSeparators, model, position, 0 /* WordStart */), - WordOperations.moveWordLeft(wordSeparators, model, position, 2 /* WordEnd */), - WordOperations._moveWordPartLeft(model, position) - ]); - candidates.sort(_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"].compare); - return candidates[2]; - } - static moveWordPartRight(wordSeparators, model, position) { - const candidates = enforceDefined([ - WordOperations.moveWordRight(wordSeparators, model, position, 0 /* WordStart */), - WordOperations.moveWordRight(wordSeparators, model, position, 2 /* WordEnd */), - WordOperations._moveWordPartRight(model, position) - ]); - candidates.sort(_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"].compare); - return candidates[0]; - } -} -function enforceDefined(arr) { - return arr.filter(el => Boolean(el)); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/controller/oneCursor.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/controller/oneCursor.js ***! - \*********************************************************************************/ -/*! exports provided: OneCursor */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OneCursor", function() { return OneCursor; }); -/* harmony import */ var _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class OneCursor { - constructor(context) { - this._selTrackedRange = null; - this._trackSelection = true; - this._setState(context, new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["SingleCursorState"](new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](1, 1, 1, 1), 0, new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](1, 1), 0), new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["SingleCursorState"](new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](1, 1, 1, 1), 0, new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](1, 1), 0)); - } - dispose(context) { - this._removeTrackedRange(context); - } - startTrackingSelection(context) { - this._trackSelection = true; - this._updateTrackedRange(context); - } - stopTrackingSelection(context) { - this._trackSelection = false; - this._removeTrackedRange(context); - } - _updateTrackedRange(context) { - if (!this._trackSelection) { - // don't track the selection - return; - } - this._selTrackedRange = context.model._setTrackedRange(this._selTrackedRange, this.modelState.selection, 0 /* AlwaysGrowsWhenTypingAtEdges */); - } - _removeTrackedRange(context) { - this._selTrackedRange = context.model._setTrackedRange(this._selTrackedRange, null, 0 /* AlwaysGrowsWhenTypingAtEdges */); - } - asCursorState() { - return new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["CursorState"](this.modelState, this.viewState); - } - readSelectionFromMarkers(context) { - const range = context.model._getTrackedRange(this._selTrackedRange); - if (this.modelState.selection.getDirection() === 0 /* LTR */) { - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_3__["Selection"](range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); - } - return new _core_selection_js__WEBPACK_IMPORTED_MODULE_3__["Selection"](range.endLineNumber, range.endColumn, range.startLineNumber, range.startColumn); - } - ensureValidState(context) { - this._setState(context, this.modelState, this.viewState); - } - setState(context, modelState, viewState) { - this._setState(context, modelState, viewState); - } - _setState(context, modelState, viewState) { - if (!modelState) { - if (!viewState) { - return; - } - // We only have the view state => compute the model state - const selectionStart = context.model.validateRange(context.coordinatesConverter.convertViewRangeToModelRange(viewState.selectionStart)); - const position = context.model.validatePosition(context.coordinatesConverter.convertViewPositionToModelPosition(viewState.position)); - modelState = new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["SingleCursorState"](selectionStart, viewState.selectionStartLeftoverVisibleColumns, position, viewState.leftoverVisibleColumns); - } - else { - // Validate new model state - const selectionStart = context.model.validateRange(modelState.selectionStart); - const selectionStartLeftoverVisibleColumns = modelState.selectionStart.equalsRange(selectionStart) ? modelState.selectionStartLeftoverVisibleColumns : 0; - const position = context.model.validatePosition(modelState.position); - const leftoverVisibleColumns = modelState.position.equals(position) ? modelState.leftoverVisibleColumns : 0; - modelState = new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["SingleCursorState"](selectionStart, selectionStartLeftoverVisibleColumns, position, leftoverVisibleColumns); - } - if (!viewState) { - // We only have the model state => compute the view state - const viewSelectionStart1 = context.coordinatesConverter.convertModelPositionToViewPosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](modelState.selectionStart.startLineNumber, modelState.selectionStart.startColumn)); - const viewSelectionStart2 = context.coordinatesConverter.convertModelPositionToViewPosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](modelState.selectionStart.endLineNumber, modelState.selectionStart.endColumn)); - const viewSelectionStart = new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](viewSelectionStart1.lineNumber, viewSelectionStart1.column, viewSelectionStart2.lineNumber, viewSelectionStart2.column); - const viewPosition = context.coordinatesConverter.convertModelPositionToViewPosition(modelState.position); - viewState = new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["SingleCursorState"](viewSelectionStart, modelState.selectionStartLeftoverVisibleColumns, viewPosition, modelState.leftoverVisibleColumns); - } - else { - // Validate new view state - const viewSelectionStart = context.coordinatesConverter.validateViewRange(viewState.selectionStart, modelState.selectionStart); - const viewPosition = context.coordinatesConverter.validateViewPosition(viewState.position, modelState.position); - viewState = new _cursorCommon_js__WEBPACK_IMPORTED_MODULE_0__["SingleCursorState"](viewSelectionStart, modelState.selectionStartLeftoverVisibleColumns, viewPosition, modelState.leftoverVisibleColumns); - } - this.modelState = modelState; - this.viewState = viewState; - this._updateTrackedRange(context); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/controller/wordCharacterClassifier.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/controller/wordCharacterClassifier.js ***! - \***********************************************************************************************/ -/*! exports provided: WordCharacterClassifier, getMapForWordSeparators */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WordCharacterClassifier", function() { return WordCharacterClassifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMapForWordSeparators", function() { return getMapForWordSeparators; }); -/* harmony import */ var _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class WordCharacterClassifier extends _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__["CharacterClassifier"] { - constructor(wordSeparators) { - super(0 /* Regular */); - for (let i = 0, len = wordSeparators.length; i < len; i++) { - this.set(wordSeparators.charCodeAt(i), 2 /* WordSeparator */); - } - this.set(32 /* Space */, 1 /* Whitespace */); - this.set(9 /* Tab */, 1 /* Whitespace */); - } -} -function once(computeFn) { - let cache = {}; // TODO@Alex unbounded cache - return (input) => { - if (!cache.hasOwnProperty(input)) { - cache[input] = computeFn(input); - } - return cache[input]; - }; -} -const getMapForWordSeparators = once((input) => new WordCharacterClassifier(input)); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js ***! - \*************************************************************************************/ -/*! exports provided: CharacterClassifier, CharacterSet */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterClassifier", function() { return CharacterClassifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterSet", function() { return CharacterSet; }); -/* harmony import */ var _base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uint.js */ "./node_modules/monaco-editor/esm/vs/base/common/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A fast character classifier that uses a compact array for ASCII values. - */ -class CharacterClassifier { - constructor(_defaultValue) { - let defaultValue = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_defaultValue); - this._defaultValue = defaultValue; - this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); - this._map = new Map(); - } - static _createAsciiMap(defaultValue) { - let asciiMap = new Uint8Array(256); - for (let i = 0; i < 256; i++) { - asciiMap[i] = defaultValue; - } - return asciiMap; - } - set(charCode, _value) { - let value = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_value); - if (charCode >= 0 && charCode < 256) { - this._asciiMap[charCode] = value; - } - else { - this._map.set(charCode, value); - } - } - get(charCode) { - if (charCode >= 0 && charCode < 256) { - return this._asciiMap[charCode]; - } - else { - return (this._map.get(charCode) || this._defaultValue); - } - } -} -class CharacterSet { - constructor() { - this._actual = new CharacterClassifier(0 /* False */); - } - add(charCode) { - this._actual.set(charCode, 1 /* True */); - } - has(charCode) { - return (this._actual.get(charCode) === 1 /* True */); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js ***! - \*******************************************************************************/ -/*! exports provided: EditOperation */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditOperation", function() { return EditOperation; }); -/* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class EditOperation { - static insert(position, text) { - return { - range: new _range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](position.lineNumber, position.column, position.lineNumber, position.column), - text: text, - forceMoveMarkers: true - }; - } - static delete(range) { - return { - range: range, - text: null - }; - } - static replace(range, text) { - return { - range: range, - text: text - }; - } - static replaceMove(range, text) { - return { - range: range, - text: text, - forceMoveMarkers: true - }; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/lineTokens.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/lineTokens.js ***! - \****************************************************************************/ -/*! exports provided: LineTokens, SlicedLineTokens */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineTokens", function() { return LineTokens; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SlicedLineTokens", function() { return SlicedLineTokens; }); -/* harmony import */ var _modes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class LineTokens { - constructor(tokens, text) { - this._tokens = tokens; - this._tokensCount = (this._tokens.length >>> 1); - this._text = text; - } - equals(other) { - if (other instanceof LineTokens) { - return this.slicedEquals(other, 0, this._tokensCount); - } - return false; - } - slicedEquals(other, sliceFromTokenIndex, sliceTokenCount) { - if (this._text !== other._text) { - return false; - } - if (this._tokensCount !== other._tokensCount) { - return false; - } - const from = (sliceFromTokenIndex << 1); - const to = from + (sliceTokenCount << 1); - for (let i = from; i < to; i++) { - if (this._tokens[i] !== other._tokens[i]) { - return false; - } - } - return true; - } - getLineContent() { - return this._text; - } - getCount() { - return this._tokensCount; - } - getStartOffset(tokenIndex) { - if (tokenIndex > 0) { - return this._tokens[(tokenIndex - 1) << 1]; - } - return 0; - } - getMetadata(tokenIndex) { - const metadata = this._tokens[(tokenIndex << 1) + 1]; - return metadata; - } - getLanguageId(tokenIndex) { - const metadata = this._tokens[(tokenIndex << 1) + 1]; - return _modes_js__WEBPACK_IMPORTED_MODULE_0__["TokenMetadata"].getLanguageId(metadata); - } - getStandardTokenType(tokenIndex) { - const metadata = this._tokens[(tokenIndex << 1) + 1]; - return _modes_js__WEBPACK_IMPORTED_MODULE_0__["TokenMetadata"].getTokenType(metadata); - } - getForeground(tokenIndex) { - const metadata = this._tokens[(tokenIndex << 1) + 1]; - return _modes_js__WEBPACK_IMPORTED_MODULE_0__["TokenMetadata"].getForeground(metadata); - } - getClassName(tokenIndex) { - const metadata = this._tokens[(tokenIndex << 1) + 1]; - return _modes_js__WEBPACK_IMPORTED_MODULE_0__["TokenMetadata"].getClassNameFromMetadata(metadata); - } - getInlineStyle(tokenIndex, colorMap) { - const metadata = this._tokens[(tokenIndex << 1) + 1]; - return _modes_js__WEBPACK_IMPORTED_MODULE_0__["TokenMetadata"].getInlineStyleFromMetadata(metadata, colorMap); - } - getEndOffset(tokenIndex) { - return this._tokens[tokenIndex << 1]; - } - /** - * Find the token containing offset `offset`. - * @param offset The search offset - * @return The index of the token containing the offset. - */ - findTokenIndexAtOffset(offset) { - return LineTokens.findIndexInTokensArray(this._tokens, offset); - } - inflate() { - return this; - } - sliceAndInflate(startOffset, endOffset, deltaOffset) { - return new SlicedLineTokens(this, startOffset, endOffset, deltaOffset); - } - static convertToEndOffset(tokens, lineTextLength) { - const tokenCount = (tokens.length >>> 1); - const lastTokenIndex = tokenCount - 1; - for (let tokenIndex = 0; tokenIndex < lastTokenIndex; tokenIndex++) { - tokens[tokenIndex << 1] = tokens[(tokenIndex + 1) << 1]; - } - tokens[lastTokenIndex << 1] = lineTextLength; - } - static findIndexInTokensArray(tokens, desiredIndex) { - if (tokens.length <= 2) { - return 0; - } - let low = 0; - let high = (tokens.length >>> 1) - 1; - while (low < high) { - const mid = low + Math.floor((high - low) / 2); - const endOffset = tokens[(mid << 1)]; - if (endOffset === desiredIndex) { - return mid + 1; - } - else if (endOffset < desiredIndex) { - low = mid + 1; - } - else if (endOffset > desiredIndex) { - high = mid; - } - } - return low; - } -} -class SlicedLineTokens { - constructor(source, startOffset, endOffset, deltaOffset) { - this._source = source; - this._startOffset = startOffset; - this._endOffset = endOffset; - this._deltaOffset = deltaOffset; - this._firstTokenIndex = source.findTokenIndexAtOffset(startOffset); - this._tokensCount = 0; - for (let i = this._firstTokenIndex, len = source.getCount(); i < len; i++) { - const tokenStartOffset = source.getStartOffset(i); - if (tokenStartOffset >= endOffset) { - break; - } - this._tokensCount++; - } - } - equals(other) { - if (other instanceof SlicedLineTokens) { - return (this._startOffset === other._startOffset - && this._endOffset === other._endOffset - && this._deltaOffset === other._deltaOffset - && this._source.slicedEquals(other._source, this._firstTokenIndex, this._tokensCount)); - } - return false; - } - getCount() { - return this._tokensCount; - } - getForeground(tokenIndex) { - return this._source.getForeground(this._firstTokenIndex + tokenIndex); - } - getEndOffset(tokenIndex) { - const tokenEndOffset = this._source.getEndOffset(this._firstTokenIndex + tokenIndex); - return Math.min(this._endOffset, tokenEndOffset) - this._startOffset + this._deltaOffset; - } - getClassName(tokenIndex) { - return this._source.getClassName(this._firstTokenIndex + tokenIndex); - } - getInlineStyle(tokenIndex, colorMap) { - return this._source.getInlineStyle(this._firstTokenIndex + tokenIndex, colorMap); - } - findTokenIndexAtOffset(offset) { - return this._source.findTokenIndexAtOffset(offset + this._startOffset - this._deltaOffset) - this._firstTokenIndex; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js ***! - \**************************************************************************/ -/*! exports provided: Position */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * A position in the editor. - */ -class Position { - constructor(lineNumber, column) { - this.lineNumber = lineNumber; - this.column = column; - } - /** - * Create a new position from this position. - * - * @param newLineNumber new line number - * @param newColumn new column - */ - with(newLineNumber = this.lineNumber, newColumn = this.column) { - if (newLineNumber === this.lineNumber && newColumn === this.column) { - return this; - } - else { - return new Position(newLineNumber, newColumn); - } - } - /** - * Derive a new position from this position. - * - * @param deltaLineNumber line number delta - * @param deltaColumn column delta - */ - delta(deltaLineNumber = 0, deltaColumn = 0) { - return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); - } - /** - * Test if this position equals other position - */ - equals(other) { - return Position.equals(this, other); - } - /** - * Test if position `a` equals position `b` - */ - static equals(a, b) { - if (!a && !b) { - return true; - } - return (!!a && - !!b && - a.lineNumber === b.lineNumber && - a.column === b.column); - } - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be false. - */ - isBefore(other) { - return Position.isBefore(this, other); - } - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be false. - */ - static isBefore(a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column < b.column; - } - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be true. - */ - isBeforeOrEqual(other) { - return Position.isBeforeOrEqual(this, other); - } - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be true. - */ - static isBeforeOrEqual(a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column <= b.column; - } - /** - * A function that compares positions, useful for sorting - */ - static compare(a, b) { - let aLineNumber = a.lineNumber | 0; - let bLineNumber = b.lineNumber | 0; - if (aLineNumber === bLineNumber) { - let aColumn = a.column | 0; - let bColumn = b.column | 0; - return aColumn - bColumn; - } - return aLineNumber - bLineNumber; - } - /** - * Clone this position. - */ - clone() { - return new Position(this.lineNumber, this.column); - } - /** - * Convert to a human-readable representation. - */ - toString() { - return '(' + this.lineNumber + ',' + this.column + ')'; - } - // --- - /** - * Create a `Position` from an `IPosition`. - */ - static lift(pos) { - return new Position(pos.lineNumber, pos.column); - } - /** - * Test if `obj` is an `IPosition`. - */ - static isIPosition(obj) { - return (obj - && (typeof obj.lineNumber === 'number') - && (typeof obj.column === 'number')); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js ***! - \***********************************************************************/ -/*! exports provided: Range */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) - */ -class Range { - constructor(startLineNumber, startColumn, endLineNumber, endColumn) { - if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { - this.startLineNumber = endLineNumber; - this.startColumn = endColumn; - this.endLineNumber = startLineNumber; - this.endColumn = startColumn; - } - else { - this.startLineNumber = startLineNumber; - this.startColumn = startColumn; - this.endLineNumber = endLineNumber; - this.endColumn = endColumn; - } - } - /** - * Test if this range is empty. - */ - isEmpty() { - return Range.isEmpty(this); - } - /** - * Test if `range` is empty. - */ - static isEmpty(range) { - return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); - } - /** - * Test if position is in this range. If the position is at the edges, will return true. - */ - containsPosition(position) { - return Range.containsPosition(this, position); - } - /** - * Test if `position` is in `range`. If the position is at the edges, will return true. - */ - static containsPosition(range, position) { - if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { - return false; - } - if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { - return false; - } - if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { - return false; - } - return true; - } - /** - * Test if range is in this range. If the range is equal to this range, will return true. - */ - containsRange(range) { - return Range.containsRange(this, range); - } - /** - * Test if `otherRange` is in `range`. If the ranges are equal, will return true. - */ - static containsRange(range, otherRange) { - if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { - return false; - } - if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { - return false; - } - if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { - return false; - } - if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { - return false; - } - return true; - } - /** - * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true. - */ - strictContainsRange(range) { - return Range.strictContainsRange(this, range); - } - /** - * Test if `otherRange` is strinctly in `range` (must start after, and end before). If the ranges are equal, will return false. - */ - static strictContainsRange(range, otherRange) { - if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { - return false; - } - if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { - return false; - } - if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) { - return false; - } - if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) { - return false; - } - return true; - } - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - plusRange(range) { - return Range.plusRange(this, range); - } - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - static plusRange(a, b) { - let startLineNumber; - let startColumn; - let endLineNumber; - let endColumn; - if (b.startLineNumber < a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = b.startColumn; - } - else if (b.startLineNumber === a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = Math.min(b.startColumn, a.startColumn); - } - else { - startLineNumber = a.startLineNumber; - startColumn = a.startColumn; - } - if (b.endLineNumber > a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = b.endColumn; - } - else if (b.endLineNumber === a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = Math.max(b.endColumn, a.endColumn); - } - else { - endLineNumber = a.endLineNumber; - endColumn = a.endColumn; - } - return new Range(startLineNumber, startColumn, endLineNumber, endColumn); - } - /** - * A intersection of the two ranges. - */ - intersectRanges(range) { - return Range.intersectRanges(this, range); - } - /** - * A intersection of the two ranges. - */ - static intersectRanges(a, b) { - let resultStartLineNumber = a.startLineNumber; - let resultStartColumn = a.startColumn; - let resultEndLineNumber = a.endLineNumber; - let resultEndColumn = a.endColumn; - let otherStartLineNumber = b.startLineNumber; - let otherStartColumn = b.startColumn; - let otherEndLineNumber = b.endLineNumber; - let otherEndColumn = b.endColumn; - if (resultStartLineNumber < otherStartLineNumber) { - resultStartLineNumber = otherStartLineNumber; - resultStartColumn = otherStartColumn; - } - else if (resultStartLineNumber === otherStartLineNumber) { - resultStartColumn = Math.max(resultStartColumn, otherStartColumn); - } - if (resultEndLineNumber > otherEndLineNumber) { - resultEndLineNumber = otherEndLineNumber; - resultEndColumn = otherEndColumn; - } - else if (resultEndLineNumber === otherEndLineNumber) { - resultEndColumn = Math.min(resultEndColumn, otherEndColumn); - } - // Check if selection is now empty - if (resultStartLineNumber > resultEndLineNumber) { - return null; - } - if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { - return null; - } - return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); - } - /** - * Test if this range equals other. - */ - equalsRange(other) { - return Range.equalsRange(this, other); - } - /** - * Test if range `a` equals `b`. - */ - static equalsRange(a, b) { - return (!!a && - !!b && - a.startLineNumber === b.startLineNumber && - a.startColumn === b.startColumn && - a.endLineNumber === b.endLineNumber && - a.endColumn === b.endColumn); - } - /** - * Return the end position (which will be after or equal to the start position) - */ - getEndPosition() { - return Range.getEndPosition(this); - } - /** - * Return the end position (which will be after or equal to the start position) - */ - static getEndPosition(range) { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](range.endLineNumber, range.endColumn); - } - /** - * Return the start position (which will be before or equal to the end position) - */ - getStartPosition() { - return Range.getStartPosition(this); - } - /** - * Return the start position (which will be before or equal to the end position) - */ - static getStartPosition(range) { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](range.startLineNumber, range.startColumn); - } - /** - * Transform to a user presentable string representation. - */ - toString() { - return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; - } - /** - * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. - */ - setEndPosition(endLineNumber, endColumn) { - return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - } - /** - * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. - */ - setStartPosition(startLineNumber, startColumn) { - return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - } - /** - * Create a new empty range using this range's start position. - */ - collapseToStart() { - return Range.collapseToStart(this); - } - /** - * Create a new empty range using this range's start position. - */ - static collapseToStart(range) { - return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); - } - // --- - static fromPositions(start, end = start) { - return new Range(start.lineNumber, start.column, end.lineNumber, end.column); - } - static lift(range) { - if (!range) { - return null; - } - return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); - } - /** - * Test if `obj` is an `IRange`. - */ - static isIRange(obj) { - return (obj - && (typeof obj.startLineNumber === 'number') - && (typeof obj.startColumn === 'number') - && (typeof obj.endLineNumber === 'number') - && (typeof obj.endColumn === 'number')); - } - /** - * Test if the two ranges are touching in any way. - */ - static areIntersectingOrTouching(a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - } - /** - * Test if the two ranges are intersecting. If the ranges are touching it returns true. - */ - static areIntersecting(a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - } - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the startPosition and then on the endPosition - */ - static compareRangesUsingStarts(a, b) { - if (a && b) { - const aStartLineNumber = a.startLineNumber | 0; - const bStartLineNumber = b.startLineNumber | 0; - if (aStartLineNumber === bStartLineNumber) { - const aStartColumn = a.startColumn | 0; - const bStartColumn = b.startColumn | 0; - if (aStartColumn === bStartColumn) { - const aEndLineNumber = a.endLineNumber | 0; - const bEndLineNumber = b.endLineNumber | 0; - if (aEndLineNumber === bEndLineNumber) { - const aEndColumn = a.endColumn | 0; - const bEndColumn = b.endColumn | 0; - return aEndColumn - bEndColumn; - } - return aEndLineNumber - bEndLineNumber; - } - return aStartColumn - bStartColumn; - } - return aStartLineNumber - bStartLineNumber; - } - const aExists = (a ? 1 : 0); - const bExists = (b ? 1 : 0); - return aExists - bExists; - } - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the endPosition and then on the startPosition - */ - static compareRangesUsingEnds(a, b) { - if (a.endLineNumber === b.endLineNumber) { - if (a.endColumn === b.endColumn) { - if (a.startLineNumber === b.startLineNumber) { - return a.startColumn - b.startColumn; - } - return a.startLineNumber - b.startLineNumber; - } - return a.endColumn - b.endColumn; - } - return a.endLineNumber - b.endLineNumber; - } - /** - * Test if the range spans multiple lines. - */ - static spansMultipleLines(range) { - return range.endLineNumber > range.startLineNumber; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/rgba.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/rgba.js ***! - \**********************************************************************/ -/*! exports provided: RGBA8 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RGBA8", function() { return RGBA8; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * A very VM friendly rgba datastructure. - * Please don't touch unless you take a look at the IR. - */ -class RGBA8 { - constructor(r, g, b, a) { - this.r = RGBA8._clamp(r); - this.g = RGBA8._clamp(g); - this.b = RGBA8._clamp(b); - this.a = RGBA8._clamp(a); - } - equals(other) { - return (this.r === other.r - && this.g === other.g - && this.b === other.b - && this.a === other.a); - } - static _clamp(c) { - if (c < 0) { - return 0; - } - if (c > 255) { - return 255; - } - return c | 0; - } -} -RGBA8.Empty = new RGBA8(0, 0, 0, 0); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js ***! - \***************************************************************************/ -/*! exports provided: Selection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return Selection; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -/** - * A selection in the editor. - * The selection is a range that has an orientation. - */ -class Selection extends _range_js__WEBPACK_IMPORTED_MODULE_1__["Range"] { - constructor(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { - super(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn); - this.selectionStartLineNumber = selectionStartLineNumber; - this.selectionStartColumn = selectionStartColumn; - this.positionLineNumber = positionLineNumber; - this.positionColumn = positionColumn; - } - /** - * Transform to a human-readable representation. - */ - toString() { - return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; - } - /** - * Test if equals other selection. - */ - equalsSelection(other) { - return (Selection.selectionsEqual(this, other)); - } - /** - * Test if the two selections are equal. - */ - static selectionsEqual(a, b) { - return (a.selectionStartLineNumber === b.selectionStartLineNumber && - a.selectionStartColumn === b.selectionStartColumn && - a.positionLineNumber === b.positionLineNumber && - a.positionColumn === b.positionColumn); - } - /** - * Get directions (LTR or RTL). - */ - getDirection() { - if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { - return 0 /* LTR */; - } - return 1 /* RTL */; - } - /** - * Create a new selection with a different `positionLineNumber` and `positionColumn`. - */ - setEndPosition(endLineNumber, endColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); - } - /** - * Get the position at `positionLineNumber` and `positionColumn`. - */ - getPosition() { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.positionLineNumber, this.positionColumn); - } - /** - * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. - */ - setStartPosition(startLineNumber, startColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - } - return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); - } - // ---- - /** - * Create a `Selection` from one or two positions - */ - static fromPositions(start, end = start) { - return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); - } - /** - * Create a `Selection` from an `ISelection`. - */ - static liftSelection(sel) { - return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); - } - /** - * `a` equals `b`. - */ - static selectionsArrEqual(a, b) { - if (a && !b || !a && b) { - return false; - } - if (!a && !b) { - return true; - } - if (a.length !== b.length) { - return false; - } - for (let i = 0, len = a.length; i < len; i++) { - if (!this.selectionsEqual(a[i], b[i])) { - return false; - } - } - return true; - } - /** - * Test if `obj` is an `ISelection`. - */ - static isISelection(obj) { - return (obj - && (typeof obj.selectionStartLineNumber === 'number') - && (typeof obj.selectionStartColumn === 'number') - && (typeof obj.positionLineNumber === 'number') - && (typeof obj.positionColumn === 'number')); - } - /** - * Create with a direction. - */ - static createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, direction) { - if (direction === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/stringBuilder.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/stringBuilder.js ***! - \*******************************************************************************/ -/*! exports provided: getPlatformTextDecoder, hasTextDecoder, createStringBuilder, decodeUTF16LE */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPlatformTextDecoder", function() { return getPlatformTextDecoder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasTextDecoder", function() { return hasTextDecoder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStringBuilder", function() { return createStringBuilder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeUTF16LE", function() { return decodeUTF16LE; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/buffer.js */ "./node_modules/monaco-editor/esm/vs/base/common/buffer.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -let _platformTextDecoder; -function getPlatformTextDecoder() { - if (!_platformTextDecoder) { - _platformTextDecoder = new TextDecoder(_base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["isLittleEndian"]() ? 'UTF-16LE' : 'UTF-16BE'); - } - return _platformTextDecoder; -} -const hasTextDecoder = (typeof TextDecoder !== 'undefined'); -let createStringBuilder; -let decodeUTF16LE; -if (hasTextDecoder) { - createStringBuilder = (capacity) => new StringBuilder(capacity); - decodeUTF16LE = standardDecodeUTF16LE; -} -else { - createStringBuilder = (capacity) => new CompatStringBuilder(); - decodeUTF16LE = compatDecodeUTF16LE; -} -function standardDecodeUTF16LE(source, offset, len) { - const view = new Uint16Array(source.buffer, offset, len); - return getPlatformTextDecoder().decode(view); -} -function compatDecodeUTF16LE(source, offset, len) { - let result = []; - let resultLen = 0; - for (let i = 0; i < len; i++) { - const charCode = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_2__["readUInt16LE"](source, offset); - offset += 2; - result[resultLen++] = String.fromCharCode(charCode); - } - return result.join(''); -} -class StringBuilder { - constructor(capacity) { - this._capacity = capacity | 0; - this._buffer = new Uint16Array(this._capacity); - this._completedStrings = null; - this._bufferLength = 0; - } - reset() { - this._completedStrings = null; - this._bufferLength = 0; - } - build() { - if (this._completedStrings !== null) { - this._flushBuffer(); - return this._completedStrings.join(''); - } - return this._buildBuffer(); - } - _buildBuffer() { - if (this._bufferLength === 0) { - return ''; - } - const view = new Uint16Array(this._buffer.buffer, 0, this._bufferLength); - return getPlatformTextDecoder().decode(view); - } - _flushBuffer() { - const bufferString = this._buildBuffer(); - this._bufferLength = 0; - if (this._completedStrings === null) { - this._completedStrings = [bufferString]; - } - else { - this._completedStrings[this._completedStrings.length] = bufferString; - } - } - write1(charCode) { - const remainingSpace = this._capacity - this._bufferLength; - if (remainingSpace <= 1) { - if (remainingSpace === 0 || _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isHighSurrogate"](charCode)) { - this._flushBuffer(); - } - } - this._buffer[this._bufferLength++] = charCode; - } - appendASCII(charCode) { - if (this._bufferLength === this._capacity) { - // buffer is full - this._flushBuffer(); - } - this._buffer[this._bufferLength++] = charCode; - } - appendASCIIString(str) { - const strLen = str.length; - if (this._bufferLength + strLen >= this._capacity) { - // This string does not fit in the remaining buffer space - this._flushBuffer(); - this._completedStrings[this._completedStrings.length] = str; - return; - } - for (let i = 0; i < strLen; i++) { - this._buffer[this._bufferLength++] = str.charCodeAt(i); - } - } -} -class CompatStringBuilder { - constructor() { - this._pieces = []; - this._piecesLen = 0; - } - reset() { - this._pieces = []; - this._piecesLen = 0; - } - build() { - return this._pieces.join(''); - } - write1(charCode) { - this._pieces[this._piecesLen++] = String.fromCharCode(charCode); - } - appendASCII(charCode) { - this._pieces[this._piecesLen++] = String.fromCharCode(charCode); - } - appendASCIIString(str) { - this._pieces[this._piecesLen++] = str; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js ***! - \***********************************************************************/ -/*! exports provided: Token, TokenizationResult, TokenizationResult2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult", function() { return TokenizationResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult2", function() { return TokenizationResult2; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class Token { - constructor(offset, type, language) { - this.offset = offset | 0; // @perf - this.type = type; - this.language = language; - } - toString() { - return '(' + this.offset + ', ' + this.type + ')'; - } -} -class TokenizationResult { - constructor(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } -} -class TokenizationResult2 { - constructor(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js ***! - \******************************************************************************/ -/*! exports provided: DiffComputer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffComputer", function() { return DiffComputer; }); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -const MINIMUM_MATCHING_CHARACTER_LENGTH = 3; -function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) { - const diffAlgo = new _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__["LcsDiff"](originalSequence, modifiedSequence, continueProcessingPredicate); - return diffAlgo.ComputeDiff(pretty); -} -class LineSequence { - constructor(lines) { - const startColumns = []; - const endColumns = []; - for (let i = 0, length = lines.length; i < length; i++) { - startColumns[i] = getFirstNonBlankColumn(lines[i], 1); - endColumns[i] = getLastNonBlankColumn(lines[i], 1); - } - this.lines = lines; - this._startColumns = startColumns; - this._endColumns = endColumns; - } - getElements() { - const elements = []; - for (let i = 0, len = this.lines.length; i < len; i++) { - elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1); - } - return elements; - } - getStartLineNumber(i) { - return i + 1; - } - getEndLineNumber(i) { - return i + 1; - } - createCharSequence(shouldIgnoreTrimWhitespace, startIndex, endIndex) { - const charCodes = []; - const lineNumbers = []; - const columns = []; - let len = 0; - for (let index = startIndex; index <= endIndex; index++) { - const lineContent = this.lines[index]; - const startColumn = (shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1); - const endColumn = (shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1); - for (let col = startColumn; col < endColumn; col++) { - charCodes[len] = lineContent.charCodeAt(col - 1); - lineNumbers[len] = index + 1; - columns[len] = col; - len++; - } - } - return new CharSequence(charCodes, lineNumbers, columns); - } -} -class CharSequence { - constructor(charCodes, lineNumbers, columns) { - this._charCodes = charCodes; - this._lineNumbers = lineNumbers; - this._columns = columns; - } - getElements() { - return this._charCodes; - } - getStartLineNumber(i) { - return this._lineNumbers[i]; - } - getStartColumn(i) { - return this._columns[i]; - } - getEndLineNumber(i) { - return this._lineNumbers[i]; - } - getEndColumn(i) { - return this._columns[i] + 1; - } -} -class CharChange { - constructor(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) { - this.originalStartLineNumber = originalStartLineNumber; - this.originalStartColumn = originalStartColumn; - this.originalEndLineNumber = originalEndLineNumber; - this.originalEndColumn = originalEndColumn; - this.modifiedStartLineNumber = modifiedStartLineNumber; - this.modifiedStartColumn = modifiedStartColumn; - this.modifiedEndLineNumber = modifiedEndLineNumber; - this.modifiedEndColumn = modifiedEndColumn; - } - static createFromDiffChange(diffChange, originalCharSequence, modifiedCharSequence) { - let originalStartLineNumber; - let originalStartColumn; - let originalEndLineNumber; - let originalEndColumn; - let modifiedStartLineNumber; - let modifiedStartColumn; - let modifiedEndLineNumber; - let modifiedEndColumn; - if (diffChange.originalLength === 0) { - originalStartLineNumber = 0; - originalStartColumn = 0; - originalEndLineNumber = 0; - originalEndColumn = 0; - } - else { - originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart); - originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart); - originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1); - originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1); - } - if (diffChange.modifiedLength === 0) { - modifiedStartLineNumber = 0; - modifiedStartColumn = 0; - modifiedEndLineNumber = 0; - modifiedEndColumn = 0; - } - else { - modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart); - modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart); - modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1); - modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1); - } - return new CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn); - } -} -function postProcessCharChanges(rawChanges) { - if (rawChanges.length <= 1) { - return rawChanges; - } - const result = [rawChanges[0]]; - let prevChange = result[0]; - for (let i = 1, len = rawChanges.length; i < len; i++) { - const currChange = rawChanges[i]; - const originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength); - const modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength); - // Both of the above should be equal, but the continueProcessingPredicate may prevent this from being true - const matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength); - if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) { - // Merge the current change into the previous one - prevChange.originalLength = (currChange.originalStart + currChange.originalLength) - prevChange.originalStart; - prevChange.modifiedLength = (currChange.modifiedStart + currChange.modifiedLength) - prevChange.modifiedStart; - } - else { - // Add the current change - result.push(currChange); - prevChange = currChange; - } - } - return result; -} -class LineChange { - constructor(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges) { - this.originalStartLineNumber = originalStartLineNumber; - this.originalEndLineNumber = originalEndLineNumber; - this.modifiedStartLineNumber = modifiedStartLineNumber; - this.modifiedEndLineNumber = modifiedEndLineNumber; - this.charChanges = charChanges; - } - static createFromDiffResult(shouldIgnoreTrimWhitespace, diffChange, originalLineSequence, modifiedLineSequence, continueCharDiff, shouldComputeCharChanges, shouldPostProcessCharChanges) { - let originalStartLineNumber; - let originalEndLineNumber; - let modifiedStartLineNumber; - let modifiedEndLineNumber; - let charChanges = undefined; - if (diffChange.originalLength === 0) { - originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1; - originalEndLineNumber = 0; - } - else { - originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart); - originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1); - } - if (diffChange.modifiedLength === 0) { - modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1; - modifiedEndLineNumber = 0; - } - else { - modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart); - modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1); - } - if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) { - // Compute character changes for diff chunks of at most 20 lines... - const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1); - const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1); - let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes; - if (shouldPostProcessCharChanges) { - rawChanges = postProcessCharChanges(rawChanges); - } - charChanges = []; - for (let i = 0, length = rawChanges.length; i < length; i++) { - charChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence)); - } - } - return new LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges); - } -} -class DiffComputer { - constructor(originalLines, modifiedLines, opts) { - this.shouldComputeCharChanges = opts.shouldComputeCharChanges; - this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges; - this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace; - this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff; - this.originalLines = originalLines; - this.modifiedLines = modifiedLines; - this.original = new LineSequence(originalLines); - this.modified = new LineSequence(modifiedLines); - this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime); - this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5000)); // never run after 5s for character changes... - } - computeDiff() { - if (this.original.lines.length === 1 && this.original.lines[0].length === 0) { - // empty original => fast path - return { - quitEarly: false, - changes: [{ - originalStartLineNumber: 1, - originalEndLineNumber: 1, - modifiedStartLineNumber: 1, - modifiedEndLineNumber: this.modified.lines.length, - charChanges: [{ - modifiedEndColumn: 0, - modifiedEndLineNumber: 0, - modifiedStartColumn: 0, - modifiedStartLineNumber: 0, - originalEndColumn: 0, - originalEndLineNumber: 0, - originalStartColumn: 0, - originalStartLineNumber: 0 - }] - }] - }; - } - if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) { - // empty modified => fast path - return { - quitEarly: false, - changes: [{ - originalStartLineNumber: 1, - originalEndLineNumber: this.original.lines.length, - modifiedStartLineNumber: 1, - modifiedEndLineNumber: 1, - charChanges: [{ - modifiedEndColumn: 0, - modifiedEndLineNumber: 0, - modifiedStartColumn: 0, - modifiedStartLineNumber: 0, - originalEndColumn: 0, - originalEndLineNumber: 0, - originalStartColumn: 0, - originalStartLineNumber: 0 - }] - }] - }; - } - const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff); - const rawChanges = diffResult.changes; - const quitEarly = diffResult.quitEarly; - // The diff is always computed with ignoring trim whitespace - // This ensures we get the prettiest diff - if (this.shouldIgnoreTrimWhitespace) { - const lineChanges = []; - for (let i = 0, length = rawChanges.length; i < length; i++) { - lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)); - } - return { - quitEarly: quitEarly, - changes: lineChanges - }; - } - // Need to post-process and introduce changes where the trim whitespace is different - // Note that we are looping starting at -1 to also cover the lines before the first change - const result = []; - let originalLineIndex = 0; - let modifiedLineIndex = 0; - for (let i = -1 /* !!!! */, len = rawChanges.length; i < len; i++) { - const nextChange = (i + 1 < len ? rawChanges[i + 1] : null); - const originalStop = (nextChange ? nextChange.originalStart : this.originalLines.length); - const modifiedStop = (nextChange ? nextChange.modifiedStart : this.modifiedLines.length); - while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) { - const originalLine = this.originalLines[originalLineIndex]; - const modifiedLine = this.modifiedLines[modifiedLineIndex]; - if (originalLine !== modifiedLine) { - // These lines differ only in trim whitespace - // Check the leading whitespace - { - let originalStartColumn = getFirstNonBlankColumn(originalLine, 1); - let modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1); - while (originalStartColumn > 1 && modifiedStartColumn > 1) { - const originalChar = originalLine.charCodeAt(originalStartColumn - 2); - const modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2); - if (originalChar !== modifiedChar) { - break; - } - originalStartColumn--; - modifiedStartColumn--; - } - if (originalStartColumn > 1 || modifiedStartColumn > 1) { - this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, 1, originalStartColumn, modifiedLineIndex + 1, 1, modifiedStartColumn); - } - } - // Check the trailing whitespace - { - let originalEndColumn = getLastNonBlankColumn(originalLine, 1); - let modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1); - const originalMaxColumn = originalLine.length + 1; - const modifiedMaxColumn = modifiedLine.length + 1; - while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) { - const originalChar = originalLine.charCodeAt(originalEndColumn - 1); - const modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1); - if (originalChar !== modifiedChar) { - break; - } - originalEndColumn++; - modifiedEndColumn++; - } - if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) { - this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, originalEndColumn, originalMaxColumn, modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn); - } - } - } - originalLineIndex++; - modifiedLineIndex++; - } - if (nextChange) { - // Emit the actual change - result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)); - originalLineIndex += nextChange.originalLength; - modifiedLineIndex += nextChange.modifiedLength; - } - } - return { - quitEarly: quitEarly, - changes: result - }; - } - _pushTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) { - if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) { - // Merged into previous - return; - } - let charChanges = undefined; - if (this.shouldComputeCharChanges) { - charChanges = [new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)]; - } - result.push(new LineChange(originalLineNumber, originalLineNumber, modifiedLineNumber, modifiedLineNumber, charChanges)); - } - _mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) { - const len = result.length; - if (len === 0) { - return false; - } - const prevChange = result[len - 1]; - if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) { - // Don't merge with inserts/deletes - return false; - } - if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) { - prevChange.originalEndLineNumber = originalLineNumber; - prevChange.modifiedEndLineNumber = modifiedLineNumber; - if (this.shouldComputeCharChanges && prevChange.charChanges) { - prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)); - } - return true; - } - return false; - } -} -function getFirstNonBlankColumn(txt, defaultValue) { - const r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](txt); - if (r === -1) { - return defaultValue; - } - return r + 1; -} -function getLastNonBlankColumn(txt, defaultValue) { - const r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["lastNonWhitespaceIndex"](txt); - if (r === -1) { - return defaultValue; - } - return r + 2; -} -function createContinueProcessingPredicate(maximumRuntime) { - if (maximumRuntime === 0) { - return () => true; - } - const startTime = Date.now(); - return () => { - return Date.now() - startTime < maximumRuntime; - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/editorAction.js": -/*!*************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/editorAction.js ***! - \*************************************************************************/ -/*! exports provided: InternalEditorAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InternalEditorAction", function() { return InternalEditorAction; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class InternalEditorAction { - constructor(id, label, alias, precondition, run, contextKeyService) { - this.id = id; - this.label = label; - this.alias = alias; - this._precondition = precondition; - this._run = run; - this._contextKeyService = contextKeyService; - } - isSupported() { - return this._contextKeyService.contextMatchesRules(this._precondition); - } - run() { - if (!this.isSupported()) { - return Promise.resolve(undefined); - } - return this._run(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/editorCommon.js": -/*!*************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/editorCommon.js ***! - \*************************************************************************/ -/*! exports provided: isThemeColor, EditorType */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isThemeColor", function() { return isThemeColor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorType", function() { return EditorType; }); -/** - * @internal - */ -function isThemeColor(o) { - return o && typeof o.id === 'string'; -} -/** - * The type of the `IEditor`. - */ -const EditorType = { - ICodeEditor: 'vs.editor.ICodeEditor', - IDiffEditor: 'vs.editor.IDiffEditor' -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js ***! - \******************************************************************************/ -/*! exports provided: EditorContextKeys */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorContextKeys", function() { return EditorContextKeys; }); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var EditorContextKeys; -(function (EditorContextKeys) { - EditorContextKeys.editorSimpleInput = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorSimpleInput', false); - /** - * A context key that is set when the editor's text has focus (cursor is blinking). - * Is false when focus is in simple editor widgets (repl input, scm commit input). - */ - EditorContextKeys.editorTextFocus = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorTextFocus', false); - /** - * A context key that is set when the editor's text or an editor's widget has focus. - */ - EditorContextKeys.focus = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorFocus', false); - /** - * A context key that is set when any editor input has focus (regular editor, repl input...). - */ - EditorContextKeys.textInputFocus = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('textInputFocus', false); - EditorContextKeys.readOnly = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorReadonly', false); - EditorContextKeys.columnSelection = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorColumnSelection', false); - EditorContextKeys.writable = EditorContextKeys.readOnly.toNegated(); - EditorContextKeys.hasNonEmptySelection = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasSelection', false); - EditorContextKeys.hasOnlyEmptySelection = EditorContextKeys.hasNonEmptySelection.toNegated(); - EditorContextKeys.hasMultipleSelections = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasMultipleSelections', false); - EditorContextKeys.hasSingleSelection = EditorContextKeys.hasMultipleSelections.toNegated(); - EditorContextKeys.tabMovesFocus = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorTabMovesFocus', false); - EditorContextKeys.tabDoesNotMoveFocus = EditorContextKeys.tabMovesFocus.toNegated(); - EditorContextKeys.isInWalkThroughSnippet = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('isInEmbeddedEditor', false); - EditorContextKeys.canUndo = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('canUndo', false); - EditorContextKeys.canRedo = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('canRedo', false); - EditorContextKeys.hoverVisible = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHoverVisible', false); - /** - * A context key that is set when an editor is part of a larger editor, like notebooks or - * (future) a diff editor - */ - EditorContextKeys.inCompositeEditor = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('inCompositeEditor', undefined); - EditorContextKeys.notInCompositeEditor = EditorContextKeys.inCompositeEditor.toNegated(); - // -- mode context keys - EditorContextKeys.languageId = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorLangId', ''); - EditorContextKeys.hasCompletionItemProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasCompletionItemProvider', false); - EditorContextKeys.hasCodeActionsProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasCodeActionsProvider', false); - EditorContextKeys.hasCodeLensProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasCodeLensProvider', false); - EditorContextKeys.hasDefinitionProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasDefinitionProvider', false); - EditorContextKeys.hasDeclarationProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasDeclarationProvider', false); - EditorContextKeys.hasImplementationProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasImplementationProvider', false); - EditorContextKeys.hasTypeDefinitionProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasTypeDefinitionProvider', false); - EditorContextKeys.hasHoverProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasHoverProvider', false); - EditorContextKeys.hasDocumentHighlightProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasDocumentHighlightProvider', false); - EditorContextKeys.hasDocumentSymbolProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasDocumentSymbolProvider', false); - EditorContextKeys.hasReferenceProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasReferenceProvider', false); - EditorContextKeys.hasRenameProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasRenameProvider', false); - EditorContextKeys.hasSignatureHelpProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasSignatureHelpProvider', false); - // -- mode context keys: formatting - EditorContextKeys.hasDocumentFormattingProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasDocumentFormattingProvider', false); - EditorContextKeys.hasDocumentSelectionFormattingProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasDocumentSelectionFormattingProvider', false); - EditorContextKeys.hasMultipleDocumentFormattingProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasMultipleDocumentFormattingProvider', false); - EditorContextKeys.hasMultipleDocumentSelectionFormattingProvider = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('editorHasMultipleDocumentSelectionFormattingProvider', false); -})(EditorContextKeys || (EditorContextKeys = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model.js ***! - \******************************************************************/ -/*! exports provided: OverviewRulerLane, MinimapPosition, TextModelResolvedOptions, FindMatch, ValidAnnotatedEditOperation, ApplyEditsResult */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewRulerLane", function() { return OverviewRulerLane; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinimapPosition", function() { return MinimapPosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextModelResolvedOptions", function() { return TextModelResolvedOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindMatch", function() { return FindMatch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValidAnnotatedEditOperation", function() { return ValidAnnotatedEditOperation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ApplyEditsResult", function() { return ApplyEditsResult; }); -/** - * Vertical Lane in the overview ruler of the editor. - */ -var OverviewRulerLane; -(function (OverviewRulerLane) { - OverviewRulerLane[OverviewRulerLane["Left"] = 1] = "Left"; - OverviewRulerLane[OverviewRulerLane["Center"] = 2] = "Center"; - OverviewRulerLane[OverviewRulerLane["Right"] = 4] = "Right"; - OverviewRulerLane[OverviewRulerLane["Full"] = 7] = "Full"; -})(OverviewRulerLane || (OverviewRulerLane = {})); -/** - * Position in the minimap to render the decoration. - */ -var MinimapPosition; -(function (MinimapPosition) { - MinimapPosition[MinimapPosition["Inline"] = 1] = "Inline"; - MinimapPosition[MinimapPosition["Gutter"] = 2] = "Gutter"; -})(MinimapPosition || (MinimapPosition = {})); -class TextModelResolvedOptions { - /** - * @internal - */ - constructor(src) { - this.tabSize = Math.max(1, src.tabSize | 0); - this.indentSize = src.tabSize | 0; - this.insertSpaces = Boolean(src.insertSpaces); - this.defaultEOL = src.defaultEOL | 0; - this.trimAutoWhitespace = Boolean(src.trimAutoWhitespace); - } - /** - * @internal - */ - equals(other) { - return (this.tabSize === other.tabSize - && this.indentSize === other.indentSize - && this.insertSpaces === other.insertSpaces - && this.defaultEOL === other.defaultEOL - && this.trimAutoWhitespace === other.trimAutoWhitespace); - } - /** - * @internal - */ - createChangeEvent(newOpts) { - return { - tabSize: this.tabSize !== newOpts.tabSize, - indentSize: this.indentSize !== newOpts.indentSize, - insertSpaces: this.insertSpaces !== newOpts.insertSpaces, - trimAutoWhitespace: this.trimAutoWhitespace !== newOpts.trimAutoWhitespace, - }; - } -} -class FindMatch { - /** - * @internal - */ - constructor(range, matches) { - this.range = range; - this.matches = matches; - } -} -/** - * @internal - */ -class ValidAnnotatedEditOperation { - constructor(identifier, range, text, forceMoveMarkers, isAutoWhitespaceEdit, _isTracked) { - this.identifier = identifier; - this.range = range; - this.text = text; - this.forceMoveMarkers = forceMoveMarkers; - this.isAutoWhitespaceEdit = isAutoWhitespaceEdit; - this._isTracked = _isTracked; - } -} -/** - * @internal - */ -class ApplyEditsResult { - constructor(reverseEdits, changes, trimAutoWhitespaceLineNumbers) { - this.reverseEdits = reverseEdits; - this.changes = changes; - this.trimAutoWhitespaceLineNumbers = trimAutoWhitespaceLineNumbers; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/editStack.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/editStack.js ***! - \****************************************************************************/ -/*! exports provided: SingleModelEditStackElement, MultiModelEditStackElement, isEditStackElement, EditStack */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SingleModelEditStackElement", function() { return SingleModelEditStackElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiModelEditStackElement", function() { return MultiModelEditStackElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEditStackElement", function() { return isEditStackElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditStack", function() { return EditStack; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _textChange_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./textChange.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textChange.js"); -/* harmony import */ var _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/buffer.js */ "./node_modules/monaco-editor/esm/vs/base/common/buffer.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -function uriGetComparisonKey(resource) { - return resource.toString(); -} -class SingleModelEditStackData { - constructor(beforeVersionId, afterVersionId, beforeEOL, afterEOL, beforeCursorState, afterCursorState, changes) { - this.beforeVersionId = beforeVersionId; - this.afterVersionId = afterVersionId; - this.beforeEOL = beforeEOL; - this.afterEOL = afterEOL; - this.beforeCursorState = beforeCursorState; - this.afterCursorState = afterCursorState; - this.changes = changes; - } - static create(model, beforeCursorState) { - const alternativeVersionId = model.getAlternativeVersionId(); - const eol = getModelEOL(model); - return new SingleModelEditStackData(alternativeVersionId, alternativeVersionId, eol, eol, beforeCursorState, beforeCursorState, []); - } - append(model, textChanges, afterEOL, afterVersionId, afterCursorState) { - if (textChanges.length > 0) { - this.changes = Object(_textChange_js__WEBPACK_IMPORTED_MODULE_4__["compressConsecutiveTextChanges"])(this.changes, textChanges); - } - this.afterEOL = afterEOL; - this.afterVersionId = afterVersionId; - this.afterCursorState = afterCursorState; - } - static _writeSelectionsSize(selections) { - return 4 + 4 * 4 * (selections ? selections.length : 0); - } - static _writeSelections(b, selections, offset) { - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["writeUInt32BE"](b, (selections ? selections.length : 0), offset); - offset += 4; - if (selections) { - for (const selection of selections) { - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["writeUInt32BE"](b, selection.selectionStartLineNumber, offset); - offset += 4; - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["writeUInt32BE"](b, selection.selectionStartColumn, offset); - offset += 4; - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["writeUInt32BE"](b, selection.positionLineNumber, offset); - offset += 4; - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["writeUInt32BE"](b, selection.positionColumn, offset); - offset += 4; - } - } - return offset; - } - static _readSelections(b, offset, dest) { - const count = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["readUInt32BE"](b, offset); - offset += 4; - for (let i = 0; i < count; i++) { - const selectionStartLineNumber = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["readUInt32BE"](b, offset); - offset += 4; - const selectionStartColumn = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["readUInt32BE"](b, offset); - offset += 4; - const positionLineNumber = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["readUInt32BE"](b, offset); - offset += 4; - const positionColumn = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["readUInt32BE"](b, offset); - offset += 4; - dest.push(new _core_selection_js__WEBPACK_IMPORTED_MODULE_2__["Selection"](selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn)); - } - return offset; - } - serialize() { - let necessarySize = (+4 // beforeVersionId - + 4 // afterVersionId - + 1 // beforeEOL - + 1 // afterEOL - + SingleModelEditStackData._writeSelectionsSize(this.beforeCursorState) - + SingleModelEditStackData._writeSelectionsSize(this.afterCursorState) - + 4 // change count - ); - for (const change of this.changes) { - necessarySize += change.writeSize(); - } - const b = new Uint8Array(necessarySize); - let offset = 0; - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["writeUInt32BE"](b, this.beforeVersionId, offset); - offset += 4; - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["writeUInt32BE"](b, this.afterVersionId, offset); - offset += 4; - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["writeUInt8"](b, this.beforeEOL, offset); - offset += 1; - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["writeUInt8"](b, this.afterEOL, offset); - offset += 1; - offset = SingleModelEditStackData._writeSelections(b, this.beforeCursorState, offset); - offset = SingleModelEditStackData._writeSelections(b, this.afterCursorState, offset); - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["writeUInt32BE"](b, this.changes.length, offset); - offset += 4; - for (const change of this.changes) { - offset = change.write(b, offset); - } - return b.buffer; - } - static deserialize(source) { - const b = new Uint8Array(source); - let offset = 0; - const beforeVersionId = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["readUInt32BE"](b, offset); - offset += 4; - const afterVersionId = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["readUInt32BE"](b, offset); - offset += 4; - const beforeEOL = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["readUInt8"](b, offset); - offset += 1; - const afterEOL = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["readUInt8"](b, offset); - offset += 1; - const beforeCursorState = []; - offset = SingleModelEditStackData._readSelections(b, offset, beforeCursorState); - const afterCursorState = []; - offset = SingleModelEditStackData._readSelections(b, offset, afterCursorState); - const changeCount = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_5__["readUInt32BE"](b, offset); - offset += 4; - const changes = []; - for (let i = 0; i < changeCount; i++) { - offset = _textChange_js__WEBPACK_IMPORTED_MODULE_4__["TextChange"].read(b, offset, changes); - } - return new SingleModelEditStackData(beforeVersionId, afterVersionId, beforeEOL, afterEOL, beforeCursorState, afterCursorState, changes); - } -} -class SingleModelEditStackElement { - constructor(model, beforeCursorState) { - this.model = model; - this._data = SingleModelEditStackData.create(model, beforeCursorState); - } - get type() { - return 0 /* Resource */; - } - get resource() { - if (_base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"].isUri(this.model)) { - return this.model; - } - return this.model.uri; - } - get label() { - return _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('edit', "Typing"); - } - toString() { - const data = (this._data instanceof SingleModelEditStackData ? this._data : SingleModelEditStackData.deserialize(this._data)); - return data.changes.map(change => change.toString()).join(', '); - } - matchesResource(resource) { - const uri = (_base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"].isUri(this.model) ? this.model : this.model.uri); - return (uri.toString() === resource.toString()); - } - setModel(model) { - this.model = model; - } - canAppend(model) { - return (this.model === model && this._data instanceof SingleModelEditStackData); - } - append(model, textChanges, afterEOL, afterVersionId, afterCursorState) { - if (this._data instanceof SingleModelEditStackData) { - this._data.append(model, textChanges, afterEOL, afterVersionId, afterCursorState); - } - } - close() { - if (this._data instanceof SingleModelEditStackData) { - this._data = this._data.serialize(); - } - } - undo() { - if (_base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"].isUri(this.model)) { - // don't have a model - throw new Error(`Invalid SingleModelEditStackElement`); - } - if (this._data instanceof SingleModelEditStackData) { - this._data = this._data.serialize(); - } - const data = SingleModelEditStackData.deserialize(this._data); - this.model._applyUndo(data.changes, data.beforeEOL, data.beforeVersionId, data.beforeCursorState); - } - redo() { - if (_base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"].isUri(this.model)) { - // don't have a model - throw new Error(`Invalid SingleModelEditStackElement`); - } - if (this._data instanceof SingleModelEditStackData) { - this._data = this._data.serialize(); - } - const data = SingleModelEditStackData.deserialize(this._data); - this.model._applyRedo(data.changes, data.afterEOL, data.afterVersionId, data.afterCursorState); - } -} -class MultiModelEditStackElement { - constructor(label, editStackElements) { - this.type = 1 /* Workspace */; - this.label = label; - this._isOpen = true; - this._editStackElementsArr = editStackElements.slice(0); - this._editStackElementsMap = new Map(); - for (const editStackElement of this._editStackElementsArr) { - const key = uriGetComparisonKey(editStackElement.resource); - this._editStackElementsMap.set(key, editStackElement); - } - this._delegate = null; - } - get resources() { - return this._editStackElementsArr.map(editStackElement => editStackElement.resource); - } - prepareUndoRedo() { - if (this._delegate) { - return this._delegate.prepareUndoRedo(this); - } - } - matchesResource(resource) { - const key = uriGetComparisonKey(resource); - return (this._editStackElementsMap.has(key)); - } - setModel(model) { - const key = uriGetComparisonKey(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"].isUri(model) ? model : model.uri); - if (this._editStackElementsMap.has(key)) { - this._editStackElementsMap.get(key).setModel(model); - } - } - canAppend(model) { - if (!this._isOpen) { - return false; - } - const key = uriGetComparisonKey(model.uri); - if (this._editStackElementsMap.has(key)) { - const editStackElement = this._editStackElementsMap.get(key); - return editStackElement.canAppend(model); - } - return false; - } - append(model, textChanges, afterEOL, afterVersionId, afterCursorState) { - const key = uriGetComparisonKey(model.uri); - const editStackElement = this._editStackElementsMap.get(key); - editStackElement.append(model, textChanges, afterEOL, afterVersionId, afterCursorState); - } - close() { - this._isOpen = false; - } - undo() { - this._isOpen = false; - for (const editStackElement of this._editStackElementsArr) { - editStackElement.undo(); - } - } - redo() { - for (const editStackElement of this._editStackElementsArr) { - editStackElement.redo(); - } - } - split() { - return this._editStackElementsArr; - } -} -function getModelEOL(model) { - const eol = model.getEOL(); - if (eol === '\n') { - return 0 /* LF */; - } - else { - return 1 /* CRLF */; - } -} -function isEditStackElement(element) { - if (!element) { - return false; - } - return ((element instanceof SingleModelEditStackElement) || (element instanceof MultiModelEditStackElement)); -} -class EditStack { - constructor(model, undoRedoService) { - this._model = model; - this._undoRedoService = undoRedoService; - } - pushStackElement() { - const lastElement = this._undoRedoService.getLastElement(this._model.uri); - if (isEditStackElement(lastElement)) { - lastElement.close(); - } - } - clear() { - this._undoRedoService.removeElements(this._model.uri); - } - _getOrCreateEditStackElement(beforeCursorState) { - const lastElement = this._undoRedoService.getLastElement(this._model.uri); - if (isEditStackElement(lastElement) && lastElement.canAppend(this._model)) { - return lastElement; - } - const newElement = new SingleModelEditStackElement(this._model, beforeCursorState); - this._undoRedoService.pushElement(newElement); - return newElement; - } - pushEOL(eol) { - const editStackElement = this._getOrCreateEditStackElement(null); - this._model.setEOL(eol); - editStackElement.append(this._model, [], getModelEOL(this._model), this._model.getAlternativeVersionId(), null); - } - pushEditOperation(beforeCursorState, editOperations, cursorStateComputer) { - const editStackElement = this._getOrCreateEditStackElement(beforeCursorState); - const inverseEditOperations = this._model.applyEdits(editOperations, true); - const afterCursorState = EditStack._computeCursorState(cursorStateComputer, inverseEditOperations); - const textChanges = inverseEditOperations.map((op, index) => ({ index: index, textChange: op.textChange })); - textChanges.sort((a, b) => { - if (a.textChange.oldPosition === b.textChange.oldPosition) { - return a.index - b.index; - } - return a.textChange.oldPosition - b.textChange.oldPosition; - }); - editStackElement.append(this._model, textChanges.map(op => op.textChange), getModelEOL(this._model), this._model.getAlternativeVersionId(), afterCursorState); - return afterCursorState; - } - static _computeCursorState(cursorStateComputer, inverseEditOperations) { - try { - return cursorStateComputer ? cursorStateComputer(inverseEditOperations) : null; - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"])(e); - return null; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/indentationGuesser.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/indentationGuesser.js ***! - \*************************************************************************************/ -/*! exports provided: guessIndentation */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "guessIndentation", function() { return guessIndentation; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class SpacesDiffResult { - constructor() { - this.spacesDiff = 0; - this.looksLikeAlignment = false; - } -} -/** - * Compute the diff in spaces between two line's indentation. - */ -function spacesDiff(a, aLength, b, bLength, result) { - result.spacesDiff = 0; - result.looksLikeAlignment = false; - // This can go both ways (e.g.): - // - a: "\t" - // - b: "\t " - // => This should count 1 tab and 4 spaces - let i; - for (i = 0; i < aLength && i < bLength; i++) { - let aCharCode = a.charCodeAt(i); - let bCharCode = b.charCodeAt(i); - if (aCharCode !== bCharCode) { - break; - } - } - let aSpacesCnt = 0, aTabsCount = 0; - for (let j = i; j < aLength; j++) { - let aCharCode = a.charCodeAt(j); - if (aCharCode === 32 /* Space */) { - aSpacesCnt++; - } - else { - aTabsCount++; - } - } - let bSpacesCnt = 0, bTabsCount = 0; - for (let j = i; j < bLength; j++) { - let bCharCode = b.charCodeAt(j); - if (bCharCode === 32 /* Space */) { - bSpacesCnt++; - } - else { - bTabsCount++; - } - } - if (aSpacesCnt > 0 && aTabsCount > 0) { - return; - } - if (bSpacesCnt > 0 && bTabsCount > 0) { - return; - } - let tabsDiff = Math.abs(aTabsCount - bTabsCount); - let spacesDiff = Math.abs(aSpacesCnt - bSpacesCnt); - if (tabsDiff === 0) { - // check if the indentation difference might be caused by alignment reasons - // sometime folks like to align their code, but this should not be used as a hint - result.spacesDiff = spacesDiff; - if (spacesDiff > 0 && 0 <= bSpacesCnt - 1 && bSpacesCnt - 1 < a.length && bSpacesCnt < b.length) { - if (b.charCodeAt(bSpacesCnt) !== 32 /* Space */ && a.charCodeAt(bSpacesCnt - 1) === 32 /* Space */) { - if (a.charCodeAt(a.length - 1) === 44 /* Comma */) { - // This looks like an alignment desire: e.g. - // const a = b + c, - // d = b - c; - result.looksLikeAlignment = true; - } - } - } - return; - } - if (spacesDiff % tabsDiff === 0) { - result.spacesDiff = spacesDiff / tabsDiff; - return; - } -} -function guessIndentation(source, defaultTabSize, defaultInsertSpaces) { - // Look at most at the first 10k lines - const linesCount = Math.min(source.getLineCount(), 10000); - let linesIndentedWithTabsCount = 0; // number of lines that contain at least one tab in indentation - let linesIndentedWithSpacesCount = 0; // number of lines that contain only spaces in indentation - let previousLineText = ''; // content of latest line that contained non-whitespace chars - let previousLineIndentation = 0; // index at which latest line contained the first non-whitespace char - const ALLOWED_TAB_SIZE_GUESSES = [2, 4, 6, 8, 3, 5, 7]; // prefer even guesses for `tabSize`, limit to [2, 8]. - const MAX_ALLOWED_TAB_SIZE_GUESS = 8; // max(ALLOWED_TAB_SIZE_GUESSES) = 8 - let spacesDiffCount = [0, 0, 0, 0, 0, 0, 0, 0, 0]; // `tabSize` scores - let tmp = new SpacesDiffResult(); - for (let lineNumber = 1; lineNumber <= linesCount; lineNumber++) { - let currentLineLength = source.getLineLength(lineNumber); - let currentLineText = source.getLineContent(lineNumber); - // if the text buffer is chunk based, so long lines are cons-string, v8 will flattern the string when we check charCode. - // checking charCode on chunks directly is cheaper. - const useCurrentLineText = (currentLineLength <= 65536); - let currentLineHasContent = false; // does `currentLineText` contain non-whitespace chars - let currentLineIndentation = 0; // index at which `currentLineText` contains the first non-whitespace char - let currentLineSpacesCount = 0; // count of spaces found in `currentLineText` indentation - let currentLineTabsCount = 0; // count of tabs found in `currentLineText` indentation - for (let j = 0, lenJ = currentLineLength; j < lenJ; j++) { - let charCode = (useCurrentLineText ? currentLineText.charCodeAt(j) : source.getLineCharCode(lineNumber, j)); - if (charCode === 9 /* Tab */) { - currentLineTabsCount++; - } - else if (charCode === 32 /* Space */) { - currentLineSpacesCount++; - } - else { - // Hit non whitespace character on this line - currentLineHasContent = true; - currentLineIndentation = j; - break; - } - } - // Ignore empty or only whitespace lines - if (!currentLineHasContent) { - continue; - } - if (currentLineTabsCount > 0) { - linesIndentedWithTabsCount++; - } - else if (currentLineSpacesCount > 1) { - linesIndentedWithSpacesCount++; - } - spacesDiff(previousLineText, previousLineIndentation, currentLineText, currentLineIndentation, tmp); - if (tmp.looksLikeAlignment) { - // if defaultInsertSpaces === true && the spaces count == tabSize, we may want to count it as valid indentation - // - // - item1 - // - item2 - // - // otherwise skip this line entirely - // - // const a = 1, - // b = 2; - if (!(defaultInsertSpaces && defaultTabSize === tmp.spacesDiff)) { - continue; - } - } - let currentSpacesDiff = tmp.spacesDiff; - if (currentSpacesDiff <= MAX_ALLOWED_TAB_SIZE_GUESS) { - spacesDiffCount[currentSpacesDiff]++; - } - previousLineText = currentLineText; - previousLineIndentation = currentLineIndentation; - } - let insertSpaces = defaultInsertSpaces; - if (linesIndentedWithTabsCount !== linesIndentedWithSpacesCount) { - insertSpaces = (linesIndentedWithTabsCount < linesIndentedWithSpacesCount); - } - let tabSize = defaultTabSize; - // Guess tabSize only if inserting spaces... - if (insertSpaces) { - let tabSizeScore = (insertSpaces ? 0 : 0.1 * linesCount); - // console.log("score threshold: " + tabSizeScore); - ALLOWED_TAB_SIZE_GUESSES.forEach((possibleTabSize) => { - let possibleTabSizeScore = spacesDiffCount[possibleTabSize]; - if (possibleTabSizeScore > tabSizeScore) { - tabSizeScore = possibleTabSizeScore; - tabSize = possibleTabSize; - } - }); - // Let a tabSize of 2 win even if it is not the maximum - // (only in case 4 was guessed) - if (tabSize === 4 && spacesDiffCount[4] > 0 && spacesDiffCount[2] > 0 && spacesDiffCount[2] >= spacesDiffCount[4] / 2) { - tabSize = 2; - } - } - // console.log('--------------------------'); - // console.log('linesIndentedWithTabsCount: ' + linesIndentedWithTabsCount + ', linesIndentedWithSpacesCount: ' + linesIndentedWithSpacesCount); - // console.log('spacesDiffCount: ' + spacesDiffCount); - // console.log('tabSize: ' + tabSize + ', tabSizeScore: ' + tabSizeScore); - return { - insertSpaces: insertSpaces, - tabSize: tabSize - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/intervalTree.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/intervalTree.js ***! - \*******************************************************************************/ -/*! exports provided: getNodeColor, getNodeIsInOverviewRuler, IntervalNode, SENTINEL, IntervalTree, nodeAcceptEdit, recomputeMaxEnd, intervalCompare */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeColor", function() { return getNodeColor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeIsInOverviewRuler", function() { return getNodeIsInOverviewRuler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntervalNode", function() { return IntervalNode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SENTINEL", function() { return SENTINEL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntervalTree", function() { return IntervalTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nodeAcceptEdit", function() { return nodeAcceptEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recomputeMaxEnd", function() { return recomputeMaxEnd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "intervalCompare", function() { return intervalCompare; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function getNodeColor(node) { - return ((node.metadata & 1 /* ColorMask */) >>> 0 /* ColorOffset */); -} -function setNodeColor(node, color) { - node.metadata = ((node.metadata & 254 /* ColorMaskInverse */) | (color << 0 /* ColorOffset */)); -} -function getNodeIsVisited(node) { - return ((node.metadata & 2 /* IsVisitedMask */) >>> 1 /* IsVisitedOffset */) === 1; -} -function setNodeIsVisited(node, value) { - node.metadata = ((node.metadata & 253 /* IsVisitedMaskInverse */) | ((value ? 1 : 0) << 1 /* IsVisitedOffset */)); -} -function getNodeIsForValidation(node) { - return ((node.metadata & 4 /* IsForValidationMask */) >>> 2 /* IsForValidationOffset */) === 1; -} -function setNodeIsForValidation(node, value) { - node.metadata = ((node.metadata & 251 /* IsForValidationMaskInverse */) | ((value ? 1 : 0) << 2 /* IsForValidationOffset */)); -} -function getNodeIsInOverviewRuler(node) { - return ((node.metadata & 8 /* IsInOverviewRulerMask */) >>> 3 /* IsInOverviewRulerOffset */) === 1; -} -function setNodeIsInOverviewRuler(node, value) { - node.metadata = ((node.metadata & 247 /* IsInOverviewRulerMaskInverse */) | ((value ? 1 : 0) << 3 /* IsInOverviewRulerOffset */)); -} -function getNodeStickiness(node) { - return ((node.metadata & 48 /* StickinessMask */) >>> 4 /* StickinessOffset */); -} -function _setNodeStickiness(node, stickiness) { - node.metadata = ((node.metadata & 207 /* StickinessMaskInverse */) | (stickiness << 4 /* StickinessOffset */)); -} -function getCollapseOnReplaceEdit(node) { - return ((node.metadata & 64 /* CollapseOnReplaceEditMask */) >>> 6 /* CollapseOnReplaceEditOffset */) === 1; -} -function setCollapseOnReplaceEdit(node, value) { - node.metadata = ((node.metadata & 191 /* CollapseOnReplaceEditMaskInverse */) | ((value ? 1 : 0) << 6 /* CollapseOnReplaceEditOffset */)); -} -class IntervalNode { - constructor(id, start, end) { - this.metadata = 0; - this.parent = this; - this.left = this; - this.right = this; - setNodeColor(this, 1 /* Red */); - this.start = start; - this.end = end; - // FORCE_OVERFLOWING_TEST: this.delta = start; - this.delta = 0; - this.maxEnd = end; - this.id = id; - this.ownerId = 0; - this.options = null; - setNodeIsForValidation(this, false); - _setNodeStickiness(this, 1 /* NeverGrowsWhenTypingAtEdges */); - setNodeIsInOverviewRuler(this, false); - setCollapseOnReplaceEdit(this, false); - this.cachedVersionId = 0; - this.cachedAbsoluteStart = start; - this.cachedAbsoluteEnd = end; - this.range = null; - setNodeIsVisited(this, false); - } - reset(versionId, start, end, range) { - this.start = start; - this.end = end; - this.maxEnd = end; - this.cachedVersionId = versionId; - this.cachedAbsoluteStart = start; - this.cachedAbsoluteEnd = end; - this.range = range; - } - setOptions(options) { - this.options = options; - let className = this.options.className; - setNodeIsForValidation(this, (className === "squiggly-error" /* EditorErrorDecoration */ - || className === "squiggly-warning" /* EditorWarningDecoration */ - || className === "squiggly-info" /* EditorInfoDecoration */)); - _setNodeStickiness(this, this.options.stickiness); - setNodeIsInOverviewRuler(this, (this.options.overviewRuler && this.options.overviewRuler.color) ? true : false); - setCollapseOnReplaceEdit(this, this.options.collapseOnReplaceEdit); - } - setCachedOffsets(absoluteStart, absoluteEnd, cachedVersionId) { - if (this.cachedVersionId !== cachedVersionId) { - this.range = null; - } - this.cachedVersionId = cachedVersionId; - this.cachedAbsoluteStart = absoluteStart; - this.cachedAbsoluteEnd = absoluteEnd; - } - detach() { - this.parent = null; - this.left = null; - this.right = null; - } -} -const SENTINEL = new IntervalNode(null, 0, 0); -SENTINEL.parent = SENTINEL; -SENTINEL.left = SENTINEL; -SENTINEL.right = SENTINEL; -setNodeColor(SENTINEL, 0 /* Black */); -class IntervalTree { - constructor() { - this.root = SENTINEL; - this.requestNormalizeDelta = false; - } - intervalSearch(start, end, filterOwnerId, filterOutValidation, cachedVersionId) { - if (this.root === SENTINEL) { - return []; - } - return intervalSearch(this, start, end, filterOwnerId, filterOutValidation, cachedVersionId); - } - search(filterOwnerId, filterOutValidation, cachedVersionId) { - if (this.root === SENTINEL) { - return []; - } - return search(this, filterOwnerId, filterOutValidation, cachedVersionId); - } - /** - * Will not set `cachedAbsoluteStart` nor `cachedAbsoluteEnd` on the returned nodes! - */ - collectNodesFromOwner(ownerId) { - return collectNodesFromOwner(this, ownerId); - } - /** - * Will not set `cachedAbsoluteStart` nor `cachedAbsoluteEnd` on the returned nodes! - */ - collectNodesPostOrder() { - return collectNodesPostOrder(this); - } - insert(node) { - rbTreeInsert(this, node); - this._normalizeDeltaIfNecessary(); - } - delete(node) { - rbTreeDelete(this, node); - this._normalizeDeltaIfNecessary(); - } - resolveNode(node, cachedVersionId) { - const initialNode = node; - let delta = 0; - while (node !== this.root) { - if (node === node.parent.right) { - delta += node.parent.delta; - } - node = node.parent; - } - const nodeStart = initialNode.start + delta; - const nodeEnd = initialNode.end + delta; - initialNode.setCachedOffsets(nodeStart, nodeEnd, cachedVersionId); - } - acceptReplace(offset, length, textLength, forceMoveMarkers) { - // Our strategy is to remove all directly impacted nodes, and then add them back to the tree. - // (1) collect all nodes that are intersecting this edit as nodes of interest - const nodesOfInterest = searchForEditing(this, offset, offset + length); - // (2) remove all nodes that are intersecting this edit - for (let i = 0, len = nodesOfInterest.length; i < len; i++) { - const node = nodesOfInterest[i]; - rbTreeDelete(this, node); - } - this._normalizeDeltaIfNecessary(); - // (3) edit all tree nodes except the nodes of interest - noOverlapReplace(this, offset, offset + length, textLength); - this._normalizeDeltaIfNecessary(); - // (4) edit the nodes of interest and insert them back in the tree - for (let i = 0, len = nodesOfInterest.length; i < len; i++) { - const node = nodesOfInterest[i]; - node.start = node.cachedAbsoluteStart; - node.end = node.cachedAbsoluteEnd; - nodeAcceptEdit(node, offset, (offset + length), textLength, forceMoveMarkers); - node.maxEnd = node.end; - rbTreeInsert(this, node); - } - this._normalizeDeltaIfNecessary(); - } - _normalizeDeltaIfNecessary() { - if (!this.requestNormalizeDelta) { - return; - } - this.requestNormalizeDelta = false; - normalizeDelta(this); - } -} -//#region Delta Normalization -function normalizeDelta(T) { - let node = T.root; - let delta = 0; - while (node !== SENTINEL) { - if (node.left !== SENTINEL && !getNodeIsVisited(node.left)) { - // go left - node = node.left; - continue; - } - if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { - // go right - delta += node.delta; - node = node.right; - continue; - } - // handle current node - node.start = delta + node.start; - node.end = delta + node.end; - node.delta = 0; - recomputeMaxEnd(node); - setNodeIsVisited(node, true); - // going up from this node - setNodeIsVisited(node.left, false); - setNodeIsVisited(node.right, false); - if (node === node.parent.right) { - delta -= node.parent.delta; - } - node = node.parent; - } - setNodeIsVisited(T.root, false); -} -function adjustMarkerBeforeColumn(markerOffset, markerStickToPreviousCharacter, checkOffset, moveSemantics) { - if (markerOffset < checkOffset) { - return true; - } - if (markerOffset > checkOffset) { - return false; - } - if (moveSemantics === 1 /* ForceMove */) { - return false; - } - if (moveSemantics === 2 /* ForceStay */) { - return true; - } - return markerStickToPreviousCharacter; -} -/** - * This is a lot more complicated than strictly necessary to maintain the same behaviour - * as when decorations were implemented using two markers. - */ -function nodeAcceptEdit(node, start, end, textLength, forceMoveMarkers) { - const nodeStickiness = getNodeStickiness(node); - const startStickToPreviousCharacter = (nodeStickiness === 0 /* AlwaysGrowsWhenTypingAtEdges */ - || nodeStickiness === 2 /* GrowsOnlyWhenTypingBefore */); - const endStickToPreviousCharacter = (nodeStickiness === 1 /* NeverGrowsWhenTypingAtEdges */ - || nodeStickiness === 2 /* GrowsOnlyWhenTypingBefore */); - const deletingCnt = (end - start); - const insertingCnt = textLength; - const commonLength = Math.min(deletingCnt, insertingCnt); - const nodeStart = node.start; - let startDone = false; - const nodeEnd = node.end; - let endDone = false; - if (start <= nodeStart && nodeEnd <= end && getCollapseOnReplaceEdit(node)) { - // This edit encompasses the entire decoration range - // and the decoration has asked to become collapsed - node.start = start; - startDone = true; - node.end = start; - endDone = true; - } - { - const moveSemantics = forceMoveMarkers ? 1 /* ForceMove */ : (deletingCnt > 0 ? 2 /* ForceStay */ : 0 /* MarkerDefined */); - if (!startDone && adjustMarkerBeforeColumn(nodeStart, startStickToPreviousCharacter, start, moveSemantics)) { - startDone = true; - } - if (!endDone && adjustMarkerBeforeColumn(nodeEnd, endStickToPreviousCharacter, start, moveSemantics)) { - endDone = true; - } - } - if (commonLength > 0 && !forceMoveMarkers) { - const moveSemantics = (deletingCnt > insertingCnt ? 2 /* ForceStay */ : 0 /* MarkerDefined */); - if (!startDone && adjustMarkerBeforeColumn(nodeStart, startStickToPreviousCharacter, start + commonLength, moveSemantics)) { - startDone = true; - } - if (!endDone && adjustMarkerBeforeColumn(nodeEnd, endStickToPreviousCharacter, start + commonLength, moveSemantics)) { - endDone = true; - } - } - { - const moveSemantics = forceMoveMarkers ? 1 /* ForceMove */ : 0 /* MarkerDefined */; - if (!startDone && adjustMarkerBeforeColumn(nodeStart, startStickToPreviousCharacter, end, moveSemantics)) { - node.start = start + insertingCnt; - startDone = true; - } - if (!endDone && adjustMarkerBeforeColumn(nodeEnd, endStickToPreviousCharacter, end, moveSemantics)) { - node.end = start + insertingCnt; - endDone = true; - } - } - // Finish - const deltaColumn = (insertingCnt - deletingCnt); - if (!startDone) { - node.start = Math.max(0, nodeStart + deltaColumn); - } - if (!endDone) { - node.end = Math.max(0, nodeEnd + deltaColumn); - } - if (node.start > node.end) { - node.end = node.start; - } -} -function searchForEditing(T, start, end) { - // https://en.wikipedia.org/wiki/Interval_tree#Augmented_tree - // Now, it is known that two intervals A and B overlap only when both - // A.low <= B.high and A.high >= B.low. When searching the trees for - // nodes overlapping with a given interval, you can immediately skip: - // a) all nodes to the right of nodes whose low value is past the end of the given interval. - // b) all nodes that have their maximum 'high' value below the start of the given interval. - let node = T.root; - let delta = 0; - let nodeMaxEnd = 0; - let nodeStart = 0; - let nodeEnd = 0; - let result = []; - let resultLen = 0; - while (node !== SENTINEL) { - if (getNodeIsVisited(node)) { - // going up from this node - setNodeIsVisited(node.left, false); - setNodeIsVisited(node.right, false); - if (node === node.parent.right) { - delta -= node.parent.delta; - } - node = node.parent; - continue; - } - if (!getNodeIsVisited(node.left)) { - // first time seeing this node - nodeMaxEnd = delta + node.maxEnd; - if (nodeMaxEnd < start) { - // cover case b) from above - // there is no need to search this node or its children - setNodeIsVisited(node, true); - continue; - } - if (node.left !== SENTINEL) { - // go left - node = node.left; - continue; - } - } - // handle current node - nodeStart = delta + node.start; - if (nodeStart > end) { - // cover case a) from above - // there is no need to search this node or its right subtree - setNodeIsVisited(node, true); - continue; - } - nodeEnd = delta + node.end; - if (nodeEnd >= start) { - node.setCachedOffsets(nodeStart, nodeEnd, 0); - result[resultLen++] = node; - } - setNodeIsVisited(node, true); - if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { - // go right - delta += node.delta; - node = node.right; - continue; - } - } - setNodeIsVisited(T.root, false); - return result; -} -function noOverlapReplace(T, start, end, textLength) { - // https://en.wikipedia.org/wiki/Interval_tree#Augmented_tree - // Now, it is known that two intervals A and B overlap only when both - // A.low <= B.high and A.high >= B.low. When searching the trees for - // nodes overlapping with a given interval, you can immediately skip: - // a) all nodes to the right of nodes whose low value is past the end of the given interval. - // b) all nodes that have their maximum 'high' value below the start of the given interval. - let node = T.root; - let delta = 0; - let nodeMaxEnd = 0; - let nodeStart = 0; - const editDelta = (textLength - (end - start)); - while (node !== SENTINEL) { - if (getNodeIsVisited(node)) { - // going up from this node - setNodeIsVisited(node.left, false); - setNodeIsVisited(node.right, false); - if (node === node.parent.right) { - delta -= node.parent.delta; - } - recomputeMaxEnd(node); - node = node.parent; - continue; - } - if (!getNodeIsVisited(node.left)) { - // first time seeing this node - nodeMaxEnd = delta + node.maxEnd; - if (nodeMaxEnd < start) { - // cover case b) from above - // there is no need to search this node or its children - setNodeIsVisited(node, true); - continue; - } - if (node.left !== SENTINEL) { - // go left - node = node.left; - continue; - } - } - // handle current node - nodeStart = delta + node.start; - if (nodeStart > end) { - node.start += editDelta; - node.end += editDelta; - node.delta += editDelta; - if (node.delta < -1073741824 /* MIN_SAFE_DELTA */ || node.delta > 1073741824 /* MAX_SAFE_DELTA */) { - T.requestNormalizeDelta = true; - } - // cover case a) from above - // there is no need to search this node or its right subtree - setNodeIsVisited(node, true); - continue; - } - setNodeIsVisited(node, true); - if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { - // go right - delta += node.delta; - node = node.right; - continue; - } - } - setNodeIsVisited(T.root, false); -} -//#endregion -//#region Searching -function collectNodesFromOwner(T, ownerId) { - let node = T.root; - let result = []; - let resultLen = 0; - while (node !== SENTINEL) { - if (getNodeIsVisited(node)) { - // going up from this node - setNodeIsVisited(node.left, false); - setNodeIsVisited(node.right, false); - node = node.parent; - continue; - } - if (node.left !== SENTINEL && !getNodeIsVisited(node.left)) { - // go left - node = node.left; - continue; - } - // handle current node - if (node.ownerId === ownerId) { - result[resultLen++] = node; - } - setNodeIsVisited(node, true); - if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { - // go right - node = node.right; - continue; - } - } - setNodeIsVisited(T.root, false); - return result; -} -function collectNodesPostOrder(T) { - let node = T.root; - let result = []; - let resultLen = 0; - while (node !== SENTINEL) { - if (getNodeIsVisited(node)) { - // going up from this node - setNodeIsVisited(node.left, false); - setNodeIsVisited(node.right, false); - node = node.parent; - continue; - } - if (node.left !== SENTINEL && !getNodeIsVisited(node.left)) { - // go left - node = node.left; - continue; - } - if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { - // go right - node = node.right; - continue; - } - // handle current node - result[resultLen++] = node; - setNodeIsVisited(node, true); - } - setNodeIsVisited(T.root, false); - return result; -} -function search(T, filterOwnerId, filterOutValidation, cachedVersionId) { - let node = T.root; - let delta = 0; - let nodeStart = 0; - let nodeEnd = 0; - let result = []; - let resultLen = 0; - while (node !== SENTINEL) { - if (getNodeIsVisited(node)) { - // going up from this node - setNodeIsVisited(node.left, false); - setNodeIsVisited(node.right, false); - if (node === node.parent.right) { - delta -= node.parent.delta; - } - node = node.parent; - continue; - } - if (node.left !== SENTINEL && !getNodeIsVisited(node.left)) { - // go left - node = node.left; - continue; - } - // handle current node - nodeStart = delta + node.start; - nodeEnd = delta + node.end; - node.setCachedOffsets(nodeStart, nodeEnd, cachedVersionId); - let include = true; - if (filterOwnerId && node.ownerId && node.ownerId !== filterOwnerId) { - include = false; - } - if (filterOutValidation && getNodeIsForValidation(node)) { - include = false; - } - if (include) { - result[resultLen++] = node; - } - setNodeIsVisited(node, true); - if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { - // go right - delta += node.delta; - node = node.right; - continue; - } - } - setNodeIsVisited(T.root, false); - return result; -} -function intervalSearch(T, intervalStart, intervalEnd, filterOwnerId, filterOutValidation, cachedVersionId) { - // https://en.wikipedia.org/wiki/Interval_tree#Augmented_tree - // Now, it is known that two intervals A and B overlap only when both - // A.low <= B.high and A.high >= B.low. When searching the trees for - // nodes overlapping with a given interval, you can immediately skip: - // a) all nodes to the right of nodes whose low value is past the end of the given interval. - // b) all nodes that have their maximum 'high' value below the start of the given interval. - let node = T.root; - let delta = 0; - let nodeMaxEnd = 0; - let nodeStart = 0; - let nodeEnd = 0; - let result = []; - let resultLen = 0; - while (node !== SENTINEL) { - if (getNodeIsVisited(node)) { - // going up from this node - setNodeIsVisited(node.left, false); - setNodeIsVisited(node.right, false); - if (node === node.parent.right) { - delta -= node.parent.delta; - } - node = node.parent; - continue; - } - if (!getNodeIsVisited(node.left)) { - // first time seeing this node - nodeMaxEnd = delta + node.maxEnd; - if (nodeMaxEnd < intervalStart) { - // cover case b) from above - // there is no need to search this node or its children - setNodeIsVisited(node, true); - continue; - } - if (node.left !== SENTINEL) { - // go left - node = node.left; - continue; - } - } - // handle current node - nodeStart = delta + node.start; - if (nodeStart > intervalEnd) { - // cover case a) from above - // there is no need to search this node or its right subtree - setNodeIsVisited(node, true); - continue; - } - nodeEnd = delta + node.end; - if (nodeEnd >= intervalStart) { - // There is overlap - node.setCachedOffsets(nodeStart, nodeEnd, cachedVersionId); - let include = true; - if (filterOwnerId && node.ownerId && node.ownerId !== filterOwnerId) { - include = false; - } - if (filterOutValidation && getNodeIsForValidation(node)) { - include = false; - } - if (include) { - result[resultLen++] = node; - } - } - setNodeIsVisited(node, true); - if (node.right !== SENTINEL && !getNodeIsVisited(node.right)) { - // go right - delta += node.delta; - node = node.right; - continue; - } - } - setNodeIsVisited(T.root, false); - return result; -} -//#endregion -//#region Insertion -function rbTreeInsert(T, newNode) { - if (T.root === SENTINEL) { - newNode.parent = SENTINEL; - newNode.left = SENTINEL; - newNode.right = SENTINEL; - setNodeColor(newNode, 0 /* Black */); - T.root = newNode; - return T.root; - } - treeInsert(T, newNode); - recomputeMaxEndWalkToRoot(newNode.parent); - // repair tree - let x = newNode; - while (x !== T.root && getNodeColor(x.parent) === 1 /* Red */) { - if (x.parent === x.parent.parent.left) { - const y = x.parent.parent.right; - if (getNodeColor(y) === 1 /* Red */) { - setNodeColor(x.parent, 0 /* Black */); - setNodeColor(y, 0 /* Black */); - setNodeColor(x.parent.parent, 1 /* Red */); - x = x.parent.parent; - } - else { - if (x === x.parent.right) { - x = x.parent; - leftRotate(T, x); - } - setNodeColor(x.parent, 0 /* Black */); - setNodeColor(x.parent.parent, 1 /* Red */); - rightRotate(T, x.parent.parent); - } - } - else { - const y = x.parent.parent.left; - if (getNodeColor(y) === 1 /* Red */) { - setNodeColor(x.parent, 0 /* Black */); - setNodeColor(y, 0 /* Black */); - setNodeColor(x.parent.parent, 1 /* Red */); - x = x.parent.parent; - } - else { - if (x === x.parent.left) { - x = x.parent; - rightRotate(T, x); - } - setNodeColor(x.parent, 0 /* Black */); - setNodeColor(x.parent.parent, 1 /* Red */); - leftRotate(T, x.parent.parent); - } - } - } - setNodeColor(T.root, 0 /* Black */); - return newNode; -} -function treeInsert(T, z) { - let delta = 0; - let x = T.root; - const zAbsoluteStart = z.start; - const zAbsoluteEnd = z.end; - while (true) { - const cmp = intervalCompare(zAbsoluteStart, zAbsoluteEnd, x.start + delta, x.end + delta); - if (cmp < 0) { - // this node should be inserted to the left - // => it is not affected by the node's delta - if (x.left === SENTINEL) { - z.start -= delta; - z.end -= delta; - z.maxEnd -= delta; - x.left = z; - break; - } - else { - x = x.left; - } - } - else { - // this node should be inserted to the right - // => it is not affected by the node's delta - if (x.right === SENTINEL) { - z.start -= (delta + x.delta); - z.end -= (delta + x.delta); - z.maxEnd -= (delta + x.delta); - x.right = z; - break; - } - else { - delta += x.delta; - x = x.right; - } - } - } - z.parent = x; - z.left = SENTINEL; - z.right = SENTINEL; - setNodeColor(z, 1 /* Red */); -} -//#endregion -//#region Deletion -function rbTreeDelete(T, z) { - let x; - let y; - // RB-DELETE except we don't swap z and y in case c) - // i.e. we always delete what's pointed at by z. - if (z.left === SENTINEL) { - x = z.right; - y = z; - // x's delta is no longer influenced by z's delta - x.delta += z.delta; - if (x.delta < -1073741824 /* MIN_SAFE_DELTA */ || x.delta > 1073741824 /* MAX_SAFE_DELTA */) { - T.requestNormalizeDelta = true; - } - x.start += z.delta; - x.end += z.delta; - } - else if (z.right === SENTINEL) { - x = z.left; - y = z; - } - else { - y = leftest(z.right); - x = y.right; - // y's delta is no longer influenced by z's delta, - // but we don't want to walk the entire right-hand-side subtree of x. - // we therefore maintain z's delta in y, and adjust only x - x.start += y.delta; - x.end += y.delta; - x.delta += y.delta; - if (x.delta < -1073741824 /* MIN_SAFE_DELTA */ || x.delta > 1073741824 /* MAX_SAFE_DELTA */) { - T.requestNormalizeDelta = true; - } - y.start += z.delta; - y.end += z.delta; - y.delta = z.delta; - if (y.delta < -1073741824 /* MIN_SAFE_DELTA */ || y.delta > 1073741824 /* MAX_SAFE_DELTA */) { - T.requestNormalizeDelta = true; - } - } - if (y === T.root) { - T.root = x; - setNodeColor(x, 0 /* Black */); - z.detach(); - resetSentinel(); - recomputeMaxEnd(x); - T.root.parent = SENTINEL; - return; - } - let yWasRed = (getNodeColor(y) === 1 /* Red */); - if (y === y.parent.left) { - y.parent.left = x; - } - else { - y.parent.right = x; - } - if (y === z) { - x.parent = y.parent; - } - else { - if (y.parent === z) { - x.parent = y; - } - else { - x.parent = y.parent; - } - y.left = z.left; - y.right = z.right; - y.parent = z.parent; - setNodeColor(y, getNodeColor(z)); - if (z === T.root) { - T.root = y; - } - else { - if (z === z.parent.left) { - z.parent.left = y; - } - else { - z.parent.right = y; - } - } - if (y.left !== SENTINEL) { - y.left.parent = y; - } - if (y.right !== SENTINEL) { - y.right.parent = y; - } - } - z.detach(); - if (yWasRed) { - recomputeMaxEndWalkToRoot(x.parent); - if (y !== z) { - recomputeMaxEndWalkToRoot(y); - recomputeMaxEndWalkToRoot(y.parent); - } - resetSentinel(); - return; - } - recomputeMaxEndWalkToRoot(x); - recomputeMaxEndWalkToRoot(x.parent); - if (y !== z) { - recomputeMaxEndWalkToRoot(y); - recomputeMaxEndWalkToRoot(y.parent); - } - // RB-DELETE-FIXUP - let w; - while (x !== T.root && getNodeColor(x) === 0 /* Black */) { - if (x === x.parent.left) { - w = x.parent.right; - if (getNodeColor(w) === 1 /* Red */) { - setNodeColor(w, 0 /* Black */); - setNodeColor(x.parent, 1 /* Red */); - leftRotate(T, x.parent); - w = x.parent.right; - } - if (getNodeColor(w.left) === 0 /* Black */ && getNodeColor(w.right) === 0 /* Black */) { - setNodeColor(w, 1 /* Red */); - x = x.parent; - } - else { - if (getNodeColor(w.right) === 0 /* Black */) { - setNodeColor(w.left, 0 /* Black */); - setNodeColor(w, 1 /* Red */); - rightRotate(T, w); - w = x.parent.right; - } - setNodeColor(w, getNodeColor(x.parent)); - setNodeColor(x.parent, 0 /* Black */); - setNodeColor(w.right, 0 /* Black */); - leftRotate(T, x.parent); - x = T.root; - } - } - else { - w = x.parent.left; - if (getNodeColor(w) === 1 /* Red */) { - setNodeColor(w, 0 /* Black */); - setNodeColor(x.parent, 1 /* Red */); - rightRotate(T, x.parent); - w = x.parent.left; - } - if (getNodeColor(w.left) === 0 /* Black */ && getNodeColor(w.right) === 0 /* Black */) { - setNodeColor(w, 1 /* Red */); - x = x.parent; - } - else { - if (getNodeColor(w.left) === 0 /* Black */) { - setNodeColor(w.right, 0 /* Black */); - setNodeColor(w, 1 /* Red */); - leftRotate(T, w); - w = x.parent.left; - } - setNodeColor(w, getNodeColor(x.parent)); - setNodeColor(x.parent, 0 /* Black */); - setNodeColor(w.left, 0 /* Black */); - rightRotate(T, x.parent); - x = T.root; - } - } - } - setNodeColor(x, 0 /* Black */); - resetSentinel(); -} -function leftest(node) { - while (node.left !== SENTINEL) { - node = node.left; - } - return node; -} -function resetSentinel() { - SENTINEL.parent = SENTINEL; - SENTINEL.delta = 0; // optional - SENTINEL.start = 0; // optional - SENTINEL.end = 0; // optional -} -//#endregion -//#region Rotations -function leftRotate(T, x) { - const y = x.right; // set y. - y.delta += x.delta; // y's delta is no longer influenced by x's delta - if (y.delta < -1073741824 /* MIN_SAFE_DELTA */ || y.delta > 1073741824 /* MAX_SAFE_DELTA */) { - T.requestNormalizeDelta = true; - } - y.start += x.delta; - y.end += x.delta; - x.right = y.left; // turn y's left subtree into x's right subtree. - if (y.left !== SENTINEL) { - y.left.parent = x; - } - y.parent = x.parent; // link x's parent to y. - if (x.parent === SENTINEL) { - T.root = y; - } - else if (x === x.parent.left) { - x.parent.left = y; - } - else { - x.parent.right = y; - } - y.left = x; // put x on y's left. - x.parent = y; - recomputeMaxEnd(x); - recomputeMaxEnd(y); -} -function rightRotate(T, y) { - const x = y.left; - y.delta -= x.delta; - if (y.delta < -1073741824 /* MIN_SAFE_DELTA */ || y.delta > 1073741824 /* MAX_SAFE_DELTA */) { - T.requestNormalizeDelta = true; - } - y.start -= x.delta; - y.end -= x.delta; - y.left = x.right; - if (x.right !== SENTINEL) { - x.right.parent = y; - } - x.parent = y.parent; - if (y.parent === SENTINEL) { - T.root = x; - } - else if (y === y.parent.right) { - y.parent.right = x; - } - else { - y.parent.left = x; - } - x.right = y; - y.parent = x; - recomputeMaxEnd(y); - recomputeMaxEnd(x); -} -//#endregion -//#region max end computation -function computeMaxEnd(node) { - let maxEnd = node.end; - if (node.left !== SENTINEL) { - const leftMaxEnd = node.left.maxEnd; - if (leftMaxEnd > maxEnd) { - maxEnd = leftMaxEnd; - } - } - if (node.right !== SENTINEL) { - const rightMaxEnd = node.right.maxEnd + node.delta; - if (rightMaxEnd > maxEnd) { - maxEnd = rightMaxEnd; - } - } - return maxEnd; -} -function recomputeMaxEnd(node) { - node.maxEnd = computeMaxEnd(node); -} -function recomputeMaxEndWalkToRoot(node) { - while (node !== SENTINEL) { - const maxEnd = computeMaxEnd(node); - if (node.maxEnd === maxEnd) { - // no need to go further - return; - } - node.maxEnd = maxEnd; - node = node.parent; - } -} -//#endregion -//#region utils -function intervalCompare(aStart, aEnd, bStart, bEnd) { - if (aStart === bStart) { - return aEnd - bEnd; - } - return aStart - bStart; -} -//#endregion - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js ***! - \**********************************************************************************/ -/*! exports provided: MirrorTextModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MirrorTextModel", function() { return MirrorTextModel; }); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewModel/prefixSumComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class MirrorTextModel { - constructor(uri, lines, eol, versionId) { - this._uri = uri; - this._lines = lines; - this._eol = eol; - this._versionId = versionId; - this._lineStarts = null; - this._cachedTextValue = null; - } - dispose() { - this._lines.length = 0; - } - getText() { - if (this._cachedTextValue === null) { - this._cachedTextValue = this._lines.join(this._eol); - } - return this._cachedTextValue; - } - onEvents(e) { - if (e.eol && e.eol !== this._eol) { - this._eol = e.eol; - this._lineStarts = null; - } - // Update my lines - const changes = e.changes; - for (const change of changes) { - this._acceptDeleteRange(change.range); - this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](change.range.startLineNumber, change.range.startColumn), change.text); - } - this._versionId = e.versionId; - this._cachedTextValue = null; - } - _ensureLineStarts() { - if (!this._lineStarts) { - const eolLength = this._eol.length; - const linesLength = this._lines.length; - const lineStartValues = new Uint32Array(linesLength); - for (let i = 0; i < linesLength; i++) { - lineStartValues[i] = this._lines[i].length + eolLength; - } - this._lineStarts = new _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__["PrefixSumComputer"](lineStartValues); - } - } - /** - * All changes to a line's text go through this method - */ - _setLineText(lineIndex, newValue) { - this._lines[lineIndex] = newValue; - if (this._lineStarts) { - // update prefix sum - this._lineStarts.changeValue(lineIndex, this._lines[lineIndex].length + this._eol.length); - } - } - _acceptDeleteRange(range) { - if (range.startLineNumber === range.endLineNumber) { - if (range.startColumn === range.endColumn) { - // Nothing to delete - return; - } - // Delete text on the affected line - this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) - + this._lines[range.startLineNumber - 1].substring(range.endColumn - 1)); - return; - } - // Take remaining text on last line and append it to remaining text on first line - this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) - + this._lines[range.endLineNumber - 1].substring(range.endColumn - 1)); - // Delete middle lines - this._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber); - if (this._lineStarts) { - // update prefix sum - this._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber); - } - } - _acceptInsertText(position, insertText) { - if (insertText.length === 0) { - // Nothing to insert - return; - } - let insertLines = insertText.split(/\r\n|\r|\n/); - if (insertLines.length === 1) { - // Inserting text on one line - this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) - + insertLines[0] - + this._lines[position.lineNumber - 1].substring(position.column - 1)); - return; - } - // Append overflowing text from first line to the end of text to insert - insertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1); - // Delete overflowing text from first line and insert text on first line - this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) - + insertLines[0]); - // Insert new lines & store lengths - let newLengths = new Uint32Array(insertLines.length - 1); - for (let i = 1; i < insertLines.length; i++) { - this._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]); - newLengths[i - 1] = insertLines[i].length + this._eol.length; - } - if (this._lineStarts) { - // update prefix sum - this._lineStarts.insertValues(position.lineNumber, newLengths); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js": -/*!****************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js ***! - \****************************************************************************************************/ -/*! exports provided: AverageBufferSize, createUintArray, LineStarts, createLineStartsFast, createLineStarts, Piece, StringBuffer, PieceTreeBase */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AverageBufferSize", function() { return AverageBufferSize; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUintArray", function() { return createUintArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineStarts", function() { return LineStarts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLineStartsFast", function() { return createLineStartsFast; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLineStarts", function() { return createLineStarts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Piece", function() { return Piece; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringBuffer", function() { return StringBuffer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PieceTreeBase", function() { return PieceTreeBase; }); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/* harmony import */ var _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./rbTreeBase.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.js"); -/* harmony import */ var _textModelSearch_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../textModelSearch.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModelSearch.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -// const lfRegex = new RegExp(/\r\n|\r|\n/g); -const AverageBufferSize = 65535; -function createUintArray(arr) { - let r; - if (arr[arr.length - 1] < 65536) { - r = new Uint16Array(arr.length); - } - else { - r = new Uint32Array(arr.length); - } - r.set(arr, 0); - return r; -} -class LineStarts { - constructor(lineStarts, cr, lf, crlf, isBasicASCII) { - this.lineStarts = lineStarts; - this.cr = cr; - this.lf = lf; - this.crlf = crlf; - this.isBasicASCII = isBasicASCII; - } -} -function createLineStartsFast(str, readonly = true) { - let r = [0], rLength = 1; - for (let i = 0, len = str.length; i < len; i++) { - const chr = str.charCodeAt(i); - if (chr === 13 /* CarriageReturn */) { - if (i + 1 < len && str.charCodeAt(i + 1) === 10 /* LineFeed */) { - // \r\n... case - r[rLength++] = i + 2; - i++; // skip \n - } - else { - // \r... case - r[rLength++] = i + 1; - } - } - else if (chr === 10 /* LineFeed */) { - r[rLength++] = i + 1; - } - } - if (readonly) { - return createUintArray(r); - } - else { - return r; - } -} -function createLineStarts(r, str) { - r.length = 0; - r[0] = 0; - let rLength = 1; - let cr = 0, lf = 0, crlf = 0; - let isBasicASCII = true; - for (let i = 0, len = str.length; i < len; i++) { - const chr = str.charCodeAt(i); - if (chr === 13 /* CarriageReturn */) { - if (i + 1 < len && str.charCodeAt(i + 1) === 10 /* LineFeed */) { - // \r\n... case - crlf++; - r[rLength++] = i + 2; - i++; // skip \n - } - else { - cr++; - // \r... case - r[rLength++] = i + 1; - } - } - else if (chr === 10 /* LineFeed */) { - lf++; - r[rLength++] = i + 1; - } - else { - if (isBasicASCII) { - if (chr !== 9 /* Tab */ && (chr < 32 || chr > 126)) { - isBasicASCII = false; - } - } - } - } - const result = new LineStarts(createUintArray(r), cr, lf, crlf, isBasicASCII); - r.length = 0; - return result; -} -class Piece { - constructor(bufferIndex, start, end, lineFeedCnt, length) { - this.bufferIndex = bufferIndex; - this.start = start; - this.end = end; - this.lineFeedCnt = lineFeedCnt; - this.length = length; - } -} -class StringBuffer { - constructor(buffer, lineStarts) { - this.buffer = buffer; - this.lineStarts = lineStarts; - } -} -/** - * Readonly snapshot for piece tree. - * In a real multiple thread environment, to make snapshot reading always work correctly, we need to - * 1. Make TreeNode.piece immutable, then reading and writing can run in parallel. - * 2. TreeNode/Buffers normalization should not happen during snapshot reading. - */ -class PieceTreeSnapshot { - constructor(tree, BOM) { - this._pieces = []; - this._tree = tree; - this._BOM = BOM; - this._index = 0; - if (tree.root !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - tree.iterate(tree.root, node => { - if (node !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - this._pieces.push(node.piece); - } - return true; - }); - } - } - read() { - if (this._pieces.length === 0) { - if (this._index === 0) { - this._index++; - return this._BOM; - } - else { - return null; - } - } - if (this._index > this._pieces.length - 1) { - return null; - } - if (this._index === 0) { - return this._BOM + this._tree.getPieceContent(this._pieces[this._index++]); - } - return this._tree.getPieceContent(this._pieces[this._index++]); - } -} -class PieceTreeSearchCache { - constructor(limit) { - this._limit = limit; - this._cache = []; - } - get(offset) { - for (let i = this._cache.length - 1; i >= 0; i--) { - let nodePos = this._cache[i]; - if (nodePos.nodeStartOffset <= offset && nodePos.nodeStartOffset + nodePos.node.piece.length >= offset) { - return nodePos; - } - } - return null; - } - get2(lineNumber) { - for (let i = this._cache.length - 1; i >= 0; i--) { - let nodePos = this._cache[i]; - if (nodePos.nodeStartLineNumber && nodePos.nodeStartLineNumber < lineNumber && nodePos.nodeStartLineNumber + nodePos.node.piece.lineFeedCnt >= lineNumber) { - return nodePos; - } - } - return null; - } - set(nodePosition) { - if (this._cache.length >= this._limit) { - this._cache.shift(); - } - this._cache.push(nodePosition); - } - validate(offset) { - let hasInvalidVal = false; - let tmp = this._cache; - for (let i = 0; i < tmp.length; i++) { - let nodePos = tmp[i]; - if (nodePos.node.parent === null || nodePos.nodeStartOffset >= offset) { - tmp[i] = null; - hasInvalidVal = true; - continue; - } - } - if (hasInvalidVal) { - let newArr = []; - for (const entry of tmp) { - if (entry !== null) { - newArr.push(entry); - } - } - this._cache = newArr; - } - } -} -class PieceTreeBase { - constructor(chunks, eol, eolNormalized) { - this.create(chunks, eol, eolNormalized); - } - create(chunks, eol, eolNormalized) { - this._buffers = [ - new StringBuffer('', [0]) - ]; - this._lastChangeBufferPos = { line: 0, column: 0 }; - this.root = _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]; - this._lineCnt = 1; - this._length = 0; - this._EOL = eol; - this._EOLLength = eol.length; - this._EOLNormalized = eolNormalized; - let lastNode = null; - for (let i = 0, len = chunks.length; i < len; i++) { - if (chunks[i].buffer.length > 0) { - if (!chunks[i].lineStarts) { - chunks[i].lineStarts = createLineStartsFast(chunks[i].buffer); - } - let piece = new Piece(i + 1, { line: 0, column: 0 }, { line: chunks[i].lineStarts.length - 1, column: chunks[i].buffer.length - chunks[i].lineStarts[chunks[i].lineStarts.length - 1] }, chunks[i].lineStarts.length - 1, chunks[i].buffer.length); - this._buffers.push(chunks[i]); - lastNode = this.rbInsertRight(lastNode, piece); - } - } - this._searchCache = new PieceTreeSearchCache(1); - this._lastVisitedLine = { lineNumber: 0, value: '' }; - this.computeBufferMetadata(); - } - normalizeEOL(eol) { - let averageBufferSize = AverageBufferSize; - let min = averageBufferSize - Math.floor(averageBufferSize / 3); - let max = min * 2; - let tempChunk = ''; - let tempChunkLen = 0; - let chunks = []; - this.iterate(this.root, node => { - let str = this.getNodeContent(node); - let len = str.length; - if (tempChunkLen <= min || tempChunkLen + len < max) { - tempChunk += str; - tempChunkLen += len; - return true; - } - // flush anyways - let text = tempChunk.replace(/\r\n|\r|\n/g, eol); - chunks.push(new StringBuffer(text, createLineStartsFast(text))); - tempChunk = str; - tempChunkLen = len; - return true; - }); - if (tempChunkLen > 0) { - let text = tempChunk.replace(/\r\n|\r|\n/g, eol); - chunks.push(new StringBuffer(text, createLineStartsFast(text))); - } - this.create(chunks, eol, true); - } - // #region Buffer API - getEOL() { - return this._EOL; - } - setEOL(newEOL) { - this._EOL = newEOL; - this._EOLLength = this._EOL.length; - this.normalizeEOL(newEOL); - } - createSnapshot(BOM) { - return new PieceTreeSnapshot(this, BOM); - } - getOffsetAt(lineNumber, column) { - let leftLen = 0; // inorder - let x = this.root; - while (x !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - if (x.left !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"] && x.lf_left + 1 >= lineNumber) { - x = x.left; - } - else if (x.lf_left + x.piece.lineFeedCnt + 1 >= lineNumber) { - leftLen += x.size_left; - // lineNumber >= 2 - let accumualtedValInCurrentIndex = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); - return leftLen += accumualtedValInCurrentIndex + column - 1; - } - else { - lineNumber -= x.lf_left + x.piece.lineFeedCnt; - leftLen += x.size_left + x.piece.length; - x = x.right; - } - } - return leftLen; - } - getPositionAt(offset) { - offset = Math.floor(offset); - offset = Math.max(0, offset); - let x = this.root; - let lfCnt = 0; - let originalOffset = offset; - while (x !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - if (x.size_left !== 0 && x.size_left >= offset) { - x = x.left; - } - else if (x.size_left + x.piece.length >= offset) { - let out = this.getIndexOf(x, offset - x.size_left); - lfCnt += x.lf_left + out.index; - if (out.index === 0) { - let lineStartOffset = this.getOffsetAt(lfCnt + 1, 1); - let column = originalOffset - lineStartOffset; - return new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](lfCnt + 1, column + 1); - } - return new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](lfCnt + 1, out.remainder + 1); - } - else { - offset -= x.size_left + x.piece.length; - lfCnt += x.lf_left + x.piece.lineFeedCnt; - if (x.right === _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - // last node - let lineStartOffset = this.getOffsetAt(lfCnt + 1, 1); - let column = originalOffset - offset - lineStartOffset; - return new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](lfCnt + 1, column + 1); - } - else { - x = x.right; - } - } - } - return new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](1, 1); - } - getValueInRange(range, eol) { - if (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn) { - return ''; - } - let startPosition = this.nodeAt2(range.startLineNumber, range.startColumn); - let endPosition = this.nodeAt2(range.endLineNumber, range.endColumn); - let value = this.getValueInRange2(startPosition, endPosition); - if (eol) { - if (eol !== this._EOL || !this._EOLNormalized) { - return value.replace(/\r\n|\r|\n/g, eol); - } - if (eol === this.getEOL() && this._EOLNormalized) { - if (eol === '\r\n') { - } - return value; - } - return value.replace(/\r\n|\r|\n/g, eol); - } - return value; - } - getValueInRange2(startPosition, endPosition) { - if (startPosition.node === endPosition.node) { - let node = startPosition.node; - let buffer = this._buffers[node.piece.bufferIndex].buffer; - let startOffset = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start); - return buffer.substring(startOffset + startPosition.remainder, startOffset + endPosition.remainder); - } - let x = startPosition.node; - let buffer = this._buffers[x.piece.bufferIndex].buffer; - let startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); - let ret = buffer.substring(startOffset + startPosition.remainder, startOffset + x.piece.length); - x = x.next(); - while (x !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - let buffer = this._buffers[x.piece.bufferIndex].buffer; - let startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); - if (x === endPosition.node) { - ret += buffer.substring(startOffset, startOffset + endPosition.remainder); - break; - } - else { - ret += buffer.substr(startOffset, x.piece.length); - } - x = x.next(); - } - return ret; - } - getLinesContent() { - let lines = []; - let linesLength = 0; - let currentLine = ''; - let danglingCR = false; - this.iterate(this.root, node => { - if (node === _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - return true; - } - const piece = node.piece; - let pieceLength = piece.length; - if (pieceLength === 0) { - return true; - } - const buffer = this._buffers[piece.bufferIndex].buffer; - const lineStarts = this._buffers[piece.bufferIndex].lineStarts; - const pieceStartLine = piece.start.line; - const pieceEndLine = piece.end.line; - let pieceStartOffset = lineStarts[pieceStartLine] + piece.start.column; - if (danglingCR) { - if (buffer.charCodeAt(pieceStartOffset) === 10 /* LineFeed */) { - // pretend the \n was in the previous piece.. - pieceStartOffset++; - pieceLength--; - } - lines[linesLength++] = currentLine; - currentLine = ''; - danglingCR = false; - if (pieceLength === 0) { - return true; - } - } - if (pieceStartLine === pieceEndLine) { - // this piece has no new lines - if (!this._EOLNormalized && buffer.charCodeAt(pieceStartOffset + pieceLength - 1) === 13 /* CarriageReturn */) { - danglingCR = true; - currentLine += buffer.substr(pieceStartOffset, pieceLength - 1); - } - else { - currentLine += buffer.substr(pieceStartOffset, pieceLength); - } - return true; - } - // add the text before the first line start in this piece - currentLine += (this._EOLNormalized - ? buffer.substring(pieceStartOffset, Math.max(pieceStartOffset, lineStarts[pieceStartLine + 1] - this._EOLLength)) - : buffer.substring(pieceStartOffset, lineStarts[pieceStartLine + 1]).replace(/(\r\n|\r|\n)$/, '')); - lines[linesLength++] = currentLine; - for (let line = pieceStartLine + 1; line < pieceEndLine; line++) { - currentLine = (this._EOLNormalized - ? buffer.substring(lineStarts[line], lineStarts[line + 1] - this._EOLLength) - : buffer.substring(lineStarts[line], lineStarts[line + 1]).replace(/(\r\n|\r|\n)$/, '')); - lines[linesLength++] = currentLine; - } - if (!this._EOLNormalized && buffer.charCodeAt(lineStarts[pieceEndLine] + piece.end.column - 1) === 13 /* CarriageReturn */) { - danglingCR = true; - if (piece.end.column === 0) { - // The last line ended with a \r, let's undo the push, it will be pushed by next iteration - linesLength--; - } - else { - currentLine = buffer.substr(lineStarts[pieceEndLine], piece.end.column - 1); - } - } - else { - currentLine = buffer.substr(lineStarts[pieceEndLine], piece.end.column); - } - return true; - }); - if (danglingCR) { - lines[linesLength++] = currentLine; - currentLine = ''; - } - lines[linesLength++] = currentLine; - return lines; - } - getLength() { - return this._length; - } - getLineCount() { - return this._lineCnt; - } - getLineContent(lineNumber) { - if (this._lastVisitedLine.lineNumber === lineNumber) { - return this._lastVisitedLine.value; - } - this._lastVisitedLine.lineNumber = lineNumber; - if (lineNumber === this._lineCnt) { - this._lastVisitedLine.value = this.getLineRawContent(lineNumber); - } - else if (this._EOLNormalized) { - this._lastVisitedLine.value = this.getLineRawContent(lineNumber, this._EOLLength); - } - else { - this._lastVisitedLine.value = this.getLineRawContent(lineNumber).replace(/(\r\n|\r|\n)$/, ''); - } - return this._lastVisitedLine.value; - } - _getCharCode(nodePos) { - if (nodePos.remainder === nodePos.node.piece.length) { - // the char we want to fetch is at the head of next node. - let matchingNode = nodePos.node.next(); - if (!matchingNode) { - return 0; - } - let buffer = this._buffers[matchingNode.piece.bufferIndex]; - let startOffset = this.offsetInBuffer(matchingNode.piece.bufferIndex, matchingNode.piece.start); - return buffer.buffer.charCodeAt(startOffset); - } - else { - let buffer = this._buffers[nodePos.node.piece.bufferIndex]; - let startOffset = this.offsetInBuffer(nodePos.node.piece.bufferIndex, nodePos.node.piece.start); - let targetOffset = startOffset + nodePos.remainder; - return buffer.buffer.charCodeAt(targetOffset); - } - } - getLineCharCode(lineNumber, index) { - let nodePos = this.nodeAt2(lineNumber, index + 1); - return this._getCharCode(nodePos); - } - getLineLength(lineNumber) { - if (lineNumber === this.getLineCount()) { - let startOffset = this.getOffsetAt(lineNumber, 1); - return this.getLength() - startOffset; - } - return this.getOffsetAt(lineNumber + 1, 1) - this.getOffsetAt(lineNumber, 1) - this._EOLLength; - } - findMatchesInNode(node, searcher, startLineNumber, startColumn, startCursor, endCursor, searchData, captureMatches, limitResultCount, resultLen, result) { - let buffer = this._buffers[node.piece.bufferIndex]; - let startOffsetInBuffer = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start); - let start = this.offsetInBuffer(node.piece.bufferIndex, startCursor); - let end = this.offsetInBuffer(node.piece.bufferIndex, endCursor); - let m; - // Reset regex to search from the beginning - let ret = { line: 0, column: 0 }; - let searchText; - let offsetInBuffer; - if (searcher._wordSeparators) { - searchText = buffer.buffer.substring(start, end); - offsetInBuffer = (offset) => offset + start; - searcher.reset(0); - } - else { - searchText = buffer.buffer; - offsetInBuffer = (offset) => offset; - searcher.reset(start); - } - do { - m = searcher.next(searchText); - if (m) { - if (offsetInBuffer(m.index) >= end) { - return resultLen; - } - this.positionInBuffer(node, offsetInBuffer(m.index) - startOffsetInBuffer, ret); - let lineFeedCnt = this.getLineFeedCnt(node.piece.bufferIndex, startCursor, ret); - let retStartColumn = ret.line === startCursor.line ? ret.column - startCursor.column + startColumn : ret.column + 1; - let retEndColumn = retStartColumn + m[0].length; - result[resultLen++] = Object(_textModelSearch_js__WEBPACK_IMPORTED_MODULE_4__["createFindMatch"])(new _core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"](startLineNumber + lineFeedCnt, retStartColumn, startLineNumber + lineFeedCnt, retEndColumn), m, captureMatches); - if (offsetInBuffer(m.index) + m[0].length >= end) { - return resultLen; - } - if (resultLen >= limitResultCount) { - return resultLen; - } - } - } while (m); - return resultLen; - } - findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount) { - const result = []; - let resultLen = 0; - const searcher = new _textModelSearch_js__WEBPACK_IMPORTED_MODULE_4__["Searcher"](searchData.wordSeparators, searchData.regex); - let startPosition = this.nodeAt2(searchRange.startLineNumber, searchRange.startColumn); - if (startPosition === null) { - return []; - } - let endPosition = this.nodeAt2(searchRange.endLineNumber, searchRange.endColumn); - if (endPosition === null) { - return []; - } - let start = this.positionInBuffer(startPosition.node, startPosition.remainder); - let end = this.positionInBuffer(endPosition.node, endPosition.remainder); - if (startPosition.node === endPosition.node) { - this.findMatchesInNode(startPosition.node, searcher, searchRange.startLineNumber, searchRange.startColumn, start, end, searchData, captureMatches, limitResultCount, resultLen, result); - return result; - } - let startLineNumber = searchRange.startLineNumber; - let currentNode = startPosition.node; - while (currentNode !== endPosition.node) { - let lineBreakCnt = this.getLineFeedCnt(currentNode.piece.bufferIndex, start, currentNode.piece.end); - if (lineBreakCnt >= 1) { - // last line break position - let lineStarts = this._buffers[currentNode.piece.bufferIndex].lineStarts; - let startOffsetInBuffer = this.offsetInBuffer(currentNode.piece.bufferIndex, currentNode.piece.start); - let nextLineStartOffset = lineStarts[start.line + lineBreakCnt]; - let startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn : 1; - resultLen = this.findMatchesInNode(currentNode, searcher, startLineNumber, startColumn, start, this.positionInBuffer(currentNode, nextLineStartOffset - startOffsetInBuffer), searchData, captureMatches, limitResultCount, resultLen, result); - if (resultLen >= limitResultCount) { - return result; - } - startLineNumber += lineBreakCnt; - } - let startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn - 1 : 0; - // search for the remaining content - if (startLineNumber === searchRange.endLineNumber) { - const text = this.getLineContent(startLineNumber).substring(startColumn, searchRange.endColumn - 1); - resultLen = this._findMatchesInLine(searchData, searcher, text, searchRange.endLineNumber, startColumn, resultLen, result, captureMatches, limitResultCount); - return result; - } - resultLen = this._findMatchesInLine(searchData, searcher, this.getLineContent(startLineNumber).substr(startColumn), startLineNumber, startColumn, resultLen, result, captureMatches, limitResultCount); - if (resultLen >= limitResultCount) { - return result; - } - startLineNumber++; - startPosition = this.nodeAt2(startLineNumber, 1); - currentNode = startPosition.node; - start = this.positionInBuffer(startPosition.node, startPosition.remainder); - } - if (startLineNumber === searchRange.endLineNumber) { - let startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn - 1 : 0; - const text = this.getLineContent(startLineNumber).substring(startColumn, searchRange.endColumn - 1); - resultLen = this._findMatchesInLine(searchData, searcher, text, searchRange.endLineNumber, startColumn, resultLen, result, captureMatches, limitResultCount); - return result; - } - let startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn : 1; - resultLen = this.findMatchesInNode(endPosition.node, searcher, startLineNumber, startColumn, start, end, searchData, captureMatches, limitResultCount, resultLen, result); - return result; - } - _findMatchesInLine(searchData, searcher, text, lineNumber, deltaOffset, resultLen, result, captureMatches, limitResultCount) { - const wordSeparators = searchData.wordSeparators; - if (!captureMatches && searchData.simpleSearch) { - const searchString = searchData.simpleSearch; - const searchStringLen = searchString.length; - const textLength = text.length; - let lastMatchIndex = -searchStringLen; - while ((lastMatchIndex = text.indexOf(searchString, lastMatchIndex + searchStringLen)) !== -1) { - if (!wordSeparators || Object(_textModelSearch_js__WEBPACK_IMPORTED_MODULE_4__["isValidMatch"])(wordSeparators, text, textLength, lastMatchIndex, searchStringLen)) { - result[resultLen++] = new _model_js__WEBPACK_IMPORTED_MODULE_2__["FindMatch"](new _core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"](lineNumber, lastMatchIndex + 1 + deltaOffset, lineNumber, lastMatchIndex + 1 + searchStringLen + deltaOffset), null); - if (resultLen >= limitResultCount) { - return resultLen; - } - } - } - return resultLen; - } - let m; - // Reset regex to search from the beginning - searcher.reset(0); - do { - m = searcher.next(text); - if (m) { - result[resultLen++] = Object(_textModelSearch_js__WEBPACK_IMPORTED_MODULE_4__["createFindMatch"])(new _core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"](lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset), m, captureMatches); - if (resultLen >= limitResultCount) { - return resultLen; - } - } - } while (m); - return resultLen; - } - // #endregion - // #region Piece Table - insert(offset, value, eolNormalized = false) { - this._EOLNormalized = this._EOLNormalized && eolNormalized; - this._lastVisitedLine.lineNumber = 0; - this._lastVisitedLine.value = ''; - if (this.root !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - let { node, remainder, nodeStartOffset } = this.nodeAt(offset); - let piece = node.piece; - let bufferIndex = piece.bufferIndex; - let insertPosInBuffer = this.positionInBuffer(node, remainder); - if (node.piece.bufferIndex === 0 && - piece.end.line === this._lastChangeBufferPos.line && - piece.end.column === this._lastChangeBufferPos.column && - (nodeStartOffset + piece.length === offset) && - value.length < AverageBufferSize) { - // changed buffer - this.appendToNode(node, value); - this.computeBufferMetadata(); - return; - } - if (nodeStartOffset === offset) { - this.insertContentToNodeLeft(value, node); - this._searchCache.validate(offset); - } - else if (nodeStartOffset + node.piece.length > offset) { - // we are inserting into the middle of a node. - let nodesToDel = []; - let newRightPiece = new Piece(piece.bufferIndex, insertPosInBuffer, piece.end, this.getLineFeedCnt(piece.bufferIndex, insertPosInBuffer, piece.end), this.offsetInBuffer(bufferIndex, piece.end) - this.offsetInBuffer(bufferIndex, insertPosInBuffer)); - if (this.shouldCheckCRLF() && this.endWithCR(value)) { - let headOfRight = this.nodeCharCodeAt(node, remainder); - if (headOfRight === 10 /** \n */) { - let newStart = { line: newRightPiece.start.line + 1, column: 0 }; - newRightPiece = new Piece(newRightPiece.bufferIndex, newStart, newRightPiece.end, this.getLineFeedCnt(newRightPiece.bufferIndex, newStart, newRightPiece.end), newRightPiece.length - 1); - value += '\n'; - } - } - // reuse node for content before insertion point. - if (this.shouldCheckCRLF() && this.startWithLF(value)) { - let tailOfLeft = this.nodeCharCodeAt(node, remainder - 1); - if (tailOfLeft === 13 /** \r */) { - let previousPos = this.positionInBuffer(node, remainder - 1); - this.deleteNodeTail(node, previousPos); - value = '\r' + value; - if (node.piece.length === 0) { - nodesToDel.push(node); - } - } - else { - this.deleteNodeTail(node, insertPosInBuffer); - } - } - else { - this.deleteNodeTail(node, insertPosInBuffer); - } - let newPieces = this.createNewPieces(value); - if (newRightPiece.length > 0) { - this.rbInsertRight(node, newRightPiece); - } - let tmpNode = node; - for (let k = 0; k < newPieces.length; k++) { - tmpNode = this.rbInsertRight(tmpNode, newPieces[k]); - } - this.deleteNodes(nodesToDel); - } - else { - this.insertContentToNodeRight(value, node); - } - } - else { - // insert new node - let pieces = this.createNewPieces(value); - let node = this.rbInsertLeft(null, pieces[0]); - for (let k = 1; k < pieces.length; k++) { - node = this.rbInsertRight(node, pieces[k]); - } - } - // todo, this is too brutal. Total line feed count should be updated the same way as lf_left. - this.computeBufferMetadata(); - } - delete(offset, cnt) { - this._lastVisitedLine.lineNumber = 0; - this._lastVisitedLine.value = ''; - if (cnt <= 0 || this.root === _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - return; - } - let startPosition = this.nodeAt(offset); - let endPosition = this.nodeAt(offset + cnt); - let startNode = startPosition.node; - let endNode = endPosition.node; - if (startNode === endNode) { - let startSplitPosInBuffer = this.positionInBuffer(startNode, startPosition.remainder); - let endSplitPosInBuffer = this.positionInBuffer(startNode, endPosition.remainder); - if (startPosition.nodeStartOffset === offset) { - if (cnt === startNode.piece.length) { // delete node - let next = startNode.next(); - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["rbDelete"])(this, startNode); - this.validateCRLFWithPrevNode(next); - this.computeBufferMetadata(); - return; - } - this.deleteNodeHead(startNode, endSplitPosInBuffer); - this._searchCache.validate(offset); - this.validateCRLFWithPrevNode(startNode); - this.computeBufferMetadata(); - return; - } - if (startPosition.nodeStartOffset + startNode.piece.length === offset + cnt) { - this.deleteNodeTail(startNode, startSplitPosInBuffer); - this.validateCRLFWithNextNode(startNode); - this.computeBufferMetadata(); - return; - } - // delete content in the middle, this node will be splitted to nodes - this.shrinkNode(startNode, startSplitPosInBuffer, endSplitPosInBuffer); - this.computeBufferMetadata(); - return; - } - let nodesToDel = []; - let startSplitPosInBuffer = this.positionInBuffer(startNode, startPosition.remainder); - this.deleteNodeTail(startNode, startSplitPosInBuffer); - this._searchCache.validate(offset); - if (startNode.piece.length === 0) { - nodesToDel.push(startNode); - } - // update last touched node - let endSplitPosInBuffer = this.positionInBuffer(endNode, endPosition.remainder); - this.deleteNodeHead(endNode, endSplitPosInBuffer); - if (endNode.piece.length === 0) { - nodesToDel.push(endNode); - } - // delete nodes in between - let secondNode = startNode.next(); - for (let node = secondNode; node !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"] && node !== endNode; node = node.next()) { - nodesToDel.push(node); - } - let prev = startNode.piece.length === 0 ? startNode.prev() : startNode; - this.deleteNodes(nodesToDel); - this.validateCRLFWithNextNode(prev); - this.computeBufferMetadata(); - } - insertContentToNodeLeft(value, node) { - // we are inserting content to the beginning of node - let nodesToDel = []; - if (this.shouldCheckCRLF() && this.endWithCR(value) && this.startWithLF(node)) { - // move `\n` to new node. - let piece = node.piece; - let newStart = { line: piece.start.line + 1, column: 0 }; - let nPiece = new Piece(piece.bufferIndex, newStart, piece.end, this.getLineFeedCnt(piece.bufferIndex, newStart, piece.end), piece.length - 1); - node.piece = nPiece; - value += '\n'; - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["updateTreeMetadata"])(this, node, -1, -1); - if (node.piece.length === 0) { - nodesToDel.push(node); - } - } - let newPieces = this.createNewPieces(value); - let newNode = this.rbInsertLeft(node, newPieces[newPieces.length - 1]); - for (let k = newPieces.length - 2; k >= 0; k--) { - newNode = this.rbInsertLeft(newNode, newPieces[k]); - } - this.validateCRLFWithPrevNode(newNode); - this.deleteNodes(nodesToDel); - } - insertContentToNodeRight(value, node) { - // we are inserting to the right of this node. - if (this.adjustCarriageReturnFromNext(value, node)) { - // move \n to the new node. - value += '\n'; - } - let newPieces = this.createNewPieces(value); - let newNode = this.rbInsertRight(node, newPieces[0]); - let tmpNode = newNode; - for (let k = 1; k < newPieces.length; k++) { - tmpNode = this.rbInsertRight(tmpNode, newPieces[k]); - } - this.validateCRLFWithPrevNode(newNode); - } - positionInBuffer(node, remainder, ret) { - let piece = node.piece; - let bufferIndex = node.piece.bufferIndex; - let lineStarts = this._buffers[bufferIndex].lineStarts; - let startOffset = lineStarts[piece.start.line] + piece.start.column; - let offset = startOffset + remainder; - // binary search offset between startOffset and endOffset - let low = piece.start.line; - let high = piece.end.line; - let mid = 0; - let midStop = 0; - let midStart = 0; - while (low <= high) { - mid = low + ((high - low) / 2) | 0; - midStart = lineStarts[mid]; - if (mid === high) { - break; - } - midStop = lineStarts[mid + 1]; - if (offset < midStart) { - high = mid - 1; - } - else if (offset >= midStop) { - low = mid + 1; - } - else { - break; - } - } - if (ret) { - ret.line = mid; - ret.column = offset - midStart; - return null; - } - return { - line: mid, - column: offset - midStart - }; - } - getLineFeedCnt(bufferIndex, start, end) { - // we don't need to worry about start: abc\r|\n, or abc|\r, or abc|\n, or abc|\r\n doesn't change the fact that, there is one line break after start. - // now let's take care of end: abc\r|\n, if end is in between \r and \n, we need to add line feed count by 1 - if (end.column === 0) { - return end.line - start.line; - } - let lineStarts = this._buffers[bufferIndex].lineStarts; - if (end.line === lineStarts.length - 1) { // it means, there is no \n after end, otherwise, there will be one more lineStart. - return end.line - start.line; - } - let nextLineStartOffset = lineStarts[end.line + 1]; - let endOffset = lineStarts[end.line] + end.column; - if (nextLineStartOffset > endOffset + 1) { // there are more than 1 character after end, which means it can't be \n - return end.line - start.line; - } - // endOffset + 1 === nextLineStartOffset - // character at endOffset is \n, so we check the character before first - // if character at endOffset is \r, end.column is 0 and we can't get here. - let previousCharOffset = endOffset - 1; // end.column > 0 so it's okay. - let buffer = this._buffers[bufferIndex].buffer; - if (buffer.charCodeAt(previousCharOffset) === 13) { - return end.line - start.line + 1; - } - else { - return end.line - start.line; - } - } - offsetInBuffer(bufferIndex, cursor) { - let lineStarts = this._buffers[bufferIndex].lineStarts; - return lineStarts[cursor.line] + cursor.column; - } - deleteNodes(nodes) { - for (let i = 0; i < nodes.length; i++) { - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["rbDelete"])(this, nodes[i]); - } - } - createNewPieces(text) { - if (text.length > AverageBufferSize) { - // the content is large, operations like substring, charCode becomes slow - // so here we split it into smaller chunks, just like what we did for CR/LF normalization - let newPieces = []; - while (text.length > AverageBufferSize) { - const lastChar = text.charCodeAt(AverageBufferSize - 1); - let splitText; - if (lastChar === 13 /* CarriageReturn */ || (lastChar >= 0xD800 && lastChar <= 0xDBFF)) { - // last character is \r or a high surrogate => keep it back - splitText = text.substring(0, AverageBufferSize - 1); - text = text.substring(AverageBufferSize - 1); - } - else { - splitText = text.substring(0, AverageBufferSize); - text = text.substring(AverageBufferSize); - } - let lineStarts = createLineStartsFast(splitText); - newPieces.push(new Piece(this._buffers.length, /* buffer index */ { line: 0, column: 0 }, { line: lineStarts.length - 1, column: splitText.length - lineStarts[lineStarts.length - 1] }, lineStarts.length - 1, splitText.length)); - this._buffers.push(new StringBuffer(splitText, lineStarts)); - } - let lineStarts = createLineStartsFast(text); - newPieces.push(new Piece(this._buffers.length, /* buffer index */ { line: 0, column: 0 }, { line: lineStarts.length - 1, column: text.length - lineStarts[lineStarts.length - 1] }, lineStarts.length - 1, text.length)); - this._buffers.push(new StringBuffer(text, lineStarts)); - return newPieces; - } - let startOffset = this._buffers[0].buffer.length; - const lineStarts = createLineStartsFast(text, false); - let start = this._lastChangeBufferPos; - if (this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 1] === startOffset - && startOffset !== 0 - && this.startWithLF(text) - && this.endWithCR(this._buffers[0].buffer) // todo, we can check this._lastChangeBufferPos's column as it's the last one - ) { - this._lastChangeBufferPos = { line: this._lastChangeBufferPos.line, column: this._lastChangeBufferPos.column + 1 }; - start = this._lastChangeBufferPos; - for (let i = 0; i < lineStarts.length; i++) { - lineStarts[i] += startOffset + 1; - } - this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(lineStarts.slice(1)); - this._buffers[0].buffer += '_' + text; - startOffset += 1; - } - else { - if (startOffset !== 0) { - for (let i = 0; i < lineStarts.length; i++) { - lineStarts[i] += startOffset; - } - } - this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(lineStarts.slice(1)); - this._buffers[0].buffer += text; - } - const endOffset = this._buffers[0].buffer.length; - let endIndex = this._buffers[0].lineStarts.length - 1; - let endColumn = endOffset - this._buffers[0].lineStarts[endIndex]; - let endPos = { line: endIndex, column: endColumn }; - let newPiece = new Piece(0, /** todo@peng */ start, endPos, this.getLineFeedCnt(0, start, endPos), endOffset - startOffset); - this._lastChangeBufferPos = endPos; - return [newPiece]; - } - getLineRawContent(lineNumber, endOffset = 0) { - let x = this.root; - let ret = ''; - let cache = this._searchCache.get2(lineNumber); - if (cache) { - x = cache.node; - let prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - cache.nodeStartLineNumber - 1); - let buffer = this._buffers[x.piece.bufferIndex].buffer; - let startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); - if (cache.nodeStartLineNumber + x.piece.lineFeedCnt === lineNumber) { - ret = buffer.substring(startOffset + prevAccumulatedValue, startOffset + x.piece.length); - } - else { - let accumulatedValue = this.getAccumulatedValue(x, lineNumber - cache.nodeStartLineNumber); - return buffer.substring(startOffset + prevAccumulatedValue, startOffset + accumulatedValue - endOffset); - } - } - else { - let nodeStartOffset = 0; - const originalLineNumber = lineNumber; - while (x !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - if (x.left !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"] && x.lf_left >= lineNumber - 1) { - x = x.left; - } - else if (x.lf_left + x.piece.lineFeedCnt > lineNumber - 1) { - let prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); - let accumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 1); - let buffer = this._buffers[x.piece.bufferIndex].buffer; - let startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); - nodeStartOffset += x.size_left; - this._searchCache.set({ - node: x, - nodeStartOffset, - nodeStartLineNumber: originalLineNumber - (lineNumber - 1 - x.lf_left) - }); - return buffer.substring(startOffset + prevAccumulatedValue, startOffset + accumulatedValue - endOffset); - } - else if (x.lf_left + x.piece.lineFeedCnt === lineNumber - 1) { - let prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); - let buffer = this._buffers[x.piece.bufferIndex].buffer; - let startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); - ret = buffer.substring(startOffset + prevAccumulatedValue, startOffset + x.piece.length); - break; - } - else { - lineNumber -= x.lf_left + x.piece.lineFeedCnt; - nodeStartOffset += x.size_left + x.piece.length; - x = x.right; - } - } - } - // search in order, to find the node contains end column - x = x.next(); - while (x !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - let buffer = this._buffers[x.piece.bufferIndex].buffer; - if (x.piece.lineFeedCnt > 0) { - let accumulatedValue = this.getAccumulatedValue(x, 0); - let startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); - ret += buffer.substring(startOffset, startOffset + accumulatedValue - endOffset); - return ret; - } - else { - let startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); - ret += buffer.substr(startOffset, x.piece.length); - } - x = x.next(); - } - return ret; - } - computeBufferMetadata() { - let x = this.root; - let lfCnt = 1; - let len = 0; - while (x !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - lfCnt += x.lf_left + x.piece.lineFeedCnt; - len += x.size_left + x.piece.length; - x = x.right; - } - this._lineCnt = lfCnt; - this._length = len; - this._searchCache.validate(this._length); - } - // #region node operations - getIndexOf(node, accumulatedValue) { - let piece = node.piece; - let pos = this.positionInBuffer(node, accumulatedValue); - let lineCnt = pos.line - piece.start.line; - if (this.offsetInBuffer(piece.bufferIndex, piece.end) - this.offsetInBuffer(piece.bufferIndex, piece.start) === accumulatedValue) { - // we are checking the end of this node, so a CRLF check is necessary. - let realLineCnt = this.getLineFeedCnt(node.piece.bufferIndex, piece.start, pos); - if (realLineCnt !== lineCnt) { - // aha yes, CRLF - return { index: realLineCnt, remainder: 0 }; - } - } - return { index: lineCnt, remainder: pos.column }; - } - getAccumulatedValue(node, index) { - if (index < 0) { - return 0; - } - let piece = node.piece; - let lineStarts = this._buffers[piece.bufferIndex].lineStarts; - let expectedLineStartIndex = piece.start.line + index + 1; - if (expectedLineStartIndex > piece.end.line) { - return lineStarts[piece.end.line] + piece.end.column - lineStarts[piece.start.line] - piece.start.column; - } - else { - return lineStarts[expectedLineStartIndex] - lineStarts[piece.start.line] - piece.start.column; - } - } - deleteNodeTail(node, pos) { - const piece = node.piece; - const originalLFCnt = piece.lineFeedCnt; - const originalEndOffset = this.offsetInBuffer(piece.bufferIndex, piece.end); - const newEnd = pos; - const newEndOffset = this.offsetInBuffer(piece.bufferIndex, newEnd); - const newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, piece.start, newEnd); - const lf_delta = newLineFeedCnt - originalLFCnt; - const size_delta = newEndOffset - originalEndOffset; - const newLength = piece.length + size_delta; - node.piece = new Piece(piece.bufferIndex, piece.start, newEnd, newLineFeedCnt, newLength); - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["updateTreeMetadata"])(this, node, size_delta, lf_delta); - } - deleteNodeHead(node, pos) { - const piece = node.piece; - const originalLFCnt = piece.lineFeedCnt; - const originalStartOffset = this.offsetInBuffer(piece.bufferIndex, piece.start); - const newStart = pos; - const newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, newStart, piece.end); - const newStartOffset = this.offsetInBuffer(piece.bufferIndex, newStart); - const lf_delta = newLineFeedCnt - originalLFCnt; - const size_delta = originalStartOffset - newStartOffset; - const newLength = piece.length + size_delta; - node.piece = new Piece(piece.bufferIndex, newStart, piece.end, newLineFeedCnt, newLength); - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["updateTreeMetadata"])(this, node, size_delta, lf_delta); - } - shrinkNode(node, start, end) { - const piece = node.piece; - const originalStartPos = piece.start; - const originalEndPos = piece.end; - // old piece, originalStartPos, start - const oldLength = piece.length; - const oldLFCnt = piece.lineFeedCnt; - const newEnd = start; - const newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, piece.start, newEnd); - const newLength = this.offsetInBuffer(piece.bufferIndex, start) - this.offsetInBuffer(piece.bufferIndex, originalStartPos); - node.piece = new Piece(piece.bufferIndex, piece.start, newEnd, newLineFeedCnt, newLength); - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["updateTreeMetadata"])(this, node, newLength - oldLength, newLineFeedCnt - oldLFCnt); - // new right piece, end, originalEndPos - let newPiece = new Piece(piece.bufferIndex, end, originalEndPos, this.getLineFeedCnt(piece.bufferIndex, end, originalEndPos), this.offsetInBuffer(piece.bufferIndex, originalEndPos) - this.offsetInBuffer(piece.bufferIndex, end)); - let newNode = this.rbInsertRight(node, newPiece); - this.validateCRLFWithPrevNode(newNode); - } - appendToNode(node, value) { - if (this.adjustCarriageReturnFromNext(value, node)) { - value += '\n'; - } - const hitCRLF = this.shouldCheckCRLF() && this.startWithLF(value) && this.endWithCR(node); - const startOffset = this._buffers[0].buffer.length; - this._buffers[0].buffer += value; - const lineStarts = createLineStartsFast(value, false); - for (let i = 0; i < lineStarts.length; i++) { - lineStarts[i] += startOffset; - } - if (hitCRLF) { - let prevStartOffset = this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 2]; - this._buffers[0].lineStarts.pop(); - // _lastChangeBufferPos is already wrong - this._lastChangeBufferPos = { line: this._lastChangeBufferPos.line - 1, column: startOffset - prevStartOffset }; - } - this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(lineStarts.slice(1)); - const endIndex = this._buffers[0].lineStarts.length - 1; - const endColumn = this._buffers[0].buffer.length - this._buffers[0].lineStarts[endIndex]; - const newEnd = { line: endIndex, column: endColumn }; - const newLength = node.piece.length + value.length; - const oldLineFeedCnt = node.piece.lineFeedCnt; - const newLineFeedCnt = this.getLineFeedCnt(0, node.piece.start, newEnd); - const lf_delta = newLineFeedCnt - oldLineFeedCnt; - node.piece = new Piece(node.piece.bufferIndex, node.piece.start, newEnd, newLineFeedCnt, newLength); - this._lastChangeBufferPos = newEnd; - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["updateTreeMetadata"])(this, node, value.length, lf_delta); - } - nodeAt(offset) { - let x = this.root; - let cache = this._searchCache.get(offset); - if (cache) { - return { - node: cache.node, - nodeStartOffset: cache.nodeStartOffset, - remainder: offset - cache.nodeStartOffset - }; - } - let nodeStartOffset = 0; - while (x !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - if (x.size_left > offset) { - x = x.left; - } - else if (x.size_left + x.piece.length >= offset) { - nodeStartOffset += x.size_left; - let ret = { - node: x, - remainder: offset - x.size_left, - nodeStartOffset - }; - this._searchCache.set(ret); - return ret; - } - else { - offset -= x.size_left + x.piece.length; - nodeStartOffset += x.size_left + x.piece.length; - x = x.right; - } - } - return null; - } - nodeAt2(lineNumber, column) { - let x = this.root; - let nodeStartOffset = 0; - while (x !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - if (x.left !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"] && x.lf_left >= lineNumber - 1) { - x = x.left; - } - else if (x.lf_left + x.piece.lineFeedCnt > lineNumber - 1) { - let prevAccumualtedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); - let accumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 1); - nodeStartOffset += x.size_left; - return { - node: x, - remainder: Math.min(prevAccumualtedValue + column - 1, accumulatedValue), - nodeStartOffset - }; - } - else if (x.lf_left + x.piece.lineFeedCnt === lineNumber - 1) { - let prevAccumualtedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); - if (prevAccumualtedValue + column - 1 <= x.piece.length) { - return { - node: x, - remainder: prevAccumualtedValue + column - 1, - nodeStartOffset - }; - } - else { - column -= x.piece.length - prevAccumualtedValue; - break; - } - } - else { - lineNumber -= x.lf_left + x.piece.lineFeedCnt; - nodeStartOffset += x.size_left + x.piece.length; - x = x.right; - } - } - // search in order, to find the node contains position.column - x = x.next(); - while (x !== _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - if (x.piece.lineFeedCnt > 0) { - let accumulatedValue = this.getAccumulatedValue(x, 0); - let nodeStartOffset = this.offsetOfNode(x); - return { - node: x, - remainder: Math.min(column - 1, accumulatedValue), - nodeStartOffset - }; - } - else { - if (x.piece.length >= column - 1) { - let nodeStartOffset = this.offsetOfNode(x); - return { - node: x, - remainder: column - 1, - nodeStartOffset - }; - } - else { - column -= x.piece.length; - } - } - x = x.next(); - } - return null; - } - nodeCharCodeAt(node, offset) { - if (node.piece.lineFeedCnt < 1) { - return -1; - } - let buffer = this._buffers[node.piece.bufferIndex]; - let newOffset = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start) + offset; - return buffer.buffer.charCodeAt(newOffset); - } - offsetOfNode(node) { - if (!node) { - return 0; - } - let pos = node.size_left; - while (node !== this.root) { - if (node.parent.right === node) { - pos += node.parent.size_left + node.parent.piece.length; - } - node = node.parent; - } - return pos; - } - // #endregion - // #region CRLF - shouldCheckCRLF() { - return !(this._EOLNormalized && this._EOL === '\n'); - } - startWithLF(val) { - if (typeof val === 'string') { - return val.charCodeAt(0) === 10; - } - if (val === _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"] || val.piece.lineFeedCnt === 0) { - return false; - } - let piece = val.piece; - let lineStarts = this._buffers[piece.bufferIndex].lineStarts; - let line = piece.start.line; - let startOffset = lineStarts[line] + piece.start.column; - if (line === lineStarts.length - 1) { - // last line, so there is no line feed at the end of this line - return false; - } - let nextLineOffset = lineStarts[line + 1]; - if (nextLineOffset > startOffset + 1) { - return false; - } - return this._buffers[piece.bufferIndex].buffer.charCodeAt(startOffset) === 10; - } - endWithCR(val) { - if (typeof val === 'string') { - return val.charCodeAt(val.length - 1) === 13; - } - if (val === _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"] || val.piece.lineFeedCnt === 0) { - return false; - } - return this.nodeCharCodeAt(val, val.piece.length - 1) === 13; - } - validateCRLFWithPrevNode(nextNode) { - if (this.shouldCheckCRLF() && this.startWithLF(nextNode)) { - let node = nextNode.prev(); - if (this.endWithCR(node)) { - this.fixCRLF(node, nextNode); - } - } - } - validateCRLFWithNextNode(node) { - if (this.shouldCheckCRLF() && this.endWithCR(node)) { - let nextNode = node.next(); - if (this.startWithLF(nextNode)) { - this.fixCRLF(node, nextNode); - } - } - } - fixCRLF(prev, next) { - let nodesToDel = []; - // update node - let lineStarts = this._buffers[prev.piece.bufferIndex].lineStarts; - let newEnd; - if (prev.piece.end.column === 0) { - // it means, last line ends with \r, not \r\n - newEnd = { line: prev.piece.end.line - 1, column: lineStarts[prev.piece.end.line] - lineStarts[prev.piece.end.line - 1] - 1 }; - } - else { - // \r\n - newEnd = { line: prev.piece.end.line, column: prev.piece.end.column - 1 }; - } - const prevNewLength = prev.piece.length - 1; - const prevNewLFCnt = prev.piece.lineFeedCnt - 1; - prev.piece = new Piece(prev.piece.bufferIndex, prev.piece.start, newEnd, prevNewLFCnt, prevNewLength); - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["updateTreeMetadata"])(this, prev, -1, -1); - if (prev.piece.length === 0) { - nodesToDel.push(prev); - } - // update nextNode - let newStart = { line: next.piece.start.line + 1, column: 0 }; - const newLength = next.piece.length - 1; - const newLineFeedCnt = this.getLineFeedCnt(next.piece.bufferIndex, newStart, next.piece.end); - next.piece = new Piece(next.piece.bufferIndex, newStart, next.piece.end, newLineFeedCnt, newLength); - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["updateTreeMetadata"])(this, next, -1, -1); - if (next.piece.length === 0) { - nodesToDel.push(next); - } - // create new piece which contains \r\n - let pieces = this.createNewPieces('\r\n'); - this.rbInsertRight(prev, pieces[0]); - // delete empty nodes - for (let i = 0; i < nodesToDel.length; i++) { - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["rbDelete"])(this, nodesToDel[i]); - } - } - adjustCarriageReturnFromNext(value, node) { - if (this.shouldCheckCRLF() && this.endWithCR(value)) { - let nextNode = node.next(); - if (this.startWithLF(nextNode)) { - // move `\n` forward - value += '\n'; - if (nextNode.piece.length === 1) { - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["rbDelete"])(this, nextNode); - } - else { - const piece = nextNode.piece; - const newStart = { line: piece.start.line + 1, column: 0 }; - const newLength = piece.length - 1; - const newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, newStart, piece.end); - nextNode.piece = new Piece(piece.bufferIndex, newStart, piece.end, newLineFeedCnt, newLength); - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["updateTreeMetadata"])(this, nextNode, -1, -1); - } - return true; - } - } - return false; - } - // #endregion - // #endregion - // #region Tree operations - iterate(node, callback) { - if (node === _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - return callback(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]); - } - let leftRet = this.iterate(node.left, callback); - if (!leftRet) { - return leftRet; - } - return callback(node) && this.iterate(node.right, callback); - } - getNodeContent(node) { - if (node === _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - return ''; - } - let buffer = this._buffers[node.piece.bufferIndex]; - let currentContent; - let piece = node.piece; - let startOffset = this.offsetInBuffer(piece.bufferIndex, piece.start); - let endOffset = this.offsetInBuffer(piece.bufferIndex, piece.end); - currentContent = buffer.buffer.substring(startOffset, endOffset); - return currentContent; - } - getPieceContent(piece) { - let buffer = this._buffers[piece.bufferIndex]; - let startOffset = this.offsetInBuffer(piece.bufferIndex, piece.start); - let endOffset = this.offsetInBuffer(piece.bufferIndex, piece.end); - let currentContent = buffer.buffer.substring(startOffset, endOffset); - return currentContent; - } - /** - * node node - * / \ / \ - * a b <---- a b - * / - * z - */ - rbInsertRight(node, p) { - let z = new _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["TreeNode"](p, 1 /* Red */); - z.left = _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]; - z.right = _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]; - z.parent = _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]; - z.size_left = 0; - z.lf_left = 0; - let x = this.root; - if (x === _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - this.root = z; - z.color = 0 /* Black */; - } - else if (node.right === _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - node.right = z; - z.parent = node; - } - else { - let nextNode = Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["leftest"])(node.right); - nextNode.left = z; - z.parent = nextNode; - } - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["fixInsert"])(this, z); - return z; - } - /** - * node node - * / \ / \ - * a b ----> a b - * \ - * z - */ - rbInsertLeft(node, p) { - let z = new _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["TreeNode"](p, 1 /* Red */); - z.left = _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]; - z.right = _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]; - z.parent = _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]; - z.size_left = 0; - z.lf_left = 0; - if (this.root === _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - this.root = z; - z.color = 0 /* Black */; - } - else if (node.left === _rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["SENTINEL"]) { - node.left = z; - z.parent = node; - } - else { - let prevNode = Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["righttest"])(node.left); // a - prevNode.right = z; - z.parent = prevNode; - } - Object(_rbTreeBase_js__WEBPACK_IMPORTED_MODULE_3__["fixInsert"])(this, z); - return z; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js ***! - \**********************************************************************************************************/ -/*! exports provided: PieceTreeTextBuffer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PieceTreeTextBuffer", function() { return PieceTreeTextBuffer; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/* harmony import */ var _pieceTreeBase_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pieceTreeBase.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js"); -/* harmony import */ var _tokensStore_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tokensStore.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/tokensStore.js"); -/* harmony import */ var _textChange_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../textChange.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textChange.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -class PieceTreeTextBuffer { - constructor(chunks, BOM, eol, containsRTL, containsUnusualLineTerminators, isBasicASCII, eolNormalized) { - this._onDidChangeContent = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this._BOM = BOM; - this._mightContainNonBasicASCII = !isBasicASCII; - this._mightContainRTL = containsRTL; - this._mightContainUnusualLineTerminators = containsUnusualLineTerminators; - this._pieceTree = new _pieceTreeBase_js__WEBPACK_IMPORTED_MODULE_4__["PieceTreeBase"](chunks, eol, eolNormalized); - } - dispose() { - this._onDidChangeContent.dispose(); - } - mightContainRTL() { - return this._mightContainRTL; - } - mightContainUnusualLineTerminators() { - return this._mightContainUnusualLineTerminators; - } - resetMightContainUnusualLineTerminators() { - this._mightContainUnusualLineTerminators = false; - } - mightContainNonBasicASCII() { - return this._mightContainNonBasicASCII; - } - getBOM() { - return this._BOM; - } - getEOL() { - return this._pieceTree.getEOL(); - } - createSnapshot(preserveBOM) { - return this._pieceTree.createSnapshot(preserveBOM ? this._BOM : ''); - } - getOffsetAt(lineNumber, column) { - return this._pieceTree.getOffsetAt(lineNumber, column); - } - getPositionAt(offset) { - return this._pieceTree.getPositionAt(offset); - } - getRangeAt(start, length) { - let end = start + length; - const startPosition = this.getPositionAt(start); - const endPosition = this.getPositionAt(end); - return new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column); - } - getValueInRange(range, eol = 0 /* TextDefined */) { - if (range.isEmpty()) { - return ''; - } - const lineEnding = this._getEndOfLine(eol); - return this._pieceTree.getValueInRange(range, lineEnding); - } - getValueLengthInRange(range, eol = 0 /* TextDefined */) { - if (range.isEmpty()) { - return 0; - } - if (range.startLineNumber === range.endLineNumber) { - return (range.endColumn - range.startColumn); - } - let startOffset = this.getOffsetAt(range.startLineNumber, range.startColumn); - let endOffset = this.getOffsetAt(range.endLineNumber, range.endColumn); - return endOffset - startOffset; - } - getCharacterCountInRange(range, eol = 0 /* TextDefined */) { - if (this._mightContainNonBasicASCII) { - // we must count by iterating - let result = 0; - const fromLineNumber = range.startLineNumber; - const toLineNumber = range.endLineNumber; - for (let lineNumber = fromLineNumber; lineNumber <= toLineNumber; lineNumber++) { - const lineContent = this.getLineContent(lineNumber); - const fromOffset = (lineNumber === fromLineNumber ? range.startColumn - 1 : 0); - const toOffset = (lineNumber === toLineNumber ? range.endColumn - 1 : lineContent.length); - for (let offset = fromOffset; offset < toOffset; offset++) { - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["isHighSurrogate"](lineContent.charCodeAt(offset))) { - result = result + 1; - offset = offset + 1; - } - else { - result = result + 1; - } - } - } - result += this._getEndOfLine(eol).length * (toLineNumber - fromLineNumber); - return result; - } - return this.getValueLengthInRange(range, eol); - } - getLength() { - return this._pieceTree.getLength(); - } - getLineCount() { - return this._pieceTree.getLineCount(); - } - getLinesContent() { - return this._pieceTree.getLinesContent(); - } - getLineContent(lineNumber) { - return this._pieceTree.getLineContent(lineNumber); - } - getLineCharCode(lineNumber, index) { - return this._pieceTree.getLineCharCode(lineNumber, index); - } - getLineLength(lineNumber) { - return this._pieceTree.getLineLength(lineNumber); - } - getLineFirstNonWhitespaceColumn(lineNumber) { - const result = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](this.getLineContent(lineNumber)); - if (result === -1) { - return 0; - } - return result + 1; - } - getLineLastNonWhitespaceColumn(lineNumber) { - const result = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["lastNonWhitespaceIndex"](this.getLineContent(lineNumber)); - if (result === -1) { - return 0; - } - return result + 2; - } - _getEndOfLine(eol) { - switch (eol) { - case 1 /* LF */: - return '\n'; - case 2 /* CRLF */: - return '\r\n'; - case 0 /* TextDefined */: - return this.getEOL(); - default: - throw new Error('Unknown EOL preference'); - } - } - setEOL(newEOL) { - this._pieceTree.setEOL(newEOL); - } - applyEdits(rawOperations, recordTrimAutoWhitespace, computeUndoEdits) { - let mightContainRTL = this._mightContainRTL; - let mightContainUnusualLineTerminators = this._mightContainUnusualLineTerminators; - let mightContainNonBasicASCII = this._mightContainNonBasicASCII; - let canReduceOperations = true; - let operations = []; - for (let i = 0; i < rawOperations.length; i++) { - let op = rawOperations[i]; - if (canReduceOperations && op._isTracked) { - canReduceOperations = false; - } - let validatedRange = op.range; - if (op.text) { - let textMightContainNonBasicASCII = true; - if (!mightContainNonBasicASCII) { - textMightContainNonBasicASCII = !_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["isBasicASCII"](op.text); - mightContainNonBasicASCII = textMightContainNonBasicASCII; - } - if (!mightContainRTL && textMightContainNonBasicASCII) { - // check if the new inserted text contains RTL - mightContainRTL = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["containsRTL"](op.text); - } - if (!mightContainUnusualLineTerminators && textMightContainNonBasicASCII) { - // check if the new inserted text contains unusual line terminators - mightContainUnusualLineTerminators = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["containsUnusualLineTerminators"](op.text); - } - } - let validText = ''; - let eolCount = 0; - let firstLineLength = 0; - let lastLineLength = 0; - if (op.text) { - let strEOL; - [eolCount, firstLineLength, lastLineLength, strEOL] = Object(_tokensStore_js__WEBPACK_IMPORTED_MODULE_5__["countEOL"])(op.text); - const bufferEOL = this.getEOL(); - const expectedStrEOL = (bufferEOL === '\r\n' ? 2 /* CRLF */ : 1 /* LF */); - if (strEOL === 0 /* Unknown */ || strEOL === expectedStrEOL) { - validText = op.text; - } - else { - validText = op.text.replace(/\r\n|\r|\n/g, bufferEOL); - } - } - operations[i] = { - sortIndex: i, - identifier: op.identifier || null, - range: validatedRange, - rangeOffset: this.getOffsetAt(validatedRange.startLineNumber, validatedRange.startColumn), - rangeLength: this.getValueLengthInRange(validatedRange), - text: validText, - eolCount: eolCount, - firstLineLength: firstLineLength, - lastLineLength: lastLineLength, - forceMoveMarkers: Boolean(op.forceMoveMarkers), - isAutoWhitespaceEdit: op.isAutoWhitespaceEdit || false - }; - } - // Sort operations ascending - operations.sort(PieceTreeTextBuffer._sortOpsAscending); - let hasTouchingRanges = false; - for (let i = 0, count = operations.length - 1; i < count; i++) { - let rangeEnd = operations[i].range.getEndPosition(); - let nextRangeStart = operations[i + 1].range.getStartPosition(); - if (nextRangeStart.isBeforeOrEqual(rangeEnd)) { - if (nextRangeStart.isBefore(rangeEnd)) { - // overlapping ranges - throw new Error('Overlapping ranges are not allowed!'); - } - hasTouchingRanges = true; - } - } - if (canReduceOperations) { - operations = this._reduceOperations(operations); - } - // Delta encode operations - let reverseRanges = (computeUndoEdits || recordTrimAutoWhitespace ? PieceTreeTextBuffer._getInverseEditRanges(operations) : []); - let newTrimAutoWhitespaceCandidates = []; - if (recordTrimAutoWhitespace) { - for (let i = 0; i < operations.length; i++) { - let op = operations[i]; - let reverseRange = reverseRanges[i]; - if (op.isAutoWhitespaceEdit && op.range.isEmpty()) { - // Record already the future line numbers that might be auto whitespace removal candidates on next edit - for (let lineNumber = reverseRange.startLineNumber; lineNumber <= reverseRange.endLineNumber; lineNumber++) { - let currentLineContent = ''; - if (lineNumber === reverseRange.startLineNumber) { - currentLineContent = this.getLineContent(op.range.startLineNumber); - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](currentLineContent) !== -1) { - continue; - } - } - newTrimAutoWhitespaceCandidates.push({ lineNumber: lineNumber, oldContent: currentLineContent }); - } - } - } - } - let reverseOperations = null; - if (computeUndoEdits) { - let reverseRangeDeltaOffset = 0; - reverseOperations = []; - for (let i = 0; i < operations.length; i++) { - const op = operations[i]; - const reverseRange = reverseRanges[i]; - const bufferText = this.getValueInRange(op.range); - const reverseRangeOffset = op.rangeOffset + reverseRangeDeltaOffset; - reverseRangeDeltaOffset += (op.text.length - bufferText.length); - reverseOperations[i] = { - sortIndex: op.sortIndex, - identifier: op.identifier, - range: reverseRange, - text: bufferText, - textChange: new _textChange_js__WEBPACK_IMPORTED_MODULE_6__["TextChange"](op.rangeOffset, bufferText, reverseRangeOffset, op.text) - }; - } - // Can only sort reverse operations when the order is not significant - if (!hasTouchingRanges) { - reverseOperations.sort((a, b) => a.sortIndex - b.sortIndex); - } - } - this._mightContainRTL = mightContainRTL; - this._mightContainUnusualLineTerminators = mightContainUnusualLineTerminators; - this._mightContainNonBasicASCII = mightContainNonBasicASCII; - const contentChanges = this._doApplyEdits(operations); - let trimAutoWhitespaceLineNumbers = null; - if (recordTrimAutoWhitespace && newTrimAutoWhitespaceCandidates.length > 0) { - // sort line numbers auto whitespace removal candidates for next edit descending - newTrimAutoWhitespaceCandidates.sort((a, b) => b.lineNumber - a.lineNumber); - trimAutoWhitespaceLineNumbers = []; - for (let i = 0, len = newTrimAutoWhitespaceCandidates.length; i < len; i++) { - let lineNumber = newTrimAutoWhitespaceCandidates[i].lineNumber; - if (i > 0 && newTrimAutoWhitespaceCandidates[i - 1].lineNumber === lineNumber) { - // Do not have the same line number twice - continue; - } - let prevContent = newTrimAutoWhitespaceCandidates[i].oldContent; - let lineContent = this.getLineContent(lineNumber); - if (lineContent.length === 0 || lineContent === prevContent || _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](lineContent) !== -1) { - continue; - } - trimAutoWhitespaceLineNumbers.push(lineNumber); - } - } - this._onDidChangeContent.fire(); - return new _model_js__WEBPACK_IMPORTED_MODULE_3__["ApplyEditsResult"](reverseOperations, contentChanges, trimAutoWhitespaceLineNumbers); - } - /** - * Transform operations such that they represent the same logic edit, - * but that they also do not cause OOM crashes. - */ - _reduceOperations(operations) { - if (operations.length < 1000) { - // We know from empirical testing that a thousand edits work fine regardless of their shape. - return operations; - } - // At one point, due to how events are emitted and how each operation is handled, - // some operations can trigger a high amount of temporary string allocations, - // that will immediately get edited again. - // e.g. a formatter inserting ridiculous ammounts of \n on a model with a single line - // Therefore, the strategy is to collapse all the operations into a huge single edit operation - return [this._toSingleEditOperation(operations)]; - } - _toSingleEditOperation(operations) { - let forceMoveMarkers = false; - const firstEditRange = operations[0].range; - const lastEditRange = operations[operations.length - 1].range; - const entireEditRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](firstEditRange.startLineNumber, firstEditRange.startColumn, lastEditRange.endLineNumber, lastEditRange.endColumn); - let lastEndLineNumber = firstEditRange.startLineNumber; - let lastEndColumn = firstEditRange.startColumn; - const result = []; - for (let i = 0, len = operations.length; i < len; i++) { - const operation = operations[i]; - const range = operation.range; - forceMoveMarkers = forceMoveMarkers || operation.forceMoveMarkers; - // (1) -- Push old text - result.push(this.getValueInRange(new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](lastEndLineNumber, lastEndColumn, range.startLineNumber, range.startColumn))); - // (2) -- Push new text - if (operation.text.length > 0) { - result.push(operation.text); - } - lastEndLineNumber = range.endLineNumber; - lastEndColumn = range.endColumn; - } - const text = result.join(''); - const [eolCount, firstLineLength, lastLineLength] = Object(_tokensStore_js__WEBPACK_IMPORTED_MODULE_5__["countEOL"])(text); - return { - sortIndex: 0, - identifier: operations[0].identifier, - range: entireEditRange, - rangeOffset: this.getOffsetAt(entireEditRange.startLineNumber, entireEditRange.startColumn), - rangeLength: this.getValueLengthInRange(entireEditRange, 0 /* TextDefined */), - text: text, - eolCount: eolCount, - firstLineLength: firstLineLength, - lastLineLength: lastLineLength, - forceMoveMarkers: forceMoveMarkers, - isAutoWhitespaceEdit: false - }; - } - _doApplyEdits(operations) { - operations.sort(PieceTreeTextBuffer._sortOpsDescending); - let contentChanges = []; - // operations are from bottom to top - for (let i = 0; i < operations.length; i++) { - let op = operations[i]; - const startLineNumber = op.range.startLineNumber; - const startColumn = op.range.startColumn; - const endLineNumber = op.range.endLineNumber; - const endColumn = op.range.endColumn; - if (startLineNumber === endLineNumber && startColumn === endColumn && op.text.length === 0) { - // no-op - continue; - } - if (op.text) { - // replacement - this._pieceTree.delete(op.rangeOffset, op.rangeLength); - this._pieceTree.insert(op.rangeOffset, op.text, true); - } - else { - // deletion - this._pieceTree.delete(op.rangeOffset, op.rangeLength); - } - const contentChangeRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](startLineNumber, startColumn, endLineNumber, endColumn); - contentChanges.push({ - range: contentChangeRange, - rangeLength: op.rangeLength, - text: op.text, - rangeOffset: op.rangeOffset, - forceMoveMarkers: op.forceMoveMarkers - }); - } - return contentChanges; - } - findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount) { - return this._pieceTree.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount); - } - /** - * Assumes `operations` are validated and sorted ascending - */ - static _getInverseEditRanges(operations) { - let result = []; - let prevOpEndLineNumber = 0; - let prevOpEndColumn = 0; - let prevOp = null; - for (let i = 0, len = operations.length; i < len; i++) { - let op = operations[i]; - let startLineNumber; - let startColumn; - if (prevOp) { - if (prevOp.range.endLineNumber === op.range.startLineNumber) { - startLineNumber = prevOpEndLineNumber; - startColumn = prevOpEndColumn + (op.range.startColumn - prevOp.range.endColumn); - } - else { - startLineNumber = prevOpEndLineNumber + (op.range.startLineNumber - prevOp.range.endLineNumber); - startColumn = op.range.startColumn; - } - } - else { - startLineNumber = op.range.startLineNumber; - startColumn = op.range.startColumn; - } - let resultRange; - if (op.text.length > 0) { - // the operation inserts something - const lineCount = op.eolCount + 1; - if (lineCount === 1) { - // single line insert - resultRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](startLineNumber, startColumn, startLineNumber, startColumn + op.firstLineLength); - } - else { - // multi line insert - resultRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](startLineNumber, startColumn, startLineNumber + lineCount - 1, op.lastLineLength + 1); - } - } - else { - // There is nothing to insert - resultRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](startLineNumber, startColumn, startLineNumber, startColumn); - } - prevOpEndLineNumber = resultRange.endLineNumber; - prevOpEndColumn = resultRange.endColumn; - result.push(resultRange); - prevOp = op; - } - return result; - } - static _sortOpsAscending(a, b) { - let r = _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].compareRangesUsingEnds(a.range, b.range); - if (r === 0) { - return a.sortIndex - b.sortIndex; - } - return r; - } - static _sortOpsDescending(a, b) { - let r = _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].compareRangesUsingEnds(a.range, b.range); - if (r === 0) { - return b.sortIndex - a.sortIndex; - } - return -r; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.js": -/*!*****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.js ***! - \*****************************************************************************************************************/ -/*! exports provided: PieceTreeTextBufferFactory, PieceTreeTextBufferBuilder */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PieceTreeTextBufferFactory", function() { return PieceTreeTextBufferFactory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PieceTreeTextBufferBuilder", function() { return PieceTreeTextBufferBuilder; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _pieceTreeBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pieceTreeBase.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.js"); -/* harmony import */ var _pieceTreeTextBuffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pieceTreeTextBuffer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class PieceTreeTextBufferFactory { - constructor(_chunks, _bom, _cr, _lf, _crlf, _containsRTL, _containsUnusualLineTerminators, _isBasicASCII, _normalizeEOL) { - this._chunks = _chunks; - this._bom = _bom; - this._cr = _cr; - this._lf = _lf; - this._crlf = _crlf; - this._containsRTL = _containsRTL; - this._containsUnusualLineTerminators = _containsUnusualLineTerminators; - this._isBasicASCII = _isBasicASCII; - this._normalizeEOL = _normalizeEOL; - } - _getEOL(defaultEOL) { - const totalEOLCount = this._cr + this._lf + this._crlf; - const totalCRCount = this._cr + this._crlf; - if (totalEOLCount === 0) { - // This is an empty file or a file with precisely one line - return (defaultEOL === 1 /* LF */ ? '\n' : '\r\n'); - } - if (totalCRCount > totalEOLCount / 2) { - // More than half of the file contains \r\n ending lines - return '\r\n'; - } - // At least one line more ends in \n - return '\n'; - } - create(defaultEOL) { - const eol = this._getEOL(defaultEOL); - let chunks = this._chunks; - if (this._normalizeEOL && - ((eol === '\r\n' && (this._cr > 0 || this._lf > 0)) - || (eol === '\n' && (this._cr > 0 || this._crlf > 0)))) { - // Normalize pieces - for (let i = 0, len = chunks.length; i < len; i++) { - let str = chunks[i].buffer.replace(/\r\n|\r|\n/g, eol); - let newLineStart = Object(_pieceTreeBase_js__WEBPACK_IMPORTED_MODULE_1__["createLineStartsFast"])(str); - chunks[i] = new _pieceTreeBase_js__WEBPACK_IMPORTED_MODULE_1__["StringBuffer"](str, newLineStart); - } - } - return new _pieceTreeTextBuffer_js__WEBPACK_IMPORTED_MODULE_2__["PieceTreeTextBuffer"](chunks, this._bom, eol, this._containsRTL, this._containsUnusualLineTerminators, this._isBasicASCII, this._normalizeEOL); - } -} -class PieceTreeTextBufferBuilder { - constructor() { - this.chunks = []; - this.BOM = ''; - this._hasPreviousChar = false; - this._previousChar = 0; - this._tmpLineStarts = []; - this.cr = 0; - this.lf = 0; - this.crlf = 0; - this.containsRTL = false; - this.containsUnusualLineTerminators = false; - this.isBasicASCII = true; - } - acceptChunk(chunk) { - if (chunk.length === 0) { - return; - } - if (this.chunks.length === 0) { - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["startsWithUTF8BOM"](chunk)) { - this.BOM = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["UTF8_BOM_CHARACTER"]; - chunk = chunk.substr(1); - } - } - const lastChar = chunk.charCodeAt(chunk.length - 1); - if (lastChar === 13 /* CarriageReturn */ || (lastChar >= 0xD800 && lastChar <= 0xDBFF)) { - // last character is \r or a high surrogate => keep it back - this._acceptChunk1(chunk.substr(0, chunk.length - 1), false); - this._hasPreviousChar = true; - this._previousChar = lastChar; - } - else { - this._acceptChunk1(chunk, false); - this._hasPreviousChar = false; - this._previousChar = lastChar; - } - } - _acceptChunk1(chunk, allowEmptyStrings) { - if (!allowEmptyStrings && chunk.length === 0) { - // Nothing to do - return; - } - if (this._hasPreviousChar) { - this._acceptChunk2(String.fromCharCode(this._previousChar) + chunk); - } - else { - this._acceptChunk2(chunk); - } - } - _acceptChunk2(chunk) { - const lineStarts = Object(_pieceTreeBase_js__WEBPACK_IMPORTED_MODULE_1__["createLineStarts"])(this._tmpLineStarts, chunk); - this.chunks.push(new _pieceTreeBase_js__WEBPACK_IMPORTED_MODULE_1__["StringBuffer"](chunk, lineStarts.lineStarts)); - this.cr += lineStarts.cr; - this.lf += lineStarts.lf; - this.crlf += lineStarts.crlf; - if (this.isBasicASCII) { - this.isBasicASCII = lineStarts.isBasicASCII; - } - if (!this.isBasicASCII && !this.containsRTL) { - // No need to check if it is basic ASCII - this.containsRTL = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["containsRTL"](chunk); - } - if (!this.isBasicASCII && !this.containsUnusualLineTerminators) { - // No need to check if it is basic ASCII - this.containsUnusualLineTerminators = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["containsUnusualLineTerminators"](chunk); - } - } - finish(normalizeEOL = true) { - this._finish(); - return new PieceTreeTextBufferFactory(this.chunks, this.BOM, this.cr, this.lf, this.crlf, this.containsRTL, this.containsUnusualLineTerminators, this.isBasicASCII, normalizeEOL); - } - _finish() { - if (this.chunks.length === 0) { - this._acceptChunk1('', true); - } - if (this._hasPreviousChar) { - this._hasPreviousChar = false; - // recreate last chunk - let lastChunk = this.chunks[this.chunks.length - 1]; - lastChunk.buffer += String.fromCharCode(this._previousChar); - let newLineStarts = Object(_pieceTreeBase_js__WEBPACK_IMPORTED_MODULE_1__["createLineStartsFast"])(lastChunk.buffer); - lastChunk.lineStarts = newLineStarts; - if (this._previousChar === 13 /* CarriageReturn */) { - this.cr++; - } - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/rbTreeBase.js ***! - \*************************************************************************************************/ -/*! exports provided: TreeNode, SENTINEL, leftest, righttest, calculateSize, calculateLF, resetSentinel, leftRotate, rightRotate, rbDelete, fixInsert, updateTreeMetadata, recomputeTreeMetadata */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TreeNode", function() { return TreeNode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SENTINEL", function() { return SENTINEL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "leftest", function() { return leftest; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "righttest", function() { return righttest; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateSize", function() { return calculateSize; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateLF", function() { return calculateLF; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resetSentinel", function() { return resetSentinel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "leftRotate", function() { return leftRotate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rightRotate", function() { return rightRotate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rbDelete", function() { return rbDelete; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fixInsert", function() { return fixInsert; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateTreeMetadata", function() { return updateTreeMetadata; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recomputeTreeMetadata", function() { return recomputeTreeMetadata; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class TreeNode { - constructor(piece, color) { - this.piece = piece; - this.color = color; - this.size_left = 0; - this.lf_left = 0; - this.parent = this; - this.left = this; - this.right = this; - } - next() { - if (this.right !== SENTINEL) { - return leftest(this.right); - } - let node = this; - while (node.parent !== SENTINEL) { - if (node.parent.left === node) { - break; - } - node = node.parent; - } - if (node.parent === SENTINEL) { - return SENTINEL; - } - else { - return node.parent; - } - } - prev() { - if (this.left !== SENTINEL) { - return righttest(this.left); - } - let node = this; - while (node.parent !== SENTINEL) { - if (node.parent.right === node) { - break; - } - node = node.parent; - } - if (node.parent === SENTINEL) { - return SENTINEL; - } - else { - return node.parent; - } - } - detach() { - this.parent = null; - this.left = null; - this.right = null; - } -} -const SENTINEL = new TreeNode(null, 0 /* Black */); -SENTINEL.parent = SENTINEL; -SENTINEL.left = SENTINEL; -SENTINEL.right = SENTINEL; -SENTINEL.color = 0 /* Black */; -function leftest(node) { - while (node.left !== SENTINEL) { - node = node.left; - } - return node; -} -function righttest(node) { - while (node.right !== SENTINEL) { - node = node.right; - } - return node; -} -function calculateSize(node) { - if (node === SENTINEL) { - return 0; - } - return node.size_left + node.piece.length + calculateSize(node.right); -} -function calculateLF(node) { - if (node === SENTINEL) { - return 0; - } - return node.lf_left + node.piece.lineFeedCnt + calculateLF(node.right); -} -function resetSentinel() { - SENTINEL.parent = SENTINEL; -} -function leftRotate(tree, x) { - let y = x.right; - // fix size_left - y.size_left += x.size_left + (x.piece ? x.piece.length : 0); - y.lf_left += x.lf_left + (x.piece ? x.piece.lineFeedCnt : 0); - x.right = y.left; - if (y.left !== SENTINEL) { - y.left.parent = x; - } - y.parent = x.parent; - if (x.parent === SENTINEL) { - tree.root = y; - } - else if (x.parent.left === x) { - x.parent.left = y; - } - else { - x.parent.right = y; - } - y.left = x; - x.parent = y; -} -function rightRotate(tree, y) { - let x = y.left; - y.left = x.right; - if (x.right !== SENTINEL) { - x.right.parent = y; - } - x.parent = y.parent; - // fix size_left - y.size_left -= x.size_left + (x.piece ? x.piece.length : 0); - y.lf_left -= x.lf_left + (x.piece ? x.piece.lineFeedCnt : 0); - if (y.parent === SENTINEL) { - tree.root = x; - } - else if (y === y.parent.right) { - y.parent.right = x; - } - else { - y.parent.left = x; - } - x.right = y; - y.parent = x; -} -function rbDelete(tree, z) { - let x; - let y; - if (z.left === SENTINEL) { - y = z; - x = y.right; - } - else if (z.right === SENTINEL) { - y = z; - x = y.left; - } - else { - y = leftest(z.right); - x = y.right; - } - if (y === tree.root) { - tree.root = x; - // if x is null, we are removing the only node - x.color = 0 /* Black */; - z.detach(); - resetSentinel(); - tree.root.parent = SENTINEL; - return; - } - let yWasRed = (y.color === 1 /* Red */); - if (y === y.parent.left) { - y.parent.left = x; - } - else { - y.parent.right = x; - } - if (y === z) { - x.parent = y.parent; - recomputeTreeMetadata(tree, x); - } - else { - if (y.parent === z) { - x.parent = y; - } - else { - x.parent = y.parent; - } - // as we make changes to x's hierarchy, update size_left of subtree first - recomputeTreeMetadata(tree, x); - y.left = z.left; - y.right = z.right; - y.parent = z.parent; - y.color = z.color; - if (z === tree.root) { - tree.root = y; - } - else { - if (z === z.parent.left) { - z.parent.left = y; - } - else { - z.parent.right = y; - } - } - if (y.left !== SENTINEL) { - y.left.parent = y; - } - if (y.right !== SENTINEL) { - y.right.parent = y; - } - // update metadata - // we replace z with y, so in this sub tree, the length change is z.item.length - y.size_left = z.size_left; - y.lf_left = z.lf_left; - recomputeTreeMetadata(tree, y); - } - z.detach(); - if (x.parent.left === x) { - let newSizeLeft = calculateSize(x); - let newLFLeft = calculateLF(x); - if (newSizeLeft !== x.parent.size_left || newLFLeft !== x.parent.lf_left) { - let delta = newSizeLeft - x.parent.size_left; - let lf_delta = newLFLeft - x.parent.lf_left; - x.parent.size_left = newSizeLeft; - x.parent.lf_left = newLFLeft; - updateTreeMetadata(tree, x.parent, delta, lf_delta); - } - } - recomputeTreeMetadata(tree, x.parent); - if (yWasRed) { - resetSentinel(); - return; - } - // RB-DELETE-FIXUP - let w; - while (x !== tree.root && x.color === 0 /* Black */) { - if (x === x.parent.left) { - w = x.parent.right; - if (w.color === 1 /* Red */) { - w.color = 0 /* Black */; - x.parent.color = 1 /* Red */; - leftRotate(tree, x.parent); - w = x.parent.right; - } - if (w.left.color === 0 /* Black */ && w.right.color === 0 /* Black */) { - w.color = 1 /* Red */; - x = x.parent; - } - else { - if (w.right.color === 0 /* Black */) { - w.left.color = 0 /* Black */; - w.color = 1 /* Red */; - rightRotate(tree, w); - w = x.parent.right; - } - w.color = x.parent.color; - x.parent.color = 0 /* Black */; - w.right.color = 0 /* Black */; - leftRotate(tree, x.parent); - x = tree.root; - } - } - else { - w = x.parent.left; - if (w.color === 1 /* Red */) { - w.color = 0 /* Black */; - x.parent.color = 1 /* Red */; - rightRotate(tree, x.parent); - w = x.parent.left; - } - if (w.left.color === 0 /* Black */ && w.right.color === 0 /* Black */) { - w.color = 1 /* Red */; - x = x.parent; - } - else { - if (w.left.color === 0 /* Black */) { - w.right.color = 0 /* Black */; - w.color = 1 /* Red */; - leftRotate(tree, w); - w = x.parent.left; - } - w.color = x.parent.color; - x.parent.color = 0 /* Black */; - w.left.color = 0 /* Black */; - rightRotate(tree, x.parent); - x = tree.root; - } - } - } - x.color = 0 /* Black */; - resetSentinel(); -} -function fixInsert(tree, x) { - recomputeTreeMetadata(tree, x); - while (x !== tree.root && x.parent.color === 1 /* Red */) { - if (x.parent === x.parent.parent.left) { - const y = x.parent.parent.right; - if (y.color === 1 /* Red */) { - x.parent.color = 0 /* Black */; - y.color = 0 /* Black */; - x.parent.parent.color = 1 /* Red */; - x = x.parent.parent; - } - else { - if (x === x.parent.right) { - x = x.parent; - leftRotate(tree, x); - } - x.parent.color = 0 /* Black */; - x.parent.parent.color = 1 /* Red */; - rightRotate(tree, x.parent.parent); - } - } - else { - const y = x.parent.parent.left; - if (y.color === 1 /* Red */) { - x.parent.color = 0 /* Black */; - y.color = 0 /* Black */; - x.parent.parent.color = 1 /* Red */; - x = x.parent.parent; - } - else { - if (x === x.parent.left) { - x = x.parent; - rightRotate(tree, x); - } - x.parent.color = 0 /* Black */; - x.parent.parent.color = 1 /* Red */; - leftRotate(tree, x.parent.parent); - } - } - } - tree.root.color = 0 /* Black */; -} -function updateTreeMetadata(tree, x, delta, lineFeedCntDelta) { - // node length change or line feed count change - while (x !== tree.root && x !== SENTINEL) { - if (x.parent.left === x) { - x.parent.size_left += delta; - x.parent.lf_left += lineFeedCntDelta; - } - x = x.parent; - } -} -function recomputeTreeMetadata(tree, x) { - let delta = 0; - let lf_delta = 0; - if (x === tree.root) { - return; - } - if (delta === 0) { - // go upwards till the node whose left subtree is changed. - while (x !== tree.root && x === x.parent.right) { - x = x.parent; - } - if (x === tree.root) { - // well, it means we add a node to the end (inorder) - return; - } - // x is the node whose right subtree is changed. - x = x.parent; - delta = calculateSize(x.left) - x.size_left; - lf_delta = calculateLF(x.left) - x.lf_left; - x.size_left += delta; - x.lf_left += lf_delta; - } - // go upwards till root. O(logN) - while (x !== tree.root && (delta !== 0 || lf_delta !== 0)) { - if (x.parent.left === x) { - x.parent.size_left += delta; - x.parent.lf_left += lf_delta; - } - x = x.parent; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/textChange.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/textChange.js ***! - \*****************************************************************************/ -/*! exports provided: TextChange, compressConsecutiveTextChanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextChange", function() { return TextChange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compressConsecutiveTextChanges", function() { return compressConsecutiveTextChanges; }); -/* harmony import */ var _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/buffer.js */ "./node_modules/monaco-editor/esm/vs/base/common/buffer.js"); -/* harmony import */ var _core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/stringBuilder.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/stringBuilder.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class TextChange { - constructor(oldPosition, oldText, newPosition, newText) { - this.oldPosition = oldPosition; - this.oldText = oldText; - this.newPosition = newPosition; - this.newText = newText; - } - get oldLength() { - return this.oldText.length; - } - get oldEnd() { - return this.oldPosition + this.oldText.length; - } - get newLength() { - return this.newText.length; - } - get newEnd() { - return this.newPosition + this.newText.length; - } - toString() { - if (this.oldText.length === 0) { - return `(insert@${this.oldPosition} "${this.newText}")`; - } - if (this.newText.length === 0) { - return `(delete@${this.oldPosition} "${this.oldText}")`; - } - return `(replace@${this.oldPosition} "${this.oldText}" with "${this.newText}")`; - } - static _writeStringSize(str) { - return (4 + 2 * str.length); - } - static _writeString(b, str, offset) { - const len = str.length; - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_0__["writeUInt32BE"](b, len, offset); - offset += 4; - for (let i = 0; i < len; i++) { - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_0__["writeUInt16LE"](b, str.charCodeAt(i), offset); - offset += 2; - } - return offset; - } - static _readString(b, offset) { - const len = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_0__["readUInt32BE"](b, offset); - offset += 4; - return Object(_core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_1__["decodeUTF16LE"])(b, offset, len); - } - writeSize() { - return (+4 // oldPosition - + 4 // newPosition - + TextChange._writeStringSize(this.oldText) - + TextChange._writeStringSize(this.newText)); - } - write(b, offset) { - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_0__["writeUInt32BE"](b, this.oldPosition, offset); - offset += 4; - _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_0__["writeUInt32BE"](b, this.newPosition, offset); - offset += 4; - offset = TextChange._writeString(b, this.oldText, offset); - offset = TextChange._writeString(b, this.newText, offset); - return offset; - } - static read(b, offset, dest) { - const oldPosition = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_0__["readUInt32BE"](b, offset); - offset += 4; - const newPosition = _base_common_buffer_js__WEBPACK_IMPORTED_MODULE_0__["readUInt32BE"](b, offset); - offset += 4; - const oldText = TextChange._readString(b, offset); - offset += TextChange._writeStringSize(oldText); - const newText = TextChange._readString(b, offset); - offset += TextChange._writeStringSize(newText); - dest.push(new TextChange(oldPosition, oldText, newPosition, newText)); - return offset; - } -} -function compressConsecutiveTextChanges(prevEdits, currEdits) { - if (prevEdits === null || prevEdits.length === 0) { - return currEdits; - } - const compressor = new TextChangeCompressor(prevEdits, currEdits); - return compressor.compress(); -} -class TextChangeCompressor { - constructor(prevEdits, currEdits) { - this._prevEdits = prevEdits; - this._currEdits = currEdits; - this._result = []; - this._resultLen = 0; - this._prevLen = this._prevEdits.length; - this._prevDeltaOffset = 0; - this._currLen = this._currEdits.length; - this._currDeltaOffset = 0; - } - compress() { - let prevIndex = 0; - let currIndex = 0; - let prevEdit = this._getPrev(prevIndex); - let currEdit = this._getCurr(currIndex); - while (prevIndex < this._prevLen || currIndex < this._currLen) { - if (prevEdit === null) { - this._acceptCurr(currEdit); - currEdit = this._getCurr(++currIndex); - continue; - } - if (currEdit === null) { - this._acceptPrev(prevEdit); - prevEdit = this._getPrev(++prevIndex); - continue; - } - if (currEdit.oldEnd <= prevEdit.newPosition) { - this._acceptCurr(currEdit); - currEdit = this._getCurr(++currIndex); - continue; - } - if (prevEdit.newEnd <= currEdit.oldPosition) { - this._acceptPrev(prevEdit); - prevEdit = this._getPrev(++prevIndex); - continue; - } - if (currEdit.oldPosition < prevEdit.newPosition) { - const [e1, e2] = TextChangeCompressor._splitCurr(currEdit, prevEdit.newPosition - currEdit.oldPosition); - this._acceptCurr(e1); - currEdit = e2; - continue; - } - if (prevEdit.newPosition < currEdit.oldPosition) { - const [e1, e2] = TextChangeCompressor._splitPrev(prevEdit, currEdit.oldPosition - prevEdit.newPosition); - this._acceptPrev(e1); - prevEdit = e2; - continue; - } - // At this point, currEdit.oldPosition === prevEdit.newPosition - let mergePrev; - let mergeCurr; - if (currEdit.oldEnd === prevEdit.newEnd) { - mergePrev = prevEdit; - mergeCurr = currEdit; - prevEdit = this._getPrev(++prevIndex); - currEdit = this._getCurr(++currIndex); - } - else if (currEdit.oldEnd < prevEdit.newEnd) { - const [e1, e2] = TextChangeCompressor._splitPrev(prevEdit, currEdit.oldLength); - mergePrev = e1; - mergeCurr = currEdit; - prevEdit = e2; - currEdit = this._getCurr(++currIndex); - } - else { - const [e1, e2] = TextChangeCompressor._splitCurr(currEdit, prevEdit.newLength); - mergePrev = prevEdit; - mergeCurr = e1; - prevEdit = this._getPrev(++prevIndex); - currEdit = e2; - } - this._result[this._resultLen++] = new TextChange(mergePrev.oldPosition, mergePrev.oldText, mergeCurr.newPosition, mergeCurr.newText); - this._prevDeltaOffset += mergePrev.newLength - mergePrev.oldLength; - this._currDeltaOffset += mergeCurr.newLength - mergeCurr.oldLength; - } - const merged = TextChangeCompressor._merge(this._result); - const cleaned = TextChangeCompressor._removeNoOps(merged); - return cleaned; - } - _acceptCurr(currEdit) { - this._result[this._resultLen++] = TextChangeCompressor._rebaseCurr(this._prevDeltaOffset, currEdit); - this._currDeltaOffset += currEdit.newLength - currEdit.oldLength; - } - _getCurr(currIndex) { - return (currIndex < this._currLen ? this._currEdits[currIndex] : null); - } - _acceptPrev(prevEdit) { - this._result[this._resultLen++] = TextChangeCompressor._rebasePrev(this._currDeltaOffset, prevEdit); - this._prevDeltaOffset += prevEdit.newLength - prevEdit.oldLength; - } - _getPrev(prevIndex) { - return (prevIndex < this._prevLen ? this._prevEdits[prevIndex] : null); - } - static _rebaseCurr(prevDeltaOffset, currEdit) { - return new TextChange(currEdit.oldPosition - prevDeltaOffset, currEdit.oldText, currEdit.newPosition, currEdit.newText); - } - static _rebasePrev(currDeltaOffset, prevEdit) { - return new TextChange(prevEdit.oldPosition, prevEdit.oldText, prevEdit.newPosition + currDeltaOffset, prevEdit.newText); - } - static _splitPrev(edit, offset) { - const preText = edit.newText.substr(0, offset); - const postText = edit.newText.substr(offset); - return [ - new TextChange(edit.oldPosition, edit.oldText, edit.newPosition, preText), - new TextChange(edit.oldEnd, '', edit.newPosition + offset, postText) - ]; - } - static _splitCurr(edit, offset) { - const preText = edit.oldText.substr(0, offset); - const postText = edit.oldText.substr(offset); - return [ - new TextChange(edit.oldPosition, preText, edit.newPosition, edit.newText), - new TextChange(edit.oldPosition + offset, postText, edit.newEnd, '') - ]; - } - static _merge(edits) { - if (edits.length === 0) { - return edits; - } - let result = [], resultLen = 0; - let prev = edits[0]; - for (let i = 1; i < edits.length; i++) { - const curr = edits[i]; - if (prev.oldEnd === curr.oldPosition) { - // Merge into `prev` - prev = new TextChange(prev.oldPosition, prev.oldText + curr.oldText, prev.newPosition, prev.newText + curr.newText); - } - else { - result[resultLen++] = prev; - prev = curr; - } - } - result[resultLen++] = prev; - return result; - } - static _removeNoOps(edits) { - if (edits.length === 0) { - return edits; - } - let result = [], resultLen = 0; - for (let i = 0; i < edits.length; i++) { - const edit = edits[i]; - if (edit.oldText === edit.newText) { - continue; - } - result[resultLen++] = edit; - } - return result; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js ***! - \****************************************************************************/ -/*! exports provided: createTextBufferFactory, createTextBuffer, LONG_LINE_BOUNDARY, TextModel, ModelDecorationOverviewRulerOptions, ModelDecorationMinimapOptions, ModelDecorationOptions, DidChangeDecorationsEmitter, DidChangeContentEmitter */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTextBufferFactory", function() { return createTextBufferFactory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTextBuffer", function() { return createTextBuffer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LONG_LINE_BOUNDARY", function() { return LONG_LINE_BOUNDARY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextModel", function() { return TextModel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModelDecorationOverviewRulerOptions", function() { return ModelDecorationOverviewRulerOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModelDecorationMinimapOptions", function() { return ModelDecorationMinimapOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModelDecorationOptions", function() { return ModelDecorationOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DidChangeDecorationsEmitter", function() { return DidChangeDecorationsEmitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DidChangeContentEmitter", function() { return DidChangeContentEmitter; }); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/* harmony import */ var _editStack_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./editStack.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/editStack.js"); -/* harmony import */ var _indentationGuesser_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./indentationGuesser.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/indentationGuesser.js"); -/* harmony import */ var _intervalTree_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./intervalTree.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/intervalTree.js"); -/* harmony import */ var _pieceTreeTextBuffer_pieceTreeTextBufferBuilder_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./pieceTreeTextBuffer/pieceTreeTextBufferBuilder.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.js"); -/* harmony import */ var _textModelEvents_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./textModelEvents.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModelEvents.js"); -/* harmony import */ var _textModelSearch_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./textModelSearch.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModelSearch.js"); -/* harmony import */ var _textModelTokens_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./textModelTokens.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModelTokens.js"); -/* harmony import */ var _wordHelper_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./wordHelper.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js"); -/* harmony import */ var _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/* harmony import */ var _modes_nullMode_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../modes/nullMode.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/nullMode.js"); -/* harmony import */ var _modes_supports_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../modes/supports.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports.js"); -/* harmony import */ var _modes_supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../modes/supports/richEditBrackets.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/richEditBrackets.js"); -/* harmony import */ var _tokensStore_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./tokensStore.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/tokensStore.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - - - - - - - - -function createTextBufferBuilder() { - return new _pieceTreeTextBuffer_pieceTreeTextBufferBuilder_js__WEBPACK_IMPORTED_MODULE_13__["PieceTreeTextBufferBuilder"](); -} -function createTextBufferFactory(text) { - const builder = createTextBufferBuilder(); - builder.acceptChunk(text); - return builder.finish(); -} -function createTextBuffer(value, defaultEOL) { - const factory = (typeof value === 'string' ? createTextBufferFactory(value) : value); - return factory.create(defaultEOL); -} -let MODEL_ID = 0; -const LIMIT_FIND_COUNT = 999; -const LONG_LINE_BOUNDARY = 10000; -class TextModelSnapshot { - constructor(source) { - this._source = source; - this._eos = false; - } - read() { - if (this._eos) { - return null; - } - let result = [], resultCnt = 0, resultLength = 0; - do { - let tmp = this._source.read(); - if (tmp === null) { - // end-of-stream - this._eos = true; - if (resultCnt === 0) { - return null; - } - else { - return result.join(''); - } - } - if (tmp.length > 0) { - result[resultCnt++] = tmp; - resultLength += tmp.length; - } - if (resultLength >= 64 * 1024) { - return result.join(''); - } - } while (true); - } -} -const invalidFunc = () => { throw new Error(`Invalid change accessor`); }; -class BracketSearchCanceled { - constructor() { - this._searchCanceledBrand = undefined; - } -} -BracketSearchCanceled.INSTANCE = new BracketSearchCanceled(); -function stripBracketSearchCanceled(result) { - if (result instanceof BracketSearchCanceled) { - return null; - } - return result; -} -class TextModel extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - //#endregion - constructor(source, creationOptions, languageIdentifier, associatedResource = null, undoRedoService) { - super(); - //#region Events - this._onWillDispose = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onWillDispose = this._onWillDispose.event; - this._onDidChangeDecorations = this._register(new DidChangeDecorationsEmitter()); - this.onDidChangeDecorations = this._onDidChangeDecorations.event; - this._onDidChangeLanguage = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidChangeLanguage = this._onDidChangeLanguage.event; - this._onDidChangeLanguageConfiguration = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidChangeLanguageConfiguration = this._onDidChangeLanguageConfiguration.event; - this._onDidChangeTokens = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidChangeTokens = this._onDidChangeTokens.event; - this._onDidChangeOptions = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidChangeOptions = this._onDidChangeOptions.event; - this._onDidChangeAttached = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidChangeAttached = this._onDidChangeAttached.event; - this._eventEmitter = this._register(new DidChangeContentEmitter()); - // Generate a new unique model id - MODEL_ID++; - this.id = '$model' + MODEL_ID; - this.isForSimpleWidget = creationOptions.isForSimpleWidget; - if (typeof associatedResource === 'undefined' || associatedResource === null) { - this._associatedResource = _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"].parse('inmemory://model/' + MODEL_ID); - } - else { - this._associatedResource = associatedResource; - } - this._undoRedoService = undoRedoService; - this._attachedEditorCount = 0; - this._buffer = createTextBuffer(source, creationOptions.defaultEOL); - this._options = TextModel.resolveOptions(this._buffer, creationOptions); - const bufferLineCount = this._buffer.getLineCount(); - const bufferTextLength = this._buffer.getValueLengthInRange(new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](1, 1, bufferLineCount, this._buffer.getLineLength(bufferLineCount) + 1), 0 /* TextDefined */); - // !!! Make a decision in the ctor and permanently respect this decision !!! - // If a model is too large at construction time, it will never get tokenized, - // under no circumstances. - if (creationOptions.largeFileOptimizations) { - this._isTooLargeForTokenization = ((bufferTextLength > TextModel.LARGE_FILE_SIZE_THRESHOLD) - || (bufferLineCount > TextModel.LARGE_FILE_LINE_COUNT_THRESHOLD)); - } - else { - this._isTooLargeForTokenization = false; - } - this._isTooLargeForSyncing = (bufferTextLength > TextModel.MODEL_SYNC_LIMIT); - this._versionId = 1; - this._alternativeVersionId = 1; - this._initialUndoRedoSnapshot = null; - this._isDisposed = false; - this._isDisposing = false; - this._languageIdentifier = languageIdentifier || _modes_nullMode_js__WEBPACK_IMPORTED_MODULE_19__["NULL_LANGUAGE_IDENTIFIER"]; - this._languageRegistryListener = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].onDidChange((e) => { - if (e.languageIdentifier.id === this._languageIdentifier.id) { - this._onDidChangeLanguageConfiguration.fire({}); - } - }); - this._instanceId = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["singleLetterHash"](MODEL_ID); - this._lastDecorationId = 0; - this._decorations = Object.create(null); - this._decorationsTree = new DecorationsTrees(); - this._commandManager = new _editStack_js__WEBPACK_IMPORTED_MODULE_10__["EditStack"](this, undoRedoService); - this._isUndoing = false; - this._isRedoing = false; - this._trimAutoWhitespaceLines = null; - this._tokens = new _tokensStore_js__WEBPACK_IMPORTED_MODULE_22__["TokensStore"](); - this._tokens2 = new _tokensStore_js__WEBPACK_IMPORTED_MODULE_22__["TokensStore2"](); - this._tokenization = new _textModelTokens_js__WEBPACK_IMPORTED_MODULE_16__["TextModelTokenization"](this); - } - static resolveOptions(textBuffer, options) { - if (options.detectIndentation) { - const guessedIndentation = Object(_indentationGuesser_js__WEBPACK_IMPORTED_MODULE_11__["guessIndentation"])(textBuffer, options.tabSize, options.insertSpaces); - return new _model_js__WEBPACK_IMPORTED_MODULE_9__["TextModelResolvedOptions"]({ - tabSize: guessedIndentation.tabSize, - indentSize: guessedIndentation.tabSize, - insertSpaces: guessedIndentation.insertSpaces, - trimAutoWhitespace: options.trimAutoWhitespace, - defaultEOL: options.defaultEOL - }); - } - return new _model_js__WEBPACK_IMPORTED_MODULE_9__["TextModelResolvedOptions"]({ - tabSize: options.tabSize, - indentSize: options.indentSize, - insertSpaces: options.insertSpaces, - trimAutoWhitespace: options.trimAutoWhitespace, - defaultEOL: options.defaultEOL - }); - } - onDidChangeRawContentFast(listener) { - return this._eventEmitter.fastEvent((e) => listener(e.rawContentChangedEvent)); - } - onDidChangeContentFast(listener) { - return this._eventEmitter.fastEvent((e) => listener(e.contentChangedEvent)); - } - onDidChangeContent(listener) { - return this._eventEmitter.slowEvent((e) => listener(e.contentChangedEvent)); - } - dispose() { - this._isDisposing = true; - this._onWillDispose.fire(); - this._languageRegistryListener.dispose(); - this._tokenization.dispose(); - this._isDisposed = true; - super.dispose(); - this._isDisposing = false; - } - _assertNotDisposed() { - if (this._isDisposed) { - throw new Error('Model is disposed!'); - } - } - _emitContentChangedEvent(rawChange, change) { - if (this._isDisposing) { - // Do not confuse listeners by emitting any event after disposing - return; - } - this._eventEmitter.fire(new _textModelEvents_js__WEBPACK_IMPORTED_MODULE_14__["InternalModelContentChangeEvent"](rawChange, change)); - } - setValue(value) { - this._assertNotDisposed(); - if (value === null) { - // There's nothing to do - return; - } - const textBuffer = createTextBuffer(value, this._options.defaultEOL); - this.setValueFromTextBuffer(textBuffer); - } - _createContentChanged2(range, rangeOffset, rangeLength, text, isUndoing, isRedoing, isFlush) { - return { - changes: [{ - range: range, - rangeOffset: rangeOffset, - rangeLength: rangeLength, - text: text, - }], - eol: this._buffer.getEOL(), - versionId: this.getVersionId(), - isUndoing: isUndoing, - isRedoing: isRedoing, - isFlush: isFlush - }; - } - setValueFromTextBuffer(textBuffer) { - this._assertNotDisposed(); - if (textBuffer === null) { - // There's nothing to do - return; - } - const oldFullModelRange = this.getFullModelRange(); - const oldModelValueLength = this.getValueLengthInRange(oldFullModelRange); - const endLineNumber = this.getLineCount(); - const endColumn = this.getLineMaxColumn(endLineNumber); - this._buffer = textBuffer; - this._increaseVersionId(); - // Flush all tokens - this._tokens.flush(); - this._tokens2.flush(); - // Destroy all my decorations - this._decorations = Object.create(null); - this._decorationsTree = new DecorationsTrees(); - // Destroy my edit history and settings - this._commandManager.clear(); - this._trimAutoWhitespaceLines = null; - this._emitContentChangedEvent(new _textModelEvents_js__WEBPACK_IMPORTED_MODULE_14__["ModelRawContentChangedEvent"]([ - new _textModelEvents_js__WEBPACK_IMPORTED_MODULE_14__["ModelRawFlush"]() - ], this._versionId, false, false), this._createContentChanged2(new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](1, 1, endLineNumber, endColumn), 0, oldModelValueLength, this.getValue(), false, false, true)); - } - setEOL(eol) { - this._assertNotDisposed(); - const newEOL = (eol === 1 /* CRLF */ ? '\r\n' : '\n'); - if (this._buffer.getEOL() === newEOL) { - // Nothing to do - return; - } - const oldFullModelRange = this.getFullModelRange(); - const oldModelValueLength = this.getValueLengthInRange(oldFullModelRange); - const endLineNumber = this.getLineCount(); - const endColumn = this.getLineMaxColumn(endLineNumber); - this._onBeforeEOLChange(); - this._buffer.setEOL(newEOL); - this._increaseVersionId(); - this._onAfterEOLChange(); - this._emitContentChangedEvent(new _textModelEvents_js__WEBPACK_IMPORTED_MODULE_14__["ModelRawContentChangedEvent"]([ - new _textModelEvents_js__WEBPACK_IMPORTED_MODULE_14__["ModelRawEOLChanged"]() - ], this._versionId, false, false), this._createContentChanged2(new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](1, 1, endLineNumber, endColumn), 0, oldModelValueLength, this.getValue(), false, false, false)); - } - _onBeforeEOLChange() { - // Ensure all decorations get their `range` set. - const versionId = this.getVersionId(); - const allDecorations = this._decorationsTree.search(0, false, false, versionId); - this._ensureNodesHaveRanges(allDecorations); - } - _onAfterEOLChange() { - // Transform back `range` to offsets - const versionId = this.getVersionId(); - const allDecorations = this._decorationsTree.collectNodesPostOrder(); - for (let i = 0, len = allDecorations.length; i < len; i++) { - const node = allDecorations[i]; - const delta = node.cachedAbsoluteStart - node.start; - const startOffset = this._buffer.getOffsetAt(node.range.startLineNumber, node.range.startColumn); - const endOffset = this._buffer.getOffsetAt(node.range.endLineNumber, node.range.endColumn); - node.cachedAbsoluteStart = startOffset; - node.cachedAbsoluteEnd = endOffset; - node.cachedVersionId = versionId; - node.start = startOffset - delta; - node.end = endOffset - delta; - Object(_intervalTree_js__WEBPACK_IMPORTED_MODULE_12__["recomputeMaxEnd"])(node); - } - } - onBeforeAttached() { - this._attachedEditorCount++; - if (this._attachedEditorCount === 1) { - this._onDidChangeAttached.fire(undefined); - } - } - onBeforeDetached() { - this._attachedEditorCount--; - if (this._attachedEditorCount === 0) { - this._onDidChangeAttached.fire(undefined); - } - } - isAttachedToEditor() { - return this._attachedEditorCount > 0; - } - getAttachedEditorCount() { - return this._attachedEditorCount; - } - isTooLargeForSyncing() { - return this._isTooLargeForSyncing; - } - isTooLargeForTokenization() { - return this._isTooLargeForTokenization; - } - isDisposed() { - return this._isDisposed; - } - isDominatedByLongLines() { - this._assertNotDisposed(); - if (this.isTooLargeForTokenization()) { - // Cannot word wrap huge files anyways, so it doesn't really matter - return false; - } - let smallLineCharCount = 0; - let longLineCharCount = 0; - const lineCount = this._buffer.getLineCount(); - for (let lineNumber = 1; lineNumber <= lineCount; lineNumber++) { - const lineLength = this._buffer.getLineLength(lineNumber); - if (lineLength >= LONG_LINE_BOUNDARY) { - longLineCharCount += lineLength; - } - else { - smallLineCharCount += lineLength; - } - } - return (longLineCharCount > smallLineCharCount); - } - get uri() { - return this._associatedResource; - } - //#region Options - getOptions() { - this._assertNotDisposed(); - return this._options; - } - getFormattingOptions() { - return { - tabSize: this._options.indentSize, - insertSpaces: this._options.insertSpaces - }; - } - updateOptions(_newOpts) { - this._assertNotDisposed(); - let tabSize = (typeof _newOpts.tabSize !== 'undefined') ? _newOpts.tabSize : this._options.tabSize; - let indentSize = (typeof _newOpts.indentSize !== 'undefined') ? _newOpts.indentSize : this._options.indentSize; - let insertSpaces = (typeof _newOpts.insertSpaces !== 'undefined') ? _newOpts.insertSpaces : this._options.insertSpaces; - let trimAutoWhitespace = (typeof _newOpts.trimAutoWhitespace !== 'undefined') ? _newOpts.trimAutoWhitespace : this._options.trimAutoWhitespace; - let newOpts = new _model_js__WEBPACK_IMPORTED_MODULE_9__["TextModelResolvedOptions"]({ - tabSize: tabSize, - indentSize: indentSize, - insertSpaces: insertSpaces, - defaultEOL: this._options.defaultEOL, - trimAutoWhitespace: trimAutoWhitespace - }); - if (this._options.equals(newOpts)) { - return; - } - let e = this._options.createChangeEvent(newOpts); - this._options = newOpts; - this._onDidChangeOptions.fire(e); - } - detectIndentation(defaultInsertSpaces, defaultTabSize) { - this._assertNotDisposed(); - let guessedIndentation = Object(_indentationGuesser_js__WEBPACK_IMPORTED_MODULE_11__["guessIndentation"])(this._buffer, defaultTabSize, defaultInsertSpaces); - this.updateOptions({ - insertSpaces: guessedIndentation.insertSpaces, - tabSize: guessedIndentation.tabSize, - indentSize: guessedIndentation.tabSize, - }); - } - static _normalizeIndentationFromWhitespace(str, indentSize, insertSpaces) { - let spacesCnt = 0; - for (let i = 0; i < str.length; i++) { - if (str.charAt(i) === '\t') { - spacesCnt += indentSize; - } - else { - spacesCnt++; - } - } - let result = ''; - if (!insertSpaces) { - let tabsCnt = Math.floor(spacesCnt / indentSize); - spacesCnt = spacesCnt % indentSize; - for (let i = 0; i < tabsCnt; i++) { - result += '\t'; - } - } - for (let i = 0; i < spacesCnt; i++) { - result += ' '; - } - return result; - } - static normalizeIndentation(str, indentSize, insertSpaces) { - let firstNonWhitespaceIndex = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["firstNonWhitespaceIndex"](str); - if (firstNonWhitespaceIndex === -1) { - firstNonWhitespaceIndex = str.length; - } - return TextModel._normalizeIndentationFromWhitespace(str.substring(0, firstNonWhitespaceIndex), indentSize, insertSpaces) + str.substring(firstNonWhitespaceIndex); - } - normalizeIndentation(str) { - this._assertNotDisposed(); - return TextModel.normalizeIndentation(str, this._options.indentSize, this._options.insertSpaces); - } - //#endregion - //#region Reading - getVersionId() { - this._assertNotDisposed(); - return this._versionId; - } - mightContainRTL() { - return this._buffer.mightContainRTL(); - } - mightContainUnusualLineTerminators() { - return this._buffer.mightContainUnusualLineTerminators(); - } - removeUnusualLineTerminators(selections = null) { - const matches = this.findMatches(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["UNUSUAL_LINE_TERMINATORS"].source, false, true, false, null, false, 1073741824 /* MAX_SAFE_SMALL_INTEGER */); - this._buffer.resetMightContainUnusualLineTerminators(); - this.pushEditOperations(selections, matches.map(m => ({ range: m.range, text: null })), () => null); - } - mightContainNonBasicASCII() { - return this._buffer.mightContainNonBasicASCII(); - } - getAlternativeVersionId() { - this._assertNotDisposed(); - return this._alternativeVersionId; - } - getOffsetAt(rawPosition) { - this._assertNotDisposed(); - let position = this._validatePosition(rawPosition.lineNumber, rawPosition.column, 0 /* Relaxed */); - return this._buffer.getOffsetAt(position.lineNumber, position.column); - } - getPositionAt(rawOffset) { - this._assertNotDisposed(); - let offset = (Math.min(this._buffer.getLength(), Math.max(0, rawOffset))); - return this._buffer.getPositionAt(offset); - } - _increaseVersionId() { - this._versionId = this._versionId + 1; - this._alternativeVersionId = this._versionId; - } - _overwriteVersionId(versionId) { - this._versionId = versionId; - } - _overwriteAlternativeVersionId(newAlternativeVersionId) { - this._alternativeVersionId = newAlternativeVersionId; - } - _overwriteInitialUndoRedoSnapshot(newInitialUndoRedoSnapshot) { - this._initialUndoRedoSnapshot = newInitialUndoRedoSnapshot; - } - getValue(eol, preserveBOM = false) { - this._assertNotDisposed(); - const fullModelRange = this.getFullModelRange(); - const fullModelValue = this.getValueInRange(fullModelRange, eol); - if (preserveBOM) { - return this._buffer.getBOM() + fullModelValue; - } - return fullModelValue; - } - createSnapshot(preserveBOM = false) { - return new TextModelSnapshot(this._buffer.createSnapshot(preserveBOM)); - } - getValueLength(eol, preserveBOM = false) { - this._assertNotDisposed(); - const fullModelRange = this.getFullModelRange(); - const fullModelValue = this.getValueLengthInRange(fullModelRange, eol); - if (preserveBOM) { - return this._buffer.getBOM().length + fullModelValue; - } - return fullModelValue; - } - getValueInRange(rawRange, eol = 0 /* TextDefined */) { - this._assertNotDisposed(); - return this._buffer.getValueInRange(this.validateRange(rawRange), eol); - } - getValueLengthInRange(rawRange, eol = 0 /* TextDefined */) { - this._assertNotDisposed(); - return this._buffer.getValueLengthInRange(this.validateRange(rawRange), eol); - } - getCharacterCountInRange(rawRange, eol = 0 /* TextDefined */) { - this._assertNotDisposed(); - return this._buffer.getCharacterCountInRange(this.validateRange(rawRange), eol); - } - getLineCount() { - this._assertNotDisposed(); - return this._buffer.getLineCount(); - } - getLineContent(lineNumber) { - this._assertNotDisposed(); - if (lineNumber < 1 || lineNumber > this.getLineCount()) { - throw new Error('Illegal value for lineNumber'); - } - return this._buffer.getLineContent(lineNumber); - } - getLineLength(lineNumber) { - this._assertNotDisposed(); - if (lineNumber < 1 || lineNumber > this.getLineCount()) { - throw new Error('Illegal value for lineNumber'); - } - return this._buffer.getLineLength(lineNumber); - } - getLinesContent() { - this._assertNotDisposed(); - return this._buffer.getLinesContent(); - } - getEOL() { - this._assertNotDisposed(); - return this._buffer.getEOL(); - } - getLineMinColumn(lineNumber) { - this._assertNotDisposed(); - return 1; - } - getLineMaxColumn(lineNumber) { - this._assertNotDisposed(); - if (lineNumber < 1 || lineNumber > this.getLineCount()) { - throw new Error('Illegal value for lineNumber'); - } - return this._buffer.getLineLength(lineNumber) + 1; - } - getLineFirstNonWhitespaceColumn(lineNumber) { - this._assertNotDisposed(); - if (lineNumber < 1 || lineNumber > this.getLineCount()) { - throw new Error('Illegal value for lineNumber'); - } - return this._buffer.getLineFirstNonWhitespaceColumn(lineNumber); - } - getLineLastNonWhitespaceColumn(lineNumber) { - this._assertNotDisposed(); - if (lineNumber < 1 || lineNumber > this.getLineCount()) { - throw new Error('Illegal value for lineNumber'); - } - return this._buffer.getLineLastNonWhitespaceColumn(lineNumber); - } - /** - * Validates `range` is within buffer bounds, but allows it to sit in between surrogate pairs, etc. - * Will try to not allocate if possible. - */ - _validateRangeRelaxedNoAllocations(range) { - const linesCount = this._buffer.getLineCount(); - const initialStartLineNumber = range.startLineNumber; - const initialStartColumn = range.startColumn; - let startLineNumber; - let startColumn; - if (initialStartLineNumber < 1) { - startLineNumber = 1; - startColumn = 1; - } - else if (initialStartLineNumber > linesCount) { - startLineNumber = linesCount; - startColumn = this.getLineMaxColumn(startLineNumber); - } - else { - startLineNumber = initialStartLineNumber | 0; - if (initialStartColumn <= 1) { - startColumn = 1; - } - else { - const maxColumn = this.getLineMaxColumn(startLineNumber); - if (initialStartColumn >= maxColumn) { - startColumn = maxColumn; - } - else { - startColumn = initialStartColumn | 0; - } - } - } - const initialEndLineNumber = range.endLineNumber; - const initialEndColumn = range.endColumn; - let endLineNumber; - let endColumn; - if (initialEndLineNumber < 1) { - endLineNumber = 1; - endColumn = 1; - } - else if (initialEndLineNumber > linesCount) { - endLineNumber = linesCount; - endColumn = this.getLineMaxColumn(endLineNumber); - } - else { - endLineNumber = initialEndLineNumber | 0; - if (initialEndColumn <= 1) { - endColumn = 1; - } - else { - const maxColumn = this.getLineMaxColumn(endLineNumber); - if (initialEndColumn >= maxColumn) { - endColumn = maxColumn; - } - else { - endColumn = initialEndColumn | 0; - } - } - } - if (initialStartLineNumber === startLineNumber - && initialStartColumn === startColumn - && initialEndLineNumber === endLineNumber - && initialEndColumn === endColumn - && range instanceof _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"] - && !(range instanceof _core_selection_js__WEBPACK_IMPORTED_MODULE_8__["Selection"])) { - return range; - } - return new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](startLineNumber, startColumn, endLineNumber, endColumn); - } - _isValidPosition(lineNumber, column, validationType) { - if (typeof lineNumber !== 'number' || typeof column !== 'number') { - return false; - } - if (isNaN(lineNumber) || isNaN(column)) { - return false; - } - if (lineNumber < 1 || column < 1) { - return false; - } - if ((lineNumber | 0) !== lineNumber || (column | 0) !== column) { - return false; - } - const lineCount = this._buffer.getLineCount(); - if (lineNumber > lineCount) { - return false; - } - if (column === 1) { - return true; - } - const maxColumn = this.getLineMaxColumn(lineNumber); - if (column > maxColumn) { - return false; - } - if (validationType === 1 /* SurrogatePairs */) { - // !!At this point, column > 1 - const charCodeBefore = this._buffer.getLineCharCode(lineNumber, column - 2); - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["isHighSurrogate"](charCodeBefore)) { - return false; - } - } - return true; - } - _validatePosition(_lineNumber, _column, validationType) { - const lineNumber = Math.floor((typeof _lineNumber === 'number' && !isNaN(_lineNumber)) ? _lineNumber : 1); - const column = Math.floor((typeof _column === 'number' && !isNaN(_column)) ? _column : 1); - const lineCount = this._buffer.getLineCount(); - if (lineNumber < 1) { - return new _core_position_js__WEBPACK_IMPORTED_MODULE_6__["Position"](1, 1); - } - if (lineNumber > lineCount) { - return new _core_position_js__WEBPACK_IMPORTED_MODULE_6__["Position"](lineCount, this.getLineMaxColumn(lineCount)); - } - if (column <= 1) { - return new _core_position_js__WEBPACK_IMPORTED_MODULE_6__["Position"](lineNumber, 1); - } - const maxColumn = this.getLineMaxColumn(lineNumber); - if (column >= maxColumn) { - return new _core_position_js__WEBPACK_IMPORTED_MODULE_6__["Position"](lineNumber, maxColumn); - } - if (validationType === 1 /* SurrogatePairs */) { - // If the position would end up in the middle of a high-low surrogate pair, - // we move it to before the pair - // !!At this point, column > 1 - const charCodeBefore = this._buffer.getLineCharCode(lineNumber, column - 2); - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["isHighSurrogate"](charCodeBefore)) { - return new _core_position_js__WEBPACK_IMPORTED_MODULE_6__["Position"](lineNumber, column - 1); - } - } - return new _core_position_js__WEBPACK_IMPORTED_MODULE_6__["Position"](lineNumber, column); - } - validatePosition(position) { - const validationType = 1 /* SurrogatePairs */; - this._assertNotDisposed(); - // Avoid object allocation and cover most likely case - if (position instanceof _core_position_js__WEBPACK_IMPORTED_MODULE_6__["Position"]) { - if (this._isValidPosition(position.lineNumber, position.column, validationType)) { - return position; - } - } - return this._validatePosition(position.lineNumber, position.column, validationType); - } - _isValidRange(range, validationType) { - const startLineNumber = range.startLineNumber; - const startColumn = range.startColumn; - const endLineNumber = range.endLineNumber; - const endColumn = range.endColumn; - if (!this._isValidPosition(startLineNumber, startColumn, 0 /* Relaxed */)) { - return false; - } - if (!this._isValidPosition(endLineNumber, endColumn, 0 /* Relaxed */)) { - return false; - } - if (validationType === 1 /* SurrogatePairs */) { - const charCodeBeforeStart = (startColumn > 1 ? this._buffer.getLineCharCode(startLineNumber, startColumn - 2) : 0); - const charCodeBeforeEnd = (endColumn > 1 && endColumn <= this._buffer.getLineLength(endLineNumber) ? this._buffer.getLineCharCode(endLineNumber, endColumn - 2) : 0); - const startInsideSurrogatePair = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["isHighSurrogate"](charCodeBeforeStart); - const endInsideSurrogatePair = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["isHighSurrogate"](charCodeBeforeEnd); - if (!startInsideSurrogatePair && !endInsideSurrogatePair) { - return true; - } - return false; - } - return true; - } - validateRange(_range) { - const validationType = 1 /* SurrogatePairs */; - this._assertNotDisposed(); - // Avoid object allocation and cover most likely case - if ((_range instanceof _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"]) && !(_range instanceof _core_selection_js__WEBPACK_IMPORTED_MODULE_8__["Selection"])) { - if (this._isValidRange(_range, validationType)) { - return _range; - } - } - const start = this._validatePosition(_range.startLineNumber, _range.startColumn, 0 /* Relaxed */); - const end = this._validatePosition(_range.endLineNumber, _range.endColumn, 0 /* Relaxed */); - const startLineNumber = start.lineNumber; - const startColumn = start.column; - const endLineNumber = end.lineNumber; - const endColumn = end.column; - if (validationType === 1 /* SurrogatePairs */) { - const charCodeBeforeStart = (startColumn > 1 ? this._buffer.getLineCharCode(startLineNumber, startColumn - 2) : 0); - const charCodeBeforeEnd = (endColumn > 1 && endColumn <= this._buffer.getLineLength(endLineNumber) ? this._buffer.getLineCharCode(endLineNumber, endColumn - 2) : 0); - const startInsideSurrogatePair = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["isHighSurrogate"](charCodeBeforeStart); - const endInsideSurrogatePair = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["isHighSurrogate"](charCodeBeforeEnd); - if (!startInsideSurrogatePair && !endInsideSurrogatePair) { - return new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](startLineNumber, startColumn, endLineNumber, endColumn); - } - if (startLineNumber === endLineNumber && startColumn === endColumn) { - // do not expand a collapsed range, simply move it to a valid location - return new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](startLineNumber, startColumn - 1, endLineNumber, endColumn - 1); - } - if (startInsideSurrogatePair && endInsideSurrogatePair) { - // expand range at both ends - return new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](startLineNumber, startColumn - 1, endLineNumber, endColumn + 1); - } - if (startInsideSurrogatePair) { - // only expand range at the start - return new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](startLineNumber, startColumn - 1, endLineNumber, endColumn); - } - // only expand range at the end - return new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](startLineNumber, startColumn, endLineNumber, endColumn + 1); - } - return new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](startLineNumber, startColumn, endLineNumber, endColumn); - } - modifyPosition(rawPosition, offset) { - this._assertNotDisposed(); - let candidate = this.getOffsetAt(rawPosition) + offset; - return this.getPositionAt(Math.min(this._buffer.getLength(), Math.max(0, candidate))); - } - getFullModelRange() { - this._assertNotDisposed(); - const lineCount = this.getLineCount(); - return new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](1, 1, lineCount, this.getLineMaxColumn(lineCount)); - } - findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount) { - return this._buffer.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount); - } - findMatches(searchString, rawSearchScope, isRegex, matchCase, wordSeparators, captureMatches, limitResultCount = LIMIT_FIND_COUNT) { - this._assertNotDisposed(); - let searchRanges = null; - if (rawSearchScope !== null) { - if (!Array.isArray(rawSearchScope)) { - rawSearchScope = [rawSearchScope]; - } - if (rawSearchScope.every((searchScope) => _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].isIRange(searchScope))) { - searchRanges = rawSearchScope.map((searchScope) => this.validateRange(searchScope)); - } - } - if (searchRanges === null) { - searchRanges = [this.getFullModelRange()]; - } - searchRanges = searchRanges.sort((d1, d2) => d1.startLineNumber - d2.startLineNumber || d1.startColumn - d2.startColumn); - const uniqueSearchRanges = []; - uniqueSearchRanges.push(searchRanges.reduce((prev, curr) => { - if (_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].areIntersecting(prev, curr)) { - return prev.plusRange(curr); - } - uniqueSearchRanges.push(prev); - return curr; - })); - let matchMapper; - if (!isRegex && searchString.indexOf('\n') < 0) { - // not regex, not multi line - const searchParams = new _textModelSearch_js__WEBPACK_IMPORTED_MODULE_15__["SearchParams"](searchString, isRegex, matchCase, wordSeparators); - const searchData = searchParams.parseSearchRequest(); - if (!searchData) { - return []; - } - matchMapper = (searchRange) => this.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount); - } - else { - matchMapper = (searchRange) => _textModelSearch_js__WEBPACK_IMPORTED_MODULE_15__["TextModelSearch"].findMatches(this, new _textModelSearch_js__WEBPACK_IMPORTED_MODULE_15__["SearchParams"](searchString, isRegex, matchCase, wordSeparators), searchRange, captureMatches, limitResultCount); - } - return uniqueSearchRanges.map(matchMapper).reduce((arr, matches) => arr.concat(matches), []); - } - findNextMatch(searchString, rawSearchStart, isRegex, matchCase, wordSeparators, captureMatches) { - this._assertNotDisposed(); - const searchStart = this.validatePosition(rawSearchStart); - if (!isRegex && searchString.indexOf('\n') < 0) { - const searchParams = new _textModelSearch_js__WEBPACK_IMPORTED_MODULE_15__["SearchParams"](searchString, isRegex, matchCase, wordSeparators); - const searchData = searchParams.parseSearchRequest(); - if (!searchData) { - return null; - } - const lineCount = this.getLineCount(); - let searchRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](searchStart.lineNumber, searchStart.column, lineCount, this.getLineMaxColumn(lineCount)); - let ret = this.findMatchesLineByLine(searchRange, searchData, captureMatches, 1); - _textModelSearch_js__WEBPACK_IMPORTED_MODULE_15__["TextModelSearch"].findNextMatch(this, new _textModelSearch_js__WEBPACK_IMPORTED_MODULE_15__["SearchParams"](searchString, isRegex, matchCase, wordSeparators), searchStart, captureMatches); - if (ret.length > 0) { - return ret[0]; - } - searchRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](1, 1, searchStart.lineNumber, this.getLineMaxColumn(searchStart.lineNumber)); - ret = this.findMatchesLineByLine(searchRange, searchData, captureMatches, 1); - if (ret.length > 0) { - return ret[0]; - } - return null; - } - return _textModelSearch_js__WEBPACK_IMPORTED_MODULE_15__["TextModelSearch"].findNextMatch(this, new _textModelSearch_js__WEBPACK_IMPORTED_MODULE_15__["SearchParams"](searchString, isRegex, matchCase, wordSeparators), searchStart, captureMatches); - } - findPreviousMatch(searchString, rawSearchStart, isRegex, matchCase, wordSeparators, captureMatches) { - this._assertNotDisposed(); - const searchStart = this.validatePosition(rawSearchStart); - return _textModelSearch_js__WEBPACK_IMPORTED_MODULE_15__["TextModelSearch"].findPreviousMatch(this, new _textModelSearch_js__WEBPACK_IMPORTED_MODULE_15__["SearchParams"](searchString, isRegex, matchCase, wordSeparators), searchStart, captureMatches); - } - //#endregion - //#region Editing - pushStackElement() { - this._commandManager.pushStackElement(); - } - pushEOL(eol) { - const currentEOL = (this.getEOL() === '\n' ? 0 /* LF */ : 1 /* CRLF */); - if (currentEOL === eol) { - return; - } - try { - this._onDidChangeDecorations.beginDeferredEmit(); - this._eventEmitter.beginDeferredEmit(); - if (this._initialUndoRedoSnapshot === null) { - this._initialUndoRedoSnapshot = this._undoRedoService.createSnapshot(this.uri); - } - this._commandManager.pushEOL(eol); - } - finally { - this._eventEmitter.endDeferredEmit(); - this._onDidChangeDecorations.endDeferredEmit(); - } - } - _validateEditOperation(rawOperation) { - if (rawOperation instanceof _model_js__WEBPACK_IMPORTED_MODULE_9__["ValidAnnotatedEditOperation"]) { - return rawOperation; - } - return new _model_js__WEBPACK_IMPORTED_MODULE_9__["ValidAnnotatedEditOperation"](rawOperation.identifier || null, this.validateRange(rawOperation.range), rawOperation.text, rawOperation.forceMoveMarkers || false, rawOperation.isAutoWhitespaceEdit || false, rawOperation._isTracked || false); - } - _validateEditOperations(rawOperations) { - const result = []; - for (let i = 0, len = rawOperations.length; i < len; i++) { - result[i] = this._validateEditOperation(rawOperations[i]); - } - return result; - } - pushEditOperations(beforeCursorState, editOperations, cursorStateComputer) { - try { - this._onDidChangeDecorations.beginDeferredEmit(); - this._eventEmitter.beginDeferredEmit(); - return this._pushEditOperations(beforeCursorState, this._validateEditOperations(editOperations), cursorStateComputer); - } - finally { - this._eventEmitter.endDeferredEmit(); - this._onDidChangeDecorations.endDeferredEmit(); - } - } - _pushEditOperations(beforeCursorState, editOperations, cursorStateComputer) { - if (this._options.trimAutoWhitespace && this._trimAutoWhitespaceLines) { - // Go through each saved line number and insert a trim whitespace edit - // if it is safe to do so (no conflicts with other edits). - let incomingEdits = editOperations.map((op) => { - return { - range: this.validateRange(op.range), - text: op.text - }; - }); - // Sometimes, auto-formatters change ranges automatically which can cause undesired auto whitespace trimming near the cursor - // We'll use the following heuristic: if the edits occur near the cursor, then it's ok to trim auto whitespace - let editsAreNearCursors = true; - if (beforeCursorState) { - for (let i = 0, len = beforeCursorState.length; i < len; i++) { - let sel = beforeCursorState[i]; - let foundEditNearSel = false; - for (let j = 0, lenJ = incomingEdits.length; j < lenJ; j++) { - let editRange = incomingEdits[j].range; - let selIsAbove = editRange.startLineNumber > sel.endLineNumber; - let selIsBelow = sel.startLineNumber > editRange.endLineNumber; - if (!selIsAbove && !selIsBelow) { - foundEditNearSel = true; - break; - } - } - if (!foundEditNearSel) { - editsAreNearCursors = false; - break; - } - } - } - if (editsAreNearCursors) { - for (let i = 0, len = this._trimAutoWhitespaceLines.length; i < len; i++) { - let trimLineNumber = this._trimAutoWhitespaceLines[i]; - let maxLineColumn = this.getLineMaxColumn(trimLineNumber); - let allowTrimLine = true; - for (let j = 0, lenJ = incomingEdits.length; j < lenJ; j++) { - let editRange = incomingEdits[j].range; - let editText = incomingEdits[j].text; - if (trimLineNumber < editRange.startLineNumber || trimLineNumber > editRange.endLineNumber) { - // `trimLine` is completely outside this edit - continue; - } - // At this point: - // editRange.startLineNumber <= trimLine <= editRange.endLineNumber - if (trimLineNumber === editRange.startLineNumber && editRange.startColumn === maxLineColumn - && editRange.isEmpty() && editText && editText.length > 0 && editText.charAt(0) === '\n') { - // This edit inserts a new line (and maybe other text) after `trimLine` - continue; - } - if (trimLineNumber === editRange.startLineNumber && editRange.startColumn === 1 - && editRange.isEmpty() && editText && editText.length > 0 && editText.charAt(editText.length - 1) === '\n') { - // This edit inserts a new line (and maybe other text) before `trimLine` - continue; - } - // Looks like we can't trim this line as it would interfere with an incoming edit - allowTrimLine = false; - break; - } - if (allowTrimLine) { - const trimRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](trimLineNumber, 1, trimLineNumber, maxLineColumn); - editOperations.push(new _model_js__WEBPACK_IMPORTED_MODULE_9__["ValidAnnotatedEditOperation"](null, trimRange, null, false, false, false)); - } - } - } - this._trimAutoWhitespaceLines = null; - } - if (this._initialUndoRedoSnapshot === null) { - this._initialUndoRedoSnapshot = this._undoRedoService.createSnapshot(this.uri); - } - return this._commandManager.pushEditOperation(beforeCursorState, editOperations, cursorStateComputer); - } - _applyUndo(changes, eol, resultingAlternativeVersionId, resultingSelection) { - const edits = changes.map((change) => { - const rangeStart = this.getPositionAt(change.newPosition); - const rangeEnd = this.getPositionAt(change.newEnd); - return { - range: new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](rangeStart.lineNumber, rangeStart.column, rangeEnd.lineNumber, rangeEnd.column), - text: change.oldText - }; - }); - this._applyUndoRedoEdits(edits, eol, true, false, resultingAlternativeVersionId, resultingSelection); - } - _applyRedo(changes, eol, resultingAlternativeVersionId, resultingSelection) { - const edits = changes.map((change) => { - const rangeStart = this.getPositionAt(change.oldPosition); - const rangeEnd = this.getPositionAt(change.oldEnd); - return { - range: new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](rangeStart.lineNumber, rangeStart.column, rangeEnd.lineNumber, rangeEnd.column), - text: change.newText - }; - }); - this._applyUndoRedoEdits(edits, eol, false, true, resultingAlternativeVersionId, resultingSelection); - } - _applyUndoRedoEdits(edits, eol, isUndoing, isRedoing, resultingAlternativeVersionId, resultingSelection) { - try { - this._onDidChangeDecorations.beginDeferredEmit(); - this._eventEmitter.beginDeferredEmit(); - this._isUndoing = isUndoing; - this._isRedoing = isRedoing; - this.applyEdits(edits, false); - this.setEOL(eol); - this._overwriteAlternativeVersionId(resultingAlternativeVersionId); - } - finally { - this._isUndoing = false; - this._isRedoing = false; - this._eventEmitter.endDeferredEmit(resultingSelection); - this._onDidChangeDecorations.endDeferredEmit(); - } - } - applyEdits(rawOperations, computeUndoEdits = false) { - try { - this._onDidChangeDecorations.beginDeferredEmit(); - this._eventEmitter.beginDeferredEmit(); - const operations = this._validateEditOperations(rawOperations); - return this._doApplyEdits(operations, computeUndoEdits); - } - finally { - this._eventEmitter.endDeferredEmit(); - this._onDidChangeDecorations.endDeferredEmit(); - } - } - _doApplyEdits(rawOperations, computeUndoEdits) { - const oldLineCount = this._buffer.getLineCount(); - const result = this._buffer.applyEdits(rawOperations, this._options.trimAutoWhitespace, computeUndoEdits); - const newLineCount = this._buffer.getLineCount(); - const contentChanges = result.changes; - this._trimAutoWhitespaceLines = result.trimAutoWhitespaceLineNumbers; - if (contentChanges.length !== 0) { - let rawContentChanges = []; - let lineCount = oldLineCount; - for (let i = 0, len = contentChanges.length; i < len; i++) { - const change = contentChanges[i]; - const [eolCount, firstLineLength, lastLineLength] = Object(_tokensStore_js__WEBPACK_IMPORTED_MODULE_22__["countEOL"])(change.text); - this._tokens.acceptEdit(change.range, eolCount, firstLineLength); - this._tokens2.acceptEdit(change.range, eolCount, firstLineLength, lastLineLength, change.text.length > 0 ? change.text.charCodeAt(0) : 0 /* Null */); - this._onDidChangeDecorations.fire(); - this._decorationsTree.acceptReplace(change.rangeOffset, change.rangeLength, change.text.length, change.forceMoveMarkers); - const startLineNumber = change.range.startLineNumber; - const endLineNumber = change.range.endLineNumber; - const deletingLinesCnt = endLineNumber - startLineNumber; - const insertingLinesCnt = eolCount; - const editingLinesCnt = Math.min(deletingLinesCnt, insertingLinesCnt); - const changeLineCountDelta = (insertingLinesCnt - deletingLinesCnt); - for (let j = editingLinesCnt; j >= 0; j--) { - const editLineNumber = startLineNumber + j; - const currentEditLineNumber = newLineCount - lineCount - changeLineCountDelta + editLineNumber; - rawContentChanges.push(new _textModelEvents_js__WEBPACK_IMPORTED_MODULE_14__["ModelRawLineChanged"](editLineNumber, this.getLineContent(currentEditLineNumber))); - } - if (editingLinesCnt < deletingLinesCnt) { - // Must delete some lines - const spliceStartLineNumber = startLineNumber + editingLinesCnt; - rawContentChanges.push(new _textModelEvents_js__WEBPACK_IMPORTED_MODULE_14__["ModelRawLinesDeleted"](spliceStartLineNumber + 1, endLineNumber)); - } - if (editingLinesCnt < insertingLinesCnt) { - // Must insert some lines - const spliceLineNumber = startLineNumber + editingLinesCnt; - const cnt = insertingLinesCnt - editingLinesCnt; - const fromLineNumber = newLineCount - lineCount - cnt + spliceLineNumber + 1; - let newLines = []; - for (let i = 0; i < cnt; i++) { - let lineNumber = fromLineNumber + i; - newLines[lineNumber - fromLineNumber] = this.getLineContent(lineNumber); - } - rawContentChanges.push(new _textModelEvents_js__WEBPACK_IMPORTED_MODULE_14__["ModelRawLinesInserted"](spliceLineNumber + 1, startLineNumber + insertingLinesCnt, newLines)); - } - lineCount += changeLineCountDelta; - } - this._increaseVersionId(); - this._emitContentChangedEvent(new _textModelEvents_js__WEBPACK_IMPORTED_MODULE_14__["ModelRawContentChangedEvent"](rawContentChanges, this.getVersionId(), this._isUndoing, this._isRedoing), { - changes: contentChanges, - eol: this._buffer.getEOL(), - versionId: this.getVersionId(), - isUndoing: this._isUndoing, - isRedoing: this._isRedoing, - isFlush: false - }); - } - return (result.reverseEdits === null ? undefined : result.reverseEdits); - } - undo() { - this._undoRedoService.undo(this.uri); - } - canUndo() { - return this._undoRedoService.canUndo(this.uri); - } - redo() { - this._undoRedoService.redo(this.uri); - } - canRedo() { - return this._undoRedoService.canRedo(this.uri); - } - //#endregion - //#region Decorations - changeDecorations(callback, ownerId = 0) { - this._assertNotDisposed(); - try { - this._onDidChangeDecorations.beginDeferredEmit(); - return this._changeDecorations(ownerId, callback); - } - finally { - this._onDidChangeDecorations.endDeferredEmit(); - } - } - _changeDecorations(ownerId, callback) { - let changeAccessor = { - addDecoration: (range, options) => { - return this._deltaDecorationsImpl(ownerId, [], [{ range: range, options: options }])[0]; - }, - changeDecoration: (id, newRange) => { - this._changeDecorationImpl(id, newRange); - }, - changeDecorationOptions: (id, options) => { - this._changeDecorationOptionsImpl(id, _normalizeOptions(options)); - }, - removeDecoration: (id) => { - this._deltaDecorationsImpl(ownerId, [id], []); - }, - deltaDecorations: (oldDecorations, newDecorations) => { - if (oldDecorations.length === 0 && newDecorations.length === 0) { - // nothing to do - return []; - } - return this._deltaDecorationsImpl(ownerId, oldDecorations, newDecorations); - } - }; - let result = null; - try { - result = callback(changeAccessor); - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - } - // Invalidate change accessor - changeAccessor.addDecoration = invalidFunc; - changeAccessor.changeDecoration = invalidFunc; - changeAccessor.changeDecorationOptions = invalidFunc; - changeAccessor.removeDecoration = invalidFunc; - changeAccessor.deltaDecorations = invalidFunc; - return result; - } - deltaDecorations(oldDecorations, newDecorations, ownerId = 0) { - this._assertNotDisposed(); - if (!oldDecorations) { - oldDecorations = []; - } - if (oldDecorations.length === 0 && newDecorations.length === 0) { - // nothing to do - return []; - } - try { - this._onDidChangeDecorations.beginDeferredEmit(); - return this._deltaDecorationsImpl(ownerId, oldDecorations, newDecorations); - } - finally { - this._onDidChangeDecorations.endDeferredEmit(); - } - } - _getTrackedRange(id) { - return this.getDecorationRange(id); - } - _setTrackedRange(id, newRange, newStickiness) { - const node = (id ? this._decorations[id] : null); - if (!node) { - if (!newRange) { - // node doesn't exist, the request is to delete => nothing to do - return null; - } - // node doesn't exist, the request is to set => add the tracked range - return this._deltaDecorationsImpl(0, [], [{ range: newRange, options: TRACKED_RANGE_OPTIONS[newStickiness] }])[0]; - } - if (!newRange) { - // node exists, the request is to delete => delete node - this._decorationsTree.delete(node); - delete this._decorations[node.id]; - return null; - } - // node exists, the request is to set => change the tracked range and its options - const range = this._validateRangeRelaxedNoAllocations(newRange); - const startOffset = this._buffer.getOffsetAt(range.startLineNumber, range.startColumn); - const endOffset = this._buffer.getOffsetAt(range.endLineNumber, range.endColumn); - this._decorationsTree.delete(node); - node.reset(this.getVersionId(), startOffset, endOffset, range); - node.setOptions(TRACKED_RANGE_OPTIONS[newStickiness]); - this._decorationsTree.insert(node); - return node.id; - } - removeAllDecorationsWithOwnerId(ownerId) { - if (this._isDisposed) { - return; - } - const nodes = this._decorationsTree.collectNodesFromOwner(ownerId); - for (let i = 0, len = nodes.length; i < len; i++) { - const node = nodes[i]; - this._decorationsTree.delete(node); - delete this._decorations[node.id]; - } - } - getDecorationOptions(decorationId) { - const node = this._decorations[decorationId]; - if (!node) { - return null; - } - return node.options; - } - getDecorationRange(decorationId) { - const node = this._decorations[decorationId]; - if (!node) { - return null; - } - const versionId = this.getVersionId(); - if (node.cachedVersionId !== versionId) { - this._decorationsTree.resolveNode(node, versionId); - } - if (node.range === null) { - node.range = this._getRangeAt(node.cachedAbsoluteStart, node.cachedAbsoluteEnd); - } - return node.range; - } - getLineDecorations(lineNumber, ownerId = 0, filterOutValidation = false) { - if (lineNumber < 1 || lineNumber > this.getLineCount()) { - return []; - } - return this.getLinesDecorations(lineNumber, lineNumber, ownerId, filterOutValidation); - } - getLinesDecorations(_startLineNumber, _endLineNumber, ownerId = 0, filterOutValidation = false) { - let lineCount = this.getLineCount(); - let startLineNumber = Math.min(lineCount, Math.max(1, _startLineNumber)); - let endLineNumber = Math.min(lineCount, Math.max(1, _endLineNumber)); - let endColumn = this.getLineMaxColumn(endLineNumber); - return this._getDecorationsInRange(new _core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](startLineNumber, 1, endLineNumber, endColumn), ownerId, filterOutValidation); - } - getDecorationsInRange(range, ownerId = 0, filterOutValidation = false) { - let validatedRange = this.validateRange(range); - return this._getDecorationsInRange(validatedRange, ownerId, filterOutValidation); - } - getOverviewRulerDecorations(ownerId = 0, filterOutValidation = false) { - const versionId = this.getVersionId(); - const result = this._decorationsTree.search(ownerId, filterOutValidation, true, versionId); - return this._ensureNodesHaveRanges(result); - } - getAllDecorations(ownerId = 0, filterOutValidation = false) { - const versionId = this.getVersionId(); - const result = this._decorationsTree.search(ownerId, filterOutValidation, false, versionId); - return this._ensureNodesHaveRanges(result); - } - _getDecorationsInRange(filterRange, filterOwnerId, filterOutValidation) { - const startOffset = this._buffer.getOffsetAt(filterRange.startLineNumber, filterRange.startColumn); - const endOffset = this._buffer.getOffsetAt(filterRange.endLineNumber, filterRange.endColumn); - const versionId = this.getVersionId(); - const result = this._decorationsTree.intervalSearch(startOffset, endOffset, filterOwnerId, filterOutValidation, versionId); - return this._ensureNodesHaveRanges(result); - } - _ensureNodesHaveRanges(nodes) { - for (let i = 0, len = nodes.length; i < len; i++) { - const node = nodes[i]; - if (node.range === null) { - node.range = this._getRangeAt(node.cachedAbsoluteStart, node.cachedAbsoluteEnd); - } - } - return nodes; - } - _getRangeAt(start, end) { - return this._buffer.getRangeAt(start, end - start); - } - _changeDecorationImpl(decorationId, _range) { - const node = this._decorations[decorationId]; - if (!node) { - return; - } - const range = this._validateRangeRelaxedNoAllocations(_range); - const startOffset = this._buffer.getOffsetAt(range.startLineNumber, range.startColumn); - const endOffset = this._buffer.getOffsetAt(range.endLineNumber, range.endColumn); - this._decorationsTree.delete(node); - node.reset(this.getVersionId(), startOffset, endOffset, range); - this._decorationsTree.insert(node); - this._onDidChangeDecorations.checkAffectedAndFire(node.options); - } - _changeDecorationOptionsImpl(decorationId, options) { - const node = this._decorations[decorationId]; - if (!node) { - return; - } - const nodeWasInOverviewRuler = (node.options.overviewRuler && node.options.overviewRuler.color ? true : false); - const nodeIsInOverviewRuler = (options.overviewRuler && options.overviewRuler.color ? true : false); - this._onDidChangeDecorations.checkAffectedAndFire(node.options); - this._onDidChangeDecorations.checkAffectedAndFire(options); - if (nodeWasInOverviewRuler !== nodeIsInOverviewRuler) { - // Delete + Insert due to an overview ruler status change - this._decorationsTree.delete(node); - node.setOptions(options); - this._decorationsTree.insert(node); - } - else { - node.setOptions(options); - } - } - _deltaDecorationsImpl(ownerId, oldDecorationsIds, newDecorations) { - const versionId = this.getVersionId(); - const oldDecorationsLen = oldDecorationsIds.length; - let oldDecorationIndex = 0; - const newDecorationsLen = newDecorations.length; - let newDecorationIndex = 0; - let result = new Array(newDecorationsLen); - while (oldDecorationIndex < oldDecorationsLen || newDecorationIndex < newDecorationsLen) { - let node = null; - if (oldDecorationIndex < oldDecorationsLen) { - // (1) get ourselves an old node - do { - node = this._decorations[oldDecorationsIds[oldDecorationIndex++]]; - } while (!node && oldDecorationIndex < oldDecorationsLen); - // (2) remove the node from the tree (if it exists) - if (node) { - this._decorationsTree.delete(node); - this._onDidChangeDecorations.checkAffectedAndFire(node.options); - } - } - if (newDecorationIndex < newDecorationsLen) { - // (3) create a new node if necessary - if (!node) { - const internalDecorationId = (++this._lastDecorationId); - const decorationId = `${this._instanceId};${internalDecorationId}`; - node = new _intervalTree_js__WEBPACK_IMPORTED_MODULE_12__["IntervalNode"](decorationId, 0, 0); - this._decorations[decorationId] = node; - } - // (4) initialize node - const newDecoration = newDecorations[newDecorationIndex]; - const range = this._validateRangeRelaxedNoAllocations(newDecoration.range); - const options = _normalizeOptions(newDecoration.options); - const startOffset = this._buffer.getOffsetAt(range.startLineNumber, range.startColumn); - const endOffset = this._buffer.getOffsetAt(range.endLineNumber, range.endColumn); - node.ownerId = ownerId; - node.reset(versionId, startOffset, endOffset, range); - node.setOptions(options); - this._onDidChangeDecorations.checkAffectedAndFire(options); - this._decorationsTree.insert(node); - result[newDecorationIndex] = node.id; - newDecorationIndex++; - } - else { - if (node) { - delete this._decorations[node.id]; - } - } - } - return result; - } - setTokens(tokens) { - if (tokens.length === 0) { - return; - } - let ranges = []; - for (let i = 0, len = tokens.length; i < len; i++) { - const element = tokens[i]; - let minChangedLineNumber = 0; - let maxChangedLineNumber = 0; - let hasChange = false; - for (let j = 0, lenJ = element.tokens.length; j < lenJ; j++) { - const lineNumber = element.startLineNumber + j; - if (hasChange) { - this._tokens.setTokens(this._languageIdentifier.id, lineNumber - 1, this._buffer.getLineLength(lineNumber), element.tokens[j], false); - maxChangedLineNumber = lineNumber; - } - else { - const lineHasChange = this._tokens.setTokens(this._languageIdentifier.id, lineNumber - 1, this._buffer.getLineLength(lineNumber), element.tokens[j], true); - if (lineHasChange) { - hasChange = true; - minChangedLineNumber = lineNumber; - maxChangedLineNumber = lineNumber; - } - } - } - if (hasChange) { - ranges.push({ fromLineNumber: minChangedLineNumber, toLineNumber: maxChangedLineNumber }); - } - } - if (ranges.length > 0) { - this._emitModelTokensChangedEvent({ - tokenizationSupportChanged: false, - semanticTokensApplied: false, - ranges: ranges - }); - } - } - setSemanticTokens(tokens, isComplete) { - this._tokens2.set(tokens, isComplete); - this._emitModelTokensChangedEvent({ - tokenizationSupportChanged: false, - semanticTokensApplied: tokens !== null, - ranges: [{ fromLineNumber: 1, toLineNumber: this.getLineCount() }] - }); - } - hasSemanticTokens() { - return this._tokens2.isComplete(); - } - setPartialSemanticTokens(range, tokens) { - if (this.hasSemanticTokens()) { - return; - } - const changedRange = this._tokens2.setPartial(range, tokens); - this._emitModelTokensChangedEvent({ - tokenizationSupportChanged: false, - semanticTokensApplied: true, - ranges: [{ fromLineNumber: changedRange.startLineNumber, toLineNumber: changedRange.endLineNumber }] - }); - } - tokenizeViewport(startLineNumber, endLineNumber) { - startLineNumber = Math.max(1, startLineNumber); - endLineNumber = Math.min(this._buffer.getLineCount(), endLineNumber); - this._tokenization.tokenizeViewport(startLineNumber, endLineNumber); - } - clearTokens() { - this._tokens.flush(); - this._emitModelTokensChangedEvent({ - tokenizationSupportChanged: true, - semanticTokensApplied: false, - ranges: [{ - fromLineNumber: 1, - toLineNumber: this._buffer.getLineCount() - }] - }); - } - _emitModelTokensChangedEvent(e) { - if (!this._isDisposing) { - this._onDidChangeTokens.fire(e); - } - } - resetTokenization() { - this._tokenization.reset(); - } - forceTokenization(lineNumber) { - if (lineNumber < 1 || lineNumber > this.getLineCount()) { - throw new Error('Illegal value for lineNumber'); - } - this._tokenization.forceTokenization(lineNumber); - } - isCheapToTokenize(lineNumber) { - return this._tokenization.isCheapToTokenize(lineNumber); - } - tokenizeIfCheap(lineNumber) { - if (this.isCheapToTokenize(lineNumber)) { - this.forceTokenization(lineNumber); - } - } - getLineTokens(lineNumber) { - if (lineNumber < 1 || lineNumber > this.getLineCount()) { - throw new Error('Illegal value for lineNumber'); - } - return this._getLineTokens(lineNumber); - } - _getLineTokens(lineNumber) { - const lineText = this.getLineContent(lineNumber); - const syntacticTokens = this._tokens.getTokens(this._languageIdentifier.id, lineNumber - 1, lineText); - return this._tokens2.addSemanticTokens(lineNumber, syntacticTokens); - } - getLanguageIdentifier() { - return this._languageIdentifier; - } - getModeId() { - return this._languageIdentifier.language; - } - setMode(languageIdentifier) { - if (this._languageIdentifier.id === languageIdentifier.id) { - // There's nothing to do - return; - } - let e = { - oldLanguage: this._languageIdentifier.language, - newLanguage: languageIdentifier.language - }; - this._languageIdentifier = languageIdentifier; - this._onDidChangeLanguage.fire(e); - this._onDidChangeLanguageConfiguration.fire({}); - } - getLanguageIdAtPosition(lineNumber, column) { - const position = this.validatePosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_6__["Position"](lineNumber, column)); - const lineTokens = this.getLineTokens(position.lineNumber); - return lineTokens.getLanguageId(lineTokens.findTokenIndexAtOffset(position.column - 1)); - } - // Having tokens allows implementing additional helper methods - getWordAtPosition(_position) { - this._assertNotDisposed(); - const position = this.validatePosition(_position); - const lineContent = this.getLineContent(position.lineNumber); - const lineTokens = this._getLineTokens(position.lineNumber); - const tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); - // (1). First try checking right biased word - const [rbStartOffset, rbEndOffset] = TextModel._findLanguageBoundaries(lineTokens, tokenIndex); - const rightBiasedWord = Object(_wordHelper_js__WEBPACK_IMPORTED_MODULE_17__["getWordAtText"])(position.column, _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getWordDefinition(lineTokens.getLanguageId(tokenIndex)), lineContent.substring(rbStartOffset, rbEndOffset), rbStartOffset); - // Make sure the result touches the original passed in position - if (rightBiasedWord && rightBiasedWord.startColumn <= _position.column && _position.column <= rightBiasedWord.endColumn) { - return rightBiasedWord; - } - // (2). Else, if we were at a language boundary, check the left biased word - if (tokenIndex > 0 && rbStartOffset === position.column - 1) { - // edge case, where `position` sits between two tokens belonging to two different languages - const [lbStartOffset, lbEndOffset] = TextModel._findLanguageBoundaries(lineTokens, tokenIndex - 1); - const leftBiasedWord = Object(_wordHelper_js__WEBPACK_IMPORTED_MODULE_17__["getWordAtText"])(position.column, _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getWordDefinition(lineTokens.getLanguageId(tokenIndex - 1)), lineContent.substring(lbStartOffset, lbEndOffset), lbStartOffset); - // Make sure the result touches the original passed in position - if (leftBiasedWord && leftBiasedWord.startColumn <= _position.column && _position.column <= leftBiasedWord.endColumn) { - return leftBiasedWord; - } - } - return null; - } - static _findLanguageBoundaries(lineTokens, tokenIndex) { - const languageId = lineTokens.getLanguageId(tokenIndex); - // go left until a different language is hit - let startOffset = 0; - for (let i = tokenIndex; i >= 0 && lineTokens.getLanguageId(i) === languageId; i--) { - startOffset = lineTokens.getStartOffset(i); - } - // go right until a different language is hit - let endOffset = lineTokens.getLineContent().length; - for (let i = tokenIndex, tokenCount = lineTokens.getCount(); i < tokenCount && lineTokens.getLanguageId(i) === languageId; i++) { - endOffset = lineTokens.getEndOffset(i); - } - return [startOffset, endOffset]; - } - getWordUntilPosition(position) { - const wordAtPosition = this.getWordAtPosition(position); - if (!wordAtPosition) { - return { - word: '', - startColumn: position.column, - endColumn: position.column - }; - } - return { - word: wordAtPosition.word.substr(0, position.column - wordAtPosition.startColumn), - startColumn: wordAtPosition.startColumn, - endColumn: position.column - }; - } - findMatchingBracketUp(_bracket, _position) { - let bracket = _bracket.toLowerCase(); - let position = this.validatePosition(_position); - let lineTokens = this._getLineTokens(position.lineNumber); - let languageId = lineTokens.getLanguageId(lineTokens.findTokenIndexAtOffset(position.column - 1)); - let bracketsSupport = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getBracketsSupport(languageId); - if (!bracketsSupport) { - return null; - } - let data = bracketsSupport.textIsBracket[bracket]; - if (!data) { - return null; - } - return stripBracketSearchCanceled(this._findMatchingBracketUp(data, position, null)); - } - matchBracket(position) { - return this._matchBracket(this.validatePosition(position)); - } - _matchBracket(position) { - const lineNumber = position.lineNumber; - const lineTokens = this._getLineTokens(lineNumber); - const tokenCount = lineTokens.getCount(); - const lineText = this._buffer.getLineContent(lineNumber); - const tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); - if (tokenIndex < 0) { - return null; - } - const currentModeBrackets = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getBracketsSupport(lineTokens.getLanguageId(tokenIndex)); - // check that the token is not to be ignored - if (currentModeBrackets && !Object(_modes_supports_js__WEBPACK_IMPORTED_MODULE_20__["ignoreBracketsInToken"])(lineTokens.getStandardTokenType(tokenIndex))) { - // limit search to not go before `maxBracketLength` - let searchStartOffset = Math.max(0, position.column - 1 - currentModeBrackets.maxBracketLength); - for (let i = tokenIndex - 1; i >= 0; i--) { - const tokenEndOffset = lineTokens.getEndOffset(i); - if (tokenEndOffset <= searchStartOffset) { - break; - } - if (Object(_modes_supports_js__WEBPACK_IMPORTED_MODULE_20__["ignoreBracketsInToken"])(lineTokens.getStandardTokenType(i))) { - searchStartOffset = tokenEndOffset; - } - } - // limit search to not go after `maxBracketLength` - const searchEndOffset = Math.min(lineText.length, position.column - 1 + currentModeBrackets.maxBracketLength); - // it might be the case that [currentTokenStart -> currentTokenEnd] contains multiple brackets - // `bestResult` will contain the most right-side result - let bestResult = null; - while (true) { - const foundBracket = _modes_supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_21__["BracketsUtils"].findNextBracketInRange(currentModeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (!foundBracket) { - // there are no more brackets in this text - break; - } - // check that we didn't hit a bracket too far away from position - if (foundBracket.startColumn <= position.column && position.column <= foundBracket.endColumn) { - const foundBracketText = lineText.substring(foundBracket.startColumn - 1, foundBracket.endColumn - 1).toLowerCase(); - const r = this._matchFoundBracket(foundBracket, currentModeBrackets.textIsBracket[foundBracketText], currentModeBrackets.textIsOpenBracket[foundBracketText], null); - if (r) { - if (r instanceof BracketSearchCanceled) { - return null; - } - bestResult = r; - } - } - searchStartOffset = foundBracket.endColumn - 1; - } - if (bestResult) { - return bestResult; - } - } - // If position is in between two tokens, try also looking in the previous token - if (tokenIndex > 0 && lineTokens.getStartOffset(tokenIndex) === position.column - 1) { - const prevTokenIndex = tokenIndex - 1; - const prevModeBrackets = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getBracketsSupport(lineTokens.getLanguageId(prevTokenIndex)); - // check that previous token is not to be ignored - if (prevModeBrackets && !Object(_modes_supports_js__WEBPACK_IMPORTED_MODULE_20__["ignoreBracketsInToken"])(lineTokens.getStandardTokenType(prevTokenIndex))) { - // limit search in case previous token is very large, there's no need to go beyond `maxBracketLength` - const searchStartOffset = Math.max(0, position.column - 1 - prevModeBrackets.maxBracketLength); - let searchEndOffset = Math.min(lineText.length, position.column - 1 + prevModeBrackets.maxBracketLength); - for (let i = prevTokenIndex + 1; i < tokenCount; i++) { - const tokenStartOffset = lineTokens.getStartOffset(i); - if (tokenStartOffset >= searchEndOffset) { - break; - } - if (Object(_modes_supports_js__WEBPACK_IMPORTED_MODULE_20__["ignoreBracketsInToken"])(lineTokens.getStandardTokenType(i))) { - searchEndOffset = tokenStartOffset; - } - } - const foundBracket = _modes_supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_21__["BracketsUtils"].findPrevBracketInRange(prevModeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); - // check that we didn't hit a bracket too far away from position - if (foundBracket && foundBracket.startColumn <= position.column && position.column <= foundBracket.endColumn) { - const foundBracketText = lineText.substring(foundBracket.startColumn - 1, foundBracket.endColumn - 1).toLowerCase(); - const r = this._matchFoundBracket(foundBracket, prevModeBrackets.textIsBracket[foundBracketText], prevModeBrackets.textIsOpenBracket[foundBracketText], null); - if (r) { - if (r instanceof BracketSearchCanceled) { - return null; - } - return r; - } - } - } - } - return null; - } - _matchFoundBracket(foundBracket, data, isOpen, continueSearchPredicate) { - if (!data) { - return null; - } - const matched = (isOpen - ? this._findMatchingBracketDown(data, foundBracket.getEndPosition(), continueSearchPredicate) - : this._findMatchingBracketUp(data, foundBracket.getStartPosition(), continueSearchPredicate)); - if (!matched) { - return null; - } - if (matched instanceof BracketSearchCanceled) { - return matched; - } - return [foundBracket, matched]; - } - _findMatchingBracketUp(bracket, position, continueSearchPredicate) { - // console.log('_findMatchingBracketUp: ', 'bracket: ', JSON.stringify(bracket), 'startPosition: ', String(position)); - const languageId = bracket.languageIdentifier.id; - const reversedBracketRegex = bracket.reversedRegex; - let count = -1; - let totalCallCount = 0; - const searchPrevMatchingBracketInRange = (lineNumber, lineText, searchStartOffset, searchEndOffset) => { - while (true) { - if (continueSearchPredicate && (++totalCallCount) % 100 === 0 && !continueSearchPredicate()) { - return BracketSearchCanceled.INSTANCE; - } - const r = _modes_supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_21__["BracketsUtils"].findPrevBracketInRange(reversedBracketRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (!r) { - break; - } - const hitText = lineText.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase(); - if (bracket.isOpen(hitText)) { - count++; - } - else if (bracket.isClose(hitText)) { - count--; - } - if (count === 0) { - return r; - } - searchEndOffset = r.startColumn - 1; - } - return null; - }; - for (let lineNumber = position.lineNumber; lineNumber >= 1; lineNumber--) { - const lineTokens = this._getLineTokens(lineNumber); - const tokenCount = lineTokens.getCount(); - const lineText = this._buffer.getLineContent(lineNumber); - let tokenIndex = tokenCount - 1; - let searchStartOffset = lineText.length; - let searchEndOffset = lineText.length; - if (lineNumber === position.lineNumber) { - tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); - searchStartOffset = position.column - 1; - searchEndOffset = position.column - 1; - } - let prevSearchInToken = true; - for (; tokenIndex >= 0; tokenIndex--) { - const searchInToken = (lineTokens.getLanguageId(tokenIndex) === languageId && !Object(_modes_supports_js__WEBPACK_IMPORTED_MODULE_20__["ignoreBracketsInToken"])(lineTokens.getStandardTokenType(tokenIndex))); - if (searchInToken) { - // this token should be searched - if (prevSearchInToken) { - // the previous token should be searched, simply extend searchStartOffset - searchStartOffset = lineTokens.getStartOffset(tokenIndex); - } - else { - // the previous token should not be searched - searchStartOffset = lineTokens.getStartOffset(tokenIndex); - searchEndOffset = lineTokens.getEndOffset(tokenIndex); - } - } - else { - // this token should not be searched - if (prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = searchPrevMatchingBracketInRange(lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return r; - } - } - } - prevSearchInToken = searchInToken; - } - if (prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = searchPrevMatchingBracketInRange(lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return r; - } - } - } - return null; - } - _findMatchingBracketDown(bracket, position, continueSearchPredicate) { - // console.log('_findMatchingBracketDown: ', 'bracket: ', JSON.stringify(bracket), 'startPosition: ', String(position)); - const languageId = bracket.languageIdentifier.id; - const bracketRegex = bracket.forwardRegex; - let count = 1; - let totalCallCount = 0; - const searchNextMatchingBracketInRange = (lineNumber, lineText, searchStartOffset, searchEndOffset) => { - while (true) { - if (continueSearchPredicate && (++totalCallCount) % 100 === 0 && !continueSearchPredicate()) { - return BracketSearchCanceled.INSTANCE; - } - const r = _modes_supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_21__["BracketsUtils"].findNextBracketInRange(bracketRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (!r) { - break; - } - const hitText = lineText.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase(); - if (bracket.isOpen(hitText)) { - count++; - } - else if (bracket.isClose(hitText)) { - count--; - } - if (count === 0) { - return r; - } - searchStartOffset = r.endColumn - 1; - } - return null; - }; - const lineCount = this.getLineCount(); - for (let lineNumber = position.lineNumber; lineNumber <= lineCount; lineNumber++) { - const lineTokens = this._getLineTokens(lineNumber); - const tokenCount = lineTokens.getCount(); - const lineText = this._buffer.getLineContent(lineNumber); - let tokenIndex = 0; - let searchStartOffset = 0; - let searchEndOffset = 0; - if (lineNumber === position.lineNumber) { - tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); - searchStartOffset = position.column - 1; - searchEndOffset = position.column - 1; - } - let prevSearchInToken = true; - for (; tokenIndex < tokenCount; tokenIndex++) { - const searchInToken = (lineTokens.getLanguageId(tokenIndex) === languageId && !Object(_modes_supports_js__WEBPACK_IMPORTED_MODULE_20__["ignoreBracketsInToken"])(lineTokens.getStandardTokenType(tokenIndex))); - if (searchInToken) { - // this token should be searched - if (prevSearchInToken) { - // the previous token should be searched, simply extend searchEndOffset - searchEndOffset = lineTokens.getEndOffset(tokenIndex); - } - else { - // the previous token should not be searched - searchStartOffset = lineTokens.getStartOffset(tokenIndex); - searchEndOffset = lineTokens.getEndOffset(tokenIndex); - } - } - else { - // this token should not be searched - if (prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = searchNextMatchingBracketInRange(lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return r; - } - } - } - prevSearchInToken = searchInToken; - } - if (prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = searchNextMatchingBracketInRange(lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return r; - } - } - } - return null; - } - findPrevBracket(_position) { - const position = this.validatePosition(_position); - let languageId = -1; - let modeBrackets = null; - for (let lineNumber = position.lineNumber; lineNumber >= 1; lineNumber--) { - const lineTokens = this._getLineTokens(lineNumber); - const tokenCount = lineTokens.getCount(); - const lineText = this._buffer.getLineContent(lineNumber); - let tokenIndex = tokenCount - 1; - let searchStartOffset = lineText.length; - let searchEndOffset = lineText.length; - if (lineNumber === position.lineNumber) { - tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); - searchStartOffset = position.column - 1; - searchEndOffset = position.column - 1; - const tokenLanguageId = lineTokens.getLanguageId(tokenIndex); - if (languageId !== tokenLanguageId) { - languageId = tokenLanguageId; - modeBrackets = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getBracketsSupport(languageId); - } - } - let prevSearchInToken = true; - for (; tokenIndex >= 0; tokenIndex--) { - const tokenLanguageId = lineTokens.getLanguageId(tokenIndex); - if (languageId !== tokenLanguageId) { - // language id change! - if (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = _modes_supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_21__["BracketsUtils"].findPrevBracketInRange(modeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return this._toFoundBracket(modeBrackets, r); - } - prevSearchInToken = false; - } - languageId = tokenLanguageId; - modeBrackets = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getBracketsSupport(languageId); - } - const searchInToken = (!!modeBrackets && !Object(_modes_supports_js__WEBPACK_IMPORTED_MODULE_20__["ignoreBracketsInToken"])(lineTokens.getStandardTokenType(tokenIndex))); - if (searchInToken) { - // this token should be searched - if (prevSearchInToken) { - // the previous token should be searched, simply extend searchStartOffset - searchStartOffset = lineTokens.getStartOffset(tokenIndex); - } - else { - // the previous token should not be searched - searchStartOffset = lineTokens.getStartOffset(tokenIndex); - searchEndOffset = lineTokens.getEndOffset(tokenIndex); - } - } - else { - // this token should not be searched - if (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = _modes_supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_21__["BracketsUtils"].findPrevBracketInRange(modeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return this._toFoundBracket(modeBrackets, r); - } - } - } - prevSearchInToken = searchInToken; - } - if (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = _modes_supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_21__["BracketsUtils"].findPrevBracketInRange(modeBrackets.reversedRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return this._toFoundBracket(modeBrackets, r); - } - } - } - return null; - } - findNextBracket(_position) { - const position = this.validatePosition(_position); - const lineCount = this.getLineCount(); - let languageId = -1; - let modeBrackets = null; - for (let lineNumber = position.lineNumber; lineNumber <= lineCount; lineNumber++) { - const lineTokens = this._getLineTokens(lineNumber); - const tokenCount = lineTokens.getCount(); - const lineText = this._buffer.getLineContent(lineNumber); - let tokenIndex = 0; - let searchStartOffset = 0; - let searchEndOffset = 0; - if (lineNumber === position.lineNumber) { - tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); - searchStartOffset = position.column - 1; - searchEndOffset = position.column - 1; - const tokenLanguageId = lineTokens.getLanguageId(tokenIndex); - if (languageId !== tokenLanguageId) { - languageId = tokenLanguageId; - modeBrackets = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getBracketsSupport(languageId); - } - } - let prevSearchInToken = true; - for (; tokenIndex < tokenCount; tokenIndex++) { - const tokenLanguageId = lineTokens.getLanguageId(tokenIndex); - if (languageId !== tokenLanguageId) { - // language id change! - if (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = _modes_supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_21__["BracketsUtils"].findNextBracketInRange(modeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return this._toFoundBracket(modeBrackets, r); - } - prevSearchInToken = false; - } - languageId = tokenLanguageId; - modeBrackets = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getBracketsSupport(languageId); - } - const searchInToken = (!!modeBrackets && !Object(_modes_supports_js__WEBPACK_IMPORTED_MODULE_20__["ignoreBracketsInToken"])(lineTokens.getStandardTokenType(tokenIndex))); - if (searchInToken) { - // this token should be searched - if (prevSearchInToken) { - // the previous token should be searched, simply extend searchEndOffset - searchEndOffset = lineTokens.getEndOffset(tokenIndex); - } - else { - // the previous token should not be searched - searchStartOffset = lineTokens.getStartOffset(tokenIndex); - searchEndOffset = lineTokens.getEndOffset(tokenIndex); - } - } - else { - // this token should not be searched - if (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = _modes_supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_21__["BracketsUtils"].findNextBracketInRange(modeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return this._toFoundBracket(modeBrackets, r); - } - } - } - prevSearchInToken = searchInToken; - } - if (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = _modes_supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_21__["BracketsUtils"].findNextBracketInRange(modeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return this._toFoundBracket(modeBrackets, r); - } - } - } - return null; - } - findEnclosingBrackets(_position, maxDuration) { - let continueSearchPredicate; - if (typeof maxDuration === 'undefined') { - continueSearchPredicate = null; - } - else { - const startTime = Date.now(); - continueSearchPredicate = () => { - return (Date.now() - startTime <= maxDuration); - }; - } - const position = this.validatePosition(_position); - const lineCount = this.getLineCount(); - const savedCounts = new Map(); - let counts = []; - const resetCounts = (languageId, modeBrackets) => { - if (!savedCounts.has(languageId)) { - let tmp = []; - for (let i = 0, len = modeBrackets ? modeBrackets.brackets.length : 0; i < len; i++) { - tmp[i] = 0; - } - savedCounts.set(languageId, tmp); - } - counts = savedCounts.get(languageId); - }; - let totalCallCount = 0; - const searchInRange = (modeBrackets, lineNumber, lineText, searchStartOffset, searchEndOffset) => { - while (true) { - if (continueSearchPredicate && (++totalCallCount) % 100 === 0 && !continueSearchPredicate()) { - return BracketSearchCanceled.INSTANCE; - } - const r = _modes_supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_21__["BracketsUtils"].findNextBracketInRange(modeBrackets.forwardRegex, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (!r) { - break; - } - const hitText = lineText.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase(); - const bracket = modeBrackets.textIsBracket[hitText]; - if (bracket) { - if (bracket.isOpen(hitText)) { - counts[bracket.index]++; - } - else if (bracket.isClose(hitText)) { - counts[bracket.index]--; - } - if (counts[bracket.index] === -1) { - return this._matchFoundBracket(r, bracket, false, continueSearchPredicate); - } - } - searchStartOffset = r.endColumn - 1; - } - return null; - }; - let languageId = -1; - let modeBrackets = null; - for (let lineNumber = position.lineNumber; lineNumber <= lineCount; lineNumber++) { - const lineTokens = this._getLineTokens(lineNumber); - const tokenCount = lineTokens.getCount(); - const lineText = this._buffer.getLineContent(lineNumber); - let tokenIndex = 0; - let searchStartOffset = 0; - let searchEndOffset = 0; - if (lineNumber === position.lineNumber) { - tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); - searchStartOffset = position.column - 1; - searchEndOffset = position.column - 1; - const tokenLanguageId = lineTokens.getLanguageId(tokenIndex); - if (languageId !== tokenLanguageId) { - languageId = tokenLanguageId; - modeBrackets = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getBracketsSupport(languageId); - resetCounts(languageId, modeBrackets); - } - } - let prevSearchInToken = true; - for (; tokenIndex < tokenCount; tokenIndex++) { - const tokenLanguageId = lineTokens.getLanguageId(tokenIndex); - if (languageId !== tokenLanguageId) { - // language id change! - if (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = searchInRange(modeBrackets, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return stripBracketSearchCanceled(r); - } - prevSearchInToken = false; - } - languageId = tokenLanguageId; - modeBrackets = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getBracketsSupport(languageId); - resetCounts(languageId, modeBrackets); - } - const searchInToken = (!!modeBrackets && !Object(_modes_supports_js__WEBPACK_IMPORTED_MODULE_20__["ignoreBracketsInToken"])(lineTokens.getStandardTokenType(tokenIndex))); - if (searchInToken) { - // this token should be searched - if (prevSearchInToken) { - // the previous token should be searched, simply extend searchEndOffset - searchEndOffset = lineTokens.getEndOffset(tokenIndex); - } - else { - // the previous token should not be searched - searchStartOffset = lineTokens.getStartOffset(tokenIndex); - searchEndOffset = lineTokens.getEndOffset(tokenIndex); - } - } - else { - // this token should not be searched - if (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = searchInRange(modeBrackets, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return stripBracketSearchCanceled(r); - } - } - } - prevSearchInToken = searchInToken; - } - if (modeBrackets && prevSearchInToken && searchStartOffset !== searchEndOffset) { - const r = searchInRange(modeBrackets, lineNumber, lineText, searchStartOffset, searchEndOffset); - if (r) { - return stripBracketSearchCanceled(r); - } - } - } - return null; - } - _toFoundBracket(modeBrackets, r) { - if (!r) { - return null; - } - let text = this.getValueInRange(r); - text = text.toLowerCase(); - let data = modeBrackets.textIsBracket[text]; - if (!data) { - return null; - } - return { - range: r, - open: data.open, - close: data.close, - isOpen: modeBrackets.textIsOpenBracket[text] - }; - } - /** - * Returns: - * - -1 => the line consists of whitespace - * - otherwise => the indent level is returned value - */ - static computeIndentLevel(line, tabSize) { - let indent = 0; - let i = 0; - let len = line.length; - while (i < len) { - let chCode = line.charCodeAt(i); - if (chCode === 32 /* Space */) { - indent++; - } - else if (chCode === 9 /* Tab */) { - indent = indent - indent % tabSize + tabSize; - } - else { - break; - } - i++; - } - if (i === len) { - return -1; // line only consists of whitespace - } - return indent; - } - _computeIndentLevel(lineIndex) { - return TextModel.computeIndentLevel(this._buffer.getLineContent(lineIndex + 1), this._options.tabSize); - } - getActiveIndentGuide(lineNumber, minLineNumber, maxLineNumber) { - this._assertNotDisposed(); - const lineCount = this.getLineCount(); - if (lineNumber < 1 || lineNumber > lineCount) { - throw new Error('Illegal value for lineNumber'); - } - const foldingRules = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getFoldingRules(this._languageIdentifier.id); - const offSide = Boolean(foldingRules && foldingRules.offSide); - let up_aboveContentLineIndex = -2; /* -2 is a marker for not having computed it */ - let up_aboveContentLineIndent = -1; - let up_belowContentLineIndex = -2; /* -2 is a marker for not having computed it */ - let up_belowContentLineIndent = -1; - const up_resolveIndents = (lineNumber) => { - if (up_aboveContentLineIndex !== -1 && (up_aboveContentLineIndex === -2 || up_aboveContentLineIndex > lineNumber - 1)) { - up_aboveContentLineIndex = -1; - up_aboveContentLineIndent = -1; - // must find previous line with content - for (let lineIndex = lineNumber - 2; lineIndex >= 0; lineIndex--) { - let indent = this._computeIndentLevel(lineIndex); - if (indent >= 0) { - up_aboveContentLineIndex = lineIndex; - up_aboveContentLineIndent = indent; - break; - } - } - } - if (up_belowContentLineIndex === -2) { - up_belowContentLineIndex = -1; - up_belowContentLineIndent = -1; - // must find next line with content - for (let lineIndex = lineNumber; lineIndex < lineCount; lineIndex++) { - let indent = this._computeIndentLevel(lineIndex); - if (indent >= 0) { - up_belowContentLineIndex = lineIndex; - up_belowContentLineIndent = indent; - break; - } - } - } - }; - let down_aboveContentLineIndex = -2; /* -2 is a marker for not having computed it */ - let down_aboveContentLineIndent = -1; - let down_belowContentLineIndex = -2; /* -2 is a marker for not having computed it */ - let down_belowContentLineIndent = -1; - const down_resolveIndents = (lineNumber) => { - if (down_aboveContentLineIndex === -2) { - down_aboveContentLineIndex = -1; - down_aboveContentLineIndent = -1; - // must find previous line with content - for (let lineIndex = lineNumber - 2; lineIndex >= 0; lineIndex--) { - let indent = this._computeIndentLevel(lineIndex); - if (indent >= 0) { - down_aboveContentLineIndex = lineIndex; - down_aboveContentLineIndent = indent; - break; - } - } - } - if (down_belowContentLineIndex !== -1 && (down_belowContentLineIndex === -2 || down_belowContentLineIndex < lineNumber - 1)) { - down_belowContentLineIndex = -1; - down_belowContentLineIndent = -1; - // must find next line with content - for (let lineIndex = lineNumber; lineIndex < lineCount; lineIndex++) { - let indent = this._computeIndentLevel(lineIndex); - if (indent >= 0) { - down_belowContentLineIndex = lineIndex; - down_belowContentLineIndent = indent; - break; - } - } - } - }; - let startLineNumber = 0; - let goUp = true; - let endLineNumber = 0; - let goDown = true; - let indent = 0; - let initialIndent = 0; - for (let distance = 0; goUp || goDown; distance++) { - const upLineNumber = lineNumber - distance; - const downLineNumber = lineNumber + distance; - if (distance > 1 && (upLineNumber < 1 || upLineNumber < minLineNumber)) { - goUp = false; - } - if (distance > 1 && (downLineNumber > lineCount || downLineNumber > maxLineNumber)) { - goDown = false; - } - if (distance > 50000) { - // stop processing - goUp = false; - goDown = false; - } - let upLineIndentLevel = -1; - if (goUp) { - // compute indent level going up - const currentIndent = this._computeIndentLevel(upLineNumber - 1); - if (currentIndent >= 0) { - // This line has content (besides whitespace) - // Use the line's indent - up_belowContentLineIndex = upLineNumber - 1; - up_belowContentLineIndent = currentIndent; - upLineIndentLevel = Math.ceil(currentIndent / this._options.indentSize); - } - else { - up_resolveIndents(upLineNumber); - upLineIndentLevel = this._getIndentLevelForWhitespaceLine(offSide, up_aboveContentLineIndent, up_belowContentLineIndent); - } - } - let downLineIndentLevel = -1; - if (goDown) { - // compute indent level going down - const currentIndent = this._computeIndentLevel(downLineNumber - 1); - if (currentIndent >= 0) { - // This line has content (besides whitespace) - // Use the line's indent - down_aboveContentLineIndex = downLineNumber - 1; - down_aboveContentLineIndent = currentIndent; - downLineIndentLevel = Math.ceil(currentIndent / this._options.indentSize); - } - else { - down_resolveIndents(downLineNumber); - downLineIndentLevel = this._getIndentLevelForWhitespaceLine(offSide, down_aboveContentLineIndent, down_belowContentLineIndent); - } - } - if (distance === 0) { - initialIndent = upLineIndentLevel; - continue; - } - if (distance === 1) { - if (downLineNumber <= lineCount && downLineIndentLevel >= 0 && initialIndent + 1 === downLineIndentLevel) { - // This is the beginning of a scope, we have special handling here, since we want the - // child scope indent to be active, not the parent scope - goUp = false; - startLineNumber = downLineNumber; - endLineNumber = downLineNumber; - indent = downLineIndentLevel; - continue; - } - if (upLineNumber >= 1 && upLineIndentLevel >= 0 && upLineIndentLevel - 1 === initialIndent) { - // This is the end of a scope, just like above - goDown = false; - startLineNumber = upLineNumber; - endLineNumber = upLineNumber; - indent = upLineIndentLevel; - continue; - } - startLineNumber = lineNumber; - endLineNumber = lineNumber; - indent = initialIndent; - if (indent === 0) { - // No need to continue - return { startLineNumber, endLineNumber, indent }; - } - } - if (goUp) { - if (upLineIndentLevel >= indent) { - startLineNumber = upLineNumber; - } - else { - goUp = false; - } - } - if (goDown) { - if (downLineIndentLevel >= indent) { - endLineNumber = downLineNumber; - } - else { - goDown = false; - } - } - } - return { startLineNumber, endLineNumber, indent }; - } - getLinesIndentGuides(startLineNumber, endLineNumber) { - this._assertNotDisposed(); - const lineCount = this.getLineCount(); - if (startLineNumber < 1 || startLineNumber > lineCount) { - throw new Error('Illegal value for startLineNumber'); - } - if (endLineNumber < 1 || endLineNumber > lineCount) { - throw new Error('Illegal value for endLineNumber'); - } - const foldingRules = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_18__["LanguageConfigurationRegistry"].getFoldingRules(this._languageIdentifier.id); - const offSide = Boolean(foldingRules && foldingRules.offSide); - let result = new Array(endLineNumber - startLineNumber + 1); - let aboveContentLineIndex = -2; /* -2 is a marker for not having computed it */ - let aboveContentLineIndent = -1; - let belowContentLineIndex = -2; /* -2 is a marker for not having computed it */ - let belowContentLineIndent = -1; - for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { - let resultIndex = lineNumber - startLineNumber; - const currentIndent = this._computeIndentLevel(lineNumber - 1); - if (currentIndent >= 0) { - // This line has content (besides whitespace) - // Use the line's indent - aboveContentLineIndex = lineNumber - 1; - aboveContentLineIndent = currentIndent; - result[resultIndex] = Math.ceil(currentIndent / this._options.indentSize); - continue; - } - if (aboveContentLineIndex === -2) { - aboveContentLineIndex = -1; - aboveContentLineIndent = -1; - // must find previous line with content - for (let lineIndex = lineNumber - 2; lineIndex >= 0; lineIndex--) { - let indent = this._computeIndentLevel(lineIndex); - if (indent >= 0) { - aboveContentLineIndex = lineIndex; - aboveContentLineIndent = indent; - break; - } - } - } - if (belowContentLineIndex !== -1 && (belowContentLineIndex === -2 || belowContentLineIndex < lineNumber - 1)) { - belowContentLineIndex = -1; - belowContentLineIndent = -1; - // must find next line with content - for (let lineIndex = lineNumber; lineIndex < lineCount; lineIndex++) { - let indent = this._computeIndentLevel(lineIndex); - if (indent >= 0) { - belowContentLineIndex = lineIndex; - belowContentLineIndent = indent; - break; - } - } - } - result[resultIndex] = this._getIndentLevelForWhitespaceLine(offSide, aboveContentLineIndent, belowContentLineIndent); - } - return result; - } - _getIndentLevelForWhitespaceLine(offSide, aboveContentLineIndent, belowContentLineIndent) { - if (aboveContentLineIndent === -1 || belowContentLineIndent === -1) { - // At the top or bottom of the file - return 0; - } - else if (aboveContentLineIndent < belowContentLineIndent) { - // we are inside the region above - return (1 + Math.floor(aboveContentLineIndent / this._options.indentSize)); - } - else if (aboveContentLineIndent === belowContentLineIndent) { - // we are in between two regions - return Math.ceil(belowContentLineIndent / this._options.indentSize); - } - else { - if (offSide) { - // same level as region below - return Math.ceil(belowContentLineIndent / this._options.indentSize); - } - else { - // we are inside the region that ends below - return (1 + Math.floor(belowContentLineIndent / this._options.indentSize)); - } - } - } -} -TextModel.MODEL_SYNC_LIMIT = 50 * 1024 * 1024; // 50 MB -TextModel.LARGE_FILE_SIZE_THRESHOLD = 20 * 1024 * 1024; // 20 MB; -TextModel.LARGE_FILE_LINE_COUNT_THRESHOLD = 300 * 1000; // 300K lines -TextModel.DEFAULT_CREATION_OPTIONS = { - isForSimpleWidget: false, - tabSize: _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["EDITOR_MODEL_DEFAULTS"].tabSize, - indentSize: _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["EDITOR_MODEL_DEFAULTS"].indentSize, - insertSpaces: _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["EDITOR_MODEL_DEFAULTS"].insertSpaces, - detectIndentation: false, - defaultEOL: 1 /* LF */, - trimAutoWhitespace: _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["EDITOR_MODEL_DEFAULTS"].trimAutoWhitespace, - largeFileOptimizations: _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_5__["EDITOR_MODEL_DEFAULTS"].largeFileOptimizations, -}; -//#region Decorations -class DecorationsTrees { - constructor() { - this._decorationsTree0 = new _intervalTree_js__WEBPACK_IMPORTED_MODULE_12__["IntervalTree"](); - this._decorationsTree1 = new _intervalTree_js__WEBPACK_IMPORTED_MODULE_12__["IntervalTree"](); - } - intervalSearch(start, end, filterOwnerId, filterOutValidation, cachedVersionId) { - const r0 = this._decorationsTree0.intervalSearch(start, end, filterOwnerId, filterOutValidation, cachedVersionId); - const r1 = this._decorationsTree1.intervalSearch(start, end, filterOwnerId, filterOutValidation, cachedVersionId); - return r0.concat(r1); - } - search(filterOwnerId, filterOutValidation, overviewRulerOnly, cachedVersionId) { - if (overviewRulerOnly) { - return this._decorationsTree1.search(filterOwnerId, filterOutValidation, cachedVersionId); - } - else { - const r0 = this._decorationsTree0.search(filterOwnerId, filterOutValidation, cachedVersionId); - const r1 = this._decorationsTree1.search(filterOwnerId, filterOutValidation, cachedVersionId); - return r0.concat(r1); - } - } - collectNodesFromOwner(ownerId) { - const r0 = this._decorationsTree0.collectNodesFromOwner(ownerId); - const r1 = this._decorationsTree1.collectNodesFromOwner(ownerId); - return r0.concat(r1); - } - collectNodesPostOrder() { - const r0 = this._decorationsTree0.collectNodesPostOrder(); - const r1 = this._decorationsTree1.collectNodesPostOrder(); - return r0.concat(r1); - } - insert(node) { - if (Object(_intervalTree_js__WEBPACK_IMPORTED_MODULE_12__["getNodeIsInOverviewRuler"])(node)) { - this._decorationsTree1.insert(node); - } - else { - this._decorationsTree0.insert(node); - } - } - delete(node) { - if (Object(_intervalTree_js__WEBPACK_IMPORTED_MODULE_12__["getNodeIsInOverviewRuler"])(node)) { - this._decorationsTree1.delete(node); - } - else { - this._decorationsTree0.delete(node); - } - } - resolveNode(node, cachedVersionId) { - if (Object(_intervalTree_js__WEBPACK_IMPORTED_MODULE_12__["getNodeIsInOverviewRuler"])(node)) { - this._decorationsTree1.resolveNode(node, cachedVersionId); - } - else { - this._decorationsTree0.resolveNode(node, cachedVersionId); - } - } - acceptReplace(offset, length, textLength, forceMoveMarkers) { - this._decorationsTree0.acceptReplace(offset, length, textLength, forceMoveMarkers); - this._decorationsTree1.acceptReplace(offset, length, textLength, forceMoveMarkers); - } -} -function cleanClassName(className) { - return className.replace(/[^a-z0-9\-_]/gi, ' '); -} -class DecorationOptions { - constructor(options) { - this.color = options.color || ''; - this.darkColor = options.darkColor || ''; - } -} -class ModelDecorationOverviewRulerOptions extends DecorationOptions { - constructor(options) { - super(options); - this._resolvedColor = null; - this.position = (typeof options.position === 'number' ? options.position : _model_js__WEBPACK_IMPORTED_MODULE_9__["OverviewRulerLane"].Center); - } - getColor(theme) { - if (!this._resolvedColor) { - if (theme.type !== 'light' && this.darkColor) { - this._resolvedColor = this._resolveColor(this.darkColor, theme); - } - else { - this._resolvedColor = this._resolveColor(this.color, theme); - } - } - return this._resolvedColor; - } - invalidateCachedColor() { - this._resolvedColor = null; - } - _resolveColor(color, theme) { - if (typeof color === 'string') { - return color; - } - let c = color ? theme.getColor(color.id) : null; - if (!c) { - return ''; - } - return c.toString(); - } -} -class ModelDecorationMinimapOptions extends DecorationOptions { - constructor(options) { - super(options); - this.position = options.position; - } - getColor(theme) { - if (!this._resolvedColor) { - if (theme.type !== 'light' && this.darkColor) { - this._resolvedColor = this._resolveColor(this.darkColor, theme); - } - else { - this._resolvedColor = this._resolveColor(this.color, theme); - } - } - return this._resolvedColor; - } - invalidateCachedColor() { - this._resolvedColor = undefined; - } - _resolveColor(color, theme) { - if (typeof color === 'string') { - return _base_common_color_js__WEBPACK_IMPORTED_MODULE_23__["Color"].fromHex(color); - } - return theme.getColor(color.id); - } -} -class ModelDecorationOptions { - constructor(options) { - this.stickiness = options.stickiness || 0 /* AlwaysGrowsWhenTypingAtEdges */; - this.zIndex = options.zIndex || 0; - this.className = options.className ? cleanClassName(options.className) : null; - this.hoverMessage = options.hoverMessage || null; - this.glyphMarginHoverMessage = options.glyphMarginHoverMessage || null; - this.isWholeLine = options.isWholeLine || false; - this.showIfCollapsed = options.showIfCollapsed || false; - this.collapseOnReplaceEdit = options.collapseOnReplaceEdit || false; - this.overviewRuler = options.overviewRuler ? new ModelDecorationOverviewRulerOptions(options.overviewRuler) : null; - this.minimap = options.minimap ? new ModelDecorationMinimapOptions(options.minimap) : null; - this.glyphMarginClassName = options.glyphMarginClassName ? cleanClassName(options.glyphMarginClassName) : null; - this.linesDecorationsClassName = options.linesDecorationsClassName ? cleanClassName(options.linesDecorationsClassName) : null; - this.firstLineDecorationClassName = options.firstLineDecorationClassName ? cleanClassName(options.firstLineDecorationClassName) : null; - this.marginClassName = options.marginClassName ? cleanClassName(options.marginClassName) : null; - this.inlineClassName = options.inlineClassName ? cleanClassName(options.inlineClassName) : null; - this.inlineClassNameAffectsLetterSpacing = options.inlineClassNameAffectsLetterSpacing || false; - this.beforeContentClassName = options.beforeContentClassName ? cleanClassName(options.beforeContentClassName) : null; - this.afterContentClassName = options.afterContentClassName ? cleanClassName(options.afterContentClassName) : null; - } - static register(options) { - return new ModelDecorationOptions(options); - } - static createDynamic(options) { - return new ModelDecorationOptions(options); - } -} -ModelDecorationOptions.EMPTY = ModelDecorationOptions.register({}); -/** - * The order carefully matches the values of the enum. - */ -const TRACKED_RANGE_OPTIONS = [ - ModelDecorationOptions.register({ stickiness: 0 /* AlwaysGrowsWhenTypingAtEdges */ }), - ModelDecorationOptions.register({ stickiness: 1 /* NeverGrowsWhenTypingAtEdges */ }), - ModelDecorationOptions.register({ stickiness: 2 /* GrowsOnlyWhenTypingBefore */ }), - ModelDecorationOptions.register({ stickiness: 3 /* GrowsOnlyWhenTypingAfter */ }), -]; -function _normalizeOptions(options) { - if (options instanceof ModelDecorationOptions) { - return options; - } - return ModelDecorationOptions.createDynamic(options); -} -class DidChangeDecorationsEmitter extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor() { - super(); - this._actual = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.event = this._actual.event; - this._deferredCnt = 0; - this._shouldFire = false; - this._affectsMinimap = false; - this._affectsOverviewRuler = false; - } - beginDeferredEmit() { - this._deferredCnt++; - } - endDeferredEmit() { - this._deferredCnt--; - if (this._deferredCnt === 0) { - if (this._shouldFire) { - const event = { - affectsMinimap: this._affectsMinimap, - affectsOverviewRuler: this._affectsOverviewRuler, - }; - this._shouldFire = false; - this._affectsMinimap = false; - this._affectsOverviewRuler = false; - this._actual.fire(event); - } - } - } - checkAffectedAndFire(options) { - if (!this._affectsMinimap) { - this._affectsMinimap = options.minimap && options.minimap.position ? true : false; - } - if (!this._affectsOverviewRuler) { - this._affectsOverviewRuler = options.overviewRuler && options.overviewRuler.color ? true : false; - } - this._shouldFire = true; - } - fire() { - this._affectsMinimap = true; - this._affectsOverviewRuler = true; - this._shouldFire = true; - } -} -//#endregion -class DidChangeContentEmitter extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor() { - super(); - /** - * Both `fastEvent` and `slowEvent` work the same way and contain the same events, but first we invoke `fastEvent` and then `slowEvent`. - */ - this._fastEmitter = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.fastEvent = this._fastEmitter.event; - this._slowEmitter = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.slowEvent = this._slowEmitter.event; - this._deferredCnt = 0; - this._deferredEvent = null; - } - beginDeferredEmit() { - this._deferredCnt++; - } - endDeferredEmit(resultingSelection = null) { - this._deferredCnt--; - if (this._deferredCnt === 0) { - if (this._deferredEvent !== null) { - this._deferredEvent.rawContentChangedEvent.resultingSelection = resultingSelection; - const e = this._deferredEvent; - this._deferredEvent = null; - this._fastEmitter.fire(e); - this._slowEmitter.fire(e); - } - } - } - fire(e) { - if (this._deferredCnt > 0) { - if (this._deferredEvent) { - this._deferredEvent = this._deferredEvent.merge(e); - } - else { - this._deferredEvent = e; - } - return; - } - this._fastEmitter.fire(e); - this._slowEmitter.fire(e); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModelEvents.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/textModelEvents.js ***! - \**********************************************************************************/ -/*! exports provided: ModelRawFlush, ModelRawLineChanged, ModelRawLinesDeleted, ModelRawLinesInserted, ModelRawEOLChanged, ModelRawContentChangedEvent, InternalModelContentChangeEvent */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModelRawFlush", function() { return ModelRawFlush; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModelRawLineChanged", function() { return ModelRawLineChanged; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModelRawLinesDeleted", function() { return ModelRawLinesDeleted; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModelRawLinesInserted", function() { return ModelRawLinesInserted; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModelRawEOLChanged", function() { return ModelRawEOLChanged; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModelRawContentChangedEvent", function() { return ModelRawContentChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InternalModelContentChangeEvent", function() { return InternalModelContentChangeEvent; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * An event describing that a model has been reset to a new value. - * @internal - */ -class ModelRawFlush { - constructor() { - this.changeType = 1 /* Flush */; - } -} -/** - * An event describing that a line has changed in a model. - * @internal - */ -class ModelRawLineChanged { - constructor(lineNumber, detail) { - this.changeType = 2 /* LineChanged */; - this.lineNumber = lineNumber; - this.detail = detail; - } -} -/** - * An event describing that line(s) have been deleted in a model. - * @internal - */ -class ModelRawLinesDeleted { - constructor(fromLineNumber, toLineNumber) { - this.changeType = 3 /* LinesDeleted */; - this.fromLineNumber = fromLineNumber; - this.toLineNumber = toLineNumber; - } -} -/** - * An event describing that line(s) have been inserted in a model. - * @internal - */ -class ModelRawLinesInserted { - constructor(fromLineNumber, toLineNumber, detail) { - this.changeType = 4 /* LinesInserted */; - this.fromLineNumber = fromLineNumber; - this.toLineNumber = toLineNumber; - this.detail = detail; - } -} -/** - * An event describing that a model has had its EOL changed. - * @internal - */ -class ModelRawEOLChanged { - constructor() { - this.changeType = 5 /* EOLChanged */; - } -} -/** - * An event describing a change in the text of a model. - * @internal - */ -class ModelRawContentChangedEvent { - constructor(changes, versionId, isUndoing, isRedoing) { - this.changes = changes; - this.versionId = versionId; - this.isUndoing = isUndoing; - this.isRedoing = isRedoing; - this.resultingSelection = null; - } - containsEvent(type) { - for (let i = 0, len = this.changes.length; i < len; i++) { - const change = this.changes[i]; - if (change.changeType === type) { - return true; - } - } - return false; - } - static merge(a, b) { - const changes = [].concat(a.changes).concat(b.changes); - const versionId = b.versionId; - const isUndoing = (a.isUndoing || b.isUndoing); - const isRedoing = (a.isRedoing || b.isRedoing); - return new ModelRawContentChangedEvent(changes, versionId, isUndoing, isRedoing); - } -} -/** - * @internal - */ -class InternalModelContentChangeEvent { - constructor(rawContentChangedEvent, contentChangedEvent) { - this.rawContentChangedEvent = rawContentChangedEvent; - this.contentChangedEvent = contentChangedEvent; - } - merge(other) { - const rawContentChangedEvent = ModelRawContentChangedEvent.merge(this.rawContentChangedEvent, other.rawContentChangedEvent); - const contentChangedEvent = InternalModelContentChangeEvent._mergeChangeEvents(this.contentChangedEvent, other.contentChangedEvent); - return new InternalModelContentChangeEvent(rawContentChangedEvent, contentChangedEvent); - } - static _mergeChangeEvents(a, b) { - const changes = [].concat(a.changes).concat(b.changes); - const eol = b.eol; - const versionId = b.versionId; - const isUndoing = (a.isUndoing || b.isUndoing); - const isRedoing = (a.isRedoing || b.isRedoing); - const isFlush = (a.isFlush || b.isFlush); - return { - changes: changes, - eol: eol, - versionId: versionId, - isUndoing: isUndoing, - isRedoing: isRedoing, - isFlush: isFlush - }; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModelSearch.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/textModelSearch.js ***! - \**********************************************************************************/ -/*! exports provided: SearchParams, isMultilineRegexSource, SearchData, createFindMatch, TextModelSearch, isValidMatch, Searcher */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SearchParams", function() { return SearchParams; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMultilineRegexSource", function() { return isMultilineRegexSource; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SearchData", function() { return SearchData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFindMatch", function() { return createFindMatch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextModelSearch", function() { return TextModelSearch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidMatch", function() { return isValidMatch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Searcher", function() { return Searcher; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _controller_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../controller/wordCharacterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/wordCharacterClassifier.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -const LIMIT_FIND_COUNT = 999; -class SearchParams { - constructor(searchString, isRegex, matchCase, wordSeparators) { - this.searchString = searchString; - this.isRegex = isRegex; - this.matchCase = matchCase; - this.wordSeparators = wordSeparators; - } - parseSearchRequest() { - if (this.searchString === '') { - return null; - } - // Try to create a RegExp out of the params - let multiline; - if (this.isRegex) { - multiline = isMultilineRegexSource(this.searchString); - } - else { - multiline = (this.searchString.indexOf('\n') >= 0); - } - let regex = null; - try { - regex = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["createRegExp"](this.searchString, this.isRegex, { - matchCase: this.matchCase, - wholeWord: false, - multiline: multiline, - global: true, - unicode: true - }); - } - catch (err) { - return null; - } - if (!regex) { - return null; - } - let canUseSimpleSearch = (!this.isRegex && !multiline); - if (canUseSimpleSearch && this.searchString.toLowerCase() !== this.searchString.toUpperCase()) { - // casing might make a difference - canUseSimpleSearch = this.matchCase; - } - return new SearchData(regex, this.wordSeparators ? Object(_controller_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_1__["getMapForWordSeparators"])(this.wordSeparators) : null, canUseSimpleSearch ? this.searchString : null); - } -} -function isMultilineRegexSource(searchString) { - if (!searchString || searchString.length === 0) { - return false; - } - for (let i = 0, len = searchString.length; i < len; i++) { - const chCode = searchString.charCodeAt(i); - if (chCode === 92 /* Backslash */) { - // move to next char - i++; - if (i >= len) { - // string ends with a \ - break; - } - const nextChCode = searchString.charCodeAt(i); - if (nextChCode === 110 /* n */ || nextChCode === 114 /* r */ || nextChCode === 87 /* W */ || nextChCode === 119 /* w */) { - return true; - } - } - } - return false; -} -class SearchData { - constructor(regex, wordSeparators, simpleSearch) { - this.regex = regex; - this.wordSeparators = wordSeparators; - this.simpleSearch = simpleSearch; - } -} -function createFindMatch(range, rawMatches, captureMatches) { - if (!captureMatches) { - return new _model_js__WEBPACK_IMPORTED_MODULE_4__["FindMatch"](range, null); - } - let matches = []; - for (let i = 0, len = rawMatches.length; i < len; i++) { - matches[i] = rawMatches[i]; - } - return new _model_js__WEBPACK_IMPORTED_MODULE_4__["FindMatch"](range, matches); -} -class LineFeedCounter { - constructor(text) { - let lineFeedsOffsets = []; - let lineFeedsOffsetsLen = 0; - for (let i = 0, textLen = text.length; i < textLen; i++) { - if (text.charCodeAt(i) === 10 /* LineFeed */) { - lineFeedsOffsets[lineFeedsOffsetsLen++] = i; - } - } - this._lineFeedsOffsets = lineFeedsOffsets; - } - findLineFeedCountBeforeOffset(offset) { - const lineFeedsOffsets = this._lineFeedsOffsets; - let min = 0; - let max = lineFeedsOffsets.length - 1; - if (max === -1) { - // no line feeds - return 0; - } - if (offset <= lineFeedsOffsets[0]) { - // before first line feed - return 0; - } - while (min < max) { - const mid = min + ((max - min) / 2 >> 0); - if (lineFeedsOffsets[mid] >= offset) { - max = mid - 1; - } - else { - if (lineFeedsOffsets[mid + 1] >= offset) { - // bingo! - min = mid; - max = mid; - } - else { - min = mid + 1; - } - } - } - return min + 1; - } -} -class TextModelSearch { - static findMatches(model, searchParams, searchRange, captureMatches, limitResultCount) { - const searchData = searchParams.parseSearchRequest(); - if (!searchData) { - return []; - } - if (searchData.regex.multiline) { - return this._doFindMatchesMultiline(model, searchRange, new Searcher(searchData.wordSeparators, searchData.regex), captureMatches, limitResultCount); - } - return this._doFindMatchesLineByLine(model, searchRange, searchData, captureMatches, limitResultCount); - } - /** - * Multiline search always executes on the lines concatenated with \n. - * We must therefore compensate for the count of \n in case the model is CRLF - */ - static _getMultilineMatchRange(model, deltaOffset, text, lfCounter, matchIndex, match0) { - let startOffset; - let lineFeedCountBeforeMatch = 0; - if (lfCounter) { - lineFeedCountBeforeMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex); - startOffset = deltaOffset + matchIndex + lineFeedCountBeforeMatch /* add as many \r as there were \n */; - } - else { - startOffset = deltaOffset + matchIndex; - } - let endOffset; - if (lfCounter) { - let lineFeedCountBeforeEndOfMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex + match0.length); - let lineFeedCountInMatch = lineFeedCountBeforeEndOfMatch - lineFeedCountBeforeMatch; - endOffset = startOffset + match0.length + lineFeedCountInMatch /* add as many \r as there were \n */; - } - else { - endOffset = startOffset + match0.length; - } - const startPosition = model.getPositionAt(startOffset); - const endPosition = model.getPositionAt(endOffset); - return new _core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column); - } - static _doFindMatchesMultiline(model, searchRange, searcher, captureMatches, limitResultCount) { - const deltaOffset = model.getOffsetAt(searchRange.getStartPosition()); - // We always execute multiline search over the lines joined with \n - // This makes it that \n will match the EOL for both CRLF and LF models - // We compensate for offset errors in `_getMultilineMatchRange` - const text = model.getValueInRange(searchRange, 1 /* LF */); - const lfCounter = (model.getEOL() === '\r\n' ? new LineFeedCounter(text) : null); - const result = []; - let counter = 0; - let m; - searcher.reset(0); - while ((m = searcher.next(text))) { - result[counter++] = createFindMatch(this._getMultilineMatchRange(model, deltaOffset, text, lfCounter, m.index, m[0]), m, captureMatches); - if (counter >= limitResultCount) { - return result; - } - } - return result; - } - static _doFindMatchesLineByLine(model, searchRange, searchData, captureMatches, limitResultCount) { - const result = []; - let resultLen = 0; - // Early case for a search range that starts & stops on the same line number - if (searchRange.startLineNumber === searchRange.endLineNumber) { - const text = model.getLineContent(searchRange.startLineNumber).substring(searchRange.startColumn - 1, searchRange.endColumn - 1); - resultLen = this._findMatchesInLine(searchData, text, searchRange.startLineNumber, searchRange.startColumn - 1, resultLen, result, captureMatches, limitResultCount); - return result; - } - // Collect results from first line - const text = model.getLineContent(searchRange.startLineNumber).substring(searchRange.startColumn - 1); - resultLen = this._findMatchesInLine(searchData, text, searchRange.startLineNumber, searchRange.startColumn - 1, resultLen, result, captureMatches, limitResultCount); - // Collect results from middle lines - for (let lineNumber = searchRange.startLineNumber + 1; lineNumber < searchRange.endLineNumber && resultLen < limitResultCount; lineNumber++) { - resultLen = this._findMatchesInLine(searchData, model.getLineContent(lineNumber), lineNumber, 0, resultLen, result, captureMatches, limitResultCount); - } - // Collect results from last line - if (resultLen < limitResultCount) { - const text = model.getLineContent(searchRange.endLineNumber).substring(0, searchRange.endColumn - 1); - resultLen = this._findMatchesInLine(searchData, text, searchRange.endLineNumber, 0, resultLen, result, captureMatches, limitResultCount); - } - return result; - } - static _findMatchesInLine(searchData, text, lineNumber, deltaOffset, resultLen, result, captureMatches, limitResultCount) { - const wordSeparators = searchData.wordSeparators; - if (!captureMatches && searchData.simpleSearch) { - const searchString = searchData.simpleSearch; - const searchStringLen = searchString.length; - const textLength = text.length; - let lastMatchIndex = -searchStringLen; - while ((lastMatchIndex = text.indexOf(searchString, lastMatchIndex + searchStringLen)) !== -1) { - if (!wordSeparators || isValidMatch(wordSeparators, text, textLength, lastMatchIndex, searchStringLen)) { - result[resultLen++] = new _model_js__WEBPACK_IMPORTED_MODULE_4__["FindMatch"](new _core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](lineNumber, lastMatchIndex + 1 + deltaOffset, lineNumber, lastMatchIndex + 1 + searchStringLen + deltaOffset), null); - if (resultLen >= limitResultCount) { - return resultLen; - } - } - } - return resultLen; - } - const searcher = new Searcher(searchData.wordSeparators, searchData.regex); - let m; - // Reset regex to search from the beginning - searcher.reset(0); - do { - m = searcher.next(text); - if (m) { - result[resultLen++] = createFindMatch(new _core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](lineNumber, m.index + 1 + deltaOffset, lineNumber, m.index + 1 + m[0].length + deltaOffset), m, captureMatches); - if (resultLen >= limitResultCount) { - return resultLen; - } - } - } while (m); - return resultLen; - } - static findNextMatch(model, searchParams, searchStart, captureMatches) { - const searchData = searchParams.parseSearchRequest(); - if (!searchData) { - return null; - } - const searcher = new Searcher(searchData.wordSeparators, searchData.regex); - if (searchData.regex.multiline) { - return this._doFindNextMatchMultiline(model, searchStart, searcher, captureMatches); - } - return this._doFindNextMatchLineByLine(model, searchStart, searcher, captureMatches); - } - static _doFindNextMatchMultiline(model, searchStart, searcher, captureMatches) { - const searchTextStart = new _core_position_js__WEBPACK_IMPORTED_MODULE_2__["Position"](searchStart.lineNumber, 1); - const deltaOffset = model.getOffsetAt(searchTextStart); - const lineCount = model.getLineCount(); - // We always execute multiline search over the lines joined with \n - // This makes it that \n will match the EOL for both CRLF and LF models - // We compensate for offset errors in `_getMultilineMatchRange` - const text = model.getValueInRange(new _core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](searchTextStart.lineNumber, searchTextStart.column, lineCount, model.getLineMaxColumn(lineCount)), 1 /* LF */); - const lfCounter = (model.getEOL() === '\r\n' ? new LineFeedCounter(text) : null); - searcher.reset(searchStart.column - 1); - let m = searcher.next(text); - if (m) { - return createFindMatch(this._getMultilineMatchRange(model, deltaOffset, text, lfCounter, m.index, m[0]), m, captureMatches); - } - if (searchStart.lineNumber !== 1 || searchStart.column !== 1) { - // Try again from the top - return this._doFindNextMatchMultiline(model, new _core_position_js__WEBPACK_IMPORTED_MODULE_2__["Position"](1, 1), searcher, captureMatches); - } - return null; - } - static _doFindNextMatchLineByLine(model, searchStart, searcher, captureMatches) { - const lineCount = model.getLineCount(); - const startLineNumber = searchStart.lineNumber; - // Look in first line - const text = model.getLineContent(startLineNumber); - const r = this._findFirstMatchInLine(searcher, text, startLineNumber, searchStart.column, captureMatches); - if (r) { - return r; - } - for (let i = 1; i <= lineCount; i++) { - const lineIndex = (startLineNumber + i - 1) % lineCount; - const text = model.getLineContent(lineIndex + 1); - const r = this._findFirstMatchInLine(searcher, text, lineIndex + 1, 1, captureMatches); - if (r) { - return r; - } - } - return null; - } - static _findFirstMatchInLine(searcher, text, lineNumber, fromColumn, captureMatches) { - // Set regex to search from column - searcher.reset(fromColumn - 1); - const m = searcher.next(text); - if (m) { - return createFindMatch(new _core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](lineNumber, m.index + 1, lineNumber, m.index + 1 + m[0].length), m, captureMatches); - } - return null; - } - static findPreviousMatch(model, searchParams, searchStart, captureMatches) { - const searchData = searchParams.parseSearchRequest(); - if (!searchData) { - return null; - } - const searcher = new Searcher(searchData.wordSeparators, searchData.regex); - if (searchData.regex.multiline) { - return this._doFindPreviousMatchMultiline(model, searchStart, searcher, captureMatches); - } - return this._doFindPreviousMatchLineByLine(model, searchStart, searcher, captureMatches); - } - static _doFindPreviousMatchMultiline(model, searchStart, searcher, captureMatches) { - const matches = this._doFindMatchesMultiline(model, new _core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](1, 1, searchStart.lineNumber, searchStart.column), searcher, captureMatches, 10 * LIMIT_FIND_COUNT); - if (matches.length > 0) { - return matches[matches.length - 1]; - } - const lineCount = model.getLineCount(); - if (searchStart.lineNumber !== lineCount || searchStart.column !== model.getLineMaxColumn(lineCount)) { - // Try again with all content - return this._doFindPreviousMatchMultiline(model, new _core_position_js__WEBPACK_IMPORTED_MODULE_2__["Position"](lineCount, model.getLineMaxColumn(lineCount)), searcher, captureMatches); - } - return null; - } - static _doFindPreviousMatchLineByLine(model, searchStart, searcher, captureMatches) { - const lineCount = model.getLineCount(); - const startLineNumber = searchStart.lineNumber; - // Look in first line - const text = model.getLineContent(startLineNumber).substring(0, searchStart.column - 1); - const r = this._findLastMatchInLine(searcher, text, startLineNumber, captureMatches); - if (r) { - return r; - } - for (let i = 1; i <= lineCount; i++) { - const lineIndex = (lineCount + startLineNumber - i - 1) % lineCount; - const text = model.getLineContent(lineIndex + 1); - const r = this._findLastMatchInLine(searcher, text, lineIndex + 1, captureMatches); - if (r) { - return r; - } - } - return null; - } - static _findLastMatchInLine(searcher, text, lineNumber, captureMatches) { - let bestResult = null; - let m; - searcher.reset(0); - while ((m = searcher.next(text))) { - bestResult = createFindMatch(new _core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](lineNumber, m.index + 1, lineNumber, m.index + 1 + m[0].length), m, captureMatches); - } - return bestResult; - } -} -function leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) { - if (matchStartIndex === 0) { - // Match starts at start of string - return true; - } - const charBefore = text.charCodeAt(matchStartIndex - 1); - if (wordSeparators.get(charBefore) !== 0 /* Regular */) { - // The character before the match is a word separator - return true; - } - if (charBefore === 13 /* CarriageReturn */ || charBefore === 10 /* LineFeed */) { - // The character before the match is line break or carriage return. - return true; - } - if (matchLength > 0) { - const firstCharInMatch = text.charCodeAt(matchStartIndex); - if (wordSeparators.get(firstCharInMatch) !== 0 /* Regular */) { - // The first character inside the match is a word separator - return true; - } - } - return false; -} -function rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) { - if (matchStartIndex + matchLength === textLength) { - // Match ends at end of string - return true; - } - const charAfter = text.charCodeAt(matchStartIndex + matchLength); - if (wordSeparators.get(charAfter) !== 0 /* Regular */) { - // The character after the match is a word separator - return true; - } - if (charAfter === 13 /* CarriageReturn */ || charAfter === 10 /* LineFeed */) { - // The character after the match is line break or carriage return. - return true; - } - if (matchLength > 0) { - const lastCharInMatch = text.charCodeAt(matchStartIndex + matchLength - 1); - if (wordSeparators.get(lastCharInMatch) !== 0 /* Regular */) { - // The last character in the match is a word separator - return true; - } - } - return false; -} -function isValidMatch(wordSeparators, text, textLength, matchStartIndex, matchLength) { - return (leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) - && rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength)); -} -class Searcher { - constructor(wordSeparators, searchRegex) { - this._wordSeparators = wordSeparators; - this._searchRegex = searchRegex; - this._prevMatchStartIndex = -1; - this._prevMatchLength = 0; - } - reset(lastIndex) { - this._searchRegex.lastIndex = lastIndex; - this._prevMatchStartIndex = -1; - this._prevMatchLength = 0; - } - next(text) { - const textLength = text.length; - let m; - do { - if (this._prevMatchStartIndex + this._prevMatchLength === textLength) { - // Reached the end of the line - return null; - } - m = this._searchRegex.exec(text); - if (!m) { - return null; - } - const matchStartIndex = m.index; - const matchLength = m[0].length; - if (matchStartIndex === this._prevMatchStartIndex && matchLength === this._prevMatchLength) { - if (matchLength === 0) { - // the search result is an empty string and won't advance `regex.lastIndex`, so `regex.exec` will stuck here - // we attempt to recover from that by advancing by two if surrogate pair found and by one otherwise - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["getNextCodePoint"](text, textLength, this._searchRegex.lastIndex) > 0xFFFF) { - this._searchRegex.lastIndex += 2; - } - else { - this._searchRegex.lastIndex += 1; - } - continue; - } - // Exit early if the regex matches the same range twice - return null; - } - this._prevMatchStartIndex = matchStartIndex; - this._prevMatchLength = matchLength; - if (!this._wordSeparators || isValidMatch(this._wordSeparators, text, textLength, matchStartIndex, matchLength)) { - return m; - } - } while (m); - return null; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModelTokens.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/textModelTokens.js ***! - \**********************************************************************************/ -/*! exports provided: TokenizationStateStore, TextModelTokenization */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationStateStore", function() { return TokenizationStateStore; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextModelTokenization", function() { return TextModelTokenization; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _core_lineTokens_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/lineTokens.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/lineTokens.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _modes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _modes_nullMode_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modes/nullMode.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/nullMode.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_stopwatch_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/stopwatch.js */ "./node_modules/monaco-editor/esm/vs/base/common/stopwatch.js"); -/* harmony import */ var _tokensStore_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./tokensStore.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/tokensStore.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - -class TokenizationStateStore { - constructor() { - this._beginState = []; - this._valid = []; - this._len = 0; - this._invalidLineStartIndex = 0; - } - _reset(initialState) { - this._beginState = []; - this._valid = []; - this._len = 0; - this._invalidLineStartIndex = 0; - if (initialState) { - this._setBeginState(0, initialState); - } - } - flush(initialState) { - this._reset(initialState); - } - get invalidLineStartIndex() { - return this._invalidLineStartIndex; - } - _invalidateLine(lineIndex) { - if (lineIndex < this._len) { - this._valid[lineIndex] = false; - } - if (lineIndex < this._invalidLineStartIndex) { - this._invalidLineStartIndex = lineIndex; - } - } - _isValid(lineIndex) { - if (lineIndex < this._len) { - return this._valid[lineIndex]; - } - return false; - } - getBeginState(lineIndex) { - if (lineIndex < this._len) { - return this._beginState[lineIndex]; - } - return null; - } - _ensureLine(lineIndex) { - while (lineIndex >= this._len) { - this._beginState[this._len] = null; - this._valid[this._len] = false; - this._len++; - } - } - _deleteLines(start, deleteCount) { - if (deleteCount === 0) { - return; - } - if (start + deleteCount > this._len) { - deleteCount = this._len - start; - } - this._beginState.splice(start, deleteCount); - this._valid.splice(start, deleteCount); - this._len -= deleteCount; - } - _insertLines(insertIndex, insertCount) { - if (insertCount === 0) { - return; - } - let beginState = []; - let valid = []; - for (let i = 0; i < insertCount; i++) { - beginState[i] = null; - valid[i] = false; - } - this._beginState = _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["arrayInsert"](this._beginState, insertIndex, beginState); - this._valid = _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["arrayInsert"](this._valid, insertIndex, valid); - this._len += insertCount; - } - _setValid(lineIndex, valid) { - this._ensureLine(lineIndex); - this._valid[lineIndex] = valid; - } - _setBeginState(lineIndex, beginState) { - this._ensureLine(lineIndex); - this._beginState[lineIndex] = beginState; - } - setEndState(linesLength, lineIndex, endState) { - this._setValid(lineIndex, true); - this._invalidLineStartIndex = lineIndex + 1; - // Check if this was the last line - if (lineIndex === linesLength - 1) { - return; - } - // Check if the end state has changed - const previousEndState = this.getBeginState(lineIndex + 1); - if (previousEndState === null || !endState.equals(previousEndState)) { - this._setBeginState(lineIndex + 1, endState); - this._invalidateLine(lineIndex + 1); - return; - } - // Perhaps we can skip tokenizing some lines... - let i = lineIndex + 1; - while (i < linesLength) { - if (!this._isValid(i)) { - break; - } - i++; - } - this._invalidLineStartIndex = i; - } - setFakeTokens(lineIndex) { - this._setValid(lineIndex, false); - } - //#region Editing - applyEdits(range, eolCount) { - const deletingLinesCnt = range.endLineNumber - range.startLineNumber; - const insertingLinesCnt = eolCount; - const editingLinesCnt = Math.min(deletingLinesCnt, insertingLinesCnt); - for (let j = editingLinesCnt; j >= 0; j--) { - this._invalidateLine(range.startLineNumber + j - 1); - } - this._acceptDeleteRange(range); - this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](range.startLineNumber, range.startColumn), eolCount); - } - _acceptDeleteRange(range) { - const firstLineIndex = range.startLineNumber - 1; - if (firstLineIndex >= this._len) { - return; - } - this._deleteLines(range.startLineNumber, range.endLineNumber - range.startLineNumber); - } - _acceptInsertText(position, eolCount) { - const lineIndex = position.lineNumber - 1; - if (lineIndex >= this._len) { - return; - } - this._insertLines(position.lineNumber, eolCount); - } -} -class TextModelTokenization extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_6__["Disposable"] { - constructor(textModel) { - super(); - this._isDisposed = false; - this._textModel = textModel; - this._tokenizationStateStore = new TokenizationStateStore(); - this._tokenizationSupport = null; - this._register(_modes_js__WEBPACK_IMPORTED_MODULE_4__["TokenizationRegistry"].onDidChange((e) => { - const languageIdentifier = this._textModel.getLanguageIdentifier(); - if (e.changedLanguages.indexOf(languageIdentifier.language) === -1) { - return; - } - this._resetTokenizationState(); - this._textModel.clearTokens(); - })); - this._register(this._textModel.onDidChangeRawContentFast((e) => { - if (e.containsEvent(1 /* Flush */)) { - this._resetTokenizationState(); - return; - } - })); - this._register(this._textModel.onDidChangeContentFast((e) => { - for (let i = 0, len = e.changes.length; i < len; i++) { - const change = e.changes[i]; - const [eolCount] = Object(_tokensStore_js__WEBPACK_IMPORTED_MODULE_8__["countEOL"])(change.text); - this._tokenizationStateStore.applyEdits(change.range, eolCount); - } - this._beginBackgroundTokenization(); - })); - this._register(this._textModel.onDidChangeAttached(() => { - this._beginBackgroundTokenization(); - })); - this._register(this._textModel.onDidChangeLanguage(() => { - this._resetTokenizationState(); - this._textModel.clearTokens(); - })); - this._resetTokenizationState(); - } - dispose() { - this._isDisposed = true; - super.dispose(); - } - _resetTokenizationState() { - const [tokenizationSupport, initialState] = initializeTokenization(this._textModel); - this._tokenizationSupport = tokenizationSupport; - this._tokenizationStateStore.flush(initialState); - this._beginBackgroundTokenization(); - } - _beginBackgroundTokenization() { - if (this._textModel.isAttachedToEditor() && this._hasLinesToTokenize()) { - _base_common_platform_js__WEBPACK_IMPORTED_MODULE_9__["setImmediate"](() => { - if (this._isDisposed) { - // disposed in the meantime - return; - } - this._revalidateTokensNow(); - }); - } - } - _revalidateTokensNow(toLineNumber = this._textModel.getLineCount()) { - const MAX_ALLOWED_TIME = 1; - const builder = new _tokensStore_js__WEBPACK_IMPORTED_MODULE_8__["MultilineTokensBuilder"](); - const sw = _base_common_stopwatch_js__WEBPACK_IMPORTED_MODULE_7__["StopWatch"].create(false); - while (this._hasLinesToTokenize()) { - if (sw.elapsed() > MAX_ALLOWED_TIME) { - // Stop if MAX_ALLOWED_TIME is reached - break; - } - const tokenizedLineNumber = this._tokenizeOneInvalidLine(builder); - if (tokenizedLineNumber >= toLineNumber) { - break; - } - } - this._beginBackgroundTokenization(); - this._textModel.setTokens(builder.tokens); - } - tokenizeViewport(startLineNumber, endLineNumber) { - const builder = new _tokensStore_js__WEBPACK_IMPORTED_MODULE_8__["MultilineTokensBuilder"](); - this._tokenizeViewport(builder, startLineNumber, endLineNumber); - this._textModel.setTokens(builder.tokens); - } - reset() { - this._resetTokenizationState(); - this._textModel.clearTokens(); - } - forceTokenization(lineNumber) { - const builder = new _tokensStore_js__WEBPACK_IMPORTED_MODULE_8__["MultilineTokensBuilder"](); - this._updateTokensUntilLine(builder, lineNumber); - this._textModel.setTokens(builder.tokens); - } - isCheapToTokenize(lineNumber) { - if (!this._tokenizationSupport) { - return true; - } - const firstInvalidLineNumber = this._tokenizationStateStore.invalidLineStartIndex + 1; - if (lineNumber > firstInvalidLineNumber) { - return false; - } - if (lineNumber < firstInvalidLineNumber) { - return true; - } - if (this._textModel.getLineLength(lineNumber) < 2048 /* CHEAP_TOKENIZATION_LENGTH_LIMIT */) { - return true; - } - return false; - } - _hasLinesToTokenize() { - if (!this._tokenizationSupport) { - return false; - } - return (this._tokenizationStateStore.invalidLineStartIndex < this._textModel.getLineCount()); - } - _tokenizeOneInvalidLine(builder) { - if (!this._hasLinesToTokenize()) { - return this._textModel.getLineCount() + 1; - } - const lineNumber = this._tokenizationStateStore.invalidLineStartIndex + 1; - this._updateTokensUntilLine(builder, lineNumber); - return lineNumber; - } - _updateTokensUntilLine(builder, lineNumber) { - if (!this._tokenizationSupport) { - return; - } - const languageIdentifier = this._textModel.getLanguageIdentifier(); - const linesLength = this._textModel.getLineCount(); - const endLineIndex = lineNumber - 1; - // Validate all states up to and including endLineIndex - for (let lineIndex = this._tokenizationStateStore.invalidLineStartIndex; lineIndex <= endLineIndex; lineIndex++) { - const text = this._textModel.getLineContent(lineIndex + 1); - const lineStartState = this._tokenizationStateStore.getBeginState(lineIndex); - const r = safeTokenize(languageIdentifier, this._tokenizationSupport, text, lineStartState); - builder.add(lineIndex + 1, r.tokens); - this._tokenizationStateStore.setEndState(linesLength, lineIndex, r.endState); - lineIndex = this._tokenizationStateStore.invalidLineStartIndex - 1; // -1 because the outer loop increments it - } - } - _tokenizeViewport(builder, startLineNumber, endLineNumber) { - if (!this._tokenizationSupport) { - // nothing to do - return; - } - if (endLineNumber <= this._tokenizationStateStore.invalidLineStartIndex) { - // nothing to do - return; - } - if (startLineNumber <= this._tokenizationStateStore.invalidLineStartIndex) { - // tokenization has reached the viewport start... - this._updateTokensUntilLine(builder, endLineNumber); - return; - } - let nonWhitespaceColumn = this._textModel.getLineFirstNonWhitespaceColumn(startLineNumber); - let fakeLines = []; - let initialState = null; - for (let i = startLineNumber - 1; nonWhitespaceColumn > 0 && i >= 1; i--) { - let newNonWhitespaceIndex = this._textModel.getLineFirstNonWhitespaceColumn(i); - if (newNonWhitespaceIndex === 0) { - continue; - } - if (newNonWhitespaceIndex < nonWhitespaceColumn) { - initialState = this._tokenizationStateStore.getBeginState(i - 1); - if (initialState) { - break; - } - fakeLines.push(this._textModel.getLineContent(i)); - nonWhitespaceColumn = newNonWhitespaceIndex; - } - } - if (!initialState) { - initialState = this._tokenizationSupport.getInitialState(); - } - const languageIdentifier = this._textModel.getLanguageIdentifier(); - let state = initialState; - for (let i = fakeLines.length - 1; i >= 0; i--) { - let r = safeTokenize(languageIdentifier, this._tokenizationSupport, fakeLines[i], state); - state = r.endState; - } - for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { - let text = this._textModel.getLineContent(lineNumber); - let r = safeTokenize(languageIdentifier, this._tokenizationSupport, text, state); - builder.add(lineNumber, r.tokens); - this._tokenizationStateStore.setFakeTokens(lineNumber - 1); - state = r.endState; - } - } -} -function initializeTokenization(textModel) { - const languageIdentifier = textModel.getLanguageIdentifier(); - let tokenizationSupport = (textModel.isTooLargeForTokenization() - ? null - : _modes_js__WEBPACK_IMPORTED_MODULE_4__["TokenizationRegistry"].get(languageIdentifier.language)); - let initialState = null; - if (tokenizationSupport) { - try { - initialState = tokenizationSupport.getInitialState(); - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"])(e); - tokenizationSupport = null; - } - } - return [tokenizationSupport, initialState]; -} -function safeTokenize(languageIdentifier, tokenizationSupport, text, state) { - let r = null; - if (tokenizationSupport) { - try { - r = tokenizationSupport.tokenize2(text, state.clone(), 0); - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"])(e); - } - } - if (!r) { - r = Object(_modes_nullMode_js__WEBPACK_IMPORTED_MODULE_5__["nullTokenize2"])(languageIdentifier.id, text, state, 0); - } - _core_lineTokens_js__WEBPACK_IMPORTED_MODULE_2__["LineTokens"].convertToEndOffset(r.tokens, text.length); - return r; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/tokensStore.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/tokensStore.js ***! - \******************************************************************************/ -/*! exports provided: countEOL, MultilineTokensBuilder, SparseEncodedTokens, LineTokens2, MultilineTokens2, MultilineTokens, TokensStore2, TokensStore */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "countEOL", function() { return countEOL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultilineTokensBuilder", function() { return MultilineTokensBuilder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SparseEncodedTokens", function() { return SparseEncodedTokens; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineTokens2", function() { return LineTokens2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultilineTokens2", function() { return MultilineTokens2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultilineTokens", function() { return MultilineTokens; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokensStore2", function() { return TokensStore2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokensStore", function() { return TokensStore; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _core_lineTokens_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/lineTokens.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/lineTokens.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _modes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -function countEOL(text) { - let eolCount = 0; - let firstLineLength = 0; - let lastLineStart = 0; - let eol = 0 /* Unknown */; - for (let i = 0, len = text.length; i < len; i++) { - const chr = text.charCodeAt(i); - if (chr === 13 /* CarriageReturn */) { - if (eolCount === 0) { - firstLineLength = i; - } - eolCount++; - if (i + 1 < len && text.charCodeAt(i + 1) === 10 /* LineFeed */) { - // \r\n... case - eol |= 2 /* CRLF */; - i++; // skip \n - } - else { - // \r... case - eol |= 3 /* Invalid */; - } - lastLineStart = i + 1; - } - else if (chr === 10 /* LineFeed */) { - // \n... case - eol |= 1 /* LF */; - if (eolCount === 0) { - firstLineLength = i; - } - eolCount++; - lastLineStart = i + 1; - } - } - if (eolCount === 0) { - firstLineLength = text.length; - } - return [eolCount, firstLineLength, text.length - lastLineStart, eol]; -} -function getDefaultMetadata(topLevelLanguageId) { - return ((topLevelLanguageId << 0 /* LANGUAGEID_OFFSET */) - | (0 /* Other */ << 8 /* TOKEN_TYPE_OFFSET */) - | (0 /* None */ << 11 /* FONT_STYLE_OFFSET */) - | (1 /* DefaultForeground */ << 14 /* FOREGROUND_OFFSET */) - | (2 /* DefaultBackground */ << 23 /* BACKGROUND_OFFSET */)) >>> 0; -} -const EMPTY_LINE_TOKENS = (new Uint32Array(0)).buffer; -class MultilineTokensBuilder { - constructor() { - this.tokens = []; - } - add(lineNumber, lineTokens) { - if (this.tokens.length > 0) { - const last = this.tokens[this.tokens.length - 1]; - const lastLineNumber = last.startLineNumber + last.tokens.length - 1; - if (lastLineNumber + 1 === lineNumber) { - // append - last.tokens.push(lineTokens); - return; - } - } - this.tokens.push(new MultilineTokens(lineNumber, [lineTokens])); - } -} -class SparseEncodedTokens { - constructor(tokens) { - this._tokens = tokens; - this._tokenCount = tokens.length / 4; - } - toString(startLineNumber) { - let pieces = []; - for (let i = 0; i < this._tokenCount; i++) { - pieces.push(`(${this._getDeltaLine(i) + startLineNumber},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`); - } - return `[${pieces.join(',')}]`; - } - getMaxDeltaLine() { - const tokenCount = this._getTokenCount(); - if (tokenCount === 0) { - return -1; - } - return this._getDeltaLine(tokenCount - 1); - } - getRange() { - const tokenCount = this._getTokenCount(); - if (tokenCount === 0) { - return null; - } - const startChar = this._getStartCharacter(0); - const maxDeltaLine = this._getDeltaLine(tokenCount - 1); - const endChar = this._getEndCharacter(tokenCount - 1); - return new _core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](0, startChar + 1, maxDeltaLine, endChar + 1); - } - _getTokenCount() { - return this._tokenCount; - } - _getDeltaLine(tokenIndex) { - return this._tokens[4 * tokenIndex]; - } - _getStartCharacter(tokenIndex) { - return this._tokens[4 * tokenIndex + 1]; - } - _getEndCharacter(tokenIndex) { - return this._tokens[4 * tokenIndex + 2]; - } - isEmpty() { - return (this._getTokenCount() === 0); - } - getLineTokens(deltaLine) { - let low = 0; - let high = this._getTokenCount() - 1; - while (low < high) { - const mid = low + Math.floor((high - low) / 2); - const midDeltaLine = this._getDeltaLine(mid); - if (midDeltaLine < deltaLine) { - low = mid + 1; - } - else if (midDeltaLine > deltaLine) { - high = mid - 1; - } - else { - let min = mid; - while (min > low && this._getDeltaLine(min - 1) === deltaLine) { - min--; - } - let max = mid; - while (max < high && this._getDeltaLine(max + 1) === deltaLine) { - max++; - } - return new LineTokens2(this._tokens.subarray(4 * min, 4 * max + 4)); - } - } - if (this._getDeltaLine(low) === deltaLine) { - return new LineTokens2(this._tokens.subarray(4 * low, 4 * low + 4)); - } - return null; - } - clear() { - this._tokenCount = 0; - } - removeTokens(startDeltaLine, startChar, endDeltaLine, endChar) { - const tokens = this._tokens; - const tokenCount = this._tokenCount; - let newTokenCount = 0; - let hasDeletedTokens = false; - let firstDeltaLine = 0; - for (let i = 0; i < tokenCount; i++) { - const srcOffset = 4 * i; - const tokenDeltaLine = tokens[srcOffset]; - const tokenStartCharacter = tokens[srcOffset + 1]; - const tokenEndCharacter = tokens[srcOffset + 2]; - const tokenMetadata = tokens[srcOffset + 3]; - if ((tokenDeltaLine > startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar)) - && (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar))) { - hasDeletedTokens = true; - } - else { - if (newTokenCount === 0) { - firstDeltaLine = tokenDeltaLine; - } - if (hasDeletedTokens) { - // must move the token to the left - const destOffset = 4 * newTokenCount; - tokens[destOffset] = tokenDeltaLine - firstDeltaLine; - tokens[destOffset + 1] = tokenStartCharacter; - tokens[destOffset + 2] = tokenEndCharacter; - tokens[destOffset + 3] = tokenMetadata; - } - newTokenCount++; - } - } - this._tokenCount = newTokenCount; - return firstDeltaLine; - } - split(startDeltaLine, startChar, endDeltaLine, endChar) { - const tokens = this._tokens; - const tokenCount = this._tokenCount; - let aTokens = []; - let bTokens = []; - let destTokens = aTokens; - let destOffset = 0; - let destFirstDeltaLine = 0; - for (let i = 0; i < tokenCount; i++) { - const srcOffset = 4 * i; - const tokenDeltaLine = tokens[srcOffset]; - const tokenStartCharacter = tokens[srcOffset + 1]; - const tokenEndCharacter = tokens[srcOffset + 2]; - const tokenMetadata = tokens[srcOffset + 3]; - if ((tokenDeltaLine > startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter >= startChar))) { - if ((tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter <= endChar))) { - // this token is touching the range - continue; - } - else { - // this token is after the range - if (destTokens !== bTokens) { - // this token is the first token after the range - destTokens = bTokens; - destOffset = 0; - destFirstDeltaLine = tokenDeltaLine; - } - } - } - destTokens[destOffset++] = tokenDeltaLine - destFirstDeltaLine; - destTokens[destOffset++] = tokenStartCharacter; - destTokens[destOffset++] = tokenEndCharacter; - destTokens[destOffset++] = tokenMetadata; - } - return [new SparseEncodedTokens(new Uint32Array(aTokens)), new SparseEncodedTokens(new Uint32Array(bTokens)), destFirstDeltaLine]; - } - acceptDeleteRange(horizontalShiftForFirstLineTokens, startDeltaLine, startCharacter, endDeltaLine, endCharacter) { - // This is a bit complex, here are the cases I used to think about this: - // - // 1. The token starts before the deletion range - // 1a. The token is completely before the deletion range - // ----------- - // xxxxxxxxxxx - // 1b. The token starts before, the deletion range ends after the token - // ----------- - // xxxxxxxxxxx - // 1c. The token starts before, the deletion range ends precisely with the token - // --------------- - // xxxxxxxx - // 1d. The token starts before, the deletion range is inside the token - // --------------- - // xxxxx - // - // 2. The token starts at the same position with the deletion range - // 2a. The token starts at the same position, and ends inside the deletion range - // ------- - // xxxxxxxxxxx - // 2b. The token starts at the same position, and ends at the same position as the deletion range - // ---------- - // xxxxxxxxxx - // 2c. The token starts at the same position, and ends after the deletion range - // ------------- - // xxxxxxx - // - // 3. The token starts inside the deletion range - // 3a. The token is inside the deletion range - // ------- - // xxxxxxxxxxxxx - // 3b. The token starts inside the deletion range, and ends at the same position as the deletion range - // ---------- - // xxxxxxxxxxxxx - // 3c. The token starts inside the deletion range, and ends after the deletion range - // ------------ - // xxxxxxxxxxx - // - // 4. The token starts after the deletion range - // ----------- - // xxxxxxxx - // - const tokens = this._tokens; - const tokenCount = this._tokenCount; - const deletedLineCount = (endDeltaLine - startDeltaLine); - let newTokenCount = 0; - let hasDeletedTokens = false; - for (let i = 0; i < tokenCount; i++) { - const srcOffset = 4 * i; - let tokenDeltaLine = tokens[srcOffset]; - let tokenStartCharacter = tokens[srcOffset + 1]; - let tokenEndCharacter = tokens[srcOffset + 2]; - const tokenMetadata = tokens[srcOffset + 3]; - if (tokenDeltaLine < startDeltaLine || (tokenDeltaLine === startDeltaLine && tokenEndCharacter <= startCharacter)) { - // 1a. The token is completely before the deletion range - // => nothing to do - newTokenCount++; - continue; - } - else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter < startCharacter) { - // 1b, 1c, 1d - // => the token survives, but it needs to shrink - if (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) { - // 1d. The token starts before, the deletion range is inside the token - // => the token shrinks by the deletion character count - tokenEndCharacter -= (endCharacter - startCharacter); - } - else { - // 1b. The token starts before, the deletion range ends after the token - // 1c. The token starts before, the deletion range ends precisely with the token - // => the token shrinks its ending to the deletion start - tokenEndCharacter = startCharacter; - } - } - else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter === startCharacter) { - // 2a, 2b, 2c - if (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) { - // 2c. The token starts at the same position, and ends after the deletion range - // => the token shrinks by the deletion character count - tokenEndCharacter -= (endCharacter - startCharacter); - } - else { - // 2a. The token starts at the same position, and ends inside the deletion range - // 2b. The token starts at the same position, and ends at the same position as the deletion range - // => the token is deleted - hasDeletedTokens = true; - continue; - } - } - else if (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter < endCharacter)) { - // 3a, 3b, 3c - if (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) { - // 3c. The token starts inside the deletion range, and ends after the deletion range - // => the token moves left and shrinks - if (tokenDeltaLine === startDeltaLine) { - // the deletion started on the same line as the token - // => the token moves left and shrinks - tokenStartCharacter = startCharacter; - tokenEndCharacter = tokenStartCharacter + (tokenEndCharacter - endCharacter); - } - else { - // the deletion started on a line above the token - // => the token moves to the beginning of the line - tokenStartCharacter = 0; - tokenEndCharacter = tokenStartCharacter + (tokenEndCharacter - endCharacter); - } - } - else { - // 3a. The token is inside the deletion range - // 3b. The token starts inside the deletion range, and ends at the same position as the deletion range - // => the token is deleted - hasDeletedTokens = true; - continue; - } - } - else if (tokenDeltaLine > endDeltaLine) { - // 4. (partial) The token starts after the deletion range, on a line below... - if (deletedLineCount === 0 && !hasDeletedTokens) { - // early stop, there is no need to walk all the tokens and do nothing... - newTokenCount = tokenCount; - break; - } - tokenDeltaLine -= deletedLineCount; - } - else if (tokenDeltaLine === endDeltaLine && tokenStartCharacter >= endCharacter) { - // 4. (continued) The token starts after the deletion range, on the last line where a deletion occurs - if (horizontalShiftForFirstLineTokens && tokenDeltaLine === 0) { - tokenStartCharacter += horizontalShiftForFirstLineTokens; - tokenEndCharacter += horizontalShiftForFirstLineTokens; - } - tokenDeltaLine -= deletedLineCount; - tokenStartCharacter -= (endCharacter - startCharacter); - tokenEndCharacter -= (endCharacter - startCharacter); - } - else { - throw new Error(`Not possible!`); - } - const destOffset = 4 * newTokenCount; - tokens[destOffset] = tokenDeltaLine; - tokens[destOffset + 1] = tokenStartCharacter; - tokens[destOffset + 2] = tokenEndCharacter; - tokens[destOffset + 3] = tokenMetadata; - newTokenCount++; - } - this._tokenCount = newTokenCount; - } - acceptInsertText(deltaLine, character, eolCount, firstLineLength, lastLineLength, firstCharCode) { - // Here are the cases I used to think about this: - // - // 1. The token is completely before the insertion point - // ----------- | - // 2. The token ends precisely at the insertion point - // -----------| - // 3. The token contains the insertion point - // -----|------ - // 4. The token starts precisely at the insertion point - // |----------- - // 5. The token is completely after the insertion point - // | ----------- - // - const isInsertingPreciselyOneWordCharacter = (eolCount === 0 - && firstLineLength === 1 - && ((firstCharCode >= 48 /* Digit0 */ && firstCharCode <= 57 /* Digit9 */) - || (firstCharCode >= 65 /* A */ && firstCharCode <= 90 /* Z */) - || (firstCharCode >= 97 /* a */ && firstCharCode <= 122 /* z */))); - const tokens = this._tokens; - const tokenCount = this._tokenCount; - for (let i = 0; i < tokenCount; i++) { - const offset = 4 * i; - let tokenDeltaLine = tokens[offset]; - let tokenStartCharacter = tokens[offset + 1]; - let tokenEndCharacter = tokens[offset + 2]; - if (tokenDeltaLine < deltaLine || (tokenDeltaLine === deltaLine && tokenEndCharacter < character)) { - // 1. The token is completely before the insertion point - // => nothing to do - continue; - } - else if (tokenDeltaLine === deltaLine && tokenEndCharacter === character) { - // 2. The token ends precisely at the insertion point - // => expand the end character only if inserting precisely one character that is a word character - if (isInsertingPreciselyOneWordCharacter) { - tokenEndCharacter += 1; - } - else { - continue; - } - } - else if (tokenDeltaLine === deltaLine && tokenStartCharacter < character && character < tokenEndCharacter) { - // 3. The token contains the insertion point - if (eolCount === 0) { - // => just expand the end character - tokenEndCharacter += firstLineLength; - } - else { - // => cut off the token - tokenEndCharacter = character; - } - } - else { - // 4. or 5. - if (tokenDeltaLine === deltaLine && tokenStartCharacter === character) { - // 4. The token starts precisely at the insertion point - // => grow the token (by keeping its start constant) only if inserting precisely one character that is a word character - // => otherwise behave as in case 5. - if (isInsertingPreciselyOneWordCharacter) { - continue; - } - } - // => the token must move and keep its size constant - if (tokenDeltaLine === deltaLine) { - tokenDeltaLine += eolCount; - // this token is on the line where the insertion is taking place - if (eolCount === 0) { - tokenStartCharacter += firstLineLength; - tokenEndCharacter += firstLineLength; - } - else { - const tokenLength = tokenEndCharacter - tokenStartCharacter; - tokenStartCharacter = lastLineLength + (tokenStartCharacter - character); - tokenEndCharacter = tokenStartCharacter + tokenLength; - } - } - else { - tokenDeltaLine += eolCount; - } - } - tokens[offset] = tokenDeltaLine; - tokens[offset + 1] = tokenStartCharacter; - tokens[offset + 2] = tokenEndCharacter; - } - } -} -class LineTokens2 { - constructor(tokens) { - this._tokens = tokens; - } - getCount() { - return this._tokens.length / 4; - } - getStartCharacter(tokenIndex) { - return this._tokens[4 * tokenIndex + 1]; - } - getEndCharacter(tokenIndex) { - return this._tokens[4 * tokenIndex + 2]; - } - getMetadata(tokenIndex) { - return this._tokens[4 * tokenIndex + 3]; - } -} -class MultilineTokens2 { - constructor(startLineNumber, tokens) { - this.startLineNumber = startLineNumber; - this.tokens = tokens; - this.endLineNumber = this.startLineNumber + this.tokens.getMaxDeltaLine(); - } - toString() { - return this.tokens.toString(this.startLineNumber); - } - _updateEndLineNumber() { - this.endLineNumber = this.startLineNumber + this.tokens.getMaxDeltaLine(); - } - isEmpty() { - return this.tokens.isEmpty(); - } - getLineTokens(lineNumber) { - if (this.startLineNumber <= lineNumber && lineNumber <= this.endLineNumber) { - return this.tokens.getLineTokens(lineNumber - this.startLineNumber); - } - return null; - } - getRange() { - const deltaRange = this.tokens.getRange(); - if (!deltaRange) { - return deltaRange; - } - return new _core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](this.startLineNumber + deltaRange.startLineNumber, deltaRange.startColumn, this.startLineNumber + deltaRange.endLineNumber, deltaRange.endColumn); - } - removeTokens(range) { - const startLineIndex = range.startLineNumber - this.startLineNumber; - const endLineIndex = range.endLineNumber - this.startLineNumber; - this.startLineNumber += this.tokens.removeTokens(startLineIndex, range.startColumn - 1, endLineIndex, range.endColumn - 1); - this._updateEndLineNumber(); - } - split(range) { - // split tokens to two: - // a) all the tokens before `range` - // b) all the tokens after `range` - const startLineIndex = range.startLineNumber - this.startLineNumber; - const endLineIndex = range.endLineNumber - this.startLineNumber; - const [a, b, bDeltaLine] = this.tokens.split(startLineIndex, range.startColumn - 1, endLineIndex, range.endColumn - 1); - return [new MultilineTokens2(this.startLineNumber, a), new MultilineTokens2(this.startLineNumber + bDeltaLine, b)]; - } - applyEdit(range, text) { - const [eolCount, firstLineLength, lastLineLength] = countEOL(text); - this.acceptEdit(range, eolCount, firstLineLength, lastLineLength, text.length > 0 ? text.charCodeAt(0) : 0 /* Null */); - } - acceptEdit(range, eolCount, firstLineLength, lastLineLength, firstCharCode) { - this._acceptDeleteRange(range); - this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_2__["Position"](range.startLineNumber, range.startColumn), eolCount, firstLineLength, lastLineLength, firstCharCode); - this._updateEndLineNumber(); - } - _acceptDeleteRange(range) { - if (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn) { - // Nothing to delete - return; - } - const firstLineIndex = range.startLineNumber - this.startLineNumber; - const lastLineIndex = range.endLineNumber - this.startLineNumber; - if (lastLineIndex < 0) { - // this deletion occurs entirely before this block, so we only need to adjust line numbers - const deletedLinesCount = lastLineIndex - firstLineIndex; - this.startLineNumber -= deletedLinesCount; - return; - } - const tokenMaxDeltaLine = this.tokens.getMaxDeltaLine(); - if (firstLineIndex >= tokenMaxDeltaLine + 1) { - // this deletion occurs entirely after this block, so there is nothing to do - return; - } - if (firstLineIndex < 0 && lastLineIndex >= tokenMaxDeltaLine + 1) { - // this deletion completely encompasses this block - this.startLineNumber = 0; - this.tokens.clear(); - return; - } - if (firstLineIndex < 0) { - const deletedBefore = -firstLineIndex; - this.startLineNumber -= deletedBefore; - this.tokens.acceptDeleteRange(range.startColumn - 1, 0, 0, lastLineIndex, range.endColumn - 1); - } - else { - this.tokens.acceptDeleteRange(0, firstLineIndex, range.startColumn - 1, lastLineIndex, range.endColumn - 1); - } - } - _acceptInsertText(position, eolCount, firstLineLength, lastLineLength, firstCharCode) { - if (eolCount === 0 && firstLineLength === 0) { - // Nothing to insert - return; - } - const lineIndex = position.lineNumber - this.startLineNumber; - if (lineIndex < 0) { - // this insertion occurs before this block, so we only need to adjust line numbers - this.startLineNumber += eolCount; - return; - } - const tokenMaxDeltaLine = this.tokens.getMaxDeltaLine(); - if (lineIndex >= tokenMaxDeltaLine + 1) { - // this insertion occurs after this block, so there is nothing to do - return; - } - this.tokens.acceptInsertText(lineIndex, position.column - 1, eolCount, firstLineLength, lastLineLength, firstCharCode); - } -} -class MultilineTokens { - constructor(startLineNumber, tokens) { - this.startLineNumber = startLineNumber; - this.tokens = tokens; - } -} -function toUint32Array(arr) { - if (arr instanceof Uint32Array) { - return arr; - } - else { - return new Uint32Array(arr); - } -} -class TokensStore2 { - constructor() { - this._pieces = []; - this._isComplete = false; - } - flush() { - this._pieces = []; - this._isComplete = false; - } - set(pieces, isComplete) { - this._pieces = pieces || []; - this._isComplete = isComplete; - } - setPartial(_range, pieces) { - // console.log(`setPartial ${_range} ${pieces.map(p => p.toString()).join(', ')}`); - let range = _range; - if (pieces.length > 0) { - const _firstRange = pieces[0].getRange(); - const _lastRange = pieces[pieces.length - 1].getRange(); - if (!_firstRange || !_lastRange) { - return _range; - } - range = _range.plusRange(_firstRange).plusRange(_lastRange); - } - let insertPosition = null; - for (let i = 0, len = this._pieces.length; i < len; i++) { - const piece = this._pieces[i]; - if (piece.endLineNumber < range.startLineNumber) { - // this piece is before the range - continue; - } - if (piece.startLineNumber > range.endLineNumber) { - // this piece is after the range, so mark the spot before this piece - // as a good insertion position and stop looping - insertPosition = insertPosition || { index: i }; - break; - } - // this piece might intersect with the range - piece.removeTokens(range); - if (piece.isEmpty()) { - // remove the piece if it became empty - this._pieces.splice(i, 1); - i--; - len--; - continue; - } - if (piece.endLineNumber < range.startLineNumber) { - // after removal, this piece is before the range - continue; - } - if (piece.startLineNumber > range.endLineNumber) { - // after removal, this piece is after the range - insertPosition = insertPosition || { index: i }; - continue; - } - // after removal, this piece contains the range - const [a, b] = piece.split(range); - if (a.isEmpty()) { - // this piece is actually after the range - insertPosition = insertPosition || { index: i }; - continue; - } - if (b.isEmpty()) { - // this piece is actually before the range - continue; - } - this._pieces.splice(i, 1, a, b); - i++; - len++; - insertPosition = insertPosition || { index: i }; - } - insertPosition = insertPosition || { index: this._pieces.length }; - if (pieces.length > 0) { - this._pieces = _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["arrayInsert"](this._pieces, insertPosition.index, pieces); - } - // console.log(`I HAVE ${this._pieces.length} pieces`); - // console.log(`${this._pieces.map(p => p.toString()).join('\n')}`); - return range; - } - isComplete() { - return this._isComplete; - } - addSemanticTokens(lineNumber, aTokens) { - const pieces = this._pieces; - if (pieces.length === 0) { - return aTokens; - } - const pieceIndex = TokensStore2._findFirstPieceWithLine(pieces, lineNumber); - const bTokens = pieces[pieceIndex].getLineTokens(lineNumber); - if (!bTokens) { - return aTokens; - } - const aLen = aTokens.getCount(); - const bLen = bTokens.getCount(); - let aIndex = 0; - let result = [], resultLen = 0; - let lastEndOffset = 0; - const emitToken = (endOffset, metadata) => { - if (endOffset === lastEndOffset) { - return; - } - lastEndOffset = endOffset; - result[resultLen++] = endOffset; - result[resultLen++] = metadata; - }; - for (let bIndex = 0; bIndex < bLen; bIndex++) { - const bStartCharacter = bTokens.getStartCharacter(bIndex); - const bEndCharacter = bTokens.getEndCharacter(bIndex); - const bMetadata = bTokens.getMetadata(bIndex); - const bMask = (((bMetadata & 1 /* SEMANTIC_USE_ITALIC */) ? 2048 /* ITALIC_MASK */ : 0) - | ((bMetadata & 2 /* SEMANTIC_USE_BOLD */) ? 4096 /* BOLD_MASK */ : 0) - | ((bMetadata & 4 /* SEMANTIC_USE_UNDERLINE */) ? 8192 /* UNDERLINE_MASK */ : 0) - | ((bMetadata & 8 /* SEMANTIC_USE_FOREGROUND */) ? 8372224 /* FOREGROUND_MASK */ : 0) - | ((bMetadata & 16 /* SEMANTIC_USE_BACKGROUND */) ? 4286578688 /* BACKGROUND_MASK */ : 0)) >>> 0; - const aMask = (~bMask) >>> 0; - // push any token from `a` that is before `b` - while (aIndex < aLen && aTokens.getEndOffset(aIndex) <= bStartCharacter) { - emitToken(aTokens.getEndOffset(aIndex), aTokens.getMetadata(aIndex)); - aIndex++; - } - // push the token from `a` if it intersects the token from `b` - if (aIndex < aLen && aTokens.getStartOffset(aIndex) < bStartCharacter) { - emitToken(bStartCharacter, aTokens.getMetadata(aIndex)); - } - // skip any tokens from `a` that are contained inside `b` - while (aIndex < aLen && aTokens.getEndOffset(aIndex) < bEndCharacter) { - emitToken(aTokens.getEndOffset(aIndex), (aTokens.getMetadata(aIndex) & aMask) | (bMetadata & bMask)); - aIndex++; - } - if (aIndex < aLen) { - emitToken(bEndCharacter, (aTokens.getMetadata(aIndex) & aMask) | (bMetadata & bMask)); - if (aTokens.getEndOffset(aIndex) === bEndCharacter) { - // `a` ends exactly at the same spot as `b`! - aIndex++; - } - } - else { - const aMergeIndex = Math.min(Math.max(0, aIndex - 1), aLen - 1); - // push the token from `b` - emitToken(bEndCharacter, (aTokens.getMetadata(aMergeIndex) & aMask) | (bMetadata & bMask)); - } - } - // push the remaining tokens from `a` - while (aIndex < aLen) { - emitToken(aTokens.getEndOffset(aIndex), aTokens.getMetadata(aIndex)); - aIndex++; - } - return new _core_lineTokens_js__WEBPACK_IMPORTED_MODULE_1__["LineTokens"](new Uint32Array(result), aTokens.getLineContent()); - } - static _findFirstPieceWithLine(pieces, lineNumber) { - let low = 0; - let high = pieces.length - 1; - while (low < high) { - let mid = low + Math.floor((high - low) / 2); - if (pieces[mid].endLineNumber < lineNumber) { - low = mid + 1; - } - else if (pieces[mid].startLineNumber > lineNumber) { - high = mid - 1; - } - else { - while (mid > low && pieces[mid - 1].startLineNumber <= lineNumber && lineNumber <= pieces[mid - 1].endLineNumber) { - mid--; - } - return mid; - } - } - return low; - } - //#region Editing - acceptEdit(range, eolCount, firstLineLength, lastLineLength, firstCharCode) { - for (const piece of this._pieces) { - piece.acceptEdit(range, eolCount, firstLineLength, lastLineLength, firstCharCode); - } - } -} -class TokensStore { - constructor() { - this._lineTokens = []; - this._len = 0; - } - flush() { - this._lineTokens = []; - this._len = 0; - } - getTokens(topLevelLanguageId, lineIndex, lineText) { - let rawLineTokens = null; - if (lineIndex < this._len) { - rawLineTokens = this._lineTokens[lineIndex]; - } - if (rawLineTokens !== null && rawLineTokens !== EMPTY_LINE_TOKENS) { - return new _core_lineTokens_js__WEBPACK_IMPORTED_MODULE_1__["LineTokens"](toUint32Array(rawLineTokens), lineText); - } - let lineTokens = new Uint32Array(2); - lineTokens[0] = lineText.length; - lineTokens[1] = getDefaultMetadata(topLevelLanguageId); - return new _core_lineTokens_js__WEBPACK_IMPORTED_MODULE_1__["LineTokens"](lineTokens, lineText); - } - static _massageTokens(topLevelLanguageId, lineTextLength, _tokens) { - const tokens = _tokens ? toUint32Array(_tokens) : null; - if (lineTextLength === 0) { - let hasDifferentLanguageId = false; - if (tokens && tokens.length > 1) { - hasDifferentLanguageId = (_modes_js__WEBPACK_IMPORTED_MODULE_4__["TokenMetadata"].getLanguageId(tokens[1]) !== topLevelLanguageId); - } - if (!hasDifferentLanguageId) { - return EMPTY_LINE_TOKENS; - } - } - if (!tokens || tokens.length === 0) { - const tokens = new Uint32Array(2); - tokens[0] = lineTextLength; - tokens[1] = getDefaultMetadata(topLevelLanguageId); - return tokens.buffer; - } - // Ensure the last token covers the end of the text - tokens[tokens.length - 2] = lineTextLength; - if (tokens.byteOffset === 0 && tokens.byteLength === tokens.buffer.byteLength) { - // Store directly the ArrayBuffer pointer to save an object - return tokens.buffer; - } - return tokens; - } - _ensureLine(lineIndex) { - while (lineIndex >= this._len) { - this._lineTokens[this._len] = null; - this._len++; - } - } - _deleteLines(start, deleteCount) { - if (deleteCount === 0) { - return; - } - if (start + deleteCount > this._len) { - deleteCount = this._len - start; - } - this._lineTokens.splice(start, deleteCount); - this._len -= deleteCount; - } - _insertLines(insertIndex, insertCount) { - if (insertCount === 0) { - return; - } - let lineTokens = []; - for (let i = 0; i < insertCount; i++) { - lineTokens[i] = null; - } - this._lineTokens = _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["arrayInsert"](this._lineTokens, insertIndex, lineTokens); - this._len += insertCount; - } - setTokens(topLevelLanguageId, lineIndex, lineTextLength, _tokens, checkEquality) { - const tokens = TokensStore._massageTokens(topLevelLanguageId, lineTextLength, _tokens); - this._ensureLine(lineIndex); - const oldTokens = this._lineTokens[lineIndex]; - this._lineTokens[lineIndex] = tokens; - if (checkEquality) { - return !TokensStore._equals(oldTokens, tokens); - } - return false; - } - static _equals(_a, _b) { - if (!_a || !_b) { - return !_a && !_b; - } - const a = toUint32Array(_a); - const b = toUint32Array(_b); - if (a.length !== b.length) { - return false; - } - for (let i = 0, len = a.length; i < len; i++) { - if (a[i] !== b[i]) { - return false; - } - } - return true; - } - //#region Editing - acceptEdit(range, eolCount, firstLineLength) { - this._acceptDeleteRange(range); - this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_2__["Position"](range.startLineNumber, range.startColumn), eolCount, firstLineLength); - } - _acceptDeleteRange(range) { - const firstLineIndex = range.startLineNumber - 1; - if (firstLineIndex >= this._len) { - return; - } - if (range.startLineNumber === range.endLineNumber) { - if (range.startColumn === range.endColumn) { - // Nothing to delete - return; - } - this._lineTokens[firstLineIndex] = TokensStore._delete(this._lineTokens[firstLineIndex], range.startColumn - 1, range.endColumn - 1); - return; - } - this._lineTokens[firstLineIndex] = TokensStore._deleteEnding(this._lineTokens[firstLineIndex], range.startColumn - 1); - const lastLineIndex = range.endLineNumber - 1; - let lastLineTokens = null; - if (lastLineIndex < this._len) { - lastLineTokens = TokensStore._deleteBeginning(this._lineTokens[lastLineIndex], range.endColumn - 1); - } - // Take remaining text on last line and append it to remaining text on first line - this._lineTokens[firstLineIndex] = TokensStore._append(this._lineTokens[firstLineIndex], lastLineTokens); - // Delete middle lines - this._deleteLines(range.startLineNumber, range.endLineNumber - range.startLineNumber); - } - _acceptInsertText(position, eolCount, firstLineLength) { - if (eolCount === 0 && firstLineLength === 0) { - // Nothing to insert - return; - } - const lineIndex = position.lineNumber - 1; - if (lineIndex >= this._len) { - return; - } - if (eolCount === 0) { - // Inserting text on one line - this._lineTokens[lineIndex] = TokensStore._insert(this._lineTokens[lineIndex], position.column - 1, firstLineLength); - return; - } - this._lineTokens[lineIndex] = TokensStore._deleteEnding(this._lineTokens[lineIndex], position.column - 1); - this._lineTokens[lineIndex] = TokensStore._insert(this._lineTokens[lineIndex], position.column - 1, firstLineLength); - this._insertLines(position.lineNumber, eolCount); - } - static _deleteBeginning(lineTokens, toChIndex) { - if (lineTokens === null || lineTokens === EMPTY_LINE_TOKENS) { - return lineTokens; - } - return TokensStore._delete(lineTokens, 0, toChIndex); - } - static _deleteEnding(lineTokens, fromChIndex) { - if (lineTokens === null || lineTokens === EMPTY_LINE_TOKENS) { - return lineTokens; - } - const tokens = toUint32Array(lineTokens); - const lineTextLength = tokens[tokens.length - 2]; - return TokensStore._delete(lineTokens, fromChIndex, lineTextLength); - } - static _delete(lineTokens, fromChIndex, toChIndex) { - if (lineTokens === null || lineTokens === EMPTY_LINE_TOKENS || fromChIndex === toChIndex) { - return lineTokens; - } - const tokens = toUint32Array(lineTokens); - const tokensCount = (tokens.length >>> 1); - // special case: deleting everything - if (fromChIndex === 0 && tokens[tokens.length - 2] === toChIndex) { - return EMPTY_LINE_TOKENS; - } - const fromTokenIndex = _core_lineTokens_js__WEBPACK_IMPORTED_MODULE_1__["LineTokens"].findIndexInTokensArray(tokens, fromChIndex); - const fromTokenStartOffset = (fromTokenIndex > 0 ? tokens[(fromTokenIndex - 1) << 1] : 0); - const fromTokenEndOffset = tokens[fromTokenIndex << 1]; - if (toChIndex < fromTokenEndOffset) { - // the delete range is inside a single token - const delta = (toChIndex - fromChIndex); - for (let i = fromTokenIndex; i < tokensCount; i++) { - tokens[i << 1] -= delta; - } - return lineTokens; - } - let dest; - let lastEnd; - if (fromTokenStartOffset !== fromChIndex) { - tokens[fromTokenIndex << 1] = fromChIndex; - dest = ((fromTokenIndex + 1) << 1); - lastEnd = fromChIndex; - } - else { - dest = (fromTokenIndex << 1); - lastEnd = fromTokenStartOffset; - } - const delta = (toChIndex - fromChIndex); - for (let tokenIndex = fromTokenIndex + 1; tokenIndex < tokensCount; tokenIndex++) { - const tokenEndOffset = tokens[tokenIndex << 1] - delta; - if (tokenEndOffset > lastEnd) { - tokens[dest++] = tokenEndOffset; - tokens[dest++] = tokens[(tokenIndex << 1) + 1]; - lastEnd = tokenEndOffset; - } - } - if (dest === tokens.length) { - // nothing to trim - return lineTokens; - } - let tmp = new Uint32Array(dest); - tmp.set(tokens.subarray(0, dest), 0); - return tmp.buffer; - } - static _append(lineTokens, _otherTokens) { - if (_otherTokens === EMPTY_LINE_TOKENS) { - return lineTokens; - } - if (lineTokens === EMPTY_LINE_TOKENS) { - return _otherTokens; - } - if (lineTokens === null) { - return lineTokens; - } - if (_otherTokens === null) { - // cannot determine combined line length... - return null; - } - const myTokens = toUint32Array(lineTokens); - const otherTokens = toUint32Array(_otherTokens); - const otherTokensCount = (otherTokens.length >>> 1); - let result = new Uint32Array(myTokens.length + otherTokens.length); - result.set(myTokens, 0); - let dest = myTokens.length; - const delta = myTokens[myTokens.length - 2]; - for (let i = 0; i < otherTokensCount; i++) { - result[dest++] = otherTokens[(i << 1)] + delta; - result[dest++] = otherTokens[(i << 1) + 1]; - } - return result.buffer; - } - static _insert(lineTokens, chIndex, textLength) { - if (lineTokens === null || lineTokens === EMPTY_LINE_TOKENS) { - // nothing to do - return lineTokens; - } - const tokens = toUint32Array(lineTokens); - const tokensCount = (tokens.length >>> 1); - let fromTokenIndex = _core_lineTokens_js__WEBPACK_IMPORTED_MODULE_1__["LineTokens"].findIndexInTokensArray(tokens, chIndex); - if (fromTokenIndex > 0) { - const fromTokenStartOffset = tokens[(fromTokenIndex - 1) << 1]; - if (fromTokenStartOffset === chIndex) { - fromTokenIndex--; - } - } - for (let tokenIndex = fromTokenIndex; tokenIndex < tokensCount; tokenIndex++) { - tokens[tokenIndex << 1] += textLength; - } - return lineTokens; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js ***! - \*****************************************************************************/ -/*! exports provided: USUAL_WORD_SEPARATORS, DEFAULT_WORD_REGEXP, ensureValidWordDefinition, getWordAtText */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USUAL_WORD_SEPARATORS", function() { return USUAL_WORD_SEPARATORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_WORD_REGEXP", function() { return DEFAULT_WORD_REGEXP; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureValidWordDefinition", function() { return ensureValidWordDefinition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWordAtText", function() { return getWordAtText; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -const USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?'; -/** - * Create a word definition regular expression based on default word separators. - * Optionally provide allowed separators that should be included in words. - * - * The default would look like this: - * /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g - */ -function createWordRegExp(allowInWords = '') { - let source = '(-?\\d*\\.\\d\\w*)|([^'; - for (const sep of USUAL_WORD_SEPARATORS) { - if (allowInWords.indexOf(sep) >= 0) { - continue; - } - source += '\\' + sep; - } - source += '\\s]+)'; - return new RegExp(source, 'g'); -} -// catches numbers (including floating numbers) in the first group, and alphanum in the second -const DEFAULT_WORD_REGEXP = createWordRegExp(); -function ensureValidWordDefinition(wordDefinition) { - let result = DEFAULT_WORD_REGEXP; - if (wordDefinition && (wordDefinition instanceof RegExp)) { - if (!wordDefinition.global) { - let flags = 'g'; - if (wordDefinition.ignoreCase) { - flags += 'i'; - } - if (wordDefinition.multiline) { - flags += 'm'; - } - if (wordDefinition.unicode) { - flags += 'u'; - } - result = new RegExp(wordDefinition.source, flags); - } - else { - result = wordDefinition; - } - } - result.lastIndex = 0; - return result; -} -const _defaultConfig = { - maxLen: 1000, - windowSize: 15, - timeBudget: 150 -}; -function getWordAtText(column, wordDefinition, text, textOffset, config = _defaultConfig) { - if (text.length > config.maxLen) { - // don't throw strings that long at the regexp - // but use a sub-string in which a word must occur - let start = column - config.maxLen / 2; - if (start < 0) { - textOffset += column; - start = 0; - } - else { - textOffset += start; - } - text = text.substring(start, column + config.maxLen / 2); - return getWordAtText(column, wordDefinition, text, textOffset, config); - } - const t1 = Date.now(); - const pos = column - 1 - textOffset; - let prevRegexIndex = -1; - let match = null; - for (let i = 1;; i++) { - // check time budget - if (Date.now() - t1 >= config.timeBudget) { - // break; - } - // reset the index at which the regexp should start matching, also know where it - // should stop so that subsequent search don't repeat previous searches - const regexIndex = pos - config.windowSize * i; - wordDefinition.lastIndex = Math.max(0, regexIndex); - const thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text, pos, prevRegexIndex); - if (!thisMatch && match) { - // stop: we have something - break; - } - match = thisMatch; - // stop: searched at start - if (regexIndex <= 0) { - break; - } - prevRegexIndex = regexIndex; - } - if (match) { - let result = { - word: match[0], - startColumn: textOffset + 1 + match.index, - endColumn: textOffset + 1 + match.index + match[0].length - }; - wordDefinition.lastIndex = 0; - return result; - } - return null; -} -function _findRegexMatchEnclosingPosition(wordDefinition, text, pos, stopPos) { - let match; - while (match = wordDefinition.exec(text)) { - const matchIndex = match.index || 0; - if (matchIndex <= pos && wordDefinition.lastIndex >= pos) { - return match; - } - else if (stopPos > 0 && matchIndex > stopPos) { - return null; - } - } - return null; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes.js ***! - \******************************************************************/ -/*! exports provided: LanguageIdentifier, TokenMetadata, completionKindToCssClass, completionKindFromString, SignatureHelpTriggerKind, DocumentHighlightKind, isLocationLink, SymbolKinds, FoldingRangeKind, ReferenceProviderRegistry, RenameProviderRegistry, CompletionProviderRegistry, SignatureHelpProviderRegistry, HoverProviderRegistry, DocumentSymbolProviderRegistry, DocumentHighlightProviderRegistry, OnTypeRenameProviderRegistry, DefinitionProviderRegistry, DeclarationProviderRegistry, ImplementationProviderRegistry, TypeDefinitionProviderRegistry, CodeLensProviderRegistry, CodeActionProviderRegistry, DocumentFormattingEditProviderRegistry, DocumentRangeFormattingEditProviderRegistry, OnTypeFormattingEditProviderRegistry, LinkProviderRegistry, ColorProviderRegistry, SelectionRangeRegistry, FoldingRangeProviderRegistry, DocumentSemanticTokensProviderRegistry, DocumentRangeSemanticTokensProviderRegistry, TokenizationRegistry */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageIdentifier", function() { return LanguageIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenMetadata", function() { return TokenMetadata; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "completionKindToCssClass", function() { return completionKindToCssClass; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "completionKindFromString", function() { return completionKindFromString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureHelpTriggerKind", function() { return SignatureHelpTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLocationLink", function() { return isLocationLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKinds", function() { return SymbolKinds; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return FoldingRangeKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReferenceProviderRegistry", function() { return ReferenceProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenameProviderRegistry", function() { return RenameProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionProviderRegistry", function() { return CompletionProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureHelpProviderRegistry", function() { return SignatureHelpProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HoverProviderRegistry", function() { return HoverProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbolProviderRegistry", function() { return DocumentSymbolProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightProviderRegistry", function() { return DocumentHighlightProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OnTypeRenameProviderRegistry", function() { return OnTypeRenameProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefinitionProviderRegistry", function() { return DefinitionProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeclarationProviderRegistry", function() { return DeclarationProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImplementationProviderRegistry", function() { return ImplementationProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TypeDefinitionProviderRegistry", function() { return TypeDefinitionProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLensProviderRegistry", function() { return CodeLensProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionProviderRegistry", function() { return CodeActionProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentFormattingEditProviderRegistry", function() { return DocumentFormattingEditProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentRangeFormattingEditProviderRegistry", function() { return DocumentRangeFormattingEditProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OnTypeFormattingEditProviderRegistry", function() { return OnTypeFormattingEditProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkProviderRegistry", function() { return LinkProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorProviderRegistry", function() { return ColorProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionRangeRegistry", function() { return SelectionRangeRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeProviderRegistry", function() { return FoldingRangeProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentSemanticTokensProviderRegistry", function() { return DocumentSemanticTokensProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentRangeSemanticTokensProviderRegistry", function() { return DocumentRangeSemanticTokensProviderRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationRegistry", function() { return TokenizationRegistry; }); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modes/languageFeatureRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageFeatureRegistry.js"); -/* harmony import */ var _modes_tokenizationRegistry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modes/tokenizationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/tokenizationRegistry.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -/** - * @internal - */ -class LanguageIdentifier { - constructor(language, id) { - this.language = language; - this.id = id; - } -} -/** - * @internal - */ -class TokenMetadata { - static getLanguageId(metadata) { - return (metadata & 255 /* LANGUAGEID_MASK */) >>> 0 /* LANGUAGEID_OFFSET */; - } - static getTokenType(metadata) { - return (metadata & 1792 /* TOKEN_TYPE_MASK */) >>> 8 /* TOKEN_TYPE_OFFSET */; - } - static getFontStyle(metadata) { - return (metadata & 14336 /* FONT_STYLE_MASK */) >>> 11 /* FONT_STYLE_OFFSET */; - } - static getForeground(metadata) { - return (metadata & 8372224 /* FOREGROUND_MASK */) >>> 14 /* FOREGROUND_OFFSET */; - } - static getBackground(metadata) { - return (metadata & 4286578688 /* BACKGROUND_MASK */) >>> 23 /* BACKGROUND_OFFSET */; - } - static getClassNameFromMetadata(metadata) { - let foreground = this.getForeground(metadata); - let className = 'mtk' + foreground; - let fontStyle = this.getFontStyle(metadata); - if (fontStyle & 1 /* Italic */) { - className += ' mtki'; - } - if (fontStyle & 2 /* Bold */) { - className += ' mtkb'; - } - if (fontStyle & 4 /* Underline */) { - className += ' mtku'; - } - return className; - } - static getInlineStyleFromMetadata(metadata, colorMap) { - const foreground = this.getForeground(metadata); - const fontStyle = this.getFontStyle(metadata); - let result = `color: ${colorMap[foreground]};`; - if (fontStyle & 1 /* Italic */) { - result += 'font-style: italic;'; - } - if (fontStyle & 2 /* Bold */) { - result += 'font-weight: bold;'; - } - if (fontStyle & 4 /* Underline */) { - result += 'text-decoration: underline;'; - } - return result; - } -} -/** - * @internal - */ -const completionKindToCssClass = (function () { - let data = Object.create(null); - data[0 /* Method */] = 'symbol-method'; - data[1 /* Function */] = 'symbol-function'; - data[2 /* Constructor */] = 'symbol-constructor'; - data[3 /* Field */] = 'symbol-field'; - data[4 /* Variable */] = 'symbol-variable'; - data[5 /* Class */] = 'symbol-class'; - data[6 /* Struct */] = 'symbol-struct'; - data[7 /* Interface */] = 'symbol-interface'; - data[8 /* Module */] = 'symbol-module'; - data[9 /* Property */] = 'symbol-property'; - data[10 /* Event */] = 'symbol-event'; - data[11 /* Operator */] = 'symbol-operator'; - data[12 /* Unit */] = 'symbol-unit'; - data[13 /* Value */] = 'symbol-value'; - data[14 /* Constant */] = 'symbol-constant'; - data[15 /* Enum */] = 'symbol-enum'; - data[16 /* EnumMember */] = 'symbol-enum-member'; - data[17 /* Keyword */] = 'symbol-keyword'; - data[27 /* Snippet */] = 'symbol-snippet'; - data[18 /* Text */] = 'symbol-text'; - data[19 /* Color */] = 'symbol-color'; - data[20 /* File */] = 'symbol-file'; - data[21 /* Reference */] = 'symbol-reference'; - data[22 /* Customcolor */] = 'symbol-customcolor'; - data[23 /* Folder */] = 'symbol-folder'; - data[24 /* TypeParameter */] = 'symbol-type-parameter'; - data[25 /* User */] = 'account'; - data[26 /* Issue */] = 'issues'; - return function (kind) { - const name = data[kind]; - let codicon = name && _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_4__["iconRegistry"].get(name); - if (!codicon) { - console.info('No codicon found for CompletionItemKind ' + kind); - codicon = _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_4__["Codicon"].symbolProperty; - } - return codicon.classNames; - }; -})(); -/** - * @internal - */ -let completionKindFromString = (function () { - let data = Object.create(null); - data['method'] = 0 /* Method */; - data['function'] = 1 /* Function */; - data['constructor'] = 2 /* Constructor */; - data['field'] = 3 /* Field */; - data['variable'] = 4 /* Variable */; - data['class'] = 5 /* Class */; - data['struct'] = 6 /* Struct */; - data['interface'] = 7 /* Interface */; - data['module'] = 8 /* Module */; - data['property'] = 9 /* Property */; - data['event'] = 10 /* Event */; - data['operator'] = 11 /* Operator */; - data['unit'] = 12 /* Unit */; - data['value'] = 13 /* Value */; - data['constant'] = 14 /* Constant */; - data['enum'] = 15 /* Enum */; - data['enum-member'] = 16 /* EnumMember */; - data['enumMember'] = 16 /* EnumMember */; - data['keyword'] = 17 /* Keyword */; - data['snippet'] = 27 /* Snippet */; - data['text'] = 18 /* Text */; - data['color'] = 19 /* Color */; - data['file'] = 20 /* File */; - data['reference'] = 21 /* Reference */; - data['customcolor'] = 22 /* Customcolor */; - data['folder'] = 23 /* Folder */; - data['type-parameter'] = 24 /* TypeParameter */; - data['typeParameter'] = 24 /* TypeParameter */; - data['account'] = 25 /* User */; - data['issue'] = 26 /* Issue */; - return function (value, strict) { - let res = data[value]; - if (typeof res === 'undefined' && !strict) { - res = 9 /* Property */; - } - return res; - }; -})(); -var SignatureHelpTriggerKind; -(function (SignatureHelpTriggerKind) { - SignatureHelpTriggerKind[SignatureHelpTriggerKind["Invoke"] = 1] = "Invoke"; - SignatureHelpTriggerKind[SignatureHelpTriggerKind["TriggerCharacter"] = 2] = "TriggerCharacter"; - SignatureHelpTriggerKind[SignatureHelpTriggerKind["ContentChange"] = 3] = "ContentChange"; -})(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {})); -/** - * A document highlight kind. - */ -var DocumentHighlightKind; -(function (DocumentHighlightKind) { - /** - * A textual occurrence. - */ - DocumentHighlightKind[DocumentHighlightKind["Text"] = 0] = "Text"; - /** - * Read-access of a symbol, like reading a variable. - */ - DocumentHighlightKind[DocumentHighlightKind["Read"] = 1] = "Read"; - /** - * Write-access of a symbol, like writing to a variable. - */ - DocumentHighlightKind[DocumentHighlightKind["Write"] = 2] = "Write"; -})(DocumentHighlightKind || (DocumentHighlightKind = {})); -/** - * @internal - */ -function isLocationLink(thing) { - return thing - && _base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__["URI"].isUri(thing.uri) - && _core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].isIRange(thing.range) - && (_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].isIRange(thing.originSelectionRange) || _core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].isIRange(thing.targetSelectionRange)); -} -/** - * @internal - */ -var SymbolKinds; -(function (SymbolKinds) { - const byName = new Map(); - byName.set('file', 0 /* File */); - byName.set('module', 1 /* Module */); - byName.set('namespace', 2 /* Namespace */); - byName.set('package', 3 /* Package */); - byName.set('class', 4 /* Class */); - byName.set('method', 5 /* Method */); - byName.set('property', 6 /* Property */); - byName.set('field', 7 /* Field */); - byName.set('constructor', 8 /* Constructor */); - byName.set('enum', 9 /* Enum */); - byName.set('interface', 10 /* Interface */); - byName.set('function', 11 /* Function */); - byName.set('variable', 12 /* Variable */); - byName.set('constant', 13 /* Constant */); - byName.set('string', 14 /* String */); - byName.set('number', 15 /* Number */); - byName.set('boolean', 16 /* Boolean */); - byName.set('array', 17 /* Array */); - byName.set('object', 18 /* Object */); - byName.set('key', 19 /* Key */); - byName.set('null', 20 /* Null */); - byName.set('enum-member', 21 /* EnumMember */); - byName.set('struct', 22 /* Struct */); - byName.set('event', 23 /* Event */); - byName.set('operator', 24 /* Operator */); - byName.set('type-parameter', 25 /* TypeParameter */); - const byKind = new Map(); - byKind.set(0 /* File */, 'file'); - byKind.set(1 /* Module */, 'module'); - byKind.set(2 /* Namespace */, 'namespace'); - byKind.set(3 /* Package */, 'package'); - byKind.set(4 /* Class */, 'class'); - byKind.set(5 /* Method */, 'method'); - byKind.set(6 /* Property */, 'property'); - byKind.set(7 /* Field */, 'field'); - byKind.set(8 /* Constructor */, 'constructor'); - byKind.set(9 /* Enum */, 'enum'); - byKind.set(10 /* Interface */, 'interface'); - byKind.set(11 /* Function */, 'function'); - byKind.set(12 /* Variable */, 'variable'); - byKind.set(13 /* Constant */, 'constant'); - byKind.set(14 /* String */, 'string'); - byKind.set(15 /* Number */, 'number'); - byKind.set(16 /* Boolean */, 'boolean'); - byKind.set(17 /* Array */, 'array'); - byKind.set(18 /* Object */, 'object'); - byKind.set(19 /* Key */, 'key'); - byKind.set(20 /* Null */, 'null'); - byKind.set(21 /* EnumMember */, 'enum-member'); - byKind.set(22 /* Struct */, 'struct'); - byKind.set(23 /* Event */, 'event'); - byKind.set(24 /* Operator */, 'operator'); - byKind.set(25 /* TypeParameter */, 'type-parameter'); - /** - * @internal - */ - function fromString(value) { - return byName.get(value); - } - SymbolKinds.fromString = fromString; - /** - * @internal - */ - function toString(kind) { - return byKind.get(kind); - } - SymbolKinds.toString = toString; - /** - * @internal - */ - function toCssClassName(kind, inline) { - const symbolName = byKind.get(kind); - let codicon = symbolName && _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_4__["iconRegistry"].get('symbol-' + symbolName); - if (!codicon) { - console.info('No codicon found for SymbolKind ' + kind); - codicon = _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_4__["Codicon"].symbolProperty; - } - return `${inline ? 'inline' : 'block'} ${codicon.classNames}`; - } - SymbolKinds.toCssClassName = toCssClassName; -})(SymbolKinds || (SymbolKinds = {})); -class FoldingRangeKind { - /** - * Creates a new [FoldingRangeKind](#FoldingRangeKind). - * - * @param value of the kind. - */ - constructor(value) { - this.value = value; - } -} -/** - * Kind for folding range representing a comment. The value of the kind is 'comment'. - */ -FoldingRangeKind.Comment = new FoldingRangeKind('comment'); -/** - * Kind for folding range representing a import. The value of the kind is 'imports'. - */ -FoldingRangeKind.Imports = new FoldingRangeKind('imports'); -/** - * Kind for folding range representing regions (for example marked by `#region`, `#endregion`). - * The value of the kind is 'region'. - */ -FoldingRangeKind.Region = new FoldingRangeKind('region'); -// --- feature registries ------ -/** - * @internal - */ -const ReferenceProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const RenameProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const CompletionProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const SignatureHelpProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const HoverProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const DocumentSymbolProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const DocumentHighlightProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const OnTypeRenameProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const DefinitionProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const DeclarationProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const ImplementationProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const TypeDefinitionProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const CodeLensProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const CodeActionProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const DocumentFormattingEditProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const DocumentRangeFormattingEditProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const OnTypeFormattingEditProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const LinkProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const ColorProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const SelectionRangeRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const FoldingRangeProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const DocumentSemanticTokensProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const DocumentRangeSemanticTokensProviderRegistry = new _modes_languageFeatureRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageFeatureRegistry"](); -/** - * @internal - */ -const TokenizationRegistry = new _modes_tokenizationRegistry_js__WEBPACK_IMPORTED_MODULE_3__["TokenizationRegistryImpl"](); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/abstractMode.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/abstractMode.js ***! - \*******************************************************************************/ -/*! exports provided: FrankensteinMode */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FrankensteinMode", function() { return FrankensteinMode; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class FrankensteinMode { - constructor(languageIdentifier) { - this._languageIdentifier = languageIdentifier; - } - getId() { - return this._languageIdentifier.language; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfiguration.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfiguration.js ***! - \****************************************************************************************/ -/*! exports provided: IndentAction, StandardAutoClosingPairConditional */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentAction", function() { return IndentAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandardAutoClosingPairConditional", function() { return StandardAutoClosingPairConditional; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * Describes what to do with the indentation when pressing Enter. - */ -var IndentAction; -(function (IndentAction) { - /** - * Insert new line and copy the previous line's indentation. - */ - IndentAction[IndentAction["None"] = 0] = "None"; - /** - * Insert new line and indent once (relative to the previous line's indentation). - */ - IndentAction[IndentAction["Indent"] = 1] = "Indent"; - /** - * Insert two new lines: - * - the first one indented which will hold the cursor - * - the second one at the same indentation level - */ - IndentAction[IndentAction["IndentOutdent"] = 2] = "IndentOutdent"; - /** - * Insert new line and outdent once (relative to the previous line's indentation). - */ - IndentAction[IndentAction["Outdent"] = 3] = "Outdent"; -})(IndentAction || (IndentAction = {})); -/** - * @internal - */ -class StandardAutoClosingPairConditional { - constructor(source) { - this.open = source.open; - this.close = source.close; - // initially allowed in all tokens - this._standardTokenMask = 0; - if (Array.isArray(source.notIn)) { - for (let i = 0, len = source.notIn.length; i < len; i++) { - const notIn = source.notIn[i]; - switch (notIn) { - case 'string': - this._standardTokenMask |= 2 /* String */; - break; - case 'comment': - this._standardTokenMask |= 1 /* Comment */; - break; - case 'regex': - this._standardTokenMask |= 4 /* RegEx */; - break; - } - } - } - } - isOK(standardToken) { - return (this._standardTokenMask & standardToken) === 0; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js ***! - \************************************************************************************************/ -/*! exports provided: RichEditSupport, LanguageConfigurationChangeEvent, LanguageConfigurationRegistryImpl, LanguageConfigurationRegistry */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RichEditSupport", function() { return RichEditSupport; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageConfigurationChangeEvent", function() { return LanguageConfigurationChangeEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageConfigurationRegistryImpl", function() { return LanguageConfigurationRegistryImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageConfigurationRegistry", function() { return LanguageConfigurationRegistry; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../model/wordHelper.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js"); -/* harmony import */ var _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./languageConfiguration.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfiguration.js"); -/* harmony import */ var _supports_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./supports.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports.js"); -/* harmony import */ var _supports_characterPair_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./supports/characterPair.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/characterPair.js"); -/* harmony import */ var _supports_electricCharacter_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./supports/electricCharacter.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/electricCharacter.js"); -/* harmony import */ var _supports_indentRules_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./supports/indentRules.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/indentRules.js"); -/* harmony import */ var _supports_onEnter_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./supports/onEnter.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/onEnter.js"); -/* harmony import */ var _supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./supports/richEditBrackets.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/richEditBrackets.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - -class RichEditSupport { - constructor(languageIdentifier, previous, rawConf) { - this._languageIdentifier = languageIdentifier; - this._brackets = null; - this._electricCharacter = null; - let prev = null; - if (previous) { - prev = previous._conf; - } - this._conf = RichEditSupport._mergeConf(prev, rawConf); - this._onEnterSupport = (this._conf.brackets || this._conf.indentationRules || this._conf.onEnterRules ? new _supports_onEnter_js__WEBPACK_IMPORTED_MODULE_9__["OnEnterSupport"](this._conf) : null); - this.comments = RichEditSupport._handleComments(this._conf); - this.characterPair = new _supports_characterPair_js__WEBPACK_IMPORTED_MODULE_6__["CharacterPairSupport"](this._conf); - this.wordDefinition = this._conf.wordPattern || _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_3__["DEFAULT_WORD_REGEXP"]; - this.indentationRules = this._conf.indentationRules; - if (this._conf.indentationRules) { - this.indentRulesSupport = new _supports_indentRules_js__WEBPACK_IMPORTED_MODULE_8__["IndentRulesSupport"](this._conf.indentationRules); - } - else { - this.indentRulesSupport = null; - } - this.foldingRules = this._conf.folding || {}; - } - get brackets() { - if (!this._brackets && this._conf.brackets) { - this._brackets = new _supports_richEditBrackets_js__WEBPACK_IMPORTED_MODULE_10__["RichEditBrackets"](this._languageIdentifier, this._conf.brackets); - } - return this._brackets; - } - get electricCharacter() { - if (!this._electricCharacter) { - this._electricCharacter = new _supports_electricCharacter_js__WEBPACK_IMPORTED_MODULE_7__["BracketElectricCharacterSupport"](this.brackets); - } - return this._electricCharacter; - } - onEnter(autoIndent, oneLineAboveText, beforeEnterText, afterEnterText) { - if (!this._onEnterSupport) { - return null; - } - return this._onEnterSupport.onEnter(autoIndent, oneLineAboveText, beforeEnterText, afterEnterText); - } - static _mergeConf(prev, current) { - return { - comments: (prev ? current.comments || prev.comments : current.comments), - brackets: (prev ? current.brackets || prev.brackets : current.brackets), - wordPattern: (prev ? current.wordPattern || prev.wordPattern : current.wordPattern), - indentationRules: (prev ? current.indentationRules || prev.indentationRules : current.indentationRules), - onEnterRules: (prev ? current.onEnterRules || prev.onEnterRules : current.onEnterRules), - autoClosingPairs: (prev ? current.autoClosingPairs || prev.autoClosingPairs : current.autoClosingPairs), - surroundingPairs: (prev ? current.surroundingPairs || prev.surroundingPairs : current.surroundingPairs), - autoCloseBefore: (prev ? current.autoCloseBefore || prev.autoCloseBefore : current.autoCloseBefore), - folding: (prev ? current.folding || prev.folding : current.folding), - __electricCharacterSupport: (prev ? current.__electricCharacterSupport || prev.__electricCharacterSupport : current.__electricCharacterSupport), - }; - } - static _handleComments(conf) { - let commentRule = conf.comments; - if (!commentRule) { - return null; - } - // comment configuration - let comments = {}; - if (commentRule.lineComment) { - comments.lineCommentToken = commentRule.lineComment; - } - if (commentRule.blockComment) { - let [blockStart, blockEnd] = commentRule.blockComment; - comments.blockCommentStartToken = blockStart; - comments.blockCommentEndToken = blockEnd; - } - return comments; - } -} -class LanguageConfigurationChangeEvent { - constructor(languageIdentifier) { - this.languageIdentifier = languageIdentifier; - } -} -class LanguageConfigurationRegistryImpl { - constructor() { - this._entries = new Map(); - this._onDidChange = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this.onDidChange = this._onDidChange.event; - } - register(languageIdentifier, configuration) { - let previous = this._getRichEditSupport(languageIdentifier.id); - let current = new RichEditSupport(languageIdentifier, previous, configuration); - this._entries.set(languageIdentifier.id, current); - this._onDidChange.fire(new LanguageConfigurationChangeEvent(languageIdentifier)); - return Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => { - if (this._entries.get(languageIdentifier.id) === current) { - this._entries.set(languageIdentifier.id, previous); - this._onDidChange.fire(new LanguageConfigurationChangeEvent(languageIdentifier)); - } - }); - } - _getRichEditSupport(languageId) { - return this._entries.get(languageId); - } - getIndentationRules(languageId) { - const value = this._entries.get(languageId); - if (!value) { - return null; - } - return value.indentationRules || null; - } - // begin electricCharacter - _getElectricCharacterSupport(languageId) { - let value = this._getRichEditSupport(languageId); - if (!value) { - return null; - } - return value.electricCharacter || null; - } - getElectricCharacters(languageId) { - let electricCharacterSupport = this._getElectricCharacterSupport(languageId); - if (!electricCharacterSupport) { - return []; - } - return electricCharacterSupport.getElectricCharacters(); - } - /** - * Should return opening bracket type to match indentation with - */ - onElectricCharacter(character, context, column) { - let scopedLineTokens = Object(_supports_js__WEBPACK_IMPORTED_MODULE_5__["createScopedLineTokens"])(context, column - 1); - let electricCharacterSupport = this._getElectricCharacterSupport(scopedLineTokens.languageId); - if (!electricCharacterSupport) { - return null; - } - return electricCharacterSupport.onElectricCharacter(character, scopedLineTokens, column - scopedLineTokens.firstCharOffset); - } - // end electricCharacter - getComments(languageId) { - let value = this._getRichEditSupport(languageId); - if (!value) { - return null; - } - return value.comments || null; - } - // begin characterPair - _getCharacterPairSupport(languageId) { - let value = this._getRichEditSupport(languageId); - if (!value) { - return null; - } - return value.characterPair || null; - } - getAutoClosingPairs(languageId) { - let characterPairSupport = this._getCharacterPairSupport(languageId); - if (!characterPairSupport) { - return []; - } - return characterPairSupport.getAutoClosingPairs(); - } - getAutoCloseBeforeSet(languageId) { - let characterPairSupport = this._getCharacterPairSupport(languageId); - if (!characterPairSupport) { - return _supports_characterPair_js__WEBPACK_IMPORTED_MODULE_6__["CharacterPairSupport"].DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED; - } - return characterPairSupport.getAutoCloseBeforeSet(); - } - getSurroundingPairs(languageId) { - let characterPairSupport = this._getCharacterPairSupport(languageId); - if (!characterPairSupport) { - return []; - } - return characterPairSupport.getSurroundingPairs(); - } - shouldAutoClosePair(autoClosingPair, context, column) { - const scopedLineTokens = Object(_supports_js__WEBPACK_IMPORTED_MODULE_5__["createScopedLineTokens"])(context, column - 1); - return _supports_characterPair_js__WEBPACK_IMPORTED_MODULE_6__["CharacterPairSupport"].shouldAutoClosePair(autoClosingPair, scopedLineTokens, column - scopedLineTokens.firstCharOffset); - } - // end characterPair - getWordDefinition(languageId) { - let value = this._getRichEditSupport(languageId); - if (!value) { - return Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_3__["ensureValidWordDefinition"])(null); - } - return Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_3__["ensureValidWordDefinition"])(value.wordDefinition || null); - } - getFoldingRules(languageId) { - let value = this._getRichEditSupport(languageId); - if (!value) { - return {}; - } - return value.foldingRules; - } - // begin Indent Rules - getIndentRulesSupport(languageId) { - let value = this._getRichEditSupport(languageId); - if (!value) { - return null; - } - return value.indentRulesSupport || null; - } - /** - * Get nearest preceiding line which doesn't match unIndentPattern or contains all whitespace. - * Result: - * -1: run into the boundary of embedded languages - * 0: every line above are invalid - * else: nearest preceding line of the same language - */ - getPrecedingValidLine(model, lineNumber, indentRulesSupport) { - let languageID = model.getLanguageIdAtPosition(lineNumber, 0); - if (lineNumber > 1) { - let lastLineNumber; - let resultLineNumber = -1; - for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) { - if (model.getLanguageIdAtPosition(lastLineNumber, 0) !== languageID) { - return resultLineNumber; - } - let text = model.getLineContent(lastLineNumber); - if (indentRulesSupport.shouldIgnore(text) || /^\s+$/.test(text) || text === '') { - resultLineNumber = lastLineNumber; - continue; - } - return lastLineNumber; - } - } - return -1; - } - /** - * Get inherited indentation from above lines. - * 1. Find the nearest preceding line which doesn't match unIndentedLinePattern. - * 2. If this line matches indentNextLinePattern or increaseIndentPattern, it means that the indent level of `lineNumber` should be 1 greater than this line. - * 3. If this line doesn't match any indent rules - * a. check whether the line above it matches indentNextLinePattern - * b. If not, the indent level of this line is the result - * c. If so, it means the indent of this line is *temporary*, go upward utill we find a line whose indent is not temporary (the same workflow a -> b -> c). - * 4. Otherwise, we fail to get an inherited indent from aboves. Return null and we should not touch the indent of `lineNumber` - * - * This function only return the inherited indent based on above lines, it doesn't check whether current line should decrease or not. - */ - getInheritIndentForLine(autoIndent, model, lineNumber, honorIntentialIndent = true) { - if (autoIndent < 4 /* Full */) { - return null; - } - const indentRulesSupport = this.getIndentRulesSupport(model.getLanguageIdentifier().id); - if (!indentRulesSupport) { - return null; - } - if (lineNumber <= 1) { - return { - indentation: '', - action: null - }; - } - const precedingUnIgnoredLine = this.getPrecedingValidLine(model, lineNumber, indentRulesSupport); - if (precedingUnIgnoredLine < 0) { - return null; - } - else if (precedingUnIgnoredLine < 1) { - return { - indentation: '', - action: null - }; - } - const precedingUnIgnoredLineContent = model.getLineContent(precedingUnIgnoredLine); - if (indentRulesSupport.shouldIncrease(precedingUnIgnoredLineContent) || indentRulesSupport.shouldIndentNextLine(precedingUnIgnoredLineContent)) { - return { - indentation: _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](precedingUnIgnoredLineContent), - action: _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].Indent, - line: precedingUnIgnoredLine - }; - } - else if (indentRulesSupport.shouldDecrease(precedingUnIgnoredLineContent)) { - return { - indentation: _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](precedingUnIgnoredLineContent), - action: null, - line: precedingUnIgnoredLine - }; - } - else { - // precedingUnIgnoredLine can not be ignored. - // it doesn't increase indent of following lines - // it doesn't increase just next line - // so current line is not affect by precedingUnIgnoredLine - // and then we should get a correct inheritted indentation from above lines - if (precedingUnIgnoredLine === 1) { - return { - indentation: _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](model.getLineContent(precedingUnIgnoredLine)), - action: null, - line: precedingUnIgnoredLine - }; - } - const previousLine = precedingUnIgnoredLine - 1; - const previousLineIndentMetadata = indentRulesSupport.getIndentMetadata(model.getLineContent(previousLine)); - if (!(previousLineIndentMetadata & (1 /* INCREASE_MASK */ | 2 /* DECREASE_MASK */)) && - (previousLineIndentMetadata & 4 /* INDENT_NEXTLINE_MASK */)) { - let stopLine = 0; - for (let i = previousLine - 1; i > 0; i--) { - if (indentRulesSupport.shouldIndentNextLine(model.getLineContent(i))) { - continue; - } - stopLine = i; - break; - } - return { - indentation: _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](model.getLineContent(stopLine + 1)), - action: null, - line: stopLine + 1 - }; - } - if (honorIntentialIndent) { - return { - indentation: _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](model.getLineContent(precedingUnIgnoredLine)), - action: null, - line: precedingUnIgnoredLine - }; - } - else { - // search from precedingUnIgnoredLine until we find one whose indent is not temporary - for (let i = precedingUnIgnoredLine; i > 0; i--) { - const lineContent = model.getLineContent(i); - if (indentRulesSupport.shouldIncrease(lineContent)) { - return { - indentation: _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](lineContent), - action: _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].Indent, - line: i - }; - } - else if (indentRulesSupport.shouldIndentNextLine(lineContent)) { - let stopLine = 0; - for (let j = i - 1; j > 0; j--) { - if (indentRulesSupport.shouldIndentNextLine(model.getLineContent(i))) { - continue; - } - stopLine = j; - break; - } - return { - indentation: _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](model.getLineContent(stopLine + 1)), - action: null, - line: stopLine + 1 - }; - } - else if (indentRulesSupport.shouldDecrease(lineContent)) { - return { - indentation: _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](lineContent), - action: null, - line: i - }; - } - } - return { - indentation: _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](model.getLineContent(1)), - action: null, - line: 1 - }; - } - } - } - getGoodIndentForLine(autoIndent, virtualModel, languageId, lineNumber, indentConverter) { - if (autoIndent < 4 /* Full */) { - return null; - } - const richEditSupport = this._getRichEditSupport(languageId); - if (!richEditSupport) { - return null; - } - const indentRulesSupport = this.getIndentRulesSupport(languageId); - if (!indentRulesSupport) { - return null; - } - const indent = this.getInheritIndentForLine(autoIndent, virtualModel, lineNumber); - const lineContent = virtualModel.getLineContent(lineNumber); - if (indent) { - const inheritLine = indent.line; - if (inheritLine !== undefined) { - const enterResult = richEditSupport.onEnter(autoIndent, '', virtualModel.getLineContent(inheritLine), ''); - if (enterResult) { - let indentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](virtualModel.getLineContent(inheritLine)); - if (enterResult.removeText) { - indentation = indentation.substring(0, indentation.length - enterResult.removeText); - } - if ((enterResult.indentAction === _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].Indent) || - (enterResult.indentAction === _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].IndentOutdent)) { - indentation = indentConverter.shiftIndent(indentation); - } - else if (enterResult.indentAction === _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].Outdent) { - indentation = indentConverter.unshiftIndent(indentation); - } - if (indentRulesSupport.shouldDecrease(lineContent)) { - indentation = indentConverter.unshiftIndent(indentation); - } - if (enterResult.appendText) { - indentation += enterResult.appendText; - } - return _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](indentation); - } - } - if (indentRulesSupport.shouldDecrease(lineContent)) { - if (indent.action === _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].Indent) { - return indent.indentation; - } - else { - return indentConverter.unshiftIndent(indent.indentation); - } - } - else { - if (indent.action === _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].Indent) { - return indentConverter.shiftIndent(indent.indentation); - } - else { - return indent.indentation; - } - } - } - return null; - } - getIndentForEnter(autoIndent, model, range, indentConverter) { - if (autoIndent < 4 /* Full */) { - return null; - } - model.forceTokenization(range.startLineNumber); - const lineTokens = model.getLineTokens(range.startLineNumber); - const scopedLineTokens = Object(_supports_js__WEBPACK_IMPORTED_MODULE_5__["createScopedLineTokens"])(lineTokens, range.startColumn - 1); - const scopedLineText = scopedLineTokens.getLineContent(); - let embeddedLanguage = false; - let beforeEnterText; - if (scopedLineTokens.firstCharOffset > 0 && lineTokens.getLanguageId(0) !== scopedLineTokens.languageId) { - // we are in the embeded language content - embeddedLanguage = true; // if embeddedLanguage is true, then we don't touch the indentation of current line - beforeEnterText = scopedLineText.substr(0, range.startColumn - 1 - scopedLineTokens.firstCharOffset); - } - else { - beforeEnterText = lineTokens.getLineContent().substring(0, range.startColumn - 1); - } - let afterEnterText; - if (range.isEmpty()) { - afterEnterText = scopedLineText.substr(range.startColumn - 1 - scopedLineTokens.firstCharOffset); - } - else { - const endScopedLineTokens = this.getScopedLineTokens(model, range.endLineNumber, range.endColumn); - afterEnterText = endScopedLineTokens.getLineContent().substr(range.endColumn - 1 - scopedLineTokens.firstCharOffset); - } - const indentRulesSupport = this.getIndentRulesSupport(scopedLineTokens.languageId); - if (!indentRulesSupport) { - return null; - } - const beforeEnterResult = beforeEnterText; - const beforeEnterIndent = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](beforeEnterText); - const virtualModel = { - getLineTokens: (lineNumber) => { - return model.getLineTokens(lineNumber); - }, - getLanguageIdentifier: () => { - return model.getLanguageIdentifier(); - }, - getLanguageIdAtPosition: (lineNumber, column) => { - return model.getLanguageIdAtPosition(lineNumber, column); - }, - getLineContent: (lineNumber) => { - if (lineNumber === range.startLineNumber) { - return beforeEnterResult; - } - else { - return model.getLineContent(lineNumber); - } - } - }; - const currentLineIndent = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](lineTokens.getLineContent()); - const afterEnterAction = this.getInheritIndentForLine(autoIndent, virtualModel, range.startLineNumber + 1); - if (!afterEnterAction) { - const beforeEnter = embeddedLanguage ? currentLineIndent : beforeEnterIndent; - return { - beforeEnter: beforeEnter, - afterEnter: beforeEnter - }; - } - let afterEnterIndent = embeddedLanguage ? currentLineIndent : afterEnterAction.indentation; - if (afterEnterAction.action === _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].Indent) { - afterEnterIndent = indentConverter.shiftIndent(afterEnterIndent); - } - if (indentRulesSupport.shouldDecrease(afterEnterText)) { - afterEnterIndent = indentConverter.unshiftIndent(afterEnterIndent); - } - return { - beforeEnter: embeddedLanguage ? currentLineIndent : beforeEnterIndent, - afterEnter: afterEnterIndent - }; - } - /** - * We should always allow intentional indentation. It means, if users change the indentation of `lineNumber` and the content of - * this line doesn't match decreaseIndentPattern, we should not adjust the indentation. - */ - getIndentActionForType(autoIndent, model, range, ch, indentConverter) { - if (autoIndent < 4 /* Full */) { - return null; - } - const scopedLineTokens = this.getScopedLineTokens(model, range.startLineNumber, range.startColumn); - const indentRulesSupport = this.getIndentRulesSupport(scopedLineTokens.languageId); - if (!indentRulesSupport) { - return null; - } - const scopedLineText = scopedLineTokens.getLineContent(); - const beforeTypeText = scopedLineText.substr(0, range.startColumn - 1 - scopedLineTokens.firstCharOffset); - // selection support - let afterTypeText; - if (range.isEmpty()) { - afterTypeText = scopedLineText.substr(range.startColumn - 1 - scopedLineTokens.firstCharOffset); - } - else { - const endScopedLineTokens = this.getScopedLineTokens(model, range.endLineNumber, range.endColumn); - afterTypeText = endScopedLineTokens.getLineContent().substr(range.endColumn - 1 - scopedLineTokens.firstCharOffset); - } - // If previous content already matches decreaseIndentPattern, it means indentation of this line should already be adjusted - // Users might change the indentation by purpose and we should honor that instead of readjusting. - if (!indentRulesSupport.shouldDecrease(beforeTypeText + afterTypeText) && indentRulesSupport.shouldDecrease(beforeTypeText + ch + afterTypeText)) { - // after typing `ch`, the content matches decreaseIndentPattern, we should adjust the indent to a good manner. - // 1. Get inherited indent action - const r = this.getInheritIndentForLine(autoIndent, model, range.startLineNumber, false); - if (!r) { - return null; - } - let indentation = r.indentation; - if (r.action !== _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].Indent) { - indentation = indentConverter.unshiftIndent(indentation); - } - return indentation; - } - return null; - } - getIndentMetadata(model, lineNumber) { - const indentRulesSupport = this.getIndentRulesSupport(model.getLanguageIdentifier().id); - if (!indentRulesSupport) { - return null; - } - if (lineNumber < 1 || lineNumber > model.getLineCount()) { - return null; - } - return indentRulesSupport.getIndentMetadata(model.getLineContent(lineNumber)); - } - // end Indent Rules - // begin onEnter - getEnterAction(autoIndent, model, range) { - const scopedLineTokens = this.getScopedLineTokens(model, range.startLineNumber, range.startColumn); - const richEditSupport = this._getRichEditSupport(scopedLineTokens.languageId); - if (!richEditSupport) { - return null; - } - const scopedLineText = scopedLineTokens.getLineContent(); - const beforeEnterText = scopedLineText.substr(0, range.startColumn - 1 - scopedLineTokens.firstCharOffset); - // selection support - let afterEnterText; - if (range.isEmpty()) { - afterEnterText = scopedLineText.substr(range.startColumn - 1 - scopedLineTokens.firstCharOffset); - } - else { - const endScopedLineTokens = this.getScopedLineTokens(model, range.endLineNumber, range.endColumn); - afterEnterText = endScopedLineTokens.getLineContent().substr(range.endColumn - 1 - scopedLineTokens.firstCharOffset); - } - let oneLineAboveText = ''; - if (range.startLineNumber > 1 && scopedLineTokens.firstCharOffset === 0) { - // This is not the first line and the entire line belongs to this mode - const oneLineAboveScopedLineTokens = this.getScopedLineTokens(model, range.startLineNumber - 1); - if (oneLineAboveScopedLineTokens.languageId === scopedLineTokens.languageId) { - // The line above ends with text belonging to the same mode - oneLineAboveText = oneLineAboveScopedLineTokens.getLineContent(); - } - } - const enterResult = richEditSupport.onEnter(autoIndent, oneLineAboveText, beforeEnterText, afterEnterText); - if (!enterResult) { - return null; - } - const indentAction = enterResult.indentAction; - let appendText = enterResult.appendText; - const removeText = enterResult.removeText || 0; - // Here we add `\t` to appendText first because enterAction is leveraging appendText and removeText to change indentation. - if (!appendText) { - if ((indentAction === _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].Indent) || - (indentAction === _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].IndentOutdent)) { - appendText = '\t'; - } - else { - appendText = ''; - } - } - let indentation = this.getIndentationAtPosition(model, range.startLineNumber, range.startColumn); - if (removeText) { - indentation = indentation.substring(0, indentation.length - removeText); - } - return { - indentAction: indentAction, - appendText: appendText, - removeText: removeText, - indentation: indentation - }; - } - getIndentationAtPosition(model, lineNumber, column) { - const lineText = model.getLineContent(lineNumber); - let indentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](lineText); - if (indentation.length > column - 1) { - indentation = indentation.substring(0, column - 1); - } - return indentation; - } - getScopedLineTokens(model, lineNumber, columnNumber) { - model.forceTokenization(lineNumber); - const lineTokens = model.getLineTokens(lineNumber); - const column = (typeof columnNumber === 'undefined' ? model.getLineMaxColumn(lineNumber) - 1 : columnNumber - 1); - return Object(_supports_js__WEBPACK_IMPORTED_MODULE_5__["createScopedLineTokens"])(lineTokens, column); - } - // end onEnter - getBracketsSupport(languageId) { - const value = this._getRichEditSupport(languageId); - if (!value) { - return null; - } - return value.brackets || null; - } -} -const LanguageConfigurationRegistry = new LanguageConfigurationRegistryImpl(); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageFeatureRegistry.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/languageFeatureRegistry.js ***! - \******************************************************************************************/ -/*! exports provided: LanguageFeatureRegistry */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageFeatureRegistry", function() { return LanguageFeatureRegistry; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _languageSelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./languageSelector.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageSelector.js"); -/* harmony import */ var _services_modelService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -function isExclusive(selector) { - if (typeof selector === 'string') { - return false; - } - else if (Array.isArray(selector)) { - return selector.every(isExclusive); - } - else { - return !!selector.exclusive; - } -} -class LanguageFeatureRegistry { - constructor() { - this._clock = 0; - this._entries = []; - this._onDidChange = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - } - get onDidChange() { - return this._onDidChange.event; - } - register(selector, provider) { - let entry = { - selector, - provider, - _score: -1, - _time: this._clock++ - }; - this._entries.push(entry); - this._lastCandidate = undefined; - this._onDidChange.fire(this._entries.length); - return Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => { - if (entry) { - let idx = this._entries.indexOf(entry); - if (idx >= 0) { - this._entries.splice(idx, 1); - this._lastCandidate = undefined; - this._onDidChange.fire(this._entries.length); - entry = undefined; - } - } - }); - } - has(model) { - return this.all(model).length > 0; - } - all(model) { - if (!model) { - return []; - } - this._updateScores(model); - const result = []; - // from registry - for (let entry of this._entries) { - if (entry._score > 0) { - result.push(entry.provider); - } - } - return result; - } - ordered(model) { - const result = []; - this._orderedForEach(model, entry => result.push(entry.provider)); - return result; - } - orderedGroups(model) { - const result = []; - let lastBucket; - let lastBucketScore; - this._orderedForEach(model, entry => { - if (lastBucket && lastBucketScore === entry._score) { - lastBucket.push(entry.provider); - } - else { - lastBucketScore = entry._score; - lastBucket = [entry.provider]; - result.push(lastBucket); - } - }); - return result; - } - _orderedForEach(model, callback) { - if (!model) { - return; - } - this._updateScores(model); - for (const entry of this._entries) { - if (entry._score > 0) { - callback(entry); - } - } - } - _updateScores(model) { - let candidate = { - uri: model.uri.toString(), - language: model.getLanguageIdentifier().language - }; - if (this._lastCandidate - && this._lastCandidate.language === candidate.language - && this._lastCandidate.uri === candidate.uri) { - // nothing has changed - return; - } - this._lastCandidate = candidate; - for (let entry of this._entries) { - entry._score = Object(_languageSelector_js__WEBPACK_IMPORTED_MODULE_2__["score"])(entry.selector, model.uri, model.getLanguageIdentifier().language, Object(_services_modelService_js__WEBPACK_IMPORTED_MODULE_3__["shouldSynchronizeModel"])(model)); - if (isExclusive(entry.selector) && entry._score > 0) { - // support for one exclusive selector that overwrites - // any other selector - for (let entry of this._entries) { - entry._score = 0; - } - entry._score = 1000; - break; - } - } - // needs sorting - this._entries.sort(LanguageFeatureRegistry._compareByScoreAndTime); - } - static _compareByScoreAndTime(a, b) { - if (a._score < b._score) { - return 1; - } - else if (a._score > b._score) { - return -1; - } - else if (a._time < b._time) { - return 1; - } - else if (a._time > b._time) { - return -1; - } - else { - return 0; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageSelector.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/languageSelector.js ***! - \***********************************************************************************/ -/*! exports provided: score */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "score", function() { return score; }); -/* harmony import */ var _base_common_glob_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/glob.js */ "./node_modules/monaco-editor/esm/vs/base/common/glob.js"); -/* harmony import */ var _base_common_path_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/path.js */ "./node_modules/monaco-editor/esm/vs/base/common/path.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -function score(selector, candidateUri, candidateLanguage, candidateIsSynchronized) { - if (Array.isArray(selector)) { - // array -> take max individual value - let ret = 0; - for (const filter of selector) { - const value = score(filter, candidateUri, candidateLanguage, candidateIsSynchronized); - if (value === 10) { - return value; // already at the highest - } - if (value > ret) { - ret = value; - } - } - return ret; - } - else if (typeof selector === 'string') { - if (!candidateIsSynchronized) { - return 0; - } - // short-hand notion, desugars to - // 'fooLang' -> { language: 'fooLang'} - // '*' -> { language: '*' } - if (selector === '*') { - return 5; - } - else if (selector === candidateLanguage) { - return 10; - } - else { - return 0; - } - } - else if (selector) { - // filter -> select accordingly, use defaults for scheme - const { language, pattern, scheme, hasAccessToAllModels } = selector; - if (!candidateIsSynchronized && !hasAccessToAllModels) { - return 0; - } - let ret = 0; - if (scheme) { - if (scheme === candidateUri.scheme) { - ret = 10; - } - else if (scheme === '*') { - ret = 5; - } - else { - return 0; - } - } - if (language) { - if (language === candidateLanguage) { - ret = 10; - } - else if (language === '*') { - ret = Math.max(ret, 5); - } - else { - return 0; - } - } - if (pattern) { - let normalizedPattern; - if (typeof pattern === 'string') { - normalizedPattern = pattern; - } - else { - // Since this pattern has a `base` property, we need - // to normalize this path first before passing it on - // because we will compare it against `Uri.fsPath` - // which uses platform specific separators. - // Refs: https://github.com/microsoft/vscode/issues/99938 - normalizedPattern = Object.assign(Object.assign({}, pattern), { base: Object(_base_common_path_js__WEBPACK_IMPORTED_MODULE_1__["normalize"])(pattern.base) }); - } - if (normalizedPattern === candidateUri.fsPath || Object(_base_common_glob_js__WEBPACK_IMPORTED_MODULE_0__["match"])(normalizedPattern, candidateUri.fsPath)) { - ret = 10; - } - else { - return 0; - } - } - return ret; - } - else { - return 0; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js ***! - \*******************************************************************************/ -/*! exports provided: Uint8Matrix, StateMachine, LinkComputer, computeLinks */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8Matrix", function() { return Uint8Matrix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StateMachine", function() { return StateMachine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkComputer", function() { return LinkComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeLinks", function() { return computeLinks; }); -/* harmony import */ var _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class Uint8Matrix { - constructor(rows, cols, defaultValue) { - const data = new Uint8Array(rows * cols); - for (let i = 0, len = rows * cols; i < len; i++) { - data[i] = defaultValue; - } - this._data = data; - this.rows = rows; - this.cols = cols; - } - get(row, col) { - return this._data[row * this.cols + col]; - } - set(row, col, value) { - this._data[row * this.cols + col] = value; - } -} -class StateMachine { - constructor(edges) { - let maxCharCode = 0; - let maxState = 0 /* Invalid */; - for (let i = 0, len = edges.length; i < len; i++) { - let [from, chCode, to] = edges[i]; - if (chCode > maxCharCode) { - maxCharCode = chCode; - } - if (from > maxState) { - maxState = from; - } - if (to > maxState) { - maxState = to; - } - } - maxCharCode++; - maxState++; - let states = new Uint8Matrix(maxState, maxCharCode, 0 /* Invalid */); - for (let i = 0, len = edges.length; i < len; i++) { - let [from, chCode, to] = edges[i]; - states.set(from, chCode, to); - } - this._states = states; - this._maxCharCode = maxCharCode; - } - nextState(currentState, chCode) { - if (chCode < 0 || chCode >= this._maxCharCode) { - return 0 /* Invalid */; - } - return this._states.get(currentState, chCode); - } -} -// State machine for http:// or https:// or file:// -let _stateMachine = null; -function getStateMachine() { - if (_stateMachine === null) { - _stateMachine = new StateMachine([ - [1 /* Start */, 104 /* h */, 2 /* H */], - [1 /* Start */, 72 /* H */, 2 /* H */], - [1 /* Start */, 102 /* f */, 6 /* F */], - [1 /* Start */, 70 /* F */, 6 /* F */], - [2 /* H */, 116 /* t */, 3 /* HT */], - [2 /* H */, 84 /* T */, 3 /* HT */], - [3 /* HT */, 116 /* t */, 4 /* HTT */], - [3 /* HT */, 84 /* T */, 4 /* HTT */], - [4 /* HTT */, 112 /* p */, 5 /* HTTP */], - [4 /* HTT */, 80 /* P */, 5 /* HTTP */], - [5 /* HTTP */, 115 /* s */, 9 /* BeforeColon */], - [5 /* HTTP */, 83 /* S */, 9 /* BeforeColon */], - [5 /* HTTP */, 58 /* Colon */, 10 /* AfterColon */], - [6 /* F */, 105 /* i */, 7 /* FI */], - [6 /* F */, 73 /* I */, 7 /* FI */], - [7 /* FI */, 108 /* l */, 8 /* FIL */], - [7 /* FI */, 76 /* L */, 8 /* FIL */], - [8 /* FIL */, 101 /* e */, 9 /* BeforeColon */], - [8 /* FIL */, 69 /* E */, 9 /* BeforeColon */], - [9 /* BeforeColon */, 58 /* Colon */, 10 /* AfterColon */], - [10 /* AfterColon */, 47 /* Slash */, 11 /* AlmostThere */], - [11 /* AlmostThere */, 47 /* Slash */, 12 /* End */], - ]); - } - return _stateMachine; -} -let _classifier = null; -function getClassifier() { - if (_classifier === null) { - _classifier = new _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__["CharacterClassifier"](0 /* None */); - const FORCE_TERMINATION_CHARACTERS = ' \t<>\'\"、。。、,.:;‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…'; - for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) { - _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1 /* ForceTermination */); - } - const CANNOT_END_WITH_CHARACTERS = '.,;'; - for (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) { - _classifier.set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), 2 /* CannotEndIn */); - } - } - return _classifier; -} -class LinkComputer { - static _createLink(classifier, line, lineNumber, linkBeginIndex, linkEndIndex) { - // Do not allow to end link in certain characters... - let lastIncludedCharIndex = linkEndIndex - 1; - do { - const chCode = line.charCodeAt(lastIncludedCharIndex); - const chClass = classifier.get(chCode); - if (chClass !== 2 /* CannotEndIn */) { - break; - } - lastIncludedCharIndex--; - } while (lastIncludedCharIndex > linkBeginIndex); - // Handle links enclosed in parens, square brackets and curlys. - if (linkBeginIndex > 0) { - const charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1); - const lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex); - if ((charCodeBeforeLink === 40 /* OpenParen */ && lastCharCodeInLink === 41 /* CloseParen */) - || (charCodeBeforeLink === 91 /* OpenSquareBracket */ && lastCharCodeInLink === 93 /* CloseSquareBracket */) - || (charCodeBeforeLink === 123 /* OpenCurlyBrace */ && lastCharCodeInLink === 125 /* CloseCurlyBrace */)) { - // Do not end in ) if ( is before the link start - // Do not end in ] if [ is before the link start - // Do not end in } if { is before the link start - lastIncludedCharIndex--; - } - } - return { - range: { - startLineNumber: lineNumber, - startColumn: linkBeginIndex + 1, - endLineNumber: lineNumber, - endColumn: lastIncludedCharIndex + 2 - }, - url: line.substring(linkBeginIndex, lastIncludedCharIndex + 1) - }; - } - static computeLinks(model, stateMachine = getStateMachine()) { - const classifier = getClassifier(); - let result = []; - for (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) { - const line = model.getLineContent(i); - const len = line.length; - let j = 0; - let linkBeginIndex = 0; - let linkBeginChCode = 0; - let state = 1 /* Start */; - let hasOpenParens = false; - let hasOpenSquareBracket = false; - let inSquareBrackets = false; - let hasOpenCurlyBracket = false; - while (j < len) { - let resetStateMachine = false; - const chCode = line.charCodeAt(j); - if (state === 13 /* Accept */) { - let chClass; - switch (chCode) { - case 40 /* OpenParen */: - hasOpenParens = true; - chClass = 0 /* None */; - break; - case 41 /* CloseParen */: - chClass = (hasOpenParens ? 0 /* None */ : 1 /* ForceTermination */); - break; - case 91 /* OpenSquareBracket */: - inSquareBrackets = true; - hasOpenSquareBracket = true; - chClass = 0 /* None */; - break; - case 93 /* CloseSquareBracket */: - inSquareBrackets = false; - chClass = (hasOpenSquareBracket ? 0 /* None */ : 1 /* ForceTermination */); - break; - case 123 /* OpenCurlyBrace */: - hasOpenCurlyBracket = true; - chClass = 0 /* None */; - break; - case 125 /* CloseCurlyBrace */: - chClass = (hasOpenCurlyBracket ? 0 /* None */ : 1 /* ForceTermination */); - break; - /* The following three rules make it that ' or " or ` are allowed inside links if the link began with a different one */ - case 39 /* SingleQuote */: - chClass = (linkBeginChCode === 34 /* DoubleQuote */ || linkBeginChCode === 96 /* BackTick */) ? 0 /* None */ : 1 /* ForceTermination */; - break; - case 34 /* DoubleQuote */: - chClass = (linkBeginChCode === 39 /* SingleQuote */ || linkBeginChCode === 96 /* BackTick */) ? 0 /* None */ : 1 /* ForceTermination */; - break; - case 96 /* BackTick */: - chClass = (linkBeginChCode === 39 /* SingleQuote */ || linkBeginChCode === 34 /* DoubleQuote */) ? 0 /* None */ : 1 /* ForceTermination */; - break; - case 42 /* Asterisk */: - // `*` terminates a link if the link began with `*` - chClass = (linkBeginChCode === 42 /* Asterisk */) ? 1 /* ForceTermination */ : 0 /* None */; - break; - case 124 /* Pipe */: - // `|` terminates a link if the link began with `|` - chClass = (linkBeginChCode === 124 /* Pipe */) ? 1 /* ForceTermination */ : 0 /* None */; - break; - case 32 /* Space */: - // ` ` allow space in between [ and ] - chClass = (inSquareBrackets ? 0 /* None */ : 1 /* ForceTermination */); - break; - default: - chClass = classifier.get(chCode); - } - // Check if character terminates link - if (chClass === 1 /* ForceTermination */) { - result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, j)); - resetStateMachine = true; - } - } - else if (state === 12 /* End */) { - let chClass; - if (chCode === 91 /* OpenSquareBracket */) { - // Allow for the authority part to contain ipv6 addresses which contain [ and ] - hasOpenSquareBracket = true; - chClass = 0 /* None */; - } - else { - chClass = classifier.get(chCode); - } - // Check if character terminates link - if (chClass === 1 /* ForceTermination */) { - resetStateMachine = true; - } - else { - state = 13 /* Accept */; - } - } - else { - state = stateMachine.nextState(state, chCode); - if (state === 0 /* Invalid */) { - resetStateMachine = true; - } - } - if (resetStateMachine) { - state = 1 /* Start */; - hasOpenParens = false; - hasOpenSquareBracket = false; - hasOpenCurlyBracket = false; - // Record where the link started - linkBeginIndex = j + 1; - linkBeginChCode = chCode; - } - j++; - } - if (state === 13 /* Accept */) { - result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, len)); - } - } - return result; - } -} -/** - * Returns an array of all links contains in the provided - * document. *Note* that this operation is computational - * expensive and should not run in the UI thread. - */ -function computeLinks(model) { - if (!model || typeof model.getLineCount !== 'function' || typeof model.getLineContent !== 'function') { - // Unknown caller! - return []; - } - return LinkComputer.computeLinks(model); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/modesRegistry.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/modesRegistry.js ***! - \********************************************************************************/ -/*! exports provided: Extensions, EditorModesRegistry, ModesRegistry, PLAINTEXT_MODE_ID, PLAINTEXT_LANGUAGE_IDENTIFIER */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Extensions", function() { return Extensions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorModesRegistry", function() { return EditorModesRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModesRegistry", function() { return ModesRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLAINTEXT_MODE_ID", function() { return PLAINTEXT_MODE_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLAINTEXT_LANGUAGE_IDENTIFIER", function() { return PLAINTEXT_LANGUAGE_IDENTIFIER; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _modes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/* harmony import */ var _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -// Define extension point ids -const Extensions = { - ModesRegistry: 'editor.modesRegistry' -}; -class EditorModesRegistry { - constructor() { - this._onDidChangeLanguages = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"](); - this.onDidChangeLanguages = this._onDidChangeLanguages.event; - this._languages = []; - this._dynamicLanguages = []; - } - // --- languages - registerLanguage(def) { - this._languages.push(def); - this._onDidChangeLanguages.fire(undefined); - return { - dispose: () => { - for (let i = 0, len = this._languages.length; i < len; i++) { - if (this._languages[i] === def) { - this._languages.splice(i, 1); - return; - } - } - } - }; - } - getLanguages() { - return [].concat(this._languages).concat(this._dynamicLanguages); - } -} -const ModesRegistry = new EditorModesRegistry(); -_platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_4__["Registry"].add(Extensions.ModesRegistry, ModesRegistry); -const PLAINTEXT_MODE_ID = 'plaintext'; -const PLAINTEXT_LANGUAGE_IDENTIFIER = new _modes_js__WEBPACK_IMPORTED_MODULE_2__["LanguageIdentifier"](PLAINTEXT_MODE_ID, 1 /* PlainText */); -ModesRegistry.registerLanguage({ - id: PLAINTEXT_MODE_ID, - extensions: ['.txt'], - aliases: [_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('plainText.alias', "Plain Text"), 'text'], - mimetypes: ['text/plain'] -}); -_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_3__["LanguageConfigurationRegistry"].register(PLAINTEXT_LANGUAGE_IDENTIFIER, { - brackets: [ - ['(', ')'], - ['[', ']'], - ['{', '}'], - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '<', close: '>' }, - { open: '\"', close: '\"' }, - { open: '\'', close: '\'' }, - { open: '`', close: '`' }, - ], - folding: { - offSide: true - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/nullMode.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/nullMode.js ***! - \***************************************************************************/ -/*! exports provided: NULL_STATE, NULL_MODE_ID, NULL_LANGUAGE_IDENTIFIER, nullTokenize, nullTokenize2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NULL_STATE", function() { return NULL_STATE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NULL_MODE_ID", function() { return NULL_MODE_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NULL_LANGUAGE_IDENTIFIER", function() { return NULL_LANGUAGE_IDENTIFIER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nullTokenize", function() { return nullTokenize; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nullTokenize2", function() { return nullTokenize2; }); -/* harmony import */ var _core_token_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/token.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js"); -/* harmony import */ var _modes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class NullStateImpl { - clone() { - return this; - } - equals(other) { - return (this === other); - } -} -const NULL_STATE = new NullStateImpl(); -const NULL_MODE_ID = 'vs.editor.nullMode'; -const NULL_LANGUAGE_IDENTIFIER = new _modes_js__WEBPACK_IMPORTED_MODULE_1__["LanguageIdentifier"](NULL_MODE_ID, 0 /* Null */); -function nullTokenize(modeId, buffer, state, deltaOffset) { - return new _core_token_js__WEBPACK_IMPORTED_MODULE_0__["TokenizationResult"]([new _core_token_js__WEBPACK_IMPORTED_MODULE_0__["Token"](deltaOffset, '', modeId)], state); -} -function nullTokenize2(languageId, buffer, state, deltaOffset) { - let tokens = new Uint32Array(2); - tokens[0] = deltaOffset; - tokens[1] = ((languageId << 0 /* LANGUAGEID_OFFSET */) - | (0 /* Other */ << 8 /* TOKEN_TYPE_OFFSET */) - | (0 /* None */ << 11 /* FONT_STYLE_OFFSET */) - | (1 /* DefaultForeground */ << 14 /* FOREGROUND_OFFSET */) - | (2 /* DefaultBackground */ << 23 /* BACKGROUND_OFFSET */)) >>> 0; - return new _core_token_js__WEBPACK_IMPORTED_MODULE_0__["TokenizationResult2"](tokens, state === null ? NULL_STATE : state); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports.js ***! - \***************************************************************************/ -/*! exports provided: createScopedLineTokens, ScopedLineTokens, ignoreBracketsInToken */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createScopedLineTokens", function() { return createScopedLineTokens; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScopedLineTokens", function() { return ScopedLineTokens; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreBracketsInToken", function() { return ignoreBracketsInToken; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function createScopedLineTokens(context, offset) { - let tokenCount = context.getCount(); - let tokenIndex = context.findTokenIndexAtOffset(offset); - let desiredLanguageId = context.getLanguageId(tokenIndex); - let lastTokenIndex = tokenIndex; - while (lastTokenIndex + 1 < tokenCount && context.getLanguageId(lastTokenIndex + 1) === desiredLanguageId) { - lastTokenIndex++; - } - let firstTokenIndex = tokenIndex; - while (firstTokenIndex > 0 && context.getLanguageId(firstTokenIndex - 1) === desiredLanguageId) { - firstTokenIndex--; - } - return new ScopedLineTokens(context, desiredLanguageId, firstTokenIndex, lastTokenIndex + 1, context.getStartOffset(firstTokenIndex), context.getEndOffset(lastTokenIndex)); -} -class ScopedLineTokens { - constructor(actual, languageId, firstTokenIndex, lastTokenIndex, firstCharOffset, lastCharOffset) { - this._actual = actual; - this.languageId = languageId; - this._firstTokenIndex = firstTokenIndex; - this._lastTokenIndex = lastTokenIndex; - this.firstCharOffset = firstCharOffset; - this._lastCharOffset = lastCharOffset; - } - getLineContent() { - const actualLineContent = this._actual.getLineContent(); - return actualLineContent.substring(this.firstCharOffset, this._lastCharOffset); - } - getActualLineContentBefore(offset) { - const actualLineContent = this._actual.getLineContent(); - return actualLineContent.substring(0, this.firstCharOffset + offset); - } - getTokenCount() { - return this._lastTokenIndex - this._firstTokenIndex; - } - findTokenIndexAtOffset(offset) { - return this._actual.findTokenIndexAtOffset(offset + this.firstCharOffset) - this._firstTokenIndex; - } - getStandardTokenType(tokenIndex) { - return this._actual.getStandardTokenType(tokenIndex + this._firstTokenIndex); - } -} -function ignoreBracketsInToken(standardTokenType) { - return (standardTokenType & 7 /* value */) !== 0; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/characterPair.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/characterPair.js ***! - \*****************************************************************************************/ -/*! exports provided: CharacterPairSupport */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterPairSupport", function() { return CharacterPairSupport; }); -/* harmony import */ var _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../languageConfiguration.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfiguration.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class CharacterPairSupport { - constructor(config) { - if (config.autoClosingPairs) { - this._autoClosingPairs = config.autoClosingPairs.map(el => new _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_0__["StandardAutoClosingPairConditional"](el)); - } - else if (config.brackets) { - this._autoClosingPairs = config.brackets.map(b => new _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_0__["StandardAutoClosingPairConditional"]({ open: b[0], close: b[1] })); - } - else { - this._autoClosingPairs = []; - } - if (config.__electricCharacterSupport && config.__electricCharacterSupport.docComment) { - const docComment = config.__electricCharacterSupport.docComment; - // IDocComment is legacy, only partially supported - this._autoClosingPairs.push(new _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_0__["StandardAutoClosingPairConditional"]({ open: docComment.open, close: docComment.close || '' })); - } - this._autoCloseBefore = typeof config.autoCloseBefore === 'string' ? config.autoCloseBefore : CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED; - this._surroundingPairs = config.surroundingPairs || this._autoClosingPairs; - } - getAutoClosingPairs() { - return this._autoClosingPairs; - } - getAutoCloseBeforeSet() { - return this._autoCloseBefore; - } - static shouldAutoClosePair(autoClosingPair, context, column) { - // Always complete on empty line - if (context.getTokenCount() === 0) { - return true; - } - const tokenIndex = context.findTokenIndexAtOffset(column - 2); - const standardTokenType = context.getStandardTokenType(tokenIndex); - return autoClosingPair.isOK(standardTokenType); - } - getSurroundingPairs() { - return this._surroundingPairs; - } -} -CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED = ';:.,=}])> \n\t'; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/electricCharacter.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/electricCharacter.js ***! - \*********************************************************************************************/ -/*! exports provided: BracketElectricCharacterSupport */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BracketElectricCharacterSupport", function() { return BracketElectricCharacterSupport; }); -/* harmony import */ var _supports_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../supports.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports.js"); -/* harmony import */ var _richEditBrackets_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./richEditBrackets.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/richEditBrackets.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class BracketElectricCharacterSupport { - constructor(richEditBrackets) { - this._richEditBrackets = richEditBrackets; - } - getElectricCharacters() { - let result = []; - if (this._richEditBrackets) { - for (const bracket of this._richEditBrackets.brackets) { - for (const close of bracket.close) { - const lastChar = close.charAt(close.length - 1); - result.push(lastChar); - } - } - } - // Filter duplicate entries - result = result.filter((item, pos, array) => { - return array.indexOf(item) === pos; - }); - return result; - } - onElectricCharacter(character, context, column) { - if (!this._richEditBrackets || this._richEditBrackets.brackets.length === 0) { - return null; - } - const tokenIndex = context.findTokenIndexAtOffset(column - 1); - if (Object(_supports_js__WEBPACK_IMPORTED_MODULE_0__["ignoreBracketsInToken"])(context.getStandardTokenType(tokenIndex))) { - return null; - } - const reversedBracketRegex = this._richEditBrackets.reversedRegex; - const text = context.getLineContent().substring(0, column - 1) + character; - const r = _richEditBrackets_js__WEBPACK_IMPORTED_MODULE_1__["BracketsUtils"].findPrevBracketInRange(reversedBracketRegex, 1, text, 0, text.length); - if (!r) { - return null; - } - const bracketText = text.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase(); - const isOpen = this._richEditBrackets.textIsOpenBracket[bracketText]; - if (isOpen) { - return null; - } - const textBeforeBracket = context.getActualLineContentBefore(r.startColumn - 1); - if (!/^\s*$/.test(textBeforeBracket)) { - // There is other text on the line before the bracket - return null; - } - return { - matchOpenBracket: bracketText - }; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/indentRules.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/indentRules.js ***! - \***************************************************************************************/ -/*! exports provided: IndentRulesSupport */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentRulesSupport", function() { return IndentRulesSupport; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class IndentRulesSupport { - constructor(indentationRules) { - this._indentationRules = indentationRules; - } - shouldIncrease(text) { - if (this._indentationRules) { - if (this._indentationRules.increaseIndentPattern && this._indentationRules.increaseIndentPattern.test(text)) { - return true; - } - // if (this._indentationRules.indentNextLinePattern && this._indentationRules.indentNextLinePattern.test(text)) { - // return true; - // } - } - return false; - } - shouldDecrease(text) { - if (this._indentationRules && this._indentationRules.decreaseIndentPattern && this._indentationRules.decreaseIndentPattern.test(text)) { - return true; - } - return false; - } - shouldIndentNextLine(text) { - if (this._indentationRules && this._indentationRules.indentNextLinePattern && this._indentationRules.indentNextLinePattern.test(text)) { - return true; - } - return false; - } - shouldIgnore(text) { - // the text matches `unIndentedLinePattern` - if (this._indentationRules && this._indentationRules.unIndentedLinePattern && this._indentationRules.unIndentedLinePattern.test(text)) { - return true; - } - return false; - } - getIndentMetadata(text) { - let ret = 0; - if (this.shouldIncrease(text)) { - ret += 1 /* INCREASE_MASK */; - } - if (this.shouldDecrease(text)) { - ret += 2 /* DECREASE_MASK */; - } - if (this.shouldIndentNextLine(text)) { - ret += 4 /* INDENT_NEXTLINE_MASK */; - } - if (this.shouldIgnore(text)) { - ret += 8 /* UNINDENT_MASK */; - } - return ret; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js ***! - \*************************************************************************************************/ -/*! exports provided: BasicInplaceReplace */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasicInplaceReplace", function() { return BasicInplaceReplace; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class BasicInplaceReplace { - constructor() { - this._defaultValueSet = [ - ['true', 'false'], - ['True', 'False'], - ['Private', 'Public', 'Friend', 'ReadOnly', 'Partial', 'Protected', 'WriteOnly'], - ['public', 'protected', 'private'], - ]; - } - navigateValueSet(range1, text1, range2, text2, up) { - if (range1 && text1) { - let result = this.doNavigateValueSet(text1, up); - if (result) { - return { - range: range1, - value: result - }; - } - } - if (range2 && text2) { - let result = this.doNavigateValueSet(text2, up); - if (result) { - return { - range: range2, - value: result - }; - } - } - return null; - } - doNavigateValueSet(text, up) { - let numberResult = this.numberReplace(text, up); - if (numberResult !== null) { - return numberResult; - } - return this.textReplace(text, up); - } - numberReplace(value, up) { - let precision = Math.pow(10, value.length - (value.lastIndexOf('.') + 1)); - let n1 = Number(value); - let n2 = parseFloat(value); - if (!isNaN(n1) && !isNaN(n2) && n1 === n2) { - if (n1 === 0 && !up) { - return null; // don't do negative - // } else if(n1 === 9 && up) { - // return null; // don't insert 10 into a number - } - else { - n1 = Math.floor(n1 * precision); - n1 += up ? precision : -precision; - return String(n1 / precision); - } - } - return null; - } - textReplace(value, up) { - return this.valueSetsReplace(this._defaultValueSet, value, up); - } - valueSetsReplace(valueSets, value, up) { - let result = null; - for (let i = 0, len = valueSets.length; result === null && i < len; i++) { - result = this.valueSetReplace(valueSets[i], value, up); - } - return result; - } - valueSetReplace(valueSet, value, up) { - let idx = valueSet.indexOf(value); - if (idx >= 0) { - idx += up ? +1 : -1; - if (idx < 0) { - idx = valueSet.length - 1; - } - else { - idx %= valueSet.length; - } - return valueSet[idx]; - } - return null; - } -} -BasicInplaceReplace.INSTANCE = new BasicInplaceReplace(); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/onEnter.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/onEnter.js ***! - \***********************************************************************************/ -/*! exports provided: OnEnterSupport */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OnEnterSupport", function() { return OnEnterSupport; }); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../languageConfiguration.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfiguration.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class OnEnterSupport { - constructor(opts) { - opts = opts || {}; - opts.brackets = opts.brackets || [ - ['(', ')'], - ['{', '}'], - ['[', ']'] - ]; - this._brackets = []; - opts.brackets.forEach((bracket) => { - const openRegExp = OnEnterSupport._createOpenBracketRegExp(bracket[0]); - const closeRegExp = OnEnterSupport._createCloseBracketRegExp(bracket[1]); - if (openRegExp && closeRegExp) { - this._brackets.push({ - open: bracket[0], - openRegExp: openRegExp, - close: bracket[1], - closeRegExp: closeRegExp, - }); - } - }); - this._regExpRules = opts.onEnterRules || []; - } - onEnter(autoIndent, oneLineAboveText, beforeEnterText, afterEnterText) { - // (1): `regExpRules` - if (autoIndent >= 3 /* Advanced */) { - for (let i = 0, len = this._regExpRules.length; i < len; i++) { - let rule = this._regExpRules[i]; - const regResult = [{ - reg: rule.beforeText, - text: beforeEnterText - }, { - reg: rule.afterText, - text: afterEnterText - }, { - reg: rule.oneLineAboveText, - text: oneLineAboveText - }].every((obj) => { - return obj.reg ? obj.reg.test(obj.text) : true; - }); - if (regResult) { - return rule.action; - } - } - } - // (2): Special indent-outdent - if (autoIndent >= 2 /* Brackets */) { - if (beforeEnterText.length > 0 && afterEnterText.length > 0) { - for (let i = 0, len = this._brackets.length; i < len; i++) { - let bracket = this._brackets[i]; - if (bracket.openRegExp.test(beforeEnterText) && bracket.closeRegExp.test(afterEnterText)) { - return { indentAction: _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_2__["IndentAction"].IndentOutdent }; - } - } - } - } - // (4): Open bracket based logic - if (autoIndent >= 2 /* Brackets */) { - if (beforeEnterText.length > 0) { - for (let i = 0, len = this._brackets.length; i < len; i++) { - let bracket = this._brackets[i]; - if (bracket.openRegExp.test(beforeEnterText)) { - return { indentAction: _languageConfiguration_js__WEBPACK_IMPORTED_MODULE_2__["IndentAction"].Indent }; - } - } - } - } - return null; - } - static _createOpenBracketRegExp(bracket) { - let str = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["escapeRegExpCharacters"](bracket); - if (!/\B/.test(str.charAt(0))) { - str = '\\b' + str; - } - str += '\\s*$'; - return OnEnterSupport._safeRegExp(str); - } - static _createCloseBracketRegExp(bracket) { - let str = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["escapeRegExpCharacters"](bracket); - if (!/\B/.test(str.charAt(str.length - 1))) { - str = str + '\\b'; - } - str = '^\\s*' + str; - return OnEnterSupport._safeRegExp(str); - } - static _safeRegExp(def) { - try { - return new RegExp(def); - } - catch (err) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(err); - return null; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/richEditBrackets.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/richEditBrackets.js ***! - \********************************************************************************************/ -/*! exports provided: RichEditBracket, RichEditBrackets, BracketsUtils */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RichEditBracket", function() { return RichEditBracket; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RichEditBrackets", function() { return RichEditBrackets; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BracketsUtils", function() { return BracketsUtils; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../core/stringBuilder.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/stringBuilder.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class RichEditBracket { - constructor(languageIdentifier, index, open, close, forwardRegex, reversedRegex) { - this.languageIdentifier = languageIdentifier; - this.index = index; - this.open = open; - this.close = close; - this.forwardRegex = forwardRegex; - this.reversedRegex = reversedRegex; - this._openSet = RichEditBracket._toSet(this.open); - this._closeSet = RichEditBracket._toSet(this.close); - } - isOpen(text) { - return this._openSet.has(text); - } - isClose(text) { - return this._closeSet.has(text); - } - static _toSet(arr) { - const result = new Set(); - for (const element of arr) { - result.add(element); - } - return result; - } -} -function groupFuzzyBrackets(brackets) { - const N = brackets.length; - brackets = brackets.map(b => [b[0].toLowerCase(), b[1].toLowerCase()]); - const group = []; - for (let i = 0; i < N; i++) { - group[i] = i; - } - const areOverlapping = (a, b) => { - const [aOpen, aClose] = a; - const [bOpen, bClose] = b; - return (aOpen === bOpen || aOpen === bClose || aClose === bOpen || aClose === bClose); - }; - const mergeGroups = (g1, g2) => { - const newG = Math.min(g1, g2); - const oldG = Math.max(g1, g2); - for (let i = 0; i < N; i++) { - if (group[i] === oldG) { - group[i] = newG; - } - } - }; - // group together brackets that have the same open or the same close sequence - for (let i = 0; i < N; i++) { - const a = brackets[i]; - for (let j = i + 1; j < N; j++) { - const b = brackets[j]; - if (areOverlapping(a, b)) { - mergeGroups(group[i], group[j]); - } - } - } - const result = []; - for (let g = 0; g < N; g++) { - let currentOpen = []; - let currentClose = []; - for (let i = 0; i < N; i++) { - if (group[i] === g) { - const [open, close] = brackets[i]; - currentOpen.push(open); - currentClose.push(close); - } - } - if (currentOpen.length > 0) { - result.push({ - open: currentOpen, - close: currentClose - }); - } - } - return result; -} -class RichEditBrackets { - constructor(languageIdentifier, _brackets) { - const brackets = groupFuzzyBrackets(_brackets); - this.brackets = brackets.map((b, index) => { - return new RichEditBracket(languageIdentifier, index, b.open, b.close, getRegexForBracketPair(b.open, b.close, brackets, index), getReversedRegexForBracketPair(b.open, b.close, brackets, index)); - }); - this.forwardRegex = getRegexForBrackets(this.brackets); - this.reversedRegex = getReversedRegexForBrackets(this.brackets); - this.textIsBracket = {}; - this.textIsOpenBracket = {}; - this.maxBracketLength = 0; - for (const bracket of this.brackets) { - for (const open of bracket.open) { - this.textIsBracket[open] = bracket; - this.textIsOpenBracket[open] = true; - this.maxBracketLength = Math.max(this.maxBracketLength, open.length); - } - for (const close of bracket.close) { - this.textIsBracket[close] = bracket; - this.textIsOpenBracket[close] = false; - this.maxBracketLength = Math.max(this.maxBracketLength, close.length); - } - } - } -} -function collectSuperstrings(str, brackets, currentIndex, dest) { - for (let i = 0, len = brackets.length; i < len; i++) { - if (i === currentIndex) { - continue; - } - const bracket = brackets[i]; - for (const open of bracket.open) { - if (open.indexOf(str) >= 0) { - dest.push(open); - } - } - for (const close of bracket.close) { - if (close.indexOf(str) >= 0) { - dest.push(close); - } - } - } -} -function lengthcmp(a, b) { - return a.length - b.length; -} -function unique(arr) { - if (arr.length <= 1) { - return arr; - } - const result = []; - const seen = new Set(); - for (const element of arr) { - if (seen.has(element)) { - continue; - } - result.push(element); - seen.add(element); - } - return result; -} -function getRegexForBracketPair(open, close, brackets, currentIndex) { - // search in all brackets for other brackets that are a superstring of these brackets - let pieces = []; - pieces = pieces.concat(open); - pieces = pieces.concat(close); - for (let i = 0, len = pieces.length; i < len; i++) { - collectSuperstrings(pieces[i], brackets, currentIndex, pieces); - } - pieces = unique(pieces); - pieces.sort(lengthcmp); - pieces.reverse(); - return createBracketOrRegExp(pieces); -} -function getReversedRegexForBracketPair(open, close, brackets, currentIndex) { - // search in all brackets for other brackets that are a superstring of these brackets - let pieces = []; - pieces = pieces.concat(open); - pieces = pieces.concat(close); - for (let i = 0, len = pieces.length; i < len; i++) { - collectSuperstrings(pieces[i], brackets, currentIndex, pieces); - } - pieces = unique(pieces); - pieces.sort(lengthcmp); - pieces.reverse(); - return createBracketOrRegExp(pieces.map(toReversedString)); -} -function getRegexForBrackets(brackets) { - let pieces = []; - for (const bracket of brackets) { - for (const open of bracket.open) { - pieces.push(open); - } - for (const close of bracket.close) { - pieces.push(close); - } - } - pieces = unique(pieces); - return createBracketOrRegExp(pieces); -} -function getReversedRegexForBrackets(brackets) { - let pieces = []; - for (const bracket of brackets) { - for (const open of bracket.open) { - pieces.push(open); - } - for (const close of bracket.close) { - pieces.push(close); - } - } - pieces = unique(pieces); - return createBracketOrRegExp(pieces.map(toReversedString)); -} -function prepareBracketForRegExp(str) { - // This bracket pair uses letters like e.g. "begin" - "end" - const insertWordBoundaries = (/^[\w ]+$/.test(str)); - str = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["escapeRegExpCharacters"](str); - return (insertWordBoundaries ? `\\b${str}\\b` : str); -} -function createBracketOrRegExp(pieces) { - let regexStr = `(${pieces.map(prepareBracketForRegExp).join(')|(')})`; - return _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["createRegExp"](regexStr, true); -} -const toReversedString = (function () { - function reverse(str) { - if (_core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_1__["hasTextDecoder"]) { - // create a Uint16Array and then use a TextDecoder to create a string - const arr = new Uint16Array(str.length); - let offset = 0; - for (let i = str.length - 1; i >= 0; i--) { - arr[offset++] = str.charCodeAt(i); - } - return _core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_1__["getPlatformTextDecoder"]().decode(arr); - } - else { - let result = [], resultLen = 0; - for (let i = str.length - 1; i >= 0; i--) { - result[resultLen++] = str.charAt(i); - } - return result.join(''); - } - } - let lastInput = null; - let lastOutput = null; - return function toReversedString(str) { - if (lastInput !== str) { - lastInput = str; - lastOutput = reverse(lastInput); - } - return lastOutput; - }; -})(); -class BracketsUtils { - static _findPrevBracketInText(reversedBracketRegex, lineNumber, reversedText, offset) { - let m = reversedText.match(reversedBracketRegex); - if (!m) { - return null; - } - let matchOffset = reversedText.length - (m.index || 0); - let matchLength = m[0].length; - let absoluteMatchOffset = offset + matchOffset; - return new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](lineNumber, absoluteMatchOffset - matchLength + 1, lineNumber, absoluteMatchOffset + 1); - } - static findPrevBracketInRange(reversedBracketRegex, lineNumber, lineText, startOffset, endOffset) { - // Because JS does not support backwards regex search, we search forwards in a reversed string with a reversed regex ;) - const reversedLineText = toReversedString(lineText); - const reversedSubstr = reversedLineText.substring(lineText.length - endOffset, lineText.length - startOffset); - return this._findPrevBracketInText(reversedBracketRegex, lineNumber, reversedSubstr, startOffset); - } - static findNextBracketInText(bracketRegex, lineNumber, text, offset) { - let m = text.match(bracketRegex); - if (!m) { - return null; - } - let matchOffset = m.index || 0; - let matchLength = m[0].length; - if (matchLength === 0) { - return null; - } - let absoluteMatchOffset = offset + matchOffset; - return new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](lineNumber, absoluteMatchOffset + 1, lineNumber, absoluteMatchOffset + 1 + matchLength); - } - static findNextBracketInRange(bracketRegex, lineNumber, lineText, startOffset, endOffset) { - const substr = lineText.substring(startOffset, endOffset); - return this.findNextBracketInText(bracketRegex, lineNumber, substr, startOffset); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/tokenization.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/tokenization.js ***! - \****************************************************************************************/ -/*! exports provided: ParsedTokenThemeRule, parseTokenTheme, ColorMap, TokenTheme, toStandardTokenType, strcmp, ThemeTrieElementRule, ThemeTrieElement, generateTokensCSSForColorMap */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParsedTokenThemeRule", function() { return ParsedTokenThemeRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseTokenTheme", function() { return parseTokenTheme; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorMap", function() { return ColorMap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenTheme", function() { return TokenTheme; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toStandardTokenType", function() { return toStandardTokenType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "strcmp", function() { return strcmp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeTrieElementRule", function() { return ThemeTrieElementRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeTrieElement", function() { return ThemeTrieElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generateTokensCSSForColorMap", function() { return generateTokensCSSForColorMap; }); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class ParsedTokenThemeRule { - constructor(token, index, fontStyle, foreground, background) { - this.token = token; - this.index = index; - this.fontStyle = fontStyle; - this.foreground = foreground; - this.background = background; - } -} -/** - * Parse a raw theme into rules. - */ -function parseTokenTheme(source) { - if (!source || !Array.isArray(source)) { - return []; - } - let result = [], resultLen = 0; - for (let i = 0, len = source.length; i < len; i++) { - let entry = source[i]; - let fontStyle = -1 /* NotSet */; - if (typeof entry.fontStyle === 'string') { - fontStyle = 0 /* None */; - let segments = entry.fontStyle.split(' '); - for (let j = 0, lenJ = segments.length; j < lenJ; j++) { - let segment = segments[j]; - switch (segment) { - case 'italic': - fontStyle = fontStyle | 1 /* Italic */; - break; - case 'bold': - fontStyle = fontStyle | 2 /* Bold */; - break; - case 'underline': - fontStyle = fontStyle | 4 /* Underline */; - break; - } - } - } - let foreground = null; - if (typeof entry.foreground === 'string') { - foreground = entry.foreground; - } - let background = null; - if (typeof entry.background === 'string') { - background = entry.background; - } - result[resultLen++] = new ParsedTokenThemeRule(entry.token || '', i, fontStyle, foreground, background); - } - return result; -} -/** - * Resolve rules (i.e. inheritance). - */ -function resolveParsedTokenThemeRules(parsedThemeRules, customTokenColors) { - // Sort rules lexicographically, and then by index if necessary - parsedThemeRules.sort((a, b) => { - let r = strcmp(a.token, b.token); - if (r !== 0) { - return r; - } - return a.index - b.index; - }); - // Determine defaults - let defaultFontStyle = 0 /* None */; - let defaultForeground = '000000'; - let defaultBackground = 'ffffff'; - while (parsedThemeRules.length >= 1 && parsedThemeRules[0].token === '') { - let incomingDefaults = parsedThemeRules.shift(); - if (incomingDefaults.fontStyle !== -1 /* NotSet */) { - defaultFontStyle = incomingDefaults.fontStyle; - } - if (incomingDefaults.foreground !== null) { - defaultForeground = incomingDefaults.foreground; - } - if (incomingDefaults.background !== null) { - defaultBackground = incomingDefaults.background; - } - } - let colorMap = new ColorMap(); - // start with token colors from custom token themes - for (let color of customTokenColors) { - colorMap.getId(color); - } - let foregroundColorId = colorMap.getId(defaultForeground); - let backgroundColorId = colorMap.getId(defaultBackground); - let defaults = new ThemeTrieElementRule(defaultFontStyle, foregroundColorId, backgroundColorId); - let root = new ThemeTrieElement(defaults); - for (let i = 0, len = parsedThemeRules.length; i < len; i++) { - let rule = parsedThemeRules[i]; - root.insert(rule.token, rule.fontStyle, colorMap.getId(rule.foreground), colorMap.getId(rule.background)); - } - return new TokenTheme(colorMap, root); -} -const colorRegExp = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/; -class ColorMap { - constructor() { - this._lastColorId = 0; - this._id2color = []; - this._color2id = new Map(); - } - getId(color) { - if (color === null) { - return 0; - } - const match = color.match(colorRegExp); - if (!match) { - throw new Error('Illegal value for token color: ' + color); - } - color = match[1].toUpperCase(); - let value = this._color2id.get(color); - if (value) { - return value; - } - value = ++this._lastColorId; - this._color2id.set(color, value); - this._id2color[value] = _base_common_color_js__WEBPACK_IMPORTED_MODULE_0__["Color"].fromHex('#' + color); - return value; - } - getColorMap() { - return this._id2color.slice(0); - } -} -class TokenTheme { - constructor(colorMap, root) { - this._colorMap = colorMap; - this._root = root; - this._cache = new Map(); - } - static createFromRawTokenTheme(source, customTokenColors) { - return this.createFromParsedTokenTheme(parseTokenTheme(source), customTokenColors); - } - static createFromParsedTokenTheme(source, customTokenColors) { - return resolveParsedTokenThemeRules(source, customTokenColors); - } - getColorMap() { - return this._colorMap.getColorMap(); - } - _match(token) { - return this._root.match(token); - } - match(languageId, token) { - // The cache contains the metadata without the language bits set. - let result = this._cache.get(token); - if (typeof result === 'undefined') { - let rule = this._match(token); - let standardToken = toStandardTokenType(token); - result = (rule.metadata - | (standardToken << 8 /* TOKEN_TYPE_OFFSET */)) >>> 0; - this._cache.set(token, result); - } - return (result - | (languageId << 0 /* LANGUAGEID_OFFSET */)) >>> 0; - } -} -const STANDARD_TOKEN_TYPE_REGEXP = /\b(comment|string|regex|regexp)\b/; -function toStandardTokenType(tokenType) { - let m = tokenType.match(STANDARD_TOKEN_TYPE_REGEXP); - if (!m) { - return 0 /* Other */; - } - switch (m[1]) { - case 'comment': - return 1 /* Comment */; - case 'string': - return 2 /* String */; - case 'regex': - return 4 /* RegEx */; - case 'regexp': - return 4 /* RegEx */; - } - throw new Error('Unexpected match for standard token type!'); -} -function strcmp(a, b) { - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - return 0; -} -class ThemeTrieElementRule { - constructor(fontStyle, foreground, background) { - this._fontStyle = fontStyle; - this._foreground = foreground; - this._background = background; - this.metadata = ((this._fontStyle << 11 /* FONT_STYLE_OFFSET */) - | (this._foreground << 14 /* FOREGROUND_OFFSET */) - | (this._background << 23 /* BACKGROUND_OFFSET */)) >>> 0; - } - clone() { - return new ThemeTrieElementRule(this._fontStyle, this._foreground, this._background); - } - acceptOverwrite(fontStyle, foreground, background) { - if (fontStyle !== -1 /* NotSet */) { - this._fontStyle = fontStyle; - } - if (foreground !== 0 /* None */) { - this._foreground = foreground; - } - if (background !== 0 /* None */) { - this._background = background; - } - this.metadata = ((this._fontStyle << 11 /* FONT_STYLE_OFFSET */) - | (this._foreground << 14 /* FOREGROUND_OFFSET */) - | (this._background << 23 /* BACKGROUND_OFFSET */)) >>> 0; - } -} -class ThemeTrieElement { - constructor(mainRule) { - this._mainRule = mainRule; - this._children = new Map(); - } - match(token) { - if (token === '') { - return this._mainRule; - } - let dotIndex = token.indexOf('.'); - let head; - let tail; - if (dotIndex === -1) { - head = token; - tail = ''; - } - else { - head = token.substring(0, dotIndex); - tail = token.substring(dotIndex + 1); - } - let child = this._children.get(head); - if (typeof child !== 'undefined') { - return child.match(tail); - } - return this._mainRule; - } - insert(token, fontStyle, foreground, background) { - if (token === '') { - // Merge into the main rule - this._mainRule.acceptOverwrite(fontStyle, foreground, background); - return; - } - let dotIndex = token.indexOf('.'); - let head; - let tail; - if (dotIndex === -1) { - head = token; - tail = ''; - } - else { - head = token.substring(0, dotIndex); - tail = token.substring(dotIndex + 1); - } - let child = this._children.get(head); - if (typeof child === 'undefined') { - child = new ThemeTrieElement(this._mainRule.clone()); - this._children.set(head, child); - } - child.insert(tail, fontStyle, foreground, background); - } -} -function generateTokensCSSForColorMap(colorMap) { - let rules = []; - for (let i = 1, len = colorMap.length; i < len; i++) { - let color = colorMap[i]; - rules[i] = `.mtk${i} { color: ${color}; }`; - } - rules.push('.mtki { font-style: italic; }'); - rules.push('.mtkb { font-weight: bold; }'); - rules.push('.mtku { text-decoration: underline; text-underline-position: under; }'); - return rules.join('\n'); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/textToHtmlTokenizer.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/textToHtmlTokenizer.js ***! - \**************************************************************************************/ -/*! exports provided: tokenizeToString, tokenizeLineToHTML */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tokenizeToString", function() { return tokenizeToString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tokenizeLineToHTML", function() { return tokenizeLineToHTML; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _core_lineTokens_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/lineTokens.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/lineTokens.js"); -/* harmony import */ var _nullMode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./nullMode.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/nullMode.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -const fallback = { - getInitialState: () => _nullMode_js__WEBPACK_IMPORTED_MODULE_2__["NULL_STATE"], - tokenize2: (buffer, state, deltaOffset) => Object(_nullMode_js__WEBPACK_IMPORTED_MODULE_2__["nullTokenize2"])(0 /* Null */, buffer, state, deltaOffset) -}; -function tokenizeToString(text, tokenizationSupport = fallback) { - return _tokenizeToString(text, tokenizationSupport || fallback); -} -function tokenizeLineToHTML(text, viewLineTokens, colorMap, startOffset, endOffset, tabSize, useNbsp) { - let result = `
    `; - let charIndex = startOffset; - let tabsCharDelta = 0; - for (let tokenIndex = 0, tokenCount = viewLineTokens.getCount(); tokenIndex < tokenCount; tokenIndex++) { - const tokenEndIndex = viewLineTokens.getEndOffset(tokenIndex); - if (tokenEndIndex <= startOffset) { - continue; - } - let partContent = ''; - for (; charIndex < tokenEndIndex && charIndex < endOffset; charIndex++) { - const charCode = text.charCodeAt(charIndex); - switch (charCode) { - case 9 /* Tab */: - let insertSpacesCount = tabSize - (charIndex + tabsCharDelta) % tabSize; - tabsCharDelta += insertSpacesCount - 1; - while (insertSpacesCount > 0) { - partContent += useNbsp ? ' ' : ' '; - insertSpacesCount--; - } - break; - case 60 /* LessThan */: - partContent += '<'; - break; - case 62 /* GreaterThan */: - partContent += '>'; - break; - case 38 /* Ampersand */: - partContent += '&'; - break; - case 0 /* Null */: - partContent += '�'; - break; - case 65279 /* UTF8_BOM */: - case 8232 /* LINE_SEPARATOR */: - case 8233 /* PARAGRAPH_SEPARATOR */: - case 133 /* NEXT_LINE */: - partContent += '\ufffd'; - break; - case 13 /* CarriageReturn */: - // zero width space, because carriage return would introduce a line break - partContent += '​'; - break; - case 32 /* Space */: - partContent += useNbsp ? ' ' : ' '; - break; - default: - partContent += String.fromCharCode(charCode); - } - } - result += `${partContent}`; - if (tokenEndIndex > endOffset || charIndex >= endOffset) { - break; - } - } - result += `
    `; - return result; -} -function _tokenizeToString(text, tokenizationSupport) { - let result = `
    `; - let lines = text.split(/\r\n|\r|\n/); - let currentState = tokenizationSupport.getInitialState(); - for (let i = 0, len = lines.length; i < len; i++) { - let line = lines[i]; - if (i > 0) { - result += `
    `; - } - let tokenizationResult = tokenizationSupport.tokenize2(line, currentState, 0); - _core_lineTokens_js__WEBPACK_IMPORTED_MODULE_1__["LineTokens"].convertToEndOffset(tokenizationResult.tokens, line.length); - let lineTokens = new _core_lineTokens_js__WEBPACK_IMPORTED_MODULE_1__["LineTokens"](tokenizationResult.tokens, line); - let viewLineTokens = lineTokens.inflate(); - let startOffset = 0; - for (let j = 0, lenJ = viewLineTokens.getCount(); j < lenJ; j++) { - const type = viewLineTokens.getClassName(j); - const endIndex = viewLineTokens.getEndOffset(j); - result += `${_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["escape"](line.substring(startOffset, endIndex))}`; - startOffset = endIndex; - } - currentState = tokenizationResult.endState; - } - result += `
    `; - return result; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/tokenizationRegistry.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/tokenizationRegistry.js ***! - \***************************************************************************************/ -/*! exports provided: TokenizationRegistryImpl */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationRegistryImpl", function() { return TokenizationRegistryImpl; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class TokenizationRegistryImpl { - constructor() { - this._map = new Map(); - this._promises = new Map(); - this._onDidChange = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this.onDidChange = this._onDidChange.event; - this._colorMap = null; - } - fire(languages) { - this._onDidChange.fire({ - changedLanguages: languages, - changedColorMap: false - }); - } - register(language, support) { - this._map.set(language, support); - this.fire([language]); - return Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => { - if (this._map.get(language) !== support) { - return; - } - this._map.delete(language); - this.fire([language]); - }); - } - registerPromise(language, supportPromise) { - let registration = null; - let isDisposed = false; - this._promises.set(language, supportPromise.then(support => { - this._promises.delete(language); - if (isDisposed || !support) { - return; - } - registration = this.register(language, support); - })); - return Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => { - isDisposed = true; - if (registration) { - registration.dispose(); - } - }); - } - getPromise(language) { - const support = this.get(language); - if (support) { - return Promise.resolve(support); - } - const promise = this._promises.get(language); - if (promise) { - return promise.then(_ => this.get(language)); - } - return null; - } - get(language) { - return (this._map.get(language) || null); - } - setColorMap(colorMap) { - this._colorMap = colorMap; - this._onDidChange.fire({ - changedLanguages: Array.from(this._map.keys()), - changedColorMap: true - }); - } - getColorMap() { - return this._colorMap; - } - getDefaultBackground() { - if (this._colorMap && this._colorMap.length > 2 /* DefaultBackground */) { - return this._colorMap[2 /* DefaultBackground */]; - } - return null; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js ***! - \****************************************************************************************/ -/*! exports provided: EditorSimpleWorker, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorSimpleWorker", function() { return EditorSimpleWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../diff/diffComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js"); -/* harmony import */ var _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../model/mirrorTextModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js"); -/* harmony import */ var _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../model/wordHelper.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js"); -/* harmony import */ var _modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modes/linkComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js"); -/* harmony import */ var _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modes/supports/inplaceReplaceSupport.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js"); -/* harmony import */ var _standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../standalone/standaloneBase.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - -/** - * @internal - */ -class MirrorModel extends _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_7__["MirrorTextModel"] { - get uri() { - return this._uri; - } - get version() { - return this._versionId; - } - get eol() { - return this._eol; - } - getValue() { - return this.getText(); - } - getLinesContent() { - return this._lines.slice(0); - } - getLineCount() { - return this._lines.length; - } - getLineContent(lineNumber) { - return this._lines[lineNumber - 1]; - } - getWordAtPosition(position, wordDefinition) { - let wordAtText = Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_8__["getWordAtText"])(position.column, Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_8__["ensureValidWordDefinition"])(wordDefinition), this._lines[position.lineNumber - 1], 0); - if (wordAtText) { - return new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); - } - return null; - } - words(wordDefinition) { - const lines = this._lines; - const wordenize = this._wordenize.bind(this); - let lineNumber = 0; - let lineText = ''; - let wordRangesIdx = 0; - let wordRanges = []; - return { - *[Symbol.iterator]() { - while (true) { - if (wordRangesIdx < wordRanges.length) { - const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); - wordRangesIdx += 1; - yield value; - } - else { - if (lineNumber < lines.length) { - lineText = lines[lineNumber]; - wordRanges = wordenize(lineText, wordDefinition); - wordRangesIdx = 0; - lineNumber += 1; - } - else { - break; - } - } - } - } - }; - } - getLineWords(lineNumber, wordDefinition) { - let content = this._lines[lineNumber - 1]; - let ranges = this._wordenize(content, wordDefinition); - let words = []; - for (const range of ranges) { - words.push({ - word: content.substring(range.start, range.end), - startColumn: range.start + 1, - endColumn: range.end + 1 - }); - } - return words; - } - _wordenize(content, wordDefinition) { - const result = []; - let match; - wordDefinition.lastIndex = 0; // reset lastIndex just to be sure - while (match = wordDefinition.exec(content)) { - if (match[0].length === 0) { - // it did match the empty string - break; - } - result.push({ start: match.index, end: match.index + match[0].length }); - } - return result; - } - getValueInRange(range) { - range = this._validateRange(range); - if (range.startLineNumber === range.endLineNumber) { - return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); - } - let lineEnding = this._eol; - let startLineIndex = range.startLineNumber - 1; - let endLineIndex = range.endLineNumber - 1; - let resultLines = []; - resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); - for (let i = startLineIndex + 1; i < endLineIndex; i++) { - resultLines.push(this._lines[i]); - } - resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); - return resultLines.join(lineEnding); - } - offsetAt(position) { - position = this._validatePosition(position); - this._ensureLineStarts(); - return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); - } - positionAt(offset) { - offset = Math.floor(offset); - offset = Math.max(0, offset); - this._ensureLineStarts(); - let out = this._lineStarts.getIndexOf(offset); - let lineLength = this._lines[out.index].length; - // Ensure we return a valid position - return { - lineNumber: 1 + out.index, - column: 1 + Math.min(out.remainder, lineLength) - }; - } - _validateRange(range) { - const start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); - const end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); - if (start.lineNumber !== range.startLineNumber - || start.column !== range.startColumn - || end.lineNumber !== range.endLineNumber - || end.column !== range.endColumn) { - return { - startLineNumber: start.lineNumber, - startColumn: start.column, - endLineNumber: end.lineNumber, - endColumn: end.column - }; - } - return range; - } - _validatePosition(position) { - if (!_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"].isIPosition(position)) { - throw new Error('bad position'); - } - let { lineNumber, column } = position; - let hasChanged = false; - if (lineNumber < 1) { - lineNumber = 1; - column = 1; - hasChanged = true; - } - else if (lineNumber > this._lines.length) { - lineNumber = this._lines.length; - column = this._lines[lineNumber - 1].length + 1; - hasChanged = true; - } - else { - let maxCharacter = this._lines[lineNumber - 1].length + 1; - if (column < 1) { - column = 1; - hasChanged = true; - } - else if (column > maxCharacter) { - column = maxCharacter; - hasChanged = true; - } - } - if (!hasChanged) { - return position; - } - else { - return { lineNumber, column }; - } - } -} -/** - * @internal - */ -class EditorSimpleWorker { - constructor(host, foreignModuleFactory) { - this._host = host; - this._models = Object.create(null); - this._foreignModuleFactory = foreignModuleFactory; - this._foreignModule = null; - } - dispose() { - this._models = Object.create(null); - } - _getModel(uri) { - return this._models[uri]; - } - _getModels() { - let all = []; - Object.keys(this._models).forEach((key) => all.push(this._models[key])); - return all; - } - acceptNewModel(data) { - this._models[data.url] = new MirrorModel(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"].parse(data.url), data.lines, data.EOL, data.versionId); - } - acceptModelChanged(strURL, e) { - if (!this._models[strURL]) { - return; - } - let model = this._models[strURL]; - model.onEvents(e); - } - acceptRemovedModel(strURL) { - if (!this._models[strURL]) { - return; - } - delete this._models[strURL]; - } - // ---- BEGIN diff -------------------------------------------------------------------------- - computeDiff(originalUrl, modifiedUrl, ignoreTrimWhitespace, maxComputationTime) { - return __awaiter(this, void 0, void 0, function* () { - const original = this._getModel(originalUrl); - const modified = this._getModel(modifiedUrl); - if (!original || !modified) { - return null; - } - const originalLines = original.getLinesContent(); - const modifiedLines = modified.getLinesContent(); - const diffComputer = new _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_6__["DiffComputer"](originalLines, modifiedLines, { - shouldComputeCharChanges: true, - shouldPostProcessCharChanges: true, - shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, - shouldMakePrettyDiff: true, - maxComputationTime: maxComputationTime - }); - const diffResult = diffComputer.computeDiff(); - const identical = (diffResult.changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); - return { - quitEarly: diffResult.quitEarly, - identical: identical, - changes: diffResult.changes - }; - }); - } - _modelsAreIdentical(original, modified) { - const originalLineCount = original.getLineCount(); - const modifiedLineCount = modified.getLineCount(); - if (originalLineCount !== modifiedLineCount) { - return false; - } - for (let line = 1; line <= originalLineCount; line++) { - const originalLine = original.getLineContent(line); - const modifiedLine = modified.getLineContent(line); - if (originalLine !== modifiedLine) { - return false; - } - } - return true; - } - computeMoreMinimalEdits(modelUrl, edits) { - return __awaiter(this, void 0, void 0, function* () { - const model = this._getModel(modelUrl); - if (!model) { - return edits; - } - const result = []; - let lastEol = undefined; - edits = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["mergeSort"])(edits, (a, b) => { - if (a.range && b.range) { - return _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].compareRangesUsingStarts(a.range, b.range); - } - // eol only changes should go to the end - let aRng = a.range ? 0 : 1; - let bRng = b.range ? 0 : 1; - return aRng - bRng; - }); - for (let { range, text, eol } of edits) { - if (typeof eol === 'number') { - lastEol = eol; - } - if (_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].isEmpty(range) && !text) { - // empty change - continue; - } - const original = model.getValueInRange(range); - text = text.replace(/\r\n|\n|\r/g, model.eol); - if (original === text) { - // noop - continue; - } - // make sure diff won't take too long - if (Math.max(text.length, original.length) > EditorSimpleWorker._diffLimit) { - result.push({ range, text }); - continue; - } - // compute diff between original and edit.text - const changes = Object(_base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__["stringDiff"])(original, text, false); - const editOffset = model.offsetAt(_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].lift(range).getStartPosition()); - for (const change of changes) { - const start = model.positionAt(editOffset + change.originalStart); - const end = model.positionAt(editOffset + change.originalStart + change.originalLength); - const newEdit = { - text: text.substr(change.modifiedStart, change.modifiedLength), - range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } - }; - if (model.getValueInRange(newEdit.range) !== newEdit.text) { - result.push(newEdit); - } - } - } - if (typeof lastEol === 'number') { - result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); - } - return result; - }); - } - // ---- END minimal edits --------------------------------------------------------------- - computeLinks(modelUrl) { - return __awaiter(this, void 0, void 0, function* () { - let model = this._getModel(modelUrl); - if (!model) { - return null; - } - return Object(_modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_9__["computeLinks"])(model); - }); - } - textualSuggest(modelUrl, position, wordDef, wordDefFlags) { - return __awaiter(this, void 0, void 0, function* () { - const model = this._getModel(modelUrl); - if (!model) { - return null; - } - const words = []; - const seen = new Set(); - const wordDefRegExp = new RegExp(wordDef, wordDefFlags); - const wordAt = model.getWordAtPosition(position, wordDefRegExp); - if (wordAt) { - seen.add(model.getValueInRange(wordAt)); - } - for (let word of model.words(wordDefRegExp)) { - if (seen.has(word)) { - continue; - } - seen.add(word); - if (!isNaN(Number(word))) { - continue; - } - words.push(word); - if (seen.size > EditorSimpleWorker._suggestionsLimit) { - break; - } - } - return words; - }); - } - // ---- END suggest -------------------------------------------------------------------------- - //#region -- word ranges -- - computeWordRanges(modelUrl, range, wordDef, wordDefFlags) { - return __awaiter(this, void 0, void 0, function* () { - let model = this._getModel(modelUrl); - if (!model) { - return Object.create(null); - } - const wordDefRegExp = new RegExp(wordDef, wordDefFlags); - const result = Object.create(null); - for (let line = range.startLineNumber; line < range.endLineNumber; line++) { - let words = model.getLineWords(line, wordDefRegExp); - for (const word of words) { - if (!isNaN(Number(word.word))) { - continue; - } - let array = result[word.word]; - if (!array) { - array = []; - result[word.word] = array; - } - array.push({ - startLineNumber: line, - startColumn: word.startColumn, - endLineNumber: line, - endColumn: word.endColumn - }); - } - } - return result; - }); - } - //#endregion - navigateValueSet(modelUrl, range, up, wordDef, wordDefFlags) { - return __awaiter(this, void 0, void 0, function* () { - let model = this._getModel(modelUrl); - if (!model) { - return null; - } - let wordDefRegExp = new RegExp(wordDef, wordDefFlags); - if (range.startColumn === range.endColumn) { - range = { - startLineNumber: range.startLineNumber, - startColumn: range.startColumn, - endLineNumber: range.endLineNumber, - endColumn: range.endColumn + 1 - }; - } - let selectionText = model.getValueInRange(range); - let wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); - if (!wordRange) { - return null; - } - let word = model.getValueInRange(wordRange); - let result = _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_10__["BasicInplaceReplace"].INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); - return result; - }); - } - // ---- BEGIN foreign module support -------------------------------------------------------------------------- - loadForeignModule(moduleId, createData, foreignHostMethods) { - const proxyMethodRequest = (method, args) => { - return this._host.fhr(method, args); - }; - const foreignHost = _base_common_types_js__WEBPACK_IMPORTED_MODULE_12__["createProxyObject"](foreignHostMethods, proxyMethodRequest); - let ctx = { - host: foreignHost, - getMirrorModels: () => { - return this._getModels(); - } - }; - if (this._foreignModuleFactory) { - this._foreignModule = this._foreignModuleFactory(ctx, createData); - // static foreing module - return Promise.resolve(_base_common_types_js__WEBPACK_IMPORTED_MODULE_12__["getAllMethodNames"](this._foreignModule)); - } - // ESM-comment-begin - // return new Promise((resolve, reject) => { - // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { - // this._foreignModule = foreignModule.create(ctx, createData); - // - // resolve(types.getAllMethodNames(this._foreignModule)); - // - // }, reject); - // }); - // ESM-comment-end - // ESM-uncomment-begin - return Promise.reject(new Error(`Unexpected usage`)); - // ESM-uncomment-end - } - // foreign method request - fmr(method, args) { - if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); - } - catch (e) { - return Promise.reject(e); - } - } -} -// ---- END diff -------------------------------------------------------------------------- -// ---- BEGIN minimal edits --------------------------------------------------------------- -EditorSimpleWorker._diffLimit = 100000; -// ---- BEGIN suggest -------------------------------------------------------------------------- -EditorSimpleWorker._suggestionsLimit = 10000; -/** - * Called on the worker side - * @internal - */ -function create(host) { - return new EditorSimpleWorker(host, null); -} -if (typeof importScripts === 'function') { - // Running in a web worker - _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["globals"].monaco = Object(_standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_11__["createMonacoBaseAPI"])(); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerService.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerService.js ***! - \*****************************************************************************************/ -/*! exports provided: ID_EDITOR_WORKER_SERVICE, IEditorWorkerService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ID_EDITOR_WORKER_SERVICE", function() { return ID_EDITOR_WORKER_SERVICE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IEditorWorkerService", function() { return IEditorWorkerService; }); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const ID_EDITOR_WORKER_SERVICE = 'editorWorkerService'; -const IEditorWorkerService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])(ID_EDITOR_WORKER_SERVICE); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerServiceImpl.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerServiceImpl.js ***! - \*********************************************************************************************/ -/*! exports provided: EditorWorkerServiceImpl, EditorWorkerHost, EditorWorkerClient */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorWorkerServiceImpl", function() { return EditorWorkerServiceImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorWorkerHost", function() { return EditorWorkerHost; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorWorkerClient", function() { return EditorWorkerClient; }); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/worker/simpleWorker.js */ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js"); -/* harmony import */ var _base_worker_defaultWorkerFactory_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/worker/defaultWorkerFactory.js */ "./node_modules/monaco-editor/esm/vs/base/worker/defaultWorkerFactory.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _modes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/* harmony import */ var _editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./editorSimpleWorker.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js"); -/* harmony import */ var _modelService_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _textResourceConfigurationService_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./textResourceConfigurationService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/textResourceConfigurationService.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../platform/log/common/log.js */ "./node_modules/monaco-editor/esm/vs/platform/log/common/log.js"); -/* harmony import */ var _base_common_stopwatch_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../base/common/stopwatch.js */ "./node_modules/monaco-editor/esm/vs/base/common/stopwatch.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - -/** - * Stop syncing a model to the worker if it was not needed for 1 min. - */ -const STOP_SYNC_MODEL_DELTA_TIME_MS = 60 * 1000; -/** - * Stop the worker if it was not needed for 5 min. - */ -const STOP_WORKER_DELTA_TIME_MS = 5 * 60 * 1000; -function canSyncModel(modelService, resource) { - let model = modelService.getModel(resource); - if (!model) { - return false; - } - if (model.isTooLargeForSyncing()) { - return false; - } - return true; -} -let EditorWorkerServiceImpl = class EditorWorkerServiceImpl extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(modelService, configurationService, logService) { - super(); - this._modelService = modelService; - this._workerManager = this._register(new WorkerManager(this._modelService)); - this._logService = logService; - // register default link-provider and default completions-provider - this._register(_modes_js__WEBPACK_IMPORTED_MODULE_5__["LinkProviderRegistry"].register('*', { - provideLinks: (model, token) => { - if (!canSyncModel(this._modelService, model.uri)) { - return Promise.resolve({ links: [] }); // File too large - } - return this._workerManager.withWorker().then(client => client.computeLinks(model.uri)).then(links => { - return links && { links }; - }); - } - })); - this._register(_modes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionProviderRegistry"].register('*', new WordBasedCompletionItemProvider(this._workerManager, configurationService, this._modelService))); - } - dispose() { - super.dispose(); - } - canComputeDiff(original, modified) { - return (canSyncModel(this._modelService, original) && canSyncModel(this._modelService, modified)); - } - computeDiff(original, modified, ignoreTrimWhitespace, maxComputationTime) { - return this._workerManager.withWorker().then(client => client.computeDiff(original, modified, ignoreTrimWhitespace, maxComputationTime)); - } - computeMoreMinimalEdits(resource, edits) { - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_11__["isNonEmptyArray"])(edits)) { - if (!canSyncModel(this._modelService, resource)) { - return Promise.resolve(edits); // File too large - } - const sw = _base_common_stopwatch_js__WEBPACK_IMPORTED_MODULE_13__["StopWatch"].create(true); - const result = this._workerManager.withWorker().then(client => client.computeMoreMinimalEdits(resource, edits)); - result.finally(() => this._logService.trace('FORMAT#computeMoreMinimalEdits', resource.toString(true), sw.elapsed())); - return result; - } - else { - return Promise.resolve(undefined); - } - } - canNavigateValueSet(resource) { - return (canSyncModel(this._modelService, resource)); - } - navigateValueSet(resource, range, up) { - return this._workerManager.withWorker().then(client => client.navigateValueSet(resource, range, up)); - } - canComputeWordRanges(resource) { - return canSyncModel(this._modelService, resource); - } - computeWordRanges(resource, range) { - return this._workerManager.withWorker().then(client => client.computeWordRanges(resource, range)); - } -}; -EditorWorkerServiceImpl = __decorate([ - __param(0, _modelService_js__WEBPACK_IMPORTED_MODULE_8__["IModelService"]), - __param(1, _textResourceConfigurationService_js__WEBPACK_IMPORTED_MODULE_9__["ITextResourceConfigurationService"]), - __param(2, _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_12__["ILogService"]) -], EditorWorkerServiceImpl); - -class WordBasedCompletionItemProvider { - constructor(workerManager, configurationService, modelService) { - this._debugDisplayName = 'wordbasedCompletions'; - this._workerManager = workerManager; - this._configurationService = configurationService; - this._modelService = modelService; - } - provideCompletionItems(model, position) { - return __awaiter(this, void 0, void 0, function* () { - const { wordBasedSuggestions } = this._configurationService.getValue(model.uri, position, 'editor'); - if (!wordBasedSuggestions) { - return undefined; - } - if (!canSyncModel(this._modelService, model.uri)) { - return undefined; // File too large - } - const word = model.getWordAtPosition(position); - const replace = !word ? _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].fromPositions(position) : new _core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](position.lineNumber, word.startColumn, position.lineNumber, word.endColumn); - const insert = replace.setEndPosition(position.lineNumber, position.column); - const client = yield this._workerManager.withWorker(); - const words = yield client.textualSuggest(model.uri, position); - if (!words) { - return undefined; - } - return { - suggestions: words.map((word) => { - return { - kind: 18 /* Text */, - label: word, - insertText: word, - range: { insert, replace } - }; - }) - }; - }); - } -} -class WorkerManager extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(modelService) { - super(); - this._modelService = modelService; - this._editorWorkerClient = null; - this._lastWorkerUsedTime = (new Date()).getTime(); - let stopWorkerInterval = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["IntervalTimer"]()); - stopWorkerInterval.cancelAndSet(() => this._checkStopIdleWorker(), Math.round(STOP_WORKER_DELTA_TIME_MS / 2)); - this._register(this._modelService.onModelRemoved(_ => this._checkStopEmptyWorker())); - } - dispose() { - if (this._editorWorkerClient) { - this._editorWorkerClient.dispose(); - this._editorWorkerClient = null; - } - super.dispose(); - } - /** - * Check if the model service has no more models and stop the worker if that is the case. - */ - _checkStopEmptyWorker() { - if (!this._editorWorkerClient) { - return; - } - let models = this._modelService.getModels(); - if (models.length === 0) { - // There are no more models => nothing possible for me to do - this._editorWorkerClient.dispose(); - this._editorWorkerClient = null; - } - } - /** - * Check if the worker has been idle for a while and then stop it. - */ - _checkStopIdleWorker() { - if (!this._editorWorkerClient) { - return; - } - let timeSinceLastWorkerUsedTime = (new Date()).getTime() - this._lastWorkerUsedTime; - if (timeSinceLastWorkerUsedTime > STOP_WORKER_DELTA_TIME_MS) { - this._editorWorkerClient.dispose(); - this._editorWorkerClient = null; - } - } - withWorker() { - this._lastWorkerUsedTime = (new Date()).getTime(); - if (!this._editorWorkerClient) { - this._editorWorkerClient = new EditorWorkerClient(this._modelService, false, 'editorWorkerService'); - } - return Promise.resolve(this._editorWorkerClient); - } -} -class EditorModelManager extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(proxy, modelService, keepIdleModels) { - super(); - this._syncedModels = Object.create(null); - this._syncedModelsLastUsedTime = Object.create(null); - this._proxy = proxy; - this._modelService = modelService; - if (!keepIdleModels) { - let timer = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["IntervalTimer"](); - timer.cancelAndSet(() => this._checkStopModelSync(), Math.round(STOP_SYNC_MODEL_DELTA_TIME_MS / 2)); - this._register(timer); - } - } - dispose() { - for (let modelUrl in this._syncedModels) { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this._syncedModels[modelUrl]); - } - this._syncedModels = Object.create(null); - this._syncedModelsLastUsedTime = Object.create(null); - super.dispose(); - } - ensureSyncedResources(resources) { - for (const resource of resources) { - let resourceStr = resource.toString(); - if (!this._syncedModels[resourceStr]) { - this._beginModelSync(resource); - } - if (this._syncedModels[resourceStr]) { - this._syncedModelsLastUsedTime[resourceStr] = (new Date()).getTime(); - } - } - } - _checkStopModelSync() { - let currentTime = (new Date()).getTime(); - let toRemove = []; - for (let modelUrl in this._syncedModelsLastUsedTime) { - let elapsedTime = currentTime - this._syncedModelsLastUsedTime[modelUrl]; - if (elapsedTime > STOP_SYNC_MODEL_DELTA_TIME_MS) { - toRemove.push(modelUrl); - } - } - for (const e of toRemove) { - this._stopModelSync(e); - } - } - _beginModelSync(resource) { - let model = this._modelService.getModel(resource); - if (!model) { - return; - } - if (model.isTooLargeForSyncing()) { - return; - } - let modelUrl = resource.toString(); - this._proxy.acceptNewModel({ - url: model.uri.toString(), - lines: model.getLinesContent(), - EOL: model.getEOL(), - versionId: model.getVersionId() - }); - const toDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - toDispose.add(model.onDidChangeContent((e) => { - this._proxy.acceptModelChanged(modelUrl.toString(), e); - })); - toDispose.add(model.onWillDispose(() => { - this._stopModelSync(modelUrl); - })); - toDispose.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => { - this._proxy.acceptRemovedModel(modelUrl); - })); - this._syncedModels[modelUrl] = toDispose; - } - _stopModelSync(modelUrl) { - let toDispose = this._syncedModels[modelUrl]; - delete this._syncedModels[modelUrl]; - delete this._syncedModelsLastUsedTime[modelUrl]; - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(toDispose); - } -} -class SynchronousWorkerClient { - constructor(instance) { - this._instance = instance; - this._proxyObj = Promise.resolve(this._instance); - } - dispose() { - this._instance.dispose(); - } - getProxyObject() { - return this._proxyObj; - } -} -class EditorWorkerHost { - constructor(workerClient) { - this._workerClient = workerClient; - } - // foreign host request - fhr(method, args) { - return this._workerClient.fhr(method, args); - } -} -class EditorWorkerClient extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(modelService, keepIdleModels, label) { - super(); - this._disposed = false; - this._modelService = modelService; - this._keepIdleModels = keepIdleModels; - this._workerFactory = new _base_worker_defaultWorkerFactory_js__WEBPACK_IMPORTED_MODULE_3__["DefaultWorkerFactory"](label); - this._worker = null; - this._modelManager = null; - } - // foreign host request - fhr(method, args) { - throw new Error(`Not implemented!`); - } - _getOrCreateWorker() { - if (!this._worker) { - try { - this._worker = this._register(new _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_2__["SimpleWorkerClient"](this._workerFactory, 'vs/editor/common/services/editorSimpleWorker', new EditorWorkerHost(this))); - } - catch (err) { - Object(_base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_2__["logOnceWebWorkerWarning"])(err); - this._worker = new SynchronousWorkerClient(new _editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_7__["EditorSimpleWorker"](new EditorWorkerHost(this), null)); - } - } - return this._worker; - } - _getProxy() { - return this._getOrCreateWorker().getProxyObject().then(undefined, (err) => { - Object(_base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_2__["logOnceWebWorkerWarning"])(err); - this._worker = new SynchronousWorkerClient(new _editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_7__["EditorSimpleWorker"](new EditorWorkerHost(this), null)); - return this._getOrCreateWorker().getProxyObject(); - }); - } - _getOrCreateModelManager(proxy) { - if (!this._modelManager) { - this._modelManager = this._register(new EditorModelManager(proxy, this._modelService, this._keepIdleModels)); - } - return this._modelManager; - } - _withSyncedResources(resources) { - if (this._disposed) { - return Promise.reject(Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_14__["canceled"])()); - } - return this._getProxy().then((proxy) => { - this._getOrCreateModelManager(proxy).ensureSyncedResources(resources); - return proxy; - }); - } - computeDiff(original, modified, ignoreTrimWhitespace, maxComputationTime) { - return this._withSyncedResources([original, modified]).then(proxy => { - return proxy.computeDiff(original.toString(), modified.toString(), ignoreTrimWhitespace, maxComputationTime); - }); - } - computeMoreMinimalEdits(resource, edits) { - return this._withSyncedResources([resource]).then(proxy => { - return proxy.computeMoreMinimalEdits(resource.toString(), edits); - }); - } - computeLinks(resource) { - return this._withSyncedResources([resource]).then(proxy => { - return proxy.computeLinks(resource.toString()); - }); - } - textualSuggest(resource, position) { - return this._withSyncedResources([resource]).then(proxy => { - let model = this._modelService.getModel(resource); - if (!model) { - return null; - } - let wordDefRegExp = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_6__["LanguageConfigurationRegistry"].getWordDefinition(model.getLanguageIdentifier().id); - let wordDef = wordDefRegExp.source; - let wordDefFlags = Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_10__["regExpFlags"])(wordDefRegExp); - return proxy.textualSuggest(resource.toString(), position, wordDef, wordDefFlags); - }); - } - computeWordRanges(resource, range) { - return this._withSyncedResources([resource]).then(proxy => { - let model = this._modelService.getModel(resource); - if (!model) { - return Promise.resolve(null); - } - let wordDefRegExp = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_6__["LanguageConfigurationRegistry"].getWordDefinition(model.getLanguageIdentifier().id); - let wordDef = wordDefRegExp.source; - let wordDefFlags = Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_10__["regExpFlags"])(wordDefRegExp); - return proxy.computeWordRanges(resource.toString(), range, wordDef, wordDefFlags); - }); - } - navigateValueSet(resource, range, up) { - return this._withSyncedResources([resource]).then(proxy => { - let model = this._modelService.getModel(resource); - if (!model) { - return null; - } - let wordDefRegExp = _modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_6__["LanguageConfigurationRegistry"].getWordDefinition(model.getLanguageIdentifier().id); - let wordDef = wordDefRegExp.source; - let wordDefFlags = Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_10__["regExpFlags"])(wordDefRegExp); - return proxy.navigateValueSet(resource.toString(), range, up, wordDef, wordDefFlags); - }); - } - dispose() { - super.dispose(); - this._disposed = true; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/getIconClasses.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/getIconClasses.js ***! - \************************************************************************************/ -/*! exports provided: getIconClasses, detectModeId, cssEscape */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getIconClasses", function() { return getIconClasses; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectModeId", function() { return detectModeId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cssEscape", function() { return cssEscape; }); -/* harmony import */ var _base_common_network_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _base_common_resources_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/* harmony import */ var _modes_modesRegistry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modes/modesRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/modesRegistry.js"); -/* harmony import */ var _platform_files_common_files_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../platform/files/common/files.js */ "./node_modules/monaco-editor/esm/vs/platform/files/common/files.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -function getIconClasses(modelService, modeService, resource, fileKind) { - // we always set these base classes even if we do not have a path - const classes = fileKind === _platform_files_common_files_js__WEBPACK_IMPORTED_MODULE_3__["FileKind"].ROOT_FOLDER ? ['rootfolder-icon'] : fileKind === _platform_files_common_files_js__WEBPACK_IMPORTED_MODULE_3__["FileKind"].FOLDER ? ['folder-icon'] : ['file-icon']; - if (resource) { - // Get the path and name of the resource. For data-URIs, we need to parse specially - let name; - if (resource.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_0__["Schemas"].data) { - const metadata = _base_common_resources_js__WEBPACK_IMPORTED_MODULE_1__["DataUri"].parseMetaData(resource); - name = metadata.get(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_1__["DataUri"].META_DATA_LABEL); - } - else { - name = cssEscape(Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_1__["basenameOrAuthority"])(resource).toLowerCase()); - } - // Folders - if (fileKind === _platform_files_common_files_js__WEBPACK_IMPORTED_MODULE_3__["FileKind"].FOLDER) { - classes.push(`${name}-name-folder-icon`); - } - // Files - else { - // Name & Extension(s) - if (name) { - classes.push(`${name}-name-file-icon`); - const dotSegments = name.split('.'); - for (let i = 1; i < dotSegments.length; i++) { - classes.push(`${dotSegments.slice(i).join('.')}-ext-file-icon`); // add each combination of all found extensions if more than one - } - classes.push(`ext-file-icon`); // extra segment to increase file-ext score - } - // Detected Mode - const detectedModeId = detectModeId(modelService, modeService, resource); - if (detectedModeId) { - classes.push(`${cssEscape(detectedModeId)}-lang-file-icon`); - } - } - } - return classes; -} -function detectModeId(modelService, modeService, resource) { - if (!resource) { - return null; // we need a resource at least - } - let modeId = null; - // Data URI: check for encoded metadata - if (resource.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_0__["Schemas"].data) { - const metadata = _base_common_resources_js__WEBPACK_IMPORTED_MODULE_1__["DataUri"].parseMetaData(resource); - const mime = metadata.get(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_1__["DataUri"].META_DATA_MIME); - if (mime) { - modeId = modeService.getModeId(mime); - } - } - // Any other URI: check for model if existing - else { - const model = modelService.getModel(resource); - if (model) { - modeId = model.getModeId(); - } - } - // only take if the mode is specific (aka no just plain text) - if (modeId && modeId !== _modes_modesRegistry_js__WEBPACK_IMPORTED_MODULE_2__["PLAINTEXT_MODE_ID"]) { - return modeId; - } - // otherwise fallback to path based detection - return modeService.getModeIdByFilepathOrFirstLine(resource); -} -function cssEscape(val) { - return val.replace(/\s/g, '\\$&'); // make sure to not introduce CSS classes from files that contain whitespace -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/languagesRegistry.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/languagesRegistry.js ***! - \***************************************************************************************/ -/*! exports provided: LanguagesRegistry */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguagesRegistry", function() { return LanguagesRegistry; }); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_mime_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/mime.js */ "./node_modules/monaco-editor/esm/vs/base/common/mime.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _modes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _modes_modesRegistry_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modes/modesRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/modesRegistry.js"); -/* harmony import */ var _modes_nullMode_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../modes/nullMode.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/nullMode.js"); -/* harmony import */ var _platform_configuration_common_configurationRegistry_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/configuration/common/configurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js"); -/* harmony import */ var _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - -const hasOwnProperty = Object.prototype.hasOwnProperty; -class LanguagesRegistry extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor(useModesRegistry = true, warnOnOverwrite = false) { - super(); - this._onDidChange = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidChange = this._onDidChange.event; - this._warnOnOverwrite = warnOnOverwrite; - this._nextLanguageId2 = 1; - this._languageIdToLanguage = []; - this._languageToLanguageId = Object.create(null); - this._languages = {}; - this._mimeTypesMap = {}; - this._nameMap = {}; - this._lowercaseNameMap = {}; - if (useModesRegistry) { - this._initializeFromRegistry(); - this._register(_modes_modesRegistry_js__WEBPACK_IMPORTED_MODULE_6__["ModesRegistry"].onDidChangeLanguages((m) => this._initializeFromRegistry())); - } - } - _initializeFromRegistry() { - this._languages = {}; - this._mimeTypesMap = {}; - this._nameMap = {}; - this._lowercaseNameMap = {}; - const desc = _modes_modesRegistry_js__WEBPACK_IMPORTED_MODULE_6__["ModesRegistry"].getLanguages(); - this._registerLanguages(desc); - } - _registerLanguages(desc) { - for (const d of desc) { - this._registerLanguage(d); - } - // Rebuild fast path maps - this._mimeTypesMap = {}; - this._nameMap = {}; - this._lowercaseNameMap = {}; - Object.keys(this._languages).forEach((langId) => { - let language = this._languages[langId]; - if (language.name) { - this._nameMap[language.name] = language.identifier; - } - language.aliases.forEach((alias) => { - this._lowercaseNameMap[alias.toLowerCase()] = language.identifier; - }); - language.mimetypes.forEach((mimetype) => { - this._mimeTypesMap[mimetype] = language.identifier; - }); - }); - _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_9__["Registry"].as(_platform_configuration_common_configurationRegistry_js__WEBPACK_IMPORTED_MODULE_8__["Extensions"].Configuration).registerOverrideIdentifiers(_modes_modesRegistry_js__WEBPACK_IMPORTED_MODULE_6__["ModesRegistry"].getLanguages().map(language => language.id)); - this._onDidChange.fire(); - } - _getLanguageId(language) { - if (this._languageToLanguageId[language]) { - return this._languageToLanguageId[language]; - } - const languageId = this._nextLanguageId2++; - this._languageIdToLanguage[languageId] = language; - this._languageToLanguageId[language] = languageId; - return languageId; - } - _registerLanguage(lang) { - const langId = lang.id; - let resolvedLanguage; - if (hasOwnProperty.call(this._languages, langId)) { - resolvedLanguage = this._languages[langId]; - } - else { - const languageId = this._getLanguageId(langId); - resolvedLanguage = { - identifier: new _modes_js__WEBPACK_IMPORTED_MODULE_5__["LanguageIdentifier"](langId, languageId), - name: null, - mimetypes: [], - aliases: [], - extensions: [], - filenames: [], - configurationFiles: [] - }; - this._languages[langId] = resolvedLanguage; - } - this._mergeLanguage(resolvedLanguage, lang); - } - _mergeLanguage(resolvedLanguage, lang) { - const langId = lang.id; - let primaryMime = null; - if (Array.isArray(lang.mimetypes) && lang.mimetypes.length > 0) { - resolvedLanguage.mimetypes.push(...lang.mimetypes); - primaryMime = lang.mimetypes[0]; - } - if (!primaryMime) { - primaryMime = `text/x-${langId}`; - resolvedLanguage.mimetypes.push(primaryMime); - } - if (Array.isArray(lang.extensions)) { - if (lang.configuration) { - // insert first as this appears to be the 'primary' language definition - resolvedLanguage.extensions = lang.extensions.concat(resolvedLanguage.extensions); - } - else { - resolvedLanguage.extensions = resolvedLanguage.extensions.concat(lang.extensions); - } - for (let extension of lang.extensions) { - _base_common_mime_js__WEBPACK_IMPORTED_MODULE_3__["registerTextMime"]({ id: langId, mime: primaryMime, extension: extension }, this._warnOnOverwrite); - } - } - if (Array.isArray(lang.filenames)) { - for (let filename of lang.filenames) { - _base_common_mime_js__WEBPACK_IMPORTED_MODULE_3__["registerTextMime"]({ id: langId, mime: primaryMime, filename: filename }, this._warnOnOverwrite); - resolvedLanguage.filenames.push(filename); - } - } - if (Array.isArray(lang.filenamePatterns)) { - for (let filenamePattern of lang.filenamePatterns) { - _base_common_mime_js__WEBPACK_IMPORTED_MODULE_3__["registerTextMime"]({ id: langId, mime: primaryMime, filepattern: filenamePattern }, this._warnOnOverwrite); - } - } - if (typeof lang.firstLine === 'string' && lang.firstLine.length > 0) { - let firstLineRegexStr = lang.firstLine; - if (firstLineRegexStr.charAt(0) !== '^') { - firstLineRegexStr = '^' + firstLineRegexStr; - } - try { - let firstLineRegex = new RegExp(firstLineRegexStr); - if (!_base_common_strings_js__WEBPACK_IMPORTED_MODULE_4__["regExpLeadsToEndlessLoop"](firstLineRegex)) { - _base_common_mime_js__WEBPACK_IMPORTED_MODULE_3__["registerTextMime"]({ id: langId, mime: primaryMime, firstline: firstLineRegex }, this._warnOnOverwrite); - } - } - catch (err) { - // Most likely, the regex was bad - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(err); - } - } - resolvedLanguage.aliases.push(langId); - let langAliases = null; - if (typeof lang.aliases !== 'undefined' && Array.isArray(lang.aliases)) { - if (lang.aliases.length === 0) { - // signal that this language should not get a name - langAliases = [null]; - } - else { - langAliases = lang.aliases; - } - } - if (langAliases !== null) { - for (const langAlias of langAliases) { - if (!langAlias || langAlias.length === 0) { - continue; - } - resolvedLanguage.aliases.push(langAlias); - } - } - let containsAliases = (langAliases !== null && langAliases.length > 0); - if (containsAliases && langAliases[0] === null) { - // signal that this language should not get a name - } - else { - let bestName = (containsAliases ? langAliases[0] : null) || langId; - if (containsAliases || !resolvedLanguage.name) { - resolvedLanguage.name = bestName; - } - } - if (lang.configuration) { - resolvedLanguage.configurationFiles.push(lang.configuration); - } - } - isRegisteredMode(mimetypeOrModeId) { - // Is this a known mime type ? - if (hasOwnProperty.call(this._mimeTypesMap, mimetypeOrModeId)) { - return true; - } - // Is this a known mode id ? - return hasOwnProperty.call(this._languages, mimetypeOrModeId); - } - getModeIdForLanguageNameLowercase(languageNameLower) { - if (!hasOwnProperty.call(this._lowercaseNameMap, languageNameLower)) { - return null; - } - return this._lowercaseNameMap[languageNameLower].language; - } - extractModeIds(commaSeparatedMimetypesOrCommaSeparatedIds) { - if (!commaSeparatedMimetypesOrCommaSeparatedIds) { - return []; - } - return (commaSeparatedMimetypesOrCommaSeparatedIds. - split(','). - map((mimeTypeOrId) => mimeTypeOrId.trim()). - map((mimeTypeOrId) => { - if (hasOwnProperty.call(this._mimeTypesMap, mimeTypeOrId)) { - return this._mimeTypesMap[mimeTypeOrId].language; - } - return mimeTypeOrId; - }). - filter((modeId) => { - return hasOwnProperty.call(this._languages, modeId); - })); - } - getLanguageIdentifier(_modeId) { - if (_modeId === _modes_nullMode_js__WEBPACK_IMPORTED_MODULE_7__["NULL_MODE_ID"] || _modeId === 0 /* Null */) { - return _modes_nullMode_js__WEBPACK_IMPORTED_MODULE_7__["NULL_LANGUAGE_IDENTIFIER"]; - } - let modeId; - if (typeof _modeId === 'string') { - modeId = _modeId; - } - else { - modeId = this._languageIdToLanguage[_modeId]; - if (!modeId) { - return null; - } - } - if (!hasOwnProperty.call(this._languages, modeId)) { - return null; - } - return this._languages[modeId].identifier; - } - getModeIdsFromFilepathOrFirstLine(resource, firstLine) { - if (!resource && !firstLine) { - return []; - } - let mimeTypes = _base_common_mime_js__WEBPACK_IMPORTED_MODULE_3__["guessMimeTypes"](resource, firstLine); - return this.extractModeIds(mimeTypes.join(',')); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/markerDecorationsServiceImpl.js": -/*!**************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/markerDecorationsServiceImpl.js ***! - \**************************************************************************************************/ -/*! exports provided: MarkerDecorationsService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerDecorationsService", function() { return MarkerDecorationsService; }); -/* harmony import */ var _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/markers/common/markers.js */ "./node_modules/monaco-editor/esm/vs/platform/markers/common/markers.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/* harmony import */ var _modelService_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_common_network_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - -function MODEL_ID(resource) { - return resource.toString(); -} -class MarkerDecorations extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(model) { - super(); - this.model = model; - this._markersData = new Map(); - this._register(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => { - this.model.deltaDecorations([...this._markersData.keys()], []); - this._markersData.clear(); - })); - } - update(markers, newDecorations) { - const oldIds = [...this._markersData.keys()]; - this._markersData.clear(); - const ids = this.model.deltaDecorations(oldIds, newDecorations); - for (let index = 0; index < ids.length; index++) { - this._markersData.set(ids[index], markers[index]); - } - return oldIds.length !== 0 || ids.length !== 0; - } - getMarker(decoration) { - return this._markersData.get(decoration.id); - } -} -let MarkerDecorationsService = class MarkerDecorationsService extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(modelService, _markerService) { - super(); - this._markerService = _markerService; - this._onDidChangeMarker = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_8__["Emitter"]()); - this._markerDecorations = new Map(); - modelService.getModels().forEach(model => this._onModelAdded(model)); - this._register(modelService.onModelAdded(this._onModelAdded, this)); - this._register(modelService.onModelRemoved(this._onModelRemoved, this)); - this._register(this._markerService.onMarkerChanged(this._handleMarkerChange, this)); - } - dispose() { - super.dispose(); - this._markerDecorations.forEach(value => value.dispose()); - this._markerDecorations.clear(); - } - getMarker(model, decoration) { - const markerDecorations = this._markerDecorations.get(MODEL_ID(model.uri)); - return markerDecorations ? (markerDecorations.getMarker(decoration) || null) : null; - } - _handleMarkerChange(changedResources) { - changedResources.forEach((resource) => { - const markerDecorations = this._markerDecorations.get(MODEL_ID(resource)); - if (markerDecorations) { - this._updateDecorations(markerDecorations); - } - }); - } - _onModelAdded(model) { - const markerDecorations = new MarkerDecorations(model); - this._markerDecorations.set(MODEL_ID(model.uri), markerDecorations); - this._updateDecorations(markerDecorations); - } - _onModelRemoved(model) { - const markerDecorations = this._markerDecorations.get(MODEL_ID(model.uri)); - if (markerDecorations) { - markerDecorations.dispose(); - this._markerDecorations.delete(MODEL_ID(model.uri)); - } - // clean up markers for internal, transient models - if (model.uri.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_7__["Schemas"].inMemory - || model.uri.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_7__["Schemas"].internal - || model.uri.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_7__["Schemas"].vscode) { - if (this._markerService) { - this._markerService.read({ resource: model.uri }).map(marker => marker.owner).forEach(owner => this._markerService.remove(owner, [model.uri])); - } - } - } - _updateDecorations(markerDecorations) { - // Limit to the first 500 errors/warnings - const markers = this._markerService.read({ resource: markerDecorations.model.uri, take: 500 }); - let newModelDecorations = markers.map((marker) => { - return { - range: this._createDecorationRange(markerDecorations.model, marker), - options: this._createDecorationOption(marker) - }; - }); - if (markerDecorations.update(markers, newModelDecorations)) { - this._onDidChangeMarker.fire(markerDecorations.model); - } - } - _createDecorationRange(model, rawMarker) { - let ret = _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].lift(rawMarker); - if (rawMarker.severity === _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__["MarkerSeverity"].Hint && !this._hasMarkerTag(rawMarker, 1 /* Unnecessary */) && !this._hasMarkerTag(rawMarker, 2 /* Deprecated */)) { - // * never render hints on multiple lines - // * make enough space for three dots - ret = ret.setEndPosition(ret.startLineNumber, ret.startColumn + 2); - } - ret = model.validateRange(ret); - if (ret.isEmpty()) { - let word = model.getWordAtPosition(ret.getStartPosition()); - if (word) { - ret = new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](ret.startLineNumber, word.startColumn, ret.endLineNumber, word.endColumn); - } - else { - let maxColumn = model.getLineLastNonWhitespaceColumn(ret.startLineNumber) || - model.getLineMaxColumn(ret.startLineNumber); - if (maxColumn === 1) { - // empty line - // console.warn('marker on empty line:', marker); - } - else if (ret.endColumn >= maxColumn) { - // behind eol - ret = new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](ret.startLineNumber, maxColumn - 1, ret.endLineNumber, maxColumn); - } - else { - // extend marker to width = 1 - ret = new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](ret.startLineNumber, ret.startColumn, ret.endLineNumber, ret.endColumn + 1); - } - } - } - else if (rawMarker.endColumn === Number.MAX_VALUE && rawMarker.startColumn === 1 && ret.startLineNumber === ret.endLineNumber) { - let minColumn = model.getLineFirstNonWhitespaceColumn(rawMarker.startLineNumber); - if (minColumn < ret.endColumn) { - ret = new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](ret.startLineNumber, minColumn, ret.endLineNumber, ret.endColumn); - rawMarker.startColumn = minColumn; - } - } - return ret; - } - _createDecorationOption(marker) { - let className; - let color = undefined; - let zIndex; - let inlineClassName = undefined; - let minimap; - switch (marker.severity) { - case _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__["MarkerSeverity"].Hint: - if (this._hasMarkerTag(marker, 2 /* Deprecated */)) { - className = undefined; - } - else if (this._hasMarkerTag(marker, 1 /* Unnecessary */)) { - className = "squiggly-unnecessary" /* EditorUnnecessaryDecoration */; - } - else { - className = "squiggly-hint" /* EditorHintDecoration */; - } - zIndex = 0; - break; - case _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__["MarkerSeverity"].Warning: - className = "squiggly-warning" /* EditorWarningDecoration */; - color = Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_3__["themeColorFromId"])(_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["overviewRulerWarning"]); - zIndex = 20; - minimap = { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_3__["themeColorFromId"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__["minimapWarning"]), - position: _model_js__WEBPACK_IMPORTED_MODULE_2__["MinimapPosition"].Inline - }; - break; - case _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__["MarkerSeverity"].Info: - className = "squiggly-info" /* EditorInfoDecoration */; - color = Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_3__["themeColorFromId"])(_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["overviewRulerInfo"]); - zIndex = 10; - break; - case _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__["MarkerSeverity"].Error: - default: - className = "squiggly-error" /* EditorErrorDecoration */; - color = Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_3__["themeColorFromId"])(_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["overviewRulerError"]); - zIndex = 30; - minimap = { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_3__["themeColorFromId"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__["minimapError"]), - position: _model_js__WEBPACK_IMPORTED_MODULE_2__["MinimapPosition"].Inline - }; - break; - } - if (marker.tags) { - if (marker.tags.indexOf(1 /* Unnecessary */) !== -1) { - inlineClassName = "squiggly-inline-unnecessary" /* EditorUnnecessaryInlineDecoration */; - } - if (marker.tags.indexOf(2 /* Deprecated */) !== -1) { - inlineClassName = "squiggly-inline-deprecated" /* EditorDeprecatedInlineDecoration */; - } - } - return { - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - className, - showIfCollapsed: true, - overviewRuler: { - color, - position: _model_js__WEBPACK_IMPORTED_MODULE_2__["OverviewRulerLane"].Right - }, - minimap, - zIndex, - inlineClassName, - }; - } - _hasMarkerTag(marker, tag) { - if (marker.tags) { - return marker.tags.indexOf(tag) >= 0; - } - return false; - } -}; -MarkerDecorationsService = __decorate([ - __param(0, _modelService_js__WEBPACK_IMPORTED_MODULE_5__["IModelService"]), - __param(1, _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__["IMarkerService"]) -], MarkerDecorationsService); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/markersDecorationService.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/markersDecorationService.js ***! - \**********************************************************************************************/ -/*! exports provided: IMarkerDecorationsService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IMarkerDecorationsService", function() { return IMarkerDecorationsService; }); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const IMarkerDecorationsService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('markerDecorationsService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/modeService.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/modeService.js ***! - \*********************************************************************************/ -/*! exports provided: IModeService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IModeService", function() { return IModeService; }); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const IModeService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('modeService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/modeServiceImpl.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/modeServiceImpl.js ***! - \*************************************************************************************/ -/*! exports provided: ModeServiceImpl */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModeServiceImpl", function() { return ModeServiceImpl; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _modes_abstractMode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modes/abstractMode.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/abstractMode.js"); -/* harmony import */ var _modes_nullMode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modes/nullMode.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/nullMode.js"); -/* harmony import */ var _languagesRegistry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./languagesRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/languagesRegistry.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -class LanguageSelection extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(onLanguagesMaybeChanged, selector) { - super(); - this._onDidChange = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this.onDidChange = this._onDidChange.event; - this._selector = selector; - this.languageIdentifier = this._selector(); - this._register(onLanguagesMaybeChanged(() => this._evaluate())); - } - _evaluate() { - let languageIdentifier = this._selector(); - if (languageIdentifier.id === this.languageIdentifier.id) { - // no change - return; - } - this.languageIdentifier = languageIdentifier; - this._onDidChange.fire(this.languageIdentifier); - } -} -class ModeServiceImpl { - constructor(warnOnOverwrite = false) { - this._onDidCreateMode = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this.onDidCreateMode = this._onDidCreateMode.event; - this._onLanguagesMaybeChanged = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this.onLanguagesMaybeChanged = this._onLanguagesMaybeChanged.event; - this._instantiatedModes = {}; - this._registry = new _languagesRegistry_js__WEBPACK_IMPORTED_MODULE_4__["LanguagesRegistry"](true, warnOnOverwrite); - this._registry.onDidChange(() => this._onLanguagesMaybeChanged.fire()); - } - isRegisteredMode(mimetypeOrModeId) { - return this._registry.isRegisteredMode(mimetypeOrModeId); - } - getModeIdForLanguageName(alias) { - return this._registry.getModeIdForLanguageNameLowercase(alias); - } - getModeIdByFilepathOrFirstLine(resource, firstLine) { - const modeIds = this._registry.getModeIdsFromFilepathOrFirstLine(resource, firstLine); - return Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_5__["firstOrDefault"])(modeIds, null); - } - getModeId(commaSeparatedMimetypesOrCommaSeparatedIds) { - const modeIds = this._registry.extractModeIds(commaSeparatedMimetypesOrCommaSeparatedIds); - return Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_5__["firstOrDefault"])(modeIds, null); - } - getLanguageIdentifier(modeId) { - return this._registry.getLanguageIdentifier(modeId); - } - // --- instantiation - create(commaSeparatedMimetypesOrCommaSeparatedIds) { - return new LanguageSelection(this.onLanguagesMaybeChanged, () => { - const modeId = this.getModeId(commaSeparatedMimetypesOrCommaSeparatedIds); - return this._createModeAndGetLanguageIdentifier(modeId); - }); - } - createByFilepathOrFirstLine(resource, firstLine) { - return new LanguageSelection(this.onLanguagesMaybeChanged, () => { - const modeId = this.getModeIdByFilepathOrFirstLine(resource, firstLine); - return this._createModeAndGetLanguageIdentifier(modeId); - }); - } - _createModeAndGetLanguageIdentifier(modeId) { - // Fall back to plain text if no mode was found - const languageIdentifier = this.getLanguageIdentifier(modeId || 'plaintext') || _modes_nullMode_js__WEBPACK_IMPORTED_MODULE_3__["NULL_LANGUAGE_IDENTIFIER"]; - this._getOrCreateMode(languageIdentifier.language); - return languageIdentifier; - } - triggerMode(commaSeparatedMimetypesOrCommaSeparatedIds) { - const modeId = this.getModeId(commaSeparatedMimetypesOrCommaSeparatedIds); - // Fall back to plain text if no mode was found - this._getOrCreateMode(modeId || 'plaintext'); - } - _getOrCreateMode(modeId) { - if (!this._instantiatedModes.hasOwnProperty(modeId)) { - let languageIdentifier = this.getLanguageIdentifier(modeId) || _modes_nullMode_js__WEBPACK_IMPORTED_MODULE_3__["NULL_LANGUAGE_IDENTIFIER"]; - this._instantiatedModes[modeId] = new _modes_abstractMode_js__WEBPACK_IMPORTED_MODULE_2__["FrankensteinMode"](languageIdentifier); - this._onDidCreateMode.fire(this._instantiatedModes[modeId]); - } - return this._instantiatedModes[modeId]; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js ***! - \**********************************************************************************/ -/*! exports provided: IModelService, shouldSynchronizeModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IModelService", function() { return IModelService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shouldSynchronizeModel", function() { return shouldSynchronizeModel; }); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const IModelService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('modelService'); -function shouldSynchronizeModel(model) { - return (!model.isTooLargeForSyncing() && !model.isForSimpleWidget); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelServiceImpl.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/modelServiceImpl.js ***! - \**************************************************************************************/ -/*! exports provided: ModelServiceImpl, SEMANTIC_HIGHLIGHTING_SETTING_ID, isSemanticColoringEnabled */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModelServiceImpl", function() { return ModelServiceImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SEMANTIC_HIGHLIGHTING_SETTING_ID", function() { return SEMANTIC_HIGHLIGHTING_SETTING_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSemanticColoringEnabled", function() { return isSemanticColoringEnabled; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _model_textModel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _modes_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _modes_modesRegistry_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../modes/modesRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/modesRegistry.js"); -/* harmony import */ var _textResourceConfigurationService_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./textResourceConfigurationService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/textResourceConfigurationService.js"); -/* harmony import */ var _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/log/common/log.js */ "./node_modules/monaco-editor/esm/vs/platform/log/common/log.js"); -/* harmony import */ var _platform_undoRedo_common_undoRedo_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/undoRedo/common/undoRedo.js */ "./node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js"); -/* harmony import */ var _base_common_hash_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../base/common/hash.js */ "./node_modules/monaco-editor/esm/vs/base/common/hash.js"); -/* harmony import */ var _model_editStack_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../model/editStack.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/editStack.js"); -/* harmony import */ var _semanticTokensProviderStyling_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./semanticTokensProviderStyling.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/semanticTokensProviderStyling.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - - - -function MODEL_ID(resource) { - return resource.toString(); -} -function computeModelSha1(model) { - // compute the sha1 - const shaComputer = new _base_common_hash_js__WEBPACK_IMPORTED_MODULE_15__["StringSHA1"](); - const snapshot = model.createSnapshot(); - let text; - while ((text = snapshot.read())) { - shaComputer.update(text); - } - return shaComputer.digest(); -} -class ModelData { - constructor(model, onWillDispose, onDidChangeLanguage) { - this._modelEventListeners = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this.model = model; - this._languageSelection = null; - this._languageSelectionListener = null; - this._modelEventListeners.add(model.onWillDispose(() => onWillDispose(model))); - this._modelEventListeners.add(model.onDidChangeLanguage((e) => onDidChangeLanguage(model, e))); - } - _disposeLanguageSelection() { - if (this._languageSelectionListener) { - this._languageSelectionListener.dispose(); - this._languageSelectionListener = null; - } - if (this._languageSelection) { - this._languageSelection.dispose(); - this._languageSelection = null; - } - } - dispose() { - this._modelEventListeners.dispose(); - this._disposeLanguageSelection(); - } - setLanguage(languageSelection) { - this._disposeLanguageSelection(); - this._languageSelection = languageSelection; - this._languageSelectionListener = this._languageSelection.onDidChange(() => this.model.setMode(languageSelection.languageIdentifier)); - this.model.setMode(languageSelection.languageIdentifier); - } -} -const DEFAULT_EOL = (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isLinux"] || _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"]) ? 1 /* LF */ : 2 /* CRLF */; -class DisposedModelInfo { - constructor(uri, initialUndoRedoSnapshot, time, sharesUndoRedoStack, heapSize, sha1, versionId, alternativeVersionId) { - this.uri = uri; - this.initialUndoRedoSnapshot = initialUndoRedoSnapshot; - this.time = time; - this.sharesUndoRedoStack = sharesUndoRedoStack; - this.heapSize = heapSize; - this.sha1 = sha1; - this.versionId = versionId; - this.alternativeVersionId = alternativeVersionId; - } -} -let ModelServiceImpl = class ModelServiceImpl extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(_configurationService, _resourcePropertiesService, _themeService, _logService, _undoRedoService) { - super(); - this._configurationService = _configurationService; - this._resourcePropertiesService = _resourcePropertiesService; - this._themeService = _themeService; - this._logService = _logService; - this._undoRedoService = _undoRedoService; - this._onModelAdded = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this.onModelAdded = this._onModelAdded.event; - this._onModelRemoved = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this.onModelRemoved = this._onModelRemoved.event; - this._onModelModeChanged = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this.onModelModeChanged = this._onModelModeChanged.event; - this._modelCreationOptionsByLanguageAndResource = Object.create(null); - this._models = {}; - this._disposedModels = new Map(); - this._disposedModelsHeapSize = 0; - this._semanticStyling = this._register(new SemanticStyling(this._themeService, this._logService)); - this._register(this._configurationService.onDidChangeConfiguration(() => this._updateModelOptions())); - this._updateModelOptions(); - this._register(new SemanticColoringFeature(this, this._themeService, this._configurationService, this._semanticStyling)); - } - static _readModelOptions(config, isForSimpleWidget) { - let tabSize = _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["EDITOR_MODEL_DEFAULTS"].tabSize; - if (config.editor && typeof config.editor.tabSize !== 'undefined') { - const parsedTabSize = parseInt(config.editor.tabSize, 10); - if (!isNaN(parsedTabSize)) { - tabSize = parsedTabSize; - } - if (tabSize < 1) { - tabSize = 1; - } - } - let indentSize = tabSize; - if (config.editor && typeof config.editor.indentSize !== 'undefined' && config.editor.indentSize !== 'tabSize') { - const parsedIndentSize = parseInt(config.editor.indentSize, 10); - if (!isNaN(parsedIndentSize)) { - indentSize = parsedIndentSize; - } - if (indentSize < 1) { - indentSize = 1; - } - } - let insertSpaces = _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["EDITOR_MODEL_DEFAULTS"].insertSpaces; - if (config.editor && typeof config.editor.insertSpaces !== 'undefined') { - insertSpaces = (config.editor.insertSpaces === 'false' ? false : Boolean(config.editor.insertSpaces)); - } - let newDefaultEOL = DEFAULT_EOL; - const eol = config.eol; - if (eol === '\r\n') { - newDefaultEOL = 2 /* CRLF */; - } - else if (eol === '\n') { - newDefaultEOL = 1 /* LF */; - } - let trimAutoWhitespace = _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["EDITOR_MODEL_DEFAULTS"].trimAutoWhitespace; - if (config.editor && typeof config.editor.trimAutoWhitespace !== 'undefined') { - trimAutoWhitespace = (config.editor.trimAutoWhitespace === 'false' ? false : Boolean(config.editor.trimAutoWhitespace)); - } - let detectIndentation = _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["EDITOR_MODEL_DEFAULTS"].detectIndentation; - if (config.editor && typeof config.editor.detectIndentation !== 'undefined') { - detectIndentation = (config.editor.detectIndentation === 'false' ? false : Boolean(config.editor.detectIndentation)); - } - let largeFileOptimizations = _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["EDITOR_MODEL_DEFAULTS"].largeFileOptimizations; - if (config.editor && typeof config.editor.largeFileOptimizations !== 'undefined') { - largeFileOptimizations = (config.editor.largeFileOptimizations === 'false' ? false : Boolean(config.editor.largeFileOptimizations)); - } - return { - isForSimpleWidget: isForSimpleWidget, - tabSize: tabSize, - indentSize: indentSize, - insertSpaces: insertSpaces, - detectIndentation: detectIndentation, - defaultEOL: newDefaultEOL, - trimAutoWhitespace: trimAutoWhitespace, - largeFileOptimizations: largeFileOptimizations - }; - } - _getEOL(resource, language) { - if (resource) { - return this._resourcePropertiesService.getEOL(resource, language); - } - const eol = this._configurationService.getValue('files.eol', { overrideIdentifier: language }); - if (eol && eol !== 'auto') { - return eol; - } - return _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["OS"] === 3 /* Linux */ || _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["OS"] === 2 /* Macintosh */ ? '\n' : '\r\n'; - } - getCreationOptions(language, resource, isForSimpleWidget) { - let creationOptions = this._modelCreationOptionsByLanguageAndResource[language + resource]; - if (!creationOptions) { - const editor = this._configurationService.getValue('editor', { overrideIdentifier: language, resource }); - const eol = this._getEOL(resource, language); - creationOptions = ModelServiceImpl._readModelOptions({ editor, eol }, isForSimpleWidget); - this._modelCreationOptionsByLanguageAndResource[language + resource] = creationOptions; - } - return creationOptions; - } - _updateModelOptions() { - const oldOptionsByLanguageAndResource = this._modelCreationOptionsByLanguageAndResource; - this._modelCreationOptionsByLanguageAndResource = Object.create(null); - // Update options on all models - const keys = Object.keys(this._models); - for (let i = 0, len = keys.length; i < len; i++) { - const modelId = keys[i]; - const modelData = this._models[modelId]; - const language = modelData.model.getLanguageIdentifier().language; - const uri = modelData.model.uri; - const oldOptions = oldOptionsByLanguageAndResource[language + uri]; - const newOptions = this.getCreationOptions(language, uri, modelData.model.isForSimpleWidget); - ModelServiceImpl._setModelOptionsForModel(modelData.model, newOptions, oldOptions); - } - } - static _setModelOptionsForModel(model, newOptions, currentOptions) { - if (currentOptions && currentOptions.defaultEOL !== newOptions.defaultEOL && model.getLineCount() === 1) { - model.setEOL(newOptions.defaultEOL === 1 /* LF */ ? 0 /* LF */ : 1 /* CRLF */); - } - if (currentOptions - && (currentOptions.detectIndentation === newOptions.detectIndentation) - && (currentOptions.insertSpaces === newOptions.insertSpaces) - && (currentOptions.tabSize === newOptions.tabSize) - && (currentOptions.indentSize === newOptions.indentSize) - && (currentOptions.trimAutoWhitespace === newOptions.trimAutoWhitespace)) { - // Same indent opts, no need to touch the model - return; - } - if (newOptions.detectIndentation) { - model.detectIndentation(newOptions.insertSpaces, newOptions.tabSize); - model.updateOptions({ - trimAutoWhitespace: newOptions.trimAutoWhitespace - }); - } - else { - model.updateOptions({ - insertSpaces: newOptions.insertSpaces, - tabSize: newOptions.tabSize, - indentSize: newOptions.indentSize, - trimAutoWhitespace: newOptions.trimAutoWhitespace - }); - } - } - _removeDisposedModel(resource) { - const disposedModelData = this._disposedModels.get(MODEL_ID(resource)); - if (disposedModelData) { - this._disposedModelsHeapSize -= disposedModelData.heapSize; - } - this._disposedModels.delete(MODEL_ID(resource)); - return disposedModelData; - } - _createModelData(value, languageIdentifier, resource, isForSimpleWidget) { - // create & save the model - const options = this.getCreationOptions(languageIdentifier.language, resource, isForSimpleWidget); - const model = new _model_textModel_js__WEBPACK_IMPORTED_MODULE_5__["TextModel"](value, options, languageIdentifier, resource, this._undoRedoService); - if (resource && this._disposedModels.has(MODEL_ID(resource))) { - const disposedModelData = this._removeDisposedModel(resource); - const elements = this._undoRedoService.getElements(resource); - const sha1IsEqual = (computeModelSha1(model) === disposedModelData.sha1); - if (sha1IsEqual || disposedModelData.sharesUndoRedoStack) { - for (const element of elements.past) { - if (Object(_model_editStack_js__WEBPACK_IMPORTED_MODULE_16__["isEditStackElement"])(element) && element.matchesResource(resource)) { - element.setModel(model); - } - } - for (const element of elements.future) { - if (Object(_model_editStack_js__WEBPACK_IMPORTED_MODULE_16__["isEditStackElement"])(element) && element.matchesResource(resource)) { - element.setModel(model); - } - } - this._undoRedoService.setElementsValidFlag(resource, true, (element) => (Object(_model_editStack_js__WEBPACK_IMPORTED_MODULE_16__["isEditStackElement"])(element) && element.matchesResource(resource))); - if (sha1IsEqual) { - model._overwriteVersionId(disposedModelData.versionId); - model._overwriteAlternativeVersionId(disposedModelData.alternativeVersionId); - model._overwriteInitialUndoRedoSnapshot(disposedModelData.initialUndoRedoSnapshot); - } - } - else { - if (disposedModelData.initialUndoRedoSnapshot !== null) { - this._undoRedoService.restoreSnapshot(disposedModelData.initialUndoRedoSnapshot); - } - } - } - const modelId = MODEL_ID(model.uri); - if (this._models[modelId]) { - // There already exists a model with this id => this is a programmer error - throw new Error('ModelService: Cannot add model because it already exists!'); - } - const modelData = new ModelData(model, (model) => this._onWillDispose(model), (model, e) => this._onDidChangeLanguage(model, e)); - this._models[modelId] = modelData; - return modelData; - } - createModel(value, languageSelection, resource, isForSimpleWidget = false) { - let modelData; - if (languageSelection) { - modelData = this._createModelData(value, languageSelection.languageIdentifier, resource, isForSimpleWidget); - this.setMode(modelData.model, languageSelection); - } - else { - modelData = this._createModelData(value, _modes_modesRegistry_js__WEBPACK_IMPORTED_MODULE_7__["PLAINTEXT_LANGUAGE_IDENTIFIER"], resource, isForSimpleWidget); - } - this._onModelAdded.fire(modelData.model); - return modelData.model; - } - setMode(model, languageSelection) { - if (!languageSelection) { - return; - } - const modelData = this._models[MODEL_ID(model.uri)]; - if (!modelData) { - return; - } - modelData.setLanguage(languageSelection); - } - getModels() { - const ret = []; - const keys = Object.keys(this._models); - for (let i = 0, len = keys.length; i < len; i++) { - const modelId = keys[i]; - ret.push(this._models[modelId].model); - } - return ret; - } - getModel(resource) { - const modelId = MODEL_ID(resource); - const modelData = this._models[modelId]; - if (!modelData) { - return null; - } - return modelData.model; - } - getSemanticTokensProviderStyling(provider) { - return this._semanticStyling.get(provider); - } - // --- end IModelService - _onWillDispose(model) { - const modelId = MODEL_ID(model.uri); - const modelData = this._models[modelId]; - delete this._models[modelId]; - modelData.dispose(); - // clean up cache - delete this._modelCreationOptionsByLanguageAndResource[model.getLanguageIdentifier().language + model.uri]; - this._onModelRemoved.fire(model); - } - _onDidChangeLanguage(model, e) { - const oldModeId = e.oldLanguage; - const newModeId = model.getLanguageIdentifier().language; - const oldOptions = this.getCreationOptions(oldModeId, model.uri, model.isForSimpleWidget); - const newOptions = this.getCreationOptions(newModeId, model.uri, model.isForSimpleWidget); - ModelServiceImpl._setModelOptionsForModel(model, newOptions, oldOptions); - this._onModelModeChanged.fire({ model, oldModeId }); - } -}; -ModelServiceImpl = __decorate([ - __param(0, _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_9__["IConfigurationService"]), - __param(1, _textResourceConfigurationService_js__WEBPACK_IMPORTED_MODULE_8__["ITextResourcePropertiesService"]), - __param(2, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_12__["IThemeService"]), - __param(3, _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_13__["ILogService"]), - __param(4, _platform_undoRedo_common_undoRedo_js__WEBPACK_IMPORTED_MODULE_14__["IUndoRedoService"]) -], ModelServiceImpl); - -const SEMANTIC_HIGHLIGHTING_SETTING_ID = 'editor.semanticHighlighting'; -function isSemanticColoringEnabled(model, themeService, configurationService) { - var _a; - const setting = (_a = configurationService.getValue(SEMANTIC_HIGHLIGHTING_SETTING_ID, { overrideIdentifier: model.getLanguageIdentifier().language, resource: model.uri })) === null || _a === void 0 ? void 0 : _a.enabled; - if (typeof setting === 'boolean') { - return setting; - } - return themeService.getColorTheme().semanticHighlighting; -} -class SemanticColoringFeature extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(modelService, themeService, configurationService, semanticStyling) { - super(); - this._watchers = Object.create(null); - this._semanticStyling = semanticStyling; - const register = (model) => { - this._watchers[model.uri.toString()] = new ModelSemanticColoring(model, themeService, this._semanticStyling); - }; - const deregister = (model, modelSemanticColoring) => { - modelSemanticColoring.dispose(); - delete this._watchers[model.uri.toString()]; - }; - const handleSettingOrThemeChange = () => { - for (let model of modelService.getModels()) { - const curr = this._watchers[model.uri.toString()]; - if (isSemanticColoringEnabled(model, themeService, configurationService)) { - if (!curr) { - register(model); - } - } - else { - if (curr) { - deregister(model, curr); - } - } - } - }; - this._register(modelService.onModelAdded((model) => { - if (isSemanticColoringEnabled(model, themeService, configurationService)) { - register(model); - } - })); - this._register(modelService.onModelRemoved((model) => { - const curr = this._watchers[model.uri.toString()]; - if (curr) { - deregister(model, curr); - } - })); - this._register(configurationService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration(SEMANTIC_HIGHLIGHTING_SETTING_ID)) { - handleSettingOrThemeChange(); - } - })); - this._register(themeService.onDidColorThemeChange(handleSettingOrThemeChange)); - } -} -class SemanticStyling extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(_themeService, _logService) { - super(); - this._themeService = _themeService; - this._logService = _logService; - this._caches = new WeakMap(); - this._register(this._themeService.onDidColorThemeChange(() => { - this._caches = new WeakMap(); - })); - } - get(provider) { - if (!this._caches.has(provider)) { - this._caches.set(provider, new _semanticTokensProviderStyling_js__WEBPACK_IMPORTED_MODULE_17__["SemanticTokensProviderStyling"](provider.getLegend(), this._themeService, this._logService)); - } - return this._caches.get(provider); - } -} -class SemanticTokensResponse { - constructor(_provider, resultId, data) { - this._provider = _provider; - this.resultId = resultId; - this.data = data; - } - dispose() { - this._provider.releaseDocumentSemanticTokens(this.resultId); - } -} -class ModelSemanticColoring extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(model, themeService, stylingProvider) { - super(); - this._isDisposed = false; - this._model = model; - this._semanticStyling = stylingProvider; - this._fetchDocumentSemanticTokens = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_10__["RunOnceScheduler"](() => this._fetchDocumentSemanticTokensNow(), 300)); - this._currentDocumentResponse = null; - this._currentDocumentRequestCancellationTokenSource = null; - this._documentProvidersChangeListeners = []; - this._register(this._model.onDidChangeContent(() => { - if (!this._fetchDocumentSemanticTokens.isScheduled()) { - this._fetchDocumentSemanticTokens.schedule(); - } - })); - const bindDocumentChangeListeners = () => { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this._documentProvidersChangeListeners); - this._documentProvidersChangeListeners = []; - for (const provider of _modes_js__WEBPACK_IMPORTED_MODULE_6__["DocumentSemanticTokensProviderRegistry"].all(model)) { - if (typeof provider.onDidChange === 'function') { - this._documentProvidersChangeListeners.push(provider.onDidChange(() => this._fetchDocumentSemanticTokens.schedule(0))); - } - } - }; - bindDocumentChangeListeners(); - this._register(_modes_js__WEBPACK_IMPORTED_MODULE_6__["DocumentSemanticTokensProviderRegistry"].onDidChange(() => { - bindDocumentChangeListeners(); - this._fetchDocumentSemanticTokens.schedule(); - })); - this._register(themeService.onDidColorThemeChange(_ => { - // clear out existing tokens - this._setDocumentSemanticTokens(null, null, null, []); - this._fetchDocumentSemanticTokens.schedule(); - })); - this._fetchDocumentSemanticTokens.schedule(0); - } - dispose() { - if (this._currentDocumentResponse) { - this._currentDocumentResponse.dispose(); - this._currentDocumentResponse = null; - } - if (this._currentDocumentRequestCancellationTokenSource) { - this._currentDocumentRequestCancellationTokenSource.cancel(); - this._currentDocumentRequestCancellationTokenSource = null; - } - this._setDocumentSemanticTokens(null, null, null, []); - this._isDisposed = true; - super.dispose(); - } - _fetchDocumentSemanticTokensNow() { - if (this._currentDocumentRequestCancellationTokenSource) { - // there is already a request running, let it finish... - return; - } - const provider = this._getSemanticColoringProvider(); - if (!provider) { - return; - } - this._currentDocumentRequestCancellationTokenSource = new _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_11__["CancellationTokenSource"](); - const pendingChanges = []; - const contentChangeListener = this._model.onDidChangeContent((e) => { - pendingChanges.push(e); - }); - const styling = this._semanticStyling.get(provider); - const lastResultId = this._currentDocumentResponse ? this._currentDocumentResponse.resultId || null : null; - const request = Promise.resolve(provider.provideDocumentSemanticTokens(this._model, lastResultId, this._currentDocumentRequestCancellationTokenSource.token)); - request.then((res) => { - this._currentDocumentRequestCancellationTokenSource = null; - contentChangeListener.dispose(); - this._setDocumentSemanticTokens(provider, res || null, styling, pendingChanges); - }, (err) => { - if (!err || typeof err.message !== 'string' || err.message.indexOf('busy') === -1) { - _base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["onUnexpectedError"](err); - } - // Semantic tokens eats up all errors and considers errors to mean that the result is temporarily not available - // The API does not have a special error kind to express this... - this._currentDocumentRequestCancellationTokenSource = null; - contentChangeListener.dispose(); - if (pendingChanges.length > 0) { - // More changes occurred while the request was running - if (!this._fetchDocumentSemanticTokens.isScheduled()) { - this._fetchDocumentSemanticTokens.schedule(); - } - } - }); - } - static _isSemanticTokens(v) { - return v && !!(v.data); - } - static _isSemanticTokensEdits(v) { - return v && Array.isArray(v.edits); - } - static _copy(src, srcOffset, dest, destOffset, length) { - for (let i = 0; i < length; i++) { - dest[destOffset + i] = src[srcOffset + i]; - } - } - _setDocumentSemanticTokens(provider, tokens, styling, pendingChanges) { - const currentResponse = this._currentDocumentResponse; - if (this._currentDocumentResponse) { - this._currentDocumentResponse.dispose(); - this._currentDocumentResponse = null; - } - if (this._isDisposed) { - // disposed! - if (provider && tokens) { - provider.releaseDocumentSemanticTokens(tokens.resultId); - } - return; - } - if (!provider || !styling) { - this._model.setSemanticTokens(null, false); - return; - } - if (!tokens) { - this._model.setSemanticTokens(null, true); - return; - } - if (ModelSemanticColoring._isSemanticTokensEdits(tokens)) { - if (!currentResponse) { - // not possible! - this._model.setSemanticTokens(null, true); - return; - } - if (tokens.edits.length === 0) { - // nothing to do! - tokens = { - resultId: tokens.resultId, - data: currentResponse.data - }; - } - else { - let deltaLength = 0; - for (const edit of tokens.edits) { - deltaLength += (edit.data ? edit.data.length : 0) - edit.deleteCount; - } - const srcData = currentResponse.data; - const destData = new Uint32Array(srcData.length + deltaLength); - let srcLastStart = srcData.length; - let destLastStart = destData.length; - for (let i = tokens.edits.length - 1; i >= 0; i--) { - const edit = tokens.edits[i]; - const copyCount = srcLastStart - (edit.start + edit.deleteCount); - if (copyCount > 0) { - ModelSemanticColoring._copy(srcData, srcLastStart - copyCount, destData, destLastStart - copyCount, copyCount); - destLastStart -= copyCount; - } - if (edit.data) { - ModelSemanticColoring._copy(edit.data, 0, destData, destLastStart - edit.data.length, edit.data.length); - destLastStart -= edit.data.length; - } - srcLastStart = edit.start; - } - if (srcLastStart > 0) { - ModelSemanticColoring._copy(srcData, 0, destData, 0, srcLastStart); - } - tokens = { - resultId: tokens.resultId, - data: destData - }; - } - } - if (ModelSemanticColoring._isSemanticTokens(tokens)) { - this._currentDocumentResponse = new SemanticTokensResponse(provider, tokens.resultId, tokens.data); - const result = Object(_semanticTokensProviderStyling_js__WEBPACK_IMPORTED_MODULE_17__["toMultilineTokens2"])(tokens, styling, this._model.getLanguageIdentifier()); - // Adjust incoming semantic tokens - if (pendingChanges.length > 0) { - // More changes occurred while the request was running - // We need to: - // 1. Adjust incoming semantic tokens - // 2. Request them again - for (const change of pendingChanges) { - for (const area of result) { - for (const singleChange of change.changes) { - area.applyEdit(singleChange.range, singleChange.text); - } - } - } - if (!this._fetchDocumentSemanticTokens.isScheduled()) { - this._fetchDocumentSemanticTokens.schedule(); - } - } - this._model.setSemanticTokens(result, true); - return; - } - this._model.setSemanticTokens(null, true); - } - _getSemanticColoringProvider() { - const result = _modes_js__WEBPACK_IMPORTED_MODULE_6__["DocumentSemanticTokensProviderRegistry"].ordered(this._model); - return (result.length > 0 ? result[0] : null); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/resolverService.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/resolverService.js ***! - \*************************************************************************************/ -/*! exports provided: ITextModelService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ITextModelService", function() { return ITextModelService; }); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const ITextModelService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('textModelService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/semanticTokensProviderStyling.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/semanticTokensProviderStyling.js ***! - \***************************************************************************************************/ -/*! exports provided: SemanticTokensProviderStyling, toMultilineTokens2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticTokensProviderStyling", function() { return SemanticTokensProviderStyling; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toMultilineTokens2", function() { return toMultilineTokens2; }); -/* harmony import */ var _modes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../platform/log/common/log.js */ "./node_modules/monaco-editor/esm/vs/platform/log/common/log.js"); -/* harmony import */ var _model_tokensStore_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/tokensStore.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/tokensStore.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class SemanticTokensProviderStyling { - constructor(_legend, _themeService, _logService) { - this._legend = _legend; - this._themeService = _themeService; - this._logService = _logService; - this._hashTable = new HashTable(); - } - getMetadata(tokenTypeIndex, tokenModifierSet, languageId) { - const entry = this._hashTable.get(tokenTypeIndex, tokenModifierSet, languageId.id); - let metadata; - if (entry) { - metadata = entry.metadata; - if (this._logService.getLevel() === _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Trace) { - this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${tokenTypeIndex} / ${tokenModifierSet}: foreground ${_modes_js__WEBPACK_IMPORTED_MODULE_0__["TokenMetadata"].getForeground(metadata)}, fontStyle ${_modes_js__WEBPACK_IMPORTED_MODULE_0__["TokenMetadata"].getFontStyle(metadata).toString(2)}`); - } - } - else { - let tokenType = this._legend.tokenTypes[tokenTypeIndex]; - const tokenModifiers = []; - if (tokenType) { - let modifierSet = tokenModifierSet; - for (let modifierIndex = 0; modifierSet > 0 && modifierIndex < this._legend.tokenModifiers.length; modifierIndex++) { - if (modifierSet & 1) { - tokenModifiers.push(this._legend.tokenModifiers[modifierIndex]); - } - modifierSet = modifierSet >> 1; - } - if (modifierSet > 0 && this._logService.getLevel() === _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Trace) { - this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${tokenModifierSet.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`); - tokenModifiers.push('not-in-legend'); - } - const tokenStyle = this._themeService.getColorTheme().getTokenStyleMetadata(tokenType, tokenModifiers, languageId.language); - if (typeof tokenStyle === 'undefined') { - metadata = 2147483647 /* NO_STYLING */; - } - else { - metadata = 0; - if (typeof tokenStyle.italic !== 'undefined') { - const italicBit = (tokenStyle.italic ? 1 /* Italic */ : 0) << 11 /* FONT_STYLE_OFFSET */; - metadata |= italicBit | 1 /* SEMANTIC_USE_ITALIC */; - } - if (typeof tokenStyle.bold !== 'undefined') { - const boldBit = (tokenStyle.bold ? 2 /* Bold */ : 0) << 11 /* FONT_STYLE_OFFSET */; - metadata |= boldBit | 2 /* SEMANTIC_USE_BOLD */; - } - if (typeof tokenStyle.underline !== 'undefined') { - const underlineBit = (tokenStyle.underline ? 4 /* Underline */ : 0) << 11 /* FONT_STYLE_OFFSET */; - metadata |= underlineBit | 4 /* SEMANTIC_USE_UNDERLINE */; - } - if (tokenStyle.foreground) { - const foregroundBits = (tokenStyle.foreground) << 14 /* FOREGROUND_OFFSET */; - metadata |= foregroundBits | 8 /* SEMANTIC_USE_FOREGROUND */; - } - if (metadata === 0) { - // Nothing! - metadata = 2147483647 /* NO_STYLING */; - } - } - } - else { - if (this._logService.getLevel() === _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Trace) { - this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${tokenTypeIndex} for legend: ${JSON.stringify(this._legend.tokenTypes)}`); - } - metadata = 2147483647 /* NO_STYLING */; - tokenType = 'not-in-legend'; - } - this._hashTable.add(tokenTypeIndex, tokenModifierSet, languageId.id, metadata); - if (this._logService.getLevel() === _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Trace) { - this._logService.trace(`SemanticTokensProviderStyling ${tokenTypeIndex} (${tokenType}) / ${tokenModifierSet} (${tokenModifiers.join(' ')}): foreground ${_modes_js__WEBPACK_IMPORTED_MODULE_0__["TokenMetadata"].getForeground(metadata)}, fontStyle ${_modes_js__WEBPACK_IMPORTED_MODULE_0__["TokenMetadata"].getFontStyle(metadata).toString(2)}`); - } - } - return metadata; - } -} -function toMultilineTokens2(tokens, styling, languageId) { - const srcData = tokens.data; - const tokenCount = (tokens.data.length / 5) | 0; - const tokensPerArea = Math.max(Math.ceil(tokenCount / 1024 /* DesiredMaxAreas */), 400 /* DesiredTokensPerArea */); - const result = []; - let tokenIndex = 0; - let lastLineNumber = 1; - let lastStartCharacter = 0; - while (tokenIndex < tokenCount) { - const tokenStartIndex = tokenIndex; - let tokenEndIndex = Math.min(tokenStartIndex + tokensPerArea, tokenCount); - // Keep tokens on the same line in the same area... - if (tokenEndIndex < tokenCount) { - let smallTokenEndIndex = tokenEndIndex; - while (smallTokenEndIndex - 1 > tokenStartIndex && srcData[5 * smallTokenEndIndex] === 0) { - smallTokenEndIndex--; - } - if (smallTokenEndIndex - 1 === tokenStartIndex) { - // there are so many tokens on this line that our area would be empty, we must now go right - let bigTokenEndIndex = tokenEndIndex; - while (bigTokenEndIndex + 1 < tokenCount && srcData[5 * bigTokenEndIndex] === 0) { - bigTokenEndIndex++; - } - tokenEndIndex = bigTokenEndIndex; - } - else { - tokenEndIndex = smallTokenEndIndex; - } - } - let destData = new Uint32Array((tokenEndIndex - tokenStartIndex) * 4); - let destOffset = 0; - let areaLine = 0; - while (tokenIndex < tokenEndIndex) { - const srcOffset = 5 * tokenIndex; - const deltaLine = srcData[srcOffset]; - const deltaCharacter = srcData[srcOffset + 1]; - const lineNumber = lastLineNumber + deltaLine; - const startCharacter = (deltaLine === 0 ? lastStartCharacter + deltaCharacter : deltaCharacter); - const length = srcData[srcOffset + 2]; - const tokenTypeIndex = srcData[srcOffset + 3]; - const tokenModifierSet = srcData[srcOffset + 4]; - const metadata = styling.getMetadata(tokenTypeIndex, tokenModifierSet, languageId); - if (metadata !== 2147483647 /* NO_STYLING */) { - if (areaLine === 0) { - areaLine = lineNumber; - } - destData[destOffset] = lineNumber - areaLine; - destData[destOffset + 1] = startCharacter; - destData[destOffset + 2] = startCharacter + length; - destData[destOffset + 3] = metadata; - destOffset += 4; - } - lastLineNumber = lineNumber; - lastStartCharacter = startCharacter; - tokenIndex++; - } - if (destOffset !== destData.length) { - destData = destData.subarray(0, destOffset); - } - const tokens = new _model_tokensStore_js__WEBPACK_IMPORTED_MODULE_2__["MultilineTokens2"](areaLine, new _model_tokensStore_js__WEBPACK_IMPORTED_MODULE_2__["SparseEncodedTokens"](destData)); - result.push(tokens); - } - return result; -} -class HashTableEntry { - constructor(tokenTypeIndex, tokenModifierSet, languageId, metadata) { - this.tokenTypeIndex = tokenTypeIndex; - this.tokenModifierSet = tokenModifierSet; - this.languageId = languageId; - this.metadata = metadata; - this.next = null; - } -} -class HashTable { - constructor() { - this._elementsCount = 0; - this._currentLengthIndex = 0; - this._currentLength = HashTable._SIZES[this._currentLengthIndex]; - this._growCount = Math.round(this._currentLengthIndex + 1 < HashTable._SIZES.length ? 2 / 3 * this._currentLength : 0); - this._elements = []; - HashTable._nullOutEntries(this._elements, this._currentLength); - } - static _nullOutEntries(entries, length) { - for (let i = 0; i < length; i++) { - entries[i] = null; - } - } - _hash2(n1, n2) { - return (((n1 << 5) - n1) + n2) | 0; // n1 * 31 + n2, keep as int32 - } - _hashFunc(tokenTypeIndex, tokenModifierSet, languageId) { - return this._hash2(this._hash2(tokenTypeIndex, tokenModifierSet), languageId) % this._currentLength; - } - get(tokenTypeIndex, tokenModifierSet, languageId) { - const hash = this._hashFunc(tokenTypeIndex, tokenModifierSet, languageId); - let p = this._elements[hash]; - while (p) { - if (p.tokenTypeIndex === tokenTypeIndex && p.tokenModifierSet === tokenModifierSet && p.languageId === languageId) { - return p; - } - p = p.next; - } - return null; - } - add(tokenTypeIndex, tokenModifierSet, languageId, metadata) { - this._elementsCount++; - if (this._growCount !== 0 && this._elementsCount >= this._growCount) { - // expand! - const oldElements = this._elements; - this._currentLengthIndex++; - this._currentLength = HashTable._SIZES[this._currentLengthIndex]; - this._growCount = Math.round(this._currentLengthIndex + 1 < HashTable._SIZES.length ? 2 / 3 * this._currentLength : 0); - this._elements = []; - HashTable._nullOutEntries(this._elements, this._currentLength); - for (const first of oldElements) { - let p = first; - while (p) { - const oldNext = p.next; - p.next = null; - this._add(p); - p = oldNext; - } - } - } - this._add(new HashTableEntry(tokenTypeIndex, tokenModifierSet, languageId, metadata)); - } - _add(element) { - const hash = this._hashFunc(element.tokenTypeIndex, element.tokenModifierSet, element.languageId); - element.next = this._elements[hash]; - this._elements[hash] = element; - } -} -HashTable._SIZES = [3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143]; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/textResourceConfigurationService.js": -/*!******************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/textResourceConfigurationService.js ***! - \******************************************************************************************************/ -/*! exports provided: ITextResourceConfigurationService, ITextResourcePropertiesService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ITextResourceConfigurationService", function() { return ITextResourceConfigurationService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ITextResourcePropertiesService", function() { return ITextResourcePropertiesService; }); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); - -const ITextResourceConfigurationService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('textResourceConfigurationService'); -const ITextResourcePropertiesService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('textResourcePropertiesService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/webWorker.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/webWorker.js ***! - \*******************************************************************************/ -/*! exports provided: createWebWorker */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createWebWorker", function() { return createWebWorker; }); -/* harmony import */ var _editorWorkerServiceImpl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editorWorkerServiceImpl.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerServiceImpl.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -/** - * Create a new web worker that has model syncing capabilities built in. - * Specify an AMD module to load that will `create` an object that will be proxied. - */ -function createWebWorker(modelService, opts) { - return new MonacoWebWorkerImpl(modelService, opts); -} -class MonacoWebWorkerImpl extends _editorWorkerServiceImpl_js__WEBPACK_IMPORTED_MODULE_0__["EditorWorkerClient"] { - constructor(modelService, opts) { - super(modelService, opts.keepIdleModels || false, opts.label); - this._foreignModuleId = opts.moduleId; - this._foreignModuleCreateData = opts.createData || null; - this._foreignModuleHost = opts.host || null; - this._foreignProxy = null; - } - // foreign host request - fhr(method, args) { - if (!this._foreignModuleHost || typeof this._foreignModuleHost[method] !== 'function') { - return Promise.reject(new Error('Missing method ' + method + ' or missing main thread foreign host.')); - } - try { - return Promise.resolve(this._foreignModuleHost[method].apply(this._foreignModuleHost, args)); - } - catch (e) { - return Promise.reject(e); - } - } - _getForeignProxy() { - if (!this._foreignProxy) { - this._foreignProxy = this._getProxy().then((proxy) => { - const foreignHostMethods = this._foreignModuleHost ? _base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["getAllMethodNames"](this._foreignModuleHost) : []; - return proxy.loadForeignModule(this._foreignModuleId, this._foreignModuleCreateData, foreignHostMethods).then((foreignMethods) => { - this._foreignModuleCreateData = null; - const proxyMethodRequest = (method, args) => { - return proxy.fmr(method, args); - }; - const createProxyMethod = (method, proxyMethodRequest) => { - return function () { - const args = Array.prototype.slice.call(arguments, 0); - return proxyMethodRequest(method, args); - }; - }; - let foreignProxy = {}; - for (const foreignMethod of foreignMethods) { - foreignProxy[foreignMethod] = createProxyMethod(foreignMethod, proxyMethodRequest); - } - return foreignProxy; - }); - }); - } - return this._foreignProxy; - } - getProxy() { - return this._getForeignProxy(); - } - withSyncedResources(resources) { - return this._withSyncedResources(resources).then(_ => this.getProxy()); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js ***! - \**************************************************************************************/ -/*! exports provided: KeyMod, createMonacoBaseAPI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyMod", function() { return KeyMod; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMonacoBaseAPI", function() { return createMonacoBaseAPI; }); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _core_token_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/token.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js"); -/* harmony import */ var _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./standaloneEnums.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -class KeyMod { - static chord(firstPart, secondPart) { - return Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__["KeyChord"])(firstPart, secondPart); - } -} -KeyMod.CtrlCmd = 2048 /* CtrlCmd */; -KeyMod.Shift = 1024 /* Shift */; -KeyMod.Alt = 512 /* Alt */; -KeyMod.WinCtrl = 256 /* WinCtrl */; -function createMonacoBaseAPI() { - return { - editor: undefined, - languages: undefined, - CancellationTokenSource: _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationTokenSource"], - Emitter: _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"], - KeyCode: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__["KeyCode"], - KeyMod: KeyMod, - Position: _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"], - Range: _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"], - Selection: _core_selection_js__WEBPACK_IMPORTED_MODULE_6__["Selection"], - SelectionDirection: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__["SelectionDirection"], - MarkerSeverity: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__["MarkerSeverity"], - MarkerTag: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__["MarkerTag"], - Uri: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"], - Token: _core_token_js__WEBPACK_IMPORTED_MODULE_7__["Token"] - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js ***! - \***************************************************************************************/ -/*! exports provided: AccessibilitySupport, CompletionItemInsertTextRule, CompletionItemKind, CompletionItemTag, CompletionTriggerKind, ContentWidgetPositionPreference, CursorChangeReason, DefaultEndOfLine, DocumentHighlightKind, EditorAutoIndentStrategy, EditorOption, EndOfLinePreference, EndOfLineSequence, IndentAction, KeyCode, MarkerSeverity, MarkerTag, MinimapPosition, MouseTargetType, OverlayWidgetPositionPreference, OverviewRulerLane, RenderLineNumbersType, RenderMinimap, ScrollType, ScrollbarVisibility, SelectionDirection, SignatureHelpTriggerKind, SymbolKind, SymbolTag, TextEditorCursorBlinkingStyle, TextEditorCursorStyle, TrackedRangeStickiness, WrappingIndent */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccessibilitySupport", function() { return AccessibilitySupport; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemInsertTextRule", function() { return CompletionItemInsertTextRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemTag", function() { return CompletionItemTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionTriggerKind", function() { return CompletionTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentWidgetPositionPreference", function() { return ContentWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorChangeReason", function() { return CursorChangeReason; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultEndOfLine", function() { return DefaultEndOfLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorAutoIndentStrategy", function() { return EditorAutoIndentStrategy; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorOption", function() { return EditorOption; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLinePreference", function() { return EndOfLinePreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLineSequence", function() { return EndOfLineSequence; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentAction", function() { return IndentAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCode", function() { return KeyCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerSeverity", function() { return MarkerSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerTag", function() { return MarkerTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinimapPosition", function() { return MinimapPosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseTargetType", function() { return MouseTargetType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayWidgetPositionPreference", function() { return OverlayWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewRulerLane", function() { return OverviewRulerLane; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderLineNumbersType", function() { return RenderLineNumbersType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderMinimap", function() { return RenderMinimap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollType", function() { return ScrollType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollbarVisibility", function() { return ScrollbarVisibility; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionDirection", function() { return SelectionDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureHelpTriggerKind", function() { return SignatureHelpTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolTag", function() { return SymbolTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorBlinkingStyle", function() { return TextEditorCursorBlinkingStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorStyle", function() { return TextEditorCursorStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackedRangeStickiness", function() { return TrackedRangeStickiness; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrappingIndent", function() { return WrappingIndent; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. -var AccessibilitySupport; -(function (AccessibilitySupport) { - /** - * This should be the browser case where it is not known if a screen reader is attached or no. - */ - AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown"; - AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled"; - AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled"; -})(AccessibilitySupport || (AccessibilitySupport = {})); -var CompletionItemInsertTextRule; -(function (CompletionItemInsertTextRule) { - /** - * Adjust whitespace/indentation of multiline insert texts to - * match the current line indentation. - */ - CompletionItemInsertTextRule[CompletionItemInsertTextRule["KeepWhitespace"] = 1] = "KeepWhitespace"; - /** - * `insertText` is a snippet. - */ - CompletionItemInsertTextRule[CompletionItemInsertTextRule["InsertAsSnippet"] = 4] = "InsertAsSnippet"; -})(CompletionItemInsertTextRule || (CompletionItemInsertTextRule = {})); -var CompletionItemKind; -(function (CompletionItemKind) { - CompletionItemKind[CompletionItemKind["Method"] = 0] = "Method"; - CompletionItemKind[CompletionItemKind["Function"] = 1] = "Function"; - CompletionItemKind[CompletionItemKind["Constructor"] = 2] = "Constructor"; - CompletionItemKind[CompletionItemKind["Field"] = 3] = "Field"; - CompletionItemKind[CompletionItemKind["Variable"] = 4] = "Variable"; - CompletionItemKind[CompletionItemKind["Class"] = 5] = "Class"; - CompletionItemKind[CompletionItemKind["Struct"] = 6] = "Struct"; - CompletionItemKind[CompletionItemKind["Interface"] = 7] = "Interface"; - CompletionItemKind[CompletionItemKind["Module"] = 8] = "Module"; - CompletionItemKind[CompletionItemKind["Property"] = 9] = "Property"; - CompletionItemKind[CompletionItemKind["Event"] = 10] = "Event"; - CompletionItemKind[CompletionItemKind["Operator"] = 11] = "Operator"; - CompletionItemKind[CompletionItemKind["Unit"] = 12] = "Unit"; - CompletionItemKind[CompletionItemKind["Value"] = 13] = "Value"; - CompletionItemKind[CompletionItemKind["Constant"] = 14] = "Constant"; - CompletionItemKind[CompletionItemKind["Enum"] = 15] = "Enum"; - CompletionItemKind[CompletionItemKind["EnumMember"] = 16] = "EnumMember"; - CompletionItemKind[CompletionItemKind["Keyword"] = 17] = "Keyword"; - CompletionItemKind[CompletionItemKind["Text"] = 18] = "Text"; - CompletionItemKind[CompletionItemKind["Color"] = 19] = "Color"; - CompletionItemKind[CompletionItemKind["File"] = 20] = "File"; - CompletionItemKind[CompletionItemKind["Reference"] = 21] = "Reference"; - CompletionItemKind[CompletionItemKind["Customcolor"] = 22] = "Customcolor"; - CompletionItemKind[CompletionItemKind["Folder"] = 23] = "Folder"; - CompletionItemKind[CompletionItemKind["TypeParameter"] = 24] = "TypeParameter"; - CompletionItemKind[CompletionItemKind["User"] = 25] = "User"; - CompletionItemKind[CompletionItemKind["Issue"] = 26] = "Issue"; - CompletionItemKind[CompletionItemKind["Snippet"] = 27] = "Snippet"; -})(CompletionItemKind || (CompletionItemKind = {})); -var CompletionItemTag; -(function (CompletionItemTag) { - CompletionItemTag[CompletionItemTag["Deprecated"] = 1] = "Deprecated"; -})(CompletionItemTag || (CompletionItemTag = {})); -/** - * How a suggest provider was triggered. - */ -var CompletionTriggerKind; -(function (CompletionTriggerKind) { - CompletionTriggerKind[CompletionTriggerKind["Invoke"] = 0] = "Invoke"; - CompletionTriggerKind[CompletionTriggerKind["TriggerCharacter"] = 1] = "TriggerCharacter"; - CompletionTriggerKind[CompletionTriggerKind["TriggerForIncompleteCompletions"] = 2] = "TriggerForIncompleteCompletions"; -})(CompletionTriggerKind || (CompletionTriggerKind = {})); -/** - * A positioning preference for rendering content widgets. - */ -var ContentWidgetPositionPreference; -(function (ContentWidgetPositionPreference) { - /** - * Place the content widget exactly at a position - */ - ContentWidgetPositionPreference[ContentWidgetPositionPreference["EXACT"] = 0] = "EXACT"; - /** - * Place the content widget above a position - */ - ContentWidgetPositionPreference[ContentWidgetPositionPreference["ABOVE"] = 1] = "ABOVE"; - /** - * Place the content widget below a position - */ - ContentWidgetPositionPreference[ContentWidgetPositionPreference["BELOW"] = 2] = "BELOW"; -})(ContentWidgetPositionPreference || (ContentWidgetPositionPreference = {})); -/** - * Describes the reason the cursor has changed its position. - */ -var CursorChangeReason; -(function (CursorChangeReason) { - /** - * Unknown or not set. - */ - CursorChangeReason[CursorChangeReason["NotSet"] = 0] = "NotSet"; - /** - * A `model.setValue()` was called. - */ - CursorChangeReason[CursorChangeReason["ContentFlush"] = 1] = "ContentFlush"; - /** - * The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers. - */ - CursorChangeReason[CursorChangeReason["RecoverFromMarkers"] = 2] = "RecoverFromMarkers"; - /** - * There was an explicit user gesture. - */ - CursorChangeReason[CursorChangeReason["Explicit"] = 3] = "Explicit"; - /** - * There was a Paste. - */ - CursorChangeReason[CursorChangeReason["Paste"] = 4] = "Paste"; - /** - * There was an Undo. - */ - CursorChangeReason[CursorChangeReason["Undo"] = 5] = "Undo"; - /** - * There was a Redo. - */ - CursorChangeReason[CursorChangeReason["Redo"] = 6] = "Redo"; -})(CursorChangeReason || (CursorChangeReason = {})); -/** - * The default end of line to use when instantiating models. - */ -var DefaultEndOfLine; -(function (DefaultEndOfLine) { - /** - * Use line feed (\n) as the end of line character. - */ - DefaultEndOfLine[DefaultEndOfLine["LF"] = 1] = "LF"; - /** - * Use carriage return and line feed (\r\n) as the end of line character. - */ - DefaultEndOfLine[DefaultEndOfLine["CRLF"] = 2] = "CRLF"; -})(DefaultEndOfLine || (DefaultEndOfLine = {})); -/** - * A document highlight kind. - */ -var DocumentHighlightKind; -(function (DocumentHighlightKind) { - /** - * A textual occurrence. - */ - DocumentHighlightKind[DocumentHighlightKind["Text"] = 0] = "Text"; - /** - * Read-access of a symbol, like reading a variable. - */ - DocumentHighlightKind[DocumentHighlightKind["Read"] = 1] = "Read"; - /** - * Write-access of a symbol, like writing to a variable. - */ - DocumentHighlightKind[DocumentHighlightKind["Write"] = 2] = "Write"; -})(DocumentHighlightKind || (DocumentHighlightKind = {})); -/** - * Configuration options for auto indentation in the editor - */ -var EditorAutoIndentStrategy; -(function (EditorAutoIndentStrategy) { - EditorAutoIndentStrategy[EditorAutoIndentStrategy["None"] = 0] = "None"; - EditorAutoIndentStrategy[EditorAutoIndentStrategy["Keep"] = 1] = "Keep"; - EditorAutoIndentStrategy[EditorAutoIndentStrategy["Brackets"] = 2] = "Brackets"; - EditorAutoIndentStrategy[EditorAutoIndentStrategy["Advanced"] = 3] = "Advanced"; - EditorAutoIndentStrategy[EditorAutoIndentStrategy["Full"] = 4] = "Full"; -})(EditorAutoIndentStrategy || (EditorAutoIndentStrategy = {})); -var EditorOption; -(function (EditorOption) { - EditorOption[EditorOption["acceptSuggestionOnCommitCharacter"] = 0] = "acceptSuggestionOnCommitCharacter"; - EditorOption[EditorOption["acceptSuggestionOnEnter"] = 1] = "acceptSuggestionOnEnter"; - EditorOption[EditorOption["accessibilitySupport"] = 2] = "accessibilitySupport"; - EditorOption[EditorOption["accessibilityPageSize"] = 3] = "accessibilityPageSize"; - EditorOption[EditorOption["ariaLabel"] = 4] = "ariaLabel"; - EditorOption[EditorOption["autoClosingBrackets"] = 5] = "autoClosingBrackets"; - EditorOption[EditorOption["autoClosingOvertype"] = 6] = "autoClosingOvertype"; - EditorOption[EditorOption["autoClosingQuotes"] = 7] = "autoClosingQuotes"; - EditorOption[EditorOption["autoIndent"] = 8] = "autoIndent"; - EditorOption[EditorOption["automaticLayout"] = 9] = "automaticLayout"; - EditorOption[EditorOption["autoSurround"] = 10] = "autoSurround"; - EditorOption[EditorOption["codeLens"] = 11] = "codeLens"; - EditorOption[EditorOption["colorDecorators"] = 12] = "colorDecorators"; - EditorOption[EditorOption["columnSelection"] = 13] = "columnSelection"; - EditorOption[EditorOption["comments"] = 14] = "comments"; - EditorOption[EditorOption["contextmenu"] = 15] = "contextmenu"; - EditorOption[EditorOption["copyWithSyntaxHighlighting"] = 16] = "copyWithSyntaxHighlighting"; - EditorOption[EditorOption["cursorBlinking"] = 17] = "cursorBlinking"; - EditorOption[EditorOption["cursorSmoothCaretAnimation"] = 18] = "cursorSmoothCaretAnimation"; - EditorOption[EditorOption["cursorStyle"] = 19] = "cursorStyle"; - EditorOption[EditorOption["cursorSurroundingLines"] = 20] = "cursorSurroundingLines"; - EditorOption[EditorOption["cursorSurroundingLinesStyle"] = 21] = "cursorSurroundingLinesStyle"; - EditorOption[EditorOption["cursorWidth"] = 22] = "cursorWidth"; - EditorOption[EditorOption["disableLayerHinting"] = 23] = "disableLayerHinting"; - EditorOption[EditorOption["disableMonospaceOptimizations"] = 24] = "disableMonospaceOptimizations"; - EditorOption[EditorOption["dragAndDrop"] = 25] = "dragAndDrop"; - EditorOption[EditorOption["emptySelectionClipboard"] = 26] = "emptySelectionClipboard"; - EditorOption[EditorOption["extraEditorClassName"] = 27] = "extraEditorClassName"; - EditorOption[EditorOption["fastScrollSensitivity"] = 28] = "fastScrollSensitivity"; - EditorOption[EditorOption["find"] = 29] = "find"; - EditorOption[EditorOption["fixedOverflowWidgets"] = 30] = "fixedOverflowWidgets"; - EditorOption[EditorOption["folding"] = 31] = "folding"; - EditorOption[EditorOption["foldingStrategy"] = 32] = "foldingStrategy"; - EditorOption[EditorOption["foldingHighlight"] = 33] = "foldingHighlight"; - EditorOption[EditorOption["unfoldOnClickAfterEndOfLine"] = 34] = "unfoldOnClickAfterEndOfLine"; - EditorOption[EditorOption["fontFamily"] = 35] = "fontFamily"; - EditorOption[EditorOption["fontInfo"] = 36] = "fontInfo"; - EditorOption[EditorOption["fontLigatures"] = 37] = "fontLigatures"; - EditorOption[EditorOption["fontSize"] = 38] = "fontSize"; - EditorOption[EditorOption["fontWeight"] = 39] = "fontWeight"; - EditorOption[EditorOption["formatOnPaste"] = 40] = "formatOnPaste"; - EditorOption[EditorOption["formatOnType"] = 41] = "formatOnType"; - EditorOption[EditorOption["glyphMargin"] = 42] = "glyphMargin"; - EditorOption[EditorOption["gotoLocation"] = 43] = "gotoLocation"; - EditorOption[EditorOption["hideCursorInOverviewRuler"] = 44] = "hideCursorInOverviewRuler"; - EditorOption[EditorOption["highlightActiveIndentGuide"] = 45] = "highlightActiveIndentGuide"; - EditorOption[EditorOption["hover"] = 46] = "hover"; - EditorOption[EditorOption["inDiffEditor"] = 47] = "inDiffEditor"; - EditorOption[EditorOption["letterSpacing"] = 48] = "letterSpacing"; - EditorOption[EditorOption["lightbulb"] = 49] = "lightbulb"; - EditorOption[EditorOption["lineDecorationsWidth"] = 50] = "lineDecorationsWidth"; - EditorOption[EditorOption["lineHeight"] = 51] = "lineHeight"; - EditorOption[EditorOption["lineNumbers"] = 52] = "lineNumbers"; - EditorOption[EditorOption["lineNumbersMinChars"] = 53] = "lineNumbersMinChars"; - EditorOption[EditorOption["links"] = 54] = "links"; - EditorOption[EditorOption["matchBrackets"] = 55] = "matchBrackets"; - EditorOption[EditorOption["minimap"] = 56] = "minimap"; - EditorOption[EditorOption["mouseStyle"] = 57] = "mouseStyle"; - EditorOption[EditorOption["mouseWheelScrollSensitivity"] = 58] = "mouseWheelScrollSensitivity"; - EditorOption[EditorOption["mouseWheelZoom"] = 59] = "mouseWheelZoom"; - EditorOption[EditorOption["multiCursorMergeOverlapping"] = 60] = "multiCursorMergeOverlapping"; - EditorOption[EditorOption["multiCursorModifier"] = 61] = "multiCursorModifier"; - EditorOption[EditorOption["multiCursorPaste"] = 62] = "multiCursorPaste"; - EditorOption[EditorOption["occurrencesHighlight"] = 63] = "occurrencesHighlight"; - EditorOption[EditorOption["overviewRulerBorder"] = 64] = "overviewRulerBorder"; - EditorOption[EditorOption["overviewRulerLanes"] = 65] = "overviewRulerLanes"; - EditorOption[EditorOption["padding"] = 66] = "padding"; - EditorOption[EditorOption["parameterHints"] = 67] = "parameterHints"; - EditorOption[EditorOption["peekWidgetDefaultFocus"] = 68] = "peekWidgetDefaultFocus"; - EditorOption[EditorOption["definitionLinkOpensInPeek"] = 69] = "definitionLinkOpensInPeek"; - EditorOption[EditorOption["quickSuggestions"] = 70] = "quickSuggestions"; - EditorOption[EditorOption["quickSuggestionsDelay"] = 71] = "quickSuggestionsDelay"; - EditorOption[EditorOption["readOnly"] = 72] = "readOnly"; - EditorOption[EditorOption["renameOnType"] = 73] = "renameOnType"; - EditorOption[EditorOption["renderControlCharacters"] = 74] = "renderControlCharacters"; - EditorOption[EditorOption["renderIndentGuides"] = 75] = "renderIndentGuides"; - EditorOption[EditorOption["renderFinalNewline"] = 76] = "renderFinalNewline"; - EditorOption[EditorOption["renderLineHighlight"] = 77] = "renderLineHighlight"; - EditorOption[EditorOption["renderLineHighlightOnlyWhenFocus"] = 78] = "renderLineHighlightOnlyWhenFocus"; - EditorOption[EditorOption["renderValidationDecorations"] = 79] = "renderValidationDecorations"; - EditorOption[EditorOption["renderWhitespace"] = 80] = "renderWhitespace"; - EditorOption[EditorOption["revealHorizontalRightPadding"] = 81] = "revealHorizontalRightPadding"; - EditorOption[EditorOption["roundedSelection"] = 82] = "roundedSelection"; - EditorOption[EditorOption["rulers"] = 83] = "rulers"; - EditorOption[EditorOption["scrollbar"] = 84] = "scrollbar"; - EditorOption[EditorOption["scrollBeyondLastColumn"] = 85] = "scrollBeyondLastColumn"; - EditorOption[EditorOption["scrollBeyondLastLine"] = 86] = "scrollBeyondLastLine"; - EditorOption[EditorOption["scrollPredominantAxis"] = 87] = "scrollPredominantAxis"; - EditorOption[EditorOption["selectionClipboard"] = 88] = "selectionClipboard"; - EditorOption[EditorOption["selectionHighlight"] = 89] = "selectionHighlight"; - EditorOption[EditorOption["selectOnLineNumbers"] = 90] = "selectOnLineNumbers"; - EditorOption[EditorOption["showFoldingControls"] = 91] = "showFoldingControls"; - EditorOption[EditorOption["showUnused"] = 92] = "showUnused"; - EditorOption[EditorOption["snippetSuggestions"] = 93] = "snippetSuggestions"; - EditorOption[EditorOption["smoothScrolling"] = 94] = "smoothScrolling"; - EditorOption[EditorOption["stopRenderingLineAfter"] = 95] = "stopRenderingLineAfter"; - EditorOption[EditorOption["suggest"] = 96] = "suggest"; - EditorOption[EditorOption["suggestFontSize"] = 97] = "suggestFontSize"; - EditorOption[EditorOption["suggestLineHeight"] = 98] = "suggestLineHeight"; - EditorOption[EditorOption["suggestOnTriggerCharacters"] = 99] = "suggestOnTriggerCharacters"; - EditorOption[EditorOption["suggestSelection"] = 100] = "suggestSelection"; - EditorOption[EditorOption["tabCompletion"] = 101] = "tabCompletion"; - EditorOption[EditorOption["tabIndex"] = 102] = "tabIndex"; - EditorOption[EditorOption["unusualLineTerminators"] = 103] = "unusualLineTerminators"; - EditorOption[EditorOption["useTabStops"] = 104] = "useTabStops"; - EditorOption[EditorOption["wordSeparators"] = 105] = "wordSeparators"; - EditorOption[EditorOption["wordWrap"] = 106] = "wordWrap"; - EditorOption[EditorOption["wordWrapBreakAfterCharacters"] = 107] = "wordWrapBreakAfterCharacters"; - EditorOption[EditorOption["wordWrapBreakBeforeCharacters"] = 108] = "wordWrapBreakBeforeCharacters"; - EditorOption[EditorOption["wordWrapColumn"] = 109] = "wordWrapColumn"; - EditorOption[EditorOption["wordWrapMinified"] = 110] = "wordWrapMinified"; - EditorOption[EditorOption["wrappingIndent"] = 111] = "wrappingIndent"; - EditorOption[EditorOption["wrappingStrategy"] = 112] = "wrappingStrategy"; - EditorOption[EditorOption["showDeprecated"] = 113] = "showDeprecated"; - EditorOption[EditorOption["editorClassName"] = 114] = "editorClassName"; - EditorOption[EditorOption["pixelRatio"] = 115] = "pixelRatio"; - EditorOption[EditorOption["tabFocusMode"] = 116] = "tabFocusMode"; - EditorOption[EditorOption["layoutInfo"] = 117] = "layoutInfo"; - EditorOption[EditorOption["wrappingInfo"] = 118] = "wrappingInfo"; -})(EditorOption || (EditorOption = {})); -/** - * End of line character preference. - */ -var EndOfLinePreference; -(function (EndOfLinePreference) { - /** - * Use the end of line character identified in the text buffer. - */ - EndOfLinePreference[EndOfLinePreference["TextDefined"] = 0] = "TextDefined"; - /** - * Use line feed (\n) as the end of line character. - */ - EndOfLinePreference[EndOfLinePreference["LF"] = 1] = "LF"; - /** - * Use carriage return and line feed (\r\n) as the end of line character. - */ - EndOfLinePreference[EndOfLinePreference["CRLF"] = 2] = "CRLF"; -})(EndOfLinePreference || (EndOfLinePreference = {})); -/** - * End of line character preference. - */ -var EndOfLineSequence; -(function (EndOfLineSequence) { - /** - * Use line feed (\n) as the end of line character. - */ - EndOfLineSequence[EndOfLineSequence["LF"] = 0] = "LF"; - /** - * Use carriage return and line feed (\r\n) as the end of line character. - */ - EndOfLineSequence[EndOfLineSequence["CRLF"] = 1] = "CRLF"; -})(EndOfLineSequence || (EndOfLineSequence = {})); -/** - * Describes what to do with the indentation when pressing Enter. - */ -var IndentAction; -(function (IndentAction) { - /** - * Insert new line and copy the previous line's indentation. - */ - IndentAction[IndentAction["None"] = 0] = "None"; - /** - * Insert new line and indent once (relative to the previous line's indentation). - */ - IndentAction[IndentAction["Indent"] = 1] = "Indent"; - /** - * Insert two new lines: - * - the first one indented which will hold the cursor - * - the second one at the same indentation level - */ - IndentAction[IndentAction["IndentOutdent"] = 2] = "IndentOutdent"; - /** - * Insert new line and outdent once (relative to the previous line's indentation). - */ - IndentAction[IndentAction["Outdent"] = 3] = "Outdent"; -})(IndentAction || (IndentAction = {})); -/** - * Virtual Key Codes, the value does not hold any inherent meaning. - * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx - * But these are "more general", as they should work across browsers & OS`s. - */ -var KeyCode; -(function (KeyCode) { - /** - * Placed first to cover the 0 value of the enum. - */ - KeyCode[KeyCode["Unknown"] = 0] = "Unknown"; - KeyCode[KeyCode["Backspace"] = 1] = "Backspace"; - KeyCode[KeyCode["Tab"] = 2] = "Tab"; - KeyCode[KeyCode["Enter"] = 3] = "Enter"; - KeyCode[KeyCode["Shift"] = 4] = "Shift"; - KeyCode[KeyCode["Ctrl"] = 5] = "Ctrl"; - KeyCode[KeyCode["Alt"] = 6] = "Alt"; - KeyCode[KeyCode["PauseBreak"] = 7] = "PauseBreak"; - KeyCode[KeyCode["CapsLock"] = 8] = "CapsLock"; - KeyCode[KeyCode["Escape"] = 9] = "Escape"; - KeyCode[KeyCode["Space"] = 10] = "Space"; - KeyCode[KeyCode["PageUp"] = 11] = "PageUp"; - KeyCode[KeyCode["PageDown"] = 12] = "PageDown"; - KeyCode[KeyCode["End"] = 13] = "End"; - KeyCode[KeyCode["Home"] = 14] = "Home"; - KeyCode[KeyCode["LeftArrow"] = 15] = "LeftArrow"; - KeyCode[KeyCode["UpArrow"] = 16] = "UpArrow"; - KeyCode[KeyCode["RightArrow"] = 17] = "RightArrow"; - KeyCode[KeyCode["DownArrow"] = 18] = "DownArrow"; - KeyCode[KeyCode["Insert"] = 19] = "Insert"; - KeyCode[KeyCode["Delete"] = 20] = "Delete"; - KeyCode[KeyCode["KEY_0"] = 21] = "KEY_0"; - KeyCode[KeyCode["KEY_1"] = 22] = "KEY_1"; - KeyCode[KeyCode["KEY_2"] = 23] = "KEY_2"; - KeyCode[KeyCode["KEY_3"] = 24] = "KEY_3"; - KeyCode[KeyCode["KEY_4"] = 25] = "KEY_4"; - KeyCode[KeyCode["KEY_5"] = 26] = "KEY_5"; - KeyCode[KeyCode["KEY_6"] = 27] = "KEY_6"; - KeyCode[KeyCode["KEY_7"] = 28] = "KEY_7"; - KeyCode[KeyCode["KEY_8"] = 29] = "KEY_8"; - KeyCode[KeyCode["KEY_9"] = 30] = "KEY_9"; - KeyCode[KeyCode["KEY_A"] = 31] = "KEY_A"; - KeyCode[KeyCode["KEY_B"] = 32] = "KEY_B"; - KeyCode[KeyCode["KEY_C"] = 33] = "KEY_C"; - KeyCode[KeyCode["KEY_D"] = 34] = "KEY_D"; - KeyCode[KeyCode["KEY_E"] = 35] = "KEY_E"; - KeyCode[KeyCode["KEY_F"] = 36] = "KEY_F"; - KeyCode[KeyCode["KEY_G"] = 37] = "KEY_G"; - KeyCode[KeyCode["KEY_H"] = 38] = "KEY_H"; - KeyCode[KeyCode["KEY_I"] = 39] = "KEY_I"; - KeyCode[KeyCode["KEY_J"] = 40] = "KEY_J"; - KeyCode[KeyCode["KEY_K"] = 41] = "KEY_K"; - KeyCode[KeyCode["KEY_L"] = 42] = "KEY_L"; - KeyCode[KeyCode["KEY_M"] = 43] = "KEY_M"; - KeyCode[KeyCode["KEY_N"] = 44] = "KEY_N"; - KeyCode[KeyCode["KEY_O"] = 45] = "KEY_O"; - KeyCode[KeyCode["KEY_P"] = 46] = "KEY_P"; - KeyCode[KeyCode["KEY_Q"] = 47] = "KEY_Q"; - KeyCode[KeyCode["KEY_R"] = 48] = "KEY_R"; - KeyCode[KeyCode["KEY_S"] = 49] = "KEY_S"; - KeyCode[KeyCode["KEY_T"] = 50] = "KEY_T"; - KeyCode[KeyCode["KEY_U"] = 51] = "KEY_U"; - KeyCode[KeyCode["KEY_V"] = 52] = "KEY_V"; - KeyCode[KeyCode["KEY_W"] = 53] = "KEY_W"; - KeyCode[KeyCode["KEY_X"] = 54] = "KEY_X"; - KeyCode[KeyCode["KEY_Y"] = 55] = "KEY_Y"; - KeyCode[KeyCode["KEY_Z"] = 56] = "KEY_Z"; - KeyCode[KeyCode["Meta"] = 57] = "Meta"; - KeyCode[KeyCode["ContextMenu"] = 58] = "ContextMenu"; - KeyCode[KeyCode["F1"] = 59] = "F1"; - KeyCode[KeyCode["F2"] = 60] = "F2"; - KeyCode[KeyCode["F3"] = 61] = "F3"; - KeyCode[KeyCode["F4"] = 62] = "F4"; - KeyCode[KeyCode["F5"] = 63] = "F5"; - KeyCode[KeyCode["F6"] = 64] = "F6"; - KeyCode[KeyCode["F7"] = 65] = "F7"; - KeyCode[KeyCode["F8"] = 66] = "F8"; - KeyCode[KeyCode["F9"] = 67] = "F9"; - KeyCode[KeyCode["F10"] = 68] = "F10"; - KeyCode[KeyCode["F11"] = 69] = "F11"; - KeyCode[KeyCode["F12"] = 70] = "F12"; - KeyCode[KeyCode["F13"] = 71] = "F13"; - KeyCode[KeyCode["F14"] = 72] = "F14"; - KeyCode[KeyCode["F15"] = 73] = "F15"; - KeyCode[KeyCode["F16"] = 74] = "F16"; - KeyCode[KeyCode["F17"] = 75] = "F17"; - KeyCode[KeyCode["F18"] = 76] = "F18"; - KeyCode[KeyCode["F19"] = 77] = "F19"; - KeyCode[KeyCode["NumLock"] = 78] = "NumLock"; - KeyCode[KeyCode["ScrollLock"] = 79] = "ScrollLock"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the ';:' key - */ - KeyCode[KeyCode["US_SEMICOLON"] = 80] = "US_SEMICOLON"; - /** - * For any country/region, the '+' key - * For the US standard keyboard, the '=+' key - */ - KeyCode[KeyCode["US_EQUAL"] = 81] = "US_EQUAL"; - /** - * For any country/region, the ',' key - * For the US standard keyboard, the ',<' key - */ - KeyCode[KeyCode["US_COMMA"] = 82] = "US_COMMA"; - /** - * For any country/region, the '-' key - * For the US standard keyboard, the '-_' key - */ - KeyCode[KeyCode["US_MINUS"] = 83] = "US_MINUS"; - /** - * For any country/region, the '.' key - * For the US standard keyboard, the '.>' key - */ - KeyCode[KeyCode["US_DOT"] = 84] = "US_DOT"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the '/?' key - */ - KeyCode[KeyCode["US_SLASH"] = 85] = "US_SLASH"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the '`~' key - */ - KeyCode[KeyCode["US_BACKTICK"] = 86] = "US_BACKTICK"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the '[{' key - */ - KeyCode[KeyCode["US_OPEN_SQUARE_BRACKET"] = 87] = "US_OPEN_SQUARE_BRACKET"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the '\|' key - */ - KeyCode[KeyCode["US_BACKSLASH"] = 88] = "US_BACKSLASH"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the ']}' key - */ - KeyCode[KeyCode["US_CLOSE_SQUARE_BRACKET"] = 89] = "US_CLOSE_SQUARE_BRACKET"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the ''"' key - */ - KeyCode[KeyCode["US_QUOTE"] = 90] = "US_QUOTE"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - */ - KeyCode[KeyCode["OEM_8"] = 91] = "OEM_8"; - /** - * Either the angle bracket key or the backslash key on the RT 102-key keyboard. - */ - KeyCode[KeyCode["OEM_102"] = 92] = "OEM_102"; - KeyCode[KeyCode["NUMPAD_0"] = 93] = "NUMPAD_0"; - KeyCode[KeyCode["NUMPAD_1"] = 94] = "NUMPAD_1"; - KeyCode[KeyCode["NUMPAD_2"] = 95] = "NUMPAD_2"; - KeyCode[KeyCode["NUMPAD_3"] = 96] = "NUMPAD_3"; - KeyCode[KeyCode["NUMPAD_4"] = 97] = "NUMPAD_4"; - KeyCode[KeyCode["NUMPAD_5"] = 98] = "NUMPAD_5"; - KeyCode[KeyCode["NUMPAD_6"] = 99] = "NUMPAD_6"; - KeyCode[KeyCode["NUMPAD_7"] = 100] = "NUMPAD_7"; - KeyCode[KeyCode["NUMPAD_8"] = 101] = "NUMPAD_8"; - KeyCode[KeyCode["NUMPAD_9"] = 102] = "NUMPAD_9"; - KeyCode[KeyCode["NUMPAD_MULTIPLY"] = 103] = "NUMPAD_MULTIPLY"; - KeyCode[KeyCode["NUMPAD_ADD"] = 104] = "NUMPAD_ADD"; - KeyCode[KeyCode["NUMPAD_SEPARATOR"] = 105] = "NUMPAD_SEPARATOR"; - KeyCode[KeyCode["NUMPAD_SUBTRACT"] = 106] = "NUMPAD_SUBTRACT"; - KeyCode[KeyCode["NUMPAD_DECIMAL"] = 107] = "NUMPAD_DECIMAL"; - KeyCode[KeyCode["NUMPAD_DIVIDE"] = 108] = "NUMPAD_DIVIDE"; - /** - * Cover all key codes when IME is processing input. - */ - KeyCode[KeyCode["KEY_IN_COMPOSITION"] = 109] = "KEY_IN_COMPOSITION"; - KeyCode[KeyCode["ABNT_C1"] = 110] = "ABNT_C1"; - KeyCode[KeyCode["ABNT_C2"] = 111] = "ABNT_C2"; - /** - * Placed last to cover the length of the enum. - * Please do not depend on this value! - */ - KeyCode[KeyCode["MAX_VALUE"] = 112] = "MAX_VALUE"; -})(KeyCode || (KeyCode = {})); -var MarkerSeverity; -(function (MarkerSeverity) { - MarkerSeverity[MarkerSeverity["Hint"] = 1] = "Hint"; - MarkerSeverity[MarkerSeverity["Info"] = 2] = "Info"; - MarkerSeverity[MarkerSeverity["Warning"] = 4] = "Warning"; - MarkerSeverity[MarkerSeverity["Error"] = 8] = "Error"; -})(MarkerSeverity || (MarkerSeverity = {})); -var MarkerTag; -(function (MarkerTag) { - MarkerTag[MarkerTag["Unnecessary"] = 1] = "Unnecessary"; - MarkerTag[MarkerTag["Deprecated"] = 2] = "Deprecated"; -})(MarkerTag || (MarkerTag = {})); -/** - * Position in the minimap to render the decoration. - */ -var MinimapPosition; -(function (MinimapPosition) { - MinimapPosition[MinimapPosition["Inline"] = 1] = "Inline"; - MinimapPosition[MinimapPosition["Gutter"] = 2] = "Gutter"; -})(MinimapPosition || (MinimapPosition = {})); -/** - * Type of hit element with the mouse in the editor. - */ -var MouseTargetType; -(function (MouseTargetType) { - /** - * Mouse is on top of an unknown element. - */ - MouseTargetType[MouseTargetType["UNKNOWN"] = 0] = "UNKNOWN"; - /** - * Mouse is on top of the textarea used for input. - */ - MouseTargetType[MouseTargetType["TEXTAREA"] = 1] = "TEXTAREA"; - /** - * Mouse is on top of the glyph margin - */ - MouseTargetType[MouseTargetType["GUTTER_GLYPH_MARGIN"] = 2] = "GUTTER_GLYPH_MARGIN"; - /** - * Mouse is on top of the line numbers - */ - MouseTargetType[MouseTargetType["GUTTER_LINE_NUMBERS"] = 3] = "GUTTER_LINE_NUMBERS"; - /** - * Mouse is on top of the line decorations - */ - MouseTargetType[MouseTargetType["GUTTER_LINE_DECORATIONS"] = 4] = "GUTTER_LINE_DECORATIONS"; - /** - * Mouse is on top of the whitespace left in the gutter by a view zone. - */ - MouseTargetType[MouseTargetType["GUTTER_VIEW_ZONE"] = 5] = "GUTTER_VIEW_ZONE"; - /** - * Mouse is on top of text in the content. - */ - MouseTargetType[MouseTargetType["CONTENT_TEXT"] = 6] = "CONTENT_TEXT"; - /** - * Mouse is on top of empty space in the content (e.g. after line text or below last line) - */ - MouseTargetType[MouseTargetType["CONTENT_EMPTY"] = 7] = "CONTENT_EMPTY"; - /** - * Mouse is on top of a view zone in the content. - */ - MouseTargetType[MouseTargetType["CONTENT_VIEW_ZONE"] = 8] = "CONTENT_VIEW_ZONE"; - /** - * Mouse is on top of a content widget. - */ - MouseTargetType[MouseTargetType["CONTENT_WIDGET"] = 9] = "CONTENT_WIDGET"; - /** - * Mouse is on top of the decorations overview ruler. - */ - MouseTargetType[MouseTargetType["OVERVIEW_RULER"] = 10] = "OVERVIEW_RULER"; - /** - * Mouse is on top of a scrollbar. - */ - MouseTargetType[MouseTargetType["SCROLLBAR"] = 11] = "SCROLLBAR"; - /** - * Mouse is on top of an overlay widget. - */ - MouseTargetType[MouseTargetType["OVERLAY_WIDGET"] = 12] = "OVERLAY_WIDGET"; - /** - * Mouse is outside of the editor. - */ - MouseTargetType[MouseTargetType["OUTSIDE_EDITOR"] = 13] = "OUTSIDE_EDITOR"; -})(MouseTargetType || (MouseTargetType = {})); -/** - * A positioning preference for rendering overlay widgets. - */ -var OverlayWidgetPositionPreference; -(function (OverlayWidgetPositionPreference) { - /** - * Position the overlay widget in the top right corner - */ - OverlayWidgetPositionPreference[OverlayWidgetPositionPreference["TOP_RIGHT_CORNER"] = 0] = "TOP_RIGHT_CORNER"; - /** - * Position the overlay widget in the bottom right corner - */ - OverlayWidgetPositionPreference[OverlayWidgetPositionPreference["BOTTOM_RIGHT_CORNER"] = 1] = "BOTTOM_RIGHT_CORNER"; - /** - * Position the overlay widget in the top center - */ - OverlayWidgetPositionPreference[OverlayWidgetPositionPreference["TOP_CENTER"] = 2] = "TOP_CENTER"; -})(OverlayWidgetPositionPreference || (OverlayWidgetPositionPreference = {})); -/** - * Vertical Lane in the overview ruler of the editor. - */ -var OverviewRulerLane; -(function (OverviewRulerLane) { - OverviewRulerLane[OverviewRulerLane["Left"] = 1] = "Left"; - OverviewRulerLane[OverviewRulerLane["Center"] = 2] = "Center"; - OverviewRulerLane[OverviewRulerLane["Right"] = 4] = "Right"; - OverviewRulerLane[OverviewRulerLane["Full"] = 7] = "Full"; -})(OverviewRulerLane || (OverviewRulerLane = {})); -var RenderLineNumbersType; -(function (RenderLineNumbersType) { - RenderLineNumbersType[RenderLineNumbersType["Off"] = 0] = "Off"; - RenderLineNumbersType[RenderLineNumbersType["On"] = 1] = "On"; - RenderLineNumbersType[RenderLineNumbersType["Relative"] = 2] = "Relative"; - RenderLineNumbersType[RenderLineNumbersType["Interval"] = 3] = "Interval"; - RenderLineNumbersType[RenderLineNumbersType["Custom"] = 4] = "Custom"; -})(RenderLineNumbersType || (RenderLineNumbersType = {})); -var RenderMinimap; -(function (RenderMinimap) { - RenderMinimap[RenderMinimap["None"] = 0] = "None"; - RenderMinimap[RenderMinimap["Text"] = 1] = "Text"; - RenderMinimap[RenderMinimap["Blocks"] = 2] = "Blocks"; -})(RenderMinimap || (RenderMinimap = {})); -var ScrollType; -(function (ScrollType) { - ScrollType[ScrollType["Smooth"] = 0] = "Smooth"; - ScrollType[ScrollType["Immediate"] = 1] = "Immediate"; -})(ScrollType || (ScrollType = {})); -var ScrollbarVisibility; -(function (ScrollbarVisibility) { - ScrollbarVisibility[ScrollbarVisibility["Auto"] = 1] = "Auto"; - ScrollbarVisibility[ScrollbarVisibility["Hidden"] = 2] = "Hidden"; - ScrollbarVisibility[ScrollbarVisibility["Visible"] = 3] = "Visible"; -})(ScrollbarVisibility || (ScrollbarVisibility = {})); -/** - * The direction of a selection. - */ -var SelectionDirection; -(function (SelectionDirection) { - /** - * The selection starts above where it ends. - */ - SelectionDirection[SelectionDirection["LTR"] = 0] = "LTR"; - /** - * The selection starts below where it ends. - */ - SelectionDirection[SelectionDirection["RTL"] = 1] = "RTL"; -})(SelectionDirection || (SelectionDirection = {})); -var SignatureHelpTriggerKind; -(function (SignatureHelpTriggerKind) { - SignatureHelpTriggerKind[SignatureHelpTriggerKind["Invoke"] = 1] = "Invoke"; - SignatureHelpTriggerKind[SignatureHelpTriggerKind["TriggerCharacter"] = 2] = "TriggerCharacter"; - SignatureHelpTriggerKind[SignatureHelpTriggerKind["ContentChange"] = 3] = "ContentChange"; -})(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {})); -/** - * A symbol kind. - */ -var SymbolKind; -(function (SymbolKind) { - SymbolKind[SymbolKind["File"] = 0] = "File"; - SymbolKind[SymbolKind["Module"] = 1] = "Module"; - SymbolKind[SymbolKind["Namespace"] = 2] = "Namespace"; - SymbolKind[SymbolKind["Package"] = 3] = "Package"; - SymbolKind[SymbolKind["Class"] = 4] = "Class"; - SymbolKind[SymbolKind["Method"] = 5] = "Method"; - SymbolKind[SymbolKind["Property"] = 6] = "Property"; - SymbolKind[SymbolKind["Field"] = 7] = "Field"; - SymbolKind[SymbolKind["Constructor"] = 8] = "Constructor"; - SymbolKind[SymbolKind["Enum"] = 9] = "Enum"; - SymbolKind[SymbolKind["Interface"] = 10] = "Interface"; - SymbolKind[SymbolKind["Function"] = 11] = "Function"; - SymbolKind[SymbolKind["Variable"] = 12] = "Variable"; - SymbolKind[SymbolKind["Constant"] = 13] = "Constant"; - SymbolKind[SymbolKind["String"] = 14] = "String"; - SymbolKind[SymbolKind["Number"] = 15] = "Number"; - SymbolKind[SymbolKind["Boolean"] = 16] = "Boolean"; - SymbolKind[SymbolKind["Array"] = 17] = "Array"; - SymbolKind[SymbolKind["Object"] = 18] = "Object"; - SymbolKind[SymbolKind["Key"] = 19] = "Key"; - SymbolKind[SymbolKind["Null"] = 20] = "Null"; - SymbolKind[SymbolKind["EnumMember"] = 21] = "EnumMember"; - SymbolKind[SymbolKind["Struct"] = 22] = "Struct"; - SymbolKind[SymbolKind["Event"] = 23] = "Event"; - SymbolKind[SymbolKind["Operator"] = 24] = "Operator"; - SymbolKind[SymbolKind["TypeParameter"] = 25] = "TypeParameter"; -})(SymbolKind || (SymbolKind = {})); -var SymbolTag; -(function (SymbolTag) { - SymbolTag[SymbolTag["Deprecated"] = 1] = "Deprecated"; -})(SymbolTag || (SymbolTag = {})); -/** - * The kind of animation in which the editor's cursor should be rendered. - */ -var TextEditorCursorBlinkingStyle; -(function (TextEditorCursorBlinkingStyle) { - /** - * Hidden - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Hidden"] = 0] = "Hidden"; - /** - * Blinking - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Blink"] = 1] = "Blink"; - /** - * Blinking with smooth fading - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Smooth"] = 2] = "Smooth"; - /** - * Blinking with prolonged filled state and smooth fading - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Phase"] = 3] = "Phase"; - /** - * Expand collapse animation on the y axis - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Expand"] = 4] = "Expand"; - /** - * No-Blinking - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Solid"] = 5] = "Solid"; -})(TextEditorCursorBlinkingStyle || (TextEditorCursorBlinkingStyle = {})); -/** - * The style in which the editor's cursor should be rendered. - */ -var TextEditorCursorStyle; -(function (TextEditorCursorStyle) { - /** - * As a vertical line (sitting between two characters). - */ - TextEditorCursorStyle[TextEditorCursorStyle["Line"] = 1] = "Line"; - /** - * As a block (sitting on top of a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["Block"] = 2] = "Block"; - /** - * As a horizontal line (sitting under a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["Underline"] = 3] = "Underline"; - /** - * As a thin vertical line (sitting between two characters). - */ - TextEditorCursorStyle[TextEditorCursorStyle["LineThin"] = 4] = "LineThin"; - /** - * As an outlined block (sitting on top of a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["BlockOutline"] = 5] = "BlockOutline"; - /** - * As a thin horizontal line (sitting under a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["UnderlineThin"] = 6] = "UnderlineThin"; -})(TextEditorCursorStyle || (TextEditorCursorStyle = {})); -/** - * Describes the behavior of decorations when typing/editing near their edges. - * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior` - */ -var TrackedRangeStickiness; -(function (TrackedRangeStickiness) { - TrackedRangeStickiness[TrackedRangeStickiness["AlwaysGrowsWhenTypingAtEdges"] = 0] = "AlwaysGrowsWhenTypingAtEdges"; - TrackedRangeStickiness[TrackedRangeStickiness["NeverGrowsWhenTypingAtEdges"] = 1] = "NeverGrowsWhenTypingAtEdges"; - TrackedRangeStickiness[TrackedRangeStickiness["GrowsOnlyWhenTypingBefore"] = 2] = "GrowsOnlyWhenTypingBefore"; - TrackedRangeStickiness[TrackedRangeStickiness["GrowsOnlyWhenTypingAfter"] = 3] = "GrowsOnlyWhenTypingAfter"; -})(TrackedRangeStickiness || (TrackedRangeStickiness = {})); -/** - * Describes how to indent wrapped lines. - */ -var WrappingIndent; -(function (WrappingIndent) { - /** - * No indentation => wrapped lines begin at column 1. - */ - WrappingIndent[WrappingIndent["None"] = 0] = "None"; - /** - * Same => wrapped lines get the same indentation as the parent. - */ - WrappingIndent[WrappingIndent["Same"] = 1] = "Same"; - /** - * Indent => wrapped lines get +1 indentation toward the parent. - */ - WrappingIndent[WrappingIndent["Indent"] = 2] = "Indent"; - /** - * DeepIndent => wrapped lines get +2 indentation toward the parent. - */ - WrappingIndent[WrappingIndent["DeepIndent"] = 3] = "DeepIndent"; -})(WrappingIndent || (WrappingIndent = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js ***! - \******************************************************************************/ -/*! exports provided: AccessibilityHelpNLS, InspectTokensNLS, GoToLineNLS, QuickHelpNLS, QuickCommandNLS, QuickOutlineNLS, StandaloneCodeEditorNLS, ToggleHighContrastNLS, SimpleServicesNLS */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccessibilityHelpNLS", function() { return AccessibilityHelpNLS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InspectTokensNLS", function() { return InspectTokensNLS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GoToLineNLS", function() { return GoToLineNLS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickHelpNLS", function() { return QuickHelpNLS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickCommandNLS", function() { return QuickCommandNLS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickOutlineNLS", function() { return QuickOutlineNLS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneCodeEditorNLS", function() { return StandaloneCodeEditorNLS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ToggleHighContrastNLS", function() { return ToggleHighContrastNLS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleServicesNLS", function() { return SimpleServicesNLS; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var AccessibilityHelpNLS; -(function (AccessibilityHelpNLS) { - AccessibilityHelpNLS.noSelection = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("noSelection", "No selection"); - AccessibilityHelpNLS.singleSelectionRange = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("singleSelectionRange", "Line {0}, Column {1} ({2} selected)"); - AccessibilityHelpNLS.singleSelection = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("singleSelection", "Line {0}, Column {1}"); - AccessibilityHelpNLS.multiSelectionRange = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("multiSelectionRange", "{0} selections ({1} characters selected)"); - AccessibilityHelpNLS.multiSelection = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("multiSelection", "{0} selections"); - AccessibilityHelpNLS.emergencyConfOn = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("emergencyConfOn", "Now changing the setting `accessibilitySupport` to 'on'."); - AccessibilityHelpNLS.openingDocs = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("openingDocs", "Now opening the Editor Accessibility documentation page."); - AccessibilityHelpNLS.readonlyDiffEditor = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("readonlyDiffEditor", " in a read-only pane of a diff editor."); - AccessibilityHelpNLS.editableDiffEditor = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("editableDiffEditor", " in a pane of a diff editor."); - AccessibilityHelpNLS.readonlyEditor = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("readonlyEditor", " in a read-only code editor"); - AccessibilityHelpNLS.editableEditor = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("editableEditor", " in a code editor"); - AccessibilityHelpNLS.changeConfigToOnMac = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("changeConfigToOnMac", "To configure the editor to be optimized for usage with a Screen Reader press Command+E now."); - AccessibilityHelpNLS.changeConfigToOnWinLinux = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("changeConfigToOnWinLinux", "To configure the editor to be optimized for usage with a Screen Reader press Control+E now."); - AccessibilityHelpNLS.auto_on = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("auto_on", "The editor is configured to be optimized for usage with a Screen Reader."); - AccessibilityHelpNLS.auto_off = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("auto_off", "The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time."); - AccessibilityHelpNLS.tabFocusModeOnMsg = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("tabFocusModeOnMsg", "Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."); - AccessibilityHelpNLS.tabFocusModeOnMsgNoKb = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("tabFocusModeOnMsgNoKb", "Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding."); - AccessibilityHelpNLS.tabFocusModeOffMsg = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("tabFocusModeOffMsg", "Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."); - AccessibilityHelpNLS.tabFocusModeOffMsgNoKb = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("tabFocusModeOffMsgNoKb", "Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding."); - AccessibilityHelpNLS.openDocMac = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("openDocMac", "Press Command+H now to open a browser window with more information related to editor accessibility."); - AccessibilityHelpNLS.openDocWinLinux = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("openDocWinLinux", "Press Control+H now to open a browser window with more information related to editor accessibility."); - AccessibilityHelpNLS.outroMsg = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("outroMsg", "You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."); - AccessibilityHelpNLS.showAccessibilityHelpAction = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]("showAccessibilityHelpAction", "Show Accessibility Help"); -})(AccessibilityHelpNLS || (AccessibilityHelpNLS = {})); -var InspectTokensNLS; -(function (InspectTokensNLS) { - InspectTokensNLS.inspectTokensAction = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('inspectTokens', "Developer: Inspect Tokens"); -})(InspectTokensNLS || (InspectTokensNLS = {})); -var GoToLineNLS; -(function (GoToLineNLS) { - GoToLineNLS.gotoLineActionLabel = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('gotoLineActionLabel', "Go to Line/Column..."); -})(GoToLineNLS || (GoToLineNLS = {})); -var QuickHelpNLS; -(function (QuickHelpNLS) { - QuickHelpNLS.helpQuickAccessActionLabel = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('helpQuickAccess', "Show all Quick Access Providers"); -})(QuickHelpNLS || (QuickHelpNLS = {})); -var QuickCommandNLS; -(function (QuickCommandNLS) { - QuickCommandNLS.quickCommandActionLabel = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('quickCommandActionLabel', "Command Palette"); - QuickCommandNLS.quickCommandHelp = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('quickCommandActionHelp', "Show And Run Commands"); -})(QuickCommandNLS || (QuickCommandNLS = {})); -var QuickOutlineNLS; -(function (QuickOutlineNLS) { - QuickOutlineNLS.quickOutlineActionLabel = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('quickOutlineActionLabel', "Go to Symbol..."); - QuickOutlineNLS.quickOutlineByCategoryActionLabel = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('quickOutlineByCategoryActionLabel', "Go to Symbol by Category..."); -})(QuickOutlineNLS || (QuickOutlineNLS = {})); -var StandaloneCodeEditorNLS; -(function (StandaloneCodeEditorNLS) { - StandaloneCodeEditorNLS.editorViewAccessibleLabel = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorViewAccessibleLabel', "Editor content"); - StandaloneCodeEditorNLS.accessibilityHelpMessage = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('accessibilityHelpMessage', "Press Alt+F1 for Accessibility Options."); -})(StandaloneCodeEditorNLS || (StandaloneCodeEditorNLS = {})); -var ToggleHighContrastNLS; -(function (ToggleHighContrastNLS) { - ToggleHighContrastNLS.toggleHighContrast = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('toggleHighContrast', "Toggle High Contrast Theme"); -})(ToggleHighContrastNLS || (ToggleHighContrastNLS = {})); -var SimpleServicesNLS; -(function (SimpleServicesNLS) { - SimpleServicesNLS.bulkEditServiceSummary = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('bulkEditServiceSummary', "Made {0} edits in {1} files"); -})(SimpleServicesNLS || (SimpleServicesNLS = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js ***! - \*************************************************************************************/ -/*! exports provided: editorLineHighlight, editorLineHighlightBorder, editorRangeHighlight, editorRangeHighlightBorder, editorSymbolHighlight, editorSymbolHighlightBorder, editorCursorForeground, editorCursorBackground, editorWhitespaces, editorIndentGuides, editorActiveIndentGuides, editorLineNumbers, editorActiveLineNumber, editorRuler, editorCodeLensForeground, editorBracketMatchBackground, editorBracketMatchBorder, editorOverviewRulerBorder, editorOverviewRulerBackground, editorGutter, editorUnnecessaryCodeBorder, editorUnnecessaryCodeOpacity, overviewRulerRangeHighlight, overviewRulerError, overviewRulerWarning, overviewRulerInfo */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorLineHighlight", function() { return editorLineHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorLineHighlightBorder", function() { return editorLineHighlightBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorRangeHighlight", function() { return editorRangeHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorRangeHighlightBorder", function() { return editorRangeHighlightBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorSymbolHighlight", function() { return editorSymbolHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorSymbolHighlightBorder", function() { return editorSymbolHighlightBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorCursorForeground", function() { return editorCursorForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorCursorBackground", function() { return editorCursorBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorWhitespaces", function() { return editorWhitespaces; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorIndentGuides", function() { return editorIndentGuides; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorActiveIndentGuides", function() { return editorActiveIndentGuides; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorLineNumbers", function() { return editorLineNumbers; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorActiveLineNumber", function() { return editorActiveLineNumber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorRuler", function() { return editorRuler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorCodeLensForeground", function() { return editorCodeLensForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorBracketMatchBackground", function() { return editorBracketMatchBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorBracketMatchBorder", function() { return editorBracketMatchBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorOverviewRulerBorder", function() { return editorOverviewRulerBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorOverviewRulerBackground", function() { return editorOverviewRulerBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorGutter", function() { return editorGutter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorUnnecessaryCodeBorder", function() { return editorUnnecessaryCodeBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorUnnecessaryCodeOpacity", function() { return editorUnnecessaryCodeOpacity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "overviewRulerRangeHighlight", function() { return overviewRulerRangeHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "overviewRulerError", function() { return overviewRulerError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "overviewRulerWarning", function() { return overviewRulerWarning; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "overviewRulerInfo", function() { return overviewRulerInfo; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -/** - * Definition of the editor colors - */ -const editorLineHighlight = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editor.lineHighlightBackground', { dark: null, light: null, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lineHighlight', 'Background color for the highlight of line at the cursor position.')); -const editorLineHighlightBorder = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editor.lineHighlightBorder', { dark: '#282828', light: '#eeeeee', hc: '#f38518' }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lineHighlightBorderBox', 'Background color for the border around the line at the cursor position.')); -const editorRangeHighlight = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editor.rangeHighlightBackground', { dark: '#ffffff0b', light: '#fdff0033', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('rangeHighlight', 'Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations.'), true); -const editorRangeHighlightBorder = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editor.rangeHighlightBorder', { dark: null, light: null, hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["activeContrastBorder"] }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('rangeHighlightBorder', 'Background color of the border around highlighted ranges.'), true); -const editorSymbolHighlight = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editor.symbolHighlightBackground', { dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorFindMatchHighlight"], light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorFindMatchHighlight"], hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('symbolHighlight', 'Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations.'), true); -const editorSymbolHighlightBorder = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editor.symbolHighlightBorder', { dark: null, light: null, hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["activeContrastBorder"] }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('symbolHighlightBorder', 'Background color of the border around highlighted symbols.'), true); -const editorCursorForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorCursor.foreground', { dark: '#AEAFAD', light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].black, hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('caret', 'Color of the editor cursor.')); -const editorCursorBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorCursor.background', null, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorCursorBackground', 'The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.')); -const editorWhitespaces = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorWhitespace.foreground', { dark: '#e3e4e229', light: '#33333333', hc: '#e3e4e229' }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorWhitespaces', 'Color of whitespace characters in the editor.')); -const editorIndentGuides = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorIndentGuide.background', { dark: editorWhitespaces, light: editorWhitespaces, hc: editorWhitespaces }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorIndentGuides', 'Color of the editor indentation guides.')); -const editorActiveIndentGuides = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorIndentGuide.activeBackground', { dark: editorWhitespaces, light: editorWhitespaces, hc: editorWhitespaces }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorActiveIndentGuide', 'Color of the active editor indentation guides.')); -const editorLineNumbers = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorLineNumber.foreground', { dark: '#858585', light: '#237893', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorLineNumbers', 'Color of editor line numbers.')); -const deprecatedEditorActiveLineNumber = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorActiveLineNumber.foreground', { dark: '#c6c6c6', light: '#0B216F', hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["activeContrastBorder"] }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorActiveLineNumber', 'Color of editor active line number'), false, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('deprecatedEditorActiveLineNumber', 'Id is deprecated. Use \'editorLineNumber.activeForeground\' instead.')); -const editorActiveLineNumber = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorLineNumber.activeForeground', { dark: deprecatedEditorActiveLineNumber, light: deprecatedEditorActiveLineNumber, hc: deprecatedEditorActiveLineNumber }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorActiveLineNumber', 'Color of editor active line number')); -const editorRuler = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorRuler.foreground', { dark: '#5A5A5A', light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].lightgrey, hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorRuler', 'Color of the editor rulers.')); -const editorCodeLensForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorCodeLens.foreground', { dark: '#999999', light: '#999999', hc: '#999999' }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorCodeLensForeground', 'Foreground color of editor CodeLens')); -const editorBracketMatchBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorBracketMatch.background', { dark: '#0064001a', light: '#0064001a', hc: '#0064001a' }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorBracketMatchBackground', 'Background color behind matching brackets')); -const editorBracketMatchBorder = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorBracketMatch.border', { dark: '#888', light: '#B9B9B9', hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["contrastBorder"] }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorBracketMatchBorder', 'Color for matching brackets boxes')); -const editorOverviewRulerBorder = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorOverviewRuler.border', { dark: '#7f7f7f4d', light: '#7f7f7f4d', hc: '#7f7f7f4d' }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorOverviewRulerBorder', 'Color of the overview ruler border.')); -const editorOverviewRulerBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorOverviewRuler.background', null, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorOverviewRulerBackground', 'Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.')); -const editorGutter = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorGutter.background', { dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorBackground"], light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorBackground"], hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorBackground"] }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editorGutter', 'Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.')); -const editorUnnecessaryCodeBorder = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorUnnecessaryCode.border', { dark: null, light: null, hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#fff').transparent(0.8) }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('unnecessaryCodeBorder', 'Border color of unnecessary (unused) source code in the editor.')); -const editorUnnecessaryCodeOpacity = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorUnnecessaryCode.opacity', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#000a'), light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#0007'), hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('unnecessaryCodeOpacity', 'Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the \'editorUnnecessaryCode.border\' theme color to underline unnecessary code instead of fading it out.')); -const rulerRangeDefault = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](0, 122, 204, 0.6)); -const overviewRulerRangeHighlight = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorOverviewRuler.rangeHighlightForeground', { dark: rulerRangeDefault, light: rulerRangeDefault, hc: rulerRangeDefault }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('overviewRulerRangeHighlight', 'Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.'), true); -const overviewRulerError = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorOverviewRuler.errorForeground', { dark: new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](255, 18, 18, 0.7)), light: new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](255, 18, 18, 0.7)), hc: new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](255, 50, 50, 1)) }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('overviewRuleError', 'Overview ruler marker color for errors.')); -const overviewRulerWarning = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorOverviewRuler.warningForeground', { dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorWarningForeground"], light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorWarningForeground"], hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorWarningBorder"] }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('overviewRuleWarning', 'Overview ruler marker color for warnings.')); -const overviewRulerInfo = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["registerColor"])('editorOverviewRuler.infoForeground', { dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorInfoForeground"], light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorInfoForeground"], hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorInfoBorder"] }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('overviewRuleInfo', 'Overview ruler marker color for infos.')); -// contains all color rules that used to defined in editor/browser/widget/editor.css -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_3__["registerThemingParticipant"])((theme, collector) => { - const background = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorBackground"]); - if (background) { - collector.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${background}; }`); - } - const foreground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["editorForeground"]); - if (foreground) { - collector.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${foreground}; }`); - } - const gutter = theme.getColor(editorGutter); - if (gutter) { - collector.addRule(`.monaco-editor .margin { background-color: ${gutter}; }`); - } - const rangeHighlight = theme.getColor(editorRangeHighlight); - if (rangeHighlight) { - collector.addRule(`.monaco-editor .rangeHighlight { background-color: ${rangeHighlight}; }`); - } - const rangeHighlightBorder = theme.getColor(editorRangeHighlightBorder); - if (rangeHighlightBorder) { - collector.addRule(`.monaco-editor .rangeHighlight { border: 1px ${theme.type === 'hc' ? 'dotted' : 'solid'} ${rangeHighlightBorder}; }`); - } - const symbolHighlight = theme.getColor(editorSymbolHighlight); - if (symbolHighlight) { - collector.addRule(`.monaco-editor .symbolHighlight { background-color: ${symbolHighlight}; }`); - } - const symbolHighlightBorder = theme.getColor(editorSymbolHighlightBorder); - if (symbolHighlightBorder) { - collector.addRule(`.monaco-editor .symbolHighlight { border: 1px ${theme.type === 'hc' ? 'dotted' : 'solid'} ${symbolHighlightBorder}; }`); - } - const invisibles = theme.getColor(editorWhitespaces); - if (invisibles) { - collector.addRule(`.monaco-editor .mtkw { color: ${invisibles} !important; }`); - collector.addRule(`.monaco-editor .mtkz { color: ${invisibles} !important; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/view/overviewZoneManager.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/view/overviewZoneManager.js ***! - \*************************************************************************************/ -/*! exports provided: ColorZone, OverviewRulerZone, OverviewZoneManager */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorZone", function() { return ColorZone; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewRulerZone", function() { return OverviewRulerZone; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewZoneManager", function() { return OverviewZoneManager; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class ColorZone { - constructor(from, to, colorId) { - this.from = from | 0; - this.to = to | 0; - this.colorId = colorId | 0; - } - static compare(a, b) { - if (a.colorId === b.colorId) { - if (a.from === b.from) { - return a.to - b.to; - } - return a.from - b.from; - } - return a.colorId - b.colorId; - } -} -/** - * A zone in the overview ruler - */ -class OverviewRulerZone { - constructor(startLineNumber, endLineNumber, color) { - this.startLineNumber = startLineNumber; - this.endLineNumber = endLineNumber; - this.color = color; - this._colorZone = null; - } - static compare(a, b) { - if (a.color === b.color) { - if (a.startLineNumber === b.startLineNumber) { - return a.endLineNumber - b.endLineNumber; - } - return a.startLineNumber - b.startLineNumber; - } - return a.color < b.color ? -1 : 1; - } - setColorZone(colorZone) { - this._colorZone = colorZone; - } - getColorZones() { - return this._colorZone; - } -} -class OverviewZoneManager { - constructor(getVerticalOffsetForLine) { - this._getVerticalOffsetForLine = getVerticalOffsetForLine; - this._zones = []; - this._colorZonesInvalid = false; - this._lineHeight = 0; - this._domWidth = 0; - this._domHeight = 0; - this._outerHeight = 0; - this._pixelRatio = 1; - this._lastAssignedId = 0; - this._color2Id = Object.create(null); - this._id2Color = []; - } - getId2Color() { - return this._id2Color; - } - setZones(newZones) { - this._zones = newZones; - this._zones.sort(OverviewRulerZone.compare); - } - setLineHeight(lineHeight) { - if (this._lineHeight === lineHeight) { - return false; - } - this._lineHeight = lineHeight; - this._colorZonesInvalid = true; - return true; - } - setPixelRatio(pixelRatio) { - this._pixelRatio = pixelRatio; - this._colorZonesInvalid = true; - } - getDOMWidth() { - return this._domWidth; - } - getCanvasWidth() { - return this._domWidth * this._pixelRatio; - } - setDOMWidth(width) { - if (this._domWidth === width) { - return false; - } - this._domWidth = width; - this._colorZonesInvalid = true; - return true; - } - getDOMHeight() { - return this._domHeight; - } - getCanvasHeight() { - return this._domHeight * this._pixelRatio; - } - setDOMHeight(height) { - if (this._domHeight === height) { - return false; - } - this._domHeight = height; - this._colorZonesInvalid = true; - return true; - } - getOuterHeight() { - return this._outerHeight; - } - setOuterHeight(outerHeight) { - if (this._outerHeight === outerHeight) { - return false; - } - this._outerHeight = outerHeight; - this._colorZonesInvalid = true; - return true; - } - resolveColorZones() { - const colorZonesInvalid = this._colorZonesInvalid; - const lineHeight = Math.floor(this._lineHeight); // @perf - const totalHeight = Math.floor(this.getCanvasHeight()); // @perf - const outerHeight = Math.floor(this._outerHeight); // @perf - const heightRatio = totalHeight / outerHeight; - const halfMinimumHeight = Math.floor(4 /* MINIMUM_HEIGHT */ * this._pixelRatio / 2); - let allColorZones = []; - for (let i = 0, len = this._zones.length; i < len; i++) { - const zone = this._zones[i]; - if (!colorZonesInvalid) { - const colorZone = zone.getColorZones(); - if (colorZone) { - allColorZones.push(colorZone); - continue; - } - } - const y1 = Math.floor(heightRatio * (this._getVerticalOffsetForLine(zone.startLineNumber))); - const y2 = Math.floor(heightRatio * (this._getVerticalOffsetForLine(zone.endLineNumber) + lineHeight)); - let ycenter = Math.floor((y1 + y2) / 2); - let halfHeight = (y2 - ycenter); - if (halfHeight < halfMinimumHeight) { - halfHeight = halfMinimumHeight; - } - if (ycenter - halfHeight < 0) { - ycenter = halfHeight; - } - if (ycenter + halfHeight > totalHeight) { - ycenter = totalHeight - halfHeight; - } - const color = zone.color; - let colorId = this._color2Id[color]; - if (!colorId) { - colorId = (++this._lastAssignedId); - this._color2Id[color] = colorId; - this._id2Color[colorId] = color; - } - const colorZone = new ColorZone(ycenter - halfHeight, ycenter + halfHeight, colorId); - zone.setColorZone(colorZone); - allColorZones.push(colorZone); - } - this._colorZonesInvalid = false; - allColorZones.sort(ColorZone.compare); - return allColorZones; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/view/renderingContext.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/view/renderingContext.js ***! - \**********************************************************************************/ -/*! exports provided: RestrictedRenderingContext, RenderingContext, LineVisibleRanges, HorizontalRange, HorizontalPosition, VisibleRanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RestrictedRenderingContext", function() { return RestrictedRenderingContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderingContext", function() { return RenderingContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineVisibleRanges", function() { return LineVisibleRanges; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HorizontalRange", function() { return HorizontalRange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HorizontalPosition", function() { return HorizontalPosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VisibleRanges", function() { return VisibleRanges; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class RestrictedRenderingContext { - constructor(viewLayout, viewportData) { - this._viewLayout = viewLayout; - this.viewportData = viewportData; - this.scrollWidth = this._viewLayout.getScrollWidth(); - this.scrollHeight = this._viewLayout.getScrollHeight(); - this.visibleRange = this.viewportData.visibleRange; - this.bigNumbersDelta = this.viewportData.bigNumbersDelta; - const vInfo = this._viewLayout.getCurrentViewport(); - this.scrollTop = vInfo.top; - this.scrollLeft = vInfo.left; - this.viewportWidth = vInfo.width; - this.viewportHeight = vInfo.height; - } - getScrolledTopFromAbsoluteTop(absoluteTop) { - return absoluteTop - this.scrollTop; - } - getVerticalOffsetForLineNumber(lineNumber) { - return this._viewLayout.getVerticalOffsetForLineNumber(lineNumber); - } - getDecorationsInViewport() { - return this.viewportData.getDecorationsInViewport(); - } -} -class RenderingContext extends RestrictedRenderingContext { - constructor(viewLayout, viewportData, viewLines) { - super(viewLayout, viewportData); - this._viewLines = viewLines; - } - linesVisibleRangesForRange(range, includeNewLines) { - return this._viewLines.linesVisibleRangesForRange(range, includeNewLines); - } - visibleRangeForPosition(position) { - return this._viewLines.visibleRangeForPosition(position); - } -} -class LineVisibleRanges { - constructor(outsideRenderedLine, lineNumber, ranges) { - this.outsideRenderedLine = outsideRenderedLine; - this.lineNumber = lineNumber; - this.ranges = ranges; - } -} -class HorizontalRange { - constructor(left, width) { - this.left = Math.round(left); - this.width = Math.round(width); - } - toString() { - return `[${this.left},${this.width}]`; - } -} -class HorizontalPosition { - constructor(outsideRenderedLine, left) { - this.outsideRenderedLine = outsideRenderedLine; - this.left = Math.round(left); - } -} -class VisibleRanges { - constructor(outsideRenderedLine, ranges) { - this.outsideRenderedLine = outsideRenderedLine; - this.ranges = ranges; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/view/viewContext.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/view/viewContext.js ***! - \*****************************************************************************/ -/*! exports provided: EditorTheme, ViewContext */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorTheme", function() { return EditorTheme; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewContext", function() { return ViewContext; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class EditorTheme { - constructor(theme) { - this._theme = theme; - } - get type() { - return this._theme.type; - } - update(theme) { - this._theme = theme; - } - getColor(color) { - return this._theme.getColor(color); - } -} -class ViewContext { - constructor(configuration, theme, model) { - this.configuration = configuration; - this.theme = new EditorTheme(theme); - this.model = model; - this.viewLayout = model.viewLayout; - } - addEventHandler(eventHandler) { - this.model.addViewEventHandler(eventHandler); - } - removeEventHandler(eventHandler) { - this.model.removeViewEventHandler(eventHandler); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/view/viewEvents.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/view/viewEvents.js ***! - \****************************************************************************/ -/*! exports provided: ViewConfigurationChangedEvent, ViewCursorStateChangedEvent, ViewDecorationsChangedEvent, ViewFlushedEvent, ViewFocusChangedEvent, ViewLanguageConfigurationEvent, ViewLineMappingChangedEvent, ViewLinesChangedEvent, ViewLinesDeletedEvent, ViewLinesInsertedEvent, ViewRevealRangeRequestEvent, ViewScrollChangedEvent, ViewThemeChangedEvent, ViewTokensChangedEvent, ViewTokensColorsChangedEvent, ViewZonesChangedEvent */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewConfigurationChangedEvent", function() { return ViewConfigurationChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewCursorStateChangedEvent", function() { return ViewCursorStateChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewDecorationsChangedEvent", function() { return ViewDecorationsChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewFlushedEvent", function() { return ViewFlushedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewFocusChangedEvent", function() { return ViewFocusChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewLanguageConfigurationEvent", function() { return ViewLanguageConfigurationEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewLineMappingChangedEvent", function() { return ViewLineMappingChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewLinesChangedEvent", function() { return ViewLinesChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewLinesDeletedEvent", function() { return ViewLinesDeletedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewLinesInsertedEvent", function() { return ViewLinesInsertedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewRevealRangeRequestEvent", function() { return ViewRevealRangeRequestEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewScrollChangedEvent", function() { return ViewScrollChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewThemeChangedEvent", function() { return ViewThemeChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewTokensChangedEvent", function() { return ViewTokensChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewTokensColorsChangedEvent", function() { return ViewTokensColorsChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewZonesChangedEvent", function() { return ViewZonesChangedEvent; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class ViewConfigurationChangedEvent { - constructor(source) { - this.type = 0 /* ViewConfigurationChanged */; - this._source = source; - } - hasChanged(id) { - return this._source.hasChanged(id); - } -} -class ViewCursorStateChangedEvent { - constructor(selections, modelSelections) { - this.type = 1 /* ViewCursorStateChanged */; - this.selections = selections; - this.modelSelections = modelSelections; - } -} -class ViewDecorationsChangedEvent { - constructor(source) { - this.type = 2 /* ViewDecorationsChanged */; - if (source) { - this.affectsMinimap = source.affectsMinimap; - this.affectsOverviewRuler = source.affectsOverviewRuler; - } - else { - this.affectsMinimap = true; - this.affectsOverviewRuler = true; - } - } -} -class ViewFlushedEvent { - constructor() { - this.type = 3 /* ViewFlushed */; - // Nothing to do - } -} -class ViewFocusChangedEvent { - constructor(isFocused) { - this.type = 4 /* ViewFocusChanged */; - this.isFocused = isFocused; - } -} -class ViewLanguageConfigurationEvent { - constructor() { - this.type = 5 /* ViewLanguageConfigurationChanged */; - } -} -class ViewLineMappingChangedEvent { - constructor() { - this.type = 6 /* ViewLineMappingChanged */; - // Nothing to do - } -} -class ViewLinesChangedEvent { - constructor(fromLineNumber, toLineNumber) { - this.type = 7 /* ViewLinesChanged */; - this.fromLineNumber = fromLineNumber; - this.toLineNumber = toLineNumber; - } -} -class ViewLinesDeletedEvent { - constructor(fromLineNumber, toLineNumber) { - this.type = 8 /* ViewLinesDeleted */; - this.fromLineNumber = fromLineNumber; - this.toLineNumber = toLineNumber; - } -} -class ViewLinesInsertedEvent { - constructor(fromLineNumber, toLineNumber) { - this.type = 9 /* ViewLinesInserted */; - this.fromLineNumber = fromLineNumber; - this.toLineNumber = toLineNumber; - } -} -class ViewRevealRangeRequestEvent { - constructor(source, range, selections, verticalType, revealHorizontal, scrollType) { - this.type = 10 /* ViewRevealRangeRequest */; - this.source = source; - this.range = range; - this.selections = selections; - this.verticalType = verticalType; - this.revealHorizontal = revealHorizontal; - this.scrollType = scrollType; - } -} -class ViewScrollChangedEvent { - constructor(source) { - this.type = 11 /* ViewScrollChanged */; - this.scrollWidth = source.scrollWidth; - this.scrollLeft = source.scrollLeft; - this.scrollHeight = source.scrollHeight; - this.scrollTop = source.scrollTop; - this.scrollWidthChanged = source.scrollWidthChanged; - this.scrollLeftChanged = source.scrollLeftChanged; - this.scrollHeightChanged = source.scrollHeightChanged; - this.scrollTopChanged = source.scrollTopChanged; - } -} -class ViewThemeChangedEvent { - constructor() { - this.type = 12 /* ViewThemeChanged */; - } -} -class ViewTokensChangedEvent { - constructor(ranges) { - this.type = 13 /* ViewTokensChanged */; - this.ranges = ranges; - } -} -class ViewTokensColorsChangedEvent { - constructor() { - this.type = 14 /* ViewTokensColorsChanged */; - // Nothing to do - } -} -class ViewZonesChangedEvent { - constructor() { - this.type = 15 /* ViewZonesChanged */; - // Nothing to do - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/lineDecorations.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/lineDecorations.js ***! - \***************************************************************************************/ -/*! exports provided: LineDecoration, DecorationSegment, LineDecorationsNormalizer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineDecoration", function() { return LineDecoration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DecorationSegment", function() { return DecorationSegment; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineDecorationsNormalizer", function() { return LineDecorationsNormalizer; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class LineDecoration { - constructor(startColumn, endColumn, className, type) { - this.startColumn = startColumn; - this.endColumn = endColumn; - this.className = className; - this.type = type; - } - static _equals(a, b) { - return (a.startColumn === b.startColumn - && a.endColumn === b.endColumn - && a.className === b.className - && a.type === b.type); - } - static equalsArr(a, b) { - const aLen = a.length; - const bLen = b.length; - if (aLen !== bLen) { - return false; - } - for (let i = 0; i < aLen; i++) { - if (!LineDecoration._equals(a[i], b[i])) { - return false; - } - } - return true; - } - static filter(lineDecorations, lineNumber, minLineColumn, maxLineColumn) { - if (lineDecorations.length === 0) { - return []; - } - let result = [], resultLen = 0; - for (let i = 0, len = lineDecorations.length; i < len; i++) { - const d = lineDecorations[i]; - const range = d.range; - if (range.endLineNumber < lineNumber || range.startLineNumber > lineNumber) { - // Ignore decorations that sit outside this line - continue; - } - if (range.isEmpty() && (d.type === 0 /* Regular */ || d.type === 3 /* RegularAffectingLetterSpacing */)) { - // Ignore empty range decorations - continue; - } - const startColumn = (range.startLineNumber === lineNumber ? range.startColumn : minLineColumn); - const endColumn = (range.endLineNumber === lineNumber ? range.endColumn : maxLineColumn); - result[resultLen++] = new LineDecoration(startColumn, endColumn, d.inlineClassName, d.type); - } - return result; - } - static _typeCompare(a, b) { - const ORDER = [2, 0, 1, 3]; - return ORDER[a] - ORDER[b]; - } - static compare(a, b) { - if (a.startColumn === b.startColumn) { - if (a.endColumn === b.endColumn) { - const typeCmp = LineDecoration._typeCompare(a.type, b.type); - if (typeCmp === 0) { - if (a.className < b.className) { - return -1; - } - if (a.className > b.className) { - return 1; - } - return 0; - } - return typeCmp; - } - return a.endColumn - b.endColumn; - } - return a.startColumn - b.startColumn; - } -} -class DecorationSegment { - constructor(startOffset, endOffset, className, metadata) { - this.startOffset = startOffset; - this.endOffset = endOffset; - this.className = className; - this.metadata = metadata; - } -} -class Stack { - constructor() { - this.stopOffsets = []; - this.classNames = []; - this.metadata = []; - this.count = 0; - } - static _metadata(metadata) { - let result = 0; - for (let i = 0, len = metadata.length; i < len; i++) { - result |= metadata[i]; - } - return result; - } - consumeLowerThan(maxStopOffset, nextStartOffset, result) { - while (this.count > 0 && this.stopOffsets[0] < maxStopOffset) { - let i = 0; - // Take all equal stopping offsets - while (i + 1 < this.count && this.stopOffsets[i] === this.stopOffsets[i + 1]) { - i++; - } - // Basically we are consuming the first i + 1 elements of the stack - result.push(new DecorationSegment(nextStartOffset, this.stopOffsets[i], this.classNames.join(' '), Stack._metadata(this.metadata))); - nextStartOffset = this.stopOffsets[i] + 1; - // Consume them - this.stopOffsets.splice(0, i + 1); - this.classNames.splice(0, i + 1); - this.metadata.splice(0, i + 1); - this.count -= (i + 1); - } - if (this.count > 0 && nextStartOffset < maxStopOffset) { - result.push(new DecorationSegment(nextStartOffset, maxStopOffset - 1, this.classNames.join(' '), Stack._metadata(this.metadata))); - nextStartOffset = maxStopOffset; - } - return nextStartOffset; - } - insert(stopOffset, className, metadata) { - if (this.count === 0 || this.stopOffsets[this.count - 1] <= stopOffset) { - // Insert at the end - this.stopOffsets.push(stopOffset); - this.classNames.push(className); - this.metadata.push(metadata); - } - else { - // Find the insertion position for `stopOffset` - for (let i = 0; i < this.count; i++) { - if (this.stopOffsets[i] >= stopOffset) { - this.stopOffsets.splice(i, 0, stopOffset); - this.classNames.splice(i, 0, className); - this.metadata.splice(i, 0, metadata); - break; - } - } - } - this.count++; - return; - } -} -class LineDecorationsNormalizer { - /** - * Normalize line decorations. Overlapping decorations will generate multiple segments - */ - static normalize(lineContent, lineDecorations) { - if (lineDecorations.length === 0) { - return []; - } - let result = []; - const stack = new Stack(); - let nextStartOffset = 0; - for (let i = 0, len = lineDecorations.length; i < len; i++) { - const d = lineDecorations[i]; - let startColumn = d.startColumn; - let endColumn = d.endColumn; - const className = d.className; - const metadata = (d.type === 1 /* Before */ - ? 2 /* PSEUDO_BEFORE */ - : d.type === 2 /* After */ - ? 4 /* PSEUDO_AFTER */ - : 0); - // If the position would end up in the middle of a high-low surrogate pair, we move it to before the pair - if (startColumn > 1) { - const charCodeBefore = lineContent.charCodeAt(startColumn - 2); - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isHighSurrogate"](charCodeBefore)) { - startColumn--; - } - } - if (endColumn > 1) { - const charCodeBefore = lineContent.charCodeAt(endColumn - 2); - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isHighSurrogate"](charCodeBefore)) { - endColumn--; - } - } - const currentStartOffset = startColumn - 1; - const currentEndOffset = endColumn - 2; - nextStartOffset = stack.consumeLowerThan(currentStartOffset, nextStartOffset, result); - if (stack.count === 0) { - nextStartOffset = currentStartOffset; - } - stack.insert(currentEndOffset, className, metadata); - } - stack.consumeLowerThan(1073741824 /* MAX_SAFE_SMALL_INTEGER */, nextStartOffset, result); - return result; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/linesLayout.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/linesLayout.js ***! - \***********************************************************************************/ -/*! exports provided: EditorWhitespace, LinesLayout */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorWhitespace", function() { return EditorWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinesLayout", function() { return LinesLayout; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class PendingChanges { - constructor() { - this._hasPending = false; - this._inserts = []; - this._changes = []; - this._removes = []; - } - insert(x) { - this._hasPending = true; - this._inserts.push(x); - } - change(x) { - this._hasPending = true; - this._changes.push(x); - } - remove(x) { - this._hasPending = true; - this._removes.push(x); - } - mustCommit() { - return this._hasPending; - } - commit(linesLayout) { - if (!this._hasPending) { - return; - } - const inserts = this._inserts; - const changes = this._changes; - const removes = this._removes; - this._hasPending = false; - this._inserts = []; - this._changes = []; - this._removes = []; - linesLayout._commitPendingChanges(inserts, changes, removes); - } -} -class EditorWhitespace { - constructor(id, afterLineNumber, ordinal, height, minWidth) { - this.id = id; - this.afterLineNumber = afterLineNumber; - this.ordinal = ordinal; - this.height = height; - this.minWidth = minWidth; - this.prefixSum = 0; - } -} -/** - * Layouting of objects that take vertical space (by having a height) and push down other objects. - * - * These objects are basically either text (lines) or spaces between those lines (whitespaces). - * This provides commodity operations for working with lines that contain whitespace that pushes lines lower (vertically). - */ -class LinesLayout { - constructor(lineCount, lineHeight, paddingTop, paddingBottom) { - this._instanceId = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["singleLetterHash"](++LinesLayout.INSTANCE_COUNT); - this._pendingChanges = new PendingChanges(); - this._lastWhitespaceId = 0; - this._arr = []; - this._prefixSumValidIndex = -1; - this._minWidth = -1; /* marker for not being computed */ - this._lineCount = lineCount; - this._lineHeight = lineHeight; - this._paddingTop = paddingTop; - this._paddingBottom = paddingBottom; - } - /** - * Find the insertion index for a new value inside a sorted array of values. - * If the value is already present in the sorted array, the insertion index will be after the already existing value. - */ - static findInsertionIndex(arr, afterLineNumber, ordinal) { - let low = 0; - let high = arr.length; - while (low < high) { - const mid = ((low + high) >>> 1); - if (afterLineNumber === arr[mid].afterLineNumber) { - if (ordinal < arr[mid].ordinal) { - high = mid; - } - else { - low = mid + 1; - } - } - else if (afterLineNumber < arr[mid].afterLineNumber) { - high = mid; - } - else { - low = mid + 1; - } - } - return low; - } - /** - * Change the height of a line in pixels. - */ - setLineHeight(lineHeight) { - this._checkPendingChanges(); - this._lineHeight = lineHeight; - } - /** - * Changes the padding used to calculate vertical offsets. - */ - setPadding(paddingTop, paddingBottom) { - this._paddingTop = paddingTop; - this._paddingBottom = paddingBottom; - } - /** - * Set the number of lines. - * - * @param lineCount New number of lines. - */ - onFlushed(lineCount) { - this._checkPendingChanges(); - this._lineCount = lineCount; - } - changeWhitespace(callback) { - let hadAChange = false; - try { - const accessor = { - insertWhitespace: (afterLineNumber, ordinal, heightInPx, minWidth) => { - hadAChange = true; - afterLineNumber = afterLineNumber | 0; - ordinal = ordinal | 0; - heightInPx = heightInPx | 0; - minWidth = minWidth | 0; - const id = this._instanceId + (++this._lastWhitespaceId); - this._pendingChanges.insert(new EditorWhitespace(id, afterLineNumber, ordinal, heightInPx, minWidth)); - return id; - }, - changeOneWhitespace: (id, newAfterLineNumber, newHeight) => { - hadAChange = true; - newAfterLineNumber = newAfterLineNumber | 0; - newHeight = newHeight | 0; - this._pendingChanges.change({ id, newAfterLineNumber, newHeight }); - }, - removeWhitespace: (id) => { - hadAChange = true; - this._pendingChanges.remove({ id }); - } - }; - callback(accessor); - } - finally { - this._pendingChanges.commit(this); - } - return hadAChange; - } - _commitPendingChanges(inserts, changes, removes) { - if (inserts.length > 0 || removes.length > 0) { - this._minWidth = -1; /* marker for not being computed */ - } - if (inserts.length + changes.length + removes.length <= 1) { - // when only one thing happened, handle it "delicately" - for (const insert of inserts) { - this._insertWhitespace(insert); - } - for (const change of changes) { - this._changeOneWhitespace(change.id, change.newAfterLineNumber, change.newHeight); - } - for (const remove of removes) { - const index = this._findWhitespaceIndex(remove.id); - if (index === -1) { - continue; - } - this._removeWhitespace(index); - } - return; - } - // simply rebuild the entire datastructure - const toRemove = new Set(); - for (const remove of removes) { - toRemove.add(remove.id); - } - const toChange = new Map(); - for (const change of changes) { - toChange.set(change.id, change); - } - const applyRemoveAndChange = (whitespaces) => { - let result = []; - for (const whitespace of whitespaces) { - if (toRemove.has(whitespace.id)) { - continue; - } - if (toChange.has(whitespace.id)) { - const change = toChange.get(whitespace.id); - whitespace.afterLineNumber = change.newAfterLineNumber; - whitespace.height = change.newHeight; - } - result.push(whitespace); - } - return result; - }; - const result = applyRemoveAndChange(this._arr).concat(applyRemoveAndChange(inserts)); - result.sort((a, b) => { - if (a.afterLineNumber === b.afterLineNumber) { - return a.ordinal - b.ordinal; - } - return a.afterLineNumber - b.afterLineNumber; - }); - this._arr = result; - this._prefixSumValidIndex = -1; - } - _checkPendingChanges() { - if (this._pendingChanges.mustCommit()) { - this._pendingChanges.commit(this); - } - } - _insertWhitespace(whitespace) { - const insertIndex = LinesLayout.findInsertionIndex(this._arr, whitespace.afterLineNumber, whitespace.ordinal); - this._arr.splice(insertIndex, 0, whitespace); - this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, insertIndex - 1); - } - _findWhitespaceIndex(id) { - const arr = this._arr; - for (let i = 0, len = arr.length; i < len; i++) { - if (arr[i].id === id) { - return i; - } - } - return -1; - } - _changeOneWhitespace(id, newAfterLineNumber, newHeight) { - const index = this._findWhitespaceIndex(id); - if (index === -1) { - return; - } - if (this._arr[index].height !== newHeight) { - this._arr[index].height = newHeight; - this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, index - 1); - } - if (this._arr[index].afterLineNumber !== newAfterLineNumber) { - // `afterLineNumber` changed for this whitespace - // Record old whitespace - const whitespace = this._arr[index]; - // Since changing `afterLineNumber` can trigger a reordering, we're gonna remove this whitespace - this._removeWhitespace(index); - whitespace.afterLineNumber = newAfterLineNumber; - // And add it again - this._insertWhitespace(whitespace); - } - } - _removeWhitespace(removeIndex) { - this._arr.splice(removeIndex, 1); - this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, removeIndex - 1); - } - /** - * Notify the layouter that lines have been deleted (a continuous zone of lines). - * - * @param fromLineNumber The line number at which the deletion started, inclusive - * @param toLineNumber The line number at which the deletion ended, inclusive - */ - onLinesDeleted(fromLineNumber, toLineNumber) { - this._checkPendingChanges(); - fromLineNumber = fromLineNumber | 0; - toLineNumber = toLineNumber | 0; - this._lineCount -= (toLineNumber - fromLineNumber + 1); - for (let i = 0, len = this._arr.length; i < len; i++) { - const afterLineNumber = this._arr[i].afterLineNumber; - if (fromLineNumber <= afterLineNumber && afterLineNumber <= toLineNumber) { - // The line this whitespace was after has been deleted - // => move whitespace to before first deleted line - this._arr[i].afterLineNumber = fromLineNumber - 1; - } - else if (afterLineNumber > toLineNumber) { - // The line this whitespace was after has been moved up - // => move whitespace up - this._arr[i].afterLineNumber -= (toLineNumber - fromLineNumber + 1); - } - } - } - /** - * Notify the layouter that lines have been inserted (a continuous zone of lines). - * - * @param fromLineNumber The line number at which the insertion started, inclusive - * @param toLineNumber The line number at which the insertion ended, inclusive. - */ - onLinesInserted(fromLineNumber, toLineNumber) { - this._checkPendingChanges(); - fromLineNumber = fromLineNumber | 0; - toLineNumber = toLineNumber | 0; - this._lineCount += (toLineNumber - fromLineNumber + 1); - for (let i = 0, len = this._arr.length; i < len; i++) { - const afterLineNumber = this._arr[i].afterLineNumber; - if (fromLineNumber <= afterLineNumber) { - this._arr[i].afterLineNumber += (toLineNumber - fromLineNumber + 1); - } - } - } - /** - * Get the sum of all the whitespaces. - */ - getWhitespacesTotalHeight() { - this._checkPendingChanges(); - if (this._arr.length === 0) { - return 0; - } - return this.getWhitespacesAccumulatedHeight(this._arr.length - 1); - } - /** - * Return the sum of the heights of the whitespaces at [0..index]. - * This includes the whitespace at `index`. - * - * @param index The index of the whitespace. - * @return The sum of the heights of all whitespaces before the one at `index`, including the one at `index`. - */ - getWhitespacesAccumulatedHeight(index) { - this._checkPendingChanges(); - index = index | 0; - let startIndex = Math.max(0, this._prefixSumValidIndex + 1); - if (startIndex === 0) { - this._arr[0].prefixSum = this._arr[0].height; - startIndex++; - } - for (let i = startIndex; i <= index; i++) { - this._arr[i].prefixSum = this._arr[i - 1].prefixSum + this._arr[i].height; - } - this._prefixSumValidIndex = Math.max(this._prefixSumValidIndex, index); - return this._arr[index].prefixSum; - } - /** - * Get the sum of heights for all objects. - * - * @return The sum of heights for all objects. - */ - getLinesTotalHeight() { - this._checkPendingChanges(); - const linesHeight = this._lineHeight * this._lineCount; - const whitespacesHeight = this.getWhitespacesTotalHeight(); - return linesHeight + whitespacesHeight + this._paddingTop + this._paddingBottom; - } - /** - * Returns the accumulated height of whitespaces before the given line number. - * - * @param lineNumber The line number - */ - getWhitespaceAccumulatedHeightBeforeLineNumber(lineNumber) { - this._checkPendingChanges(); - lineNumber = lineNumber | 0; - const lastWhitespaceBeforeLineNumber = this._findLastWhitespaceBeforeLineNumber(lineNumber); - if (lastWhitespaceBeforeLineNumber === -1) { - return 0; - } - return this.getWhitespacesAccumulatedHeight(lastWhitespaceBeforeLineNumber); - } - _findLastWhitespaceBeforeLineNumber(lineNumber) { - lineNumber = lineNumber | 0; - // Find the whitespace before line number - const arr = this._arr; - let low = 0; - let high = arr.length - 1; - while (low <= high) { - const delta = (high - low) | 0; - const halfDelta = (delta / 2) | 0; - const mid = (low + halfDelta) | 0; - if (arr[mid].afterLineNumber < lineNumber) { - if (mid + 1 >= arr.length || arr[mid + 1].afterLineNumber >= lineNumber) { - return mid; - } - else { - low = (mid + 1) | 0; - } - } - else { - high = (mid - 1) | 0; - } - } - return -1; - } - _findFirstWhitespaceAfterLineNumber(lineNumber) { - lineNumber = lineNumber | 0; - const lastWhitespaceBeforeLineNumber = this._findLastWhitespaceBeforeLineNumber(lineNumber); - const firstWhitespaceAfterLineNumber = lastWhitespaceBeforeLineNumber + 1; - if (firstWhitespaceAfterLineNumber < this._arr.length) { - return firstWhitespaceAfterLineNumber; - } - return -1; - } - /** - * Find the index of the first whitespace which has `afterLineNumber` >= `lineNumber`. - * @return The index of the first whitespace with `afterLineNumber` >= `lineNumber` or -1 if no whitespace is found. - */ - getFirstWhitespaceIndexAfterLineNumber(lineNumber) { - this._checkPendingChanges(); - lineNumber = lineNumber | 0; - return this._findFirstWhitespaceAfterLineNumber(lineNumber); - } - /** - * Get the vertical offset (the sum of heights for all objects above) a certain line number. - * - * @param lineNumber The line number - * @return The sum of heights for all objects above `lineNumber`. - */ - getVerticalOffsetForLineNumber(lineNumber) { - this._checkPendingChanges(); - lineNumber = lineNumber | 0; - let previousLinesHeight; - if (lineNumber > 1) { - previousLinesHeight = this._lineHeight * (lineNumber - 1); - } - else { - previousLinesHeight = 0; - } - const previousWhitespacesHeight = this.getWhitespaceAccumulatedHeightBeforeLineNumber(lineNumber); - return previousLinesHeight + previousWhitespacesHeight + this._paddingTop; - } - /** - * The maximum min width for all whitespaces. - */ - getWhitespaceMinWidth() { - this._checkPendingChanges(); - if (this._minWidth === -1) { - let minWidth = 0; - for (let i = 0, len = this._arr.length; i < len; i++) { - minWidth = Math.max(minWidth, this._arr[i].minWidth); - } - this._minWidth = minWidth; - } - return this._minWidth; - } - /** - * Check if `verticalOffset` is below all lines. - */ - isAfterLines(verticalOffset) { - this._checkPendingChanges(); - const totalHeight = this.getLinesTotalHeight(); - return verticalOffset > totalHeight; - } - /** - * Find the first line number that is at or after vertical offset `verticalOffset`. - * i.e. if getVerticalOffsetForLine(line) is x and getVerticalOffsetForLine(line + 1) is y, then - * getLineNumberAtOrAfterVerticalOffset(i) = line, x <= i < y. - * - * @param verticalOffset The vertical offset to search at. - * @return The line number at or after vertical offset `verticalOffset`. - */ - getLineNumberAtOrAfterVerticalOffset(verticalOffset) { - this._checkPendingChanges(); - verticalOffset = verticalOffset | 0; - if (verticalOffset < 0) { - return 1; - } - const linesCount = this._lineCount | 0; - const lineHeight = this._lineHeight; - let minLineNumber = 1; - let maxLineNumber = linesCount; - while (minLineNumber < maxLineNumber) { - const midLineNumber = ((minLineNumber + maxLineNumber) / 2) | 0; - const midLineNumberVerticalOffset = this.getVerticalOffsetForLineNumber(midLineNumber) | 0; - if (verticalOffset >= midLineNumberVerticalOffset + lineHeight) { - // vertical offset is after mid line number - minLineNumber = midLineNumber + 1; - } - else if (verticalOffset >= midLineNumberVerticalOffset) { - // Hit - return midLineNumber; - } - else { - // vertical offset is before mid line number, but mid line number could still be what we're searching for - maxLineNumber = midLineNumber; - } - } - if (minLineNumber > linesCount) { - return linesCount; - } - return minLineNumber; - } - /** - * Get all the lines and their relative vertical offsets that are positioned between `verticalOffset1` and `verticalOffset2`. - * - * @param verticalOffset1 The beginning of the viewport. - * @param verticalOffset2 The end of the viewport. - * @return A structure describing the lines positioned between `verticalOffset1` and `verticalOffset2`. - */ - getLinesViewportData(verticalOffset1, verticalOffset2) { - this._checkPendingChanges(); - verticalOffset1 = verticalOffset1 | 0; - verticalOffset2 = verticalOffset2 | 0; - const lineHeight = this._lineHeight; - // Find first line number - // We don't live in a perfect world, so the line number might start before or after verticalOffset1 - const startLineNumber = this.getLineNumberAtOrAfterVerticalOffset(verticalOffset1) | 0; - const startLineNumberVerticalOffset = this.getVerticalOffsetForLineNumber(startLineNumber) | 0; - let endLineNumber = this._lineCount | 0; - // Also keep track of what whitespace we've got - let whitespaceIndex = this.getFirstWhitespaceIndexAfterLineNumber(startLineNumber) | 0; - const whitespaceCount = this.getWhitespacesCount() | 0; - let currentWhitespaceHeight; - let currentWhitespaceAfterLineNumber; - if (whitespaceIndex === -1) { - whitespaceIndex = whitespaceCount; - currentWhitespaceAfterLineNumber = endLineNumber + 1; - currentWhitespaceHeight = 0; - } - else { - currentWhitespaceAfterLineNumber = this.getAfterLineNumberForWhitespaceIndex(whitespaceIndex) | 0; - currentWhitespaceHeight = this.getHeightForWhitespaceIndex(whitespaceIndex) | 0; - } - let currentVerticalOffset = startLineNumberVerticalOffset; - let currentLineRelativeOffset = currentVerticalOffset; - // IE (all versions) cannot handle units above about 1,533,908 px, so every 500k pixels bring numbers down - const STEP_SIZE = 500000; - let bigNumbersDelta = 0; - if (startLineNumberVerticalOffset >= STEP_SIZE) { - // Compute a delta that guarantees that lines are positioned at `lineHeight` increments - bigNumbersDelta = Math.floor(startLineNumberVerticalOffset / STEP_SIZE) * STEP_SIZE; - bigNumbersDelta = Math.floor(bigNumbersDelta / lineHeight) * lineHeight; - currentLineRelativeOffset -= bigNumbersDelta; - } - const linesOffsets = []; - const verticalCenter = verticalOffset1 + (verticalOffset2 - verticalOffset1) / 2; - let centeredLineNumber = -1; - // Figure out how far the lines go - for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { - if (centeredLineNumber === -1) { - const currentLineTop = currentVerticalOffset; - const currentLineBottom = currentVerticalOffset + lineHeight; - if ((currentLineTop <= verticalCenter && verticalCenter < currentLineBottom) || currentLineTop > verticalCenter) { - centeredLineNumber = lineNumber; - } - } - // Count current line height in the vertical offsets - currentVerticalOffset += lineHeight; - linesOffsets[lineNumber - startLineNumber] = currentLineRelativeOffset; - // Next line starts immediately after this one - currentLineRelativeOffset += lineHeight; - while (currentWhitespaceAfterLineNumber === lineNumber) { - // Push down next line with the height of the current whitespace - currentLineRelativeOffset += currentWhitespaceHeight; - // Count current whitespace in the vertical offsets - currentVerticalOffset += currentWhitespaceHeight; - whitespaceIndex++; - if (whitespaceIndex >= whitespaceCount) { - currentWhitespaceAfterLineNumber = endLineNumber + 1; - } - else { - currentWhitespaceAfterLineNumber = this.getAfterLineNumberForWhitespaceIndex(whitespaceIndex) | 0; - currentWhitespaceHeight = this.getHeightForWhitespaceIndex(whitespaceIndex) | 0; - } - } - if (currentVerticalOffset >= verticalOffset2) { - // We have covered the entire viewport area, time to stop - endLineNumber = lineNumber; - break; - } - } - if (centeredLineNumber === -1) { - centeredLineNumber = endLineNumber; - } - const endLineNumberVerticalOffset = this.getVerticalOffsetForLineNumber(endLineNumber) | 0; - let completelyVisibleStartLineNumber = startLineNumber; - let completelyVisibleEndLineNumber = endLineNumber; - if (completelyVisibleStartLineNumber < completelyVisibleEndLineNumber) { - if (startLineNumberVerticalOffset < verticalOffset1) { - completelyVisibleStartLineNumber++; - } - } - if (completelyVisibleStartLineNumber < completelyVisibleEndLineNumber) { - if (endLineNumberVerticalOffset + lineHeight > verticalOffset2) { - completelyVisibleEndLineNumber--; - } - } - return { - bigNumbersDelta: bigNumbersDelta, - startLineNumber: startLineNumber, - endLineNumber: endLineNumber, - relativeVerticalOffset: linesOffsets, - centeredLineNumber: centeredLineNumber, - completelyVisibleStartLineNumber: completelyVisibleStartLineNumber, - completelyVisibleEndLineNumber: completelyVisibleEndLineNumber - }; - } - getVerticalOffsetForWhitespaceIndex(whitespaceIndex) { - this._checkPendingChanges(); - whitespaceIndex = whitespaceIndex | 0; - const afterLineNumber = this.getAfterLineNumberForWhitespaceIndex(whitespaceIndex); - let previousLinesHeight; - if (afterLineNumber >= 1) { - previousLinesHeight = this._lineHeight * afterLineNumber; - } - else { - previousLinesHeight = 0; - } - let previousWhitespacesHeight; - if (whitespaceIndex > 0) { - previousWhitespacesHeight = this.getWhitespacesAccumulatedHeight(whitespaceIndex - 1); - } - else { - previousWhitespacesHeight = 0; - } - return previousLinesHeight + previousWhitespacesHeight + this._paddingTop; - } - getWhitespaceIndexAtOrAfterVerticallOffset(verticalOffset) { - this._checkPendingChanges(); - verticalOffset = verticalOffset | 0; - let minWhitespaceIndex = 0; - let maxWhitespaceIndex = this.getWhitespacesCount() - 1; - if (maxWhitespaceIndex < 0) { - return -1; - } - // Special case: nothing to be found - const maxWhitespaceVerticalOffset = this.getVerticalOffsetForWhitespaceIndex(maxWhitespaceIndex); - const maxWhitespaceHeight = this.getHeightForWhitespaceIndex(maxWhitespaceIndex); - if (verticalOffset >= maxWhitespaceVerticalOffset + maxWhitespaceHeight) { - return -1; - } - while (minWhitespaceIndex < maxWhitespaceIndex) { - const midWhitespaceIndex = Math.floor((minWhitespaceIndex + maxWhitespaceIndex) / 2); - const midWhitespaceVerticalOffset = this.getVerticalOffsetForWhitespaceIndex(midWhitespaceIndex); - const midWhitespaceHeight = this.getHeightForWhitespaceIndex(midWhitespaceIndex); - if (verticalOffset >= midWhitespaceVerticalOffset + midWhitespaceHeight) { - // vertical offset is after whitespace - minWhitespaceIndex = midWhitespaceIndex + 1; - } - else if (verticalOffset >= midWhitespaceVerticalOffset) { - // Hit - return midWhitespaceIndex; - } - else { - // vertical offset is before whitespace, but midWhitespaceIndex might still be what we're searching for - maxWhitespaceIndex = midWhitespaceIndex; - } - } - return minWhitespaceIndex; - } - /** - * Get exactly the whitespace that is layouted at `verticalOffset`. - * - * @param verticalOffset The vertical offset. - * @return Precisely the whitespace that is layouted at `verticaloffset` or null. - */ - getWhitespaceAtVerticalOffset(verticalOffset) { - this._checkPendingChanges(); - verticalOffset = verticalOffset | 0; - const candidateIndex = this.getWhitespaceIndexAtOrAfterVerticallOffset(verticalOffset); - if (candidateIndex < 0) { - return null; - } - if (candidateIndex >= this.getWhitespacesCount()) { - return null; - } - const candidateTop = this.getVerticalOffsetForWhitespaceIndex(candidateIndex); - if (candidateTop > verticalOffset) { - return null; - } - const candidateHeight = this.getHeightForWhitespaceIndex(candidateIndex); - const candidateId = this.getIdForWhitespaceIndex(candidateIndex); - const candidateAfterLineNumber = this.getAfterLineNumberForWhitespaceIndex(candidateIndex); - return { - id: candidateId, - afterLineNumber: candidateAfterLineNumber, - verticalOffset: candidateTop, - height: candidateHeight - }; - } - /** - * Get a list of whitespaces that are positioned between `verticalOffset1` and `verticalOffset2`. - * - * @param verticalOffset1 The beginning of the viewport. - * @param verticalOffset2 The end of the viewport. - * @return An array with all the whitespaces in the viewport. If no whitespace is in viewport, the array is empty. - */ - getWhitespaceViewportData(verticalOffset1, verticalOffset2) { - this._checkPendingChanges(); - verticalOffset1 = verticalOffset1 | 0; - verticalOffset2 = verticalOffset2 | 0; - const startIndex = this.getWhitespaceIndexAtOrAfterVerticallOffset(verticalOffset1); - const endIndex = this.getWhitespacesCount() - 1; - if (startIndex < 0) { - return []; - } - let result = []; - for (let i = startIndex; i <= endIndex; i++) { - const top = this.getVerticalOffsetForWhitespaceIndex(i); - const height = this.getHeightForWhitespaceIndex(i); - if (top >= verticalOffset2) { - break; - } - result.push({ - id: this.getIdForWhitespaceIndex(i), - afterLineNumber: this.getAfterLineNumberForWhitespaceIndex(i), - verticalOffset: top, - height: height - }); - } - return result; - } - /** - * Get all whitespaces. - */ - getWhitespaces() { - this._checkPendingChanges(); - return this._arr.slice(0); - } - /** - * The number of whitespaces. - */ - getWhitespacesCount() { - this._checkPendingChanges(); - return this._arr.length; - } - /** - * Get the `id` for whitespace at index `index`. - * - * @param index The index of the whitespace. - * @return `id` of whitespace at `index`. - */ - getIdForWhitespaceIndex(index) { - this._checkPendingChanges(); - index = index | 0; - return this._arr[index].id; - } - /** - * Get the `afterLineNumber` for whitespace at index `index`. - * - * @param index The index of the whitespace. - * @return `afterLineNumber` of whitespace at `index`. - */ - getAfterLineNumberForWhitespaceIndex(index) { - this._checkPendingChanges(); - index = index | 0; - return this._arr[index].afterLineNumber; - } - /** - * Get the `height` for whitespace at index `index`. - * - * @param index The index of the whitespace. - * @return `height` of whitespace at `index`. - */ - getHeightForWhitespaceIndex(index) { - this._checkPendingChanges(); - index = index | 0; - return this._arr[index].height; - } -} -LinesLayout.INSTANCE_COUNT = 0; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLayout.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLayout.js ***! - \**********************************************************************************/ -/*! exports provided: ViewLayout */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewLayout", function() { return ViewLayout; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_scrollable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/scrollable.js */ "./node_modules/monaco-editor/esm/vs/base/common/scrollable.js"); -/* harmony import */ var _linesLayout_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linesLayout.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/linesLayout.js"); -/* harmony import */ var _viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../viewModel/viewModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModel.js"); -/* harmony import */ var _viewModel_viewModelEventDispatcher_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../viewModel/viewModelEventDispatcher.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelEventDispatcher.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -const SMOOTH_SCROLLING_TIME = 125; -class EditorScrollDimensions { - constructor(width, contentWidth, height, contentHeight) { - width = width | 0; - contentWidth = contentWidth | 0; - height = height | 0; - contentHeight = contentHeight | 0; - if (width < 0) { - width = 0; - } - if (contentWidth < 0) { - contentWidth = 0; - } - if (height < 0) { - height = 0; - } - if (contentHeight < 0) { - contentHeight = 0; - } - this.width = width; - this.contentWidth = contentWidth; - this.scrollWidth = Math.max(width, contentWidth); - this.height = height; - this.contentHeight = contentHeight; - this.scrollHeight = Math.max(height, contentHeight); - } - equals(other) { - return (this.width === other.width - && this.contentWidth === other.contentWidth - && this.height === other.height - && this.contentHeight === other.contentHeight); - } -} -class EditorScrollable extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(smoothScrollDuration, scheduleAtNextAnimationFrame) { - super(); - this._onDidContentSizeChange = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this.onDidContentSizeChange = this._onDidContentSizeChange.event; - this._dimensions = new EditorScrollDimensions(0, 0, 0, 0); - this._scrollable = this._register(new _base_common_scrollable_js__WEBPACK_IMPORTED_MODULE_2__["Scrollable"](smoothScrollDuration, scheduleAtNextAnimationFrame)); - this.onDidScroll = this._scrollable.onScroll; - } - getScrollable() { - return this._scrollable; - } - setSmoothScrollDuration(smoothScrollDuration) { - this._scrollable.setSmoothScrollDuration(smoothScrollDuration); - } - validateScrollPosition(scrollPosition) { - return this._scrollable.validateScrollPosition(scrollPosition); - } - getScrollDimensions() { - return this._dimensions; - } - setScrollDimensions(dimensions) { - if (this._dimensions.equals(dimensions)) { - return; - } - const oldDimensions = this._dimensions; - this._dimensions = dimensions; - this._scrollable.setScrollDimensions({ - width: dimensions.width, - scrollWidth: dimensions.scrollWidth, - height: dimensions.height, - scrollHeight: dimensions.scrollHeight - }, true); - const contentWidthChanged = (oldDimensions.contentWidth !== dimensions.contentWidth); - const contentHeightChanged = (oldDimensions.contentHeight !== dimensions.contentHeight); - if (contentWidthChanged || contentHeightChanged) { - this._onDidContentSizeChange.fire(new _viewModel_viewModelEventDispatcher_js__WEBPACK_IMPORTED_MODULE_5__["ContentSizeChangedEvent"](oldDimensions.contentWidth, oldDimensions.contentHeight, dimensions.contentWidth, dimensions.contentHeight)); - } - } - getFutureScrollPosition() { - return this._scrollable.getFutureScrollPosition(); - } - getCurrentScrollPosition() { - return this._scrollable.getCurrentScrollPosition(); - } - setScrollPositionNow(update) { - this._scrollable.setScrollPositionNow(update); - } - setScrollPositionSmooth(update) { - this._scrollable.setScrollPositionSmooth(update); - } -} -class ViewLayout extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(configuration, lineCount, scheduleAtNextAnimationFrame) { - super(); - this._configuration = configuration; - const options = this._configuration.options; - const layoutInfo = options.get(117 /* layoutInfo */); - const padding = options.get(66 /* padding */); - this._linesLayout = new _linesLayout_js__WEBPACK_IMPORTED_MODULE_3__["LinesLayout"](lineCount, options.get(51 /* lineHeight */), padding.top, padding.bottom); - this._scrollable = this._register(new EditorScrollable(0, scheduleAtNextAnimationFrame)); - this._configureSmoothScrollDuration(); - this._scrollable.setScrollDimensions(new EditorScrollDimensions(layoutInfo.contentWidth, 0, layoutInfo.height, 0)); - this.onDidScroll = this._scrollable.onDidScroll; - this.onDidContentSizeChange = this._scrollable.onDidContentSizeChange; - this._updateHeight(); - } - dispose() { - super.dispose(); - } - getScrollable() { - return this._scrollable.getScrollable(); - } - onHeightMaybeChanged() { - this._updateHeight(); - } - _configureSmoothScrollDuration() { - this._scrollable.setSmoothScrollDuration(this._configuration.options.get(94 /* smoothScrolling */) ? SMOOTH_SCROLLING_TIME : 0); - } - // ---- begin view event handlers - onConfigurationChanged(e) { - const options = this._configuration.options; - if (e.hasChanged(51 /* lineHeight */)) { - this._linesLayout.setLineHeight(options.get(51 /* lineHeight */)); - } - if (e.hasChanged(66 /* padding */)) { - const padding = options.get(66 /* padding */); - this._linesLayout.setPadding(padding.top, padding.bottom); - } - if (e.hasChanged(117 /* layoutInfo */)) { - const layoutInfo = options.get(117 /* layoutInfo */); - const width = layoutInfo.contentWidth; - const height = layoutInfo.height; - const scrollDimensions = this._scrollable.getScrollDimensions(); - const contentWidth = scrollDimensions.contentWidth; - this._scrollable.setScrollDimensions(new EditorScrollDimensions(width, scrollDimensions.contentWidth, height, this._getContentHeight(width, height, contentWidth))); - } - else { - this._updateHeight(); - } - if (e.hasChanged(94 /* smoothScrolling */)) { - this._configureSmoothScrollDuration(); - } - } - onFlushed(lineCount) { - this._linesLayout.onFlushed(lineCount); - } - onLinesDeleted(fromLineNumber, toLineNumber) { - this._linesLayout.onLinesDeleted(fromLineNumber, toLineNumber); - } - onLinesInserted(fromLineNumber, toLineNumber) { - this._linesLayout.onLinesInserted(fromLineNumber, toLineNumber); - } - // ---- end view event handlers - _getHorizontalScrollbarHeight(width, scrollWidth) { - const options = this._configuration.options; - const scrollbar = options.get(84 /* scrollbar */); - if (scrollbar.horizontal === 2 /* Hidden */) { - // horizontal scrollbar not visible - return 0; - } - if (width >= scrollWidth) { - // horizontal scrollbar not visible - return 0; - } - return scrollbar.horizontalScrollbarSize; - } - _getContentHeight(width, height, contentWidth) { - const options = this._configuration.options; - let result = this._linesLayout.getLinesTotalHeight(); - if (options.get(86 /* scrollBeyondLastLine */)) { - result += height - options.get(51 /* lineHeight */); - } - else { - result += this._getHorizontalScrollbarHeight(width, contentWidth); - } - return result; - } - _updateHeight() { - const scrollDimensions = this._scrollable.getScrollDimensions(); - const width = scrollDimensions.width; - const height = scrollDimensions.height; - const contentWidth = scrollDimensions.contentWidth; - this._scrollable.setScrollDimensions(new EditorScrollDimensions(width, scrollDimensions.contentWidth, height, this._getContentHeight(width, height, contentWidth))); - } - // ---- Layouting logic - getCurrentViewport() { - const scrollDimensions = this._scrollable.getScrollDimensions(); - const currentScrollPosition = this._scrollable.getCurrentScrollPosition(); - return new _viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_4__["Viewport"](currentScrollPosition.scrollTop, currentScrollPosition.scrollLeft, scrollDimensions.width, scrollDimensions.height); - } - getFutureViewport() { - const scrollDimensions = this._scrollable.getScrollDimensions(); - const currentScrollPosition = this._scrollable.getFutureScrollPosition(); - return new _viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_4__["Viewport"](currentScrollPosition.scrollTop, currentScrollPosition.scrollLeft, scrollDimensions.width, scrollDimensions.height); - } - _computeContentWidth(maxLineWidth) { - const options = this._configuration.options; - const wrappingInfo = options.get(118 /* wrappingInfo */); - const fontInfo = options.get(36 /* fontInfo */); - if (wrappingInfo.isViewportWrapping) { - const layoutInfo = options.get(117 /* layoutInfo */); - const minimap = options.get(56 /* minimap */); - if (maxLineWidth > layoutInfo.contentWidth + fontInfo.typicalHalfwidthCharacterWidth) { - // This is a case where viewport wrapping is on, but the line extends above the viewport - if (minimap.enabled && minimap.side === 'right') { - // We need to accomodate the scrollbar width - return maxLineWidth + layoutInfo.verticalScrollbarWidth; - } - } - return maxLineWidth; - } - else { - const extraHorizontalSpace = options.get(85 /* scrollBeyondLastColumn */) * fontInfo.typicalHalfwidthCharacterWidth; - const whitespaceMinWidth = this._linesLayout.getWhitespaceMinWidth(); - return Math.max(maxLineWidth + extraHorizontalSpace, whitespaceMinWidth); - } - } - setMaxLineWidth(maxLineWidth) { - const scrollDimensions = this._scrollable.getScrollDimensions(); - // const newScrollWidth = ; - this._scrollable.setScrollDimensions(new EditorScrollDimensions(scrollDimensions.width, this._computeContentWidth(maxLineWidth), scrollDimensions.height, scrollDimensions.contentHeight)); - // The height might depend on the fact that there is a horizontal scrollbar or not - this._updateHeight(); - } - // ---- view state - saveState() { - const currentScrollPosition = this._scrollable.getFutureScrollPosition(); - let scrollTop = currentScrollPosition.scrollTop; - let firstLineNumberInViewport = this._linesLayout.getLineNumberAtOrAfterVerticalOffset(scrollTop); - let whitespaceAboveFirstLine = this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(firstLineNumberInViewport); - return { - scrollTop: scrollTop, - scrollTopWithoutViewZones: scrollTop - whitespaceAboveFirstLine, - scrollLeft: currentScrollPosition.scrollLeft - }; - } - // ---- IVerticalLayoutProvider - changeWhitespace(callback) { - const hadAChange = this._linesLayout.changeWhitespace(callback); - if (hadAChange) { - this.onHeightMaybeChanged(); - } - return hadAChange; - } - getVerticalOffsetForLineNumber(lineNumber) { - return this._linesLayout.getVerticalOffsetForLineNumber(lineNumber); - } - isAfterLines(verticalOffset) { - return this._linesLayout.isAfterLines(verticalOffset); - } - getLineNumberAtVerticalOffset(verticalOffset) { - return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(verticalOffset); - } - getWhitespaceAtVerticalOffset(verticalOffset) { - return this._linesLayout.getWhitespaceAtVerticalOffset(verticalOffset); - } - getLinesViewportData() { - const visibleBox = this.getCurrentViewport(); - return this._linesLayout.getLinesViewportData(visibleBox.top, visibleBox.top + visibleBox.height); - } - getLinesViewportDataAtScrollTop(scrollTop) { - // do some minimal validations on scrollTop - const scrollDimensions = this._scrollable.getScrollDimensions(); - if (scrollTop + scrollDimensions.height > scrollDimensions.scrollHeight) { - scrollTop = scrollDimensions.scrollHeight - scrollDimensions.height; - } - if (scrollTop < 0) { - scrollTop = 0; - } - return this._linesLayout.getLinesViewportData(scrollTop, scrollTop + scrollDimensions.height); - } - getWhitespaceViewportData() { - const visibleBox = this.getCurrentViewport(); - return this._linesLayout.getWhitespaceViewportData(visibleBox.top, visibleBox.top + visibleBox.height); - } - getWhitespaces() { - return this._linesLayout.getWhitespaces(); - } - // ---- IScrollingProvider - getContentWidth() { - const scrollDimensions = this._scrollable.getScrollDimensions(); - return scrollDimensions.contentWidth; - } - getScrollWidth() { - const scrollDimensions = this._scrollable.getScrollDimensions(); - return scrollDimensions.scrollWidth; - } - getContentHeight() { - const scrollDimensions = this._scrollable.getScrollDimensions(); - return scrollDimensions.contentHeight; - } - getScrollHeight() { - const scrollDimensions = this._scrollable.getScrollDimensions(); - return scrollDimensions.scrollHeight; - } - getCurrentScrollLeft() { - const currentScrollPosition = this._scrollable.getCurrentScrollPosition(); - return currentScrollPosition.scrollLeft; - } - getCurrentScrollTop() { - const currentScrollPosition = this._scrollable.getCurrentScrollPosition(); - return currentScrollPosition.scrollTop; - } - validateScrollPosition(scrollPosition) { - return this._scrollable.validateScrollPosition(scrollPosition); - } - setScrollPosition(position, type) { - if (type === 1 /* Immediate */) { - this._scrollable.setScrollPositionNow(position); - } - else { - this._scrollable.setScrollPositionSmooth(position); - } - } - deltaScrollNow(deltaScrollLeft, deltaScrollTop) { - const currentScrollPosition = this._scrollable.getCurrentScrollPosition(); - this._scrollable.setScrollPositionNow({ - scrollLeft: currentScrollPosition.scrollLeft + deltaScrollLeft, - scrollTop: currentScrollPosition.scrollTop + deltaScrollTop - }); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLineRenderer.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLineRenderer.js ***! - \****************************************************************************************/ -/*! exports provided: LineRange, RenderLineInput, CharacterMapping, RenderLineOutput, renderViewLine, RenderLineOutput2, renderViewLine2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineRange", function() { return LineRange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderLineInput", function() { return RenderLineInput; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterMapping", function() { return CharacterMapping; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderLineOutput", function() { return RenderLineOutput; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderViewLine", function() { return renderViewLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderLineOutput2", function() { return RenderLineOutput2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderViewLine2", function() { return renderViewLine2; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/stringBuilder.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/stringBuilder.js"); -/* harmony import */ var _lineDecorations_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lineDecorations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/lineDecorations.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class LinePart { - constructor(endIndex, type, metadata) { - this.endIndex = endIndex; - this.type = type; - this.metadata = metadata; - } - isWhitespace() { - return (this.metadata & 1 /* IS_WHITESPACE_MASK */ ? true : false); - } -} -class LineRange { - constructor(startIndex, endIndex) { - this.startOffset = startIndex; - this.endOffset = endIndex; - } - equals(otherLineRange) { - return this.startOffset === otherLineRange.startOffset - && this.endOffset === otherLineRange.endOffset; - } -} -class RenderLineInput { - constructor(useMonospaceOptimizations, canUseHalfwidthRightwardsArrow, lineContent, continuesWithWrappedLine, isBasicASCII, containsRTL, fauxIndentLength, lineTokens, lineDecorations, tabSize, startVisibleColumn, spaceWidth, middotWidth, wsmiddotWidth, stopRenderingLineAfter, renderWhitespace, renderControlCharacters, fontLigatures, selectionsOnLine) { - this.useMonospaceOptimizations = useMonospaceOptimizations; - this.canUseHalfwidthRightwardsArrow = canUseHalfwidthRightwardsArrow; - this.lineContent = lineContent; - this.continuesWithWrappedLine = continuesWithWrappedLine; - this.isBasicASCII = isBasicASCII; - this.containsRTL = containsRTL; - this.fauxIndentLength = fauxIndentLength; - this.lineTokens = lineTokens; - this.lineDecorations = lineDecorations; - this.tabSize = tabSize; - this.startVisibleColumn = startVisibleColumn; - this.spaceWidth = spaceWidth; - this.stopRenderingLineAfter = stopRenderingLineAfter; - this.renderWhitespace = (renderWhitespace === 'all' - ? 4 /* All */ - : renderWhitespace === 'boundary' - ? 1 /* Boundary */ - : renderWhitespace === 'selection' - ? 2 /* Selection */ - : renderWhitespace === 'trailing' - ? 3 /* Trailing */ - : 0 /* None */); - this.renderControlCharacters = renderControlCharacters; - this.fontLigatures = fontLigatures; - this.selectionsOnLine = selectionsOnLine && selectionsOnLine.sort((a, b) => a.startOffset < b.startOffset ? -1 : 1); - const wsmiddotDiff = Math.abs(wsmiddotWidth - spaceWidth); - const middotDiff = Math.abs(middotWidth - spaceWidth); - if (wsmiddotDiff < middotDiff) { - this.renderSpaceWidth = wsmiddotWidth; - this.renderSpaceCharCode = 0x2E31; // U+2E31 - WORD SEPARATOR MIDDLE DOT - } - else { - this.renderSpaceWidth = middotWidth; - this.renderSpaceCharCode = 0xB7; // U+00B7 - MIDDLE DOT - } - } - sameSelection(otherSelections) { - if (this.selectionsOnLine === null) { - return otherSelections === null; - } - if (otherSelections === null) { - return false; - } - if (otherSelections.length !== this.selectionsOnLine.length) { - return false; - } - for (let i = 0; i < this.selectionsOnLine.length; i++) { - if (!this.selectionsOnLine[i].equals(otherSelections[i])) { - return false; - } - } - return true; - } - equals(other) { - return (this.useMonospaceOptimizations === other.useMonospaceOptimizations - && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow - && this.lineContent === other.lineContent - && this.continuesWithWrappedLine === other.continuesWithWrappedLine - && this.isBasicASCII === other.isBasicASCII - && this.containsRTL === other.containsRTL - && this.fauxIndentLength === other.fauxIndentLength - && this.tabSize === other.tabSize - && this.startVisibleColumn === other.startVisibleColumn - && this.spaceWidth === other.spaceWidth - && this.renderSpaceWidth === other.renderSpaceWidth - && this.renderSpaceCharCode === other.renderSpaceCharCode - && this.stopRenderingLineAfter === other.stopRenderingLineAfter - && this.renderWhitespace === other.renderWhitespace - && this.renderControlCharacters === other.renderControlCharacters - && this.fontLigatures === other.fontLigatures - && _lineDecorations_js__WEBPACK_IMPORTED_MODULE_2__["LineDecoration"].equalsArr(this.lineDecorations, other.lineDecorations) - && this.lineTokens.equals(other.lineTokens) - && this.sameSelection(other.selectionsOnLine)); - } -} -/** - * Provides a both direction mapping between a line's character and its rendered position. - */ -class CharacterMapping { - constructor(length, partCount) { - this.length = length; - this._data = new Uint32Array(this.length); - this._absoluteOffsets = new Uint32Array(this.length); - } - static getPartIndex(partData) { - return (partData & 4294901760 /* PART_INDEX_MASK */) >>> 16 /* PART_INDEX_OFFSET */; - } - static getCharIndex(partData) { - return (partData & 65535 /* CHAR_INDEX_MASK */) >>> 0 /* CHAR_INDEX_OFFSET */; - } - setPartData(charOffset, partIndex, charIndex, partAbsoluteOffset) { - let partData = ((partIndex << 16 /* PART_INDEX_OFFSET */) - | (charIndex << 0 /* CHAR_INDEX_OFFSET */)) >>> 0; - this._data[charOffset] = partData; - this._absoluteOffsets[charOffset] = partAbsoluteOffset + charIndex; - } - getAbsoluteOffsets() { - return this._absoluteOffsets; - } - charOffsetToPartData(charOffset) { - if (this.length === 0) { - return 0; - } - if (charOffset < 0) { - return this._data[0]; - } - if (charOffset >= this.length) { - return this._data[this.length - 1]; - } - return this._data[charOffset]; - } - partDataToCharOffset(partIndex, partLength, charIndex) { - if (this.length === 0) { - return 0; - } - let searchEntry = ((partIndex << 16 /* PART_INDEX_OFFSET */) - | (charIndex << 0 /* CHAR_INDEX_OFFSET */)) >>> 0; - let min = 0; - let max = this.length - 1; - while (min + 1 < max) { - let mid = ((min + max) >>> 1); - let midEntry = this._data[mid]; - if (midEntry === searchEntry) { - return mid; - } - else if (midEntry > searchEntry) { - max = mid; - } - else { - min = mid; - } - } - if (min === max) { - return min; - } - let minEntry = this._data[min]; - let maxEntry = this._data[max]; - if (minEntry === searchEntry) { - return min; - } - if (maxEntry === searchEntry) { - return max; - } - let minPartIndex = CharacterMapping.getPartIndex(minEntry); - let minCharIndex = CharacterMapping.getCharIndex(minEntry); - let maxPartIndex = CharacterMapping.getPartIndex(maxEntry); - let maxCharIndex; - if (minPartIndex !== maxPartIndex) { - // sitting between parts - maxCharIndex = partLength; - } - else { - maxCharIndex = CharacterMapping.getCharIndex(maxEntry); - } - let minEntryDistance = charIndex - minCharIndex; - let maxEntryDistance = maxCharIndex - charIndex; - if (minEntryDistance <= maxEntryDistance) { - return min; - } - return max; - } -} -class RenderLineOutput { - constructor(characterMapping, containsRTL, containsForeignElements) { - this.characterMapping = characterMapping; - this.containsRTL = containsRTL; - this.containsForeignElements = containsForeignElements; - } -} -function renderViewLine(input, sb) { - if (input.lineContent.length === 0) { - let containsForeignElements = 0 /* None */; - let content = ''; - if (input.lineDecorations.length > 0) { - // This line is empty, but it contains inline decorations - const beforeClassNames = []; - const afterClassNames = []; - for (let i = 0, len = input.lineDecorations.length; i < len; i++) { - const lineDecoration = input.lineDecorations[i]; - if (lineDecoration.type === 1 /* Before */) { - beforeClassNames.push(input.lineDecorations[i].className); - containsForeignElements |= 1 /* Before */; - } - if (lineDecoration.type === 2 /* After */) { - afterClassNames.push(input.lineDecorations[i].className); - containsForeignElements |= 2 /* After */; - } - } - if (containsForeignElements !== 0 /* None */) { - const beforeSpan = (beforeClassNames.length > 0 ? `` : ``); - const afterSpan = (afterClassNames.length > 0 ? `` : ``); - content = `${beforeSpan}${afterSpan}`; - } - } - sb.appendASCIIString(content); - return new RenderLineOutput(new CharacterMapping(0, 0), false, containsForeignElements); - } - return _renderLine(resolveRenderLineInput(input), sb); -} -class RenderLineOutput2 { - constructor(characterMapping, html, containsRTL, containsForeignElements) { - this.characterMapping = characterMapping; - this.html = html; - this.containsRTL = containsRTL; - this.containsForeignElements = containsForeignElements; - } -} -function renderViewLine2(input) { - let sb = Object(_core_stringBuilder_js__WEBPACK_IMPORTED_MODULE_1__["createStringBuilder"])(10000); - let out = renderViewLine(input, sb); - return new RenderLineOutput2(out.characterMapping, sb.build(), out.containsRTL, out.containsForeignElements); -} -class ResolvedRenderLineInput { - constructor(fontIsMonospace, canUseHalfwidthRightwardsArrow, lineContent, len, isOverflowing, parts, containsForeignElements, fauxIndentLength, tabSize, startVisibleColumn, containsRTL, spaceWidth, renderSpaceCharCode, renderWhitespace, renderControlCharacters) { - this.fontIsMonospace = fontIsMonospace; - this.canUseHalfwidthRightwardsArrow = canUseHalfwidthRightwardsArrow; - this.lineContent = lineContent; - this.len = len; - this.isOverflowing = isOverflowing; - this.parts = parts; - this.containsForeignElements = containsForeignElements; - this.fauxIndentLength = fauxIndentLength; - this.tabSize = tabSize; - this.startVisibleColumn = startVisibleColumn; - this.containsRTL = containsRTL; - this.spaceWidth = spaceWidth; - this.renderSpaceCharCode = renderSpaceCharCode; - this.renderWhitespace = renderWhitespace; - this.renderControlCharacters = renderControlCharacters; - // - } -} -function resolveRenderLineInput(input) { - const lineContent = input.lineContent; - let isOverflowing; - let len; - if (input.stopRenderingLineAfter !== -1 && input.stopRenderingLineAfter < lineContent.length) { - isOverflowing = true; - len = input.stopRenderingLineAfter; - } - else { - isOverflowing = false; - len = lineContent.length; - } - let tokens = transformAndRemoveOverflowing(input.lineTokens, input.fauxIndentLength, len); - if (input.renderWhitespace === 4 /* All */ || - input.renderWhitespace === 1 /* Boundary */ || - (input.renderWhitespace === 2 /* Selection */ && !!input.selectionsOnLine) || - input.renderWhitespace === 3 /* Trailing */) { - tokens = _applyRenderWhitespace(input, lineContent, len, tokens); - } - let containsForeignElements = 0 /* None */; - if (input.lineDecorations.length > 0) { - for (let i = 0, len = input.lineDecorations.length; i < len; i++) { - const lineDecoration = input.lineDecorations[i]; - if (lineDecoration.type === 3 /* RegularAffectingLetterSpacing */) { - // Pretend there are foreign elements... although not 100% accurate. - containsForeignElements |= 1 /* Before */; - } - else if (lineDecoration.type === 1 /* Before */) { - containsForeignElements |= 1 /* Before */; - } - else if (lineDecoration.type === 2 /* After */) { - containsForeignElements |= 2 /* After */; - } - } - tokens = _applyInlineDecorations(lineContent, len, tokens, input.lineDecorations); - } - if (!input.containsRTL) { - // We can never split RTL text, as it ruins the rendering - tokens = splitLargeTokens(lineContent, tokens, !input.isBasicASCII || input.fontLigatures); - } - return new ResolvedRenderLineInput(input.useMonospaceOptimizations, input.canUseHalfwidthRightwardsArrow, lineContent, len, isOverflowing, tokens, containsForeignElements, input.fauxIndentLength, input.tabSize, input.startVisibleColumn, input.containsRTL, input.spaceWidth, input.renderSpaceCharCode, input.renderWhitespace, input.renderControlCharacters); -} -/** - * In the rendering phase, characters are always looped until token.endIndex. - * Ensure that all tokens end before `len` and the last one ends precisely at `len`. - */ -function transformAndRemoveOverflowing(tokens, fauxIndentLength, len) { - let result = [], resultLen = 0; - // The faux indent part of the line should have no token type - if (fauxIndentLength > 0) { - result[resultLen++] = new LinePart(fauxIndentLength, '', 0); - } - for (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) { - const endIndex = tokens.getEndOffset(tokenIndex); - if (endIndex <= fauxIndentLength) { - // The faux indent part of the line should have no token type - continue; - } - const type = tokens.getClassName(tokenIndex); - if (endIndex >= len) { - result[resultLen++] = new LinePart(len, type, 0); - break; - } - result[resultLen++] = new LinePart(endIndex, type, 0); - } - return result; -} -/** - * See https://github.com/Microsoft/vscode/issues/6885. - * It appears that having very large spans causes very slow reading of character positions. - * So here we try to avoid that. - */ -function splitLargeTokens(lineContent, tokens, onlyAtSpaces) { - let lastTokenEndIndex = 0; - let result = [], resultLen = 0; - if (onlyAtSpaces) { - // Split only at spaces => we need to walk each character - for (let i = 0, len = tokens.length; i < len; i++) { - const token = tokens[i]; - const tokenEndIndex = token.endIndex; - if (lastTokenEndIndex + 50 /* LongToken */ < tokenEndIndex) { - const tokenType = token.type; - const tokenMetadata = token.metadata; - let lastSpaceOffset = -1; - let currTokenStart = lastTokenEndIndex; - for (let j = lastTokenEndIndex; j < tokenEndIndex; j++) { - if (lineContent.charCodeAt(j) === 32 /* Space */) { - lastSpaceOffset = j; - } - if (lastSpaceOffset !== -1 && j - currTokenStart >= 50 /* LongToken */) { - // Split at `lastSpaceOffset` + 1 - result[resultLen++] = new LinePart(lastSpaceOffset + 1, tokenType, tokenMetadata); - currTokenStart = lastSpaceOffset + 1; - lastSpaceOffset = -1; - } - } - if (currTokenStart !== tokenEndIndex) { - result[resultLen++] = new LinePart(tokenEndIndex, tokenType, tokenMetadata); - } - } - else { - result[resultLen++] = token; - } - lastTokenEndIndex = tokenEndIndex; - } - } - else { - // Split anywhere => we don't need to walk each character - for (let i = 0, len = tokens.length; i < len; i++) { - const token = tokens[i]; - const tokenEndIndex = token.endIndex; - let diff = (tokenEndIndex - lastTokenEndIndex); - if (diff > 50 /* LongToken */) { - const tokenType = token.type; - const tokenMetadata = token.metadata; - const piecesCount = Math.ceil(diff / 50 /* LongToken */); - for (let j = 1; j < piecesCount; j++) { - let pieceEndIndex = lastTokenEndIndex + (j * 50 /* LongToken */); - result[resultLen++] = new LinePart(pieceEndIndex, tokenType, tokenMetadata); - } - result[resultLen++] = new LinePart(tokenEndIndex, tokenType, tokenMetadata); - } - else { - result[resultLen++] = token; - } - lastTokenEndIndex = tokenEndIndex; - } - } - return result; -} -/** - * Whitespace is rendered by "replacing" tokens with a special-purpose `mtkw` type that is later recognized in the rendering phase. - * Moreover, a token is created for every visual indent because on some fonts the glyphs used for rendering whitespace (→ or ·) do not have the same width as  . - * The rendering phase will generate `style="width:..."` for these tokens. - */ -function _applyRenderWhitespace(input, lineContent, len, tokens) { - const continuesWithWrappedLine = input.continuesWithWrappedLine; - const fauxIndentLength = input.fauxIndentLength; - const tabSize = input.tabSize; - const startVisibleColumn = input.startVisibleColumn; - const useMonospaceOptimizations = input.useMonospaceOptimizations; - const selections = input.selectionsOnLine; - const onlyBoundary = (input.renderWhitespace === 1 /* Boundary */); - const onlyTrailing = (input.renderWhitespace === 3 /* Trailing */); - const generateLinePartForEachWhitespace = (input.renderSpaceWidth !== input.spaceWidth); - let result = [], resultLen = 0; - let tokenIndex = 0; - let tokenType = tokens[tokenIndex].type; - let tokenEndIndex = tokens[tokenIndex].endIndex; - const tokensLength = tokens.length; - let lineIsEmptyOrWhitespace = false; - let firstNonWhitespaceIndex = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["firstNonWhitespaceIndex"](lineContent); - let lastNonWhitespaceIndex; - if (firstNonWhitespaceIndex === -1) { - lineIsEmptyOrWhitespace = true; - firstNonWhitespaceIndex = len; - lastNonWhitespaceIndex = len; - } - else { - lastNonWhitespaceIndex = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["lastNonWhitespaceIndex"](lineContent); - } - let wasInWhitespace = false; - let currentSelectionIndex = 0; - let currentSelection = selections && selections[currentSelectionIndex]; - let tmpIndent = startVisibleColumn % tabSize; - for (let charIndex = fauxIndentLength; charIndex < len; charIndex++) { - const chCode = lineContent.charCodeAt(charIndex); - if (currentSelection && charIndex >= currentSelection.endOffset) { - currentSelectionIndex++; - currentSelection = selections && selections[currentSelectionIndex]; - } - let isInWhitespace; - if (charIndex < firstNonWhitespaceIndex || charIndex > lastNonWhitespaceIndex) { - // in leading or trailing whitespace - isInWhitespace = true; - } - else if (chCode === 9 /* Tab */) { - // a tab character is rendered both in all and boundary cases - isInWhitespace = true; - } - else if (chCode === 32 /* Space */) { - // hit a space character - if (onlyBoundary) { - // rendering only boundary whitespace - if (wasInWhitespace) { - isInWhitespace = true; - } - else { - const nextChCode = (charIndex + 1 < len ? lineContent.charCodeAt(charIndex + 1) : 0 /* Null */); - isInWhitespace = (nextChCode === 32 /* Space */ || nextChCode === 9 /* Tab */); - } - } - else { - isInWhitespace = true; - } - } - else { - isInWhitespace = false; - } - // If rendering whitespace on selection, check that the charIndex falls within a selection - if (isInWhitespace && selections) { - isInWhitespace = !!currentSelection && currentSelection.startOffset <= charIndex && currentSelection.endOffset > charIndex; - } - // If rendering only trailing whitespace, check that the charIndex points to trailing whitespace. - if (isInWhitespace && onlyTrailing) { - isInWhitespace = lineIsEmptyOrWhitespace || charIndex > lastNonWhitespaceIndex; - } - if (wasInWhitespace) { - // was in whitespace token - if (!isInWhitespace || (!useMonospaceOptimizations && tmpIndent >= tabSize)) { - // leaving whitespace token or entering a new indent - if (generateLinePartForEachWhitespace) { - const lastEndIndex = (resultLen > 0 ? result[resultLen - 1].endIndex : fauxIndentLength); - for (let i = lastEndIndex + 1; i <= charIndex; i++) { - result[resultLen++] = new LinePart(i, 'mtkw', 1 /* IS_WHITESPACE */); - } - } - else { - result[resultLen++] = new LinePart(charIndex, 'mtkw', 1 /* IS_WHITESPACE */); - } - tmpIndent = tmpIndent % tabSize; - } - } - else { - // was in regular token - if (charIndex === tokenEndIndex || (isInWhitespace && charIndex > fauxIndentLength)) { - result[resultLen++] = new LinePart(charIndex, tokenType, 0); - tmpIndent = tmpIndent % tabSize; - } - } - if (chCode === 9 /* Tab */) { - tmpIndent = tabSize; - } - else if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isFullWidthCharacter"](chCode)) { - tmpIndent += 2; - } - else { - tmpIndent++; - } - wasInWhitespace = isInWhitespace; - while (charIndex === tokenEndIndex) { - tokenIndex++; - if (tokenIndex < tokensLength) { - tokenType = tokens[tokenIndex].type; - tokenEndIndex = tokens[tokenIndex].endIndex; - } - } - } - let generateWhitespace = false; - if (wasInWhitespace) { - // was in whitespace token - if (continuesWithWrappedLine && onlyBoundary) { - let lastCharCode = (len > 0 ? lineContent.charCodeAt(len - 1) : 0 /* Null */); - let prevCharCode = (len > 1 ? lineContent.charCodeAt(len - 2) : 0 /* Null */); - let isSingleTrailingSpace = (lastCharCode === 32 /* Space */ && (prevCharCode !== 32 /* Space */ && prevCharCode !== 9 /* Tab */)); - if (!isSingleTrailingSpace) { - generateWhitespace = true; - } - } - else { - generateWhitespace = true; - } - } - if (generateWhitespace) { - if (generateLinePartForEachWhitespace) { - const lastEndIndex = (resultLen > 0 ? result[resultLen - 1].endIndex : fauxIndentLength); - for (let i = lastEndIndex + 1; i <= len; i++) { - result[resultLen++] = new LinePart(i, 'mtkw', 1 /* IS_WHITESPACE */); - } - } - else { - result[resultLen++] = new LinePart(len, 'mtkw', 1 /* IS_WHITESPACE */); - } - } - else { - result[resultLen++] = new LinePart(len, tokenType, 0); - } - return result; -} -/** - * Inline decorations are "merged" on top of tokens. - * Special care must be taken when multiple inline decorations are at play and they overlap. - */ -function _applyInlineDecorations(lineContent, len, tokens, _lineDecorations) { - _lineDecorations.sort(_lineDecorations_js__WEBPACK_IMPORTED_MODULE_2__["LineDecoration"].compare); - const lineDecorations = _lineDecorations_js__WEBPACK_IMPORTED_MODULE_2__["LineDecorationsNormalizer"].normalize(lineContent, _lineDecorations); - const lineDecorationsLen = lineDecorations.length; - let lineDecorationIndex = 0; - let result = [], resultLen = 0, lastResultEndIndex = 0; - for (let tokenIndex = 0, len = tokens.length; tokenIndex < len; tokenIndex++) { - const token = tokens[tokenIndex]; - const tokenEndIndex = token.endIndex; - const tokenType = token.type; - const tokenMetadata = token.metadata; - while (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset < tokenEndIndex) { - const lineDecoration = lineDecorations[lineDecorationIndex]; - if (lineDecoration.startOffset > lastResultEndIndex) { - lastResultEndIndex = lineDecoration.startOffset; - result[resultLen++] = new LinePart(lastResultEndIndex, tokenType, tokenMetadata); - } - if (lineDecoration.endOffset + 1 <= tokenEndIndex) { - // This line decoration ends before this token ends - lastResultEndIndex = lineDecoration.endOffset + 1; - result[resultLen++] = new LinePart(lastResultEndIndex, tokenType + ' ' + lineDecoration.className, tokenMetadata | lineDecoration.metadata); - lineDecorationIndex++; - } - else { - // This line decoration continues on to the next token - lastResultEndIndex = tokenEndIndex; - result[resultLen++] = new LinePart(lastResultEndIndex, tokenType + ' ' + lineDecoration.className, tokenMetadata | lineDecoration.metadata); - break; - } - } - if (tokenEndIndex > lastResultEndIndex) { - lastResultEndIndex = tokenEndIndex; - result[resultLen++] = new LinePart(lastResultEndIndex, tokenType, tokenMetadata); - } - } - const lastTokenEndIndex = tokens[tokens.length - 1].endIndex; - if (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) { - let classNames = []; - let metadata = 0; - while (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) { - classNames.push(lineDecorations[lineDecorationIndex].className); - metadata |= lineDecorations[lineDecorationIndex].metadata; - lineDecorationIndex++; - } - result[resultLen++] = new LinePart(lastResultEndIndex, classNames.join(' '), metadata); - } - return result; -} -/** - * This function is on purpose not split up into multiple functions to allow runtime type inference (i.e. performance reasons). - * Notice how all the needed data is fully resolved and passed in (i.e. no other calls). - */ -function _renderLine(input, sb) { - const fontIsMonospace = input.fontIsMonospace; - const canUseHalfwidthRightwardsArrow = input.canUseHalfwidthRightwardsArrow; - const containsForeignElements = input.containsForeignElements; - const lineContent = input.lineContent; - const len = input.len; - const isOverflowing = input.isOverflowing; - const parts = input.parts; - const fauxIndentLength = input.fauxIndentLength; - const tabSize = input.tabSize; - const startVisibleColumn = input.startVisibleColumn; - const containsRTL = input.containsRTL; - const spaceWidth = input.spaceWidth; - const renderSpaceCharCode = input.renderSpaceCharCode; - const renderWhitespace = input.renderWhitespace; - const renderControlCharacters = input.renderControlCharacters; - const characterMapping = new CharacterMapping(len + 1, parts.length); - let charIndex = 0; - let visibleColumn = startVisibleColumn; - let charOffsetInPart = 0; - let partDisplacement = 0; - let prevPartContentCnt = 0; - let partAbsoluteOffset = 0; - if (containsRTL) { - sb.appendASCIIString(''); - } - else { - sb.appendASCIIString(''); - } - for (let partIndex = 0, tokensLen = parts.length; partIndex < tokensLen; partIndex++) { - partAbsoluteOffset += prevPartContentCnt; - const part = parts[partIndex]; - const partEndIndex = part.endIndex; - const partType = part.type; - const partRendersWhitespace = (renderWhitespace !== 0 /* None */ && part.isWhitespace()); - const partRendersWhitespaceWithWidth = partRendersWhitespace && !fontIsMonospace && (partType === 'mtkw' /*only whitespace*/ || !containsForeignElements); - const partIsEmptyAndHasPseudoAfter = (charIndex === partEndIndex && part.metadata === 4 /* PSEUDO_AFTER */); - charOffsetInPart = 0; - sb.appendASCIIString(' 1) { - sb.write1(0x2192); // RIGHTWARDS ARROW - } - else { - sb.write1(0xFFEB); // HALFWIDTH RIGHTWARDS ARROW - } - for (let space = 2; space <= charWidth; space++) { - sb.write1(0xA0); //   - } - } - else { // must be CharCode.Space - charWidth = 1; - sb.write1(renderSpaceCharCode); // · or word separator middle dot - } - charOffsetInPart += charWidth; - if (charIndex >= fauxIndentLength) { - visibleColumn += charWidth; - } - } - prevPartContentCnt = partContentCnt; - } - else { - let partContentCnt = 0; - sb.appendASCII(62 /* GreaterThan */); - for (; charIndex < partEndIndex; charIndex++) { - characterMapping.setPartData(charIndex, partIndex - partDisplacement, charOffsetInPart, partAbsoluteOffset); - partDisplacement = 0; - const charCode = lineContent.charCodeAt(charIndex); - let producedCharacters = 1; - let charWidth = 1; - switch (charCode) { - case 9 /* Tab */: - producedCharacters = (tabSize - (visibleColumn % tabSize)); - charWidth = producedCharacters; - for (let space = 1; space <= producedCharacters; space++) { - sb.write1(0xA0); //   - } - break; - case 32 /* Space */: - sb.write1(0xA0); //   - break; - case 60 /* LessThan */: - sb.appendASCIIString('<'); - break; - case 62 /* GreaterThan */: - sb.appendASCIIString('>'); - break; - case 38 /* Ampersand */: - sb.appendASCIIString('&'); - break; - case 0 /* Null */: - sb.appendASCIIString('�'); - break; - case 65279 /* UTF8_BOM */: - case 8232 /* LINE_SEPARATOR */: - case 8233 /* PARAGRAPH_SEPARATOR */: - case 133 /* NEXT_LINE */: - sb.write1(0xFFFD); - break; - default: - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isFullWidthCharacter"](charCode)) { - charWidth++; - } - if (renderControlCharacters && charCode < 32) { - sb.write1(9216 + charCode); - } - else { - sb.write1(charCode); - } - } - charOffsetInPart += producedCharacters; - partContentCnt += producedCharacters; - if (charIndex >= fauxIndentLength) { - visibleColumn += charWidth; - } - } - prevPartContentCnt = partContentCnt; - } - if (partIsEmptyAndHasPseudoAfter) { - partDisplacement++; - } - else { - partDisplacement = 0; - } - sb.appendASCIIString(''); - } - // When getting client rects for the last character, we will position the - // text range at the end of the span, insteaf of at the beginning of next span - characterMapping.setPartData(len, parts.length - 1, charOffsetInPart, partAbsoluteOffset); - if (isOverflowing) { - sb.appendASCIIString(''); - } - sb.appendASCIIString(''); - return new RenderLineOutput(characterMapping, containsRTL, containsForeignElements); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLinesViewportData.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLinesViewportData.js ***! - \*********************************************************************************************/ -/*! exports provided: ViewportData */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewportData", function() { return ViewportData; }); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * Contains all data needed to render at a specific viewport. - */ -class ViewportData { - constructor(selections, partialData, whitespaceViewportData, model) { - this.selections = selections; - this.startLineNumber = partialData.startLineNumber | 0; - this.endLineNumber = partialData.endLineNumber | 0; - this.relativeVerticalOffset = partialData.relativeVerticalOffset; - this.bigNumbersDelta = partialData.bigNumbersDelta | 0; - this.whitespaceViewportData = whitespaceViewportData; - this._model = model; - this.visibleRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](partialData.startLineNumber, this._model.getLineMinColumn(partialData.startLineNumber), partialData.endLineNumber, this._model.getLineMaxColumn(partialData.endLineNumber)); - } - getViewLineRenderingData(lineNumber) { - return this._model.getViewLineRenderingData(this.visibleRange, lineNumber); - } - getDecorationsInViewport() { - return this._model.getDecorationsInViewport(this.visibleRange); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/minimapTokensColorTracker.js": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/minimapTokensColorTracker.js ***! - \************************************************************************************************/ -/*! exports provided: MinimapTokensColorTracker */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinimapTokensColorTracker", function() { return MinimapTokensColorTracker; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _core_rgba_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/rgba.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/rgba.js"); -/* harmony import */ var _modes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class MinimapTokensColorTracker { - constructor() { - this._onDidChange = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this.onDidChange = this._onDidChange.event; - this._updateColorMap(); - _modes_js__WEBPACK_IMPORTED_MODULE_2__["TokenizationRegistry"].onDidChange(e => { - if (e.changedColorMap) { - this._updateColorMap(); - } - }); - } - static getInstance() { - if (!this._INSTANCE) { - this._INSTANCE = new MinimapTokensColorTracker(); - } - return this._INSTANCE; - } - _updateColorMap() { - const colorMap = _modes_js__WEBPACK_IMPORTED_MODULE_2__["TokenizationRegistry"].getColorMap(); - if (!colorMap) { - this._colors = [_core_rgba_js__WEBPACK_IMPORTED_MODULE_1__["RGBA8"].Empty]; - this._backgroundIsLight = true; - return; - } - this._colors = [_core_rgba_js__WEBPACK_IMPORTED_MODULE_1__["RGBA8"].Empty]; - for (let colorId = 1; colorId < colorMap.length; colorId++) { - const source = colorMap[colorId].rgba; - // Use a VM friendly data-type - this._colors[colorId] = new _core_rgba_js__WEBPACK_IMPORTED_MODULE_1__["RGBA8"](source.r, source.g, source.b, Math.round(source.a * 255)); - } - let backgroundLuminosity = colorMap[2 /* DefaultBackground */].getRelativeLuminance(); - this._backgroundIsLight = backgroundLuminosity >= 0.5; - this._onDidChange.fire(undefined); - } - getColor(colorId) { - if (colorId < 1 || colorId >= this._colors.length) { - // background color (basically invisible) - colorId = 2 /* DefaultBackground */; - } - return this._colors[colorId]; - } - backgroundIsLight() { - return this._backgroundIsLight; - } -} -MinimapTokensColorTracker._INSTANCE = null; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js": -/*!**************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js ***! - \**************************************************************************************************/ -/*! exports provided: MonospaceLineBreaksComputerFactory */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MonospaceLineBreaksComputerFactory", function() { return MonospaceLineBreaksComputerFactory; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/* harmony import */ var _splitLinesCollection_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./splitLinesCollection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/splitLinesCollection.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class WrappingCharacterClassifier extends _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_1__["CharacterClassifier"] { - constructor(BREAK_BEFORE, BREAK_AFTER) { - super(0 /* NONE */); - for (let i = 0; i < BREAK_BEFORE.length; i++) { - this.set(BREAK_BEFORE.charCodeAt(i), 1 /* BREAK_BEFORE */); - } - for (let i = 0; i < BREAK_AFTER.length; i++) { - this.set(BREAK_AFTER.charCodeAt(i), 2 /* BREAK_AFTER */); - } - } - get(charCode) { - if (charCode >= 0 && charCode < 256) { - return this._asciiMap[charCode]; - } - else { - // Initialize CharacterClass.BREAK_IDEOGRAPHIC for these Unicode ranges: - // 1. CJK Unified Ideographs (0x4E00 -- 0x9FFF) - // 2. CJK Unified Ideographs Extension A (0x3400 -- 0x4DBF) - // 3. Hiragana and Katakana (0x3040 -- 0x30FF) - if ((charCode >= 0x3040 && charCode <= 0x30FF) - || (charCode >= 0x3400 && charCode <= 0x4DBF) - || (charCode >= 0x4E00 && charCode <= 0x9FFF)) { - return 3 /* BREAK_IDEOGRAPHIC */; - } - return (this._map.get(charCode) || this._defaultValue); - } - } -} -let arrPool1 = []; -let arrPool2 = []; -class MonospaceLineBreaksComputerFactory { - constructor(breakBeforeChars, breakAfterChars) { - this.classifier = new WrappingCharacterClassifier(breakBeforeChars, breakAfterChars); - } - static create(options) { - return new MonospaceLineBreaksComputerFactory(options.get(108 /* wordWrapBreakBeforeCharacters */), options.get(107 /* wordWrapBreakAfterCharacters */)); - } - createLineBreaksComputer(fontInfo, tabSize, wrappingColumn, wrappingIndent) { - tabSize = tabSize | 0; //@perf - wrappingColumn = +wrappingColumn; //@perf - let requests = []; - let previousBreakingData = []; - return { - addRequest: (lineText, previousLineBreakData) => { - requests.push(lineText); - previousBreakingData.push(previousLineBreakData); - }, - finalize: () => { - const columnsForFullWidthChar = fontInfo.typicalFullwidthCharacterWidth / fontInfo.typicalHalfwidthCharacterWidth; //@perf - let result = []; - for (let i = 0, len = requests.length; i < len; i++) { - const previousLineBreakData = previousBreakingData[i]; - if (previousLineBreakData) { - result[i] = createLineBreaksFromPreviousLineBreaks(this.classifier, previousLineBreakData, requests[i], tabSize, wrappingColumn, columnsForFullWidthChar, wrappingIndent); - } - else { - result[i] = createLineBreaks(this.classifier, requests[i], tabSize, wrappingColumn, columnsForFullWidthChar, wrappingIndent); - } - } - arrPool1.length = 0; - arrPool2.length = 0; - return result; - } - }; - } -} -function createLineBreaksFromPreviousLineBreaks(classifier, previousBreakingData, lineText, tabSize, firstLineBreakColumn, columnsForFullWidthChar, wrappingIndent) { - if (firstLineBreakColumn === -1) { - return null; - } - const len = lineText.length; - if (len <= 1) { - return null; - } - const prevBreakingOffsets = previousBreakingData.breakOffsets; - const prevBreakingOffsetsVisibleColumn = previousBreakingData.breakOffsetsVisibleColumn; - const wrappedTextIndentLength = computeWrappedTextIndentLength(lineText, tabSize, firstLineBreakColumn, columnsForFullWidthChar, wrappingIndent); - const wrappedLineBreakColumn = firstLineBreakColumn - wrappedTextIndentLength; - let breakingOffsets = arrPool1; - let breakingOffsetsVisibleColumn = arrPool2; - let breakingOffsetsCount = 0; - let lastBreakingOffset = 0; - let lastBreakingOffsetVisibleColumn = 0; - let breakingColumn = firstLineBreakColumn; - const prevLen = prevBreakingOffsets.length; - let prevIndex = 0; - if (prevIndex >= 0) { - let bestDistance = Math.abs(prevBreakingOffsetsVisibleColumn[prevIndex] - breakingColumn); - while (prevIndex + 1 < prevLen) { - const distance = Math.abs(prevBreakingOffsetsVisibleColumn[prevIndex + 1] - breakingColumn); - if (distance >= bestDistance) { - break; - } - bestDistance = distance; - prevIndex++; - } - } - while (prevIndex < prevLen) { - // Allow for prevIndex to be -1 (for the case where we hit a tab when walking backwards from the first break) - let prevBreakOffset = prevIndex < 0 ? 0 : prevBreakingOffsets[prevIndex]; - let prevBreakOffsetVisibleColumn = prevIndex < 0 ? 0 : prevBreakingOffsetsVisibleColumn[prevIndex]; - if (lastBreakingOffset > prevBreakOffset) { - prevBreakOffset = lastBreakingOffset; - prevBreakOffsetVisibleColumn = lastBreakingOffsetVisibleColumn; - } - let breakOffset = 0; - let breakOffsetVisibleColumn = 0; - let forcedBreakOffset = 0; - let forcedBreakOffsetVisibleColumn = 0; - // initially, we search as much as possible to the right (if it fits) - if (prevBreakOffsetVisibleColumn <= breakingColumn) { - let visibleColumn = prevBreakOffsetVisibleColumn; - let prevCharCode = prevBreakOffset === 0 ? 0 /* Null */ : lineText.charCodeAt(prevBreakOffset - 1); - let prevCharCodeClass = prevBreakOffset === 0 ? 0 /* NONE */ : classifier.get(prevCharCode); - let entireLineFits = true; - for (let i = prevBreakOffset; i < len; i++) { - const charStartOffset = i; - const charCode = lineText.charCodeAt(i); - let charCodeClass; - let charWidth; - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isHighSurrogate"](charCode)) { - // A surrogate pair must always be considered as a single unit, so it is never to be broken - i++; - charCodeClass = 0 /* NONE */; - charWidth = 2; - } - else { - charCodeClass = classifier.get(charCode); - charWidth = computeCharWidth(charCode, visibleColumn, tabSize, columnsForFullWidthChar); - } - if (charStartOffset > lastBreakingOffset && canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) { - breakOffset = charStartOffset; - breakOffsetVisibleColumn = visibleColumn; - } - visibleColumn += charWidth; - // check if adding character at `i` will go over the breaking column - if (visibleColumn > breakingColumn) { - // We need to break at least before character at `i`: - if (charStartOffset > lastBreakingOffset) { - forcedBreakOffset = charStartOffset; - forcedBreakOffsetVisibleColumn = visibleColumn - charWidth; - } - else { - // we need to advance at least by one character - forcedBreakOffset = i + 1; - forcedBreakOffsetVisibleColumn = visibleColumn; - } - if (visibleColumn - breakOffsetVisibleColumn > wrappedLineBreakColumn) { - // Cannot break at `breakOffset` => reset it if it was set - breakOffset = 0; - } - entireLineFits = false; - break; - } - prevCharCode = charCode; - prevCharCodeClass = charCodeClass; - } - if (entireLineFits) { - // there is no more need to break => stop the outer loop! - if (breakingOffsetsCount > 0) { - // Add last segment, no need to assign to `lastBreakingOffset` and `lastBreakingOffsetVisibleColumn` - breakingOffsets[breakingOffsetsCount] = prevBreakingOffsets[prevBreakingOffsets.length - 1]; - breakingOffsetsVisibleColumn[breakingOffsetsCount] = prevBreakingOffsetsVisibleColumn[prevBreakingOffsets.length - 1]; - breakingOffsetsCount++; - } - break; - } - } - if (breakOffset === 0) { - // must search left - let visibleColumn = prevBreakOffsetVisibleColumn; - let charCode = lineText.charCodeAt(prevBreakOffset); - let charCodeClass = classifier.get(charCode); - let hitATabCharacter = false; - for (let i = prevBreakOffset - 1; i >= lastBreakingOffset; i--) { - const charStartOffset = i + 1; - const prevCharCode = lineText.charCodeAt(i); - if (prevCharCode === 9 /* Tab */) { - // cannot determine the width of a tab when going backwards, so we must go forwards - hitATabCharacter = true; - break; - } - let prevCharCodeClass; - let prevCharWidth; - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isLowSurrogate"](prevCharCode)) { - // A surrogate pair must always be considered as a single unit, so it is never to be broken - i--; - prevCharCodeClass = 0 /* NONE */; - prevCharWidth = 2; - } - else { - prevCharCodeClass = classifier.get(prevCharCode); - prevCharWidth = (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isFullWidthCharacter"](prevCharCode) ? columnsForFullWidthChar : 1); - } - if (visibleColumn <= breakingColumn) { - if (forcedBreakOffset === 0) { - forcedBreakOffset = charStartOffset; - forcedBreakOffsetVisibleColumn = visibleColumn; - } - if (visibleColumn <= breakingColumn - wrappedLineBreakColumn) { - // went too far! - break; - } - if (canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) { - breakOffset = charStartOffset; - breakOffsetVisibleColumn = visibleColumn; - break; - } - } - visibleColumn -= prevCharWidth; - charCode = prevCharCode; - charCodeClass = prevCharCodeClass; - } - if (breakOffset !== 0) { - const remainingWidthOfNextLine = wrappedLineBreakColumn - (forcedBreakOffsetVisibleColumn - breakOffsetVisibleColumn); - if (remainingWidthOfNextLine <= tabSize) { - const charCodeAtForcedBreakOffset = lineText.charCodeAt(forcedBreakOffset); - let charWidth; - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isHighSurrogate"](charCodeAtForcedBreakOffset)) { - // A surrogate pair must always be considered as a single unit, so it is never to be broken - charWidth = 2; - } - else { - charWidth = computeCharWidth(charCodeAtForcedBreakOffset, forcedBreakOffsetVisibleColumn, tabSize, columnsForFullWidthChar); - } - if (remainingWidthOfNextLine - charWidth < 0) { - // it is not worth it to break at breakOffset, it just introduces an extra needless line! - breakOffset = 0; - } - } - } - if (hitATabCharacter) { - // cannot determine the width of a tab when going backwards, so we must go forwards from the previous break - prevIndex--; - continue; - } - } - if (breakOffset === 0) { - // Could not find a good breaking point - breakOffset = forcedBreakOffset; - breakOffsetVisibleColumn = forcedBreakOffsetVisibleColumn; - } - lastBreakingOffset = breakOffset; - breakingOffsets[breakingOffsetsCount] = breakOffset; - lastBreakingOffsetVisibleColumn = breakOffsetVisibleColumn; - breakingOffsetsVisibleColumn[breakingOffsetsCount] = breakOffsetVisibleColumn; - breakingOffsetsCount++; - breakingColumn = breakOffsetVisibleColumn + wrappedLineBreakColumn; - while (prevIndex < 0 || (prevIndex < prevLen && prevBreakingOffsetsVisibleColumn[prevIndex] < breakOffsetVisibleColumn)) { - prevIndex++; - } - let bestDistance = Math.abs(prevBreakingOffsetsVisibleColumn[prevIndex] - breakingColumn); - while (prevIndex + 1 < prevLen) { - const distance = Math.abs(prevBreakingOffsetsVisibleColumn[prevIndex + 1] - breakingColumn); - if (distance >= bestDistance) { - break; - } - bestDistance = distance; - prevIndex++; - } - } - if (breakingOffsetsCount === 0) { - return null; - } - // Doing here some object reuse which ends up helping a huge deal with GC pauses! - breakingOffsets.length = breakingOffsetsCount; - breakingOffsetsVisibleColumn.length = breakingOffsetsCount; - arrPool1 = previousBreakingData.breakOffsets; - arrPool2 = previousBreakingData.breakOffsetsVisibleColumn; - previousBreakingData.breakOffsets = breakingOffsets; - previousBreakingData.breakOffsetsVisibleColumn = breakingOffsetsVisibleColumn; - previousBreakingData.wrappedTextIndentLength = wrappedTextIndentLength; - return previousBreakingData; -} -function createLineBreaks(classifier, lineText, tabSize, firstLineBreakColumn, columnsForFullWidthChar, wrappingIndent) { - if (firstLineBreakColumn === -1) { - return null; - } - const len = lineText.length; - if (len <= 1) { - return null; - } - const wrappedTextIndentLength = computeWrappedTextIndentLength(lineText, tabSize, firstLineBreakColumn, columnsForFullWidthChar, wrappingIndent); - const wrappedLineBreakColumn = firstLineBreakColumn - wrappedTextIndentLength; - let breakingOffsets = []; - let breakingOffsetsVisibleColumn = []; - let breakingOffsetsCount = 0; - let breakOffset = 0; - let breakOffsetVisibleColumn = 0; - let breakingColumn = firstLineBreakColumn; - let prevCharCode = lineText.charCodeAt(0); - let prevCharCodeClass = classifier.get(prevCharCode); - let visibleColumn = computeCharWidth(prevCharCode, 0, tabSize, columnsForFullWidthChar); - let startOffset = 1; - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isHighSurrogate"](prevCharCode)) { - // A surrogate pair must always be considered as a single unit, so it is never to be broken - visibleColumn += 1; - prevCharCode = lineText.charCodeAt(1); - prevCharCodeClass = classifier.get(prevCharCode); - startOffset++; - } - for (let i = startOffset; i < len; i++) { - const charStartOffset = i; - const charCode = lineText.charCodeAt(i); - let charCodeClass; - let charWidth; - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isHighSurrogate"](charCode)) { - // A surrogate pair must always be considered as a single unit, so it is never to be broken - i++; - charCodeClass = 0 /* NONE */; - charWidth = 2; - } - else { - charCodeClass = classifier.get(charCode); - charWidth = computeCharWidth(charCode, visibleColumn, tabSize, columnsForFullWidthChar); - } - if (canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) { - breakOffset = charStartOffset; - breakOffsetVisibleColumn = visibleColumn; - } - visibleColumn += charWidth; - // check if adding character at `i` will go over the breaking column - if (visibleColumn > breakingColumn) { - // We need to break at least before character at `i`: - if (breakOffset === 0 || visibleColumn - breakOffsetVisibleColumn > wrappedLineBreakColumn) { - // Cannot break at `breakOffset`, must break at `i` - breakOffset = charStartOffset; - breakOffsetVisibleColumn = visibleColumn - charWidth; - } - breakingOffsets[breakingOffsetsCount] = breakOffset; - breakingOffsetsVisibleColumn[breakingOffsetsCount] = breakOffsetVisibleColumn; - breakingOffsetsCount++; - breakingColumn = breakOffsetVisibleColumn + wrappedLineBreakColumn; - breakOffset = 0; - } - prevCharCode = charCode; - prevCharCodeClass = charCodeClass; - } - if (breakingOffsetsCount === 0) { - return null; - } - // Add last segment - breakingOffsets[breakingOffsetsCount] = len; - breakingOffsetsVisibleColumn[breakingOffsetsCount] = visibleColumn; - return new _splitLinesCollection_js__WEBPACK_IMPORTED_MODULE_2__["LineBreakData"](breakingOffsets, breakingOffsetsVisibleColumn, wrappedTextIndentLength); -} -function computeCharWidth(charCode, visibleColumn, tabSize, columnsForFullWidthChar) { - if (charCode === 9 /* Tab */) { - return (tabSize - (visibleColumn % tabSize)); - } - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isFullWidthCharacter"](charCode)) { - return columnsForFullWidthChar; - } - return 1; -} -function tabCharacterWidth(visibleColumn, tabSize) { - return (tabSize - (visibleColumn % tabSize)); -} -/** - * Kinsoku Shori : Don't break after a leading character, like an open bracket - * Kinsoku Shori : Don't break before a trailing character, like a period - */ -function canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass) { - return (charCode !== 32 /* Space */ - && ((prevCharCodeClass === 2 /* BREAK_AFTER */) - || (prevCharCodeClass === 3 /* BREAK_IDEOGRAPHIC */ && charCodeClass !== 2 /* BREAK_AFTER */) - || (charCodeClass === 1 /* BREAK_BEFORE */) - || (charCodeClass === 3 /* BREAK_IDEOGRAPHIC */ && prevCharCodeClass !== 1 /* BREAK_BEFORE */))); -} -function computeWrappedTextIndentLength(lineText, tabSize, firstLineBreakColumn, columnsForFullWidthChar, wrappingIndent) { - let wrappedTextIndentLength = 0; - if (wrappingIndent !== 0 /* None */) { - const firstNonWhitespaceIndex = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["firstNonWhitespaceIndex"](lineText); - if (firstNonWhitespaceIndex !== -1) { - // Track existing indent - for (let i = 0; i < firstNonWhitespaceIndex; i++) { - const charWidth = (lineText.charCodeAt(i) === 9 /* Tab */ ? tabCharacterWidth(wrappedTextIndentLength, tabSize) : 1); - wrappedTextIndentLength += charWidth; - } - // Increase indent of continuation lines, if desired - const numberOfAdditionalTabs = (wrappingIndent === 3 /* DeepIndent */ ? 2 : wrappingIndent === 2 /* Indent */ ? 1 : 0); - for (let i = 0; i < numberOfAdditionalTabs; i++) { - const charWidth = tabCharacterWidth(wrappedTextIndentLength, tabSize); - wrappedTextIndentLength += charWidth; - } - // Force sticking to beginning of line if no character would fit except for the indentation - if (wrappedTextIndentLength + columnsForFullWidthChar > firstLineBreakColumn) { - wrappedTextIndentLength = 0; - } - } - } - return wrappedTextIndentLength; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js ***! - \****************************************************************************************/ -/*! exports provided: PrefixSumIndexOfResult, PrefixSumComputer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumIndexOfResult", function() { return PrefixSumIndexOfResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputer", function() { return PrefixSumComputer; }); -/* harmony import */ var _base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uint.js */ "./node_modules/monaco-editor/esm/vs/base/common/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class PrefixSumIndexOfResult { - constructor(index, remainder) { - this.index = index; - this.remainder = remainder; - } -} -class PrefixSumComputer { - constructor(values) { - this.values = values; - this.prefixSum = new Uint32Array(values.length); - this.prefixSumValidIndex = new Int32Array(1); - this.prefixSumValidIndex[0] = -1; - } - insertValues(insertIndex, insertValues) { - insertIndex = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(insertIndex); - const oldValues = this.values; - const oldPrefixSum = this.prefixSum; - const insertValuesLen = insertValues.length; - if (insertValuesLen === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length + insertValuesLen); - this.values.set(oldValues.subarray(0, insertIndex), 0); - this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); - this.values.set(insertValues, insertIndex); - if (insertIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = insertIndex - 1; - } - this.prefixSum = new Uint32Array(this.values.length); - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; - } - changeValue(index, value) { - index = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - value = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(value); - if (this.values[index] === value) { - return false; - } - this.values[index] = value; - if (index - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = index - 1; - } - return true; - } - removeValues(startIndex, cnt) { - startIndex = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(startIndex); - cnt = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(cnt); - const oldValues = this.values; - const oldPrefixSum = this.prefixSum; - if (startIndex >= oldValues.length) { - return false; - } - let maxCnt = oldValues.length - startIndex; - if (cnt >= maxCnt) { - cnt = maxCnt; - } - if (cnt === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length - cnt); - this.values.set(oldValues.subarray(0, startIndex), 0); - this.values.set(oldValues.subarray(startIndex + cnt), startIndex); - this.prefixSum = new Uint32Array(this.values.length); - if (startIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = startIndex - 1; - } - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; - } - getTotalValue() { - if (this.values.length === 0) { - return 0; - } - return this._getAccumulatedValue(this.values.length - 1); - } - getAccumulatedValue(index) { - if (index < 0) { - return 0; - } - index = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - return this._getAccumulatedValue(index); - } - _getAccumulatedValue(index) { - if (index <= this.prefixSumValidIndex[0]) { - return this.prefixSum[index]; - } - let startIndex = this.prefixSumValidIndex[0] + 1; - if (startIndex === 0) { - this.prefixSum[0] = this.values[0]; - startIndex++; - } - if (index >= this.values.length) { - index = this.values.length - 1; - } - for (let i = startIndex; i <= index; i++) { - this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; - } - this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); - return this.prefixSum[index]; - } - getIndexOf(accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - // Compute all sums (to get a fully valid prefixSum) - this.getTotalValue(); - let low = 0; - let high = this.values.length - 1; - let mid = 0; - let midStop = 0; - let midStart = 0; - while (low <= high) { - mid = low + ((high - low) / 2) | 0; - midStop = this.prefixSum[mid]; - midStart = midStop - this.values[mid]; - if (accumulatedValue < midStart) { - high = mid - 1; - } - else if (accumulatedValue >= midStop) { - low = mid + 1; - } - else { - break; - } - } - return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/splitLinesCollection.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/splitLinesCollection.js ***! - \*******************************************************************************************/ -/*! exports provided: OutputPosition, LineBreakData, CoordinatesConverter, SplitLinesCollection, SplitLine, IdentityCoordinatesConverter, IdentityLinesCollection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputPosition", function() { return OutputPosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineBreakData", function() { return LineBreakData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CoordinatesConverter", function() { return CoordinatesConverter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SplitLinesCollection", function() { return SplitLinesCollection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SplitLine", function() { return SplitLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IdentityCoordinatesConverter", function() { return IdentityCoordinatesConverter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IdentityLinesCollection", function() { return IdentityLinesCollection; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _model_textModel_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../view/viewEvents.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/viewEvents.js"); -/* harmony import */ var _prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./prefixSumComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js"); -/* harmony import */ var _viewModel_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./viewModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModel.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -class OutputPosition { - constructor(outputLineIndex, outputOffset) { - this.outputLineIndex = outputLineIndex; - this.outputOffset = outputOffset; - } -} -class LineBreakData { - constructor(breakOffsets, breakOffsetsVisibleColumn, wrappedTextIndentLength) { - this.breakOffsets = breakOffsets; - this.breakOffsetsVisibleColumn = breakOffsetsVisibleColumn; - this.wrappedTextIndentLength = wrappedTextIndentLength; - } - static getInputOffsetOfOutputPosition(breakOffsets, outputLineIndex, outputOffset) { - if (outputLineIndex === 0) { - return outputOffset; - } - else { - return breakOffsets[outputLineIndex - 1] + outputOffset; - } - } - static getOutputPositionOfInputOffset(breakOffsets, inputOffset) { - let low = 0; - let high = breakOffsets.length - 1; - let mid = 0; - let midStart = 0; - while (low <= high) { - mid = low + ((high - low) / 2) | 0; - const midStop = breakOffsets[mid]; - midStart = mid > 0 ? breakOffsets[mid - 1] : 0; - if (inputOffset < midStart) { - high = mid - 1; - } - else if (inputOffset >= midStop) { - low = mid + 1; - } - else { - break; - } - } - return new OutputPosition(mid, inputOffset - midStart); - } -} -class CoordinatesConverter { - constructor(lines) { - this._lines = lines; - } - // View -> Model conversion and related methods - convertViewPositionToModelPosition(viewPosition) { - return this._lines.convertViewPositionToModelPosition(viewPosition.lineNumber, viewPosition.column); - } - convertViewRangeToModelRange(viewRange) { - return this._lines.convertViewRangeToModelRange(viewRange); - } - validateViewPosition(viewPosition, expectedModelPosition) { - return this._lines.validateViewPosition(viewPosition.lineNumber, viewPosition.column, expectedModelPosition); - } - validateViewRange(viewRange, expectedModelRange) { - return this._lines.validateViewRange(viewRange, expectedModelRange); - } - // Model -> View conversion and related methods - convertModelPositionToViewPosition(modelPosition) { - return this._lines.convertModelPositionToViewPosition(modelPosition.lineNumber, modelPosition.column); - } - convertModelRangeToViewRange(modelRange) { - return this._lines.convertModelRangeToViewRange(modelRange); - } - modelPositionIsVisible(modelPosition) { - return this._lines.modelPositionIsVisible(modelPosition.lineNumber, modelPosition.column); - } -} -class LineNumberMapper { - constructor(viewLineCounts) { - this._counts = viewLineCounts; - this._isValid = false; - this._validEndIndex = -1; - this._modelToView = []; - this._viewToModel = []; - } - _invalidate(index) { - this._isValid = false; - this._validEndIndex = Math.min(this._validEndIndex, index - 1); - } - _ensureValid() { - if (this._isValid) { - return; - } - for (let i = this._validEndIndex + 1, len = this._counts.length; i < len; i++) { - const viewLineCount = this._counts[i]; - const viewLinesAbove = (i > 0 ? this._modelToView[i - 1] : 0); - this._modelToView[i] = viewLinesAbove + viewLineCount; - for (let j = 0; j < viewLineCount; j++) { - this._viewToModel[viewLinesAbove + j] = i; - } - } - // trim things - this._modelToView.length = this._counts.length; - this._viewToModel.length = this._modelToView[this._modelToView.length - 1]; - // mark as valid - this._isValid = true; - this._validEndIndex = this._counts.length - 1; - } - changeValue(index, value) { - if (this._counts[index] === value) { - // no change - return; - } - this._counts[index] = value; - this._invalidate(index); - } - removeValues(start, deleteCount) { - this._counts.splice(start, deleteCount); - this._invalidate(start); - } - insertValues(insertIndex, insertArr) { - this._counts = _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["arrayInsert"](this._counts, insertIndex, insertArr); - this._invalidate(insertIndex); - } - getTotalValue() { - this._ensureValid(); - return this._viewToModel.length; - } - getAccumulatedValue(index) { - this._ensureValid(); - return this._modelToView[index]; - } - getIndexOf(accumulatedValue) { - this._ensureValid(); - const modelLineIndex = this._viewToModel[accumulatedValue]; - const viewLinesAbove = (modelLineIndex > 0 ? this._modelToView[modelLineIndex - 1] : 0); - return new _prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_5__["PrefixSumIndexOfResult"](modelLineIndex, accumulatedValue - viewLinesAbove); - } -} -class SplitLinesCollection { - constructor(model, domLineBreaksComputerFactory, monospaceLineBreaksComputerFactory, fontInfo, tabSize, wrappingStrategy, wrappingColumn, wrappingIndent) { - this.model = model; - this._validModelVersionId = -1; - this._domLineBreaksComputerFactory = domLineBreaksComputerFactory; - this._monospaceLineBreaksComputerFactory = monospaceLineBreaksComputerFactory; - this.fontInfo = fontInfo; - this.tabSize = tabSize; - this.wrappingStrategy = wrappingStrategy; - this.wrappingColumn = wrappingColumn; - this.wrappingIndent = wrappingIndent; - this._constructLines(/*resetHiddenAreas*/ true, null); - } - dispose() { - this.hiddenAreasIds = this.model.deltaDecorations(this.hiddenAreasIds, []); - } - createCoordinatesConverter() { - return new CoordinatesConverter(this); - } - _constructLines(resetHiddenAreas, previousLineBreaks) { - this.lines = []; - if (resetHiddenAreas) { - this.hiddenAreasIds = []; - } - let linesContent = this.model.getLinesContent(); - const lineCount = linesContent.length; - const lineBreaksComputer = this.createLineBreaksComputer(); - for (let i = 0; i < lineCount; i++) { - lineBreaksComputer.addRequest(linesContent[i], previousLineBreaks ? previousLineBreaks[i] : null); - } - const linesBreaks = lineBreaksComputer.finalize(); - let values = []; - let hiddenAreas = this.hiddenAreasIds.map((areaId) => this.model.getDecorationRange(areaId)).sort(_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].compareRangesUsingStarts); - let hiddenAreaStart = 1, hiddenAreaEnd = 0; - let hiddenAreaIdx = -1; - let nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : lineCount + 2; - for (let i = 0; i < lineCount; i++) { - let lineNumber = i + 1; - if (lineNumber === nextLineNumberToUpdateHiddenArea) { - hiddenAreaIdx++; - hiddenAreaStart = hiddenAreas[hiddenAreaIdx].startLineNumber; - hiddenAreaEnd = hiddenAreas[hiddenAreaIdx].endLineNumber; - nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : lineCount + 2; - } - let isInHiddenArea = (lineNumber >= hiddenAreaStart && lineNumber <= hiddenAreaEnd); - let line = createSplitLine(linesBreaks[i], !isInHiddenArea); - values[i] = line.getViewLineCount(); - this.lines[i] = line; - } - this._validModelVersionId = this.model.getVersionId(); - this.prefixSumComputer = new LineNumberMapper(values); - } - getHiddenAreas() { - return this.hiddenAreasIds.map((decId) => { - return this.model.getDecorationRange(decId); - }); - } - _reduceRanges(_ranges) { - if (_ranges.length === 0) { - return []; - } - let ranges = _ranges.map(r => this.model.validateRange(r)).sort(_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].compareRangesUsingStarts); - let result = []; - let currentRangeStart = ranges[0].startLineNumber; - let currentRangeEnd = ranges[0].endLineNumber; - for (let i = 1, len = ranges.length; i < len; i++) { - let range = ranges[i]; - if (range.startLineNumber > currentRangeEnd + 1) { - result.push(new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](currentRangeStart, 1, currentRangeEnd, 1)); - currentRangeStart = range.startLineNumber; - currentRangeEnd = range.endLineNumber; - } - else if (range.endLineNumber > currentRangeEnd) { - currentRangeEnd = range.endLineNumber; - } - } - result.push(new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](currentRangeStart, 1, currentRangeEnd, 1)); - return result; - } - setHiddenAreas(_ranges) { - let newRanges = this._reduceRanges(_ranges); - // BEGIN TODO@Martin: Please stop calling this method on each model change! - let oldRanges = this.hiddenAreasIds.map((areaId) => this.model.getDecorationRange(areaId)).sort(_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].compareRangesUsingStarts); - if (newRanges.length === oldRanges.length) { - let hasDifference = false; - for (let i = 0; i < newRanges.length; i++) { - if (!newRanges[i].equalsRange(oldRanges[i])) { - hasDifference = true; - break; - } - } - if (!hasDifference) { - return false; - } - } - // END TODO@Martin: Please stop calling this method on each model change! - let newDecorations = []; - for (const newRange of newRanges) { - newDecorations.push({ - range: newRange, - options: _model_textModel_js__WEBPACK_IMPORTED_MODULE_3__["ModelDecorationOptions"].EMPTY - }); - } - this.hiddenAreasIds = this.model.deltaDecorations(this.hiddenAreasIds, newDecorations); - let hiddenAreas = newRanges; - let hiddenAreaStart = 1, hiddenAreaEnd = 0; - let hiddenAreaIdx = -1; - let nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : this.lines.length + 2; - let hasVisibleLine = false; - for (let i = 0; i < this.lines.length; i++) { - let lineNumber = i + 1; - if (lineNumber === nextLineNumberToUpdateHiddenArea) { - hiddenAreaIdx++; - hiddenAreaStart = hiddenAreas[hiddenAreaIdx].startLineNumber; - hiddenAreaEnd = hiddenAreas[hiddenAreaIdx].endLineNumber; - nextLineNumberToUpdateHiddenArea = (hiddenAreaIdx + 1 < hiddenAreas.length) ? hiddenAreaEnd + 1 : this.lines.length + 2; - } - let lineChanged = false; - if (lineNumber >= hiddenAreaStart && lineNumber <= hiddenAreaEnd) { - // Line should be hidden - if (this.lines[i].isVisible()) { - this.lines[i] = this.lines[i].setVisible(false); - lineChanged = true; - } - } - else { - hasVisibleLine = true; - // Line should be visible - if (!this.lines[i].isVisible()) { - this.lines[i] = this.lines[i].setVisible(true); - lineChanged = true; - } - } - if (lineChanged) { - let newOutputLineCount = this.lines[i].getViewLineCount(); - this.prefixSumComputer.changeValue(i, newOutputLineCount); - } - } - if (!hasVisibleLine) { - // Cannot have everything be hidden => reveal everything! - this.setHiddenAreas([]); - } - return true; - } - modelPositionIsVisible(modelLineNumber, _modelColumn) { - if (modelLineNumber < 1 || modelLineNumber > this.lines.length) { - // invalid arguments - return false; - } - return this.lines[modelLineNumber - 1].isVisible(); - } - setTabSize(newTabSize) { - if (this.tabSize === newTabSize) { - return false; - } - this.tabSize = newTabSize; - this._constructLines(/*resetHiddenAreas*/ false, null); - return true; - } - setWrappingSettings(fontInfo, wrappingStrategy, wrappingColumn, wrappingIndent) { - const equalFontInfo = this.fontInfo.equals(fontInfo); - const equalWrappingStrategy = (this.wrappingStrategy === wrappingStrategy); - const equalWrappingColumn = (this.wrappingColumn === wrappingColumn); - const equalWrappingIndent = (this.wrappingIndent === wrappingIndent); - if (equalFontInfo && equalWrappingStrategy && equalWrappingColumn && equalWrappingIndent) { - return false; - } - const onlyWrappingColumnChanged = (equalFontInfo && equalWrappingStrategy && !equalWrappingColumn && equalWrappingIndent); - this.fontInfo = fontInfo; - this.wrappingStrategy = wrappingStrategy; - this.wrappingColumn = wrappingColumn; - this.wrappingIndent = wrappingIndent; - let previousLineBreaks = null; - if (onlyWrappingColumnChanged) { - previousLineBreaks = []; - for (let i = 0, len = this.lines.length; i < len; i++) { - previousLineBreaks[i] = this.lines[i].getLineBreakData(); - } - } - this._constructLines(/*resetHiddenAreas*/ false, previousLineBreaks); - return true; - } - createLineBreaksComputer() { - const lineBreaksComputerFactory = (this.wrappingStrategy === 'advanced' - ? this._domLineBreaksComputerFactory - : this._monospaceLineBreaksComputerFactory); - return lineBreaksComputerFactory.createLineBreaksComputer(this.fontInfo, this.tabSize, this.wrappingColumn, this.wrappingIndent); - } - onModelFlushed() { - this._constructLines(/*resetHiddenAreas*/ true, null); - } - onModelLinesDeleted(versionId, fromLineNumber, toLineNumber) { - if (versionId <= this._validModelVersionId) { - // Here we check for versionId in case the lines were reconstructed in the meantime. - // We don't want to apply stale change events on top of a newer read model state. - return null; - } - let outputFromLineNumber = (fromLineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(fromLineNumber - 2) + 1); - let outputToLineNumber = this.prefixSumComputer.getAccumulatedValue(toLineNumber - 1); - this.lines.splice(fromLineNumber - 1, toLineNumber - fromLineNumber + 1); - this.prefixSumComputer.removeValues(fromLineNumber - 1, toLineNumber - fromLineNumber + 1); - return new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_4__["ViewLinesDeletedEvent"](outputFromLineNumber, outputToLineNumber); - } - onModelLinesInserted(versionId, fromLineNumber, _toLineNumber, lineBreaks) { - if (versionId <= this._validModelVersionId) { - // Here we check for versionId in case the lines were reconstructed in the meantime. - // We don't want to apply stale change events on top of a newer read model state. - return null; - } - let hiddenAreas = this.getHiddenAreas(); - let isInHiddenArea = false; - let testPosition = new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](fromLineNumber, 1); - for (const hiddenArea of hiddenAreas) { - if (hiddenArea.containsPosition(testPosition)) { - isInHiddenArea = true; - break; - } - } - let outputFromLineNumber = (fromLineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(fromLineNumber - 2) + 1); - let totalOutputLineCount = 0; - let insertLines = []; - let insertPrefixSumValues = []; - for (let i = 0, len = lineBreaks.length; i < len; i++) { - let line = createSplitLine(lineBreaks[i], !isInHiddenArea); - insertLines.push(line); - let outputLineCount = line.getViewLineCount(); - totalOutputLineCount += outputLineCount; - insertPrefixSumValues[i] = outputLineCount; - } - // TODO@Alex: use arrays.arrayInsert - this.lines = this.lines.slice(0, fromLineNumber - 1).concat(insertLines).concat(this.lines.slice(fromLineNumber - 1)); - this.prefixSumComputer.insertValues(fromLineNumber - 1, insertPrefixSumValues); - return new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_4__["ViewLinesInsertedEvent"](outputFromLineNumber, outputFromLineNumber + totalOutputLineCount - 1); - } - onModelLineChanged(versionId, lineNumber, lineBreakData) { - if (versionId <= this._validModelVersionId) { - // Here we check for versionId in case the lines were reconstructed in the meantime. - // We don't want to apply stale change events on top of a newer read model state. - return [false, null, null, null]; - } - let lineIndex = lineNumber - 1; - let oldOutputLineCount = this.lines[lineIndex].getViewLineCount(); - let isVisible = this.lines[lineIndex].isVisible(); - let line = createSplitLine(lineBreakData, isVisible); - this.lines[lineIndex] = line; - let newOutputLineCount = this.lines[lineIndex].getViewLineCount(); - let lineMappingChanged = false; - let changeFrom = 0; - let changeTo = -1; - let insertFrom = 0; - let insertTo = -1; - let deleteFrom = 0; - let deleteTo = -1; - if (oldOutputLineCount > newOutputLineCount) { - changeFrom = (lineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(lineNumber - 2) + 1); - changeTo = changeFrom + newOutputLineCount - 1; - deleteFrom = changeTo + 1; - deleteTo = deleteFrom + (oldOutputLineCount - newOutputLineCount) - 1; - lineMappingChanged = true; - } - else if (oldOutputLineCount < newOutputLineCount) { - changeFrom = (lineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(lineNumber - 2) + 1); - changeTo = changeFrom + oldOutputLineCount - 1; - insertFrom = changeTo + 1; - insertTo = insertFrom + (newOutputLineCount - oldOutputLineCount) - 1; - lineMappingChanged = true; - } - else { - changeFrom = (lineNumber === 1 ? 1 : this.prefixSumComputer.getAccumulatedValue(lineNumber - 2) + 1); - changeTo = changeFrom + newOutputLineCount - 1; - } - this.prefixSumComputer.changeValue(lineIndex, newOutputLineCount); - const viewLinesChangedEvent = (changeFrom <= changeTo ? new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_4__["ViewLinesChangedEvent"](changeFrom, changeTo) : null); - const viewLinesInsertedEvent = (insertFrom <= insertTo ? new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_4__["ViewLinesInsertedEvent"](insertFrom, insertTo) : null); - const viewLinesDeletedEvent = (deleteFrom <= deleteTo ? new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_4__["ViewLinesDeletedEvent"](deleteFrom, deleteTo) : null); - return [lineMappingChanged, viewLinesChangedEvent, viewLinesInsertedEvent, viewLinesDeletedEvent]; - } - acceptVersionId(versionId) { - this._validModelVersionId = versionId; - if (this.lines.length === 1 && !this.lines[0].isVisible()) { - // At least one line must be visible => reset hidden areas - this.setHiddenAreas([]); - } - } - getViewLineCount() { - return this.prefixSumComputer.getTotalValue(); - } - _toValidViewLineNumber(viewLineNumber) { - if (viewLineNumber < 1) { - return 1; - } - const viewLineCount = this.getViewLineCount(); - if (viewLineNumber > viewLineCount) { - return viewLineCount; - } - return viewLineNumber | 0; - } - getActiveIndentGuide(viewLineNumber, minLineNumber, maxLineNumber) { - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - minLineNumber = this._toValidViewLineNumber(minLineNumber); - maxLineNumber = this._toValidViewLineNumber(maxLineNumber); - const modelPosition = this.convertViewPositionToModelPosition(viewLineNumber, this.getViewLineMinColumn(viewLineNumber)); - const modelMinPosition = this.convertViewPositionToModelPosition(minLineNumber, this.getViewLineMinColumn(minLineNumber)); - const modelMaxPosition = this.convertViewPositionToModelPosition(maxLineNumber, this.getViewLineMinColumn(maxLineNumber)); - const result = this.model.getActiveIndentGuide(modelPosition.lineNumber, modelMinPosition.lineNumber, modelMaxPosition.lineNumber); - const viewStartPosition = this.convertModelPositionToViewPosition(result.startLineNumber, 1); - const viewEndPosition = this.convertModelPositionToViewPosition(result.endLineNumber, this.model.getLineMaxColumn(result.endLineNumber)); - return { - startLineNumber: viewStartPosition.lineNumber, - endLineNumber: viewEndPosition.lineNumber, - indent: result.indent - }; - } - getViewLinesIndentGuides(viewStartLineNumber, viewEndLineNumber) { - viewStartLineNumber = this._toValidViewLineNumber(viewStartLineNumber); - viewEndLineNumber = this._toValidViewLineNumber(viewEndLineNumber); - const modelStart = this.convertViewPositionToModelPosition(viewStartLineNumber, this.getViewLineMinColumn(viewStartLineNumber)); - const modelEnd = this.convertViewPositionToModelPosition(viewEndLineNumber, this.getViewLineMaxColumn(viewEndLineNumber)); - let result = []; - let resultRepeatCount = []; - let resultRepeatOption = []; - const modelStartLineIndex = modelStart.lineNumber - 1; - const modelEndLineIndex = modelEnd.lineNumber - 1; - let reqStart = null; - for (let modelLineIndex = modelStartLineIndex; modelLineIndex <= modelEndLineIndex; modelLineIndex++) { - const line = this.lines[modelLineIndex]; - if (line.isVisible()) { - let viewLineStartIndex = line.getViewLineNumberOfModelPosition(0, modelLineIndex === modelStartLineIndex ? modelStart.column : 1); - let viewLineEndIndex = line.getViewLineNumberOfModelPosition(0, this.model.getLineMaxColumn(modelLineIndex + 1)); - let count = viewLineEndIndex - viewLineStartIndex + 1; - let option = 0 /* BlockNone */; - if (count > 1 && line.getViewLineMinColumn(this.model, modelLineIndex + 1, viewLineEndIndex) === 1) { - // wrapped lines should block indent guides - option = (viewLineStartIndex === 0 ? 1 /* BlockSubsequent */ : 2 /* BlockAll */); - } - resultRepeatCount.push(count); - resultRepeatOption.push(option); - // merge into previous request - if (reqStart === null) { - reqStart = new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](modelLineIndex + 1, 0); - } - } - else { - // hit invisible line => flush request - if (reqStart !== null) { - result = result.concat(this.model.getLinesIndentGuides(reqStart.lineNumber, modelLineIndex)); - reqStart = null; - } - } - } - if (reqStart !== null) { - result = result.concat(this.model.getLinesIndentGuides(reqStart.lineNumber, modelEnd.lineNumber)); - reqStart = null; - } - const viewLineCount = viewEndLineNumber - viewStartLineNumber + 1; - let viewIndents = new Array(viewLineCount); - let currIndex = 0; - for (let i = 0, len = result.length; i < len; i++) { - let value = result[i]; - let count = Math.min(viewLineCount - currIndex, resultRepeatCount[i]); - let option = resultRepeatOption[i]; - let blockAtIndex; - if (option === 2 /* BlockAll */) { - blockAtIndex = 0; - } - else if (option === 1 /* BlockSubsequent */) { - blockAtIndex = 1; - } - else { - blockAtIndex = count; - } - for (let j = 0; j < count; j++) { - if (j === blockAtIndex) { - value = 0; - } - viewIndents[currIndex++] = value; - } - } - return viewIndents; - } - getViewLineContent(viewLineNumber) { - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - return this.lines[lineIndex].getViewLineContent(this.model, lineIndex + 1, remainder); - } - getViewLineLength(viewLineNumber) { - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - return this.lines[lineIndex].getViewLineLength(this.model, lineIndex + 1, remainder); - } - getViewLineMinColumn(viewLineNumber) { - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - return this.lines[lineIndex].getViewLineMinColumn(this.model, lineIndex + 1, remainder); - } - getViewLineMaxColumn(viewLineNumber) { - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - return this.lines[lineIndex].getViewLineMaxColumn(this.model, lineIndex + 1, remainder); - } - getViewLineData(viewLineNumber) { - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - return this.lines[lineIndex].getViewLineData(this.model, lineIndex + 1, remainder); - } - getViewLinesData(viewStartLineNumber, viewEndLineNumber, needed) { - viewStartLineNumber = this._toValidViewLineNumber(viewStartLineNumber); - viewEndLineNumber = this._toValidViewLineNumber(viewEndLineNumber); - let start = this.prefixSumComputer.getIndexOf(viewStartLineNumber - 1); - let viewLineNumber = viewStartLineNumber; - let startModelLineIndex = start.index; - let startRemainder = start.remainder; - let result = []; - for (let modelLineIndex = startModelLineIndex, len = this.model.getLineCount(); modelLineIndex < len; modelLineIndex++) { - let line = this.lines[modelLineIndex]; - if (!line.isVisible()) { - continue; - } - let fromViewLineIndex = (modelLineIndex === startModelLineIndex ? startRemainder : 0); - let remainingViewLineCount = line.getViewLineCount() - fromViewLineIndex; - let lastLine = false; - if (viewLineNumber + remainingViewLineCount > viewEndLineNumber) { - lastLine = true; - remainingViewLineCount = viewEndLineNumber - viewLineNumber + 1; - } - let toViewLineIndex = fromViewLineIndex + remainingViewLineCount; - line.getViewLinesData(this.model, modelLineIndex + 1, fromViewLineIndex, toViewLineIndex, viewLineNumber - viewStartLineNumber, needed, result); - viewLineNumber += remainingViewLineCount; - if (lastLine) { - break; - } - } - return result; - } - validateViewPosition(viewLineNumber, viewColumn, expectedModelPosition) { - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - let line = this.lines[lineIndex]; - let minColumn = line.getViewLineMinColumn(this.model, lineIndex + 1, remainder); - let maxColumn = line.getViewLineMaxColumn(this.model, lineIndex + 1, remainder); - if (viewColumn < minColumn) { - viewColumn = minColumn; - } - if (viewColumn > maxColumn) { - viewColumn = maxColumn; - } - let computedModelColumn = line.getModelColumnOfViewPosition(remainder, viewColumn); - let computedModelPosition = this.model.validatePosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](lineIndex + 1, computedModelColumn)); - if (computedModelPosition.equals(expectedModelPosition)) { - return new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](viewLineNumber, viewColumn); - } - return this.convertModelPositionToViewPosition(expectedModelPosition.lineNumber, expectedModelPosition.column); - } - validateViewRange(viewRange, expectedModelRange) { - const validViewStart = this.validateViewPosition(viewRange.startLineNumber, viewRange.startColumn, expectedModelRange.getStartPosition()); - const validViewEnd = this.validateViewPosition(viewRange.endLineNumber, viewRange.endColumn, expectedModelRange.getEndPosition()); - return new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](validViewStart.lineNumber, validViewStart.column, validViewEnd.lineNumber, validViewEnd.column); - } - convertViewPositionToModelPosition(viewLineNumber, viewColumn) { - viewLineNumber = this._toValidViewLineNumber(viewLineNumber); - let r = this.prefixSumComputer.getIndexOf(viewLineNumber - 1); - let lineIndex = r.index; - let remainder = r.remainder; - let inputColumn = this.lines[lineIndex].getModelColumnOfViewPosition(remainder, viewColumn); - // console.log('out -> in ' + viewLineNumber + ',' + viewColumn + ' ===> ' + (lineIndex+1) + ',' + inputColumn); - return this.model.validatePosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](lineIndex + 1, inputColumn)); - } - convertViewRangeToModelRange(viewRange) { - const start = this.convertViewPositionToModelPosition(viewRange.startLineNumber, viewRange.startColumn); - const end = this.convertViewPositionToModelPosition(viewRange.endLineNumber, viewRange.endColumn); - return new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](start.lineNumber, start.column, end.lineNumber, end.column); - } - convertModelPositionToViewPosition(_modelLineNumber, _modelColumn) { - const validPosition = this.model.validatePosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](_modelLineNumber, _modelColumn)); - const inputLineNumber = validPosition.lineNumber; - const inputColumn = validPosition.column; - let lineIndex = inputLineNumber - 1, lineIndexChanged = false; - while (lineIndex > 0 && !this.lines[lineIndex].isVisible()) { - lineIndex--; - lineIndexChanged = true; - } - if (lineIndex === 0 && !this.lines[lineIndex].isVisible()) { - // Could not reach a real line - // console.log('in -> out ' + inputLineNumber + ',' + inputColumn + ' ===> ' + 1 + ',' + 1); - return new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](1, 1); - } - const deltaLineNumber = 1 + (lineIndex === 0 ? 0 : this.prefixSumComputer.getAccumulatedValue(lineIndex - 1)); - let r; - if (lineIndexChanged) { - r = this.lines[lineIndex].getViewPositionOfModelPosition(deltaLineNumber, this.model.getLineMaxColumn(lineIndex + 1)); - } - else { - r = this.lines[inputLineNumber - 1].getViewPositionOfModelPosition(deltaLineNumber, inputColumn); - } - // console.log('in -> out ' + inputLineNumber + ',' + inputColumn + ' ===> ' + r.lineNumber + ',' + r); - return r; - } - convertModelRangeToViewRange(modelRange) { - let start = this.convertModelPositionToViewPosition(modelRange.startLineNumber, modelRange.startColumn); - let end = this.convertModelPositionToViewPosition(modelRange.endLineNumber, modelRange.endColumn); - if (modelRange.startLineNumber === modelRange.endLineNumber && start.lineNumber !== end.lineNumber) { - // This is a single line range that ends up taking more lines due to wrapping - if (end.column === this.getViewLineMinColumn(end.lineNumber)) { - // the end column lands on the first column of the next line - return new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](start.lineNumber, start.column, end.lineNumber - 1, this.getViewLineMaxColumn(end.lineNumber - 1)); - } - } - return new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](start.lineNumber, start.column, end.lineNumber, end.column); - } - _getViewLineNumberForModelPosition(inputLineNumber, inputColumn) { - let lineIndex = inputLineNumber - 1; - if (this.lines[lineIndex].isVisible()) { - // this model line is visible - const deltaLineNumber = 1 + (lineIndex === 0 ? 0 : this.prefixSumComputer.getAccumulatedValue(lineIndex - 1)); - return this.lines[lineIndex].getViewLineNumberOfModelPosition(deltaLineNumber, inputColumn); - } - // this model line is not visible - while (lineIndex > 0 && !this.lines[lineIndex].isVisible()) { - lineIndex--; - } - if (lineIndex === 0 && !this.lines[lineIndex].isVisible()) { - // Could not reach a real line - return 1; - } - const deltaLineNumber = 1 + (lineIndex === 0 ? 0 : this.prefixSumComputer.getAccumulatedValue(lineIndex - 1)); - return this.lines[lineIndex].getViewLineNumberOfModelPosition(deltaLineNumber, this.model.getLineMaxColumn(lineIndex + 1)); - } - getAllOverviewRulerDecorations(ownerId, filterOutValidation, theme) { - const decorations = this.model.getOverviewRulerDecorations(ownerId, filterOutValidation); - const result = new OverviewRulerDecorations(); - for (const decoration of decorations) { - const opts = decoration.options.overviewRuler; - const lane = opts ? opts.position : 0; - if (lane === 0) { - continue; - } - const color = opts.getColor(theme); - const viewStartLineNumber = this._getViewLineNumberForModelPosition(decoration.range.startLineNumber, decoration.range.startColumn); - const viewEndLineNumber = this._getViewLineNumberForModelPosition(decoration.range.endLineNumber, decoration.range.endColumn); - result.accept(color, viewStartLineNumber, viewEndLineNumber, lane); - } - return result.result; - } - getDecorationsInRange(range, ownerId, filterOutValidation) { - const modelStart = this.convertViewPositionToModelPosition(range.startLineNumber, range.startColumn); - const modelEnd = this.convertViewPositionToModelPosition(range.endLineNumber, range.endColumn); - if (modelEnd.lineNumber - modelStart.lineNumber <= range.endLineNumber - range.startLineNumber) { - // most likely there are no hidden lines => fast path - // fetch decorations from column 1 to cover the case of wrapped lines that have whole line decorations at column 1 - return this.model.getDecorationsInRange(new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](modelStart.lineNumber, 1, modelEnd.lineNumber, modelEnd.column), ownerId, filterOutValidation); - } - let result = []; - const modelStartLineIndex = modelStart.lineNumber - 1; - const modelEndLineIndex = modelEnd.lineNumber - 1; - let reqStart = null; - for (let modelLineIndex = modelStartLineIndex; modelLineIndex <= modelEndLineIndex; modelLineIndex++) { - const line = this.lines[modelLineIndex]; - if (line.isVisible()) { - // merge into previous request - if (reqStart === null) { - reqStart = new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](modelLineIndex + 1, modelLineIndex === modelStartLineIndex ? modelStart.column : 1); - } - } - else { - // hit invisible line => flush request - if (reqStart !== null) { - const maxLineColumn = this.model.getLineMaxColumn(modelLineIndex); - result = result.concat(this.model.getDecorationsInRange(new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](reqStart.lineNumber, reqStart.column, modelLineIndex, maxLineColumn), ownerId, filterOutValidation)); - reqStart = null; - } - } - } - if (reqStart !== null) { - result = result.concat(this.model.getDecorationsInRange(new _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](reqStart.lineNumber, reqStart.column, modelEnd.lineNumber, modelEnd.column), ownerId, filterOutValidation)); - reqStart = null; - } - result.sort((a, b) => { - const res = _core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].compareRangesUsingStarts(a.range, b.range); - if (res === 0) { - if (a.id < b.id) { - return -1; - } - if (a.id > b.id) { - return 1; - } - return 0; - } - return res; - }); - // Eliminate duplicate decorations that might have intersected our visible ranges multiple times - let finalResult = [], finalResultLen = 0; - let prevDecId = null; - for (const dec of result) { - const decId = dec.id; - if (prevDecId === decId) { - // skip - continue; - } - prevDecId = decId; - finalResult[finalResultLen++] = dec; - } - return finalResult; - } -} -class VisibleIdentitySplitLine { - constructor() { } - isVisible() { - return true; - } - setVisible(isVisible) { - if (isVisible) { - return this; - } - return InvisibleIdentitySplitLine.INSTANCE; - } - getLineBreakData() { - return null; - } - getViewLineCount() { - return 1; - } - getViewLineContent(model, modelLineNumber, _outputLineIndex) { - return model.getLineContent(modelLineNumber); - } - getViewLineLength(model, modelLineNumber, _outputLineIndex) { - return model.getLineLength(modelLineNumber); - } - getViewLineMinColumn(model, modelLineNumber, _outputLineIndex) { - return model.getLineMinColumn(modelLineNumber); - } - getViewLineMaxColumn(model, modelLineNumber, _outputLineIndex) { - return model.getLineMaxColumn(modelLineNumber); - } - getViewLineData(model, modelLineNumber, _outputLineIndex) { - let lineTokens = model.getLineTokens(modelLineNumber); - let lineContent = lineTokens.getLineContent(); - return new _viewModel_js__WEBPACK_IMPORTED_MODULE_6__["ViewLineData"](lineContent, false, 1, lineContent.length + 1, 0, lineTokens.inflate()); - } - getViewLinesData(model, modelLineNumber, _fromOuputLineIndex, _toOutputLineIndex, globalStartIndex, needed, result) { - if (!needed[globalStartIndex]) { - result[globalStartIndex] = null; - return; - } - result[globalStartIndex] = this.getViewLineData(model, modelLineNumber, 0); - } - getModelColumnOfViewPosition(_outputLineIndex, outputColumn) { - return outputColumn; - } - getViewPositionOfModelPosition(deltaLineNumber, inputColumn) { - return new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](deltaLineNumber, inputColumn); - } - getViewLineNumberOfModelPosition(deltaLineNumber, _inputColumn) { - return deltaLineNumber; - } -} -VisibleIdentitySplitLine.INSTANCE = new VisibleIdentitySplitLine(); -class InvisibleIdentitySplitLine { - constructor() { } - isVisible() { - return false; - } - setVisible(isVisible) { - if (!isVisible) { - return this; - } - return VisibleIdentitySplitLine.INSTANCE; - } - getLineBreakData() { - return null; - } - getViewLineCount() { - return 0; - } - getViewLineContent(_model, _modelLineNumber, _outputLineIndex) { - throw new Error('Not supported'); - } - getViewLineLength(_model, _modelLineNumber, _outputLineIndex) { - throw new Error('Not supported'); - } - getViewLineMinColumn(_model, _modelLineNumber, _outputLineIndex) { - throw new Error('Not supported'); - } - getViewLineMaxColumn(_model, _modelLineNumber, _outputLineIndex) { - throw new Error('Not supported'); - } - getViewLineData(_model, _modelLineNumber, _outputLineIndex) { - throw new Error('Not supported'); - } - getViewLinesData(_model, _modelLineNumber, _fromOuputLineIndex, _toOutputLineIndex, _globalStartIndex, _needed, _result) { - throw new Error('Not supported'); - } - getModelColumnOfViewPosition(_outputLineIndex, _outputColumn) { - throw new Error('Not supported'); - } - getViewPositionOfModelPosition(_deltaLineNumber, _inputColumn) { - throw new Error('Not supported'); - } - getViewLineNumberOfModelPosition(_deltaLineNumber, _inputColumn) { - throw new Error('Not supported'); - } -} -InvisibleIdentitySplitLine.INSTANCE = new InvisibleIdentitySplitLine(); -class SplitLine { - constructor(lineBreakData, isVisible) { - this._lineBreakData = lineBreakData; - this._isVisible = isVisible; - } - isVisible() { - return this._isVisible; - } - setVisible(isVisible) { - this._isVisible = isVisible; - return this; - } - getLineBreakData() { - return this._lineBreakData; - } - getViewLineCount() { - if (!this._isVisible) { - return 0; - } - return this._lineBreakData.breakOffsets.length; - } - getInputStartOffsetOfOutputLineIndex(outputLineIndex) { - return LineBreakData.getInputOffsetOfOutputPosition(this._lineBreakData.breakOffsets, outputLineIndex, 0); - } - getInputEndOffsetOfOutputLineIndex(model, modelLineNumber, outputLineIndex) { - if (outputLineIndex + 1 === this._lineBreakData.breakOffsets.length) { - return model.getLineMaxColumn(modelLineNumber) - 1; - } - return LineBreakData.getInputOffsetOfOutputPosition(this._lineBreakData.breakOffsets, outputLineIndex + 1, 0); - } - getViewLineContent(model, modelLineNumber, outputLineIndex) { - if (!this._isVisible) { - throw new Error('Not supported'); - } - let startOffset = this.getInputStartOffsetOfOutputLineIndex(outputLineIndex); - let endOffset = this.getInputEndOffsetOfOutputLineIndex(model, modelLineNumber, outputLineIndex); - let r = model.getValueInRange({ - startLineNumber: modelLineNumber, - startColumn: startOffset + 1, - endLineNumber: modelLineNumber, - endColumn: endOffset + 1 - }); - if (outputLineIndex > 0) { - r = spaces(this._lineBreakData.wrappedTextIndentLength) + r; - } - return r; - } - getViewLineLength(model, modelLineNumber, outputLineIndex) { - if (!this._isVisible) { - throw new Error('Not supported'); - } - let startOffset = this.getInputStartOffsetOfOutputLineIndex(outputLineIndex); - let endOffset = this.getInputEndOffsetOfOutputLineIndex(model, modelLineNumber, outputLineIndex); - let r = endOffset - startOffset; - if (outputLineIndex > 0) { - r = this._lineBreakData.wrappedTextIndentLength + r; - } - return r; - } - getViewLineMinColumn(_model, _modelLineNumber, outputLineIndex) { - if (!this._isVisible) { - throw new Error('Not supported'); - } - if (outputLineIndex > 0) { - return this._lineBreakData.wrappedTextIndentLength + 1; - } - return 1; - } - getViewLineMaxColumn(model, modelLineNumber, outputLineIndex) { - if (!this._isVisible) { - throw new Error('Not supported'); - } - return this.getViewLineContent(model, modelLineNumber, outputLineIndex).length + 1; - } - getViewLineData(model, modelLineNumber, outputLineIndex) { - if (!this._isVisible) { - throw new Error('Not supported'); - } - let startOffset = this.getInputStartOffsetOfOutputLineIndex(outputLineIndex); - let endOffset = this.getInputEndOffsetOfOutputLineIndex(model, modelLineNumber, outputLineIndex); - let lineContent = model.getValueInRange({ - startLineNumber: modelLineNumber, - startColumn: startOffset + 1, - endLineNumber: modelLineNumber, - endColumn: endOffset + 1 - }); - if (outputLineIndex > 0) { - lineContent = spaces(this._lineBreakData.wrappedTextIndentLength) + lineContent; - } - let minColumn = (outputLineIndex > 0 ? this._lineBreakData.wrappedTextIndentLength + 1 : 1); - let maxColumn = lineContent.length + 1; - let continuesWithWrappedLine = (outputLineIndex + 1 < this.getViewLineCount()); - let deltaStartIndex = 0; - if (outputLineIndex > 0) { - deltaStartIndex = this._lineBreakData.wrappedTextIndentLength; - } - let lineTokens = model.getLineTokens(modelLineNumber); - const startVisibleColumn = (outputLineIndex === 0 ? 0 : this._lineBreakData.breakOffsetsVisibleColumn[outputLineIndex - 1]); - return new _viewModel_js__WEBPACK_IMPORTED_MODULE_6__["ViewLineData"](lineContent, continuesWithWrappedLine, minColumn, maxColumn, startVisibleColumn, lineTokens.sliceAndInflate(startOffset, endOffset, deltaStartIndex)); - } - getViewLinesData(model, modelLineNumber, fromOuputLineIndex, toOutputLineIndex, globalStartIndex, needed, result) { - if (!this._isVisible) { - throw new Error('Not supported'); - } - for (let outputLineIndex = fromOuputLineIndex; outputLineIndex < toOutputLineIndex; outputLineIndex++) { - let globalIndex = globalStartIndex + outputLineIndex - fromOuputLineIndex; - if (!needed[globalIndex]) { - result[globalIndex] = null; - continue; - } - result[globalIndex] = this.getViewLineData(model, modelLineNumber, outputLineIndex); - } - } - getModelColumnOfViewPosition(outputLineIndex, outputColumn) { - if (!this._isVisible) { - throw new Error('Not supported'); - } - let adjustedColumn = outputColumn - 1; - if (outputLineIndex > 0) { - if (adjustedColumn < this._lineBreakData.wrappedTextIndentLength) { - adjustedColumn = 0; - } - else { - adjustedColumn -= this._lineBreakData.wrappedTextIndentLength; - } - } - return LineBreakData.getInputOffsetOfOutputPosition(this._lineBreakData.breakOffsets, outputLineIndex, adjustedColumn) + 1; - } - getViewPositionOfModelPosition(deltaLineNumber, inputColumn) { - if (!this._isVisible) { - throw new Error('Not supported'); - } - let r = LineBreakData.getOutputPositionOfInputOffset(this._lineBreakData.breakOffsets, inputColumn - 1); - let outputLineIndex = r.outputLineIndex; - let outputColumn = r.outputOffset + 1; - if (outputLineIndex > 0) { - outputColumn += this._lineBreakData.wrappedTextIndentLength; - } - // console.log('in -> out ' + deltaLineNumber + ',' + inputColumn + ' ===> ' + (deltaLineNumber+outputLineIndex) + ',' + outputColumn); - return new _core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](deltaLineNumber + outputLineIndex, outputColumn); - } - getViewLineNumberOfModelPosition(deltaLineNumber, inputColumn) { - if (!this._isVisible) { - throw new Error('Not supported'); - } - const r = LineBreakData.getOutputPositionOfInputOffset(this._lineBreakData.breakOffsets, inputColumn - 1); - return (deltaLineNumber + r.outputLineIndex); - } -} -let _spaces = ['']; -function spaces(count) { - if (count >= _spaces.length) { - for (let i = 1; i <= count; i++) { - _spaces[i] = _makeSpaces(i); - } - } - return _spaces[count]; -} -function _makeSpaces(count) { - return new Array(count + 1).join(' '); -} -function createSplitLine(lineBreakData, isVisible) { - if (lineBreakData === null) { - // No mapping needed - if (isVisible) { - return VisibleIdentitySplitLine.INSTANCE; - } - return InvisibleIdentitySplitLine.INSTANCE; - } - else { - return new SplitLine(lineBreakData, isVisible); - } -} -class IdentityCoordinatesConverter { - constructor(lines) { - this._lines = lines; - } - _validPosition(pos) { - return this._lines.model.validatePosition(pos); - } - _validRange(range) { - return this._lines.model.validateRange(range); - } - // View -> Model conversion and related methods - convertViewPositionToModelPosition(viewPosition) { - return this._validPosition(viewPosition); - } - convertViewRangeToModelRange(viewRange) { - return this._validRange(viewRange); - } - validateViewPosition(_viewPosition, expectedModelPosition) { - return this._validPosition(expectedModelPosition); - } - validateViewRange(_viewRange, expectedModelRange) { - return this._validRange(expectedModelRange); - } - // Model -> View conversion and related methods - convertModelPositionToViewPosition(modelPosition) { - return this._validPosition(modelPosition); - } - convertModelRangeToViewRange(modelRange) { - return this._validRange(modelRange); - } - modelPositionIsVisible(modelPosition) { - const lineCount = this._lines.model.getLineCount(); - if (modelPosition.lineNumber < 1 || modelPosition.lineNumber > lineCount) { - // invalid arguments - return false; - } - return true; - } -} -class IdentityLinesCollection { - constructor(model) { - this.model = model; - } - dispose() { - } - createCoordinatesConverter() { - return new IdentityCoordinatesConverter(this); - } - getHiddenAreas() { - return []; - } - setHiddenAreas(_ranges) { - return false; - } - setTabSize(_newTabSize) { - return false; - } - setWrappingSettings(_fontInfo, _wrappingStrategy, _wrappingColumn, _wrappingIndent) { - return false; - } - createLineBreaksComputer() { - let result = []; - return { - addRequest: (lineText, previousLineBreakData) => { - result.push(null); - }, - finalize: () => { - return result; - } - }; - } - onModelFlushed() { - } - onModelLinesDeleted(_versionId, fromLineNumber, toLineNumber) { - return new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_4__["ViewLinesDeletedEvent"](fromLineNumber, toLineNumber); - } - onModelLinesInserted(_versionId, fromLineNumber, toLineNumber, lineBreaks) { - return new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_4__["ViewLinesInsertedEvent"](fromLineNumber, toLineNumber); - } - onModelLineChanged(_versionId, lineNumber, lineBreakData) { - return [false, new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_4__["ViewLinesChangedEvent"](lineNumber, lineNumber), null, null]; - } - acceptVersionId(_versionId) { - } - getViewLineCount() { - return this.model.getLineCount(); - } - getActiveIndentGuide(viewLineNumber, _minLineNumber, _maxLineNumber) { - return { - startLineNumber: viewLineNumber, - endLineNumber: viewLineNumber, - indent: 0 - }; - } - getViewLinesIndentGuides(viewStartLineNumber, viewEndLineNumber) { - const viewLineCount = viewEndLineNumber - viewStartLineNumber + 1; - let result = new Array(viewLineCount); - for (let i = 0; i < viewLineCount; i++) { - result[i] = 0; - } - return result; - } - getViewLineContent(viewLineNumber) { - return this.model.getLineContent(viewLineNumber); - } - getViewLineLength(viewLineNumber) { - return this.model.getLineLength(viewLineNumber); - } - getViewLineMinColumn(viewLineNumber) { - return this.model.getLineMinColumn(viewLineNumber); - } - getViewLineMaxColumn(viewLineNumber) { - return this.model.getLineMaxColumn(viewLineNumber); - } - getViewLineData(viewLineNumber) { - let lineTokens = this.model.getLineTokens(viewLineNumber); - let lineContent = lineTokens.getLineContent(); - return new _viewModel_js__WEBPACK_IMPORTED_MODULE_6__["ViewLineData"](lineContent, false, 1, lineContent.length + 1, 0, lineTokens.inflate()); - } - getViewLinesData(viewStartLineNumber, viewEndLineNumber, needed) { - const lineCount = this.model.getLineCount(); - viewStartLineNumber = Math.min(Math.max(1, viewStartLineNumber), lineCount); - viewEndLineNumber = Math.min(Math.max(1, viewEndLineNumber), lineCount); - let result = []; - for (let lineNumber = viewStartLineNumber; lineNumber <= viewEndLineNumber; lineNumber++) { - let idx = lineNumber - viewStartLineNumber; - if (!needed[idx]) { - result[idx] = null; - } - result[idx] = this.getViewLineData(lineNumber); - } - return result; - } - getAllOverviewRulerDecorations(ownerId, filterOutValidation, theme) { - const decorations = this.model.getOverviewRulerDecorations(ownerId, filterOutValidation); - const result = new OverviewRulerDecorations(); - for (const decoration of decorations) { - const opts = decoration.options.overviewRuler; - const lane = opts ? opts.position : 0; - if (lane === 0) { - continue; - } - const color = opts.getColor(theme); - const viewStartLineNumber = decoration.range.startLineNumber; - const viewEndLineNumber = decoration.range.endLineNumber; - result.accept(color, viewStartLineNumber, viewEndLineNumber, lane); - } - return result.result; - } - getDecorationsInRange(range, ownerId, filterOutValidation) { - return this.model.getDecorationsInRange(range, ownerId, filterOutValidation); - } -} -class OverviewRulerDecorations { - constructor() { - this.result = Object.create(null); - } - accept(color, startLineNumber, endLineNumber, lane) { - let prev = this.result[color]; - if (prev) { - const prevLane = prev[prev.length - 3]; - const prevEndLineNumber = prev[prev.length - 1]; - if (prevLane === lane && prevEndLineNumber + 1 >= startLineNumber) { - // merge into prev - if (endLineNumber > prevEndLineNumber) { - prev[prev.length - 1] = endLineNumber; - } - return; - } - // push - prev.push(lane, startLineNumber, endLineNumber); - } - else { - this.result[color] = [lane, startLineNumber, endLineNumber]; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewEventHandler.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewEventHandler.js ***! - \***************************************************************************************/ -/*! exports provided: ViewEventHandler */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewEventHandler", function() { return ViewEventHandler; }); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class ViewEventHandler extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["Disposable"] { - constructor() { - super(); - this._shouldRender = true; - } - shouldRender() { - return this._shouldRender; - } - forceShouldRender() { - this._shouldRender = true; - } - setShouldRender() { - this._shouldRender = true; - } - onDidRender() { - this._shouldRender = false; - } - // --- begin event handlers - onConfigurationChanged(e) { - return false; - } - onCursorStateChanged(e) { - return false; - } - onDecorationsChanged(e) { - return false; - } - onFlushed(e) { - return false; - } - onFocusChanged(e) { - return false; - } - onLanguageConfigurationChanged(e) { - return false; - } - onLineMappingChanged(e) { - return false; - } - onLinesChanged(e) { - return false; - } - onLinesDeleted(e) { - return false; - } - onLinesInserted(e) { - return false; - } - onRevealRangeRequest(e) { - return false; - } - onScrollChanged(e) { - return false; - } - onThemeChanged(e) { - return false; - } - onTokensChanged(e) { - return false; - } - onTokensColorsChanged(e) { - return false; - } - onZonesChanged(e) { - return false; - } - // --- end event handlers - handleEvents(events) { - let shouldRender = false; - for (let i = 0, len = events.length; i < len; i++) { - let e = events[i]; - switch (e.type) { - case 0 /* ViewConfigurationChanged */: - if (this.onConfigurationChanged(e)) { - shouldRender = true; - } - break; - case 1 /* ViewCursorStateChanged */: - if (this.onCursorStateChanged(e)) { - shouldRender = true; - } - break; - case 2 /* ViewDecorationsChanged */: - if (this.onDecorationsChanged(e)) { - shouldRender = true; - } - break; - case 3 /* ViewFlushed */: - if (this.onFlushed(e)) { - shouldRender = true; - } - break; - case 4 /* ViewFocusChanged */: - if (this.onFocusChanged(e)) { - shouldRender = true; - } - break; - case 5 /* ViewLanguageConfigurationChanged */: - if (this.onLanguageConfigurationChanged(e)) { - shouldRender = true; - } - break; - case 6 /* ViewLineMappingChanged */: - if (this.onLineMappingChanged(e)) { - shouldRender = true; - } - break; - case 7 /* ViewLinesChanged */: - if (this.onLinesChanged(e)) { - shouldRender = true; - } - break; - case 8 /* ViewLinesDeleted */: - if (this.onLinesDeleted(e)) { - shouldRender = true; - } - break; - case 9 /* ViewLinesInserted */: - if (this.onLinesInserted(e)) { - shouldRender = true; - } - break; - case 10 /* ViewRevealRangeRequest */: - if (this.onRevealRangeRequest(e)) { - shouldRender = true; - } - break; - case 11 /* ViewScrollChanged */: - if (this.onScrollChanged(e)) { - shouldRender = true; - } - break; - case 13 /* ViewTokensChanged */: - if (this.onTokensChanged(e)) { - shouldRender = true; - } - break; - case 12 /* ViewThemeChanged */: - if (this.onThemeChanged(e)) { - shouldRender = true; - } - break; - case 14 /* ViewTokensColorsChanged */: - if (this.onTokensColorsChanged(e)) { - shouldRender = true; - } - break; - case 15 /* ViewZonesChanged */: - if (this.onZonesChanged(e)) { - shouldRender = true; - } - break; - default: - console.info('View received unknown event: '); - console.info(e); - } - } - if (shouldRender) { - this._shouldRender = true; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModel.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModel.js ***! - \********************************************************************************/ -/*! exports provided: Viewport, MinimapLinesRenderingData, ViewLineData, ViewLineRenderingData, InlineDecoration, ViewModelDecoration */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Viewport", function() { return Viewport; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinimapLinesRenderingData", function() { return MinimapLinesRenderingData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewLineData", function() { return ViewLineData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewLineRenderingData", function() { return ViewLineRenderingData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InlineDecoration", function() { return InlineDecoration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewModelDecoration", function() { return ViewModelDecoration; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class Viewport { - constructor(top, left, width, height) { - this.top = top | 0; - this.left = left | 0; - this.width = width | 0; - this.height = height | 0; - } -} -class MinimapLinesRenderingData { - constructor(tabSize, data) { - this.tabSize = tabSize; - this.data = data; - } -} -class ViewLineData { - constructor(content, continuesWithWrappedLine, minColumn, maxColumn, startVisibleColumn, tokens) { - this.content = content; - this.continuesWithWrappedLine = continuesWithWrappedLine; - this.minColumn = minColumn; - this.maxColumn = maxColumn; - this.startVisibleColumn = startVisibleColumn; - this.tokens = tokens; - } -} -class ViewLineRenderingData { - constructor(minColumn, maxColumn, content, continuesWithWrappedLine, mightContainRTL, mightContainNonBasicASCII, tokens, inlineDecorations, tabSize, startVisibleColumn) { - this.minColumn = minColumn; - this.maxColumn = maxColumn; - this.content = content; - this.continuesWithWrappedLine = continuesWithWrappedLine; - this.isBasicASCII = ViewLineRenderingData.isBasicASCII(content, mightContainNonBasicASCII); - this.containsRTL = ViewLineRenderingData.containsRTL(content, this.isBasicASCII, mightContainRTL); - this.tokens = tokens; - this.inlineDecorations = inlineDecorations; - this.tabSize = tabSize; - this.startVisibleColumn = startVisibleColumn; - } - static isBasicASCII(lineContent, mightContainNonBasicASCII) { - if (mightContainNonBasicASCII) { - return _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isBasicASCII"](lineContent); - } - return true; - } - static containsRTL(lineContent, isBasicASCII, mightContainRTL) { - if (!isBasicASCII && mightContainRTL) { - return _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["containsRTL"](lineContent); - } - return false; - } -} -class InlineDecoration { - constructor(range, inlineClassName, type) { - this.range = range; - this.inlineClassName = inlineClassName; - this.type = type; - } -} -class ViewModelDecoration { - constructor(range, options) { - this.range = range; - this.options = options; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelDecorations.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelDecorations.js ***! - \*******************************************************************************************/ -/*! exports provided: ViewModelDecorations */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewModelDecorations", function() { return ViewModelDecorations; }); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _viewModel_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./viewModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModel.js"); -/* harmony import */ var _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class ViewModelDecorations { - constructor(editorId, model, configuration, linesCollection, coordinatesConverter) { - this.editorId = editorId; - this.model = model; - this.configuration = configuration; - this._linesCollection = linesCollection; - this._coordinatesConverter = coordinatesConverter; - this._decorationsCache = Object.create(null); - this._cachedModelDecorationsResolver = null; - this._cachedModelDecorationsResolverViewRange = null; - } - _clearCachedModelDecorationsResolver() { - this._cachedModelDecorationsResolver = null; - this._cachedModelDecorationsResolverViewRange = null; - } - dispose() { - this._decorationsCache = Object.create(null); - this._clearCachedModelDecorationsResolver(); - } - reset() { - this._decorationsCache = Object.create(null); - this._clearCachedModelDecorationsResolver(); - } - onModelDecorationsChanged() { - this._decorationsCache = Object.create(null); - this._clearCachedModelDecorationsResolver(); - } - onLineMappingChanged() { - this._decorationsCache = Object.create(null); - this._clearCachedModelDecorationsResolver(); - } - _getOrCreateViewModelDecoration(modelDecoration) { - const id = modelDecoration.id; - let r = this._decorationsCache[id]; - if (!r) { - const modelRange = modelDecoration.range; - const options = modelDecoration.options; - let viewRange; - if (options.isWholeLine) { - const start = this._coordinatesConverter.convertModelPositionToViewPosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](modelRange.startLineNumber, 1)); - const end = this._coordinatesConverter.convertModelPositionToViewPosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](modelRange.endLineNumber, this.model.getLineMaxColumn(modelRange.endLineNumber))); - viewRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"](start.lineNumber, start.column, end.lineNumber, end.column); - } - else { - viewRange = this._coordinatesConverter.convertModelRangeToViewRange(modelRange); - } - r = new _viewModel_js__WEBPACK_IMPORTED_MODULE_2__["ViewModelDecoration"](viewRange, options); - this._decorationsCache[id] = r; - } - return r; - } - getDecorationsViewportData(viewRange) { - let cacheIsValid = (this._cachedModelDecorationsResolver !== null); - cacheIsValid = cacheIsValid && (viewRange.equalsRange(this._cachedModelDecorationsResolverViewRange)); - if (!cacheIsValid) { - this._cachedModelDecorationsResolver = this._getDecorationsViewportData(viewRange); - this._cachedModelDecorationsResolverViewRange = viewRange; - } - return this._cachedModelDecorationsResolver; - } - _getDecorationsViewportData(viewportRange) { - const modelDecorations = this._linesCollection.getDecorationsInRange(viewportRange, this.editorId, Object(_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_3__["filterValidationDecorations"])(this.configuration.options)); - const startLineNumber = viewportRange.startLineNumber; - const endLineNumber = viewportRange.endLineNumber; - let decorationsInViewport = [], decorationsInViewportLen = 0; - let inlineDecorations = []; - for (let j = startLineNumber; j <= endLineNumber; j++) { - inlineDecorations[j - startLineNumber] = []; - } - for (let i = 0, len = modelDecorations.length; i < len; i++) { - let modelDecoration = modelDecorations[i]; - let decorationOptions = modelDecoration.options; - let viewModelDecoration = this._getOrCreateViewModelDecoration(modelDecoration); - let viewRange = viewModelDecoration.range; - decorationsInViewport[decorationsInViewportLen++] = viewModelDecoration; - if (decorationOptions.inlineClassName) { - let inlineDecoration = new _viewModel_js__WEBPACK_IMPORTED_MODULE_2__["InlineDecoration"](viewRange, decorationOptions.inlineClassName, decorationOptions.inlineClassNameAffectsLetterSpacing ? 3 /* RegularAffectingLetterSpacing */ : 0 /* Regular */); - let intersectedStartLineNumber = Math.max(startLineNumber, viewRange.startLineNumber); - let intersectedEndLineNumber = Math.min(endLineNumber, viewRange.endLineNumber); - for (let j = intersectedStartLineNumber; j <= intersectedEndLineNumber; j++) { - inlineDecorations[j - startLineNumber].push(inlineDecoration); - } - } - if (decorationOptions.beforeContentClassName) { - if (startLineNumber <= viewRange.startLineNumber && viewRange.startLineNumber <= endLineNumber) { - let inlineDecoration = new _viewModel_js__WEBPACK_IMPORTED_MODULE_2__["InlineDecoration"](new _core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"](viewRange.startLineNumber, viewRange.startColumn, viewRange.startLineNumber, viewRange.startColumn), decorationOptions.beforeContentClassName, 1 /* Before */); - inlineDecorations[viewRange.startLineNumber - startLineNumber].push(inlineDecoration); - } - } - if (decorationOptions.afterContentClassName) { - if (startLineNumber <= viewRange.endLineNumber && viewRange.endLineNumber <= endLineNumber) { - let inlineDecoration = new _viewModel_js__WEBPACK_IMPORTED_MODULE_2__["InlineDecoration"](new _core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"](viewRange.endLineNumber, viewRange.endColumn, viewRange.endLineNumber, viewRange.endColumn), decorationOptions.afterContentClassName, 2 /* After */); - inlineDecorations[viewRange.endLineNumber - startLineNumber].push(inlineDecoration); - } - } - } - return { - decorations: decorationsInViewport, - inlineDecorations: inlineDecorations - }; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelEventDispatcher.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelEventDispatcher.js ***! - \***********************************************************************************************/ -/*! exports provided: ViewModelEventDispatcher, ViewModelEventsCollector, ContentSizeChangedEvent, FocusChangedEvent, ScrollChangedEvent, ViewZonesChangedEvent, CursorStateChangedEvent, ReadOnlyEditAttemptEvent */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewModelEventDispatcher", function() { return ViewModelEventDispatcher; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewModelEventsCollector", function() { return ViewModelEventsCollector; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentSizeChangedEvent", function() { return ContentSizeChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FocusChangedEvent", function() { return FocusChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollChangedEvent", function() { return ScrollChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewZonesChangedEvent", function() { return ViewZonesChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorStateChangedEvent", function() { return CursorStateChangedEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReadOnlyEditAttemptEvent", function() { return ReadOnlyEditAttemptEvent; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class ViewModelEventDispatcher extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor() { - super(); - this._onEvent = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this.onEvent = this._onEvent.event; - this._eventHandlers = []; - this._viewEventQueue = null; - this._isConsumingViewEventQueue = false; - this._collector = null; - this._collectorCnt = 0; - this._outgoingEvents = []; - } - emitOutgoingEvent(e) { - this._addOutgoingEvent(e); - this._emitOugoingEvents(); - } - _addOutgoingEvent(e) { - for (let i = 0, len = this._outgoingEvents.length; i < len; i++) { - if (this._outgoingEvents[i].kind === e.kind) { - this._outgoingEvents[i] = this._outgoingEvents[i].merge(e); - return; - } - } - // not merged - this._outgoingEvents.push(e); - } - _emitOugoingEvents() { - while (this._outgoingEvents.length > 0) { - if (this._collector || this._isConsumingViewEventQueue) { - // right now collecting or emitting view events, so let's postpone emitting - return; - } - const event = this._outgoingEvents.shift(); - if (event.isNoOp()) { - continue; - } - this._onEvent.fire(event); - } - } - addViewEventHandler(eventHandler) { - for (let i = 0, len = this._eventHandlers.length; i < len; i++) { - if (this._eventHandlers[i] === eventHandler) { - console.warn('Detected duplicate listener in ViewEventDispatcher', eventHandler); - } - } - this._eventHandlers.push(eventHandler); - } - removeViewEventHandler(eventHandler) { - for (let i = 0; i < this._eventHandlers.length; i++) { - if (this._eventHandlers[i] === eventHandler) { - this._eventHandlers.splice(i, 1); - break; - } - } - } - beginEmitViewEvents() { - this._collectorCnt++; - if (this._collectorCnt === 1) { - this._collector = new ViewModelEventsCollector(); - } - return this._collector; - } - endEmitViewEvents() { - this._collectorCnt--; - if (this._collectorCnt === 0) { - const outgoingEvents = this._collector.outgoingEvents; - const viewEvents = this._collector.viewEvents; - this._collector = null; - for (const outgoingEvent of outgoingEvents) { - this._addOutgoingEvent(outgoingEvent); - } - if (viewEvents.length > 0) { - this._emitMany(viewEvents); - } - } - this._emitOugoingEvents(); - } - emitSingleViewEvent(event) { - try { - const eventsCollector = this.beginEmitViewEvents(); - eventsCollector.emitViewEvent(event); - } - finally { - this.endEmitViewEvents(); - } - } - _emitMany(events) { - if (this._viewEventQueue) { - this._viewEventQueue = this._viewEventQueue.concat(events); - } - else { - this._viewEventQueue = events; - } - if (!this._isConsumingViewEventQueue) { - this._consumeViewEventQueue(); - } - } - _consumeViewEventQueue() { - try { - this._isConsumingViewEventQueue = true; - this._doConsumeQueue(); - } - finally { - this._isConsumingViewEventQueue = false; - } - } - _doConsumeQueue() { - while (this._viewEventQueue) { - // Empty event queue, as events might come in while sending these off - const events = this._viewEventQueue; - this._viewEventQueue = null; - // Use a clone of the event handlers list, as they might remove themselves - const eventHandlers = this._eventHandlers.slice(0); - for (const eventHandler of eventHandlers) { - eventHandler.handleEvents(events); - } - } - } -} -class ViewModelEventsCollector { - constructor() { - this.viewEvents = []; - this.outgoingEvents = []; - } - emitViewEvent(event) { - this.viewEvents.push(event); - } - emitOutgoingEvent(e) { - this.outgoingEvents.push(e); - } -} -class ContentSizeChangedEvent { - constructor(oldContentWidth, oldContentHeight, contentWidth, contentHeight) { - this.kind = 0 /* ContentSizeChanged */; - this._oldContentWidth = oldContentWidth; - this._oldContentHeight = oldContentHeight; - this.contentWidth = contentWidth; - this.contentHeight = contentHeight; - this.contentWidthChanged = (this._oldContentWidth !== this.contentWidth); - this.contentHeightChanged = (this._oldContentHeight !== this.contentHeight); - } - isNoOp() { - return (!this.contentWidthChanged && !this.contentHeightChanged); - } - merge(other) { - if (other.kind !== 0 /* ContentSizeChanged */) { - return this; - } - return new ContentSizeChangedEvent(this._oldContentWidth, this._oldContentHeight, other.contentWidth, other.contentHeight); - } -} -class FocusChangedEvent { - constructor(oldHasFocus, hasFocus) { - this.kind = 1 /* FocusChanged */; - this.oldHasFocus = oldHasFocus; - this.hasFocus = hasFocus; - } - isNoOp() { - return (this.oldHasFocus === this.hasFocus); - } - merge(other) { - if (other.kind !== 1 /* FocusChanged */) { - return this; - } - return new FocusChangedEvent(this.oldHasFocus, other.hasFocus); - } -} -class ScrollChangedEvent { - constructor(oldScrollWidth, oldScrollLeft, oldScrollHeight, oldScrollTop, scrollWidth, scrollLeft, scrollHeight, scrollTop) { - this.kind = 2 /* ScrollChanged */; - this._oldScrollWidth = oldScrollWidth; - this._oldScrollLeft = oldScrollLeft; - this._oldScrollHeight = oldScrollHeight; - this._oldScrollTop = oldScrollTop; - this.scrollWidth = scrollWidth; - this.scrollLeft = scrollLeft; - this.scrollHeight = scrollHeight; - this.scrollTop = scrollTop; - this.scrollWidthChanged = (this._oldScrollWidth !== this.scrollWidth); - this.scrollLeftChanged = (this._oldScrollLeft !== this.scrollLeft); - this.scrollHeightChanged = (this._oldScrollHeight !== this.scrollHeight); - this.scrollTopChanged = (this._oldScrollTop !== this.scrollTop); - } - isNoOp() { - return (!this.scrollWidthChanged && !this.scrollLeftChanged && !this.scrollHeightChanged && !this.scrollTopChanged); - } - merge(other) { - if (other.kind !== 2 /* ScrollChanged */) { - return this; - } - return new ScrollChangedEvent(this._oldScrollWidth, this._oldScrollLeft, this._oldScrollHeight, this._oldScrollTop, other.scrollWidth, other.scrollLeft, other.scrollHeight, other.scrollTop); - } -} -class ViewZonesChangedEvent { - constructor() { - this.kind = 3 /* ViewZonesChanged */; - } - isNoOp() { - return false; - } - merge(other) { - return this; - } -} -class CursorStateChangedEvent { - constructor(oldSelections, selections, oldModelVersionId, modelVersionId, source, reason, reachedMaxCursorCount) { - this.kind = 5 /* CursorStateChanged */; - this.oldSelections = oldSelections; - this.selections = selections; - this.oldModelVersionId = oldModelVersionId; - this.modelVersionId = modelVersionId; - this.source = source; - this.reason = reason; - this.reachedMaxCursorCount = reachedMaxCursorCount; - } - static _selectionsAreEqual(a, b) { - if (!a && !b) { - return true; - } - if (!a || !b) { - return false; - } - const aLen = a.length; - const bLen = b.length; - if (aLen !== bLen) { - return false; - } - for (let i = 0; i < aLen; i++) { - if (!a[i].equalsSelection(b[i])) { - return false; - } - } - return true; - } - isNoOp() { - return (CursorStateChangedEvent._selectionsAreEqual(this.oldSelections, this.selections) - && this.oldModelVersionId === this.modelVersionId); - } - merge(other) { - if (other.kind !== 5 /* CursorStateChanged */) { - return this; - } - return new CursorStateChangedEvent(this.oldSelections, other.selections, this.oldModelVersionId, other.modelVersionId, other.source, other.reason, this.reachedMaxCursorCount || other.reachedMaxCursorCount); - } -} -class ReadOnlyEditAttemptEvent { - constructor() { - this.kind = 4 /* ReadOnlyEditAttempt */; - } - isNoOp() { - return false; - } - merge(other) { - return this; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelImpl.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelImpl.js ***! - \************************************************************************************/ -/*! exports provided: ViewModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewModel", function() { return ViewModel; }); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _modes_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _modes_textToHtmlTokenizer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../modes/textToHtmlTokenizer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/textToHtmlTokenizer.js"); -/* harmony import */ var _minimapTokensColorTracker_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./minimapTokensColorTracker.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/minimapTokensColorTracker.js"); -/* harmony import */ var _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../view/viewEvents.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/viewEvents.js"); -/* harmony import */ var _viewLayout_viewLayout_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../viewLayout/viewLayout.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLayout.js"); -/* harmony import */ var _splitLinesCollection_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./splitLinesCollection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/splitLinesCollection.js"); -/* harmony import */ var _viewModel_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./viewModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModel.js"); -/* harmony import */ var _viewModelDecorations_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./viewModelDecorations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelDecorations.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _controller_cursor_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../controller/cursor.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursor.js"); -/* harmony import */ var _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../controller/cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _viewModelEventDispatcher_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./viewModelEventDispatcher.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelEventDispatcher.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - - - -const USE_IDENTITY_LINES_COLLECTION = true; -class ViewModel extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(editorId, configuration, model, domLineBreaksComputerFactory, monospaceLineBreaksComputerFactory, scheduleAtNextAnimationFrame) { - super(); - this._editorId = editorId; - this._configuration = configuration; - this.model = model; - this._eventDispatcher = new _viewModelEventDispatcher_js__WEBPACK_IMPORTED_MODULE_18__["ViewModelEventDispatcher"](); - this.onEvent = this._eventDispatcher.onEvent; - this.cursorConfig = new _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_17__["CursorConfiguration"](this.model.getLanguageIdentifier(), this.model.getOptions(), this._configuration); - this._tokenizeViewportSoon = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_14__["RunOnceScheduler"](() => this.tokenizeViewport(), 50)); - this._updateConfigurationViewLineCount = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_14__["RunOnceScheduler"](() => this._updateConfigurationViewLineCountNow(), 0)); - this._hasFocus = false; - this._viewportStartLine = -1; - this._viewportStartLineTrackedRange = null; - this._viewportStartLineDelta = 0; - if (USE_IDENTITY_LINES_COLLECTION && this.model.isTooLargeForTokenization()) { - this._lines = new _splitLinesCollection_js__WEBPACK_IMPORTED_MODULE_11__["IdentityLinesCollection"](this.model); - } - else { - const options = this._configuration.options; - const fontInfo = options.get(36 /* fontInfo */); - const wrappingStrategy = options.get(112 /* wrappingStrategy */); - const wrappingInfo = options.get(118 /* wrappingInfo */); - const wrappingIndent = options.get(111 /* wrappingIndent */); - this._lines = new _splitLinesCollection_js__WEBPACK_IMPORTED_MODULE_11__["SplitLinesCollection"](this.model, domLineBreaksComputerFactory, monospaceLineBreaksComputerFactory, fontInfo, this.model.getOptions().tabSize, wrappingStrategy, wrappingInfo.wrappingColumn, wrappingIndent); - } - this.coordinatesConverter = this._lines.createCoordinatesConverter(); - this._cursor = this._register(new _controller_cursor_js__WEBPACK_IMPORTED_MODULE_16__["Cursor"](model, this, this.coordinatesConverter, this.cursorConfig)); - this.viewLayout = this._register(new _viewLayout_viewLayout_js__WEBPACK_IMPORTED_MODULE_10__["ViewLayout"](this._configuration, this.getLineCount(), scheduleAtNextAnimationFrame)); - this._register(this.viewLayout.onDidScroll((e) => { - if (e.scrollTopChanged) { - this._tokenizeViewportSoon.schedule(); - } - this._eventDispatcher.emitSingleViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewScrollChangedEvent"](e)); - this._eventDispatcher.emitOutgoingEvent(new _viewModelEventDispatcher_js__WEBPACK_IMPORTED_MODULE_18__["ScrollChangedEvent"](e.oldScrollWidth, e.oldScrollLeft, e.oldScrollHeight, e.oldScrollTop, e.scrollWidth, e.scrollLeft, e.scrollHeight, e.scrollTop)); - })); - this._register(this.viewLayout.onDidContentSizeChange((e) => { - this._eventDispatcher.emitOutgoingEvent(e); - })); - this._decorations = new _viewModelDecorations_js__WEBPACK_IMPORTED_MODULE_13__["ViewModelDecorations"](this._editorId, this.model, this._configuration, this._lines, this.coordinatesConverter); - this._registerModelEvents(); - this._register(this._configuration.onDidChangeFast((e) => { - try { - const eventsCollector = this._eventDispatcher.beginEmitViewEvents(); - this._onConfigurationChanged(eventsCollector, e); - } - finally { - this._eventDispatcher.endEmitViewEvents(); - } - })); - this._register(_minimapTokensColorTracker_js__WEBPACK_IMPORTED_MODULE_8__["MinimapTokensColorTracker"].getInstance().onDidChange(() => { - this._eventDispatcher.emitSingleViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewTokensColorsChangedEvent"]()); - })); - this._updateConfigurationViewLineCountNow(); - } - dispose() { - // First remove listeners, as disposing the lines might end up sending - // model decoration changed events ... and we no longer care about them ... - super.dispose(); - this._decorations.dispose(); - this._lines.dispose(); - this.invalidateMinimapColorCache(); - this._viewportStartLineTrackedRange = this.model._setTrackedRange(this._viewportStartLineTrackedRange, null, 1 /* NeverGrowsWhenTypingAtEdges */); - this._eventDispatcher.dispose(); - } - addViewEventHandler(eventHandler) { - this._eventDispatcher.addViewEventHandler(eventHandler); - } - removeViewEventHandler(eventHandler) { - this._eventDispatcher.removeViewEventHandler(eventHandler); - } - _updateConfigurationViewLineCountNow() { - this._configuration.setViewLineCount(this._lines.getViewLineCount()); - } - tokenizeViewport() { - const linesViewportData = this.viewLayout.getLinesViewportData(); - const startPosition = this.coordinatesConverter.convertViewPositionToModelPosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](linesViewportData.startLineNumber, 1)); - const endPosition = this.coordinatesConverter.convertViewPositionToModelPosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](linesViewportData.endLineNumber, 1)); - this.model.tokenizeViewport(startPosition.lineNumber, endPosition.lineNumber); - } - setHasFocus(hasFocus) { - this._hasFocus = hasFocus; - this._cursor.setHasFocus(hasFocus); - this._eventDispatcher.emitSingleViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewFocusChangedEvent"](hasFocus)); - this._eventDispatcher.emitOutgoingEvent(new _viewModelEventDispatcher_js__WEBPACK_IMPORTED_MODULE_18__["FocusChangedEvent"](!hasFocus, hasFocus)); - } - onDidColorThemeChange() { - this._eventDispatcher.emitSingleViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewThemeChangedEvent"]()); - } - _onConfigurationChanged(eventsCollector, e) { - // We might need to restore the current centered view range, so save it (if available) - let previousViewportStartModelPosition = null; - if (this._viewportStartLine !== -1) { - let previousViewportStartViewPosition = new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](this._viewportStartLine, this.getLineMinColumn(this._viewportStartLine)); - previousViewportStartModelPosition = this.coordinatesConverter.convertViewPositionToModelPosition(previousViewportStartViewPosition); - } - let restorePreviousViewportStart = false; - const options = this._configuration.options; - const fontInfo = options.get(36 /* fontInfo */); - const wrappingStrategy = options.get(112 /* wrappingStrategy */); - const wrappingInfo = options.get(118 /* wrappingInfo */); - const wrappingIndent = options.get(111 /* wrappingIndent */); - if (this._lines.setWrappingSettings(fontInfo, wrappingStrategy, wrappingInfo.wrappingColumn, wrappingIndent)) { - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewFlushedEvent"]()); - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewLineMappingChangedEvent"]()); - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewDecorationsChangedEvent"](null)); - this._cursor.onLineMappingChanged(eventsCollector); - this._decorations.onLineMappingChanged(); - this.viewLayout.onFlushed(this.getLineCount()); - if (this.viewLayout.getCurrentScrollTop() !== 0) { - // Never change the scroll position from 0 to something else... - restorePreviousViewportStart = true; - } - this._updateConfigurationViewLineCount.schedule(); - } - if (e.hasChanged(72 /* readOnly */)) { - // Must read again all decorations due to readOnly filtering - this._decorations.reset(); - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewDecorationsChangedEvent"](null)); - } - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewConfigurationChangedEvent"](e)); - this.viewLayout.onConfigurationChanged(e); - if (restorePreviousViewportStart && previousViewportStartModelPosition) { - const viewPosition = this.coordinatesConverter.convertModelPositionToViewPosition(previousViewportStartModelPosition); - const viewPositionTop = this.viewLayout.getVerticalOffsetForLineNumber(viewPosition.lineNumber); - this.viewLayout.setScrollPosition({ scrollTop: viewPositionTop + this._viewportStartLineDelta }, 1 /* Immediate */); - } - if (_controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_17__["CursorConfiguration"].shouldRecreate(e)) { - this.cursorConfig = new _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_17__["CursorConfiguration"](this.model.getLanguageIdentifier(), this.model.getOptions(), this._configuration); - this._cursor.updateConfiguration(this.cursorConfig); - } - } - _registerModelEvents() { - this._register(this.model.onDidChangeRawContentFast((e) => { - try { - const eventsCollector = this._eventDispatcher.beginEmitViewEvents(); - let hadOtherModelChange = false; - let hadModelLineChangeThatChangedLineMapping = false; - const changes = e.changes; - const versionId = e.versionId; - // Do a first pass to compute line mappings, and a second pass to actually interpret them - const lineBreaksComputer = this._lines.createLineBreaksComputer(); - for (const change of changes) { - switch (change.changeType) { - case 4 /* LinesInserted */: { - for (const line of change.detail) { - lineBreaksComputer.addRequest(line, null); - } - break; - } - case 2 /* LineChanged */: { - lineBreaksComputer.addRequest(change.detail, null); - break; - } - } - } - const lineBreaks = lineBreaksComputer.finalize(); - let lineBreaksOffset = 0; - for (const change of changes) { - switch (change.changeType) { - case 1 /* Flush */: { - this._lines.onModelFlushed(); - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewFlushedEvent"]()); - this._decorations.reset(); - this.viewLayout.onFlushed(this.getLineCount()); - hadOtherModelChange = true; - break; - } - case 3 /* LinesDeleted */: { - const linesDeletedEvent = this._lines.onModelLinesDeleted(versionId, change.fromLineNumber, change.toLineNumber); - if (linesDeletedEvent !== null) { - eventsCollector.emitViewEvent(linesDeletedEvent); - this.viewLayout.onLinesDeleted(linesDeletedEvent.fromLineNumber, linesDeletedEvent.toLineNumber); - } - hadOtherModelChange = true; - break; - } - case 4 /* LinesInserted */: { - const insertedLineBreaks = lineBreaks.slice(lineBreaksOffset, lineBreaksOffset + change.detail.length); - lineBreaksOffset += change.detail.length; - const linesInsertedEvent = this._lines.onModelLinesInserted(versionId, change.fromLineNumber, change.toLineNumber, insertedLineBreaks); - if (linesInsertedEvent !== null) { - eventsCollector.emitViewEvent(linesInsertedEvent); - this.viewLayout.onLinesInserted(linesInsertedEvent.fromLineNumber, linesInsertedEvent.toLineNumber); - } - hadOtherModelChange = true; - break; - } - case 2 /* LineChanged */: { - const changedLineBreakData = lineBreaks[lineBreaksOffset]; - lineBreaksOffset++; - const [lineMappingChanged, linesChangedEvent, linesInsertedEvent, linesDeletedEvent] = this._lines.onModelLineChanged(versionId, change.lineNumber, changedLineBreakData); - hadModelLineChangeThatChangedLineMapping = lineMappingChanged; - if (linesChangedEvent) { - eventsCollector.emitViewEvent(linesChangedEvent); - } - if (linesInsertedEvent) { - eventsCollector.emitViewEvent(linesInsertedEvent); - this.viewLayout.onLinesInserted(linesInsertedEvent.fromLineNumber, linesInsertedEvent.toLineNumber); - } - if (linesDeletedEvent) { - eventsCollector.emitViewEvent(linesDeletedEvent); - this.viewLayout.onLinesDeleted(linesDeletedEvent.fromLineNumber, linesDeletedEvent.toLineNumber); - } - break; - } - case 5 /* EOLChanged */: { - // Nothing to do. The new version will be accepted below - break; - } - } - } - this._lines.acceptVersionId(versionId); - this.viewLayout.onHeightMaybeChanged(); - if (!hadOtherModelChange && hadModelLineChangeThatChangedLineMapping) { - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewLineMappingChangedEvent"]()); - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewDecorationsChangedEvent"](null)); - this._cursor.onLineMappingChanged(eventsCollector); - this._decorations.onLineMappingChanged(); - } - } - finally { - this._eventDispatcher.endEmitViewEvents(); - } - // Update the configuration and reset the centered view line - this._viewportStartLine = -1; - this._configuration.setMaxLineNumber(this.model.getLineCount()); - this._updateConfigurationViewLineCountNow(); - // Recover viewport - if (!this._hasFocus && this.model.getAttachedEditorCount() >= 2 && this._viewportStartLineTrackedRange) { - const modelRange = this.model._getTrackedRange(this._viewportStartLineTrackedRange); - if (modelRange) { - const viewPosition = this.coordinatesConverter.convertModelPositionToViewPosition(modelRange.getStartPosition()); - const viewPositionTop = this.viewLayout.getVerticalOffsetForLineNumber(viewPosition.lineNumber); - this.viewLayout.setScrollPosition({ scrollTop: viewPositionTop + this._viewportStartLineDelta }, 1 /* Immediate */); - } - } - try { - const eventsCollector = this._eventDispatcher.beginEmitViewEvents(); - this._cursor.onModelContentChanged(eventsCollector, e); - } - finally { - this._eventDispatcher.endEmitViewEvents(); - } - })); - this._register(this.model.onDidChangeTokens((e) => { - let viewRanges = []; - for (let j = 0, lenJ = e.ranges.length; j < lenJ; j++) { - const modelRange = e.ranges[j]; - const viewStartLineNumber = this.coordinatesConverter.convertModelPositionToViewPosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](modelRange.fromLineNumber, 1)).lineNumber; - const viewEndLineNumber = this.coordinatesConverter.convertModelPositionToViewPosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](modelRange.toLineNumber, this.model.getLineMaxColumn(modelRange.toLineNumber))).lineNumber; - viewRanges[j] = { - fromLineNumber: viewStartLineNumber, - toLineNumber: viewEndLineNumber - }; - } - this._eventDispatcher.emitSingleViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewTokensChangedEvent"](viewRanges)); - if (e.tokenizationSupportChanged) { - this._tokenizeViewportSoon.schedule(); - } - })); - this._register(this.model.onDidChangeLanguageConfiguration((e) => { - this._eventDispatcher.emitSingleViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewLanguageConfigurationEvent"]()); - this.cursorConfig = new _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_17__["CursorConfiguration"](this.model.getLanguageIdentifier(), this.model.getOptions(), this._configuration); - this._cursor.updateConfiguration(this.cursorConfig); - })); - this._register(this.model.onDidChangeLanguage((e) => { - this.cursorConfig = new _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_17__["CursorConfiguration"](this.model.getLanguageIdentifier(), this.model.getOptions(), this._configuration); - this._cursor.updateConfiguration(this.cursorConfig); - })); - this._register(this.model.onDidChangeOptions((e) => { - // A tab size change causes a line mapping changed event => all view parts will repaint OK, no further event needed here - if (this._lines.setTabSize(this.model.getOptions().tabSize)) { - try { - const eventsCollector = this._eventDispatcher.beginEmitViewEvents(); - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewFlushedEvent"]()); - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewLineMappingChangedEvent"]()); - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewDecorationsChangedEvent"](null)); - this._cursor.onLineMappingChanged(eventsCollector); - this._decorations.onLineMappingChanged(); - this.viewLayout.onFlushed(this.getLineCount()); - } - finally { - this._eventDispatcher.endEmitViewEvents(); - } - this._updateConfigurationViewLineCount.schedule(); - } - this.cursorConfig = new _controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_17__["CursorConfiguration"](this.model.getLanguageIdentifier(), this.model.getOptions(), this._configuration); - this._cursor.updateConfiguration(this.cursorConfig); - })); - this._register(this.model.onDidChangeDecorations((e) => { - this._decorations.onModelDecorationsChanged(); - this._eventDispatcher.emitSingleViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewDecorationsChangedEvent"](e)); - })); - } - setHiddenAreas(ranges) { - try { - const eventsCollector = this._eventDispatcher.beginEmitViewEvents(); - let lineMappingChanged = this._lines.setHiddenAreas(ranges); - if (lineMappingChanged) { - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewFlushedEvent"]()); - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewLineMappingChangedEvent"]()); - eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewDecorationsChangedEvent"](null)); - this._cursor.onLineMappingChanged(eventsCollector); - this._decorations.onLineMappingChanged(); - this.viewLayout.onFlushed(this.getLineCount()); - this.viewLayout.onHeightMaybeChanged(); - } - } - finally { - this._eventDispatcher.endEmitViewEvents(); - } - this._updateConfigurationViewLineCount.schedule(); - } - getVisibleRangesPlusViewportAboveBelow() { - const layoutInfo = this._configuration.options.get(117 /* layoutInfo */); - const lineHeight = this._configuration.options.get(51 /* lineHeight */); - const linesAround = Math.max(20, Math.round(layoutInfo.height / lineHeight)); - const partialData = this.viewLayout.getLinesViewportData(); - const startViewLineNumber = Math.max(1, partialData.completelyVisibleStartLineNumber - linesAround); - const endViewLineNumber = Math.min(this.getLineCount(), partialData.completelyVisibleEndLineNumber + linesAround); - return this._toModelVisibleRanges(new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](startViewLineNumber, this.getLineMinColumn(startViewLineNumber), endViewLineNumber, this.getLineMaxColumn(endViewLineNumber))); - } - getVisibleRanges() { - const visibleViewRange = this.getCompletelyVisibleViewRange(); - return this._toModelVisibleRanges(visibleViewRange); - } - _toModelVisibleRanges(visibleViewRange) { - const visibleRange = this.coordinatesConverter.convertViewRangeToModelRange(visibleViewRange); - const hiddenAreas = this._lines.getHiddenAreas(); - if (hiddenAreas.length === 0) { - return [visibleRange]; - } - let result = [], resultLen = 0; - let startLineNumber = visibleRange.startLineNumber; - let startColumn = visibleRange.startColumn; - let endLineNumber = visibleRange.endLineNumber; - let endColumn = visibleRange.endColumn; - for (let i = 0, len = hiddenAreas.length; i < len; i++) { - const hiddenStartLineNumber = hiddenAreas[i].startLineNumber; - const hiddenEndLineNumber = hiddenAreas[i].endLineNumber; - if (hiddenEndLineNumber < startLineNumber) { - continue; - } - if (hiddenStartLineNumber > endLineNumber) { - continue; - } - if (startLineNumber < hiddenStartLineNumber) { - result[resultLen++] = new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](startLineNumber, startColumn, hiddenStartLineNumber - 1, this.model.getLineMaxColumn(hiddenStartLineNumber - 1)); - } - startLineNumber = hiddenEndLineNumber + 1; - startColumn = 1; - } - if (startLineNumber < endLineNumber || (startLineNumber === endLineNumber && startColumn < endColumn)) { - result[resultLen++] = new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](startLineNumber, startColumn, endLineNumber, endColumn); - } - return result; - } - getCompletelyVisibleViewRange() { - const partialData = this.viewLayout.getLinesViewportData(); - const startViewLineNumber = partialData.completelyVisibleStartLineNumber; - const endViewLineNumber = partialData.completelyVisibleEndLineNumber; - return new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](startViewLineNumber, this.getLineMinColumn(startViewLineNumber), endViewLineNumber, this.getLineMaxColumn(endViewLineNumber)); - } - getCompletelyVisibleViewRangeAtScrollTop(scrollTop) { - const partialData = this.viewLayout.getLinesViewportDataAtScrollTop(scrollTop); - const startViewLineNumber = partialData.completelyVisibleStartLineNumber; - const endViewLineNumber = partialData.completelyVisibleEndLineNumber; - return new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](startViewLineNumber, this.getLineMinColumn(startViewLineNumber), endViewLineNumber, this.getLineMaxColumn(endViewLineNumber)); - } - saveState() { - const compatViewState = this.viewLayout.saveState(); - const scrollTop = compatViewState.scrollTop; - const firstViewLineNumber = this.viewLayout.getLineNumberAtVerticalOffset(scrollTop); - const firstPosition = this.coordinatesConverter.convertViewPositionToModelPosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](firstViewLineNumber, this.getLineMinColumn(firstViewLineNumber))); - const firstPositionDeltaTop = this.viewLayout.getVerticalOffsetForLineNumber(firstViewLineNumber) - scrollTop; - return { - scrollLeft: compatViewState.scrollLeft, - firstPosition: firstPosition, - firstPositionDeltaTop: firstPositionDeltaTop - }; - } - reduceRestoreState(state) { - if (typeof state.firstPosition === 'undefined') { - // This is a view state serialized by an older version - return this._reduceRestoreStateCompatibility(state); - } - const modelPosition = this.model.validatePosition(state.firstPosition); - const viewPosition = this.coordinatesConverter.convertModelPositionToViewPosition(modelPosition); - const scrollTop = this.viewLayout.getVerticalOffsetForLineNumber(viewPosition.lineNumber) - state.firstPositionDeltaTop; - return { - scrollLeft: state.scrollLeft, - scrollTop: scrollTop - }; - } - _reduceRestoreStateCompatibility(state) { - return { - scrollLeft: state.scrollLeft, - scrollTop: state.scrollTopWithoutViewZones - }; - } - getTabSize() { - return this.model.getOptions().tabSize; - } - getTextModelOptions() { - return this.model.getOptions(); - } - getLineCount() { - return this._lines.getViewLineCount(); - } - /** - * Gives a hint that a lot of requests are about to come in for these line numbers. - */ - setViewport(startLineNumber, endLineNumber, centeredLineNumber) { - this._viewportStartLine = startLineNumber; - let position = this.coordinatesConverter.convertViewPositionToModelPosition(new _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](startLineNumber, this.getLineMinColumn(startLineNumber))); - this._viewportStartLineTrackedRange = this.model._setTrackedRange(this._viewportStartLineTrackedRange, new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](position.lineNumber, position.column, position.lineNumber, position.column), 1 /* NeverGrowsWhenTypingAtEdges */); - const viewportStartLineTop = this.viewLayout.getVerticalOffsetForLineNumber(startLineNumber); - const scrollTop = this.viewLayout.getCurrentScrollTop(); - this._viewportStartLineDelta = scrollTop - viewportStartLineTop; - } - getActiveIndentGuide(lineNumber, minLineNumber, maxLineNumber) { - return this._lines.getActiveIndentGuide(lineNumber, minLineNumber, maxLineNumber); - } - getLinesIndentGuides(startLineNumber, endLineNumber) { - return this._lines.getViewLinesIndentGuides(startLineNumber, endLineNumber); - } - getLineContent(lineNumber) { - return this._lines.getViewLineContent(lineNumber); - } - getLineLength(lineNumber) { - return this._lines.getViewLineLength(lineNumber); - } - getLineMinColumn(lineNumber) { - return this._lines.getViewLineMinColumn(lineNumber); - } - getLineMaxColumn(lineNumber) { - return this._lines.getViewLineMaxColumn(lineNumber); - } - getLineFirstNonWhitespaceColumn(lineNumber) { - const result = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["firstNonWhitespaceIndex"](this.getLineContent(lineNumber)); - if (result === -1) { - return 0; - } - return result + 1; - } - getLineLastNonWhitespaceColumn(lineNumber) { - const result = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["lastNonWhitespaceIndex"](this.getLineContent(lineNumber)); - if (result === -1) { - return 0; - } - return result + 2; - } - getDecorationsInViewport(visibleRange) { - return this._decorations.getDecorationsViewportData(visibleRange).decorations; - } - getViewLineRenderingData(visibleRange, lineNumber) { - let mightContainRTL = this.model.mightContainRTL(); - let mightContainNonBasicASCII = this.model.mightContainNonBasicASCII(); - let tabSize = this.getTabSize(); - let lineData = this._lines.getViewLineData(lineNumber); - let allInlineDecorations = this._decorations.getDecorationsViewportData(visibleRange).inlineDecorations; - let inlineDecorations = allInlineDecorations[lineNumber - visibleRange.startLineNumber]; - return new _viewModel_js__WEBPACK_IMPORTED_MODULE_12__["ViewLineRenderingData"](lineData.minColumn, lineData.maxColumn, lineData.content, lineData.continuesWithWrappedLine, mightContainRTL, mightContainNonBasicASCII, lineData.tokens, inlineDecorations, tabSize, lineData.startVisibleColumn); - } - getViewLineData(lineNumber) { - return this._lines.getViewLineData(lineNumber); - } - getMinimapLinesRenderingData(startLineNumber, endLineNumber, needed) { - let result = this._lines.getViewLinesData(startLineNumber, endLineNumber, needed); - return new _viewModel_js__WEBPACK_IMPORTED_MODULE_12__["MinimapLinesRenderingData"](this.getTabSize(), result); - } - getAllOverviewRulerDecorations(theme) { - return this._lines.getAllOverviewRulerDecorations(this._editorId, Object(_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_3__["filterValidationDecorations"])(this._configuration.options), theme); - } - invalidateOverviewRulerColorCache() { - const decorations = this.model.getOverviewRulerDecorations(); - for (const decoration of decorations) { - const opts = decoration.options.overviewRuler; - if (opts) { - opts.invalidateCachedColor(); - } - } - } - invalidateMinimapColorCache() { - const decorations = this.model.getAllDecorations(); - for (const decoration of decorations) { - const opts = decoration.options.minimap; - if (opts) { - opts.invalidateCachedColor(); - } - } - } - getValueInRange(range, eol) { - const modelRange = this.coordinatesConverter.convertViewRangeToModelRange(range); - return this.model.getValueInRange(modelRange, eol); - } - getModelLineMaxColumn(modelLineNumber) { - return this.model.getLineMaxColumn(modelLineNumber); - } - validateModelPosition(position) { - return this.model.validatePosition(position); - } - validateModelRange(range) { - return this.model.validateRange(range); - } - deduceModelPositionRelativeToViewPosition(viewAnchorPosition, deltaOffset, lineFeedCnt) { - const modelAnchor = this.coordinatesConverter.convertViewPositionToModelPosition(viewAnchorPosition); - if (this.model.getEOL().length === 2) { - // This model uses CRLF, so the delta must take that into account - if (deltaOffset < 0) { - deltaOffset -= lineFeedCnt; - } - else { - deltaOffset += lineFeedCnt; - } - } - const modelAnchorOffset = this.model.getOffsetAt(modelAnchor); - const resultOffset = modelAnchorOffset + deltaOffset; - return this.model.getPositionAt(resultOffset); - } - getEOL() { - return this.model.getEOL(); - } - getPlainTextToCopy(modelRanges, emptySelectionClipboard, forceCRLF) { - const newLineCharacter = forceCRLF ? '\r\n' : this.model.getEOL(); - modelRanges = modelRanges.slice(0); - modelRanges.sort(_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].compareRangesUsingStarts); - let hasEmptyRange = false; - let hasNonEmptyRange = false; - for (const range of modelRanges) { - if (range.isEmpty()) { - hasEmptyRange = true; - } - else { - hasNonEmptyRange = true; - } - } - if (!hasNonEmptyRange) { - // all ranges are empty - if (!emptySelectionClipboard) { - return ''; - } - const modelLineNumbers = modelRanges.map((r) => r.startLineNumber); - let result = ''; - for (let i = 0; i < modelLineNumbers.length; i++) { - if (i > 0 && modelLineNumbers[i - 1] === modelLineNumbers[i]) { - continue; - } - result += this.model.getLineContent(modelLineNumbers[i]) + newLineCharacter; - } - return result; - } - if (hasEmptyRange && emptySelectionClipboard) { - // mixed empty selections and non-empty selections - let result = []; - let prevModelLineNumber = 0; - for (const modelRange of modelRanges) { - const modelLineNumber = modelRange.startLineNumber; - if (modelRange.isEmpty()) { - if (modelLineNumber !== prevModelLineNumber) { - result.push(this.model.getLineContent(modelLineNumber)); - } - } - else { - result.push(this.model.getValueInRange(modelRange, forceCRLF ? 2 /* CRLF */ : 0 /* TextDefined */)); - } - prevModelLineNumber = modelLineNumber; - } - return result.length === 1 ? result[0] : result; - } - let result = []; - for (const modelRange of modelRanges) { - if (!modelRange.isEmpty()) { - result.push(this.model.getValueInRange(modelRange, forceCRLF ? 2 /* CRLF */ : 0 /* TextDefined */)); - } - } - return result.length === 1 ? result[0] : result; - } - getRichTextToCopy(modelRanges, emptySelectionClipboard) { - const languageId = this.model.getLanguageIdentifier(); - if (languageId.id === 1 /* PlainText */) { - return null; - } - if (modelRanges.length !== 1) { - // no multiple selection support at this time - return null; - } - let range = modelRanges[0]; - if (range.isEmpty()) { - if (!emptySelectionClipboard) { - // nothing to copy - return null; - } - const lineNumber = range.startLineNumber; - range = new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](lineNumber, this.model.getLineMinColumn(lineNumber), lineNumber, this.model.getLineMaxColumn(lineNumber)); - } - const fontInfo = this._configuration.options.get(36 /* fontInfo */); - const colorMap = this._getColorMap(); - const fontFamily = fontInfo.fontFamily === _config_editorOptions_js__WEBPACK_IMPORTED_MODULE_3__["EDITOR_FONT_DEFAULTS"].fontFamily ? fontInfo.fontFamily : `'${fontInfo.fontFamily}', ${_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_3__["EDITOR_FONT_DEFAULTS"].fontFamily}`; - return { - mode: languageId.language, - html: (`
    ` - + this._getHTMLToCopy(range, colorMap) - + '
    ') - }; - } - _getHTMLToCopy(modelRange, colorMap) { - const startLineNumber = modelRange.startLineNumber; - const startColumn = modelRange.startColumn; - const endLineNumber = modelRange.endLineNumber; - const endColumn = modelRange.endColumn; - const tabSize = this.getTabSize(); - let result = ''; - for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { - const lineTokens = this.model.getLineTokens(lineNumber); - const lineContent = lineTokens.getLineContent(); - const startOffset = (lineNumber === startLineNumber ? startColumn - 1 : 0); - const endOffset = (lineNumber === endLineNumber ? endColumn - 1 : lineContent.length); - if (lineContent === '') { - result += '
    '; - } - else { - result += Object(_modes_textToHtmlTokenizer_js__WEBPACK_IMPORTED_MODULE_7__["tokenizeLineToHTML"])(lineContent, lineTokens.inflate(), colorMap, startOffset, endOffset, tabSize, _base_common_platform_js__WEBPACK_IMPORTED_MODULE_15__["isWindows"]); - } - } - return result; - } - _getColorMap() { - let colorMap = _modes_js__WEBPACK_IMPORTED_MODULE_6__["TokenizationRegistry"].getColorMap(); - let result = ['#000000']; - if (colorMap) { - for (let i = 1, len = colorMap.length; i < len; i++) { - result[i] = _base_common_color_js__WEBPACK_IMPORTED_MODULE_0__["Color"].Format.CSS.formatHex(colorMap[i]); - } - } - return result; - } - //#region model - pushStackElement() { - this.model.pushStackElement(); - } - //#endregion - //#region cursor operations - getPrimaryCursorState() { - return this._cursor.getPrimaryCursorState(); - } - getLastAddedCursorIndex() { - return this._cursor.getLastAddedCursorIndex(); - } - getCursorStates() { - return this._cursor.getCursorStates(); - } - setCursorStates(source, reason, states) { - this._withViewEventsCollector(eventsCollector => this._cursor.setStates(eventsCollector, source, reason, states)); - } - getCursorColumnSelectData() { - return this._cursor.getCursorColumnSelectData(); - } - setCursorColumnSelectData(columnSelectData) { - this._cursor.setCursorColumnSelectData(columnSelectData); - } - getPrevEditOperationType() { - return this._cursor.getPrevEditOperationType(); - } - setPrevEditOperationType(type) { - this._cursor.setPrevEditOperationType(type); - } - getSelection() { - return this._cursor.getSelection(); - } - getSelections() { - return this._cursor.getSelections(); - } - getPosition() { - return this._cursor.getPrimaryCursorState().modelState.position; - } - setSelections(source, selections) { - this._withViewEventsCollector(eventsCollector => this._cursor.setSelections(eventsCollector, source, selections)); - } - saveCursorState() { - return this._cursor.saveState(); - } - restoreCursorState(states) { - this._withViewEventsCollector(eventsCollector => this._cursor.restoreState(eventsCollector, states)); - } - _executeCursorEdit(callback) { - if (this._cursor.context.cursorConfig.readOnly) { - // we cannot edit when read only... - this._eventDispatcher.emitOutgoingEvent(new _viewModelEventDispatcher_js__WEBPACK_IMPORTED_MODULE_18__["ReadOnlyEditAttemptEvent"]()); - return; - } - this._withViewEventsCollector(callback); - } - executeEdits(source, edits, cursorStateComputer) { - this._executeCursorEdit(eventsCollector => this._cursor.executeEdits(eventsCollector, source, edits, cursorStateComputer)); - } - startComposition() { - this._cursor.setIsDoingComposition(true); - this._executeCursorEdit(eventsCollector => this._cursor.startComposition(eventsCollector)); - } - endComposition(source) { - this._cursor.setIsDoingComposition(false); - this._executeCursorEdit(eventsCollector => this._cursor.endComposition(eventsCollector, source)); - } - type(text, source) { - this._executeCursorEdit(eventsCollector => this._cursor.type(eventsCollector, text, source)); - } - replacePreviousChar(text, replaceCharCnt, source) { - this._executeCursorEdit(eventsCollector => this._cursor.replacePreviousChar(eventsCollector, text, replaceCharCnt, source)); - } - paste(text, pasteOnNewLine, multicursorText, source) { - this._executeCursorEdit(eventsCollector => this._cursor.paste(eventsCollector, text, pasteOnNewLine, multicursorText, source)); - } - cut(source) { - this._executeCursorEdit(eventsCollector => this._cursor.cut(eventsCollector, source)); - } - executeCommand(command, source) { - this._executeCursorEdit(eventsCollector => this._cursor.executeCommand(eventsCollector, command, source)); - } - executeCommands(commands, source) { - this._executeCursorEdit(eventsCollector => this._cursor.executeCommands(eventsCollector, commands, source)); - } - revealPrimaryCursor(source, revealHorizontal) { - this._withViewEventsCollector(eventsCollector => this._cursor.revealPrimary(eventsCollector, source, revealHorizontal, 0 /* Smooth */)); - } - revealTopMostCursor(source) { - const viewPosition = this._cursor.getTopMostViewPosition(); - const viewRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](viewPosition.lineNumber, viewPosition.column, viewPosition.lineNumber, viewPosition.column); - this._withViewEventsCollector(eventsCollector => eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewRevealRangeRequestEvent"](source, viewRange, null, 0 /* Simple */, true, 0 /* Smooth */))); - } - revealBottomMostCursor(source) { - const viewPosition = this._cursor.getBottomMostViewPosition(); - const viewRange = new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](viewPosition.lineNumber, viewPosition.column, viewPosition.lineNumber, viewPosition.column); - this._withViewEventsCollector(eventsCollector => eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewRevealRangeRequestEvent"](source, viewRange, null, 0 /* Simple */, true, 0 /* Smooth */))); - } - revealRange(source, revealHorizontal, viewRange, verticalType, scrollType) { - this._withViewEventsCollector(eventsCollector => eventsCollector.emitViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewRevealRangeRequestEvent"](source, viewRange, null, verticalType, revealHorizontal, scrollType))); - } - //#endregion - //#region viewLayout - getVerticalOffsetForLineNumber(viewLineNumber) { - return this.viewLayout.getVerticalOffsetForLineNumber(viewLineNumber); - } - getScrollTop() { - return this.viewLayout.getCurrentScrollTop(); - } - setScrollTop(newScrollTop, scrollType) { - this.viewLayout.setScrollPosition({ scrollTop: newScrollTop }, scrollType); - } - setScrollPosition(position, type) { - this.viewLayout.setScrollPosition(position, type); - } - deltaScrollNow(deltaScrollLeft, deltaScrollTop) { - this.viewLayout.deltaScrollNow(deltaScrollLeft, deltaScrollTop); - } - changeWhitespace(callback) { - const hadAChange = this.viewLayout.changeWhitespace(callback); - if (hadAChange) { - this._eventDispatcher.emitSingleViewEvent(new _view_viewEvents_js__WEBPACK_IMPORTED_MODULE_9__["ViewZonesChangedEvent"]()); - this._eventDispatcher.emitOutgoingEvent(new _viewModelEventDispatcher_js__WEBPACK_IMPORTED_MODULE_18__["ViewZonesChangedEvent"]()); - } - } - setMaxLineWidth(maxLineWidth) { - this.viewLayout.setMaxLineWidth(maxLineWidth); - } - //#endregion - _withViewEventsCollector(callback) { - try { - const eventsCollector = this._eventDispatcher.beginEmitViewEvents(); - callback(eventsCollector); - } - finally { - this._eventDispatcher.endEmitViewEvents(); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/anchorSelect/anchorSelect.css": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/anchorSelect/anchorSelect.css ***! - \****************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_anchorSelect_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./anchorSelect.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/anchorSelect/anchorSelect.css"); -/* harmony import */ var _css_loader_dist_cjs_js_anchorSelect_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_anchorSelect_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_anchorSelect_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_anchorSelect_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/anchorSelect/anchorSelect.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/anchorSelect/anchorSelect.js ***! - \***************************************************************************************/ -/*! exports provided: SelectionAnchorSet */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionAnchorSet", function() { return SelectionAnchorSet; }); -/* harmony import */ var _anchorSelect_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./anchorSelect.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/anchorSelect/anchorSelect.css"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/htmlContent.js */ "./node_modules/monaco-editor/esm/vs/base/common/htmlContent.js"); -/* harmony import */ var _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/browser/ui/aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - -const SelectionAnchorSet = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__["RawContextKey"]('selectionAnchorSet', false); -let SelectionAnchorController = class SelectionAnchorController { - constructor(editor, contextKeyService) { - this.editor = editor; - this.selectionAnchorSetContextKey = SelectionAnchorSet.bindTo(contextKeyService); - this.modelChangeListener = editor.onDidChangeModel(() => this.selectionAnchorSetContextKey.reset()); - } - static get(editor) { - return editor.getContribution(SelectionAnchorController.ID); - } - setSelectionAnchor() { - if (this.editor.hasModel()) { - const position = this.editor.getPosition(); - const previousDecorations = this.decorationId ? [this.decorationId] : []; - const newDecorationId = this.editor.deltaDecorations(previousDecorations, [{ - range: _common_core_selection_js__WEBPACK_IMPORTED_MODULE_4__["Selection"].fromPositions(position, position), - options: { - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - hoverMessage: new _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_7__["MarkdownString"]().appendText(Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('selectionAnchor', "Selection Anchor")), - className: 'selection-anchor' - } - }]); - this.decorationId = newDecorationId[0]; - this.selectionAnchorSetContextKey.set(!!this.decorationId); - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_8__["alert"])(Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('anchorSet', "Anchor set at {0}:{1}", position.lineNumber, position.column)); - } - } - goToSelectionAnchor() { - if (this.editor.hasModel() && this.decorationId) { - const anchorPosition = this.editor.getModel().getDecorationRange(this.decorationId); - if (anchorPosition) { - this.editor.setPosition(anchorPosition.getStartPosition()); - } - } - } - selectFromAnchorToCursor() { - if (this.editor.hasModel() && this.decorationId) { - const start = this.editor.getModel().getDecorationRange(this.decorationId); - if (start) { - const end = this.editor.getPosition(); - this.editor.setSelection(_common_core_selection_js__WEBPACK_IMPORTED_MODULE_4__["Selection"].fromPositions(start.getStartPosition(), end)); - this.cancelSelectionAnchor(); - } - } - } - cancelSelectionAnchor() { - if (this.decorationId) { - this.editor.deltaDecorations([this.decorationId], []); - this.decorationId = undefined; - this.selectionAnchorSetContextKey.set(false); - } - } - dispose() { - this.cancelSelectionAnchor(); - this.modelChangeListener.dispose(); - } -}; -SelectionAnchorController.ID = 'editor.contrib.selectionAnchorController'; -SelectionAnchorController = __decorate([ - __param(1, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__["IContextKeyService"]) -], SelectionAnchorController); -class SetSelectionAnchor extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.setSelectionAnchor', - label: Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('setSelectionAnchor', "Set Selection Anchor"), - alias: 'Set Selection Anchor', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 32 /* KEY_B */), - weight: 100 /* EditorContrib */ - } - }); - } - run(_accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - const controller = SelectionAnchorController.get(editor); - controller.setSelectionAnchor(); - }); - } -} -class GoToSelectionAnchor extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.goToSelectionAnchor', - label: Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('goToSelectionAnchor', "Go to Selection Anchor"), - alias: 'Go to Selection Anchor', - precondition: SelectionAnchorSet, - }); - } - run(_accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - const controller = SelectionAnchorController.get(editor); - controller.goToSelectionAnchor(); - }); - } -} -class SelectFromAnchorToCursor extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.selectFromAnchorToCursor', - label: Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('selectFromAnchorToCursor', "Select from Anchor to Cursor"), - alias: 'Select from Anchor to Cursor', - precondition: SelectionAnchorSet, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 41 /* KEY_K */), - weight: 100 /* EditorContrib */ - } - }); - } - run(_accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - const controller = SelectionAnchorController.get(editor); - controller.selectFromAnchorToCursor(); - }); - } -} -class CancelSelectionAnchor extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.cancelSelectionAnchor', - label: Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('cancelSelectionAnchor', "Cancel Selection Anchor"), - alias: 'Cancel Selection Anchor', - precondition: SelectionAnchorSet, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].editorTextFocus, - primary: 9 /* Escape */, - weight: 100 /* EditorContrib */ - } - }); - } - run(_accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - const controller = SelectionAnchorController.get(editor); - controller.cancelSelectionAnchor(); - }); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorContribution"])(SelectionAnchorController.ID, SelectionAnchorController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorAction"])(SetSelectionAnchor); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorAction"])(GoToSelectionAnchor); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorAction"])(SelectFromAnchorToCursor); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorAction"])(CancelSelectionAnchor); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/bracketMatching/bracketMatching.css": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/bracketMatching/bracketMatching.css ***! - \**********************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_bracketMatching_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./bracketMatching.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/bracketMatching/bracketMatching.css"); -/* harmony import */ var _css_loader_dist_cjs_js_bracketMatching_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_bracketMatching_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_bracketMatching_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_bracketMatching_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/bracketMatching/bracketMatching.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/bracketMatching/bracketMatching.js ***! - \*********************************************************************************************/ -/*! exports provided: BracketMatchingController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BracketMatchingController", function() { return BracketMatchingController; }); -/* harmony import */ var _bracketMatching_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bracketMatching.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/bracketMatching/bracketMatching.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _common_model_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../common/view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - -const overviewRulerBracketMatchForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_12__["registerColor"])('editorOverviewRuler.bracketMatchForeground', { dark: '#A0A0A0', light: '#A0A0A0', hc: '#A0A0A0' }, _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('overviewRulerBracketMatchForeground', 'Overview ruler marker color for matching brackets.')); -class JumpToBracketAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.jumpToBracket', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('smartSelect.jumpBracket', "Go to Bracket"), - alias: 'Go to Bracket', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 88 /* US_BACKSLASH */, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - let controller = BracketMatchingController.get(editor); - if (!controller) { - return; - } - controller.jumpToBracket(); - } -} -class SelectToBracketAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.selectToBracket', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('smartSelect.selectToBracket', "Select to Bracket"), - alias: 'Select to Bracket', - precondition: undefined, - description: { - description: `Select to Bracket`, - args: [{ - name: 'args', - schema: { - type: 'object', - properties: { - 'selectBrackets': { - type: 'boolean', - default: true - } - }, - } - }] - } - }); - } - run(accessor, editor, args) { - const controller = BracketMatchingController.get(editor); - if (!controller) { - return; - } - let selectBrackets = true; - if (args && args.selectBrackets === false) { - selectBrackets = false; - } - controller.selectToBracket(selectBrackets); - } -} -class BracketsData { - constructor(position, brackets, options) { - this.position = position; - this.brackets = brackets; - this.options = options; - } -} -class BracketMatchingController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(editor) { - super(); - this._editor = editor; - this._lastBracketsData = []; - this._lastVersionId = 0; - this._decorations = []; - this._updateBracketsSoon = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["RunOnceScheduler"](() => this._updateBrackets(), 50)); - this._matchBrackets = this._editor.getOption(55 /* matchBrackets */); - this._updateBracketsSoon.schedule(); - this._register(editor.onDidChangeCursorPosition((e) => { - if (this._matchBrackets === 'never') { - // Early exit if nothing needs to be done! - // Leave some form of early exit check here if you wish to continue being a cursor position change listener ;) - return; - } - this._updateBracketsSoon.schedule(); - })); - this._register(editor.onDidChangeModelContent((e) => { - this._updateBracketsSoon.schedule(); - })); - this._register(editor.onDidChangeModel((e) => { - this._lastBracketsData = []; - this._decorations = []; - this._updateBracketsSoon.schedule(); - })); - this._register(editor.onDidChangeModelLanguageConfiguration((e) => { - this._lastBracketsData = []; - this._updateBracketsSoon.schedule(); - })); - this._register(editor.onDidChangeConfiguration((e) => { - if (e.hasChanged(55 /* matchBrackets */)) { - this._matchBrackets = this._editor.getOption(55 /* matchBrackets */); - this._decorations = this._editor.deltaDecorations(this._decorations, []); - this._lastBracketsData = []; - this._lastVersionId = 0; - this._updateBracketsSoon.schedule(); - } - })); - } - static get(editor) { - return editor.getContribution(BracketMatchingController.ID); - } - jumpToBracket() { - if (!this._editor.hasModel()) { - return; - } - const model = this._editor.getModel(); - const newSelections = this._editor.getSelections().map(selection => { - const position = selection.getStartPosition(); - // find matching brackets if position is on a bracket - const brackets = model.matchBracket(position); - let newCursorPosition = null; - if (brackets) { - if (brackets[0].containsPosition(position)) { - newCursorPosition = brackets[1].getStartPosition(); - } - else if (brackets[1].containsPosition(position)) { - newCursorPosition = brackets[0].getStartPosition(); - } - } - else { - // find the enclosing brackets if the position isn't on a matching bracket - const enclosingBrackets = model.findEnclosingBrackets(position); - if (enclosingBrackets) { - newCursorPosition = enclosingBrackets[0].getStartPosition(); - } - else { - // no enclosing brackets, try the very first next bracket - const nextBracket = model.findNextBracket(position); - if (nextBracket && nextBracket.range) { - newCursorPosition = nextBracket.range.getStartPosition(); - } - } - } - if (newCursorPosition) { - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](newCursorPosition.lineNumber, newCursorPosition.column, newCursorPosition.lineNumber, newCursorPosition.column); - } - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](position.lineNumber, position.column, position.lineNumber, position.column); - }); - this._editor.setSelections(newSelections); - this._editor.revealRange(newSelections[0]); - } - selectToBracket(selectBrackets) { - if (!this._editor.hasModel()) { - return; - } - const model = this._editor.getModel(); - const newSelections = []; - this._editor.getSelections().forEach(selection => { - const position = selection.getStartPosition(); - let brackets = model.matchBracket(position); - if (!brackets) { - brackets = model.findEnclosingBrackets(position); - if (!brackets) { - const nextBracket = model.findNextBracket(position); - if (nextBracket && nextBracket.range) { - brackets = model.matchBracket(nextBracket.range.getStartPosition()); - } - } - } - let selectFrom = null; - let selectTo = null; - if (brackets) { - brackets.sort(_common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts); - const [open, close] = brackets; - selectFrom = selectBrackets ? open.getStartPosition() : open.getEndPosition(); - selectTo = selectBrackets ? close.getEndPosition() : close.getStartPosition(); - } - if (selectFrom && selectTo) { - newSelections.push(new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](selectFrom.lineNumber, selectFrom.column, selectTo.lineNumber, selectTo.column)); - } - }); - if (newSelections.length > 0) { - this._editor.setSelections(newSelections); - this._editor.revealRange(newSelections[0]); - } - } - _updateBrackets() { - if (this._matchBrackets === 'never') { - return; - } - this._recomputeBrackets(); - let newDecorations = [], newDecorationsLen = 0; - for (const bracketData of this._lastBracketsData) { - let brackets = bracketData.brackets; - if (brackets) { - newDecorations[newDecorationsLen++] = { range: brackets[0], options: bracketData.options }; - newDecorations[newDecorationsLen++] = { range: brackets[1], options: bracketData.options }; - } - } - this._decorations = this._editor.deltaDecorations(this._decorations, newDecorations); - } - _recomputeBrackets() { - if (!this._editor.hasModel()) { - // no model => no brackets! - this._lastBracketsData = []; - this._lastVersionId = 0; - return; - } - const selections = this._editor.getSelections(); - if (selections.length > 100) { - // no bracket matching for high numbers of selections - this._lastBracketsData = []; - this._lastVersionId = 0; - return; - } - const model = this._editor.getModel(); - const versionId = model.getVersionId(); - let previousData = []; - if (this._lastVersionId === versionId) { - // use the previous data only if the model is at the same version id - previousData = this._lastBracketsData; - } - let positions = [], positionsLen = 0; - for (let i = 0, len = selections.length; i < len; i++) { - let selection = selections[i]; - if (selection.isEmpty()) { - // will bracket match a cursor only if the selection is collapsed - positions[positionsLen++] = selection.getStartPosition(); - } - } - // sort positions for `previousData` cache hits - if (positions.length > 1) { - positions.sort(_common_core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"].compare); - } - let newData = [], newDataLen = 0; - let previousIndex = 0, previousLen = previousData.length; - for (let i = 0, len = positions.length; i < len; i++) { - let position = positions[i]; - while (previousIndex < previousLen && previousData[previousIndex].position.isBefore(position)) { - previousIndex++; - } - if (previousIndex < previousLen && previousData[previousIndex].position.equals(position)) { - newData[newDataLen++] = previousData[previousIndex]; - } - else { - let brackets = model.matchBracket(position); - let options = BracketMatchingController._DECORATION_OPTIONS_WITH_OVERVIEW_RULER; - if (!brackets && this._matchBrackets === 'always') { - brackets = model.findEnclosingBrackets(position, 20 /* give at most 20ms to compute */); - options = BracketMatchingController._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER; - } - newData[newDataLen++] = new BracketsData(position, brackets, options); - } - } - this._lastBracketsData = newData; - this._lastVersionId = versionId; - } -} -BracketMatchingController.ID = 'editor.contrib.bracketMatchingController'; -BracketMatchingController._DECORATION_OPTIONS_WITH_OVERVIEW_RULER = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - className: 'bracket-match', - overviewRuler: { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__["themeColorFromId"])(overviewRulerBracketMatchForeground), - position: _common_model_js__WEBPACK_IMPORTED_MODULE_9__["OverviewRulerLane"].Center - } -}); -BracketMatchingController._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - className: 'bracket-match' -}); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorContribution"])(BracketMatchingController.ID, BracketMatchingController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(SelectToBracketAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(JumpToBracketAction); -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__["registerThemingParticipant"])((theme, collector) => { - const bracketMatchBackground = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_11__["editorBracketMatchBackground"]); - if (bracketMatchBackground) { - collector.addRule(`.monaco-editor .bracket-match { background-color: ${bracketMatchBackground}; }`); - } - const bracketMatchBorder = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_11__["editorBracketMatchBorder"]); - if (bracketMatchBorder) { - collector.addRule(`.monaco-editor .bracket-match { border: 1px solid ${bracketMatchBorder}; }`); - } -}); -// Go to menu -_platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_14__["MenuRegistry"].appendMenuItem(_platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_14__["MenuId"].MenubarGoMenu, { - group: '5_infile_nav', - command: { - id: 'editor.action.jumpToBracket', - title: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]({ key: 'miGoToBracket', comment: ['&& denotes a mnemonic'] }, "Go to &&Bracket") - }, - order: 2 -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/caretOperations/caretOperations.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/caretOperations/caretOperations.js ***! - \*********************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _moveCaretCommand_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./moveCaretCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/caretOperations/moveCaretCommand.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class MoveCaretAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["EditorAction"] { - constructor(left, opts) { - super(opts); - this.left = left; - } - run(accessor, editor) { - if (!editor.hasModel()) { - return; - } - let commands = []; - let selections = editor.getSelections(); - for (const selection of selections) { - commands.push(new _moveCaretCommand_js__WEBPACK_IMPORTED_MODULE_3__["MoveCaretCommand"](selection, this.left)); - } - editor.pushUndoStop(); - editor.executeCommands(this.id, commands); - editor.pushUndoStop(); - } -} -class MoveCaretLeftAction extends MoveCaretAction { - constructor() { - super(true, { - id: 'editor.action.moveCarretLeftAction', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('caret.moveLeft', "Move Selected Text Left"), - alias: 'Move Selected Text Left', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_2__["EditorContextKeys"].writable - }); - } -} -class MoveCaretRightAction extends MoveCaretAction { - constructor() { - super(false, { - id: 'editor.action.moveCarretRightAction', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('caret.moveRight', "Move Selected Text Right"), - alias: 'Move Selected Text Right', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_2__["EditorContextKeys"].writable - }); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorAction"])(MoveCaretLeftAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorAction"])(MoveCaretRightAction); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/caretOperations/moveCaretCommand.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/caretOperations/moveCaretCommand.js ***! - \**********************************************************************************************/ -/*! exports provided: MoveCaretCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MoveCaretCommand", function() { return MoveCaretCommand; }); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class MoveCaretCommand { - constructor(selection, isMovingLeft) { - this._selection = selection; - this._isMovingLeft = isMovingLeft; - } - getEditOperations(model, builder) { - if (this._selection.startLineNumber !== this._selection.endLineNumber || this._selection.isEmpty()) { - return; - } - const lineNumber = this._selection.startLineNumber; - const startColumn = this._selection.startColumn; - const endColumn = this._selection.endColumn; - if (this._isMovingLeft && startColumn === 1) { - return; - } - if (!this._isMovingLeft && endColumn === model.getLineMaxColumn(lineNumber)) { - return; - } - if (this._isMovingLeft) { - const rangeBefore = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](lineNumber, startColumn - 1, lineNumber, startColumn); - const charBefore = model.getValueInRange(rangeBefore); - builder.addEditOperation(rangeBefore, null); - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](lineNumber, endColumn, lineNumber, endColumn), charBefore); - } - else { - const rangeAfter = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](lineNumber, endColumn, lineNumber, endColumn + 1); - const charAfter = model.getValueInRange(rangeAfter); - builder.addEditOperation(rangeAfter, null); - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](lineNumber, startColumn, lineNumber, startColumn), charAfter); - } - } - computeCursorState(model, helper) { - if (this._isMovingLeft) { - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_1__["Selection"](this._selection.startLineNumber, this._selection.startColumn - 1, this._selection.endLineNumber, this._selection.endColumn - 1); - } - else { - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_1__["Selection"](this._selection.startLineNumber, this._selection.startColumn + 1, this._selection.endLineNumber, this._selection.endColumn + 1); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/caretOperations/transpose.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/caretOperations/transpose.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/commands/replaceCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/common/commands/replaceCommand.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _common_controller_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/controller/cursorMoveOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorMoveOperations.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -class TransposeLettersAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.transposeLetters', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('transposeLetters.label', "Transpose Letters"), - alias: 'Transpose Letters', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_4__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_4__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { - primary: 256 /* WinCtrl */ | 50 /* KEY_T */ - }, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - if (!editor.hasModel()) { - return; - } - let model = editor.getModel(); - let commands = []; - let selections = editor.getSelections(); - for (let selection of selections) { - if (!selection.isEmpty()) { - continue; - } - let lineNumber = selection.startLineNumber; - let column = selection.startColumn; - let lastColumn = model.getLineMaxColumn(lineNumber); - if (lineNumber === 1 && (column === 1 || (column === 2 && lastColumn === 2))) { - // at beginning of file, nothing to do - continue; - } - // handle special case: when at end of line, transpose left two chars - // otherwise, transpose left and right chars - let endPosition = (column === lastColumn) ? - selection.getPosition() : - _common_controller_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_5__["MoveOperations"].rightPosition(model, selection.getPosition().lineNumber, selection.getPosition().column); - let middlePosition = _common_controller_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_5__["MoveOperations"].leftPosition(model, endPosition.lineNumber, endPosition.column); - let beginPosition = _common_controller_cursorMoveOperations_js__WEBPACK_IMPORTED_MODULE_5__["MoveOperations"].leftPosition(model, middlePosition.lineNumber, middlePosition.column); - let leftChar = model.getValueInRange(_common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].fromPositions(beginPosition, middlePosition)); - let rightChar = model.getValueInRange(_common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].fromPositions(middlePosition, endPosition)); - let replaceRange = _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].fromPositions(beginPosition, endPosition); - commands.push(new _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](replaceRange, rightChar + leftChar)); - } - if (commands.length > 0) { - editor.pushUndoStop(); - editor.executeCommands(this.id, commands); - editor.pushUndoStop(); - } - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorAction"])(TransposeLettersAction); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/clipboard/clipboard.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/clipboard/clipboard.js ***! - \*********************************************************************************/ -/*! exports provided: CutAction, CopyAction, PasteAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CutAction", function() { return CutAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CopyAction", function() { return CopyAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PasteAction", function() { return PasteAction; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _browser_controller_textAreaInput_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/controller/textAreaInput.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/textAreaInput.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/clipboard/common/clipboardService.js */ "./node_modules/monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - -const CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste'; -const supportsCut = (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isNative"] || document.queryCommandSupported('cut')); -const supportsCopy = (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isNative"] || document.queryCommandSupported('copy')); -// IE and Edge have trouble with setting html content in clipboard -const supportsCopyWithSyntaxHighlighting = (supportsCopy && !_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_1__["isEdge"]); -// Firefox only supports navigator.clipboard.readText() in browser extensions. -// See https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText#Browser_compatibility -const supportsPaste = (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_1__["isFirefox"] ? document.queryCommandSupported('paste') : true); -function registerCommand(command) { - command.register(); - return command; -} -const CutAction = supportsCut ? registerCommand(new _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["MultiCommand"]({ - id: 'editor.action.clipboardCutAction', - precondition: undefined, - kbOpts: ( - // Do not bind cut keybindings in the browser, - // since browsers do that for us and it avoids security prompts - _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isNative"] ? { - primary: 2048 /* CtrlCmd */ | 54 /* KEY_X */, - win: { primary: 2048 /* CtrlCmd */ | 54 /* KEY_X */, secondary: [1024 /* Shift */ | 20 /* Delete */] }, - weight: 100 /* EditorContrib */ - } : undefined), - menuOpts: [{ - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].MenubarEditMenu, - group: '2_ccp', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miCut', comment: ['&& denotes a mnemonic'] }, "Cu&&t"), - order: 1 - }, { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].EditorContext, - group: CLIPBOARD_CONTEXT_MENU_GROUP, - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('actions.clipboard.cutLabel', "Cut"), - when: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__["EditorContextKeys"].writable, - order: 1, - }, { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].CommandPalette, - group: '', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('actions.clipboard.cutLabel', "Cut"), - order: 1 - }] -})) : undefined; -const CopyAction = supportsCopy ? registerCommand(new _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["MultiCommand"]({ - id: 'editor.action.clipboardCopyAction', - precondition: undefined, - kbOpts: ( - // Do not bind copy keybindings in the browser, - // since browsers do that for us and it avoids security prompts - _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isNative"] ? { - primary: 2048 /* CtrlCmd */ | 33 /* KEY_C */, - win: { primary: 2048 /* CtrlCmd */ | 33 /* KEY_C */, secondary: [2048 /* CtrlCmd */ | 19 /* Insert */] }, - weight: 100 /* EditorContrib */ - } : undefined), - menuOpts: [{ - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].MenubarEditMenu, - group: '2_ccp', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miCopy', comment: ['&& denotes a mnemonic'] }, "&&Copy"), - order: 2 - }, { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].EditorContext, - group: CLIPBOARD_CONTEXT_MENU_GROUP, - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('actions.clipboard.copyLabel', "Copy"), - order: 2, - }, { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].CommandPalette, - group: '', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('actions.clipboard.copyLabel', "Copy"), - order: 1 - }] -})) : undefined; -const PasteAction = supportsPaste ? registerCommand(new _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["MultiCommand"]({ - id: 'editor.action.clipboardPasteAction', - precondition: undefined, - kbOpts: ( - // Do not bind paste keybindings in the browser, - // since browsers do that for us and it avoids security prompts - _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isNative"] ? { - primary: 2048 /* CtrlCmd */ | 52 /* KEY_V */, - win: { primary: 2048 /* CtrlCmd */ | 52 /* KEY_V */, secondary: [1024 /* Shift */ | 19 /* Insert */] }, - linux: { primary: 2048 /* CtrlCmd */ | 52 /* KEY_V */, secondary: [1024 /* Shift */ | 19 /* Insert */] }, - weight: 100 /* EditorContrib */ - } : undefined), - menuOpts: [{ - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].MenubarEditMenu, - group: '2_ccp', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miPaste', comment: ['&& denotes a mnemonic'] }, "&&Paste"), - order: 3 - }, { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].EditorContext, - group: CLIPBOARD_CONTEXT_MENU_GROUP, - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('actions.clipboard.pasteLabel', "Paste"), - when: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__["EditorContextKeys"].writable, - order: 3, - }, { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_7__["MenuId"].CommandPalette, - group: '', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('actions.clipboard.pasteLabel', "Paste"), - order: 1 - }] -})) : undefined; -class ExecCommandCopyWithSyntaxHighlightingAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.clipboardCopyWithSyntaxHighlightingAction', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('actions.clipboard.copyWithSyntaxHighlightingLabel', "Copy With Syntax Highlighting"), - alias: 'Copy With Syntax Highlighting', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__["EditorContextKeys"].textInputFocus, - primary: 0, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - if (!editor.hasModel()) { - return; - } - const emptySelectionClipboard = editor.getOption(26 /* emptySelectionClipboard */); - if (!emptySelectionClipboard && editor.getSelection().isEmpty()) { - return; - } - _browser_controller_textAreaInput_js__WEBPACK_IMPORTED_MODULE_3__["CopyOptions"].forceCopyWithSyntaxHighlighting = true; - editor.focus(); - document.execCommand('copy'); - _browser_controller_textAreaInput_js__WEBPACK_IMPORTED_MODULE_3__["CopyOptions"].forceCopyWithSyntaxHighlighting = false; - } -} -function registerExecCommandImpl(target, browserCommand) { - if (!target) { - return; - } - // 1. handle case when focus is in editor. - target.addImplementation(10000, (accessor, args) => { - // Only if editor text focus (i.e. not if editor has widget focus). - const focusedEditor = accessor.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_5__["ICodeEditorService"]).getFocusedCodeEditor(); - if (focusedEditor && focusedEditor.hasTextFocus()) { - // Do not execute if there is no selection and empty selection clipboard is off - const emptySelectionClipboard = focusedEditor.getOption(26 /* emptySelectionClipboard */); - const selection = focusedEditor.getSelection(); - if (selection && selection.isEmpty() && !emptySelectionClipboard) { - return true; - } - document.execCommand(browserCommand); - return true; - } - return false; - }); - // 2. (default) handle case when focus is somewhere else. - target.addImplementation(0, (accessor, args) => { - document.execCommand(browserCommand); - return true; - }); -} -registerExecCommandImpl(CutAction, 'cut'); -registerExecCommandImpl(CopyAction, 'copy'); -if (PasteAction) { - // 1. Paste: handle case when focus is in editor. - PasteAction.addImplementation(10000, (accessor, args) => { - const codeEditorService = accessor.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_5__["ICodeEditorService"]); - const clipboardService = accessor.get(_platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_8__["IClipboardService"]); - // Only if editor text focus (i.e. not if editor has widget focus). - const focusedEditor = codeEditorService.getFocusedCodeEditor(); - if (focusedEditor && focusedEditor.hasTextFocus()) { - const result = document.execCommand('paste'); - // Use the clipboard service if document.execCommand('paste') was not successful - if (!result && _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWeb"]) { - (() => __awaiter(void 0, void 0, void 0, function* () { - const clipboardText = yield clipboardService.readText(); - if (clipboardText !== '') { - const metadata = _browser_controller_textAreaInput_js__WEBPACK_IMPORTED_MODULE_3__["InMemoryClipboardMetadataManager"].INSTANCE.get(clipboardText); - let pasteOnNewLine = false; - let multicursorText = null; - let mode = null; - if (metadata) { - pasteOnNewLine = (focusedEditor.getOption(26 /* emptySelectionClipboard */) && !!metadata.isFromEmptySelection); - multicursorText = (typeof metadata.multicursorText !== 'undefined' ? metadata.multicursorText : null); - mode = metadata.mode; - } - focusedEditor.trigger('keyboard', "paste" /* Paste */, { - text: clipboardText, - pasteOnNewLine, - multicursorText, - mode - }); - } - }))(); - return true; - } - return true; - } - return false; - }); - // 2. Paste: (default) handle case when focus is somewhere else. - PasteAction.addImplementation(0, (accessor, args) => { - document.execCommand('paste'); - return true; - }); -} -if (supportsCopyWithSyntaxHighlighting) { - Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(ExecCommandCopyWithSyntaxHighlightingAction); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeAction.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeAction.js ***! - \***********************************************************************************/ -/*! exports provided: codeActionCommandId, refactorCommandId, sourceActionCommandId, organizeImportsCommandId, fixAllCommandId, getCodeActions */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "codeActionCommandId", function() { return codeActionCommandId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "refactorCommandId", function() { return refactorCommandId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sourceActionCommandId", function() { return sourceActionCommandId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "organizeImportsCommandId", function() { return organizeImportsCommandId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fixAllCommandId", function() { return fixAllCommandId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCodeActions", function() { return getCodeActions; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../browser/core/editorState.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/core/editorState.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./types.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/types.js"); -/* harmony import */ var _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../platform/progress/common/progress.js */ "./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - -const codeActionCommandId = 'editor.action.codeAction'; -const refactorCommandId = 'editor.action.refactor'; -const sourceActionCommandId = 'editor.action.sourceAction'; -const organizeImportsCommandId = 'editor.action.organizeImports'; -const fixAllCommandId = 'editor.action.fixAll'; -class ManagedCodeActionSet extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(actions, documentation, disposables) { - super(); - this.documentation = documentation; - this._register(disposables); - this.allActions = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["mergeSort"])([...actions], ManagedCodeActionSet.codeActionsComparator); - this.validActions = this.allActions.filter(action => !action.disabled); - } - static codeActionsComparator(a, b) { - if (a.isPreferred && !b.isPreferred) { - return -1; - } - else if (!a.isPreferred && b.isPreferred) { - return 1; - } - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["isNonEmptyArray"])(a.diagnostics)) { - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["isNonEmptyArray"])(b.diagnostics)) { - return a.diagnostics[0].message.localeCompare(b.diagnostics[0].message); - } - else { - return -1; - } - } - else if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["isNonEmptyArray"])(b.diagnostics)) { - return 1; - } - else { - return 0; // both have no diagnostics - } - } - get hasAutoFix() { - return this.validActions.some(fix => !!fix.kind && _types_js__WEBPACK_IMPORTED_MODULE_11__["CodeActionKind"].QuickFix.contains(new _types_js__WEBPACK_IMPORTED_MODULE_11__["CodeActionKind"](fix.kind)) && !!fix.isPreferred); - } -} -const emptyCodeActionsResponse = { actions: [], documentation: undefined }; -function getCodeActions(model, rangeOrSelection, trigger, progress, token) { - var _a; - const filter = trigger.filter || {}; - const codeActionContext = { - only: (_a = filter.include) === null || _a === void 0 ? void 0 : _a.value, - trigger: trigger.type, - }; - const cts = new _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_5__["TextModelCancellationTokenSource"](model, token); - const providers = getCodeActionProviders(model, filter); - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - const promises = providers.map((provider) => __awaiter(this, void 0, void 0, function* () { - try { - progress.report(provider); - const providedCodeActions = yield provider.provideCodeActions(model, rangeOrSelection, codeActionContext, cts.token); - if (providedCodeActions) { - disposables.add(providedCodeActions); - } - if (cts.token.isCancellationRequested) { - return emptyCodeActionsResponse; - } - const filteredActions = ((providedCodeActions === null || providedCodeActions === void 0 ? void 0 : providedCodeActions.actions) || []).filter(action => action && Object(_types_js__WEBPACK_IMPORTED_MODULE_11__["filtersAction"])(filter, action)); - const documentation = getDocumentation(provider, filteredActions, filter.include); - return { actions: filteredActions, documentation }; - } - catch (err) { - if (Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["isPromiseCanceledError"])(err)) { - throw err; - } - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["onUnexpectedExternalError"])(err); - return emptyCodeActionsResponse; - } - })); - const listener = _common_modes_js__WEBPACK_IMPORTED_MODULE_9__["CodeActionProviderRegistry"].onDidChange(() => { - const newProviders = _common_modes_js__WEBPACK_IMPORTED_MODULE_9__["CodeActionProviderRegistry"].all(model); - if (!Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["equals"])(newProviders, providers)) { - cts.cancel(); - } - }); - return Promise.all(promises).then(actions => { - const allActions = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["flatten"])(actions.map(x => x.actions)); - const allDocumentation = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["coalesce"])(actions.map(x => x.documentation)); - return new ManagedCodeActionSet(allActions, allDocumentation, disposables); - }) - .finally(() => { - listener.dispose(); - cts.dispose(); - }); -} -function getCodeActionProviders(model, filter) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_9__["CodeActionProviderRegistry"].all(model) - // Don't include providers that we know will not return code actions of interest - .filter(provider => { - if (!provider.providedCodeActionKinds) { - // We don't know what type of actions this provider will return. - return true; - } - return provider.providedCodeActionKinds.some(kind => Object(_types_js__WEBPACK_IMPORTED_MODULE_11__["mayIncludeActionsOfKind"])(filter, new _types_js__WEBPACK_IMPORTED_MODULE_11__["CodeActionKind"](kind))); - }); -} -function getDocumentation(provider, providedCodeActions, only) { - if (!provider.documentation) { - return undefined; - } - const documentation = provider.documentation.map(entry => ({ kind: new _types_js__WEBPACK_IMPORTED_MODULE_11__["CodeActionKind"](entry.kind), command: entry.command })); - if (only) { - let currentBest; - for (const entry of documentation) { - if (entry.kind.contains(only)) { - if (!currentBest) { - currentBest = entry; - } - else { - // Take best match - if (currentBest.kind.contains(entry.kind)) { - currentBest = entry; - } - } - } - } - if (currentBest) { - return currentBest === null || currentBest === void 0 ? void 0 : currentBest.command; - } - } - // Otherwise, check to see if any of the provided actions match. - for (const action of providedCodeActions) { - if (!action.kind) { - continue; - } - for (const entry of documentation) { - if (entry.kind.contains(new _types_js__WEBPACK_IMPORTED_MODULE_11__["CodeActionKind"](action.kind))) { - return entry.command; - } - } - } - return undefined; -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerLanguageCommand"])('_executeCodeActionProvider', function (accessor, args) { - return __awaiter(this, void 0, void 0, function* () { - const { resource, rangeOrSelection, kind } = args; - if (!(resource instanceof _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"])) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["illegalArgument"])(); - } - const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_10__["IModelService"]).getModel(resource); - if (!model) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["illegalArgument"])(); - } - const validatedRangeOrSelection = _common_core_selection_js__WEBPACK_IMPORTED_MODULE_8__["Selection"].isISelection(rangeOrSelection) - ? _common_core_selection_js__WEBPACK_IMPORTED_MODULE_8__["Selection"].liftSelection(rangeOrSelection) - : _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].isIRange(rangeOrSelection) - ? model.validateRange(rangeOrSelection) - : undefined; - if (!validatedRangeOrSelection) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["illegalArgument"])(); - } - const codeActionSet = yield getCodeActions(model, validatedRangeOrSelection, { type: 2 /* Manual */, filter: { includeSourceActions: true, include: kind && kind.value ? new _types_js__WEBPACK_IMPORTED_MODULE_11__["CodeActionKind"](kind.value) : undefined } }, _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_12__["Progress"].None, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationToken"].None); - setTimeout(() => codeActionSet.dispose(), 100); - return codeActionSet.validActions; - }); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionCommands.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionCommands.js ***! - \*******************************************************************************************/ -/*! exports provided: QuickFixController, applyCodeAction, QuickFixAction, CodeActionCommand, RefactorAction, SourceAction, OrganizeImportsAction, FixAllAction, AutoFixAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickFixController", function() { return QuickFixController; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyCodeAction", function() { return applyCodeAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickFixAction", function() { return QuickFixAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionCommand", function() { return CodeActionCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RefactorAction", function() { return RefactorAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SourceAction", function() { return SourceAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OrganizeImportsAction", function() { return OrganizeImportsAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FixAllAction", function() { return FixAllAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutoFixAction", function() { return AutoFixAction; }); -/* harmony import */ var _base_common_lazy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/lazy.js */ "./node_modules/monaco-editor/esm/vs/base/common/lazy.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _browser_services_bulkEditService_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/services/bulkEditService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/bulkEditService.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _codeAction_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./codeAction.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeAction.js"); -/* harmony import */ var _codeActionUi_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./codeActionUi.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionUi.js"); -/* harmony import */ var _message_messageController_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../message/messageController.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/message/messageController.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/markers/common/markers.js */ "./node_modules/monaco-editor/esm/vs/platform/markers/common/markers.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/progress/common/progress.js */ "./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js"); -/* harmony import */ var _platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/telemetry/common/telemetry.js */ "./node_modules/monaco-editor/esm/vs/platform/telemetry/common/telemetry.js"); -/* harmony import */ var _codeActionModel_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./codeActionModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionModel.js"); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./types.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - - - - -function contextKeyForSupportedActions(kind) { - return _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["ContextKeyExpr"].regex(_codeActionModel_js__WEBPACK_IMPORTED_MODULE_17__["SUPPORTED_CODE_ACTIONS"].keys()[0], new RegExp('(\\s|^)' + Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["escapeRegExpCharacters"])(kind.value) + '\\b')); -} -const argsSchema = { - type: 'object', - defaultSnippets: [{ body: { kind: '' } }], - properties: { - 'kind': { - type: 'string', - description: _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('args.schema.kind', "Kind of the code action to run."), - }, - 'apply': { - type: 'string', - description: _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('args.schema.apply', "Controls when the returned actions are applied."), - default: "ifSingle" /* IfSingle */, - enum: ["first" /* First */, "ifSingle" /* IfSingle */, "never" /* Never */], - enumDescriptions: [ - _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('args.schema.apply.first', "Always apply the first returned code action."), - _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('args.schema.apply.ifSingle', "Apply the first returned code action if it is the only one."), - _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('args.schema.apply.never', "Do not apply the returned code actions."), - ] - }, - 'preferred': { - type: 'boolean', - default: false, - description: _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('args.schema.preferred', "Controls if only preferred code actions should be returned."), - } - } -}; -let QuickFixController = class QuickFixController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(editor, markerService, contextKeyService, progressService, _instantiationService) { - super(); - this._instantiationService = _instantiationService; - this._editor = editor; - this._model = this._register(new _codeActionModel_js__WEBPACK_IMPORTED_MODULE_17__["CodeActionModel"](this._editor, markerService, contextKeyService, progressService)); - this._register(this._model.onDidChangeState(newState => this.update(newState))); - this._ui = new _base_common_lazy_js__WEBPACK_IMPORTED_MODULE_0__["Lazy"](() => this._register(new _codeActionUi_js__WEBPACK_IMPORTED_MODULE_7__["CodeActionUi"](editor, QuickFixAction.Id, AutoFixAction.Id, { - applyCodeAction: (action, retrigger) => __awaiter(this, void 0, void 0, function* () { - try { - yield this._applyCodeAction(action); - } - finally { - if (retrigger) { - this._trigger({ type: 1 /* Auto */, filter: {} }); - } - } - }) - }, this._instantiationService))); - } - static get(editor) { - return editor.getContribution(QuickFixController.ID); - } - update(newState) { - this._ui.getValue().update(newState); - } - showCodeActions(trigger, actions, at) { - return this._ui.getValue().showCodeActionList(trigger, actions, at, { includeDisabledActions: false }); - } - manualTriggerAtCurrentPosition(notAvailableMessage, filter, autoApply) { - if (!this._editor.hasModel()) { - return; - } - _message_messageController_js__WEBPACK_IMPORTED_MODULE_8__["MessageController"].get(this._editor).closeMessage(); - const triggerPosition = this._editor.getPosition(); - this._trigger({ type: 2 /* Manual */, filter, autoApply, context: { notAvailableMessage, position: triggerPosition } }); - } - _trigger(trigger) { - return this._model.trigger(trigger); - } - _applyCodeAction(action) { - return this._instantiationService.invokeFunction(applyCodeAction, action, this._editor); - } -}; -QuickFixController.ID = 'editor.contrib.quickFixController'; -QuickFixController = __decorate([ - __param(1, _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_13__["IMarkerService"]), - __param(2, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["IContextKeyService"]), - __param(3, _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_15__["IEditorProgressService"]), - __param(4, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_12__["IInstantiationService"]) -], QuickFixController); - -function applyCodeAction(accessor, action, editor) { - return __awaiter(this, void 0, void 0, function* () { - const bulkEditService = accessor.get(_browser_services_bulkEditService_js__WEBPACK_IMPORTED_MODULE_4__["IBulkEditService"]); - const commandService = accessor.get(_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_10__["ICommandService"]); - const telemetryService = accessor.get(_platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_16__["ITelemetryService"]); - const notificationService = accessor.get(_platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_14__["INotificationService"]); - telemetryService.publicLog2('codeAction.applyCodeAction', { - codeActionTitle: action.title, - codeActionKind: action.kind, - codeActionIsPreferred: !!action.isPreferred, - }); - if (action.edit) { - yield bulkEditService.apply(_browser_services_bulkEditService_js__WEBPACK_IMPORTED_MODULE_4__["ResourceEdit"].convert(action.edit), { editor, label: action.title }); - } - if (action.command) { - try { - yield commandService.executeCommand(action.command.id, ...(action.command.arguments || [])); - } - catch (err) { - const message = asMessage(err); - notificationService.error(typeof message === 'string' - ? message - : _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('applyCodeActionFailed', "An unknown error occurred while applying the code action")); - } - } - }); -} -function asMessage(err) { - if (typeof err === 'string') { - return err; - } - else if (err instanceof Error && typeof err.message === 'string') { - return err.message; - } - else { - return undefined; - } -} -function triggerCodeActionsForEditorSelection(editor, notAvailableMessage, filter, autoApply) { - if (editor.hasModel()) { - const controller = QuickFixController.get(editor); - if (controller) { - controller.manualTriggerAtCurrentPosition(notAvailableMessage, filter, autoApply); - } - } -} -class QuickFixAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: QuickFixAction.Id, - label: _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('quickfix.trigger.label', "Quick Fix..."), - alias: 'Quick Fix...', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].writable, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].hasCodeActionsProvider), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 84 /* US_DOT */, - weight: 100 /* EditorContrib */ - } - }); - } - run(_accessor, editor) { - return triggerCodeActionsForEditorSelection(editor, _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.quickFix.noneMessage', "No code actions available"), undefined, undefined); - } -} -QuickFixAction.Id = 'editor.action.quickFix'; -class CodeActionCommand extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorCommand"] { - constructor() { - super({ - id: _codeAction_js__WEBPACK_IMPORTED_MODULE_6__["codeActionCommandId"], - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].writable, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].hasCodeActionsProvider), - description: { - description: 'Trigger a code action', - args: [{ name: 'args', schema: argsSchema, }] - } - }); - } - runEditorCommand(_accessor, editor, userArgs) { - const args = _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionCommandArgs"].fromUser(userArgs, { - kind: _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].Empty, - apply: "ifSingle" /* IfSingle */, - }); - return triggerCodeActionsForEditorSelection(editor, typeof (userArgs === null || userArgs === void 0 ? void 0 : userArgs.kind) === 'string' - ? args.preferred - ? _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.codeAction.noneMessage.preferred.kind', "No preferred code actions for '{0}' available", userArgs.kind) - : _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.codeAction.noneMessage.kind', "No code actions for '{0}' available", userArgs.kind) - : args.preferred - ? _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.codeAction.noneMessage.preferred', "No preferred code actions available") - : _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.codeAction.noneMessage', "No code actions available"), { - include: args.kind, - includeSourceActions: true, - onlyIncludePreferredActions: args.preferred, - }, args.apply); - } -} -class RefactorAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: _codeAction_js__WEBPACK_IMPORTED_MODULE_6__["refactorCommandId"], - label: _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('refactor.label', "Refactor..."), - alias: 'Refactor...', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].writable, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].hasCodeActionsProvider), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 48 /* KEY_R */, - mac: { - primary: 256 /* WinCtrl */ | 1024 /* Shift */ | 48 /* KEY_R */ - }, - weight: 100 /* EditorContrib */ - }, - contextMenuOpts: { - group: '1_modification', - order: 2, - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].writable, contextKeyForSupportedActions(_types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].Refactor)), - }, - description: { - description: 'Refactor...', - args: [{ name: 'args', schema: argsSchema }] - } - }); - } - run(_accessor, editor, userArgs) { - const args = _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionCommandArgs"].fromUser(userArgs, { - kind: _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].Refactor, - apply: "never" /* Never */ - }); - return triggerCodeActionsForEditorSelection(editor, typeof (userArgs === null || userArgs === void 0 ? void 0 : userArgs.kind) === 'string' - ? args.preferred - ? _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.refactor.noneMessage.preferred.kind', "No preferred refactorings for '{0}' available", userArgs.kind) - : _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.refactor.noneMessage.kind', "No refactorings for '{0}' available", userArgs.kind) - : args.preferred - ? _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.refactor.noneMessage.preferred', "No preferred refactorings available") - : _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.refactor.noneMessage', "No refactorings available"), { - include: _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].Refactor.contains(args.kind) ? args.kind : _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].None, - onlyIncludePreferredActions: args.preferred, - }, args.apply); - } -} -class SourceAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: _codeAction_js__WEBPACK_IMPORTED_MODULE_6__["sourceActionCommandId"], - label: _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('source.label', "Source Action..."), - alias: 'Source Action...', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].writable, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].hasCodeActionsProvider), - contextMenuOpts: { - group: '1_modification', - order: 2.1, - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].writable, contextKeyForSupportedActions(_types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].Source)), - }, - description: { - description: 'Source Action...', - args: [{ name: 'args', schema: argsSchema }] - } - }); - } - run(_accessor, editor, userArgs) { - const args = _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionCommandArgs"].fromUser(userArgs, { - kind: _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].Source, - apply: "never" /* Never */ - }); - return triggerCodeActionsForEditorSelection(editor, typeof (userArgs === null || userArgs === void 0 ? void 0 : userArgs.kind) === 'string' - ? args.preferred - ? _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.source.noneMessage.preferred.kind', "No preferred source actions for '{0}' available", userArgs.kind) - : _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.source.noneMessage.kind', "No source actions for '{0}' available", userArgs.kind) - : args.preferred - ? _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.source.noneMessage.preferred', "No preferred source actions available") - : _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.source.noneMessage', "No source actions available"), { - include: _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].Source.contains(args.kind) ? args.kind : _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].None, - includeSourceActions: true, - onlyIncludePreferredActions: args.preferred, - }, args.apply); - } -} -class OrganizeImportsAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: _codeAction_js__WEBPACK_IMPORTED_MODULE_6__["organizeImportsCommandId"], - label: _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('organizeImports.label', "Organize Imports"), - alias: 'Organize Imports', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].writable, contextKeyForSupportedActions(_types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].SourceOrganizeImports)), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].editorTextFocus, - primary: 1024 /* Shift */ | 512 /* Alt */ | 45 /* KEY_O */, - weight: 100 /* EditorContrib */ - }, - }); - } - run(_accessor, editor) { - return triggerCodeActionsForEditorSelection(editor, _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.organize.noneMessage', "No organize imports action available"), { include: _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].SourceOrganizeImports, includeSourceActions: true }, "ifSingle" /* IfSingle */); - } -} -class FixAllAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: _codeAction_js__WEBPACK_IMPORTED_MODULE_6__["fixAllCommandId"], - label: _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('fixAll.label', "Fix All"), - alias: 'Fix All', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].writable, contextKeyForSupportedActions(_types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].SourceFixAll)) - }); - } - run(_accessor, editor) { - return triggerCodeActionsForEditorSelection(editor, _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('fixAll.noneMessage', "No fix all action available"), { include: _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].SourceFixAll, includeSourceActions: true }, "ifSingle" /* IfSingle */); - } -} -class AutoFixAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: AutoFixAction.Id, - label: _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('autoFix.label', "Auto Fix..."), - alias: 'Auto Fix...', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].writable, contextKeyForSupportedActions(_types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].QuickFix)), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].editorTextFocus, - primary: 512 /* Alt */ | 1024 /* Shift */ | 84 /* US_DOT */, - mac: { - primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 84 /* US_DOT */ - }, - weight: 100 /* EditorContrib */ - } - }); - } - run(_accessor, editor) { - return triggerCodeActionsForEditorSelection(editor, _nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"]('editor.action.autoFix.noneMessage', "No auto fixes available"), { - include: _types_js__WEBPACK_IMPORTED_MODULE_18__["CodeActionKind"].QuickFix, - onlyIncludePreferredActions: true - }, "ifSingle" /* IfSingle */); - } -} -AutoFixAction.Id = 'editor.action.autoFix'; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionContributions.js": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionContributions.js ***! - \************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _codeActionCommands_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./codeActionCommands.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionCommands.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorContribution"])(_codeActionCommands_js__WEBPACK_IMPORTED_MODULE_1__["QuickFixController"].ID, _codeActionCommands_js__WEBPACK_IMPORTED_MODULE_1__["QuickFixController"]); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorAction"])(_codeActionCommands_js__WEBPACK_IMPORTED_MODULE_1__["QuickFixAction"]); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorAction"])(_codeActionCommands_js__WEBPACK_IMPORTED_MODULE_1__["RefactorAction"]); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorAction"])(_codeActionCommands_js__WEBPACK_IMPORTED_MODULE_1__["SourceAction"]); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorAction"])(_codeActionCommands_js__WEBPACK_IMPORTED_MODULE_1__["OrganizeImportsAction"]); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorAction"])(_codeActionCommands_js__WEBPACK_IMPORTED_MODULE_1__["AutoFixAction"]); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorAction"])(_codeActionCommands_js__WEBPACK_IMPORTED_MODULE_1__["FixAllAction"]); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new _codeActionCommands_js__WEBPACK_IMPORTED_MODULE_1__["CodeActionCommand"]()); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionMenu.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionMenu.js ***! - \***************************************************************************************/ -/*! exports provided: CodeActionMenu, CodeActionKeybindingResolver */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionMenu", function() { return CodeActionMenu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionKeybindingResolver", function() { return CodeActionKeybindingResolver; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_actions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_lazy_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lazy.js */ "./node_modules/monaco-editor/esm/vs/base/common/lazy.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _codeAction_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./codeAction.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeAction.js"); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./types.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/types.js"); -/* harmony import */ var _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/contextview/browser/contextView.js */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextView.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - -class CodeActionAction extends _base_common_actions_js__WEBPACK_IMPORTED_MODULE_1__["Action"] { - constructor(action, callback) { - super(action.command ? action.command.id : action.title, action.title, undefined, !action.disabled, callback); - this.action = action; - } -} -let CodeActionMenu = class CodeActionMenu extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["Disposable"] { - constructor(_editor, _delegate, _contextMenuService, keybindingService) { - super(); - this._editor = _editor; - this._delegate = _delegate; - this._contextMenuService = _contextMenuService; - this._visible = false; - this._showingActions = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["MutableDisposable"]()); - this._keybindingResolver = new CodeActionKeybindingResolver({ - getKeybindings: () => keybindingService.getKeybindings() - }); - } - get isVisible() { - return this._visible; - } - show(trigger, codeActions, at, options) { - return __awaiter(this, void 0, void 0, function* () { - const actionsToShow = options.includeDisabledActions ? codeActions.allActions : codeActions.validActions; - if (!actionsToShow.length) { - this._visible = false; - return; - } - if (!this._editor.getDomNode()) { - // cancel when editor went off-dom - this._visible = false; - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["canceled"])(); - } - this._visible = true; - this._showingActions.value = codeActions; - const menuActions = this.getMenuActions(trigger, actionsToShow, codeActions.documentation); - const anchor = _common_core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"].isIPosition(at) ? this._toCoords(at) : at || { x: 0, y: 0 }; - const resolver = this._keybindingResolver.getResolver(); - this._contextMenuService.showContextMenu({ - domForShadowRoot: this._editor.getDomNode(), - getAnchor: () => anchor, - getActions: () => menuActions, - onHide: () => { - this._visible = false; - this._editor.focus(); - }, - autoSelectFirstItem: true, - getKeyBinding: action => action instanceof CodeActionAction ? resolver(action.action) : undefined, - }); - }); - } - getMenuActions(trigger, actionsToShow, documentation) { - var _a, _b; - const toCodeActionAction = (action) => new CodeActionAction(action, () => this._delegate.onSelectCodeAction(action)); - const result = actionsToShow - .map(toCodeActionAction); - const allDocumentation = [...documentation]; - const model = this._editor.getModel(); - if (model && result.length) { - for (const provider of _common_modes_js__WEBPACK_IMPORTED_MODULE_6__["CodeActionProviderRegistry"].all(model)) { - if (provider._getAdditionalMenuItems) { - allDocumentation.push(...provider._getAdditionalMenuItems({ trigger: trigger.type, only: (_b = (_a = trigger.filter) === null || _a === void 0 ? void 0 : _a.include) === null || _b === void 0 ? void 0 : _b.value }, actionsToShow)); - } - } - } - if (allDocumentation.length) { - result.push(new _base_common_actions_js__WEBPACK_IMPORTED_MODULE_1__["Separator"](), ...allDocumentation.map(command => toCodeActionAction({ - title: command.title, - command: command, - }))); - } - return result; - } - _toCoords(position) { - if (!this._editor.hasModel()) { - return { x: 0, y: 0 }; - } - this._editor.revealPosition(position, 1 /* Immediate */); - this._editor.render(); - // Translate to absolute editor position - const cursorCoords = this._editor.getScrolledVisiblePosition(position); - const editorCoords = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["getDomNodePagePosition"])(this._editor.getDomNode()); - const x = editorCoords.left + cursorCoords.left; - const y = editorCoords.top + cursorCoords.top + cursorCoords.height; - return { x, y }; - } -}; -CodeActionMenu = __decorate([ - __param(2, _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_9__["IContextMenuService"]), - __param(3, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__["IKeybindingService"]) -], CodeActionMenu); - -class CodeActionKeybindingResolver { - constructor(_keybindingProvider) { - this._keybindingProvider = _keybindingProvider; - } - getResolver() { - // Lazy since we may not actually ever read the value - const allCodeActionBindings = new _base_common_lazy_js__WEBPACK_IMPORTED_MODULE_3__["Lazy"](() => this._keybindingProvider.getKeybindings() - .filter(item => CodeActionKeybindingResolver.codeActionCommands.indexOf(item.command) >= 0) - .filter(item => item.resolvedKeybinding) - .map((item) => { - // Special case these commands since they come built-in with VS Code and don't use 'commandArgs' - let commandArgs = item.commandArgs; - if (item.command === _codeAction_js__WEBPACK_IMPORTED_MODULE_7__["organizeImportsCommandId"]) { - commandArgs = { kind: _types_js__WEBPACK_IMPORTED_MODULE_8__["CodeActionKind"].SourceOrganizeImports.value }; - } - else if (item.command === _codeAction_js__WEBPACK_IMPORTED_MODULE_7__["fixAllCommandId"]) { - commandArgs = { kind: _types_js__WEBPACK_IMPORTED_MODULE_8__["CodeActionKind"].SourceFixAll.value }; - } - return Object.assign({ resolvedKeybinding: item.resolvedKeybinding }, _types_js__WEBPACK_IMPORTED_MODULE_8__["CodeActionCommandArgs"].fromUser(commandArgs, { - kind: _types_js__WEBPACK_IMPORTED_MODULE_8__["CodeActionKind"].None, - apply: "never" /* Never */ - })); - })); - return (action) => { - if (action.kind) { - const binding = this.bestKeybindingForCodeAction(action, allCodeActionBindings.getValue()); - return binding === null || binding === void 0 ? void 0 : binding.resolvedKeybinding; - } - return undefined; - }; - } - bestKeybindingForCodeAction(action, candidates) { - if (!action.kind) { - return undefined; - } - const kind = new _types_js__WEBPACK_IMPORTED_MODULE_8__["CodeActionKind"](action.kind); - return candidates - .filter(candidate => candidate.kind.contains(kind)) - .filter(candidate => { - if (candidate.preferred) { - // If the candidate keybinding only applies to preferred actions, the this action must also be preferred - return action.isPreferred; - } - return true; - }) - .reduceRight((currentBest, candidate) => { - if (!currentBest) { - return candidate; - } - // Select the more specific binding - return currentBest.kind.contains(candidate.kind) ? candidate : currentBest; - }, undefined); - } -} -CodeActionKeybindingResolver.codeActionCommands = [ - _codeAction_js__WEBPACK_IMPORTED_MODULE_7__["refactorCommandId"], - _codeAction_js__WEBPACK_IMPORTED_MODULE_7__["codeActionCommandId"], - _codeAction_js__WEBPACK_IMPORTED_MODULE_7__["sourceActionCommandId"], - _codeAction_js__WEBPACK_IMPORTED_MODULE_7__["organizeImportsCommandId"], - _codeAction_js__WEBPACK_IMPORTED_MODULE_7__["fixAllCommandId"] -]; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionModel.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionModel.js ***! - \****************************************************************************************/ -/*! exports provided: SUPPORTED_CODE_ACTIONS, CodeActionsState, CodeActionModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SUPPORTED_CODE_ACTIONS", function() { return SUPPORTED_CODE_ACTIONS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionsState", function() { return CodeActionsState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionModel", function() { return CodeActionModel; }); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/progress/common/progress.js */ "./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js"); -/* harmony import */ var _codeAction_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./codeAction.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeAction.js"); -/* harmony import */ var _base_common_resources_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -const SUPPORTED_CODE_ACTIONS = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["RawContextKey"]('supportedCodeAction', ''); -class CodeActionOracle extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor(_editor, _markerService, _signalChange, _delay = 250) { - super(); - this._editor = _editor; - this._markerService = _markerService; - this._signalChange = _signalChange; - this._delay = _delay; - this._autoTriggerTimer = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["TimeoutTimer"]()); - this._register(this._markerService.onMarkerChanged(e => this._onMarkerChanges(e))); - this._register(this._editor.onDidChangeCursorPosition(() => this._onCursorChange())); - } - trigger(trigger) { - const selection = this._getRangeOfSelectionUnlessWhitespaceEnclosed(trigger); - return this._createEventAndSignalChange(trigger, selection); - } - _onMarkerChanges(resources) { - const model = this._editor.getModel(); - if (!model) { - return; - } - if (resources.some(resource => Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_8__["isEqual"])(resource, model.uri))) { - this._autoTriggerTimer.cancelAndSet(() => { - this.trigger({ type: 1 /* Auto */ }); - }, this._delay); - } - } - _onCursorChange() { - this._autoTriggerTimer.cancelAndSet(() => { - this.trigger({ type: 1 /* Auto */ }); - }, this._delay); - } - _getRangeOfMarker(selection) { - const model = this._editor.getModel(); - if (!model) { - return undefined; - } - for (const marker of this._markerService.read({ resource: model.uri })) { - const markerRange = model.validateRange(marker); - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].intersectRanges(markerRange, selection)) { - return _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].lift(markerRange); - } - } - return undefined; - } - _getRangeOfSelectionUnlessWhitespaceEnclosed(trigger) { - if (!this._editor.hasModel()) { - return undefined; - } - const model = this._editor.getModel(); - const selection = this._editor.getSelection(); - if (selection.isEmpty() && trigger.type === 1 /* Auto */) { - const { lineNumber, column } = selection.getPosition(); - const line = model.getLineContent(lineNumber); - if (line.length === 0) { - // empty line - return undefined; - } - else if (column === 1) { - // look only right - if (/\s/.test(line[0])) { - return undefined; - } - } - else if (column === model.getLineMaxColumn(lineNumber)) { - // look only left - if (/\s/.test(line[line.length - 1])) { - return undefined; - } - } - else { - // look left and right - if (/\s/.test(line[column - 2]) && /\s/.test(line[column - 1])) { - return undefined; - } - } - } - return selection; - } - _createEventAndSignalChange(trigger, selection) { - const model = this._editor.getModel(); - if (!selection || !model) { - // cancel - this._signalChange(undefined); - return undefined; - } - const markerRange = this._getRangeOfMarker(selection); - const position = markerRange ? markerRange.getStartPosition() : selection.getStartPosition(); - const e = { - trigger, - selection, - position - }; - this._signalChange(e); - return e; - } -} -var CodeActionsState; -(function (CodeActionsState) { - CodeActionsState.Empty = { type: 0 /* Empty */ }; - class Triggered { - constructor(trigger, rangeOrSelection, position, actions) { - this.trigger = trigger; - this.rangeOrSelection = rangeOrSelection; - this.position = position; - this.actions = actions; - this.type = 1 /* Triggered */; - } - } - CodeActionsState.Triggered = Triggered; -})(CodeActionsState || (CodeActionsState = {})); -class CodeActionModel extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor(_editor, _markerService, contextKeyService, _progressService) { - super(); - this._editor = _editor; - this._markerService = _markerService; - this._progressService = _progressService; - this._codeActionOracle = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["MutableDisposable"]()); - this._state = CodeActionsState.Empty; - this._onDidChangeState = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onDidChangeState = this._onDidChangeState.event; - this._supportedCodeActions = SUPPORTED_CODE_ACTIONS.bindTo(contextKeyService); - this._register(this._editor.onDidChangeModel(() => this._update())); - this._register(this._editor.onDidChangeModelLanguage(() => this._update())); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_4__["CodeActionProviderRegistry"].onDidChange(() => this._update())); - this._update(); - } - dispose() { - super.dispose(); - this.setState(CodeActionsState.Empty, true); - } - _update() { - this._codeActionOracle.value = undefined; - this.setState(CodeActionsState.Empty); - const model = this._editor.getModel(); - if (model - && _common_modes_js__WEBPACK_IMPORTED_MODULE_4__["CodeActionProviderRegistry"].has(model) - && !this._editor.getOption(72 /* readOnly */)) { - const supportedActions = []; - for (const provider of _common_modes_js__WEBPACK_IMPORTED_MODULE_4__["CodeActionProviderRegistry"].all(model)) { - if (Array.isArray(provider.providedCodeActionKinds)) { - supportedActions.push(...provider.providedCodeActionKinds); - } - } - this._supportedCodeActions.set(supportedActions.join(' ')); - this._codeActionOracle.value = new CodeActionOracle(this._editor, this._markerService, trigger => { - var _a; - if (!trigger) { - this.setState(CodeActionsState.Empty); - return; - } - const actions = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["createCancelablePromise"])(token => Object(_codeAction_js__WEBPACK_IMPORTED_MODULE_7__["getCodeActions"])(model, trigger.selection, trigger.trigger, _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_6__["Progress"].None, token)); - if (trigger.trigger.type === 2 /* Manual */) { - (_a = this._progressService) === null || _a === void 0 ? void 0 : _a.showWhile(actions, 250); - } - this.setState(new CodeActionsState.Triggered(trigger.trigger, trigger.selection, trigger.position, actions)); - }, undefined); - this._codeActionOracle.value.trigger({ type: 1 /* Auto */ }); - } - else { - this._supportedCodeActions.reset(); - } - } - trigger(trigger) { - if (this._codeActionOracle.value) { - this._codeActionOracle.value.trigger(trigger); - } - } - setState(newState, skipNotify) { - if (newState === this._state) { - return; - } - // Cancel old request - if (this._state.type === 1 /* Triggered */) { - this._state.actions.cancel(); - } - this._state = newState; - if (!skipNotify) { - this._onDidChangeState.fire(newState); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionUi.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionUi.js ***! - \*************************************************************************************/ -/*! exports provided: CodeActionUi */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionUi", function() { return CodeActionUi; }); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_lazy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lazy.js */ "./node_modules/monaco-editor/esm/vs/base/common/lazy.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _message_messageController_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../message/messageController.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/message/messageController.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _codeActionMenu_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./codeActionMenu.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionMenu.js"); -/* harmony import */ var _lightBulbWidget_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lightBulbWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/lightBulbWidget.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - -let CodeActionUi = class CodeActionUi extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor(_editor, quickFixActionId, preferredFixActionId, delegate, instantiationService) { - super(); - this._editor = _editor; - this.delegate = delegate; - this._activeCodeActions = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["MutableDisposable"]()); - this._codeActionWidget = new _base_common_lazy_js__WEBPACK_IMPORTED_MODULE_1__["Lazy"](() => { - return this._register(instantiationService.createInstance(_codeActionMenu_js__WEBPACK_IMPORTED_MODULE_5__["CodeActionMenu"], this._editor, { - onSelectCodeAction: (action) => __awaiter(this, void 0, void 0, function* () { - this.delegate.applyCodeAction(action, /* retrigger */ true); - }) - })); - }); - this._lightBulbWidget = new _base_common_lazy_js__WEBPACK_IMPORTED_MODULE_1__["Lazy"](() => { - const widget = this._register(instantiationService.createInstance(_lightBulbWidget_js__WEBPACK_IMPORTED_MODULE_6__["LightBulbWidget"], this._editor, quickFixActionId, preferredFixActionId)); - this._register(widget.onClick(e => this.showCodeActionList(e.trigger, e.actions, e, { includeDisabledActions: false }))); - return widget; - }); - } - update(newState) { - var _a, _b, _c; - return __awaiter(this, void 0, void 0, function* () { - if (newState.type !== 1 /* Triggered */) { - (_a = this._lightBulbWidget.rawValue) === null || _a === void 0 ? void 0 : _a.hide(); - return; - } - let actions; - try { - actions = yield newState.actions; - } - catch (e) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - return; - } - this._lightBulbWidget.getValue().update(actions, newState.trigger, newState.position); - if (newState.trigger.type === 2 /* Manual */) { - if ((_b = newState.trigger.filter) === null || _b === void 0 ? void 0 : _b.include) { // Triggered for specific scope - // Check to see if we want to auto apply. - const validActionToApply = this.tryGetValidActionToApply(newState.trigger, actions); - if (validActionToApply) { - try { - yield this.delegate.applyCodeAction(validActionToApply, false); - } - finally { - actions.dispose(); - } - return; - } - // Check to see if there is an action that we would have applied were it not invalid - if (newState.trigger.context) { - const invalidAction = this.getInvalidActionThatWouldHaveBeenApplied(newState.trigger, actions); - if (invalidAction && invalidAction.disabled) { - _message_messageController_js__WEBPACK_IMPORTED_MODULE_3__["MessageController"].get(this._editor).showMessage(invalidAction.disabled, newState.trigger.context.position); - actions.dispose(); - return; - } - } - } - const includeDisabledActions = !!((_c = newState.trigger.filter) === null || _c === void 0 ? void 0 : _c.include); - if (newState.trigger.context) { - if (!actions.allActions.length || !includeDisabledActions && !actions.validActions.length) { - _message_messageController_js__WEBPACK_IMPORTED_MODULE_3__["MessageController"].get(this._editor).showMessage(newState.trigger.context.notAvailableMessage, newState.trigger.context.position); - this._activeCodeActions.value = actions; - actions.dispose(); - return; - } - } - this._activeCodeActions.value = actions; - this._codeActionWidget.getValue().show(newState.trigger, actions, newState.position, { includeDisabledActions }); - } - else { - // auto magically triggered - if (this._codeActionWidget.getValue().isVisible) { - // TODO: Figure out if we should update the showing menu? - actions.dispose(); - } - else { - this._activeCodeActions.value = actions; - } - } - }); - } - getInvalidActionThatWouldHaveBeenApplied(trigger, actions) { - if (!actions.allActions.length) { - return undefined; - } - if ((trigger.autoApply === "first" /* First */ && actions.validActions.length === 0) - || (trigger.autoApply === "ifSingle" /* IfSingle */ && actions.allActions.length === 1)) { - return actions.allActions.find(action => action.disabled); - } - return undefined; - } - tryGetValidActionToApply(trigger, actions) { - if (!actions.validActions.length) { - return undefined; - } - if ((trigger.autoApply === "first" /* First */ && actions.validActions.length > 0) - || (trigger.autoApply === "ifSingle" /* IfSingle */ && actions.validActions.length === 1)) { - return actions.validActions[0]; - } - return undefined; - } - showCodeActionList(trigger, actions, at, options) { - return __awaiter(this, void 0, void 0, function* () { - this._codeActionWidget.getValue().show(trigger, actions, at, options); - }); - } -}; -CodeActionUi = __decorate([ - __param(4, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_4__["IInstantiationService"]) -], CodeActionUi); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/lightBulbWidget.css": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/lightBulbWidget.css ***! - \*****************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_lightBulbWidget_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./lightBulbWidget.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/lightBulbWidget.css"); -/* harmony import */ var _css_loader_dist_cjs_js_lightBulbWidget_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_lightBulbWidget_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_lightBulbWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_lightBulbWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/lightBulbWidget.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/lightBulbWidget.js ***! - \****************************************************************************************/ -/*! exports provided: LightBulbWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LightBulbWidget", function() { return LightBulbWidget; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/globalMouseMoveMonitor.js */ "./node_modules/monaco-editor/esm/vs/base/browser/globalMouseMoveMonitor.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _lightBulbWidget_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lightBulbWidget.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/lightBulbWidget.css"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/browser/touch.js */ "./node_modules/monaco-editor/esm/vs/base/browser/touch.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - -var LightBulbState; -(function (LightBulbState) { - LightBulbState.Hidden = { type: 0 /* Hidden */ }; - class Showing { - constructor(actions, trigger, editorPosition, widgetPosition) { - this.actions = actions; - this.trigger = trigger; - this.editorPosition = editorPosition; - this.widgetPosition = widgetPosition; - this.type = 1 /* Showing */; - } - } - LightBulbState.Showing = Showing; -})(LightBulbState || (LightBulbState = {})); -let LightBulbWidget = class LightBulbWidget extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(_editor, _quickFixActionId, _preferredFixActionId, _keybindingService) { - super(); - this._editor = _editor; - this._quickFixActionId = _quickFixActionId; - this._preferredFixActionId = _preferredFixActionId; - this._keybindingService = _keybindingService; - this._onClick = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"]()); - this.onClick = this._onClick.event; - this._state = LightBulbState.Hidden; - this._domNode = document.createElement('div'); - this._domNode.className = _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_11__["Codicon"].lightBulb.classNames; - this._editor.addContentWidget(this); - this._register(this._editor.onDidChangeModelContent(_ => { - // cancel when the line in question has been removed - const editorModel = this._editor.getModel(); - if (this.state.type !== 1 /* Showing */ || !editorModel || this.state.editorPosition.lineNumber >= editorModel.getLineCount()) { - this.hide(); - } - })); - _base_browser_touch_js__WEBPACK_IMPORTED_MODULE_10__["Gesture"].ignoreTarget(this._domNode); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addStandardDisposableGenericMouseDownListner"](this._domNode, e => { - if (this.state.type !== 1 /* Showing */) { - return; - } - // Make sure that focus / cursor location is not lost when clicking widget icon - this._editor.focus(); - e.preventDefault(); - // a bit of extra work to make sure the menu - // doesn't cover the line-text - const { top, height } = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["getDomNodePagePosition"](this._domNode); - const lineHeight = this._editor.getOption(51 /* lineHeight */); - let pad = Math.floor(lineHeight / 3); - if (this.state.widgetPosition.position !== null && this.state.widgetPosition.position.lineNumber < this.state.editorPosition.lineNumber) { - pad += lineHeight; - } - this._onClick.fire({ - x: e.posx, - y: top + height + pad, - actions: this.state.actions, - trigger: this.state.trigger, - }); - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](this._domNode, 'mouseenter', (e) => { - if ((e.buttons & 1) !== 1) { - return; - } - // mouse enters lightbulb while the primary/left button - // is being pressed -> hide the lightbulb and block future - // showings until mouse is released - this.hide(); - const monitor = new _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_1__["GlobalMouseMoveMonitor"](); - monitor.startMonitoring(e.target, e.buttons, _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_1__["standardMouseMoveMerger"], () => { }, () => { - monitor.dispose(); - }); - })); - this._register(this._editor.onDidChangeConfiguration(e => { - // hide when told to do so - if (e.hasChanged(49 /* lightbulb */) && !this._editor.getOption(49 /* lightbulb */).enabled) { - this.hide(); - } - })); - this._updateLightBulbTitleAndIcon(); - this._register(this._keybindingService.onDidUpdateKeybindings(this._updateLightBulbTitleAndIcon, this)); - } - dispose() { - super.dispose(); - this._editor.removeContentWidget(this); - } - getId() { - return 'LightBulbWidget'; - } - getDomNode() { - return this._domNode; - } - getPosition() { - return this._state.type === 1 /* Showing */ ? this._state.widgetPosition : null; - } - update(actions, trigger, atPosition) { - if (actions.validActions.length <= 0) { - return this.hide(); - } - const options = this._editor.getOptions(); - if (!options.get(49 /* lightbulb */).enabled) { - return this.hide(); - } - const model = this._editor.getModel(); - if (!model) { - return this.hide(); - } - const { lineNumber, column } = model.validatePosition(atPosition); - const tabSize = model.getOptions().tabSize; - const fontInfo = options.get(36 /* fontInfo */); - const lineContent = model.getLineContent(lineNumber); - const indent = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_5__["TextModel"].computeIndentLevel(lineContent, tabSize); - const lineHasSpace = fontInfo.spaceWidth * indent > 22; - const isFolded = (lineNumber) => { - return lineNumber > 2 && this._editor.getTopForLineNumber(lineNumber) === this._editor.getTopForLineNumber(lineNumber - 1); - }; - let effectiveLineNumber = lineNumber; - if (!lineHasSpace) { - if (lineNumber > 1 && !isFolded(lineNumber - 1)) { - effectiveLineNumber -= 1; - } - else if (!isFolded(lineNumber + 1)) { - effectiveLineNumber += 1; - } - else if (column * fontInfo.spaceWidth < 22) { - // cannot show lightbulb above/below and showing - // it inline would overlay the cursor... - return this.hide(); - } - } - this.state = new LightBulbState.Showing(actions, trigger, atPosition, { - position: { lineNumber: effectiveLineNumber, column: 1 }, - preference: LightBulbWidget._posPref - }); - this._editor.layoutContentWidget(this); - } - hide() { - this.state = LightBulbState.Hidden; - this._editor.layoutContentWidget(this); - } - get state() { return this._state; } - set state(value) { - this._state = value; - this._updateLightBulbTitleAndIcon(); - } - _updateLightBulbTitleAndIcon() { - if (this.state.type === 1 /* Showing */ && this.state.actions.hasAutoFix) { - // update icon - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["removeClasses"](this._domNode, _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_11__["Codicon"].lightBulb.classNames); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addClasses"](this._domNode, _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_11__["Codicon"].lightbulbAutofix.classNames); - const preferredKb = this._keybindingService.lookupKeybinding(this._preferredFixActionId); - if (preferredKb) { - this.title = _nls_js__WEBPACK_IMPORTED_MODULE_6__["localize"]('prefferedQuickFixWithKb', "Show Fixes. Preferred Fix Available ({0})", preferredKb.getLabel()); - return; - } - } - // update icon - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["removeClasses"](this._domNode, _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_11__["Codicon"].lightbulbAutofix.classNames); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addClasses"](this._domNode, _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_11__["Codicon"].lightBulb.classNames); - const kb = this._keybindingService.lookupKeybinding(this._quickFixActionId); - if (kb) { - this.title = _nls_js__WEBPACK_IMPORTED_MODULE_6__["localize"]('quickFixWithKb', "Show Fixes ({0})", kb.getLabel()); - } - else { - this.title = _nls_js__WEBPACK_IMPORTED_MODULE_6__["localize"]('quickFix', "Show Fixes"); - } - } - set title(value) { - this._domNode.title = value; - } -}; -LightBulbWidget._posPref = [0 /* EXACT */]; -LightBulbWidget = __decorate([ - __param(3, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_7__["IKeybindingService"]) -], LightBulbWidget); - -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_8__["registerThemingParticipant"])((theme, collector) => { - // Lightbulb Icon - const editorLightBulbForegroundColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__["editorLightBulbForeground"]); - if (editorLightBulbForegroundColor) { - collector.addRule(` - .monaco-editor .contentWidgets ${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_11__["Codicon"].lightBulb.cssSelector} { - color: ${editorLightBulbForegroundColor}; - }`); - } - // Lightbulb Auto Fix Icon - const editorLightBulbAutoFixForegroundColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__["editorLightBulbAutoFixForeground"]); - if (editorLightBulbAutoFixForegroundColor) { - collector.addRule(` - .monaco-editor .contentWidgets ${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_11__["Codicon"].lightbulbAutofix.cssSelector} { - color: ${editorLightBulbAutoFixForegroundColor}; - }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/types.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/types.js ***! - \******************************************************************************/ -/*! exports provided: CodeActionKind, mayIncludeActionsOfKind, filtersAction, CodeActionCommandArgs */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return CodeActionKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mayIncludeActionsOfKind", function() { return mayIncludeActionsOfKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filtersAction", function() { return filtersAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionCommandArgs", function() { return CodeActionCommandArgs; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class CodeActionKind { - constructor(value) { - this.value = value; - } - equals(other) { - return this.value === other.value; - } - contains(other) { - return this.equals(other) || this.value === '' || Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["startsWith"])(other.value, this.value + CodeActionKind.sep); - } - intersects(other) { - return this.contains(other) || other.contains(this); - } - append(part) { - return new CodeActionKind(this.value + CodeActionKind.sep + part); - } -} -CodeActionKind.sep = '.'; -CodeActionKind.None = new CodeActionKind('@@none@@'); // Special code action that contains nothing -CodeActionKind.Empty = new CodeActionKind(''); -CodeActionKind.QuickFix = new CodeActionKind('quickfix'); -CodeActionKind.Refactor = new CodeActionKind('refactor'); -CodeActionKind.Source = new CodeActionKind('source'); -CodeActionKind.SourceOrganizeImports = CodeActionKind.Source.append('organizeImports'); -CodeActionKind.SourceFixAll = CodeActionKind.Source.append('fixAll'); -function mayIncludeActionsOfKind(filter, providedKind) { - // A provided kind may be a subset or superset of our filtered kind. - if (filter.include && !filter.include.intersects(providedKind)) { - return false; - } - if (filter.excludes) { - if (filter.excludes.some(exclude => excludesAction(providedKind, exclude, filter.include))) { - return false; - } - } - // Don't return source actions unless they are explicitly requested - if (!filter.includeSourceActions && CodeActionKind.Source.contains(providedKind)) { - return false; - } - return true; -} -function filtersAction(filter, action) { - const actionKind = action.kind ? new CodeActionKind(action.kind) : undefined; - // Filter out actions by kind - if (filter.include) { - if (!actionKind || !filter.include.contains(actionKind)) { - return false; - } - } - if (filter.excludes) { - if (actionKind && filter.excludes.some(exclude => excludesAction(actionKind, exclude, filter.include))) { - return false; - } - } - // Don't return source actions unless they are explicitly requested - if (!filter.includeSourceActions) { - if (actionKind && CodeActionKind.Source.contains(actionKind)) { - return false; - } - } - if (filter.onlyIncludePreferredActions) { - if (!action.isPreferred) { - return false; - } - } - return true; -} -function excludesAction(providedKind, exclude, include) { - if (!exclude.contains(providedKind)) { - return false; - } - if (include && exclude.contains(include)) { - // The include is more specific, don't filter out - return false; - } - return true; -} -class CodeActionCommandArgs { - constructor(kind, apply, preferred) { - this.kind = kind; - this.apply = apply; - this.preferred = preferred; - } - static fromUser(arg, defaults) { - if (!arg || typeof arg !== 'object') { - return new CodeActionCommandArgs(defaults.kind, defaults.apply, false); - } - return new CodeActionCommandArgs(CodeActionCommandArgs.getKindFromUser(arg, defaults.kind), CodeActionCommandArgs.getApplyFromUser(arg, defaults.apply), CodeActionCommandArgs.getPreferredUser(arg)); - } - static getApplyFromUser(arg, defaultAutoApply) { - switch (typeof arg.apply === 'string' ? arg.apply.toLowerCase() : '') { - case 'first': return "first" /* First */; - case 'never': return "never" /* Never */; - case 'ifsingle': return "ifSingle" /* IfSingle */; - default: return defaultAutoApply; - } - } - static getKindFromUser(arg, defaultKind) { - return typeof arg.kind === 'string' - ? new CodeActionKind(arg.kind) - : defaultKind; - } - static getPreferredUser(arg) { - return typeof arg.preferred === 'boolean' - ? arg.preferred - : false; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codeLensCache.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codeLensCache.js ***! - \************************************************************************************/ -/*! exports provided: ICodeLensCache, CodeLensCache */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ICodeLensCache", function() { return ICodeLensCache; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLensCache", function() { return CodeLensCache; }); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../platform/instantiation/common/extensions.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/extensions.js"); -/* harmony import */ var _codelens_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./codelens.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelens.js"); -/* harmony import */ var _base_common_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/map.js */ "./node_modules/monaco-editor/esm/vs/base/common/map.js"); -/* harmony import */ var _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/storage/common/storage.js */ "./node_modules/monaco-editor/esm/vs/platform/storage/common/storage.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_functional_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/functional.js */ "./node_modules/monaco-editor/esm/vs/base/common/functional.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - -const ICodeLensCache = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('ICodeLensCache'); -class CacheItem { - constructor(lineCount, data) { - this.lineCount = lineCount; - this.data = data; - } -} -let CodeLensCache = class CodeLensCache { - constructor(storageService) { - this._fakeProvider = new class { - provideCodeLenses() { - throw new Error('not supported'); - } - }; - this._cache = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_3__["LRUCache"](20, 0.75); - // remove old data - const oldkey = 'codelens/cache'; - Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_6__["runWhenIdle"])(() => storageService.remove(oldkey, 1 /* WORKSPACE */)); - // restore lens data on start - const key = 'codelens/cache2'; - const raw = storageService.get(key, 1 /* WORKSPACE */, '{}'); - this._deserialize(raw); - // store lens data on shutdown - Object(_base_common_functional_js__WEBPACK_IMPORTED_MODULE_7__["once"])(storageService.onWillSaveState)(e => { - if (e.reason === _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_4__["WillSaveStateReason"].SHUTDOWN) { - storageService.store(key, this._serialize(), 1 /* WORKSPACE */); - } - }); - } - put(model, data) { - // create a copy of the model that is without command-ids - // but with comand-labels - const copyItems = data.lenses.map(item => { - var _a; - return { - range: item.symbol.range, - command: item.symbol.command && { id: '', title: (_a = item.symbol.command) === null || _a === void 0 ? void 0 : _a.title }, - }; - }); - const copyModel = new _codelens_js__WEBPACK_IMPORTED_MODULE_2__["CodeLensModel"](); - copyModel.add({ lenses: copyItems, dispose: () => { } }, this._fakeProvider); - const item = new CacheItem(model.getLineCount(), copyModel); - this._cache.set(model.uri.toString(), item); - } - get(model) { - const item = this._cache.get(model.uri.toString()); - return item && item.lineCount === model.getLineCount() ? item.data : undefined; - } - delete(model) { - this._cache.delete(model.uri.toString()); - } - // --- persistence - _serialize() { - const data = Object.create(null); - for (const [key, value] of this._cache) { - const lines = new Set(); - for (const d of value.data.lenses) { - lines.add(d.symbol.range.startLineNumber); - } - data[key] = { - lineCount: value.lineCount, - lines: [...lines.values()] - }; - } - return JSON.stringify(data); - } - _deserialize(raw) { - try { - const data = JSON.parse(raw); - for (const key in data) { - const element = data[key]; - const lenses = []; - for (const line of element.lines) { - lenses.push({ range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](line, 1, line, 11) }); - } - const model = new _codelens_js__WEBPACK_IMPORTED_MODULE_2__["CodeLensModel"](); - model.add({ lenses, dispose() { } }, this._fakeProvider); - this._cache.set(key, new CacheItem(element.lineCount, model)); - } - } - catch (_a) { - // ignore... - } - } -}; -CodeLensCache = __decorate([ - __param(0, _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_4__["IStorageService"]) -], CodeLensCache); - -Object(_platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_1__["registerSingleton"])(ICodeLensCache, CodeLensCache); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelens.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelens.js ***! - \*******************************************************************************/ -/*! exports provided: CodeLensModel, getCodeLensData */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLensModel", function() { return CodeLensModel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCodeLensData", function() { return getCodeLensData; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - -class CodeLensModel { - constructor() { - this.lenses = []; - this._disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["DisposableStore"](); - } - dispose() { - this._disposables.dispose(); - } - add(list, provider) { - this._disposables.add(list); - for (const symbol of list.lenses) { - this.lenses.push({ symbol, provider }); - } - } -} -function getCodeLensData(model, token) { - const provider = _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["CodeLensProviderRegistry"].ordered(model); - const providerRanks = new Map(); - const result = new CodeLensModel(); - const promises = provider.map((provider, i) => { - providerRanks.set(provider, i); - return Promise.resolve(provider.provideCodeLenses(model, token)) - .then(list => list && result.add(list, provider)) - .catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["onUnexpectedExternalError"]); - }); - return Promise.all(promises).then(() => { - result.lenses = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["mergeSort"])(result.lenses, (a, b) => { - // sort by lineNumber, provider-rank, and column - if (a.symbol.range.startLineNumber < b.symbol.range.startLineNumber) { - return -1; - } - else if (a.symbol.range.startLineNumber > b.symbol.range.startLineNumber) { - return 1; - } - else if (providerRanks.get(a.provider) < providerRanks.get(b.provider)) { - return -1; - } - else if (providerRanks.get(a.provider) > providerRanks.get(b.provider)) { - return 1; - } - else if (a.symbol.range.startColumn < b.symbol.range.startColumn) { - return -1; - } - else if (a.symbol.range.startColumn > b.symbol.range.startColumn) { - return 1; - } - else { - return 0; - } - }); - return result; - }); -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerLanguageCommand"])('_executeCodeLensProvider', function (accessor, args) { - let { resource, itemResolveCount } = args; - if (!(resource instanceof _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"])) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["illegalArgument"])(); - } - const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_6__["IModelService"]).getModel(resource); - if (!model) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["illegalArgument"])(); - } - const result = []; - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["DisposableStore"](); - return getCodeLensData(model, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationToken"].None).then(value => { - disposables.add(value); - let resolve = []; - for (const item of value.lenses) { - if (typeof itemResolveCount === 'undefined' || Boolean(item.symbol.command)) { - result.push(item.symbol); - } - else if (itemResolveCount-- > 0 && item.provider.resolveCodeLens) { - resolve.push(Promise.resolve(item.provider.resolveCodeLens(model, item.symbol, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationToken"].None)).then(symbol => result.push(symbol || item.symbol))); - } - } - return Promise.all(resolve); - }).then(() => { - return result; - }).finally(() => { - // make sure to return results, then (on next tick) - // dispose the results - setTimeout(() => disposables.dispose(), 100); - }); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelensController.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelensController.js ***! - \*****************************************************************************************/ -/*! exports provided: CodeLensContribution */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLensContribution", function() { return CodeLensContribution; }); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/core/editorState.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/core/editorState.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _codelens_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./codelens.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelens.js"); -/* harmony import */ var _codelensWidget_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./codelensWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelensWidget.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _codeLensCache_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./codeLensCache.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codeLensCache.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_hash_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../base/common/hash.js */ "./node_modules/monaco-editor/esm/vs/base/common/hash.js"); -/* harmony import */ var _platform_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/quickinput/common/quickInput.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickInput.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - -let CodeLensContribution = class CodeLensContribution { - constructor(_editor, _commandService, _notificationService, _codeLensCache) { - this._editor = _editor; - this._commandService = _commandService; - this._notificationService = _notificationService; - this._codeLensCache = _codeLensCache; - this._globalToDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["DisposableStore"](); - this._localToDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["DisposableStore"](); - this._lenses = []; - this._oldCodeLensModels = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["DisposableStore"](); - this._modelChangeCounter = 0; - this._isEnabled = this._editor.getOption(11 /* codeLens */); - this._globalToDispose.add(this._editor.onDidChangeModel(() => this._onModelChange())); - this._globalToDispose.add(this._editor.onDidChangeModelLanguage(() => this._onModelChange())); - this._globalToDispose.add(this._editor.onDidChangeConfiguration(() => { - const prevIsEnabled = this._isEnabled; - this._isEnabled = this._editor.getOption(11 /* codeLens */); - if (prevIsEnabled !== this._isEnabled) { - this._onModelChange(); - } - })); - this._globalToDispose.add(_common_modes_js__WEBPACK_IMPORTED_MODULE_5__["CodeLensProviderRegistry"].onDidChange(this._onModelChange, this)); - this._globalToDispose.add(this._editor.onDidChangeConfiguration(e => { - if (e.hasChanged(36 /* fontInfo */)) { - this._updateLensStyle(); - } - })); - this._onModelChange(); - this._styleClassName = '_' + Object(_base_common_hash_js__WEBPACK_IMPORTED_MODULE_12__["hash"])(this._editor.getId()).toString(16); - this._styleElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_11__["createStyleSheet"](_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_11__["isInShadowDOM"](this._editor.getContainerDomNode()) - ? this._editor.getContainerDomNode() - : undefined); - this._updateLensStyle(); - } - dispose() { - this._localDispose(); - this._globalToDispose.dispose(); - this._oldCodeLensModels.dispose(); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(this._currentCodeLensModel); - } - _updateLensStyle() { - const options = this._editor.getOptions(); - const fontInfo = options.get(36 /* fontInfo */); - const lineHeight = options.get(51 /* lineHeight */); - const height = Math.round(lineHeight * 1.1); - const fontSize = Math.round(fontInfo.fontSize * 0.9); - const newStyle = ` - .monaco-editor .codelens-decoration.${this._styleClassName} { height: ${height}px; line-height: ${lineHeight}px; font-size: ${fontSize}px; padding-right: ${Math.round(fontInfo.fontSize * 0.45)}px;} - .monaco-editor .codelens-decoration.${this._styleClassName} > a > .codicon { line-height: ${lineHeight}px; font-size: ${fontSize}px; } - `; - this._styleElement.textContent = newStyle; - } - _localDispose() { - if (this._currentFindCodeLensSymbolsPromise) { - this._currentFindCodeLensSymbolsPromise.cancel(); - this._currentFindCodeLensSymbolsPromise = undefined; - this._modelChangeCounter++; - } - if (this._currentResolveCodeLensSymbolsPromise) { - this._currentResolveCodeLensSymbolsPromise.cancel(); - this._currentResolveCodeLensSymbolsPromise = undefined; - } - this._localToDispose.clear(); - this._oldCodeLensModels.clear(); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(this._currentCodeLensModel); - } - _onModelChange() { - this._localDispose(); - const model = this._editor.getModel(); - if (!model) { - return; - } - if (!this._isEnabled) { - return; - } - const cachedLenses = this._codeLensCache.get(model); - if (cachedLenses) { - this._renderCodeLensSymbols(cachedLenses); - } - if (!_common_modes_js__WEBPACK_IMPORTED_MODULE_5__["CodeLensProviderRegistry"].has(model)) { - // no provider -> return but check with - // cached lenses. they expire after 30 seconds - if (cachedLenses) { - this._localToDispose.add(Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["disposableTimeout"])(() => { - const cachedLensesNow = this._codeLensCache.get(model); - if (cachedLenses === cachedLensesNow) { - this._codeLensCache.delete(model); - this._onModelChange(); - } - }, 30 * 1000)); - } - return; - } - for (const provider of _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["CodeLensProviderRegistry"].all(model)) { - if (typeof provider.onDidChange === 'function') { - let registration = provider.onDidChange(() => scheduler.schedule()); - this._localToDispose.add(registration); - } - } - const detectVisibleLenses = this._detectVisibleLenses = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["RunOnceScheduler"](() => this._onViewportChanged(), 250); - const scheduler = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["RunOnceScheduler"](() => { - const counterValue = ++this._modelChangeCounter; - if (this._currentFindCodeLensSymbolsPromise) { - this._currentFindCodeLensSymbolsPromise.cancel(); - } - this._currentFindCodeLensSymbolsPromise = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["createCancelablePromise"])(token => Object(_codelens_js__WEBPACK_IMPORTED_MODULE_6__["getCodeLensData"])(model, token)); - this._currentFindCodeLensSymbolsPromise.then(result => { - if (counterValue === this._modelChangeCounter) { // only the last one wins - if (this._currentCodeLensModel) { - this._oldCodeLensModels.add(this._currentCodeLensModel); - } - this._currentCodeLensModel = result; - // cache model to reduce flicker - this._codeLensCache.put(model, result); - // render lenses - this._renderCodeLensSymbols(result); - detectVisibleLenses.schedule(); - } - }, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"]); - }, 250); - this._localToDispose.add(scheduler); - this._localToDispose.add(detectVisibleLenses); - this._localToDispose.add(this._editor.onDidChangeModelContent(() => { - this._editor.changeDecorations(decorationsAccessor => { - this._editor.changeViewZones(viewZonesAccessor => { - let toDispose = []; - let lastLensLineNumber = -1; - this._lenses.forEach((lens) => { - if (!lens.isValid() || lastLensLineNumber === lens.getLineNumber()) { - // invalid -> lens collapsed, attach range doesn't exist anymore - // line_number -> lenses should never be on the same line - toDispose.push(lens); - } - else { - lens.update(viewZonesAccessor); - lastLensLineNumber = lens.getLineNumber(); - } - }); - let helper = new _codelensWidget_js__WEBPACK_IMPORTED_MODULE_7__["CodeLensHelper"](); - toDispose.forEach((l) => { - l.dispose(helper, viewZonesAccessor); - this._lenses.splice(this._lenses.indexOf(l), 1); - }); - helper.commit(decorationsAccessor); - }); - }); - // Compute new `visible` code lenses - detectVisibleLenses.schedule(); - // Ask for all references again - scheduler.schedule(); - })); - this._localToDispose.add(this._editor.onDidScrollChange(e => { - if (e.scrollTopChanged && this._lenses.length > 0) { - detectVisibleLenses.schedule(); - } - })); - this._localToDispose.add(this._editor.onDidLayoutChange(() => { - detectVisibleLenses.schedule(); - })); - this._localToDispose.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["toDisposable"])(() => { - if (this._editor.getModel()) { - const scrollState = _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_3__["StableEditorScrollState"].capture(this._editor); - this._editor.changeDecorations(decorationsAccessor => { - this._editor.changeViewZones(viewZonesAccessor => { - this._disposeAllLenses(decorationsAccessor, viewZonesAccessor); - }); - }); - scrollState.restore(this._editor); - } - else { - // No accessors available - this._disposeAllLenses(undefined, undefined); - } - })); - this._localToDispose.add(this._editor.onMouseUp(e => { - if (e.target.type !== 9 /* CONTENT_WIDGET */) { - return; - } - let target = e.target.element; - if ((target === null || target === void 0 ? void 0 : target.tagName) === 'SPAN') { - target = target.parentElement; - } - if ((target === null || target === void 0 ? void 0 : target.tagName) === 'A') { - for (const lens of this._lenses) { - let command = lens.getCommand(target); - if (command) { - this._commandService.executeCommand(command.id, ...(command.arguments || [])).catch(err => this._notificationService.error(err)); - break; - } - } - } - })); - scheduler.schedule(); - } - _disposeAllLenses(decChangeAccessor, viewZoneChangeAccessor) { - const helper = new _codelensWidget_js__WEBPACK_IMPORTED_MODULE_7__["CodeLensHelper"](); - for (const lens of this._lenses) { - lens.dispose(helper, viewZoneChangeAccessor); - } - if (decChangeAccessor) { - helper.commit(decChangeAccessor); - } - this._lenses = []; - } - _renderCodeLensSymbols(symbols) { - if (!this._editor.hasModel()) { - return; - } - let maxLineNumber = this._editor.getModel().getLineCount(); - let groups = []; - let lastGroup; - for (let symbol of symbols.lenses) { - let line = symbol.symbol.range.startLineNumber; - if (line < 1 || line > maxLineNumber) { - // invalid code lens - continue; - } - else if (lastGroup && lastGroup[lastGroup.length - 1].symbol.range.startLineNumber === line) { - // on same line as previous - lastGroup.push(symbol); - } - else { - // on later line as previous - lastGroup = [symbol]; - groups.push(lastGroup); - } - } - const scrollState = _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_3__["StableEditorScrollState"].capture(this._editor); - this._editor.changeDecorations(decorationsAccessor => { - this._editor.changeViewZones(viewZoneAccessor => { - const helper = new _codelensWidget_js__WEBPACK_IMPORTED_MODULE_7__["CodeLensHelper"](); - let codeLensIndex = 0; - let groupsIndex = 0; - while (groupsIndex < groups.length && codeLensIndex < this._lenses.length) { - let symbolsLineNumber = groups[groupsIndex][0].symbol.range.startLineNumber; - let codeLensLineNumber = this._lenses[codeLensIndex].getLineNumber(); - if (codeLensLineNumber < symbolsLineNumber) { - this._lenses[codeLensIndex].dispose(helper, viewZoneAccessor); - this._lenses.splice(codeLensIndex, 1); - } - else if (codeLensLineNumber === symbolsLineNumber) { - this._lenses[codeLensIndex].updateCodeLensSymbols(groups[groupsIndex], helper); - groupsIndex++; - codeLensIndex++; - } - else { - this._lenses.splice(codeLensIndex, 0, new _codelensWidget_js__WEBPACK_IMPORTED_MODULE_7__["CodeLensWidget"](groups[groupsIndex], this._editor, this._styleClassName, helper, viewZoneAccessor, () => this._detectVisibleLenses && this._detectVisibleLenses.schedule())); - codeLensIndex++; - groupsIndex++; - } - } - // Delete extra code lenses - while (codeLensIndex < this._lenses.length) { - this._lenses[codeLensIndex].dispose(helper, viewZoneAccessor); - this._lenses.splice(codeLensIndex, 1); - } - // Create extra symbols - while (groupsIndex < groups.length) { - this._lenses.push(new _codelensWidget_js__WEBPACK_IMPORTED_MODULE_7__["CodeLensWidget"](groups[groupsIndex], this._editor, this._styleClassName, helper, viewZoneAccessor, () => this._detectVisibleLenses && this._detectVisibleLenses.schedule())); - groupsIndex++; - } - helper.commit(decorationsAccessor); - }); - }); - scrollState.restore(this._editor); - } - _onViewportChanged() { - if (this._currentResolveCodeLensSymbolsPromise) { - this._currentResolveCodeLensSymbolsPromise.cancel(); - this._currentResolveCodeLensSymbolsPromise = undefined; - } - const model = this._editor.getModel(); - if (!model) { - return; - } - const toResolve = []; - const lenses = []; - this._lenses.forEach((lens) => { - const request = lens.computeIfNecessary(model); - if (request) { - toResolve.push(request); - lenses.push(lens); - } - }); - if (toResolve.length === 0) { - return; - } - const resolvePromise = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["createCancelablePromise"])(token => { - const promises = toResolve.map((request, i) => { - const resolvedSymbols = new Array(request.length); - const promises = request.map((request, i) => { - if (!request.symbol.command && typeof request.provider.resolveCodeLens === 'function') { - return Promise.resolve(request.provider.resolveCodeLens(model, request.symbol, token)).then(symbol => { - resolvedSymbols[i] = symbol; - }, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedExternalError"]); - } - else { - resolvedSymbols[i] = request.symbol; - return Promise.resolve(undefined); - } - }); - return Promise.all(promises).then(() => { - if (!token.isCancellationRequested && !lenses[i].isDisposed()) { - lenses[i].updateCommands(resolvedSymbols); - } - }); - }); - return Promise.all(promises); - }); - this._currentResolveCodeLensSymbolsPromise = resolvePromise; - this._currentResolveCodeLensSymbolsPromise.then(() => { - if (this._currentCodeLensModel) { // update the cached state with new resolved items - this._codeLensCache.put(model, this._currentCodeLensModel); - } - this._oldCodeLensModels.clear(); // dispose old models once we have updated the UI with the current model - if (resolvePromise === this._currentResolveCodeLensSymbolsPromise) { - this._currentResolveCodeLensSymbolsPromise = undefined; - } - }, err => { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"])(err); // can also be cancellation! - if (resolvePromise === this._currentResolveCodeLensSymbolsPromise) { - this._currentResolveCodeLensSymbolsPromise = undefined; - } - }); - } - getLenses() { - return this._lenses; - } -}; -CodeLensContribution.ID = 'css.editor.codeLens'; -CodeLensContribution = __decorate([ - __param(1, _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_8__["ICommandService"]), - __param(2, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_9__["INotificationService"]), - __param(3, _codeLensCache_js__WEBPACK_IMPORTED_MODULE_10__["ICodeLensCache"]) -], CodeLensContribution); - -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorContribution"])(CodeLensContribution.ID, CodeLensContribution); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(class ShowLensesInCurrentLine extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'codelens.showLensesInCurrentLine', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_15__["EditorContextKeys"].hasCodeLensProvider, - label: Object(_nls_js__WEBPACK_IMPORTED_MODULE_14__["localize"])('showLensOnLine', "Show CodeLens Commands For Current Line"), - alias: 'Show CodeLens Commands For Current Line', - }); - } - run(accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - if (!editor.hasModel()) { - return; - } - const quickInputService = accessor.get(_platform_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_13__["IQuickInputService"]); - const commandService = accessor.get(_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_8__["ICommandService"]); - const notificationService = accessor.get(_platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_9__["INotificationService"]); - const lineNumber = editor.getSelection().positionLineNumber; - const codelensController = editor.getContribution(CodeLensContribution.ID); - const items = []; - for (let lens of codelensController.getLenses()) { - if (lens.getLineNumber() === lineNumber) { - for (let item of lens.getItems()) { - const { command } = item.symbol; - if (command) { - items.push({ - label: command.title, - command: command - }); - } - } - } - } - if (items.length === 0) { - // We dont want an empty picker - return; - } - const item = yield quickInputService.pick(items, { canPickMany: false }); - if (!item) { - // Nothing picked - return; - } - try { - yield commandService.executeCommand(item.command.id, ...(item.command.arguments || [])); - } - catch (err) { - notificationService.error(err); - } - }); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelensWidget.css": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelensWidget.css ***! - \**************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_codelensWidget_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./codelensWidget.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelensWidget.css"); -/* harmony import */ var _css_loader_dist_cjs_js_codelensWidget_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_codelensWidget_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_codelensWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_codelensWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelensWidget.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelensWidget.js ***! - \*************************************************************************************/ -/*! exports provided: CodeLensHelper, CodeLensWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLensHelper", function() { return CodeLensHelper; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLensWidget", function() { return CodeLensWidget; }); -/* harmony import */ var _codelensWidget_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./codelensWidget.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelensWidget.css"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - -class CodeLensViewZone { - constructor(afterLineNumber, onHeight) { - this.afterLineNumber = afterLineNumber; - this._onHeight = onHeight; - this.heightInLines = 1; - this.suppressMouseDown = true; - this.domNode = document.createElement('div'); - } - onComputedHeight(height) { - if (this._lastHeight === undefined) { - this._lastHeight = height; - } - else if (this._lastHeight !== height) { - this._lastHeight = height; - this._onHeight(); - } - } -} -class CodeLensContentWidget { - constructor(editor, className, line) { - // Editor.IContentWidget.allowEditorOverflow - this.allowEditorOverflow = false; - this.suppressMouseDown = true; - this._commands = new Map(); - this._isEmpty = true; - this._editor = editor; - this._id = `codelens.widget-${(CodeLensContentWidget._idPool++)}`; - this.updatePosition(line); - this._domNode = document.createElement('span'); - this._domNode.className = `codelens-decoration ${className}`; - } - withCommands(lenses, animate) { - this._commands.clear(); - let innerHtml = ''; - let hasSymbol = false; - for (let i = 0; i < lenses.length; i++) { - const lens = lenses[i]; - if (!lens) { - continue; - } - hasSymbol = true; - if (lens.command) { - const title = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__["renderCodicons"])(Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["escape"])(lens.command.title)); - if (lens.command.id) { - innerHtml += `
    ${title}`; - this._commands.set(String(i), lens.command); - } - else { - innerHtml += `${title}`; - } - if (i + 1 < lenses.length) { - innerHtml += ' | '; - } - } - } - if (!hasSymbol) { - // symbols but no commands - this._domNode.innerHTML = 'no commands'; - } - else { - // symbols and commands - if (!innerHtml) { - innerHtml = '\u00a0'; - } - this._domNode.innerHTML = innerHtml; - if (this._isEmpty && animate) { - this._domNode.classList.add('fadein'); - } - this._isEmpty = false; - } - } - getCommand(link) { - return link.parentElement === this._domNode - ? this._commands.get(link.id) - : undefined; - } - getId() { - return this._id; - } - getDomNode() { - return this._domNode; - } - updatePosition(line) { - const column = this._editor.getModel().getLineFirstNonWhitespaceColumn(line); - this._widgetPosition = { - position: { lineNumber: line, column: column }, - preference: [1 /* ABOVE */] - }; - } - getPosition() { - return this._widgetPosition || null; - } -} -CodeLensContentWidget._idPool = 0; -class CodeLensHelper { - constructor() { - this._removeDecorations = []; - this._addDecorations = []; - this._addDecorationsCallbacks = []; - } - addDecoration(decoration, callback) { - this._addDecorations.push(decoration); - this._addDecorationsCallbacks.push(callback); - } - removeDecoration(decorationId) { - this._removeDecorations.push(decorationId); - } - commit(changeAccessor) { - let resultingDecorations = changeAccessor.deltaDecorations(this._removeDecorations, this._addDecorations); - for (let i = 0, len = resultingDecorations.length; i < len; i++) { - this._addDecorationsCallbacks[i](resultingDecorations[i]); - } - } -} -class CodeLensWidget { - constructor(data, editor, className, helper, viewZoneChangeAccessor, updateCallback) { - this._isDisposed = false; - this._editor = editor; - this._className = className; - this._data = data; - // create combined range, track all ranges with decorations, - // check if there is already something to render - this._decorationIds = []; - let range; - let lenses = []; - this._data.forEach((codeLensData, i) => { - if (codeLensData.symbol.command) { - lenses.push(codeLensData.symbol); - } - helper.addDecoration({ - range: codeLensData.symbol.range, - options: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_4__["ModelDecorationOptions"].EMPTY - }, id => this._decorationIds[i] = id); - // the range contains all lenses on this line - if (!range) { - range = _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].lift(codeLensData.symbol.range); - } - else { - range = _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].plusRange(range, codeLensData.symbol.range); - } - }); - this._viewZone = new CodeLensViewZone(range.startLineNumber - 1, updateCallback); - this._viewZoneId = viewZoneChangeAccessor.addZone(this._viewZone); - if (lenses.length > 0) { - this._createContentWidgetIfNecessary(); - this._contentWidget.withCommands(lenses, false); - } - } - _createContentWidgetIfNecessary() { - if (!this._contentWidget) { - this._contentWidget = new CodeLensContentWidget(this._editor, this._className, this._viewZone.afterLineNumber + 1); - this._editor.addContentWidget(this._contentWidget); - } - } - dispose(helper, viewZoneChangeAccessor) { - this._decorationIds.forEach(helper.removeDecoration, helper); - this._decorationIds = []; - if (viewZoneChangeAccessor) { - viewZoneChangeAccessor.removeZone(this._viewZoneId); - } - if (this._contentWidget) { - this._editor.removeContentWidget(this._contentWidget); - this._contentWidget = undefined; - } - this._isDisposed = true; - } - isDisposed() { - return this._isDisposed; - } - isValid() { - return this._decorationIds.some((id, i) => { - const range = this._editor.getModel().getDecorationRange(id); - const symbol = this._data[i].symbol; - return !!(range && _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].isEmpty(symbol.range) === range.isEmpty()); - }); - } - updateCodeLensSymbols(data, helper) { - this._decorationIds.forEach(helper.removeDecoration, helper); - this._decorationIds = []; - this._data = data; - this._data.forEach((codeLensData, i) => { - helper.addDecoration({ - range: codeLensData.symbol.range, - options: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_4__["ModelDecorationOptions"].EMPTY - }, id => this._decorationIds[i] = id); - }); - } - computeIfNecessary(model) { - if (!this._viewZone.domNode.hasAttribute('monaco-visible-view-zone')) { - return null; - } - // Read editor current state - for (let i = 0; i < this._decorationIds.length; i++) { - const range = model.getDecorationRange(this._decorationIds[i]); - if (range) { - this._data[i].symbol.range = range; - } - } - return this._data; - } - updateCommands(symbols) { - this._createContentWidgetIfNecessary(); - this._contentWidget.withCommands(symbols, true); - for (let i = 0; i < this._data.length; i++) { - const resolved = symbols[i]; - if (resolved) { - const { symbol } = this._data[i]; - symbol.command = resolved.command || symbol.command; - } - } - } - getCommand(link) { - var _a; - return (_a = this._contentWidget) === null || _a === void 0 ? void 0 : _a.getCommand(link); - } - getLineNumber() { - const range = this._editor.getModel().getDecorationRange(this._decorationIds[0]); - if (range) { - return range.startLineNumber; - } - return -1; - } - update(viewZoneChangeAccessor) { - if (this.isValid()) { - const range = this._editor.getModel().getDecorationRange(this._decorationIds[0]); - if (range) { - this._viewZone.afterLineNumber = range.startLineNumber - 1; - viewZoneChangeAccessor.layoutZone(this._viewZoneId); - if (this._contentWidget) { - this._contentWidget.updatePosition(range.startLineNumber); - this._editor.layoutContentWidget(this._contentWidget); - } - } - } - } - getItems() { - return this._data; - } -} -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__["registerThemingParticipant"])((theme, collector) => { - const codeLensForeground = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["editorCodeLensForeground"]); - if (codeLensForeground) { - collector.addRule(`.monaco-editor .codelens-decoration { color: ${codeLensForeground}; }`); - collector.addRule(`.monaco-editor .codelens-decoration .codicon { color: ${codeLensForeground}; }`); - } - const activeLinkForeground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["editorActiveLinkForeground"]); - if (activeLinkForeground) { - collector.addRule(`.monaco-editor .codelens-decoration > a:hover { color: ${activeLinkForeground} !important; }`); - collector.addRule(`.monaco-editor .codelens-decoration > a:hover .codicon { color: ${activeLinkForeground} !important; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/color.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/color.js ***! - \*******************************************************************************/ -/*! exports provided: getColors, getColorPresentations */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColors", function() { return getColors; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColorPresentations", function() { return getColorPresentations; }); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -function getColors(model, token) { - const colors = []; - const providers = _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["ColorProviderRegistry"].ordered(model).reverse(); - const promises = providers.map(provider => Promise.resolve(provider.provideDocumentColors(model, token)).then(result => { - if (Array.isArray(result)) { - for (let colorInfo of result) { - colors.push({ colorInfo, provider }); - } - } - })); - return Promise.all(promises).then(() => colors); -} -function getColorPresentations(model, colorInfo, provider, token) { - return Promise.resolve(provider.provideColorPresentations(model, colorInfo, token)); -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerLanguageCommand"])('_executeDocumentColorProvider', function (accessor, args) { - const { resource } = args; - if (!(resource instanceof _base_common_uri_js__WEBPACK_IMPORTED_MODULE_2__["URI"])) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["illegalArgument"])(); - } - const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_6__["IModelService"]).getModel(resource); - if (!model) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["illegalArgument"])(); - } - const rawCIs = []; - const providers = _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["ColorProviderRegistry"].ordered(model).reverse(); - const promises = providers.map(provider => Promise.resolve(provider.provideDocumentColors(model, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationToken"].None)).then(result => { - if (Array.isArray(result)) { - for (let ci of result) { - rawCIs.push({ range: ci.range, color: [ci.color.red, ci.color.green, ci.color.blue, ci.color.alpha] }); - } - } - })); - return Promise.all(promises).then(() => rawCIs); -}); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerLanguageCommand"])('_executeColorPresentationProvider', function (accessor, args) { - const { resource, color, range } = args; - if (!(resource instanceof _base_common_uri_js__WEBPACK_IMPORTED_MODULE_2__["URI"]) || !Array.isArray(color) || color.length !== 4 || !_common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].isIRange(range)) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["illegalArgument"])(); - } - const [red, green, blue, alpha] = color; - const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_6__["IModelService"]).getModel(resource); - if (!model) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["illegalArgument"])(); - } - const colorInfo = { - range, - color: { red, green, blue, alpha } - }; - const presentations = []; - const providers = _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["ColorProviderRegistry"].ordered(model).reverse(); - const promises = providers.map(provider => Promise.resolve(provider.provideColorPresentations(model, colorInfo, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationToken"].None)).then(result => { - if (Array.isArray(result)) { - presentations.push(...result); - } - })); - return Promise.all(promises).then(() => presentations); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorDetector.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorDetector.js ***! - \***************************************************************************************/ -/*! exports provided: ColorDetector */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorDetector", function() { return ColorDetector; }); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_hash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/hash.js */ "./node_modules/monaco-editor/esm/vs/base/common/hash.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./color.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/color.js"); -/* harmony import */ var _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../platform/configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - -const MAX_DECORATORS = 500; -let ColorDetector = class ColorDetector extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["Disposable"] { - constructor(_editor, _codeEditorService, _configurationService) { - super(); - this._editor = _editor; - this._codeEditorService = _codeEditorService; - this._configurationService = _configurationService; - this._localToDispose = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"]()); - this._decorationsIds = []; - this._colorDatas = new Map(); - this._colorDecoratorIds = []; - this._decorationsTypes = new Set(); - this._register(_editor.onDidChangeModel((e) => { - this._isEnabled = this.isEnabled(); - this.onModelChanged(); - })); - this._register(_editor.onDidChangeModelLanguage((e) => this.onModelChanged())); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_9__["ColorProviderRegistry"].onDidChange((e) => this.onModelChanged())); - this._register(_editor.onDidChangeConfiguration((e) => { - let prevIsEnabled = this._isEnabled; - this._isEnabled = this.isEnabled(); - if (prevIsEnabled !== this._isEnabled) { - if (this._isEnabled) { - this.onModelChanged(); - } - else { - this.removeAllDecorations(); - } - } - })); - this._timeoutTimer = null; - this._computePromise = null; - this._isEnabled = this.isEnabled(); - this.onModelChanged(); - } - isEnabled() { - const model = this._editor.getModel(); - if (!model) { - return false; - } - const languageId = model.getLanguageIdentifier(); - // handle deprecated settings. [languageId].colorDecorators.enable - const deprecatedConfig = this._configurationService.getValue(languageId.language); - if (deprecatedConfig) { - const colorDecorators = deprecatedConfig['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable'); - if (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) { - return colorDecorators['enable']; - } - } - return this._editor.getOption(12 /* colorDecorators */); - } - static get(editor) { - return editor.getContribution(this.ID); - } - dispose() { - this.stop(); - this.removeAllDecorations(); - super.dispose(); - } - onModelChanged() { - this.stop(); - if (!this._isEnabled) { - return; - } - const model = this._editor.getModel(); - if (!model || !_common_modes_js__WEBPACK_IMPORTED_MODULE_9__["ColorProviderRegistry"].has(model)) { - return; - } - this._localToDispose.add(this._editor.onDidChangeModelContent((e) => { - if (!this._timeoutTimer) { - this._timeoutTimer = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["TimeoutTimer"](); - this._timeoutTimer.cancelAndSet(() => { - this._timeoutTimer = null; - this.beginCompute(); - }, ColorDetector.RECOMPUTE_TIME); - } - })); - this.beginCompute(); - } - beginCompute() { - this._computePromise = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["createCancelablePromise"])(token => { - const model = this._editor.getModel(); - if (!model) { - return Promise.resolve([]); - } - return Object(_color_js__WEBPACK_IMPORTED_MODULE_10__["getColors"])(model, token); - }); - this._computePromise.then((colorInfos) => { - this.updateDecorations(colorInfos); - this.updateColorDecorators(colorInfos); - this._computePromise = null; - }, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["onUnexpectedError"]); - } - stop() { - if (this._timeoutTimer) { - this._timeoutTimer.cancel(); - this._timeoutTimer = null; - } - if (this._computePromise) { - this._computePromise.cancel(); - this._computePromise = null; - } - this._localToDispose.clear(); - } - updateDecorations(colorDatas) { - const decorations = colorDatas.map(c => ({ - range: { - startLineNumber: c.colorInfo.range.startLineNumber, - startColumn: c.colorInfo.range.startColumn, - endLineNumber: c.colorInfo.range.endLineNumber, - endColumn: c.colorInfo.range.endColumn - }, - options: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_8__["ModelDecorationOptions"].EMPTY - })); - this._decorationsIds = this._editor.deltaDecorations(this._decorationsIds, decorations); - this._colorDatas = new Map(); - this._decorationsIds.forEach((id, i) => this._colorDatas.set(id, colorDatas[i])); - } - updateColorDecorators(colorData) { - let decorations = []; - let newDecorationsTypes = {}; - for (let i = 0; i < colorData.length && decorations.length < MAX_DECORATORS; i++) { - const { red, green, blue, alpha } = colorData[i].colorInfo.color; - const rgba = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha); - let subKey = Object(_base_common_hash_js__WEBPACK_IMPORTED_MODULE_3__["hash"])(`rgba(${rgba.r},${rgba.g},${rgba.b},${rgba.a})`).toString(16); - let color = `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`; - let key = 'colorBox-' + subKey; - if (!this._decorationsTypes.has(key) && !newDecorationsTypes[key]) { - this._codeEditorService.registerDecorationType(key, { - before: { - contentText: ' ', - border: 'solid 0.1em #000', - margin: '0.1em 0.2em 0 0.2em', - width: '0.8em', - height: '0.8em', - backgroundColor: color - }, - dark: { - before: { - border: 'solid 0.1em #eee' - } - } - }, undefined, this._editor); - } - newDecorationsTypes[key] = true; - decorations.push({ - range: { - startLineNumber: colorData[i].colorInfo.range.startLineNumber, - startColumn: colorData[i].colorInfo.range.startColumn, - endLineNumber: colorData[i].colorInfo.range.endLineNumber, - endColumn: colorData[i].colorInfo.range.endColumn - }, - options: this._codeEditorService.resolveDecorationOptions(key, true) - }); - } - this._decorationsTypes.forEach(subType => { - if (!newDecorationsTypes[subType]) { - this._codeEditorService.removeDecorationType(subType); - } - }); - this._colorDecoratorIds = this._editor.deltaDecorations(this._colorDecoratorIds, decorations); - } - removeAllDecorations() { - this._decorationsIds = this._editor.deltaDecorations(this._decorationsIds, []); - this._colorDecoratorIds = this._editor.deltaDecorations(this._colorDecoratorIds, []); - this._decorationsTypes.forEach(subType => { - this._codeEditorService.removeDecorationType(subType); - }); - } - getColorData(position) { - const model = this._editor.getModel(); - if (!model) { - return null; - } - const decorations = model - .getDecorationsInRange(_common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].fromPositions(position, position)) - .filter(d => this._colorDatas.has(d.id)); - if (decorations.length === 0) { - return null; - } - return this._colorDatas.get(decorations[0].id); - } -}; -ColorDetector.ID = 'editor.contrib.colorDetector'; -ColorDetector.RECOMPUTE_TIME = 1000; // ms -ColorDetector = __decorate([ - __param(1, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_6__["ICodeEditorService"]), - __param(2, _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_11__["IConfigurationService"]) -], ColorDetector); - -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorContribution"])(ColorDetector.ID, ColorDetector); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorPicker.css": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorPicker.css ***! - \**************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_colorPicker_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./colorPicker.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorPicker.css"); -/* harmony import */ var _css_loader_dist_cjs_js_colorPicker_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_colorPicker_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_colorPicker_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_colorPicker_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorPickerModel.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorPickerModel.js ***! - \******************************************************************************************/ -/*! exports provided: ColorPickerModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPickerModel", function() { return ColorPickerModel; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class ColorPickerModel { - constructor(color, availableColorPresentations, presentationIndex) { - this.presentationIndex = presentationIndex; - this._onColorFlushed = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this.onColorFlushed = this._onColorFlushed.event; - this._onDidChangeColor = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this.onDidChangeColor = this._onDidChangeColor.event; - this._onDidChangePresentation = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this.onDidChangePresentation = this._onDidChangePresentation.event; - this.originalColor = color; - this._color = color; - this._colorPresentations = availableColorPresentations; - } - get color() { - return this._color; - } - set color(color) { - if (this._color.equals(color)) { - return; - } - this._color = color; - this._onDidChangeColor.fire(color); - } - get presentation() { return this.colorPresentations[this.presentationIndex]; } - get colorPresentations() { - return this._colorPresentations; - } - set colorPresentations(colorPresentations) { - this._colorPresentations = colorPresentations; - if (this.presentationIndex > colorPresentations.length - 1) { - this.presentationIndex = 0; - } - this._onDidChangePresentation.fire(this.presentation); - } - selectNextColorPresentation() { - this.presentationIndex = (this.presentationIndex + 1) % this.colorPresentations.length; - this.flushColor(); - this._onDidChangePresentation.fire(this.presentation); - } - guessColorPresentation(color, originalText) { - for (let i = 0; i < this.colorPresentations.length; i++) { - if (originalText.toLowerCase() === this.colorPresentations[i].label) { - this.presentationIndex = i; - this._onDidChangePresentation.fire(this.presentation); - break; - } - } - } - flushColor() { - this._onColorFlushed.fire(this._color); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorPickerWidget.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorPickerWidget.js ***! - \*******************************************************************************************/ -/*! exports provided: ColorPickerHeader, ColorPickerBody, ColorPickerWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPickerHeader", function() { return ColorPickerHeader; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPickerBody", function() { return ColorPickerBody; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPickerWidget", function() { return ColorPickerWidget; }); -/* harmony import */ var _colorPicker_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colorPicker.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorPicker.css"); -/* harmony import */ var _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/browser/globalMouseMoveMonitor.js */ "./node_modules/monaco-editor/esm/vs/base/browser/globalMouseMoveMonitor.js"); -/* harmony import */ var _base_browser_ui_widget_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/browser/ui/widget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - -const $ = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["$"]; -class ColorPickerHeader extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["Disposable"] { - constructor(container, model, themeService) { - super(); - this.model = model; - this.domNode = $('.colorpicker-header'); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](container, this.domNode); - this.pickedColorNode = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](this.domNode, $('.picked-color')); - const colorBox = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](this.domNode, $('.original-color')); - colorBox.style.backgroundColor = _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["Color"].Format.CSS.format(this.model.originalColor) || ''; - this.backgroundColor = themeService.getColorTheme().getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_8__["editorHoverBackground"]) || _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["Color"].white; - this._register(Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_9__["registerThemingParticipant"])((theme, collector) => { - this.backgroundColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_8__["editorHoverBackground"]) || _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["Color"].white; - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](this.pickedColorNode, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].CLICK, () => this.model.selectNextColorPresentation())); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](colorBox, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["EventType"].CLICK, () => { - this.model.color = this.model.originalColor; - this.model.flushColor(); - })); - this._register(model.onDidChangeColor(this.onDidChangeColor, this)); - this._register(model.onDidChangePresentation(this.onDidChangePresentation, this)); - this.pickedColorNode.style.backgroundColor = _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["Color"].Format.CSS.format(model.color) || ''; - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["toggleClass"](this.pickedColorNode, 'light', model.color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : model.color.isLighter()); - } - onDidChangeColor(color) { - this.pickedColorNode.style.backgroundColor = _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["Color"].Format.CSS.format(color) || ''; - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["toggleClass"](this.pickedColorNode, 'light', color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : color.isLighter()); - this.onDidChangePresentation(); - } - onDidChangePresentation() { - this.pickedColorNode.textContent = this.model.presentation ? this.model.presentation.label : ''; - } -} -class ColorPickerBody extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["Disposable"] { - constructor(container, model, pixelRatio) { - super(); - this.model = model; - this.pixelRatio = pixelRatio; - this.domNode = $('.colorpicker-body'); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](container, this.domNode); - this.saturationBox = new SaturationBox(this.domNode, this.model, this.pixelRatio); - this._register(this.saturationBox); - this._register(this.saturationBox.onDidChange(this.onDidSaturationValueChange, this)); - this._register(this.saturationBox.onColorFlushed(this.flushColor, this)); - this.opacityStrip = new OpacityStrip(this.domNode, this.model); - this._register(this.opacityStrip); - this._register(this.opacityStrip.onDidChange(this.onDidOpacityChange, this)); - this._register(this.opacityStrip.onColorFlushed(this.flushColor, this)); - this.hueStrip = new HueStrip(this.domNode, this.model); - this._register(this.hueStrip); - this._register(this.hueStrip.onDidChange(this.onDidHueChange, this)); - this._register(this.hueStrip.onColorFlushed(this.flushColor, this)); - } - flushColor() { - this.model.flushColor(); - } - onDidSaturationValueChange({ s, v }) { - const hsva = this.model.color.hsva; - this.model.color = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["HSVA"](hsva.h, s, v, hsva.a)); - } - onDidOpacityChange(a) { - const hsva = this.model.color.hsva; - this.model.color = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["HSVA"](hsva.h, hsva.s, hsva.v, a)); - } - onDidHueChange(value) { - const hsva = this.model.color.hsva; - const h = (1 - value) * 360; - this.model.color = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["HSVA"](h === 360 ? 0 : h, hsva.s, hsva.v, hsva.a)); - } - layout() { - this.saturationBox.layout(); - this.opacityStrip.layout(); - this.hueStrip.layout(); - } -} -class SaturationBox extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["Disposable"] { - constructor(container, model, pixelRatio) { - super(); - this.model = model; - this.pixelRatio = pixelRatio; - this._onDidChange = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"](); - this.onDidChange = this._onDidChange.event; - this._onColorFlushed = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"](); - this.onColorFlushed = this._onColorFlushed.event; - this.domNode = $('.saturation-wrap'); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](container, this.domNode); - // Create canvas, draw selected color - this.canvas = document.createElement('canvas'); - this.canvas.className = 'saturation-box'; - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](this.domNode, this.canvas); - // Add selection circle - this.selection = $('.saturation-selection'); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](this.domNode, this.selection); - this.layout(); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableGenericMouseDownListner"](this.domNode, e => this.onMouseDown(e))); - this._register(this.model.onDidChangeColor(this.onDidChangeColor, this)); - this.monitor = null; - } - onMouseDown(e) { - this.monitor = this._register(new _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_3__["GlobalMouseMoveMonitor"]()); - const origin = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getDomNodePagePosition"](this.domNode); - if (e.target !== this.selection) { - this.onDidChangePosition(e.offsetX, e.offsetY); - } - this.monitor.startMonitoring(e.target, e.buttons, _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_3__["standardMouseMoveMerger"], event => this.onDidChangePosition(event.posx - origin.left, event.posy - origin.top), () => null); - const mouseUpListener = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableGenericMouseUpListner"](document, () => { - this._onColorFlushed.fire(); - mouseUpListener.dispose(); - if (this.monitor) { - this.monitor.stopMonitoring(true); - this.monitor = null; - } - }, true); - } - onDidChangePosition(left, top) { - const s = Math.max(0, Math.min(1, left / this.width)); - const v = Math.max(0, Math.min(1, 1 - (top / this.height))); - this.paintSelection(s, v); - this._onDidChange.fire({ s, v }); - } - layout() { - this.width = this.domNode.offsetWidth; - this.height = this.domNode.offsetHeight; - this.canvas.width = this.width * this.pixelRatio; - this.canvas.height = this.height * this.pixelRatio; - this.paint(); - const hsva = this.model.color.hsva; - this.paintSelection(hsva.s, hsva.v); - } - paint() { - const hsva = this.model.color.hsva; - const saturatedColor = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["HSVA"](hsva.h, 1, 1, 1)); - const ctx = this.canvas.getContext('2d'); - const whiteGradient = ctx.createLinearGradient(0, 0, this.canvas.width, 0); - whiteGradient.addColorStop(0, 'rgba(255, 255, 255, 1)'); - whiteGradient.addColorStop(0.5, 'rgba(255, 255, 255, 0.5)'); - whiteGradient.addColorStop(1, 'rgba(255, 255, 255, 0)'); - const blackGradient = ctx.createLinearGradient(0, 0, 0, this.canvas.height); - blackGradient.addColorStop(0, 'rgba(0, 0, 0, 0)'); - blackGradient.addColorStop(1, 'rgba(0, 0, 0, 1)'); - ctx.rect(0, 0, this.canvas.width, this.canvas.height); - ctx.fillStyle = _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["Color"].Format.CSS.format(saturatedColor); - ctx.fill(); - ctx.fillStyle = whiteGradient; - ctx.fill(); - ctx.fillStyle = blackGradient; - ctx.fill(); - } - paintSelection(s, v) { - this.selection.style.left = `${s * this.width}px`; - this.selection.style.top = `${this.height - v * this.height}px`; - } - onDidChangeColor() { - if (this.monitor && this.monitor.isMonitoring()) { - return; - } - this.paint(); - } -} -class Strip extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["Disposable"] { - constructor(container, model) { - super(); - this.model = model; - this._onDidChange = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"](); - this.onDidChange = this._onDidChange.event; - this._onColorFlushed = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"](); - this.onColorFlushed = this._onColorFlushed.event; - this.domNode = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](container, $('.strip')); - this.overlay = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](this.domNode, $('.overlay')); - this.slider = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](this.domNode, $('.slider')); - this.slider.style.top = `0px`; - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableGenericMouseDownListner"](this.domNode, e => this.onMouseDown(e))); - this.layout(); - } - layout() { - this.height = this.domNode.offsetHeight - this.slider.offsetHeight; - const value = this.getValue(this.model.color); - this.updateSliderPosition(value); - } - onMouseDown(e) { - const monitor = this._register(new _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_3__["GlobalMouseMoveMonitor"]()); - const origin = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getDomNodePagePosition"](this.domNode); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](this.domNode, 'grabbing'); - if (e.target !== this.slider) { - this.onDidChangeTop(e.offsetY); - } - monitor.startMonitoring(e.target, e.buttons, _base_browser_globalMouseMoveMonitor_js__WEBPACK_IMPORTED_MODULE_3__["standardMouseMoveMerger"], event => this.onDidChangeTop(event.posy - origin.top), () => null); - const mouseUpListener = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableGenericMouseUpListner"](document, () => { - this._onColorFlushed.fire(); - mouseUpListener.dispose(); - monitor.stopMonitoring(true); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["removeClass"](this.domNode, 'grabbing'); - }, true); - } - onDidChangeTop(top) { - const value = Math.max(0, Math.min(1, 1 - (top / this.height))); - this.updateSliderPosition(value); - this._onDidChange.fire(value); - } - updateSliderPosition(value) { - this.slider.style.top = `${(1 - value) * this.height}px`; - } -} -class OpacityStrip extends Strip { - constructor(container, model) { - super(container, model); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](this.domNode, 'opacity-strip'); - this._register(model.onDidChangeColor(this.onDidChangeColor, this)); - this.onDidChangeColor(this.model.color); - } - onDidChangeColor(color) { - const { r, g, b } = color.rgba; - const opaque = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["RGBA"](r, g, b, 1)); - const transparent = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_5__["RGBA"](r, g, b, 0)); - this.overlay.style.background = `linear-gradient(to bottom, ${opaque} 0%, ${transparent} 100%)`; - } - getValue(color) { - return color.hsva.a; - } -} -class HueStrip extends Strip { - constructor(container, model) { - super(container, model); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](this.domNode, 'hue-strip'); - } - getValue(color) { - return 1 - (color.hsva.h / 360); - } -} -class ColorPickerWidget extends _base_browser_ui_widget_js__WEBPACK_IMPORTED_MODULE_4__["Widget"] { - constructor(container, model, pixelRatio, themeService) { - super(); - this.model = model; - this.pixelRatio = pixelRatio; - this._register(Object(_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_1__["onDidChangeZoomLevel"])(() => this.layout())); - const element = $('.colorpicker-widget'); - container.appendChild(element); - const header = new ColorPickerHeader(element, this.model, themeService); - this.body = new ColorPickerBody(element, this.model, this.pixelRatio); - this._register(header); - this._register(this.body); - } - layout() { - this.body.layout(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/comment/blockCommentCommand.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/comment/blockCommentCommand.js ***! - \*****************************************************************************************/ -/*! exports provided: BlockCommentCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlockCommentCommand", function() { return BlockCommentCommand; }); -/* harmony import */ var _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/core/editOperation.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -class BlockCommentCommand { - constructor(selection, insertSpace) { - this._selection = selection; - this._insertSpace = insertSpace; - this._usedEndToken = null; - } - static _haystackHasNeedleAtOffset(haystack, needle, offset) { - if (offset < 0) { - return false; - } - const needleLength = needle.length; - const haystackLength = haystack.length; - if (offset + needleLength > haystackLength) { - return false; - } - for (let i = 0; i < needleLength; i++) { - const codeA = haystack.charCodeAt(offset + i); - const codeB = needle.charCodeAt(i); - if (codeA === codeB) { - continue; - } - if (codeA >= 65 /* A */ && codeA <= 90 /* Z */ && codeA + 32 === codeB) { - // codeA is upper-case variant of codeB - continue; - } - if (codeB >= 65 /* A */ && codeB <= 90 /* Z */ && codeB + 32 === codeA) { - // codeB is upper-case variant of codeA - continue; - } - return false; - } - return true; - } - _createOperationsForBlockComment(selection, startToken, endToken, insertSpace, model, builder) { - const startLineNumber = selection.startLineNumber; - const startColumn = selection.startColumn; - const endLineNumber = selection.endLineNumber; - const endColumn = selection.endColumn; - const startLineText = model.getLineContent(startLineNumber); - const endLineText = model.getLineContent(endLineNumber); - let startTokenIndex = startLineText.lastIndexOf(startToken, startColumn - 1 + startToken.length); - let endTokenIndex = endLineText.indexOf(endToken, endColumn - 1 - endToken.length); - if (startTokenIndex !== -1 && endTokenIndex !== -1) { - if (startLineNumber === endLineNumber) { - const lineBetweenTokens = startLineText.substring(startTokenIndex + startToken.length, endTokenIndex); - if (lineBetweenTokens.indexOf(endToken) >= 0) { - // force to add a block comment - startTokenIndex = -1; - endTokenIndex = -1; - } - } - else { - const startLineAfterStartToken = startLineText.substring(startTokenIndex + startToken.length); - const endLineBeforeEndToken = endLineText.substring(0, endTokenIndex); - if (startLineAfterStartToken.indexOf(endToken) >= 0 || endLineBeforeEndToken.indexOf(endToken) >= 0) { - // force to add a block comment - startTokenIndex = -1; - endTokenIndex = -1; - } - } - } - let ops; - if (startTokenIndex !== -1 && endTokenIndex !== -1) { - // Consider spaces as part of the comment tokens - if (insertSpace && startTokenIndex + startToken.length < startLineText.length && startLineText.charCodeAt(startTokenIndex + startToken.length) === 32 /* Space */) { - // Pretend the start token contains a trailing space - startToken = startToken + ' '; - } - if (insertSpace && endTokenIndex > 0 && endLineText.charCodeAt(endTokenIndex - 1) === 32 /* Space */) { - // Pretend the end token contains a leading space - endToken = ' ' + endToken; - endTokenIndex -= 1; - } - ops = BlockCommentCommand._createRemoveBlockCommentOperations(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](startLineNumber, startTokenIndex + startToken.length + 1, endLineNumber, endTokenIndex + 1), startToken, endToken); - } - else { - ops = BlockCommentCommand._createAddBlockCommentOperations(selection, startToken, endToken, this._insertSpace); - this._usedEndToken = ops.length === 1 ? endToken : null; - } - for (const op of ops) { - builder.addTrackedEditOperation(op.range, op.text); - } - } - static _createRemoveBlockCommentOperations(r, startToken, endToken) { - let res = []; - if (!_common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].isEmpty(r)) { - // Remove block comment start - res.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_0__["EditOperation"].delete(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](r.startLineNumber, r.startColumn - startToken.length, r.startLineNumber, r.startColumn))); - // Remove block comment end - res.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_0__["EditOperation"].delete(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](r.endLineNumber, r.endColumn, r.endLineNumber, r.endColumn + endToken.length))); - } - else { - // Remove both continuously - res.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_0__["EditOperation"].delete(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](r.startLineNumber, r.startColumn - startToken.length, r.endLineNumber, r.endColumn + endToken.length))); - } - return res; - } - static _createAddBlockCommentOperations(r, startToken, endToken, insertSpace) { - let res = []; - if (!_common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].isEmpty(r)) { - // Insert block comment start - res.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_0__["EditOperation"].insert(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](r.startLineNumber, r.startColumn), startToken + (insertSpace ? ' ' : ''))); - // Insert block comment end - res.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_0__["EditOperation"].insert(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_1__["Position"](r.endLineNumber, r.endColumn), (insertSpace ? ' ' : '') + endToken)); - } - else { - // Insert both continuously - res.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_0__["EditOperation"].replace(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn), startToken + ' ' + endToken)); - } - return res; - } - getEditOperations(model, builder) { - const startLineNumber = this._selection.startLineNumber; - const startColumn = this._selection.startColumn; - model.tokenizeIfCheap(startLineNumber); - const languageId = model.getLanguageIdAtPosition(startLineNumber, startColumn); - const config = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_4__["LanguageConfigurationRegistry"].getComments(languageId); - if (!config || !config.blockCommentStartToken || !config.blockCommentEndToken) { - // Mode does not support block comments - return; - } - this._createOperationsForBlockComment(this._selection, config.blockCommentStartToken, config.blockCommentEndToken, this._insertSpace, model, builder); - } - computeCursorState(model, helper) { - const inverseEditOperations = helper.getInverseEditOperations(); - if (inverseEditOperations.length === 2) { - const startTokenEditOperation = inverseEditOperations[0]; - const endTokenEditOperation = inverseEditOperations[1]; - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_3__["Selection"](startTokenEditOperation.range.endLineNumber, startTokenEditOperation.range.endColumn, endTokenEditOperation.range.startLineNumber, endTokenEditOperation.range.startColumn); - } - else { - const srcRange = inverseEditOperations[0].range; - const deltaColumn = this._usedEndToken ? -this._usedEndToken.length - 1 : 0; // minus 1 space before endToken - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_3__["Selection"](srcRange.endLineNumber, srcRange.endColumn + deltaColumn, srcRange.endLineNumber, srcRange.endColumn + deltaColumn); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/comment/comment.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/comment/comment.js ***! - \*****************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _blockCommentCommand_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./blockCommentCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/comment/blockCommentCommand.js"); -/* harmony import */ var _lineCommentCommand_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lineCommentCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/comment/lineCommentCommand.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -class CommentLineAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["EditorAction"] { - constructor(type, opts) { - super(opts); - this._type = type; - } - run(accessor, editor) { - if (!editor.hasModel()) { - return; - } - const model = editor.getModel(); - const commands = []; - const selections = editor.getSelections(); - const modelOptions = model.getOptions(); - const commentsOptions = editor.getOption(14 /* comments */); - for (const selection of selections) { - commands.push(new _lineCommentCommand_js__WEBPACK_IMPORTED_MODULE_5__["LineCommentCommand"](selection, modelOptions.tabSize, this._type, commentsOptions.insertSpace, commentsOptions.ignoreEmptyLines)); - } - editor.pushUndoStop(); - editor.executeCommands(this.id, commands); - editor.pushUndoStop(); - } -} -class ToggleCommentLineAction extends CommentLineAction { - constructor() { - super(0 /* Toggle */, { - id: 'editor.action.commentLine', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('comment.line', "Toggle Line Comment"), - alias: 'Toggle Line Comment', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 85 /* US_SLASH */, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_6__["MenuId"].MenubarEditMenu, - group: '5_insert', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miToggleLineComment', comment: ['&& denotes a mnemonic'] }, "&&Toggle Line Comment"), - order: 1 - } - }); - } -} -class AddLineCommentAction extends CommentLineAction { - constructor() { - super(1 /* ForceAdd */, { - id: 'editor.action.addCommentLine', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('comment.line.add', "Add Line Comment"), - alias: 'Add Line Comment', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 33 /* KEY_C */), - weight: 100 /* EditorContrib */ - } - }); - } -} -class RemoveLineCommentAction extends CommentLineAction { - constructor() { - super(2 /* ForceRemove */, { - id: 'editor.action.removeCommentLine', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('comment.line.remove', "Remove Line Comment"), - alias: 'Remove Line Comment', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 51 /* KEY_U */), - weight: 100 /* EditorContrib */ - } - }); - } -} -class BlockCommentAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.blockComment', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('comment.block', "Toggle Block Comment"), - alias: 'Toggle Block Comment', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].editorTextFocus, - primary: 1024 /* Shift */ | 512 /* Alt */ | 31 /* KEY_A */, - linux: { primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 31 /* KEY_A */ }, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_6__["MenuId"].MenubarEditMenu, - group: '5_insert', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miToggleBlockComment', comment: ['&& denotes a mnemonic'] }, "Toggle &&Block Comment"), - order: 2 - } - }); - } - run(accessor, editor) { - if (!editor.hasModel()) { - return; - } - const commentsOptions = editor.getOption(14 /* comments */); - const commands = []; - const selections = editor.getSelections(); - for (const selection of selections) { - commands.push(new _blockCommentCommand_js__WEBPACK_IMPORTED_MODULE_4__["BlockCommentCommand"](selection, commentsOptions.insertSpace)); - } - editor.pushUndoStop(); - editor.executeCommands(this.id, commands); - editor.pushUndoStop(); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorAction"])(ToggleCommentLineAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorAction"])(AddLineCommentAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorAction"])(RemoveLineCommentAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorAction"])(BlockCommentAction); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/comment/lineCommentCommand.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/comment/lineCommentCommand.js ***! - \****************************************************************************************/ -/*! exports provided: LineCommentCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineCommentCommand", function() { return LineCommentCommand; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/editOperation.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/* harmony import */ var _blockCommentCommand_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./blockCommentCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/comment/blockCommentCommand.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -class LineCommentCommand { - constructor(selection, tabSize, type, insertSpace, ignoreEmptyLines) { - this._selection = selection; - this._tabSize = tabSize; - this._type = type; - this._insertSpace = insertSpace; - this._selectionId = null; - this._deltaColumn = 0; - this._moveEndPositionDown = false; - this._ignoreEmptyLines = ignoreEmptyLines; - } - /** - * Do an initial pass over the lines and gather info about the line comment string. - * Returns null if any of the lines doesn't support a line comment string. - */ - static _gatherPreflightCommentStrings(model, startLineNumber, endLineNumber) { - model.tokenizeIfCheap(startLineNumber); - const languageId = model.getLanguageIdAtPosition(startLineNumber, 1); - const config = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__["LanguageConfigurationRegistry"].getComments(languageId); - const commentStr = (config ? config.lineCommentToken : null); - if (!commentStr) { - // Mode does not support line comments - return null; - } - let lines = []; - for (let i = 0, lineCount = endLineNumber - startLineNumber + 1; i < lineCount; i++) { - lines[i] = { - ignore: false, - commentStr: commentStr, - commentStrOffset: 0, - commentStrLength: commentStr.length - }; - } - return lines; - } - /** - * Analyze lines and decide which lines are relevant and what the toggle should do. - * Also, build up several offsets and lengths useful in the generation of editor operations. - */ - static _analyzeLines(type, insertSpace, model, lines, startLineNumber, ignoreEmptyLines) { - let onlyWhitespaceLines = true; - let shouldRemoveComments; - if (type === 0 /* Toggle */) { - shouldRemoveComments = true; - } - else if (type === 1 /* ForceAdd */) { - shouldRemoveComments = false; - } - else { - shouldRemoveComments = true; - } - for (let i = 0, lineCount = lines.length; i < lineCount; i++) { - const lineData = lines[i]; - const lineNumber = startLineNumber + i; - const lineContent = model.getLineContent(lineNumber); - const lineContentStartOffset = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["firstNonWhitespaceIndex"](lineContent); - if (lineContentStartOffset === -1) { - // Empty or whitespace only line - lineData.ignore = ignoreEmptyLines; - lineData.commentStrOffset = lineContent.length; - continue; - } - onlyWhitespaceLines = false; - lineData.ignore = false; - lineData.commentStrOffset = lineContentStartOffset; - if (shouldRemoveComments && !_blockCommentCommand_js__WEBPACK_IMPORTED_MODULE_6__["BlockCommentCommand"]._haystackHasNeedleAtOffset(lineContent, lineData.commentStr, lineContentStartOffset)) { - if (type === 0 /* Toggle */) { - // Every line so far has been a line comment, but this one is not - shouldRemoveComments = false; - } - else if (type === 1 /* ForceAdd */) { - // Will not happen - } - else { - lineData.ignore = true; - } - } - if (shouldRemoveComments && insertSpace) { - // Remove a following space if present - const commentStrEndOffset = lineContentStartOffset + lineData.commentStrLength; - if (commentStrEndOffset < lineContent.length && lineContent.charCodeAt(commentStrEndOffset) === 32 /* Space */) { - lineData.commentStrLength += 1; - } - } - } - if (type === 0 /* Toggle */ && onlyWhitespaceLines) { - // For only whitespace lines, we insert comments - shouldRemoveComments = false; - // Also, no longer ignore them - for (let i = 0, lineCount = lines.length; i < lineCount; i++) { - lines[i].ignore = false; - } - } - return { - supported: true, - shouldRemoveComments: shouldRemoveComments, - lines: lines - }; - } - /** - * Analyze all lines and decide exactly what to do => not supported | insert line comments | remove line comments - */ - static _gatherPreflightData(type, insertSpace, model, startLineNumber, endLineNumber, ignoreEmptyLines) { - const lines = LineCommentCommand._gatherPreflightCommentStrings(model, startLineNumber, endLineNumber); - if (lines === null) { - return { - supported: false - }; - } - return LineCommentCommand._analyzeLines(type, insertSpace, model, lines, startLineNumber, ignoreEmptyLines); - } - /** - * Given a successful analysis, execute either insert line comments, either remove line comments - */ - _executeLineComments(model, builder, data, s) { - let ops; - if (data.shouldRemoveComments) { - ops = LineCommentCommand._createRemoveLineCommentsOperations(data.lines, s.startLineNumber); - } - else { - LineCommentCommand._normalizeInsertionPoint(model, data.lines, s.startLineNumber, this._tabSize); - ops = this._createAddLineCommentsOperations(data.lines, s.startLineNumber); - } - const cursorPosition = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_2__["Position"](s.positionLineNumber, s.positionColumn); - for (let i = 0, len = ops.length; i < len; i++) { - builder.addEditOperation(ops[i].range, ops[i].text); - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].isEmpty(ops[i].range) && _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].getStartPosition(ops[i].range).equals(cursorPosition)) { - const lineContent = model.getLineContent(cursorPosition.lineNumber); - if (lineContent.length + 1 === cursorPosition.column) { - this._deltaColumn = (ops[i].text || '').length; - } - } - } - this._selectionId = builder.trackSelection(s); - } - _attemptRemoveBlockComment(model, s, startToken, endToken) { - let startLineNumber = s.startLineNumber; - let endLineNumber = s.endLineNumber; - let startTokenAllowedBeforeColumn = endToken.length + Math.max(model.getLineFirstNonWhitespaceColumn(s.startLineNumber), s.startColumn); - let startTokenIndex = model.getLineContent(startLineNumber).lastIndexOf(startToken, startTokenAllowedBeforeColumn - 1); - let endTokenIndex = model.getLineContent(endLineNumber).indexOf(endToken, s.endColumn - 1 - startToken.length); - if (startTokenIndex !== -1 && endTokenIndex === -1) { - endTokenIndex = model.getLineContent(startLineNumber).indexOf(endToken, startTokenIndex + startToken.length); - endLineNumber = startLineNumber; - } - if (startTokenIndex === -1 && endTokenIndex !== -1) { - startTokenIndex = model.getLineContent(endLineNumber).lastIndexOf(startToken, endTokenIndex); - startLineNumber = endLineNumber; - } - if (s.isEmpty() && (startTokenIndex === -1 || endTokenIndex === -1)) { - startTokenIndex = model.getLineContent(startLineNumber).indexOf(startToken); - if (startTokenIndex !== -1) { - endTokenIndex = model.getLineContent(startLineNumber).indexOf(endToken, startTokenIndex + startToken.length); - } - } - // We have to adjust to possible inner white space. - // For Space after startToken, add Space to startToken - range math will work out. - if (startTokenIndex !== -1 && model.getLineContent(startLineNumber).charCodeAt(startTokenIndex + startToken.length) === 32 /* Space */) { - startToken += ' '; - } - // For Space before endToken, add Space before endToken and shift index one left. - if (endTokenIndex !== -1 && model.getLineContent(endLineNumber).charCodeAt(endTokenIndex - 1) === 32 /* Space */) { - endToken = ' ' + endToken; - endTokenIndex -= 1; - } - if (startTokenIndex !== -1 && endTokenIndex !== -1) { - return _blockCommentCommand_js__WEBPACK_IMPORTED_MODULE_6__["BlockCommentCommand"]._createRemoveBlockCommentOperations(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](startLineNumber, startTokenIndex + startToken.length + 1, endLineNumber, endTokenIndex + 1), startToken, endToken); - } - return null; - } - /** - * Given an unsuccessful analysis, delegate to the block comment command - */ - _executeBlockComment(model, builder, s) { - model.tokenizeIfCheap(s.startLineNumber); - let languageId = model.getLanguageIdAtPosition(s.startLineNumber, 1); - let config = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__["LanguageConfigurationRegistry"].getComments(languageId); - if (!config || !config.blockCommentStartToken || !config.blockCommentEndToken) { - // Mode does not support block comments - return; - } - const startToken = config.blockCommentStartToken; - const endToken = config.blockCommentEndToken; - let ops = this._attemptRemoveBlockComment(model, s, startToken, endToken); - if (!ops) { - if (s.isEmpty()) { - const lineContent = model.getLineContent(s.startLineNumber); - let firstNonWhitespaceIndex = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["firstNonWhitespaceIndex"](lineContent); - if (firstNonWhitespaceIndex === -1) { - // Line is empty or contains only whitespace - firstNonWhitespaceIndex = lineContent.length; - } - ops = _blockCommentCommand_js__WEBPACK_IMPORTED_MODULE_6__["BlockCommentCommand"]._createAddBlockCommentOperations(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](s.startLineNumber, firstNonWhitespaceIndex + 1, s.startLineNumber, lineContent.length + 1), startToken, endToken, this._insertSpace); - } - else { - ops = _blockCommentCommand_js__WEBPACK_IMPORTED_MODULE_6__["BlockCommentCommand"]._createAddBlockCommentOperations(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](s.startLineNumber, model.getLineFirstNonWhitespaceColumn(s.startLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), startToken, endToken, this._insertSpace); - } - if (ops.length === 1) { - // Leave cursor after token and Space - this._deltaColumn = startToken.length + 1; - } - } - this._selectionId = builder.trackSelection(s); - for (const op of ops) { - builder.addEditOperation(op.range, op.text); - } - } - getEditOperations(model, builder) { - let s = this._selection; - this._moveEndPositionDown = false; - if (s.startLineNumber < s.endLineNumber && s.endColumn === 1) { - this._moveEndPositionDown = true; - s = s.setEndPosition(s.endLineNumber - 1, model.getLineMaxColumn(s.endLineNumber - 1)); - } - const data = LineCommentCommand._gatherPreflightData(this._type, this._insertSpace, model, s.startLineNumber, s.endLineNumber, this._ignoreEmptyLines); - if (data.supported) { - return this._executeLineComments(model, builder, data, s); - } - return this._executeBlockComment(model, builder, s); - } - computeCursorState(model, helper) { - let result = helper.getTrackedSelection(this._selectionId); - if (this._moveEndPositionDown) { - result = result.setEndPosition(result.endLineNumber + 1, 1); - } - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_4__["Selection"](result.selectionStartLineNumber, result.selectionStartColumn + this._deltaColumn, result.positionLineNumber, result.positionColumn + this._deltaColumn); - } - /** - * Generate edit operations in the remove line comment case - */ - static _createRemoveLineCommentsOperations(lines, startLineNumber) { - let res = []; - for (let i = 0, len = lines.length; i < len; i++) { - const lineData = lines[i]; - if (lineData.ignore) { - continue; - } - res.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_1__["EditOperation"].delete(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"](startLineNumber + i, lineData.commentStrOffset + 1, startLineNumber + i, lineData.commentStrOffset + lineData.commentStrLength + 1))); - } - return res; - } - /** - * Generate edit operations in the add line comment case - */ - _createAddLineCommentsOperations(lines, startLineNumber) { - let res = []; - const afterCommentStr = this._insertSpace ? ' ' : ''; - for (let i = 0, len = lines.length; i < len; i++) { - const lineData = lines[i]; - if (lineData.ignore) { - continue; - } - res.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_1__["EditOperation"].insert(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_2__["Position"](startLineNumber + i, lineData.commentStrOffset + 1), lineData.commentStr + afterCommentStr)); - } - return res; - } - static nextVisibleColumn(currentVisibleColumn, tabSize, isTab, columnSize) { - if (isTab) { - return currentVisibleColumn + (tabSize - (currentVisibleColumn % tabSize)); - } - return currentVisibleColumn + columnSize; - } - /** - * Adjust insertion points to have them vertically aligned in the add line comment case - */ - static _normalizeInsertionPoint(model, lines, startLineNumber, tabSize) { - let minVisibleColumn = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - let j; - let lenJ; - for (let i = 0, len = lines.length; i < len; i++) { - if (lines[i].ignore) { - continue; - } - const lineContent = model.getLineContent(startLineNumber + i); - let currentVisibleColumn = 0; - for (let j = 0, lenJ = lines[i].commentStrOffset; currentVisibleColumn < minVisibleColumn && j < lenJ; j++) { - currentVisibleColumn = LineCommentCommand.nextVisibleColumn(currentVisibleColumn, tabSize, lineContent.charCodeAt(j) === 9 /* Tab */, 1); - } - if (currentVisibleColumn < minVisibleColumn) { - minVisibleColumn = currentVisibleColumn; - } - } - minVisibleColumn = Math.floor(minVisibleColumn / tabSize) * tabSize; - for (let i = 0, len = lines.length; i < len; i++) { - if (lines[i].ignore) { - continue; - } - const lineContent = model.getLineContent(startLineNumber + i); - let currentVisibleColumn = 0; - for (j = 0, lenJ = lines[i].commentStrOffset; currentVisibleColumn < minVisibleColumn && j < lenJ; j++) { - currentVisibleColumn = LineCommentCommand.nextVisibleColumn(currentVisibleColumn, tabSize, lineContent.charCodeAt(j) === 9 /* Tab */, 1); - } - if (currentVisibleColumn > minVisibleColumn) { - lines[i].commentStrOffset = j - 1; - } - else { - lines[i].commentStrOffset = j; - } - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/contextmenu/contextmenu.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/contextmenu/contextmenu.js ***! - \*************************************************************************************/ -/*! exports provided: ContextMenuController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextMenuController", function() { return ContextMenuController; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_actions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/contextview/browser/contextView.js */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextView.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _base_browser_ui_actionbar_actionViewItems_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/browser/ui/actionbar/actionViewItems.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - -let ContextMenuController = class ContextMenuController { - constructor(editor, _contextMenuService, _contextViewService, _contextKeyService, _keybindingService, _menuService) { - this._contextMenuService = _contextMenuService; - this._contextViewService = _contextViewService; - this._contextKeyService = _contextKeyService; - this._keybindingService = _keybindingService; - this._menuService = _menuService; - this._toDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - this._contextMenuIsBeingShownCount = 0; - this._editor = editor; - this._toDispose.add(this._editor.onContextMenu((e) => this._onContextMenu(e))); - this._toDispose.add(this._editor.onMouseWheel((e) => { - if (this._contextMenuIsBeingShownCount > 0) { - const view = this._contextViewService.getContextViewElement(); - const target = e.srcElement; - // Event triggers on shadow root host first - // Check if the context view is under this host before hiding it #103169 - if (!(target.shadowRoot && _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["getShadowRoot"](view) === target.shadowRoot)) { - this._contextViewService.hideContextView(); - } - } - })); - this._toDispose.add(this._editor.onKeyDown((e) => { - if (e.keyCode === 58 /* ContextMenu */) { - // Chrome is funny like that - e.preventDefault(); - e.stopPropagation(); - this.showContextMenu(); - } - })); - } - static get(editor) { - return editor.getContribution(ContextMenuController.ID); - } - _onContextMenu(e) { - if (!this._editor.hasModel()) { - return; - } - if (!this._editor.getOption(15 /* contextmenu */)) { - this._editor.focus(); - // Ensure the cursor is at the position of the mouse click - if (e.target.position && !this._editor.getSelection().containsPosition(e.target.position)) { - this._editor.setPosition(e.target.position); - } - return; // Context menu is turned off through configuration - } - if (e.target.type === 12 /* OVERLAY_WIDGET */) { - return; // allow native menu on widgets to support right click on input field for example in find - } - e.event.preventDefault(); - if (e.target.type !== 6 /* CONTENT_TEXT */ && e.target.type !== 7 /* CONTENT_EMPTY */ && e.target.type !== 1 /* TEXTAREA */) { - return; // only support mouse click into text or native context menu key for now - } - // Ensure the editor gets focus if it hasn't, so the right events are being sent to other contributions - this._editor.focus(); - // Ensure the cursor is at the position of the mouse click - if (e.target.position) { - let hasSelectionAtPosition = false; - for (const selection of this._editor.getSelections()) { - if (selection.containsPosition(e.target.position)) { - hasSelectionAtPosition = true; - break; - } - } - if (!hasSelectionAtPosition) { - this._editor.setPosition(e.target.position); - } - } - // Unless the user triggerd the context menu through Shift+F10, use the mouse position as menu position - let anchor = null; - if (e.target.type !== 1 /* TEXTAREA */) { - anchor = { x: e.event.posx - 1, width: 2, y: e.event.posy - 1, height: 2 }; - } - // Show the context menu - this.showContextMenu(anchor); - } - showContextMenu(anchor) { - if (!this._editor.getOption(15 /* contextmenu */)) { - return; // Context menu is turned off through configuration - } - if (!this._editor.hasModel()) { - return; - } - if (!this._contextMenuService) { - this._editor.focus(); - return; // We need the context menu service to function - } - // Find actions available for menu - const menuActions = this._getMenuActions(this._editor.getModel(), _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_6__["MenuId"].EditorContext); - // Show menu if we have actions to show - if (menuActions.length > 0) { - this._doShowContextMenu(menuActions, anchor); - } - } - _getMenuActions(model, menuId) { - const result = []; - // get menu groups - const menu = this._menuService.createMenu(menuId, this._contextKeyService); - const groups = menu.getActions({ arg: model.uri }); - menu.dispose(); - // translate them into other actions - for (let group of groups) { - const [, actions] = group; - let addedItems = 0; - for (const action of actions) { - if (action instanceof _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_6__["SubmenuItemAction"]) { - const subActions = this._getMenuActions(model, action.item.submenu); - if (subActions.length > 0) { - result.push(new _base_common_actions_js__WEBPACK_IMPORTED_MODULE_2__["SubmenuAction"](action.id, action.label, subActions)); - addedItems++; - } - } - else { - result.push(action); - addedItems++; - } - } - if (addedItems) { - result.push(new _base_common_actions_js__WEBPACK_IMPORTED_MODULE_2__["Separator"]()); - } - } - if (result.length) { - result.pop(); // remove last separator - } - return result; - } - _doShowContextMenu(actions, anchor = null) { - if (!this._editor.hasModel()) { - return; - } - // Disable hover - const oldHoverSetting = this._editor.getOption(46 /* hover */); - this._editor.updateOptions({ - hover: { - enabled: false - } - }); - if (!anchor) { - // Ensure selection is visible - this._editor.revealPosition(this._editor.getPosition(), 1 /* Immediate */); - this._editor.render(); - const cursorCoords = this._editor.getScrolledVisiblePosition(this._editor.getPosition()); - // Translate to absolute editor position - const editorCoords = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["getDomNodePagePosition"](this._editor.getDomNode()); - const posx = editorCoords.left + cursorCoords.left; - const posy = editorCoords.top + cursorCoords.top + cursorCoords.height; - anchor = { x: posx, y: posy }; - } - // Show menu - this._contextMenuIsBeingShownCount++; - this._contextMenuService.showContextMenu({ - domForShadowRoot: this._editor.getDomNode(), - getAnchor: () => anchor, - getActions: () => actions, - getActionViewItem: (action) => { - const keybinding = this._keybindingFor(action); - if (keybinding) { - return new _base_browser_ui_actionbar_actionViewItems_js__WEBPACK_IMPORTED_MODULE_10__["ActionViewItem"](action, action, { label: true, keybinding: keybinding.getLabel(), isMenu: true }); - } - const customActionViewItem = action; - if (typeof customActionViewItem.getActionViewItem === 'function') { - return customActionViewItem.getActionViewItem(); - } - return new _base_browser_ui_actionbar_actionViewItems_js__WEBPACK_IMPORTED_MODULE_10__["ActionViewItem"](action, action, { icon: true, label: true, isMenu: true }); - }, - getKeyBinding: (action) => { - return this._keybindingFor(action); - }, - onHide: (wasCancelled) => { - this._contextMenuIsBeingShownCount--; - this._editor.focus(); - this._editor.updateOptions({ - hover: oldHoverSetting - }); - } - }); - } - _keybindingFor(action) { - return this._keybindingService.lookupKeybinding(action.id); - } - dispose() { - if (this._contextMenuIsBeingShownCount > 0) { - this._contextViewService.hideContextView(); - } - this._toDispose.dispose(); - } -}; -ContextMenuController.ID = 'editor.contrib.contextmenu'; -ContextMenuController = __decorate([ - __param(1, _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_8__["IContextMenuService"]), - __param(2, _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_8__["IContextViewService"]), - __param(3, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_7__["IContextKeyService"]), - __param(4, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_9__["IKeybindingService"]), - __param(5, _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_6__["IMenuService"]) -], ContextMenuController); - -class ShowContextMenu extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.showContextMenu', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('action.showContextMenu.label', "Show Editor Context Menu"), - alias: 'Show Editor Context Menu', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].textInputFocus, - primary: 1024 /* Shift */ | 68 /* F10 */, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - let contribution = ContextMenuController.get(editor); - contribution.showContextMenu(); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorContribution"])(ContextMenuController.ID, ContextMenuController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(ShowContextMenu); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/cursorUndo/cursorUndo.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/cursorUndo/cursorUndo.js ***! - \***********************************************************************************/ -/*! exports provided: CursorUndoRedoController, CursorUndo, CursorRedo */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorUndoRedoController", function() { return CursorUndoRedoController; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorUndo", function() { return CursorUndo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorRedo", function() { return CursorRedo; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class CursorState { - constructor(selections) { - this.selections = selections; - } - equals(other) { - const thisLen = this.selections.length; - const otherLen = other.selections.length; - if (thisLen !== otherLen) { - return false; - } - for (let i = 0; i < thisLen; i++) { - if (!this.selections[i].equalsSelection(other.selections[i])) { - return false; - } - } - return true; - } -} -class StackElement { - constructor(cursorState, scrollTop, scrollLeft) { - this.cursorState = cursorState; - this.scrollTop = scrollTop; - this.scrollLeft = scrollLeft; - } -} -class CursorUndoRedoController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(editor) { - super(); - this._editor = editor; - this._isCursorUndoRedo = false; - this._undoStack = []; - this._redoStack = []; - this._register(editor.onDidChangeModel((e) => { - this._undoStack = []; - this._redoStack = []; - })); - this._register(editor.onDidChangeModelContent((e) => { - this._undoStack = []; - this._redoStack = []; - })); - this._register(editor.onDidChangeCursorSelection((e) => { - if (this._isCursorUndoRedo) { - return; - } - if (!e.oldSelections) { - return; - } - if (e.oldModelVersionId !== e.modelVersionId) { - return; - } - const prevState = new CursorState(e.oldSelections); - const isEqualToLastUndoStack = (this._undoStack.length > 0 && this._undoStack[this._undoStack.length - 1].cursorState.equals(prevState)); - if (!isEqualToLastUndoStack) { - this._undoStack.push(new StackElement(prevState, editor.getScrollTop(), editor.getScrollLeft())); - this._redoStack = []; - if (this._undoStack.length > 50) { - // keep the cursor undo stack bounded - this._undoStack.shift(); - } - } - })); - } - static get(editor) { - return editor.getContribution(CursorUndoRedoController.ID); - } - cursorUndo() { - if (!this._editor.hasModel() || this._undoStack.length === 0) { - return; - } - this._redoStack.push(new StackElement(new CursorState(this._editor.getSelections()), this._editor.getScrollTop(), this._editor.getScrollLeft())); - this._applyState(this._undoStack.pop()); - } - cursorRedo() { - if (!this._editor.hasModel() || this._redoStack.length === 0) { - return; - } - this._undoStack.push(new StackElement(new CursorState(this._editor.getSelections()), this._editor.getScrollTop(), this._editor.getScrollLeft())); - this._applyState(this._redoStack.pop()); - } - _applyState(stackElement) { - this._isCursorUndoRedo = true; - this._editor.setSelections(stackElement.cursorState.selections); - this._editor.setScrollPosition({ - scrollTop: stackElement.scrollTop, - scrollLeft: stackElement.scrollLeft - }); - this._isCursorUndoRedo = false; - } -} -CursorUndoRedoController.ID = 'editor.contrib.cursorUndoRedoController'; -class CursorUndo extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["EditorAction"] { - constructor() { - super({ - id: 'cursorUndo', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('cursor.undo', "Cursor Undo"), - alias: 'Cursor Undo', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 51 /* KEY_U */, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor, args) { - CursorUndoRedoController.get(editor).cursorUndo(); - } -} -class CursorRedo extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["EditorAction"] { - constructor() { - super({ - id: 'cursorRedo', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('cursor.redo', "Cursor Redo"), - alias: 'Cursor Redo', - precondition: undefined - }); - } - run(accessor, editor, args) { - CursorUndoRedoController.get(editor).cursorRedo(); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorContribution"])(CursorUndoRedoController.ID, CursorUndoRedoController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorAction"])(CursorUndo); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorAction"])(CursorRedo); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/dnd/dnd.css": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/dnd/dnd.css ***! - \**********************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_dnd_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./dnd.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/dnd/dnd.css"); -/* harmony import */ var _css_loader_dist_cjs_js_dnd_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_dnd_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_dnd_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_dnd_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/dnd/dnd.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/dnd/dnd.js ***! - \*********************************************************************/ -/*! exports provided: DragAndDropController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragAndDropController", function() { return DragAndDropController; }); -/* harmony import */ var _dnd_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dnd.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/dnd/dnd.css"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _dragAndDropCommand_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dragAndDropCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/dnd/dragAndDropCommand.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -function hasTriggerModifier(e) { - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"]) { - return e.altKey; - } - else { - return e.ctrlKey; - } -} -class DragAndDropController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(editor) { - super(); - this._editor = editor; - this._register(this._editor.onMouseDown((e) => this._onEditorMouseDown(e))); - this._register(this._editor.onMouseUp((e) => this._onEditorMouseUp(e))); - this._register(this._editor.onMouseDrag((e) => this._onEditorMouseDrag(e))); - this._register(this._editor.onMouseDrop((e) => this._onEditorMouseDrop(e))); - this._register(this._editor.onKeyDown((e) => this.onEditorKeyDown(e))); - this._register(this._editor.onKeyUp((e) => this.onEditorKeyUp(e))); - this._register(this._editor.onDidBlurEditorWidget(() => this.onEditorBlur())); - this._register(this._editor.onDidBlurEditorText(() => this.onEditorBlur())); - this._dndDecorationIds = []; - this._mouseDown = false; - this._modifierPressed = false; - this._dragSelection = null; - } - onEditorBlur() { - this._removeDecoration(); - this._dragSelection = null; - this._mouseDown = false; - this._modifierPressed = false; - } - onEditorKeyDown(e) { - if (!this._editor.getOption(25 /* dragAndDrop */) || this._editor.getOption(13 /* columnSelection */)) { - return; - } - if (hasTriggerModifier(e)) { - this._modifierPressed = true; - } - if (this._mouseDown && hasTriggerModifier(e)) { - this._editor.updateOptions({ - mouseStyle: 'copy' - }); - } - } - onEditorKeyUp(e) { - if (!this._editor.getOption(25 /* dragAndDrop */) || this._editor.getOption(13 /* columnSelection */)) { - return; - } - if (hasTriggerModifier(e)) { - this._modifierPressed = false; - } - if (this._mouseDown && e.keyCode === DragAndDropController.TRIGGER_KEY_VALUE) { - this._editor.updateOptions({ - mouseStyle: 'default' - }); - } - } - _onEditorMouseDown(mouseEvent) { - this._mouseDown = true; - } - _onEditorMouseUp(mouseEvent) { - this._mouseDown = false; - // Whenever users release the mouse, the drag and drop operation should finish and the cursor should revert to text. - this._editor.updateOptions({ - mouseStyle: 'text' - }); - } - _onEditorMouseDrag(mouseEvent) { - let target = mouseEvent.target; - if (this._dragSelection === null) { - const selections = this._editor.getSelections() || []; - let possibleSelections = selections.filter(selection => target.position && selection.containsPosition(target.position)); - if (possibleSelections.length === 1) { - this._dragSelection = possibleSelections[0]; - } - else { - return; - } - } - if (hasTriggerModifier(mouseEvent.event)) { - this._editor.updateOptions({ - mouseStyle: 'copy' - }); - } - else { - this._editor.updateOptions({ - mouseStyle: 'default' - }); - } - if (target.position) { - if (this._dragSelection.containsPosition(target.position)) { - this._removeDecoration(); - } - else { - this.showAt(target.position); - } - } - } - _onEditorMouseDrop(mouseEvent) { - if (mouseEvent.target && (this._hitContent(mouseEvent.target) || this._hitMargin(mouseEvent.target)) && mouseEvent.target.position) { - let newCursorPosition = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"](mouseEvent.target.position.lineNumber, mouseEvent.target.position.column); - if (this._dragSelection === null) { - let newSelections = null; - if (mouseEvent.event.shiftKey) { - let primarySelection = this._editor.getSelection(); - if (primarySelection) { - const { selectionStartLineNumber, selectionStartColumn } = primarySelection; - newSelections = [new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_6__["Selection"](selectionStartLineNumber, selectionStartColumn, newCursorPosition.lineNumber, newCursorPosition.column)]; - } - } - else { - newSelections = (this._editor.getSelections() || []).map(selection => { - if (selection.containsPosition(newCursorPosition)) { - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_6__["Selection"](newCursorPosition.lineNumber, newCursorPosition.column, newCursorPosition.lineNumber, newCursorPosition.column); - } - else { - return selection; - } - }); - } - // Use `mouse` as the source instead of `api`. - this._editor.setSelections(newSelections || [], 'mouse'); - } - else if (!this._dragSelection.containsPosition(newCursorPosition) || - ((hasTriggerModifier(mouseEvent.event) || - this._modifierPressed) && (this._dragSelection.getEndPosition().equals(newCursorPosition) || this._dragSelection.getStartPosition().equals(newCursorPosition)) // we allow users to paste content beside the selection - )) { - this._editor.pushUndoStop(); - this._editor.executeCommand(DragAndDropController.ID, new _dragAndDropCommand_js__WEBPACK_IMPORTED_MODULE_7__["DragAndDropCommand"](this._dragSelection, newCursorPosition, hasTriggerModifier(mouseEvent.event) || this._modifierPressed)); - this._editor.pushUndoStop(); - } - } - this._editor.updateOptions({ - mouseStyle: 'text' - }); - this._removeDecoration(); - this._dragSelection = null; - this._mouseDown = false; - } - showAt(position) { - let newDecorations = [{ - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](position.lineNumber, position.column, position.lineNumber, position.column), - options: DragAndDropController._DECORATION_OPTIONS - }]; - this._dndDecorationIds = this._editor.deltaDecorations(this._dndDecorationIds, newDecorations); - this._editor.revealPosition(position, 1 /* Immediate */); - } - _removeDecoration() { - this._dndDecorationIds = this._editor.deltaDecorations(this._dndDecorationIds, []); - } - _hitContent(target) { - return target.type === 6 /* CONTENT_TEXT */ || - target.type === 7 /* CONTENT_EMPTY */; - } - _hitMargin(target) { - return target.type === 2 /* GUTTER_GLYPH_MARGIN */ || - target.type === 3 /* GUTTER_LINE_NUMBERS */ || - target.type === 4 /* GUTTER_LINE_DECORATIONS */; - } - dispose() { - this._removeDecoration(); - this._dragSelection = null; - this._mouseDown = false; - this._modifierPressed = false; - super.dispose(); - } -} -DragAndDropController.ID = 'editor.contrib.dragAndDrop'; -DragAndDropController.TRIGGER_KEY_VALUE = _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"] ? 6 /* Alt */ : 5 /* Ctrl */; -DragAndDropController._DECORATION_OPTIONS = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_8__["ModelDecorationOptions"].register({ - className: 'dnd-target' -}); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorContribution"])(DragAndDropController.ID, DragAndDropController); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/dnd/dragAndDropCommand.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/dnd/dragAndDropCommand.js ***! - \************************************************************************************/ -/*! exports provided: DragAndDropCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragAndDropCommand", function() { return DragAndDropCommand; }); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class DragAndDropCommand { - constructor(selection, targetPosition, copy) { - this.selection = selection; - this.targetPosition = targetPosition; - this.copy = copy; - this.targetSelection = null; - } - getEditOperations(model, builder) { - let text = model.getValueInRange(this.selection); - if (!this.copy) { - builder.addEditOperation(this.selection, null); - } - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"](this.targetPosition.lineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.targetPosition.column), text); - if (this.selection.containsPosition(this.targetPosition) && !(this.copy && (this.selection.getEndPosition().equals(this.targetPosition) || this.selection.getStartPosition().equals(this.targetPosition)) // we allow users to paste content beside the selection - )) { - this.targetSelection = this.selection; - return; - } - if (this.copy) { - this.targetSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_0__["Selection"](this.targetPosition.lineNumber, this.targetPosition.column, this.selection.endLineNumber - this.selection.startLineNumber + this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? - this.targetPosition.column + this.selection.endColumn - this.selection.startColumn : - this.selection.endColumn); - return; - } - if (this.targetPosition.lineNumber > this.selection.endLineNumber) { - // Drag the selection downwards - this.targetSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_0__["Selection"](this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? - this.targetPosition.column + this.selection.endColumn - this.selection.startColumn : - this.selection.endColumn); - return; - } - if (this.targetPosition.lineNumber < this.selection.endLineNumber) { - // Drag the selection upwards - this.targetSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_0__["Selection"](this.targetPosition.lineNumber, this.targetPosition.column, this.targetPosition.lineNumber + this.selection.endLineNumber - this.selection.startLineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? - this.targetPosition.column + this.selection.endColumn - this.selection.startColumn : - this.selection.endColumn); - return; - } - // The target position is at the same line as the selection's end position. - if (this.selection.endColumn <= this.targetPosition.column) { - // The target position is after the selection's end position - this.targetSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_0__["Selection"](this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? - this.targetPosition.column - this.selection.endColumn + this.selection.startColumn : - this.targetPosition.column - this.selection.endColumn + this.selection.startColumn, this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? - this.targetPosition.column : - this.selection.endColumn); - } - else { - // The target position is before the selection's end position. Since the selection doesn't contain the target position, the selection is one-line and target position is before this selection. - this.targetSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_0__["Selection"](this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.targetPosition.column + this.selection.endColumn - this.selection.startColumn); - } - } - computeCursorState(model, helper) { - return this.targetSelection; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/media/outlineTree.css": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/media/outlineTree.css ***! - \************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_outlineTree_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./outlineTree.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/media/outlineTree.css"); -/* harmony import */ var _css_loader_dist_cjs_js_outlineTree_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_outlineTree_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_outlineTree_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_outlineTree_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/media/symbol-icons.css": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/media/symbol-icons.css ***! - \*************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_symbol_icons_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./symbol-icons.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/media/symbol-icons.css"); -/* harmony import */ var _css_loader_dist_cjs_js_symbol_icons_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_symbol_icons_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_symbol_icons_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_symbol_icons_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/outlineModel.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/outlineModel.js ***! - \******************************************************************************************/ -/*! exports provided: TreeElement, OutlineElement, OutlineGroup, OutlineModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TreeElement", function() { return TreeElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutlineElement", function() { return OutlineElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutlineGroup", function() { return OutlineGroup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutlineModel", function() { return OutlineModel; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/map.js */ "./node_modules/monaco-editor/esm/vs/base/common/map.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/* harmony import */ var _base_common_numbers_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/numbers.js */ "./node_modules/monaco-editor/esm/vs/base/common/numbers.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -class TreeElement { - remove() { - if (this.parent) { - this.parent.children.delete(this.id); - } - } - static findId(candidate, container) { - // complex id-computation which contains the origin/extension, - // the parent path, and some dedupe logic when names collide - let candidateId; - if (typeof candidate === 'string') { - candidateId = `${container.id}/${candidate}`; - } - else { - candidateId = `${container.id}/${candidate.name}`; - if (container.children.get(candidateId) !== undefined) { - candidateId = `${container.id}/${candidate.name}_${candidate.range.startLineNumber}_${candidate.range.startColumn}`; - } - } - let id = candidateId; - for (let i = 0; container.children.get(id) !== undefined; i++) { - id = `${candidateId}_${i}`; - } - return id; - } - static empty(element) { - return element.children.size === 0; - } -} -class OutlineElement extends TreeElement { - constructor(id, parent, symbol) { - super(); - this.id = id; - this.parent = parent; - this.symbol = symbol; - this.children = new Map(); - } -} -class OutlineGroup extends TreeElement { - constructor(id, parent, label, order) { - super(); - this.id = id; - this.parent = parent; - this.label = label; - this.order = order; - this.children = new Map(); - } -} -class OutlineModel extends TreeElement { - constructor(uri) { - super(); - this.uri = uri; - this.id = 'root'; - this.parent = undefined; - this._groups = new Map(); - this.children = new Map(); - this.id = 'root'; - this.parent = undefined; - } - static create(textModel, token) { - let key = this._keys.for(textModel, true); - let data = OutlineModel._requests.get(key); - if (!data) { - let source = new _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationTokenSource"](); - data = { - promiseCnt: 0, - source, - promise: OutlineModel._create(textModel, source.token), - model: undefined, - }; - OutlineModel._requests.set(key, data); - // keep moving average of request durations - const now = Date.now(); - data.promise.then(() => { - let key = this._keys.for(textModel, false); - let avg = this._requestDurations.get(key); - if (!avg) { - avg = new _base_common_numbers_js__WEBPACK_IMPORTED_MODULE_6__["MovingAverage"](); - this._requestDurations.set(key, avg); - } - avg.update(Date.now() - now); - }); - } - if (data.model) { - // resolved -> return data - return Promise.resolve(data.model); - } - // increase usage counter - data.promiseCnt += 1; - token.onCancellationRequested(() => { - // last -> cancel provider request, remove cached promise - if (--data.promiseCnt === 0) { - data.source.cancel(); - OutlineModel._requests.delete(key); - } - }); - return new Promise((resolve, reject) => { - data.promise.then(model => { - data.model = model; - resolve(model); - }, err => { - OutlineModel._requests.delete(key); - reject(err); - }); - }); - } - static _create(textModel, token) { - const cts = new _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationTokenSource"](token); - const result = new OutlineModel(textModel.uri); - const provider = _common_modes_js__WEBPACK_IMPORTED_MODULE_4__["DocumentSymbolProviderRegistry"].ordered(textModel); - const promises = provider.map((provider, index) => { - var _a; - let id = TreeElement.findId(`provider_${index}`, result); - let group = new OutlineGroup(id, result, (_a = provider.displayName) !== null && _a !== void 0 ? _a : 'Unknown Outline Provider', index); - return Promise.resolve(provider.provideDocumentSymbols(textModel, cts.token)).then(result => { - for (const info of result || []) { - OutlineModel._makeOutlineElement(info, group); - } - return group; - }, err => { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["onUnexpectedExternalError"])(err); - return group; - }).then(group => { - if (!TreeElement.empty(group)) { - result._groups.set(id, group); - } - else { - group.remove(); - } - }); - }); - const listener = _common_modes_js__WEBPACK_IMPORTED_MODULE_4__["DocumentSymbolProviderRegistry"].onDidChange(() => { - const newProvider = _common_modes_js__WEBPACK_IMPORTED_MODULE_4__["DocumentSymbolProviderRegistry"].ordered(textModel); - if (!Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["equals"])(newProvider, provider)) { - cts.cancel(); - } - }); - return Promise.all(promises).then(() => { - if (cts.token.isCancellationRequested && !token.isCancellationRequested) { - return OutlineModel._create(textModel, token); - } - else { - return result._compact(); - } - }).finally(() => { - listener.dispose(); - }); - } - static _makeOutlineElement(info, container) { - let id = TreeElement.findId(info, container); - let res = new OutlineElement(id, container, info); - if (info.children) { - for (const childInfo of info.children) { - OutlineModel._makeOutlineElement(childInfo, res); - } - } - container.children.set(res.id, res); - } - _compact() { - let count = 0; - for (const [key, group] of this._groups) { - if (group.children.size === 0) { // empty - this._groups.delete(key); - } - else { - count += 1; - } - } - if (count !== 1) { - // - this.children = this._groups; - } - else { - // adopt all elements of the first group - let group = _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_5__["Iterable"].first(this._groups.values()); - for (let [, child] of group.children) { - child.parent = this; - this.children.set(child.id, child); - } - } - return this; - } -} -OutlineModel._requestDurations = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_3__["LRUCache"](50, 0.7); -OutlineModel._requests = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_3__["LRUCache"](9, 0.75); -OutlineModel._keys = new class { - constructor() { - this._counter = 1; - this._data = new WeakMap(); - } - for(textModel, version) { - return `${textModel.id}/${version ? textModel.getVersionId() : ''}/${this._hash(_common_modes_js__WEBPACK_IMPORTED_MODULE_4__["DocumentSymbolProviderRegistry"].all(textModel))}`; - } - _hash(providers) { - let result = ''; - for (const provider of providers) { - let n = this._data.get(provider); - if (typeof n === 'undefined') { - n = this._counter++; - this._data.set(provider, n); - } - result += n; - } - return result; - } -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/outlineTree.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/outlineTree.js ***! - \*****************************************************************************************/ -/*! exports provided: SYMBOL_ICON_ARRAY_FOREGROUND, SYMBOL_ICON_BOOLEAN_FOREGROUND, SYMBOL_ICON_CLASS_FOREGROUND, SYMBOL_ICON_COLOR_FOREGROUND, SYMBOL_ICON_CONSTANT_FOREGROUND, SYMBOL_ICON_CONSTRUCTOR_FOREGROUND, SYMBOL_ICON_ENUMERATOR_FOREGROUND, SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND, SYMBOL_ICON_EVENT_FOREGROUND, SYMBOL_ICON_FIELD_FOREGROUND, SYMBOL_ICON_FILE_FOREGROUND, SYMBOL_ICON_FOLDER_FOREGROUND, SYMBOL_ICON_FUNCTION_FOREGROUND, SYMBOL_ICON_INTERFACE_FOREGROUND, SYMBOL_ICON_KEY_FOREGROUND, SYMBOL_ICON_KEYWORD_FOREGROUND, SYMBOL_ICON_METHOD_FOREGROUND, SYMBOL_ICON_MODULE_FOREGROUND, SYMBOL_ICON_NAMESPACE_FOREGROUND, SYMBOL_ICON_NULL_FOREGROUND, SYMBOL_ICON_NUMBER_FOREGROUND, SYMBOL_ICON_OBJECT_FOREGROUND, SYMBOL_ICON_OPERATOR_FOREGROUND, SYMBOL_ICON_PACKAGE_FOREGROUND, SYMBOL_ICON_PROPERTY_FOREGROUND, SYMBOL_ICON_REFERENCE_FOREGROUND, SYMBOL_ICON_SNIPPET_FOREGROUND, SYMBOL_ICON_STRING_FOREGROUND, SYMBOL_ICON_STRUCT_FOREGROUND, SYMBOL_ICON_TEXT_FOREGROUND, SYMBOL_ICON_TYPEPARAMETER_FOREGROUND, SYMBOL_ICON_UNIT_FOREGROUND, SYMBOL_ICON_VARIABLE_FOREGROUND */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_ARRAY_FOREGROUND", function() { return SYMBOL_ICON_ARRAY_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_BOOLEAN_FOREGROUND", function() { return SYMBOL_ICON_BOOLEAN_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_CLASS_FOREGROUND", function() { return SYMBOL_ICON_CLASS_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_COLOR_FOREGROUND", function() { return SYMBOL_ICON_COLOR_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_CONSTANT_FOREGROUND", function() { return SYMBOL_ICON_CONSTANT_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_CONSTRUCTOR_FOREGROUND", function() { return SYMBOL_ICON_CONSTRUCTOR_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_ENUMERATOR_FOREGROUND", function() { return SYMBOL_ICON_ENUMERATOR_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND", function() { return SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_EVENT_FOREGROUND", function() { return SYMBOL_ICON_EVENT_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_FIELD_FOREGROUND", function() { return SYMBOL_ICON_FIELD_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_FILE_FOREGROUND", function() { return SYMBOL_ICON_FILE_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_FOLDER_FOREGROUND", function() { return SYMBOL_ICON_FOLDER_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_FUNCTION_FOREGROUND", function() { return SYMBOL_ICON_FUNCTION_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_INTERFACE_FOREGROUND", function() { return SYMBOL_ICON_INTERFACE_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_KEY_FOREGROUND", function() { return SYMBOL_ICON_KEY_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_KEYWORD_FOREGROUND", function() { return SYMBOL_ICON_KEYWORD_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_METHOD_FOREGROUND", function() { return SYMBOL_ICON_METHOD_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_MODULE_FOREGROUND", function() { return SYMBOL_ICON_MODULE_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_NAMESPACE_FOREGROUND", function() { return SYMBOL_ICON_NAMESPACE_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_NULL_FOREGROUND", function() { return SYMBOL_ICON_NULL_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_NUMBER_FOREGROUND", function() { return SYMBOL_ICON_NUMBER_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_OBJECT_FOREGROUND", function() { return SYMBOL_ICON_OBJECT_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_OPERATOR_FOREGROUND", function() { return SYMBOL_ICON_OPERATOR_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_PACKAGE_FOREGROUND", function() { return SYMBOL_ICON_PACKAGE_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_PROPERTY_FOREGROUND", function() { return SYMBOL_ICON_PROPERTY_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_REFERENCE_FOREGROUND", function() { return SYMBOL_ICON_REFERENCE_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_SNIPPET_FOREGROUND", function() { return SYMBOL_ICON_SNIPPET_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_STRING_FOREGROUND", function() { return SYMBOL_ICON_STRING_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_STRUCT_FOREGROUND", function() { return SYMBOL_ICON_STRUCT_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_TEXT_FOREGROUND", function() { return SYMBOL_ICON_TEXT_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_TYPEPARAMETER_FOREGROUND", function() { return SYMBOL_ICON_TYPEPARAMETER_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_UNIT_FOREGROUND", function() { return SYMBOL_ICON_UNIT_FOREGROUND; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYMBOL_ICON_VARIABLE_FOREGROUND", function() { return SYMBOL_ICON_VARIABLE_FOREGROUND; }); -/* harmony import */ var _media_outlineTree_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/outlineTree.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/media/outlineTree.css"); -/* harmony import */ var _media_symbol_icons_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./media/symbol-icons.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/media/symbol-icons.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); - - - - - - -const SYMBOL_ICON_ARRAY_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.arrayForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.arrayForeground', 'The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_BOOLEAN_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.booleanForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.booleanForeground', 'The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_CLASS_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.classForeground', { - dark: '#EE9D28', - light: '#D67E00', - hc: '#EE9D28' -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.classForeground', 'The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_COLOR_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.colorForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.colorForeground', 'The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_CONSTANT_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.constantForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.constantForeground', 'The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_CONSTRUCTOR_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.constructorForeground', { - dark: '#B180D7', - light: '#652D90', - hc: '#B180D7' -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.constructorForeground', 'The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_ENUMERATOR_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.enumeratorForeground', { - dark: '#EE9D28', - light: '#D67E00', - hc: '#EE9D28' -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.enumeratorForeground', 'The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.enumeratorMemberForeground', { - dark: '#75BEFF', - light: '#007ACC', - hc: '#75BEFF' -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.enumeratorMemberForeground', 'The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_EVENT_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.eventForeground', { - dark: '#EE9D28', - light: '#D67E00', - hc: '#EE9D28' -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.eventForeground', 'The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_FIELD_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.fieldForeground', { - dark: '#75BEFF', - light: '#007ACC', - hc: '#75BEFF' -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.fieldForeground', 'The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_FILE_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.fileForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.fileForeground', 'The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_FOLDER_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.folderForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.folderForeground', 'The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_FUNCTION_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.functionForeground', { - dark: '#B180D7', - light: '#652D90', - hc: '#B180D7' -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.functionForeground', 'The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_INTERFACE_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.interfaceForeground', { - dark: '#75BEFF', - light: '#007ACC', - hc: '#75BEFF' -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.interfaceForeground', 'The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_KEY_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.keyForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.keyForeground', 'The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_KEYWORD_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.keywordForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.keywordForeground', 'The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_METHOD_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.methodForeground', { - dark: '#B180D7', - light: '#652D90', - hc: '#B180D7' -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.methodForeground', 'The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_MODULE_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.moduleForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.moduleForeground', 'The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_NAMESPACE_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.namespaceForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.namespaceForeground', 'The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_NULL_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.nullForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.nullForeground', 'The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_NUMBER_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.numberForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.numberForeground', 'The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_OBJECT_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.objectForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.objectForeground', 'The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_OPERATOR_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.operatorForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.operatorForeground', 'The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_PACKAGE_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.packageForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.packageForeground', 'The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_PROPERTY_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.propertyForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.propertyForeground', 'The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_REFERENCE_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.referenceForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.referenceForeground', 'The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_SNIPPET_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.snippetForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.snippetForeground', 'The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_STRING_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.stringForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.stringForeground', 'The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_STRUCT_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.structForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.structForeground', 'The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_TEXT_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.textForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.textForeground', 'The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_TYPEPARAMETER_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.typeParameterForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.typeParameterForeground', 'The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_UNIT_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.unitForeground', { - dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"], - hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["foreground"] -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.unitForeground', 'The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -const SYMBOL_ICON_VARIABLE_FOREGROUND = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_4__["registerColor"])('symbolIcon.variableForeground', { - dark: '#75BEFF', - light: '#007ACC', - hc: '#75BEFF' -}, Object(_nls_js__WEBPACK_IMPORTED_MODULE_2__["localize"])('symbolIcon.variableForeground', 'The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_3__["registerThemingParticipant"])((theme, collector) => { - const symbolIconArrayColor = theme.getColor(SYMBOL_ICON_ARRAY_FOREGROUND); - if (symbolIconArrayColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolArray.cssSelector} { color: ${symbolIconArrayColor}; }`); - } - const symbolIconBooleanColor = theme.getColor(SYMBOL_ICON_BOOLEAN_FOREGROUND); - if (symbolIconBooleanColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolBoolean.cssSelector} { color: ${symbolIconBooleanColor}; }`); - } - const symbolIconClassColor = theme.getColor(SYMBOL_ICON_CLASS_FOREGROUND); - if (symbolIconClassColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolClass.cssSelector} { color: ${symbolIconClassColor}; }`); - } - const symbolIconMethodColor = theme.getColor(SYMBOL_ICON_METHOD_FOREGROUND); - if (symbolIconMethodColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolMethod.cssSelector} { color: ${symbolIconMethodColor}; }`); - } - const symbolIconColorColor = theme.getColor(SYMBOL_ICON_COLOR_FOREGROUND); - if (symbolIconColorColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolColor.cssSelector} { color: ${symbolIconColorColor}; }`); - } - const symbolIconConstantColor = theme.getColor(SYMBOL_ICON_CONSTANT_FOREGROUND); - if (symbolIconConstantColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolConstant.cssSelector} { color: ${symbolIconConstantColor}; }`); - } - const symbolIconConstructorColor = theme.getColor(SYMBOL_ICON_CONSTRUCTOR_FOREGROUND); - if (symbolIconConstructorColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolConstructor.cssSelector} { color: ${symbolIconConstructorColor}; }`); - } - const symbolIconEnumeratorColor = theme.getColor(SYMBOL_ICON_ENUMERATOR_FOREGROUND); - if (symbolIconEnumeratorColor) { - collector.addRule(` - ${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolValue.cssSelector},${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolEnum.cssSelector} { color: ${symbolIconEnumeratorColor}; }`); - } - const symbolIconEnumeratorMemberColor = theme.getColor(SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND); - if (symbolIconEnumeratorMemberColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolEnumMember.cssSelector} { color: ${symbolIconEnumeratorMemberColor}; }`); - } - const symbolIconEventColor = theme.getColor(SYMBOL_ICON_EVENT_FOREGROUND); - if (symbolIconEventColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolEvent.cssSelector} { color: ${symbolIconEventColor}; }`); - } - const symbolIconFieldColor = theme.getColor(SYMBOL_ICON_FIELD_FOREGROUND); - if (symbolIconFieldColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolField.cssSelector} { color: ${symbolIconFieldColor}; }`); - } - const symbolIconFileColor = theme.getColor(SYMBOL_ICON_FILE_FOREGROUND); - if (symbolIconFileColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolFile.cssSelector} { color: ${symbolIconFileColor}; }`); - } - const symbolIconFolderColor = theme.getColor(SYMBOL_ICON_FOLDER_FOREGROUND); - if (symbolIconFolderColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolFolder.cssSelector} { color: ${symbolIconFolderColor}; }`); - } - const symbolIconFunctionColor = theme.getColor(SYMBOL_ICON_FUNCTION_FOREGROUND); - if (symbolIconFunctionColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolFunction.cssSelector} { color: ${symbolIconFunctionColor}; }`); - } - const symbolIconInterfaceColor = theme.getColor(SYMBOL_ICON_INTERFACE_FOREGROUND); - if (symbolIconInterfaceColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolInterface.cssSelector} { color: ${symbolIconInterfaceColor}; }`); - } - const symbolIconKeyColor = theme.getColor(SYMBOL_ICON_KEY_FOREGROUND); - if (symbolIconKeyColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolKey.cssSelector} { color: ${symbolIconKeyColor}; }`); - } - const symbolIconKeywordColor = theme.getColor(SYMBOL_ICON_KEYWORD_FOREGROUND); - if (symbolIconKeywordColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolKeyword.cssSelector} { color: ${symbolIconKeywordColor}; }`); - } - const symbolIconModuleColor = theme.getColor(SYMBOL_ICON_MODULE_FOREGROUND); - if (symbolIconModuleColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolModule.cssSelector} { color: ${symbolIconModuleColor}; }`); - } - const outlineNamespaceColor = theme.getColor(SYMBOL_ICON_NAMESPACE_FOREGROUND); - if (outlineNamespaceColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolNamespace.cssSelector} { color: ${outlineNamespaceColor}; }`); - } - const symbolIconNullColor = theme.getColor(SYMBOL_ICON_NULL_FOREGROUND); - if (symbolIconNullColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolNull.cssSelector} { color: ${symbolIconNullColor}; }`); - } - const symbolIconNumberColor = theme.getColor(SYMBOL_ICON_NUMBER_FOREGROUND); - if (symbolIconNumberColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolNumber.cssSelector} { color: ${symbolIconNumberColor}; }`); - } - const symbolIconObjectColor = theme.getColor(SYMBOL_ICON_OBJECT_FOREGROUND); - if (symbolIconObjectColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolObject.cssSelector} { color: ${symbolIconObjectColor}; }`); - } - const symbolIconOperatorColor = theme.getColor(SYMBOL_ICON_OPERATOR_FOREGROUND); - if (symbolIconOperatorColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolOperator.cssSelector} { color: ${symbolIconOperatorColor}; }`); - } - const symbolIconPackageColor = theme.getColor(SYMBOL_ICON_PACKAGE_FOREGROUND); - if (symbolIconPackageColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolPackage.cssSelector} { color: ${symbolIconPackageColor}; }`); - } - const symbolIconPropertyColor = theme.getColor(SYMBOL_ICON_PROPERTY_FOREGROUND); - if (symbolIconPropertyColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolProperty.cssSelector} { color: ${symbolIconPropertyColor}; }`); - } - const symbolIconReferenceColor = theme.getColor(SYMBOL_ICON_REFERENCE_FOREGROUND); - if (symbolIconReferenceColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolReference.cssSelector} { color: ${symbolIconReferenceColor}; }`); - } - const symbolIconSnippetColor = theme.getColor(SYMBOL_ICON_SNIPPET_FOREGROUND); - if (symbolIconSnippetColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolSnippet.cssSelector} { color: ${symbolIconSnippetColor}; }`); - } - const symbolIconStringColor = theme.getColor(SYMBOL_ICON_STRING_FOREGROUND); - if (symbolIconStringColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolString.cssSelector} { color: ${symbolIconStringColor}; }`); - } - const symbolIconStructColor = theme.getColor(SYMBOL_ICON_STRUCT_FOREGROUND); - if (symbolIconStructColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolStruct.cssSelector} { color: ${symbolIconStructColor}; }`); - } - const symbolIconTextColor = theme.getColor(SYMBOL_ICON_TEXT_FOREGROUND); - if (symbolIconTextColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolText.cssSelector} { color: ${symbolIconTextColor}; }`); - } - const symbolIconTypeParameterColor = theme.getColor(SYMBOL_ICON_TYPEPARAMETER_FOREGROUND); - if (symbolIconTypeParameterColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolTypeParameter.cssSelector} { color: ${symbolIconTypeParameterColor}; }`); - } - const symbolIconUnitColor = theme.getColor(SYMBOL_ICON_UNIT_FOREGROUND); - if (symbolIconUnitColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolUnit.cssSelector} { color: ${symbolIconUnitColor}; }`); - } - const symbolIconVariableColor = theme.getColor(SYMBOL_ICON_VARIABLE_FOREGROUND); - if (symbolIconVariableColor) { - collector.addRule(`${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_5__["Codicon"].symbolVariable.cssSelector} { color: ${symbolIconVariableColor}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findController.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/find/findController.js ***! - \*********************************************************************************/ -/*! exports provided: getSelectionSearchString, CommonFindController, FindController, StartFindAction, StartFindWithSelectionAction, MatchFindAction, NextMatchFindAction, NextMatchFindAction2, PreviousMatchFindAction, PreviousMatchFindAction2, SelectionMatchFindAction, NextSelectionMatchFindAction, PreviousSelectionMatchFindAction, StartFindReplaceAction, EditorStartFindAction, EditorStartFindReplaceAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectionSearchString", function() { return getSelectionSearchString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommonFindController", function() { return CommonFindController; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindController", function() { return FindController; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StartFindAction", function() { return StartFindAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StartFindWithSelectionAction", function() { return StartFindWithSelectionAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MatchFindAction", function() { return MatchFindAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NextMatchFindAction", function() { return NextMatchFindAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NextMatchFindAction2", function() { return NextMatchFindAction2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreviousMatchFindAction", function() { return PreviousMatchFindAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreviousMatchFindAction2", function() { return PreviousMatchFindAction2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionMatchFindAction", function() { return SelectionMatchFindAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NextSelectionMatchFindAction", function() { return NextSelectionMatchFindAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreviousSelectionMatchFindAction", function() { return PreviousSelectionMatchFindAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StartFindReplaceAction", function() { return StartFindReplaceAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorStartFindAction", function() { return EditorStartFindAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorStartFindReplaceAction", function() { return EditorStartFindReplaceAction; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _findModel_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./findModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findModel.js"); -/* harmony import */ var _findOptionsWidget_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./findOptionsWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findOptionsWidget.js"); -/* harmony import */ var _findState_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./findState.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findState.js"); -/* harmony import */ var _findWidget_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./findWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findWidget.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../platform/clipboard/common/clipboardService.js */ "./node_modules/monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/contextview/browser/contextView.js */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextView.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/storage/common/storage.js */ "./node_modules/monaco-editor/esm/vs/platform/storage/common/storage.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _platform_userDataSync_common_storageKeys_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/userDataSync/common/storageKeys.js */ "./node_modules/monaco-editor/esm/vs/platform/userDataSync/common/storageKeys.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - - - - -const SEARCH_STRING_MAX_LENGTH = 524288; -function getSelectionSearchString(editor) { - if (!editor.hasModel()) { - return null; - } - const selection = editor.getSelection(); - // if selection spans multiple lines, default search string to empty - if (selection.startLineNumber === selection.endLineNumber) { - if (selection.isEmpty()) { - const wordAtPosition = editor.getConfiguredWordAtPosition(selection.getStartPosition()); - if (wordAtPosition) { - return wordAtPosition.word; - } - } - else { - if (editor.getModel().getValueLengthInRange(selection) < SEARCH_STRING_MAX_LENGTH) { - return editor.getModel().getValueInRange(selection); - } - } - } - return null; -} -let CommonFindController = class CommonFindController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor(editor, contextKeyService, storageService, clipboardService) { - super(); - this._editor = editor; - this._findWidgetVisible = _findModel_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_FIND_WIDGET_VISIBLE"].bindTo(contextKeyService); - this._contextKeyService = contextKeyService; - this._storageService = storageService; - this._clipboardService = clipboardService; - this._updateHistoryDelayer = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_1__["Delayer"](500); - this._state = this._register(new _findState_js__WEBPACK_IMPORTED_MODULE_8__["FindReplaceState"]()); - this.loadQueryState(); - this._register(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e))); - this._model = null; - this._register(this._editor.onDidChangeModel(() => { - let shouldRestartFind = (this._editor.getModel() && this._state.isRevealed); - this.disposeModel(); - this._state.change({ - searchScope: null, - matchCase: this._storageService.getBoolean('editor.matchCase', 1 /* WORKSPACE */, false), - wholeWord: this._storageService.getBoolean('editor.wholeWord', 1 /* WORKSPACE */, false), - isRegex: this._storageService.getBoolean('editor.isRegex', 1 /* WORKSPACE */, false), - preserveCase: this._storageService.getBoolean('editor.preserveCase', 1 /* WORKSPACE */, false) - }, false); - if (shouldRestartFind) { - this._start({ - forceRevealReplace: false, - seedSearchStringFromSelection: false && false, - seedSearchStringFromGlobalClipboard: false, - shouldFocus: 0 /* NoFocusChange */, - shouldAnimate: false, - updateSearchScope: false, - loop: this._editor.getOption(29 /* find */).loop - }); - } - })); - } - static get(editor) { - return editor.getContribution(CommonFindController.ID); - } - dispose() { - this.disposeModel(); - super.dispose(); - } - disposeModel() { - if (this._model) { - this._model.dispose(); - this._model = null; - } - } - _onStateChanged(e) { - this.saveQueryState(e); - if (e.isRevealed) { - if (this._state.isRevealed) { - this._findWidgetVisible.set(true); - } - else { - this._findWidgetVisible.reset(); - this.disposeModel(); - } - } - if (e.searchString) { - this.setGlobalBufferTerm(this._state.searchString); - } - } - saveQueryState(e) { - if (e.isRegex) { - this._storageService.store('editor.isRegex', this._state.actualIsRegex, 1 /* WORKSPACE */); - } - if (e.wholeWord) { - this._storageService.store('editor.wholeWord', this._state.actualWholeWord, 1 /* WORKSPACE */); - } - if (e.matchCase) { - this._storageService.store('editor.matchCase', this._state.actualMatchCase, 1 /* WORKSPACE */); - } - if (e.preserveCase) { - this._storageService.store('editor.preserveCase', this._state.actualPreserveCase, 1 /* WORKSPACE */); - } - } - loadQueryState() { - this._state.change({ - matchCase: this._storageService.getBoolean('editor.matchCase', 1 /* WORKSPACE */, this._state.matchCase), - wholeWord: this._storageService.getBoolean('editor.wholeWord', 1 /* WORKSPACE */, this._state.wholeWord), - isRegex: this._storageService.getBoolean('editor.isRegex', 1 /* WORKSPACE */, this._state.isRegex), - preserveCase: this._storageService.getBoolean('editor.preserveCase', 1 /* WORKSPACE */, this._state.preserveCase) - }, false); - } - isFindInputFocused() { - return !!_findModel_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_FIND_INPUT_FOCUSED"].getValue(this._contextKeyService); - } - getState() { - return this._state; - } - closeFindWidget() { - this._state.change({ - isRevealed: false, - searchScope: null - }, false); - this._editor.focus(); - } - toggleCaseSensitive() { - this._state.change({ matchCase: !this._state.matchCase }, false); - if (!this._state.isRevealed) { - this.highlightFindOptions(); - } - } - toggleWholeWords() { - this._state.change({ wholeWord: !this._state.wholeWord }, false); - if (!this._state.isRevealed) { - this.highlightFindOptions(); - } - } - toggleRegex() { - this._state.change({ isRegex: !this._state.isRegex }, false); - if (!this._state.isRevealed) { - this.highlightFindOptions(); - } - } - toggleSearchScope() { - if (this._state.searchScope) { - this._state.change({ searchScope: null }, true); - } - else { - if (this._editor.hasModel()) { - let selections = this._editor.getSelections(); - selections.map(selection => { - if (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) { - selection = selection.setEndPosition(selection.endLineNumber - 1, this._editor.getModel().getLineMaxColumn(selection.endLineNumber - 1)); - } - if (!selection.isEmpty()) { - return selection; - } - return null; - }).filter(element => !!element); - if (selections.length) { - this._state.change({ searchScope: selections }, true); - } - } - } - } - setSearchString(searchString) { - if (this._state.isRegex) { - searchString = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["escapeRegExpCharacters"](searchString); - } - this._state.change({ searchString: searchString }, false); - } - highlightFindOptions() { - // overwritten in subclass - } - _start(opts) { - return __awaiter(this, void 0, void 0, function* () { - this.disposeModel(); - if (!this._editor.hasModel()) { - // cannot do anything with an editor that doesn't have a model... - return; - } - let stateChanges = { - isRevealed: true - }; - if (opts.seedSearchStringFromSelection) { - let selectionSearchString = getSelectionSearchString(this._editor); - if (selectionSearchString) { - if (this._state.isRegex) { - stateChanges.searchString = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["escapeRegExpCharacters"](selectionSearchString); - } - else { - stateChanges.searchString = selectionSearchString; - } - } - } - if (!stateChanges.searchString && opts.seedSearchStringFromGlobalClipboard) { - let selectionSearchString = yield this.getGlobalBufferTerm(); - if (!this._editor.hasModel()) { - // the editor has lost its model in the meantime - return; - } - if (selectionSearchString) { - stateChanges.searchString = selectionSearchString; - } - } - // Overwrite isReplaceRevealed - if (opts.forceRevealReplace) { - stateChanges.isReplaceRevealed = true; - } - else if (!this._findWidgetVisible.get()) { - stateChanges.isReplaceRevealed = false; - } - if (opts.updateSearchScope) { - let currentSelections = this._editor.getSelections(); - if (currentSelections.some(selection => !selection.isEmpty())) { - stateChanges.searchScope = currentSelections; - } - } - stateChanges.loop = opts.loop; - this._state.change(stateChanges, false); - if (!this._model) { - this._model = new _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FindModelBoundToEditorModel"](this._editor, this._state); - } - }); - } - start(opts) { - return this._start(opts); - } - moveToNextMatch() { - if (this._model) { - this._model.moveToNextMatch(); - return true; - } - return false; - } - moveToPrevMatch() { - if (this._model) { - this._model.moveToPrevMatch(); - return true; - } - return false; - } - replace() { - if (this._model) { - this._model.replace(); - return true; - } - return false; - } - replaceAll() { - if (this._model) { - this._model.replaceAll(); - return true; - } - return false; - } - selectAllMatches() { - if (this._model) { - this._model.selectAllMatches(); - this._editor.focus(); - return true; - } - return false; - } - getGlobalBufferTerm() { - return __awaiter(this, void 0, void 0, function* () { - if (this._editor.getOption(29 /* find */).globalFindClipboard - && this._editor.hasModel() - && !this._editor.getModel().isTooLargeForSyncing()) { - return this._clipboardService.readFindText(); - } - return ''; - }); - } - setGlobalBufferTerm(text) { - if (this._editor.getOption(29 /* find */).globalFindClipboard - && this._editor.hasModel() - && !this._editor.getModel().isTooLargeForSyncing()) { - // intentionally not awaited - this._clipboardService.writeFindText(text); - } - } -}; -CommonFindController.ID = 'editor.contrib.findController'; -CommonFindController = __decorate([ - __param(1, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["IContextKeyService"]), - __param(2, _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_15__["IStorageService"]), - __param(3, _platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_11__["IClipboardService"]) -], CommonFindController); - -let FindController = class FindController extends CommonFindController { - constructor(editor, _contextViewService, _contextKeyService, _keybindingService, _themeService, _notificationService, _storageService, _storageKeysSyncRegistryService, clipboardService) { - super(editor, _contextKeyService, _storageService, clipboardService); - this._contextViewService = _contextViewService; - this._keybindingService = _keybindingService; - this._themeService = _themeService; - this._notificationService = _notificationService; - this._storageKeysSyncRegistryService = _storageKeysSyncRegistryService; - this._widget = null; - this._findOptionsWidget = null; - } - _start(opts) { - const _super = Object.create(null, { - _start: { get: () => super._start } - }); - return __awaiter(this, void 0, void 0, function* () { - if (!this._widget) { - this._createFindWidget(); - } - const selection = this._editor.getSelection(); - let updateSearchScope = false; - switch (this._editor.getOption(29 /* find */).autoFindInSelection) { - case 'always': - updateSearchScope = true; - break; - case 'never': - updateSearchScope = false; - break; - case 'multiline': - const isSelectionMultipleLine = !!selection && selection.startLineNumber !== selection.endLineNumber; - updateSearchScope = isSelectionMultipleLine; - break; - default: - break; - } - opts.updateSearchScope = updateSearchScope; - yield _super._start.call(this, opts); - if (this._widget) { - if (opts.shouldFocus === 2 /* FocusReplaceInput */) { - this._widget.focusReplaceInput(); - } - else if (opts.shouldFocus === 1 /* FocusFindInput */) { - this._widget.focusFindInput(); - } - } - }); - } - highlightFindOptions() { - if (!this._widget) { - this._createFindWidget(); - } - if (this._state.isRevealed) { - this._widget.highlightFindOptions(); - } - else { - this._findOptionsWidget.highlightFindOptions(); - } - } - _createFindWidget() { - this._widget = this._register(new _findWidget_js__WEBPACK_IMPORTED_MODULE_9__["FindWidget"](this._editor, this, this._state, this._contextViewService, this._keybindingService, this._contextKeyService, this._themeService, this._storageService, this._notificationService, this._storageKeysSyncRegistryService)); - this._findOptionsWidget = this._register(new _findOptionsWidget_js__WEBPACK_IMPORTED_MODULE_7__["FindOptionsWidget"](this._editor, this._state, this._keybindingService, this._themeService)); - } -}; -FindController = __decorate([ - __param(1, _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_13__["IContextViewService"]), - __param(2, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["IContextKeyService"]), - __param(3, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_14__["IKeybindingService"]), - __param(4, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_16__["IThemeService"]), - __param(5, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_17__["INotificationService"]), - __param(6, _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_15__["IStorageService"]), - __param(7, _platform_userDataSync_common_storageKeys_js__WEBPACK_IMPORTED_MODULE_18__["IStorageKeysSyncRegistryService"]), - __param(8, _platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_11__["IClipboardService"]) -], FindController); - -class StartFindAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["MultiEditorAction"] { - constructor() { - super({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].StartFindAction, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('startFindAction', "Find"), - alias: 'Find', - precondition: undefined, - kbOpts: { - kbExpr: null, - primary: 2048 /* CtrlCmd */ | 36 /* KEY_F */, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_10__["MenuId"].MenubarEditMenu, - group: '3_find', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miFind', comment: ['&& denotes a mnemonic'] }, "&&Find"), - order: 1 - } - }); - } - run(accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - let controller = CommonFindController.get(editor); - if (controller) { - yield controller.start({ - forceRevealReplace: false, - seedSearchStringFromSelection: editor.getOption(29 /* find */).seedSearchStringFromSelection, - seedSearchStringFromGlobalClipboard: editor.getOption(29 /* find */).globalFindClipboard, - shouldFocus: 1 /* FocusFindInput */, - shouldAnimate: true, - updateSearchScope: false, - loop: editor.getOption(29 /* find */).loop - }); - } - }); - } -} -class StartFindWithSelectionAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].StartFindWithSelection, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('startFindWithSelectionAction', "Find With Selection"), - alias: 'Find With Selection', - precondition: undefined, - kbOpts: { - kbExpr: null, - primary: 0, - mac: { - primary: 2048 /* CtrlCmd */ | 35 /* KEY_E */, - }, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - let controller = CommonFindController.get(editor); - if (controller) { - yield controller.start({ - forceRevealReplace: false, - seedSearchStringFromSelection: true, - seedSearchStringFromGlobalClipboard: false, - shouldFocus: 0 /* NoFocusChange */, - shouldAnimate: true, - updateSearchScope: false, - loop: editor.getOption(29 /* find */).loop - }); - controller.setGlobalBufferTerm(controller.getState().searchString); - } - }); - } -} -class MatchFindAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - run(accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - let controller = CommonFindController.get(editor); - if (controller && !this._run(controller)) { - yield controller.start({ - forceRevealReplace: false, - seedSearchStringFromSelection: (controller.getState().searchString.length === 0) && editor.getOption(29 /* find */).seedSearchStringFromSelection, - seedSearchStringFromGlobalClipboard: true, - shouldFocus: 0 /* NoFocusChange */, - shouldAnimate: true, - updateSearchScope: false, - loop: editor.getOption(29 /* find */).loop - }); - this._run(controller); - } - }); - } -} -class NextMatchFindAction extends MatchFindAction { - constructor() { - super({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].NextMatchFindAction, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('findNextMatchAction', "Find Next"), - alias: 'Find Next', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: 61 /* F3 */, - mac: { primary: 2048 /* CtrlCmd */ | 37 /* KEY_G */, secondary: [61 /* F3 */] }, - weight: 100 /* EditorContrib */ - } - }); - } - _run(controller) { - return controller.moveToNextMatch(); - } -} -class NextMatchFindAction2 extends MatchFindAction { - constructor() { - super({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].NextMatchFindAction, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('findNextMatchAction', "Find Next"), - alias: 'Find Next', - precondition: undefined, - kbOpts: { - kbExpr: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, _findModel_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_FIND_INPUT_FOCUSED"]), - primary: 3 /* Enter */, - weight: 100 /* EditorContrib */ - } - }); - } - _run(controller) { - return controller.moveToNextMatch(); - } -} -class PreviousMatchFindAction extends MatchFindAction { - constructor() { - super({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].PreviousMatchFindAction, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('findPreviousMatchAction', "Find Previous"), - alias: 'Find Previous', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: 1024 /* Shift */ | 61 /* F3 */, - mac: { primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 37 /* KEY_G */, secondary: [1024 /* Shift */ | 61 /* F3 */] }, - weight: 100 /* EditorContrib */ - } - }); - } - _run(controller) { - return controller.moveToPrevMatch(); - } -} -class PreviousMatchFindAction2 extends MatchFindAction { - constructor() { - super({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].PreviousMatchFindAction, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('findPreviousMatchAction', "Find Previous"), - alias: 'Find Previous', - precondition: undefined, - kbOpts: { - kbExpr: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, _findModel_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_FIND_INPUT_FOCUSED"]), - primary: 1024 /* Shift */ | 3 /* Enter */, - weight: 100 /* EditorContrib */ - } - }); - } - _run(controller) { - return controller.moveToPrevMatch(); - } -} -class SelectionMatchFindAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - run(accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - let controller = CommonFindController.get(editor); - if (!controller) { - return; - } - let selectionSearchString = getSelectionSearchString(editor); - if (selectionSearchString) { - controller.setSearchString(selectionSearchString); - } - if (!this._run(controller)) { - yield controller.start({ - forceRevealReplace: false, - seedSearchStringFromSelection: editor.getOption(29 /* find */).seedSearchStringFromSelection, - seedSearchStringFromGlobalClipboard: false, - shouldFocus: 0 /* NoFocusChange */, - shouldAnimate: true, - updateSearchScope: false, - loop: editor.getOption(29 /* find */).loop - }); - this._run(controller); - } - }); - } -} -class NextSelectionMatchFindAction extends SelectionMatchFindAction { - constructor() { - super({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].NextSelectionMatchFindAction, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('nextSelectionMatchFindAction', "Find Next Selection"), - alias: 'Find Next Selection', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: 2048 /* CtrlCmd */ | 61 /* F3 */, - weight: 100 /* EditorContrib */ - } - }); - } - _run(controller) { - return controller.moveToNextMatch(); - } -} -class PreviousSelectionMatchFindAction extends SelectionMatchFindAction { - constructor() { - super({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].PreviousSelectionMatchFindAction, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('previousSelectionMatchFindAction', "Find Previous Selection"), - alias: 'Find Previous Selection', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 61 /* F3 */, - weight: 100 /* EditorContrib */ - } - }); - } - _run(controller) { - return controller.moveToPrevMatch(); - } -} -class StartFindReplaceAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["MultiEditorAction"] { - constructor() { - super({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].StartFindReplaceAction, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('startReplace', "Replace"), - alias: 'Replace', - precondition: undefined, - kbOpts: { - kbExpr: null, - primary: 2048 /* CtrlCmd */ | 38 /* KEY_H */, - mac: { primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 36 /* KEY_F */ }, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_10__["MenuId"].MenubarEditMenu, - group: '3_find', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miReplace', comment: ['&& denotes a mnemonic'] }, "&&Replace"), - order: 2 - } - }); - } - run(accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - if (!editor.hasModel() || editor.getOption(72 /* readOnly */)) { - return; - } - let controller = CommonFindController.get(editor); - let currentSelection = editor.getSelection(); - let findInputFocused = controller.isFindInputFocused(); - // we only seed search string from selection when the current selection is single line and not empty, - // + the find input is not focused - let seedSearchStringFromSelection = !currentSelection.isEmpty() - && currentSelection.startLineNumber === currentSelection.endLineNumber && editor.getOption(29 /* find */).seedSearchStringFromSelection - && !findInputFocused; - /* - * if the existing search string in find widget is empty and we don't seed search string from selection, it means the Find Input is still empty, so we should focus the Find Input instead of Replace Input. - - * findInputFocused true -> seedSearchStringFromSelection false, FocusReplaceInput - * findInputFocused false, seedSearchStringFromSelection true FocusReplaceInput - * findInputFocused false seedSearchStringFromSelection false FocusFindInput - */ - let shouldFocus = (findInputFocused || seedSearchStringFromSelection) ? - 2 /* FocusReplaceInput */ : 1 /* FocusFindInput */; - if (controller) { - yield controller.start({ - forceRevealReplace: true, - seedSearchStringFromSelection: seedSearchStringFromSelection, - seedSearchStringFromGlobalClipboard: editor.getOption(29 /* find */).seedSearchStringFromSelection, - shouldFocus: shouldFocus, - shouldAnimate: true, - updateSearchScope: false, - loop: editor.getOption(29 /* find */).loop - }); - } - }); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorContribution"])(CommonFindController.ID, FindController); -const EditorStartFindAction = new StartFindAction(); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerMultiEditorAction"])(EditorStartFindAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(StartFindWithSelectionAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(NextMatchFindAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(NextMatchFindAction2); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(PreviousMatchFindAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(PreviousMatchFindAction2); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(NextSelectionMatchFindAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(PreviousSelectionMatchFindAction); -const EditorStartFindReplaceAction = new StartFindReplaceAction(); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerMultiEditorAction"])(EditorStartFindReplaceAction); -const FindCommand = _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorCommand"].bindToContribution(CommonFindController.get); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new FindCommand({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].CloseFindWidgetCommand, - precondition: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_FIND_WIDGET_VISIBLE"], - handler: x => x.closeFindWidget(), - kbOpts: { - weight: 100 /* EditorContrib */ + 5, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: 9 /* Escape */, - secondary: [1024 /* Shift */ | 9 /* Escape */] - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new FindCommand({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].ToggleCaseSensitiveCommand, - precondition: undefined, - handler: x => x.toggleCaseSensitive(), - kbOpts: { - weight: 100 /* EditorContrib */ + 5, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleCaseSensitiveKeybinding"].primary, - mac: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleCaseSensitiveKeybinding"].mac, - win: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleCaseSensitiveKeybinding"].win, - linux: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleCaseSensitiveKeybinding"].linux - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new FindCommand({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].ToggleWholeWordCommand, - precondition: undefined, - handler: x => x.toggleWholeWords(), - kbOpts: { - weight: 100 /* EditorContrib */ + 5, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleWholeWordKeybinding"].primary, - mac: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleWholeWordKeybinding"].mac, - win: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleWholeWordKeybinding"].win, - linux: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleWholeWordKeybinding"].linux - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new FindCommand({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].ToggleRegexCommand, - precondition: undefined, - handler: x => x.toggleRegex(), - kbOpts: { - weight: 100 /* EditorContrib */ + 5, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleRegexKeybinding"].primary, - mac: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleRegexKeybinding"].mac, - win: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleRegexKeybinding"].win, - linux: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleRegexKeybinding"].linux - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new FindCommand({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].ToggleSearchScopeCommand, - precondition: undefined, - handler: x => x.toggleSearchScope(), - kbOpts: { - weight: 100 /* EditorContrib */ + 5, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleSearchScopeKeybinding"].primary, - mac: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleSearchScopeKeybinding"].mac, - win: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleSearchScopeKeybinding"].win, - linux: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["ToggleSearchScopeKeybinding"].linux - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new FindCommand({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].ReplaceOneAction, - precondition: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_FIND_WIDGET_VISIBLE"], - handler: x => x.replace(), - kbOpts: { - weight: 100 /* EditorContrib */ + 5, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 22 /* KEY_1 */ - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new FindCommand({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].ReplaceOneAction, - precondition: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_FIND_WIDGET_VISIBLE"], - handler: x => x.replace(), - kbOpts: { - weight: 100 /* EditorContrib */ + 5, - kbExpr: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, _findModel_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_REPLACE_INPUT_FOCUSED"]), - primary: 3 /* Enter */ - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new FindCommand({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].ReplaceAllAction, - precondition: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_FIND_WIDGET_VISIBLE"], - handler: x => x.replaceAll(), - kbOpts: { - weight: 100 /* EditorContrib */ + 5, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 3 /* Enter */ - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new FindCommand({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].ReplaceAllAction, - precondition: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_FIND_WIDGET_VISIBLE"], - handler: x => x.replaceAll(), - kbOpts: { - weight: 100 /* EditorContrib */ + 5, - kbExpr: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, _findModel_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_REPLACE_INPUT_FOCUSED"]), - primary: undefined, - mac: { - primary: 2048 /* CtrlCmd */ | 3 /* Enter */, - } - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new FindCommand({ - id: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["FIND_IDS"].SelectAllMatchesAction, - precondition: _findModel_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_FIND_WIDGET_VISIBLE"], - handler: x => x.selectAllMatches(), - kbOpts: { - weight: 100 /* EditorContrib */ + 5, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: 512 /* Alt */ | 3 /* Enter */ - } -})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findDecorations.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/find/findDecorations.js ***! - \**********************************************************************************/ -/*! exports provided: FindDecorations */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindDecorations", function() { return FindDecorations; }); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_model_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -class FindDecorations { - constructor(editor) { - this._editor = editor; - this._decorations = []; - this._overviewRulerApproximateDecorations = []; - this._findScopeDecorationIds = []; - this._rangeHighlightDecorationId = null; - this._highlightedDecorationId = null; - this._startPosition = this._editor.getPosition(); - } - dispose() { - this._editor.deltaDecorations(this._allDecorations(), []); - this._decorations = []; - this._overviewRulerApproximateDecorations = []; - this._findScopeDecorationIds = []; - this._rangeHighlightDecorationId = null; - this._highlightedDecorationId = null; - } - reset() { - this._decorations = []; - this._overviewRulerApproximateDecorations = []; - this._findScopeDecorationIds = []; - this._rangeHighlightDecorationId = null; - this._highlightedDecorationId = null; - } - getCount() { - return this._decorations.length; - } - /** @deprecated use getFindScopes to support multiple selections */ - getFindScope() { - if (this._findScopeDecorationIds[0]) { - return this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]); - } - return null; - } - getFindScopes() { - if (this._findScopeDecorationIds.length) { - const scopes = this._findScopeDecorationIds.map(findScopeDecorationId => this._editor.getModel().getDecorationRange(findScopeDecorationId)).filter(element => !!element); - if (scopes.length) { - return scopes; - } - } - return null; - } - getStartPosition() { - return this._startPosition; - } - setStartPosition(newStartPosition) { - this._startPosition = newStartPosition; - this.setCurrentFindMatch(null); - } - _getDecorationIndex(decorationId) { - const index = this._decorations.indexOf(decorationId); - if (index >= 0) { - return index + 1; - } - return 1; - } - getCurrentMatchesPosition(desiredRange) { - let candidates = this._editor.getModel().getDecorationsInRange(desiredRange); - for (const candidate of candidates) { - const candidateOpts = candidate.options; - if (candidateOpts === FindDecorations._FIND_MATCH_DECORATION || candidateOpts === FindDecorations._CURRENT_FIND_MATCH_DECORATION) { - return this._getDecorationIndex(candidate.id); - } - } - // We don't know the current match position, so returns zero to show '?' in find widget - return 0; - } - setCurrentFindMatch(nextMatch) { - let newCurrentDecorationId = null; - let matchPosition = 0; - if (nextMatch) { - for (let i = 0, len = this._decorations.length; i < len; i++) { - let range = this._editor.getModel().getDecorationRange(this._decorations[i]); - if (nextMatch.equalsRange(range)) { - newCurrentDecorationId = this._decorations[i]; - matchPosition = (i + 1); - break; - } - } - } - if (this._highlightedDecorationId !== null || newCurrentDecorationId !== null) { - this._editor.changeDecorations((changeAccessor) => { - if (this._highlightedDecorationId !== null) { - changeAccessor.changeDecorationOptions(this._highlightedDecorationId, FindDecorations._FIND_MATCH_DECORATION); - this._highlightedDecorationId = null; - } - if (newCurrentDecorationId !== null) { - this._highlightedDecorationId = newCurrentDecorationId; - changeAccessor.changeDecorationOptions(this._highlightedDecorationId, FindDecorations._CURRENT_FIND_MATCH_DECORATION); - } - if (this._rangeHighlightDecorationId !== null) { - changeAccessor.removeDecoration(this._rangeHighlightDecorationId); - this._rangeHighlightDecorationId = null; - } - if (newCurrentDecorationId !== null) { - let rng = this._editor.getModel().getDecorationRange(newCurrentDecorationId); - if (rng.startLineNumber !== rng.endLineNumber && rng.endColumn === 1) { - let lineBeforeEnd = rng.endLineNumber - 1; - let lineBeforeEndMaxColumn = this._editor.getModel().getLineMaxColumn(lineBeforeEnd); - rng = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](rng.startLineNumber, rng.startColumn, lineBeforeEnd, lineBeforeEndMaxColumn); - } - this._rangeHighlightDecorationId = changeAccessor.addDecoration(rng, FindDecorations._RANGE_HIGHLIGHT_DECORATION); - } - }); - } - return matchPosition; - } - set(findMatches, findScopes) { - this._editor.changeDecorations((accessor) => { - let findMatchesOptions = FindDecorations._FIND_MATCH_DECORATION; - let newOverviewRulerApproximateDecorations = []; - if (findMatches.length > 1000) { - // we go into a mode where the overview ruler gets "approximate" decorations - // the reason is that the overview ruler paints all the decorations in the file and we don't want to cause freezes - findMatchesOptions = FindDecorations._FIND_MATCH_NO_OVERVIEW_DECORATION; - // approximate a distance in lines where matches should be merged - const lineCount = this._editor.getModel().getLineCount(); - const height = this._editor.getLayoutInfo().height; - const approxPixelsPerLine = height / lineCount; - const mergeLinesDelta = Math.max(2, Math.ceil(3 / approxPixelsPerLine)); - // merge decorations as much as possible - let prevStartLineNumber = findMatches[0].range.startLineNumber; - let prevEndLineNumber = findMatches[0].range.endLineNumber; - for (let i = 1, len = findMatches.length; i < len; i++) { - const range = findMatches[i].range; - if (prevEndLineNumber + mergeLinesDelta >= range.startLineNumber) { - if (range.endLineNumber > prevEndLineNumber) { - prevEndLineNumber = range.endLineNumber; - } - } - else { - newOverviewRulerApproximateDecorations.push({ - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](prevStartLineNumber, 1, prevEndLineNumber, 1), - options: FindDecorations._FIND_MATCH_ONLY_OVERVIEW_DECORATION - }); - prevStartLineNumber = range.startLineNumber; - prevEndLineNumber = range.endLineNumber; - } - } - newOverviewRulerApproximateDecorations.push({ - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](prevStartLineNumber, 1, prevEndLineNumber, 1), - options: FindDecorations._FIND_MATCH_ONLY_OVERVIEW_DECORATION - }); - } - // Find matches - let newFindMatchesDecorations = new Array(findMatches.length); - for (let i = 0, len = findMatches.length; i < len; i++) { - newFindMatchesDecorations[i] = { - range: findMatches[i].range, - options: findMatchesOptions - }; - } - this._decorations = accessor.deltaDecorations(this._decorations, newFindMatchesDecorations); - // Overview ruler approximate decorations - this._overviewRulerApproximateDecorations = accessor.deltaDecorations(this._overviewRulerApproximateDecorations, newOverviewRulerApproximateDecorations); - // Range highlight - if (this._rangeHighlightDecorationId) { - accessor.removeDecoration(this._rangeHighlightDecorationId); - this._rangeHighlightDecorationId = null; - } - // Find scope - if (this._findScopeDecorationIds.length) { - this._findScopeDecorationIds.forEach(findScopeDecorationId => accessor.removeDecoration(findScopeDecorationId)); - this._findScopeDecorationIds = []; - } - if (findScopes === null || findScopes === void 0 ? void 0 : findScopes.length) { - this._findScopeDecorationIds = findScopes.map(findScope => accessor.addDecoration(findScope, FindDecorations._FIND_SCOPE_DECORATION)); - } - }); - } - matchBeforePosition(position) { - if (this._decorations.length === 0) { - return null; - } - for (let i = this._decorations.length - 1; i >= 0; i--) { - let decorationId = this._decorations[i]; - let r = this._editor.getModel().getDecorationRange(decorationId); - if (!r || r.endLineNumber > position.lineNumber) { - continue; - } - if (r.endLineNumber < position.lineNumber) { - return r; - } - if (r.endColumn > position.column) { - continue; - } - return r; - } - return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length - 1]); - } - matchAfterPosition(position) { - if (this._decorations.length === 0) { - return null; - } - for (let i = 0, len = this._decorations.length; i < len; i++) { - let decorationId = this._decorations[i]; - let r = this._editor.getModel().getDecorationRange(decorationId); - if (!r || r.startLineNumber < position.lineNumber) { - continue; - } - if (r.startLineNumber > position.lineNumber) { - return r; - } - if (r.startColumn < position.column) { - continue; - } - return r; - } - return this._editor.getModel().getDecorationRange(this._decorations[0]); - } - _allDecorations() { - let result = []; - result = result.concat(this._decorations); - result = result.concat(this._overviewRulerApproximateDecorations); - if (this._findScopeDecorationIds.length) { - result.push(...this._findScopeDecorationIds); - } - if (this._rangeHighlightDecorationId) { - result.push(this._rangeHighlightDecorationId); - } - return result; - } -} -FindDecorations._CURRENT_FIND_MATCH_DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_2__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - zIndex: 13, - className: 'currentFindMatch', - showIfCollapsed: true, - overviewRuler: { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__["themeColorFromId"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["overviewRulerFindMatchForeground"]), - position: _common_model_js__WEBPACK_IMPORTED_MODULE_1__["OverviewRulerLane"].Center - }, - minimap: { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__["themeColorFromId"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["minimapFindMatch"]), - position: _common_model_js__WEBPACK_IMPORTED_MODULE_1__["MinimapPosition"].Inline - } -}); -FindDecorations._FIND_MATCH_DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_2__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - className: 'findMatch', - showIfCollapsed: true, - overviewRuler: { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__["themeColorFromId"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["overviewRulerFindMatchForeground"]), - position: _common_model_js__WEBPACK_IMPORTED_MODULE_1__["OverviewRulerLane"].Center - }, - minimap: { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__["themeColorFromId"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["minimapFindMatch"]), - position: _common_model_js__WEBPACK_IMPORTED_MODULE_1__["MinimapPosition"].Inline - } -}); -FindDecorations._FIND_MATCH_NO_OVERVIEW_DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_2__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - className: 'findMatch', - showIfCollapsed: true -}); -FindDecorations._FIND_MATCH_ONLY_OVERVIEW_DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_2__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - overviewRuler: { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_4__["themeColorFromId"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["overviewRulerFindMatchForeground"]), - position: _common_model_js__WEBPACK_IMPORTED_MODULE_1__["OverviewRulerLane"].Center - } -}); -FindDecorations._RANGE_HIGHLIGHT_DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_2__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - className: 'rangeHighlight', - isWholeLine: true -}); -FindDecorations._FIND_SCOPE_DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_2__["ModelDecorationOptions"].register({ - className: 'findScope', - isWholeLine: true -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findModel.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/find/findModel.js ***! - \****************************************************************************/ -/*! exports provided: CONTEXT_FIND_WIDGET_VISIBLE, CONTEXT_FIND_INPUT_FOCUSED, CONTEXT_REPLACE_INPUT_FOCUSED, ToggleCaseSensitiveKeybinding, ToggleWholeWordKeybinding, ToggleRegexKeybinding, ToggleSearchScopeKeybinding, FIND_IDS, MATCHES_LIMIT, FindModelBoundToEditorModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTEXT_FIND_WIDGET_VISIBLE", function() { return CONTEXT_FIND_WIDGET_VISIBLE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTEXT_FIND_INPUT_FOCUSED", function() { return CONTEXT_FIND_INPUT_FOCUSED; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTEXT_REPLACE_INPUT_FOCUSED", function() { return CONTEXT_REPLACE_INPUT_FOCUSED; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ToggleCaseSensitiveKeybinding", function() { return ToggleCaseSensitiveKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ToggleWholeWordKeybinding", function() { return ToggleWholeWordKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ToggleRegexKeybinding", function() { return ToggleRegexKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ToggleSearchScopeKeybinding", function() { return ToggleSearchScopeKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FIND_IDS", function() { return FIND_IDS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MATCHES_LIMIT", function() { return MATCHES_LIMIT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindModelBoundToEditorModel", function() { return FindModelBoundToEditorModel; }); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/commands/replaceCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/common/commands/replaceCommand.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_model_textModelSearch_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/model/textModelSearch.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModelSearch.js"); -/* harmony import */ var _findDecorations_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./findDecorations.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findDecorations.js"); -/* harmony import */ var _replaceAllCommand_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./replaceAllCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/replaceAllCommand.js"); -/* harmony import */ var _replacePattern_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./replacePattern.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/replacePattern.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - -const CONTEXT_FIND_WIDGET_VISIBLE = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_10__["RawContextKey"]('findWidgetVisible', false); -// Keep ContextKey use of 'Focussed' to not break when clauses -const CONTEXT_FIND_INPUT_FOCUSED = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_10__["RawContextKey"]('findInputFocussed', false); -const CONTEXT_REPLACE_INPUT_FOCUSED = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_10__["RawContextKey"]('replaceInputFocussed', false); -const ToggleCaseSensitiveKeybinding = { - primary: 512 /* Alt */ | 33 /* KEY_C */, - mac: { primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 33 /* KEY_C */ } -}; -const ToggleWholeWordKeybinding = { - primary: 512 /* Alt */ | 53 /* KEY_W */, - mac: { primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 53 /* KEY_W */ } -}; -const ToggleRegexKeybinding = { - primary: 512 /* Alt */ | 48 /* KEY_R */, - mac: { primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 48 /* KEY_R */ } -}; -const ToggleSearchScopeKeybinding = { - primary: 512 /* Alt */ | 42 /* KEY_L */, - mac: { primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 42 /* KEY_L */ } -}; -const FIND_IDS = { - StartFindAction: 'actions.find', - StartFindWithSelection: 'actions.findWithSelection', - NextMatchFindAction: 'editor.action.nextMatchFindAction', - PreviousMatchFindAction: 'editor.action.previousMatchFindAction', - NextSelectionMatchFindAction: 'editor.action.nextSelectionMatchFindAction', - PreviousSelectionMatchFindAction: 'editor.action.previousSelectionMatchFindAction', - StartFindReplaceAction: 'editor.action.startFindReplaceAction', - CloseFindWidgetCommand: 'closeFindWidget', - ToggleCaseSensitiveCommand: 'toggleFindCaseSensitive', - ToggleWholeWordCommand: 'toggleFindWholeWord', - ToggleRegexCommand: 'toggleFindRegex', - ToggleSearchScopeCommand: 'toggleFindInSelection', - TogglePreserveCaseCommand: 'togglePreserveCase', - ReplaceOneAction: 'editor.action.replaceOne', - ReplaceAllAction: 'editor.action.replaceAll', - SelectAllMatchesAction: 'editor.action.selectAllMatches' -}; -const MATCHES_LIMIT = 19999; -const RESEARCH_DELAY = 240; -class FindModelBoundToEditorModel { - constructor(editor, state) { - this._toDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this._editor = editor; - this._state = state; - this._isDisposed = false; - this._startSearchingTimer = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["TimeoutTimer"](); - this._decorations = new _findDecorations_js__WEBPACK_IMPORTED_MODULE_7__["FindDecorations"](editor); - this._toDispose.add(this._decorations); - this._updateDecorationsScheduler = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["RunOnceScheduler"](() => this.research(false), 100); - this._toDispose.add(this._updateDecorationsScheduler); - this._toDispose.add(this._editor.onDidChangeCursorPosition((e) => { - if (e.reason === 3 /* Explicit */ - || e.reason === 5 /* Undo */ - || e.reason === 6 /* Redo */) { - this._decorations.setStartPosition(this._editor.getPosition()); - } - })); - this._ignoreModelContentChanged = false; - this._toDispose.add(this._editor.onDidChangeModelContent((e) => { - if (this._ignoreModelContentChanged) { - return; - } - if (e.isFlush) { - // a model.setValue() was called - this._decorations.reset(); - } - this._decorations.setStartPosition(this._editor.getPosition()); - this._updateDecorationsScheduler.schedule(); - })); - this._toDispose.add(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e))); - this.research(false, this._state.searchScope); - } - dispose() { - this._isDisposed = true; - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this._startSearchingTimer); - this._toDispose.dispose(); - } - _onStateChanged(e) { - if (this._isDisposed) { - // The find model is disposed during a find state changed event - return; - } - if (!this._editor.hasModel()) { - // The find model will be disposed momentarily - return; - } - if (e.searchString || e.isReplaceRevealed || e.isRegex || e.wholeWord || e.matchCase || e.searchScope) { - let model = this._editor.getModel(); - if (model.isTooLargeForSyncing()) { - this._startSearchingTimer.cancel(); - this._startSearchingTimer.setIfNotSet(() => { - if (e.searchScope) { - this.research(e.moveCursor, this._state.searchScope); - } - else { - this.research(e.moveCursor); - } - }, RESEARCH_DELAY); - } - else { - if (e.searchScope) { - this.research(e.moveCursor, this._state.searchScope); - } - else { - this.research(e.moveCursor); - } - } - } - } - static _getSearchRange(model, findScope) { - // If we have set now or before a find scope, use it for computing the search range - if (findScope) { - return findScope; - } - return model.getFullModelRange(); - } - research(moveCursor, newFindScope) { - let findScopes = null; - if (typeof newFindScope !== 'undefined') { - if (newFindScope !== null) { - if (!Array.isArray(newFindScope)) { - findScopes = [newFindScope]; - } - else { - findScopes = newFindScope; - } - } - } - else { - findScopes = this._decorations.getFindScopes(); - } - if (findScopes !== null) { - findScopes = findScopes.map(findScope => { - if (findScope.startLineNumber !== findScope.endLineNumber) { - let endLineNumber = findScope.endLineNumber; - if (findScope.endColumn === 1) { - endLineNumber = endLineNumber - 1; - } - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](findScope.startLineNumber, 1, endLineNumber, this._editor.getModel().getLineMaxColumn(endLineNumber)); - } - return findScope; - }); - } - let findMatches = this._findMatches(findScopes, false, MATCHES_LIMIT); - this._decorations.set(findMatches, findScopes); - const editorSelection = this._editor.getSelection(); - let currentMatchesPosition = this._decorations.getCurrentMatchesPosition(editorSelection); - if (currentMatchesPosition === 0 && findMatches.length > 0) { - // current selection is not on top of a match - // try to find its nearest result from the top of the document - const matchAfterSelection = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_11__["findFirstInSorted"])(findMatches.map(match => match.range), range => _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].compareRangesUsingStarts(range, editorSelection) >= 0); - currentMatchesPosition = matchAfterSelection > 0 ? matchAfterSelection - 1 + 1 /** match position is one based */ : currentMatchesPosition; - } - this._state.changeMatchInfo(currentMatchesPosition, this._decorations.getCount(), undefined); - if (moveCursor && this._editor.getOption(29 /* find */).cursorMoveOnType) { - this._moveToNextMatch(this._decorations.getStartPosition()); - } - } - _hasMatches() { - return (this._state.matchesCount > 0); - } - _cannotFind() { - if (!this._hasMatches()) { - let findScope = this._decorations.getFindScope(); - if (findScope) { - // Reveal the selection so user is reminded that 'selection find' is on. - this._editor.revealRangeInCenterIfOutsideViewport(findScope, 0 /* Smooth */); - } - return true; - } - return false; - } - _setCurrentFindMatch(match) { - let matchesPosition = this._decorations.setCurrentFindMatch(match); - this._state.changeMatchInfo(matchesPosition, this._decorations.getCount(), match); - this._editor.setSelection(match); - this._editor.revealRangeInCenterIfOutsideViewport(match, 0 /* Smooth */); - } - _prevSearchPosition(before) { - let isUsingLineStops = this._state.isRegex && (this._state.searchString.indexOf('^') >= 0 - || this._state.searchString.indexOf('$') >= 0); - let { lineNumber, column } = before; - let model = this._editor.getModel(); - if (isUsingLineStops || column === 1) { - if (lineNumber === 1) { - lineNumber = model.getLineCount(); - } - else { - lineNumber--; - } - column = model.getLineMaxColumn(lineNumber); - } - else { - column--; - } - return new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - } - _moveToPrevMatch(before, isRecursed = false) { - if (!this._state.canNavigateBack()) { - // we are beyond the first matched find result - // instead of doing nothing, we should refocus the first item - const nextMatchRange = this._decorations.matchAfterPosition(before); - if (nextMatchRange) { - this._setCurrentFindMatch(nextMatchRange); - } - return; - } - if (this._decorations.getCount() < MATCHES_LIMIT) { - let prevMatchRange = this._decorations.matchBeforePosition(before); - if (prevMatchRange && prevMatchRange.isEmpty() && prevMatchRange.getStartPosition().equals(before)) { - before = this._prevSearchPosition(before); - prevMatchRange = this._decorations.matchBeforePosition(before); - } - if (prevMatchRange) { - this._setCurrentFindMatch(prevMatchRange); - } - return; - } - if (this._cannotFind()) { - return; - } - let findScope = this._decorations.getFindScope(); - let searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope); - // ...(----)...|... - if (searchRange.getEndPosition().isBefore(before)) { - before = searchRange.getEndPosition(); - } - // ...|...(----)... - if (before.isBefore(searchRange.getStartPosition())) { - before = searchRange.getEndPosition(); - } - let { lineNumber, column } = before; - let model = this._editor.getModel(); - let position = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - let prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(105 /* wordSeparators */) : null, false); - if (prevMatch && prevMatch.range.isEmpty() && prevMatch.range.getStartPosition().equals(position)) { - // Looks like we're stuck at this position, unacceptable! - position = this._prevSearchPosition(position); - prevMatch = model.findPreviousMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(105 /* wordSeparators */) : null, false); - } - if (!prevMatch) { - // there is precisely one match and selection is on top of it - return; - } - if (!isRecursed && !searchRange.containsRange(prevMatch.range)) { - return this._moveToPrevMatch(prevMatch.range.getStartPosition(), true); - } - this._setCurrentFindMatch(prevMatch.range); - } - moveToPrevMatch() { - this._moveToPrevMatch(this._editor.getSelection().getStartPosition()); - } - _nextSearchPosition(after) { - let isUsingLineStops = this._state.isRegex && (this._state.searchString.indexOf('^') >= 0 - || this._state.searchString.indexOf('$') >= 0); - let { lineNumber, column } = after; - let model = this._editor.getModel(); - if (isUsingLineStops || column === model.getLineMaxColumn(lineNumber)) { - if (lineNumber === model.getLineCount()) { - lineNumber = 1; - } - else { - lineNumber++; - } - column = 1; - } - else { - column++; - } - return new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - } - _moveToNextMatch(after) { - if (!this._state.canNavigateForward()) { - // we are beyond the last matched find result - // instead of doing nothing, we should refocus the last item - const prevMatchRange = this._decorations.matchBeforePosition(after); - if (prevMatchRange) { - this._setCurrentFindMatch(prevMatchRange); - } - return; - } - if (this._decorations.getCount() < MATCHES_LIMIT) { - let nextMatchRange = this._decorations.matchAfterPosition(after); - if (nextMatchRange && nextMatchRange.isEmpty() && nextMatchRange.getStartPosition().equals(after)) { - // Looks like we're stuck at this position, unacceptable! - after = this._nextSearchPosition(after); - nextMatchRange = this._decorations.matchAfterPosition(after); - } - if (nextMatchRange) { - this._setCurrentFindMatch(nextMatchRange); - } - return; - } - let nextMatch = this._getNextMatch(after, false, true); - if (nextMatch) { - this._setCurrentFindMatch(nextMatch.range); - } - } - _getNextMatch(after, captureMatches, forceMove, isRecursed = false) { - if (this._cannotFind()) { - return null; - } - let findScope = this._decorations.getFindScope(); - let searchRange = FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), findScope); - // ...(----)...|... - if (searchRange.getEndPosition().isBefore(after)) { - after = searchRange.getStartPosition(); - } - // ...|...(----)... - if (after.isBefore(searchRange.getStartPosition())) { - after = searchRange.getStartPosition(); - } - let { lineNumber, column } = after; - let model = this._editor.getModel(); - let position = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](lineNumber, column); - let nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(105 /* wordSeparators */) : null, captureMatches); - if (forceMove && nextMatch && nextMatch.range.isEmpty() && nextMatch.range.getStartPosition().equals(position)) { - // Looks like we're stuck at this position, unacceptable! - position = this._nextSearchPosition(position); - nextMatch = model.findNextMatch(this._state.searchString, position, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(105 /* wordSeparators */) : null, captureMatches); - } - if (!nextMatch) { - // there is precisely one match and selection is on top of it - return null; - } - if (!isRecursed && !searchRange.containsRange(nextMatch.range)) { - return this._getNextMatch(nextMatch.range.getEndPosition(), captureMatches, forceMove, true); - } - return nextMatch; - } - moveToNextMatch() { - this._moveToNextMatch(this._editor.getSelection().getEndPosition()); - } - _getReplacePattern() { - if (this._state.isRegex) { - return Object(_replacePattern_js__WEBPACK_IMPORTED_MODULE_9__["parseReplaceString"])(this._state.replaceString); - } - return _replacePattern_js__WEBPACK_IMPORTED_MODULE_9__["ReplacePattern"].fromStaticValue(this._state.replaceString); - } - replace() { - if (!this._hasMatches()) { - return; - } - let replacePattern = this._getReplacePattern(); - let selection = this._editor.getSelection(); - let nextMatch = this._getNextMatch(selection.getStartPosition(), true, false); - if (nextMatch) { - if (selection.equalsRange(nextMatch.range)) { - // selection sits on a find match => replace it! - let replaceString = replacePattern.buildReplaceString(nextMatch.matches, this._state.preserveCase); - let command = new _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommand"](selection, replaceString); - this._executeEditorCommand('replace', command); - this._decorations.setStartPosition(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](selection.startLineNumber, selection.startColumn + replaceString.length)); - this.research(true); - } - else { - this._decorations.setStartPosition(this._editor.getPosition()); - this._setCurrentFindMatch(nextMatch.range); - } - } - } - _findMatches(findScopes, captureMatches, limitResultCount) { - const searchRanges = (findScopes || [null]).map((scope) => FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(), scope)); - return this._editor.getModel().findMatches(this._state.searchString, searchRanges, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(105 /* wordSeparators */) : null, captureMatches, limitResultCount); - } - replaceAll() { - if (!this._hasMatches()) { - return; - } - const findScopes = this._decorations.getFindScopes(); - if (findScopes === null && this._state.matchesCount >= MATCHES_LIMIT) { - // Doing a replace on the entire file that is over ${MATCHES_LIMIT} matches - this._largeReplaceAll(); - } - else { - this._regularReplaceAll(findScopes); - } - this.research(false); - } - _largeReplaceAll() { - const searchParams = new _common_model_textModelSearch_js__WEBPACK_IMPORTED_MODULE_6__["SearchParams"](this._state.searchString, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(105 /* wordSeparators */) : null); - const searchData = searchParams.parseSearchRequest(); - if (!searchData) { - return; - } - let searchRegex = searchData.regex; - if (!searchRegex.multiline) { - let mod = 'mu'; - if (searchRegex.ignoreCase) { - mod += 'i'; - } - if (searchRegex.global) { - mod += 'g'; - } - searchRegex = new RegExp(searchRegex.source, mod); - } - const model = this._editor.getModel(); - const modelText = model.getValue(1 /* LF */); - const fullModelRange = model.getFullModelRange(); - const replacePattern = this._getReplacePattern(); - let resultText; - const preserveCase = this._state.preserveCase; - if (replacePattern.hasReplacementPatterns || preserveCase) { - resultText = modelText.replace(searchRegex, function () { - return replacePattern.buildReplaceString(arguments, preserveCase); - }); - } - else { - resultText = modelText.replace(searchRegex, replacePattern.buildReplaceString(null, preserveCase)); - } - let command = new _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_2__["ReplaceCommandThatPreservesSelection"](fullModelRange, resultText, this._editor.getSelection()); - this._executeEditorCommand('replaceAll', command); - } - _regularReplaceAll(findScopes) { - const replacePattern = this._getReplacePattern(); - // Get all the ranges (even more than the highlighted ones) - let matches = this._findMatches(findScopes, replacePattern.hasReplacementPatterns || this._state.preserveCase, 1073741824 /* MAX_SAFE_SMALL_INTEGER */); - let replaceStrings = []; - for (let i = 0, len = matches.length; i < len; i++) { - replaceStrings[i] = replacePattern.buildReplaceString(matches[i].matches, this._state.preserveCase); - } - let command = new _replaceAllCommand_js__WEBPACK_IMPORTED_MODULE_8__["ReplaceAllCommand"](this._editor.getSelection(), matches.map(m => m.range), replaceStrings); - this._executeEditorCommand('replaceAll', command); - } - selectAllMatches() { - if (!this._hasMatches()) { - return; - } - let findScopes = this._decorations.getFindScopes(); - // Get all the ranges (even more than the highlighted ones) - let matches = this._findMatches(findScopes, false, 1073741824 /* MAX_SAFE_SMALL_INTEGER */); - let selections = matches.map(m => new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_5__["Selection"](m.range.startLineNumber, m.range.startColumn, m.range.endLineNumber, m.range.endColumn)); - // If one of the ranges is the editor selection, then maintain it as primary - let editorSelection = this._editor.getSelection(); - for (let i = 0, len = selections.length; i < len; i++) { - let sel = selections[i]; - if (sel.equalsRange(editorSelection)) { - selections = [editorSelection].concat(selections.slice(0, i)).concat(selections.slice(i + 1)); - break; - } - } - this._editor.setSelections(selections); - } - _executeEditorCommand(source, command) { - try { - this._ignoreModelContentChanged = true; - this._editor.pushUndoStop(); - this._editor.executeCommand(source, command); - this._editor.pushUndoStop(); - } - finally { - this._ignoreModelContentChanged = false; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findOptionsWidget.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/find/findOptionsWidget.js ***! - \************************************************************************************/ -/*! exports provided: FindOptionsWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindOptionsWidget", function() { return FindOptionsWidget; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_ui_findinput_findInputCheckboxes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/ui/findinput/findInputCheckboxes.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInputCheckboxes.js"); -/* harmony import */ var _base_browser_ui_widget_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/ui/widget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _findModel_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./findModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findModel.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -class FindOptionsWidget extends _base_browser_ui_widget_js__WEBPACK_IMPORTED_MODULE_2__["Widget"] { - constructor(editor, state, keybindingService, themeService) { - super(); - this._hideSoon = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_3__["RunOnceScheduler"](() => this._hide(), 2000)); - this._isVisible = false; - this._editor = editor; - this._state = state; - this._keybindingService = keybindingService; - this._domNode = document.createElement('div'); - this._domNode.className = 'findOptionsWidget'; - this._domNode.style.display = 'none'; - this._domNode.style.top = '10px'; - this._domNode.setAttribute('role', 'presentation'); - this._domNode.setAttribute('aria-hidden', 'true'); - const inputActiveOptionBorderColor = themeService.getColorTheme().getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["inputActiveOptionBorder"]); - const inputActiveOptionForegroundColor = themeService.getColorTheme().getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["inputActiveOptionForeground"]); - const inputActiveOptionBackgroundColor = themeService.getColorTheme().getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["inputActiveOptionBackground"]); - this.caseSensitive = this._register(new _base_browser_ui_findinput_findInputCheckboxes_js__WEBPACK_IMPORTED_MODULE_1__["CaseSensitiveCheckbox"]({ - appendTitle: this._keybindingLabelFor(_findModel_js__WEBPACK_IMPORTED_MODULE_4__["FIND_IDS"].ToggleCaseSensitiveCommand), - isChecked: this._state.matchCase, - inputActiveOptionBorder: inputActiveOptionBorderColor, - inputActiveOptionForeground: inputActiveOptionForegroundColor, - inputActiveOptionBackground: inputActiveOptionBackgroundColor - })); - this._domNode.appendChild(this.caseSensitive.domNode); - this._register(this.caseSensitive.onChange(() => { - this._state.change({ - matchCase: this.caseSensitive.checked - }, false); - })); - this.wholeWords = this._register(new _base_browser_ui_findinput_findInputCheckboxes_js__WEBPACK_IMPORTED_MODULE_1__["WholeWordsCheckbox"]({ - appendTitle: this._keybindingLabelFor(_findModel_js__WEBPACK_IMPORTED_MODULE_4__["FIND_IDS"].ToggleWholeWordCommand), - isChecked: this._state.wholeWord, - inputActiveOptionBorder: inputActiveOptionBorderColor, - inputActiveOptionForeground: inputActiveOptionForegroundColor, - inputActiveOptionBackground: inputActiveOptionBackgroundColor - })); - this._domNode.appendChild(this.wholeWords.domNode); - this._register(this.wholeWords.onChange(() => { - this._state.change({ - wholeWord: this.wholeWords.checked - }, false); - })); - this.regex = this._register(new _base_browser_ui_findinput_findInputCheckboxes_js__WEBPACK_IMPORTED_MODULE_1__["RegexCheckbox"]({ - appendTitle: this._keybindingLabelFor(_findModel_js__WEBPACK_IMPORTED_MODULE_4__["FIND_IDS"].ToggleRegexCommand), - isChecked: this._state.isRegex, - inputActiveOptionBorder: inputActiveOptionBorderColor, - inputActiveOptionForeground: inputActiveOptionForegroundColor, - inputActiveOptionBackground: inputActiveOptionBackgroundColor - })); - this._domNode.appendChild(this.regex.domNode); - this._register(this.regex.onChange(() => { - this._state.change({ - isRegex: this.regex.checked - }, false); - })); - this._editor.addOverlayWidget(this); - this._register(this._state.onFindReplaceStateChange((e) => { - let somethingChanged = false; - if (e.isRegex) { - this.regex.checked = this._state.isRegex; - somethingChanged = true; - } - if (e.wholeWord) { - this.wholeWords.checked = this._state.wholeWord; - somethingChanged = true; - } - if (e.matchCase) { - this.caseSensitive.checked = this._state.matchCase; - somethingChanged = true; - } - if (!this._state.isRevealed && somethingChanged) { - this._revealTemporarily(); - } - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableNonBubblingMouseOutListener"](this._domNode, (e) => this._onMouseOut())); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addDisposableListener"](this._domNode, 'mouseover', (e) => this._onMouseOver())); - this._applyTheme(themeService.getColorTheme()); - this._register(themeService.onDidColorThemeChange(this._applyTheme.bind(this))); - } - _keybindingLabelFor(actionId) { - let kb = this._keybindingService.lookupKeybinding(actionId); - if (!kb) { - return ''; - } - return ` (${kb.getLabel()})`; - } - dispose() { - this._editor.removeOverlayWidget(this); - super.dispose(); - } - // ----- IOverlayWidget API - getId() { - return FindOptionsWidget.ID; - } - getDomNode() { - return this._domNode; - } - getPosition() { - return { - preference: 0 /* TOP_RIGHT_CORNER */ - }; - } - highlightFindOptions() { - this._revealTemporarily(); - } - _revealTemporarily() { - this._show(); - this._hideSoon.schedule(); - } - _onMouseOut() { - this._hideSoon.schedule(); - } - _onMouseOver() { - this._hideSoon.cancel(); - } - _show() { - if (this._isVisible) { - return; - } - this._isVisible = true; - this._domNode.style.display = 'block'; - } - _hide() { - if (!this._isVisible) { - return; - } - this._isVisible = false; - this._domNode.style.display = 'none'; - } - _applyTheme(theme) { - let inputStyles = { - inputActiveOptionBorder: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["inputActiveOptionBorder"]), - inputActiveOptionForeground: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["inputActiveOptionForeground"]), - inputActiveOptionBackground: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["inputActiveOptionBackground"]) - }; - this.caseSensitive.style(inputStyles); - this.wholeWords.style(inputStyles); - this.regex.style(inputStyles); - } -} -FindOptionsWidget.ID = 'editor.contrib.findOptionsWidget'; -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_6__["registerThemingParticipant"])((theme, collector) => { - const widgetBackground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["editorWidgetBackground"]); - if (widgetBackground) { - collector.addRule(`.monaco-editor .findOptionsWidget { background-color: ${widgetBackground}; }`); - } - const widgetForeground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["editorWidgetForeground"]); - if (widgetForeground) { - collector.addRule(`.monaco-editor .findOptionsWidget { color: ${widgetForeground}; }`); - } - const widgetShadowColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["widgetShadow"]); - if (widgetShadowColor) { - collector.addRule(`.monaco-editor .findOptionsWidget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`); - } - const hcBorder = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["contrastBorder"]); - if (hcBorder) { - collector.addRule(`.monaco-editor .findOptionsWidget { border: 2px solid ${hcBorder}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findState.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/find/findState.js ***! - \****************************************************************************/ -/*! exports provided: FindReplaceState */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindReplaceState", function() { return FindReplaceState; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _findModel_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./findModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findModel.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -function effectiveOptionValue(override, value) { - if (override === 1 /* True */) { - return true; - } - if (override === 2 /* False */) { - return false; - } - return value; -} -class FindReplaceState extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor() { - super(); - this._onFindReplaceStateChange = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this.onFindReplaceStateChange = this._onFindReplaceStateChange.event; - this._searchString = ''; - this._replaceString = ''; - this._isRevealed = false; - this._isReplaceRevealed = false; - this._isRegex = false; - this._isRegexOverride = 0 /* NotSet */; - this._wholeWord = false; - this._wholeWordOverride = 0 /* NotSet */; - this._matchCase = false; - this._matchCaseOverride = 0 /* NotSet */; - this._preserveCase = false; - this._preserveCaseOverride = 0 /* NotSet */; - this._searchScope = null; - this._matchesPosition = 0; - this._matchesCount = 0; - this._currentMatch = null; - this._loop = true; - } - get searchString() { return this._searchString; } - get replaceString() { return this._replaceString; } - get isRevealed() { return this._isRevealed; } - get isReplaceRevealed() { return this._isReplaceRevealed; } - get isRegex() { return effectiveOptionValue(this._isRegexOverride, this._isRegex); } - get wholeWord() { return effectiveOptionValue(this._wholeWordOverride, this._wholeWord); } - get matchCase() { return effectiveOptionValue(this._matchCaseOverride, this._matchCase); } - get preserveCase() { return effectiveOptionValue(this._preserveCaseOverride, this._preserveCase); } - get actualIsRegex() { return this._isRegex; } - get actualWholeWord() { return this._wholeWord; } - get actualMatchCase() { return this._matchCase; } - get actualPreserveCase() { return this._preserveCase; } - get searchScope() { return this._searchScope; } - get matchesPosition() { return this._matchesPosition; } - get matchesCount() { return this._matchesCount; } - get currentMatch() { return this._currentMatch; } - changeMatchInfo(matchesPosition, matchesCount, currentMatch) { - let changeEvent = { - moveCursor: false, - updateHistory: false, - searchString: false, - replaceString: false, - isRevealed: false, - isReplaceRevealed: false, - isRegex: false, - wholeWord: false, - matchCase: false, - preserveCase: false, - searchScope: false, - matchesPosition: false, - matchesCount: false, - currentMatch: false, - loop: false - }; - let somethingChanged = false; - if (matchesCount === 0) { - matchesPosition = 0; - } - if (matchesPosition > matchesCount) { - matchesPosition = matchesCount; - } - if (this._matchesPosition !== matchesPosition) { - this._matchesPosition = matchesPosition; - changeEvent.matchesPosition = true; - somethingChanged = true; - } - if (this._matchesCount !== matchesCount) { - this._matchesCount = matchesCount; - changeEvent.matchesCount = true; - somethingChanged = true; - } - if (typeof currentMatch !== 'undefined') { - if (!_common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].equalsRange(this._currentMatch, currentMatch)) { - this._currentMatch = currentMatch; - changeEvent.currentMatch = true; - somethingChanged = true; - } - } - if (somethingChanged) { - this._onFindReplaceStateChange.fire(changeEvent); - } - } - change(newState, moveCursor, updateHistory = true) { - var _a; - let changeEvent = { - moveCursor: moveCursor, - updateHistory: updateHistory, - searchString: false, - replaceString: false, - isRevealed: false, - isReplaceRevealed: false, - isRegex: false, - wholeWord: false, - matchCase: false, - preserveCase: false, - searchScope: false, - matchesPosition: false, - matchesCount: false, - currentMatch: false, - loop: false - }; - let somethingChanged = false; - const oldEffectiveIsRegex = this.isRegex; - const oldEffectiveWholeWords = this.wholeWord; - const oldEffectiveMatchCase = this.matchCase; - const oldEffectivePreserveCase = this.preserveCase; - if (typeof newState.searchString !== 'undefined') { - if (this._searchString !== newState.searchString) { - this._searchString = newState.searchString; - changeEvent.searchString = true; - somethingChanged = true; - } - } - if (typeof newState.replaceString !== 'undefined') { - if (this._replaceString !== newState.replaceString) { - this._replaceString = newState.replaceString; - changeEvent.replaceString = true; - somethingChanged = true; - } - } - if (typeof newState.isRevealed !== 'undefined') { - if (this._isRevealed !== newState.isRevealed) { - this._isRevealed = newState.isRevealed; - changeEvent.isRevealed = true; - somethingChanged = true; - } - } - if (typeof newState.isReplaceRevealed !== 'undefined') { - if (this._isReplaceRevealed !== newState.isReplaceRevealed) { - this._isReplaceRevealed = newState.isReplaceRevealed; - changeEvent.isReplaceRevealed = true; - somethingChanged = true; - } - } - if (typeof newState.isRegex !== 'undefined') { - this._isRegex = newState.isRegex; - } - if (typeof newState.wholeWord !== 'undefined') { - this._wholeWord = newState.wholeWord; - } - if (typeof newState.matchCase !== 'undefined') { - this._matchCase = newState.matchCase; - } - if (typeof newState.preserveCase !== 'undefined') { - this._preserveCase = newState.preserveCase; - } - if (typeof newState.searchScope !== 'undefined') { - if (!((_a = newState.searchScope) === null || _a === void 0 ? void 0 : _a.every((newSearchScope) => { - var _a; - return (_a = this._searchScope) === null || _a === void 0 ? void 0 : _a.some(existingSearchScope => { - return !_common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].equalsRange(existingSearchScope, newSearchScope); - }); - }))) { - this._searchScope = newState.searchScope; - changeEvent.searchScope = true; - somethingChanged = true; - } - } - if (typeof newState.loop !== 'undefined') { - if (this._loop !== newState.loop) { - this._loop = newState.loop; - changeEvent.loop = true; - somethingChanged = true; - } - } - // Overrides get set when they explicitly come in and get reset anytime something else changes - this._isRegexOverride = (typeof newState.isRegexOverride !== 'undefined' ? newState.isRegexOverride : 0 /* NotSet */); - this._wholeWordOverride = (typeof newState.wholeWordOverride !== 'undefined' ? newState.wholeWordOverride : 0 /* NotSet */); - this._matchCaseOverride = (typeof newState.matchCaseOverride !== 'undefined' ? newState.matchCaseOverride : 0 /* NotSet */); - this._preserveCaseOverride = (typeof newState.preserveCaseOverride !== 'undefined' ? newState.preserveCaseOverride : 0 /* NotSet */); - if (oldEffectiveIsRegex !== this.isRegex) { - somethingChanged = true; - changeEvent.isRegex = true; - } - if (oldEffectiveWholeWords !== this.wholeWord) { - somethingChanged = true; - changeEvent.wholeWord = true; - } - if (oldEffectiveMatchCase !== this.matchCase) { - somethingChanged = true; - changeEvent.matchCase = true; - } - if (oldEffectivePreserveCase !== this.preserveCase) { - somethingChanged = true; - changeEvent.preserveCase = true; - } - if (somethingChanged) { - this._onFindReplaceStateChange.fire(changeEvent); - } - } - canNavigateBack() { - return this.canNavigateInLoop() || (this.matchesPosition !== 1); - } - canNavigateForward() { - return this.canNavigateInLoop() || (this.matchesPosition < this.matchesCount); - } - canNavigateInLoop() { - return this._loop || (this.matchesCount >= _findModel_js__WEBPACK_IMPORTED_MODULE_3__["MATCHES_LIMIT"]); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findWidget.css": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/find/findWidget.css ***! - \******************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_findWidget_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./findWidget.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/find/findWidget.css"); -/* harmony import */ var _css_loader_dist_cjs_js_findWidget_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_findWidget_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_findWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_findWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findWidget.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/find/findWidget.js ***! - \*****************************************************************************/ -/*! exports provided: findCloseIcon, findReplaceIcon, findReplaceAllIcon, findPreviousMatchIcon, findNextMatchIcon, FindWidgetViewZone, FindWidget, SimpleButton */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findCloseIcon", function() { return findCloseIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findReplaceIcon", function() { return findReplaceIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findReplaceAllIcon", function() { return findReplaceAllIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findPreviousMatchIcon", function() { return findPreviousMatchIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNextMatchIcon", function() { return findNextMatchIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindWidgetViewZone", function() { return FindWidgetViewZone; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindWidget", function() { return FindWidget; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleButton", function() { return SimpleButton; }); -/* harmony import */ var _findWidget_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./findWidget.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findWidget.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/browser/ui/aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/* harmony import */ var _base_browser_ui_checkbox_checkbox_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/browser/ui/checkbox/checkbox.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/checkbox/checkbox.js"); -/* harmony import */ var _base_browser_ui_sash_sash_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/browser/ui/sash/sash.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/sash/sash.js"); -/* harmony import */ var _base_browser_ui_widget_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/browser/ui/widget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _findModel_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./findModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findModel.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_browser_contextScopedHistoryWidget_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/browser/contextScopedHistoryWidget.js */ "./node_modules/monaco-editor/esm/vs/platform/browser/contextScopedHistoryWidget.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - - - -const findSelectionIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["registerIcon"])('find-selection', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["Codicon"].selection); -const findCollapsedIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["registerIcon"])('find-collapsed', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["Codicon"].chevronRight); -const findExpandedIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["registerIcon"])('find-expanded', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["Codicon"].chevronDown); -const findCloseIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["registerIcon"])('find-close', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["Codicon"].close); -const findReplaceIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["registerIcon"])('find-replace', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["Codicon"].replace); -const findReplaceAllIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["registerIcon"])('find-replace-all', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["Codicon"].replaceAll); -const findPreviousMatchIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["registerIcon"])('find-previous-match', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["Codicon"].arrowUp); -const findNextMatchIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["registerIcon"])('find-next-match', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["Codicon"].arrowDown); -const NLS_FIND_INPUT_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.find', "Find"); -const NLS_FIND_INPUT_PLACEHOLDER = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('placeholder.find', "Find"); -const NLS_PREVIOUS_MATCH_BTN_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.previousMatchButton', "Previous match"); -const NLS_NEXT_MATCH_BTN_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.nextMatchButton', "Next match"); -const NLS_TOGGLE_SELECTION_FIND_TITLE = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.toggleSelectionFind', "Find in selection"); -const NLS_CLOSE_BTN_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.closeButton', "Close"); -const NLS_REPLACE_INPUT_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.replace', "Replace"); -const NLS_REPLACE_INPUT_PLACEHOLDER = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('placeholder.replace', "Replace"); -const NLS_REPLACE_BTN_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.replaceButton', "Replace"); -const NLS_REPLACE_ALL_BTN_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.replaceAllButton', "Replace All"); -const NLS_TOGGLE_REPLACE_MODE_BTN_LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.toggleReplaceButton', "Toggle Replace mode"); -const NLS_MATCHES_COUNT_LIMIT_TITLE = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('title.matchesCountLimit', "Only the first {0} results are highlighted, but all find operations work on the entire text.", _findModel_js__WEBPACK_IMPORTED_MODULE_13__["MATCHES_LIMIT"]); -const NLS_MATCHES_LOCATION = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.matchesLocation', "{0} of {1}"); -const NLS_NO_RESULTS = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label.noResults', "No results"); -const FIND_WIDGET_INITIAL_WIDTH = 419; -const PART_WIDTH = 275; -const FIND_INPUT_AREA_WIDTH = PART_WIDTH - 54; -let MAX_MATCHES_COUNT_WIDTH = 69; -// let FIND_ALL_CONTROLS_WIDTH = 17/** Find Input margin-left */ + (MAX_MATCHES_COUNT_WIDTH + 3 + 1) /** Match Results */ + 23 /** Button */ * 4 + 2/** sash */; -const FIND_INPUT_AREA_HEIGHT = 33; // The height of Find Widget when Replace Input is not visible. -const ctrlEnterReplaceAllWarningPromptedKey = 'ctrlEnterReplaceAll.windows.donotask'; -const ctrlKeyMod = (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_10__["isMacintosh"] ? 256 /* WinCtrl */ : 2048 /* CtrlCmd */); -class FindWidgetViewZone { - constructor(afterLineNumber) { - this.afterLineNumber = afterLineNumber; - this.heightInPx = FIND_INPUT_AREA_HEIGHT; - this.suppressMouseDown = false; - this.domNode = document.createElement('div'); - this.domNode.className = 'dock-find-viewzone'; - } -} -function stopPropagationForMultiLineUpwards(event, value, textarea) { - const isMultiline = !!value.match(/\n/); - if (textarea && isMultiline && textarea.selectionStart > 0) { - event.stopPropagation(); - return; - } -} -function stopPropagationForMultiLineDownwards(event, value, textarea) { - const isMultiline = !!value.match(/\n/); - if (textarea && isMultiline && textarea.selectionEnd < textarea.value.length) { - event.stopPropagation(); - return; - } -} -class FindWidget extends _base_browser_ui_widget_js__WEBPACK_IMPORTED_MODULE_6__["Widget"] { - constructor(codeEditor, controller, state, contextViewProvider, keybindingService, contextKeyService, themeService, storageService, notificationService, storageKeysSyncRegistryService) { - super(); - this._cachedHeight = null; - this._codeEditor = codeEditor; - this._controller = controller; - this._state = state; - this._contextViewProvider = contextViewProvider; - this._keybindingService = keybindingService; - this._contextKeyService = contextKeyService; - this._storageService = storageService; - this._notificationService = notificationService; - storageKeysSyncRegistryService.registerStorageKey({ key: ctrlEnterReplaceAllWarningPromptedKey, version: 1 }); - this._ctrlEnterReplaceAllWarningPrompted = !!storageService.getBoolean(ctrlEnterReplaceAllWarningPromptedKey, 0 /* GLOBAL */); - this._isVisible = false; - this._isReplaceVisible = false; - this._ignoreChangeEvent = false; - this._updateHistoryDelayer = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_7__["Delayer"](500); - this._register(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["toDisposable"])(() => this._updateHistoryDelayer.cancel())); - this._register(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e))); - this._buildDomNode(); - this._updateButtons(); - this._tryUpdateWidgetWidth(); - this._findInput.inputBox.layout(); - this._register(this._codeEditor.onDidChangeConfiguration((e) => { - if (e.hasChanged(72 /* readOnly */)) { - if (this._codeEditor.getOption(72 /* readOnly */)) { - // Hide replace part if editor becomes read only - this._state.change({ isReplaceRevealed: false }, false); - } - this._updateButtons(); - } - if (e.hasChanged(117 /* layoutInfo */)) { - this._tryUpdateWidgetWidth(); - } - if (e.hasChanged(2 /* accessibilitySupport */)) { - this.updateAccessibilitySupport(); - } - if (e.hasChanged(29 /* find */)) { - const addExtraSpaceOnTop = this._codeEditor.getOption(29 /* find */).addExtraSpaceOnTop; - if (addExtraSpaceOnTop && !this._viewZone) { - this._viewZone = new FindWidgetViewZone(0); - this._showViewZone(); - } - if (!addExtraSpaceOnTop && this._viewZone) { - this._removeViewZone(); - } - } - })); - this.updateAccessibilitySupport(); - this._register(this._codeEditor.onDidChangeCursorSelection(() => { - if (this._isVisible) { - this._updateToggleSelectionFindButton(); - } - })); - this._register(this._codeEditor.onDidFocusEditorWidget(() => __awaiter(this, void 0, void 0, function* () { - if (this._isVisible) { - let globalBufferTerm = yield this._controller.getGlobalBufferTerm(); - if (globalBufferTerm && globalBufferTerm !== this._state.searchString) { - this._state.change({ searchString: globalBufferTerm }, true); - this._findInput.select(); - } - } - }))); - this._findInputFocused = _findModel_js__WEBPACK_IMPORTED_MODULE_13__["CONTEXT_FIND_INPUT_FOCUSED"].bindTo(contextKeyService); - this._findFocusTracker = this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["trackFocus"](this._findInput.inputBox.inputElement)); - this._register(this._findFocusTracker.onDidFocus(() => { - this._findInputFocused.set(true); - this._updateSearchScope(); - })); - this._register(this._findFocusTracker.onDidBlur(() => { - this._findInputFocused.set(false); - })); - this._replaceInputFocused = _findModel_js__WEBPACK_IMPORTED_MODULE_13__["CONTEXT_REPLACE_INPUT_FOCUSED"].bindTo(contextKeyService); - this._replaceFocusTracker = this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["trackFocus"](this._replaceInput.inputBox.inputElement)); - this._register(this._replaceFocusTracker.onDidFocus(() => { - this._replaceInputFocused.set(true); - this._updateSearchScope(); - })); - this._register(this._replaceFocusTracker.onDidBlur(() => { - this._replaceInputFocused.set(false); - })); - this._codeEditor.addOverlayWidget(this); - if (this._codeEditor.getOption(29 /* find */).addExtraSpaceOnTop) { - this._viewZone = new FindWidgetViewZone(0); // Put it before the first line then users can scroll beyond the first line. - } - this._applyTheme(themeService.getColorTheme()); - this._register(themeService.onDidColorThemeChange(this._applyTheme.bind(this))); - this._register(this._codeEditor.onDidChangeModel(() => { - if (!this._isVisible) { - return; - } - this._viewZoneId = undefined; - })); - this._register(this._codeEditor.onDidScrollChange((e) => { - if (e.scrollTopChanged) { - this._layoutViewZone(); - return; - } - // for other scroll changes, layout the viewzone in next tick to avoid ruining current rendering. - setTimeout(() => { - this._layoutViewZone(); - }, 0); - })); - } - // ----- IOverlayWidget API - getId() { - return FindWidget.ID; - } - getDomNode() { - return this._domNode; - } - getPosition() { - if (this._isVisible) { - return { - preference: 0 /* TOP_RIGHT_CORNER */ - }; - } - return null; - } - // ----- React to state changes - _onStateChanged(e) { - if (e.searchString) { - try { - this._ignoreChangeEvent = true; - this._findInput.setValue(this._state.searchString); - } - finally { - this._ignoreChangeEvent = false; - } - this._updateButtons(); - } - if (e.replaceString) { - this._replaceInput.inputBox.value = this._state.replaceString; - } - if (e.isRevealed) { - if (this._state.isRevealed) { - this._reveal(); - } - else { - this._hide(true); - } - } - if (e.isReplaceRevealed) { - if (this._state.isReplaceRevealed) { - if (!this._codeEditor.getOption(72 /* readOnly */) && !this._isReplaceVisible) { - this._isReplaceVisible = true; - this._replaceInput.width = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalWidth"](this._findInput.domNode); - this._updateButtons(); - this._replaceInput.inputBox.layout(); - } - } - else { - if (this._isReplaceVisible) { - this._isReplaceVisible = false; - this._updateButtons(); - } - } - } - if ((e.isRevealed || e.isReplaceRevealed) && (this._state.isRevealed || this._state.isReplaceRevealed)) { - if (this._tryUpdateHeight()) { - this._showViewZone(); - } - } - if (e.isRegex) { - this._findInput.setRegex(this._state.isRegex); - } - if (e.wholeWord) { - this._findInput.setWholeWords(this._state.wholeWord); - } - if (e.matchCase) { - this._findInput.setCaseSensitive(this._state.matchCase); - } - if (e.searchScope) { - if (this._state.searchScope) { - this._toggleSelectionFind.checked = true; - } - else { - this._toggleSelectionFind.checked = false; - } - this._updateToggleSelectionFindButton(); - } - if (e.searchString || e.matchesCount || e.matchesPosition) { - let showRedOutline = (this._state.searchString.length > 0 && this._state.matchesCount === 0); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["toggleClass"](this._domNode, 'no-results', showRedOutline); - this._updateMatchesCount(); - this._updateButtons(); - } - if (e.searchString || e.currentMatch) { - this._layoutViewZone(); - } - if (e.updateHistory) { - this._delayedUpdateHistory(); - } - if (e.loop) { - this._updateButtons(); - } - } - _delayedUpdateHistory() { - this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)); - } - _updateHistory() { - if (this._state.searchString) { - this._findInput.inputBox.addToHistory(); - } - if (this._state.replaceString) { - this._replaceInput.inputBox.addToHistory(); - } - } - _updateMatchesCount() { - this._matchesCount.style.minWidth = MAX_MATCHES_COUNT_WIDTH + 'px'; - if (this._state.matchesCount >= _findModel_js__WEBPACK_IMPORTED_MODULE_13__["MATCHES_LIMIT"]) { - this._matchesCount.title = NLS_MATCHES_COUNT_LIMIT_TITLE; - } - else { - this._matchesCount.title = ''; - } - // remove previous content - if (this._matchesCount.firstChild) { - this._matchesCount.removeChild(this._matchesCount.firstChild); - } - let label; - if (this._state.matchesCount > 0) { - let matchesCount = String(this._state.matchesCount); - if (this._state.matchesCount >= _findModel_js__WEBPACK_IMPORTED_MODULE_13__["MATCHES_LIMIT"]) { - matchesCount += '+'; - } - let matchesPosition = String(this._state.matchesPosition); - if (matchesPosition === '0') { - matchesPosition = '?'; - } - label = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_11__["format"](NLS_MATCHES_LOCATION, matchesPosition, matchesCount); - } - else { - label = NLS_NO_RESULTS; - } - this._matchesCount.appendChild(document.createTextNode(label)); - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_3__["alert"])(this._getAriaLabel(label, this._state.currentMatch, this._state.searchString)); - MAX_MATCHES_COUNT_WIDTH = Math.max(MAX_MATCHES_COUNT_WIDTH, this._matchesCount.clientWidth); - } - // ----- actions - _getAriaLabel(label, currentMatch, searchString) { - if (label === NLS_NO_RESULTS) { - return searchString === '' - ? _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('ariaSearchNoResultEmpty', "{0} found", label) - : _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('ariaSearchNoResult', "{0} found for '{1}'", label, searchString); - } - if (currentMatch) { - const ariaLabel = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('ariaSearchNoResultWithLineNum', "{0} found for '{1}', at {2}", label, searchString, currentMatch.startLineNumber + ':' + currentMatch.startColumn); - const model = this._codeEditor.getModel(); - if (model && (currentMatch.startLineNumber <= model.getLineCount()) && (currentMatch.startLineNumber >= 1)) { - const lineContent = model.getLineContent(currentMatch.startLineNumber); - return `${lineContent}, ${ariaLabel}`; - } - return ariaLabel; - } - return _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('ariaSearchNoResultWithLineNumNoCurrentMatch', "{0} found for '{1}'", label, searchString); - } - /** - * If 'selection find' is ON we should not disable the button (its function is to cancel 'selection find'). - * If 'selection find' is OFF we enable the button only if there is a selection. - */ - _updateToggleSelectionFindButton() { - let selection = this._codeEditor.getSelection(); - let isSelection = selection ? (selection.startLineNumber !== selection.endLineNumber || selection.startColumn !== selection.endColumn) : false; - let isChecked = this._toggleSelectionFind.checked; - if (this._isVisible && (isChecked || isSelection)) { - this._toggleSelectionFind.enable(); - } - else { - this._toggleSelectionFind.disable(); - } - } - _updateButtons() { - this._findInput.setEnabled(this._isVisible); - this._replaceInput.setEnabled(this._isVisible && this._isReplaceVisible); - this._updateToggleSelectionFindButton(); - this._closeBtn.setEnabled(this._isVisible); - let findInputIsNonEmpty = (this._state.searchString.length > 0); - let matchesCount = this._state.matchesCount ? true : false; - this._prevBtn.setEnabled(this._isVisible && findInputIsNonEmpty && matchesCount && this._state.canNavigateBack()); - this._nextBtn.setEnabled(this._isVisible && findInputIsNonEmpty && matchesCount && this._state.canNavigateForward()); - this._replaceBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty); - this._replaceAllBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["toggleClass"](this._domNode, 'replaceToggled', this._isReplaceVisible); - this._toggleReplaceBtn.setExpanded(this._isReplaceVisible); - let canReplace = !this._codeEditor.getOption(72 /* readOnly */); - this._toggleReplaceBtn.setEnabled(this._isVisible && canReplace); - } - _reveal() { - if (!this._isVisible) { - this._isVisible = true; - const selection = this._codeEditor.getSelection(); - switch (this._codeEditor.getOption(29 /* find */).autoFindInSelection) { - case 'always': - this._toggleSelectionFind.checked = true; - break; - case 'never': - this._toggleSelectionFind.checked = false; - break; - case 'multiline': - const isSelectionMultipleLine = !!selection && selection.startLineNumber !== selection.endLineNumber; - this._toggleSelectionFind.checked = isSelectionMultipleLine; - break; - default: - break; - } - this._tryUpdateWidgetWidth(); - this._updateButtons(); - setTimeout(() => { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](this._domNode, 'visible'); - this._domNode.setAttribute('aria-hidden', 'false'); - }, 0); - // validate query again as it's being dismissed when we hide the find widget. - setTimeout(() => { - this._findInput.validate(); - }, 200); - this._codeEditor.layoutOverlayWidget(this); - let adjustEditorScrollTop = true; - if (this._codeEditor.getOption(29 /* find */).seedSearchStringFromSelection && selection) { - const domNode = this._codeEditor.getDomNode(); - if (domNode) { - const editorCoords = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getDomNodePagePosition"](domNode); - const startCoords = this._codeEditor.getScrolledVisiblePosition(selection.getStartPosition()); - const startLeft = editorCoords.left + (startCoords ? startCoords.left : 0); - const startTop = startCoords ? startCoords.top : 0; - if (this._viewZone && startTop < this._viewZone.heightInPx) { - if (selection.endLineNumber > selection.startLineNumber) { - adjustEditorScrollTop = false; - } - const leftOfFindWidget = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getTopLeftOffset"](this._domNode).left; - if (startLeft > leftOfFindWidget) { - adjustEditorScrollTop = false; - } - const endCoords = this._codeEditor.getScrolledVisiblePosition(selection.getEndPosition()); - const endLeft = editorCoords.left + (endCoords ? endCoords.left : 0); - if (endLeft > leftOfFindWidget) { - adjustEditorScrollTop = false; - } - } - } - } - this._showViewZone(adjustEditorScrollTop); - } - } - _hide(focusTheEditor) { - if (this._isVisible) { - this._isVisible = false; - this._updateButtons(); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["removeClass"](this._domNode, 'visible'); - this._domNode.setAttribute('aria-hidden', 'true'); - this._findInput.clearMessage(); - if (focusTheEditor) { - this._codeEditor.focus(); - } - this._codeEditor.layoutOverlayWidget(this); - this._removeViewZone(); - } - } - _layoutViewZone() { - const addExtraSpaceOnTop = this._codeEditor.getOption(29 /* find */).addExtraSpaceOnTop; - if (!addExtraSpaceOnTop) { - this._removeViewZone(); - return; - } - if (!this._isVisible) { - return; - } - const viewZone = this._viewZone; - if (this._viewZoneId !== undefined || !viewZone) { - return; - } - this._codeEditor.changeViewZones((accessor) => { - viewZone.heightInPx = this._getHeight(); - this._viewZoneId = accessor.addZone(viewZone); - // scroll top adjust to make sure the editor doesn't scroll when adding viewzone at the beginning. - this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + viewZone.heightInPx); - }); - } - _showViewZone(adjustScroll = true) { - if (!this._isVisible) { - return; - } - const addExtraSpaceOnTop = this._codeEditor.getOption(29 /* find */).addExtraSpaceOnTop; - if (!addExtraSpaceOnTop) { - return; - } - if (this._viewZone === undefined) { - this._viewZone = new FindWidgetViewZone(0); - } - const viewZone = this._viewZone; - this._codeEditor.changeViewZones((accessor) => { - if (this._viewZoneId !== undefined) { - // the view zone already exists, we need to update the height - const newHeight = this._getHeight(); - if (newHeight === viewZone.heightInPx) { - return; - } - let scrollAdjustment = newHeight - viewZone.heightInPx; - viewZone.heightInPx = newHeight; - accessor.layoutZone(this._viewZoneId); - if (adjustScroll) { - this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + scrollAdjustment); - } - return; - } - else { - let scrollAdjustment = this._getHeight(); - // if the editor has top padding, factor that into the zone height - scrollAdjustment -= this._codeEditor.getOption(66 /* padding */).top; - if (scrollAdjustment <= 0) { - return; - } - viewZone.heightInPx = scrollAdjustment; - this._viewZoneId = accessor.addZone(viewZone); - if (adjustScroll) { - this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + scrollAdjustment); - } - } - }); - } - _removeViewZone() { - this._codeEditor.changeViewZones((accessor) => { - if (this._viewZoneId !== undefined) { - accessor.removeZone(this._viewZoneId); - this._viewZoneId = undefined; - if (this._viewZone) { - this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() - this._viewZone.heightInPx); - this._viewZone = undefined; - } - } - }); - } - _applyTheme(theme) { - let inputStyles = { - inputActiveOptionBorder: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputActiveOptionBorder"]), - inputActiveOptionBackground: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputActiveOptionBackground"]), - inputActiveOptionForeground: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputActiveOptionForeground"]), - inputBackground: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputBackground"]), - inputForeground: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputForeground"]), - inputBorder: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputBorder"]), - inputValidationInfoBackground: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputValidationInfoBackground"]), - inputValidationInfoForeground: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputValidationInfoForeground"]), - inputValidationInfoBorder: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputValidationInfoBorder"]), - inputValidationWarningBackground: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputValidationWarningBackground"]), - inputValidationWarningForeground: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputValidationWarningForeground"]), - inputValidationWarningBorder: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputValidationWarningBorder"]), - inputValidationErrorBackground: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputValidationErrorBackground"]), - inputValidationErrorForeground: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputValidationErrorForeground"]), - inputValidationErrorBorder: theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["inputValidationErrorBorder"]), - }; - this._findInput.style(inputStyles); - this._replaceInput.style(inputStyles); - this._toggleSelectionFind.style(inputStyles); - } - _tryUpdateWidgetWidth() { - if (!this._isVisible) { - return; - } - if (!_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["isInDOM"](this._domNode)) { - // the widget is not in the DOM - return; - } - const layoutInfo = this._codeEditor.getLayoutInfo(); - const editorContentWidth = layoutInfo.contentWidth; - if (editorContentWidth <= 0) { - // for example, diff view original editor - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](this._domNode, 'hiddenEditor'); - return; - } - else if (_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["hasClass"](this._domNode, 'hiddenEditor')) { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["removeClass"](this._domNode, 'hiddenEditor'); - } - const editorWidth = layoutInfo.width; - const minimapWidth = layoutInfo.minimap.minimapWidth; - let collapsedFindWidget = false; - let reducedFindWidget = false; - let narrowFindWidget = false; - if (this._resized) { - let widgetWidth = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalWidth"](this._domNode); - if (widgetWidth > FIND_WIDGET_INITIAL_WIDTH) { - // as the widget is resized by users, we may need to change the max width of the widget as the editor width changes. - this._domNode.style.maxWidth = `${editorWidth - 28 - minimapWidth - 15}px`; - this._replaceInput.width = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalWidth"](this._findInput.domNode); - return; - } - } - if (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth >= editorWidth) { - reducedFindWidget = true; - } - if (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth - MAX_MATCHES_COUNT_WIDTH >= editorWidth) { - narrowFindWidget = true; - } - if (FIND_WIDGET_INITIAL_WIDTH + 28 + minimapWidth - MAX_MATCHES_COUNT_WIDTH >= editorWidth + 50) { - collapsedFindWidget = true; - } - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["toggleClass"](this._domNode, 'collapsed-find-widget', collapsedFindWidget); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["toggleClass"](this._domNode, 'narrow-find-widget', narrowFindWidget); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["toggleClass"](this._domNode, 'reduced-find-widget', reducedFindWidget); - if (!narrowFindWidget && !collapsedFindWidget) { - // the minimal left offset of findwidget is 15px. - this._domNode.style.maxWidth = `${editorWidth - 28 - minimapWidth - 15}px`; - } - if (this._resized) { - this._findInput.inputBox.layout(); - let findInputWidth = this._findInput.inputBox.element.clientWidth; - if (findInputWidth > 0) { - this._replaceInput.width = findInputWidth; - } - } - else if (this._isReplaceVisible) { - this._replaceInput.width = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalWidth"](this._findInput.domNode); - } - } - _getHeight() { - let totalheight = 0; - // find input margin top - totalheight += 4; - // find input height - totalheight += this._findInput.inputBox.height + 2 /** input box border */; - if (this._isReplaceVisible) { - // replace input margin - totalheight += 4; - totalheight += this._replaceInput.inputBox.height + 2 /** input box border */; - } - // margin bottom - totalheight += 4; - return totalheight; - } - _tryUpdateHeight() { - const totalHeight = this._getHeight(); - if (this._cachedHeight !== null && this._cachedHeight === totalHeight) { - return false; - } - this._cachedHeight = totalHeight; - this._domNode.style.height = `${totalHeight}px`; - return true; - } - // ----- Public - focusFindInput() { - this._findInput.select(); - // Edge browser requires focus() in addition to select() - this._findInput.focus(); - } - focusReplaceInput() { - this._replaceInput.select(); - // Edge browser requires focus() in addition to select() - this._replaceInput.focus(); - } - highlightFindOptions() { - this._findInput.highlightFindOptions(); - } - _updateSearchScope() { - if (!this._codeEditor.hasModel()) { - return; - } - if (this._toggleSelectionFind.checked) { - let selections = this._codeEditor.getSelections(); - selections.map(selection => { - if (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) { - selection = selection.setEndPosition(selection.endLineNumber - 1, this._codeEditor.getModel().getLineMaxColumn(selection.endLineNumber - 1)); - } - const currentMatch = this._state.currentMatch; - if (selection.startLineNumber !== selection.endLineNumber) { - if (!_common_core_range_js__WEBPACK_IMPORTED_MODULE_12__["Range"].equalsRange(selection, currentMatch)) { - return selection; - } - } - return null; - }).filter(element => !!element); - if (selections.length) { - this._state.change({ searchScope: selections }, true); - } - } - } - _onFindInputMouseDown(e) { - // on linux, middle key does pasting. - if (e.middleButton) { - e.stopPropagation(); - } - } - _onFindInputKeyDown(e) { - if (e.equals(ctrlKeyMod | 3 /* Enter */)) { - this._findInput.inputBox.insertAtCursor('\n'); - e.preventDefault(); - return; - } - if (e.equals(2 /* Tab */)) { - if (this._isReplaceVisible) { - this._replaceInput.focus(); - } - else { - this._findInput.focusOnCaseSensitive(); - } - e.preventDefault(); - return; - } - if (e.equals(2048 /* CtrlCmd */ | 18 /* DownArrow */)) { - this._codeEditor.focus(); - e.preventDefault(); - return; - } - if (e.equals(16 /* UpArrow */)) { - return stopPropagationForMultiLineUpwards(e, this._findInput.getValue(), this._findInput.domNode.querySelector('textarea')); - } - if (e.equals(18 /* DownArrow */)) { - return stopPropagationForMultiLineDownwards(e, this._findInput.getValue(), this._findInput.domNode.querySelector('textarea')); - } - } - _onReplaceInputKeyDown(e) { - if (e.equals(ctrlKeyMod | 3 /* Enter */)) { - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_10__["isWindows"] && _base_common_platform_js__WEBPACK_IMPORTED_MODULE_10__["isNative"] && !this._ctrlEnterReplaceAllWarningPrompted) { - // this is the first time when users press Ctrl + Enter to replace all - this._notificationService.info(_nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('ctrlEnter.keybindingChanged', 'Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.')); - this._ctrlEnterReplaceAllWarningPrompted = true; - this._storageService.store(ctrlEnterReplaceAllWarningPromptedKey, true, 0 /* GLOBAL */); - } - this._replaceInput.inputBox.insertAtCursor('\n'); - e.preventDefault(); - return; - } - if (e.equals(2 /* Tab */)) { - this._findInput.focusOnCaseSensitive(); - e.preventDefault(); - return; - } - if (e.equals(1024 /* Shift */ | 2 /* Tab */)) { - this._findInput.focus(); - e.preventDefault(); - return; - } - if (e.equals(2048 /* CtrlCmd */ | 18 /* DownArrow */)) { - this._codeEditor.focus(); - e.preventDefault(); - return; - } - if (e.equals(16 /* UpArrow */)) { - return stopPropagationForMultiLineUpwards(e, this._replaceInput.inputBox.value, this._replaceInput.inputBox.element.querySelector('textarea')); - } - if (e.equals(18 /* DownArrow */)) { - return stopPropagationForMultiLineDownwards(e, this._replaceInput.inputBox.value, this._replaceInput.inputBox.element.querySelector('textarea')); - } - } - // ----- sash - getVerticalSashLeft(_sash) { - return 0; - } - // ----- initialization - _keybindingLabelFor(actionId) { - let kb = this._keybindingService.lookupKeybinding(actionId); - if (!kb) { - return ''; - } - return ` (${kb.getLabel()})`; - } - _buildDomNode() { - const flexibleHeight = true; - const flexibleWidth = true; - // Find input - this._findInput = this._register(new _platform_browser_contextScopedHistoryWidget_js__WEBPACK_IMPORTED_MODULE_16__["ContextScopedFindInput"](null, this._contextViewProvider, { - width: FIND_INPUT_AREA_WIDTH, - label: NLS_FIND_INPUT_LABEL, - placeholder: NLS_FIND_INPUT_PLACEHOLDER, - appendCaseSensitiveLabel: this._keybindingLabelFor(_findModel_js__WEBPACK_IMPORTED_MODULE_13__["FIND_IDS"].ToggleCaseSensitiveCommand), - appendWholeWordsLabel: this._keybindingLabelFor(_findModel_js__WEBPACK_IMPORTED_MODULE_13__["FIND_IDS"].ToggleWholeWordCommand), - appendRegexLabel: this._keybindingLabelFor(_findModel_js__WEBPACK_IMPORTED_MODULE_13__["FIND_IDS"].ToggleRegexCommand), - validation: (value) => { - if (value.length === 0 || !this._findInput.getRegex()) { - return null; - } - try { - // use `g` and `u` which are also used by the TextModel search - new RegExp(value, 'gu'); - return null; - } - catch (e) { - return { content: e.message }; - } - }, - flexibleHeight, - flexibleWidth, - flexibleMaxHeight: 118 - }, this._contextKeyService, true)); - this._findInput.setRegex(!!this._state.isRegex); - this._findInput.setCaseSensitive(!!this._state.matchCase); - this._findInput.setWholeWords(!!this._state.wholeWord); - this._register(this._findInput.onKeyDown((e) => this._onFindInputKeyDown(e))); - this._register(this._findInput.inputBox.onDidChange(() => { - if (this._ignoreChangeEvent) { - return; - } - this._state.change({ searchString: this._findInput.getValue() }, true); - })); - this._register(this._findInput.onDidOptionChange(() => { - this._state.change({ - isRegex: this._findInput.getRegex(), - wholeWord: this._findInput.getWholeWords(), - matchCase: this._findInput.getCaseSensitive() - }, true); - })); - this._register(this._findInput.onCaseSensitiveKeyDown((e) => { - if (e.equals(1024 /* Shift */ | 2 /* Tab */)) { - if (this._isReplaceVisible) { - this._replaceInput.focus(); - e.preventDefault(); - } - } - })); - this._register(this._findInput.onRegexKeyDown((e) => { - if (e.equals(2 /* Tab */)) { - if (this._isReplaceVisible) { - this._replaceInput.focusOnPreserve(); - e.preventDefault(); - } - } - })); - this._register(this._findInput.inputBox.onDidHeightChange((e) => { - if (this._tryUpdateHeight()) { - this._showViewZone(); - } - })); - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_10__["isLinux"]) { - this._register(this._findInput.onMouseDown((e) => this._onFindInputMouseDown(e))); - } - this._matchesCount = document.createElement('div'); - this._matchesCount.className = 'matchesCount'; - this._updateMatchesCount(); - // Previous button - this._prevBtn = this._register(new SimpleButton({ - label: NLS_PREVIOUS_MATCH_BTN_LABEL + this._keybindingLabelFor(_findModel_js__WEBPACK_IMPORTED_MODULE_13__["FIND_IDS"].PreviousMatchFindAction), - className: findPreviousMatchIcon.classNames, - onTrigger: () => { - this._codeEditor.getAction(_findModel_js__WEBPACK_IMPORTED_MODULE_13__["FIND_IDS"].PreviousMatchFindAction).run().then(undefined, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_8__["onUnexpectedError"]); - } - })); - // Next button - this._nextBtn = this._register(new SimpleButton({ - label: NLS_NEXT_MATCH_BTN_LABEL + this._keybindingLabelFor(_findModel_js__WEBPACK_IMPORTED_MODULE_13__["FIND_IDS"].NextMatchFindAction), - className: findNextMatchIcon.classNames, - onTrigger: () => { - this._codeEditor.getAction(_findModel_js__WEBPACK_IMPORTED_MODULE_13__["FIND_IDS"].NextMatchFindAction).run().then(undefined, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_8__["onUnexpectedError"]); - } - })); - let findPart = document.createElement('div'); - findPart.className = 'find-part'; - findPart.appendChild(this._findInput.domNode); - const actionsContainer = document.createElement('div'); - actionsContainer.className = 'find-actions'; - findPart.appendChild(actionsContainer); - actionsContainer.appendChild(this._matchesCount); - actionsContainer.appendChild(this._prevBtn.domNode); - actionsContainer.appendChild(this._nextBtn.domNode); - // Toggle selection button - this._toggleSelectionFind = this._register(new _base_browser_ui_checkbox_checkbox_js__WEBPACK_IMPORTED_MODULE_4__["Checkbox"]({ - icon: findSelectionIcon, - title: NLS_TOGGLE_SELECTION_FIND_TITLE + this._keybindingLabelFor(_findModel_js__WEBPACK_IMPORTED_MODULE_13__["FIND_IDS"].ToggleSearchScopeCommand), - isChecked: false - })); - this._register(this._toggleSelectionFind.onChange(() => { - if (this._toggleSelectionFind.checked) { - if (this._codeEditor.hasModel()) { - let selections = this._codeEditor.getSelections(); - selections.map(selection => { - if (selection.endColumn === 1 && selection.endLineNumber > selection.startLineNumber) { - selection = selection.setEndPosition(selection.endLineNumber - 1, this._codeEditor.getModel().getLineMaxColumn(selection.endLineNumber - 1)); - } - if (!selection.isEmpty()) { - return selection; - } - return null; - }).filter(element => !!element); - if (selections.length) { - this._state.change({ searchScope: selections }, true); - } - } - } - else { - this._state.change({ searchScope: null }, true); - } - })); - actionsContainer.appendChild(this._toggleSelectionFind.domNode); - // Close button - this._closeBtn = this._register(new SimpleButton({ - label: NLS_CLOSE_BTN_LABEL + this._keybindingLabelFor(_findModel_js__WEBPACK_IMPORTED_MODULE_13__["FIND_IDS"].CloseFindWidgetCommand), - className: findCloseIcon.classNames, - onTrigger: () => { - this._state.change({ isRevealed: false, searchScope: null }, false); - }, - onKeyDown: (e) => { - if (e.equals(2 /* Tab */)) { - if (this._isReplaceVisible) { - if (this._replaceBtn.isEnabled()) { - this._replaceBtn.focus(); - } - else { - this._codeEditor.focus(); - } - e.preventDefault(); - } - } - } - })); - actionsContainer.appendChild(this._closeBtn.domNode); - // Replace input - this._replaceInput = this._register(new _platform_browser_contextScopedHistoryWidget_js__WEBPACK_IMPORTED_MODULE_16__["ContextScopedReplaceInput"](null, undefined, { - label: NLS_REPLACE_INPUT_LABEL, - placeholder: NLS_REPLACE_INPUT_PLACEHOLDER, - history: [], - flexibleHeight, - flexibleWidth, - flexibleMaxHeight: 118 - }, this._contextKeyService, true)); - this._replaceInput.setPreserveCase(!!this._state.preserveCase); - this._register(this._replaceInput.onKeyDown((e) => this._onReplaceInputKeyDown(e))); - this._register(this._replaceInput.inputBox.onDidChange(() => { - this._state.change({ replaceString: this._replaceInput.inputBox.value }, false); - })); - this._register(this._replaceInput.inputBox.onDidHeightChange((e) => { - if (this._isReplaceVisible && this._tryUpdateHeight()) { - this._showViewZone(); - } - })); - this._register(this._replaceInput.onDidOptionChange(() => { - this._state.change({ - preserveCase: this._replaceInput.getPreserveCase() - }, true); - })); - this._register(this._replaceInput.onPreserveCaseKeyDown((e) => { - if (e.equals(2 /* Tab */)) { - if (this._prevBtn.isEnabled()) { - this._prevBtn.focus(); - } - else if (this._nextBtn.isEnabled()) { - this._nextBtn.focus(); - } - else if (this._toggleSelectionFind.enabled) { - this._toggleSelectionFind.focus(); - } - else if (this._closeBtn.isEnabled()) { - this._closeBtn.focus(); - } - e.preventDefault(); - } - })); - // Replace one button - this._replaceBtn = this._register(new SimpleButton({ - label: NLS_REPLACE_BTN_LABEL + this._keybindingLabelFor(_findModel_js__WEBPACK_IMPORTED_MODULE_13__["FIND_IDS"].ReplaceOneAction), - className: findReplaceIcon.classNames, - onTrigger: () => { - this._controller.replace(); - }, - onKeyDown: (e) => { - if (e.equals(1024 /* Shift */ | 2 /* Tab */)) { - this._closeBtn.focus(); - e.preventDefault(); - } - } - })); - // Replace all button - this._replaceAllBtn = this._register(new SimpleButton({ - label: NLS_REPLACE_ALL_BTN_LABEL + this._keybindingLabelFor(_findModel_js__WEBPACK_IMPORTED_MODULE_13__["FIND_IDS"].ReplaceAllAction), - className: findReplaceAllIcon.classNames, - onTrigger: () => { - this._controller.replaceAll(); - } - })); - let replacePart = document.createElement('div'); - replacePart.className = 'replace-part'; - replacePart.appendChild(this._replaceInput.domNode); - const replaceActionsContainer = document.createElement('div'); - replaceActionsContainer.className = 'replace-actions'; - replacePart.appendChild(replaceActionsContainer); - replaceActionsContainer.appendChild(this._replaceBtn.domNode); - replaceActionsContainer.appendChild(this._replaceAllBtn.domNode); - // Toggle replace button - this._toggleReplaceBtn = this._register(new SimpleButton({ - label: NLS_TOGGLE_REPLACE_MODE_BTN_LABEL, - className: 'codicon toggle left', - onTrigger: () => { - this._state.change({ isReplaceRevealed: !this._isReplaceVisible }, false); - if (this._isReplaceVisible) { - this._replaceInput.width = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalWidth"](this._findInput.domNode); - this._replaceInput.inputBox.layout(); - } - this._showViewZone(); - } - })); - this._toggleReplaceBtn.setExpanded(this._isReplaceVisible); - // Widget - this._domNode = document.createElement('div'); - this._domNode.className = 'editor-widget find-widget'; - this._domNode.setAttribute('aria-hidden', 'true'); - // We need to set this explicitly, otherwise on IE11, the width inheritence of flex doesn't work. - this._domNode.style.width = `${FIND_WIDGET_INITIAL_WIDTH}px`; - this._domNode.appendChild(this._toggleReplaceBtn.domNode); - this._domNode.appendChild(findPart); - this._domNode.appendChild(replacePart); - this._resizeSash = new _base_browser_ui_sash_sash_js__WEBPACK_IMPORTED_MODULE_5__["Sash"](this._domNode, this, { orientation: 0 /* VERTICAL */, size: 2 }); - this._resized = false; - let originalWidth = FIND_WIDGET_INITIAL_WIDTH; - this._register(this._resizeSash.onDidStart(() => { - originalWidth = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalWidth"](this._domNode); - })); - this._register(this._resizeSash.onDidChange((evt) => { - this._resized = true; - let width = originalWidth + evt.startX - evt.currentX; - if (width < FIND_WIDGET_INITIAL_WIDTH) { - // narrow down the find widget should be handled by CSS. - return; - } - const maxWidth = parseFloat(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getComputedStyle"](this._domNode).maxWidth) || 0; - if (width > maxWidth) { - return; - } - this._domNode.style.width = `${width}px`; - if (this._isReplaceVisible) { - this._replaceInput.width = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalWidth"](this._findInput.domNode); - } - this._findInput.inputBox.layout(); - this._tryUpdateHeight(); - })); - this._register(this._resizeSash.onDidReset(() => { - // users double click on the sash - const currentWidth = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalWidth"](this._domNode); - if (currentWidth < FIND_WIDGET_INITIAL_WIDTH) { - // The editor is narrow and the width of the find widget is controlled fully by CSS. - return; - } - let width = FIND_WIDGET_INITIAL_WIDTH; - if (!this._resized || currentWidth === FIND_WIDGET_INITIAL_WIDTH) { - // 1. never resized before, double click should maximizes it - // 2. users resized it already but its width is the same as default - const layoutInfo = this._codeEditor.getLayoutInfo(); - width = layoutInfo.width - 28 - layoutInfo.minimap.minimapWidth - 15; - this._resized = true; - } - else { - /** - * no op, the find widget should be shrinked to its default size. - */ - } - this._domNode.style.width = `${width}px`; - if (this._isReplaceVisible) { - this._replaceInput.width = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["getTotalWidth"](this._findInput.domNode); - } - this._findInput.inputBox.layout(); - })); - } - updateAccessibilitySupport() { - const value = this._codeEditor.getOption(2 /* accessibilitySupport */); - this._findInput.setFocusInputOnOptionClick(value !== 2 /* Enabled */); - } -} -FindWidget.ID = 'editor.contrib.findWidget'; -class SimpleButton extends _base_browser_ui_widget_js__WEBPACK_IMPORTED_MODULE_6__["Widget"] { - constructor(opts) { - super(); - this._opts = opts; - this._domNode = document.createElement('div'); - this._domNode.title = this._opts.label; - this._domNode.tabIndex = 0; - this._domNode.className = 'button ' + this._opts.className; - this._domNode.setAttribute('role', 'button'); - this._domNode.setAttribute('aria-label', this._opts.label); - this.onclick(this._domNode, (e) => { - this._opts.onTrigger(); - e.preventDefault(); - }); - this.onkeydown(this._domNode, (e) => { - if (e.equals(10 /* Space */) || e.equals(3 /* Enter */)) { - this._opts.onTrigger(); - e.preventDefault(); - return; - } - if (this._opts.onKeyDown) { - this._opts.onKeyDown(e); - } - }); - } - get domNode() { - return this._domNode; - } - isEnabled() { - return (this._domNode.tabIndex >= 0); - } - focus() { - this._domNode.focus(); - } - setEnabled(enabled) { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["toggleClass"](this._domNode, 'disabled', !enabled); - this._domNode.setAttribute('aria-disabled', String(!enabled)); - this._domNode.tabIndex = enabled ? 0 : -1; - } - setExpanded(expanded) { - this._domNode.setAttribute('aria-expanded', String(!!expanded)); - if (expanded) { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["removeClasses"](this._domNode, findCollapsedIcon.classNames); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClasses"](this._domNode, findExpandedIcon.classNames); - } - else { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["removeClasses"](this._domNode, findExpandedIcon.classNames); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClasses"](this._domNode, findCollapsedIcon.classNames); - } - } -} -// theming -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_15__["registerThemingParticipant"])((theme, collector) => { - const addBackgroundColorRule = (selector, color) => { - if (color) { - collector.addRule(`.monaco-editor ${selector} { background-color: ${color}; }`); - } - }; - addBackgroundColorRule('.findMatch', theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["editorFindMatchHighlight"])); - addBackgroundColorRule('.currentFindMatch', theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["editorFindMatch"])); - addBackgroundColorRule('.findScope', theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["editorFindRangeHighlight"])); - const widgetBackground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["editorWidgetBackground"]); - addBackgroundColorRule('.find-widget', widgetBackground); - const widgetShadowColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["widgetShadow"]); - if (widgetShadowColor) { - collector.addRule(`.monaco-editor .find-widget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`); - } - const findMatchHighlightBorder = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["editorFindMatchHighlightBorder"]); - if (findMatchHighlightBorder) { - collector.addRule(`.monaco-editor .findMatch { border: 1px ${theme.type === 'hc' ? 'dotted' : 'solid'} ${findMatchHighlightBorder}; box-sizing: border-box; }`); - } - const findMatchBorder = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["editorFindMatchBorder"]); - if (findMatchBorder) { - collector.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${findMatchBorder}; padding: 1px; box-sizing: border-box; }`); - } - const findRangeHighlightBorder = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["editorFindRangeHighlightBorder"]); - if (findRangeHighlightBorder) { - collector.addRule(`.monaco-editor .findScope { border: 1px ${theme.type === 'hc' ? 'dashed' : 'solid'} ${findRangeHighlightBorder}; }`); - } - const hcBorder = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["contrastBorder"]); - if (hcBorder) { - collector.addRule(`.monaco-editor .find-widget { border: 1px solid ${hcBorder}; }`); - } - const foreground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["editorWidgetForeground"]); - if (foreground) { - collector.addRule(`.monaco-editor .find-widget { color: ${foreground}; }`); - } - const error = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["errorForeground"]); - if (error) { - collector.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${error}; }`); - } - const resizeBorderBackground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["editorWidgetResizeBorder"]); - if (resizeBorderBackground) { - collector.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${resizeBorderBackground}; }`); - } - else { - const border = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["editorWidgetBorder"]); - if (border) { - collector.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${border}; }`); - } - } - // This rule is used to override the outline color for synthetic-focus find input. - const focusOutline = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["focusBorder"]); - if (focusOutline) { - collector.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${focusOutline}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/replaceAllCommand.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/find/replaceAllCommand.js ***! - \************************************************************************************/ -/*! exports provided: ReplaceAllCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaceAllCommand", function() { return ReplaceAllCommand; }); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class ReplaceAllCommand { - constructor(editorSelection, ranges, replaceStrings) { - this._editorSelection = editorSelection; - this._ranges = ranges; - this._replaceStrings = replaceStrings; - this._trackedEditorSelectionId = null; - } - getEditOperations(model, builder) { - if (this._ranges.length > 0) { - // Collect all edit operations - let ops = []; - for (let i = 0; i < this._ranges.length; i++) { - ops.push({ - range: this._ranges[i], - text: this._replaceStrings[i] - }); - } - // Sort them in ascending order by range starts - ops.sort((o1, o2) => { - return _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"].compareRangesUsingStarts(o1.range, o2.range); - }); - // Merge operations that touch each other - let resultOps = []; - let previousOp = ops[0]; - for (let i = 1; i < ops.length; i++) { - if (previousOp.range.endLineNumber === ops[i].range.startLineNumber && previousOp.range.endColumn === ops[i].range.startColumn) { - // These operations are one after another and can be merged - previousOp.range = previousOp.range.plusRange(ops[i].range); - previousOp.text = previousOp.text + ops[i].text; - } - else { - resultOps.push(previousOp); - previousOp = ops[i]; - } - } - resultOps.push(previousOp); - for (const op of resultOps) { - builder.addEditOperation(op.range, op.text); - } - } - this._trackedEditorSelectionId = builder.trackSelection(this._editorSelection); - } - computeCursorState(model, helper) { - return helper.getTrackedSelection(this._trackedEditorSelectionId); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/replacePattern.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/find/replacePattern.js ***! - \*********************************************************************************/ -/*! exports provided: ReplacePattern, ReplacePiece, parseReplaceString */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplacePattern", function() { return ReplacePattern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplacePiece", function() { return ReplacePiece; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseReplaceString", function() { return parseReplaceString; }); -/* harmony import */ var _base_common_search_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/search.js */ "./node_modules/monaco-editor/esm/vs/base/common/search.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * Assigned when the replace pattern is entirely static. - */ -class StaticValueReplacePattern { - constructor(staticValue) { - this.staticValue = staticValue; - this.kind = 0 /* StaticValue */; - } -} -/** - * Assigned when the replace pattern has replacement patterns. - */ -class DynamicPiecesReplacePattern { - constructor(pieces) { - this.pieces = pieces; - this.kind = 1 /* DynamicPieces */; - } -} -class ReplacePattern { - constructor(pieces) { - if (!pieces || pieces.length === 0) { - this._state = new StaticValueReplacePattern(''); - } - else if (pieces.length === 1 && pieces[0].staticValue !== null) { - this._state = new StaticValueReplacePattern(pieces[0].staticValue); - } - else { - this._state = new DynamicPiecesReplacePattern(pieces); - } - } - static fromStaticValue(value) { - return new ReplacePattern([ReplacePiece.staticValue(value)]); - } - get hasReplacementPatterns() { - return (this._state.kind === 1 /* DynamicPieces */); - } - buildReplaceString(matches, preserveCase) { - if (this._state.kind === 0 /* StaticValue */) { - if (preserveCase) { - return Object(_base_common_search_js__WEBPACK_IMPORTED_MODULE_0__["buildReplaceStringWithCasePreserved"])(matches, this._state.staticValue); - } - else { - return this._state.staticValue; - } - } - let result = ''; - for (let i = 0, len = this._state.pieces.length; i < len; i++) { - let piece = this._state.pieces[i]; - if (piece.staticValue !== null) { - // static value ReplacePiece - result += piece.staticValue; - continue; - } - // match index ReplacePiece - let match = ReplacePattern._substitute(piece.matchIndex, matches); - if (piece.caseOps !== null && piece.caseOps.length > 0) { - let repl = []; - let lenOps = piece.caseOps.length; - let opIdx = 0; - for (let idx = 0, len = match.length; idx < len; idx++) { - if (opIdx >= lenOps) { - repl.push(match.slice(idx)); - break; - } - switch (piece.caseOps[opIdx]) { - case 'U': - repl.push(match[idx].toUpperCase()); - break; - case 'u': - repl.push(match[idx].toUpperCase()); - opIdx++; - break; - case 'L': - repl.push(match[idx].toLowerCase()); - break; - case 'l': - repl.push(match[idx].toLowerCase()); - opIdx++; - break; - default: - repl.push(match[idx]); - } - } - match = repl.join(''); - } - result += match; - } - return result; - } - static _substitute(matchIndex, matches) { - if (matches === null) { - return ''; - } - if (matchIndex === 0) { - return matches[0]; - } - let remainder = ''; - while (matchIndex > 0) { - if (matchIndex < matches.length) { - // A match can be undefined - let match = (matches[matchIndex] || ''); - return match + remainder; - } - remainder = String(matchIndex % 10) + remainder; - matchIndex = Math.floor(matchIndex / 10); - } - return '$' + remainder; - } -} -/** - * A replace piece can either be a static string or an index to a specific match. - */ -class ReplacePiece { - constructor(staticValue, matchIndex, caseOps) { - this.staticValue = staticValue; - this.matchIndex = matchIndex; - if (!caseOps || caseOps.length === 0) { - this.caseOps = null; - } - else { - this.caseOps = caseOps.slice(0); - } - } - static staticValue(value) { - return new ReplacePiece(value, -1, null); - } - static caseOps(index, caseOps) { - return new ReplacePiece(null, index, caseOps); - } -} -class ReplacePieceBuilder { - constructor(source) { - this._source = source; - this._lastCharIndex = 0; - this._result = []; - this._resultLen = 0; - this._currentStaticPiece = ''; - } - emitUnchanged(toCharIndex) { - this._emitStatic(this._source.substring(this._lastCharIndex, toCharIndex)); - this._lastCharIndex = toCharIndex; - } - emitStatic(value, toCharIndex) { - this._emitStatic(value); - this._lastCharIndex = toCharIndex; - } - _emitStatic(value) { - if (value.length === 0) { - return; - } - this._currentStaticPiece += value; - } - emitMatchIndex(index, toCharIndex, caseOps) { - if (this._currentStaticPiece.length !== 0) { - this._result[this._resultLen++] = ReplacePiece.staticValue(this._currentStaticPiece); - this._currentStaticPiece = ''; - } - this._result[this._resultLen++] = ReplacePiece.caseOps(index, caseOps); - this._lastCharIndex = toCharIndex; - } - finalize() { - this.emitUnchanged(this._source.length); - if (this._currentStaticPiece.length !== 0) { - this._result[this._resultLen++] = ReplacePiece.staticValue(this._currentStaticPiece); - this._currentStaticPiece = ''; - } - return new ReplacePattern(this._result); - } -} -/** - * \n => inserts a LF - * \t => inserts a TAB - * \\ => inserts a "\". - * \u => upper-cases one character in a match. - * \U => upper-cases ALL remaining characters in a match. - * \l => lower-cases one character in a match. - * \L => lower-cases ALL remaining characters in a match. - * $$ => inserts a "$". - * $& and $0 => inserts the matched substring. - * $n => Where n is a non-negative integer lesser than 100, inserts the nth parenthesized submatch string - * everything else stays untouched - * - * Also see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter - */ -function parseReplaceString(replaceString) { - if (!replaceString || replaceString.length === 0) { - return new ReplacePattern(null); - } - let caseOps = []; - let result = new ReplacePieceBuilder(replaceString); - for (let i = 0, len = replaceString.length; i < len; i++) { - let chCode = replaceString.charCodeAt(i); - if (chCode === 92 /* Backslash */) { - // move to next char - i++; - if (i >= len) { - // string ends with a \ - break; - } - let nextChCode = replaceString.charCodeAt(i); - // let replaceWithCharacter: string | null = null; - switch (nextChCode) { - case 92 /* Backslash */: - // \\ => inserts a "\" - result.emitUnchanged(i - 1); - result.emitStatic('\\', i + 1); - break; - case 110 /* n */: - // \n => inserts a LF - result.emitUnchanged(i - 1); - result.emitStatic('\n', i + 1); - break; - case 116 /* t */: - // \t => inserts a TAB - result.emitUnchanged(i - 1); - result.emitStatic('\t', i + 1); - break; - // Case modification of string replacements, patterned after Boost, but only applied - // to the replacement text, not subsequent content. - case 117 /* u */: - // \u => upper-cases one character. - case 85 /* U */: - // \U => upper-cases ALL following characters. - case 108 /* l */: - // \l => lower-cases one character. - case 76 /* L */: - // \L => lower-cases ALL following characters. - result.emitUnchanged(i - 1); - result.emitStatic('', i + 1); - caseOps.push(String.fromCharCode(nextChCode)); - break; - } - continue; - } - if (chCode === 36 /* DollarSign */) { - // move to next char - i++; - if (i >= len) { - // string ends with a $ - break; - } - let nextChCode = replaceString.charCodeAt(i); - if (nextChCode === 36 /* DollarSign */) { - // $$ => inserts a "$" - result.emitUnchanged(i - 1); - result.emitStatic('$', i + 1); - continue; - } - if (nextChCode === 48 /* Digit0 */ || nextChCode === 38 /* Ampersand */) { - // $& and $0 => inserts the matched substring. - result.emitUnchanged(i - 1); - result.emitMatchIndex(0, i + 1, caseOps); - caseOps.length = 0; - continue; - } - if (49 /* Digit1 */ <= nextChCode && nextChCode <= 57 /* Digit9 */) { - // $n - let matchIndex = nextChCode - 48 /* Digit0 */; - // peek next char to probe for $nn - if (i + 1 < len) { - let nextNextChCode = replaceString.charCodeAt(i + 1); - if (48 /* Digit0 */ <= nextNextChCode && nextNextChCode <= 57 /* Digit9 */) { - // $nn - // move to next char - i++; - matchIndex = matchIndex * 10 + (nextNextChCode - 48 /* Digit0 */); - result.emitUnchanged(i - 2); - result.emitMatchIndex(matchIndex, i + 1, caseOps); - caseOps.length = 0; - continue; - } - } - result.emitUnchanged(i - 1); - result.emitMatchIndex(matchIndex, i + 1, caseOps); - caseOps.length = 0; - continue; - } - } - } - return result.finalize(); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/folding.css": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/folding/folding.css ***! - \******************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_folding_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./folding.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/folding/folding.css"); -/* harmony import */ var _css_loader_dist_cjs_js_folding_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_folding_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_folding_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_folding_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/folding.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/folding/folding.js ***! - \*****************************************************************************/ -/*! exports provided: FoldingController, foldBackgroundBackground, editorFoldForeground */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingController", function() { return FoldingController; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "foldBackgroundBackground", function() { return foldBackgroundBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorFoldForeground", function() { return editorFoldForeground; }); -/* harmony import */ var _folding_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./folding.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/folding.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _foldingModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./foldingModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/foldingModel.js"); -/* harmony import */ var _foldingDecorations_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./foldingDecorations.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/foldingDecorations.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _hiddenRangeModel_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./hiddenRangeModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/hiddenRangeModel.js"); -/* harmony import */ var _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../common/modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/* harmony import */ var _indentRangeProvider_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./indentRangeProvider.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/indentRangeProvider.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _syntaxRangeProvider_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./syntaxRangeProvider.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/syntaxRangeProvider.js"); -/* harmony import */ var _intializingRangeProvider_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./intializingRangeProvider.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/intializingRangeProvider.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - - - - - - -const CONTEXT_FOLDING_ENABLED = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_18__["RawContextKey"]('foldingEnabled', false); -let FoldingController = class FoldingController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_6__["Disposable"] { - constructor(editor, contextKeyService) { - super(); - this.contextKeyService = contextKeyService; - this.localToDispose = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_6__["DisposableStore"]()); - this.editor = editor; - const options = this.editor.getOptions(); - this._isEnabled = options.get(31 /* folding */); - this._useFoldingProviders = options.get(32 /* foldingStrategy */) !== 'indentation'; - this._unfoldOnClickAfterEndOfLine = options.get(34 /* unfoldOnClickAfterEndOfLine */); - this.foldingModel = null; - this.hiddenRangeModel = null; - this.rangeProvider = null; - this.foldingRegionPromise = null; - this.foldingStateMemento = null; - this.foldingModelPromise = null; - this.updateScheduler = null; - this.cursorChangedScheduler = null; - this.mouseDownInfo = null; - this.foldingDecorationProvider = new _foldingDecorations_js__WEBPACK_IMPORTED_MODULE_9__["FoldingDecorationProvider"](editor); - this.foldingDecorationProvider.autoHideFoldingControls = options.get(91 /* showFoldingControls */) === 'mouseover'; - this.foldingDecorationProvider.showFoldingHighlights = options.get(33 /* foldingHighlight */); - this.foldingEnabled = CONTEXT_FOLDING_ENABLED.bindTo(this.contextKeyService); - this.foldingEnabled.set(this._isEnabled); - this._register(this.editor.onDidChangeModel(() => this.onModelChanged())); - this._register(this.editor.onDidChangeConfiguration((e) => { - if (e.hasChanged(31 /* folding */)) { - this._isEnabled = this.editor.getOptions().get(31 /* folding */); - this.foldingEnabled.set(this._isEnabled); - this.onModelChanged(); - } - if (e.hasChanged(91 /* showFoldingControls */) || e.hasChanged(33 /* foldingHighlight */)) { - const options = this.editor.getOptions(); - this.foldingDecorationProvider.autoHideFoldingControls = options.get(91 /* showFoldingControls */) === 'mouseover'; - this.foldingDecorationProvider.showFoldingHighlights = options.get(33 /* foldingHighlight */); - this.onModelContentChanged(); - } - if (e.hasChanged(32 /* foldingStrategy */)) { - this._useFoldingProviders = this.editor.getOptions().get(32 /* foldingStrategy */) !== 'indentation'; - this.onFoldingStrategyChanged(); - } - if (e.hasChanged(34 /* unfoldOnClickAfterEndOfLine */)) { - this._unfoldOnClickAfterEndOfLine = this.editor.getOptions().get(34 /* unfoldOnClickAfterEndOfLine */); - } - })); - this.onModelChanged(); - } - static get(editor) { - return editor.getContribution(FoldingController.ID); - } - /** - * Store view state. - */ - saveViewState() { - let model = this.editor.getModel(); - if (!model || !this._isEnabled || model.isTooLargeForTokenization()) { - return {}; - } - if (this.foldingModel) { // disposed ? - let collapsedRegions = this.foldingModel.isInitialized ? this.foldingModel.getMemento() : this.hiddenRangeModel.getMemento(); - let provider = this.rangeProvider ? this.rangeProvider.id : undefined; - return { collapsedRegions, lineCount: model.getLineCount(), provider }; - } - return undefined; - } - /** - * Restore view state. - */ - restoreViewState(state) { - let model = this.editor.getModel(); - if (!model || !this._isEnabled || model.isTooLargeForTokenization() || !this.hiddenRangeModel) { - return; - } - if (!state || !state.collapsedRegions || state.lineCount !== model.getLineCount()) { - return; - } - if (state.provider === _syntaxRangeProvider_js__WEBPACK_IMPORTED_MODULE_15__["ID_SYNTAX_PROVIDER"] || state.provider === _intializingRangeProvider_js__WEBPACK_IMPORTED_MODULE_16__["ID_INIT_PROVIDER"]) { - this.foldingStateMemento = state; - } - const collapsedRegions = state.collapsedRegions; - // set the hidden ranges right away, before waiting for the folding model. - if (this.hiddenRangeModel.applyMemento(collapsedRegions)) { - const foldingModel = this.getFoldingModel(); - if (foldingModel) { - foldingModel.then(foldingModel => { - if (foldingModel) { - foldingModel.applyMemento(collapsedRegions); - } - }).then(undefined, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_17__["onUnexpectedError"]); - } - } - } - onModelChanged() { - this.localToDispose.clear(); - let model = this.editor.getModel(); - if (!this._isEnabled || !model || model.isTooLargeForTokenization()) { - // huge files get no view model, so they cannot support hidden areas - return; - } - this.foldingModel = new _foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["FoldingModel"](model, this.foldingDecorationProvider); - this.localToDispose.add(this.foldingModel); - this.hiddenRangeModel = new _hiddenRangeModel_js__WEBPACK_IMPORTED_MODULE_11__["HiddenRangeModel"](this.foldingModel); - this.localToDispose.add(this.hiddenRangeModel); - this.localToDispose.add(this.hiddenRangeModel.onDidChange(hr => this.onHiddenRangesChanges(hr))); - this.updateScheduler = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_4__["Delayer"](200); - this.cursorChangedScheduler = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_4__["RunOnceScheduler"](() => this.revealCursor(), 200); - this.localToDispose.add(this.cursorChangedScheduler); - this.localToDispose.add(_common_modes_js__WEBPACK_IMPORTED_MODULE_14__["FoldingRangeProviderRegistry"].onDidChange(() => this.onFoldingStrategyChanged())); - this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(() => this.onFoldingStrategyChanged())); // covers model language changes as well - this.localToDispose.add(this.editor.onDidChangeModelContent(() => this.onModelContentChanged())); - this.localToDispose.add(this.editor.onDidChangeCursorPosition(() => this.onCursorPositionChanged())); - this.localToDispose.add(this.editor.onMouseDown(e => this.onEditorMouseDown(e))); - this.localToDispose.add(this.editor.onMouseUp(e => this.onEditorMouseUp(e))); - this.localToDispose.add({ - dispose: () => { - if (this.foldingRegionPromise) { - this.foldingRegionPromise.cancel(); - this.foldingRegionPromise = null; - } - if (this.updateScheduler) { - this.updateScheduler.cancel(); - } - this.updateScheduler = null; - this.foldingModel = null; - this.foldingModelPromise = null; - this.hiddenRangeModel = null; - this.cursorChangedScheduler = null; - this.foldingStateMemento = null; - if (this.rangeProvider) { - this.rangeProvider.dispose(); - } - this.rangeProvider = null; - } - }); - this.onModelContentChanged(); - } - onFoldingStrategyChanged() { - if (this.rangeProvider) { - this.rangeProvider.dispose(); - } - this.rangeProvider = null; - this.onModelContentChanged(); - } - getRangeProvider(editorModel) { - if (this.rangeProvider) { - return this.rangeProvider; - } - this.rangeProvider = new _indentRangeProvider_js__WEBPACK_IMPORTED_MODULE_13__["IndentRangeProvider"](editorModel); // fallback - if (this._useFoldingProviders && this.foldingModel) { - let foldingProviders = _common_modes_js__WEBPACK_IMPORTED_MODULE_14__["FoldingRangeProviderRegistry"].ordered(this.foldingModel.textModel); - if (foldingProviders.length === 0 && this.foldingStateMemento && this.foldingStateMemento.collapsedRegions) { - const rangeProvider = this.rangeProvider = new _intializingRangeProvider_js__WEBPACK_IMPORTED_MODULE_16__["InitializingRangeProvider"](editorModel, this.foldingStateMemento.collapsedRegions, () => { - // if after 30 the InitializingRangeProvider is still not replaced, force a refresh - this.foldingStateMemento = null; - this.onFoldingStrategyChanged(); - }, 30000); - return rangeProvider; // keep memento in case there are still no foldingProviders on the next request. - } - else if (foldingProviders.length > 0) { - this.rangeProvider = new _syntaxRangeProvider_js__WEBPACK_IMPORTED_MODULE_15__["SyntaxRangeProvider"](editorModel, foldingProviders); - } - } - this.foldingStateMemento = null; - return this.rangeProvider; - } - getFoldingModel() { - return this.foldingModelPromise; - } - onModelContentChanged() { - if (this.updateScheduler) { - if (this.foldingRegionPromise) { - this.foldingRegionPromise.cancel(); - this.foldingRegionPromise = null; - } - this.foldingModelPromise = this.updateScheduler.trigger(() => { - const foldingModel = this.foldingModel; - if (!foldingModel) { // null if editor has been disposed, or folding turned off - return null; - } - let foldingRegionPromise = this.foldingRegionPromise = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_4__["createCancelablePromise"])(token => this.getRangeProvider(foldingModel.textModel).compute(token)); - return foldingRegionPromise.then(foldingRanges => { - if (foldingRanges && foldingRegionPromise === this.foldingRegionPromise) { // new request or cancelled in the meantime? - // some cursors might have moved into hidden regions, make sure they are in expanded regions - let selections = this.editor.getSelections(); - let selectionLineNumbers = selections ? selections.map(s => s.startLineNumber) : []; - foldingModel.update(foldingRanges, selectionLineNumbers); - } - return foldingModel; - }); - }).then(undefined, (err) => { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_17__["onUnexpectedError"])(err); - return null; - }); - } - } - onHiddenRangesChanges(hiddenRanges) { - if (this.hiddenRangeModel && hiddenRanges.length) { - let selections = this.editor.getSelections(); - if (selections) { - if (this.hiddenRangeModel.adjustSelections(selections)) { - this.editor.setSelections(selections); - } - } - } - this.editor.setHiddenAreas(hiddenRanges); - } - onCursorPositionChanged() { - if (this.hiddenRangeModel && this.hiddenRangeModel.hasRanges()) { - this.cursorChangedScheduler.schedule(); - } - } - revealCursor() { - const foldingModel = this.getFoldingModel(); - if (!foldingModel) { - return; - } - foldingModel.then(foldingModel => { - if (foldingModel) { - let selections = this.editor.getSelections(); - if (selections && selections.length > 0) { - let toToggle = []; - for (let selection of selections) { - let lineNumber = selection.selectionStartLineNumber; - if (this.hiddenRangeModel && this.hiddenRangeModel.isHidden(lineNumber)) { - toToggle.push(...foldingModel.getAllRegionsAtLine(lineNumber, r => r.isCollapsed && lineNumber > r.startLineNumber)); - } - } - if (toToggle.length) { - foldingModel.toggleCollapseState(toToggle); - this.reveal(selections[0].getPosition()); - } - } - } - }).then(undefined, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_17__["onUnexpectedError"]); - } - onEditorMouseDown(e) { - this.mouseDownInfo = null; - if (!this.hiddenRangeModel || !e.target || !e.target.range) { - return; - } - if (!e.event.leftButton && !e.event.middleButton) { - return; - } - const range = e.target.range; - let iconClicked = false; - switch (e.target.type) { - case 4 /* GUTTER_LINE_DECORATIONS */: - const data = e.target.detail; - const offsetLeftInGutter = e.target.element.offsetLeft; - const gutterOffsetX = data.offsetX - offsetLeftInGutter; - // const gutterOffsetX = data.offsetX - data.glyphMarginWidth - data.lineNumbersWidth - data.glyphMarginLeft; - // TODO@joao TODO@alex TODO@martin this is such that we don't collide with dirty diff - if (gutterOffsetX < 5) { // the whitespace between the border and the real folding icon border is 5px - return; - } - iconClicked = true; - break; - case 7 /* CONTENT_EMPTY */: { - if (this._unfoldOnClickAfterEndOfLine && this.hiddenRangeModel.hasRanges()) { - const data = e.target.detail; - if (!data.isAfterLines) { - break; - } - } - return; - } - case 6 /* CONTENT_TEXT */: { - if (this.hiddenRangeModel.hasRanges()) { - let model = this.editor.getModel(); - if (model && range.startColumn === model.getLineMaxColumn(range.startLineNumber)) { - break; - } - } - return; - } - default: - return; - } - this.mouseDownInfo = { lineNumber: range.startLineNumber, iconClicked }; - } - onEditorMouseUp(e) { - const foldingModel = this.getFoldingModel(); - if (!foldingModel || !this.mouseDownInfo || !e.target) { - return; - } - let lineNumber = this.mouseDownInfo.lineNumber; - let iconClicked = this.mouseDownInfo.iconClicked; - let range = e.target.range; - if (!range || range.startLineNumber !== lineNumber) { - return; - } - if (iconClicked) { - if (e.target.type !== 4 /* GUTTER_LINE_DECORATIONS */) { - return; - } - } - else { - let model = this.editor.getModel(); - if (!model || range.startColumn !== model.getLineMaxColumn(lineNumber)) { - return; - } - } - foldingModel.then(foldingModel => { - if (foldingModel) { - let region = foldingModel.getRegionAtLine(lineNumber); - if (region && region.startLineNumber === lineNumber) { - let isCollapsed = region.isCollapsed; - if (iconClicked || isCollapsed) { - let toToggle = []; - let recursive = e.event.middleButton || e.event.shiftKey; - if (recursive) { - for (const r of foldingModel.getRegionsInside(region)) { - if (r.isCollapsed === isCollapsed) { - toToggle.push(r); - } - } - } - // when recursive, first only collapse all children. If all are already folded or there are no children, also fold parent. - if (isCollapsed || !recursive || toToggle.length === 0) { - toToggle.push(region); - } - foldingModel.toggleCollapseState(toToggle); - this.reveal({ lineNumber, column: 1 }); - } - } - } - }).then(undefined, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_17__["onUnexpectedError"]); - } - reveal(position) { - this.editor.revealPositionInCenterIfOutsideViewport(position, 0 /* Smooth */); - } -}; -FoldingController.ID = 'editor.contrib.folding'; -FoldingController = __decorate([ - __param(1, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_18__["IContextKeyService"]) -], FoldingController); - -class FoldingAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["EditorAction"] { - runEditorCommand(accessor, editor, args) { - let foldingController = FoldingController.get(editor); - if (!foldingController) { - return; - } - let foldingModelPromise = foldingController.getFoldingModel(); - if (foldingModelPromise) { - this.reportTelemetry(accessor, editor); - return foldingModelPromise.then(foldingModel => { - if (foldingModel) { - this.invoke(foldingController, foldingModel, editor, args); - const selection = editor.getSelection(); - if (selection) { - foldingController.reveal(selection.getStartPosition()); - } - } - }); - } - } - getSelectedLines(editor) { - let selections = editor.getSelections(); - return selections ? selections.map(s => s.startLineNumber) : []; - } - getLineNumbers(args, editor) { - if (args && args.selectionLines) { - return args.selectionLines.map(l => l + 1); // to 0-bases line numbers - } - return this.getSelectedLines(editor); - } - run(_accessor, _editor) { - } -} -function foldingArgumentsConstraint(args) { - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isUndefined"](args)) { - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isObject"](args)) { - return false; - } - const foldingArgs = args; - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isUndefined"](foldingArgs.levels) && !_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isNumber"](foldingArgs.levels)) { - return false; - } - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isUndefined"](foldingArgs.direction) && !_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isString"](foldingArgs.direction)) { - return false; - } - if (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isUndefined"](foldingArgs.selectionLines) && (!_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isArray"](foldingArgs.selectionLines) || !foldingArgs.selectionLines.every(_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isNumber"]))) { - return false; - } - } - return true; -} -class UnfoldAction extends FoldingAction { - constructor() { - super({ - id: 'editor.unfold', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('unfoldAction.label', "Unfold"), - alias: 'Unfold', - precondition: CONTEXT_FOLDING_ENABLED, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_10__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 89 /* US_CLOSE_SQUARE_BRACKET */, - mac: { - primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 89 /* US_CLOSE_SQUARE_BRACKET */ - }, - weight: 100 /* EditorContrib */ - }, - description: { - description: 'Unfold the content in the editor', - args: [ - { - name: 'Unfold editor argument', - description: `Property-value pairs that can be passed through this argument: - * 'levels': Number of levels to unfold. If not set, defaults to 1. - * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. - * 'selectionLines': The start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. - `, - constraint: foldingArgumentsConstraint, - schema: { - 'type': 'object', - 'properties': { - 'levels': { - 'type': 'number', - 'default': 1 - }, - 'direction': { - 'type': 'string', - 'enum': ['up', 'down'], - 'default': 'down' - }, - 'selectionLines': { - 'type': 'array', - 'items': { - 'type': 'number' - } - } - } - } - } - ] - } - }); - } - invoke(_foldingController, foldingModel, editor, args) { - let levels = args && args.levels || 1; - let lineNumbers = this.getLineNumbers(args, editor); - if (args && args.direction === 'up') { - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateLevelsUp"])(foldingModel, false, levels, lineNumbers); - } - else { - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateLevelsDown"])(foldingModel, false, levels, lineNumbers); - } - } -} -class UnFoldRecursivelyAction extends FoldingAction { - constructor() { - super({ - id: 'editor.unfoldRecursively', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('unFoldRecursivelyAction.label', "Unfold Recursively"), - alias: 'Unfold Recursively', - precondition: CONTEXT_FOLDING_ENABLED, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_10__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 89 /* US_CLOSE_SQUARE_BRACKET */), - weight: 100 /* EditorContrib */ - } - }); - } - invoke(_foldingController, foldingModel, editor, _args) { - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateLevelsDown"])(foldingModel, false, Number.MAX_VALUE, this.getSelectedLines(editor)); - } -} -class FoldAction extends FoldingAction { - constructor() { - super({ - id: 'editor.fold', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('foldAction.label', "Fold"), - alias: 'Fold', - precondition: CONTEXT_FOLDING_ENABLED, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_10__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 87 /* US_OPEN_SQUARE_BRACKET */, - mac: { - primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 87 /* US_OPEN_SQUARE_BRACKET */ - }, - weight: 100 /* EditorContrib */ - }, - description: { - description: 'Fold the content in the editor', - args: [ - { - name: 'Fold editor argument', - description: `Property-value pairs that can be passed through this argument: - * 'levels': Number of levels to fold. - * 'direction': If 'up', folds given number of levels up otherwise folds down. - * 'selectionLines': The start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. - If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. - `, - constraint: foldingArgumentsConstraint, - schema: { - 'type': 'object', - 'properties': { - 'levels': { - 'type': 'number', - }, - 'direction': { - 'type': 'string', - 'enum': ['up', 'down'], - }, - 'selectionLines': { - 'type': 'array', - 'items': { - 'type': 'number' - } - } - } - } - } - ] - } - }); - } - invoke(_foldingController, foldingModel, editor, args) { - let lineNumbers = this.getLineNumbers(args, editor); - const levels = args && args.levels; - const direction = args && args.direction; - if (typeof levels !== 'number' && typeof direction !== 'string') { - // fold the region at the location or if already collapsed, the first uncollapsed parent instead. - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateUp"])(foldingModel, true, lineNumbers); - } - else { - if (direction === 'up') { - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateLevelsUp"])(foldingModel, true, levels || 1, lineNumbers); - } - else { - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateLevelsDown"])(foldingModel, true, levels || 1, lineNumbers); - } - } - } -} -class ToggleFoldAction extends FoldingAction { - constructor() { - super({ - id: 'editor.toggleFold', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('toggleFoldAction.label', "Toggle Fold"), - alias: 'Toggle Fold', - precondition: CONTEXT_FOLDING_ENABLED, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_10__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 42 /* KEY_L */), - weight: 100 /* EditorContrib */ - } - }); - } - invoke(_foldingController, foldingModel, editor) { - let selectedLines = this.getSelectedLines(editor); - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["toggleCollapseState"])(foldingModel, 1, selectedLines); - } -} -class FoldRecursivelyAction extends FoldingAction { - constructor() { - super({ - id: 'editor.foldRecursively', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('foldRecursivelyAction.label', "Fold Recursively"), - alias: 'Fold Recursively', - precondition: CONTEXT_FOLDING_ENABLED, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_10__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 87 /* US_OPEN_SQUARE_BRACKET */), - weight: 100 /* EditorContrib */ - } - }); - } - invoke(_foldingController, foldingModel, editor) { - let selectedLines = this.getSelectedLines(editor); - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateLevelsDown"])(foldingModel, true, Number.MAX_VALUE, selectedLines); - } -} -class FoldAllBlockCommentsAction extends FoldingAction { - constructor() { - super({ - id: 'editor.foldAllBlockComments', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('foldAllBlockComments.label', "Fold All Block Comments"), - alias: 'Fold All Block Comments', - precondition: CONTEXT_FOLDING_ENABLED, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_10__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 85 /* US_SLASH */), - weight: 100 /* EditorContrib */ - } - }); - } - invoke(_foldingController, foldingModel, editor) { - if (foldingModel.regions.hasTypes()) { - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateForType"])(foldingModel, _common_modes_js__WEBPACK_IMPORTED_MODULE_14__["FoldingRangeKind"].Comment.value, true); - } - else { - const editorModel = editor.getModel(); - if (!editorModel) { - return; - } - let comments = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_12__["LanguageConfigurationRegistry"].getComments(editorModel.getLanguageIdentifier().id); - if (comments && comments.blockCommentStartToken) { - let regExp = new RegExp('^\\s*' + Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["escapeRegExpCharacters"])(comments.blockCommentStartToken)); - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateForMatchingLines"])(foldingModel, regExp, true); - } - } - } -} -class FoldAllRegionsAction extends FoldingAction { - constructor() { - super({ - id: 'editor.foldAllMarkerRegions', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('foldAllMarkerRegions.label', "Fold All Regions"), - alias: 'Fold All Regions', - precondition: CONTEXT_FOLDING_ENABLED, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_10__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 29 /* KEY_8 */), - weight: 100 /* EditorContrib */ - } - }); - } - invoke(_foldingController, foldingModel, editor) { - if (foldingModel.regions.hasTypes()) { - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateForType"])(foldingModel, _common_modes_js__WEBPACK_IMPORTED_MODULE_14__["FoldingRangeKind"].Region.value, true); - } - else { - const editorModel = editor.getModel(); - if (!editorModel) { - return; - } - let foldingRules = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_12__["LanguageConfigurationRegistry"].getFoldingRules(editorModel.getLanguageIdentifier().id); - if (foldingRules && foldingRules.markers && foldingRules.markers.start) { - let regExp = new RegExp(foldingRules.markers.start); - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateForMatchingLines"])(foldingModel, regExp, true); - } - } - } -} -class UnfoldAllRegionsAction extends FoldingAction { - constructor() { - super({ - id: 'editor.unfoldAllMarkerRegions', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('unfoldAllMarkerRegions.label', "Unfold All Regions"), - alias: 'Unfold All Regions', - precondition: CONTEXT_FOLDING_ENABLED, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_10__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 30 /* KEY_9 */), - weight: 100 /* EditorContrib */ - } - }); - } - invoke(_foldingController, foldingModel, editor) { - if (foldingModel.regions.hasTypes()) { - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateForType"])(foldingModel, _common_modes_js__WEBPACK_IMPORTED_MODULE_14__["FoldingRangeKind"].Region.value, false); - } - else { - const editorModel = editor.getModel(); - if (!editorModel) { - return; - } - let foldingRules = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_12__["LanguageConfigurationRegistry"].getFoldingRules(editorModel.getLanguageIdentifier().id); - if (foldingRules && foldingRules.markers && foldingRules.markers.start) { - let regExp = new RegExp(foldingRules.markers.start); - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateForMatchingLines"])(foldingModel, regExp, false); - } - } - } -} -class FoldAllAction extends FoldingAction { - constructor() { - super({ - id: 'editor.foldAll', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('foldAllAction.label', "Fold All"), - alias: 'Fold All', - precondition: CONTEXT_FOLDING_ENABLED, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_10__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 21 /* KEY_0 */), - weight: 100 /* EditorContrib */ - } - }); - } - invoke(_foldingController, foldingModel, _editor) { - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateLevelsDown"])(foldingModel, true); - } -} -class UnfoldAllAction extends FoldingAction { - constructor() { - super({ - id: 'editor.unfoldAll', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('unfoldAllAction.label', "Unfold All"), - alias: 'Unfold All', - precondition: CONTEXT_FOLDING_ENABLED, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_10__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 40 /* KEY_J */), - weight: 100 /* EditorContrib */ - } - }); - } - invoke(_foldingController, foldingModel, _editor) { - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateLevelsDown"])(foldingModel, false); - } -} -class FoldLevelAction extends FoldingAction { - getFoldingLevel() { - return parseInt(this.id.substr(FoldLevelAction.ID_PREFIX.length)); - } - invoke(_foldingController, foldingModel, editor) { - Object(_foldingModel_js__WEBPACK_IMPORTED_MODULE_8__["setCollapseStateAtLevel"])(foldingModel, this.getFoldingLevel(), true, this.getSelectedLines(editor)); - } -} -FoldLevelAction.ID_PREFIX = 'editor.foldLevel'; -FoldLevelAction.ID = (level) => FoldLevelAction.ID_PREFIX + level; -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorContribution"])(FoldingController.ID, FoldingController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorAction"])(UnfoldAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorAction"])(UnFoldRecursivelyAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorAction"])(FoldAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorAction"])(FoldRecursivelyAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorAction"])(FoldAllAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorAction"])(UnfoldAllAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorAction"])(FoldAllBlockCommentsAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorAction"])(FoldAllRegionsAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorAction"])(UnfoldAllRegionsAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorAction"])(ToggleFoldAction); -for (let i = 1; i <= 7; i++) { - Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerInstantiatedEditorAction"])(new FoldLevelAction({ - id: FoldLevelAction.ID(i), - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('foldLevelAction.label', "Fold Level {0}", i), - alias: `Fold Level ${i}`, - precondition: CONTEXT_FOLDING_ENABLED, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_10__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_5__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | (21 /* KEY_0 */ + i)), - weight: 100 /* EditorContrib */ - } - })); -} -const foldBackgroundBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_20__["registerColor"])('editor.foldBackground', { light: Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_20__["transparent"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_20__["editorSelectionBackground"], 0.3), dark: Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_20__["transparent"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_20__["editorSelectionBackground"], 0.3), hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('foldBackgroundBackground', "Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."), true); -const editorFoldForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_20__["registerColor"])('editorGutter.foldingControlForeground', { dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_20__["iconForeground"], light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_20__["iconForeground"], hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_20__["iconForeground"] }, _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('editorGutter.foldingControlForeground', 'Color of the folding control in the editor gutter.')); -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_19__["registerThemingParticipant"])((theme, collector) => { - const foldBackground = theme.getColor(foldBackgroundBackground); - if (foldBackground) { - collector.addRule(`.monaco-editor .folded-background { background-color: ${foldBackground}; }`); - } - const editorFoldColor = theme.getColor(editorFoldForeground); - if (editorFoldColor) { - collector.addRule(` - .monaco-editor .cldr${_foldingDecorations_js__WEBPACK_IMPORTED_MODULE_9__["foldingExpandedIcon"].cssSelector}, - .monaco-editor .cldr${_foldingDecorations_js__WEBPACK_IMPORTED_MODULE_9__["foldingCollapsedIcon"].cssSelector} { - color: ${editorFoldColor} !important; - } - `); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/foldingDecorations.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/folding/foldingDecorations.js ***! - \****************************************************************************************/ -/*! exports provided: foldingExpandedIcon, foldingCollapsedIcon, FoldingDecorationProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "foldingExpandedIcon", function() { return foldingExpandedIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "foldingCollapsedIcon", function() { return foldingCollapsedIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingDecorationProvider", function() { return FoldingDecorationProvider; }); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -const foldingExpandedIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__["registerIcon"])('folding-expanded', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__["Codicon"].chevronDown); -const foldingCollapsedIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__["registerIcon"])('folding-collapsed', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__["Codicon"].chevronRight); -class FoldingDecorationProvider { - constructor(editor) { - this.editor = editor; - this.autoHideFoldingControls = true; - this.showFoldingHighlights = true; - } - getDecorationOption(isCollapsed, isHidden) { - if (isHidden) { - return FoldingDecorationProvider.HIDDEN_RANGE_DECORATION; - } - if (isCollapsed) { - return this.showFoldingHighlights ? FoldingDecorationProvider.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION : FoldingDecorationProvider.COLLAPSED_VISUAL_DECORATION; - } - else if (this.autoHideFoldingControls) { - return FoldingDecorationProvider.EXPANDED_AUTO_HIDE_VISUAL_DECORATION; - } - else { - return FoldingDecorationProvider.EXPANDED_VISUAL_DECORATION; - } - } - deltaDecorations(oldDecorations, newDecorations) { - return this.editor.deltaDecorations(oldDecorations, newDecorations); - } - changeDecorations(callback) { - return this.editor.changeDecorations(callback); - } -} -FoldingDecorationProvider.COLLAPSED_VISUAL_DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_0__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - afterContentClassName: 'inline-folded', - isWholeLine: true, - firstLineDecorationClassName: foldingCollapsedIcon.classNames -}); -FoldingDecorationProvider.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_0__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - afterContentClassName: 'inline-folded', - className: 'folded-background', - isWholeLine: true, - firstLineDecorationClassName: foldingCollapsedIcon.classNames -}); -FoldingDecorationProvider.EXPANDED_AUTO_HIDE_VISUAL_DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_0__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - isWholeLine: true, - firstLineDecorationClassName: foldingExpandedIcon.classNames -}); -FoldingDecorationProvider.EXPANDED_VISUAL_DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_0__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - isWholeLine: true, - firstLineDecorationClassName: 'alwaysShowFoldIcons ' + foldingExpandedIcon.classNames -}); -FoldingDecorationProvider.HIDDEN_RANGE_DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_0__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */ -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/foldingModel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/folding/foldingModel.js ***! - \**********************************************************************************/ -/*! exports provided: FoldingModel, toggleCollapseState, setCollapseStateLevelsDown, setCollapseStateLevelsUp, setCollapseStateUp, setCollapseStateAtLevel, setCollapseStateForMatchingLines, setCollapseStateForType */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingModel", function() { return FoldingModel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleCollapseState", function() { return toggleCollapseState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCollapseStateLevelsDown", function() { return setCollapseStateLevelsDown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCollapseStateLevelsUp", function() { return setCollapseStateLevelsUp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCollapseStateUp", function() { return setCollapseStateUp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCollapseStateAtLevel", function() { return setCollapseStateAtLevel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCollapseStateForMatchingLines", function() { return setCollapseStateForMatchingLines; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCollapseStateForType", function() { return setCollapseStateForType; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _foldingRanges_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foldingRanges.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/foldingRanges.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class FoldingModel { - constructor(textModel, decorationProvider) { - this._updateEventEmitter = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this.onDidChange = this._updateEventEmitter.event; - this._textModel = textModel; - this._decorationProvider = decorationProvider; - this._regions = new _foldingRanges_js__WEBPACK_IMPORTED_MODULE_1__["FoldingRegions"](new Uint32Array(0), new Uint32Array(0)); - this._editorDecorationIds = []; - this._isInitialized = false; - } - get regions() { return this._regions; } - get textModel() { return this._textModel; } - get isInitialized() { return this._isInitialized; } - toggleCollapseState(toggledRegions) { - if (!toggledRegions.length) { - return; - } - toggledRegions = toggledRegions.sort((r1, r2) => r1.regionIndex - r2.regionIndex); - const processed = {}; - this._decorationProvider.changeDecorations(accessor => { - let k = 0; // index from [0 ... this.regions.length] - let dirtyRegionEndLine = -1; // end of the range where decorations need to be updated - let lastHiddenLine = -1; // the end of the last hidden lines - const updateDecorationsUntil = (index) => { - while (k < index) { - const endLineNumber = this._regions.getEndLineNumber(k); - const isCollapsed = this._regions.isCollapsed(k); - if (endLineNumber <= dirtyRegionEndLine) { - accessor.changeDecorationOptions(this._editorDecorationIds[k], this._decorationProvider.getDecorationOption(isCollapsed, endLineNumber <= lastHiddenLine)); - } - if (isCollapsed && endLineNumber > lastHiddenLine) { - lastHiddenLine = endLineNumber; - } - k++; - } - }; - for (let region of toggledRegions) { - let index = region.regionIndex; - let editorDecorationId = this._editorDecorationIds[index]; - if (editorDecorationId && !processed[editorDecorationId]) { - processed[editorDecorationId] = true; - updateDecorationsUntil(index); // update all decorations up to current index using the old dirtyRegionEndLine - let newCollapseState = !this._regions.isCollapsed(index); - this._regions.setCollapsed(index, newCollapseState); - dirtyRegionEndLine = Math.max(dirtyRegionEndLine, this._regions.getEndLineNumber(index)); - } - } - updateDecorationsUntil(this._regions.length); - }); - this._updateEventEmitter.fire({ model: this, collapseStateChanged: toggledRegions }); - } - update(newRegions, blockedLineNumers = []) { - let newEditorDecorations = []; - let isBlocked = (startLineNumber, endLineNumber) => { - for (let blockedLineNumber of blockedLineNumers) { - if (startLineNumber < blockedLineNumber && blockedLineNumber <= endLineNumber) { // first line is visible - return true; - } - } - return false; - }; - let lastHiddenLine = -1; - let initRange = (index, isCollapsed) => { - const startLineNumber = newRegions.getStartLineNumber(index); - const endLineNumber = newRegions.getEndLineNumber(index); - if (isCollapsed && isBlocked(startLineNumber, endLineNumber)) { - isCollapsed = false; - } - newRegions.setCollapsed(index, isCollapsed); - const maxColumn = this._textModel.getLineMaxColumn(startLineNumber); - const decorationRange = { - startLineNumber: startLineNumber, - startColumn: maxColumn, - endLineNumber: startLineNumber, - endColumn: maxColumn - }; - newEditorDecorations.push({ range: decorationRange, options: this._decorationProvider.getDecorationOption(isCollapsed, endLineNumber <= lastHiddenLine) }); - if (isCollapsed && endLineNumber > lastHiddenLine) { - lastHiddenLine = endLineNumber; - } - }; - let i = 0; - let nextCollapsed = () => { - while (i < this._regions.length) { - let isCollapsed = this._regions.isCollapsed(i); - i++; - if (isCollapsed) { - return i - 1; - } - } - return -1; - }; - let k = 0; - let collapsedIndex = nextCollapsed(); - while (collapsedIndex !== -1 && k < newRegions.length) { - // get the latest range - let decRange = this._textModel.getDecorationRange(this._editorDecorationIds[collapsedIndex]); - if (decRange) { - let collapsedStartLineNumber = decRange.startLineNumber; - if (this._textModel.getLineMaxColumn(collapsedStartLineNumber) === decRange.startColumn) { // test that the decoration is still at the end otherwise it got deleted - while (k < newRegions.length) { - let startLineNumber = newRegions.getStartLineNumber(k); - if (collapsedStartLineNumber >= startLineNumber) { - initRange(k, collapsedStartLineNumber === startLineNumber); - k++; - } - else { - break; - } - } - } - } - collapsedIndex = nextCollapsed(); - } - while (k < newRegions.length) { - initRange(k, false); - k++; - } - this._editorDecorationIds = this._decorationProvider.deltaDecorations(this._editorDecorationIds, newEditorDecorations); - this._regions = newRegions; - this._isInitialized = true; - this._updateEventEmitter.fire({ model: this }); - } - /** - * Collapse state memento, for persistence only - */ - getMemento() { - let collapsedRanges = []; - for (let i = 0; i < this._regions.length; i++) { - if (this._regions.isCollapsed(i)) { - let range = this._textModel.getDecorationRange(this._editorDecorationIds[i]); - if (range) { - let startLineNumber = range.startLineNumber; - let endLineNumber = range.endLineNumber + this._regions.getEndLineNumber(i) - this._regions.getStartLineNumber(i); - collapsedRanges.push({ startLineNumber, endLineNumber }); - } - } - } - if (collapsedRanges.length > 0) { - return collapsedRanges; - } - return undefined; - } - /** - * Apply persisted state, for persistence only - */ - applyMemento(state) { - if (!Array.isArray(state)) { - return; - } - let toToogle = []; - for (let range of state) { - let region = this.getRegionAtLine(range.startLineNumber); - if (region && !region.isCollapsed) { - toToogle.push(region); - } - } - this.toggleCollapseState(toToogle); - } - dispose() { - this._decorationProvider.deltaDecorations(this._editorDecorationIds, []); - } - getAllRegionsAtLine(lineNumber, filter) { - let result = []; - if (this._regions) { - let index = this._regions.findRange(lineNumber); - let level = 1; - while (index >= 0) { - let current = this._regions.toRegion(index); - if (!filter || filter(current, level)) { - result.push(current); - } - level++; - index = current.parentIndex; - } - } - return result; - } - getRegionAtLine(lineNumber) { - if (this._regions) { - let index = this._regions.findRange(lineNumber); - if (index >= 0) { - return this._regions.toRegion(index); - } - } - return null; - } - getRegionsInside(region, filter) { - let result = []; - let index = region ? region.regionIndex + 1 : 0; - let endLineNumber = region ? region.endLineNumber : Number.MAX_VALUE; - if (filter && filter.length === 2) { - const levelStack = []; - for (let i = index, len = this._regions.length; i < len; i++) { - let current = this._regions.toRegion(i); - if (this._regions.getStartLineNumber(i) < endLineNumber) { - while (levelStack.length > 0 && !current.containedBy(levelStack[levelStack.length - 1])) { - levelStack.pop(); - } - levelStack.push(current); - if (filter(current, levelStack.length)) { - result.push(current); - } - } - else { - break; - } - } - } - else { - for (let i = index, len = this._regions.length; i < len; i++) { - let current = this._regions.toRegion(i); - if (this._regions.getStartLineNumber(i) < endLineNumber) { - if (!filter || filter(current)) { - result.push(current); - } - } - else { - break; - } - } - } - return result; - } -} -/** - * Collapse or expand the regions at the given locations - * @param levels The number of levels. Use 1 to only impact the regions at the location, use Number.MAX_VALUE for all levels. - * @param lineNumbers the location of the regions to collapse or expand, or if not set, all regions in the model. - */ -function toggleCollapseState(foldingModel, levels, lineNumbers) { - let toToggle = []; - for (let lineNumber of lineNumbers) { - let region = foldingModel.getRegionAtLine(lineNumber); - if (region) { - const doCollapse = !region.isCollapsed; - toToggle.push(region); - if (levels > 1) { - let regionsInside = foldingModel.getRegionsInside(region, (r, level) => r.isCollapsed !== doCollapse && level < levels); - toToggle.push(...regionsInside); - } - } - } - foldingModel.toggleCollapseState(toToggle); -} -/** - * Collapse or expand the regions at the given locations including all children. - * @param doCollapse Wheter to collase or expand - * @param levels The number of levels. Use 1 to only impact the regions at the location, use Number.MAX_VALUE for all levels. - * @param lineNumbers the location of the regions to collapse or expand, or if not set, all regions in the model. - */ -function setCollapseStateLevelsDown(foldingModel, doCollapse, levels = Number.MAX_VALUE, lineNumbers) { - let toToggle = []; - if (lineNumbers && lineNumbers.length > 0) { - for (let lineNumber of lineNumbers) { - let region = foldingModel.getRegionAtLine(lineNumber); - if (region) { - if (region.isCollapsed !== doCollapse) { - toToggle.push(region); - } - if (levels > 1) { - let regionsInside = foldingModel.getRegionsInside(region, (r, level) => r.isCollapsed !== doCollapse && level < levels); - toToggle.push(...regionsInside); - } - } - } - } - else { - let regionsInside = foldingModel.getRegionsInside(null, (r, level) => r.isCollapsed !== doCollapse && level < levels); - toToggle.push(...regionsInside); - } - foldingModel.toggleCollapseState(toToggle); -} -/** - * Collapse or expand the regions at the given locations including all parents. - * @param doCollapse Wheter to collase or expand - * @param levels The number of levels. Use 1 to only impact the regions at the location, use Number.MAX_VALUE for all levels. - * @param lineNumbers the location of the regions to collapse or expand. - */ -function setCollapseStateLevelsUp(foldingModel, doCollapse, levels, lineNumbers) { - let toToggle = []; - for (let lineNumber of lineNumbers) { - let regions = foldingModel.getAllRegionsAtLine(lineNumber, (region, level) => region.isCollapsed !== doCollapse && level <= levels); - toToggle.push(...regions); - } - foldingModel.toggleCollapseState(toToggle); -} -/** - * Collapse or expand a region at the given locations. If the inner most region is already collapsed/expanded, uses the first parent instead. - * @param doCollapse Wheter to collase or expand - * @param lineNumbers the location of the regions to collapse or expand. - */ -function setCollapseStateUp(foldingModel, doCollapse, lineNumbers) { - let toToggle = []; - for (let lineNumber of lineNumbers) { - let regions = foldingModel.getAllRegionsAtLine(lineNumber, (region) => region.isCollapsed !== doCollapse); - if (regions.length > 0) { - toToggle.push(regions[0]); - } - } - foldingModel.toggleCollapseState(toToggle); -} -/** - * Folds or unfolds all regions that have a given level, except if they contain one of the blocked lines. - * @param foldLevel level. Level == 1 is the top level - * @param doCollapse Wheter to collase or expand -*/ -function setCollapseStateAtLevel(foldingModel, foldLevel, doCollapse, blockedLineNumbers) { - let filter = (region, level) => level === foldLevel && region.isCollapsed !== doCollapse && !blockedLineNumbers.some(line => region.containsLine(line)); - let toToggle = foldingModel.getRegionsInside(null, filter); - foldingModel.toggleCollapseState(toToggle); -} -/** - * Folds all regions for which the lines start with a given regex - * @param foldingModel the folding model - */ -function setCollapseStateForMatchingLines(foldingModel, regExp, doCollapse) { - let editorModel = foldingModel.textModel; - let regions = foldingModel.regions; - let toToggle = []; - for (let i = regions.length - 1; i >= 0; i--) { - if (doCollapse !== regions.isCollapsed(i)) { - let startLineNumber = regions.getStartLineNumber(i); - if (regExp.test(editorModel.getLineContent(startLineNumber))) { - toToggle.push(regions.toRegion(i)); - } - } - } - foldingModel.toggleCollapseState(toToggle); -} -/** - * Folds all regions of the given type - * @param foldingModel the folding model - */ -function setCollapseStateForType(foldingModel, type, doCollapse) { - let regions = foldingModel.regions; - let toToggle = []; - for (let i = regions.length - 1; i >= 0; i--) { - if (doCollapse !== regions.isCollapsed(i) && type === regions.getType(i)) { - toToggle.push(regions.toRegion(i)); - } - } - foldingModel.toggleCollapseState(toToggle); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/foldingRanges.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/folding/foldingRanges.js ***! - \***********************************************************************************/ -/*! exports provided: MAX_FOLDING_REGIONS, MAX_LINE_NUMBER, FoldingRegions, FoldingRegion */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAX_FOLDING_REGIONS", function() { return MAX_FOLDING_REGIONS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAX_LINE_NUMBER", function() { return MAX_LINE_NUMBER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRegions", function() { return FoldingRegions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRegion", function() { return FoldingRegion; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -const MAX_FOLDING_REGIONS = 0xFFFF; -const MAX_LINE_NUMBER = 0xFFFFFF; -const MASK_INDENT = 0xFF000000; -class FoldingRegions { - constructor(startIndexes, endIndexes, types) { - if (startIndexes.length !== endIndexes.length || startIndexes.length > MAX_FOLDING_REGIONS) { - throw new Error('invalid startIndexes or endIndexes size'); - } - this._startIndexes = startIndexes; - this._endIndexes = endIndexes; - this._collapseStates = new Uint32Array(Math.ceil(startIndexes.length / 32)); - this._types = types; - this._parentsComputed = false; - } - ensureParentIndices() { - if (!this._parentsComputed) { - this._parentsComputed = true; - let parentIndexes = []; - let isInsideLast = (startLineNumber, endLineNumber) => { - let index = parentIndexes[parentIndexes.length - 1]; - return this.getStartLineNumber(index) <= startLineNumber && this.getEndLineNumber(index) >= endLineNumber; - }; - for (let i = 0, len = this._startIndexes.length; i < len; i++) { - let startLineNumber = this._startIndexes[i]; - let endLineNumber = this._endIndexes[i]; - if (startLineNumber > MAX_LINE_NUMBER || endLineNumber > MAX_LINE_NUMBER) { - throw new Error('startLineNumber or endLineNumber must not exceed ' + MAX_LINE_NUMBER); - } - while (parentIndexes.length > 0 && !isInsideLast(startLineNumber, endLineNumber)) { - parentIndexes.pop(); - } - let parentIndex = parentIndexes.length > 0 ? parentIndexes[parentIndexes.length - 1] : -1; - parentIndexes.push(i); - this._startIndexes[i] = startLineNumber + ((parentIndex & 0xFF) << 24); - this._endIndexes[i] = endLineNumber + ((parentIndex & 0xFF00) << 16); - } - } - } - get length() { - return this._startIndexes.length; - } - getStartLineNumber(index) { - return this._startIndexes[index] & MAX_LINE_NUMBER; - } - getEndLineNumber(index) { - return this._endIndexes[index] & MAX_LINE_NUMBER; - } - getType(index) { - return this._types ? this._types[index] : undefined; - } - hasTypes() { - return !!this._types; - } - isCollapsed(index) { - let arrayIndex = (index / 32) | 0; - let bit = index % 32; - return (this._collapseStates[arrayIndex] & (1 << bit)) !== 0; - } - setCollapsed(index, newState) { - let arrayIndex = (index / 32) | 0; - let bit = index % 32; - let value = this._collapseStates[arrayIndex]; - if (newState) { - this._collapseStates[arrayIndex] = value | (1 << bit); - } - else { - this._collapseStates[arrayIndex] = value & ~(1 << bit); - } - } - toRegion(index) { - return new FoldingRegion(this, index); - } - getParentIndex(index) { - this.ensureParentIndices(); - let parent = ((this._startIndexes[index] & MASK_INDENT) >>> 24) + ((this._endIndexes[index] & MASK_INDENT) >>> 16); - if (parent === MAX_FOLDING_REGIONS) { - return -1; - } - return parent; - } - contains(index, line) { - return this.getStartLineNumber(index) <= line && this.getEndLineNumber(index) >= line; - } - findIndex(line) { - let low = 0, high = this._startIndexes.length; - if (high === 0) { - return -1; // no children - } - while (low < high) { - let mid = Math.floor((low + high) / 2); - if (line < this.getStartLineNumber(mid)) { - high = mid; - } - else { - low = mid + 1; - } - } - return low - 1; - } - findRange(line) { - let index = this.findIndex(line); - if (index >= 0) { - let endLineNumber = this.getEndLineNumber(index); - if (endLineNumber >= line) { - return index; - } - index = this.getParentIndex(index); - while (index !== -1) { - if (this.contains(index, line)) { - return index; - } - index = this.getParentIndex(index); - } - } - return -1; - } - toString() { - let res = []; - for (let i = 0; i < this.length; i++) { - res[i] = `[${this.isCollapsed(i) ? '+' : '-'}] ${this.getStartLineNumber(i)}/${this.getEndLineNumber(i)}`; - } - return res.join(', '); - } -} -class FoldingRegion { - constructor(ranges, index) { - this.ranges = ranges; - this.index = index; - } - get startLineNumber() { - return this.ranges.getStartLineNumber(this.index); - } - get endLineNumber() { - return this.ranges.getEndLineNumber(this.index); - } - get regionIndex() { - return this.index; - } - get parentIndex() { - return this.ranges.getParentIndex(this.index); - } - get isCollapsed() { - return this.ranges.isCollapsed(this.index); - } - containedBy(range) { - return range.startLineNumber <= this.startLineNumber && range.endLineNumber >= this.endLineNumber; - } - containsLine(lineNumber) { - return this.startLineNumber <= lineNumber && lineNumber <= this.endLineNumber; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/hiddenRangeModel.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/folding/hiddenRangeModel.js ***! - \**************************************************************************************/ -/*! exports provided: HiddenRangeModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HiddenRangeModel", function() { return HiddenRangeModel; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class HiddenRangeModel { - constructor(model) { - this._updateEventEmitter = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this._foldingModel = model; - this._foldingModelListener = model.onDidChange(_ => this.updateHiddenRanges()); - this._hiddenRanges = []; - if (model.regions.length) { - this.updateHiddenRanges(); - } - } - get onDidChange() { return this._updateEventEmitter.event; } - get hiddenRanges() { return this._hiddenRanges; } - updateHiddenRanges() { - let updateHiddenAreas = false; - let newHiddenAreas = []; - let i = 0; // index into hidden - let k = 0; - let lastCollapsedStart = Number.MAX_VALUE; - let lastCollapsedEnd = -1; - let ranges = this._foldingModel.regions; - for (; i < ranges.length; i++) { - if (!ranges.isCollapsed(i)) { - continue; - } - let startLineNumber = ranges.getStartLineNumber(i) + 1; // the first line is not hidden - let endLineNumber = ranges.getEndLineNumber(i); - if (lastCollapsedStart <= startLineNumber && endLineNumber <= lastCollapsedEnd) { - // ignore ranges contained in collapsed regions - continue; - } - if (!updateHiddenAreas && k < this._hiddenRanges.length && this._hiddenRanges[k].startLineNumber === startLineNumber && this._hiddenRanges[k].endLineNumber === endLineNumber) { - // reuse the old ranges - newHiddenAreas.push(this._hiddenRanges[k]); - k++; - } - else { - updateHiddenAreas = true; - newHiddenAreas.push(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"](startLineNumber, 1, endLineNumber, 1)); - } - lastCollapsedStart = startLineNumber; - lastCollapsedEnd = endLineNumber; - } - if (updateHiddenAreas || k < this._hiddenRanges.length) { - this.applyHiddenRanges(newHiddenAreas); - } - } - applyMemento(state) { - if (!Array.isArray(state) || state.length === 0) { - return false; - } - let hiddenRanges = []; - for (let r of state) { - if (!r.startLineNumber || !r.endLineNumber) { - return false; - } - hiddenRanges.push(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"](r.startLineNumber + 1, 1, r.endLineNumber, 1)); - } - this.applyHiddenRanges(hiddenRanges); - return true; - } - /** - * Collapse state memento, for persistence only, only used if folding model is not yet initialized - */ - getMemento() { - return this._hiddenRanges.map(r => ({ startLineNumber: r.startLineNumber - 1, endLineNumber: r.endLineNumber })); - } - applyHiddenRanges(newHiddenAreas) { - this._hiddenRanges = newHiddenAreas; - this._updateEventEmitter.fire(newHiddenAreas); - } - hasRanges() { - return this._hiddenRanges.length > 0; - } - isHidden(line) { - return findRange(this._hiddenRanges, line) !== null; - } - adjustSelections(selections) { - let hasChanges = false; - let editorModel = this._foldingModel.textModel; - let lastRange = null; - let adjustLine = (line) => { - if (!lastRange || !isInside(line, lastRange)) { - lastRange = findRange(this._hiddenRanges, line); - } - if (lastRange) { - return lastRange.startLineNumber - 1; - } - return null; - }; - for (let i = 0, len = selections.length; i < len; i++) { - let selection = selections[i]; - let adjustedStartLine = adjustLine(selection.startLineNumber); - if (adjustedStartLine) { - selection = selection.setStartPosition(adjustedStartLine, editorModel.getLineMaxColumn(adjustedStartLine)); - hasChanges = true; - } - let adjustedEndLine = adjustLine(selection.endLineNumber); - if (adjustedEndLine) { - selection = selection.setEndPosition(adjustedEndLine, editorModel.getLineMaxColumn(adjustedEndLine)); - hasChanges = true; - } - selections[i] = selection; - } - return hasChanges; - } - dispose() { - if (this.hiddenRanges.length > 0) { - this._hiddenRanges = []; - this._updateEventEmitter.fire(this._hiddenRanges); - } - if (this._foldingModelListener) { - this._foldingModelListener.dispose(); - this._foldingModelListener = null; - } - } -} -function isInside(line, range) { - return line >= range.startLineNumber && line <= range.endLineNumber; -} -function findRange(ranges, line) { - let i = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_2__["findFirstInSorted"])(ranges, r => line < r.startLineNumber) - 1; - if (i >= 0 && ranges[i].endLineNumber >= line) { - return ranges[i]; - } - return null; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/indentRangeProvider.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/folding/indentRangeProvider.js ***! - \*****************************************************************************************/ -/*! exports provided: ID_INDENT_PROVIDER, IndentRangeProvider, RangesCollector, computeRanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ID_INDENT_PROVIDER", function() { return ID_INDENT_PROVIDER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentRangeProvider", function() { return IndentRangeProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RangesCollector", function() { return RangesCollector; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeRanges", function() { return computeRanges; }); -/* harmony import */ var _foldingRanges_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foldingRanges.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/foldingRanges.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -const MAX_FOLDING_REGIONS_FOR_INDENT_LIMIT = 5000; -const ID_INDENT_PROVIDER = 'indent'; -class IndentRangeProvider { - constructor(editorModel) { - this.editorModel = editorModel; - this.id = ID_INDENT_PROVIDER; - } - dispose() { - } - compute(cancelationToken) { - let foldingRules = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_2__["LanguageConfigurationRegistry"].getFoldingRules(this.editorModel.getLanguageIdentifier().id); - let offSide = foldingRules && !!foldingRules.offSide; - let markers = foldingRules && foldingRules.markers; - return Promise.resolve(computeRanges(this.editorModel, offSide, markers)); - } -} -// public only for testing -class RangesCollector { - constructor(foldingRangesLimit) { - this._startIndexes = []; - this._endIndexes = []; - this._indentOccurrences = []; - this._length = 0; - this._foldingRangesLimit = foldingRangesLimit; - } - insertFirst(startLineNumber, endLineNumber, indent) { - if (startLineNumber > _foldingRanges_js__WEBPACK_IMPORTED_MODULE_0__["MAX_LINE_NUMBER"] || endLineNumber > _foldingRanges_js__WEBPACK_IMPORTED_MODULE_0__["MAX_LINE_NUMBER"]) { - return; - } - let index = this._length; - this._startIndexes[index] = startLineNumber; - this._endIndexes[index] = endLineNumber; - this._length++; - if (indent < 1000) { - this._indentOccurrences[indent] = (this._indentOccurrences[indent] || 0) + 1; - } - } - toIndentRanges(model) { - if (this._length <= this._foldingRangesLimit) { - // reverse and create arrays of the exact length - let startIndexes = new Uint32Array(this._length); - let endIndexes = new Uint32Array(this._length); - for (let i = this._length - 1, k = 0; i >= 0; i--, k++) { - startIndexes[k] = this._startIndexes[i]; - endIndexes[k] = this._endIndexes[i]; - } - return new _foldingRanges_js__WEBPACK_IMPORTED_MODULE_0__["FoldingRegions"](startIndexes, endIndexes); - } - else { - let entries = 0; - let maxIndent = this._indentOccurrences.length; - for (let i = 0; i < this._indentOccurrences.length; i++) { - let n = this._indentOccurrences[i]; - if (n) { - if (n + entries > this._foldingRangesLimit) { - maxIndent = i; - break; - } - entries += n; - } - } - const tabSize = model.getOptions().tabSize; - // reverse and create arrays of the exact length - let startIndexes = new Uint32Array(this._foldingRangesLimit); - let endIndexes = new Uint32Array(this._foldingRangesLimit); - for (let i = this._length - 1, k = 0; i >= 0; i--) { - let startIndex = this._startIndexes[i]; - let lineContent = model.getLineContent(startIndex); - let indent = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_1__["TextModel"].computeIndentLevel(lineContent, tabSize); - if (indent < maxIndent || (indent === maxIndent && entries++ < this._foldingRangesLimit)) { - startIndexes[k] = startIndex; - endIndexes[k] = this._endIndexes[i]; - k++; - } - } - return new _foldingRanges_js__WEBPACK_IMPORTED_MODULE_0__["FoldingRegions"](startIndexes, endIndexes); - } - } -} -function computeRanges(model, offSide, markers, foldingRangesLimit = MAX_FOLDING_REGIONS_FOR_INDENT_LIMIT) { - const tabSize = model.getOptions().tabSize; - let result = new RangesCollector(foldingRangesLimit); - let pattern = undefined; - if (markers) { - pattern = new RegExp(`(${markers.start.source})|(?:${markers.end.source})`); - } - let previousRegions = []; - let line = model.getLineCount() + 1; - previousRegions.push({ indent: -1, endAbove: line, line }); // sentinel, to make sure there's at least one entry - for (let line = model.getLineCount(); line > 0; line--) { - let lineContent = model.getLineContent(line); - let indent = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_1__["TextModel"].computeIndentLevel(lineContent, tabSize); - let previous = previousRegions[previousRegions.length - 1]; - if (indent === -1) { - if (offSide) { - // for offSide languages, empty lines are associated to the previous block - // note: the next block is already written to the results, so this only - // impacts the end position of the block before - previous.endAbove = line; - } - continue; // only whitespace - } - let m; - if (pattern && (m = lineContent.match(pattern))) { - // folding pattern match - if (m[1]) { // start pattern match - // discard all regions until the folding pattern - let i = previousRegions.length - 1; - while (i > 0 && previousRegions[i].indent !== -2) { - i--; - } - if (i > 0) { - previousRegions.length = i + 1; - previous = previousRegions[i]; - // new folding range from pattern, includes the end line - result.insertFirst(line, previous.line, indent); - previous.line = line; - previous.indent = indent; - previous.endAbove = line; - continue; - } - else { - // no end marker found, treat line as a regular line - } - } - else { // end pattern match - previousRegions.push({ indent: -2, endAbove: line, line }); - continue; - } - } - if (previous.indent > indent) { - // discard all regions with larger indent - do { - previousRegions.pop(); - previous = previousRegions[previousRegions.length - 1]; - } while (previous.indent > indent); - // new folding range - let endLineNumber = previous.endAbove - 1; - if (endLineNumber - line >= 1) { // needs at east size 1 - result.insertFirst(line, endLineNumber, indent); - } - } - if (previous.indent === indent) { - previous.endAbove = line; - } - else { // previous.indent < indent - // new region with a bigger indent - previousRegions.push({ indent, endAbove: line, line }); - } - } - return result.toIndentRanges(model); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/intializingRangeProvider.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/folding/intializingRangeProvider.js ***! - \**********************************************************************************************/ -/*! exports provided: ID_INIT_PROVIDER, InitializingRangeProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ID_INIT_PROVIDER", function() { return ID_INIT_PROVIDER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InitializingRangeProvider", function() { return InitializingRangeProvider; }); -/* harmony import */ var _syntaxRangeProvider_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./syntaxRangeProvider.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/syntaxRangeProvider.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const ID_INIT_PROVIDER = 'init'; -class InitializingRangeProvider { - constructor(editorModel, initialRanges, onTimeout, timeoutTime) { - this.editorModel = editorModel; - this.id = ID_INIT_PROVIDER; - if (initialRanges.length) { - let toDecorationRange = (range) => { - return { - range: { - startLineNumber: range.startLineNumber, - startColumn: 0, - endLineNumber: range.endLineNumber, - endColumn: editorModel.getLineLength(range.endLineNumber) - }, - options: { - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */ - } - }; - }; - this.decorationIds = editorModel.deltaDecorations([], initialRanges.map(toDecorationRange)); - this.timeout = setTimeout(onTimeout, timeoutTime); - } - } - dispose() { - if (this.decorationIds) { - this.editorModel.deltaDecorations(this.decorationIds, []); - this.decorationIds = undefined; - } - if (typeof this.timeout === 'number') { - clearTimeout(this.timeout); - this.timeout = undefined; - } - } - compute(cancelationToken) { - let foldingRangeData = []; - if (this.decorationIds) { - for (let id of this.decorationIds) { - let range = this.editorModel.getDecorationRange(id); - if (range) { - foldingRangeData.push({ start: range.startLineNumber, end: range.endLineNumber, rank: 1 }); - } - } - } - return Promise.resolve(Object(_syntaxRangeProvider_js__WEBPACK_IMPORTED_MODULE_0__["sanitizeRanges"])(foldingRangeData, Number.MAX_VALUE)); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/syntaxRangeProvider.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/folding/syntaxRangeProvider.js ***! - \*****************************************************************************************/ -/*! exports provided: ID_SYNTAX_PROVIDER, SyntaxRangeProvider, RangesCollector, sanitizeRanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ID_SYNTAX_PROVIDER", function() { return ID_SYNTAX_PROVIDER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyntaxRangeProvider", function() { return SyntaxRangeProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RangesCollector", function() { return RangesCollector; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sanitizeRanges", function() { return sanitizeRanges; }); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _foldingRanges_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foldingRanges.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/foldingRanges.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -const MAX_FOLDING_REGIONS = 5000; -const foldingContext = {}; -const ID_SYNTAX_PROVIDER = 'syntax'; -class SyntaxRangeProvider { - constructor(editorModel, providers, limit = MAX_FOLDING_REGIONS) { - this.editorModel = editorModel; - this.providers = providers; - this.limit = limit; - this.id = ID_SYNTAX_PROVIDER; - } - compute(cancellationToken) { - return collectSyntaxRanges(this.providers, this.editorModel, cancellationToken).then(ranges => { - if (ranges) { - let res = sanitizeRanges(ranges, this.limit); - return res; - } - return null; - }); - } - dispose() { - } -} -function collectSyntaxRanges(providers, model, cancellationToken) { - let rangeData = null; - let promises = providers.map((provider, i) => { - return Promise.resolve(provider.provideFoldingRanges(model, foldingContext, cancellationToken)).then(ranges => { - if (cancellationToken.isCancellationRequested) { - return; - } - if (Array.isArray(ranges)) { - if (!Array.isArray(rangeData)) { - rangeData = []; - } - let nLines = model.getLineCount(); - for (let r of ranges) { - if (r.start > 0 && r.end > r.start && r.end <= nLines) { - rangeData.push({ start: r.start, end: r.end, rank: i, kind: r.kind }); - } - } - } - }, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedExternalError"]); - }); - return Promise.all(promises).then(_ => { - return rangeData; - }); -} -class RangesCollector { - constructor(foldingRangesLimit) { - this._startIndexes = []; - this._endIndexes = []; - this._nestingLevels = []; - this._nestingLevelCounts = []; - this._types = []; - this._length = 0; - this._foldingRangesLimit = foldingRangesLimit; - } - add(startLineNumber, endLineNumber, type, nestingLevel) { - if (startLineNumber > _foldingRanges_js__WEBPACK_IMPORTED_MODULE_1__["MAX_LINE_NUMBER"] || endLineNumber > _foldingRanges_js__WEBPACK_IMPORTED_MODULE_1__["MAX_LINE_NUMBER"]) { - return; - } - let index = this._length; - this._startIndexes[index] = startLineNumber; - this._endIndexes[index] = endLineNumber; - this._nestingLevels[index] = nestingLevel; - this._types[index] = type; - this._length++; - if (nestingLevel < 30) { - this._nestingLevelCounts[nestingLevel] = (this._nestingLevelCounts[nestingLevel] || 0) + 1; - } - } - toIndentRanges() { - if (this._length <= this._foldingRangesLimit) { - let startIndexes = new Uint32Array(this._length); - let endIndexes = new Uint32Array(this._length); - for (let i = 0; i < this._length; i++) { - startIndexes[i] = this._startIndexes[i]; - endIndexes[i] = this._endIndexes[i]; - } - return new _foldingRanges_js__WEBPACK_IMPORTED_MODULE_1__["FoldingRegions"](startIndexes, endIndexes, this._types); - } - else { - let entries = 0; - let maxLevel = this._nestingLevelCounts.length; - for (let i = 0; i < this._nestingLevelCounts.length; i++) { - let n = this._nestingLevelCounts[i]; - if (n) { - if (n + entries > this._foldingRangesLimit) { - maxLevel = i; - break; - } - entries += n; - } - } - let startIndexes = new Uint32Array(this._foldingRangesLimit); - let endIndexes = new Uint32Array(this._foldingRangesLimit); - let types = []; - for (let i = 0, k = 0; i < this._length; i++) { - let level = this._nestingLevels[i]; - if (level < maxLevel || (level === maxLevel && entries++ < this._foldingRangesLimit)) { - startIndexes[k] = this._startIndexes[i]; - endIndexes[k] = this._endIndexes[i]; - types[k] = this._types[i]; - k++; - } - } - return new _foldingRanges_js__WEBPACK_IMPORTED_MODULE_1__["FoldingRegions"](startIndexes, endIndexes, types); - } - } -} -function sanitizeRanges(rangeData, limit) { - let sorted = rangeData.sort((d1, d2) => { - let diff = d1.start - d2.start; - if (diff === 0) { - diff = d1.rank - d2.rank; - } - return diff; - }); - let collector = new RangesCollector(limit); - let top = undefined; - let previous = []; - for (let entry of sorted) { - if (!top) { - top = entry; - collector.add(entry.start, entry.end, entry.kind && entry.kind.value, previous.length); - } - else { - if (entry.start > top.start) { - if (entry.end <= top.end) { - previous.push(top); - top = entry; - collector.add(entry.start, entry.end, entry.kind && entry.kind.value, previous.length); - } - else { - if (entry.start > top.end) { - do { - top = previous.pop(); - } while (top && entry.start > top.end); - if (top) { - previous.push(top); - } - top = entry; - } - collector.add(entry.start, entry.end, entry.kind && entry.kind.value, previous.length); - } - } - } - } - return collector.toIndentRanges(); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/fontZoom/fontZoom.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/fontZoom/fontZoom.js ***! - \*******************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_config_editorZoom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/config/editorZoom.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorZoom.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class EditorFontZoomIn extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.fontZoomIn', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('EditorFontZoomIn.label', "Editor Font Zoom In"), - alias: 'Editor Font Zoom In', - precondition: undefined - }); - } - run(accessor, editor) { - _common_config_editorZoom_js__WEBPACK_IMPORTED_MODULE_2__["EditorZoom"].setZoomLevel(_common_config_editorZoom_js__WEBPACK_IMPORTED_MODULE_2__["EditorZoom"].getZoomLevel() + 1); - } -} -class EditorFontZoomOut extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.fontZoomOut', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('EditorFontZoomOut.label', "Editor Font Zoom Out"), - alias: 'Editor Font Zoom Out', - precondition: undefined - }); - } - run(accessor, editor) { - _common_config_editorZoom_js__WEBPACK_IMPORTED_MODULE_2__["EditorZoom"].setZoomLevel(_common_config_editorZoom_js__WEBPACK_IMPORTED_MODULE_2__["EditorZoom"].getZoomLevel() - 1); - } -} -class EditorFontZoomReset extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.fontZoomReset', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('EditorFontZoomReset.label', "Editor Font Zoom Reset"), - alias: 'Editor Font Zoom Reset', - precondition: undefined - }); - } - run(accessor, editor) { - _common_config_editorZoom_js__WEBPACK_IMPORTED_MODULE_2__["EditorZoom"].setZoomLevel(0); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorAction"])(EditorFontZoomIn); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorAction"])(EditorFontZoomOut); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorAction"])(EditorFontZoomReset); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/format/format.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/format/format.js ***! - \***************************************************************************/ -/*! exports provided: alertFormattingEdits, getRealAndSyntheticDocumentFormattersOrdered, FormattingConflicts, formatDocumentRangesWithSelectedProvider, formatDocumentRangesWithProvider, formatDocumentWithSelectedProvider, formatDocumentWithProvider, getDocumentRangeFormattingEditsUntilResult, getDocumentFormattingEditsUntilResult, getOnTypeFormattingEdits */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "alertFormattingEdits", function() { return alertFormattingEdits; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRealAndSyntheticDocumentFormattersOrdered", function() { return getRealAndSyntheticDocumentFormattersOrdered; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattingConflicts", function() { return FormattingConflicts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatDocumentRangesWithSelectedProvider", function() { return formatDocumentRangesWithSelectedProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatDocumentRangesWithProvider", function() { return formatDocumentRangesWithProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatDocumentWithSelectedProvider", function() { return formatDocumentWithSelectedProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatDocumentWithProvider", function() { return formatDocumentWithProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDocumentRangeFormattingEditsUntilResult", function() { return getDocumentRangeFormattingEditsUntilResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDocumentFormattingEditsUntilResult", function() { return getDocumentFormattingEditsUntilResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOnTypeFormattingEdits", function() { return getOnTypeFormattingEdits; }); -/* harmony import */ var _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/ui/aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../browser/core/editorState.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/core/editorState.js"); -/* harmony import */ var _browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../browser/editorBrowser.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorBrowser.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../common/services/editorWorkerService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerService.js"); -/* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../common/services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _formattingEdit_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./formattingEdit.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/format/formattingEdit.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_extensions_common_extensions_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/extensions/common/extensions.js */ "./node_modules/monaco-editor/esm/vs/platform/extensions/common/extensions.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../base/common/linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - - - - - - -function alertFormattingEdits(edits) { - edits = edits.filter(edit => edit.range); - if (!edits.length) { - return; - } - let { range } = edits[0]; - for (let i = 1; i < edits.length; i++) { - range = _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].plusRange(range, edits[i].range); - } - const { startLineNumber, endLineNumber } = range; - if (startLineNumber === endLineNumber) { - if (edits.length === 1) { - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_0__["alert"])(_nls_js__WEBPACK_IMPORTED_MODULE_14__["localize"]('hint11', "Made 1 formatting edit on line {0}", startLineNumber)); - } - else { - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_0__["alert"])(_nls_js__WEBPACK_IMPORTED_MODULE_14__["localize"]('hintn1', "Made {0} formatting edits on line {1}", edits.length, startLineNumber)); - } - } - else { - if (edits.length === 1) { - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_0__["alert"])(_nls_js__WEBPACK_IMPORTED_MODULE_14__["localize"]('hint1n', "Made 1 formatting edit between lines {0} and {1}", startLineNumber, endLineNumber)); - } - else { - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_0__["alert"])(_nls_js__WEBPACK_IMPORTED_MODULE_14__["localize"]('hintnn', "Made {0} formatting edits between lines {1} and {2}", edits.length, startLineNumber, endLineNumber)); - } - } -} -function getRealAndSyntheticDocumentFormattersOrdered(model) { - const result = []; - const seen = new Set(); - // (1) add all document formatter - const docFormatter = _common_modes_js__WEBPACK_IMPORTED_MODULE_10__["DocumentFormattingEditProviderRegistry"].ordered(model); - for (const formatter of docFormatter) { - result.push(formatter); - if (formatter.extensionId) { - seen.add(_platform_extensions_common_extensions_js__WEBPACK_IMPORTED_MODULE_15__["ExtensionIdentifier"].toKey(formatter.extensionId)); - } - } - // (2) add all range formatter as document formatter (unless the same extension already did that) - const rangeFormatter = _common_modes_js__WEBPACK_IMPORTED_MODULE_10__["DocumentRangeFormattingEditProviderRegistry"].ordered(model); - for (const formatter of rangeFormatter) { - if (formatter.extensionId) { - if (seen.has(_platform_extensions_common_extensions_js__WEBPACK_IMPORTED_MODULE_15__["ExtensionIdentifier"].toKey(formatter.extensionId))) { - continue; - } - seen.add(_platform_extensions_common_extensions_js__WEBPACK_IMPORTED_MODULE_15__["ExtensionIdentifier"].toKey(formatter.extensionId)); - } - result.push({ - displayName: formatter.displayName, - extensionId: formatter.extensionId, - provideDocumentFormattingEdits(model, options, token) { - return formatter.provideDocumentRangeFormattingEdits(model, model.getFullModelRange(), options, token); - } - }); - } - return result; -} -class FormattingConflicts { - static select(formatter, document, mode) { - return __awaiter(this, void 0, void 0, function* () { - if (formatter.length === 0) { - return undefined; - } - const selector = _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_20__["Iterable"].first(FormattingConflicts._selectors); - if (selector) { - return yield selector(formatter, document, mode); - } - return formatter[0]; - }); - } -} -FormattingConflicts._selectors = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_17__["LinkedList"](); -function formatDocumentRangesWithSelectedProvider(accessor, editorOrModel, rangeOrRanges, mode, progress, token) { - return __awaiter(this, void 0, void 0, function* () { - const instaService = accessor.get(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_16__["IInstantiationService"]); - const model = Object(_browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_6__["isCodeEditor"])(editorOrModel) ? editorOrModel.getModel() : editorOrModel; - const provider = _common_modes_js__WEBPACK_IMPORTED_MODULE_10__["DocumentRangeFormattingEditProviderRegistry"].ordered(model); - const selected = yield FormattingConflicts.select(provider, model, mode); - if (selected) { - progress.report(selected); - yield instaService.invokeFunction(formatDocumentRangesWithProvider, selected, editorOrModel, rangeOrRanges, token); - } - }); -} -function formatDocumentRangesWithProvider(accessor, provider, editorOrModel, rangeOrRanges, token) { - return __awaiter(this, void 0, void 0, function* () { - const workerService = accessor.get(_common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_11__["IEditorWorkerService"]); - let model; - let cts; - if (Object(_browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_6__["isCodeEditor"])(editorOrModel)) { - model = editorOrModel.getModel(); - cts = new _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_5__["EditorStateCancellationTokenSource"](editorOrModel, 1 /* Value */ | 4 /* Position */, undefined, token); - } - else { - model = editorOrModel; - cts = new _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_5__["TextModelCancellationTokenSource"](editorOrModel, token); - } - // make sure that ranges don't overlap nor touch each other - let ranges = []; - let len = 0; - for (let range of Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["asArray"])(rangeOrRanges).sort(_common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].compareRangesUsingStarts)) { - if (len > 0 && _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].areIntersectingOrTouching(ranges[len - 1], range)) { - ranges[len - 1] = _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].fromPositions(ranges[len - 1].getStartPosition(), range.getEndPosition()); - } - else { - len = ranges.push(range); - } - } - const allEdits = []; - for (let range of ranges) { - try { - const rawEdits = yield provider.provideDocumentRangeFormattingEdits(model, range, model.getFormattingOptions(), cts.token); - const minEdits = yield workerService.computeMoreMinimalEdits(model.uri, rawEdits); - if (minEdits) { - allEdits.push(...minEdits); - } - if (cts.token.isCancellationRequested) { - return true; - } - } - finally { - cts.dispose(); - } - } - if (allEdits.length === 0) { - return false; - } - if (Object(_browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_6__["isCodeEditor"])(editorOrModel)) { - // use editor to apply edits - _formattingEdit_js__WEBPACK_IMPORTED_MODULE_13__["FormattingEdit"].execute(editorOrModel, allEdits, true); - alertFormattingEdits(allEdits); - editorOrModel.revealPositionInCenterIfOutsideViewport(editorOrModel.getPosition(), 1 /* Immediate */); - } - else { - // use model to apply edits - const [{ range }] = allEdits; - const initialSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_9__["Selection"](range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); - model.pushEditOperations([initialSelection], allEdits.map(edit => { - return { - text: edit.text, - range: _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].lift(edit.range), - forceMoveMarkers: true - }; - }), undoEdits => { - for (const { range } of undoEdits) { - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].areIntersectingOrTouching(range, initialSelection)) { - return [new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_9__["Selection"](range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn)]; - } - } - return null; - }); - } - return true; - }); -} -function formatDocumentWithSelectedProvider(accessor, editorOrModel, mode, progress, token) { - return __awaiter(this, void 0, void 0, function* () { - const instaService = accessor.get(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_16__["IInstantiationService"]); - const model = Object(_browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_6__["isCodeEditor"])(editorOrModel) ? editorOrModel.getModel() : editorOrModel; - const provider = getRealAndSyntheticDocumentFormattersOrdered(model); - const selected = yield FormattingConflicts.select(provider, model, mode); - if (selected) { - progress.report(selected); - yield instaService.invokeFunction(formatDocumentWithProvider, selected, editorOrModel, mode, token); - } - }); -} -function formatDocumentWithProvider(accessor, provider, editorOrModel, mode, token) { - return __awaiter(this, void 0, void 0, function* () { - const workerService = accessor.get(_common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_11__["IEditorWorkerService"]); - let model; - let cts; - if (Object(_browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_6__["isCodeEditor"])(editorOrModel)) { - model = editorOrModel.getModel(); - cts = new _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_5__["EditorStateCancellationTokenSource"](editorOrModel, 1 /* Value */ | 4 /* Position */, undefined, token); - } - else { - model = editorOrModel; - cts = new _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_5__["TextModelCancellationTokenSource"](editorOrModel, token); - } - let edits; - try { - const rawEdits = yield provider.provideDocumentFormattingEdits(model, model.getFormattingOptions(), cts.token); - edits = yield workerService.computeMoreMinimalEdits(model.uri, rawEdits); - if (cts.token.isCancellationRequested) { - return true; - } - } - finally { - cts.dispose(); - } - if (!edits || edits.length === 0) { - return false; - } - if (Object(_browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_6__["isCodeEditor"])(editorOrModel)) { - // use editor to apply edits - _formattingEdit_js__WEBPACK_IMPORTED_MODULE_13__["FormattingEdit"].execute(editorOrModel, edits, mode !== 2 /* Silent */); - if (mode !== 2 /* Silent */) { - alertFormattingEdits(edits); - editorOrModel.revealPositionInCenterIfOutsideViewport(editorOrModel.getPosition(), 1 /* Immediate */); - } - } - else { - // use model to apply edits - const [{ range }] = edits; - const initialSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_9__["Selection"](range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); - model.pushEditOperations([initialSelection], edits.map(edit => { - return { - text: edit.text, - range: _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].lift(edit.range), - forceMoveMarkers: true - }; - }), undoEdits => { - for (const { range } of undoEdits) { - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].areIntersectingOrTouching(range, initialSelection)) { - return [new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_9__["Selection"](range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn)]; - } - } - return null; - }); - } - return true; - }); -} -function getDocumentRangeFormattingEditsUntilResult(workerService, model, range, options, token) { - return __awaiter(this, void 0, void 0, function* () { - const providers = _common_modes_js__WEBPACK_IMPORTED_MODULE_10__["DocumentRangeFormattingEditProviderRegistry"].ordered(model); - for (const provider of providers) { - let rawEdits = yield Promise.resolve(provider.provideDocumentRangeFormattingEdits(model, range, options, token)).catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["onUnexpectedExternalError"]); - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["isNonEmptyArray"])(rawEdits)) { - return yield workerService.computeMoreMinimalEdits(model.uri, rawEdits); - } - } - return undefined; - }); -} -function getDocumentFormattingEditsUntilResult(workerService, model, options, token) { - return __awaiter(this, void 0, void 0, function* () { - const providers = getRealAndSyntheticDocumentFormattersOrdered(model); - for (const provider of providers) { - let rawEdits = yield Promise.resolve(provider.provideDocumentFormattingEdits(model, options, token)).catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["onUnexpectedExternalError"]); - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["isNonEmptyArray"])(rawEdits)) { - return yield workerService.computeMoreMinimalEdits(model.uri, rawEdits); - } - } - return undefined; - }); -} -function getOnTypeFormattingEdits(workerService, model, position, ch, options) { - const providers = _common_modes_js__WEBPACK_IMPORTED_MODULE_10__["OnTypeFormattingEditProviderRegistry"].ordered(model); - if (providers.length === 0) { - return Promise.resolve(undefined); - } - if (providers[0].autoFormatTriggerCharacters.indexOf(ch) < 0) { - return Promise.resolve(undefined); - } - return Promise.resolve(providers[0].provideOnTypeFormattingEdits(model, position, ch, options, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_2__["CancellationToken"].None)).catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["onUnexpectedExternalError"]).then(edits => { - return workerService.computeMoreMinimalEdits(model.uri, edits); - }); -} -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_18__["CommandsRegistry"].registerCommand('_executeFormatRangeProvider', function (accessor, ...args) { - const [resource, range, options] = args; - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_19__["assertType"])(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"].isUri(resource)); - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_19__["assertType"])(_common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].isIRange(range)); - const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_12__["IModelService"]).getModel(resource); - if (!model) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["illegalArgument"])('resource'); - } - return getDocumentRangeFormattingEditsUntilResult(accessor.get(_common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_11__["IEditorWorkerService"]), model, _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].lift(range), options, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_2__["CancellationToken"].None); -}); -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_18__["CommandsRegistry"].registerCommand('_executeFormatDocumentProvider', function (accessor, ...args) { - const [resource, options] = args; - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_19__["assertType"])(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"].isUri(resource)); - const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_12__["IModelService"]).getModel(resource); - if (!model) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["illegalArgument"])('resource'); - } - return getDocumentFormattingEditsUntilResult(accessor.get(_common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_11__["IEditorWorkerService"]), model, options, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_2__["CancellationToken"].None); -}); -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_18__["CommandsRegistry"].registerCommand('_executeFormatOnTypeProvider', function (accessor, ...args) { - const [resource, position, ch, options] = args; - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_19__["assertType"])(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"].isUri(resource)); - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_19__["assertType"])(_common_core_position_js__WEBPACK_IMPORTED_MODULE_7__["Position"].isIPosition(position)); - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_19__["assertType"])(typeof ch === 'string'); - const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_12__["IModelService"]).getModel(resource); - if (!model) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["illegalArgument"])('resource'); - } - return getOnTypeFormattingEdits(accessor.get(_common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_11__["IEditorWorkerService"]), model, _common_core_position_js__WEBPACK_IMPORTED_MODULE_7__["Position"].lift(position), ch, options); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/format/formatActions.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/format/formatActions.js ***! - \**********************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _common_core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/services/editorWorkerService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerService.js"); -/* harmony import */ var _format_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./format.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/format/format.js"); -/* harmony import */ var _formattingEdit_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./formattingEdit.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/format/formattingEdit.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/progress/common/progress.js */ "./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - - - - -let FormatOnType = class FormatOnType { - constructor(editor, _workerService) { - this._workerService = _workerService; - this._callOnDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - this._callOnModel = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - this._editor = editor; - this._callOnDispose.add(editor.onDidChangeConfiguration(() => this._update())); - this._callOnDispose.add(editor.onDidChangeModel(() => this._update())); - this._callOnDispose.add(editor.onDidChangeModelLanguage(() => this._update())); - this._callOnDispose.add(_common_modes_js__WEBPACK_IMPORTED_MODULE_9__["OnTypeFormattingEditProviderRegistry"].onDidChange(this._update, this)); - } - dispose() { - this._callOnDispose.dispose(); - this._callOnModel.dispose(); - } - _update() { - // clean up - this._callOnModel.clear(); - // we are disabled - if (!this._editor.getOption(41 /* formatOnType */)) { - return; - } - // no model - if (!this._editor.hasModel()) { - return; - } - const model = this._editor.getModel(); - // no support - const [support] = _common_modes_js__WEBPACK_IMPORTED_MODULE_9__["OnTypeFormattingEditProviderRegistry"].ordered(model); - if (!support || !support.autoFormatTriggerCharacters) { - return; - } - // register typing listeners that will trigger the format - let triggerChars = new _common_core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_6__["CharacterSet"](); - for (let ch of support.autoFormatTriggerCharacters) { - triggerChars.add(ch.charCodeAt(0)); - } - this._callOnModel.add(this._editor.onDidType((text) => { - let lastCharCode = text.charCodeAt(text.length - 1); - if (triggerChars.has(lastCharCode)) { - this._trigger(String.fromCharCode(lastCharCode)); - } - })); - } - _trigger(ch) { - if (!this._editor.hasModel()) { - return; - } - if (this._editor.getSelections().length > 1) { - return; - } - const model = this._editor.getModel(); - const position = this._editor.getPosition(); - let canceled = false; - // install a listener that checks if edits happens before the - // position on which we format right now. If so, we won't - // apply the format edits - const unbind = this._editor.onDidChangeModelContent((e) => { - if (e.isFlush) { - // a model.setValue() was called - // cancel only once - canceled = true; - unbind.dispose(); - return; - } - for (let i = 0, len = e.changes.length; i < len; i++) { - const change = e.changes[i]; - if (change.range.endLineNumber <= position.lineNumber) { - // cancel only once - canceled = true; - unbind.dispose(); - return; - } - } - }); - Object(_format_js__WEBPACK_IMPORTED_MODULE_11__["getOnTypeFormattingEdits"])(this._workerService, model, position, ch, model.getFormattingOptions()).then(edits => { - unbind.dispose(); - if (canceled) { - return; - } - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["isNonEmptyArray"])(edits)) { - _formattingEdit_js__WEBPACK_IMPORTED_MODULE_12__["FormattingEdit"].execute(this._editor, edits, true); - Object(_format_js__WEBPACK_IMPORTED_MODULE_11__["alertFormattingEdits"])(edits); - } - }, (err) => { - unbind.dispose(); - throw err; - }); - } -}; -FormatOnType.ID = 'editor.contrib.autoFormat'; -FormatOnType = __decorate([ - __param(1, _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_10__["IEditorWorkerService"]) -], FormatOnType); -let FormatOnPaste = class FormatOnPaste { - constructor(editor, _instantiationService) { - this.editor = editor; - this._instantiationService = _instantiationService; - this._callOnDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - this._callOnModel = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - this._callOnDispose.add(editor.onDidChangeConfiguration(() => this._update())); - this._callOnDispose.add(editor.onDidChangeModel(() => this._update())); - this._callOnDispose.add(editor.onDidChangeModelLanguage(() => this._update())); - this._callOnDispose.add(_common_modes_js__WEBPACK_IMPORTED_MODULE_9__["DocumentRangeFormattingEditProviderRegistry"].onDidChange(this._update, this)); - } - dispose() { - this._callOnDispose.dispose(); - this._callOnModel.dispose(); - } - _update() { - // clean up - this._callOnModel.clear(); - // we are disabled - if (!this.editor.getOption(40 /* formatOnPaste */)) { - return; - } - // no model - if (!this.editor.hasModel()) { - return; - } - // no formatter - if (!_common_modes_js__WEBPACK_IMPORTED_MODULE_9__["DocumentRangeFormattingEditProviderRegistry"].has(this.editor.getModel())) { - return; - } - this._callOnModel.add(this.editor.onDidPaste(({ range }) => this._trigger(range))); - } - _trigger(range) { - if (!this.editor.hasModel()) { - return; - } - if (this.editor.getSelections().length > 1) { - return; - } - this._instantiationService.invokeFunction(_format_js__WEBPACK_IMPORTED_MODULE_11__["formatDocumentRangesWithSelectedProvider"], this.editor, range, 2 /* Silent */, _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_18__["Progress"].None, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationToken"].None).catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_17__["onUnexpectedError"]); - } -}; -FormatOnPaste.ID = 'editor.contrib.formatOnPaste'; -FormatOnPaste = __decorate([ - __param(1, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_16__["IInstantiationService"]) -], FormatOnPaste); -class FormatDocumentAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.formatDocument', - label: _nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"]('formatDocument.label', "Format Document"), - alias: 'Format Document', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].notInCompositeEditor, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].hasDocumentFormattingProvider), - kbOpts: { - kbExpr: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].editorTextFocus, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].hasDocumentFormattingProvider), - primary: 1024 /* Shift */ | 512 /* Alt */ | 36 /* KEY_F */, - linux: { primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 39 /* KEY_I */ }, - weight: 100 /* EditorContrib */ - }, - contextMenuOpts: { - when: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].hasDocumentFormattingProvider, - group: '1_modification', - order: 1.3 - } - }); - } - run(accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - if (editor.hasModel()) { - const instaService = accessor.get(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_16__["IInstantiationService"]); - const progressService = accessor.get(_platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_18__["IEditorProgressService"]); - yield progressService.showWhile(instaService.invokeFunction(_format_js__WEBPACK_IMPORTED_MODULE_11__["formatDocumentWithSelectedProvider"], editor, 1 /* Explicit */, _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_18__["Progress"].None, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationToken"].None), 250); - } - }); - } -} -class FormatSelectionAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.formatSelection', - label: _nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"]('formatSelection.label', "Format Selection"), - alias: 'Format Selection', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].hasDocumentSelectionFormattingProvider), - kbOpts: { - kbExpr: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].editorTextFocus, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].hasDocumentSelectionFormattingProvider), - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 36 /* KEY_F */), - weight: 100 /* EditorContrib */ - }, - contextMenuOpts: { - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].hasDocumentSelectionFormattingProvider, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].hasNonEmptySelection), - group: '1_modification', - order: 1.31 - } - }); - } - run(accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - if (!editor.hasModel()) { - return; - } - const instaService = accessor.get(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_16__["IInstantiationService"]); - const model = editor.getModel(); - const ranges = editor.getSelections().map(range => { - return range.isEmpty() - ? new _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](range.startLineNumber, 1, range.startLineNumber, model.getLineMaxColumn(range.startLineNumber)) - : range; - }); - const progressService = accessor.get(_platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_18__["IEditorProgressService"]); - yield progressService.showWhile(instaService.invokeFunction(_format_js__WEBPACK_IMPORTED_MODULE_11__["formatDocumentRangesWithSelectedProvider"], editor, ranges, 1 /* Explicit */, _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_18__["Progress"].None, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationToken"].None), 250); - }); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorContribution"])(FormatOnType.ID, FormatOnType); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorContribution"])(FormatOnPaste.ID, FormatOnPaste); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(FormatDocumentAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(FormatSelectionAction); -// this is the old format action that does both (format document OR format selection) -// and we keep it here such that existing keybinding configurations etc will still work -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_14__["CommandsRegistry"].registerCommand('editor.action.format', (accessor) => __awaiter(void 0, void 0, void 0, function* () { - const editor = accessor.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_5__["ICodeEditorService"]).getFocusedCodeEditor(); - if (!editor || !editor.hasModel()) { - return; - } - const commandService = accessor.get(_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_14__["ICommandService"]); - if (editor.getSelection().isEmpty()) { - yield commandService.executeCommand('editor.action.formatDocument'); - } - else { - yield commandService.executeCommand('editor.action.formatSelection'); - } -})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/format/formattingEdit.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/format/formattingEdit.js ***! - \***********************************************************************************/ -/*! exports provided: FormattingEdit */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattingEdit", function() { return FormattingEdit; }); -/* harmony import */ var _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/core/editOperation.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class FormattingEdit { - static _handleEolEdits(editor, edits) { - let newEol = undefined; - let singleEdits = []; - for (let edit of edits) { - if (typeof edit.eol === 'number') { - newEol = edit.eol; - } - if (edit.range && typeof edit.text === 'string') { - singleEdits.push(edit); - } - } - if (typeof newEol === 'number') { - if (editor.hasModel()) { - editor.getModel().pushEOL(newEol); - } - } - return singleEdits; - } - static _isFullModelReplaceEdit(editor, edit) { - if (!editor.hasModel()) { - return false; - } - const model = editor.getModel(); - const editRange = model.validateRange(edit.range); - const fullModelRange = model.getFullModelRange(); - return fullModelRange.equalsRange(editRange); - } - static execute(editor, _edits, addUndoStops) { - if (addUndoStops) { - editor.pushUndoStop(); - } - const edits = FormattingEdit._handleEolEdits(editor, _edits); - if (edits.length === 1 && FormattingEdit._isFullModelReplaceEdit(editor, edits[0])) { - // We use replace semantics and hope that markers stay put... - editor.executeEdits('formatEditsCommand', edits.map(edit => _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_0__["EditOperation"].replace(_common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].lift(edit.range), edit.text))); - } - else { - editor.executeEdits('formatEditsCommand', edits.map(edit => _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_0__["EditOperation"].replaceMove(_common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].lift(edit.range), edit.text))); - } - if (addUndoStops) { - editor.pushUndoStop(); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/gotoError.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/gotoError.js ***! - \*********************************************************************************/ -/*! exports provided: MarkerController, NextMarkerAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerController", function() { return MarkerController; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NextMarkerAction", function() { return NextMarkerAction; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _gotoErrorWidget_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./gotoErrorWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/gotoErrorWidget.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _markerNavigationService_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./markerNavigationService.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/markerNavigationService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - -let MarkerController = class MarkerController { - constructor(editor, _markerNavigationService, _contextKeyService, _editorService, _instantiationService) { - this._markerNavigationService = _markerNavigationService; - this._contextKeyService = _contextKeyService; - this._editorService = _editorService; - this._instantiationService = _instantiationService; - this._sessionDispoables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this._editor = editor; - this._widgetVisible = CONTEXT_MARKERS_NAVIGATION_VISIBLE.bindTo(this._contextKeyService); - } - static get(editor) { - return editor.getContribution(MarkerController.ID); - } - dispose() { - this._cleanUp(); - this._sessionDispoables.dispose(); - } - _cleanUp() { - this._widgetVisible.reset(); - this._sessionDispoables.clear(); - this._widget = undefined; - this._model = undefined; - } - _getOrCreateModel(uri) { - if (this._model && this._model.matches(uri)) { - return this._model; - } - let reusePosition = false; - if (this._model) { - reusePosition = true; - this._cleanUp(); - } - this._model = this._markerNavigationService.getMarkerList(uri); - if (reusePosition) { - this._model.move(true, this._editor.getModel(), this._editor.getPosition()); - } - this._widget = this._instantiationService.createInstance(_gotoErrorWidget_js__WEBPACK_IMPORTED_MODULE_7__["MarkerNavigationWidget"], this._editor); - this._widget.onDidClose(() => this.close(), this, this._sessionDispoables); - this._widgetVisible.set(true); - this._sessionDispoables.add(this._model); - this._sessionDispoables.add(this._widget); - // follow cursor - this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(e => { - var _a, _b, _c; - if (!((_a = this._model) === null || _a === void 0 ? void 0 : _a.selected) || !_common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].containsPosition((_b = this._model) === null || _b === void 0 ? void 0 : _b.selected.marker, e.position)) { - (_c = this._model) === null || _c === void 0 ? void 0 : _c.resetIndex(); - } - })); - // update markers - this._sessionDispoables.add(this._model.onDidChange(() => { - if (!this._widget || !this._widget.position || !this._model) { - return; - } - const info = this._model.find(this._editor.getModel().uri, this._widget.position); - if (info) { - this._widget.updateMarker(info.marker); - } - else { - this._widget.showStale(); - } - })); - // open related - this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(related => { - this._editorService.openCodeEditor({ - resource: related.resource, - options: { pinned: true, revealIfOpened: true, selection: _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].lift(related).collapseToStart() } - }, this._editor); - this.close(false); - })); - this._sessionDispoables.add(this._editor.onDidChangeModel(() => this._cleanUp())); - return this._model; - } - close(focusEditor = true) { - this._cleanUp(); - if (focusEditor) { - this._editor.focus(); - } - } - showAtMarker(marker) { - if (this._editor.hasModel()) { - const model = this._getOrCreateModel(this._editor.getModel().uri); - model.resetIndex(); - model.move(true, this._editor.getModel(), new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](marker.startLineNumber, marker.startColumn)); - if (model.selected) { - this._widget.showAtMarker(model.selected.marker, model.selected.index, model.selected.total); - } - } - } - nagivate(next, multiFile) { - return __awaiter(this, void 0, void 0, function* () { - if (this._editor.hasModel()) { - const model = this._getOrCreateModel(multiFile ? undefined : this._editor.getModel().uri); - model.move(next, this._editor.getModel(), this._editor.getPosition()); - if (!model.selected) { - return; - } - if (model.selected.marker.resource.toString() !== this._editor.getModel().uri.toString()) { - // show in different editor - this._cleanUp(); - const otherEditor = yield this._editorService.openCodeEditor({ - resource: model.selected.marker.resource, - options: { pinned: false, revealIfOpened: true, selectionRevealType: 2 /* NearTop */, selection: model.selected.marker } - }, this._editor); - if (otherEditor) { - MarkerController.get(otherEditor).close(); - MarkerController.get(otherEditor).nagivate(next, multiFile); - } - } - else { - // show in this editor - this._widget.showAtMarker(model.selected.marker, model.selected.index, model.selected.total); - } - } - }); - } -}; -MarkerController.ID = 'editor.contrib.markerController'; -MarkerController = __decorate([ - __param(1, _markerNavigationService_js__WEBPACK_IMPORTED_MODULE_12__["IMarkerNavigationService"]), - __param(2, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_2__["IContextKeyService"]), - __param(3, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_8__["ICodeEditorService"]), - __param(4, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_11__["IInstantiationService"]) -], MarkerController); - -class MarkerNavigationAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["EditorAction"] { - constructor(_next, _multiFile, opts) { - super(opts); - this._next = _next; - this._multiFile = _multiFile; - } - run(_accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - if (editor.hasModel()) { - MarkerController.get(editor).nagivate(this._next, this._multiFile); - } - }); - } -} -class NextMarkerAction extends MarkerNavigationAction { - constructor() { - super(true, false, { - id: NextMarkerAction.ID, - label: NextMarkerAction.LABEL, - alias: 'Go to Next Problem (Error, Warning, Info)', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__["EditorContextKeys"].focus, - primary: 512 /* Alt */ | 66 /* F8 */, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _gotoErrorWidget_js__WEBPACK_IMPORTED_MODULE_7__["MarkerNavigationWidget"].TitleMenu, - title: NextMarkerAction.LABEL, - icon: Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_10__["registerIcon"])('marker-navigation-next', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_10__["Codicon"].chevronDown), - group: 'navigation', - order: 1 - } - }); - } -} -NextMarkerAction.ID = 'editor.action.marker.next'; -NextMarkerAction.LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('markerAction.next.label', "Go to Next Problem (Error, Warning, Info)"); -class PrevMarkerAction extends MarkerNavigationAction { - constructor() { - super(false, false, { - id: PrevMarkerAction.ID, - label: PrevMarkerAction.LABEL, - alias: 'Go to Previous Problem (Error, Warning, Info)', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__["EditorContextKeys"].focus, - primary: 1024 /* Shift */ | 512 /* Alt */ | 66 /* F8 */, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _gotoErrorWidget_js__WEBPACK_IMPORTED_MODULE_7__["MarkerNavigationWidget"].TitleMenu, - title: NextMarkerAction.LABEL, - icon: Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_10__["registerIcon"])('marker-navigation-previous', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_10__["Codicon"].chevronUp), - group: 'navigation', - order: 2 - } - }); - } -} -PrevMarkerAction.ID = 'editor.action.marker.prev'; -PrevMarkerAction.LABEL = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('markerAction.previous.label', "Go to Previous Problem (Error, Warning, Info)"); -class NextMarkerInFilesAction extends MarkerNavigationAction { - constructor() { - super(true, true, { - id: 'editor.action.marker.nextInFiles', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('markerAction.nextInFiles.label', "Go to Next Problem in Files (Error, Warning, Info)"), - alias: 'Go to Next Problem in Files (Error, Warning, Info)', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__["EditorContextKeys"].focus, - primary: 66 /* F8 */, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_9__["MenuId"].MenubarGoMenu, - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miGotoNextProblem', comment: ['&& denotes a mnemonic'] }, "Next &&Problem"), - group: '6_problem_nav', - order: 1 - } - }); - } -} -class PrevMarkerInFilesAction extends MarkerNavigationAction { - constructor() { - super(false, true, { - id: 'editor.action.marker.prevInFiles', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('markerAction.previousInFiles.label', "Go to Previous Problem in Files (Error, Warning, Info)"), - alias: 'Go to Previous Problem in Files (Error, Warning, Info)', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__["EditorContextKeys"].focus, - primary: 1024 /* Shift */ | 66 /* F8 */, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_9__["MenuId"].MenubarGoMenu, - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miGotoPreviousProblem', comment: ['&& denotes a mnemonic'] }, "Previous &&Problem"), - group: '6_problem_nav', - order: 2 - } - }); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorContribution"])(MarkerController.ID, MarkerController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])(NextMarkerAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])(PrevMarkerAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])(NextMarkerInFilesAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])(PrevMarkerInFilesAction); -const CONTEXT_MARKERS_NAVIGATION_VISIBLE = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_2__["RawContextKey"]('markersNavigationVisible', false); -const MarkerCommand = _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["EditorCommand"].bindToContribution(MarkerController.get); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorCommand"])(new MarkerCommand({ - id: 'closeMarkersNavigation', - precondition: CONTEXT_MARKERS_NAVIGATION_VISIBLE, - handler: x => x.close(), - kbOpts: { - weight: 100 /* EditorContrib */ + 50, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__["EditorContextKeys"].focus, - primary: 9 /* Escape */, - secondary: [1024 /* Shift */ | 9 /* Escape */] - } -})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/gotoErrorWidget.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/gotoErrorWidget.js ***! - \***************************************************************************************/ -/*! exports provided: MarkerNavigationWidget, editorMarkerNavigationError, editorMarkerNavigationWarning, editorMarkerNavigationInfo, editorMarkerNavigationBackground */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerNavigationWidget", function() { return MarkerNavigationWidget; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorMarkerNavigationError", function() { return editorMarkerNavigationError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorMarkerNavigationWarning", function() { return editorMarkerNavigationWarning; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorMarkerNavigationInfo", function() { return editorMarkerNavigationInfo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorMarkerNavigationBackground", function() { return editorMarkerNavigationBackground; }); -/* harmony import */ var _media_gotoErrorWidget_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/gotoErrorWidget.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/media/gotoErrorWidget.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/markers/common/markers.js */ "./node_modules/monaco-editor/esm/vs/platform/markers/common/markers.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _base_browser_ui_scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../base/browser/ui/scrollbar/scrollableElement.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js"); -/* harmony import */ var _base_common_labels_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/common/labels.js */ "./node_modules/monaco-editor/esm/vs/base/common/labels.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../peekView/peekView.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/peekView/peekView.js"); -/* harmony import */ var _base_common_resources_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../base/common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/* harmony import */ var _platform_severityIcon_common_severityIcon_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/severityIcon/common/severityIcon.js */ "./node_modules/monaco-editor/esm/vs/platform/severityIcon/common/severityIcon.js"); -/* harmony import */ var _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/opener/common/opener.js */ "./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_actions_browser_menuEntryActionViewItem_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../platform/actions/browser/menuEntryActionViewItem.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - - - - - - -class MessageWidget { - constructor(parent, editor, onRelatedInformation, _openerService) { - this._openerService = _openerService; - this._lines = 0; - this._longestLineLength = 0; - this._relatedDiagnostics = new WeakMap(); - this._disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - this._editor = editor; - const domNode = document.createElement('div'); - domNode.className = 'descriptioncontainer'; - this._messageBlock = document.createElement('div'); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](this._messageBlock, 'message'); - this._messageBlock.setAttribute('aria-live', 'assertive'); - this._messageBlock.setAttribute('role', 'alert'); - domNode.appendChild(this._messageBlock); - this._relatedBlock = document.createElement('div'); - domNode.appendChild(this._relatedBlock); - this._disposables.add(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addStandardDisposableListener"](this._relatedBlock, 'click', event => { - event.preventDefault(); - const related = this._relatedDiagnostics.get(event.target); - if (related) { - onRelatedInformation(related); - } - })); - this._scrollable = new _base_browser_ui_scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_9__["ScrollableElement"](domNode, { - horizontal: 1 /* Auto */, - vertical: 1 /* Auto */, - useShadows: false, - horizontalScrollbarSize: 3, - verticalScrollbarSize: 3 - }); - parent.appendChild(this._scrollable.getDomNode()); - this._disposables.add(this._scrollable.onScroll(e => { - domNode.style.left = `-${e.scrollLeft}px`; - domNode.style.top = `-${e.scrollTop}px`; - })); - this._disposables.add(this._scrollable); - } - dispose() { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["dispose"])(this._disposables); - } - update(marker) { - const { source, message, relatedInformation, code } = marker; - let sourceAndCodeLength = ((source === null || source === void 0 ? void 0 : source.length) || 0) + '()'.length; - if (code) { - if (typeof code === 'string') { - sourceAndCodeLength += code.length; - } - else { - sourceAndCodeLength += code.value.length; - } - } - const lines = message.split(/\r\n|\r|\n/g); - this._lines = lines.length; - this._longestLineLength = 0; - for (const line of lines) { - this._longestLineLength = Math.max(line.length + sourceAndCodeLength, this._longestLineLength); - } - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["clearNode"](this._messageBlock); - this._messageBlock.setAttribute('aria-label', this.getAriaLabel(marker)); - this._editor.applyFontInfo(this._messageBlock); - let lastLineElement = this._messageBlock; - for (const line of lines) { - lastLineElement = document.createElement('div'); - lastLineElement.innerText = line; - if (line === '') { - lastLineElement.style.height = this._messageBlock.style.lineHeight; - } - this._messageBlock.appendChild(lastLineElement); - } - if (source || code) { - const detailsElement = document.createElement('span'); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](detailsElement, 'details'); - lastLineElement.appendChild(detailsElement); - if (source) { - const sourceElement = document.createElement('span'); - sourceElement.innerText = source; - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](sourceElement, 'source'); - detailsElement.appendChild(sourceElement); - } - if (code) { - if (typeof code === 'string') { - const codeElement = document.createElement('span'); - codeElement.innerText = `(${code})`; - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](codeElement, 'code'); - detailsElement.appendChild(codeElement); - } - else { - this._codeLink = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["$"]('a.code-link'); - this._codeLink.setAttribute('href', `${code.target.toString()}`); - this._codeLink.onclick = (e) => { - this._openerService.open(code.target); - e.preventDefault(); - e.stopPropagation(); - }; - const codeElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](this._codeLink, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["$"]('span')); - codeElement.innerText = code.value; - detailsElement.appendChild(this._codeLink); - } - } - } - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["clearNode"](this._relatedBlock); - this._editor.applyFontInfo(this._relatedBlock); - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_11__["isNonEmptyArray"])(relatedInformation)) { - const relatedInformationNode = this._relatedBlock.appendChild(document.createElement('div')); - relatedInformationNode.style.paddingTop = `${Math.floor(this._editor.getOption(51 /* lineHeight */) * 0.66)}px`; - this._lines += 1; - for (const related of relatedInformation) { - let container = document.createElement('div'); - let relatedResource = document.createElement('a'); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](relatedResource, 'filename'); - relatedResource.innerText = `${Object(_base_common_labels_js__WEBPACK_IMPORTED_MODULE_10__["getBaseLabel"])(related.resource)}(${related.startLineNumber}, ${related.startColumn}): `; - relatedResource.title = Object(_base_common_labels_js__WEBPACK_IMPORTED_MODULE_10__["getPathLabel"])(related.resource, undefined); - this._relatedDiagnostics.set(relatedResource, related); - let relatedMessage = document.createElement('span'); - relatedMessage.innerText = related.message; - container.appendChild(relatedResource); - container.appendChild(relatedMessage); - this._lines += 1; - relatedInformationNode.appendChild(container); - } - } - const fontInfo = this._editor.getOption(36 /* fontInfo */); - const scrollWidth = Math.ceil(fontInfo.typicalFullwidthCharacterWidth * this._longestLineLength * 0.75); - const scrollHeight = fontInfo.lineHeight * this._lines; - this._scrollable.setScrollDimensions({ scrollWidth, scrollHeight }); - } - layout(height, width) { - this._scrollable.getDomNode().style.height = `${height}px`; - this._scrollable.getDomNode().style.width = `${width}px`; - this._scrollable.setScrollDimensions({ width, height }); - } - getHeightInLines() { - return Math.min(17, this._lines); - } - getAriaLabel(marker) { - let severityLabel = ''; - switch (marker.severity) { - case _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_4__["MarkerSeverity"].Error: - severityLabel = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('Error', "Error"); - break; - case _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_4__["MarkerSeverity"].Warning: - severityLabel = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('Warning', "Warning"); - break; - case _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_4__["MarkerSeverity"].Info: - severityLabel = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('Info', "Info"); - break; - case _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_4__["MarkerSeverity"].Hint: - severityLabel = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('Hint', "Hint"); - break; - } - let ariaLabel = _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('marker aria', "{0} at {1}. ", severityLabel, marker.startLineNumber + ':' + marker.startColumn); - const model = this._editor.getModel(); - if (model && (marker.startLineNumber <= model.getLineCount()) && (marker.startLineNumber >= 1)) { - const lineContent = model.getLineContent(marker.startLineNumber); - ariaLabel = `${lineContent}, ${ariaLabel}`; - } - return ariaLabel; - } -} -let MarkerNavigationWidget = class MarkerNavigationWidget extends _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_13__["PeekViewWidget"] { - constructor(editor, _themeService, _openerService, _menuService, instantiationService, _contextKeyService) { - super(editor, { showArrow: true, showFrame: true, isAccessible: true }, instantiationService); - this._themeService = _themeService; - this._openerService = _openerService; - this._menuService = _menuService; - this._contextKeyService = _contextKeyService; - this._callOnDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - this._onDidSelectRelatedInformation = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_12__["Emitter"](); - this.onDidSelectRelatedInformation = this._onDidSelectRelatedInformation.event; - this._severity = _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_4__["MarkerSeverity"].Warning; - this._backgroundColor = _base_common_color_js__WEBPACK_IMPORTED_MODULE_8__["Color"].white; - this._applyTheme(_themeService.getColorTheme()); - this._callOnDispose.add(_themeService.onDidColorThemeChange(this._applyTheme.bind(this))); - this.create(); - } - _applyTheme(theme) { - this._backgroundColor = theme.getColor(editorMarkerNavigationBackground); - let colorId = editorMarkerNavigationError; - if (this._severity === _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_4__["MarkerSeverity"].Warning) { - colorId = editorMarkerNavigationWarning; - } - else if (this._severity === _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_4__["MarkerSeverity"].Info) { - colorId = editorMarkerNavigationInfo; - } - const frameColor = theme.getColor(colorId); - this.style({ - arrowColor: frameColor, - frameColor: frameColor, - headerBackgroundColor: this._backgroundColor, - primaryHeadingColor: theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_13__["peekViewTitleForeground"]), - secondaryHeadingColor: theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_13__["peekViewTitleInfoForeground"]) - }); // style() will trigger _applyStyles - } - _applyStyles() { - if (this._parentContainer) { - this._parentContainer.style.backgroundColor = this._backgroundColor ? this._backgroundColor.toString() : ''; - } - super._applyStyles(); - } - dispose() { - this._callOnDispose.dispose(); - super.dispose(); - } - _fillHead(container) { - super._fillHead(container); - this._disposables.add(this._actionbarWidget.actionRunner.onDidBeforeRun(e => this.editor.focus())); - const actions = []; - const menu = this._menuService.createMenu(MarkerNavigationWidget.TitleMenu, this._contextKeyService); - Object(_platform_actions_browser_menuEntryActionViewItem_js__WEBPACK_IMPORTED_MODULE_19__["createAndFillInActionBarActions"])(menu, undefined, actions); - this._actionbarWidget.push(actions, { label: false, icon: true, index: 0 }); - menu.dispose(); - } - _fillTitleIcon(container) { - this._icon = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["append"](container, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["$"]('')); - } - _getActionBarOptions() { - return Object.assign(Object.assign({}, super._getActionBarOptions()), { orientation: 0 /* HORIZONTAL */ }); - } - _fillBody(container) { - this._parentContainer = container; - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addClass"](container, 'marker-widget'); - this._parentContainer.tabIndex = 0; - this._parentContainer.setAttribute('role', 'tooltip'); - this._container = document.createElement('div'); - container.appendChild(this._container); - this._message = new MessageWidget(this._container, this.editor, related => this._onDidSelectRelatedInformation.fire(related), this._openerService); - this._disposables.add(this._message); - } - show() { - throw new Error('call showAtMarker'); - } - showAtMarker(marker, markerIdx, markerCount) { - // update: - // * title - // * message - this._container.classList.remove('stale'); - this._message.update(marker); - // update frame color (only applied on 'show') - this._severity = marker.severity; - this._applyTheme(this._themeService.getColorTheme()); - // show - let range = _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].lift(marker); - const editorPosition = this.editor.getPosition(); - let position = editorPosition && range.containsPosition(editorPosition) ? editorPosition : range.getStartPosition(); - super.show(position, this.computeRequiredHeight()); - const model = this.editor.getModel(); - if (model) { - const detail = markerCount > 1 - ? _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('problems', "{0} of {1} problems", markerIdx, markerCount) - : _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('change', "{0} of {1} problem", markerIdx, markerCount); - this.setTitle(Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_14__["basename"])(model.uri), detail); - } - this._icon.className = `codicon ${_platform_severityIcon_common_severityIcon_js__WEBPACK_IMPORTED_MODULE_15__["SeverityIcon"].className(_platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_4__["MarkerSeverity"].toSeverity(this._severity))}`; - this.editor.revealPositionNearTop(position, 0 /* Smooth */); - this.editor.focus(); - } - updateMarker(marker) { - this._container.classList.remove('stale'); - this._message.update(marker); - } - showStale() { - this._container.classList.add('stale'); - this._relayout(); - } - _doLayoutBody(heightInPixel, widthInPixel) { - super._doLayoutBody(heightInPixel, widthInPixel); - this._heightInPixel = heightInPixel; - this._message.layout(heightInPixel, widthInPixel); - this._container.style.height = `${heightInPixel}px`; - } - _onWidth(widthInPixel) { - this._message.layout(this._heightInPixel, widthInPixel); - } - _relayout() { - super._relayout(this.computeRequiredHeight()); - } - computeRequiredHeight() { - return 3 + this._message.getHeightInLines(); - } -}; -MarkerNavigationWidget.TitleMenu = new _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_17__["MenuId"]('gotoErrorTitleMenu'); -MarkerNavigationWidget = __decorate([ - __param(1, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__["IThemeService"]), - __param(2, _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_16__["IOpenerService"]), - __param(3, _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_17__["IMenuService"]), - __param(4, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_20__["IInstantiationService"]), - __param(5, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_18__["IContextKeyService"]) -], MarkerNavigationWidget); - -// theming -let errorDefault = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["oneOf"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["editorErrorForeground"], _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["editorErrorBorder"]); -let warningDefault = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["oneOf"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["editorWarningForeground"], _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["editorWarningBorder"]); -let infoDefault = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["oneOf"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["editorInfoForeground"], _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["editorInfoBorder"]); -const editorMarkerNavigationError = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["registerColor"])('editorMarkerNavigationError.background', { dark: errorDefault, light: errorDefault, hc: errorDefault }, _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('editorMarkerNavigationError', 'Editor marker navigation widget error color.')); -const editorMarkerNavigationWarning = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["registerColor"])('editorMarkerNavigationWarning.background', { dark: warningDefault, light: warningDefault, hc: warningDefault }, _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('editorMarkerNavigationWarning', 'Editor marker navigation widget warning color.')); -const editorMarkerNavigationInfo = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["registerColor"])('editorMarkerNavigationInfo.background', { dark: infoDefault, light: infoDefault, hc: infoDefault }, _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('editorMarkerNavigationInfo', 'Editor marker navigation widget info color.')); -const editorMarkerNavigationBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["registerColor"])('editorMarkerNavigation.background', { dark: '#2D2D30', light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_8__["Color"].white, hc: '#0C141F' }, _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('editorMarkerNavigationBackground', 'Editor marker navigation widget background.')); -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_7__["registerThemingParticipant"])((theme, collector) => { - const linkFg = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_6__["textLinkForeground"]); - if (linkFg) { - collector.addRule(`.monaco-editor .marker-widget a { color: ${linkFg}; }`); - collector.addRule(`.monaco-editor .marker-widget a.code-link span:hover { color: ${linkFg}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/markerNavigationService.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/markerNavigationService.js ***! - \***********************************************************************************************/ -/*! exports provided: MarkerCoordinate, MarkerList, IMarkerNavigationService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerCoordinate", function() { return MarkerCoordinate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerList", function() { return MarkerList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IMarkerNavigationService", function() { return IMarkerNavigationService; }); -/* harmony import */ var _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/markers/common/markers.js */ "./node_modules/monaco-editor/esm/vs/platform/markers/common/markers.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/instantiation/common/extensions.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/extensions.js"); -/* harmony import */ var _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../base/common/linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - -class MarkerCoordinate { - constructor(marker, index, total) { - this.marker = marker; - this.index = index; - this.total = total; - } -} -let MarkerList = class MarkerList { - constructor(resourceFilter, _markerService) { - this._markerService = _markerService; - this._onDidChange = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"](); - this.onDidChange = this._onDidChange.event; - this._dispoables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - this._markers = []; - this._nextIdx = -1; - if (_base_common_uri_js__WEBPACK_IMPORTED_MODULE_1__["URI"].isUri(resourceFilter)) { - this._resourceFilter = uri => uri.toString() === resourceFilter.toString(); - } - else if (resourceFilter) { - this._resourceFilter = resourceFilter; - } - const updateMarker = () => { - this._markers = this._markerService.read({ - resource: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_1__["URI"].isUri(resourceFilter) ? resourceFilter : undefined, - severities: _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__["MarkerSeverity"].Error | _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__["MarkerSeverity"].Warning | _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__["MarkerSeverity"].Info - }); - if (typeof resourceFilter === 'function') { - this._markers = this._markers.filter(m => this._resourceFilter(m.resource)); - } - this._markers.sort(MarkerList._compareMarker); - }; - updateMarker(); - this._dispoables.add(_markerService.onMarkerChanged(uris => { - if (!this._resourceFilter || uris.some(uri => this._resourceFilter(uri))) { - updateMarker(); - this._nextIdx = -1; - this._onDidChange.fire(); - } - })); - } - dispose() { - this._dispoables.dispose(); - this._onDidChange.dispose(); - } - matches(uri) { - if (!this._resourceFilter && !uri) { - return true; - } - if (!this._resourceFilter || !uri) { - return false; - } - return this._resourceFilter(uri); - } - get selected() { - const marker = this._markers[this._nextIdx]; - return marker && new MarkerCoordinate(marker, this._nextIdx + 1, this._markers.length); - } - _initIdx(model, position, fwd) { - let found = false; - let idx = this._markers.findIndex(marker => marker.resource.toString() === model.uri.toString()); - if (idx < 0) { - idx = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_6__["binarySearch"])(this._markers, { resource: model.uri }, (a, b) => Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_5__["compare"])(a.resource.toString(), b.resource.toString())); - if (idx < 0) { - idx = ~idx; - } - } - for (let i = idx; i < this._markers.length; i++) { - let range = _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].lift(this._markers[i]); - if (range.isEmpty()) { - const word = model.getWordAtPosition(range.getStartPosition()); - if (word) { - range = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](range.startLineNumber, word.startColumn, range.startLineNumber, word.endColumn); - } - } - if (position && (range.containsPosition(position) || position.isBeforeOrEqual(range.getStartPosition()))) { - this._nextIdx = i; - found = true; - break; - } - if (this._markers[i].resource.toString() !== model.uri.toString()) { - break; - } - } - if (!found) { - // after the last change - this._nextIdx = fwd ? 0 : this._markers.length - 1; - } - if (this._nextIdx < 0) { - this._nextIdx = this._markers.length - 1; - } - } - resetIndex() { - this._nextIdx = -1; - } - move(fwd, model, position) { - if (this._markers.length === 0) { - return false; - } - let oldIdx = this._nextIdx; - if (this._nextIdx === -1) { - this._initIdx(model, position, fwd); - } - else if (fwd) { - this._nextIdx = (this._nextIdx + 1) % this._markers.length; - } - else if (!fwd) { - this._nextIdx = (this._nextIdx - 1 + this._markers.length) % this._markers.length; - } - if (oldIdx !== this._nextIdx) { - return true; - } - return false; - } - find(uri, position) { - let idx = this._markers.findIndex(marker => marker.resource.toString() === uri.toString()); - if (idx < 0) { - return undefined; - } - for (; idx < this._markers.length; idx++) { - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].containsPosition(this._markers[idx], position)) { - return new MarkerCoordinate(this._markers[idx], idx + 1, this._markers.length); - } - } - return undefined; - } - static _compareMarker(a, b) { - let res = Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_5__["compare"])(a.resource.toString(), b.resource.toString()); - if (res === 0) { - res = _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__["MarkerSeverity"].compare(a.severity, b.severity); - } - if (res === 0) { - res = _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].compareRangesUsingStarts(a, b); - } - return res; - } -}; -MarkerList = __decorate([ - __param(1, _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__["IMarkerService"]) -], MarkerList); - -const IMarkerNavigationService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_7__["createDecorator"])('IMarkerNavigationService'); -let MarkerNavigationService = class MarkerNavigationService { - constructor(_markerService) { - this._markerService = _markerService; - this._provider = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_9__["LinkedList"](); - } - getMarkerList(resource) { - for (let provider of this._provider) { - const result = provider.getMarkerList(resource); - if (result) { - return result; - } - } - // default - return new MarkerList(resource, this._markerService); - } -}; -MarkerNavigationService = __decorate([ - __param(0, _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_0__["IMarkerService"]) -], MarkerNavigationService); -Object(_platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_8__["registerSingleton"])(IMarkerNavigationService, MarkerNavigationService, true); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/media/gotoErrorWidget.css": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/media/gotoErrorWidget.css ***! - \**********************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_gotoErrorWidget_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./gotoErrorWidget.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/media/gotoErrorWidget.css"); -/* harmony import */ var _css_loader_dist_cjs_js_gotoErrorWidget_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_gotoErrorWidget_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_gotoErrorWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_gotoErrorWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/documentSymbols.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/documentSymbols.js ***! - \****************************************************************************************/ -/*! exports provided: getDocumentSymbols */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDocumentSymbols", function() { return getDocumentSymbols; }); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/services/resolverService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/resolverService.js"); -/* harmony import */ var _documentSymbols_outlineModel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../documentSymbols/outlineModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/outlineModel.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - -function getDocumentSymbols(document, flat, token) { - return __awaiter(this, void 0, void 0, function* () { - const model = yield _documentSymbols_outlineModel_js__WEBPACK_IMPORTED_MODULE_5__["OutlineModel"].create(document, token); - const roots = []; - for (const child of model.children.values()) { - if (child instanceof _documentSymbols_outlineModel_js__WEBPACK_IMPORTED_MODULE_5__["OutlineElement"]) { - roots.push(child.symbol); - } - else { - roots.push(..._base_common_iterator_js__WEBPACK_IMPORTED_MODULE_8__["Iterable"].map(child.children.values(), child => child.symbol)); - } - } - let flatEntries = []; - if (token.isCancellationRequested) { - return flatEntries; - } - if (flat) { - flatten(flatEntries, roots, ''); - } - else { - flatEntries = roots; - } - return flatEntries.sort(compareEntriesUsingStart); - }); -} -function compareEntriesUsingStart(a, b) { - return _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].compareRangesUsingStarts(a.range, b.range); -} -function flatten(bucket, entries, overrideContainerLabel) { - for (let entry of entries) { - bucket.push({ - kind: entry.kind, - tags: entry.tags, - name: entry.name, - detail: entry.detail, - containerName: entry.containerName || overrideContainerLabel, - range: entry.range, - selectionRange: entry.selectionRange, - children: undefined, - }); - if (entry.children) { - flatten(bucket, entry.children, entry.name); - } - } -} -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_6__["CommandsRegistry"].registerCommand('_executeDocumentSymbolProvider', function (accessor, ...args) { - return __awaiter(this, void 0, void 0, function* () { - const [resource] = args; - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_7__["assertType"])(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__["URI"].isUri(resource)); - const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_2__["IModelService"]).getModel(resource); - if (model) { - return getDocumentSymbols(model, false, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_3__["CancellationToken"].None); - } - const reference = yield accessor.get(_common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_4__["ITextModelService"]).createModelReference(resource); - try { - return yield getDocumentSymbols(reference.object.textEditorModel, false, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_3__["CancellationToken"].None); - } - finally { - reference.dispose(); - } - }); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/goToCommands.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/goToCommands.js ***! - \*************************************************************************************/ -/*! exports provided: DefinitionAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefinitionAction", function() { return DefinitionAction; }); -/* harmony import */ var _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/ui/aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorBrowser.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorBrowser.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _message_messageController_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../message/messageController.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/message/messageController.js"); -/* harmony import */ var _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../peekView/peekView.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/peekView/peekView.js"); -/* harmony import */ var _peek_referencesController_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./peek/referencesController.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesController.js"); -/* harmony import */ var _referencesModel_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./referencesModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/referencesModel.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../platform/progress/common/progress.js */ "./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js"); -/* harmony import */ var _goToSymbol_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./goToSymbol.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/goToSymbol.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../browser/core/editorState.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/core/editorState.js"); -/* harmony import */ var _symbolNavigation_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./symbolNavigation.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/symbolNavigation.js"); -/* harmony import */ var _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../../base/browser/browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _browser_widget_embeddedCodeEditorWidget_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../browser/widget/embeddedCodeEditorWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/embeddedCodeEditorWidget.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var _a, _b, _c, _d, _e, _f, _g, _h; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -_platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuRegistry"].appendMenuItem(_platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuId"].EditorContext, { - submenu: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuId"].EditorContextPeek, - title: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('peek.submenu', "Peek"), - group: 'navigation', - order: 100 -}); -class SymbolNavigationAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["EditorAction"] { - constructor(configuration, opts) { - super(opts); - this._configuration = configuration; - } - run(accessor, editor) { - if (!editor.hasModel()) { - return Promise.resolve(undefined); - } - const notificationService = accessor.get(_platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_18__["INotificationService"]); - const editorService = accessor.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_6__["ICodeEditorService"]); - const progressService = accessor.get(_platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_19__["IEditorProgressService"]); - const symbolNavService = accessor.get(_symbolNavigation_js__WEBPACK_IMPORTED_MODULE_23__["ISymbolNavigationService"]); - const model = editor.getModel(); - const pos = editor.getPosition(); - const cts = new _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_22__["EditorStateCancellationTokenSource"](editor, 1 /* Value */ | 4 /* Position */); - const promise = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_1__["raceCancellation"])(this._getLocationModel(model, pos, cts.token), cts.token).then((references) => __awaiter(this, void 0, void 0, function* () { - if (!references || cts.token.isCancellationRequested) { - return; - } - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_0__["alert"])(references.ariaMessage); - let altAction; - if (references.referenceAt(model.uri, pos)) { - const altActionId = this._getAlternativeCommand(editor); - if (altActionId !== this.id) { - altAction = editor.getAction(altActionId); - } - } - const referenceCount = references.references.length; - if (referenceCount === 0) { - // no result -> show message - if (!this._configuration.muteMessage) { - const info = model.getWordAtPosition(pos); - _message_messageController_js__WEBPACK_IMPORTED_MODULE_11__["MessageController"].get(editor).showMessage(this._getNoResultFoundMessage(info), pos); - } - } - else if (referenceCount === 1 && altAction) { - // already at the only result, run alternative - altAction.run(); - } - else { - // normal results handling - return this._onResult(editorService, symbolNavService, editor, references); - } - }), (err) => { - // report an error - notificationService.error(err); - }).finally(() => { - cts.dispose(); - }); - progressService.showWhile(promise, 250); - return promise; - } - _onResult(editorService, symbolNavService, editor, model) { - return __awaiter(this, void 0, void 0, function* () { - const gotoLocation = this._getGoToPreference(editor); - if (!(editor instanceof _browser_widget_embeddedCodeEditorWidget_js__WEBPACK_IMPORTED_MODULE_28__["EmbeddedCodeEditorWidget"]) && (this._configuration.openInPeek || (gotoLocation === 'peek' && model.references.length > 1))) { - this._openInPeek(editor, model); - } - else { - const next = model.firstReference(); - const peek = model.references.length > 1 && gotoLocation === 'gotoAndPeek'; - const targetEditor = yield this._openReference(editor, editorService, next, this._configuration.openToSide, !peek); - if (peek && targetEditor) { - this._openInPeek(targetEditor, model); - } - else { - model.dispose(); - } - // keep remaining locations around when using - // 'goto'-mode - if (gotoLocation === 'goto') { - symbolNavService.put(next); - } - } - }); - } - _openReference(editor, editorService, reference, sideBySide, highlight) { - return __awaiter(this, void 0, void 0, function* () { - // range is the target-selection-range when we have one - // and the fallback is the 'full' range - let range = undefined; - if (Object(_common_modes_js__WEBPACK_IMPORTED_MODULE_10__["isLocationLink"])(reference)) { - range = reference.targetSelectionRange; - } - if (!range) { - range = reference.range; - } - const targetEditor = yield editorService.openCodeEditor({ - resource: reference.uri, - options: { - selection: _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].collapseToStart(range), - selectionRevealType: 3 /* NearTopIfOutsideViewport */ - } - }, editor, sideBySide); - if (!targetEditor) { - return undefined; - } - if (highlight) { - const modelNow = targetEditor.getModel(); - const ids = targetEditor.deltaDecorations([], [{ range, options: { className: 'symbolHighlight' } }]); - setTimeout(() => { - if (targetEditor.getModel() === modelNow) { - targetEditor.deltaDecorations(ids, []); - } - }, 350); - } - return targetEditor; - }); - } - _openInPeek(target, model) { - let controller = _peek_referencesController_js__WEBPACK_IMPORTED_MODULE_13__["ReferencesController"].get(target); - if (controller && target.hasModel()) { - controller.toggleWidget(target.getSelection(), Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_1__["createCancelablePromise"])(_ => Promise.resolve(model)), this._configuration.openInPeek); - } - else { - model.dispose(); - } - } -} -//#region --- DEFINITION -class DefinitionAction extends SymbolNavigationAction { - _getLocationModel(model, position, token) { - return __awaiter(this, void 0, void 0, function* () { - return new _referencesModel_js__WEBPACK_IMPORTED_MODULE_14__["ReferencesModel"](yield Object(_goToSymbol_js__WEBPACK_IMPORTED_MODULE_20__["getDefinitionsAtPosition"])(model, position, token), _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('def.title', 'Definitions')); - }); - } - _getNoResultFoundMessage(info) { - return info && info.word - ? _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('noResultWord', "No definition found for '{0}'", info.word) - : _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('generic.noResults', "No definition found"); - } - _getAlternativeCommand(editor) { - return editor.getOption(43 /* gotoLocation */).alternativeDefinitionCommand; - } - _getGoToPreference(editor) { - return editor.getOption(43 /* gotoLocation */).multipleDefinitions; - } -} -const goToDefinitionKb = _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__["isWeb"] && !_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_24__["isStandalone"] - ? 2048 /* CtrlCmd */ | 70 /* F12 */ - : 70 /* F12 */; -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])((_a = class GoToDefinitionAction extends DefinitionAction { - constructor() { - super({ - openToSide: false, - openInPeek: false, - muteMessage: false - }, { - id: GoToDefinitionAction.id, - label: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('actions.goToDecl.label', "Go to Definition"), - alias: 'Go to Definition', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].hasDefinitionProvider, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].isInWalkThroughSnippet.toNegated()), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].editorTextFocus, - primary: goToDefinitionKb, - weight: 100 /* EditorContrib */ - }, - contextMenuOpts: { - group: 'navigation', - order: 1.1 - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuId"].MenubarGoMenu, - group: '4_symbol_nav', - order: 2, - title: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]({ key: 'miGotoDefinition', comment: ['&& denotes a mnemonic'] }, "Go to &&Definition") - } - }); - _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_21__["CommandsRegistry"].registerCommandAlias('editor.action.goToDeclaration', GoToDefinitionAction.id); - } - }, - _a.id = 'editor.action.revealDefinition', - _a)); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])((_b = class OpenDefinitionToSideAction extends DefinitionAction { - constructor() { - super({ - openToSide: true, - openInPeek: false, - muteMessage: false - }, { - id: OpenDefinitionToSideAction.id, - label: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('actions.goToDeclToSide.label', "Open Definition to the Side"), - alias: 'Open Definition to the Side', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].hasDefinitionProvider, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].isInWalkThroughSnippet.toNegated()), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, goToDefinitionKb), - weight: 100 /* EditorContrib */ - } - }); - _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_21__["CommandsRegistry"].registerCommandAlias('editor.action.openDeclarationToTheSide', OpenDefinitionToSideAction.id); - } - }, - _b.id = 'editor.action.revealDefinitionAside', - _b)); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])((_c = class PeekDefinitionAction extends DefinitionAction { - constructor() { - super({ - openToSide: false, - openInPeek: true, - muteMessage: false - }, { - id: PeekDefinitionAction.id, - label: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('actions.previewDecl.label', "Peek Definition"), - alias: 'Peek Definition', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].hasDefinitionProvider, _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_12__["PeekContext"].notInPeekEditor, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].isInWalkThroughSnippet.toNegated()), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].editorTextFocus, - primary: 512 /* Alt */ | 70 /* F12 */, - linux: { primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 68 /* F10 */ }, - weight: 100 /* EditorContrib */ - }, - contextMenuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuId"].EditorContextPeek, - group: 'peek', - order: 2 - } - }); - _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_21__["CommandsRegistry"].registerCommandAlias('editor.action.previewDeclaration', PeekDefinitionAction.id); - } - }, - _c.id = 'editor.action.peekDefinition', - _c)); -//#endregion -//#region --- DECLARATION -class DeclarationAction extends SymbolNavigationAction { - _getLocationModel(model, position, token) { - return __awaiter(this, void 0, void 0, function* () { - return new _referencesModel_js__WEBPACK_IMPORTED_MODULE_14__["ReferencesModel"](yield Object(_goToSymbol_js__WEBPACK_IMPORTED_MODULE_20__["getDeclarationsAtPosition"])(model, position, token), _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('decl.title', 'Declarations')); - }); - } - _getNoResultFoundMessage(info) { - return info && info.word - ? _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('decl.noResultWord', "No declaration found for '{0}'", info.word) - : _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('decl.generic.noResults', "No declaration found"); - } - _getAlternativeCommand(editor) { - return editor.getOption(43 /* gotoLocation */).alternativeDeclarationCommand; - } - _getGoToPreference(editor) { - return editor.getOption(43 /* gotoLocation */).multipleDeclarations; - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])((_d = class GoToDeclarationAction extends DeclarationAction { - constructor() { - super({ - openToSide: false, - openInPeek: false, - muteMessage: false - }, { - id: GoToDeclarationAction.id, - label: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('actions.goToDeclaration.label', "Go to Declaration"), - alias: 'Go to Declaration', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].hasDeclarationProvider, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].isInWalkThroughSnippet.toNegated()), - contextMenuOpts: { - group: 'navigation', - order: 1.3 - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuId"].MenubarGoMenu, - group: '4_symbol_nav', - order: 3, - title: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]({ key: 'miGotoDeclaration', comment: ['&& denotes a mnemonic'] }, "Go to &&Declaration") - }, - }); - } - _getNoResultFoundMessage(info) { - return info && info.word - ? _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('decl.noResultWord', "No declaration found for '{0}'", info.word) - : _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('decl.generic.noResults', "No declaration found"); - } - }, - _d.id = 'editor.action.revealDeclaration', - _d)); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])(class PeekDeclarationAction extends DeclarationAction { - constructor() { - super({ - openToSide: false, - openInPeek: true, - muteMessage: false - }, { - id: 'editor.action.peekDeclaration', - label: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('actions.peekDecl.label', "Peek Declaration"), - alias: 'Peek Declaration', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].hasDeclarationProvider, _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_12__["PeekContext"].notInPeekEditor, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].isInWalkThroughSnippet.toNegated()), - contextMenuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuId"].EditorContextPeek, - group: 'peek', - order: 3 - } - }); - } -}); -//#endregion -//#region --- TYPE DEFINITION -class TypeDefinitionAction extends SymbolNavigationAction { - _getLocationModel(model, position, token) { - return __awaiter(this, void 0, void 0, function* () { - return new _referencesModel_js__WEBPACK_IMPORTED_MODULE_14__["ReferencesModel"](yield Object(_goToSymbol_js__WEBPACK_IMPORTED_MODULE_20__["getTypeDefinitionsAtPosition"])(model, position, token), _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('typedef.title', 'Type Definitions')); - }); - } - _getNoResultFoundMessage(info) { - return info && info.word - ? _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('goToTypeDefinition.noResultWord', "No type definition found for '{0}'", info.word) - : _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('goToTypeDefinition.generic.noResults', "No type definition found"); - } - _getAlternativeCommand(editor) { - return editor.getOption(43 /* gotoLocation */).alternativeTypeDefinitionCommand; - } - _getGoToPreference(editor) { - return editor.getOption(43 /* gotoLocation */).multipleTypeDefinitions; - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])((_e = class GoToTypeDefinitionAction extends TypeDefinitionAction { - constructor() { - super({ - openToSide: false, - openInPeek: false, - muteMessage: false - }, { - id: GoToTypeDefinitionAction.ID, - label: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('actions.goToTypeDefinition.label', "Go to Type Definition"), - alias: 'Go to Type Definition', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].hasTypeDefinitionProvider, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].isInWalkThroughSnippet.toNegated()), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].editorTextFocus, - primary: 0, - weight: 100 /* EditorContrib */ - }, - contextMenuOpts: { - group: 'navigation', - order: 1.4 - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuId"].MenubarGoMenu, - group: '4_symbol_nav', - order: 3, - title: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]({ key: 'miGotoTypeDefinition', comment: ['&& denotes a mnemonic'] }, "Go to &&Type Definition") - } - }); - } - }, - _e.ID = 'editor.action.goToTypeDefinition', - _e)); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])((_f = class PeekTypeDefinitionAction extends TypeDefinitionAction { - constructor() { - super({ - openToSide: false, - openInPeek: true, - muteMessage: false - }, { - id: PeekTypeDefinitionAction.ID, - label: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('actions.peekTypeDefinition.label', "Peek Type Definition"), - alias: 'Peek Type Definition', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].hasTypeDefinitionProvider, _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_12__["PeekContext"].notInPeekEditor, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].isInWalkThroughSnippet.toNegated()), - contextMenuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuId"].EditorContextPeek, - group: 'peek', - order: 4 - } - }); - } - }, - _f.ID = 'editor.action.peekTypeDefinition', - _f)); -//#endregion -//#region --- IMPLEMENTATION -class ImplementationAction extends SymbolNavigationAction { - _getLocationModel(model, position, token) { - return __awaiter(this, void 0, void 0, function* () { - return new _referencesModel_js__WEBPACK_IMPORTED_MODULE_14__["ReferencesModel"](yield Object(_goToSymbol_js__WEBPACK_IMPORTED_MODULE_20__["getImplementationsAtPosition"])(model, position, token), _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('impl.title', 'Implementations')); - }); - } - _getNoResultFoundMessage(info) { - return info && info.word - ? _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('goToImplementation.noResultWord', "No implementation found for '{0}'", info.word) - : _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('goToImplementation.generic.noResults', "No implementation found"); - } - _getAlternativeCommand(editor) { - return editor.getOption(43 /* gotoLocation */).alternativeImplementationCommand; - } - _getGoToPreference(editor) { - return editor.getOption(43 /* gotoLocation */).multipleImplementations; - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])((_g = class GoToImplementationAction extends ImplementationAction { - constructor() { - super({ - openToSide: false, - openInPeek: false, - muteMessage: false - }, { - id: GoToImplementationAction.ID, - label: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('actions.goToImplementation.label', "Go to Implementations"), - alias: 'Go to Implementations', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].hasImplementationProvider, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].isInWalkThroughSnippet.toNegated()), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 70 /* F12 */, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuId"].MenubarGoMenu, - group: '4_symbol_nav', - order: 4, - title: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]({ key: 'miGotoImplementation', comment: ['&& denotes a mnemonic'] }, "Go to &&Implementations") - }, - contextMenuOpts: { - group: 'navigation', - order: 1.45 - } - }); - } - }, - _g.ID = 'editor.action.goToImplementation', - _g)); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])((_h = class PeekImplementationAction extends ImplementationAction { - constructor() { - super({ - openToSide: false, - openInPeek: true, - muteMessage: false - }, { - id: PeekImplementationAction.ID, - label: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('actions.peekImplementation.label', "Peek Implementations"), - alias: 'Peek Implementations', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].hasImplementationProvider, _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_12__["PeekContext"].notInPeekEditor, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].isInWalkThroughSnippet.toNegated()), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 70 /* F12 */, - weight: 100 /* EditorContrib */ - }, - contextMenuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuId"].EditorContextPeek, - group: 'peek', - order: 5 - } - }); - } - }, - _h.ID = 'editor.action.peekImplementation', - _h)); -//#endregion -//#region --- REFERENCES -class ReferencesAction extends SymbolNavigationAction { - _getNoResultFoundMessage(info) { - return info - ? _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('references.no', "No references found for '{0}'", info.word) - : _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('references.noGeneric', "No references found"); - } - _getAlternativeCommand(editor) { - return editor.getOption(43 /* gotoLocation */).alternativeReferenceCommand; - } - _getGoToPreference(editor) { - return editor.getOption(43 /* gotoLocation */).multipleReferences; - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])(class GoToReferencesAction extends ReferencesAction { - constructor() { - super({ - openToSide: false, - openInPeek: false, - muteMessage: false - }, { - id: 'editor.action.goToReferences', - label: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('goToReferences.label', "Go to References"), - alias: 'Go to References', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].hasReferenceProvider, _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_12__["PeekContext"].notInPeekEditor, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].isInWalkThroughSnippet.toNegated()), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].editorTextFocus, - primary: 1024 /* Shift */ | 70 /* F12 */, - weight: 100 /* EditorContrib */ - }, - contextMenuOpts: { - group: 'navigation', - order: 1.45 - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuId"].MenubarGoMenu, - group: '4_symbol_nav', - order: 5, - title: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]({ key: 'miGotoReference', comment: ['&& denotes a mnemonic'] }, "Go to &&References") - }, - }); - } - _getLocationModel(model, position, token) { - return __awaiter(this, void 0, void 0, function* () { - return new _referencesModel_js__WEBPACK_IMPORTED_MODULE_14__["ReferencesModel"](yield Object(_goToSymbol_js__WEBPACK_IMPORTED_MODULE_20__["getReferencesAtPosition"])(model, position, true, token), _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('ref.title', 'References')); - }); - } -}); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])(class PeekReferencesAction extends ReferencesAction { - constructor() { - super({ - openToSide: false, - openInPeek: true, - muteMessage: false - }, { - id: 'editor.action.referenceSearch.trigger', - label: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('references.action.label', "Peek References"), - alias: 'Peek References', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].hasReferenceProvider, _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_12__["PeekContext"].notInPeekEditor, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].isInWalkThroughSnippet.toNegated()), - contextMenuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_16__["MenuId"].EditorContextPeek, - group: 'peek', - order: 6 - } - }); - } - _getLocationModel(model, position, token) { - return __awaiter(this, void 0, void 0, function* () { - return new _referencesModel_js__WEBPACK_IMPORTED_MODULE_14__["ReferencesModel"](yield Object(_goToSymbol_js__WEBPACK_IMPORTED_MODULE_20__["getReferencesAtPosition"])(model, position, false, token), _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('ref.title', 'References')); - }); - } -}); -//#endregion -//#region --- GENERIC goto symbols command -class GenericGoToLocationAction extends SymbolNavigationAction { - constructor(config, _references, _gotoMultipleBehaviour) { - super(config, { - id: 'editor.action.goToLocation', - label: _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('label.generic', "Go To Any Symbol"), - alias: 'Go To Any Symbol', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyExpr"].and(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_12__["PeekContext"].notInPeekEditor, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].isInWalkThroughSnippet.toNegated()), - }); - this._references = _references; - this._gotoMultipleBehaviour = _gotoMultipleBehaviour; - } - _getLocationModel(_model, _position, _token) { - return __awaiter(this, void 0, void 0, function* () { - return new _referencesModel_js__WEBPACK_IMPORTED_MODULE_14__["ReferencesModel"](this._references, _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('generic.title', 'Locations')); - }); - } - _getNoResultFoundMessage(info) { - return info && _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('generic.noResult', "No results for '{0}'", info.word) || ''; - } - _getGoToPreference(editor) { - var _a; - return (_a = this._gotoMultipleBehaviour) !== null && _a !== void 0 ? _a : editor.getOption(43 /* gotoLocation */).multipleReferences; - } - _getAlternativeCommand() { return ''; } -} -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_21__["CommandsRegistry"].registerCommand({ - id: 'editor.action.goToLocations', - description: { - description: 'Go to locations from a position in a file', - args: [ - { name: 'uri', description: 'The text document in which to start', constraint: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_25__["URI"] }, - { name: 'position', description: 'The position at which to start', constraint: _common_core_position_js__WEBPACK_IMPORTED_MODULE_7__["Position"].isIPosition }, - { name: 'locations', description: 'An array of locations.', constraint: Array }, - { name: 'multiple', description: 'Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto' }, - { name: 'noResultsMessage', description: 'Human readable message that shows when locations is empty.' }, - ] - }, - handler: (accessor, resource, position, references, multiple, noResultsMessage, openInPeek) => __awaiter(void 0, void 0, void 0, function* () { - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_27__["assertType"])(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_25__["URI"].isUri(resource)); - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_27__["assertType"])(_common_core_position_js__WEBPACK_IMPORTED_MODULE_7__["Position"].isIPosition(position)); - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_27__["assertType"])(Array.isArray(references)); - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_27__["assertType"])(typeof multiple === 'undefined' || typeof multiple === 'string'); - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_27__["assertType"])(typeof openInPeek === 'undefined' || typeof openInPeek === 'boolean'); - const editorService = accessor.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_6__["ICodeEditorService"]); - const editor = yield editorService.openCodeEditor({ resource }, editorService.getFocusedCodeEditor()); - if (Object(_browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_4__["isCodeEditor"])(editor)) { - editor.setPosition(position); - editor.revealPositionInCenterIfOutsideViewport(position, 0 /* Smooth */); - return editor.invokeWithinContext(accessor => { - const command = new class extends GenericGoToLocationAction { - _getNoResultFoundMessage(info) { - return noResultsMessage || super._getNoResultFoundMessage(info); - } - }({ - muteMessage: !Boolean(noResultsMessage), - openInPeek: Boolean(openInPeek), - openToSide: false - }, references, multiple); - accessor.get(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_26__["IInstantiationService"]).invokeFunction(command.run.bind(command), editor); - }); - } - }) -}); -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_21__["CommandsRegistry"].registerCommand({ - id: 'editor.action.peekLocations', - description: { - description: 'Peek locations from a position in a file', - args: [ - { name: 'uri', description: 'The text document in which to start', constraint: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_25__["URI"] }, - { name: 'position', description: 'The position at which to start', constraint: _common_core_position_js__WEBPACK_IMPORTED_MODULE_7__["Position"].isIPosition }, - { name: 'locations', description: 'An array of locations.', constraint: Array }, - { name: 'multiple', description: 'Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto' }, - ] - }, - handler: (accessor, resource, position, references, multiple) => __awaiter(void 0, void 0, void 0, function* () { - accessor.get(_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_21__["ICommandService"]).executeCommand('editor.action.goToLocations', resource, position, references, multiple, undefined, true); - }) -}); -//#endregion -//#region --- REFERENCE search special commands -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_21__["CommandsRegistry"].registerCommand({ - id: 'editor.action.findReferences', - handler: (accessor, resource, position) => { - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_27__["assertType"])(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_25__["URI"].isUri(resource)); - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_27__["assertType"])(_common_core_position_js__WEBPACK_IMPORTED_MODULE_7__["Position"].isIPosition(position)); - const codeEditorService = accessor.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_6__["ICodeEditorService"]); - return codeEditorService.openCodeEditor({ resource }, codeEditorService.getFocusedCodeEditor()).then(control => { - if (!Object(_browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_4__["isCodeEditor"])(control) || !control.hasModel()) { - return undefined; - } - const controller = _peek_referencesController_js__WEBPACK_IMPORTED_MODULE_13__["ReferencesController"].get(control); - if (!controller) { - return undefined; - } - const references = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_1__["createCancelablePromise"])(token => Object(_goToSymbol_js__WEBPACK_IMPORTED_MODULE_20__["getReferencesAtPosition"])(control.getModel(), _common_core_position_js__WEBPACK_IMPORTED_MODULE_7__["Position"].lift(position), false, token).then(references => new _referencesModel_js__WEBPACK_IMPORTED_MODULE_14__["ReferencesModel"](references, _nls_js__WEBPACK_IMPORTED_MODULE_15__["localize"]('ref.title', 'References')))); - const range = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"](position.lineNumber, position.column, position.lineNumber, position.column); - return Promise.resolve(controller.toggleWidget(range, references, false)); - }); - } -}); -// use NEW command -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_21__["CommandsRegistry"].registerCommandAlias('editor.action.showReferences', 'editor.action.peekLocations'); -//#endregion - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/goToSymbol.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/goToSymbol.js ***! - \***********************************************************************************/ -/*! exports provided: getDefinitionsAtPosition, getDeclarationsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition, getReferencesAtPosition */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDefinitionsAtPosition", function() { return getDefinitionsAtPosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDeclarationsAtPosition", function() { return getDeclarationsAtPosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getImplementationsAtPosition", function() { return getImplementationsAtPosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTypeDefinitionsAtPosition", function() { return getTypeDefinitionsAtPosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getReferencesAtPosition", function() { return getReferencesAtPosition; }); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - -function getLocationLinks(model, position, registry, provide) { - const provider = registry.ordered(model); - // get results - const promises = provider.map((provider) => { - return Promise.resolve(provide(provider, model, position)).then(undefined, err => { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedExternalError"])(err); - return undefined; - }); - }); - return Promise.all(promises).then(values => { - const result = []; - for (let value of values) { - if (Array.isArray(value)) { - result.push(...value); - } - else if (value) { - result.push(value); - } - } - return result; - }); -} -function getDefinitionsAtPosition(model, position, token) { - return getLocationLinks(model, position, _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["DefinitionProviderRegistry"], (provider, model, position) => { - return provider.provideDefinition(model, position, token); - }); -} -function getDeclarationsAtPosition(model, position, token) { - return getLocationLinks(model, position, _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["DeclarationProviderRegistry"], (provider, model, position) => { - return provider.provideDeclaration(model, position, token); - }); -} -function getImplementationsAtPosition(model, position, token) { - return getLocationLinks(model, position, _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["ImplementationProviderRegistry"], (provider, model, position) => { - return provider.provideImplementation(model, position, token); - }); -} -function getTypeDefinitionsAtPosition(model, position, token) { - return getLocationLinks(model, position, _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["TypeDefinitionProviderRegistry"], (provider, model, position) => { - return provider.provideTypeDefinition(model, position, token); - }); -} -function getReferencesAtPosition(model, position, compact, token) { - return getLocationLinks(model, position, _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["ReferenceProviderRegistry"], (provider, model, position) => __awaiter(this, void 0, void 0, function* () { - const result = yield provider.provideReferences(model, position, { includeDeclaration: true }, token); - if (!compact || !result || result.length !== 2) { - return result; - } - const resultWithoutDeclaration = yield provider.provideReferences(model, position, { includeDeclaration: false }, token); - if (resultWithoutDeclaration && resultWithoutDeclaration.length === 1) { - return resultWithoutDeclaration; - } - return result; - })); -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerModelAndPositionCommand"])('_executeDefinitionProvider', (model, position) => getDefinitionsAtPosition(model, position, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationToken"].None)); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerModelAndPositionCommand"])('_executeDeclarationProvider', (model, position) => getDeclarationsAtPosition(model, position, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationToken"].None)); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerModelAndPositionCommand"])('_executeImplementationProvider', (model, position) => getImplementationsAtPosition(model, position, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationToken"].None)); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerModelAndPositionCommand"])('_executeTypeDefinitionProvider', (model, position) => getTypeDefinitionsAtPosition(model, position, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationToken"].None)); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerModelAndPositionCommand"])('_executeReferenceProvider', (model, position) => getReferencesAtPosition(model, position, false, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationToken"].None)); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/link/clickLinkGesture.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/link/clickLinkGesture.js ***! - \**********************************************************************************************/ -/*! exports provided: ClickLinkMouseEvent, ClickLinkKeyboardEvent, ClickLinkOptions, ClickLinkGesture */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClickLinkMouseEvent", function() { return ClickLinkMouseEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClickLinkKeyboardEvent", function() { return ClickLinkKeyboardEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClickLinkOptions", function() { return ClickLinkOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClickLinkGesture", function() { return ClickLinkGesture; }); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -function hasModifier(e, modifier) { - return !!e[modifier]; -} -/** - * An event that encapsulates the various trigger modifiers logic needed for go to definition. - */ -class ClickLinkMouseEvent { - constructor(source, opts) { - this.target = source.target; - this.hasTriggerModifier = hasModifier(source.event, opts.triggerModifier); - this.hasSideBySideModifier = hasModifier(source.event, opts.triggerSideBySideModifier); - this.isNoneOrSingleMouseDown = (source.event.detail <= 1); - } -} -/** - * An event that encapsulates the various trigger modifiers logic needed for go to definition. - */ -class ClickLinkKeyboardEvent { - constructor(source, opts) { - this.keyCodeIsTriggerKey = (source.keyCode === opts.triggerKey); - this.keyCodeIsSideBySideKey = (source.keyCode === opts.triggerSideBySideKey); - this.hasTriggerModifier = hasModifier(source, opts.triggerModifier); - } -} -class ClickLinkOptions { - constructor(triggerKey, triggerModifier, triggerSideBySideKey, triggerSideBySideModifier) { - this.triggerKey = triggerKey; - this.triggerModifier = triggerModifier; - this.triggerSideBySideKey = triggerSideBySideKey; - this.triggerSideBySideModifier = triggerSideBySideModifier; - } - equals(other) { - return (this.triggerKey === other.triggerKey - && this.triggerModifier === other.triggerModifier - && this.triggerSideBySideKey === other.triggerSideBySideKey - && this.triggerSideBySideModifier === other.triggerSideBySideModifier); - } -} -function createOptions(multiCursorModifier) { - if (multiCursorModifier === 'altKey') { - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"]) { - return new ClickLinkOptions(57 /* Meta */, 'metaKey', 6 /* Alt */, 'altKey'); - } - return new ClickLinkOptions(5 /* Ctrl */, 'ctrlKey', 6 /* Alt */, 'altKey'); - } - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"]) { - return new ClickLinkOptions(6 /* Alt */, 'altKey', 57 /* Meta */, 'metaKey'); - } - return new ClickLinkOptions(6 /* Alt */, 'altKey', 5 /* Ctrl */, 'ctrlKey'); -} -class ClickLinkGesture extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["Disposable"] { - constructor(editor) { - super(); - this._onMouseMoveOrRelevantKeyDown = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onMouseMoveOrRelevantKeyDown = this._onMouseMoveOrRelevantKeyDown.event; - this._onExecute = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onExecute = this._onExecute.event; - this._onCancel = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onCancel = this._onCancel.event; - this._editor = editor; - this._opts = createOptions(this._editor.getOption(61 /* multiCursorModifier */)); - this._lastMouseMoveEvent = null; - this._hasTriggerKeyOnMouseDown = false; - this._lineNumberOnMouseDown = 0; - this._register(this._editor.onDidChangeConfiguration((e) => { - if (e.hasChanged(61 /* multiCursorModifier */)) { - const newOpts = createOptions(this._editor.getOption(61 /* multiCursorModifier */)); - if (this._opts.equals(newOpts)) { - return; - } - this._opts = newOpts; - this._lastMouseMoveEvent = null; - this._hasTriggerKeyOnMouseDown = false; - this._lineNumberOnMouseDown = 0; - this._onCancel.fire(); - } - })); - this._register(this._editor.onMouseMove((e) => this._onEditorMouseMove(new ClickLinkMouseEvent(e, this._opts)))); - this._register(this._editor.onMouseDown((e) => this._onEditorMouseDown(new ClickLinkMouseEvent(e, this._opts)))); - this._register(this._editor.onMouseUp((e) => this._onEditorMouseUp(new ClickLinkMouseEvent(e, this._opts)))); - this._register(this._editor.onKeyDown((e) => this._onEditorKeyDown(new ClickLinkKeyboardEvent(e, this._opts)))); - this._register(this._editor.onKeyUp((e) => this._onEditorKeyUp(new ClickLinkKeyboardEvent(e, this._opts)))); - this._register(this._editor.onMouseDrag(() => this._resetHandler())); - this._register(this._editor.onDidChangeCursorSelection((e) => this._onDidChangeCursorSelection(e))); - this._register(this._editor.onDidChangeModel((e) => this._resetHandler())); - this._register(this._editor.onDidChangeModelContent(() => this._resetHandler())); - this._register(this._editor.onDidScrollChange((e) => { - if (e.scrollTopChanged || e.scrollLeftChanged) { - this._resetHandler(); - } - })); - } - _onDidChangeCursorSelection(e) { - if (e.selection && e.selection.startColumn !== e.selection.endColumn) { - this._resetHandler(); // immediately stop this feature if the user starts to select (https://github.com/Microsoft/vscode/issues/7827) - } - } - _onEditorMouseMove(mouseEvent) { - this._lastMouseMoveEvent = mouseEvent; - this._onMouseMoveOrRelevantKeyDown.fire([mouseEvent, null]); - } - _onEditorMouseDown(mouseEvent) { - // We need to record if we had the trigger key on mouse down because someone might select something in the editor - // holding the mouse down and then while mouse is down start to press Ctrl/Cmd to start a copy operation and then - // release the mouse button without wanting to do the navigation. - // With this flag we prevent goto definition if the mouse was down before the trigger key was pressed. - this._hasTriggerKeyOnMouseDown = mouseEvent.hasTriggerModifier; - this._lineNumberOnMouseDown = mouseEvent.target.position ? mouseEvent.target.position.lineNumber : 0; - } - _onEditorMouseUp(mouseEvent) { - const currentLineNumber = mouseEvent.target.position ? mouseEvent.target.position.lineNumber : 0; - if (this._hasTriggerKeyOnMouseDown && this._lineNumberOnMouseDown && this._lineNumberOnMouseDown === currentLineNumber) { - this._onExecute.fire(mouseEvent); - } - } - _onEditorKeyDown(e) { - if (this._lastMouseMoveEvent - && (e.keyCodeIsTriggerKey // User just pressed Ctrl/Cmd (normal goto definition) - || (e.keyCodeIsSideBySideKey && e.hasTriggerModifier) // User pressed Ctrl/Cmd+Alt (goto definition to the side) - )) { - this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent, e]); - } - else if (e.hasTriggerModifier) { - this._onCancel.fire(); // remove decorations if user holds another key with ctrl/cmd to prevent accident goto declaration - } - } - _onEditorKeyUp(e) { - if (e.keyCodeIsTriggerKey) { - this._onCancel.fire(); - } - } - _resetHandler() { - this._lastMouseMoveEvent = null; - this._hasTriggerKeyOnMouseDown = false; - this._onCancel.fire(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.css": -/*!*******************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.css ***! - \*******************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_goToDefinitionAtPosition_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./goToDefinitionAtPosition.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.css"); -/* harmony import */ var _css_loader_dist_cjs_js_goToDefinitionAtPosition_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_goToDefinitionAtPosition_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_goToDefinitionAtPosition_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_goToDefinitionAtPosition_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.js": -/*!******************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.js ***! - \******************************************************************************************************/ -/*! exports provided: GotoDefinitionAtPositionEditorContribution */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GotoDefinitionAtPositionEditorContribution", function() { return GotoDefinitionAtPositionEditorContribution; }); -/* harmony import */ var _goToDefinitionAtPosition_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./goToDefinitionAtPosition.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../base/common/htmlContent.js */ "./node_modules/monaco-editor/esm/vs/base/common/htmlContent.js"); -/* harmony import */ var _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/services/modeService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modeService.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _goToSymbol_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../goToSymbol.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/goToSymbol.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../common/services/resolverService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/resolverService.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../browser/core/editorState.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/core/editorState.js"); -/* harmony import */ var _goToCommands_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../goToCommands.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/goToCommands.js"); -/* harmony import */ var _clickLinkGesture_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./clickLinkGesture.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/link/clickLinkGesture.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../peekView/peekView.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/peekView/peekView.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - - - - - - -let GotoDefinitionAtPositionEditorContribution = class GotoDefinitionAtPositionEditorContribution { - constructor(editor, textModelResolverService, modeService) { - this.textModelResolverService = textModelResolverService; - this.modeService = modeService; - this.toUnhook = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_10__["DisposableStore"](); - this.toUnhookForKeyboard = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_10__["DisposableStore"](); - this.linkDecorations = []; - this.currentWordAtPosition = null; - this.previousPromise = null; - this.editor = editor; - let linkGesture = new _clickLinkGesture_js__WEBPACK_IMPORTED_MODULE_16__["ClickLinkGesture"](editor); - this.toUnhook.add(linkGesture); - this.toUnhook.add(linkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => { - this.startFindDefinitionFromMouse(mouseEvent, Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_18__["withNullAsUndefined"])(keyboardEvent)); - })); - this.toUnhook.add(linkGesture.onExecute((mouseEvent) => { - if (this.isEnabled(mouseEvent)) { - this.gotoDefinition(mouseEvent.target.position, mouseEvent.hasSideBySideModifier).then(() => { - this.removeLinkDecorations(); - }, (error) => { - this.removeLinkDecorations(); - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["onUnexpectedError"])(error); - }); - } - })); - this.toUnhook.add(linkGesture.onCancel(() => { - this.removeLinkDecorations(); - this.currentWordAtPosition = null; - })); - } - static get(editor) { - return editor.getContribution(GotoDefinitionAtPositionEditorContribution.ID); - } - startFindDefinitionFromCursor(position) { - // For issue: https://github.com/microsoft/vscode/issues/46257 - // equivalent to mouse move with meta/ctrl key - // First find the definition and add decorations - // to the editor to be shown with the content hover widget - return this.startFindDefinition(position).then(() => { - // Add listeners for editor cursor move and key down events - // Dismiss the "extended" editor decorations when the user hides - // the hover widget. There is no event for the widget itself so these - // serve as a best effort. After removing the link decorations, the hover - // widget is clean and will only show declarations per next request. - this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(() => { - this.currentWordAtPosition = null; - this.removeLinkDecorations(); - this.toUnhookForKeyboard.clear(); - })); - this.toUnhookForKeyboard.add(this.editor.onKeyDown((e) => { - if (e) { - this.currentWordAtPosition = null; - this.removeLinkDecorations(); - this.toUnhookForKeyboard.clear(); - } - })); - }); - } - startFindDefinitionFromMouse(mouseEvent, withKey) { - // check if we are active and on a content widget - if (mouseEvent.target.type === 9 /* CONTENT_WIDGET */ && this.linkDecorations.length > 0) { - return; - } - if (!this.editor.hasModel() || !this.isEnabled(mouseEvent, withKey)) { - this.currentWordAtPosition = null; - this.removeLinkDecorations(); - return; - } - const position = mouseEvent.target.position; - this.startFindDefinition(position); - } - startFindDefinition(position) { - var _a; - // Dispose listeners for updating decorations when using keyboard to show definition hover - this.toUnhookForKeyboard.clear(); - // Find word at mouse position - const word = position ? (_a = this.editor.getModel()) === null || _a === void 0 ? void 0 : _a.getWordAtPosition(position) : null; - if (!word) { - this.currentWordAtPosition = null; - this.removeLinkDecorations(); - return Promise.resolve(0); - } - // Return early if word at position is still the same - if (this.currentWordAtPosition && this.currentWordAtPosition.startColumn === word.startColumn && this.currentWordAtPosition.endColumn === word.endColumn && this.currentWordAtPosition.word === word.word) { - return Promise.resolve(0); - } - this.currentWordAtPosition = word; - // Find definition and decorate word if found - let state = new _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_14__["EditorState"](this.editor, 4 /* Position */ | 1 /* Value */ | 2 /* Selection */ | 8 /* Scroll */); - if (this.previousPromise) { - this.previousPromise.cancel(); - this.previousPromise = null; - } - this.previousPromise = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["createCancelablePromise"])(token => this.findDefinition(position, token)); - return this.previousPromise.then(results => { - if (!results || !results.length || !state.validate(this.editor)) { - this.removeLinkDecorations(); - return; - } - // Multiple results - if (results.length > 1) { - this.addDecoration(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](position.lineNumber, word.startColumn, position.lineNumber, word.endColumn), new _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_4__["MarkdownString"]().appendText(_nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('multipleResults', "Click to show {0} definitions.", results.length))); - } - // Single result - else { - let result = results[0]; - if (!result.uri) { - return; - } - this.textModelResolverService.createModelReference(result.uri).then(ref => { - if (!ref.object || !ref.object.textEditorModel) { - ref.dispose(); - return; - } - const { object: { textEditorModel } } = ref; - const { startLineNumber } = result.range; - if (startLineNumber < 1 || startLineNumber > textEditorModel.getLineCount()) { - // invalid range - ref.dispose(); - return; - } - const previewValue = this.getPreviewValue(textEditorModel, startLineNumber, result); - let wordRange; - if (result.originSelectionRange) { - wordRange = _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].lift(result.originSelectionRange); - } - else { - wordRange = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](position.lineNumber, word.startColumn, position.lineNumber, word.endColumn); - } - const modeId = this.modeService.getModeIdByFilepathOrFirstLine(textEditorModel.uri); - this.addDecoration(wordRange, new _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_4__["MarkdownString"]().appendCodeblock(modeId ? modeId : '', previewValue)); - ref.dispose(); - }); - } - }).then(undefined, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["onUnexpectedError"]); - } - getPreviewValue(textEditorModel, startLineNumber, result) { - let rangeToUse = result.targetSelectionRange ? result.range : this.getPreviewRangeBasedOnBrackets(textEditorModel, startLineNumber); - const numberOfLinesInRange = rangeToUse.endLineNumber - rangeToUse.startLineNumber; - if (numberOfLinesInRange >= GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES) { - rangeToUse = this.getPreviewRangeBasedOnIndentation(textEditorModel, startLineNumber); - } - const previewValue = this.stripIndentationFromPreviewRange(textEditorModel, startLineNumber, rangeToUse); - return previewValue; - } - stripIndentationFromPreviewRange(textEditorModel, startLineNumber, previewRange) { - const startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber); - let minIndent = startIndent; - for (let endLineNumber = startLineNumber + 1; endLineNumber < previewRange.endLineNumber; endLineNumber++) { - const endIndent = textEditorModel.getLineFirstNonWhitespaceColumn(endLineNumber); - minIndent = Math.min(minIndent, endIndent); - } - const previewValue = textEditorModel.getValueInRange(previewRange).replace(new RegExp(`^\\s{${minIndent - 1}}`, 'gm'), '').trim(); - return previewValue; - } - getPreviewRangeBasedOnIndentation(textEditorModel, startLineNumber) { - const startIndent = textEditorModel.getLineFirstNonWhitespaceColumn(startLineNumber); - const maxLineNumber = Math.min(textEditorModel.getLineCount(), startLineNumber + GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES); - let endLineNumber = startLineNumber + 1; - for (; endLineNumber < maxLineNumber; endLineNumber++) { - let endIndent = textEditorModel.getLineFirstNonWhitespaceColumn(endLineNumber); - if (startIndent === endIndent) { - break; - } - } - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](startLineNumber, 1, endLineNumber + 1, 1); - } - getPreviewRangeBasedOnBrackets(textEditorModel, startLineNumber) { - const maxLineNumber = Math.min(textEditorModel.getLineCount(), startLineNumber + GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES); - const brackets = []; - let ignoreFirstEmpty = true; - let currentBracket = textEditorModel.findNextBracket(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_17__["Position"](startLineNumber, 1)); - while (currentBracket !== null) { - if (brackets.length === 0) { - brackets.push(currentBracket); - } - else { - const lastBracket = brackets[brackets.length - 1]; - if (lastBracket.open[0] === currentBracket.open[0] && lastBracket.isOpen && !currentBracket.isOpen) { - brackets.pop(); - } - else { - brackets.push(currentBracket); - } - if (brackets.length === 0) { - if (ignoreFirstEmpty) { - ignoreFirstEmpty = false; - } - else { - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](startLineNumber, 1, currentBracket.range.endLineNumber + 1, 1); - } - } - } - const maxColumn = textEditorModel.getLineMaxColumn(startLineNumber); - let nextLineNumber = currentBracket.range.endLineNumber; - let nextColumn = currentBracket.range.endColumn; - if (maxColumn === currentBracket.range.endColumn) { - nextLineNumber++; - nextColumn = 1; - } - if (nextLineNumber > maxLineNumber) { - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](startLineNumber, 1, maxLineNumber + 1, 1); - } - currentBracket = textEditorModel.findNextBracket(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_17__["Position"](nextLineNumber, nextColumn)); - } - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](startLineNumber, 1, maxLineNumber + 1, 1); - } - addDecoration(range, hoverMessage) { - const newDecorations = { - range: range, - options: { - inlineClassName: 'goto-definition-link', - hoverMessage - } - }; - this.linkDecorations = this.editor.deltaDecorations(this.linkDecorations, [newDecorations]); - } - removeLinkDecorations() { - if (this.linkDecorations.length > 0) { - this.linkDecorations = this.editor.deltaDecorations(this.linkDecorations, []); - } - } - isEnabled(mouseEvent, withKey) { - return this.editor.hasModel() && - mouseEvent.isNoneOrSingleMouseDown && - (mouseEvent.target.type === 6 /* CONTENT_TEXT */) && - (mouseEvent.hasTriggerModifier || (withKey ? withKey.keyCodeIsTriggerKey : false)) && - _common_modes_js__WEBPACK_IMPORTED_MODULE_7__["DefinitionProviderRegistry"].has(this.editor.getModel()); - } - findDefinition(position, token) { - const model = this.editor.getModel(); - if (!model) { - return Promise.resolve(null); - } - return Object(_goToSymbol_js__WEBPACK_IMPORTED_MODULE_9__["getDefinitionsAtPosition"])(model, position, token); - } - gotoDefinition(position, openToSide) { - this.editor.setPosition(position); - return this.editor.invokeWithinContext((accessor) => { - const canPeek = !openToSide && this.editor.getOption(69 /* definitionLinkOpensInPeek */) && !this.isInPeekEditor(accessor); - const action = new _goToCommands_js__WEBPACK_IMPORTED_MODULE_15__["DefinitionAction"]({ openToSide, openInPeek: canPeek, muteMessage: true }, { alias: '', label: '', id: '', precondition: undefined }); - return action.run(accessor, this.editor); - }); - } - isInPeekEditor(accessor) { - const contextKeyService = accessor.get(_platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_20__["IContextKeyService"]); - return _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_19__["PeekContext"].inPeekEditor.getValue(contextKeyService); - } - dispose() { - this.toUnhook.dispose(); - } -}; -GotoDefinitionAtPositionEditorContribution.ID = 'editor.contrib.gotodefinitionatposition'; -GotoDefinitionAtPositionEditorContribution.MAX_SOURCE_PREVIEW_LINES = 8; -GotoDefinitionAtPositionEditorContribution = __decorate([ - __param(1, _common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_11__["ITextModelService"]), - __param(2, _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_5__["IModeService"]) -], GotoDefinitionAtPositionEditorContribution); - -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_8__["registerEditorContribution"])(GotoDefinitionAtPositionEditorContribution.ID, GotoDefinitionAtPositionEditorContribution); -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_12__["registerThemingParticipant"])((theme, collector) => { - const activeLinkForeground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["editorActiveLinkForeground"]); - if (activeLinkForeground) { - collector.addRule(`.monaco-editor .goto-definition-link { color: ${activeLinkForeground} !important; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesController.js": -/*!**************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesController.js ***! - \**************************************************************************************************/ -/*! exports provided: ctxReferenceSearchVisible, ReferencesController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ctxReferenceSearchVisible", function() { return ctxReferenceSearchVisible; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReferencesController", function() { return ReferencesController; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../platform/configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/* harmony import */ var _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../platform/storage/common/storage.js */ "./node_modules/monaco-editor/esm/vs/platform/storage/common/storage.js"); -/* harmony import */ var _referencesModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../referencesModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/referencesModel.js"); -/* harmony import */ var _referencesWidget_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./referencesWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesWidget.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../peekView/peekView.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/peekView/peekView.js"); -/* harmony import */ var _platform_list_browser_listService_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../../platform/list/browser/listService.js */ "./node_modules/monaco-editor/esm/vs/platform/list/browser/listService.js"); -/* harmony import */ var _platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../../platform/keybinding/common/keybindingsRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - - - - -const ctxReferenceSearchVisible = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["RawContextKey"]('referenceSearchVisible', false); -let ReferencesController = class ReferencesController { - constructor(_defaultTreeKeyboardSupport, _editor, contextKeyService, _editorService, _notificationService, _instantiationService, _storageService, _configurationService) { - this._defaultTreeKeyboardSupport = _defaultTreeKeyboardSupport; - this._editor = _editor; - this._editorService = _editorService; - this._notificationService = _notificationService; - this._instantiationService = _instantiationService; - this._storageService = _storageService; - this._configurationService = _configurationService; - this._disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["DisposableStore"](); - this._requestIdPool = 0; - this._ignoreModelChangeEvent = false; - this._referenceSearchVisible = ctxReferenceSearchVisible.bindTo(contextKeyService); - } - static get(editor) { - return editor.getContribution(ReferencesController.ID); - } - dispose() { - this._referenceSearchVisible.reset(); - this._disposables.dispose(); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(this._widget); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(this._model); - this._widget = undefined; - this._model = undefined; - } - toggleWidget(range, modelPromise, peekMode) { - // close current widget and return early is position didn't change - let widgetPosition; - if (this._widget) { - widgetPosition = this._widget.position; - } - this.closeWidget(); - if (!!widgetPosition && range.containsPosition(widgetPosition)) { - return; - } - this._peekMode = peekMode; - this._referenceSearchVisible.set(true); - // close the widget on model/mode changes - this._disposables.add(this._editor.onDidChangeModelLanguage(() => { this.closeWidget(); })); - this._disposables.add(this._editor.onDidChangeModel(() => { - if (!this._ignoreModelChangeEvent) { - this.closeWidget(); - } - })); - const storageKey = 'peekViewLayout'; - const data = _referencesWidget_js__WEBPACK_IMPORTED_MODULE_9__["LayoutData"].fromJSON(this._storageService.get(storageKey, 0 /* GLOBAL */, '{}')); - this._widget = this._instantiationService.createInstance(_referencesWidget_js__WEBPACK_IMPORTED_MODULE_9__["ReferenceWidget"], this._editor, this._defaultTreeKeyboardSupport, data); - this._widget.setTitle(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('labelLoading', "Loading...")); - this._widget.show(range); - this._disposables.add(this._widget.onDidClose(() => { - modelPromise.cancel(); - if (this._widget) { - this._storageService.store(storageKey, JSON.stringify(this._widget.layoutData), 0 /* GLOBAL */); - this._widget = undefined; - } - this.closeWidget(); - })); - this._disposables.add(this._widget.onDidSelectReference(event => { - let { element, kind } = event; - if (!element) { - return; - } - switch (kind) { - case 'open': - if (event.source !== 'editor' || !this._configurationService.getValue('editor.stablePeek')) { - // when stable peek is configured we don't close - // the peek window on selecting the editor - this.openReference(element, false); - } - break; - case 'side': - this.openReference(element, true); - break; - case 'goto': - if (peekMode) { - this._gotoReference(element); - } - else { - this.openReference(element, false); - } - break; - } - })); - const requestId = ++this._requestIdPool; - modelPromise.then(model => { - // still current request? widget still open? - if (requestId !== this._requestIdPool || !this._widget) { - return undefined; - } - if (this._model) { - this._model.dispose(); - } - this._model = model; - // show widget - return this._widget.setModel(this._model).then(() => { - if (this._widget && this._model && this._editor.hasModel()) { // might have been closed - // set title - if (!this._model.isEmpty) { - this._widget.setMetaTitle(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('metaTitle.N', "{0} ({1})", this._model.title, this._model.references.length)); - } - else { - this._widget.setMetaTitle(''); - } - // set 'best' selection - let uri = this._editor.getModel().uri; - let pos = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_11__["Position"](range.startLineNumber, range.startColumn); - let selection = this._model.nearestReference(uri, pos); - if (selection) { - return this._widget.setSelection(selection).then(() => { - if (this._widget && this._editor.getOption(68 /* peekWidgetDefaultFocus */) === 'editor') { - this._widget.focusOnPreviewEditor(); - } - }); - } - } - return undefined; - }); - }, error => { - this._notificationService.error(error); - }); - } - changeFocusBetweenPreviewAndReferences() { - if (!this._widget) { - // can be called while still resolving... - return; - } - if (this._widget.isPreviewEditorFocused()) { - this._widget.focusOnReferenceTree(); - } - else { - this._widget.focusOnPreviewEditor(); - } - } - goToNextOrPreviousReference(fwd) { - return __awaiter(this, void 0, void 0, function* () { - if (!this._editor.hasModel() || !this._model || !this._widget) { - // can be called while still resolving... - return; - } - const currentPosition = this._widget.position; - if (!currentPosition) { - return; - } - const source = this._model.nearestReference(this._editor.getModel().uri, currentPosition); - if (!source) { - return; - } - const target = this._model.nextOrPreviousReference(source, fwd); - const editorFocus = this._editor.hasTextFocus(); - const previewEditorFocus = this._widget.isPreviewEditorFocused(); - yield this._widget.setSelection(target); - yield this._gotoReference(target); - if (editorFocus) { - this._editor.focus(); - } - else if (this._widget && previewEditorFocus) { - this._widget.focusOnPreviewEditor(); - } - }); - } - revealReference(reference) { - return __awaiter(this, void 0, void 0, function* () { - if (!this._editor.hasModel() || !this._model || !this._widget) { - // can be called while still resolving... - return; - } - yield this._widget.revealReference(reference); - }); - } - closeWidget(focusEditor = true) { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(this._widget); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["dispose"])(this._model); - this._referenceSearchVisible.reset(); - this._disposables.clear(); - this._widget = undefined; - this._model = undefined; - if (focusEditor) { - this._editor.focus(); - } - this._requestIdPool += 1; // Cancel pending requests - } - _gotoReference(ref) { - if (this._widget) { - this._widget.hide(); - } - this._ignoreModelChangeEvent = true; - const range = _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__["Range"].lift(ref.range).collapseToStart(); - return this._editorService.openCodeEditor({ - resource: ref.uri, - options: { selection: range } - }, this._editor).then(openedEditor => { - var _a; - this._ignoreModelChangeEvent = false; - if (!openedEditor || !this._widget) { - // something went wrong... - this.closeWidget(); - return; - } - if (this._editor === openedEditor) { - // - this._widget.show(range); - this._widget.focusOnReferenceTree(); - } - else { - // we opened a different editor instance which means a different controller instance. - // therefore we stop with this controller and continue with the other - const other = ReferencesController.get(openedEditor); - const model = this._model.clone(); - this.closeWidget(); - openedEditor.focus(); - other.toggleWidget(range, Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_13__["createCancelablePromise"])(_ => Promise.resolve(model)), (_a = this._peekMode) !== null && _a !== void 0 ? _a : false); - } - }, (err) => { - this._ignoreModelChangeEvent = false; - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"])(err); - }); - } - openReference(ref, sideBySide) { - // clear stage - if (!sideBySide) { - this.closeWidget(); - } - const { uri, range } = ref; - this._editorService.openCodeEditor({ - resource: uri, - options: { selection: range } - }, this._editor, sideBySide); - } -}; -ReferencesController.ID = 'editor.contrib.referencesController'; -ReferencesController = __decorate([ - __param(2, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["IContextKeyService"]), - __param(3, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__["ICodeEditorService"]), - __param(4, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_12__["INotificationService"]), - __param(5, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_4__["IInstantiationService"]), - __param(6, _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_7__["IStorageService"]), - __param(7, _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__["IConfigurationService"]) -], ReferencesController); - -function withController(accessor, fn) { - const outerEditor = Object(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_14__["getOuterEditor"])(accessor); - if (!outerEditor) { - return; - } - let controller = ReferencesController.get(outerEditor); - if (controller) { - fn(controller); - } -} -_platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_16__["KeybindingsRegistry"].registerCommandAndKeybindingRule({ - id: 'togglePeekWidgetFocus', - weight: 100 /* EditorContrib */, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_17__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 60 /* F2 */), - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["ContextKeyExpr"].or(ctxReferenceSearchVisible, _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_14__["PeekContext"].inPeekEditor), - handler(accessor) { - withController(accessor, controller => { - controller.changeFocusBetweenPreviewAndReferences(); - }); - } -}); -_platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_16__["KeybindingsRegistry"].registerCommandAndKeybindingRule({ - id: 'goToNextReference', - weight: 100 /* EditorContrib */ - 10, - primary: 62 /* F4 */, - secondary: [70 /* F12 */], - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["ContextKeyExpr"].or(ctxReferenceSearchVisible, _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_14__["PeekContext"].inPeekEditor), - handler(accessor) { - withController(accessor, controller => { - controller.goToNextOrPreviousReference(true); - }); - } -}); -_platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_16__["KeybindingsRegistry"].registerCommandAndKeybindingRule({ - id: 'goToPreviousReference', - weight: 100 /* EditorContrib */ - 10, - primary: 1024 /* Shift */ | 62 /* F4 */, - secondary: [1024 /* Shift */ | 70 /* F12 */], - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["ContextKeyExpr"].or(ctxReferenceSearchVisible, _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_14__["PeekContext"].inPeekEditor), - handler(accessor) { - withController(accessor, controller => { - controller.goToNextOrPreviousReference(false); - }); - } -}); -// commands that aren't needed anymore because there is now ContextKeyExpr.OR -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_18__["CommandsRegistry"].registerCommandAlias('goToNextReferenceFromEmbeddedEditor', 'goToNextReference'); -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_18__["CommandsRegistry"].registerCommandAlias('goToPreviousReferenceFromEmbeddedEditor', 'goToPreviousReference'); -// close -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_18__["CommandsRegistry"].registerCommandAlias('closeReferenceSearchEditor', 'closeReferenceSearch'); -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_18__["CommandsRegistry"].registerCommand('closeReferenceSearch', accessor => withController(accessor, controller => controller.closeWidget())); -_platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_16__["KeybindingsRegistry"].registerKeybindingRule({ - id: 'closeReferenceSearch', - weight: 100 /* EditorContrib */ - 101, - primary: 9 /* Escape */, - secondary: [1024 /* Shift */ | 9 /* Escape */], - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["ContextKeyExpr"].and(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_14__["PeekContext"].inPeekEditor, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["ContextKeyExpr"].not('config.editor.stablePeek')) -}); -_platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_16__["KeybindingsRegistry"].registerKeybindingRule({ - id: 'closeReferenceSearch', - weight: 200 /* WorkbenchContrib */ + 50, - primary: 9 /* Escape */, - secondary: [1024 /* Shift */ | 9 /* Escape */], - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["ContextKeyExpr"].and(ctxReferenceSearchVisible, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["ContextKeyExpr"].not('config.editor.stablePeek')) -}); -_platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_16__["KeybindingsRegistry"].registerCommandAndKeybindingRule({ - id: 'revealReference', - weight: 200 /* WorkbenchContrib */, - primary: 3 /* Enter */, - mac: { - primary: 3 /* Enter */, - secondary: [2048 /* CtrlCmd */ | 18 /* DownArrow */] - }, - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["ContextKeyExpr"].and(ctxReferenceSearchVisible, _platform_list_browser_listService_js__WEBPACK_IMPORTED_MODULE_15__["WorkbenchListFocusContextKey"]), - handler(accessor) { - var _a; - const listService = accessor.get(_platform_list_browser_listService_js__WEBPACK_IMPORTED_MODULE_15__["IListService"]); - const focus = (_a = listService.lastFocusedList) === null || _a === void 0 ? void 0 : _a.getFocus(); - if (Array.isArray(focus) && focus[0] instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_8__["OneReference"]) { - withController(accessor, controller => controller.revealReference(focus[0])); - } - } -}); -_platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_16__["KeybindingsRegistry"].registerCommandAndKeybindingRule({ - id: 'openReferenceToSide', - weight: 100 /* EditorContrib */, - primary: 2048 /* CtrlCmd */ | 3 /* Enter */, - mac: { - primary: 256 /* WinCtrl */ | 3 /* Enter */ - }, - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["ContextKeyExpr"].and(ctxReferenceSearchVisible, _platform_list_browser_listService_js__WEBPACK_IMPORTED_MODULE_15__["WorkbenchListFocusContextKey"]), - handler(accessor) { - var _a; - const listService = accessor.get(_platform_list_browser_listService_js__WEBPACK_IMPORTED_MODULE_15__["IListService"]); - const focus = (_a = listService.lastFocusedList) === null || _a === void 0 ? void 0 : _a.getFocus(); - if (Array.isArray(focus) && focus[0] instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_8__["OneReference"]) { - withController(accessor, controller => controller.openReference(focus[0], true)); - } - } -}); -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_18__["CommandsRegistry"].registerCommand('openReference', (accessor) => { - var _a; - const listService = accessor.get(_platform_list_browser_listService_js__WEBPACK_IMPORTED_MODULE_15__["IListService"]); - const focus = (_a = listService.lastFocusedList) === null || _a === void 0 ? void 0 : _a.getFocus(); - if (Array.isArray(focus) && focus[0] instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_8__["OneReference"]) { - withController(accessor, controller => controller.openReference(focus[0], false)); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesTree.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesTree.js ***! - \********************************************************************************************/ -/*! exports provided: DataSource, Delegate, StringRepresentationProvider, IdentityProvider, FileReferencesRenderer, OneReferenceRenderer, AccessibilityProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataSource", function() { return DataSource; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Delegate", function() { return Delegate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringRepresentationProvider", function() { return StringRepresentationProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IdentityProvider", function() { return IdentityProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FileReferencesRenderer", function() { return FileReferencesRenderer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OneReferenceRenderer", function() { return OneReferenceRenderer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccessibilityProvider", function() { return AccessibilityProvider; }); -/* harmony import */ var _referencesModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../referencesModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/referencesModel.js"); -/* harmony import */ var _common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/services/resolverService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/resolverService.js"); -/* harmony import */ var _base_browser_ui_iconLabel_iconLabel_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/browser/ui/iconLabel/iconLabel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabel.js"); -/* harmony import */ var _base_browser_ui_countBadge_countBadge_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../base/browser/ui/countBadge/countBadge.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.js"); -/* harmony import */ var _platform_label_common_label_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../platform/label/common/label.js */ "./node_modules/monaco-editor/esm/vs/platform/label/common/label.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../platform/theme/common/styler.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/styler.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_labels_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../base/common/labels.js */ "./node_modules/monaco-editor/esm/vs/base/common/labels.js"); -/* harmony import */ var _base_common_resources_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../base/common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _base_common_filters_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../../base/common/filters.js */ "./node_modules/monaco-editor/esm/vs/base/common/filters.js"); -/* harmony import */ var _base_browser_ui_highlightedlabel_highlightedLabel_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../../base/browser/ui/highlightedlabel/highlightedLabel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/highlightedlabel/highlightedLabel.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - -let DataSource = class DataSource { - constructor(_resolverService) { - this._resolverService = _resolverService; - } - hasChildren(element) { - if (element instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_0__["ReferencesModel"]) { - return true; - } - if (element instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_0__["FileReferences"]) { - return true; - } - return false; - } - getChildren(element) { - if (element instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_0__["ReferencesModel"]) { - return element.groups; - } - if (element instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_0__["FileReferences"]) { - return element.resolve(this._resolverService).then(val => { - // if (element.failure) { - // // refresh the element on failure so that - // // we can update its rendering - // return tree.refresh(element).then(() => val.children); - // } - return val.children; - }); - } - throw new Error('bad tree'); - } -}; -DataSource = __decorate([ - __param(0, _common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_1__["ITextModelService"]) -], DataSource); - -//#endregion -class Delegate { - getHeight() { - return 23; - } - getTemplateId(element) { - if (element instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_0__["FileReferences"]) { - return FileReferencesRenderer.id; - } - else { - return OneReferenceRenderer.id; - } - } -} -let StringRepresentationProvider = class StringRepresentationProvider { - constructor(_keybindingService) { - this._keybindingService = _keybindingService; - } - getKeyboardNavigationLabel(element) { - var _a; - if (element instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_0__["OneReference"]) { - const parts = (_a = element.parent.getPreview(element)) === null || _a === void 0 ? void 0 : _a.preview(element.range); - if (parts) { - return parts.value; - } - } - // FileReferences or unresolved OneReference - return Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_10__["basename"])(element.uri); - } -}; -StringRepresentationProvider = __decorate([ - __param(0, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_13__["IKeybindingService"]) -], StringRepresentationProvider); - -class IdentityProvider { - getId(element) { - return element instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_0__["OneReference"] ? element.id : element.uri; - } -} -//#region render: File -let FileReferencesTemplate = class FileReferencesTemplate extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_11__["Disposable"] { - constructor(container, _uriLabel, themeService) { - super(); - this._uriLabel = _uriLabel; - const parent = document.createElement('div'); - parent.classList.add('reference-file'); - this.file = this._register(new _base_browser_ui_iconLabel_iconLabel_js__WEBPACK_IMPORTED_MODULE_2__["IconLabel"](parent, { supportHighlights: true })); - this.badge = new _base_browser_ui_countBadge_countBadge_js__WEBPACK_IMPORTED_MODULE_3__["CountBadge"](_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_7__["append"](parent, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_7__["$"]('.count'))); - this._register(Object(_platform_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_6__["attachBadgeStyler"])(this.badge, themeService)); - container.appendChild(parent); - } - set(element, matches) { - let parent = Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_10__["dirname"])(element.uri); - this.file.setLabel(Object(_base_common_labels_js__WEBPACK_IMPORTED_MODULE_9__["getBaseLabel"])(element.uri), this._uriLabel.getUriLabel(parent, { relative: true }), { title: this._uriLabel.getUriLabel(element.uri), matches }); - const len = element.children.length; - this.badge.setCount(len); - if (len > 1) { - this.badge.setTitleFormat(Object(_nls_js__WEBPACK_IMPORTED_MODULE_8__["localize"])('referencesCount', "{0} references", len)); - } - else { - this.badge.setTitleFormat(Object(_nls_js__WEBPACK_IMPORTED_MODULE_8__["localize"])('referenceCount', "{0} reference", len)); - } - } -}; -FileReferencesTemplate = __decorate([ - __param(1, _platform_label_common_label_js__WEBPACK_IMPORTED_MODULE_4__["ILabelService"]), - __param(2, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_5__["IThemeService"]) -], FileReferencesTemplate); -let FileReferencesRenderer = class FileReferencesRenderer { - constructor(_instantiationService) { - this._instantiationService = _instantiationService; - this.templateId = FileReferencesRenderer.id; - } - renderTemplate(container) { - return this._instantiationService.createInstance(FileReferencesTemplate, container); - } - renderElement(node, index, template) { - template.set(node.element, Object(_base_common_filters_js__WEBPACK_IMPORTED_MODULE_14__["createMatches"])(node.filterData)); - } - disposeTemplate(templateData) { - templateData.dispose(); - } -}; -FileReferencesRenderer.id = 'FileReferencesRenderer'; -FileReferencesRenderer = __decorate([ - __param(0, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_12__["IInstantiationService"]) -], FileReferencesRenderer); - -//#endregion -//#region render: Reference -class OneReferenceTemplate { - constructor(container) { - this.label = new _base_browser_ui_highlightedlabel_highlightedLabel_js__WEBPACK_IMPORTED_MODULE_15__["HighlightedLabel"](container, false); - } - set(element, score) { - var _a; - const preview = (_a = element.parent.getPreview(element)) === null || _a === void 0 ? void 0 : _a.preview(element.range); - if (!preview || !preview.value) { - // this means we FAILED to resolve the document or the value is the empty string - this.label.set(`${Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_10__["basename"])(element.uri)}:${element.range.startLineNumber + 1}:${element.range.startColumn + 1}`); - } - else { - // render search match as highlight unless - // we have score, then render the score - const { value, highlight } = preview; - if (score && !_base_common_filters_js__WEBPACK_IMPORTED_MODULE_14__["FuzzyScore"].isDefault(score)) { - this.label.element.classList.toggle('referenceMatch', false); - this.label.set(value, Object(_base_common_filters_js__WEBPACK_IMPORTED_MODULE_14__["createMatches"])(score)); - } - else { - this.label.element.classList.toggle('referenceMatch', true); - this.label.set(value, [highlight]); - } - } - } -} -class OneReferenceRenderer { - constructor() { - this.templateId = OneReferenceRenderer.id; - } - renderTemplate(container) { - return new OneReferenceTemplate(container); - } - renderElement(node, index, templateData) { - templateData.set(node.element, node.filterData); - } - disposeTemplate() { - } -} -OneReferenceRenderer.id = 'OneReferenceRenderer'; -//#endregion -class AccessibilityProvider { - getWidgetAriaLabel() { - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_8__["localize"])('treeAriaLabel', "References"); - } - getAriaLabel(element) { - return element.ariaMessage; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesWidget.css": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesWidget.css ***! - \***********************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_referencesWidget_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./referencesWidget.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesWidget.css"); -/* harmony import */ var _css_loader_dist_cjs_js_referencesWidget_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_referencesWidget_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_referencesWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_referencesWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesWidget.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesWidget.js ***! - \**********************************************************************************************/ -/*! exports provided: LayoutData, ReferenceWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LayoutData", function() { return LayoutData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReferenceWidget", function() { return ReferenceWidget; }); -/* harmony import */ var _referencesWidget_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./referencesWidget.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesWidget.css"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_network_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../base/common/network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _base_common_resources_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../base/common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/* harmony import */ var _browser_widget_embeddedCodeEditorWidget_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../browser/widget/embeddedCodeEditorWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/embeddedCodeEditorWidget.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../common/services/resolverService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/resolverService.js"); -/* harmony import */ var _referencesTree_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./referencesTree.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesTree.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_label_common_label_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../../platform/label/common/label.js */ "./node_modules/monaco-editor/esm/vs/platform/label/common/label.js"); -/* harmony import */ var _platform_list_browser_listService_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../../platform/list/browser/listService.js */ "./node_modules/monaco-editor/esm/vs/platform/list/browser/listService.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../peekView/peekView.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/peekView/peekView.js"); -/* harmony import */ var _referencesModel_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../referencesModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/referencesModel.js"); -/* harmony import */ var _base_browser_ui_splitview_splitview_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../../base/browser/ui/splitview/splitview.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/splitview/splitview.js"); -/* harmony import */ var _platform_undoRedo_common_undoRedo_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../../platform/undoRedo/common/undoRedo.js */ "./node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - - - - - - - - -class DecorationsManager { - constructor(_editor, _model) { - this._editor = _editor; - this._model = _model; - this._decorations = new Map(); - this._decorationIgnoreSet = new Set(); - this._callOnDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - this._callOnModelChange = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - this._callOnDispose.add(this._editor.onDidChangeModel(() => this._onModelChanged())); - this._onModelChanged(); - } - dispose() { - this._callOnModelChange.dispose(); - this._callOnDispose.dispose(); - this.removeDecorations(); - } - _onModelChanged() { - this._callOnModelChange.clear(); - const model = this._editor.getModel(); - if (!model) { - return; - } - for (let ref of this._model.references) { - if (ref.uri.toString() === model.uri.toString()) { - this._addDecorations(ref.parent); - return; - } - } - } - _addDecorations(reference) { - if (!this._editor.hasModel()) { - return; - } - this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(() => this._onDecorationChanged())); - const newDecorations = []; - const newDecorationsActualIndex = []; - for (let i = 0, len = reference.children.length; i < len; i++) { - let oneReference = reference.children[i]; - if (this._decorationIgnoreSet.has(oneReference.id)) { - continue; - } - if (oneReference.uri.toString() !== this._editor.getModel().uri.toString()) { - continue; - } - newDecorations.push({ - range: oneReference.range, - options: DecorationsManager.DecorationOptions - }); - newDecorationsActualIndex.push(i); - } - const decorations = this._editor.deltaDecorations([], newDecorations); - for (let i = 0; i < decorations.length; i++) { - this._decorations.set(decorations[i], reference.children[newDecorationsActualIndex[i]]); - } - } - _onDecorationChanged() { - const toRemove = []; - const model = this._editor.getModel(); - if (!model) { - return; - } - for (let [decorationId, reference] of this._decorations) { - const newRange = model.getDecorationRange(decorationId); - if (!newRange) { - continue; - } - let ignore = false; - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].equalsRange(newRange, reference.range)) { - continue; - } - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].spansMultipleLines(newRange)) { - ignore = true; - } - else { - const lineLength = reference.range.endColumn - reference.range.startColumn; - const newLineLength = newRange.endColumn - newRange.startColumn; - if (lineLength !== newLineLength) { - ignore = true; - } - } - if (ignore) { - this._decorationIgnoreSet.add(reference.id); - toRemove.push(decorationId); - } - else { - reference.range = newRange; - } - } - for (let i = 0, len = toRemove.length; i < len; i++) { - this._decorations.delete(toRemove[i]); - } - this._editor.deltaDecorations(toRemove, []); - } - removeDecorations() { - this._editor.deltaDecorations([...this._decorations.keys()], []); - this._decorations.clear(); - } -} -DecorationsManager.DecorationOptions = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_9__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - className: 'reference-decoration' -}); -class LayoutData { - constructor() { - this.ratio = 0.7; - this.heightInLines = 18; - } - static fromJSON(raw) { - let ratio; - let heightInLines; - try { - const data = JSON.parse(raw); - ratio = data.ratio; - heightInLines = data.heightInLines; - } - catch (_a) { - // - } - return { - ratio: ratio || 0.7, - heightInLines: heightInLines || 18 - }; - } -} -class ReferencesTree extends _platform_list_browser_listService_js__WEBPACK_IMPORTED_MODULE_15__["WorkbenchAsyncDataTree"] { -} -/** - * ZoneWidget that is shown inside the editor - */ -let ReferenceWidget = class ReferenceWidget extends _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["PeekViewWidget"] { - constructor(editor, _defaultTreeKeyboardSupport, layoutData, themeService, _textModelResolverService, _instantiationService, _peekViewService, _uriLabel, _undoRedoService, _keybindingService) { - super(editor, { showFrame: false, showArrow: true, isResizeable: true, isAccessible: true }, _instantiationService); - this._defaultTreeKeyboardSupport = _defaultTreeKeyboardSupport; - this.layoutData = layoutData; - this._textModelResolverService = _textModelResolverService; - this._instantiationService = _instantiationService; - this._peekViewService = _peekViewService; - this._uriLabel = _uriLabel; - this._undoRedoService = _undoRedoService; - this._keybindingService = _keybindingService; - this._disposeOnNewModel = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - this._callOnDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - this._onDidSelectReference = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - this.onDidSelectReference = this._onDidSelectReference.event; - this._dim = { height: 0, width: 0 }; - this._applyTheme(themeService.getColorTheme()); - this._callOnDispose.add(themeService.onDidColorThemeChange(this._applyTheme.bind(this))); - this._peekViewService.addExclusiveWidget(editor, this); - this.create(); - } - dispose() { - this.setModel(undefined); - this._callOnDispose.dispose(); - this._disposeOnNewModel.dispose(); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])(this._preview); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])(this._previewNotAvailableMessage); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])(this._tree); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])(this._previewModelReference); - this._splitView.dispose(); - super.dispose(); - } - _applyTheme(theme) { - const borderColor = theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewBorder"]) || _base_common_color_js__WEBPACK_IMPORTED_MODULE_2__["Color"].transparent; - this.style({ - arrowColor: borderColor, - frameColor: borderColor, - headerBackgroundColor: theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewTitleBackground"]) || _base_common_color_js__WEBPACK_IMPORTED_MODULE_2__["Color"].transparent, - primaryHeadingColor: theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewTitleForeground"]), - secondaryHeadingColor: theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewTitleInfoForeground"]) - }); - } - show(where) { - this.editor.revealRangeInCenterIfOutsideViewport(where, 0 /* Smooth */); - super.show(where, this.layoutData.heightInLines || 18); - } - focusOnReferenceTree() { - this._tree.domFocus(); - } - focusOnPreviewEditor() { - this._preview.focus(); - } - isPreviewEditorFocused() { - return this._preview.hasTextFocus(); - } - _onTitleClick(e) { - if (this._preview && this._preview.getModel()) { - this._onDidSelectReference.fire({ - element: this._getFocusedReference(), - kind: e.ctrlKey || e.metaKey || e.altKey ? 'side' : 'open', - source: 'title' - }); - } - } - _fillBody(containerElement) { - this.setCssClass('reference-zone-widget'); - // message pane - this._messageContainer = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](containerElement, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('div.messages')); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["hide"](this._messageContainer); - this._splitView = new _base_browser_ui_splitview_splitview_js__WEBPACK_IMPORTED_MODULE_20__["SplitView"](containerElement, { orientation: 1 /* HORIZONTAL */ }); - // editor - this._previewContainer = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](containerElement, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('div.preview.inline')); - let options = { - scrollBeyondLastLine: false, - scrollbar: { - verticalScrollbarSize: 14, - horizontal: 'auto', - useShadows: true, - verticalHasArrows: false, - horizontalHasArrows: false, - alwaysConsumeMouseWheel: false - }, - overviewRulerLanes: 2, - fixedOverflowWidgets: true, - minimap: { - enabled: false - } - }; - this._preview = this._instantiationService.createInstance(_browser_widget_embeddedCodeEditorWidget_js__WEBPACK_IMPORTED_MODULE_7__["EmbeddedCodeEditorWidget"], this._previewContainer, options, this.editor); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["hide"](this._previewContainer); - this._previewNotAvailableMessage = new _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_9__["TextModel"](_nls_js__WEBPACK_IMPORTED_MODULE_12__["localize"]('missingPreviewMessage', "no preview available"), _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_9__["TextModel"].DEFAULT_CREATION_OPTIONS, null, null, this._undoRedoService); - // tree - this._treeContainer = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](containerElement, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('div.ref-tree.inline')); - const treeOptions = { - keyboardSupport: this._defaultTreeKeyboardSupport, - accessibilityProvider: new _referencesTree_js__WEBPACK_IMPORTED_MODULE_11__["AccessibilityProvider"](), - keyboardNavigationLabelProvider: this._instantiationService.createInstance(_referencesTree_js__WEBPACK_IMPORTED_MODULE_11__["StringRepresentationProvider"]), - identityProvider: new _referencesTree_js__WEBPACK_IMPORTED_MODULE_11__["IdentityProvider"](), - openOnSingleClick: true, - openOnFocus: true, - overrideStyles: { - listBackground: _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewResultsBackground"] - } - }; - if (this._defaultTreeKeyboardSupport) { - // the tree will consume `Escape` and prevent the widget from closing - this._callOnDispose.add(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](this._treeContainer, 'keydown', (e) => { - if (e.equals(9 /* Escape */)) { - this._keybindingService.dispatchEvent(e, e.target); - e.stopPropagation(); - } - }, true)); - } - this._tree = this._instantiationService.createInstance(ReferencesTree, 'ReferencesWidget', this._treeContainer, new _referencesTree_js__WEBPACK_IMPORTED_MODULE_11__["Delegate"](), [ - this._instantiationService.createInstance(_referencesTree_js__WEBPACK_IMPORTED_MODULE_11__["FileReferencesRenderer"]), - this._instantiationService.createInstance(_referencesTree_js__WEBPACK_IMPORTED_MODULE_11__["OneReferenceRenderer"]), - ], this._instantiationService.createInstance(_referencesTree_js__WEBPACK_IMPORTED_MODULE_11__["DataSource"]), treeOptions); - // split stuff - this._splitView.addView({ - onDidChange: _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Event"].None, - element: this._previewContainer, - minimumSize: 200, - maximumSize: Number.MAX_VALUE, - layout: (width) => { - this._preview.layout({ height: this._dim.height, width }); - } - }, _base_browser_ui_splitview_splitview_js__WEBPACK_IMPORTED_MODULE_20__["Sizing"].Distribute); - this._splitView.addView({ - onDidChange: _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Event"].None, - element: this._treeContainer, - minimumSize: 100, - maximumSize: Number.MAX_VALUE, - layout: (width) => { - this._treeContainer.style.height = `${this._dim.height}px`; - this._treeContainer.style.width = `${width}px`; - this._tree.layout(this._dim.height, width); - } - }, _base_browser_ui_splitview_splitview_js__WEBPACK_IMPORTED_MODULE_20__["Sizing"].Distribute); - this._disposables.add(this._splitView.onDidSashChange(() => { - if (this._dim.width) { - this.layoutData.ratio = this._splitView.getViewSize(0) / this._dim.width; - } - }, undefined)); - // listen on selection and focus - let onEvent = (element, kind) => { - if (element instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_19__["OneReference"]) { - if (kind === 'show') { - this._revealReference(element, false); - } - this._onDidSelectReference.fire({ element, kind, source: 'tree' }); - } - }; - this._tree.onDidOpen(e => { - if (e.sideBySide) { - onEvent(e.element, 'side'); - } - else if (e.editorOptions.pinned) { - onEvent(e.element, 'goto'); - } - else { - onEvent(e.element, 'show'); - } - }); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["hide"](this._treeContainer); - } - _onWidth(width) { - if (this._dim) { - this._doLayoutBody(this._dim.height, width); - } - } - _doLayoutBody(heightInPixel, widthInPixel) { - super._doLayoutBody(heightInPixel, widthInPixel); - this._dim = { height: heightInPixel, width: widthInPixel }; - this.layoutData.heightInLines = this._viewZone ? this._viewZone.heightInLines : this.layoutData.heightInLines; - this._splitView.layout(widthInPixel); - this._splitView.resizeView(0, widthInPixel * this.layoutData.ratio); - } - setSelection(selection) { - return this._revealReference(selection, true).then(() => { - if (!this._model) { - // disposed - return; - } - // show in tree - this._tree.setSelection([selection]); - this._tree.setFocus([selection]); - }); - } - setModel(newModel) { - // clean up - this._disposeOnNewModel.clear(); - this._model = newModel; - if (this._model) { - return this._onNewModel(); - } - return Promise.resolve(); - } - _onNewModel() { - if (!this._model) { - return Promise.resolve(undefined); - } - if (this._model.isEmpty) { - this.setTitle(''); - this._messageContainer.innerText = _nls_js__WEBPACK_IMPORTED_MODULE_12__["localize"]('noResults', "No results"); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["show"](this._messageContainer); - return Promise.resolve(undefined); - } - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["hide"](this._messageContainer); - this._decorationsManager = new DecorationsManager(this._preview, this._model); - this._disposeOnNewModel.add(this._decorationsManager); - // listen on model changes - this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(reference => this._tree.rerender(reference))); - // listen on editor - this._disposeOnNewModel.add(this._preview.onMouseDown(e => { - const { event, target } = e; - if (event.detail !== 2) { - return; - } - const element = this._getFocusedReference(); - if (!element) { - return; - } - this._onDidSelectReference.fire({ - element: { uri: element.uri, range: target.range }, - kind: (event.ctrlKey || event.metaKey || event.altKey) ? 'side' : 'open', - source: 'editor' - }); - })); - // make sure things are rendered - this.container.classList.add('results-loaded'); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["show"](this._treeContainer); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["show"](this._previewContainer); - this._splitView.layout(this._dim.width); - this.focusOnReferenceTree(); - // pick input and a reference to begin with - return this._tree.setInput(this._model.groups.length === 1 ? this._model.groups[0] : this._model); - } - _getFocusedReference() { - const [element] = this._tree.getFocus(); - if (element instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_19__["OneReference"]) { - return element; - } - else if (element instanceof _referencesModel_js__WEBPACK_IMPORTED_MODULE_19__["FileReferences"]) { - if (element.children.length > 0) { - return element.children[0]; - } - } - return undefined; - } - revealReference(reference) { - return __awaiter(this, void 0, void 0, function* () { - yield this._revealReference(reference, false); - this._onDidSelectReference.fire({ element: reference, kind: 'goto', source: 'tree' }); - }); - } - _revealReference(reference, revealParent) { - return __awaiter(this, void 0, void 0, function* () { - // check if there is anything to do... - if (this._revealedReference === reference) { - return; - } - this._revealedReference = reference; - // Update widget header - if (reference.uri.scheme !== _base_common_network_js__WEBPACK_IMPORTED_MODULE_5__["Schemas"].inMemory) { - this.setTitle(Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_6__["basenameOrAuthority"])(reference.uri), this._uriLabel.getUriLabel(Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_6__["dirname"])(reference.uri))); - } - else { - this.setTitle(_nls_js__WEBPACK_IMPORTED_MODULE_12__["localize"]('peekView.alternateTitle', "References")); - } - const promise = this._textModelResolverService.createModelReference(reference.uri); - if (this._tree.getInput() === reference.parent) { - this._tree.reveal(reference); - } - else { - if (revealParent) { - this._tree.reveal(reference.parent); - } - yield this._tree.expand(reference.parent); - this._tree.reveal(reference); - } - const ref = yield promise; - if (!this._model) { - // disposed - ref.dispose(); - return; - } - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])(this._previewModelReference); - // show in editor - const model = ref.object; - if (model) { - const scrollType = this._preview.getModel() === model.textEditorModel ? 0 /* Smooth */ : 1 /* Immediate */; - const sel = _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].lift(reference.range).collapseToStart(); - this._previewModelReference = ref; - this._preview.setModel(model.textEditorModel); - this._preview.setSelection(sel); - this._preview.revealRangeInCenter(sel, scrollType); - } - else { - this._preview.setModel(this._previewNotAvailableMessage); - ref.dispose(); - } - }); - } -}; -ReferenceWidget = __decorate([ - __param(3, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_17__["IThemeService"]), - __param(4, _common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_10__["ITextModelService"]), - __param(5, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_13__["IInstantiationService"]), - __param(6, _peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["IPeekViewService"]), - __param(7, _platform_label_common_label_js__WEBPACK_IMPORTED_MODULE_14__["ILabelService"]), - __param(8, _platform_undoRedo_common_undoRedo_js__WEBPACK_IMPORTED_MODULE_21__["IUndoRedoService"]), - __param(9, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_22__["IKeybindingService"]) -], ReferenceWidget); - -// theming -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_17__["registerThemingParticipant"])((theme, collector) => { - const findMatchHighlightColor = theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewResultsMatchHighlight"]); - if (findMatchHighlightColor) { - collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { background-color: ${findMatchHighlightColor}; }`); - } - const referenceHighlightColor = theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewEditorMatchHighlight"]); - if (referenceHighlightColor) { - collector.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { background-color: ${referenceHighlightColor}; }`); - } - const referenceHighlightBorder = theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewEditorMatchHighlightBorder"]); - if (referenceHighlightBorder) { - collector.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { border: 2px solid ${referenceHighlightBorder}; box-sizing: border-box; }`); - } - const hcOutline = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_16__["activeContrastBorder"]); - if (hcOutline) { - collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { border: 1px dotted ${hcOutline}; box-sizing: border-box; }`); - } - const resultsBackground = theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewResultsBackground"]); - if (resultsBackground) { - collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree { background-color: ${resultsBackground}; }`); - } - const resultsMatchForeground = theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewResultsMatchForeground"]); - if (resultsMatchForeground) { - collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree { color: ${resultsMatchForeground}; }`); - } - const resultsFileForeground = theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewResultsFileForeground"]); - if (resultsFileForeground) { - collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .reference-file { color: ${resultsFileForeground}; }`); - } - const resultsSelectedBackground = theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewResultsSelectionBackground"]); - if (resultsSelectedBackground) { - collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { background-color: ${resultsSelectedBackground}; }`); - } - const resultsSelectedForeground = theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewResultsSelectionForeground"]); - if (resultsSelectedForeground) { - collector.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { color: ${resultsSelectedForeground} !important; }`); - } - const editorBackground = theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewEditorBackground"]); - if (editorBackground) { - collector.addRule(`.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,` + - `.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input {` + - ` background-color: ${editorBackground};` + - `}`); - } - const editorGutterBackground = theme.getColor(_peekView_peekView_js__WEBPACK_IMPORTED_MODULE_18__["peekViewEditorGutterBackground"]); - if (editorGutterBackground) { - collector.addRule(`.monaco-editor .reference-zone-widget .preview .monaco-editor .margin {` + - ` background-color: ${editorGutterBackground};` + - `}`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/referencesModel.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/referencesModel.js ***! - \****************************************************************************************/ -/*! exports provided: OneReference, FilePreview, FileReferences, ReferencesModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OneReference", function() { return OneReference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FilePreview", function() { return FilePreview; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FileReferences", function() { return FileReferences; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReferencesModel", function() { return ReferencesModel; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_resources_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _base_common_idGenerator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/idGenerator.js */ "./node_modules/monaco-editor/esm/vs/base/common/idGenerator.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_common_map_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/map.js */ "./node_modules/monaco-editor/esm/vs/base/common/map.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - -class OneReference { - constructor(isProviderFirst, parent, uri, _range, _rangeCallback) { - this.isProviderFirst = isProviderFirst; - this.parent = parent; - this.uri = uri; - this._range = _range; - this._rangeCallback = _rangeCallback; - this.id = _base_common_idGenerator_js__WEBPACK_IMPORTED_MODULE_5__["defaultGenerator"].nextId(); - } - get range() { - return this._range; - } - set range(value) { - this._range = value; - this._rangeCallback(this); - } - get ariaMessage() { - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('aria.oneReference', "symbol in {0} on line {1} at column {2}", Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_2__["basename"])(this.uri), this.range.startLineNumber, this.range.startColumn); - } -} -class FilePreview { - constructor(_modelReference) { - this._modelReference = _modelReference; - } - dispose() { - this._modelReference.dispose(); - } - preview(range, n = 8) { - const model = this._modelReference.object.textEditorModel; - if (!model) { - return undefined; - } - const { startLineNumber, startColumn, endLineNumber, endColumn } = range; - const word = model.getWordUntilPosition({ lineNumber: startLineNumber, column: startColumn - n }); - const beforeRange = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](startLineNumber, word.startColumn, startLineNumber, startColumn); - const afterRange = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](endLineNumber, endColumn, endLineNumber, 1073741824 /* MAX_SAFE_SMALL_INTEGER */); - const before = model.getValueInRange(beforeRange).replace(/^\s+/, ''); - const inside = model.getValueInRange(range); - const after = model.getValueInRange(afterRange).replace(/\s+$/, ''); - return { - value: before + inside + after, - highlight: { start: before.length, end: before.length + inside.length } - }; - } -} -class FileReferences { - constructor(parent, uri) { - this.parent = parent; - this.uri = uri; - this.children = []; - this._previews = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_7__["ResourceMap"](); - } - dispose() { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["dispose"])(this._previews.values()); - this._previews.clear(); - } - getPreview(child) { - return this._previews.get(child.uri); - } - get ariaMessage() { - const len = this.children.length; - if (len === 1) { - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('aria.fileReferences.1', "1 symbol in {0}, full path {1}", Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_2__["basename"])(this.uri), this.uri.fsPath); - } - else { - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('aria.fileReferences.N', "{0} symbols in {1}, full path {2}", len, Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_2__["basename"])(this.uri), this.uri.fsPath); - } - } - resolve(textModelResolverService) { - return __awaiter(this, void 0, void 0, function* () { - if (this._previews.size !== 0) { - return this; - } - for (let child of this.children) { - if (this._previews.has(child.uri)) { - continue; - } - try { - const ref = yield textModelResolverService.createModelReference(child.uri); - this._previews.set(child.uri, new FilePreview(ref)); - } - catch (err) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_8__["onUnexpectedError"])(err); - } - } - return this; - }); - } -} -class ReferencesModel { - constructor(links, title) { - this._disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - this.groups = []; - this.references = []; - this._onDidChangeReferenceRange = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"](); - this.onDidChangeReferenceRange = this._onDidChangeReferenceRange.event; - this._links = links; - this._title = title; - // grouping and sorting - const [providersFirst] = links; - links.sort(ReferencesModel._compareReferences); - let current; - for (let link of links) { - if (!current || !_base_common_resources_js__WEBPACK_IMPORTED_MODULE_2__["extUri"].isEqual(current.uri, link.uri, true)) { - // new group - current = new FileReferences(this, link.uri); - this.groups.push(current); - } - // append, check for equality first! - if (current.children.length === 0 || ReferencesModel._compareReferences(link, current.children[current.children.length - 1]) !== 0) { - const oneRef = new OneReference(providersFirst === link, current, link.uri, link.targetSelectionRange || link.range, ref => this._onDidChangeReferenceRange.fire(ref)); - this.references.push(oneRef); - current.children.push(oneRef); - } - } - } - dispose() { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["dispose"])(this.groups); - this._disposables.dispose(); - this._onDidChangeReferenceRange.dispose(); - this.groups.length = 0; - } - clone() { - return new ReferencesModel(this._links, this._title); - } - get title() { - return this._title; - } - get isEmpty() { - return this.groups.length === 0; - } - get ariaMessage() { - if (this.isEmpty) { - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('aria.result.0', "No results found"); - } - else if (this.references.length === 1) { - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('aria.result.1', "Found 1 symbol in {0}", this.references[0].uri.fsPath); - } - else if (this.groups.length === 1) { - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('aria.result.n1', "Found {0} symbols in {1}", this.references.length, this.groups[0].uri.fsPath); - } - else { - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('aria.result.nm', "Found {0} symbols in {1} files", this.references.length, this.groups.length); - } - } - nextOrPreviousReference(reference, next) { - let { parent } = reference; - let idx = parent.children.indexOf(reference); - let childCount = parent.children.length; - let groupCount = parent.parent.groups.length; - if (groupCount === 1 || next && idx + 1 < childCount || !next && idx > 0) { - // cycling within one file - if (next) { - idx = (idx + 1) % childCount; - } - else { - idx = (idx + childCount - 1) % childCount; - } - return parent.children[idx]; - } - idx = parent.parent.groups.indexOf(parent); - if (next) { - idx = (idx + 1) % groupCount; - return parent.parent.groups[idx].children[0]; - } - else { - idx = (idx + groupCount - 1) % groupCount; - return parent.parent.groups[idx].children[parent.parent.groups[idx].children.length - 1]; - } - } - nearestReference(resource, position) { - const nearest = this.references.map((ref, idx) => { - return { - idx, - prefixLen: _base_common_strings_js__WEBPACK_IMPORTED_MODULE_4__["commonPrefixLength"](ref.uri.toString(), resource.toString()), - offsetDist: Math.abs(ref.range.startLineNumber - position.lineNumber) * 100 + Math.abs(ref.range.startColumn - position.column) - }; - }).sort((a, b) => { - if (a.prefixLen > b.prefixLen) { - return -1; - } - else if (a.prefixLen < b.prefixLen) { - return 1; - } - else if (a.offsetDist < b.offsetDist) { - return -1; - } - else if (a.offsetDist > b.offsetDist) { - return 1; - } - else { - return 0; - } - })[0]; - if (nearest) { - return this.references[nearest.idx]; - } - return undefined; - } - referenceAt(resource, position) { - for (const ref of this.references) { - if (ref.uri.toString() === resource.toString()) { - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].containsPosition(ref.range, position)) { - return ref; - } - } - } - return undefined; - } - firstReference() { - for (const ref of this.references) { - if (ref.isProviderFirst) { - return ref; - } - } - return this.references[0]; - } - static _compareReferences(a, b) { - return _base_common_resources_js__WEBPACK_IMPORTED_MODULE_2__["extUri"].compare(a.uri, b.uri) || _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts(a.range, b.range); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/symbolNavigation.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/symbolNavigation.js ***! - \*****************************************************************************************/ -/*! exports provided: ctxHasSymbols, ISymbolNavigationService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ctxHasSymbols", function() { return ctxHasSymbols; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ISymbolNavigationService", function() { return ISymbolNavigationService; }); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../platform/instantiation/common/extensions.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/extensions.js"); -/* harmony import */ var _platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybindingsRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _base_common_resources_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../base/common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - -const ctxHasSymbols = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('hasSymbols', false); -const ISymbolNavigationService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__["createDecorator"])('ISymbolNavigationService'); -let SymbolNavigationService = class SymbolNavigationService { - constructor(contextKeyService, _editorService, _notificationService, _keybindingService) { - this._editorService = _editorService; - this._notificationService = _notificationService; - this._keybindingService = _keybindingService; - this._currentModel = undefined; - this._currentIdx = -1; - this._ignoreEditorChange = false; - this._ctxHasSymbols = ctxHasSymbols.bindTo(contextKeyService); - } - reset() { - this._ctxHasSymbols.reset(); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["dispose"])(this._currentState); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["dispose"])(this._currentMessage); - this._currentModel = undefined; - this._currentIdx = -1; - } - put(anchor) { - const refModel = anchor.parent.parent; - if (refModel.references.length <= 1) { - this.reset(); - return; - } - this._currentModel = refModel; - this._currentIdx = refModel.references.indexOf(anchor); - this._ctxHasSymbols.set(true); - this._showMessage(); - const editorState = new EditorState(this._editorService); - const listener = editorState.onDidChange(_ => { - if (this._ignoreEditorChange) { - return; - } - const editor = this._editorService.getActiveCodeEditor(); - if (!editor) { - return; - } - const model = editor.getModel(); - const position = editor.getPosition(); - if (!model || !position) { - return; - } - let seenUri = false; - let seenPosition = false; - for (const reference of refModel.references) { - if (Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_12__["isEqual"])(reference.uri, model.uri)) { - seenUri = true; - seenPosition = seenPosition || _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].containsPosition(reference.range, position); - } - else if (seenUri) { - break; - } - } - if (!seenUri || !seenPosition) { - this.reset(); - } - }); - this._currentState = Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["combinedDisposable"])(editorState, listener); - } - revealNext(source) { - if (!this._currentModel) { - return Promise.resolve(); - } - // get next result and advance - this._currentIdx += 1; - this._currentIdx %= this._currentModel.references.length; - const reference = this._currentModel.references[this._currentIdx]; - // status - this._showMessage(); - // open editor, ignore events while that happens - this._ignoreEditorChange = true; - return this._editorService.openCodeEditor({ - resource: reference.uri, - options: { - selection: _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].collapseToStart(reference.range), - selectionRevealType: 3 /* NearTopIfOutsideViewport */ - } - }, source).finally(() => { - this._ignoreEditorChange = false; - }); - } - _showMessage() { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["dispose"])(this._currentMessage); - const kb = this._keybindingService.lookupKeybinding('editor.gotoNextSymbolFromResult'); - const message = kb - ? Object(_nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"])('location.kb', "Symbol {0} of {1}, {2} for next", this._currentIdx + 1, this._currentModel.references.length, kb.getLabel()) - : Object(_nls_js__WEBPACK_IMPORTED_MODULE_9__["localize"])('location', "Symbol {0} of {1}", this._currentIdx + 1, this._currentModel.references.length); - this._currentMessage = this._notificationService.status(message); - } -}; -SymbolNavigationService = __decorate([ - __param(0, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["IContextKeyService"]), - __param(1, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_5__["ICodeEditorService"]), - __param(2, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_11__["INotificationService"]), - __param(3, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__["IKeybindingService"]) -], SymbolNavigationService); -Object(_platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_2__["registerSingleton"])(ISymbolNavigationService, SymbolNavigationService, true); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new class extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorCommand"] { - constructor() { - super({ - id: 'editor.gotoNextSymbolFromResult', - precondition: ctxHasSymbols, - kbOpts: { - weight: 100 /* EditorContrib */, - primary: 70 /* F12 */ - } - }); - } - runEditorCommand(accessor, editor) { - return accessor.get(ISymbolNavigationService).revealNext(editor); - } -}); -_platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_3__["KeybindingsRegistry"].registerCommandAndKeybindingRule({ - id: 'editor.gotoNextSymbolFromResult.cancel', - weight: 100 /* EditorContrib */, - when: ctxHasSymbols, - primary: 9 /* Escape */, - handler(accessor) { - accessor.get(ISymbolNavigationService).reset(); - } -}); -// -let EditorState = class EditorState { - constructor(editorService) { - this._listener = new Map(); - this._disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["DisposableStore"](); - this._onDidChange = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_8__["Emitter"](); - this.onDidChange = this._onDidChange.event; - this._disposables.add(editorService.onCodeEditorRemove(this._onDidRemoveEditor, this)); - this._disposables.add(editorService.onCodeEditorAdd(this._onDidAddEditor, this)); - editorService.listCodeEditors().forEach(this._onDidAddEditor, this); - } - dispose() { - this._disposables.dispose(); - this._onDidChange.dispose(); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["dispose"])(this._listener.values()); - } - _onDidAddEditor(editor) { - this._listener.set(editor, Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["combinedDisposable"])(editor.onDidChangeCursorPosition(_ => this._onDidChange.fire({ editor })), editor.onDidChangeModelContent(_ => this._onDidChange.fire({ editor })))); - } - _onDidRemoveEditor(editor) { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["dispose"])(this._listener.get(editor)); - this._listener.delete(editor); - } -}; -EditorState = __decorate([ - __param(0, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_5__["ICodeEditorService"]) -], EditorState); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/getHover.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/hover/getHover.js ***! - \****************************************************************************/ -/*! exports provided: getHover */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHover", function() { return getHover; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -function getHover(model, position, token) { - const supports = _common_modes_js__WEBPACK_IMPORTED_MODULE_4__["HoverProviderRegistry"].ordered(model); - const promises = supports.map(support => { - return Promise.resolve(support.provideHover(model, position, token)).then(hover => { - return hover && isValid(hover) ? hover : undefined; - }, err => { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["onUnexpectedExternalError"])(err); - return undefined; - }); - }); - return Promise.all(promises).then(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["coalesce"]); -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerModelAndPositionCommand"])('_executeHoverProvider', (model, position) => getHover(model, position, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationToken"].None)); -function isValid(result) { - const hasRange = (typeof result.range !== 'undefined'); - const hasHtmlContent = typeof result.contents !== 'undefined' && result.contents && result.contents.length > 0; - return hasRange && hasHtmlContent; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/hover.js": -/*!*************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/hover/hover.js ***! - \*************************************************************************/ -/*! exports provided: ModesHoverController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModesHoverController", function() { return ModesHoverController; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/services/modeService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modeService.js"); -/* harmony import */ var _modesContentHover_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modesContentHover.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/modesContentHover.js"); -/* harmony import */ var _modesGlyphHover_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./modesGlyphHover.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/modesGlyphHover.js"); -/* harmony import */ var _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/opener/common/opener.js */ "./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _common_services_markersDecorationService_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../common/services/markersDecorationService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/markersDecorationService.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _gotoSymbol_link_goToDefinitionAtPosition_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../gotoSymbol/link/goToDefinitionAtPosition.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - -let ModesHoverController = class ModesHoverController { - constructor(_editor, _openerService, _modeService, _markerDecorationsService, _keybindingService, _themeService, _contextKeyService) { - this._editor = _editor; - this._openerService = _openerService; - this._modeService = _modeService; - this._markerDecorationsService = _markerDecorationsService; - this._keybindingService = _keybindingService; - this._themeService = _themeService; - this._toUnhook = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["DisposableStore"](); - this._contentWidget = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["MutableDisposable"](); - this._glyphWidget = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["MutableDisposable"](); - this._isMouseDown = false; - this._hoverClicked = false; - this._hookEvents(); - this._didChangeConfigurationHandler = this._editor.onDidChangeConfiguration((e) => { - if (e.hasChanged(46 /* hover */)) { - this._hideWidgets(); - this._unhookEvents(); - this._hookEvents(); - } - }); - this._hoverVisibleKey = _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].hoverVisible.bindTo(_contextKeyService); - } - get contentWidget() { - if (!this._contentWidget.value) { - this._createHoverWidgets(); - } - return this._contentWidget.value; - } - get glyphWidget() { - if (!this._glyphWidget.value) { - this._createHoverWidgets(); - } - return this._glyphWidget.value; - } - static get(editor) { - return editor.getContribution(ModesHoverController.ID); - } - _hookEvents() { - const hideWidgetsEventHandler = () => this._hideWidgets(); - const hoverOpts = this._editor.getOption(46 /* hover */); - this._isHoverEnabled = hoverOpts.enabled; - this._isHoverSticky = hoverOpts.sticky; - if (this._isHoverEnabled) { - this._toUnhook.add(this._editor.onMouseDown((e) => this._onEditorMouseDown(e))); - this._toUnhook.add(this._editor.onMouseUp((e) => this._onEditorMouseUp(e))); - this._toUnhook.add(this._editor.onMouseMove((e) => this._onEditorMouseMove(e))); - this._toUnhook.add(this._editor.onKeyDown((e) => this._onKeyDown(e))); - this._toUnhook.add(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged())); - } - else { - this._toUnhook.add(this._editor.onMouseMove(hideWidgetsEventHandler)); - this._toUnhook.add(this._editor.onKeyDown((e) => this._onKeyDown(e))); - } - this._toUnhook.add(this._editor.onMouseLeave(hideWidgetsEventHandler)); - this._toUnhook.add(this._editor.onDidChangeModel(hideWidgetsEventHandler)); - this._toUnhook.add(this._editor.onDidScrollChange((e) => this._onEditorScrollChanged(e))); - } - _unhookEvents() { - this._toUnhook.clear(); - } - _onModelDecorationsChanged() { - this.contentWidget.onModelDecorationsChanged(); - this.glyphWidget.onModelDecorationsChanged(); - } - _onEditorScrollChanged(e) { - if (e.scrollTopChanged || e.scrollLeftChanged) { - this._hideWidgets(); - } - } - _onEditorMouseDown(mouseEvent) { - this._isMouseDown = true; - const targetType = mouseEvent.target.type; - if (targetType === 9 /* CONTENT_WIDGET */ && mouseEvent.target.detail === _modesContentHover_js__WEBPACK_IMPORTED_MODULE_7__["ModesContentHoverWidget"].ID) { - this._hoverClicked = true; - // mouse down on top of content hover widget - return; - } - if (targetType === 12 /* OVERLAY_WIDGET */ && mouseEvent.target.detail === _modesGlyphHover_js__WEBPACK_IMPORTED_MODULE_8__["ModesGlyphHoverWidget"].ID) { - // mouse down on top of overlay hover widget - return; - } - if (targetType !== 12 /* OVERLAY_WIDGET */ && mouseEvent.target.detail !== _modesGlyphHover_js__WEBPACK_IMPORTED_MODULE_8__["ModesGlyphHoverWidget"].ID) { - this._hoverClicked = false; - } - this._hideWidgets(); - } - _onEditorMouseUp(mouseEvent) { - this._isMouseDown = false; - } - _onEditorMouseMove(mouseEvent) { - let targetType = mouseEvent.target.type; - if (this._isMouseDown && this._hoverClicked && this.contentWidget.isColorPickerVisible()) { - return; - } - if (this._isHoverSticky && targetType === 9 /* CONTENT_WIDGET */ && mouseEvent.target.detail === _modesContentHover_js__WEBPACK_IMPORTED_MODULE_7__["ModesContentHoverWidget"].ID) { - // mouse moved on top of content hover widget - return; - } - if (this._isHoverSticky && targetType === 12 /* OVERLAY_WIDGET */ && mouseEvent.target.detail === _modesGlyphHover_js__WEBPACK_IMPORTED_MODULE_8__["ModesGlyphHoverWidget"].ID) { - // mouse moved on top of overlay hover widget - return; - } - if (targetType === 7 /* CONTENT_EMPTY */) { - const epsilon = this._editor.getOption(36 /* fontInfo */).typicalHalfwidthCharacterWidth / 2; - const data = mouseEvent.target.detail; - if (data && !data.isAfterLines && typeof data.horizontalDistanceToText === 'number' && data.horizontalDistanceToText < epsilon) { - // Let hover kick in even when the mouse is technically in the empty area after a line, given the distance is small enough - targetType = 6 /* CONTENT_TEXT */; - } - } - if (targetType === 6 /* CONTENT_TEXT */) { - this.glyphWidget.hide(); - if (this._isHoverEnabled && mouseEvent.target.range) { - this.contentWidget.startShowingAt(mouseEvent.target.range, 0 /* Delayed */, false); - } - } - else if (targetType === 2 /* GUTTER_GLYPH_MARGIN */) { - this.contentWidget.hide(); - if (this._isHoverEnabled && mouseEvent.target.position) { - this.glyphWidget.startShowingAt(mouseEvent.target.position.lineNumber); - } - } - else { - this._hideWidgets(); - } - } - _onKeyDown(e) { - if (e.keyCode !== 5 /* Ctrl */ && e.keyCode !== 6 /* Alt */ && e.keyCode !== 57 /* Meta */ && e.keyCode !== 4 /* Shift */) { - // Do not hide hover when a modifier key is pressed - this._hideWidgets(); - } - } - _hideWidgets() { - if (!this._glyphWidget.value || !this._contentWidget.value || (this._isMouseDown && this._hoverClicked && this._contentWidget.value.isColorPickerVisible())) { - return; - } - this._glyphWidget.value.hide(); - this._contentWidget.value.hide(); - } - _createHoverWidgets() { - this._contentWidget.value = new _modesContentHover_js__WEBPACK_IMPORTED_MODULE_7__["ModesContentHoverWidget"](this._editor, this._hoverVisibleKey, this._markerDecorationsService, this._keybindingService, this._themeService, this._modeService, this._openerService); - this._glyphWidget.value = new _modesGlyphHover_js__WEBPACK_IMPORTED_MODULE_8__["ModesGlyphHoverWidget"](this._editor, this._modeService, this._openerService); - } - showContentHover(range, mode, focus) { - this.contentWidget.startShowingAt(range, mode, focus); - } - dispose() { - this._unhookEvents(); - this._toUnhook.dispose(); - this._didChangeConfigurationHandler.dispose(); - this._glyphWidget.dispose(); - this._contentWidget.dispose(); - } -}; -ModesHoverController.ID = 'editor.contrib.hover'; -ModesHoverController = __decorate([ - __param(1, _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_9__["IOpenerService"]), - __param(2, _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_6__["IModeService"]), - __param(3, _common_services_markersDecorationService_js__WEBPACK_IMPORTED_MODULE_12__["IMarkerDecorationsService"]), - __param(4, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_13__["IKeybindingService"]), - __param(5, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_11__["IThemeService"]), - __param(6, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["IContextKeyService"]) -], ModesHoverController); - -class ShowHoverAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.showHover', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ - key: 'showHover', - comment: [ - 'Label for action that will trigger the showing of a hover in the editor.', - 'This allows for users to show the hover without using the mouse.' - ] - }, "Show Hover"), - alias: 'Show Hover', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 39 /* KEY_I */), - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - if (!editor.hasModel()) { - return; - } - let controller = ModesHoverController.get(editor); - if (!controller) { - return; - } - const position = editor.getPosition(); - const range = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](position.lineNumber, position.column, position.lineNumber, position.column); - const focus = editor.getOption(2 /* accessibilitySupport */) === 2 /* Enabled */; - controller.showContentHover(range, 1 /* Immediate */, focus); - } -} -class ShowDefinitionPreviewHoverAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.showDefinitionPreviewHover', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ - key: 'showDefinitionPreviewHover', - comment: [ - 'Label for action that will trigger the showing of definition preview hover in the editor.', - 'This allows for users to show the definition preview hover without using the mouse.' - ] - }, "Show Definition Preview Hover"), - alias: 'Show Definition Preview Hover', - precondition: undefined - }); - } - run(accessor, editor) { - let controller = ModesHoverController.get(editor); - if (!controller) { - return; - } - const position = editor.getPosition(); - if (!position) { - return; - } - const range = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](position.lineNumber, position.column, position.lineNumber, position.column); - const goto = _gotoSymbol_link_goToDefinitionAtPosition_js__WEBPACK_IMPORTED_MODULE_14__["GotoDefinitionAtPositionEditorContribution"].get(editor); - const promise = goto.startFindDefinitionFromCursor(position); - if (promise) { - promise.then(() => { - controller.showContentHover(range, 1 /* Immediate */, true); - }); - } - else { - controller.showContentHover(range, 1 /* Immediate */, true); - } - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorContribution"])(ModesHoverController.ID, ModesHoverController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(ShowHoverAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(ShowDefinitionPreviewHoverAction); -// theming -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_11__["registerThemingParticipant"])((theme, collector) => { - const editorHoverHighlightColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_10__["editorHoverHighlight"]); - if (editorHoverHighlightColor) { - collector.addRule(`.monaco-editor .hoverHighlight { background-color: ${editorHoverHighlightColor}; }`); - } - const hoverBackground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_10__["editorHoverBackground"]); - if (hoverBackground) { - collector.addRule(`.monaco-editor .monaco-hover { background-color: ${hoverBackground}; }`); - } - const hoverBorder = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_10__["editorHoverBorder"]); - if (hoverBorder) { - collector.addRule(`.monaco-editor .monaco-hover { border: 1px solid ${hoverBorder}; }`); - collector.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`); - collector.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${hoverBorder.transparent(0.5)}; }`); - collector.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${hoverBorder.transparent(0.5)}; }`); - } - const link = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_10__["textLinkForeground"]); - if (link) { - collector.addRule(`.monaco-editor .monaco-hover a { color: ${link}; }`); - } - const hoverForeground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_10__["editorHoverForeground"]); - if (hoverForeground) { - collector.addRule(`.monaco-editor .monaco-hover { color: ${hoverForeground}; }`); - } - const actionsBackground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_10__["editorHoverStatusBarBackground"]); - if (actionsBackground) { - collector.addRule(`.monaco-editor .monaco-hover .hover-row .actions { background-color: ${actionsBackground}; }`); - } - const codeBackground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_10__["textCodeBlockBackground"]); - if (codeBackground) { - collector.addRule(`.monaco-editor .monaco-hover code { background-color: ${codeBackground}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/hoverOperation.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/hover/hoverOperation.js ***! - \**********************************************************************************/ -/*! exports provided: HoverOperation */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HoverOperation", function() { return HoverOperation; }); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class HoverOperation { - constructor(computer, success, error, progress, hoverTime) { - this._computer = computer; - this._state = 0 /* IDLE */; - this._hoverTime = hoverTime; - this._firstWaitScheduler = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["RunOnceScheduler"](() => this._triggerAsyncComputation(), 0); - this._secondWaitScheduler = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["RunOnceScheduler"](() => this._triggerSyncComputation(), 0); - this._loadingMessageScheduler = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["RunOnceScheduler"](() => this._showLoadingMessage(), 0); - this._asyncComputationPromise = null; - this._asyncComputationPromiseDone = false; - this._completeCallback = success; - this._errorCallback = error; - this._progressCallback = progress; - } - setHoverTime(hoverTime) { - this._hoverTime = hoverTime; - } - _firstWaitTime() { - return this._hoverTime / 2; - } - _secondWaitTime() { - return this._hoverTime / 2; - } - _loadingMessageTime() { - return 3 * this._hoverTime; - } - _triggerAsyncComputation() { - this._state = 2 /* SECOND_WAIT */; - this._secondWaitScheduler.schedule(this._secondWaitTime()); - if (this._computer.computeAsync) { - this._asyncComputationPromiseDone = false; - this._asyncComputationPromise = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["createCancelablePromise"])(token => this._computer.computeAsync(token)); - this._asyncComputationPromise.then((asyncResult) => { - this._asyncComputationPromiseDone = true; - this._withAsyncResult(asyncResult); - }, (e) => this._onError(e)); - } - else { - this._asyncComputationPromiseDone = true; - } - } - _triggerSyncComputation() { - if (this._computer.computeSync) { - this._computer.onResult(this._computer.computeSync(), true); - } - if (this._asyncComputationPromiseDone) { - this._state = 0 /* IDLE */; - this._onComplete(this._computer.getResult()); - } - else { - this._state = 3 /* WAITING_FOR_ASYNC_COMPUTATION */; - this._onProgress(this._computer.getResult()); - } - } - _showLoadingMessage() { - if (this._state === 3 /* WAITING_FOR_ASYNC_COMPUTATION */) { - this._onProgress(this._computer.getResultWithLoadingMessage()); - } - } - _withAsyncResult(asyncResult) { - if (asyncResult) { - this._computer.onResult(asyncResult, false); - } - if (this._state === 3 /* WAITING_FOR_ASYNC_COMPUTATION */) { - this._state = 0 /* IDLE */; - this._onComplete(this._computer.getResult()); - } - } - _onComplete(value) { - this._completeCallback(value); - } - _onError(error) { - if (this._errorCallback) { - this._errorCallback(error); - } - else { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"])(error); - } - } - _onProgress(value) { - this._progressCallback(value); - } - start(mode) { - if (mode === 0 /* Delayed */) { - if (this._state === 0 /* IDLE */) { - this._state = 1 /* FIRST_WAIT */; - this._firstWaitScheduler.schedule(this._firstWaitTime()); - this._loadingMessageScheduler.schedule(this._loadingMessageTime()); - } - } - else { - switch (this._state) { - case 0 /* IDLE */: - this._triggerAsyncComputation(); - this._secondWaitScheduler.cancel(); - this._triggerSyncComputation(); - break; - case 2 /* SECOND_WAIT */: - this._secondWaitScheduler.cancel(); - this._triggerSyncComputation(); - break; - } - } - } - cancel() { - this._loadingMessageScheduler.cancel(); - if (this._state === 1 /* FIRST_WAIT */) { - this._firstWaitScheduler.cancel(); - } - if (this._state === 2 /* SECOND_WAIT */) { - this._secondWaitScheduler.cancel(); - if (this._asyncComputationPromise) { - this._asyncComputationPromise.cancel(); - this._asyncComputationPromise = null; - } - } - if (this._state === 3 /* WAITING_FOR_ASYNC_COMPUTATION */) { - if (this._asyncComputationPromise) { - this._asyncComputationPromise.cancel(); - this._asyncComputationPromise = null; - } - } - this._state = 0 /* IDLE */; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/hoverWidgets.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/hover/hoverWidgets.js ***! - \********************************************************************************/ -/*! exports provided: ContentHoverWidget, GlyphHoverWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentHoverWidget", function() { return ContentHoverWidget; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlyphHoverWidget", function() { return GlyphHoverWidget; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_ui_widget_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/ui/widget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"); -/* harmony import */ var _base_browser_ui_hover_hoverWidget_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/ui/hover/hoverWidget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/hover/hoverWidget.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class ContentHoverWidget extends _base_browser_ui_widget_js__WEBPACK_IMPORTED_MODULE_1__["Widget"] { - constructor(id, editor, _hoverVisibleKey, _keybindingService) { - super(); - this._hoverVisibleKey = _hoverVisibleKey; - this._keybindingService = _keybindingService; - // Editor.IContentWidget.allowEditorOverflow - this.allowEditorOverflow = true; - this._hover = this._register(new _base_browser_ui_hover_hoverWidget_js__WEBPACK_IMPORTED_MODULE_2__["HoverWidget"]()); - this._id = id; - this._editor = editor; - this._isVisible = false; - this._stoleFocus = false; - this.onkeydown(this._hover.containerDomNode, (e) => { - if (e.equals(9 /* Escape */)) { - this.hide(); - } - }); - this._register(this._editor.onDidChangeConfiguration((e) => { - if (e.hasChanged(36 /* fontInfo */)) { - this.updateFont(); - } - })); - this._editor.onDidLayoutChange(e => this.layout()); - this.layout(); - this._editor.addContentWidget(this); - this._showAtPosition = null; - this._showAtRange = null; - this._stoleFocus = false; - } - get isVisible() { - return this._isVisible; - } - set isVisible(value) { - this._isVisible = value; - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["toggleClass"](this._hover.containerDomNode, 'hidden', !this._isVisible); - } - getId() { - return this._id; - } - getDomNode() { - return this._hover.containerDomNode; - } - showAt(position, range, focus) { - // Position has changed - this._showAtPosition = position; - this._showAtRange = range; - this._hoverVisibleKey.set(true); - this.isVisible = true; - this._editor.layoutContentWidget(this); - // Simply force a synchronous render on the editor - // such that the widget does not really render with left = '0px' - this._editor.render(); - this._stoleFocus = focus; - if (focus) { - this._hover.containerDomNode.focus(); - } - } - hide() { - if (!this.isVisible) { - return; - } - setTimeout(() => { - // Give commands a chance to see the key - if (!this.isVisible) { - this._hoverVisibleKey.set(false); - } - }, 0); - this.isVisible = false; - this._editor.layoutContentWidget(this); - if (this._stoleFocus) { - this._editor.focus(); - } - } - getPosition() { - if (this.isVisible) { - return { - position: this._showAtPosition, - range: this._showAtRange, - preference: [ - 1 /* ABOVE */, - 2 /* BELOW */ - ] - }; - } - return null; - } - dispose() { - this._editor.removeContentWidget(this); - super.dispose(); - } - updateFont() { - const codeClasses = Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName('code')); - codeClasses.forEach(node => this._editor.applyFontInfo(node)); - } - updateContents(node) { - this._hover.contentsDomNode.textContent = ''; - this._hover.contentsDomNode.appendChild(node); - this.updateFont(); - this._editor.layoutContentWidget(this); - this._hover.onContentsChanged(); - } - _renderAction(parent, actionOptions) { - const keybinding = this._keybindingService.lookupKeybinding(actionOptions.commandId); - const keybindingLabel = keybinding ? keybinding.getLabel() : null; - return Object(_base_browser_ui_hover_hoverWidget_js__WEBPACK_IMPORTED_MODULE_2__["renderHoverAction"])(parent, actionOptions, keybindingLabel); - } - layout() { - const height = Math.max(this._editor.getLayoutInfo().height / 4, 250); - const { fontSize, lineHeight } = this._editor.getOption(36 /* fontInfo */); - this._hover.contentsDomNode.style.fontSize = `${fontSize}px`; - this._hover.contentsDomNode.style.lineHeight = `${lineHeight}px`; - this._hover.contentsDomNode.style.maxHeight = `${height}px`; - this._hover.contentsDomNode.style.maxWidth = `${Math.max(this._editor.getLayoutInfo().width * 0.66, 500)}px`; - } -} -class GlyphHoverWidget extends _base_browser_ui_widget_js__WEBPACK_IMPORTED_MODULE_1__["Widget"] { - constructor(id, editor) { - super(); - this._id = id; - this._editor = editor; - this._isVisible = false; - this._domNode = document.createElement('div'); - this._domNode.className = 'monaco-hover hidden'; - this._domNode.setAttribute('aria-hidden', 'true'); - this._domNode.setAttribute('role', 'tooltip'); - this._showAtLineNumber = -1; - this._register(this._editor.onDidChangeConfiguration((e) => { - if (e.hasChanged(36 /* fontInfo */)) { - this.updateFont(); - } - })); - this._editor.addOverlayWidget(this); - } - get isVisible() { - return this._isVisible; - } - set isVisible(value) { - this._isVisible = value; - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["toggleClass"](this._domNode, 'hidden', !this._isVisible); - } - getId() { - return this._id; - } - getDomNode() { - return this._domNode; - } - showAt(lineNumber) { - this._showAtLineNumber = lineNumber; - if (!this.isVisible) { - this.isVisible = true; - } - const editorLayout = this._editor.getLayoutInfo(); - const topForLineNumber = this._editor.getTopForLineNumber(this._showAtLineNumber); - const editorScrollTop = this._editor.getScrollTop(); - const lineHeight = this._editor.getOption(51 /* lineHeight */); - const nodeHeight = this._domNode.clientHeight; - const top = topForLineNumber - editorScrollTop - ((nodeHeight - lineHeight) / 2); - this._domNode.style.left = `${editorLayout.glyphMarginLeft + editorLayout.glyphMarginWidth}px`; - this._domNode.style.top = `${Math.max(Math.round(top), 0)}px`; - } - hide() { - if (!this.isVisible) { - return; - } - this.isVisible = false; - } - getPosition() { - return null; - } - dispose() { - this._editor.removeOverlayWidget(this); - super.dispose(); - } - updateFont() { - const codeTags = Array.prototype.slice.call(this._domNode.getElementsByTagName('code')); - const codeClasses = Array.prototype.slice.call(this._domNode.getElementsByClassName('code')); - [...codeTags, ...codeClasses].forEach(node => this._editor.applyFontInfo(node)); - } - updateContents(node) { - this._domNode.textContent = ''; - this._domNode.appendChild(node); - this.updateFont(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/modesContentHover.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/hover/modesContentHover.js ***! - \*************************************************************************************/ -/*! exports provided: ModesContentHoverWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModesContentHoverWidget", function() { return ModesContentHoverWidget; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/htmlContent.js */ "./node_modules/monaco-editor/esm/vs/base/common/htmlContent.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _colorPicker_color_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../colorPicker/color.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/color.js"); -/* harmony import */ var _colorPicker_colorDetector_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../colorPicker/colorDetector.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorDetector.js"); -/* harmony import */ var _colorPicker_colorPickerModel_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../colorPicker/colorPickerModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorPickerModel.js"); -/* harmony import */ var _colorPicker_colorPickerWidget_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../colorPicker/colorPickerWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorPickerWidget.js"); -/* harmony import */ var _getHover_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./getHover.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/getHover.js"); -/* harmony import */ var _hoverOperation_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./hoverOperation.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/hoverOperation.js"); -/* harmony import */ var _hoverWidgets_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./hoverWidgets.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/hoverWidgets.js"); -/* harmony import */ var _markdown_markdownRenderer_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../markdown/markdownRenderer.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/markdown/markdownRenderer.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../platform/markers/common/markers.js */ "./node_modules/monaco-editor/esm/vs/platform/markers/common/markers.js"); -/* harmony import */ var _base_common_resources_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../base/common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../platform/opener/common/opener.js */ "./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js"); -/* harmony import */ var _gotoError_gotoError_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../gotoError/gotoError.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/gotoError.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _codeAction_codeAction_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../codeAction/codeAction.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeAction.js"); -/* harmony import */ var _codeAction_codeActionCommands_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../codeAction/codeActionCommands.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionCommands.js"); -/* harmony import */ var _codeAction_types_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../codeAction/types.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/types.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../../platform/progress/common/progress.js */ "./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const $ = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]; -class ColorHover { - constructor(range, color, provider) { - this.range = range; - this.color = color; - this.provider = provider; - } -} -class MarkerHover { - constructor(range, marker) { - this.range = range; - this.marker = marker; - } -} -class ModesContentComputer { - constructor(editor, _markerDecorationsService) { - this._markerDecorationsService = _markerDecorationsService; - this._editor = editor; - this._result = []; - } - setRange(range) { - this._range = range; - this._result = []; - } - clearResult() { - this._result = []; - } - computeAsync(token) { - if (!this._editor.hasModel() || !this._range) { - return Promise.resolve([]); - } - const model = this._editor.getModel(); - if (!_common_modes_js__WEBPACK_IMPORTED_MODULE_9__["HoverProviderRegistry"].has(model)) { - return Promise.resolve([]); - } - return Object(_getHover_js__WEBPACK_IMPORTED_MODULE_14__["getHover"])(model, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_6__["Position"](this._range.startLineNumber, this._range.startColumn), token); - } - computeSync() { - if (!this._editor.hasModel() || !this._range) { - return []; - } - const model = this._editor.getModel(); - const lineNumber = this._range.startLineNumber; - if (lineNumber > this._editor.getModel().getLineCount()) { - // Illegal line number => no results - return []; - } - const colorDetector = _colorPicker_colorDetector_js__WEBPACK_IMPORTED_MODULE_11__["ColorDetector"].get(this._editor); - const maxColumn = model.getLineMaxColumn(lineNumber); - const lineDecorations = this._editor.getLineDecorations(lineNumber); - let didFindColor = false; - const hoverRange = this._range; - const result = lineDecorations.map((d) => { - const startColumn = (d.range.startLineNumber === lineNumber) ? d.range.startColumn : 1; - const endColumn = (d.range.endLineNumber === lineNumber) ? d.range.endColumn : maxColumn; - if (startColumn > hoverRange.startColumn || hoverRange.endColumn > endColumn) { - return null; - } - const range = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](hoverRange.startLineNumber, startColumn, hoverRange.startLineNumber, endColumn); - const marker = this._markerDecorationsService.getMarker(model, d); - if (marker) { - return new MarkerHover(range, marker); - } - const colorData = colorDetector.getColorData(d.range.getStartPosition()); - if (!didFindColor && colorData) { - didFindColor = true; - const { color, range } = colorData.colorInfo; - return new ColorHover(range, color, colorData.provider); - } - else { - if (Object(_base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_4__["isEmptyMarkdownString"])(d.options.hoverMessage)) { - return null; - } - const contents = d.options.hoverMessage ? Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_19__["asArray"])(d.options.hoverMessage) : []; - return { contents, range }; - } - }); - return Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_19__["coalesce"])(result); - } - onResult(result, isFromSynchronousComputation) { - // Always put synchronous messages before asynchronous ones - if (isFromSynchronousComputation) { - this._result = result.concat(this._result.sort((a, b) => { - if (a instanceof ColorHover) { // sort picker messages at to the top - return -1; - } - else if (b instanceof ColorHover) { - return 1; - } - return 0; - })); - } - else { - this._result = this._result.concat(result); - } - } - getResult() { - return this._result.slice(0); - } - getResultWithLoadingMessage() { - return this._result.slice(0).concat([this._getLoadingMessage()]); - } - _getLoadingMessage() { - return { - range: this._range, - contents: [new _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_4__["MarkdownString"]().appendText(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('modesContentHover.loading', "Loading..."))] - }; - } -} -const markerCodeActionTrigger = { - type: 2 /* Manual */, - filter: { include: _codeAction_types_js__WEBPACK_IMPORTED_MODULE_28__["CodeActionKind"].QuickFix } -}; -class ModesContentHoverWidget extends _hoverWidgets_js__WEBPACK_IMPORTED_MODULE_16__["ContentHoverWidget"] { - constructor(editor, _hoverVisibleKey, markerDecorationsService, keybindingService, _themeService, _modeService, _openerService = _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_23__["NullOpenerService"]) { - super(ModesContentHoverWidget.ID, editor, _hoverVisibleKey, keybindingService); - this._themeService = _themeService; - this._modeService = _modeService; - this._openerService = _openerService; - this.renderDisposable = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["MutableDisposable"]()); - this._messages = []; - this._lastRange = null; - this._computer = new ModesContentComputer(this._editor, markerDecorationsService); - this._highlightDecorations = []; - this._isChangingDecorations = false; - this._shouldFocus = false; - this._colorPicker = null; - this._hoverOperation = new _hoverOperation_js__WEBPACK_IMPORTED_MODULE_15__["HoverOperation"](this._computer, result => this._withResult(result, true), null, result => this._withResult(result, false), this._editor.getOption(46 /* hover */).delay); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](this.getDomNode(), _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].FOCUS, () => { - if (this._colorPicker) { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addClass"](this.getDomNode(), 'colorpicker-hover'); - } - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](this.getDomNode(), _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].BLUR, () => { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["removeClass"](this.getDomNode(), 'colorpicker-hover'); - })); - this._register(editor.onDidChangeConfiguration((e) => { - this._hoverOperation.setHoverTime(this._editor.getOption(46 /* hover */).delay); - })); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_9__["TokenizationRegistry"].onDidChange((e) => { - if (this.isVisible && this._lastRange && this._messages.length > 0) { - this._hover.contentsDomNode.textContent = ''; - this._renderMessages(this._lastRange, this._messages); - } - })); - } - dispose() { - this._hoverOperation.cancel(); - super.dispose(); - } - onModelDecorationsChanged() { - if (this._isChangingDecorations) { - return; - } - if (this.isVisible) { - // The decorations have changed and the hover is visible, - // we need to recompute the displayed text - this._hoverOperation.cancel(); - this._computer.clearResult(); - if (!this._colorPicker) { // TODO@Michel ensure that displayed text for other decorations is computed even if color picker is in place - this._hoverOperation.start(0 /* Delayed */); - } - } - } - startShowingAt(range, mode, focus) { - if (this._lastRange && this._lastRange.equalsRange(range)) { - // We have to show the widget at the exact same range as before, so no work is needed - return; - } - this._hoverOperation.cancel(); - if (this.isVisible) { - // The range might have changed, but the hover is visible - // Instead of hiding it completely, filter out messages that are still in the new range and - // kick off a new computation - if (!this._showAtPosition || this._showAtPosition.lineNumber !== range.startLineNumber) { - this.hide(); - } - else { - let filteredMessages = []; - for (let i = 0, len = this._messages.length; i < len; i++) { - const msg = this._messages[i]; - const rng = msg.range; - if (rng && rng.startColumn <= range.startColumn && rng.endColumn >= range.endColumn) { - filteredMessages.push(msg); - } - } - if (filteredMessages.length > 0) { - if (hoverContentsEquals(filteredMessages, this._messages)) { - return; - } - this._renderMessages(range, filteredMessages); - } - else { - this.hide(); - } - } - } - this._lastRange = range; - this._computer.setRange(range); - this._shouldFocus = focus; - this._hoverOperation.start(mode); - } - hide() { - this._lastRange = null; - this._hoverOperation.cancel(); - super.hide(); - this._isChangingDecorations = true; - this._highlightDecorations = this._editor.deltaDecorations(this._highlightDecorations, []); - this._isChangingDecorations = false; - this.renderDisposable.clear(); - this._colorPicker = null; - } - isColorPickerVisible() { - if (this._colorPicker) { - return true; - } - return false; - } - _withResult(result, complete) { - this._messages = result; - if (this._lastRange && this._messages.length > 0) { - this._renderMessages(this._lastRange, this._messages); - } - else if (complete) { - this.hide(); - } - } - _renderMessages(renderRange, messages) { - this.renderDisposable.dispose(); - this._colorPicker = null; - // update column from which to show - let renderColumn = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - let highlightRange = messages[0].range ? _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].lift(messages[0].range) : null; - let fragment = document.createDocumentFragment(); - let isEmptyHoverContent = true; - let containColorPicker = false; - const markdownDisposeables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["DisposableStore"](); - const markerMessages = []; - messages.forEach((msg) => { - if (!msg.range) { - return; - } - renderColumn = Math.min(renderColumn, msg.range.startColumn); - highlightRange = highlightRange ? _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].plusRange(highlightRange, msg.range) : _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].lift(msg.range); - if (msg instanceof ColorHover) { - containColorPicker = true; - const { red, green, blue, alpha } = msg.color; - const rgba = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_3__["RGBA"](Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255), alpha); - const color = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_3__["Color"](rgba); - if (!this._editor.hasModel()) { - return; - } - const editorModel = this._editor.getModel(); - let range = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](msg.range.startLineNumber, msg.range.startColumn, msg.range.endLineNumber, msg.range.endColumn); - let colorInfo = { range: msg.range, color: msg.color }; - // create blank olor picker model and widget first to ensure it's positioned correctly. - const model = new _colorPicker_colorPickerModel_js__WEBPACK_IMPORTED_MODULE_12__["ColorPickerModel"](color, [], 0); - const widget = new _colorPicker_colorPickerWidget_js__WEBPACK_IMPORTED_MODULE_13__["ColorPickerWidget"](fragment, model, this._editor.getOption(115 /* pixelRatio */), this._themeService); - Object(_colorPicker_color_js__WEBPACK_IMPORTED_MODULE_10__["getColorPresentations"])(editorModel, colorInfo, msg.provider, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_2__["CancellationToken"].None).then(colorPresentations => { - model.colorPresentations = colorPresentations || []; - if (!this._editor.hasModel()) { - // gone... - return; - } - const originalText = this._editor.getModel().getValueInRange(msg.range); - model.guessColorPresentation(color, originalText); - const updateEditorModel = () => { - let textEdits; - let newRange; - if (model.presentation.textEdit) { - textEdits = [model.presentation.textEdit]; - newRange = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](model.presentation.textEdit.range.startLineNumber, model.presentation.textEdit.range.startColumn, model.presentation.textEdit.range.endLineNumber, model.presentation.textEdit.range.endColumn); - newRange = newRange.setEndPosition(newRange.endLineNumber, newRange.startColumn + model.presentation.textEdit.text.length); - } - else { - textEdits = [{ identifier: null, range, text: model.presentation.label, forceMoveMarkers: false }]; - newRange = range.setEndPosition(range.endLineNumber, range.startColumn + model.presentation.label.length); - } - this._editor.pushUndoStop(); - this._editor.executeEdits('colorpicker', textEdits); - if (model.presentation.additionalTextEdits) { - textEdits = [...model.presentation.additionalTextEdits]; - this._editor.executeEdits('colorpicker', textEdits); - this.hide(); - } - this._editor.pushUndoStop(); - range = newRange; - }; - const updateColorPresentations = (color) => { - return Object(_colorPicker_color_js__WEBPACK_IMPORTED_MODULE_10__["getColorPresentations"])(editorModel, { - range: range, - color: { - red: color.rgba.r / 255, - green: color.rgba.g / 255, - blue: color.rgba.b / 255, - alpha: color.rgba.a - } - }, msg.provider, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_2__["CancellationToken"].None).then((colorPresentations) => { - model.colorPresentations = colorPresentations || []; - }); - }; - const colorListener = model.onColorFlushed((color) => { - updateColorPresentations(color).then(updateEditorModel); - }); - const colorChangeListener = model.onDidChangeColor(updateColorPresentations); - this._colorPicker = widget; - this.showAt(range.getStartPosition(), range, this._shouldFocus); - this.updateContents(fragment); - this._colorPicker.layout(); - this.renderDisposable.value = Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["combinedDisposable"])(colorListener, colorChangeListener, widget, markdownDisposeables); - }); - } - else { - if (msg instanceof MarkerHover) { - markerMessages.push(msg); - isEmptyHoverContent = false; - } - else { - msg.contents - .filter(contents => !Object(_base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_4__["isEmptyMarkdownString"])(contents)) - .forEach(contents => { - const markdownHoverElement = $('div.hover-row.markdown-hover'); - const hoverContentsElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](markdownHoverElement, $('div.hover-contents')); - const renderer = markdownDisposeables.add(new _markdown_markdownRenderer_js__WEBPACK_IMPORTED_MODULE_17__["MarkdownRenderer"](this._editor, this._modeService, this._openerService)); - markdownDisposeables.add(renderer.onDidRenderCodeBlock(() => { - hoverContentsElement.className = 'hover-contents code-hover-contents'; - this._hover.onContentsChanged(); - })); - const renderedContents = markdownDisposeables.add(renderer.render(contents)); - hoverContentsElement.appendChild(renderedContents.element); - fragment.appendChild(markdownHoverElement); - isEmptyHoverContent = false; - }); - } - } - }); - if (markerMessages.length) { - markerMessages.forEach(msg => fragment.appendChild(this.renderMarkerHover(msg))); - const markerHoverForStatusbar = markerMessages.length === 1 ? markerMessages[0] : markerMessages.sort((a, b) => _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_20__["MarkerSeverity"].compare(a.marker.severity, b.marker.severity))[0]; - fragment.appendChild(this.renderMarkerStatusbar(markerHoverForStatusbar)); - } - // show - if (!containColorPicker && !isEmptyHoverContent) { - this.showAt(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_6__["Position"](renderRange.startLineNumber, renderColumn), highlightRange, this._shouldFocus); - this.updateContents(fragment); - } - this._isChangingDecorations = true; - this._highlightDecorations = this._editor.deltaDecorations(this._highlightDecorations, highlightRange ? [{ - range: highlightRange, - options: ModesContentHoverWidget._DECORATION_OPTIONS - }] : []); - this._isChangingDecorations = false; - } - renderMarkerHover(markerHover) { - const hoverElement = $('div.hover-row'); - const markerElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](hoverElement, $('div.marker.hover-contents')); - const { source, message, code, relatedInformation } = markerHover.marker; - this._editor.applyFontInfo(markerElement); - const messageElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](markerElement, $('span')); - messageElement.style.whiteSpace = 'pre-wrap'; - messageElement.innerText = message; - if (source || code) { - // Code has link - if (code && typeof code !== 'string') { - const sourceAndCodeElement = $('span'); - if (source) { - const sourceElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](sourceAndCodeElement, $('span')); - sourceElement.innerText = source; - } - this._codeLink = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](sourceAndCodeElement, $('a.code-link')); - this._codeLink.setAttribute('href', code.target.toString()); - this._codeLink.onclick = (e) => { - this._openerService.open(code.target); - e.preventDefault(); - e.stopPropagation(); - }; - const codeElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this._codeLink, $('span')); - codeElement.innerText = code.value; - const detailsElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](markerElement, sourceAndCodeElement); - detailsElement.style.opacity = '0.6'; - detailsElement.style.paddingLeft = '6px'; - } - else { - const detailsElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](markerElement, $('span')); - detailsElement.style.opacity = '0.6'; - detailsElement.style.paddingLeft = '6px'; - detailsElement.innerText = source && code ? `${source}(${code})` : source ? source : `(${code})`; - } - } - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_19__["isNonEmptyArray"])(relatedInformation)) { - for (const { message, resource, startLineNumber, startColumn } of relatedInformation) { - const relatedInfoContainer = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](markerElement, $('div')); - relatedInfoContainer.style.marginTop = '8px'; - const a = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](relatedInfoContainer, $('a')); - a.innerText = `${Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_21__["basename"])(resource)}(${startLineNumber}, ${startColumn}): `; - a.style.cursor = 'pointer'; - a.onclick = e => { - e.stopPropagation(); - e.preventDefault(); - if (this._openerService) { - this._openerService.open(resource.with({ fragment: `${startLineNumber},${startColumn}` }), { fromUserGesture: true }).catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_22__["onUnexpectedError"]); - } - }; - const messageElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](relatedInfoContainer, $('span')); - messageElement.innerText = message; - this._editor.applyFontInfo(messageElement); - } - } - return hoverElement; - } - renderMarkerStatusbar(markerHover) { - const hoverElement = $('div.hover-row.status-bar'); - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["DisposableStore"](); - const actionsElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](hoverElement, $('div.actions')); - if (markerHover.marker.severity === _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_20__["MarkerSeverity"].Error || markerHover.marker.severity === _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_20__["MarkerSeverity"].Warning || markerHover.marker.severity === _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_20__["MarkerSeverity"].Info) { - disposables.add(this._renderAction(actionsElement, { - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('peek problem', "Peek Problem"), - commandId: _gotoError_gotoError_js__WEBPACK_IMPORTED_MODULE_24__["NextMarkerAction"].ID, - run: () => { - this.hide(); - _gotoError_gotoError_js__WEBPACK_IMPORTED_MODULE_24__["MarkerController"].get(this._editor).showAtMarker(markerHover.marker); - this._editor.focus(); - } - })); - } - if (!this._editor.getOption(72 /* readOnly */)) { - const quickfixPlaceholderElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](actionsElement, $('div')); - quickfixPlaceholderElement.style.opacity = '0'; - quickfixPlaceholderElement.style.transition = 'opacity 0.2s'; - setTimeout(() => quickfixPlaceholderElement.style.opacity = '1', 200); - quickfixPlaceholderElement.textContent = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('checkingForQuickFixes', "Checking for quick fixes..."); - disposables.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["toDisposable"])(() => quickfixPlaceholderElement.remove())); - const codeActionsPromise = this.getCodeActions(markerHover.marker); - disposables.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["toDisposable"])(() => codeActionsPromise.cancel())); - codeActionsPromise.then(actions => { - quickfixPlaceholderElement.style.transition = ''; - quickfixPlaceholderElement.style.opacity = '1'; - if (!actions.validActions.length) { - actions.dispose(); - quickfixPlaceholderElement.textContent = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('noQuickFixes', "No quick fixes available"); - return; - } - quickfixPlaceholderElement.remove(); - let showing = false; - disposables.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["toDisposable"])(() => { - if (!showing) { - actions.dispose(); - } - })); - disposables.add(this._renderAction(actionsElement, { - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('quick fixes', "Quick Fix..."), - commandId: _codeAction_codeActionCommands_js__WEBPACK_IMPORTED_MODULE_27__["QuickFixAction"].Id, - run: (target) => { - showing = true; - const controller = _codeAction_codeActionCommands_js__WEBPACK_IMPORTED_MODULE_27__["QuickFixController"].get(this._editor); - const elementPosition = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["getDomNodePagePosition"](target); - // Hide the hover pre-emptively, otherwise the editor can close the code actions - // context menu as well when using keyboard navigation - this.hide(); - controller.showCodeActions(markerCodeActionTrigger, actions, { - x: elementPosition.left + 6, - y: elementPosition.top + elementPosition.height + 6 - }); - } - })); - }); - } - this.renderDisposable.value = disposables; - return hoverElement; - } - getCodeActions(marker) { - return Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_25__["createCancelablePromise"])(cancellationToken => { - return Object(_codeAction_codeAction_js__WEBPACK_IMPORTED_MODULE_26__["getCodeActions"])(this._editor.getModel(), new _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](marker.startLineNumber, marker.startColumn, marker.endLineNumber, marker.endColumn), markerCodeActionTrigger, _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_30__["Progress"].None, cancellationToken); - }); - } -} -ModesContentHoverWidget.ID = 'editor.contrib.modesContentHoverWidget'; -ModesContentHoverWidget._DECORATION_OPTIONS = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_8__["ModelDecorationOptions"].register({ - className: 'hoverHighlight' -}); -function hoverContentsEquals(first, second) { - if ((!first && second) || (first && !second) || first.length !== second.length) { - return false; - } - for (let i = 0; i < first.length; i++) { - const firstElement = first[i]; - const secondElement = second[i]; - if (firstElement instanceof MarkerHover && secondElement instanceof MarkerHover) { - return _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_20__["IMarkerData"].makeKey(firstElement.marker) === _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_20__["IMarkerData"].makeKey(secondElement.marker); - } - if (firstElement instanceof ColorHover || secondElement instanceof ColorHover) { - return false; - } - if (firstElement instanceof MarkerHover || secondElement instanceof MarkerHover) { - return false; - } - if (!Object(_base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_4__["markedStringsEquals"])(firstElement.contents, secondElement.contents)) { - return false; - } - } - return true; -} -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_18__["registerThemingParticipant"])((theme, collector) => { - const linkFg = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_29__["textLinkForeground"]); - if (linkFg) { - collector.addRule(`.monaco-hover .hover-contents a.code-link span:hover { color: ${linkFg}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/modesGlyphHover.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/hover/modesGlyphHover.js ***! - \***********************************************************************************/ -/*! exports provided: ModesGlyphHoverWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModesGlyphHoverWidget", function() { return ModesGlyphHoverWidget; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/htmlContent.js */ "./node_modules/monaco-editor/esm/vs/base/common/htmlContent.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _hoverOperation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hoverOperation.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/hoverOperation.js"); -/* harmony import */ var _hoverWidgets_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hoverWidgets.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/hoverWidgets.js"); -/* harmony import */ var _markdown_markdownRenderer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../markdown/markdownRenderer.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/markdown/markdownRenderer.js"); -/* harmony import */ var _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/opener/common/opener.js */ "./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - -class MarginComputer { - constructor(editor) { - this._editor = editor; - this._lineNumber = -1; - this._result = []; - } - setLineNumber(lineNumber) { - this._lineNumber = lineNumber; - this._result = []; - } - clearResult() { - this._result = []; - } - computeSync() { - const toHoverMessage = (contents) => { - return { - value: contents - }; - }; - const lineDecorations = this._editor.getLineDecorations(this._lineNumber); - const result = []; - if (!lineDecorations) { - return result; - } - for (const d of lineDecorations) { - if (!d.options.glyphMarginClassName) { - continue; - } - const hoverMessage = d.options.glyphMarginHoverMessage; - if (!hoverMessage || Object(_base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_1__["isEmptyMarkdownString"])(hoverMessage)) { - continue; - } - result.push(...Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_7__["asArray"])(hoverMessage).map(toHoverMessage)); - } - return result; - } - onResult(result, isFromSynchronousComputation) { - this._result = this._result.concat(result); - } - getResult() { - return this._result; - } - getResultWithLoadingMessage() { - return this.getResult(); - } -} -class ModesGlyphHoverWidget extends _hoverWidgets_js__WEBPACK_IMPORTED_MODULE_4__["GlyphHoverWidget"] { - constructor(editor, modeService, openerService = _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_6__["NullOpenerService"]) { - super(ModesGlyphHoverWidget.ID, editor); - this._renderDisposeables = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["DisposableStore"]()); - this._messages = []; - this._lastLineNumber = -1; - this._markdownRenderer = this._register(new _markdown_markdownRenderer_js__WEBPACK_IMPORTED_MODULE_5__["MarkdownRenderer"](this._editor, modeService, openerService)); - this._computer = new MarginComputer(this._editor); - this._hoverOperation = new _hoverOperation_js__WEBPACK_IMPORTED_MODULE_3__["HoverOperation"](this._computer, (result) => this._withResult(result), undefined, (result) => this._withResult(result), 300); - } - dispose() { - this._hoverOperation.cancel(); - super.dispose(); - } - onModelDecorationsChanged() { - if (this.isVisible) { - // The decorations have changed and the hover is visible, - // we need to recompute the displayed text - this._hoverOperation.cancel(); - this._computer.clearResult(); - this._hoverOperation.start(0 /* Delayed */); - } - } - startShowingAt(lineNumber) { - if (this._lastLineNumber === lineNumber) { - // We have to show the widget at the exact same line number as before, so no work is needed - return; - } - this._hoverOperation.cancel(); - this.hide(); - this._lastLineNumber = lineNumber; - this._computer.setLineNumber(lineNumber); - this._hoverOperation.start(0 /* Delayed */); - } - hide() { - this._lastLineNumber = -1; - this._hoverOperation.cancel(); - super.hide(); - } - _withResult(result) { - this._messages = result; - if (this._messages.length > 0) { - this._renderMessages(this._lastLineNumber, this._messages); - } - else { - this.hide(); - } - } - _renderMessages(lineNumber, messages) { - this._renderDisposeables.clear(); - const fragment = document.createDocumentFragment(); - for (const msg of messages) { - const renderedContents = this._markdownRenderer.render(msg.value); - this._renderDisposeables.add(renderedContents); - fragment.appendChild(Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["$"])('div.hover-row', undefined, renderedContents.element)); - } - this.updateContents(fragment); - this.showAt(lineNumber); - } -} -ModesGlyphHoverWidget.ID = 'editor.contrib.modesGlyphHoverWidget'; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/inPlaceReplace/inPlaceReplace.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/inPlaceReplace/inPlaceReplace.js ***! - \*******************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/services/editorWorkerService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerService.js"); -/* harmony import */ var _inPlaceReplaceCommand_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./inPlaceReplaceCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/inPlaceReplace/inPlaceReplaceCommand.js"); -/* harmony import */ var _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../browser/core/editorState.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/core/editorState.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - -let InPlaceReplaceController = class InPlaceReplaceController { - constructor(editor, editorWorkerService) { - this.decorationIds = []; - this.editor = editor; - this.editorWorkerService = editorWorkerService; - } - static get(editor) { - return editor.getContribution(InPlaceReplaceController.ID); - } - dispose() { - } - run(source, up) { - // cancel any pending request - if (this.currentRequest) { - this.currentRequest.cancel(); - } - const editorSelection = this.editor.getSelection(); - const model = this.editor.getModel(); - if (!model || !editorSelection) { - return undefined; - } - let selection = editorSelection; - if (selection.startLineNumber !== selection.endLineNumber) { - // Can't accept multiline selection - return undefined; - } - const state = new _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_7__["EditorState"](this.editor, 1 /* Value */ | 4 /* Position */); - const modelURI = model.uri; - if (!this.editorWorkerService.canNavigateValueSet(modelURI)) { - return Promise.resolve(undefined); - } - this.currentRequest = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_11__["createCancelablePromise"])(token => this.editorWorkerService.navigateValueSet(modelURI, selection, up)); - return this.currentRequest.then(result => { - if (!result || !result.range || !result.value) { - // No proper result - return; - } - if (!state.validate(this.editor)) { - // state has changed - return; - } - // Selection - let editRange = _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].lift(result.range); - let highlightRange = result.range; - let diff = result.value.length - (selection.endColumn - selection.startColumn); - // highlight - highlightRange = { - startLineNumber: highlightRange.startLineNumber, - startColumn: highlightRange.startColumn, - endLineNumber: highlightRange.endLineNumber, - endColumn: highlightRange.startColumn + result.value.length - }; - if (diff > 1) { - selection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_2__["Selection"](selection.startLineNumber, selection.startColumn, selection.endLineNumber, selection.endColumn + diff - 1); - } - // Insert new text - const command = new _inPlaceReplaceCommand_js__WEBPACK_IMPORTED_MODULE_6__["InPlaceReplaceCommand"](editRange, selection, result.value); - this.editor.pushUndoStop(); - this.editor.executeCommand(source, command); - this.editor.pushUndoStop(); - // add decoration - this.decorationIds = this.editor.deltaDecorations(this.decorationIds, [{ - range: highlightRange, - options: InPlaceReplaceController.DECORATION - }]); - // remove decoration after delay - if (this.decorationRemover) { - this.decorationRemover.cancel(); - } - this.decorationRemover = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_11__["timeout"])(350); - this.decorationRemover.then(() => this.decorationIds = this.editor.deltaDecorations(this.decorationIds, [])).catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_12__["onUnexpectedError"]); - }).catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_12__["onUnexpectedError"]); - } -}; -InPlaceReplaceController.ID = 'editor.contrib.inPlaceReplaceController'; -InPlaceReplaceController.DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__["ModelDecorationOptions"].register({ - className: 'valueSetReplacement' -}); -InPlaceReplaceController = __decorate([ - __param(1, _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_5__["IEditorWorkerService"]) -], InPlaceReplaceController); -class InPlaceReplaceUp extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.inPlaceReplace.up', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('InPlaceReplaceAction.previous.label', "Replace with Previous Value"), - alias: 'Replace with Previous Value', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 82 /* US_COMMA */, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - const controller = InPlaceReplaceController.get(editor); - if (!controller) { - return Promise.resolve(undefined); - } - return controller.run(this.id, true); - } -} -class InPlaceReplaceDown extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.inPlaceReplace.down', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('InPlaceReplaceAction.next.label', "Replace with Next Value"), - alias: 'Replace with Next Value', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 84 /* US_DOT */, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - const controller = InPlaceReplaceController.get(editor); - if (!controller) { - return Promise.resolve(undefined); - } - return controller.run(this.id, false); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorContribution"])(InPlaceReplaceController.ID, InPlaceReplaceController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(InPlaceReplaceUp); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(InPlaceReplaceDown); -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_8__["registerThemingParticipant"])((theme, collector) => { - const border = theme.getColor(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_9__["editorBracketMatchBorder"]); - if (border) { - collector.addRule(`.monaco-editor.vs .valueSetReplacement { outline: solid 2px ${border}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/inPlaceReplace/inPlaceReplaceCommand.js": -/*!**************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/inPlaceReplace/inPlaceReplaceCommand.js ***! - \**************************************************************************************************/ -/*! exports provided: InPlaceReplaceCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InPlaceReplaceCommand", function() { return InPlaceReplaceCommand; }); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class InPlaceReplaceCommand { - constructor(editRange, originalSelection, text) { - this._editRange = editRange; - this._originalSelection = originalSelection; - this._text = text; - } - getEditOperations(model, builder) { - builder.addTrackedEditOperation(this._editRange, this._text); - } - computeCursorState(model, helper) { - const inverseEditOperations = helper.getInverseEditOperations(); - const srcRange = inverseEditOperations[0].range; - if (!this._originalSelection.isEmpty()) { - // Preserve selection and extends to typed text - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_0__["Selection"](srcRange.endLineNumber, srcRange.endColumn - this._text.length, srcRange.endLineNumber, srcRange.endColumn); - } - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_0__["Selection"](srcRange.endLineNumber, Math.min(this._originalSelection.positionColumn, srcRange.endColumn), srcRange.endLineNumber, Math.min(this._originalSelection.positionColumn, srcRange.endColumn)); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/indentation/indentUtils.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/indentation/indentUtils.js ***! - \*************************************************************************************/ -/*! exports provided: getSpaceCnt, generateIndent */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSpaceCnt", function() { return getSpaceCnt; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generateIndent", function() { return generateIndent; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function getSpaceCnt(str, tabSize) { - let spacesCnt = 0; - for (let i = 0; i < str.length; i++) { - if (str.charAt(i) === '\t') { - spacesCnt += tabSize; - } - else { - spacesCnt++; - } - } - return spacesCnt; -} -function generateIndent(spacesCnt, tabSize, insertSpaces) { - spacesCnt = spacesCnt < 0 ? 0 : spacesCnt; - let result = ''; - if (!insertSpaces) { - let tabsCnt = Math.floor(spacesCnt / tabSize); - spacesCnt = spacesCnt % tabSize; - for (let i = 0; i < tabsCnt; i++) { - result += '\t'; - } - } - for (let i = 0; i < spacesCnt; i++) { - result += ' '; - } - return result; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/indentation/indentation.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/indentation/indentation.js ***! - \*************************************************************************************/ -/*! exports provided: getReindentEditOperations, IndentationToSpacesAction, IndentationToTabsAction, ChangeIndentationSizeAction, IndentUsingTabs, IndentUsingSpaces, DetectIndentation, ReindentLinesAction, ReindentSelectedLinesAction, AutoIndentOnPasteCommand, AutoIndentOnPaste, IndentationToSpacesCommand, IndentationToTabsCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getReindentEditOperations", function() { return getReindentEditOperations; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentationToSpacesAction", function() { return IndentationToSpacesAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentationToTabsAction", function() { return IndentationToTabsAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangeIndentationSizeAction", function() { return ChangeIndentationSizeAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentUsingTabs", function() { return IndentUsingTabs; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentUsingSpaces", function() { return IndentUsingSpaces; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DetectIndentation", function() { return DetectIndentation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReindentLinesAction", function() { return ReindentLinesAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReindentSelectedLinesAction", function() { return ReindentSelectedLinesAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutoIndentOnPasteCommand", function() { return AutoIndentOnPasteCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutoIndentOnPaste", function() { return AutoIndentOnPaste; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentationToSpacesCommand", function() { return IndentationToSpacesCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentationToTabsCommand", function() { return IndentationToTabsCommand; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/commands/shiftCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/common/commands/shiftCommand.js"); -/* harmony import */ var _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/editOperation.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../common/services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _indentUtils_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./indentUtils.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/indentation/indentUtils.js"); -/* harmony import */ var _platform_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/quickinput/common/quickInput.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickInput.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - -function getReindentEditOperations(model, startLineNumber, endLineNumber, inheritedIndent) { - if (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) { - // Model is empty - return []; - } - let indentationRules = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__["LanguageConfigurationRegistry"].getIndentationRules(model.getLanguageIdentifier().id); - if (!indentationRules) { - return []; - } - endLineNumber = Math.min(endLineNumber, model.getLineCount()); - // Skip `unIndentedLinePattern` lines - while (startLineNumber <= endLineNumber) { - if (!indentationRules.unIndentedLinePattern) { - break; - } - let text = model.getLineContent(startLineNumber); - if (!indentationRules.unIndentedLinePattern.test(text)) { - break; - } - startLineNumber++; - } - if (startLineNumber > endLineNumber - 1) { - return []; - } - const { tabSize, indentSize, insertSpaces } = model.getOptions(); - const shiftIndent = (indentation, count) => { - count = count || 1; - return _common_commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_4__["ShiftCommand"].shiftIndent(indentation, indentation.length + count, tabSize, indentSize, insertSpaces); - }; - const unshiftIndent = (indentation, count) => { - count = count || 1; - return _common_commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_4__["ShiftCommand"].unshiftIndent(indentation, indentation.length + count, tabSize, indentSize, insertSpaces); - }; - let indentEdits = []; - // indentation being passed to lines below - let globalIndent; - // Calculate indentation for the first line - // If there is no passed-in indentation, we use the indentation of the first line as base. - let currentLineText = model.getLineContent(startLineNumber); - let adjustedLineContent = currentLineText; - if (inheritedIndent !== undefined && inheritedIndent !== null) { - globalIndent = inheritedIndent; - let oldIndentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](currentLineText); - adjustedLineContent = globalIndent + currentLineText.substring(oldIndentation.length); - if (indentationRules.decreaseIndentPattern && indentationRules.decreaseIndentPattern.test(adjustedLineContent)) { - globalIndent = unshiftIndent(globalIndent); - adjustedLineContent = globalIndent + currentLineText.substring(oldIndentation.length); - } - if (currentLineText !== adjustedLineContent) { - indentEdits.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_5__["EditOperation"].replace(new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](startLineNumber, 1, startLineNumber, oldIndentation.length + 1), _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_9__["TextModel"].normalizeIndentation(globalIndent, indentSize, insertSpaces))); - } - } - else { - globalIndent = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](currentLineText); - } - // idealIndentForNextLine doesn't equal globalIndent when there is a line matching `indentNextLinePattern`. - let idealIndentForNextLine = globalIndent; - if (indentationRules.increaseIndentPattern && indentationRules.increaseIndentPattern.test(adjustedLineContent)) { - idealIndentForNextLine = shiftIndent(idealIndentForNextLine); - globalIndent = shiftIndent(globalIndent); - } - else if (indentationRules.indentNextLinePattern && indentationRules.indentNextLinePattern.test(adjustedLineContent)) { - idealIndentForNextLine = shiftIndent(idealIndentForNextLine); - } - startLineNumber++; - // Calculate indentation adjustment for all following lines - for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { - let text = model.getLineContent(lineNumber); - let oldIndentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](text); - let adjustedLineContent = idealIndentForNextLine + text.substring(oldIndentation.length); - if (indentationRules.decreaseIndentPattern && indentationRules.decreaseIndentPattern.test(adjustedLineContent)) { - idealIndentForNextLine = unshiftIndent(idealIndentForNextLine); - globalIndent = unshiftIndent(globalIndent); - } - if (oldIndentation !== idealIndentForNextLine) { - indentEdits.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_5__["EditOperation"].replace(new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](lineNumber, 1, lineNumber, oldIndentation.length + 1), _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_9__["TextModel"].normalizeIndentation(idealIndentForNextLine, indentSize, insertSpaces))); - } - // calculate idealIndentForNextLine - if (indentationRules.unIndentedLinePattern && indentationRules.unIndentedLinePattern.test(text)) { - // In reindent phase, if the line matches `unIndentedLinePattern` we inherit indentation from above lines - // but don't change globalIndent and idealIndentForNextLine. - continue; - } - else if (indentationRules.increaseIndentPattern && indentationRules.increaseIndentPattern.test(adjustedLineContent)) { - globalIndent = shiftIndent(globalIndent); - idealIndentForNextLine = globalIndent; - } - else if (indentationRules.indentNextLinePattern && indentationRules.indentNextLinePattern.test(adjustedLineContent)) { - idealIndentForNextLine = shiftIndent(idealIndentForNextLine); - } - else { - idealIndentForNextLine = globalIndent; - } - } - return indentEdits; -} -class IndentationToSpacesAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: IndentationToSpacesAction.ID, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('indentationToSpaces', "Convert Indentation to Spaces"), - alias: 'Convert Indentation to Spaces', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable - }); - } - run(accessor, editor) { - let model = editor.getModel(); - if (!model) { - return; - } - let modelOpts = model.getOptions(); - let selection = editor.getSelection(); - if (!selection) { - return; - } - const command = new IndentationToSpacesCommand(selection, modelOpts.tabSize); - editor.pushUndoStop(); - editor.executeCommands(this.id, [command]); - editor.pushUndoStop(); - model.updateOptions({ - insertSpaces: true - }); - } -} -IndentationToSpacesAction.ID = 'editor.action.indentationToSpaces'; -class IndentationToTabsAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: IndentationToTabsAction.ID, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('indentationToTabs', "Convert Indentation to Tabs"), - alias: 'Convert Indentation to Tabs', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable - }); - } - run(accessor, editor) { - let model = editor.getModel(); - if (!model) { - return; - } - let modelOpts = model.getOptions(); - let selection = editor.getSelection(); - if (!selection) { - return; - } - const command = new IndentationToTabsCommand(selection, modelOpts.tabSize); - editor.pushUndoStop(); - editor.executeCommands(this.id, [command]); - editor.pushUndoStop(); - model.updateOptions({ - insertSpaces: false - }); - } -} -IndentationToTabsAction.ID = 'editor.action.indentationToTabs'; -class ChangeIndentationSizeAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor(insertSpaces, opts) { - super(opts); - this.insertSpaces = insertSpaces; - } - run(accessor, editor) { - const quickInputService = accessor.get(_platform_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_13__["IQuickInputService"]); - const modelService = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_11__["IModelService"]); - let model = editor.getModel(); - if (!model) { - return; - } - let creationOpts = modelService.getCreationOptions(model.getLanguageIdentifier().language, model.uri, model.isForSimpleWidget); - const picks = [1, 2, 3, 4, 5, 6, 7, 8].map(n => ({ - id: n.toString(), - label: n.toString(), - // add description for tabSize value set in the configuration - description: n === creationOpts.tabSize ? _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('configuredTabSize', "Configured Tab Size") : undefined - })); - // auto focus the tabSize set for the current editor - const autoFocusIndex = Math.min(model.getOptions().tabSize - 1, 7); - setTimeout(() => { - quickInputService.pick(picks, { placeHolder: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'selectTabWidth', comment: ['Tab corresponds to the tab key'] }, "Select Tab Size for Current File"), activeItem: picks[autoFocusIndex] }).then(pick => { - if (pick) { - if (model && !model.isDisposed()) { - model.updateOptions({ - tabSize: parseInt(pick.label, 10), - insertSpaces: this.insertSpaces - }); - } - } - }); - }, 50 /* quick input is sensitive to being opened so soon after another */); - } -} -class IndentUsingTabs extends ChangeIndentationSizeAction { - constructor() { - super(false, { - id: IndentUsingTabs.ID, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('indentUsingTabs', "Indent Using Tabs"), - alias: 'Indent Using Tabs', - precondition: undefined - }); - } -} -IndentUsingTabs.ID = 'editor.action.indentUsingTabs'; -class IndentUsingSpaces extends ChangeIndentationSizeAction { - constructor() { - super(true, { - id: IndentUsingSpaces.ID, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('indentUsingSpaces', "Indent Using Spaces"), - alias: 'Indent Using Spaces', - precondition: undefined - }); - } -} -IndentUsingSpaces.ID = 'editor.action.indentUsingSpaces'; -class DetectIndentation extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: DetectIndentation.ID, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('detectIndentation', "Detect Indentation from Content"), - alias: 'Detect Indentation from Content', - precondition: undefined - }); - } - run(accessor, editor) { - const modelService = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_11__["IModelService"]); - let model = editor.getModel(); - if (!model) { - return; - } - let creationOpts = modelService.getCreationOptions(model.getLanguageIdentifier().language, model.uri, model.isForSimpleWidget); - model.detectIndentation(creationOpts.insertSpaces, creationOpts.tabSize); - } -} -DetectIndentation.ID = 'editor.action.detectIndentation'; -class ReindentLinesAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.reindentlines', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.reindentlines', "Reindent Lines"), - alias: 'Reindent Lines', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable - }); - } - run(accessor, editor) { - let model = editor.getModel(); - if (!model) { - return; - } - let edits = getReindentEditOperations(model, 1, model.getLineCount()); - if (edits.length > 0) { - editor.pushUndoStop(); - editor.executeEdits(this.id, edits); - editor.pushUndoStop(); - } - } -} -class ReindentSelectedLinesAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.reindentselectedlines', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.reindentselectedlines', "Reindent Selected Lines"), - alias: 'Reindent Selected Lines', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable - }); - } - run(accessor, editor) { - let model = editor.getModel(); - if (!model) { - return; - } - let selections = editor.getSelections(); - if (selections === null) { - return; - } - let edits = []; - for (let selection of selections) { - let startLineNumber = selection.startLineNumber; - let endLineNumber = selection.endLineNumber; - if (startLineNumber !== endLineNumber && selection.endColumn === 1) { - endLineNumber--; - } - if (startLineNumber === 1) { - if (startLineNumber === endLineNumber) { - continue; - } - } - else { - startLineNumber--; - } - let editOperations = getReindentEditOperations(model, startLineNumber, endLineNumber); - edits.push(...editOperations); - } - if (edits.length > 0) { - editor.pushUndoStop(); - editor.executeEdits(this.id, edits); - editor.pushUndoStop(); - } - } -} -class AutoIndentOnPasteCommand { - constructor(edits, initialSelection) { - this._initialSelection = initialSelection; - this._edits = []; - this._selectionId = null; - for (let edit of edits) { - if (edit.range && typeof edit.text === 'string') { - this._edits.push(edit); - } - } - } - getEditOperations(model, builder) { - for (let edit of this._edits) { - builder.addEditOperation(_common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].lift(edit.range), edit.text); - } - let selectionIsSet = false; - if (Array.isArray(this._edits) && this._edits.length === 1 && this._initialSelection.isEmpty()) { - if (this._edits[0].range.startColumn === this._initialSelection.endColumn && - this._edits[0].range.startLineNumber === this._initialSelection.endLineNumber) { - selectionIsSet = true; - this._selectionId = builder.trackSelection(this._initialSelection, true); - } - else if (this._edits[0].range.endColumn === this._initialSelection.startColumn && - this._edits[0].range.endLineNumber === this._initialSelection.startLineNumber) { - selectionIsSet = true; - this._selectionId = builder.trackSelection(this._initialSelection, false); - } - } - if (!selectionIsSet) { - this._selectionId = builder.trackSelection(this._initialSelection); - } - } - computeCursorState(model, helper) { - return helper.getTrackedSelection(this._selectionId); - } -} -class AutoIndentOnPaste { - constructor(editor) { - this.callOnDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this.callOnModel = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this.editor = editor; - this.callOnDispose.add(editor.onDidChangeConfiguration(() => this.update())); - this.callOnDispose.add(editor.onDidChangeModel(() => this.update())); - this.callOnDispose.add(editor.onDidChangeModelLanguage(() => this.update())); - } - update() { - // clean up - this.callOnModel.clear(); - // we are disabled - if (this.editor.getOption(8 /* autoIndent */) < 4 /* Full */ || this.editor.getOption(40 /* formatOnPaste */)) { - return; - } - // no model - if (!this.editor.hasModel()) { - return; - } - this.callOnModel.add(this.editor.onDidPaste(({ range }) => { - this.trigger(range); - })); - } - trigger(range) { - let selections = this.editor.getSelections(); - if (selections === null || selections.length > 1) { - return; - } - const model = this.editor.getModel(); - if (!model) { - return; - } - if (!model.isCheapToTokenize(range.getStartPosition().lineNumber)) { - return; - } - const autoIndent = this.editor.getOption(8 /* autoIndent */); - const { tabSize, indentSize, insertSpaces } = model.getOptions(); - this.editor.pushUndoStop(); - let textEdits = []; - let indentConverter = { - shiftIndent: (indentation) => { - return _common_commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_4__["ShiftCommand"].shiftIndent(indentation, indentation.length + 1, tabSize, indentSize, insertSpaces); - }, - unshiftIndent: (indentation) => { - return _common_commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_4__["ShiftCommand"].unshiftIndent(indentation, indentation.length + 1, tabSize, indentSize, insertSpaces); - } - }; - let startLineNumber = range.startLineNumber; - while (startLineNumber <= range.endLineNumber) { - if (this.shouldIgnoreLine(model, startLineNumber)) { - startLineNumber++; - continue; - } - break; - } - if (startLineNumber > range.endLineNumber) { - return; - } - let firstLineText = model.getLineContent(startLineNumber); - if (!/\S/.test(firstLineText.substring(0, range.startColumn - 1))) { - let indentOfFirstLine = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__["LanguageConfigurationRegistry"].getGoodIndentForLine(autoIndent, model, model.getLanguageIdentifier().id, startLineNumber, indentConverter); - if (indentOfFirstLine !== null) { - let oldIndentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](firstLineText); - let newSpaceCnt = _indentUtils_js__WEBPACK_IMPORTED_MODULE_12__["getSpaceCnt"](indentOfFirstLine, tabSize); - let oldSpaceCnt = _indentUtils_js__WEBPACK_IMPORTED_MODULE_12__["getSpaceCnt"](oldIndentation, tabSize); - if (newSpaceCnt !== oldSpaceCnt) { - let newIndent = _indentUtils_js__WEBPACK_IMPORTED_MODULE_12__["generateIndent"](newSpaceCnt, tabSize, insertSpaces); - textEdits.push({ - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](startLineNumber, 1, startLineNumber, oldIndentation.length + 1), - text: newIndent - }); - firstLineText = newIndent + firstLineText.substr(oldIndentation.length); - } - else { - let indentMetadata = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__["LanguageConfigurationRegistry"].getIndentMetadata(model, startLineNumber); - if (indentMetadata === 0 || indentMetadata === 8 /* UNINDENT_MASK */) { - // we paste content into a line where only contains whitespaces - // after pasting, the indentation of the first line is already correct - // the first line doesn't match any indentation rule - // then no-op. - return; - } - } - } - } - const firstLineNumber = startLineNumber; - // ignore empty or ignored lines - while (startLineNumber < range.endLineNumber) { - if (!/\S/.test(model.getLineContent(startLineNumber + 1))) { - startLineNumber++; - continue; - } - break; - } - if (startLineNumber !== range.endLineNumber) { - let virtualModel = { - getLineTokens: (lineNumber) => { - return model.getLineTokens(lineNumber); - }, - getLanguageIdentifier: () => { - return model.getLanguageIdentifier(); - }, - getLanguageIdAtPosition: (lineNumber, column) => { - return model.getLanguageIdAtPosition(lineNumber, column); - }, - getLineContent: (lineNumber) => { - if (lineNumber === firstLineNumber) { - return firstLineText; - } - else { - return model.getLineContent(lineNumber); - } - } - }; - let indentOfSecondLine = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_10__["LanguageConfigurationRegistry"].getGoodIndentForLine(autoIndent, virtualModel, model.getLanguageIdentifier().id, startLineNumber + 1, indentConverter); - if (indentOfSecondLine !== null) { - let newSpaceCntOfSecondLine = _indentUtils_js__WEBPACK_IMPORTED_MODULE_12__["getSpaceCnt"](indentOfSecondLine, tabSize); - let oldSpaceCntOfSecondLine = _indentUtils_js__WEBPACK_IMPORTED_MODULE_12__["getSpaceCnt"](_base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](model.getLineContent(startLineNumber + 1)), tabSize); - if (newSpaceCntOfSecondLine !== oldSpaceCntOfSecondLine) { - let spaceCntOffset = newSpaceCntOfSecondLine - oldSpaceCntOfSecondLine; - for (let i = startLineNumber + 1; i <= range.endLineNumber; i++) { - let lineContent = model.getLineContent(i); - let originalIndent = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"](lineContent); - let originalSpacesCnt = _indentUtils_js__WEBPACK_IMPORTED_MODULE_12__["getSpaceCnt"](originalIndent, tabSize); - let newSpacesCnt = originalSpacesCnt + spaceCntOffset; - let newIndent = _indentUtils_js__WEBPACK_IMPORTED_MODULE_12__["generateIndent"](newSpacesCnt, tabSize, insertSpaces); - if (newIndent !== originalIndent) { - textEdits.push({ - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](i, 1, i, originalIndent.length + 1), - text: newIndent - }); - } - } - } - } - } - let cmd = new AutoIndentOnPasteCommand(textEdits, this.editor.getSelection()); - this.editor.executeCommand('autoIndentOnPaste', cmd); - this.editor.pushUndoStop(); - } - shouldIgnoreLine(model, lineNumber) { - model.forceTokenization(lineNumber); - let nonWhitespaceColumn = model.getLineFirstNonWhitespaceColumn(lineNumber); - if (nonWhitespaceColumn === 0) { - return true; - } - let tokens = model.getLineTokens(lineNumber); - if (tokens.getCount() > 0) { - let firstNonWhitespaceTokenIndex = tokens.findTokenIndexAtOffset(nonWhitespaceColumn); - if (firstNonWhitespaceTokenIndex >= 0 && tokens.getStandardTokenType(firstNonWhitespaceTokenIndex) === 1 /* Comment */) { - return true; - } - } - return false; - } - dispose() { - this.callOnDispose.dispose(); - this.callOnModel.dispose(); - } -} -AutoIndentOnPaste.ID = 'editor.contrib.autoIndentOnPaste'; -function getIndentationEditOperations(model, builder, tabSize, tabsToSpaces) { - if (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) { - // Model is empty - return; - } - let spaces = ''; - for (let i = 0; i < tabSize; i++) { - spaces += ' '; - } - let spacesRegExp = new RegExp(spaces, 'gi'); - for (let lineNumber = 1, lineCount = model.getLineCount(); lineNumber <= lineCount; lineNumber++) { - let lastIndentationColumn = model.getLineFirstNonWhitespaceColumn(lineNumber); - if (lastIndentationColumn === 0) { - lastIndentationColumn = model.getLineMaxColumn(lineNumber); - } - if (lastIndentationColumn === 1) { - continue; - } - const originalIndentationRange = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](lineNumber, 1, lineNumber, lastIndentationColumn); - const originalIndentation = model.getValueInRange(originalIndentationRange); - const newIndentation = (tabsToSpaces - ? originalIndentation.replace(/\t/ig, spaces) - : originalIndentation.replace(spacesRegExp, '\t')); - builder.addEditOperation(originalIndentationRange, newIndentation); - } -} -class IndentationToSpacesCommand { - constructor(selection, tabSize) { - this.selection = selection; - this.tabSize = tabSize; - this.selectionId = null; - } - getEditOperations(model, builder) { - this.selectionId = builder.trackSelection(this.selection); - getIndentationEditOperations(model, builder, this.tabSize, true); - } - computeCursorState(model, helper) { - return helper.getTrackedSelection(this.selectionId); - } -} -class IndentationToTabsCommand { - constructor(selection, tabSize) { - this.selection = selection; - this.tabSize = tabSize; - this.selectionId = null; - } - getEditOperations(model, builder) { - this.selectionId = builder.trackSelection(this.selection); - getIndentationEditOperations(model, builder, this.tabSize, false); - } - computeCursorState(model, helper) { - return helper.getTrackedSelection(this.selectionId); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorContribution"])(AutoIndentOnPaste.ID, AutoIndentOnPaste); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(IndentationToSpacesAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(IndentationToTabsAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(IndentUsingTabs); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(IndentUsingSpaces); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(DetectIndentation); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(ReindentLinesAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(ReindentSelectedLinesAction); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/copyLinesCommand.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/copyLinesCommand.js ***! - \**********************************************************************************************/ -/*! exports provided: CopyLinesCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CopyLinesCommand", function() { return CopyLinesCommand; }); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class CopyLinesCommand { - constructor(selection, isCopyingDown) { - this._selection = selection; - this._isCopyingDown = isCopyingDown; - this._selectionDirection = 0 /* LTR */; - this._selectionId = null; - this._startLineNumberDelta = 0; - this._endLineNumberDelta = 0; - } - getEditOperations(model, builder) { - let s = this._selection; - this._startLineNumberDelta = 0; - this._endLineNumberDelta = 0; - if (s.startLineNumber < s.endLineNumber && s.endColumn === 1) { - this._endLineNumberDelta = 1; - s = s.setEndPosition(s.endLineNumber - 1, model.getLineMaxColumn(s.endLineNumber - 1)); - } - let sourceLines = []; - for (let i = s.startLineNumber; i <= s.endLineNumber; i++) { - sourceLines.push(model.getLineContent(i)); - } - const sourceText = sourceLines.join('\n'); - if (sourceText === '') { - // Duplicating empty line - if (this._isCopyingDown) { - this._startLineNumberDelta++; - this._endLineNumberDelta++; - } - } - if (!this._isCopyingDown) { - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](s.endLineNumber, model.getLineMaxColumn(s.endLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), '\n' + sourceText); - } - else { - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](s.startLineNumber, 1, s.startLineNumber, 1), sourceText + '\n'); - } - this._selectionId = builder.trackSelection(s); - this._selectionDirection = this._selection.getDirection(); - } - computeCursorState(model, helper) { - let result = helper.getTrackedSelection(this._selectionId); - if (this._startLineNumberDelta !== 0 || this._endLineNumberDelta !== 0) { - let startLineNumber = result.startLineNumber; - let startColumn = result.startColumn; - let endLineNumber = result.endLineNumber; - let endColumn = result.endColumn; - if (this._startLineNumberDelta !== 0) { - startLineNumber = startLineNumber + this._startLineNumberDelta; - startColumn = 1; - } - if (this._endLineNumberDelta !== 0) { - endLineNumber = endLineNumber + this._endLineNumberDelta; - endColumn = 1; - } - result = _common_core_selection_js__WEBPACK_IMPORTED_MODULE_1__["Selection"].createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, this._selectionDirection); - } - return result; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/linesOperations.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/linesOperations.js ***! - \*********************************************************************************************/ -/*! exports provided: DuplicateSelectionAction, AbstractSortLinesAction, SortLinesAscendingAction, SortLinesDescendingAction, TrimTrailingWhitespaceAction, DeleteLinesAction, IndentLinesAction, InsertLineBeforeAction, InsertLineAfterAction, AbstractDeleteAllToBoundaryAction, DeleteAllLeftAction, DeleteAllRightAction, JoinLinesAction, TransposeAction, AbstractCaseAction, UpperCaseAction, LowerCaseAction, TitleCaseAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DuplicateSelectionAction", function() { return DuplicateSelectionAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractSortLinesAction", function() { return AbstractSortLinesAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SortLinesAscendingAction", function() { return SortLinesAscendingAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SortLinesDescendingAction", function() { return SortLinesDescendingAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrimTrailingWhitespaceAction", function() { return TrimTrailingWhitespaceAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteLinesAction", function() { return DeleteLinesAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentLinesAction", function() { return IndentLinesAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertLineBeforeAction", function() { return InsertLineBeforeAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertLineAfterAction", function() { return InsertLineAfterAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractDeleteAllToBoundaryAction", function() { return AbstractDeleteAllToBoundaryAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteAllLeftAction", function() { return DeleteAllLeftAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteAllRightAction", function() { return DeleteAllRightAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JoinLinesAction", function() { return JoinLinesAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TransposeAction", function() { return TransposeAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractCaseAction", function() { return AbstractCaseAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UpperCaseAction", function() { return UpperCaseAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LowerCaseAction", function() { return LowerCaseAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TitleCaseAction", function() { return TitleCaseAction; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _browser_controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/controller/coreCommands.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/coreCommands.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/commands/replaceCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/common/commands/replaceCommand.js"); -/* harmony import */ var _common_commands_trimTrailingWhitespaceCommand_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/commands/trimTrailingWhitespaceCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/common/commands/trimTrailingWhitespaceCommand.js"); -/* harmony import */ var _common_controller_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/controller/cursorTypeOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorTypeOperations.js"); -/* harmony import */ var _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/editOperation.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _copyLinesCommand_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./copyLinesCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/copyLinesCommand.js"); -/* harmony import */ var _moveLinesCommand_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./moveLinesCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/moveLinesCommand.js"); -/* harmony import */ var _sortLinesCommand_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sortLinesCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/sortLinesCommand.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - -// copy lines -class AbstractCopyLinesAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor(down, opts) { - super(opts); - this.down = down; - } - run(_accessor, editor) { - if (!editor.hasModel()) { - return; - } - const selections = editor.getSelections().map((selection, index) => ({ selection, index, ignore: false })); - selections.sort((a, b) => _common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"].compareRangesUsingStarts(a.selection, b.selection)); - // Remove selections that would result in copying the same line - let prev = selections[0]; - for (let i = 1; i < selections.length; i++) { - const curr = selections[i]; - if (prev.selection.endLineNumber === curr.selection.startLineNumber) { - // these two selections would copy the same line - if (prev.index < curr.index) { - // prev wins - curr.ignore = true; - } - else { - // curr wins - prev.ignore = true; - prev = curr; - } - } - } - const commands = []; - for (const selection of selections) { - if (selection.ignore) { - continue; - } - commands.push(new _copyLinesCommand_js__WEBPACK_IMPORTED_MODULE_12__["CopyLinesCommand"](selection.selection, this.down)); - } - editor.pushUndoStop(); - editor.executeCommands(this.id, commands); - editor.pushUndoStop(); - } -} -class CopyLinesUpAction extends AbstractCopyLinesAction { - constructor() { - super(false, { - id: 'editor.action.copyLinesUpAction', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.copyUp', "Copy Line Up"), - alias: 'Copy Line Up', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].editorTextFocus, - primary: 512 /* Alt */ | 1024 /* Shift */ | 16 /* UpArrow */, - linux: { primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 1024 /* Shift */ | 16 /* UpArrow */ }, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_15__["MenuId"].MenubarSelectionMenu, - group: '2_line', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miCopyLinesUp', comment: ['&& denotes a mnemonic'] }, "&&Copy Line Up"), - order: 1 - } - }); - } -} -class CopyLinesDownAction extends AbstractCopyLinesAction { - constructor() { - super(true, { - id: 'editor.action.copyLinesDownAction', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.copyDown', "Copy Line Down"), - alias: 'Copy Line Down', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].editorTextFocus, - primary: 512 /* Alt */ | 1024 /* Shift */ | 18 /* DownArrow */, - linux: { primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 1024 /* Shift */ | 18 /* DownArrow */ }, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_15__["MenuId"].MenubarSelectionMenu, - group: '2_line', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miCopyLinesDown', comment: ['&& denotes a mnemonic'] }, "Co&&py Line Down"), - order: 2 - } - }); - } -} -class DuplicateSelectionAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.duplicateSelection', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('duplicateSelection', "Duplicate Selection"), - alias: 'Duplicate Selection', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_15__["MenuId"].MenubarSelectionMenu, - group: '2_line', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miDuplicateSelection', comment: ['&& denotes a mnemonic'] }, "&&Duplicate Selection"), - order: 5 - } - }); - } - run(accessor, editor, args) { - if (!editor.hasModel()) { - return; - } - const commands = []; - const selections = editor.getSelections(); - const model = editor.getModel(); - for (const selection of selections) { - if (selection.isEmpty()) { - commands.push(new _copyLinesCommand_js__WEBPACK_IMPORTED_MODULE_12__["CopyLinesCommand"](selection, true)); - } - else { - const insertSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](selection.endLineNumber, selection.endColumn, selection.endLineNumber, selection.endColumn); - commands.push(new _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_4__["ReplaceCommandThatSelectsText"](insertSelection, model.getValueInRange(selection))); - } - } - editor.pushUndoStop(); - editor.executeCommands(this.id, commands); - editor.pushUndoStop(); - } -} -// move lines -class AbstractMoveLinesAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor(down, opts) { - super(opts); - this.down = down; - } - run(_accessor, editor) { - let commands = []; - let selections = editor.getSelections() || []; - const autoIndent = editor.getOption(8 /* autoIndent */); - for (const selection of selections) { - commands.push(new _moveLinesCommand_js__WEBPACK_IMPORTED_MODULE_13__["MoveLinesCommand"](selection, this.down, autoIndent)); - } - editor.pushUndoStop(); - editor.executeCommands(this.id, commands); - editor.pushUndoStop(); - } -} -class MoveLinesUpAction extends AbstractMoveLinesAction { - constructor() { - super(false, { - id: 'editor.action.moveLinesUpAction', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.moveUp', "Move Line Up"), - alias: 'Move Line Up', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].editorTextFocus, - primary: 512 /* Alt */ | 16 /* UpArrow */, - linux: { primary: 512 /* Alt */ | 16 /* UpArrow */ }, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_15__["MenuId"].MenubarSelectionMenu, - group: '2_line', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miMoveLinesUp', comment: ['&& denotes a mnemonic'] }, "Mo&&ve Line Up"), - order: 3 - } - }); - } -} -class MoveLinesDownAction extends AbstractMoveLinesAction { - constructor() { - super(true, { - id: 'editor.action.moveLinesDownAction', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.moveDown', "Move Line Down"), - alias: 'Move Line Down', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].editorTextFocus, - primary: 512 /* Alt */ | 18 /* DownArrow */, - linux: { primary: 512 /* Alt */ | 18 /* DownArrow */ }, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_15__["MenuId"].MenubarSelectionMenu, - group: '2_line', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miMoveLinesDown', comment: ['&& denotes a mnemonic'] }, "Move &&Line Down"), - order: 4 - } - }); - } -} -class AbstractSortLinesAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor(descending, opts) { - super(opts); - this.descending = descending; - } - run(_accessor, editor) { - const selections = editor.getSelections() || []; - for (const selection of selections) { - if (!_sortLinesCommand_js__WEBPACK_IMPORTED_MODULE_14__["SortLinesCommand"].canRun(editor.getModel(), selection, this.descending)) { - return; - } - } - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - commands[i] = new _sortLinesCommand_js__WEBPACK_IMPORTED_MODULE_14__["SortLinesCommand"](selections[i], this.descending); - } - editor.pushUndoStop(); - editor.executeCommands(this.id, commands); - editor.pushUndoStop(); - } -} -class SortLinesAscendingAction extends AbstractSortLinesAction { - constructor() { - super(false, { - id: 'editor.action.sortLinesAscending', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.sortAscending', "Sort Lines Ascending"), - alias: 'Sort Lines Ascending', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable - }); - } -} -class SortLinesDescendingAction extends AbstractSortLinesAction { - constructor() { - super(true, { - id: 'editor.action.sortLinesDescending', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.sortDescending', "Sort Lines Descending"), - alias: 'Sort Lines Descending', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable - }); - } -} -class TrimTrailingWhitespaceAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: TrimTrailingWhitespaceAction.ID, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.trimTrailingWhitespace', "Trim Trailing Whitespace"), - alias: 'Trim Trailing Whitespace', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].editorTextFocus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 54 /* KEY_X */), - weight: 100 /* EditorContrib */ - } - }); - } - run(_accessor, editor, args) { - let cursors = []; - if (args.reason === 'auto-save') { - // See https://github.com/editorconfig/editorconfig-vscode/issues/47 - // It is very convenient for the editor config extension to invoke this action. - // So, if we get a reason:'auto-save' passed in, let's preserve cursor positions. - cursors = (editor.getSelections() || []).map(s => new _common_core_position_js__WEBPACK_IMPORTED_MODULE_8__["Position"](s.positionLineNumber, s.positionColumn)); - } - let selection = editor.getSelection(); - if (selection === null) { - return; - } - let command = new _common_commands_trimTrailingWhitespaceCommand_js__WEBPACK_IMPORTED_MODULE_5__["TrimTrailingWhitespaceCommand"](selection, cursors); - editor.pushUndoStop(); - editor.executeCommands(this.id, [command]); - editor.pushUndoStop(); - } -} -TrimTrailingWhitespaceAction.ID = 'editor.action.trimTrailingWhitespace'; -class DeleteLinesAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.deleteLines', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.delete', "Delete Line"), - alias: 'Delete Line', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 41 /* KEY_K */, - weight: 100 /* EditorContrib */ - } - }); - } - run(_accessor, editor) { - if (!editor.hasModel()) { - return; - } - let ops = this._getLinesToRemove(editor); - let model = editor.getModel(); - if (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) { - // Model is empty - return; - } - let linesDeleted = 0; - let edits = []; - let cursorState = []; - for (let i = 0, len = ops.length; i < len; i++) { - const op = ops[i]; - let startLineNumber = op.startLineNumber; - let endLineNumber = op.endLineNumber; - let startColumn = 1; - let endColumn = model.getLineMaxColumn(endLineNumber); - if (endLineNumber < model.getLineCount()) { - endLineNumber += 1; - endColumn = 1; - } - else if (startLineNumber > 1) { - startLineNumber -= 1; - startColumn = model.getLineMaxColumn(startLineNumber); - } - edits.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_7__["EditOperation"].replace(new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](startLineNumber, startColumn, endLineNumber, endColumn), '')); - cursorState.push(new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](startLineNumber - linesDeleted, op.positionColumn, startLineNumber - linesDeleted, op.positionColumn)); - linesDeleted += (op.endLineNumber - op.startLineNumber + 1); - } - editor.pushUndoStop(); - editor.executeEdits(this.id, edits, cursorState); - editor.pushUndoStop(); - } - _getLinesToRemove(editor) { - // Construct delete operations - let operations = editor.getSelections().map((s) => { - let endLineNumber = s.endLineNumber; - if (s.startLineNumber < s.endLineNumber && s.endColumn === 1) { - endLineNumber -= 1; - } - return { - startLineNumber: s.startLineNumber, - selectionStartColumn: s.selectionStartColumn, - endLineNumber: endLineNumber, - positionColumn: s.positionColumn - }; - }); - // Sort delete operations - operations.sort((a, b) => { - if (a.startLineNumber === b.startLineNumber) { - return a.endLineNumber - b.endLineNumber; - } - return a.startLineNumber - b.startLineNumber; - }); - // Merge delete operations which are adjacent or overlapping - let mergedOperations = []; - let previousOperation = operations[0]; - for (let i = 1; i < operations.length; i++) { - if (previousOperation.endLineNumber + 1 >= operations[i].startLineNumber) { - // Merge current operations into the previous one - previousOperation.endLineNumber = operations[i].endLineNumber; - } - else { - // Push previous operation - mergedOperations.push(previousOperation); - previousOperation = operations[i]; - } - } - // Push the last operation - mergedOperations.push(previousOperation); - return mergedOperations; - } -} -class IndentLinesAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.indentLines', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.indent', "Indent Line"), - alias: 'Indent Line', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 89 /* US_CLOSE_SQUARE_BRACKET */, - weight: 100 /* EditorContrib */ - } - }); - } - run(_accessor, editor) { - const viewModel = editor._getViewModel(); - if (!viewModel) { - return; - } - editor.pushUndoStop(); - editor.executeCommands(this.id, _common_controller_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_6__["TypeOperations"].indent(viewModel.cursorConfig, editor.getModel(), editor.getSelections())); - editor.pushUndoStop(); - } -} -class OutdentLinesAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.outdentLines', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.outdent', "Outdent Line"), - alias: 'Outdent Line', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 87 /* US_OPEN_SQUARE_BRACKET */, - weight: 100 /* EditorContrib */ - } - }); - } - run(_accessor, editor) { - _browser_controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_2__["CoreEditingCommands"].Outdent.runEditorCommand(_accessor, editor, null); - } -} -class InsertLineBeforeAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.insertLineBefore', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.insertBefore', "Insert Line Above"), - alias: 'Insert Line Above', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 3 /* Enter */, - weight: 100 /* EditorContrib */ - } - }); - } - run(_accessor, editor) { - const viewModel = editor._getViewModel(); - if (!viewModel) { - return; - } - editor.pushUndoStop(); - editor.executeCommands(this.id, _common_controller_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_6__["TypeOperations"].lineInsertBefore(viewModel.cursorConfig, editor.getModel(), editor.getSelections())); - } -} -class InsertLineAfterAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.insertLineAfter', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.insertAfter', "Insert Line Below"), - alias: 'Insert Line Below', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 3 /* Enter */, - weight: 100 /* EditorContrib */ - } - }); - } - run(_accessor, editor) { - const viewModel = editor._getViewModel(); - if (!viewModel) { - return; - } - editor.pushUndoStop(); - editor.executeCommands(this.id, _common_controller_cursorTypeOperations_js__WEBPACK_IMPORTED_MODULE_6__["TypeOperations"].lineInsertAfter(viewModel.cursorConfig, editor.getModel(), editor.getSelections())); - } -} -class AbstractDeleteAllToBoundaryAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - run(_accessor, editor) { - if (!editor.hasModel()) { - return; - } - const primaryCursor = editor.getSelection(); - let rangesToDelete = this._getRangesToDelete(editor); - // merge overlapping selections - let effectiveRanges = []; - for (let i = 0, count = rangesToDelete.length - 1; i < count; i++) { - let range = rangesToDelete[i]; - let nextRange = rangesToDelete[i + 1]; - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"].intersectRanges(range, nextRange) === null) { - effectiveRanges.push(range); - } - else { - rangesToDelete[i + 1] = _common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"].plusRange(range, nextRange); - } - } - effectiveRanges.push(rangesToDelete[rangesToDelete.length - 1]); - let endCursorState = this._getEndCursorState(primaryCursor, effectiveRanges); - let edits = effectiveRanges.map(range => { - return _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_7__["EditOperation"].replace(range, ''); - }); - editor.pushUndoStop(); - editor.executeEdits(this.id, edits, endCursorState); - editor.pushUndoStop(); - } -} -class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction { - constructor() { - super({ - id: 'deleteAllLeft', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.deleteAllLeft', "Delete All Left"), - alias: 'Delete All Left', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 2048 /* CtrlCmd */ | 1 /* Backspace */ }, - weight: 100 /* EditorContrib */ - } - }); - } - _getEndCursorState(primaryCursor, rangesToDelete) { - let endPrimaryCursor = null; - let endCursorState = []; - let deletedLines = 0; - rangesToDelete.forEach(range => { - let endCursor; - if (range.endColumn === 1 && deletedLines > 0) { - let newStartLine = range.startLineNumber - deletedLines; - endCursor = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](newStartLine, range.startColumn, newStartLine, range.startColumn); - } - else { - endCursor = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); - } - deletedLines += range.endLineNumber - range.startLineNumber; - if (range.intersectRanges(primaryCursor)) { - endPrimaryCursor = endCursor; - } - else { - endCursorState.push(endCursor); - } - }); - if (endPrimaryCursor) { - endCursorState.unshift(endPrimaryCursor); - } - return endCursorState; - } - _getRangesToDelete(editor) { - let selections = editor.getSelections(); - if (selections === null) { - return []; - } - let rangesToDelete = selections; - let model = editor.getModel(); - if (model === null) { - return []; - } - rangesToDelete.sort(_common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"].compareRangesUsingStarts); - rangesToDelete = rangesToDelete.map(selection => { - if (selection.isEmpty()) { - if (selection.startColumn === 1) { - let deleteFromLine = Math.max(1, selection.startLineNumber - 1); - let deleteFromColumn = selection.startLineNumber === 1 ? 1 : model.getLineContent(deleteFromLine).length + 1; - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"](deleteFromLine, deleteFromColumn, selection.startLineNumber, 1); - } - else { - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"](selection.startLineNumber, 1, selection.startLineNumber, selection.startColumn); - } - } - else { - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"](selection.startLineNumber, 1, selection.endLineNumber, selection.endColumn); - } - }); - return rangesToDelete; - } -} -class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction { - constructor() { - super({ - id: 'deleteAllRight', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.deleteAllRight', "Delete All Right"), - alias: 'Delete All Right', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 41 /* KEY_K */, secondary: [2048 /* CtrlCmd */ | 20 /* Delete */] }, - weight: 100 /* EditorContrib */ - } - }); - } - _getEndCursorState(primaryCursor, rangesToDelete) { - let endPrimaryCursor = null; - let endCursorState = []; - for (let i = 0, len = rangesToDelete.length, offset = 0; i < len; i++) { - let range = rangesToDelete[i]; - let endCursor = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](range.startLineNumber - offset, range.startColumn, range.startLineNumber - offset, range.startColumn); - if (range.intersectRanges(primaryCursor)) { - endPrimaryCursor = endCursor; - } - else { - endCursorState.push(endCursor); - } - } - if (endPrimaryCursor) { - endCursorState.unshift(endPrimaryCursor); - } - return endCursorState; - } - _getRangesToDelete(editor) { - let model = editor.getModel(); - if (model === null) { - return []; - } - let selections = editor.getSelections(); - if (selections === null) { - return []; - } - let rangesToDelete = selections.map((sel) => { - if (sel.isEmpty()) { - const maxColumn = model.getLineMaxColumn(sel.startLineNumber); - if (sel.startColumn === maxColumn) { - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"](sel.startLineNumber, sel.startColumn, sel.startLineNumber + 1, 1); - } - else { - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"](sel.startLineNumber, sel.startColumn, sel.startLineNumber, maxColumn); - } - } - return sel; - }); - rangesToDelete.sort(_common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"].compareRangesUsingStarts); - return rangesToDelete; - } -} -class JoinLinesAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.joinLines', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('lines.joinLines', "Join Lines"), - alias: 'Join Lines', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].editorTextFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 40 /* KEY_J */ }, - weight: 100 /* EditorContrib */ - } - }); - } - run(_accessor, editor) { - let selections = editor.getSelections(); - if (selections === null) { - return; - } - let primaryCursor = editor.getSelection(); - if (primaryCursor === null) { - return; - } - selections.sort(_common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"].compareRangesUsingStarts); - let reducedSelections = []; - let lastSelection = selections.reduce((previousValue, currentValue) => { - if (previousValue.isEmpty()) { - if (previousValue.endLineNumber === currentValue.startLineNumber) { - if (primaryCursor.equalsSelection(previousValue)) { - primaryCursor = currentValue; - } - return currentValue; - } - if (currentValue.startLineNumber > previousValue.endLineNumber + 1) { - reducedSelections.push(previousValue); - return currentValue; - } - else { - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](previousValue.startLineNumber, previousValue.startColumn, currentValue.endLineNumber, currentValue.endColumn); - } - } - else { - if (currentValue.startLineNumber > previousValue.endLineNumber) { - reducedSelections.push(previousValue); - return currentValue; - } - else { - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](previousValue.startLineNumber, previousValue.startColumn, currentValue.endLineNumber, currentValue.endColumn); - } - } - }); - reducedSelections.push(lastSelection); - let model = editor.getModel(); - if (model === null) { - return; - } - let edits = []; - let endCursorState = []; - let endPrimaryCursor = primaryCursor; - let lineOffset = 0; - for (let i = 0, len = reducedSelections.length; i < len; i++) { - let selection = reducedSelections[i]; - let startLineNumber = selection.startLineNumber; - let startColumn = 1; - let columnDeltaOffset = 0; - let endLineNumber, endColumn; - let selectionEndPositionOffset = model.getLineContent(selection.endLineNumber).length - selection.endColumn; - if (selection.isEmpty() || selection.startLineNumber === selection.endLineNumber) { - let position = selection.getStartPosition(); - if (position.lineNumber < model.getLineCount()) { - endLineNumber = startLineNumber + 1; - endColumn = model.getLineMaxColumn(endLineNumber); - } - else { - endLineNumber = position.lineNumber; - endColumn = model.getLineMaxColumn(position.lineNumber); - } - } - else { - endLineNumber = selection.endLineNumber; - endColumn = model.getLineMaxColumn(endLineNumber); - } - let trimmedLinesContent = model.getLineContent(startLineNumber); - for (let i = startLineNumber + 1; i <= endLineNumber; i++) { - let lineText = model.getLineContent(i); - let firstNonWhitespaceIdx = model.getLineFirstNonWhitespaceColumn(i); - if (firstNonWhitespaceIdx >= 1) { - let insertSpace = true; - if (trimmedLinesContent === '') { - insertSpace = false; - } - if (insertSpace && (trimmedLinesContent.charAt(trimmedLinesContent.length - 1) === ' ' || - trimmedLinesContent.charAt(trimmedLinesContent.length - 1) === '\t')) { - insertSpace = false; - trimmedLinesContent = trimmedLinesContent.replace(/[\s\uFEFF\xA0]+$/g, ' '); - } - let lineTextWithoutIndent = lineText.substr(firstNonWhitespaceIdx - 1); - trimmedLinesContent += (insertSpace ? ' ' : '') + lineTextWithoutIndent; - if (insertSpace) { - columnDeltaOffset = lineTextWithoutIndent.length + 1; - } - else { - columnDeltaOffset = lineTextWithoutIndent.length; - } - } - else { - columnDeltaOffset = 0; - } - } - let deleteSelection = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"](startLineNumber, startColumn, endLineNumber, endColumn); - if (!deleteSelection.isEmpty()) { - let resultSelection; - if (selection.isEmpty()) { - edits.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_7__["EditOperation"].replace(deleteSelection, trimmedLinesContent)); - resultSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](deleteSelection.startLineNumber - lineOffset, trimmedLinesContent.length - columnDeltaOffset + 1, startLineNumber - lineOffset, trimmedLinesContent.length - columnDeltaOffset + 1); - } - else { - if (selection.startLineNumber === selection.endLineNumber) { - edits.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_7__["EditOperation"].replace(deleteSelection, trimmedLinesContent)); - resultSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](selection.startLineNumber - lineOffset, selection.startColumn, selection.endLineNumber - lineOffset, selection.endColumn); - } - else { - edits.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_7__["EditOperation"].replace(deleteSelection, trimmedLinesContent)); - resultSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](selection.startLineNumber - lineOffset, selection.startColumn, selection.startLineNumber - lineOffset, trimmedLinesContent.length - selectionEndPositionOffset); - } - } - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"].intersectRanges(deleteSelection, primaryCursor) !== null) { - endPrimaryCursor = resultSelection; - } - else { - endCursorState.push(resultSelection); - } - } - lineOffset += deleteSelection.endLineNumber - deleteSelection.startLineNumber; - } - endCursorState.unshift(endPrimaryCursor); - editor.pushUndoStop(); - editor.executeEdits(this.id, edits, endCursorState); - editor.pushUndoStop(); - } -} -class TransposeAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.transpose', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.transpose', "Transpose characters around the cursor"), - alias: 'Transpose characters around the cursor', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable - }); - } - run(_accessor, editor) { - let selections = editor.getSelections(); - if (selections === null) { - return; - } - let model = editor.getModel(); - if (model === null) { - return; - } - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - let selection = selections[i]; - if (!selection.isEmpty()) { - continue; - } - let cursor = selection.getStartPosition(); - let maxColumn = model.getLineMaxColumn(cursor.lineNumber); - if (cursor.column >= maxColumn) { - if (cursor.lineNumber === model.getLineCount()) { - continue; - } - // The cursor is at the end of current line and current line is not empty - // then we transpose the character before the cursor and the line break if there is any following line. - let deleteSelection = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"](cursor.lineNumber, Math.max(1, cursor.column - 1), cursor.lineNumber + 1, 1); - let chars = model.getValueInRange(deleteSelection).split('').reverse().join(''); - commands.push(new _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_4__["ReplaceCommand"](new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](cursor.lineNumber, Math.max(1, cursor.column - 1), cursor.lineNumber + 1, 1), chars)); - } - else { - let deleteSelection = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"](cursor.lineNumber, Math.max(1, cursor.column - 1), cursor.lineNumber, cursor.column + 1); - let chars = model.getValueInRange(deleteSelection).split('').reverse().join(''); - commands.push(new _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_4__["ReplaceCommandThatPreservesSelection"](deleteSelection, chars, new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](cursor.lineNumber, cursor.column + 1, cursor.lineNumber, cursor.column + 1))); - } - } - editor.pushUndoStop(); - editor.executeCommands(this.id, commands); - editor.pushUndoStop(); - } -} -class AbstractCaseAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["EditorAction"] { - run(_accessor, editor) { - let selections = editor.getSelections(); - if (selections === null) { - return; - } - let model = editor.getModel(); - if (model === null) { - return; - } - let wordSeparators = editor.getOption(105 /* wordSeparators */); - let commands = []; - for (let i = 0, len = selections.length; i < len; i++) { - let selection = selections[i]; - if (selection.isEmpty()) { - let cursor = selection.getStartPosition(); - const word = editor.getConfiguredWordAtPosition(cursor); - if (!word) { - continue; - } - let wordRange = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_9__["Range"](cursor.lineNumber, word.startColumn, cursor.lineNumber, word.endColumn); - let text = model.getValueInRange(wordRange); - commands.push(new _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_4__["ReplaceCommandThatPreservesSelection"](wordRange, this._modifyText(text, wordSeparators), new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__["Selection"](cursor.lineNumber, cursor.column, cursor.lineNumber, cursor.column))); - } - else { - let text = model.getValueInRange(selection); - commands.push(new _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_4__["ReplaceCommandThatPreservesSelection"](selection, this._modifyText(text, wordSeparators), selection)); - } - } - editor.pushUndoStop(); - editor.executeCommands(this.id, commands); - editor.pushUndoStop(); - } -} -class UpperCaseAction extends AbstractCaseAction { - constructor() { - super({ - id: 'editor.action.transformToUppercase', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.transformToUppercase', "Transform to Uppercase"), - alias: 'Transform to Uppercase', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable - }); - } - _modifyText(text, wordSeparators) { - return text.toLocaleUpperCase(); - } -} -class LowerCaseAction extends AbstractCaseAction { - constructor() { - super({ - id: 'editor.action.transformToLowercase', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.transformToLowercase', "Transform to Lowercase"), - alias: 'Transform to Lowercase', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable - }); - } - _modifyText(text, wordSeparators) { - return text.toLocaleLowerCase(); - } -} -class TitleCaseAction extends AbstractCaseAction { - constructor() { - super({ - id: 'editor.action.transformToTitlecase', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('editor.transformToTitlecase', "Transform to Title Case"), - alias: 'Transform to Title Case', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].writable - }); - } - _modifyText(text, wordSeparators) { - const separators = '\r\n\t ' + wordSeparators; - const excludedChars = separators.split(''); - let title = ''; - let startUpperCase = true; - for (let i = 0; i < text.length; i++) { - let currentChar = text[i]; - if (excludedChars.indexOf(currentChar) >= 0) { - startUpperCase = true; - title += currentChar; - } - else if (startUpperCase) { - startUpperCase = false; - title += currentChar.toLocaleUpperCase(); - } - else { - title += currentChar.toLocaleLowerCase(); - } - } - return title; - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(CopyLinesUpAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(CopyLinesDownAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(DuplicateSelectionAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(MoveLinesUpAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(MoveLinesDownAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(SortLinesAscendingAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(SortLinesDescendingAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(TrimTrailingWhitespaceAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(DeleteLinesAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(IndentLinesAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(OutdentLinesAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(InsertLineBeforeAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(InsertLineAfterAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(DeleteAllLeftAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(DeleteAllRightAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(JoinLinesAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(TransposeAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(UpperCaseAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(LowerCaseAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_3__["registerEditorAction"])(TitleCaseAction); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/moveLinesCommand.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/moveLinesCommand.js ***! - \**********************************************************************************************/ -/*! exports provided: MoveLinesCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MoveLinesCommand", function() { return MoveLinesCommand; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _common_commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/commands/shiftCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/common/commands/shiftCommand.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_modes_languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/modes/languageConfiguration.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfiguration.js"); -/* harmony import */ var _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/* harmony import */ var _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../indentation/indentUtils.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/indentation/indentUtils.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -class MoveLinesCommand { - constructor(selection, isMovingDown, autoIndent) { - this._selection = selection; - this._isMovingDown = isMovingDown; - this._autoIndent = autoIndent; - this._selectionId = null; - this._moveEndLineSelectionShrink = false; - } - getEditOperations(model, builder) { - let modelLineCount = model.getLineCount(); - if (this._isMovingDown && this._selection.endLineNumber === modelLineCount) { - this._selectionId = builder.trackSelection(this._selection); - return; - } - if (!this._isMovingDown && this._selection.startLineNumber === 1) { - this._selectionId = builder.trackSelection(this._selection); - return; - } - this._moveEndPositionDown = false; - let s = this._selection; - if (s.startLineNumber < s.endLineNumber && s.endColumn === 1) { - this._moveEndPositionDown = true; - s = s.setEndPosition(s.endLineNumber - 1, model.getLineMaxColumn(s.endLineNumber - 1)); - } - const { tabSize, indentSize, insertSpaces } = model.getOptions(); - let indentConverter = this.buildIndentConverter(tabSize, indentSize, insertSpaces); - let virtualModel = { - getLineTokens: (lineNumber) => { - return model.getLineTokens(lineNumber); - }, - getLanguageIdentifier: () => { - return model.getLanguageIdentifier(); - }, - getLanguageIdAtPosition: (lineNumber, column) => { - return model.getLanguageIdAtPosition(lineNumber, column); - }, - getLineContent: null, - }; - if (s.startLineNumber === s.endLineNumber && model.getLineMaxColumn(s.startLineNumber) === 1) { - // Current line is empty - let lineNumber = s.startLineNumber; - let otherLineNumber = (this._isMovingDown ? lineNumber + 1 : lineNumber - 1); - if (model.getLineMaxColumn(otherLineNumber) === 1) { - // Other line number is empty too, so no editing is needed - // Add a no-op to force running by the model - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](1, 1, 1, 1), null); - } - else { - // Type content from other line number on line number - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](lineNumber, 1, lineNumber, 1), model.getLineContent(otherLineNumber)); - // Remove content from other line number - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](otherLineNumber, 1, otherLineNumber, model.getLineMaxColumn(otherLineNumber)), null); - } - // Track selection at the other line number - s = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_3__["Selection"](otherLineNumber, 1, otherLineNumber, 1); - } - else { - let movingLineNumber; - let movingLineText; - if (this._isMovingDown) { - movingLineNumber = s.endLineNumber + 1; - movingLineText = model.getLineContent(movingLineNumber); - // Delete line that needs to be moved - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](movingLineNumber - 1, model.getLineMaxColumn(movingLineNumber - 1), movingLineNumber, model.getLineMaxColumn(movingLineNumber)), null); - let insertingText = movingLineText; - if (this.shouldAutoIndent(model, s)) { - let movingLineMatchResult = this.matchEnterRule(model, indentConverter, tabSize, movingLineNumber, s.startLineNumber - 1); - // if s.startLineNumber - 1 matches onEnter rule, we still honor that. - if (movingLineMatchResult !== null) { - let oldIndentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["getLeadingWhitespace"](model.getLineContent(movingLineNumber)); - let newSpaceCnt = movingLineMatchResult + _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["getSpaceCnt"](oldIndentation, tabSize); - let newIndentation = _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["generateIndent"](newSpaceCnt, tabSize, insertSpaces); - insertingText = newIndentation + this.trimLeft(movingLineText); - } - else { - // no enter rule matches, let's check indentatin rules then. - virtualModel.getLineContent = (lineNumber) => { - if (lineNumber === s.startLineNumber) { - return model.getLineContent(movingLineNumber); - } - else { - return model.getLineContent(lineNumber); - } - }; - let indentOfMovingLine = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__["LanguageConfigurationRegistry"].getGoodIndentForLine(this._autoIndent, virtualModel, model.getLanguageIdAtPosition(movingLineNumber, 1), s.startLineNumber, indentConverter); - if (indentOfMovingLine !== null) { - let oldIndentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["getLeadingWhitespace"](model.getLineContent(movingLineNumber)); - let newSpaceCnt = _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["getSpaceCnt"](indentOfMovingLine, tabSize); - let oldSpaceCnt = _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["getSpaceCnt"](oldIndentation, tabSize); - if (newSpaceCnt !== oldSpaceCnt) { - let newIndentation = _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["generateIndent"](newSpaceCnt, tabSize, insertSpaces); - insertingText = newIndentation + this.trimLeft(movingLineText); - } - } - } - // add edit operations for moving line first to make sure it's executed after we make indentation change - // to s.startLineNumber - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](s.startLineNumber, 1, s.startLineNumber, 1), insertingText + '\n'); - let ret = this.matchEnterRule(model, indentConverter, tabSize, s.startLineNumber, s.startLineNumber, insertingText); - // check if the line being moved before matches onEnter rules, if so let's adjust the indentation by onEnter rules. - if (ret !== null) { - if (ret !== 0) { - this.getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, ret); - } - } - else { - // it doesn't match onEnter rules, let's check indentation rules then. - virtualModel.getLineContent = (lineNumber) => { - if (lineNumber === s.startLineNumber) { - return insertingText; - } - else if (lineNumber >= s.startLineNumber + 1 && lineNumber <= s.endLineNumber + 1) { - return model.getLineContent(lineNumber - 1); - } - else { - return model.getLineContent(lineNumber); - } - }; - let newIndentatOfMovingBlock = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__["LanguageConfigurationRegistry"].getGoodIndentForLine(this._autoIndent, virtualModel, model.getLanguageIdAtPosition(movingLineNumber, 1), s.startLineNumber + 1, indentConverter); - if (newIndentatOfMovingBlock !== null) { - const oldIndentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["getLeadingWhitespace"](model.getLineContent(s.startLineNumber)); - const newSpaceCnt = _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["getSpaceCnt"](newIndentatOfMovingBlock, tabSize); - const oldSpaceCnt = _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["getSpaceCnt"](oldIndentation, tabSize); - if (newSpaceCnt !== oldSpaceCnt) { - const spaceCntOffset = newSpaceCnt - oldSpaceCnt; - this.getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, spaceCntOffset); - } - } - } - } - else { - // Insert line that needs to be moved before - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](s.startLineNumber, 1, s.startLineNumber, 1), insertingText + '\n'); - } - } - else { - movingLineNumber = s.startLineNumber - 1; - movingLineText = model.getLineContent(movingLineNumber); - // Delete line that needs to be moved - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](movingLineNumber, 1, movingLineNumber + 1, 1), null); - // Insert line that needs to be moved after - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](s.endLineNumber, model.getLineMaxColumn(s.endLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), '\n' + movingLineText); - if (this.shouldAutoIndent(model, s)) { - virtualModel.getLineContent = (lineNumber) => { - if (lineNumber === movingLineNumber) { - return model.getLineContent(s.startLineNumber); - } - else { - return model.getLineContent(lineNumber); - } - }; - let ret = this.matchEnterRule(model, indentConverter, tabSize, s.startLineNumber, s.startLineNumber - 2); - // check if s.startLineNumber - 2 matches onEnter rules, if so adjust the moving block by onEnter rules. - if (ret !== null) { - if (ret !== 0) { - this.getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, ret); - } - } - else { - // it doesn't match any onEnter rule, let's check indentation rules then. - let indentOfFirstLine = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__["LanguageConfigurationRegistry"].getGoodIndentForLine(this._autoIndent, virtualModel, model.getLanguageIdAtPosition(s.startLineNumber, 1), movingLineNumber, indentConverter); - if (indentOfFirstLine !== null) { - // adjust the indentation of the moving block - let oldIndent = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["getLeadingWhitespace"](model.getLineContent(s.startLineNumber)); - let newSpaceCnt = _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["getSpaceCnt"](indentOfFirstLine, tabSize); - let oldSpaceCnt = _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["getSpaceCnt"](oldIndent, tabSize); - if (newSpaceCnt !== oldSpaceCnt) { - let spaceCntOffset = newSpaceCnt - oldSpaceCnt; - this.getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, spaceCntOffset); - } - } - } - } - } - } - this._selectionId = builder.trackSelection(s); - } - buildIndentConverter(tabSize, indentSize, insertSpaces) { - return { - shiftIndent: (indentation) => { - return _common_commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_1__["ShiftCommand"].shiftIndent(indentation, indentation.length + 1, tabSize, indentSize, insertSpaces); - }, - unshiftIndent: (indentation) => { - return _common_commands_shiftCommand_js__WEBPACK_IMPORTED_MODULE_1__["ShiftCommand"].unshiftIndent(indentation, indentation.length + 1, tabSize, indentSize, insertSpaces); - } - }; - } - matchEnterRule(model, indentConverter, tabSize, line, oneLineAbove, oneLineAboveText) { - let validPrecedingLine = oneLineAbove; - while (validPrecedingLine >= 1) { - // ship empty lines as empty lines just inherit indentation - let lineContent; - if (validPrecedingLine === oneLineAbove && oneLineAboveText !== undefined) { - lineContent = oneLineAboveText; - } - else { - lineContent = model.getLineContent(validPrecedingLine); - } - let nonWhitespaceIdx = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["lastNonWhitespaceIndex"](lineContent); - if (nonWhitespaceIdx >= 0) { - break; - } - validPrecedingLine--; - } - if (validPrecedingLine < 1 || line > model.getLineCount()) { - return null; - } - let maxColumn = model.getLineMaxColumn(validPrecedingLine); - let enter = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__["LanguageConfigurationRegistry"].getEnterAction(this._autoIndent, model, new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](validPrecedingLine, maxColumn, validPrecedingLine, maxColumn)); - if (enter) { - let enterPrefix = enter.indentation; - if (enter.indentAction === _common_modes_languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].None) { - enterPrefix = enter.indentation + enter.appendText; - } - else if (enter.indentAction === _common_modes_languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].Indent) { - enterPrefix = enter.indentation + enter.appendText; - } - else if (enter.indentAction === _common_modes_languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].IndentOutdent) { - enterPrefix = enter.indentation; - } - else if (enter.indentAction === _common_modes_languageConfiguration_js__WEBPACK_IMPORTED_MODULE_4__["IndentAction"].Outdent) { - enterPrefix = indentConverter.unshiftIndent(enter.indentation) + enter.appendText; - } - let movingLineText = model.getLineContent(line); - if (this.trimLeft(movingLineText).indexOf(this.trimLeft(enterPrefix)) >= 0) { - let oldIndentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["getLeadingWhitespace"](model.getLineContent(line)); - let newIndentation = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["getLeadingWhitespace"](enterPrefix); - let indentMetadataOfMovelingLine = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__["LanguageConfigurationRegistry"].getIndentMetadata(model, line); - if (indentMetadataOfMovelingLine !== null && indentMetadataOfMovelingLine & 2 /* DECREASE_MASK */) { - newIndentation = indentConverter.unshiftIndent(newIndentation); - } - let newSpaceCnt = _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["getSpaceCnt"](newIndentation, tabSize); - let oldSpaceCnt = _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["getSpaceCnt"](oldIndentation, tabSize); - return newSpaceCnt - oldSpaceCnt; - } - } - return null; - } - trimLeft(str) { - return str.replace(/^\s+/, ''); - } - shouldAutoIndent(model, selection) { - if (this._autoIndent < 4 /* Full */) { - return false; - } - // if it's not easy to tokenize, we stop auto indent. - if (!model.isCheapToTokenize(selection.startLineNumber)) { - return false; - } - let languageAtSelectionStart = model.getLanguageIdAtPosition(selection.startLineNumber, 1); - let languageAtSelectionEnd = model.getLanguageIdAtPosition(selection.endLineNumber, 1); - if (languageAtSelectionStart !== languageAtSelectionEnd) { - return false; - } - if (_common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__["LanguageConfigurationRegistry"].getIndentRulesSupport(languageAtSelectionStart) === null) { - return false; - } - return true; - } - getIndentEditsOfMovingBlock(model, builder, s, tabSize, insertSpaces, offset) { - for (let i = s.startLineNumber; i <= s.endLineNumber; i++) { - let lineContent = model.getLineContent(i); - let originalIndent = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["getLeadingWhitespace"](lineContent); - let originalSpacesCnt = _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["getSpaceCnt"](originalIndent, tabSize); - let newSpacesCnt = originalSpacesCnt + offset; - let newIndent = _indentation_indentUtils_js__WEBPACK_IMPORTED_MODULE_6__["generateIndent"](newSpacesCnt, tabSize, insertSpaces); - if (newIndent !== originalIndent) { - builder.addEditOperation(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](i, 1, i, originalIndent.length + 1), newIndent); - if (i === s.endLineNumber && s.endColumn <= originalIndent.length + 1 && newIndent === '') { - // as users select part of the original indent white spaces - // when we adjust the indentation of endLine, we should adjust the cursor position as well. - this._moveEndLineSelectionShrink = true; - } - } - } - } - computeCursorState(model, helper) { - let result = helper.getTrackedSelection(this._selectionId); - if (this._moveEndPositionDown) { - result = result.setEndPosition(result.endLineNumber + 1, 1); - } - if (this._moveEndLineSelectionShrink && result.startLineNumber < result.endLineNumber) { - result = result.setEndPosition(result.endLineNumber, 2); - } - return result; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/sortLinesCommand.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/sortLinesCommand.js ***! - \**********************************************************************************************/ -/*! exports provided: SortLinesCommand */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SortLinesCommand", function() { return SortLinesCommand; }); -/* harmony import */ var _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/core/editOperation.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class SortLinesCommand { - constructor(selection, descending) { - this.selection = selection; - this.descending = descending; - this.selectionId = null; - } - static getCollator() { - if (!SortLinesCommand._COLLATOR) { - SortLinesCommand._COLLATOR = new Intl.Collator(); - } - return SortLinesCommand._COLLATOR; - } - getEditOperations(model, builder) { - let op = sortLines(model, this.selection, this.descending); - if (op) { - builder.addEditOperation(op.range, op.text); - } - this.selectionId = builder.trackSelection(this.selection); - } - computeCursorState(model, helper) { - return helper.getTrackedSelection(this.selectionId); - } - static canRun(model, selection, descending) { - if (model === null) { - return false; - } - let data = getSortData(model, selection, descending); - if (!data) { - return false; - } - for (let i = 0, len = data.before.length; i < len; i++) { - if (data.before[i] !== data.after[i]) { - return true; - } - } - return false; - } -} -SortLinesCommand._COLLATOR = null; -function getSortData(model, selection, descending) { - let startLineNumber = selection.startLineNumber; - let endLineNumber = selection.endLineNumber; - if (selection.endColumn === 1) { - endLineNumber--; - } - // Nothing to sort if user didn't select anything. - if (startLineNumber >= endLineNumber) { - return null; - } - let linesToSort = []; - // Get the contents of the selection to be sorted. - for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { - linesToSort.push(model.getLineContent(lineNumber)); - } - let sorted = linesToSort.slice(0); - sorted.sort(SortLinesCommand.getCollator().compare); - // If descending, reverse the order. - if (descending === true) { - sorted = sorted.reverse(); - } - return { - startLineNumber: startLineNumber, - endLineNumber: endLineNumber, - before: linesToSort, - after: sorted - }; -} -/** - * Generate commands for sorting lines on a model. - */ -function sortLines(model, selection, descending) { - let data = getSortData(model, selection, descending); - if (!data) { - return null; - } - return _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_0__["EditOperation"].replace(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"](data.startLineNumber, 1, data.endLineNumber, model.getLineMaxColumn(data.endLineNumber)), data.after.join('\n')); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/links/getLinks.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/links/getLinks.js ***! - \****************************************************************************/ -/*! exports provided: Link, LinksList, getLinks */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Link", function() { return Link; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinksList", function() { return LinksList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLinks", function() { return getLinks; }); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - -class Link { - constructor(link, provider) { - this._link = link; - this._provider = provider; - } - toJSON() { - return { - range: this.range, - url: this.url, - tooltip: this.tooltip - }; - } - get range() { - return this._link.range; - } - get url() { - return this._link.url; - } - get tooltip() { - return this._link.tooltip; - } - resolve(token) { - return __awaiter(this, void 0, void 0, function* () { - if (this._link.url) { - return this._link.url; - } - if (typeof this._provider.resolveLink === 'function') { - return Promise.resolve(this._provider.resolveLink(this._link, token)).then(value => { - this._link = value || this._link; - if (this._link.url) { - // recurse - return this.resolve(token); - } - return Promise.reject(new Error('missing')); - }); - } - return Promise.reject(new Error('missing')); - }); - } -} -class LinksList extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["Disposable"] { - constructor(tuples) { - super(); - let links = []; - for (const [list, provider] of tuples) { - // merge all links - const newLinks = list.links.map(link => new Link(link, provider)); - links = LinksList._union(links, newLinks); - // register disposables - if (Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["isDisposable"])(list)) { - this._register(list); - } - } - this.links = links; - } - static _union(oldLinks, newLinks) { - // reunite oldLinks with newLinks and remove duplicates - let result = []; - let oldIndex; - let oldLen; - let newIndex; - let newLen; - for (oldIndex = 0, newIndex = 0, oldLen = oldLinks.length, newLen = newLinks.length; oldIndex < oldLen && newIndex < newLen;) { - const oldLink = oldLinks[oldIndex]; - const newLink = newLinks[newIndex]; - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].areIntersectingOrTouching(oldLink.range, newLink.range)) { - // Remove the oldLink - oldIndex++; - continue; - } - const comparisonResult = _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].compareRangesUsingStarts(oldLink.range, newLink.range); - if (comparisonResult < 0) { - // oldLink is before - result.push(oldLink); - oldIndex++; - } - else { - // newLink is before - result.push(newLink); - newIndex++; - } - } - for (; oldIndex < oldLen; oldIndex++) { - result.push(oldLinks[oldIndex]); - } - for (; newIndex < newLen; newIndex++) { - result.push(newLinks[newIndex]); - } - return result; - } -} -function getLinks(model, token) { - const lists = []; - // ask all providers for links in parallel - const promises = _common_modes_js__WEBPACK_IMPORTED_MODULE_4__["LinkProviderRegistry"].ordered(model).reverse().map((provider, i) => { - return Promise.resolve(provider.provideLinks(model, token)).then(result => { - if (result) { - lists[i] = [result, provider]; - } - }, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedExternalError"]); - }); - return Promise.all(promises).then(() => { - const result = new LinksList(Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_8__["coalesce"])(lists)); - if (!token.isCancellationRequested) { - return result; - } - result.dispose(); - return new LinksList([]); - }); -} -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_6__["CommandsRegistry"].registerCommand('_executeLinkProvider', (accessor, ...args) => __awaiter(void 0, void 0, void 0, function* () { - const [uri] = args; - if (!(uri instanceof _base_common_uri_js__WEBPACK_IMPORTED_MODULE_2__["URI"])) { - return []; - } - const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_5__["IModelService"]).getModel(uri); - if (!model) { - return []; - } - const list = yield getLinks(model, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationToken"].None); - if (!list) { - return []; - } - const result = list.links.slice(0); - list.dispose(); - return result; -})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/links/links.css": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/links/links.css ***! - \**************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_links_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./links.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/links/links.css"); -/* harmony import */ var _css_loader_dist_cjs_js_links_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_links_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_links_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_links_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/links/links.js": -/*!*************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/links/links.js ***! - \*************************************************************************/ -/*! exports provided: LinkDetector */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkDetector", function() { return LinkDetector; }); -/* harmony import */ var _links_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./links.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/links/links.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/htmlContent.js */ "./node_modules/monaco-editor/esm/vs/base/common/htmlContent.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _gotoSymbol_link_clickLinkGesture_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../gotoSymbol/link/clickLinkGesture.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/link/clickLinkGesture.js"); -/* harmony import */ var _getLinks_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./getLinks.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/links/getLinks.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/opener/common/opener.js */ "./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _base_common_network_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../base/common/network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _base_common_resources_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../base/common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - - - - - - -function getHoverMessage(link, useMetaKey) { - const executeCmd = link.url && /^command:/i.test(link.url.toString()); - const label = link.tooltip - ? link.tooltip - : executeCmd - ? _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('links.navigate.executeCmd', 'Execute command') - : _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('links.navigate.follow', 'Follow link'); - const kb = useMetaKey - ? _base_common_platform_js__WEBPACK_IMPORTED_MODULE_7__["isMacintosh"] - ? _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('links.navigate.kb.meta.mac', "cmd + click") - : _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('links.navigate.kb.meta', "ctrl + click") - : _base_common_platform_js__WEBPACK_IMPORTED_MODULE_7__["isMacintosh"] - ? _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('links.navigate.kb.alt.mac', "option + click") - : _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('links.navigate.kb.alt', "alt + click"); - if (link.url) { - const hoverMessage = new _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_5__["MarkdownString"]('', true).appendMarkdown(`[${label}](${link.url.toString()}) (${kb})`); - return hoverMessage; - } - else { - return new _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_5__["MarkdownString"]().appendText(`${label} (${kb})`); - } -} -const decoration = { - general: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_9__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - collapseOnReplaceEdit: true, - inlineClassName: 'detected-link' - }), - active: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_9__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - collapseOnReplaceEdit: true, - inlineClassName: 'detected-link-active' - }) -}; -class LinkOccurrence { - constructor(link, decorationId) { - this.link = link; - this.decorationId = decorationId; - } - static decoration(link, useMetaKey) { - return { - range: link.range, - options: LinkOccurrence._getOptions(link, useMetaKey, false) - }; - } - static _getOptions(link, useMetaKey, isActive) { - const options = Object.assign({}, (isActive ? decoration.active : decoration.general)); - options.hoverMessage = getHoverMessage(link, useMetaKey); - return options; - } - activate(changeAccessor, useMetaKey) { - changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurrence._getOptions(this.link, useMetaKey, true)); - } - deactivate(changeAccessor, useMetaKey) { - changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurrence._getOptions(this.link, useMetaKey, false)); - } -} -let LinkDetector = class LinkDetector { - constructor(editor, openerService, notificationService) { - this.listenersToRemove = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_6__["DisposableStore"](); - this.editor = editor; - this.openerService = openerService; - this.notificationService = notificationService; - let clickLinkGesture = new _gotoSymbol_link_clickLinkGesture_js__WEBPACK_IMPORTED_MODULE_11__["ClickLinkGesture"](editor); - this.listenersToRemove.add(clickLinkGesture); - this.listenersToRemove.add(clickLinkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => { - this._onEditorMouseMove(mouseEvent, keyboardEvent); - })); - this.listenersToRemove.add(clickLinkGesture.onExecute((e) => { - this.onEditorMouseUp(e); - })); - this.listenersToRemove.add(clickLinkGesture.onCancel((e) => { - this.cleanUpActiveLinkDecoration(); - })); - this.enabled = editor.getOption(54 /* links */); - this.listenersToRemove.add(editor.onDidChangeConfiguration((e) => { - const enabled = editor.getOption(54 /* links */); - if (this.enabled === enabled) { - // No change in our configuration option - return; - } - this.enabled = enabled; - // Remove any links (for the getting disabled case) - this.updateDecorations([]); - // Stop any computation (for the getting disabled case) - this.stop(); - // Start computing (for the getting enabled case) - this.beginCompute(); - })); - this.listenersToRemove.add(editor.onDidChangeModelContent((e) => this.onChange())); - this.listenersToRemove.add(editor.onDidChangeModel((e) => this.onModelChanged())); - this.listenersToRemove.add(editor.onDidChangeModelLanguage((e) => this.onModelModeChanged())); - this.listenersToRemove.add(_common_modes_js__WEBPACK_IMPORTED_MODULE_10__["LinkProviderRegistry"].onDidChange((e) => this.onModelModeChanged())); - this.timeout = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["TimeoutTimer"](); - this.computePromise = null; - this.activeLinksList = null; - this.currentOccurrences = {}; - this.activeLinkDecorationId = null; - this.beginCompute(); - } - static get(editor) { - return editor.getContribution(LinkDetector.ID); - } - onModelChanged() { - this.currentOccurrences = {}; - this.activeLinkDecorationId = null; - this.stop(); - this.beginCompute(); - } - onModelModeChanged() { - this.stop(); - this.beginCompute(); - } - onChange() { - this.timeout.setIfNotSet(() => this.beginCompute(), LinkDetector.RECOMPUTE_TIME); - } - beginCompute() { - return __awaiter(this, void 0, void 0, function* () { - if (!this.editor.hasModel() || !this.enabled) { - return; - } - const model = this.editor.getModel(); - if (!_common_modes_js__WEBPACK_IMPORTED_MODULE_10__["LinkProviderRegistry"].has(model)) { - return; - } - if (this.activeLinksList) { - this.activeLinksList.dispose(); - this.activeLinksList = null; - } - this.computePromise = _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["createCancelablePromise"](token => Object(_getLinks_js__WEBPACK_IMPORTED_MODULE_12__["getLinks"])(model, token)); - try { - this.activeLinksList = yield this.computePromise; - this.updateDecorations(this.activeLinksList.links); - } - catch (err) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_4__["onUnexpectedError"])(err); - } - finally { - this.computePromise = null; - } - }); - } - updateDecorations(links) { - const useMetaKey = (this.editor.getOption(61 /* multiCursorModifier */) === 'altKey'); - let oldDecorations = []; - let keys = Object.keys(this.currentOccurrences); - for (let i = 0, len = keys.length; i < len; i++) { - let decorationId = keys[i]; - let occurance = this.currentOccurrences[decorationId]; - oldDecorations.push(occurance.decorationId); - } - let newDecorations = []; - if (links) { - // Not sure why this is sometimes null - for (const link of links) { - newDecorations.push(LinkOccurrence.decoration(link, useMetaKey)); - } - } - let decorations = this.editor.deltaDecorations(oldDecorations, newDecorations); - this.currentOccurrences = {}; - this.activeLinkDecorationId = null; - for (let i = 0, len = decorations.length; i < len; i++) { - let occurance = new LinkOccurrence(links[i], decorations[i]); - this.currentOccurrences[occurance.decorationId] = occurance; - } - } - _onEditorMouseMove(mouseEvent, withKey) { - const useMetaKey = (this.editor.getOption(61 /* multiCursorModifier */) === 'altKey'); - if (this.isEnabled(mouseEvent, withKey)) { - this.cleanUpActiveLinkDecoration(); // always remove previous link decoration as their can only be one - const occurrence = this.getLinkOccurrence(mouseEvent.target.position); - if (occurrence) { - this.editor.changeDecorations((changeAccessor) => { - occurrence.activate(changeAccessor, useMetaKey); - this.activeLinkDecorationId = occurrence.decorationId; - }); - } - } - else { - this.cleanUpActiveLinkDecoration(); - } - } - cleanUpActiveLinkDecoration() { - const useMetaKey = (this.editor.getOption(61 /* multiCursorModifier */) === 'altKey'); - if (this.activeLinkDecorationId) { - const occurrence = this.currentOccurrences[this.activeLinkDecorationId]; - if (occurrence) { - this.editor.changeDecorations((changeAccessor) => { - occurrence.deactivate(changeAccessor, useMetaKey); - }); - } - this.activeLinkDecorationId = null; - } - } - onEditorMouseUp(mouseEvent) { - if (!this.isEnabled(mouseEvent)) { - return; - } - const occurrence = this.getLinkOccurrence(mouseEvent.target.position); - if (!occurrence) { - return; - } - this.openLinkOccurrence(occurrence, mouseEvent.hasSideBySideModifier, true /* from user gesture */); - } - openLinkOccurrence(occurrence, openToSide, fromUserGesture = false) { - if (!this.openerService) { - return; - } - const { link } = occurrence; - link.resolve(_base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_3__["CancellationToken"].None).then(uri => { - // Support for relative file URIs of the shape file://./relativeFile.txt or file:///./relativeFile.txt - if (typeof uri === 'string' && this.editor.hasModel()) { - const modelUri = this.editor.getModel().uri; - if (modelUri.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_18__["Schemas"].file && _base_common_strings_js__WEBPACK_IMPORTED_MODULE_20__["startsWith"](uri, 'file:')) { - const parsedUri = _base_common_uri_js__WEBPACK_IMPORTED_MODULE_17__["URI"].parse(uri); - if (parsedUri.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_18__["Schemas"].file) { - const fsPath = _base_common_resources_js__WEBPACK_IMPORTED_MODULE_19__["originalFSPath"](parsedUri); - let relativePath = null; - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_20__["startsWith"](fsPath, '/./')) { - relativePath = `.${fsPath.substr(1)}`; - } - else if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_20__["startsWith"](fsPath, '//./')) { - relativePath = `.${fsPath.substr(2)}`; - } - if (relativePath) { - uri = _base_common_resources_js__WEBPACK_IMPORTED_MODULE_19__["joinPath"](modelUri, relativePath); - } - } - } - } - return this.openerService.open(uri, { openToSide, fromUserGesture }); - }, err => { - const messageOrError = err instanceof Error ? err.message : err; - // different error cases - if (messageOrError === 'invalid') { - this.notificationService.warn(_nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('invalid.url', 'Failed to open this link because it is not well-formed: {0}', link.url.toString())); - } - else if (messageOrError === 'missing') { - this.notificationService.warn(_nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('missing.url', 'Failed to open this link because its target is missing.')); - } - else { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_4__["onUnexpectedError"])(err); - } - }); - } - getLinkOccurrence(position) { - if (!this.editor.hasModel() || !position) { - return null; - } - const decorations = this.editor.getModel().getDecorationsInRange({ - startLineNumber: position.lineNumber, - startColumn: position.column, - endLineNumber: position.lineNumber, - endColumn: position.column - }, 0, true); - for (const decoration of decorations) { - const currentOccurrence = this.currentOccurrences[decoration.id]; - if (currentOccurrence) { - return currentOccurrence; - } - } - return null; - } - isEnabled(mouseEvent, withKey) { - return Boolean((mouseEvent.target.type === 6 /* CONTENT_TEXT */) - && (mouseEvent.hasTriggerModifier || (withKey && withKey.keyCodeIsTriggerKey))); - } - stop() { - this.timeout.cancel(); - if (this.activeLinksList) { - this.activeLinksList.dispose(); - } - if (this.computePromise) { - this.computePromise.cancel(); - this.computePromise = null; - } - } - dispose() { - this.listenersToRemove.dispose(); - this.stop(); - this.timeout.dispose(); - } -}; -LinkDetector.ID = 'editor.linkDetector'; -LinkDetector.RECOMPUTE_TIME = 1000; // ms -LinkDetector = __decorate([ - __param(1, _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_14__["IOpenerService"]), - __param(2, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_13__["INotificationService"]) -], LinkDetector); - -class OpenLinkAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_8__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.openLink', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('label', "Open Link"), - alias: 'Open Link', - precondition: undefined - }); - } - run(accessor, editor) { - let linkDetector = LinkDetector.get(editor); - if (!linkDetector) { - return; - } - if (!editor.hasModel()) { - return; - } - let selections = editor.getSelections(); - for (let sel of selections) { - let link = linkDetector.getLinkOccurrence(sel.getEndPosition()); - if (link) { - linkDetector.openLinkOccurrence(link, false); - } - } - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_8__["registerEditorContribution"])(LinkDetector.ID, LinkDetector); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_8__["registerEditorAction"])(OpenLinkAction); -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_16__["registerThemingParticipant"])((theme, collector) => { - const activeLinkForeground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["editorActiveLinkForeground"]); - if (activeLinkForeground) { - collector.addRule(`.monaco-editor .detected-link-active { color: ${activeLinkForeground} !important; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/markdown/markdownRenderer.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/markdown/markdownRenderer.js ***! - \***************************************************************************************/ -/*! exports provided: MarkdownRenderer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkdownRenderer", function() { return MarkdownRenderer; }); -/* harmony import */ var _base_browser_markdownRenderer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/markdownRenderer.js */ "./node_modules/monaco-editor/esm/vs/base/browser/markdownRenderer.js"); -/* harmony import */ var _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../platform/opener/common/opener.js */ "./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js"); -/* harmony import */ var _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/services/modeService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modeService.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _common_modes_textToHtmlTokenizer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/modes/textToHtmlTokenizer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/textToHtmlTokenizer.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - -let MarkdownRenderer = class MarkdownRenderer extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["Disposable"] { - constructor(_editor, _modeService, _openerService = _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_1__["NullOpenerService"]) { - super(); - this._editor = _editor; - this._modeService = _modeService; - this._openerService = _openerService; - this._onDidRenderCodeBlock = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__["Emitter"]()); - this.onDidRenderCodeBlock = this._onDidRenderCodeBlock.event; - } - getOptions(disposeables) { - return { - codeBlockRenderer: (languageAlias, value) => { - // In markdown, - // it is possible that we stumble upon language aliases (e.g.js instead of javascript) - // it is possible no alias is given in which case we fall back to the current editor lang - let modeId = null; - if (languageAlias) { - modeId = this._modeService.getModeIdForLanguageName(languageAlias); - } - else { - const model = this._editor.getModel(); - if (model) { - modeId = model.getLanguageIdentifier().language; - } - } - this._modeService.triggerMode(modeId || ''); - return Promise.resolve(true).then(_ => { - const promise = _common_modes_js__WEBPACK_IMPORTED_MODULE_8__["TokenizationRegistry"].getPromise(modeId || ''); - if (promise) { - return promise.then(support => Object(_common_modes_textToHtmlTokenizer_js__WEBPACK_IMPORTED_MODULE_4__["tokenizeToString"])(value, support)); - } - return Object(_common_modes_textToHtmlTokenizer_js__WEBPACK_IMPORTED_MODULE_4__["tokenizeToString"])(value, undefined); - }).then(code => { - return `${code}`; - }); - }, - codeBlockRenderCallback: () => this._onDidRenderCodeBlock.fire(), - actionHandler: { - callback: (content) => { - this._openerService.open(content, { fromUserGesture: true }).catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_3__["onUnexpectedError"]); - }, - disposeables - } - }; - } - render(markdown) { - const disposeables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["DisposableStore"](); - let element; - if (!markdown) { - element = document.createElement('span'); - } - else { - element = Object(_base_browser_markdownRenderer_js__WEBPACK_IMPORTED_MODULE_0__["renderMarkdown"])(markdown, this.getOptions(disposeables)); - } - return { - element, - dispose: () => disposeables.dispose() - }; - } -}; -MarkdownRenderer = __decorate([ - __param(1, _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_2__["IModeService"]), - __param(2, Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_5__["optional"])(_platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_1__["IOpenerService"])) -], MarkdownRenderer); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/message/messageController.css": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/message/messageController.css ***! - \****************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_messageController_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./messageController.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/message/messageController.css"); -/* harmony import */ var _css_loader_dist_cjs_js_messageController_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_messageController_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_messageController_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_messageController_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/message/messageController.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/message/messageController.js ***! - \***************************************************************************************/ -/*! exports provided: MessageController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MessageController", function() { return MessageController; }); -/* harmony import */ var _messageController_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./messageController.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/message/messageController.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/browser/ui/aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - -let MessageController = class MessageController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(editor, contextKeyService) { - super(); - this._messageWidget = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["MutableDisposable"]()); - this._messageListeners = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"]()); - this._editor = editor; - this._visible = MessageController.MESSAGE_VISIBLE.bindTo(contextKeyService); - this._register(this._editor.onDidAttemptReadOnlyEdit(() => this._onDidAttemptReadOnlyEdit())); - } - static get(editor) { - return editor.getContribution(MessageController.ID); - } - dispose() { - super.dispose(); - this._visible.reset(); - } - showMessage(message, position) { - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_4__["alert"])(message); - this._visible.set(true); - this._messageWidget.clear(); - this._messageListeners.clear(); - this._messageWidget.value = new MessageWidget(this._editor, position, message); - // close on blur, cursor, model change, dispose - this._messageListeners.add(this._editor.onDidBlurEditorText(() => this.closeMessage())); - this._messageListeners.add(this._editor.onDidChangeCursorPosition(() => this.closeMessage())); - this._messageListeners.add(this._editor.onDidDispose(() => this.closeMessage())); - this._messageListeners.add(this._editor.onDidChangeModel(() => this.closeMessage())); - // 3sec - this._messageListeners.add(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["TimeoutTimer"](() => this.closeMessage(), 3000)); - // close on mouse move - let bounds; - this._messageListeners.add(this._editor.onMouseMove(e => { - // outside the text area - if (!e.target.position) { - return; - } - if (!bounds) { - // define bounding box around position and first mouse occurance - bounds = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](position.lineNumber - 3, 1, e.target.position.lineNumber + 3, 1); - } - else if (!bounds.containsPosition(e.target.position)) { - // check if position is still in bounds - this.closeMessage(); - } - })); - } - closeMessage() { - this._visible.reset(); - this._messageListeners.clear(); - if (this._messageWidget.value) { - this._messageListeners.add(MessageWidget.fadeOut(this._messageWidget.value)); - } - } - _onDidAttemptReadOnlyEdit() { - if (this._editor.hasModel()) { - this.showMessage(_nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('editor.readonly', "Cannot edit in read-only editor"), this._editor.getPosition()); - } - } -}; -MessageController.ID = 'editor.contrib.messageController'; -MessageController.MESSAGE_VISIBLE = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_7__["RawContextKey"]('messageVisible', false); -MessageController = __decorate([ - __param(1, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_7__["IContextKeyService"]) -], MessageController); - -const MessageCommand = _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["EditorCommand"].bindToContribution(MessageController.get); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new MessageCommand({ - id: 'leaveEditorMessage', - precondition: MessageController.MESSAGE_VISIBLE, - handler: c => c.closeMessage(), - kbOpts: { - weight: 100 /* EditorContrib */ + 30, - primary: 9 /* Escape */ - } -})); -class MessageWidget { - constructor(editor, { lineNumber, column }, text) { - // Editor.IContentWidget.allowEditorOverflow - this.allowEditorOverflow = true; - this.suppressMouseDown = false; - this._editor = editor; - this._editor.revealLinesInCenterIfOutsideViewport(lineNumber, lineNumber, 0 /* Smooth */); - this._position = { lineNumber, column: column - 1 }; - this._domNode = document.createElement('div'); - this._domNode.classList.add('monaco-editor-overlaymessage'); - const message = document.createElement('div'); - message.classList.add('message'); - message.textContent = text; - this._domNode.appendChild(message); - const anchor = document.createElement('div'); - anchor.classList.add('anchor'); - this._domNode.appendChild(anchor); - this._editor.addContentWidget(this); - this._domNode.classList.add('fadeIn'); - } - static fadeOut(messageWidget) { - let handle; - const dispose = () => { - messageWidget.dispose(); - clearTimeout(handle); - messageWidget.getDomNode().removeEventListener('animationend', dispose); - }; - handle = setTimeout(dispose, 110); - messageWidget.getDomNode().addEventListener('animationend', dispose); - messageWidget.getDomNode().classList.add('fadeOut'); - return { dispose }; - } - dispose() { - this._editor.removeContentWidget(this); - } - getId() { - return 'messageoverlay'; - } - getDomNode() { - return this._domNode; - } - getPosition() { - return { position: this._position, preference: [1 /* ABOVE */, 2 /* BELOW */] }; - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorContribution"])(MessageController.ID, MessageController); -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_8__["registerThemingParticipant"])((theme, collector) => { - const border = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__["inputValidationInfoBorder"]); - if (border) { - let borderWidth = theme.type === _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_8__["HIGH_CONTRAST"] ? 2 : 1; - collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor { border-top-color: ${border}; }`); - collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { border: ${borderWidth}px solid ${border}; }`); - } - const background = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__["inputValidationInfoBackground"]); - if (background) { - collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${background}; }`); - } - const foreground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__["inputValidationInfoForeground"]); - if (foreground) { - collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { color: ${foreground}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/multicursor/multicursor.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/multicursor/multicursor.js ***! - \*************************************************************************************/ -/*! exports provided: InsertCursorAbove, InsertCursorBelow, MultiCursorSessionResult, MultiCursorSession, MultiCursorSelectionController, MultiCursorSelectionControllerAction, AddSelectionToNextFindMatchAction, AddSelectionToPreviousFindMatchAction, MoveSelectionToNextFindMatchAction, MoveSelectionToPreviousFindMatchAction, SelectHighlightsAction, CompatChangeAll, SelectionHighlighter */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertCursorAbove", function() { return InsertCursorAbove; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertCursorBelow", function() { return InsertCursorBelow; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiCursorSessionResult", function() { return MultiCursorSessionResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiCursorSession", function() { return MultiCursorSession; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiCursorSelectionController", function() { return MultiCursorSelectionController; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiCursorSelectionControllerAction", function() { return MultiCursorSelectionControllerAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AddSelectionToNextFindMatchAction", function() { return AddSelectionToNextFindMatchAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AddSelectionToPreviousFindMatchAction", function() { return AddSelectionToPreviousFindMatchAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MoveSelectionToNextFindMatchAction", function() { return MoveSelectionToNextFindMatchAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MoveSelectionToPreviousFindMatchAction", function() { return MoveSelectionToPreviousFindMatchAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectHighlightsAction", function() { return SelectHighlightsAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompatChangeAll", function() { return CompatChangeAll; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionHighlighter", function() { return SelectionHighlighter; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/controller/cursorMoveCommands.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorMoveCommands.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _common_model_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _find_findController_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../find/findController.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findController.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - -class InsertCursorAbove extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.insertCursorAbove', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('mutlicursor.insertAbove', "Add Cursor Above"), - alias: 'Add Cursor Above', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 16 /* UpArrow */, - linux: { - primary: 1024 /* Shift */ | 512 /* Alt */ | 16 /* UpArrow */, - secondary: [2048 /* CtrlCmd */ | 1024 /* Shift */ | 16 /* UpArrow */] - }, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_13__["MenuId"].MenubarSelectionMenu, - group: '3_multi', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miInsertCursorAbove', comment: ['&& denotes a mnemonic'] }, "&&Add Cursor Above"), - order: 2 - } - }); - } - run(accessor, editor, args) { - if (!editor.hasModel()) { - return; - } - const useLogicalLine = (args && args.logicalLine === true); - const viewModel = editor._getViewModel(); - if (viewModel.cursorConfig.readOnly) { - return; - } - viewModel.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_5__["CursorMoveCommands"].addCursorUp(viewModel, viewModel.getCursorStates(), useLogicalLine)); - viewModel.revealTopMostCursor(args.source); - } -} -class InsertCursorBelow extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.insertCursorBelow', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('mutlicursor.insertBelow', "Add Cursor Below"), - alias: 'Add Cursor Below', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 18 /* DownArrow */, - linux: { - primary: 1024 /* Shift */ | 512 /* Alt */ | 18 /* DownArrow */, - secondary: [2048 /* CtrlCmd */ | 1024 /* Shift */ | 18 /* DownArrow */] - }, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_13__["MenuId"].MenubarSelectionMenu, - group: '3_multi', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miInsertCursorBelow', comment: ['&& denotes a mnemonic'] }, "A&&dd Cursor Below"), - order: 3 - } - }); - } - run(accessor, editor, args) { - if (!editor.hasModel()) { - return; - } - const useLogicalLine = (args && args.logicalLine === true); - const viewModel = editor._getViewModel(); - if (viewModel.cursorConfig.readOnly) { - return; - } - viewModel.pushStackElement(); - viewModel.setCursorStates(args.source, 3 /* Explicit */, _common_controller_cursorMoveCommands_js__WEBPACK_IMPORTED_MODULE_5__["CursorMoveCommands"].addCursorDown(viewModel, viewModel.getCursorStates(), useLogicalLine)); - viewModel.revealBottomMostCursor(args.source); - } -} -class InsertCursorAtEndOfEachLineSelected extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.insertCursorAtEndOfEachLineSelected', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('mutlicursor.insertAtEndOfEachLineSelected', "Add Cursors to Line Ends"), - alias: 'Add Cursors to Line Ends', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].editorTextFocus, - primary: 1024 /* Shift */ | 512 /* Alt */ | 39 /* KEY_I */, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_13__["MenuId"].MenubarSelectionMenu, - group: '3_multi', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miInsertCursorAtEndOfEachLineSelected', comment: ['&& denotes a mnemonic'] }, "Add C&&ursors to Line Ends"), - order: 4 - } - }); - } - getCursorsForSelection(selection, model, result) { - if (selection.isEmpty()) { - return; - } - for (let i = selection.startLineNumber; i < selection.endLineNumber; i++) { - let currentLineMaxColumn = model.getLineMaxColumn(i); - result.push(new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](i, currentLineMaxColumn, i, currentLineMaxColumn)); - } - if (selection.endColumn > 1) { - result.push(new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](selection.endLineNumber, selection.endColumn, selection.endLineNumber, selection.endColumn)); - } - } - run(accessor, editor) { - if (!editor.hasModel()) { - return; - } - const model = editor.getModel(); - const selections = editor.getSelections(); - let newSelections = []; - selections.forEach((sel) => this.getCursorsForSelection(sel, model, newSelections)); - if (newSelections.length > 0) { - editor.setSelections(newSelections); - } - } -} -class InsertCursorAtEndOfLineSelected extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.addCursorsToBottom', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('mutlicursor.addCursorsToBottom', "Add Cursors To Bottom"), - alias: 'Add Cursors To Bottom', - precondition: undefined - }); - } - run(accessor, editor) { - if (!editor.hasModel()) { - return; - } - const selections = editor.getSelections(); - const lineCount = editor.getModel().getLineCount(); - let newSelections = []; - for (let i = selections[0].startLineNumber; i <= lineCount; i++) { - newSelections.push(new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](i, selections[0].startColumn, i, selections[0].endColumn)); - } - if (newSelections.length > 0) { - editor.setSelections(newSelections); - } - } -} -class InsertCursorAtTopOfLineSelected extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.addCursorsToTop', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('mutlicursor.addCursorsToTop', "Add Cursors To Top"), - alias: 'Add Cursors To Top', - precondition: undefined - }); - } - run(accessor, editor) { - if (!editor.hasModel()) { - return; - } - const selections = editor.getSelections(); - let newSelections = []; - for (let i = selections[0].startLineNumber; i >= 1; i--) { - newSelections.push(new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](i, selections[0].startColumn, i, selections[0].endColumn)); - } - if (newSelections.length > 0) { - editor.setSelections(newSelections); - } - } -} -class MultiCursorSessionResult { - constructor(selections, revealRange, revealScrollType) { - this.selections = selections; - this.revealRange = revealRange; - this.revealScrollType = revealScrollType; - } -} -class MultiCursorSession { - constructor(_editor, findController, isDisconnectedFromFindController, searchText, wholeWord, matchCase, currentMatch) { - this._editor = _editor; - this.findController = findController; - this.isDisconnectedFromFindController = isDisconnectedFromFindController; - this.searchText = searchText; - this.wholeWord = wholeWord; - this.matchCase = matchCase; - this.currentMatch = currentMatch; - } - static create(editor, findController) { - if (!editor.hasModel()) { - return null; - } - const findState = findController.getState(); - // Find widget owns entirely what we search for if: - // - focus is not in the editor (i.e. it is in the find widget) - // - and the search widget is visible - // - and the search string is non-empty - if (!editor.hasTextFocus() && findState.isRevealed && findState.searchString.length > 0) { - // Find widget owns what is searched for - return new MultiCursorSession(editor, findController, false, findState.searchString, findState.wholeWord, findState.matchCase, null); - } - // Otherwise, the selection gives the search text, and the find widget gives the search settings - // The exception is the find state disassociation case: when beginning with a single, collapsed selection - let isDisconnectedFromFindController = false; - let wholeWord; - let matchCase; - const selections = editor.getSelections(); - if (selections.length === 1 && selections[0].isEmpty()) { - isDisconnectedFromFindController = true; - wholeWord = true; - matchCase = true; - } - else { - wholeWord = findState.wholeWord; - matchCase = findState.matchCase; - } - // Selection owns what is searched for - const s = editor.getSelection(); - let searchText; - let currentMatch = null; - if (s.isEmpty()) { - // selection is empty => expand to current word - const word = editor.getConfiguredWordAtPosition(s.getStartPosition()); - if (!word) { - return null; - } - searchText = word.word; - currentMatch = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](s.startLineNumber, word.startColumn, s.startLineNumber, word.endColumn); - } - else { - searchText = editor.getModel().getValueInRange(s).replace(/\r\n/g, '\n'); - } - return new MultiCursorSession(editor, findController, isDisconnectedFromFindController, searchText, wholeWord, matchCase, currentMatch); - } - addSelectionToNextFindMatch() { - if (!this._editor.hasModel()) { - return null; - } - const nextMatch = this._getNextMatch(); - if (!nextMatch) { - return null; - } - const allSelections = this._editor.getSelections(); - return new MultiCursorSessionResult(allSelections.concat(nextMatch), nextMatch, 0 /* Smooth */); - } - moveSelectionToNextFindMatch() { - if (!this._editor.hasModel()) { - return null; - } - const nextMatch = this._getNextMatch(); - if (!nextMatch) { - return null; - } - const allSelections = this._editor.getSelections(); - return new MultiCursorSessionResult(allSelections.slice(0, allSelections.length - 1).concat(nextMatch), nextMatch, 0 /* Smooth */); - } - _getNextMatch() { - if (!this._editor.hasModel()) { - return null; - } - if (this.currentMatch) { - const result = this.currentMatch; - this.currentMatch = null; - return result; - } - this.findController.highlightFindOptions(); - const allSelections = this._editor.getSelections(); - const lastAddedSelection = allSelections[allSelections.length - 1]; - const nextMatch = this._editor.getModel().findNextMatch(this.searchText, lastAddedSelection.getEndPosition(), false, this.matchCase, this.wholeWord ? this._editor.getOption(105 /* wordSeparators */) : null, false); - if (!nextMatch) { - return null; - } - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](nextMatch.range.startLineNumber, nextMatch.range.startColumn, nextMatch.range.endLineNumber, nextMatch.range.endColumn); - } - addSelectionToPreviousFindMatch() { - if (!this._editor.hasModel()) { - return null; - } - const previousMatch = this._getPreviousMatch(); - if (!previousMatch) { - return null; - } - const allSelections = this._editor.getSelections(); - return new MultiCursorSessionResult(allSelections.concat(previousMatch), previousMatch, 0 /* Smooth */); - } - moveSelectionToPreviousFindMatch() { - if (!this._editor.hasModel()) { - return null; - } - const previousMatch = this._getPreviousMatch(); - if (!previousMatch) { - return null; - } - const allSelections = this._editor.getSelections(); - return new MultiCursorSessionResult(allSelections.slice(0, allSelections.length - 1).concat(previousMatch), previousMatch, 0 /* Smooth */); - } - _getPreviousMatch() { - if (!this._editor.hasModel()) { - return null; - } - if (this.currentMatch) { - const result = this.currentMatch; - this.currentMatch = null; - return result; - } - this.findController.highlightFindOptions(); - const allSelections = this._editor.getSelections(); - const lastAddedSelection = allSelections[allSelections.length - 1]; - const previousMatch = this._editor.getModel().findPreviousMatch(this.searchText, lastAddedSelection.getStartPosition(), false, this.matchCase, this.wholeWord ? this._editor.getOption(105 /* wordSeparators */) : null, false); - if (!previousMatch) { - return null; - } - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](previousMatch.range.startLineNumber, previousMatch.range.startColumn, previousMatch.range.endLineNumber, previousMatch.range.endColumn); - } - selectAll() { - if (!this._editor.hasModel()) { - return []; - } - this.findController.highlightFindOptions(); - return this._editor.getModel().findMatches(this.searchText, true, false, this.matchCase, this.wholeWord ? this._editor.getOption(105 /* wordSeparators */) : null, false, 1073741824 /* MAX_SAFE_SMALL_INTEGER */); - } -} -class MultiCursorSelectionController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(editor) { - super(); - this._sessionDispose = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"]()); - this._editor = editor; - this._ignoreSelectionChange = false; - this._session = null; - } - static get(editor) { - return editor.getContribution(MultiCursorSelectionController.ID); - } - dispose() { - this._endSession(); - super.dispose(); - } - _beginSessionIfNeeded(findController) { - if (!this._session) { - // Create a new session - const session = MultiCursorSession.create(this._editor, findController); - if (!session) { - return; - } - this._session = session; - const newState = { searchString: this._session.searchText }; - if (this._session.isDisconnectedFromFindController) { - newState.wholeWordOverride = 1 /* True */; - newState.matchCaseOverride = 1 /* True */; - newState.isRegexOverride = 2 /* False */; - } - findController.getState().change(newState, false); - this._sessionDispose.add(this._editor.onDidChangeCursorSelection((e) => { - if (this._ignoreSelectionChange) { - return; - } - this._endSession(); - })); - this._sessionDispose.add(this._editor.onDidBlurEditorText(() => { - this._endSession(); - })); - this._sessionDispose.add(findController.getState().onFindReplaceStateChange((e) => { - if (e.matchCase || e.wholeWord) { - this._endSession(); - } - })); - } - } - _endSession() { - this._sessionDispose.clear(); - if (this._session && this._session.isDisconnectedFromFindController) { - const newState = { - wholeWordOverride: 0 /* NotSet */, - matchCaseOverride: 0 /* NotSet */, - isRegexOverride: 0 /* NotSet */, - }; - this._session.findController.getState().change(newState, false); - } - this._session = null; - } - _setSelections(selections) { - this._ignoreSelectionChange = true; - this._editor.setSelections(selections); - this._ignoreSelectionChange = false; - } - _expandEmptyToWord(model, selection) { - if (!selection.isEmpty()) { - return selection; - } - const word = this._editor.getConfiguredWordAtPosition(selection.getStartPosition()); - if (!word) { - return selection; - } - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](selection.startLineNumber, word.startColumn, selection.startLineNumber, word.endColumn); - } - _applySessionResult(result) { - if (!result) { - return; - } - this._setSelections(result.selections); - if (result.revealRange) { - this._editor.revealRangeInCenterIfOutsideViewport(result.revealRange, result.revealScrollType); - } - } - getSession(findController) { - return this._session; - } - addSelectionToNextFindMatch(findController) { - if (!this._editor.hasModel()) { - return; - } - if (!this._session) { - // If there are multiple cursors, handle the case where they do not all select the same text. - const allSelections = this._editor.getSelections(); - if (allSelections.length > 1) { - const findState = findController.getState(); - const matchCase = findState.matchCase; - const selectionsContainSameText = modelRangesContainSameText(this._editor.getModel(), allSelections, matchCase); - if (!selectionsContainSameText) { - const model = this._editor.getModel(); - let resultingSelections = []; - for (let i = 0, len = allSelections.length; i < len; i++) { - resultingSelections[i] = this._expandEmptyToWord(model, allSelections[i]); - } - this._editor.setSelections(resultingSelections); - return; - } - } - } - this._beginSessionIfNeeded(findController); - if (this._session) { - this._applySessionResult(this._session.addSelectionToNextFindMatch()); - } - } - addSelectionToPreviousFindMatch(findController) { - this._beginSessionIfNeeded(findController); - if (this._session) { - this._applySessionResult(this._session.addSelectionToPreviousFindMatch()); - } - } - moveSelectionToNextFindMatch(findController) { - this._beginSessionIfNeeded(findController); - if (this._session) { - this._applySessionResult(this._session.moveSelectionToNextFindMatch()); - } - } - moveSelectionToPreviousFindMatch(findController) { - this._beginSessionIfNeeded(findController); - if (this._session) { - this._applySessionResult(this._session.moveSelectionToPreviousFindMatch()); - } - } - selectAll(findController) { - if (!this._editor.hasModel()) { - return; - } - let matches = null; - const findState = findController.getState(); - // Special case: find widget owns entirely what we search for if: - // - focus is not in the editor (i.e. it is in the find widget) - // - and the search widget is visible - // - and the search string is non-empty - // - and we're searching for a regex - if (findState.isRevealed && findState.searchString.length > 0 && findState.isRegex) { - matches = this._editor.getModel().findMatches(findState.searchString, true, findState.isRegex, findState.matchCase, findState.wholeWord ? this._editor.getOption(105 /* wordSeparators */) : null, false, 1073741824 /* MAX_SAFE_SMALL_INTEGER */); - } - else { - this._beginSessionIfNeeded(findController); - if (!this._session) { - return; - } - matches = this._session.selectAll(); - } - if (findState.searchScope) { - const states = findState.searchScope; - let inSelection = []; - matches.forEach((match) => { - states.forEach((state) => { - if (match.range.endLineNumber <= state.endLineNumber && match.range.startLineNumber >= state.startLineNumber) { - inSelection.push(match); - } - }); - }); - matches = inSelection; - } - if (matches.length > 0) { - const editorSelection = this._editor.getSelection(); - // Have the primary cursor remain the one where the action was invoked - for (let i = 0, len = matches.length; i < len; i++) { - const match = matches[i]; - const intersection = match.range.intersectRanges(editorSelection); - if (intersection) { - // bingo! - matches[i] = matches[0]; - matches[0] = match; - break; - } - } - this._setSelections(matches.map(m => new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](m.range.startLineNumber, m.range.startColumn, m.range.endLineNumber, m.range.endColumn))); - } - } -} -MultiCursorSelectionController.ID = 'editor.contrib.multiCursorController'; -class MultiCursorSelectionControllerAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - run(accessor, editor) { - const multiCursorController = MultiCursorSelectionController.get(editor); - if (!multiCursorController) { - return; - } - const findController = _find_findController_js__WEBPACK_IMPORTED_MODULE_12__["CommonFindController"].get(editor); - if (!findController) { - return; - } - this._run(multiCursorController, findController); - } -} -class AddSelectionToNextFindMatchAction extends MultiCursorSelectionControllerAction { - constructor() { - super({ - id: 'editor.action.addSelectionToNextFindMatch', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('addSelectionToNextFindMatch', "Add Selection To Next Find Match"), - alias: 'Add Selection To Next Find Match', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].focus, - primary: 2048 /* CtrlCmd */ | 34 /* KEY_D */, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_13__["MenuId"].MenubarSelectionMenu, - group: '3_multi', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miAddSelectionToNextFindMatch', comment: ['&& denotes a mnemonic'] }, "Add &&Next Occurrence"), - order: 5 - } - }); - } - _run(multiCursorController, findController) { - multiCursorController.addSelectionToNextFindMatch(findController); - } -} -class AddSelectionToPreviousFindMatchAction extends MultiCursorSelectionControllerAction { - constructor() { - super({ - id: 'editor.action.addSelectionToPreviousFindMatch', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('addSelectionToPreviousFindMatch', "Add Selection To Previous Find Match"), - alias: 'Add Selection To Previous Find Match', - precondition: undefined, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_13__["MenuId"].MenubarSelectionMenu, - group: '3_multi', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miAddSelectionToPreviousFindMatch', comment: ['&& denotes a mnemonic'] }, "Add P&&revious Occurrence"), - order: 6 - } - }); - } - _run(multiCursorController, findController) { - multiCursorController.addSelectionToPreviousFindMatch(findController); - } -} -class MoveSelectionToNextFindMatchAction extends MultiCursorSelectionControllerAction { - constructor() { - super({ - id: 'editor.action.moveSelectionToNextFindMatch', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('moveSelectionToNextFindMatch', "Move Last Selection To Next Find Match"), - alias: 'Move Last Selection To Next Find Match', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].focus, - primary: Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__["KeyChord"])(2048 /* CtrlCmd */ | 41 /* KEY_K */, 2048 /* CtrlCmd */ | 34 /* KEY_D */), - weight: 100 /* EditorContrib */ - } - }); - } - _run(multiCursorController, findController) { - multiCursorController.moveSelectionToNextFindMatch(findController); - } -} -class MoveSelectionToPreviousFindMatchAction extends MultiCursorSelectionControllerAction { - constructor() { - super({ - id: 'editor.action.moveSelectionToPreviousFindMatch', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('moveSelectionToPreviousFindMatch', "Move Last Selection To Previous Find Match"), - alias: 'Move Last Selection To Previous Find Match', - precondition: undefined - }); - } - _run(multiCursorController, findController) { - multiCursorController.moveSelectionToPreviousFindMatch(findController); - } -} -class SelectHighlightsAction extends MultiCursorSelectionControllerAction { - constructor() { - super({ - id: 'editor.action.selectHighlights', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('selectAllOccurrencesOfFindMatch', "Select All Occurrences of Find Match"), - alias: 'Select All Occurrences of Find Match', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].focus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 42 /* KEY_L */, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_13__["MenuId"].MenubarSelectionMenu, - group: '3_multi', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'miSelectHighlights', comment: ['&& denotes a mnemonic'] }, "Select All &&Occurrences"), - order: 7 - } - }); - } - _run(multiCursorController, findController) { - multiCursorController.selectAll(findController); - } -} -class CompatChangeAll extends MultiCursorSelectionControllerAction { - constructor() { - super({ - id: 'editor.action.changeAll', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('changeAll.label', "Change All Occurrences"), - alias: 'Change All Occurrences', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_16__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].editorTextFocus), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 60 /* F2 */, - weight: 100 /* EditorContrib */ - }, - contextMenuOpts: { - group: '1_modification', - order: 1.2 - } - }); - } - _run(multiCursorController, findController) { - multiCursorController.selectAll(findController); - } -} -class SelectionHighlighterState { - constructor(searchText, matchCase, wordSeparators, modelVersionId) { - this.searchText = searchText; - this.matchCase = matchCase; - this.wordSeparators = wordSeparators; - this.modelVersionId = modelVersionId; - } - /** - * Everything equals except for `lastWordUnderCursor` - */ - static softEquals(a, b) { - if (!a && !b) { - return true; - } - if (!a || !b) { - return false; - } - return (a.searchText === b.searchText - && a.matchCase === b.matchCase - && a.wordSeparators === b.wordSeparators - && a.modelVersionId === b.modelVersionId); - } -} -class SelectionHighlighter extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(editor) { - super(); - this.editor = editor; - this._isEnabled = editor.getOption(89 /* selectionHighlight */); - this.decorations = []; - this.updateSoon = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_1__["RunOnceScheduler"](() => this._update(), 300)); - this.state = null; - this._register(editor.onDidChangeConfiguration((e) => { - this._isEnabled = editor.getOption(89 /* selectionHighlight */); - })); - this._register(editor.onDidChangeCursorSelection((e) => { - if (!this._isEnabled) { - // Early exit if nothing needs to be done! - // Leave some form of early exit check here if you wish to continue being a cursor position change listener ;) - return; - } - if (e.selection.isEmpty()) { - if (e.reason === 3 /* Explicit */) { - if (this.state) { - // no longer valid - this._setState(null); - } - this.updateSoon.schedule(); - } - else { - this._setState(null); - } - } - else { - this._update(); - } - })); - this._register(editor.onDidChangeModel((e) => { - this._setState(null); - })); - this._register(editor.onDidChangeModelContent((e) => { - if (this._isEnabled) { - this.updateSoon.schedule(); - } - })); - this._register(_find_findController_js__WEBPACK_IMPORTED_MODULE_12__["CommonFindController"].get(editor).getState().onFindReplaceStateChange((e) => { - this._update(); - })); - } - _update() { - this._setState(SelectionHighlighter._createState(this._isEnabled, this.editor)); - } - static _createState(isEnabled, editor) { - if (!isEnabled) { - return null; - } - if (!editor.hasModel()) { - return null; - } - const s = editor.getSelection(); - if (s.startLineNumber !== s.endLineNumber) { - // multiline forbidden for perf reasons - return null; - } - const multiCursorController = MultiCursorSelectionController.get(editor); - if (!multiCursorController) { - return null; - } - const findController = _find_findController_js__WEBPACK_IMPORTED_MODULE_12__["CommonFindController"].get(editor); - if (!findController) { - return null; - } - let r = multiCursorController.getSession(findController); - if (!r) { - const allSelections = editor.getSelections(); - if (allSelections.length > 1) { - const findState = findController.getState(); - const matchCase = findState.matchCase; - const selectionsContainSameText = modelRangesContainSameText(editor.getModel(), allSelections, matchCase); - if (!selectionsContainSameText) { - return null; - } - } - r = MultiCursorSession.create(editor, findController); - } - if (!r) { - return null; - } - if (r.currentMatch) { - // This is an empty selection - // Do not interfere with semantic word highlighting in the no selection case - return null; - } - if (/^[ \t]+$/.test(r.searchText)) { - // whitespace only selection - return null; - } - if (r.searchText.length > 200) { - // very long selection - return null; - } - // TODO: better handling of this case - const findState = findController.getState(); - const caseSensitive = findState.matchCase; - // Return early if the find widget shows the exact same matches - if (findState.isRevealed) { - let findStateSearchString = findState.searchString; - if (!caseSensitive) { - findStateSearchString = findStateSearchString.toLowerCase(); - } - let mySearchString = r.searchText; - if (!caseSensitive) { - mySearchString = mySearchString.toLowerCase(); - } - if (findStateSearchString === mySearchString && r.matchCase === findState.matchCase && r.wholeWord === findState.wholeWord && !findState.isRegex) { - return null; - } - } - return new SelectionHighlighterState(r.searchText, r.matchCase, r.wholeWord ? editor.getOption(105 /* wordSeparators */) : null, editor.getModel().getVersionId()); - } - _setState(state) { - if (SelectionHighlighterState.softEquals(this.state, state)) { - this.state = state; - return; - } - this.state = state; - if (!this.state) { - this.decorations = this.editor.deltaDecorations(this.decorations, []); - return; - } - if (!this.editor.hasModel()) { - return; - } - const model = this.editor.getModel(); - if (model.isTooLargeForTokenization()) { - // the file is too large, so searching word under cursor in the whole document takes is blocking the UI. - return; - } - const hasFindOccurrences = _common_modes_js__WEBPACK_IMPORTED_MODULE_11__["DocumentHighlightProviderRegistry"].has(model) && this.editor.getOption(63 /* occurrencesHighlight */); - let allMatches = model.findMatches(this.state.searchText, true, false, this.state.matchCase, this.state.wordSeparators, false).map(m => m.range); - allMatches.sort(_common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts); - let selections = this.editor.getSelections(); - selections.sort(_common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts); - // do not overlap with selection (issue #64 and #512) - let matches = []; - for (let i = 0, j = 0, len = allMatches.length, lenJ = selections.length; i < len;) { - const match = allMatches[i]; - if (j >= lenJ) { - // finished all editor selections - matches.push(match); - i++; - } - else { - const cmp = _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts(match, selections[j]); - if (cmp < 0) { - // match is before sel - if (selections[j].isEmpty() || !_common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].areIntersecting(match, selections[j])) { - matches.push(match); - } - i++; - } - else if (cmp > 0) { - // sel is before match - j++; - } - else { - // sel is equal to match - i++; - j++; - } - } - } - const decorations = matches.map(r => { - return { - range: r, - // Show in overviewRuler only if model has no semantic highlighting - options: (hasFindOccurrences ? SelectionHighlighter._SELECTION_HIGHLIGHT : SelectionHighlighter._SELECTION_HIGHLIGHT_OVERVIEW) - }; - }); - this.decorations = this.editor.deltaDecorations(this.decorations, decorations); - } - dispose() { - this._setState(null); - super.dispose(); - } -} -SelectionHighlighter.ID = 'editor.contrib.selectionHighlighter'; -SelectionHighlighter._SELECTION_HIGHLIGHT_OVERVIEW = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - className: 'selectionHighlight', - overviewRuler: { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_15__["themeColorFromId"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_14__["overviewRulerSelectionHighlightForeground"]), - position: _common_model_js__WEBPACK_IMPORTED_MODULE_9__["OverviewRulerLane"].Center - } -}); -SelectionHighlighter._SELECTION_HIGHLIGHT = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - className: 'selectionHighlight', -}); -function modelRangesContainSameText(model, ranges, matchCase) { - const selectedText = getValueInRange(model, ranges[0], !matchCase); - for (let i = 1, len = ranges.length; i < len; i++) { - const range = ranges[i]; - if (range.isEmpty()) { - return false; - } - const thisSelectedText = getValueInRange(model, range, !matchCase); - if (selectedText !== thisSelectedText) { - return false; - } - } - return true; -} -function getValueInRange(model, range, toLowerCase) { - const text = model.getValueInRange(range); - return (toLowerCase ? text.toLowerCase() : text); -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorContribution"])(MultiCursorSelectionController.ID, MultiCursorSelectionController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorContribution"])(SelectionHighlighter.ID, SelectionHighlighter); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(InsertCursorAbove); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(InsertCursorBelow); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(InsertCursorAtEndOfEachLineSelected); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(AddSelectionToNextFindMatchAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(AddSelectionToPreviousFindMatchAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(MoveSelectionToNextFindMatchAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(MoveSelectionToPreviousFindMatchAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(SelectHighlightsAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(CompatChangeAll); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(InsertCursorAtEndOfLineSelected); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(InsertCursorAtTopOfLineSelected); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHints.css": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHints.css ***! - \********************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_parameterHints_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./parameterHints.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHints.css"); -/* harmony import */ var _css_loader_dist_cjs_js_parameterHints_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_parameterHints_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_parameterHints_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_parameterHints_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHints.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHints.js ***! - \*******************************************************************************************/ -/*! exports provided: TriggerParameterHintsAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TriggerParameterHintsAction", function() { return TriggerParameterHintsAction; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _parameterHintsWidget_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parameterHintsWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHintsWidget.js"); -/* harmony import */ var _provideSignatureHelp_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./provideSignatureHelp.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/provideSignatureHelp.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - -let ParameterHintsController = class ParameterHintsController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(editor, instantiationService) { - super(); - this.editor = editor; - this.widget = this._register(instantiationService.createInstance(_parameterHintsWidget_js__WEBPACK_IMPORTED_MODULE_6__["ParameterHintsWidget"], this.editor)); - } - static get(editor) { - return editor.getContribution(ParameterHintsController.ID); - } - cancel() { - this.widget.cancel(); - } - previous() { - this.widget.previous(); - } - next() { - this.widget.next(); - } - trigger(context) { - this.widget.trigger(context); - } -}; -ParameterHintsController.ID = 'editor.controller.parameterHints'; -ParameterHintsController = __decorate([ - __param(1, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_2__["IInstantiationService"]) -], ParameterHintsController); -class TriggerParameterHintsAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.triggerParameterHints', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('parameterHints.trigger.label', "Trigger Parameter Hints"), - alias: 'Trigger Parameter Hints', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].hasSignatureHelpProvider, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 10 /* Space */, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - const controller = ParameterHintsController.get(editor); - if (controller) { - controller.trigger({ - triggerKind: _common_modes_js__WEBPACK_IMPORTED_MODULE_8__["SignatureHelpTriggerKind"].Invoke - }); - } - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorContribution"])(ParameterHintsController.ID, ParameterHintsController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorAction"])(TriggerParameterHintsAction); -const weight = 100 /* EditorContrib */ + 75; -const ParameterHintsCommand = _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["EditorCommand"].bindToContribution(ParameterHintsController.get); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorCommand"])(new ParameterHintsCommand({ - id: 'closeParameterHints', - precondition: _provideSignatureHelp_js__WEBPACK_IMPORTED_MODULE_7__["Context"].Visible, - handler: x => x.cancel(), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].focus, - primary: 9 /* Escape */, - secondary: [1024 /* Shift */ | 9 /* Escape */] - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorCommand"])(new ParameterHintsCommand({ - id: 'showPrevParameterHint', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["ContextKeyExpr"].and(_provideSignatureHelp_js__WEBPACK_IMPORTED_MODULE_7__["Context"].Visible, _provideSignatureHelp_js__WEBPACK_IMPORTED_MODULE_7__["Context"].MultipleSignatures), - handler: x => x.previous(), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].focus, - primary: 16 /* UpArrow */, - secondary: [512 /* Alt */ | 16 /* UpArrow */], - mac: { primary: 16 /* UpArrow */, secondary: [512 /* Alt */ | 16 /* UpArrow */, 256 /* WinCtrl */ | 46 /* KEY_P */] } - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_5__["registerEditorCommand"])(new ParameterHintsCommand({ - id: 'showNextParameterHint', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["ContextKeyExpr"].and(_provideSignatureHelp_js__WEBPACK_IMPORTED_MODULE_7__["Context"].Visible, _provideSignatureHelp_js__WEBPACK_IMPORTED_MODULE_7__["Context"].MultipleSignatures), - handler: x => x.next(), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].focus, - primary: 18 /* DownArrow */, - secondary: [512 /* Alt */ | 18 /* DownArrow */], - mac: { primary: 18 /* DownArrow */, secondary: [512 /* Alt */ | 18 /* DownArrow */, 256 /* WinCtrl */ | 44 /* KEY_N */] } - } -})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHintsModel.js": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHintsModel.js ***! - \************************************************************************************************/ -/*! exports provided: ParameterHintsModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParameterHintsModel", function() { return ParameterHintsModel; }); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _provideSignatureHelp_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./provideSignatureHelp.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/provideSignatureHelp.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - -var ParameterHintState; -(function (ParameterHintState) { - ParameterHintState.Default = { type: 0 /* Default */ }; - class Pending { - constructor(request) { - this.request = request; - this.type = 2 /* Pending */; - } - } - ParameterHintState.Pending = Pending; - class Active { - constructor(hints) { - this.hints = hints; - this.type = 1 /* Active */; - } - } - ParameterHintState.Active = Active; -})(ParameterHintState || (ParameterHintState = {})); -class ParameterHintsModel extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(editor, delay = ParameterHintsModel.DEFAULT_DELAY) { - super(); - this._onChangedHints = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"]()); - this.onChangedHints = this._onChangedHints.event; - this.triggerOnType = false; - this._state = ParameterHintState.Default; - this._pendingTriggers = []; - this._lastSignatureHelpResult = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["MutableDisposable"]()); - this.triggerChars = new _common_core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_4__["CharacterSet"](); - this.retriggerChars = new _common_core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_4__["CharacterSet"](); - this.triggerId = 0; - this.editor = editor; - this.throttledDelayer = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["Delayer"](delay); - this._register(this.editor.onDidChangeConfiguration(() => this.onEditorConfigurationChange())); - this._register(this.editor.onDidChangeModel(e => this.onModelChanged())); - this._register(this.editor.onDidChangeModelLanguage(_ => this.onModelChanged())); - this._register(this.editor.onDidChangeCursorSelection(e => this.onCursorChange(e))); - this._register(this.editor.onDidChangeModelContent(e => this.onModelContentChange())); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_5__["SignatureHelpProviderRegistry"].onDidChange(this.onModelChanged, this)); - this._register(this.editor.onDidType(text => this.onDidType(text))); - this.onEditorConfigurationChange(); - this.onModelChanged(); - } - get state() { return this._state; } - set state(value) { - if (this._state.type === 2 /* Pending */) { - this._state.request.cancel(); - } - this._state = value; - } - cancel(silent = false) { - this.state = ParameterHintState.Default; - this.throttledDelayer.cancel(); - if (!silent) { - this._onChangedHints.fire(undefined); - } - } - trigger(context, delay) { - const model = this.editor.getModel(); - if (!model || !_common_modes_js__WEBPACK_IMPORTED_MODULE_5__["SignatureHelpProviderRegistry"].has(model)) { - return; - } - const triggerId = ++this.triggerId; - this._pendingTriggers.push(context); - this.throttledDelayer.trigger(() => { - return this.doTrigger(triggerId); - }, delay) - .catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"]); - } - next() { - if (this.state.type !== 1 /* Active */) { - return; - } - const length = this.state.hints.signatures.length; - const activeSignature = this.state.hints.activeSignature; - const last = (activeSignature % length) === (length - 1); - const cycle = this.editor.getOption(67 /* parameterHints */).cycle; - // If there is only one signature, or we're on last signature of list - if ((length < 2 || last) && !cycle) { - this.cancel(); - return; - } - this.updateActiveSignature(last && cycle ? 0 : activeSignature + 1); - } - previous() { - if (this.state.type !== 1 /* Active */) { - return; - } - const length = this.state.hints.signatures.length; - const activeSignature = this.state.hints.activeSignature; - const first = activeSignature === 0; - const cycle = this.editor.getOption(67 /* parameterHints */).cycle; - // If there is only one signature, or we're on first signature of list - if ((length < 2 || first) && !cycle) { - this.cancel(); - return; - } - this.updateActiveSignature(first && cycle ? length - 1 : activeSignature - 1); - } - updateActiveSignature(activeSignature) { - if (this.state.type !== 1 /* Active */) { - return; - } - this.state = new ParameterHintState.Active(Object.assign(Object.assign({}, this.state.hints), { activeSignature })); - this._onChangedHints.fire(this.state.hints); - } - doTrigger(triggerId) { - return __awaiter(this, void 0, void 0, function* () { - const isRetrigger = this.state.type === 1 /* Active */ || this.state.type === 2 /* Pending */; - const activeSignatureHelp = this.state.type === 1 /* Active */ ? this.state.hints : undefined; - this.cancel(true); - if (this._pendingTriggers.length === 0) { - return false; - } - const context = this._pendingTriggers.reduce(mergeTriggerContexts); - this._pendingTriggers = []; - const triggerContext = { - triggerKind: context.triggerKind, - triggerCharacter: context.triggerCharacter, - isRetrigger: isRetrigger, - activeSignatureHelp: activeSignatureHelp - }; - if (!this.editor.hasModel()) { - return false; - } - const model = this.editor.getModel(); - const position = this.editor.getPosition(); - this.state = new ParameterHintState.Pending(Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["createCancelablePromise"])(token => Object(_provideSignatureHelp_js__WEBPACK_IMPORTED_MODULE_6__["provideSignatureHelp"])(model, position, triggerContext, token))); - try { - const result = yield this.state.request; - // Check that we are still resolving the correct signature help - if (triggerId !== this.triggerId) { - result === null || result === void 0 ? void 0 : result.dispose(); - return false; - } - if (!result || !result.value.signatures || result.value.signatures.length === 0) { - result === null || result === void 0 ? void 0 : result.dispose(); - this._lastSignatureHelpResult.clear(); - this.cancel(); - return false; - } - else { - this.state = new ParameterHintState.Active(result.value); - this._lastSignatureHelpResult.value = result; - this._onChangedHints.fire(this.state.hints); - return true; - } - } - catch (error) { - if (triggerId === this.triggerId) { - this.state = ParameterHintState.Default; - } - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"])(error); - return false; - } - }); - } - get isTriggered() { - return this.state.type === 1 /* Active */ - || this.state.type === 2 /* Pending */ - || this.throttledDelayer.isTriggered(); - } - onModelChanged() { - this.cancel(); - // Update trigger characters - this.triggerChars = new _common_core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_4__["CharacterSet"](); - this.retriggerChars = new _common_core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_4__["CharacterSet"](); - const model = this.editor.getModel(); - if (!model) { - return; - } - for (const support of _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["SignatureHelpProviderRegistry"].ordered(model)) { - for (const ch of support.signatureHelpTriggerCharacters || []) { - this.triggerChars.add(ch.charCodeAt(0)); - // All trigger characters are also considered retrigger characters - this.retriggerChars.add(ch.charCodeAt(0)); - } - for (const ch of support.signatureHelpRetriggerCharacters || []) { - this.retriggerChars.add(ch.charCodeAt(0)); - } - } - } - onDidType(text) { - if (!this.triggerOnType) { - return; - } - const lastCharIndex = text.length - 1; - const triggerCharCode = text.charCodeAt(lastCharIndex); - if (this.triggerChars.has(triggerCharCode) || this.isTriggered && this.retriggerChars.has(triggerCharCode)) { - this.trigger({ - triggerKind: _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["SignatureHelpTriggerKind"].TriggerCharacter, - triggerCharacter: text.charAt(lastCharIndex), - }); - } - } - onCursorChange(e) { - if (e.source === 'mouse') { - this.cancel(); - } - else if (this.isTriggered) { - this.trigger({ triggerKind: _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["SignatureHelpTriggerKind"].ContentChange }); - } - } - onModelContentChange() { - if (this.isTriggered) { - this.trigger({ triggerKind: _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["SignatureHelpTriggerKind"].ContentChange }); - } - } - onEditorConfigurationChange() { - this.triggerOnType = this.editor.getOption(67 /* parameterHints */).enabled; - if (!this.triggerOnType) { - this.cancel(); - } - } - dispose() { - this.cancel(true); - super.dispose(); - } -} -ParameterHintsModel.DEFAULT_DELAY = 120; // ms -function mergeTriggerContexts(previous, current) { - switch (current.triggerKind) { - case _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["SignatureHelpTriggerKind"].Invoke: - // Invoke overrides previous triggers. - return current; - case _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["SignatureHelpTriggerKind"].ContentChange: - // Ignore content changes triggers - return previous; - case _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["SignatureHelpTriggerKind"].TriggerCharacter: - default: - return current; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHintsWidget.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHintsWidget.js ***! - \*************************************************************************************************/ -/*! exports provided: ParameterHintsWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParameterHintsWidget", function() { return ParameterHintsWidget; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/event.js */ "./node_modules/monaco-editor/esm/vs/base/browser/event.js"); -/* harmony import */ var _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/ui/aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/* harmony import */ var _base_browser_ui_scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/browser/ui/scrollbar/scrollableElement.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _parameterHints_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parameterHints.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHints.css"); -/* harmony import */ var _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/services/modeService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modeService.js"); -/* harmony import */ var _markdown_markdownRenderer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../markdown/markdownRenderer.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/markdown/markdownRenderer.js"); -/* harmony import */ var _provideSignatureHelp_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./provideSignatureHelp.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/provideSignatureHelp.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../platform/opener/common/opener.js */ "./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _parameterHintsModel_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./parameterHintsModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHintsModel.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - - - - -const $ = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["$"]; -const parameterHintsNextIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["registerIcon"])('parameter-hints-next', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["Codicon"].chevronDown); -const parameterHintsPreviousIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["registerIcon"])('parameter-hints-previous', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_17__["Codicon"].chevronUp); -let ParameterHintsWidget = class ParameterHintsWidget extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["Disposable"] { - constructor(editor, contextKeyService, openerService, modeService) { - super(); - this.editor = editor; - this.renderDisposeables = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["DisposableStore"]()); - this.visible = false; - this.announcedLabel = null; - // Editor.IContentWidget.allowEditorOverflow - this.allowEditorOverflow = true; - this.markdownRenderer = this._register(new _markdown_markdownRenderer_js__WEBPACK_IMPORTED_MODULE_8__["MarkdownRenderer"](editor, modeService, openerService)); - this.model = this._register(new _parameterHintsModel_js__WEBPACK_IMPORTED_MODULE_15__["ParameterHintsModel"](editor)); - this.keyVisible = _provideSignatureHelp_js__WEBPACK_IMPORTED_MODULE_9__["Context"].Visible.bindTo(contextKeyService); - this.keyMultipleSignatures = _provideSignatureHelp_js__WEBPACK_IMPORTED_MODULE_9__["Context"].MultipleSignatures.bindTo(contextKeyService); - this._register(this.model.onChangedHints(newParameterHints => { - if (newParameterHints) { - this.show(); - this.render(newParameterHints); - } - else { - this.hide(); - } - })); - } - createParamaterHintDOMNodes() { - const element = $('.editor-widget.parameter-hints-widget'); - const wrapper = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](element, $('.wrapper')); - wrapper.tabIndex = -1; - const controls = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](wrapper, $('.controls')); - const previous = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](controls, $('.button' + parameterHintsPreviousIcon.cssSelector)); - const overloads = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](controls, $('.overloads')); - const next = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](controls, $('.button' + parameterHintsNextIcon.cssSelector)); - const onPreviousClick = Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_1__["stop"])(Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_1__["domEvent"])(previous, 'click')); - this._register(onPreviousClick(this.previous, this)); - const onNextClick = Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_1__["stop"])(Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_1__["domEvent"])(next, 'click')); - this._register(onNextClick(this.next, this)); - const body = $('.body'); - const scrollbar = new _base_browser_ui_scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_3__["DomScrollableElement"](body, {}); - this._register(scrollbar); - wrapper.appendChild(scrollbar.getDomNode()); - const signature = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](body, $('.signature')); - const docs = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](body, $('.docs')); - element.style.userSelect = 'text'; - this.domNodes = { - element, - signature, - overloads, - docs, - scrollbar, - }; - this.editor.addContentWidget(this); - this.hide(); - this._register(this.editor.onDidChangeCursorSelection(e => { - if (this.visible) { - this.editor.layoutContentWidget(this); - } - })); - const updateFont = () => { - if (!this.domNodes) { - return; - } - const fontInfo = this.editor.getOption(36 /* fontInfo */); - this.domNodes.element.style.fontSize = `${fontInfo.fontSize}px`; - }; - updateFont(); - this._register(_base_common_event_js__WEBPACK_IMPORTED_MODULE_4__["Event"].chain(this.editor.onDidChangeConfiguration.bind(this.editor)) - .filter(e => e.hasChanged(36 /* fontInfo */)) - .on(updateFont, null)); - this._register(this.editor.onDidLayoutChange(e => this.updateMaxHeight())); - this.updateMaxHeight(); - } - show() { - if (this.visible) { - return; - } - if (!this.domNodes) { - this.createParamaterHintDOMNodes(); - } - this.keyVisible.set(true); - this.visible = true; - setTimeout(() => { - if (this.domNodes) { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addClass"](this.domNodes.element, 'visible'); - } - }, 100); - this.editor.layoutContentWidget(this); - } - hide() { - this.renderDisposeables.clear(); - if (!this.visible) { - return; - } - this.keyVisible.reset(); - this.visible = false; - this.announcedLabel = null; - if (this.domNodes) { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["removeClass"](this.domNodes.element, 'visible'); - } - this.editor.layoutContentWidget(this); - } - getPosition() { - if (this.visible) { - return { - position: this.editor.getPosition(), - preference: [1 /* ABOVE */, 2 /* BELOW */] - }; - } - return null; - } - render(hints) { - var _a; - this.renderDisposeables.clear(); - if (!this.domNodes) { - return; - } - const multiple = hints.signatures.length > 1; - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["toggleClass"](this.domNodes.element, 'multiple', multiple); - this.keyMultipleSignatures.set(multiple); - this.domNodes.signature.innerText = ''; - this.domNodes.docs.innerText = ''; - const signature = hints.signatures[hints.activeSignature]; - if (!signature) { - return; - } - const code = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](this.domNodes.signature, $('.code')); - const fontInfo = this.editor.getOption(36 /* fontInfo */); - code.style.fontSize = `${fontInfo.fontSize}px`; - code.style.fontFamily = fontInfo.fontFamily; - const hasParameters = signature.parameters.length > 0; - const activeParameterIndex = (_a = signature.activeParameter) !== null && _a !== void 0 ? _a : hints.activeParameter; - if (!hasParameters) { - const label = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](code, $('span')); - label.textContent = signature.label; - } - else { - this.renderParameters(code, signature, activeParameterIndex); - } - const activeParameter = signature.parameters[activeParameterIndex]; - if (activeParameter === null || activeParameter === void 0 ? void 0 : activeParameter.documentation) { - const documentation = $('span.documentation'); - if (typeof activeParameter.documentation === 'string') { - documentation.textContent = activeParameter.documentation; - } - else { - const renderedContents = this.renderDisposeables.add(this.markdownRenderer.render(activeParameter.documentation)); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addClass"](renderedContents.element, 'markdown-docs'); - documentation.appendChild(renderedContents.element); - } - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](this.domNodes.docs, $('p', {}, documentation)); - } - if (signature.documentation === undefined) { - /** no op */ - } - else if (typeof signature.documentation === 'string') { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](this.domNodes.docs, $('p', {}, signature.documentation)); - } - else { - const renderedContents = this.renderDisposeables.add(this.markdownRenderer.render(signature.documentation)); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addClass"](renderedContents.element, 'markdown-docs'); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](this.domNodes.docs, renderedContents.element); - } - const hasDocs = this.hasDocs(signature, activeParameter); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["toggleClass"](this.domNodes.signature, 'has-docs', hasDocs); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["toggleClass"](this.domNodes.docs, 'empty', !hasDocs); - this.domNodes.overloads.textContent = - Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_16__["pad"])(hints.activeSignature + 1, hints.signatures.length.toString().length) + '/' + hints.signatures.length; - if (activeParameter) { - const labelToAnnounce = this.getParameterLabel(signature, activeParameterIndex); - // Select method gets called on every user type while parameter hints are visible. - // We do not want to spam the user with same announcements, so we only announce if the current parameter changed. - if (this.announcedLabel !== labelToAnnounce) { - _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_2__["alert"](_nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('hint', "{0}, hint", labelToAnnounce)); - this.announcedLabel = labelToAnnounce; - } - } - this.editor.layoutContentWidget(this); - this.domNodes.scrollbar.scanDomNode(); - } - hasDocs(signature, activeParameter) { - if (activeParameter && typeof activeParameter.documentation === 'string' && Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_18__["assertIsDefined"])(activeParameter.documentation).length > 0) { - return true; - } - if (activeParameter && typeof activeParameter.documentation === 'object' && Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_18__["assertIsDefined"])(activeParameter.documentation).value.length > 0) { - return true; - } - if (signature.documentation && typeof signature.documentation === 'string' && Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_18__["assertIsDefined"])(signature.documentation).length > 0) { - return true; - } - if (signature.documentation && typeof signature.documentation === 'object' && Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_18__["assertIsDefined"])(signature.documentation.value).length > 0) { - return true; - } - return false; - } - renderParameters(parent, signature, activeParameterIndex) { - const [start, end] = this.getParameterLabelOffsets(signature, activeParameterIndex); - const beforeSpan = document.createElement('span'); - beforeSpan.textContent = signature.label.substring(0, start); - const paramSpan = document.createElement('span'); - paramSpan.textContent = signature.label.substring(start, end); - paramSpan.className = 'parameter active'; - const afterSpan = document.createElement('span'); - afterSpan.textContent = signature.label.substring(end); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["append"](parent, beforeSpan, paramSpan, afterSpan); - } - getParameterLabel(signature, paramIdx) { - const param = signature.parameters[paramIdx]; - if (Array.isArray(param.label)) { - return signature.label.substring(param.label[0], param.label[1]); - } - else { - return param.label; - } - } - getParameterLabelOffsets(signature, paramIdx) { - const param = signature.parameters[paramIdx]; - if (!param) { - return [0, 0]; - } - else if (Array.isArray(param.label)) { - return param.label; - } - else { - const idx = signature.label.lastIndexOf(param.label); - return idx >= 0 - ? [idx, idx + param.label.length] - : [0, 0]; - } - } - next() { - this.editor.focus(); - this.model.next(); - } - previous() { - this.editor.focus(); - this.model.previous(); - } - cancel() { - this.model.cancel(); - } - getDomNode() { - if (!this.domNodes) { - this.createParamaterHintDOMNodes(); - } - return this.domNodes.element; - } - getId() { - return ParameterHintsWidget.ID; - } - trigger(context) { - this.model.trigger(context, 0); - } - updateMaxHeight() { - if (!this.domNodes) { - return; - } - const height = Math.max(this.editor.getLayoutInfo().height / 4, 250); - const maxHeight = `${height}px`; - this.domNodes.element.style.maxHeight = maxHeight; - const wrapper = this.domNodes.element.getElementsByClassName('wrapper'); - if (wrapper.length) { - wrapper[0].style.maxHeight = maxHeight; - } - } -}; -ParameterHintsWidget.ID = 'editor.widget.parameterHintsWidget'; -ParameterHintsWidget = __decorate([ - __param(1, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["IContextKeyService"]), - __param(2, _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_12__["IOpenerService"]), - __param(3, _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_7__["IModeService"]) -], ParameterHintsWidget); - -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_14__["registerThemingParticipant"])((theme, collector) => { - const border = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["editorHoverBorder"]); - if (border) { - const borderWidth = theme.type === _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_14__["HIGH_CONTRAST"] ? 2 : 1; - collector.addRule(`.monaco-editor .parameter-hints-widget { border: ${borderWidth}px solid ${border}; }`); - collector.addRule(`.monaco-editor .parameter-hints-widget.multiple .body { border-left: 1px solid ${border.transparent(0.5)}; }`); - collector.addRule(`.monaco-editor .parameter-hints-widget .signature.has-docs { border-bottom: 1px solid ${border.transparent(0.5)}; }`); - } - const background = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["editorHoverBackground"]); - if (background) { - collector.addRule(`.monaco-editor .parameter-hints-widget { background-color: ${background}; }`); - } - const link = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["textLinkForeground"]); - if (link) { - collector.addRule(`.monaco-editor .parameter-hints-widget a { color: ${link}; }`); - } - const foreground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["editorHoverForeground"]); - if (foreground) { - collector.addRule(`.monaco-editor .parameter-hints-widget { color: ${foreground}; }`); - } - const codeBackground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["textCodeBlockBackground"]); - if (codeBackground) { - collector.addRule(`.monaco-editor .parameter-hints-widget code { background-color: ${codeBackground}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/provideSignatureHelp.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/provideSignatureHelp.js ***! - \*************************************************************************************************/ -/*! exports provided: Context, provideSignatureHelp */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return Context; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "provideSignatureHelp", function() { return provideSignatureHelp; }); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - -const Context = { - Visible: new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["RawContextKey"]('parameterHintsVisible', false), - MultipleSignatures: new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["RawContextKey"]('parameterHintsMultipleSignatures', false), -}; -function provideSignatureHelp(model, position, context, token) { - const supports = _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["SignatureHelpProviderRegistry"].ordered(model); - return Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["first"])(supports.map(support => () => { - return Promise.resolve(support.provideSignatureHelp(model, position, token, context)) - .catch(e => Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedExternalError"])(e)); - })); -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerDefaultLanguageCommand"])('_executeSignatureHelpProvider', (model, position, args) => __awaiter(void 0, void 0, void 0, function* () { - const result = yield provideSignatureHelp(model, position, { - triggerKind: _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["SignatureHelpTriggerKind"].Invoke, - isRetrigger: false, - triggerCharacter: args['triggerCharacter'] - }, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_5__["CancellationToken"].None); - if (!result) { - return undefined; - } - setTimeout(() => result.dispose(), 0); - return result.value; -})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/peekView/media/peekViewWidget.css": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/peekView/media/peekViewWidget.css ***! - \********************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_peekViewWidget_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./peekViewWidget.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/peekView/media/peekViewWidget.css"); -/* harmony import */ var _css_loader_dist_cjs_js_peekViewWidget_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_peekViewWidget_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_peekViewWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_peekViewWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/peekView/peekView.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/peekView/peekView.js ***! - \*******************************************************************************/ -/*! exports provided: IPeekViewService, PeekContext, getOuterEditor, PeekViewWidget, peekViewTitleBackground, peekViewTitleForeground, peekViewTitleInfoForeground, peekViewBorder, peekViewResultsBackground, peekViewResultsMatchForeground, peekViewResultsFileForeground, peekViewResultsSelectionBackground, peekViewResultsSelectionForeground, peekViewEditorBackground, peekViewEditorGutterBackground, peekViewResultsMatchHighlight, peekViewEditorMatchHighlight, peekViewEditorMatchHighlightBorder */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IPeekViewService", function() { return IPeekViewService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PeekContext", function() { return PeekContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOuterEditor", function() { return getOuterEditor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PeekViewWidget", function() { return PeekViewWidget; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewTitleBackground", function() { return peekViewTitleBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewTitleForeground", function() { return peekViewTitleForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewTitleInfoForeground", function() { return peekViewTitleInfoForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewBorder", function() { return peekViewBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewResultsBackground", function() { return peekViewResultsBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewResultsMatchForeground", function() { return peekViewResultsMatchForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewResultsFileForeground", function() { return peekViewResultsFileForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewResultsSelectionBackground", function() { return peekViewResultsSelectionBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewResultsSelectionForeground", function() { return peekViewResultsSelectionForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewEditorBackground", function() { return peekViewEditorBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewEditorGutterBackground", function() { return peekViewEditorGutterBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewResultsMatchHighlight", function() { return peekViewResultsMatchHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewEditorMatchHighlight", function() { return peekViewEditorMatchHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "peekViewEditorMatchHighlightBorder", function() { return peekViewEditorMatchHighlightBorder; }); -/* harmony import */ var _media_peekViewWidget_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/peekViewWidget.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/peekView/media/peekViewWidget.css"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_ui_actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/ui/actionbar/actionbar.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js"); -/* harmony import */ var _base_common_actions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_objects_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _browser_widget_embeddedCodeEditorWidget_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../browser/widget/embeddedCodeEditorWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/embeddedCodeEditorWidget.js"); -/* harmony import */ var _zoneWidget_zoneWidget_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../zoneWidget/zoneWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/zoneWidget/zoneWidget.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/instantiation/common/extensions.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/extensions.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _platform_actions_browser_menuEntryActionViewItem_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/actions/browser/menuEntryActionViewItem.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - - - - -const IPeekViewService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_12__["createDecorator"])('IPeekViewService'); -Object(_platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_13__["registerSingleton"])(IPeekViewService, class { - constructor() { - this._widgets = new Map(); - } - addExclusiveWidget(editor, widget) { - const existing = this._widgets.get(editor); - if (existing) { - existing.listener.dispose(); - existing.widget.dispose(); - } - const remove = () => { - const data = this._widgets.get(editor); - if (data && data.widget === widget) { - data.listener.dispose(); - this._widgets.delete(editor); - } - }; - this._widgets.set(editor, { widget, listener: widget.onDidClose(remove) }); - } -}); -var PeekContext; -(function (PeekContext) { - PeekContext.inPeekEditor = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["RawContextKey"]('inReferenceSearchEditor', true); - PeekContext.notInPeekEditor = PeekContext.inPeekEditor.toNegated(); -})(PeekContext || (PeekContext = {})); -let PeekContextController = class PeekContextController { - constructor(editor, contextKeyService) { - if (editor instanceof _browser_widget_embeddedCodeEditorWidget_js__WEBPACK_IMPORTED_MODULE_8__["EmbeddedCodeEditorWidget"]) { - PeekContext.inPeekEditor.bindTo(contextKeyService); - } - } - dispose() { } -}; -PeekContextController.ID = 'editor.contrib.referenceController'; -PeekContextController = __decorate([ - __param(1, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["IContextKeyService"]) -], PeekContextController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_14__["registerEditorContribution"])(PeekContextController.ID, PeekContextController); -function getOuterEditor(accessor) { - let editor = accessor.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_7__["ICodeEditorService"]).getFocusedCodeEditor(); - if (editor instanceof _browser_widget_embeddedCodeEditorWidget_js__WEBPACK_IMPORTED_MODULE_8__["EmbeddedCodeEditorWidget"]) { - return editor.getParentEditor(); - } - return editor; -} -const defaultOptions = { - headerBackgroundColor: _base_common_color_js__WEBPACK_IMPORTED_MODULE_4__["Color"].white, - primaryHeadingColor: _base_common_color_js__WEBPACK_IMPORTED_MODULE_4__["Color"].fromHex('#333333'), - secondaryHeadingColor: _base_common_color_js__WEBPACK_IMPORTED_MODULE_4__["Color"].fromHex('#6c6c6cb3') -}; -let PeekViewWidget = class PeekViewWidget extends _zoneWidget_zoneWidget_js__WEBPACK_IMPORTED_MODULE_9__["ZoneWidget"] { - constructor(editor, options, instantiationService) { - super(editor, options); - this.instantiationService = instantiationService; - this._onDidClose = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"](); - this.onDidClose = this._onDidClose.event; - _base_common_objects_js__WEBPACK_IMPORTED_MODULE_6__["mixin"](this.options, defaultOptions, false); - } - dispose() { - super.dispose(); - this._onDidClose.fire(this); - } - style(styles) { - let options = this.options; - if (styles.headerBackgroundColor) { - options.headerBackgroundColor = styles.headerBackgroundColor; - } - if (styles.primaryHeadingColor) { - options.primaryHeadingColor = styles.primaryHeadingColor; - } - if (styles.secondaryHeadingColor) { - options.secondaryHeadingColor = styles.secondaryHeadingColor; - } - super.style(styles); - } - _applyStyles() { - super._applyStyles(); - let options = this.options; - if (this._headElement && options.headerBackgroundColor) { - this._headElement.style.backgroundColor = options.headerBackgroundColor.toString(); - } - if (this._primaryHeading && options.primaryHeadingColor) { - this._primaryHeading.style.color = options.primaryHeadingColor.toString(); - } - if (this._secondaryHeading && options.secondaryHeadingColor) { - this._secondaryHeading.style.color = options.secondaryHeadingColor.toString(); - } - if (this._bodyElement && options.frameColor) { - this._bodyElement.style.borderColor = options.frameColor.toString(); - } - } - _fillContainer(container) { - this.setCssClass('peekview-widget'); - this._headElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('.head'); - this._bodyElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('.body'); - this._fillHead(this._headElement); - this._fillBody(this._bodyElement); - container.appendChild(this._headElement); - container.appendChild(this._bodyElement); - } - _fillHead(container, noCloseAction) { - const titleElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('.peekview-title'); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this._headElement, titleElement); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](titleElement, 'click', event => this._onTitleClick(event)); - this._fillTitleIcon(titleElement); - this._primaryHeading = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('span.filename'); - this._secondaryHeading = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('span.dirname'); - this._metaHeading = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('span.meta'); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](titleElement, this._primaryHeading, this._secondaryHeading, this._metaHeading); - const actionsContainer = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"]('.peekview-actions'); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"](this._headElement, actionsContainer); - const actionBarOptions = this._getActionBarOptions(); - this._actionbarWidget = new _base_browser_ui_actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_2__["ActionBar"](actionsContainer, actionBarOptions); - this._disposables.add(this._actionbarWidget); - if (!noCloseAction) { - this._actionbarWidget.push(new _base_common_actions_js__WEBPACK_IMPORTED_MODULE_3__["Action"]('peekview.close', _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('label.close', "Close"), _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_16__["Codicon"].close.classNames, true, () => { - this.dispose(); - return Promise.resolve(); - }), { label: false, icon: true }); - } - } - _fillTitleIcon(container) { - } - _getActionBarOptions() { - return { - actionViewItemProvider: action => { - if (action instanceof _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_17__["MenuItemAction"]) { - return this.instantiationService.createInstance(_platform_actions_browser_menuEntryActionViewItem_js__WEBPACK_IMPORTED_MODULE_18__["MenuEntryActionViewItem"], action); - } - else if (action instanceof _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_17__["SubmenuItemAction"]) { - return this.instantiationService.createInstance(_platform_actions_browser_menuEntryActionViewItem_js__WEBPACK_IMPORTED_MODULE_18__["SubmenuEntryActionViewItem"], action); - } - return undefined; - } - }; - } - _onTitleClick(event) { - // implement me - } - setTitle(primaryHeading, secondaryHeading) { - if (this._primaryHeading && this._secondaryHeading) { - this._primaryHeading.innerText = primaryHeading; - this._primaryHeading.setAttribute('aria-label', primaryHeading); - if (secondaryHeading) { - this._secondaryHeading.innerText = secondaryHeading; - } - else { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["clearNode"](this._secondaryHeading); - } - } - } - setMetaTitle(value) { - if (this._metaHeading) { - if (value) { - this._metaHeading.innerText = value; - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["show"](this._metaHeading); - } - else { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["hide"](this._metaHeading); - } - } - } - _doLayout(heightInPixel, widthInPixel) { - if (!this._isShowing && heightInPixel < 0) { - // Looks like the view zone got folded away! - this.dispose(); - return; - } - const headHeight = Math.ceil(this.editor.getOption(51 /* lineHeight */) * 1.2); - const bodyHeight = Math.round(heightInPixel - (headHeight + 2 /* the border-top/bottom width*/)); - this._doLayoutHead(headHeight, widthInPixel); - this._doLayoutBody(bodyHeight, widthInPixel); - } - _doLayoutHead(heightInPixel, widthInPixel) { - if (this._headElement) { - this._headElement.style.height = `${heightInPixel}px`; - this._headElement.style.lineHeight = this._headElement.style.height; - } - } - _doLayoutBody(heightInPixel, widthInPixel) { - if (this._bodyElement) { - this._bodyElement.style.height = `${heightInPixel}px`; - } - } -}; -PeekViewWidget = __decorate([ - __param(2, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_12__["IInstantiationService"]) -], PeekViewWidget); - -const peekViewTitleBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewTitle.background', { dark: '#1E1E1E', light: '#FFFFFF', hc: '#0C141F' }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewTitleBackground', 'Background color of the peek view title area.')); -const peekViewTitleForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewTitleLabel.foreground', { dark: '#FFFFFF', light: '#333333', hc: '#FFFFFF' }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewTitleForeground', 'Color of the peek view title.')); -const peekViewTitleInfoForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewTitleDescription.foreground', { dark: '#ccccccb3', light: '#616161e6', hc: '#FFFFFF99' }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewTitleInfoForeground', 'Color of the peek view title info.')); -const peekViewBorder = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekView.border', { dark: '#007acc', light: '#007acc', hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["contrastBorder"] }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewBorder', 'Color of the peek view borders and arrow.')); -const peekViewResultsBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewResult.background', { dark: '#252526', light: '#F3F3F3', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_4__["Color"].black }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewResultsBackground', 'Background color of the peek view result list.')); -const peekViewResultsMatchForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewResult.lineForeground', { dark: '#bbbbbb', light: '#646465', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_4__["Color"].white }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewResultsMatchForeground', 'Foreground color for line nodes in the peek view result list.')); -const peekViewResultsFileForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewResult.fileForeground', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_4__["Color"].white, light: '#1E1E1E', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_4__["Color"].white }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewResultsFileForeground', 'Foreground color for file nodes in the peek view result list.')); -const peekViewResultsSelectionBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewResult.selectionBackground', { dark: '#3399ff33', light: '#3399ff33', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewResultsSelectionBackground', 'Background color of the selected entry in the peek view result list.')); -const peekViewResultsSelectionForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewResult.selectionForeground', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_4__["Color"].white, light: '#6C6C6C', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_4__["Color"].white }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewResultsSelectionForeground', 'Foreground color of the selected entry in the peek view result list.')); -const peekViewEditorBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewEditor.background', { dark: '#001F33', light: '#F2F8FC', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_4__["Color"].black }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewEditorBackground', 'Background color of the peek view editor.')); -const peekViewEditorGutterBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewEditorGutter.background', { dark: peekViewEditorBackground, light: peekViewEditorBackground, hc: peekViewEditorBackground }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewEditorGutterBackground', 'Background color of the gutter in the peek view editor.')); -const peekViewResultsMatchHighlight = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewResult.matchHighlightBackground', { dark: '#ea5c004d', light: '#ea5c004d', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewResultsMatchHighlight', 'Match highlight color in the peek view result list.')); -const peekViewEditorMatchHighlight = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewEditor.matchHighlightBackground', { dark: '#ff8f0099', light: '#f5d802de', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewEditorMatchHighlight', 'Match highlight color in the peek view editor.')); -const peekViewEditorMatchHighlightBorder = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["registerColor"])('peekViewEditor.matchHighlightBorder', { dark: null, light: null, hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_15__["activeContrastBorder"] }, _nls_js__WEBPACK_IMPORTED_MODULE_10__["localize"]('peekViewEditorMatchHighlightBorder', 'Match highlight border in the peek view editor.')); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/commandsQuickAccess.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/commandsQuickAccess.js ***! - \*********************************************************************************************/ -/*! exports provided: AbstractEditorCommandsQuickAccessProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractEditorCommandsQuickAccessProvider", function() { return AbstractEditorCommandsQuickAccessProvider; }); -/* harmony import */ var _platform_quickinput_browser_commandsQuickAccess_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/quickinput/browser/commandsQuickAccess.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/commandsQuickAccess.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class AbstractEditorCommandsQuickAccessProvider extends _platform_quickinput_browser_commandsQuickAccess_js__WEBPACK_IMPORTED_MODULE_0__["AbstractCommandsQuickAccessProvider"] { - constructor(options, instantiationService, keybindingService, commandService, telemetryService, notificationService) { - super(options, instantiationService, keybindingService, commandService, telemetryService, notificationService); - } - getCodeEditorCommandPicks() { - const activeTextEditorControl = this.activeTextEditorControl; - if (!activeTextEditorControl) { - return []; - } - const editorCommandPicks = []; - for (const editorAction of activeTextEditorControl.getSupportedActions()) { - editorCommandPicks.push({ - commandId: editorAction.id, - commandAlias: editorAction.alias, - label: Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__["stripCodicons"])(editorAction.label) || editorAction.id, - }); - } - return editorCommandPicks; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/editorNavigationQuickAccess.js": -/*!*****************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/editorNavigationQuickAccess.js ***! - \*****************************************************************************************************/ -/*! exports provided: AbstractEditorNavigationQuickAccessProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractEditorNavigationQuickAccessProvider", function() { return AbstractEditorNavigationQuickAccessProvider; }); -/* harmony import */ var _common_model_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorBrowser.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorBrowser.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _base_common_functional_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/functional.js */ "./node_modules/monaco-editor/esm/vs/base/common/functional.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -/** - * A reusable quick access provider for the editor with support - * for adding decorations for navigating in the currently active file - * (for example "Go to line", "Go to symbol"). - */ -class AbstractEditorNavigationQuickAccessProvider { - constructor(options) { - this.options = options; - //#endregion - //#region Decorations Utils - this.rangeHighlightDecorationId = undefined; - } - //#region Provider methods - provide(picker, token) { - var _a; - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - // Apply options if any - picker.canAcceptInBackground = !!((_a = this.options) === null || _a === void 0 ? void 0 : _a.canAcceptInBackground); - // Disable filtering & sorting, we control the results - picker.matchOnLabel = picker.matchOnDescription = picker.matchOnDetail = picker.sortByLabel = false; - // Provide based on current active editor - const pickerDisposable = disposables.add(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["MutableDisposable"]()); - pickerDisposable.value = this.doProvide(picker, token); - // Re-create whenever the active editor changes - disposables.add(this.onDidActiveTextEditorControlChange(() => { - // Clear old - pickerDisposable.value = undefined; - // Add new - pickerDisposable.value = this.doProvide(picker, token); - })); - return disposables; - } - doProvide(picker, token) { - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - // With text control - const editor = this.activeTextEditorControl; - if (editor && this.canProvideWithTextEditor(editor)) { - // Restore any view state if this picker was closed - // without actually going to a line - const codeEditor = Object(_browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_4__["getCodeEditor"])(editor); - if (codeEditor) { - // Remember view state and update it when the cursor position - // changes even later because it could be that the user has - // configured quick access to remain open when focus is lost and - // we always want to restore the current location. - let lastKnownEditorViewState = Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_5__["withNullAsUndefined"])(editor.saveViewState()); - disposables.add(codeEditor.onDidChangeCursorPosition(() => { - lastKnownEditorViewState = Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_5__["withNullAsUndefined"])(editor.saveViewState()); - })); - disposables.add(Object(_base_common_functional_js__WEBPACK_IMPORTED_MODULE_6__["once"])(token.onCancellationRequested)(() => { - if (lastKnownEditorViewState && editor === this.activeTextEditorControl) { - editor.restoreViewState(lastKnownEditorViewState); - } - })); - } - // Clean up decorations on dispose - disposables.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["toDisposable"])(() => this.clearDecorations(editor))); - // Ask subclass for entries - disposables.add(this.provideWithTextEditor(editor, picker, token)); - } - // Without text control - else { - disposables.add(this.provideWithoutTextEditor(picker, token)); - } - return disposables; - } - /** - * Subclasses to implement if they can operate on the text editor. - */ - canProvideWithTextEditor(editor) { - return true; - } - gotoLocation(editor, options) { - editor.setSelection(options.range); - editor.revealRangeInCenter(options.range, 0 /* Smooth */); - if (!options.preserveFocus) { - editor.focus(); - } - } - getModel(editor) { - var _a; - return Object(_browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_4__["isDiffEditor"])(editor) ? (_a = editor.getModel()) === null || _a === void 0 ? void 0 : _a.modified : - editor.getModel(); - } - addDecorations(editor, range) { - editor.changeDecorations(changeAccessor => { - // Reset old decorations if any - const deleteDecorations = []; - if (this.rangeHighlightDecorationId) { - deleteDecorations.push(this.rangeHighlightDecorationId.overviewRulerDecorationId); - deleteDecorations.push(this.rangeHighlightDecorationId.rangeHighlightId); - this.rangeHighlightDecorationId = undefined; - } - // Add new decorations for the range - const newDecorations = [ - // highlight the entire line on the range - { - range, - options: { - className: 'rangeHighlight', - isWholeLine: true - } - }, - // also add overview ruler highlight - { - range, - options: { - overviewRuler: { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_1__["themeColorFromId"])(_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["overviewRulerRangeHighlight"]), - position: _common_model_js__WEBPACK_IMPORTED_MODULE_0__["OverviewRulerLane"].Full - } - } - } - ]; - const [rangeHighlightId, overviewRulerDecorationId] = changeAccessor.deltaDecorations(deleteDecorations, newDecorations); - this.rangeHighlightDecorationId = { rangeHighlightId, overviewRulerDecorationId }; - }); - } - clearDecorations(editor) { - const rangeHighlightDecorationId = this.rangeHighlightDecorationId; - if (rangeHighlightDecorationId) { - editor.changeDecorations(changeAccessor => { - changeAccessor.deltaDecorations([ - rangeHighlightDecorationId.overviewRulerDecorationId, - rangeHighlightDecorationId.rangeHighlightId - ], []); - }); - this.rangeHighlightDecorationId = undefined; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/gotoLineQuickAccess.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/gotoLineQuickAccess.js ***! - \*********************************************************************************************/ -/*! exports provided: AbstractGotoLineQuickAccessProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractGotoLineQuickAccessProvider", function() { return AbstractGotoLineQuickAccessProvider; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _editorNavigationQuickAccess_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editorNavigationQuickAccess.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/editorNavigationQuickAccess.js"); -/* harmony import */ var _browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/editorBrowser.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorBrowser.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class AbstractGotoLineQuickAccessProvider extends _editorNavigationQuickAccess_js__WEBPACK_IMPORTED_MODULE_2__["AbstractEditorNavigationQuickAccessProvider"] { - constructor() { - super({ canAcceptInBackground: true }); - } - provideWithoutTextEditor(picker) { - const label = Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('cannotRunGotoLine', "Open a text editor first to go to a line."); - picker.items = [{ label }]; - picker.ariaLabel = label; - return _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - } - provideWithTextEditor(editor, picker, token) { - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - // Goto line once picked - disposables.add(picker.onDidAccept(event => { - const [item] = picker.selectedItems; - if (item) { - if (!this.isValidLineNumber(editor, item.lineNumber)) { - return; - } - this.gotoLocation(editor, { range: this.toRange(item.lineNumber, item.column), keyMods: picker.keyMods, preserveFocus: event.inBackground }); - if (!event.inBackground) { - picker.hide(); - } - } - })); - // React to picker changes - const updatePickerAndEditor = () => { - const position = this.parsePosition(editor, picker.value.trim().substr(AbstractGotoLineQuickAccessProvider.PREFIX.length)); - const label = this.getPickLabel(editor, position.lineNumber, position.column); - // Picker - picker.items = [{ - lineNumber: position.lineNumber, - column: position.column, - label - }]; - // ARIA Label - picker.ariaLabel = label; - // Clear decorations for invalid range - if (!this.isValidLineNumber(editor, position.lineNumber)) { - this.clearDecorations(editor); - return; - } - // Reveal - const range = this.toRange(position.lineNumber, position.column); - editor.revealRangeInCenter(range, 0 /* Smooth */); - // Decorate - this.addDecorations(editor, range); - }; - updatePickerAndEditor(); - disposables.add(picker.onDidChangeValue(() => updatePickerAndEditor())); - // Adjust line number visibility as needed - const codeEditor = Object(_browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_3__["getCodeEditor"])(editor); - if (codeEditor) { - const options = codeEditor.getOptions(); - const lineNumbers = options.get(52 /* lineNumbers */); - if (lineNumbers.renderType === 2 /* Relative */) { - codeEditor.updateOptions({ lineNumbers: 'on' }); - disposables.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => codeEditor.updateOptions({ lineNumbers: 'relative' }))); - } - } - return disposables; - } - toRange(lineNumber = 1, column = 1) { - return { - startLineNumber: lineNumber, - startColumn: column, - endLineNumber: lineNumber, - endColumn: column - }; - } - parsePosition(editor, value) { - // Support line-col formats of `line,col`, `line:col`, `line#col` - const numbers = value.split(/,|:|#/).map(part => parseInt(part, 10)).filter(part => !isNaN(part)); - const endLine = this.lineCount(editor) + 1; - return { - lineNumber: numbers[0] > 0 ? numbers[0] : endLine + numbers[0], - column: numbers[1] - }; - } - getPickLabel(editor, lineNumber, column) { - // Location valid: indicate this as picker label - if (this.isValidLineNumber(editor, lineNumber)) { - if (this.isValidColumn(editor, lineNumber, column)) { - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('gotoLineColumnLabel', "Go to line {0} and column {1}.", lineNumber, column); - } - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('gotoLineLabel', "Go to line {0}.", lineNumber); - } - // Location invalid: show generic label - const position = editor.getPosition() || { lineNumber: 1, column: 1 }; - const lineCount = this.lineCount(editor); - if (lineCount > 1) { - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('gotoLineLabelEmptyWithLimit', "Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.", position.lineNumber, position.column, lineCount); - } - return Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('gotoLineLabelEmpty', "Current Line: {0}, Character: {1}. Type a line number to navigate to.", position.lineNumber, position.column); - } - isValidLineNumber(editor, lineNumber) { - if (!lineNumber || typeof lineNumber !== 'number') { - return false; - } - return lineNumber > 0 && lineNumber <= this.lineCount(editor); - } - isValidColumn(editor, lineNumber, column) { - if (!column || typeof column !== 'number') { - return false; - } - const model = this.getModel(editor); - if (!model) { - return false; - } - const positionCandidate = { lineNumber, column }; - return model.validatePosition(positionCandidate).equals(positionCandidate); - } - lineCount(editor) { - var _a, _b; - return (_b = (_a = this.getModel(editor)) === null || _a === void 0 ? void 0 : _a.getLineCount()) !== null && _b !== void 0 ? _b : 0; - } -} -AbstractGotoLineQuickAccessProvider.PREFIX = ':'; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/gotoSymbolQuickAccess.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/gotoSymbolQuickAccess.js ***! - \***********************************************************************************************/ -/*! exports provided: AbstractGotoSymbolQuickAccessProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractGotoSymbolQuickAccessProvider", function() { return AbstractGotoSymbolQuickAccessProvider; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _editorNavigationQuickAccess_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editorNavigationQuickAccess.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/editorNavigationQuickAccess.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _documentSymbols_outlineModel_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../documentSymbols/outlineModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/outlineModel.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _base_common_fuzzyScorer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/fuzzyScorer.js */ "./node_modules/monaco-editor/esm/vs/base/common/fuzzyScorer.js"); -/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - -class AbstractGotoSymbolQuickAccessProvider extends _editorNavigationQuickAccess_js__WEBPACK_IMPORTED_MODULE_4__["AbstractEditorNavigationQuickAccessProvider"] { - constructor(options = Object.create(null)) { - super(options); - this.options = options; - options.canAcceptInBackground = true; - } - provideWithoutTextEditor(picker) { - this.provideLabelPick(picker, Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('cannotRunGotoSymbolWithoutEditor', "To go to a symbol, first open a text editor with symbol information.")); - return _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"].None; - } - provideWithTextEditor(editor, picker, token) { - const model = this.getModel(editor); - if (!model) { - return _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"].None; - } - // Provide symbols from model if available in registry - if (_common_modes_js__WEBPACK_IMPORTED_MODULE_5__["DocumentSymbolProviderRegistry"].has(model)) { - return this.doProvideWithEditorSymbols(editor, model, picker, token); - } - // Otherwise show an entry for a model without registry - // But give a chance to resolve the symbols at a later - // point if possible - return this.doProvideWithoutEditorSymbols(editor, model, picker, token); - } - doProvideWithoutEditorSymbols(editor, model, picker, token) { - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["DisposableStore"](); - // Generic pick for not having any symbol information - this.provideLabelPick(picker, Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('cannotRunGotoSymbolWithoutSymbolProvider', "The active text editor does not provide symbol information.")); - // Wait for changes to the registry and see if eventually - // we do get symbols. This can happen if the picker is opened - // very early after the model has loaded but before the - // language registry is ready. - // https://github.com/microsoft/vscode/issues/70607 - (() => __awaiter(this, void 0, void 0, function* () { - const result = yield this.waitForLanguageSymbolRegistry(model, disposables); - if (!result || token.isCancellationRequested) { - return; - } - disposables.add(this.doProvideWithEditorSymbols(editor, model, picker, token)); - }))(); - return disposables; - } - provideLabelPick(picker, label) { - picker.items = [{ label, index: 0, kind: 14 /* String */ }]; - picker.ariaLabel = label; - } - waitForLanguageSymbolRegistry(model, disposables) { - return __awaiter(this, void 0, void 0, function* () { - if (_common_modes_js__WEBPACK_IMPORTED_MODULE_5__["DocumentSymbolProviderRegistry"].has(model)) { - return true; - } - let symbolProviderRegistryPromiseResolve; - const symbolProviderRegistryPromise = new Promise(resolve => symbolProviderRegistryPromiseResolve = resolve); - // Resolve promise when registry knows model - const symbolProviderListener = disposables.add(_common_modes_js__WEBPACK_IMPORTED_MODULE_5__["DocumentSymbolProviderRegistry"].onDidChange(() => { - if (_common_modes_js__WEBPACK_IMPORTED_MODULE_5__["DocumentSymbolProviderRegistry"].has(model)) { - symbolProviderListener.dispose(); - symbolProviderRegistryPromiseResolve(true); - } - })); - // Resolve promise when we get disposed too - disposables.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["toDisposable"])(() => symbolProviderRegistryPromiseResolve(false))); - return symbolProviderRegistryPromise; - }); - } - doProvideWithEditorSymbols(editor, model, picker, token) { - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["DisposableStore"](); - // Goto symbol once picked - disposables.add(picker.onDidAccept(event => { - const [item] = picker.selectedItems; - if (item && item.range) { - this.gotoLocation(editor, { range: item.range.selection, keyMods: picker.keyMods, preserveFocus: event.inBackground }); - if (!event.inBackground) { - picker.hide(); - } - } - })); - // Goto symbol side by side if enabled - disposables.add(picker.onDidTriggerItemButton(({ item }) => { - if (item && item.range) { - this.gotoLocation(editor, { range: item.range.selection, keyMods: picker.keyMods, forceSideBySide: true }); - picker.hide(); - } - })); - // Resolve symbols from document once and reuse this - // request for all filtering and typing then on - const symbolsPromise = this.getDocumentSymbols(model, true, token); - // Set initial picks and update on type - let picksCts = undefined; - const updatePickerItems = () => __awaiter(this, void 0, void 0, function* () { - // Cancel any previous ask for picks and busy - picksCts === null || picksCts === void 0 ? void 0 : picksCts.dispose(true); - picker.busy = false; - // Create new cancellation source for this run - picksCts = new _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationTokenSource"](token); - // Collect symbol picks - picker.busy = true; - try { - const query = Object(_base_common_fuzzyScorer_js__WEBPACK_IMPORTED_MODULE_8__["prepareQuery"])(picker.value.substr(AbstractGotoSymbolQuickAccessProvider.PREFIX.length).trim()); - const items = yield this.doGetSymbolPicks(symbolsPromise, query, undefined, picksCts.token); - if (token.isCancellationRequested) { - return; - } - if (items.length > 0) { - picker.items = items; - } - else { - if (query.original.length > 0) { - this.provideLabelPick(picker, Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('noMatchingSymbolResults', "No matching editor symbols")); - } - else { - this.provideLabelPick(picker, Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('noSymbolResults', "No editor symbols")); - } - } - } - finally { - if (!token.isCancellationRequested) { - picker.busy = false; - } - } - }); - disposables.add(picker.onDidChangeValue(() => updatePickerItems())); - updatePickerItems(); - // Reveal and decorate when active item changes - // However, ignore the very first event so that - // opening the picker is not immediately revealing - // and decorating the first entry. - let ignoreFirstActiveEvent = true; - disposables.add(picker.onDidChangeActive(() => { - const [item] = picker.activeItems; - if (item && item.range) { - if (ignoreFirstActiveEvent) { - ignoreFirstActiveEvent = false; - return; - } - // Reveal - editor.revealRangeInCenter(item.range.selection, 0 /* Smooth */); - // Decorate - this.addDecorations(editor, item.range.decoration); - } - })); - return disposables; - } - doGetSymbolPicks(symbolsPromise, query, options, token) { - return __awaiter(this, void 0, void 0, function* () { - const symbols = yield symbolsPromise; - if (token.isCancellationRequested) { - return []; - } - const filterBySymbolKind = query.original.indexOf(AbstractGotoSymbolQuickAccessProvider.SCOPE_PREFIX) === 0; - const filterPos = filterBySymbolKind ? 1 : 0; - // Split between symbol and container query - let symbolQuery; - let containerQuery; - if (query.values && query.values.length > 1) { - symbolQuery = Object(_base_common_fuzzyScorer_js__WEBPACK_IMPORTED_MODULE_8__["pieceToQuery"])(query.values[0]); // symbol: only match on first part - containerQuery = Object(_base_common_fuzzyScorer_js__WEBPACK_IMPORTED_MODULE_8__["pieceToQuery"])(query.values.slice(1)); // container: match on all but first parts - } - else { - symbolQuery = query; - } - // Convert to symbol picks and apply filtering - const filteredSymbolPicks = []; - for (let index = 0; index < symbols.length; index++) { - const symbol = symbols[index]; - const symbolLabel = Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_7__["trim"])(symbol.name); - const symbolLabelWithIcon = `$(symbol-${_common_modes_js__WEBPACK_IMPORTED_MODULE_5__["SymbolKinds"].toString(symbol.kind) || 'property'}) ${symbolLabel}`; - const symbolLabelIconOffset = symbolLabelWithIcon.length - symbolLabel.length; - let containerLabel = symbol.containerName; - if (options === null || options === void 0 ? void 0 : options.extraContainerLabel) { - if (containerLabel) { - containerLabel = `${options.extraContainerLabel} • ${containerLabel}`; - } - else { - containerLabel = options.extraContainerLabel; - } - } - let symbolScore = undefined; - let symbolMatches = undefined; - let containerScore = undefined; - let containerMatches = undefined; - if (query.original.length > filterPos) { - // First: try to score on the entire query, it is possible that - // the symbol matches perfectly (e.g. searching for "change log" - // can be a match on a markdown symbol "change log"). In that - // case we want to skip the container query altogether. - let skipContainerQuery = false; - if (symbolQuery !== query) { - [symbolScore, symbolMatches] = Object(_base_common_fuzzyScorer_js__WEBPACK_IMPORTED_MODULE_8__["scoreFuzzy2"])(symbolLabelWithIcon, Object.assign(Object.assign({}, query), { values: undefined /* disable multi-query support */ }), filterPos, symbolLabelIconOffset); - if (typeof symbolScore === 'number') { - skipContainerQuery = true; // since we consumed the query, skip any container matching - } - } - // Otherwise: score on the symbol query and match on the container later - if (typeof symbolScore !== 'number') { - [symbolScore, symbolMatches] = Object(_base_common_fuzzyScorer_js__WEBPACK_IMPORTED_MODULE_8__["scoreFuzzy2"])(symbolLabelWithIcon, symbolQuery, filterPos, symbolLabelIconOffset); - if (typeof symbolScore !== 'number') { - continue; - } - } - // Score by container if specified - if (!skipContainerQuery && containerQuery) { - if (containerLabel && containerQuery.original.length > 0) { - [containerScore, containerMatches] = Object(_base_common_fuzzyScorer_js__WEBPACK_IMPORTED_MODULE_8__["scoreFuzzy2"])(containerLabel, containerQuery); - } - if (typeof containerScore !== 'number') { - continue; - } - if (typeof symbolScore === 'number') { - symbolScore += containerScore; // boost symbolScore by containerScore - } - } - } - const deprecated = symbol.tags && symbol.tags.indexOf(1 /* Deprecated */) >= 0; - filteredSymbolPicks.push({ - index, - kind: symbol.kind, - score: symbolScore, - label: symbolLabelWithIcon, - ariaLabel: symbolLabel, - description: containerLabel, - highlights: deprecated ? undefined : { - label: symbolMatches, - description: containerMatches - }, - range: { - selection: _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].collapseToStart(symbol.selectionRange), - decoration: symbol.range - }, - strikethrough: deprecated, - buttons: (() => { - var _a, _b; - const openSideBySideDirection = ((_a = this.options) === null || _a === void 0 ? void 0 : _a.openSideBySideDirection) ? (_b = this.options) === null || _b === void 0 ? void 0 : _b.openSideBySideDirection() : undefined; - if (!openSideBySideDirection) { - return undefined; - } - return [ - { - iconClass: openSideBySideDirection === 'right' ? _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_10__["Codicon"].splitHorizontal.classNames : _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_10__["Codicon"].splitVertical.classNames, - tooltip: openSideBySideDirection === 'right' ? Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('openToSide', "Open to the Side") : Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('openToBottom', "Open to the Bottom") - } - ]; - })() - }); - } - // Sort by score - const sortedFilteredSymbolPicks = filteredSymbolPicks.sort((symbolA, symbolB) => filterBySymbolKind ? - this.compareByKindAndScore(symbolA, symbolB) : - this.compareByScore(symbolA, symbolB)); - // Add separator for types - // - @ only total number of symbols - // - @: grouped by symbol kind - let symbolPicks = []; - if (filterBySymbolKind) { - let lastSymbolKind = undefined; - let lastSeparator = undefined; - let lastSymbolKindCounter = 0; - function updateLastSeparatorLabel() { - if (lastSeparator && typeof lastSymbolKind === 'number' && lastSymbolKindCounter > 0) { - lastSeparator.label = Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_7__["format"])(NLS_SYMBOL_KIND_CACHE[lastSymbolKind] || FALLBACK_NLS_SYMBOL_KIND, lastSymbolKindCounter); - } - } - for (const symbolPick of sortedFilteredSymbolPicks) { - // Found new kind - if (lastSymbolKind !== symbolPick.kind) { - // Update last separator with number of symbols we found for kind - updateLastSeparatorLabel(); - lastSymbolKind = symbolPick.kind; - lastSymbolKindCounter = 1; - // Add new separator for new kind - lastSeparator = { type: 'separator' }; - symbolPicks.push(lastSeparator); - } - // Existing kind, keep counting - else { - lastSymbolKindCounter++; - } - // Add to final result - symbolPicks.push(symbolPick); - } - // Update last separator with number of symbols we found for kind - updateLastSeparatorLabel(); - } - else if (sortedFilteredSymbolPicks.length > 0) { - symbolPicks = [ - { label: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('symbols', "symbols ({0})", filteredSymbolPicks.length), type: 'separator' }, - ...sortedFilteredSymbolPicks - ]; - } - return symbolPicks; - }); - } - compareByScore(symbolA, symbolB) { - if (typeof symbolA.score !== 'number' && typeof symbolB.score === 'number') { - return 1; - } - else if (typeof symbolA.score === 'number' && typeof symbolB.score !== 'number') { - return -1; - } - if (typeof symbolA.score === 'number' && typeof symbolB.score === 'number') { - if (symbolA.score > symbolB.score) { - return -1; - } - else if (symbolA.score < symbolB.score) { - return 1; - } - } - if (symbolA.index < symbolB.index) { - return -1; - } - else if (symbolA.index > symbolB.index) { - return 1; - } - return 0; - } - compareByKindAndScore(symbolA, symbolB) { - const kindA = NLS_SYMBOL_KIND_CACHE[symbolA.kind] || FALLBACK_NLS_SYMBOL_KIND; - const kindB = NLS_SYMBOL_KIND_CACHE[symbolB.kind] || FALLBACK_NLS_SYMBOL_KIND; - // Sort by type first if scoped search - const result = kindA.localeCompare(kindB); - if (result === 0) { - return this.compareByScore(symbolA, symbolB); - } - return result; - } - getDocumentSymbols(document, flatten, token) { - return __awaiter(this, void 0, void 0, function* () { - const model = yield _documentSymbols_outlineModel_js__WEBPACK_IMPORTED_MODULE_6__["OutlineModel"].create(document, token); - if (token.isCancellationRequested) { - return []; - } - const roots = []; - for (const child of model.children.values()) { - if (child instanceof _documentSymbols_outlineModel_js__WEBPACK_IMPORTED_MODULE_6__["OutlineElement"]) { - roots.push(child.symbol); - } - else { - roots.push(..._base_common_iterator_js__WEBPACK_IMPORTED_MODULE_9__["Iterable"].map(child.children.values(), child => child.symbol)); - } - } - let flatEntries = []; - if (flatten) { - this.flattenDocumentSymbols(flatEntries, roots, ''); - } - else { - flatEntries = roots; - } - return flatEntries.sort((symbolA, symbolB) => _common_core_range_js__WEBPACK_IMPORTED_MODULE_3__["Range"].compareRangesUsingStarts(symbolA.range, symbolB.range)); - }); - } - flattenDocumentSymbols(bucket, entries, overrideContainerLabel) { - for (const entry of entries) { - bucket.push({ - kind: entry.kind, - tags: entry.tags, - name: entry.name, - detail: entry.detail, - containerName: entry.containerName || overrideContainerLabel, - range: entry.range, - selectionRange: entry.selectionRange, - children: undefined, - }); - // Recurse over children - if (entry.children) { - this.flattenDocumentSymbols(bucket, entry.children, entry.name); - } - } - } -} -AbstractGotoSymbolQuickAccessProvider.PREFIX = '@'; -AbstractGotoSymbolQuickAccessProvider.SCOPE_PREFIX = ':'; -AbstractGotoSymbolQuickAccessProvider.PREFIX_BY_CATEGORY = `${AbstractGotoSymbolQuickAccessProvider.PREFIX}${AbstractGotoSymbolQuickAccessProvider.SCOPE_PREFIX}`; -// #region NLS Helpers -const FALLBACK_NLS_SYMBOL_KIND = Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('property', "properties ({0})"); -const NLS_SYMBOL_KIND_CACHE = { - [5 /* Method */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('method', "methods ({0})"), - [11 /* Function */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('function', "functions ({0})"), - [8 /* Constructor */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('_constructor', "constructors ({0})"), - [12 /* Variable */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('variable', "variables ({0})"), - [4 /* Class */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('class', "classes ({0})"), - [22 /* Struct */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('struct', "structs ({0})"), - [23 /* Event */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('event', "events ({0})"), - [24 /* Operator */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('operator', "operators ({0})"), - [10 /* Interface */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('interface', "interfaces ({0})"), - [2 /* Namespace */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('namespace', "namespaces ({0})"), - [3 /* Package */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('package', "packages ({0})"), - [25 /* TypeParameter */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('typeParameter', "type parameters ({0})"), - [1 /* Module */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('modules', "modules ({0})"), - [6 /* Property */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('property', "properties ({0})"), - [9 /* Enum */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('enum', "enumerations ({0})"), - [21 /* EnumMember */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('enumMember', "enumeration members ({0})"), - [14 /* String */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('string', "strings ({0})"), - [0 /* File */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('file', "files ({0})"), - [17 /* Array */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('array', "arrays ({0})"), - [15 /* Number */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('number', "numbers ({0})"), - [16 /* Boolean */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('boolean', "booleans ({0})"), - [18 /* Object */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('object', "objects ({0})"), - [19 /* Key */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('key', "keys ({0})"), - [7 /* Field */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('field', "fields ({0})"), - [13 /* Constant */]: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('constant', "constants ({0})") -}; -//#endregion - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/rename/media/onTypeRename.css": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/rename/media/onTypeRename.css ***! - \****************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_onTypeRename_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./onTypeRename.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/rename/media/onTypeRename.css"); -/* harmony import */ var _css_loader_dist_cjs_js_onTypeRename_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_onTypeRename_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_onTypeRename_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_onTypeRename_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/rename/onTypeRename.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/rename/onTypeRename.js ***! - \*********************************************************************************/ -/*! exports provided: CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE, OnTypeRenameContribution, OnTypeRenameAction, getOnTypeRenameRanges, editorOnTypeRenameBackground */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE", function() { return CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OnTypeRenameContribution", function() { return OnTypeRenameContribution; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OnTypeRenameAction", function() { return OnTypeRenameAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOnTypeRenameRanges", function() { return getOnTypeRenameRanges; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorOnTypeRenameBackground", function() { return editorOnTypeRenameBackground; }); -/* harmony import */ var _media_onTypeRename_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/onTypeRename.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/rename/media/onTypeRename.css"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../common/modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - - - - - - -const CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["RawContextKey"]('onTypeRenameInputVisible', false); -let OnTypeRenameContribution = class OnTypeRenameContribution extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["Disposable"] { - constructor(editor, contextKeyService) { - super(); - this._debounceDuration = 200; - this._localToDispose = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"]()); - this._editor = editor; - this._enabled = false; - this._visibleContextKey = CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE.bindTo(contextKeyService); - this._currentDecorations = []; - this._languageWordPattern = null; - this._currentWordPattern = null; - this._ignoreChangeEvent = false; - this._localToDispose = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"]()); - this._rangeUpdateTriggerPromise = null; - this._rangeSyncTriggerPromise = null; - this._currentRequest = null; - this._currentRequestPosition = null; - this._currentRequestModelVersion = null; - this._register(this._editor.onDidChangeModel(() => this.reinitialize())); - this._register(this._editor.onDidChangeConfiguration(e => { - if (e.hasChanged(73 /* renameOnType */)) { - this.reinitialize(); - } - })); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_8__["OnTypeRenameProviderRegistry"].onDidChange(() => this.reinitialize())); - this._register(this._editor.onDidChangeModelLanguage(() => this.reinitialize())); - this.reinitialize(); - } - static get(editor) { - return editor.getContribution(OnTypeRenameContribution.ID); - } - reinitialize() { - const model = this._editor.getModel(); - const isEnabled = model !== null && this._editor.getOption(73 /* renameOnType */) && _common_modes_js__WEBPACK_IMPORTED_MODULE_8__["OnTypeRenameProviderRegistry"].has(model); - if (isEnabled === this._enabled) { - return; - } - this._enabled = isEnabled; - this.clearRanges(); - this._localToDispose.clear(); - if (!isEnabled || model === null) { - return; - } - this._languageWordPattern = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_20__["LanguageConfigurationRegistry"].getWordDefinition(model.getLanguageIdentifier().id); - this._localToDispose.add(model.onDidChangeLanguageConfiguration(() => { - this._languageWordPattern = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_20__["LanguageConfigurationRegistry"].getWordDefinition(model.getLanguageIdentifier().id); - })); - const rangeUpdateScheduler = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_9__["Delayer"](this._debounceDuration); - const triggerRangeUpdate = () => { - this._rangeUpdateTriggerPromise = rangeUpdateScheduler.trigger(() => this.updateRanges(), this._debounceDuration); - }; - const rangeSyncScheduler = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_9__["Delayer"](0); - const triggerRangeSync = (decorations) => { - this._rangeSyncTriggerPromise = rangeSyncScheduler.trigger(() => this._syncRanges(decorations)); - }; - this._localToDispose.add(this._editor.onDidChangeCursorPosition(() => { - triggerRangeUpdate(); - })); - this._localToDispose.add(this._editor.onDidChangeModelContent((e) => { - if (!this._ignoreChangeEvent) { - if (this._currentDecorations.length > 0) { - const referenceRange = model.getDecorationRange(this._currentDecorations[0]); - if (referenceRange && e.changes.every(c => referenceRange.intersectRanges(c.range))) { - triggerRangeSync(this._currentDecorations); - return; - } - } - } - triggerRangeUpdate(); - })); - this._localToDispose.add({ - dispose: () => { - rangeUpdateScheduler.cancel(); - rangeSyncScheduler.cancel(); - } - }); - this.updateRanges(); - } - _syncRanges(decorations) { - // dalayed invocation, make sure we're still on - if (!this._editor.hasModel() || decorations !== this._currentDecorations || decorations.length === 0) { - // nothing to do - return; - } - const model = this._editor.getModel(); - const referenceRange = model.getDecorationRange(decorations[0]); - if (!referenceRange || referenceRange.startLineNumber !== referenceRange.endLineNumber) { - return this.clearRanges(); - } - const referenceValue = model.getValueInRange(referenceRange); - if (this._currentWordPattern) { - const match = referenceValue.match(this._currentWordPattern); - const matchLength = match ? match[0].length : 0; - if (matchLength !== referenceValue.length) { - return this.clearRanges(); - } - } - let edits = []; - for (let i = 1, len = decorations.length; i < len; i++) { - const mirrorRange = model.getDecorationRange(decorations[i]); - if (!mirrorRange) { - continue; - } - if (mirrorRange.startLineNumber !== mirrorRange.endLineNumber) { - edits.push({ - range: mirrorRange, - text: referenceValue - }); - } - else { - let oldValue = model.getValueInRange(mirrorRange); - let newValue = referenceValue; - let rangeStartColumn = mirrorRange.startColumn; - let rangeEndColumn = mirrorRange.endColumn; - const commonPrefixLength = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_16__["commonPrefixLength"](oldValue, newValue); - rangeStartColumn += commonPrefixLength; - oldValue = oldValue.substr(commonPrefixLength); - newValue = newValue.substr(commonPrefixLength); - const commonSuffixLength = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_16__["commonSuffixLength"](oldValue, newValue); - rangeEndColumn -= commonSuffixLength; - oldValue = oldValue.substr(0, oldValue.length - commonSuffixLength); - newValue = newValue.substr(0, newValue.length - commonSuffixLength); - if (rangeStartColumn !== rangeEndColumn || newValue.length !== 0) { - edits.push({ - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](mirrorRange.startLineNumber, rangeStartColumn, mirrorRange.endLineNumber, rangeEndColumn), - text: newValue - }); - } - } - } - if (edits.length === 0) { - return; - } - try { - this._ignoreChangeEvent = true; - const prevEditOperationType = this._editor._getViewModel().getPrevEditOperationType(); - this._editor.executeEdits('onTypeRename', edits); - this._editor._getViewModel().setPrevEditOperationType(prevEditOperationType); - } - finally { - this._ignoreChangeEvent = false; - } - } - dispose() { - this.clearRanges(); - super.dispose(); - } - clearRanges() { - this._visibleContextKey.set(false); - this._currentDecorations = this._editor.deltaDecorations(this._currentDecorations, []); - if (this._currentRequest) { - this._currentRequest.cancel(); - this._currentRequest = null; - this._currentRequestPosition = null; - } - } - updateRanges(force = false) { - return __awaiter(this, void 0, void 0, function* () { - if (!this._editor.hasModel()) { - this.clearRanges(); - return; - } - const position = this._editor.getPosition(); - if (!this._enabled && !force || this._editor.getSelections().length > 1) { - // disabled or multicursor - this.clearRanges(); - return; - } - const model = this._editor.getModel(); - const modelVersionId = model.getVersionId(); - if (this._currentRequestPosition && this._currentRequestModelVersion === modelVersionId) { - if (position.equals(this._currentRequestPosition)) { - return; // same position - } - if (this._currentDecorations && this._currentDecorations.length > 0) { - const range = model.getDecorationRange(this._currentDecorations[0]); - if (range && range.containsPosition(position)) { - return; // just moving inside the existing primary range - } - } - } - this._currentRequestPosition = position; - this._currentRequestModelVersion = modelVersionId; - const request = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_9__["createCancelablePromise"])((token) => __awaiter(this, void 0, void 0, function* () { - try { - const response = yield getOnTypeRenameRanges(model, position, token); - if (request !== this._currentRequest) { - return; - } - this._currentRequest = null; - if (modelVersionId !== model.getVersionId()) { - return; - } - let ranges = []; - if (response === null || response === void 0 ? void 0 : response.ranges) { - ranges = response.ranges; - } - this._currentWordPattern = (response === null || response === void 0 ? void 0 : response.wordPattern) || this._languageWordPattern; - let foundReferenceRange = false; - for (let i = 0, len = ranges.length; i < len; i++) { - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].containsPosition(ranges[i], position)) { - foundReferenceRange = true; - if (i !== 0) { - const referenceRange = ranges[i]; - ranges.splice(i, 1); - ranges.unshift(referenceRange); - } - break; - } - } - if (!foundReferenceRange) { - // Cannot do on type rename if the ranges are not where the cursor is... - this.clearRanges(); - return; - } - const decorations = ranges.map(range => ({ range: range, options: OnTypeRenameContribution.DECORATION })); - this._visibleContextKey.set(true); - this._currentDecorations = this._editor.deltaDecorations(this._currentDecorations, decorations); - } - catch (err) { - if (!Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_15__["isPromiseCanceledError"])(err)) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_15__["onUnexpectedError"])(err); - } - if (this._currentRequest === request || !this._currentRequest) { - // stop if we are still the latest request - this.clearRanges(); - } - } - })); - this._currentRequest = request; - return request; - }); - } -}; -OnTypeRenameContribution.ID = 'editor.contrib.onTypeRename'; -OnTypeRenameContribution.DECORATION = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__["ModelDecorationOptions"].register({ - stickiness: 0 /* AlwaysGrowsWhenTypingAtEdges */, - className: 'on-type-rename-decoration' -}); -OnTypeRenameContribution = __decorate([ - __param(1, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["IContextKeyService"]) -], OnTypeRenameContribution); - -class OnTypeRenameAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.onTypeRename', - label: _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('onTypeRename.label', "On Type Rename Symbol"), - alias: 'On Type Rename Symbol', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_11__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_12__["EditorContextKeys"].writable, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_12__["EditorContextKeys"].hasRenameProvider), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_12__["EditorContextKeys"].editorTextFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 60 /* F2 */, - weight: 100 /* EditorContrib */ - } - }); - } - runCommand(accessor, args) { - const editorService = accessor.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_14__["ICodeEditorService"]); - const [uri, pos] = Array.isArray(args) && args || [undefined, undefined]; - if (_base_common_uri_js__WEBPACK_IMPORTED_MODULE_13__["URI"].isUri(uri) && _common_core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"].isIPosition(pos)) { - return editorService.openCodeEditor({ resource: uri }, editorService.getActiveCodeEditor()).then(editor => { - if (!editor) { - return; - } - editor.setPosition(pos); - editor.invokeWithinContext(accessor => { - this.reportTelemetry(accessor, editor); - return this.run(accessor, editor); - }); - }, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_15__["onUnexpectedError"]); - } - return super.runCommand(accessor, args); - } - run(_accessor, editor) { - const controller = OnTypeRenameContribution.get(editor); - if (controller) { - return Promise.resolve(controller.updateRanges(true)); - } - return Promise.resolve(); - } -} -const OnTypeRenameCommand = _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["EditorCommand"].bindToContribution(OnTypeRenameContribution.get); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorCommand"])(new OnTypeRenameCommand({ - id: 'cancelOnTypeRenameInput', - precondition: CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE, - handler: x => x.clearRanges(), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_12__["EditorContextKeys"].editorTextFocus, - weight: 100 /* EditorContrib */ + 99, - primary: 9 /* Escape */, - secondary: [1024 /* Shift */ | 9 /* Escape */] - } -})); -function getOnTypeRenameRanges(model, position, token) { - const orderedByScore = _common_modes_js__WEBPACK_IMPORTED_MODULE_8__["OnTypeRenameProviderRegistry"].ordered(model); - // in order of score ask the occurrences provider - // until someone response with a good result - // (good = none empty array) - return Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_9__["first"])(orderedByScore.map(provider => () => { - return Promise.resolve(provider.provideOnTypeRenameRanges(model, position, token)).then((res) => { - if (!res) { - return undefined; - } - return { - ranges: res.ranges, - wordPattern: res.wordPattern || provider.wordPattern - }; - }, (err) => { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_15__["onUnexpectedExternalError"])(err); - return undefined; - }); - }), result => !!result && _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_3__["isNonEmptyArray"](result === null || result === void 0 ? void 0 : result.ranges)); -} -const editorOnTypeRenameBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_17__["registerColor"])('editor.onTypeRenameBackground', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_19__["Color"].fromHex('#f00').transparent(0.3), light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_19__["Color"].fromHex('#f00').transparent(0.3), hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_19__["Color"].fromHex('#f00').transparent(0.3) }, _nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"]('editorOnTypeRenameBackground', 'Background color when the editor auto renames on type.')); -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_18__["registerThemingParticipant"])((theme, collector) => { - const editorOnTypeRenameBackgroundColor = theme.getColor(editorOnTypeRenameBackground); - if (editorOnTypeRenameBackgroundColor) { - collector.addRule(`.monaco-editor .on-type-rename-decoration { background: ${editorOnTypeRenameBackgroundColor}; border-left-color: ${editorOnTypeRenameBackgroundColor}; }`); - } -}); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerModelAndPositionCommand"])('_executeRenameOnTypeProvider', (model, position) => getOnTypeRenameRanges(model, position, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_6__["CancellationToken"].None)); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorContribution"])(OnTypeRenameContribution.ID, OnTypeRenameContribution); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorAction"])(OnTypeRenameAction); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/rename/rename.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/rename/rename.js ***! - \***************************************************************************/ -/*! exports provided: rename, RenameAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rename", function() { return rename; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenameAction", function() { return RenameAction; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../platform/progress/common/progress.js */ "./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _renameInputField_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./renameInputField.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/rename/renameInputField.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../base/browser/ui/aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _message_messageController_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../message/messageController.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/message/messageController.js"); -/* harmony import */ var _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../browser/core/editorState.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/core/editorState.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _browser_services_bulkEditService_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../browser/services/bulkEditService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/bulkEditService.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../platform/log/common/log.js */ "./node_modules/monaco-editor/esm/vs/platform/log/common/log.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../../platform/registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _platform_configuration_common_configurationRegistry_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../platform/configuration/common/configurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js"); -/* harmony import */ var _common_services_textResourceConfigurationService_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../common/services/textResourceConfigurationService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/textResourceConfigurationService.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - - - - - - - - - - - -class RenameSkeleton { - constructor(model, position) { - this.model = model; - this.position = position; - this._providerRenameIdx = 0; - this._providers = _common_modes_js__WEBPACK_IMPORTED_MODULE_7__["RenameProviderRegistry"].ordered(model); - } - hasProvider() { - return this._providers.length > 0; - } - resolveRenameLocation(token) { - return __awaiter(this, void 0, void 0, function* () { - const rejects = []; - for (this._providerRenameIdx = 0; this._providerRenameIdx < this._providers.length; this._providerRenameIdx++) { - const provider = this._providers[this._providerRenameIdx]; - if (!provider.resolveRenameLocation) { - break; - } - let res = yield provider.resolveRenameLocation(this.model, this.position, token); - if (!res) { - continue; - } - if (res.rejectReason) { - rejects.push(res.rejectReason); - continue; - } - return res; - } - const word = this.model.getWordAtPosition(this.position); - if (!word) { - return { - range: _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__["Range"].fromPositions(this.position), - text: '', - rejectReason: rejects.length > 0 ? rejects.join('\n') : undefined - }; - } - return { - range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__["Range"](this.position.lineNumber, word.startColumn, this.position.lineNumber, word.endColumn), - text: word.word, - rejectReason: rejects.length > 0 ? rejects.join('\n') : undefined - }; - }); - } - provideRenameEdits(newName, token) { - return __awaiter(this, void 0, void 0, function* () { - return this._provideRenameEdits(newName, this._providerRenameIdx, [], token); - }); - } - _provideRenameEdits(newName, i, rejects, token) { - return __awaiter(this, void 0, void 0, function* () { - const provider = this._providers[i]; - if (!provider) { - return { - edits: [], - rejectReason: rejects.join('\n') - }; - } - const result = yield provider.provideRenameEdits(this.model, this.position, newName, token); - if (!result) { - return this._provideRenameEdits(newName, i + 1, rejects.concat(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('no result', "No result.")), token); - } - else if (result.rejectReason) { - return this._provideRenameEdits(newName, i + 1, rejects.concat(result.rejectReason), token); - } - return result; - }); - } -} -function rename(model, position, newName) { - return __awaiter(this, void 0, void 0, function* () { - const skeleton = new RenameSkeleton(model, position); - const loc = yield skeleton.resolveRenameLocation(_base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_17__["CancellationToken"].None); - if (loc === null || loc === void 0 ? void 0 : loc.rejectReason) { - return { edits: [], rejectReason: loc.rejectReason }; - } - return skeleton.provideRenameEdits(newName, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_17__["CancellationToken"].None); - }); -} -// --- register actions and commands -let RenameController = class RenameController { - constructor(editor, _instaService, _notificationService, _bulkEditService, _progressService, _logService, _configService) { - this.editor = editor; - this._instaService = _instaService; - this._notificationService = _notificationService; - this._bulkEditService = _bulkEditService; - this._progressService = _progressService; - this._logService = _logService; - this._configService = _configService; - this._dispoableStore = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_18__["DisposableStore"](); - this._cts = new _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_17__["CancellationTokenSource"](); - this._renameInputField = this._dispoableStore.add(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_19__["IdleValue"](() => this._dispoableStore.add(this._instaService.createInstance(_renameInputField_js__WEBPACK_IMPORTED_MODULE_6__["RenameInputField"], this.editor, ['acceptRenameInput', 'acceptRenameInputWithPreview'])))); - } - static get(editor) { - return editor.getContribution(RenameController.ID); - } - dispose() { - this._dispoableStore.dispose(); - this._cts.dispose(true); - } - run() { - return __awaiter(this, void 0, void 0, function* () { - this._cts.dispose(true); - if (!this.editor.hasModel()) { - return undefined; - } - const position = this.editor.getPosition(); - const skeleton = new RenameSkeleton(this.editor.getModel(), position); - if (!skeleton.hasProvider()) { - return undefined; - } - this._cts = new _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_12__["EditorStateCancellationTokenSource"](this.editor, 4 /* Position */ | 1 /* Value */); - // resolve rename location - let loc; - try { - const resolveLocationOperation = skeleton.resolveRenameLocation(this._cts.token); - this._progressService.showWhile(resolveLocationOperation, 250); - loc = yield resolveLocationOperation; - } - catch (e) { - _message_messageController_js__WEBPACK_IMPORTED_MODULE_11__["MessageController"].get(this.editor).showMessage(e || _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('resolveRenameLocationFailed', "An unknown error occurred while resolving rename location"), position); - return undefined; - } - if (!loc) { - return undefined; - } - if (loc.rejectReason) { - _message_messageController_js__WEBPACK_IMPORTED_MODULE_11__["MessageController"].get(this.editor).showMessage(loc.rejectReason, position); - return undefined; - } - if (this._cts.token.isCancellationRequested) { - return undefined; - } - this._cts.dispose(); - this._cts = new _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_12__["EditorStateCancellationTokenSource"](this.editor, 4 /* Position */ | 1 /* Value */, loc.range); - // do rename at location - let selection = this.editor.getSelection(); - let selectionStart = 0; - let selectionEnd = loc.text.length; - if (!_common_core_range_js__WEBPACK_IMPORTED_MODULE_10__["Range"].isEmpty(selection) && !_common_core_range_js__WEBPACK_IMPORTED_MODULE_10__["Range"].spansMultipleLines(selection) && _common_core_range_js__WEBPACK_IMPORTED_MODULE_10__["Range"].containsRange(loc.range, selection)) { - selectionStart = Math.max(0, selection.startColumn - loc.range.startColumn); - selectionEnd = Math.min(loc.range.endColumn, selection.endColumn) - loc.range.startColumn; - } - const supportPreview = this._bulkEditService.hasPreviewHandler() && this._configService.getValue(this.editor.getModel().uri, 'editor.rename.enablePreview'); - const inputFieldResult = yield this._renameInputField.value.getInput(loc.range, loc.text, selectionStart, selectionEnd, supportPreview, this._cts.token); - // no result, only hint to focus the editor or not - if (typeof inputFieldResult === 'boolean') { - if (inputFieldResult) { - this.editor.focus(); - } - return undefined; - } - this.editor.focus(); - const renameOperation = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_19__["raceCancellation"])(skeleton.provideRenameEdits(inputFieldResult.newName, this._cts.token), this._cts.token).then((renameResult) => __awaiter(this, void 0, void 0, function* () { - if (!renameResult || !this.editor.hasModel()) { - return; - } - if (renameResult.rejectReason) { - this._notificationService.info(renameResult.rejectReason); - return; - } - this._bulkEditService.apply(_browser_services_bulkEditService_js__WEBPACK_IMPORTED_MODULE_14__["ResourceEdit"].convert(renameResult), { - editor: this.editor, - showPreview: inputFieldResult.wantsPreview, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('label', "Renaming '{0}'", loc === null || loc === void 0 ? void 0 : loc.text), - quotableLabel: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('quotableLabel', "Renaming {0}", loc === null || loc === void 0 ? void 0 : loc.text), - }).then(result => { - if (result.ariaSummary) { - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_9__["alert"])(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('aria', "Successfully renamed '{0}' to '{1}'. Summary: {2}", loc.text, inputFieldResult.newName, result.ariaSummary)); - } - }).catch(err => { - this._notificationService.error(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('rename.failedApply', "Rename failed to apply edits")); - this._logService.error(err); - }); - }), err => { - this._notificationService.error(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('rename.failed', "Rename failed to compute edits")); - this._logService.error(err); - }); - this._progressService.showWhile(renameOperation, 250); - return renameOperation; - }); - } - acceptRenameInput(wantsPreview) { - this._renameInputField.value.acceptInput(wantsPreview); - } - cancelRenameInput() { - this._renameInputField.value.cancelInput(true); - } -}; -RenameController.ID = 'editor.contrib.renameController'; -RenameController = __decorate([ - __param(1, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_21__["IInstantiationService"]), - __param(2, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_13__["INotificationService"]), - __param(3, _browser_services_bulkEditService_js__WEBPACK_IMPORTED_MODULE_14__["IBulkEditService"]), - __param(4, _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_3__["IEditorProgressService"]), - __param(5, _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_20__["ILogService"]), - __param(6, _common_services_textResourceConfigurationService_js__WEBPACK_IMPORTED_MODULE_24__["ITextResourceConfigurationService"]) -], RenameController); -// ---- action implementation -class RenameAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.rename', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('rename.label', "Rename Symbol"), - alias: 'Rename Symbol', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_2__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].writable, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].hasRenameProvider), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].editorTextFocus, - primary: 60 /* F2 */, - weight: 100 /* EditorContrib */ - }, - contextMenuOpts: { - group: '1_modification', - order: 1.1 - } - }); - } - runCommand(accessor, args) { - const editorService = accessor.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_16__["ICodeEditorService"]); - const [uri, pos] = Array.isArray(args) && args || [undefined, undefined]; - if (_base_common_uri_js__WEBPACK_IMPORTED_MODULE_15__["URI"].isUri(uri) && _common_core_position_js__WEBPACK_IMPORTED_MODULE_8__["Position"].isIPosition(pos)) { - return editorService.openCodeEditor({ resource: uri }, editorService.getActiveCodeEditor()).then(editor => { - if (!editor) { - return; - } - editor.setPosition(pos); - editor.invokeWithinContext(accessor => { - this.reportTelemetry(accessor, editor); - return this.run(accessor, editor); - }); - }, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_1__["onUnexpectedError"]); - } - return super.runCommand(accessor, args); - } - run(accessor, editor) { - const controller = RenameController.get(editor); - if (controller) { - return controller.run(); - } - return Promise.resolve(); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorContribution"])(RenameController.ID, RenameController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(RenameAction); -const RenameCommand = _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorCommand"].bindToContribution(RenameController.get); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new RenameCommand({ - id: 'acceptRenameInput', - precondition: _renameInputField_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_RENAME_INPUT_VISIBLE"], - handler: x => x.acceptRenameInput(false), - kbOpts: { - weight: 100 /* EditorContrib */ + 99, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: 3 /* Enter */ - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new RenameCommand({ - id: 'acceptRenameInputWithPreview', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_2__["ContextKeyExpr"].and(_renameInputField_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_RENAME_INPUT_VISIBLE"], _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_2__["ContextKeyExpr"].has('config.editor.rename.enablePreview')), - handler: x => x.acceptRenameInput(true), - kbOpts: { - weight: 100 /* EditorContrib */ + 99, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: 1024 /* Shift */ + 3 /* Enter */ - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorCommand"])(new RenameCommand({ - id: 'cancelRenameInput', - precondition: _renameInputField_js__WEBPACK_IMPORTED_MODULE_6__["CONTEXT_RENAME_INPUT_VISIBLE"], - handler: x => x.cancelRenameInput(), - kbOpts: { - weight: 100 /* EditorContrib */ + 99, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_5__["EditorContextKeys"].focus, - primary: 9 /* Escape */, - secondary: [1024 /* Shift */ | 9 /* Escape */] - } -})); -// ---- api bridge command -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerModelAndPositionCommand"])('_executeDocumentRenameProvider', function (model, position, ...args) { - const [newName] = args; - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_25__["assertType"])(typeof newName === 'string'); - return rename(model, position, newName); -}); -//todo@joh use editor options world -_platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_22__["Registry"].as(_platform_configuration_common_configurationRegistry_js__WEBPACK_IMPORTED_MODULE_23__["Extensions"].Configuration).registerConfiguration({ - id: 'editor', - properties: { - 'editor.rename.enablePreview': { - scope: 5 /* LANGUAGE_OVERRIDABLE */, - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('enablePreview', "Enable/disable the ability to preview changes before renaming"), - default: true, - type: 'boolean' - } - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/rename/renameInputField.css": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/rename/renameInputField.css ***! - \**************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_renameInputField_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./renameInputField.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/rename/renameInputField.css"); -/* harmony import */ var _css_loader_dist_cjs_js_renameInputField_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_renameInputField_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_renameInputField_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_renameInputField_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/rename/renameInputField.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/rename/renameInputField.js ***! - \*************************************************************************************/ -/*! exports provided: CONTEXT_RENAME_INPUT_VISIBLE, RenameInputField */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTEXT_RENAME_INPUT_VISIBLE", function() { return CONTEXT_RENAME_INPUT_VISIBLE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenameInputField", function() { return RenameInputField; }); -/* harmony import */ var _renameInputField_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./renameInputField.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/rename/renameInputField.css"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - -const CONTEXT_RENAME_INPUT_VISIBLE = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["RawContextKey"]('renameInputVisible', false); -let RenameInputField = class RenameInputField { - constructor(_editor, _acceptKeybindings, _themeService, _keybindingService, contextKeyService) { - this._editor = _editor; - this._acceptKeybindings = _acceptKeybindings; - this._themeService = _themeService; - this._keybindingService = _keybindingService; - this._disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this.allowEditorOverflow = true; - this._visibleContextKey = CONTEXT_RENAME_INPUT_VISIBLE.bindTo(contextKeyService); - this._editor.addContentWidget(this); - this._disposables.add(this._editor.onDidChangeConfiguration(e => { - if (e.hasChanged(36 /* fontInfo */)) { - this._updateFont(); - } - })); - this._disposables.add(_themeService.onDidColorThemeChange(this._updateStyles, this)); - } - dispose() { - this._disposables.dispose(); - this._editor.removeContentWidget(this); - } - getId() { - return '__renameInputWidget'; - } - getDomNode() { - if (!this._domNode) { - this._domNode = document.createElement('div'); - this._domNode.className = 'monaco-editor rename-box'; - this._input = document.createElement('input'); - this._input.className = 'rename-input'; - this._input.type = 'text'; - this._input.setAttribute('aria-label', Object(_nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"])('renameAriaLabel', "Rename input. Type new name and press Enter to commit.")); - this._domNode.appendChild(this._input); - this._label = document.createElement('div'); - this._label.className = 'rename-label'; - this._domNode.appendChild(this._label); - const updateLabel = () => { - var _a, _b; - const [accept, preview] = this._acceptKeybindings; - this._keybindingService.lookupKeybinding(accept); - this._label.innerText = Object(_nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"])({ key: 'label', comment: ['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"'] }, "{0} to Rename, {1} to Preview", (_a = this._keybindingService.lookupKeybinding(accept)) === null || _a === void 0 ? void 0 : _a.getLabel(), (_b = this._keybindingService.lookupKeybinding(preview)) === null || _b === void 0 ? void 0 : _b.getLabel()); - }; - updateLabel(); - this._disposables.add(this._keybindingService.onDidUpdateKeybindings(updateLabel)); - this._updateFont(); - this._updateStyles(this._themeService.getColorTheme()); - } - return this._domNode; - } - _updateStyles(theme) { - var _a, _b, _c, _d; - if (!this._input || !this._domNode) { - return; - } - const widgetShadowColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["widgetShadow"]); - this._domNode.style.backgroundColor = String((_a = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["editorWidgetBackground"])) !== null && _a !== void 0 ? _a : ''); - this._domNode.style.boxShadow = widgetShadowColor ? ` 0 2px 8px ${widgetShadowColor}` : ''; - this._domNode.style.color = String((_b = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["inputForeground"])) !== null && _b !== void 0 ? _b : ''); - this._input.style.backgroundColor = String((_c = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["inputBackground"])) !== null && _c !== void 0 ? _c : ''); - // this._input.style.color = String(theme.getColor(inputForeground) ?? ''); - const border = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_5__["inputBorder"]); - this._input.style.borderWidth = border ? '1px' : '0px'; - this._input.style.borderStyle = border ? 'solid' : 'none'; - this._input.style.borderColor = (_d = border === null || border === void 0 ? void 0 : border.toString()) !== null && _d !== void 0 ? _d : 'none'; - } - _updateFont() { - if (!this._input || !this._label) { - return; - } - const fontInfo = this._editor.getOption(36 /* fontInfo */); - this._input.style.fontFamily = fontInfo.fontFamily; - this._input.style.fontWeight = fontInfo.fontWeight; - this._input.style.fontSize = `${fontInfo.fontSize}px`; - this._label.style.fontSize = `${fontInfo.fontSize * 0.8}px`; - } - getPosition() { - if (!this._visible) { - return null; - } - return { - position: this._position, - preference: [2 /* BELOW */, 1 /* ABOVE */] - }; - } - acceptInput(wantsPreview) { - if (this._currentAcceptInput) { - this._currentAcceptInput(wantsPreview); - } - } - cancelInput(focusEditor) { - if (this._currentCancelInput) { - this._currentCancelInput(focusEditor); - } - } - getInput(where, value, selectionStart, selectionEnd, supportPreview, token) { - this._domNode.classList.toggle('preview', supportPreview); - this._position = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_2__["Position"](where.startLineNumber, where.startColumn); - this._input.value = value; - this._input.setAttribute('selectionStart', selectionStart.toString()); - this._input.setAttribute('selectionEnd', selectionEnd.toString()); - this._input.size = Math.max((where.endColumn - where.startColumn) * 1.1, 20); - const disposeOnDone = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - return new Promise(resolve => { - this._currentCancelInput = (focusEditor) => { - this._currentAcceptInput = undefined; - this._currentCancelInput = undefined; - resolve(focusEditor); - return true; - }; - this._currentAcceptInput = (wantsPreview) => { - if (this._input.value.trim().length === 0 || this._input.value === value) { - // empty or whitespace only or not changed - this.cancelInput(true); - return; - } - this._currentAcceptInput = undefined; - this._currentCancelInput = undefined; - resolve({ - newName: this._input.value, - wantsPreview: supportPreview && wantsPreview - }); - }; - token.onCancellationRequested(() => this.cancelInput(true)); - disposeOnDone.add(this._editor.onDidBlurEditorWidget(() => this.cancelInput(false))); - this._show(); - }).finally(() => { - disposeOnDone.dispose(); - this._hide(); - }); - } - _show() { - this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber, 0 /* Smooth */); - this._visible = true; - this._visibleContextKey.set(true); - this._editor.layoutContentWidget(this); - setTimeout(() => { - this._input.focus(); - this._input.setSelectionRange(parseInt(this._input.getAttribute('selectionStart')), parseInt(this._input.getAttribute('selectionEnd'))); - }, 100); - } - _hide() { - this._visible = false; - this._visibleContextKey.reset(); - this._editor.layoutContentWidget(this); - } -}; -RenameInputField = __decorate([ - __param(2, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_6__["IThemeService"]), - __param(3, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_7__["IKeybindingService"]), - __param(4, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["IContextKeyService"]) -], RenameInputField); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/bracketSelections.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/bracketSelections.js ***! - \*******************************************************************************************/ -/*! exports provided: BracketSelectionRangeProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BracketSelectionRangeProvider", function() { return BracketSelectionRangeProvider; }); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - -class BracketSelectionRangeProvider { - provideSelectionRanges(model, positions) { - return __awaiter(this, void 0, void 0, function* () { - const result = []; - for (const position of positions) { - const bucket = []; - result.push(bucket); - const ranges = new Map(); - yield new Promise(resolve => BracketSelectionRangeProvider._bracketsRightYield(resolve, 0, model, position, ranges)); - yield new Promise(resolve => BracketSelectionRangeProvider._bracketsLeftYield(resolve, 0, model, position, ranges, bucket)); - } - return result; - }); - } - static _bracketsRightYield(resolve, round, model, pos, ranges) { - const counts = new Map(); - const t1 = Date.now(); - while (true) { - if (round >= BracketSelectionRangeProvider._maxRounds) { - resolve(); - break; - } - if (!pos) { - resolve(); - break; - } - let bracket = model.findNextBracket(pos); - if (!bracket) { - resolve(); - break; - } - let d = Date.now() - t1; - if (d > BracketSelectionRangeProvider._maxDuration) { - setTimeout(() => BracketSelectionRangeProvider._bracketsRightYield(resolve, round + 1, model, pos, ranges)); - break; - } - const key = bracket.close[0]; - if (bracket.isOpen) { - // wait for closing - let val = counts.has(key) ? counts.get(key) : 0; - counts.set(key, val + 1); - } - else { - // process closing - let val = counts.has(key) ? counts.get(key) : 0; - val -= 1; - counts.set(key, Math.max(0, val)); - if (val < 0) { - let list = ranges.get(key); - if (!list) { - list = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_2__["LinkedList"](); - ranges.set(key, list); - } - list.push(bracket.range); - } - } - pos = bracket.range.getEndPosition(); - } - } - static _bracketsLeftYield(resolve, round, model, pos, ranges, bucket) { - const counts = new Map(); - const t1 = Date.now(); - while (true) { - if (round >= BracketSelectionRangeProvider._maxRounds && ranges.size === 0) { - resolve(); - break; - } - if (!pos) { - resolve(); - break; - } - let bracket = model.findPrevBracket(pos); - if (!bracket) { - resolve(); - break; - } - let d = Date.now() - t1; - if (d > BracketSelectionRangeProvider._maxDuration) { - setTimeout(() => BracketSelectionRangeProvider._bracketsLeftYield(resolve, round + 1, model, pos, ranges, bucket)); - break; - } - const key = bracket.close[0]; - if (!bracket.isOpen) { - // wait for opening - let val = counts.has(key) ? counts.get(key) : 0; - counts.set(key, val + 1); - } - else { - // opening - let val = counts.has(key) ? counts.get(key) : 0; - val -= 1; - counts.set(key, Math.max(0, val)); - if (val < 0) { - let list = ranges.get(key); - if (list) { - let closing = list.shift(); - if (list.size === 0) { - ranges.delete(key); - } - const innerBracket = _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].fromPositions(bracket.range.getEndPosition(), closing.getStartPosition()); - const outerBracket = _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].fromPositions(bracket.range.getStartPosition(), closing.getEndPosition()); - bucket.push({ range: innerBracket }); - bucket.push({ range: outerBracket }); - BracketSelectionRangeProvider._addBracketLeading(model, outerBracket, bucket); - } - } - } - pos = bracket.range.getStartPosition(); - } - } - static _addBracketLeading(model, bracket, bucket) { - if (bracket.startLineNumber === bracket.endLineNumber) { - return; - } - // xxxxxxxx { - // - // } - const startLine = bracket.startLineNumber; - const column = model.getLineFirstNonWhitespaceColumn(startLine); - if (column !== 0 && column !== bracket.startColumn) { - bucket.push({ range: _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].fromPositions(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](startLine, column), bracket.getEndPosition()) }); - bucket.push({ range: _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].fromPositions(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](startLine, 1), bracket.getEndPosition()) }); - } - // xxxxxxxx - // { - // - // } - const aboveLine = startLine - 1; - if (aboveLine > 0) { - const column = model.getLineFirstNonWhitespaceColumn(aboveLine); - if (column === bracket.startColumn && column !== model.getLineLastNonWhitespaceColumn(aboveLine)) { - bucket.push({ range: _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].fromPositions(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](aboveLine, column), bracket.getEndPosition()) }); - bucket.push({ range: _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].fromPositions(new _common_core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](aboveLine, 1), bracket.getEndPosition()) }); - } - } - } -} -BracketSelectionRangeProvider._maxDuration = 30; -BracketSelectionRangeProvider._maxRounds = 2; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/smartSelect.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/smartSelect.js ***! - \*************************************************************************************/ -/*! exports provided: provideSelectionRanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "provideSelectionRanges", function() { return provideSelectionRanges; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _wordSelections_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./wordSelections.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/wordSelections.js"); -/* harmony import */ var _bracketSelections_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./bracketSelections.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/bracketSelections.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - -class SelectionRanges { - constructor(index, ranges) { - this.index = index; - this.ranges = ranges; - } - mov(fwd) { - let index = this.index + (fwd ? 1 : -1); - if (index < 0 || index >= this.ranges.length) { - return this; - } - const res = new SelectionRanges(index, this.ranges); - if (res.ranges[index].equalsRange(this.ranges[this.index])) { - // next range equals this range, retry with next-next - return res.mov(fwd); - } - return res; - } -} -class SmartSelectController { - constructor(editor) { - this._ignoreSelection = false; - this._editor = editor; - } - static get(editor) { - return editor.getContribution(SmartSelectController.ID); - } - dispose() { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_10__["dispose"])(this._selectionListener); - } - run(forward) { - if (!this._editor.hasModel()) { - return; - } - const selections = this._editor.getSelections(); - const model = this._editor.getModel(); - if (!_common_modes_js__WEBPACK_IMPORTED_MODULE_7__["SelectionRangeRegistry"].has(model)) { - return; - } - let promise = Promise.resolve(undefined); - if (!this._state) { - promise = provideSelectionRanges(model, selections.map(s => s.getPosition()), _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationToken"].None).then(ranges => { - if (!_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["isNonEmptyArray"](ranges) || ranges.length !== selections.length) { - // invalid result - return; - } - if (!this._editor.hasModel() || !_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["equals"](this._editor.getSelections(), selections, (a, b) => a.equalsSelection(b))) { - // invalid editor state - return; - } - for (let i = 0; i < ranges.length; i++) { - ranges[i] = ranges[i].filter(range => { - // filter ranges inside the selection - return range.containsPosition(selections[i].getStartPosition()) && range.containsPosition(selections[i].getEndPosition()); - }); - // prepend current selection - ranges[i].unshift(selections[i]); - } - this._state = ranges.map(ranges => new SelectionRanges(0, ranges)); - // listen to caret move and forget about state - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_10__["dispose"])(this._selectionListener); - this._selectionListener = this._editor.onDidChangeCursorPosition(() => { - if (!this._ignoreSelection) { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_10__["dispose"])(this._selectionListener); - this._state = undefined; - } - }); - }); - } - return promise.then(() => { - if (!this._state) { - // no state - return; - } - this._state = this._state.map(state => state.mov(forward)); - const selections = this._state.map(state => _common_core_selection_js__WEBPACK_IMPORTED_MODULE_5__["Selection"].fromPositions(state.ranges[state.index].getStartPosition(), state.ranges[state.index].getEndPosition())); - this._ignoreSelection = true; - try { - this._editor.setSelections(selections); - } - finally { - this._ignoreSelection = false; - } - }); - } -} -SmartSelectController.ID = 'editor.contrib.smartSelectController'; -class AbstractSmartSelect extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["EditorAction"] { - constructor(forward, opts) { - super(opts); - this._forward = forward; - } - run(_accessor, editor) { - return __awaiter(this, void 0, void 0, function* () { - let controller = SmartSelectController.get(editor); - if (controller) { - yield controller.run(this._forward); - } - }); - } -} -class GrowSelectionAction extends AbstractSmartSelect { - constructor() { - super(true, { - id: 'editor.action.smartSelect.expand', - label: _nls_js__WEBPACK_IMPORTED_MODULE_8__["localize"]('smartSelect.expand', "Expand Selection"), - alias: 'Expand Selection', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__["EditorContextKeys"].editorTextFocus, - primary: 1024 /* Shift */ | 512 /* Alt */ | 17 /* RightArrow */, - mac: { - primary: 2048 /* CtrlCmd */ | 256 /* WinCtrl */ | 1024 /* Shift */ | 17 /* RightArrow */, - secondary: [256 /* WinCtrl */ | 1024 /* Shift */ | 17 /* RightArrow */], - }, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_9__["MenuId"].MenubarSelectionMenu, - group: '1_basic', - title: _nls_js__WEBPACK_IMPORTED_MODULE_8__["localize"]({ key: 'miSmartSelectGrow', comment: ['&& denotes a mnemonic'] }, "&&Expand Selection"), - order: 2 - } - }); - } -} -// renamed command id -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_13__["CommandsRegistry"].registerCommandAlias('editor.action.smartSelect.grow', 'editor.action.smartSelect.expand'); -class ShrinkSelectionAction extends AbstractSmartSelect { - constructor() { - super(false, { - id: 'editor.action.smartSelect.shrink', - label: _nls_js__WEBPACK_IMPORTED_MODULE_8__["localize"]('smartSelect.shrink', "Shrink Selection"), - alias: 'Shrink Selection', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_6__["EditorContextKeys"].editorTextFocus, - primary: 1024 /* Shift */ | 512 /* Alt */ | 15 /* LeftArrow */, - mac: { - primary: 2048 /* CtrlCmd */ | 256 /* WinCtrl */ | 1024 /* Shift */ | 15 /* LeftArrow */, - secondary: [256 /* WinCtrl */ | 1024 /* Shift */ | 15 /* LeftArrow */], - }, - weight: 100 /* EditorContrib */ - }, - menuOpts: { - menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_9__["MenuId"].MenubarSelectionMenu, - group: '1_basic', - title: _nls_js__WEBPACK_IMPORTED_MODULE_8__["localize"]({ key: 'miSmartSelectShrink', comment: ['&& denotes a mnemonic'] }, "&&Shrink Selection"), - order: 3 - } - }); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorContribution"])(SmartSelectController.ID, SmartSelectController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorAction"])(GrowSelectionAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorAction"])(ShrinkSelectionAction); -// word selection -_common_modes_js__WEBPACK_IMPORTED_MODULE_7__["SelectionRangeRegistry"].register('*', new _wordSelections_js__WEBPACK_IMPORTED_MODULE_11__["WordSelectionRangeProvider"]()); -function provideSelectionRanges(model, positions, token) { - const providers = _common_modes_js__WEBPACK_IMPORTED_MODULE_7__["SelectionRangeRegistry"].all(model); - if (providers.length === 1) { - // add word selection and bracket selection when no provider exists - providers.unshift(new _bracketSelections_js__WEBPACK_IMPORTED_MODULE_12__["BracketSelectionRangeProvider"]()); - } - let work = []; - let allRawRanges = []; - for (const provider of providers) { - work.push(Promise.resolve(provider.provideSelectionRanges(model, positions, token)).then(allProviderRanges => { - if (_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["isNonEmptyArray"](allProviderRanges) && allProviderRanges.length === positions.length) { - for (let i = 0; i < positions.length; i++) { - if (!allRawRanges[i]) { - allRawRanges[i] = []; - } - for (const oneProviderRanges of allProviderRanges[i]) { - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].isIRange(oneProviderRanges.range) && _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].containsPosition(oneProviderRanges.range, positions[i])) { - allRawRanges[i].push(_common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].lift(oneProviderRanges.range)); - } - } - } - } - }, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_14__["onUnexpectedExternalError"])); - } - return Promise.all(work).then(() => { - return allRawRanges.map(oneRawRanges => { - if (oneRawRanges.length === 0) { - return []; - } - // sort all by start/end position - oneRawRanges.sort((a, b) => { - if (_common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"].isBefore(a.getStartPosition(), b.getStartPosition())) { - return 1; - } - else if (_common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"].isBefore(b.getStartPosition(), a.getStartPosition())) { - return -1; - } - else if (_common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"].isBefore(a.getEndPosition(), b.getEndPosition())) { - return -1; - } - else if (_common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"].isBefore(b.getEndPosition(), a.getEndPosition())) { - return 1; - } - else { - return 0; - } - }); - // remove ranges that don't contain the former range or that are equal to the - // former range - let oneRanges = []; - let last; - for (const range of oneRawRanges) { - if (!last || (_common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].containsRange(range, last) && !_common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"].equalsRange(range, last))) { - oneRanges.push(range); - last = range; - } - } - // add ranges that expand trivia at line starts and ends whenever a range - // wraps onto the a new line - let oneRangesWithTrivia = [oneRanges[0]]; - for (let i = 1; i < oneRanges.length; i++) { - const prev = oneRanges[i - 1]; - const cur = oneRanges[i]; - if (cur.startLineNumber !== prev.startLineNumber || cur.endLineNumber !== prev.endLineNumber) { - // add line/block range without leading/failing whitespace - const rangeNoWhitespace = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](prev.startLineNumber, model.getLineFirstNonWhitespaceColumn(prev.startLineNumber), prev.endLineNumber, model.getLineLastNonWhitespaceColumn(prev.endLineNumber)); - if (rangeNoWhitespace.containsRange(prev) && !rangeNoWhitespace.equalsRange(prev) && cur.containsRange(rangeNoWhitespace) && !cur.equalsRange(rangeNoWhitespace)) { - oneRangesWithTrivia.push(rangeNoWhitespace); - } - // add line/block range - const rangeFull = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_4__["Range"](prev.startLineNumber, 1, prev.endLineNumber, model.getLineMaxColumn(prev.endLineNumber)); - if (rangeFull.containsRange(prev) && !rangeFull.equalsRange(rangeNoWhitespace) && cur.containsRange(rangeFull) && !cur.equalsRange(rangeFull)) { - oneRangesWithTrivia.push(rangeFull); - } - } - oneRangesWithTrivia.push(cur); - } - return oneRangesWithTrivia; - }); - }); -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerModelCommand"])('_executeSelectionRangeProvider', function (model, ...args) { - const [positions] = args; - return provideSelectionRanges(model, positions, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationToken"].None); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/wordSelections.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/wordSelections.js ***! - \****************************************************************************************/ -/*! exports provided: WordSelectionRangeProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WordSelectionRangeProvider", function() { return WordSelectionRangeProvider; }); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class WordSelectionRangeProvider { - provideSelectionRanges(model, positions) { - const result = []; - for (const position of positions) { - const bucket = []; - result.push(bucket); - this._addInWordRanges(bucket, model, position); - this._addWordRanges(bucket, model, position); - this._addWhitespaceLine(bucket, model, position); - bucket.push({ range: model.getFullModelRange() }); - } - return result; - } - _addInWordRanges(bucket, model, pos) { - const obj = model.getWordAtPosition(pos); - if (!obj) { - return; - } - let { word, startColumn } = obj; - let offset = pos.column - startColumn; - let start = offset; - let end = offset; - let lastCh = 0; - // LEFT anchor (start) - for (; start >= 0; start--) { - let ch = word.charCodeAt(start); - if ((start !== offset) && (ch === 95 /* Underline */ || ch === 45 /* Dash */)) { - // foo-bar OR foo_bar - break; - } - else if (Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["isLowerAsciiLetter"])(ch) && Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["isUpperAsciiLetter"])(lastCh)) { - // fooBar - break; - } - lastCh = ch; - } - start += 1; - // RIGHT anchor (end) - for (; end < word.length; end++) { - let ch = word.charCodeAt(end); - if (Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["isUpperAsciiLetter"])(ch) && Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["isLowerAsciiLetter"])(lastCh)) { - // fooBar - break; - } - else if (ch === 95 /* Underline */ || ch === 45 /* Dash */) { - // foo-bar OR foo_bar - break; - } - lastCh = ch; - } - if (start < end) { - bucket.push({ range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](pos.lineNumber, startColumn + start, pos.lineNumber, startColumn + end) }); - } - } - _addWordRanges(bucket, model, pos) { - const word = model.getWordAtPosition(pos); - if (word) { - bucket.push({ range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](pos.lineNumber, word.startColumn, pos.lineNumber, word.endColumn) }); - } - } - _addWhitespaceLine(bucket, model, pos) { - if (model.getLineLength(pos.lineNumber) > 0 - && model.getLineFirstNonWhitespaceColumn(pos.lineNumber) === 0 - && model.getLineLastNonWhitespaceColumn(pos.lineNumber) === 0) { - bucket.push({ range: new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](pos.lineNumber, 1, pos.lineNumber, model.getLineMaxColumn(pos.lineNumber)) }); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetController2.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetController2.js ***! - \****************************************************************************************/ -/*! exports provided: SnippetController2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SnippetController2", function() { return SnippetController2; }); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _suggest_suggest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../suggest/suggest.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggest.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/log/common/log.js */ "./node_modules/monaco-editor/esm/vs/platform/log/common/log.js"); -/* harmony import */ var _snippetSession_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./snippetSession.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetSession.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - -const _defaultOptions = { - overwriteBefore: 0, - overwriteAfter: 0, - undoStopBefore: true, - undoStopAfter: true, - adjustWhitespace: true, - clipboardText: undefined, - overtypingCapturer: undefined -}; -let SnippetController2 = class SnippetController2 { - constructor(_editor, _logService, contextKeyService) { - this._editor = _editor; - this._logService = _logService; - this._snippetListener = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["DisposableStore"](); - this._modelVersionId = -1; - this._inSnippet = SnippetController2.InSnippetMode.bindTo(contextKeyService); - this._hasNextTabstop = SnippetController2.HasNextTabstop.bindTo(contextKeyService); - this._hasPrevTabstop = SnippetController2.HasPrevTabstop.bindTo(contextKeyService); - } - static get(editor) { - return editor.getContribution(SnippetController2.ID); - } - dispose() { - this._inSnippet.reset(); - this._hasPrevTabstop.reset(); - this._hasNextTabstop.reset(); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["dispose"])(this._session); - this._snippetListener.dispose(); - } - insert(template, opts) { - // this is here to find out more about the yet-not-understood - // error that sometimes happens when we fail to inserted a nested - // snippet - try { - this._doInsert(template, typeof opts === 'undefined' ? _defaultOptions : Object.assign(Object.assign({}, _defaultOptions), opts)); - } - catch (e) { - this.cancel(); - this._logService.error(e); - this._logService.error('snippet_error'); - this._logService.error('insert_template=', template); - this._logService.error('existing_template=', this._session ? this._session._logInfo() : ''); - } - } - _doInsert(template, opts) { - if (!this._editor.hasModel()) { - return; - } - // don't listen while inserting the snippet - // as that is the inflight state causing cancelation - this._snippetListener.clear(); - if (opts.undoStopBefore) { - this._editor.getModel().pushStackElement(); - } - if (!this._session) { - this._modelVersionId = this._editor.getModel().getAlternativeVersionId(); - this._session = new _snippetSession_js__WEBPACK_IMPORTED_MODULE_8__["SnippetSession"](this._editor, template, opts); - this._session.insert(); - } - else { - this._session.merge(template, opts); - } - if (opts.undoStopAfter) { - this._editor.getModel().pushStackElement(); - } - this._updateState(); - this._snippetListener.add(this._editor.onDidChangeModelContent(e => e.isFlush && this.cancel())); - this._snippetListener.add(this._editor.onDidChangeModel(() => this.cancel())); - this._snippetListener.add(this._editor.onDidChangeCursorSelection(() => this._updateState())); - } - _updateState() { - if (!this._session || !this._editor.hasModel()) { - // canceled in the meanwhile - return; - } - if (this._modelVersionId === this._editor.getModel().getAlternativeVersionId()) { - // undo until the 'before' state happened - // and makes use cancel snippet mode - return this.cancel(); - } - if (!this._session.hasPlaceholder) { - // don't listen for selection changes and don't - // update context keys when the snippet is plain text - return this.cancel(); - } - if (this._session.isAtLastPlaceholder || !this._session.isSelectionWithinPlaceholders()) { - return this.cancel(); - } - this._inSnippet.set(true); - this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder); - this._hasNextTabstop.set(!this._session.isAtLastPlaceholder); - this._handleChoice(); - } - _handleChoice() { - if (!this._session || !this._editor.hasModel()) { - this._currentChoice = undefined; - return; - } - const { choice } = this._session; - if (!choice) { - this._currentChoice = undefined; - return; - } - if (this._currentChoice !== choice) { - this._currentChoice = choice; - this._editor.setSelections(this._editor.getSelections() - .map(s => _common_core_selection_js__WEBPACK_IMPORTED_MODULE_3__["Selection"].fromPositions(s.getStartPosition()))); - const [first] = choice.options; - Object(_suggest_suggest_js__WEBPACK_IMPORTED_MODULE_5__["showSimpleSuggestions"])(this._editor, choice.options.map((option, i) => { - // let before = choice.options.slice(0, i); - // let after = choice.options.slice(i); - return { - kind: 13 /* Value */, - label: option.value, - insertText: option.value, - // insertText: `\${1|${after.concat(before).join(',')}|}$0`, - // snippetType: 'textmate', - sortText: 'a'.repeat(i + 1), - range: _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"].fromPositions(this._editor.getPosition(), this._editor.getPosition().delta(0, first.value.length)) - }; - })); - } - } - finish() { - while (this._inSnippet.get()) { - this.next(); - } - } - cancel(resetSelection = false) { - this._inSnippet.reset(); - this._hasPrevTabstop.reset(); - this._hasNextTabstop.reset(); - this._snippetListener.clear(); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["dispose"])(this._session); - this._session = undefined; - this._modelVersionId = -1; - if (resetSelection) { - // reset selection to the primary cursor when being asked - // for. this happens when explicitly cancelling snippet mode, - // e.g. when pressing ESC - this._editor.setSelections([this._editor.getSelection()]); - } - } - prev() { - if (this._session) { - this._session.prev(); - } - this._updateState(); - } - next() { - if (this._session) { - this._session.next(); - } - this._updateState(); - } - isInSnippet() { - return Boolean(this._inSnippet.get()); - } -}; -SnippetController2.ID = 'snippetController2'; -SnippetController2.InSnippetMode = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__["RawContextKey"]('inSnippetMode', false); -SnippetController2.HasNextTabstop = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__["RawContextKey"]('hasNextTabstop', false); -SnippetController2.HasPrevTabstop = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__["RawContextKey"]('hasPrevTabstop', false); -SnippetController2 = __decorate([ - __param(1, _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_7__["ILogService"]), - __param(2, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__["IContextKeyService"]) -], SnippetController2); - -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorContribution"])(SnippetController2.ID, SnippetController2); -const CommandCtor = _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["EditorCommand"].bindToContribution(SnippetController2.get); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorCommand"])(new CommandCtor({ - id: 'jumpToNextSnippetPlaceholder', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__["ContextKeyExpr"].and(SnippetController2.InSnippetMode, SnippetController2.HasNextTabstop), - handler: ctrl => ctrl.next(), - kbOpts: { - weight: 100 /* EditorContrib */ + 30, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_4__["EditorContextKeys"].editorTextFocus, - primary: 2 /* Tab */ - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorCommand"])(new CommandCtor({ - id: 'jumpToPrevSnippetPlaceholder', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__["ContextKeyExpr"].and(SnippetController2.InSnippetMode, SnippetController2.HasPrevTabstop), - handler: ctrl => ctrl.prev(), - kbOpts: { - weight: 100 /* EditorContrib */ + 30, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_4__["EditorContextKeys"].editorTextFocus, - primary: 1024 /* Shift */ | 2 /* Tab */ - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorCommand"])(new CommandCtor({ - id: 'leaveSnippet', - precondition: SnippetController2.InSnippetMode, - handler: ctrl => ctrl.cancel(true), - kbOpts: { - weight: 100 /* EditorContrib */ + 30, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_4__["EditorContextKeys"].editorTextFocus, - primary: 9 /* Escape */, - secondary: [1024 /* Shift */ | 9 /* Escape */] - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorCommand"])(new CommandCtor({ - id: 'acceptSnippet', - precondition: SnippetController2.InSnippetMode, - handler: ctrl => ctrl.finish(), -})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetParser.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetParser.js ***! - \***********************************************************************************/ -/*! exports provided: Scanner, Marker, Text, TransformableMarker, Placeholder, Choice, Transform, FormatString, Variable, TextmateSnippet, SnippetParser */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scanner", function() { return Scanner; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Marker", function() { return Marker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Text", function() { return Text; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TransformableMarker", function() { return TransformableMarker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Placeholder", function() { return Placeholder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Choice", function() { return Choice; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Transform", function() { return Transform; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormatString", function() { return FormatString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return Variable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextmateSnippet", function() { return TextmateSnippet; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SnippetParser", function() { return SnippetParser; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class Scanner { - constructor() { - this.value = ''; - this.pos = 0; - } - static isDigitCharacter(ch) { - return ch >= 48 /* Digit0 */ && ch <= 57 /* Digit9 */; - } - static isVariableCharacter(ch) { - return ch === 95 /* Underline */ - || (ch >= 97 /* a */ && ch <= 122 /* z */) - || (ch >= 65 /* A */ && ch <= 90 /* Z */); - } - text(value) { - this.value = value; - this.pos = 0; - } - tokenText(token) { - return this.value.substr(token.pos, token.len); - } - next() { - if (this.pos >= this.value.length) { - return { type: 14 /* EOF */, pos: this.pos, len: 0 }; - } - let pos = this.pos; - let len = 0; - let ch = this.value.charCodeAt(pos); - let type; - // static types - type = Scanner._table[ch]; - if (typeof type === 'number') { - this.pos += 1; - return { type, pos, len: 1 }; - } - // number - if (Scanner.isDigitCharacter(ch)) { - type = 8 /* Int */; - do { - len += 1; - ch = this.value.charCodeAt(pos + len); - } while (Scanner.isDigitCharacter(ch)); - this.pos += len; - return { type, pos, len }; - } - // variable name - if (Scanner.isVariableCharacter(ch)) { - type = 9 /* VariableName */; - do { - ch = this.value.charCodeAt(pos + (++len)); - } while (Scanner.isVariableCharacter(ch) || Scanner.isDigitCharacter(ch)); - this.pos += len; - return { type, pos, len }; - } - // format - type = 10 /* Format */; - do { - len += 1; - ch = this.value.charCodeAt(pos + len); - } while (!isNaN(ch) - && typeof Scanner._table[ch] === 'undefined' // not static token - && !Scanner.isDigitCharacter(ch) // not number - && !Scanner.isVariableCharacter(ch) // not variable - ); - this.pos += len; - return { type, pos, len }; - } -} -Scanner._table = { - [36 /* DollarSign */]: 0 /* Dollar */, - [58 /* Colon */]: 1 /* Colon */, - [44 /* Comma */]: 2 /* Comma */, - [123 /* OpenCurlyBrace */]: 3 /* CurlyOpen */, - [125 /* CloseCurlyBrace */]: 4 /* CurlyClose */, - [92 /* Backslash */]: 5 /* Backslash */, - [47 /* Slash */]: 6 /* Forwardslash */, - [124 /* Pipe */]: 7 /* Pipe */, - [43 /* Plus */]: 11 /* Plus */, - [45 /* Dash */]: 12 /* Dash */, - [63 /* QuestionMark */]: 13 /* QuestionMark */, -}; -class Marker { - constructor() { - this._children = []; - } - appendChild(child) { - if (child instanceof Text && this._children[this._children.length - 1] instanceof Text) { - // this and previous child are text -> merge them - this._children[this._children.length - 1].value += child.value; - } - else { - // normal adoption of child - child.parent = this; - this._children.push(child); - } - return this; - } - replace(child, others) { - const { parent } = child; - const idx = parent.children.indexOf(child); - const newChildren = parent.children.slice(0); - newChildren.splice(idx, 1, ...others); - parent._children = newChildren; - (function _fixParent(children, parent) { - for (const child of children) { - child.parent = parent; - _fixParent(child.children, child); - } - })(others, parent); - } - get children() { - return this._children; - } - get snippet() { - let candidate = this; - while (true) { - if (!candidate) { - return undefined; - } - if (candidate instanceof TextmateSnippet) { - return candidate; - } - candidate = candidate.parent; - } - } - toString() { - return this.children.reduce((prev, cur) => prev + cur.toString(), ''); - } - len() { - return 0; - } -} -class Text extends Marker { - constructor(value) { - super(); - this.value = value; - } - toString() { - return this.value; - } - len() { - return this.value.length; - } - clone() { - return new Text(this.value); - } -} -class TransformableMarker extends Marker { -} -class Placeholder extends TransformableMarker { - constructor(index) { - super(); - this.index = index; - } - static compareByIndex(a, b) { - if (a.index === b.index) { - return 0; - } - else if (a.isFinalTabstop) { - return 1; - } - else if (b.isFinalTabstop) { - return -1; - } - else if (a.index < b.index) { - return -1; - } - else if (a.index > b.index) { - return 1; - } - else { - return 0; - } - } - get isFinalTabstop() { - return this.index === 0; - } - get choice() { - return this._children.length === 1 && this._children[0] instanceof Choice - ? this._children[0] - : undefined; - } - clone() { - let ret = new Placeholder(this.index); - if (this.transform) { - ret.transform = this.transform.clone(); - } - ret._children = this.children.map(child => child.clone()); - return ret; - } -} -class Choice extends Marker { - constructor() { - super(...arguments); - this.options = []; - } - appendChild(marker) { - if (marker instanceof Text) { - marker.parent = this; - this.options.push(marker); - } - return this; - } - toString() { - return this.options[0].value; - } - len() { - return this.options[0].len(); - } - clone() { - let ret = new Choice(); - this.options.forEach(ret.appendChild, ret); - return ret; - } -} -class Transform extends Marker { - constructor() { - super(...arguments); - this.regexp = new RegExp(''); - } - resolve(value) { - const _this = this; - let didMatch = false; - let ret = value.replace(this.regexp, function () { - didMatch = true; - return _this._replace(Array.prototype.slice.call(arguments, 0, -2)); - }); - // when the regex didn't match and when the transform has - // else branches, then run those - if (!didMatch && this._children.some(child => child instanceof FormatString && Boolean(child.elseValue))) { - ret = this._replace([]); - } - return ret; - } - _replace(groups) { - let ret = ''; - for (const marker of this._children) { - if (marker instanceof FormatString) { - let value = groups[marker.index] || ''; - value = marker.resolve(value); - ret += value; - } - else { - ret += marker.toString(); - } - } - return ret; - } - toString() { - return ''; - } - clone() { - let ret = new Transform(); - ret.regexp = new RegExp(this.regexp.source, '' + (this.regexp.ignoreCase ? 'i' : '') + (this.regexp.global ? 'g' : '')); - ret._children = this.children.map(child => child.clone()); - return ret; - } -} -class FormatString extends Marker { - constructor(index, shorthandName, ifValue, elseValue) { - super(); - this.index = index; - this.shorthandName = shorthandName; - this.ifValue = ifValue; - this.elseValue = elseValue; - } - resolve(value) { - if (this.shorthandName === 'upcase') { - return !value ? '' : value.toLocaleUpperCase(); - } - else if (this.shorthandName === 'downcase') { - return !value ? '' : value.toLocaleLowerCase(); - } - else if (this.shorthandName === 'capitalize') { - return !value ? '' : (value[0].toLocaleUpperCase() + value.substr(1)); - } - else if (this.shorthandName === 'pascalcase') { - return !value ? '' : this._toPascalCase(value); - } - else if (Boolean(value) && typeof this.ifValue === 'string') { - return this.ifValue; - } - else if (!Boolean(value) && typeof this.elseValue === 'string') { - return this.elseValue; - } - else { - return value || ''; - } - } - _toPascalCase(value) { - const match = value.match(/[a-z]+/gi); - if (!match) { - return value; - } - return match.map(function (word) { - return word.charAt(0).toUpperCase() - + word.substr(1).toLowerCase(); - }) - .join(''); - } - clone() { - let ret = new FormatString(this.index, this.shorthandName, this.ifValue, this.elseValue); - return ret; - } -} -class Variable extends TransformableMarker { - constructor(name) { - super(); - this.name = name; - } - resolve(resolver) { - let value = resolver.resolve(this); - if (this.transform) { - value = this.transform.resolve(value || ''); - } - if (value !== undefined) { - this._children = [new Text(value)]; - return true; - } - return false; - } - clone() { - const ret = new Variable(this.name); - if (this.transform) { - ret.transform = this.transform.clone(); - } - ret._children = this.children.map(child => child.clone()); - return ret; - } -} -function walk(marker, visitor) { - const stack = [...marker]; - while (stack.length > 0) { - const marker = stack.shift(); - const recurse = visitor(marker); - if (!recurse) { - break; - } - stack.unshift(...marker.children); - } -} -class TextmateSnippet extends Marker { - get placeholderInfo() { - if (!this._placeholders) { - // fill in placeholders - let all = []; - let last; - this.walk(function (candidate) { - if (candidate instanceof Placeholder) { - all.push(candidate); - last = !last || last.index < candidate.index ? candidate : last; - } - return true; - }); - this._placeholders = { all, last }; - } - return this._placeholders; - } - get placeholders() { - const { all } = this.placeholderInfo; - return all; - } - offset(marker) { - let pos = 0; - let found = false; - this.walk(candidate => { - if (candidate === marker) { - found = true; - return false; - } - pos += candidate.len(); - return true; - }); - if (!found) { - return -1; - } - return pos; - } - fullLen(marker) { - let ret = 0; - walk([marker], marker => { - ret += marker.len(); - return true; - }); - return ret; - } - enclosingPlaceholders(placeholder) { - let ret = []; - let { parent } = placeholder; - while (parent) { - if (parent instanceof Placeholder) { - ret.push(parent); - } - parent = parent.parent; - } - return ret; - } - resolveVariables(resolver) { - this.walk(candidate => { - if (candidate instanceof Variable) { - if (candidate.resolve(resolver)) { - this._placeholders = undefined; - } - } - return true; - }); - return this; - } - appendChild(child) { - this._placeholders = undefined; - return super.appendChild(child); - } - replace(child, others) { - this._placeholders = undefined; - return super.replace(child, others); - } - clone() { - let ret = new TextmateSnippet(); - this._children = this.children.map(child => child.clone()); - return ret; - } - walk(visitor) { - walk(this.children, visitor); - } -} -class SnippetParser { - constructor() { - this._scanner = new Scanner(); - this._token = { type: 14 /* EOF */, pos: 0, len: 0 }; - } - static escape(value) { - return value.replace(/\$|}|\\/g, '\\$&'); - } - static guessNeedsClipboard(template) { - return /\${?CLIPBOARD/.test(template); - } - parse(value, insertFinalTabstop, enforceFinalTabstop) { - this._scanner.text(value); - this._token = this._scanner.next(); - const snippet = new TextmateSnippet(); - while (this._parse(snippet)) { - // nothing - } - // fill in values for placeholders. the first placeholder of an index - // that has a value defines the value for all placeholders with that index - const placeholderDefaultValues = new Map(); - const incompletePlaceholders = []; - let placeholderCount = 0; - snippet.walk(marker => { - if (marker instanceof Placeholder) { - placeholderCount += 1; - if (marker.isFinalTabstop) { - placeholderDefaultValues.set(0, undefined); - } - else if (!placeholderDefaultValues.has(marker.index) && marker.children.length > 0) { - placeholderDefaultValues.set(marker.index, marker.children); - } - else { - incompletePlaceholders.push(marker); - } - } - return true; - }); - for (const placeholder of incompletePlaceholders) { - const defaultValues = placeholderDefaultValues.get(placeholder.index); - if (defaultValues) { - const clone = new Placeholder(placeholder.index); - clone.transform = placeholder.transform; - for (const child of defaultValues) { - clone.appendChild(child.clone()); - } - snippet.replace(placeholder, [clone]); - } - } - if (!enforceFinalTabstop) { - enforceFinalTabstop = placeholderCount > 0 && insertFinalTabstop; - } - if (!placeholderDefaultValues.has(0) && enforceFinalTabstop) { - // the snippet uses placeholders but has no - // final tabstop defined -> insert at the end - snippet.appendChild(new Placeholder(0)); - } - return snippet; - } - _accept(type, value) { - if (type === undefined || this._token.type === type) { - let ret = !value ? true : this._scanner.tokenText(this._token); - this._token = this._scanner.next(); - return ret; - } - return false; - } - _backTo(token) { - this._scanner.pos = token.pos + token.len; - this._token = token; - return false; - } - _until(type) { - const start = this._token; - while (this._token.type !== type) { - if (this._token.type === 14 /* EOF */) { - return false; - } - else if (this._token.type === 5 /* Backslash */) { - const nextToken = this._scanner.next(); - if (nextToken.type !== 0 /* Dollar */ - && nextToken.type !== 4 /* CurlyClose */ - && nextToken.type !== 5 /* Backslash */) { - return false; - } - } - this._token = this._scanner.next(); - } - const value = this._scanner.value.substring(start.pos, this._token.pos).replace(/\\(\$|}|\\)/g, '$1'); - this._token = this._scanner.next(); - return value; - } - _parse(marker) { - return this._parseEscaped(marker) - || this._parseTabstopOrVariableName(marker) - || this._parseComplexPlaceholder(marker) - || this._parseComplexVariable(marker) - || this._parseAnything(marker); - } - // \$, \\, \} -> just text - _parseEscaped(marker) { - let value; - if (value = this._accept(5 /* Backslash */, true)) { - // saw a backslash, append escaped token or that backslash - value = this._accept(0 /* Dollar */, true) - || this._accept(4 /* CurlyClose */, true) - || this._accept(5 /* Backslash */, true) - || value; - marker.appendChild(new Text(value)); - return true; - } - return false; - } - // $foo -> variable, $1 -> tabstop - _parseTabstopOrVariableName(parent) { - let value; - const token = this._token; - const match = this._accept(0 /* Dollar */) - && (value = this._accept(9 /* VariableName */, true) || this._accept(8 /* Int */, true)); - if (!match) { - return this._backTo(token); - } - parent.appendChild(/^\d+$/.test(value) - ? new Placeholder(Number(value)) - : new Variable(value)); - return true; - } - // ${1:}, ${1} -> placeholder - _parseComplexPlaceholder(parent) { - let index; - const token = this._token; - const match = this._accept(0 /* Dollar */) - && this._accept(3 /* CurlyOpen */) - && (index = this._accept(8 /* Int */, true)); - if (!match) { - return this._backTo(token); - } - const placeholder = new Placeholder(Number(index)); - if (this._accept(1 /* Colon */)) { - // ${1:} - while (true) { - // ...} -> done - if (this._accept(4 /* CurlyClose */)) { - parent.appendChild(placeholder); - return true; - } - if (this._parse(placeholder)) { - continue; - } - // fallback - parent.appendChild(new Text('${' + index + ':')); - placeholder.children.forEach(parent.appendChild, parent); - return true; - } - } - else if (placeholder.index > 0 && this._accept(7 /* Pipe */)) { - // ${1|one,two,three|} - const choice = new Choice(); - while (true) { - if (this._parseChoiceElement(choice)) { - if (this._accept(2 /* Comma */)) { - // opt, -> more - continue; - } - if (this._accept(7 /* Pipe */)) { - placeholder.appendChild(choice); - if (this._accept(4 /* CurlyClose */)) { - // ..|} -> done - parent.appendChild(placeholder); - return true; - } - } - } - this._backTo(token); - return false; - } - } - else if (this._accept(6 /* Forwardslash */)) { - // ${1///} - if (this._parseTransform(placeholder)) { - parent.appendChild(placeholder); - return true; - } - this._backTo(token); - return false; - } - else if (this._accept(4 /* CurlyClose */)) { - // ${1} - parent.appendChild(placeholder); - return true; - } - else { - // ${1 <- missing curly or colon - return this._backTo(token); - } - } - _parseChoiceElement(parent) { - const token = this._token; - const values = []; - while (true) { - if (this._token.type === 2 /* Comma */ || this._token.type === 7 /* Pipe */) { - break; - } - let value; - if (value = this._accept(5 /* Backslash */, true)) { - // \, \|, or \\ - value = this._accept(2 /* Comma */, true) - || this._accept(7 /* Pipe */, true) - || this._accept(5 /* Backslash */, true) - || value; - } - else { - value = this._accept(undefined, true); - } - if (!value) { - // EOF - this._backTo(token); - return false; - } - values.push(value); - } - if (values.length === 0) { - this._backTo(token); - return false; - } - parent.appendChild(new Text(values.join(''))); - return true; - } - // ${foo:}, ${foo} -> variable - _parseComplexVariable(parent) { - let name; - const token = this._token; - const match = this._accept(0 /* Dollar */) - && this._accept(3 /* CurlyOpen */) - && (name = this._accept(9 /* VariableName */, true)); - if (!match) { - return this._backTo(token); - } - const variable = new Variable(name); - if (this._accept(1 /* Colon */)) { - // ${foo:} - while (true) { - // ...} -> done - if (this._accept(4 /* CurlyClose */)) { - parent.appendChild(variable); - return true; - } - if (this._parse(variable)) { - continue; - } - // fallback - parent.appendChild(new Text('${' + name + ':')); - variable.children.forEach(parent.appendChild, parent); - return true; - } - } - else if (this._accept(6 /* Forwardslash */)) { - // ${foo///} - if (this._parseTransform(variable)) { - parent.appendChild(variable); - return true; - } - this._backTo(token); - return false; - } - else if (this._accept(4 /* CurlyClose */)) { - // ${foo} - parent.appendChild(variable); - return true; - } - else { - // ${foo <- missing curly or colon - return this._backTo(token); - } - } - _parseTransform(parent) { - // ...//} - let transform = new Transform(); - let regexValue = ''; - let regexOptions = ''; - // (1) /regex - while (true) { - if (this._accept(6 /* Forwardslash */)) { - break; - } - let escaped; - if (escaped = this._accept(5 /* Backslash */, true)) { - escaped = this._accept(6 /* Forwardslash */, true) || escaped; - regexValue += escaped; - continue; - } - if (this._token.type !== 14 /* EOF */) { - regexValue += this._accept(undefined, true); - continue; - } - return false; - } - // (2) /format - while (true) { - if (this._accept(6 /* Forwardslash */)) { - break; - } - let escaped; - if (escaped = this._accept(5 /* Backslash */, true)) { - escaped = this._accept(5 /* Backslash */, true) || this._accept(6 /* Forwardslash */, true) || escaped; - transform.appendChild(new Text(escaped)); - continue; - } - if (this._parseFormatString(transform) || this._parseAnything(transform)) { - continue; - } - return false; - } - // (3) /option - while (true) { - if (this._accept(4 /* CurlyClose */)) { - break; - } - if (this._token.type !== 14 /* EOF */) { - regexOptions += this._accept(undefined, true); - continue; - } - return false; - } - try { - transform.regexp = new RegExp(regexValue, regexOptions); - } - catch (e) { - // invalid regexp - return false; - } - parent.transform = transform; - return true; - } - _parseFormatString(parent) { - const token = this._token; - if (!this._accept(0 /* Dollar */)) { - return false; - } - let complex = false; - if (this._accept(3 /* CurlyOpen */)) { - complex = true; - } - let index = this._accept(8 /* Int */, true); - if (!index) { - this._backTo(token); - return false; - } - else if (!complex) { - // $1 - parent.appendChild(new FormatString(Number(index))); - return true; - } - else if (this._accept(4 /* CurlyClose */)) { - // ${1} - parent.appendChild(new FormatString(Number(index))); - return true; - } - else if (!this._accept(1 /* Colon */)) { - this._backTo(token); - return false; - } - if (this._accept(6 /* Forwardslash */)) { - // ${1:/upcase} - let shorthand = this._accept(9 /* VariableName */, true); - if (!shorthand || !this._accept(4 /* CurlyClose */)) { - this._backTo(token); - return false; - } - else { - parent.appendChild(new FormatString(Number(index), shorthand)); - return true; - } - } - else if (this._accept(11 /* Plus */)) { - // ${1:+} - let ifValue = this._until(4 /* CurlyClose */); - if (ifValue) { - parent.appendChild(new FormatString(Number(index), undefined, ifValue, undefined)); - return true; - } - } - else if (this._accept(12 /* Dash */)) { - // ${2:-} - let elseValue = this._until(4 /* CurlyClose */); - if (elseValue) { - parent.appendChild(new FormatString(Number(index), undefined, undefined, elseValue)); - return true; - } - } - else if (this._accept(13 /* QuestionMark */)) { - // ${2:?:} - let ifValue = this._until(1 /* Colon */); - if (ifValue) { - let elseValue = this._until(4 /* CurlyClose */); - if (elseValue) { - parent.appendChild(new FormatString(Number(index), undefined, ifValue, elseValue)); - return true; - } - } - } - else { - // ${1:} - let elseValue = this._until(4 /* CurlyClose */); - if (elseValue) { - parent.appendChild(new FormatString(Number(index), undefined, undefined, elseValue)); - return true; - } - } - this._backTo(token); - return false; - } - _parseAnything(marker) { - if (this._token.type !== 14 /* EOF */) { - marker.appendChild(new Text(this._scanner.tokenText(this._token))); - this._accept(undefined); - return true; - } - return false; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetSession.css": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetSession.css ***! - \*************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_snippetSession_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./snippetSession.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetSession.css"); -/* harmony import */ var _css_loader_dist_cjs_js_snippetSession_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_snippetSession_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_snippetSession_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_snippetSession_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetSession.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetSession.js ***! - \************************************************************************************/ -/*! exports provided: OneSnippet, SnippetSession */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OneSnippet", function() { return OneSnippet; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SnippetSession", function() { return SnippetSession; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _snippetSession_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./snippetSession.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetSession.css"); -/* harmony import */ var _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/core/editOperation.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _platform_workspace_common_workspace_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/workspace/common/workspace.js */ "./node_modules/monaco-editor/esm/vs/platform/workspace/common/workspace.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _snippetParser_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./snippetParser.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetParser.js"); -/* harmony import */ var _snippetVariables_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./snippetVariables.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetVariables.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_label_common_label_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/label/common/label.js */ "./node_modules/monaco-editor/esm/vs/platform/label/common/label.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_12__["registerThemingParticipant"])((theme, collector) => { - function getColorGraceful(name) { - const color = theme.getColor(name); - return color ? color.toString() : 'transparent'; - } - collector.addRule(`.monaco-editor .snippet-placeholder { background-color: ${getColorGraceful(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["snippetTabstopHighlightBackground"])}; outline-color: ${getColorGraceful(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["snippetTabstopHighlightBorder"])}; }`); - collector.addRule(`.monaco-editor .finish-snippet-placeholder { background-color: ${getColorGraceful(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["snippetFinalTabstopHighlightBackground"])}; outline-color: ${getColorGraceful(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["snippetFinalTabstopHighlightBorder"])}; }`); -}); -class OneSnippet { - constructor(editor, snippet, offset) { - this._nestingLevel = 1; - this._editor = editor; - this._snippet = snippet; - this._offset = offset; - this._placeholderGroups = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["groupBy"])(snippet.placeholders, _snippetParser_js__WEBPACK_IMPORTED_MODULE_10__["Placeholder"].compareByIndex); - this._placeholderGroupsIdx = -1; - } - dispose() { - if (this._placeholderDecorations) { - this._editor.deltaDecorations([...this._placeholderDecorations.values()], []); - } - this._placeholderGroups.length = 0; - } - _initDecorations() { - if (this._placeholderDecorations) { - // already initialized - return; - } - this._placeholderDecorations = new Map(); - const model = this._editor.getModel(); - this._editor.changeDecorations(accessor => { - // create a decoration for each placeholder - for (const placeholder of this._snippet.placeholders) { - const placeholderOffset = this._snippet.offset(placeholder); - const placeholderLen = this._snippet.fullLen(placeholder); - const range = _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].fromPositions(model.getPositionAt(this._offset + placeholderOffset), model.getPositionAt(this._offset + placeholderOffset + placeholderLen)); - const options = placeholder.isFinalTabstop ? OneSnippet._decor.inactiveFinal : OneSnippet._decor.inactive; - const handle = accessor.addDecoration(range, options); - this._placeholderDecorations.set(placeholder, handle); - } - }); - } - move(fwd) { - if (!this._editor.hasModel()) { - return []; - } - this._initDecorations(); - // Transform placeholder text if necessary - if (this._placeholderGroupsIdx >= 0) { - let operations = []; - for (const placeholder of this._placeholderGroups[this._placeholderGroupsIdx]) { - // Check if the placeholder has a transformation - if (placeholder.transform) { - const id = this._placeholderDecorations.get(placeholder); - const range = this._editor.getModel().getDecorationRange(id); - const currentValue = this._editor.getModel().getValueInRange(range); - operations.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_4__["EditOperation"].replaceMove(range, placeholder.transform.resolve(currentValue))); - } - } - if (operations.length > 0) { - this._editor.executeEdits('snippet.placeholderTransform', operations); - } - } - let couldSkipThisPlaceholder = false; - if (fwd === true && this._placeholderGroupsIdx < this._placeholderGroups.length - 1) { - this._placeholderGroupsIdx += 1; - couldSkipThisPlaceholder = true; - } - else if (fwd === false && this._placeholderGroupsIdx > 0) { - this._placeholderGroupsIdx -= 1; - couldSkipThisPlaceholder = true; - } - else { - // the selection of the current placeholder might - // not acurate any more -> simply restore it - } - const newSelections = this._editor.getModel().changeDecorations(accessor => { - const activePlaceholders = new Set(); - // change stickiness to always grow when typing at its edges - // because these decorations represent the currently active - // tabstop. - // Special case #1: reaching the final tabstop - // Special case #2: placeholders enclosing active placeholders - const selections = []; - for (const placeholder of this._placeholderGroups[this._placeholderGroupsIdx]) { - const id = this._placeholderDecorations.get(placeholder); - const range = this._editor.getModel().getDecorationRange(id); - selections.push(new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_6__["Selection"](range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn)); - // consider to skip this placeholder index when the decoration - // range is empty but when the placeholder wasn't. that's a strong - // hint that the placeholder has been deleted. (all placeholder must match this) - couldSkipThisPlaceholder = couldSkipThisPlaceholder && this._hasPlaceholderBeenCollapsed(placeholder); - accessor.changeDecorationOptions(id, placeholder.isFinalTabstop ? OneSnippet._decor.activeFinal : OneSnippet._decor.active); - activePlaceholders.add(placeholder); - for (const enclosingPlaceholder of this._snippet.enclosingPlaceholders(placeholder)) { - const id = this._placeholderDecorations.get(enclosingPlaceholder); - accessor.changeDecorationOptions(id, enclosingPlaceholder.isFinalTabstop ? OneSnippet._decor.activeFinal : OneSnippet._decor.active); - activePlaceholders.add(enclosingPlaceholder); - } - } - // change stickness to never grow when typing at its edges - // so that in-active tabstops never grow - for (const [placeholder, id] of this._placeholderDecorations) { - if (!activePlaceholders.has(placeholder)) { - accessor.changeDecorationOptions(id, placeholder.isFinalTabstop ? OneSnippet._decor.inactiveFinal : OneSnippet._decor.inactive); - } - } - return selections; - }); - return !couldSkipThisPlaceholder ? newSelections !== null && newSelections !== void 0 ? newSelections : [] : this.move(fwd); - } - _hasPlaceholderBeenCollapsed(placeholder) { - // A placeholder is empty when it wasn't empty when authored but - // when its tracking decoration is empty. This also applies to all - // potential parent placeholders - let marker = placeholder; - while (marker) { - if (marker instanceof _snippetParser_js__WEBPACK_IMPORTED_MODULE_10__["Placeholder"]) { - const id = this._placeholderDecorations.get(marker); - const range = this._editor.getModel().getDecorationRange(id); - if (range.isEmpty() && marker.toString().length > 0) { - return true; - } - } - marker = marker.parent; - } - return false; - } - get isAtFirstPlaceholder() { - return this._placeholderGroupsIdx <= 0 || this._placeholderGroups.length === 0; - } - get isAtLastPlaceholder() { - return this._placeholderGroupsIdx === this._placeholderGroups.length - 1; - } - get hasPlaceholder() { - return this._snippet.placeholders.length > 0; - } - computePossibleSelections() { - const result = new Map(); - for (const placeholdersWithEqualIndex of this._placeholderGroups) { - let ranges; - for (const placeholder of placeholdersWithEqualIndex) { - if (placeholder.isFinalTabstop) { - // ignore those - break; - } - if (!ranges) { - ranges = []; - result.set(placeholder.index, ranges); - } - const id = this._placeholderDecorations.get(placeholder); - const range = this._editor.getModel().getDecorationRange(id); - if (!range) { - // one of the placeholder lost its decoration and - // therefore we bail out and pretend the placeholder - // (with its mirrors) doesn't exist anymore. - result.delete(placeholder.index); - break; - } - ranges.push(range); - } - } - return result; - } - get choice() { - return this._placeholderGroups[this._placeholderGroupsIdx][0].choice; - } - merge(others) { - const model = this._editor.getModel(); - this._nestingLevel *= 10; - this._editor.changeDecorations(accessor => { - // For each active placeholder take one snippet and merge it - // in that the placeholder (can be many for `$1foo$1foo`). Because - // everything is sorted by editor selection we can simply remove - // elements from the beginning of the array - for (const placeholder of this._placeholderGroups[this._placeholderGroupsIdx]) { - const nested = others.shift(); - console.assert(!nested._placeholderDecorations); - // Massage placeholder-indicies of the nested snippet to be - // sorted right after the insertion point. This ensures we move - // through the placeholders in the correct order - const indexLastPlaceholder = nested._snippet.placeholderInfo.last.index; - for (const nestedPlaceholder of nested._snippet.placeholderInfo.all) { - if (nestedPlaceholder.isFinalTabstop) { - nestedPlaceholder.index = placeholder.index + ((indexLastPlaceholder + 1) / this._nestingLevel); - } - else { - nestedPlaceholder.index = placeholder.index + (nestedPlaceholder.index / this._nestingLevel); - } - } - this._snippet.replace(placeholder, nested._snippet.children); - // Remove the placeholder at which position are inserting - // the snippet and also remove its decoration. - const id = this._placeholderDecorations.get(placeholder); - accessor.removeDecoration(id); - this._placeholderDecorations.delete(placeholder); - // For each *new* placeholder we create decoration to monitor - // how and if it grows/shrinks. - for (const placeholder of nested._snippet.placeholders) { - const placeholderOffset = nested._snippet.offset(placeholder); - const placeholderLen = nested._snippet.fullLen(placeholder); - const range = _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].fromPositions(model.getPositionAt(nested._offset + placeholderOffset), model.getPositionAt(nested._offset + placeholderOffset + placeholderLen)); - const handle = accessor.addDecoration(range, OneSnippet._decor.inactive); - this._placeholderDecorations.set(placeholder, handle); - } - } - // Last, re-create the placeholder groups by sorting placeholders by their index. - this._placeholderGroups = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["groupBy"])(this._snippet.placeholders, _snippetParser_js__WEBPACK_IMPORTED_MODULE_10__["Placeholder"].compareByIndex); - }); - } -} -OneSnippet._decor = { - active: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_7__["ModelDecorationOptions"].register({ stickiness: 0 /* AlwaysGrowsWhenTypingAtEdges */, className: 'snippet-placeholder' }), - inactive: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_7__["ModelDecorationOptions"].register({ stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, className: 'snippet-placeholder' }), - activeFinal: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_7__["ModelDecorationOptions"].register({ stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, className: 'finish-snippet-placeholder' }), - inactiveFinal: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_7__["ModelDecorationOptions"].register({ stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, className: 'finish-snippet-placeholder' }), -}; -const _defaultOptions = { - overwriteBefore: 0, - overwriteAfter: 0, - adjustWhitespace: true, - clipboardText: undefined, - overtypingCapturer: undefined -}; -class SnippetSession { - constructor(editor, template, options = _defaultOptions) { - this._templateMerges = []; - this._snippets = []; - this._editor = editor; - this._template = template; - this._options = options; - } - static adjustWhitespace(model, position, snippet, adjustIndentation, adjustNewlines) { - const line = model.getLineContent(position.lineNumber); - const lineLeadingWhitespace = Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"])(line, 0, position.column - 1); - snippet.walk(marker => { - if (marker instanceof _snippetParser_js__WEBPACK_IMPORTED_MODULE_10__["Text"] && !(marker.parent instanceof _snippetParser_js__WEBPACK_IMPORTED_MODULE_10__["Choice"])) { - // adjust indentation of text markers, except for choise elements - // which get adjusted when being selected - const lines = marker.value.split(/\r\n|\r|\n/); - if (adjustIndentation) { - for (let i = 1; i < lines.length; i++) { - let templateLeadingWhitespace = Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_2__["getLeadingWhitespace"])(lines[i]); - lines[i] = model.normalizeIndentation(lineLeadingWhitespace + templateLeadingWhitespace) + lines[i].substr(templateLeadingWhitespace.length); - } - } - if (adjustNewlines) { - const newValue = lines.join(model.getEOL()); - if (newValue !== marker.value) { - marker.parent.replace(marker, [new _snippetParser_js__WEBPACK_IMPORTED_MODULE_10__["Text"](newValue)]); - } - } - } - return true; - }); - } - static adjustSelection(model, selection, overwriteBefore, overwriteAfter) { - if (overwriteBefore !== 0 || overwriteAfter !== 0) { - // overwrite[Before|After] is compute using the position, not the whole - // selection. therefore we adjust the selection around that position - const { positionLineNumber, positionColumn } = selection; - const positionColumnBefore = positionColumn - overwriteBefore; - const positionColumnAfter = positionColumn + overwriteAfter; - const range = model.validateRange({ - startLineNumber: positionLineNumber, - startColumn: positionColumnBefore, - endLineNumber: positionLineNumber, - endColumn: positionColumnAfter - }); - selection = _common_core_selection_js__WEBPACK_IMPORTED_MODULE_6__["Selection"].createWithDirection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn, selection.getDirection()); - } - return selection; - } - static createEditsAndSnippets(editor, template, overwriteBefore, overwriteAfter, enforceFinalTabstop, adjustWhitespace, clipboardText, overtypingCapturer) { - const edits = []; - const snippets = []; - if (!editor.hasModel()) { - return { edits, snippets }; - } - const model = editor.getModel(); - const workspaceService = editor.invokeWithinContext(accessor => accessor.get(_platform_workspace_common_workspace_js__WEBPACK_IMPORTED_MODULE_8__["IWorkspaceContextService"], _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_9__["optional"])); - const modelBasedVariableResolver = editor.invokeWithinContext(accessor => new _snippetVariables_js__WEBPACK_IMPORTED_MODULE_11__["ModelBasedVariableResolver"](accessor.get(_platform_label_common_label_js__WEBPACK_IMPORTED_MODULE_14__["ILabelService"], _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_9__["optional"]), model)); - const readClipboardText = () => clipboardText; - let delta = 0; - // know what text the overwrite[Before|After] extensions - // of the primary curser have selected because only when - // secondary selections extend to the same text we can grow them - let firstBeforeText = model.getValueInRange(SnippetSession.adjustSelection(model, editor.getSelection(), overwriteBefore, 0)); - let firstAfterText = model.getValueInRange(SnippetSession.adjustSelection(model, editor.getSelection(), 0, overwriteAfter)); - // remember the first non-whitespace column to decide if - // `keepWhitespace` should be overruled for secondary selections - let firstLineFirstNonWhitespace = model.getLineFirstNonWhitespaceColumn(editor.getSelection().positionLineNumber); - // sort selections by their start position but remeber - // the original index. that allows you to create correct - // offset-based selection logic without changing the - // primary selection - const indexedSelections = editor.getSelections() - .map((selection, idx) => ({ selection, idx })) - .sort((a, b) => _common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].compareRangesUsingStarts(a.selection, b.selection)); - for (const { selection, idx } of indexedSelections) { - // extend selection with the `overwriteBefore` and `overwriteAfter` and then - // compare if this matches the extensions of the primary selection - let extensionBefore = SnippetSession.adjustSelection(model, selection, overwriteBefore, 0); - let extensionAfter = SnippetSession.adjustSelection(model, selection, 0, overwriteAfter); - if (firstBeforeText !== model.getValueInRange(extensionBefore)) { - extensionBefore = selection; - } - if (firstAfterText !== model.getValueInRange(extensionAfter)) { - extensionAfter = selection; - } - // merge the before and after selection into one - const snippetSelection = selection - .setStartPosition(extensionBefore.startLineNumber, extensionBefore.startColumn) - .setEndPosition(extensionAfter.endLineNumber, extensionAfter.endColumn); - const snippet = new _snippetParser_js__WEBPACK_IMPORTED_MODULE_10__["SnippetParser"]().parse(template, true, enforceFinalTabstop); - // adjust the template string to match the indentation and - // whitespace rules of this insert location (can be different for each cursor) - // happens when being asked for (default) or when this is a secondary - // cursor and the leading whitespace is different - const start = snippetSelection.getStartPosition(); - SnippetSession.adjustWhitespace(model, start, snippet, adjustWhitespace || (idx > 0 && firstLineFirstNonWhitespace !== model.getLineFirstNonWhitespaceColumn(selection.positionLineNumber)), true); - snippet.resolveVariables(new _snippetVariables_js__WEBPACK_IMPORTED_MODULE_11__["CompositeSnippetVariableResolver"]([ - modelBasedVariableResolver, - new _snippetVariables_js__WEBPACK_IMPORTED_MODULE_11__["ClipboardBasedVariableResolver"](readClipboardText, idx, indexedSelections.length, editor.getOption(62 /* multiCursorPaste */) === 'spread'), - new _snippetVariables_js__WEBPACK_IMPORTED_MODULE_11__["SelectionBasedVariableResolver"](model, selection, idx, overtypingCapturer), - new _snippetVariables_js__WEBPACK_IMPORTED_MODULE_11__["CommentBasedVariableResolver"](model, selection), - new _snippetVariables_js__WEBPACK_IMPORTED_MODULE_11__["TimeBasedVariableResolver"], - new _snippetVariables_js__WEBPACK_IMPORTED_MODULE_11__["WorkspaceBasedVariableResolver"](workspaceService), - new _snippetVariables_js__WEBPACK_IMPORTED_MODULE_11__["RandomBasedVariableResolver"], - ])); - const offset = model.getOffsetAt(start) + delta; - delta += snippet.toString().length - model.getValueLengthInRange(snippetSelection); - // store snippets with the index of their originating selection. - // that ensures the primiary cursor stays primary despite not being - // the one with lowest start position - edits[idx] = _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_4__["EditOperation"].replace(snippetSelection, snippet.toString()); - edits[idx].identifier = { major: idx, minor: 0 }; // mark the edit so only our undo edits will be used to generate end cursors - snippets[idx] = new OneSnippet(editor, snippet, offset); - } - return { edits, snippets }; - } - dispose() { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this._snippets); - } - _logInfo() { - return `template="${this._template}", merged_templates="${this._templateMerges.join(' -> ')}"`; - } - insert() { - if (!this._editor.hasModel()) { - return; - } - // make insert edit and start with first selections - const { edits, snippets } = SnippetSession.createEditsAndSnippets(this._editor, this._template, this._options.overwriteBefore, this._options.overwriteAfter, false, this._options.adjustWhitespace, this._options.clipboardText, this._options.overtypingCapturer); - this._snippets = snippets; - this._editor.executeEdits('snippet', edits, undoEdits => { - if (this._snippets[0].hasPlaceholder) { - return this._move(true); - } - else { - return undoEdits - .filter(edit => !!edit.identifier) // only use our undo edits - .map(edit => _common_core_selection_js__WEBPACK_IMPORTED_MODULE_6__["Selection"].fromPositions(edit.range.getEndPosition())); - } - }); - this._editor.revealRange(this._editor.getSelections()[0]); - } - merge(template, options = _defaultOptions) { - if (!this._editor.hasModel()) { - return; - } - this._templateMerges.push([this._snippets[0]._nestingLevel, this._snippets[0]._placeholderGroupsIdx, template]); - const { edits, snippets } = SnippetSession.createEditsAndSnippets(this._editor, template, options.overwriteBefore, options.overwriteAfter, true, options.adjustWhitespace, options.clipboardText, options.overtypingCapturer); - this._editor.executeEdits('snippet', edits, undoEdits => { - for (const snippet of this._snippets) { - snippet.merge(snippets); - } - console.assert(snippets.length === 0); - if (this._snippets[0].hasPlaceholder) { - return this._move(undefined); - } - else { - return (undoEdits - .filter(edit => !!edit.identifier) // only use our undo edits - .map(edit => _common_core_selection_js__WEBPACK_IMPORTED_MODULE_6__["Selection"].fromPositions(edit.range.getEndPosition()))); - } - }); - } - next() { - const newSelections = this._move(true); - this._editor.setSelections(newSelections); - this._editor.revealPositionInCenterIfOutsideViewport(newSelections[0].getPosition()); - } - prev() { - const newSelections = this._move(false); - this._editor.setSelections(newSelections); - this._editor.revealPositionInCenterIfOutsideViewport(newSelections[0].getPosition()); - } - _move(fwd) { - const selections = []; - for (const snippet of this._snippets) { - const oneSelection = snippet.move(fwd); - selections.push(...oneSelection); - } - return selections; - } - get isAtFirstPlaceholder() { - return this._snippets[0].isAtFirstPlaceholder; - } - get isAtLastPlaceholder() { - return this._snippets[0].isAtLastPlaceholder; - } - get hasPlaceholder() { - return this._snippets[0].hasPlaceholder; - } - get choice() { - return this._snippets[0].choice; - } - isSelectionWithinPlaceholders() { - if (!this.hasPlaceholder) { - return false; - } - const selections = this._editor.getSelections(); - if (selections.length < this._snippets.length) { - // this means we started snippet mode with N - // selections and have M (N > M) selections. - // So one snippet is without selection -> cancel - return false; - } - let allPossibleSelections = new Map(); - for (const snippet of this._snippets) { - const possibleSelections = snippet.computePossibleSelections(); - // for the first snippet find the placeholder (and its ranges) - // that contain at least one selection. for all remaining snippets - // the same placeholder (and their ranges) must be used. - if (allPossibleSelections.size === 0) { - for (const [index, ranges] of possibleSelections) { - ranges.sort(_common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].compareRangesUsingStarts); - for (const selection of selections) { - if (ranges[0].containsRange(selection)) { - allPossibleSelections.set(index, []); - break; - } - } - } - } - if (allPossibleSelections.size === 0) { - // return false if we couldn't associate a selection to - // this (the first) snippet - return false; - } - // add selections from 'this' snippet so that we know all - // selections for this placeholder - allPossibleSelections.forEach((array, index) => { - array.push(...possibleSelections.get(index)); - }); - } - // sort selections (and later placeholder-ranges). then walk both - // arrays and make sure the placeholder-ranges contain the corresponding - // selection - selections.sort(_common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].compareRangesUsingStarts); - for (let [index, ranges] of allPossibleSelections) { - if (ranges.length !== selections.length) { - allPossibleSelections.delete(index); - continue; - } - ranges.sort(_common_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].compareRangesUsingStarts); - for (let i = 0; i < ranges.length; i++) { - if (!ranges[i].containsRange(selections[i])) { - allPossibleSelections.delete(index); - continue; - } - } - } - // from all possible selections we have deleted those - // that don't match with the current selection. if we don't - // have any left, we don't have a selection anymore - return allPossibleSelections.size > 0; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetVariables.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetVariables.js ***! - \**************************************************************************************/ -/*! exports provided: CompositeSnippetVariableResolver, SelectionBasedVariableResolver, ModelBasedVariableResolver, ClipboardBasedVariableResolver, CommentBasedVariableResolver, TimeBasedVariableResolver, WorkspaceBasedVariableResolver, RandomBasedVariableResolver */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompositeSnippetVariableResolver", function() { return CompositeSnippetVariableResolver; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionBasedVariableResolver", function() { return SelectionBasedVariableResolver; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModelBasedVariableResolver", function() { return ModelBasedVariableResolver; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClipboardBasedVariableResolver", function() { return ClipboardBasedVariableResolver; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommentBasedVariableResolver", function() { return CommentBasedVariableResolver; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeBasedVariableResolver", function() { return TimeBasedVariableResolver; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceBasedVariableResolver", function() { return WorkspaceBasedVariableResolver; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RandomBasedVariableResolver", function() { return RandomBasedVariableResolver; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_path_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/path.js */ "./node_modules/monaco-editor/esm/vs/base/common/path.js"); -/* harmony import */ var _base_common_resources_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/* harmony import */ var _snippetParser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./snippetParser.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetParser.js"); -/* harmony import */ var _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _platform_workspaces_common_workspaces_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/workspaces/common/workspaces.js */ "./node_modules/monaco-editor/esm/vs/platform/workspaces/common/workspaces.js"); -/* harmony import */ var _base_common_labels_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/labels.js */ "./node_modules/monaco-editor/esm/vs/base/common/labels.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - -class CompositeSnippetVariableResolver { - constructor(_delegates) { - this._delegates = _delegates; - // - } - resolve(variable) { - for (const delegate of this._delegates) { - let value = delegate.resolve(variable); - if (value !== undefined) { - return value; - } - } - return undefined; - } -} -class SelectionBasedVariableResolver { - constructor(_model, _selection, _selectionIdx, _overtypingCapturer) { - this._model = _model; - this._selection = _selection; - this._selectionIdx = _selectionIdx; - this._overtypingCapturer = _overtypingCapturer; - // - } - resolve(variable) { - const { name } = variable; - if (name === 'SELECTION' || name === 'TM_SELECTED_TEXT') { - let value = this._model.getValueInRange(this._selection) || undefined; - let isMultiline = this._selection.startLineNumber !== this._selection.endLineNumber; - // If there was no selected text, try to get last overtyped text - if (!value && this._overtypingCapturer) { - const info = this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx); - if (info) { - value = info.value; - isMultiline = info.multiline; - } - } - if (value && isMultiline && variable.snippet) { - // Selection is a multiline string which we indentation we now - // need to adjust. We compare the indentation of this variable - // with the indentation at the editor position and add potential - // extra indentation to the value - const line = this._model.getLineContent(this._selection.startLineNumber); - const lineLeadingWhitespace = Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_5__["getLeadingWhitespace"])(line, 0, this._selection.startColumn - 1); - let varLeadingWhitespace = lineLeadingWhitespace; - variable.snippet.walk(marker => { - if (marker === variable) { - return false; - } - if (marker instanceof _snippetParser_js__WEBPACK_IMPORTED_MODULE_3__["Text"]) { - varLeadingWhitespace = Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_5__["getLeadingWhitespace"])(marker.value.split(/\r\n|\r|\n/).pop()); - } - return true; - }); - const whitespaceCommonLength = Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_5__["commonPrefixLength"])(varLeadingWhitespace, lineLeadingWhitespace); - value = value.replace(/(\r\n|\r|\n)(.*)/g, (m, newline, rest) => `${newline}${varLeadingWhitespace.substr(whitespaceCommonLength)}${rest}`); - } - return value; - } - else if (name === 'TM_CURRENT_LINE') { - return this._model.getLineContent(this._selection.positionLineNumber); - } - else if (name === 'TM_CURRENT_WORD') { - const info = this._model.getWordAtPosition({ - lineNumber: this._selection.positionLineNumber, - column: this._selection.positionColumn - }); - return info && info.word || undefined; - } - else if (name === 'TM_LINE_INDEX') { - return String(this._selection.positionLineNumber - 1); - } - else if (name === 'TM_LINE_NUMBER') { - return String(this._selection.positionLineNumber); - } - return undefined; - } -} -class ModelBasedVariableResolver { - constructor(_labelService, _model) { - this._labelService = _labelService; - this._model = _model; - // - } - resolve(variable) { - const { name } = variable; - if (name === 'TM_FILENAME') { - return _base_common_path_js__WEBPACK_IMPORTED_MODULE_1__["basename"](this._model.uri.fsPath); - } - else if (name === 'TM_FILENAME_BASE') { - const name = _base_common_path_js__WEBPACK_IMPORTED_MODULE_1__["basename"](this._model.uri.fsPath); - const idx = name.lastIndexOf('.'); - if (idx <= 0) { - return name; - } - else { - return name.slice(0, idx); - } - } - else if (name === 'TM_DIRECTORY' && this._labelService) { - if (_base_common_path_js__WEBPACK_IMPORTED_MODULE_1__["dirname"](this._model.uri.fsPath) === '.') { - return ''; - } - return this._labelService.getUriLabel(Object(_base_common_resources_js__WEBPACK_IMPORTED_MODULE_2__["dirname"])(this._model.uri)); - } - else if (name === 'TM_FILEPATH' && this._labelService) { - return this._labelService.getUriLabel(this._model.uri); - } - return undefined; - } -} -class ClipboardBasedVariableResolver { - constructor(_readClipboardText, _selectionIdx, _selectionCount, _spread) { - this._readClipboardText = _readClipboardText; - this._selectionIdx = _selectionIdx; - this._selectionCount = _selectionCount; - this._spread = _spread; - // - } - resolve(variable) { - if (variable.name !== 'CLIPBOARD') { - return undefined; - } - const clipboardText = this._readClipboardText(); - if (!clipboardText) { - return undefined; - } - // `spread` is assigning each cursor a line of the clipboard - // text whenever there the line count equals the cursor count - // and when enabled - if (this._spread) { - const lines = clipboardText.split(/\r\n|\n|\r/).filter(s => !Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_5__["isFalsyOrWhitespace"])(s)); - if (lines.length === this._selectionCount) { - return lines[this._selectionIdx]; - } - } - return clipboardText; - } -} -class CommentBasedVariableResolver { - constructor(_model, _selection) { - this._model = _model; - this._selection = _selection; - // - } - resolve(variable) { - const { name } = variable; - const langId = this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber, this._selection.selectionStartColumn); - const config = _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_4__["LanguageConfigurationRegistry"].getComments(langId); - if (!config) { - return undefined; - } - if (name === 'LINE_COMMENT') { - return config.lineCommentToken || undefined; - } - else if (name === 'BLOCK_COMMENT_START') { - return config.blockCommentStartToken || undefined; - } - else if (name === 'BLOCK_COMMENT_END') { - return config.blockCommentEndToken || undefined; - } - return undefined; - } -} -class TimeBasedVariableResolver { - resolve(variable) { - const { name } = variable; - if (name === 'CURRENT_YEAR') { - return String(new Date().getFullYear()); - } - else if (name === 'CURRENT_YEAR_SHORT') { - return String(new Date().getFullYear()).slice(-2); - } - else if (name === 'CURRENT_MONTH') { - return String(new Date().getMonth().valueOf() + 1).padStart(2, '0'); - } - else if (name === 'CURRENT_DATE') { - return String(new Date().getDate().valueOf()).padStart(2, '0'); - } - else if (name === 'CURRENT_HOUR') { - return String(new Date().getHours().valueOf()).padStart(2, '0'); - } - else if (name === 'CURRENT_MINUTE') { - return String(new Date().getMinutes().valueOf()).padStart(2, '0'); - } - else if (name === 'CURRENT_SECOND') { - return String(new Date().getSeconds().valueOf()).padStart(2, '0'); - } - else if (name === 'CURRENT_DAY_NAME') { - return TimeBasedVariableResolver.dayNames[new Date().getDay()]; - } - else if (name === 'CURRENT_DAY_NAME_SHORT') { - return TimeBasedVariableResolver.dayNamesShort[new Date().getDay()]; - } - else if (name === 'CURRENT_MONTH_NAME') { - return TimeBasedVariableResolver.monthNames[new Date().getMonth()]; - } - else if (name === 'CURRENT_MONTH_NAME_SHORT') { - return TimeBasedVariableResolver.monthNamesShort[new Date().getMonth()]; - } - else if (name === 'CURRENT_SECONDS_UNIX') { - return String(Math.floor(Date.now() / 1000)); - } - return undefined; - } -} -TimeBasedVariableResolver.dayNames = [_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('Sunday', "Sunday"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('Monday', "Monday"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('Tuesday', "Tuesday"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('Wednesday', "Wednesday"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('Thursday', "Thursday"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('Friday', "Friday"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('Saturday', "Saturday")]; -TimeBasedVariableResolver.dayNamesShort = [_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('SundayShort', "Sun"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('MondayShort', "Mon"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('TuesdayShort', "Tue"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('WednesdayShort', "Wed"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('ThursdayShort', "Thu"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('FridayShort', "Fri"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('SaturdayShort', "Sat")]; -TimeBasedVariableResolver.monthNames = [_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('January', "January"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('February', "February"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('March', "March"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('April', "April"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('May', "May"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('June', "June"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('July', "July"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('August', "August"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('September', "September"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('October', "October"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('November', "November"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('December', "December")]; -TimeBasedVariableResolver.monthNamesShort = [_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('JanuaryShort', "Jan"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('FebruaryShort', "Feb"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('MarchShort', "Mar"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('AprilShort', "Apr"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('MayShort', "May"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('JuneShort', "Jun"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('JulyShort', "Jul"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('AugustShort', "Aug"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('SeptemberShort', "Sep"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('OctoberShort', "Oct"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('NovemberShort', "Nov"), _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('DecemberShort', "Dec")]; -class WorkspaceBasedVariableResolver { - constructor(_workspaceService) { - this._workspaceService = _workspaceService; - // - } - resolve(variable) { - if (!this._workspaceService) { - return undefined; - } - const workspaceIdentifier = Object(_platform_workspaces_common_workspaces_js__WEBPACK_IMPORTED_MODULE_6__["toWorkspaceIdentifier"])(this._workspaceService.getWorkspace()); - if (!workspaceIdentifier) { - return undefined; - } - if (variable.name === 'WORKSPACE_NAME') { - return this._resolveWorkspaceName(workspaceIdentifier); - } - else if (variable.name === 'WORKSPACE_FOLDER') { - return this._resoveWorkspacePath(workspaceIdentifier); - } - return undefined; - } - _resolveWorkspaceName(workspaceIdentifier) { - if (Object(_platform_workspaces_common_workspaces_js__WEBPACK_IMPORTED_MODULE_6__["isSingleFolderWorkspaceIdentifier"])(workspaceIdentifier)) { - return _base_common_path_js__WEBPACK_IMPORTED_MODULE_1__["basename"](workspaceIdentifier.path); - } - let filename = _base_common_path_js__WEBPACK_IMPORTED_MODULE_1__["basename"](workspaceIdentifier.configPath.path); - if (filename.endsWith(_platform_workspaces_common_workspaces_js__WEBPACK_IMPORTED_MODULE_6__["WORKSPACE_EXTENSION"])) { - filename = filename.substr(0, filename.length - _platform_workspaces_common_workspaces_js__WEBPACK_IMPORTED_MODULE_6__["WORKSPACE_EXTENSION"].length - 1); - } - return filename; - } - _resoveWorkspacePath(workspaceIdentifier) { - if (Object(_platform_workspaces_common_workspaces_js__WEBPACK_IMPORTED_MODULE_6__["isSingleFolderWorkspaceIdentifier"])(workspaceIdentifier)) { - return Object(_base_common_labels_js__WEBPACK_IMPORTED_MODULE_7__["normalizeDriveLetter"])(workspaceIdentifier.fsPath); - } - let filename = _base_common_path_js__WEBPACK_IMPORTED_MODULE_1__["basename"](workspaceIdentifier.configPath.path); - let folderpath = workspaceIdentifier.configPath.fsPath; - if (folderpath.endsWith(filename)) { - folderpath = folderpath.substr(0, folderpath.length - filename.length - 1); - } - return (folderpath ? Object(_base_common_labels_js__WEBPACK_IMPORTED_MODULE_7__["normalizeDriveLetter"])(folderpath) : '/'); - } -} -class RandomBasedVariableResolver { - resolve(variable) { - const { name } = variable; - if (name === 'RANDOM') { - return Math.random().toString().slice(-6); - } - else if (name === 'RANDOM_HEX') { - return Math.random().toString(16).slice(-6); - } - return undefined; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/completionModel.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/completionModel.js ***! - \*************************************************************************************/ -/*! exports provided: LineContext, CompletionModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineContext", function() { return LineContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionModel", function() { return CompletionModel; }); -/* harmony import */ var _base_common_filters_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/filters.js */ "./node_modules/monaco-editor/esm/vs/base/common/filters.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class LineContext { - constructor(leadingLineContent, characterCountDelta) { - this.leadingLineContent = leadingLineContent; - this.characterCountDelta = characterCountDelta; - } -} -/** - * Sorted, filtered completion view model - * */ -class CompletionModel { - constructor(items, column, lineContext, wordDistance, options, snippetSuggestions, clipboardText) { - this.clipboardText = clipboardText; - this._snippetCompareFn = CompletionModel._compareCompletionItems; - this._items = items; - this._column = column; - this._wordDistance = wordDistance; - this._options = options; - this._refilterKind = 1 /* All */; - this._lineContext = lineContext; - if (snippetSuggestions === 'top') { - this._snippetCompareFn = CompletionModel._compareCompletionItemsSnippetsUp; - } - else if (snippetSuggestions === 'bottom') { - this._snippetCompareFn = CompletionModel._compareCompletionItemsSnippetsDown; - } - } - get lineContext() { - return this._lineContext; - } - set lineContext(value) { - if (this._lineContext.leadingLineContent !== value.leadingLineContent - || this._lineContext.characterCountDelta !== value.characterCountDelta) { - this._refilterKind = this._lineContext.characterCountDelta < value.characterCountDelta && this._filteredItems ? 2 /* Incr */ : 1 /* All */; - this._lineContext = value; - } - } - get items() { - this._ensureCachedState(); - return this._filteredItems; - } - get allProvider() { - this._ensureCachedState(); - return this._allProvider; - } - get incomplete() { - this._ensureCachedState(); - return this._isIncomplete; - } - adopt(except) { - let res = []; - for (let i = 0; i < this._items.length;) { - if (!except.has(this._items[i].provider)) { - res.push(this._items[i]); - // unordered removed - this._items[i] = this._items[this._items.length - 1]; - this._items.pop(); - } - else { - // continue with next item - i++; - } - } - this._refilterKind = 1 /* All */; - return res; - } - get stats() { - this._ensureCachedState(); - return this._stats; - } - _ensureCachedState() { - if (this._refilterKind !== 0 /* Nothing */) { - this._createCachedState(); - } - } - _createCachedState() { - this._isIncomplete = new Set(); - this._allProvider = new Set(); - this._stats = { suggestionCount: 0, snippetCount: 0, textCount: 0 }; - const { leadingLineContent, characterCountDelta } = this._lineContext; - let word = ''; - let wordLow = ''; - // incrementally filter less - const source = this._refilterKind === 1 /* All */ ? this._items : this._filteredItems; - const target = []; - // picks a score function based on the number of - // items that we have to score/filter and based on the - // user-configuration - const scoreFn = (!this._options.filterGraceful || source.length > 2000) ? _base_common_filters_js__WEBPACK_IMPORTED_MODULE_0__["fuzzyScore"] : _base_common_filters_js__WEBPACK_IMPORTED_MODULE_0__["fuzzyScoreGracefulAggressive"]; - for (let i = 0; i < source.length; i++) { - const item = source[i]; - if (item.isInvalid) { - continue; // SKIP invalid items - } - // collect those supports that signaled having - // an incomplete result - if (item.container.incomplete) { - this._isIncomplete.add(item.provider); - } - this._allProvider.add(item.provider); - // 'word' is that remainder of the current line that we - // filter and score against. In theory each suggestion uses a - // different word, but in practice not - that's why we cache - const overwriteBefore = item.position.column - item.editStart.column; - const wordLen = overwriteBefore + characterCountDelta - (item.position.column - this._column); - if (word.length !== wordLen) { - word = wordLen === 0 ? '' : leadingLineContent.slice(-wordLen); - wordLow = word.toLowerCase(); - } - // remember the word against which this item was - // scored - item.word = word; - if (wordLen === 0) { - // when there is nothing to score against, don't - // event try to do. Use a const rank and rely on - // the fallback-sort using the initial sort order. - // use a score of `-100` because that is out of the - // bound of values `fuzzyScore` will return - item.score = _base_common_filters_js__WEBPACK_IMPORTED_MODULE_0__["FuzzyScore"].Default; - } - else { - // skip word characters that are whitespace until - // we have hit the replace range (overwriteBefore) - let wordPos = 0; - while (wordPos < overwriteBefore) { - const ch = word.charCodeAt(wordPos); - if (ch === 32 /* Space */ || ch === 9 /* Tab */) { - wordPos += 1; - } - else { - break; - } - } - const textLabel = typeof item.completion.label === 'string' ? item.completion.label : item.completion.label.name; - if (wordPos >= wordLen) { - // the wordPos at which scoring starts is the whole word - // and therefore the same rules as not having a word apply - item.score = _base_common_filters_js__WEBPACK_IMPORTED_MODULE_0__["FuzzyScore"].Default; - } - else if (typeof item.completion.filterText === 'string') { - // when there is a `filterText` it must match the `word`. - // if it matches we check with the label to compute highlights - // and if that doesn't yield a result we have no highlights, - // despite having the match - let match = scoreFn(word, wordLow, wordPos, item.completion.filterText, item.filterTextLow, 0, false); - if (!match) { - continue; // NO match - } - if (Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["compareIgnoreCase"])(item.completion.filterText, textLabel) === 0) { - // filterText and label are actually the same -> use good highlights - item.score = match; - } - else { - // re-run the scorer on the label in the hope of a result BUT use the rank - // of the filterText-match - item.score = Object(_base_common_filters_js__WEBPACK_IMPORTED_MODULE_0__["anyScore"])(word, wordLow, wordPos, textLabel, item.labelLow, 0); - item.score[0] = match[0]; // use score from filterText - } - } - else { - // by default match `word` against the `label` - let match = scoreFn(word, wordLow, wordPos, textLabel, item.labelLow, 0, false); - if (!match) { - continue; // NO match - } - item.score = match; - } - } - item.idx = i; - item.distance = this._wordDistance.distance(item.position, item.completion); - target.push(item); - // update stats - this._stats.suggestionCount++; - switch (item.completion.kind) { - case 27 /* Snippet */: - this._stats.snippetCount++; - break; - case 18 /* Text */: - this._stats.textCount++; - break; - } - } - this._filteredItems = target.sort(this._snippetCompareFn); - this._refilterKind = 0 /* Nothing */; - } - static _compareCompletionItems(a, b) { - if (a.score[0] > b.score[0]) { - return -1; - } - else if (a.score[0] < b.score[0]) { - return 1; - } - else if (a.distance < b.distance) { - return -1; - } - else if (a.distance > b.distance) { - return 1; - } - else if (a.idx < b.idx) { - return -1; - } - else if (a.idx > b.idx) { - return 1; - } - else { - return 0; - } - } - static _compareCompletionItemsSnippetsDown(a, b) { - if (a.completion.kind !== b.completion.kind) { - if (a.completion.kind === 27 /* Snippet */) { - return 1; - } - else if (b.completion.kind === 27 /* Snippet */) { - return -1; - } - } - return CompletionModel._compareCompletionItems(a, b); - } - static _compareCompletionItemsSnippetsUp(a, b) { - if (a.completion.kind !== b.completion.kind) { - if (a.completion.kind === 27 /* Snippet */) { - return -1; - } - else if (b.completion.kind === 27 /* Snippet */) { - return 1; - } - } - return CompletionModel._compareCompletionItems(a, b); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/media/suggest.css": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/media/suggest.css ***! - \************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_suggest_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./suggest.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/media/suggest.css"); -/* harmony import */ var _css_loader_dist_cjs_js_suggest_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_suggest_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_suggest_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_suggest_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/media/suggestStatusBar.css": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/media/suggestStatusBar.css ***! - \*********************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_suggestStatusBar_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./suggestStatusBar.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/media/suggestStatusBar.css"); -/* harmony import */ var _css_loader_dist_cjs_js_suggestStatusBar_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_suggestStatusBar_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_suggestStatusBar_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_suggestStatusBar_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggest.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggest.js ***! - \*****************************************************************************/ -/*! exports provided: Context, suggestWidgetStatusbarMenu, CompletionItem, CompletionOptions, getSnippetSuggestSupport, provideSuggestionItems, getSuggestionComparator, showSimpleSuggestions */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return Context; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "suggestWidgetStatusbarMenu", function() { return suggestWidgetStatusbarMenu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return CompletionItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionOptions", function() { return CompletionOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSnippetSuggestSupport", function() { return getSnippetSuggestSupport; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "provideSuggestionItems", function() { return provideSuggestionItems; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSuggestionComparator", function() { return getSuggestionComparator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showSimpleSuggestions", function() { return showSimpleSuggestions; }); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _base_common_filters_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/filters.js */ "./node_modules/monaco-editor/esm/vs/base/common/filters.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _snippet_snippetParser_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../snippet/snippetParser.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetParser.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - -const Context = { - Visible: new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["RawContextKey"]('suggestWidgetVisible', false), - DetailsVisible: new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["RawContextKey"]('suggestWidgetDetailsVisible', false), - MultipleSuggestions: new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["RawContextKey"]('suggestWidgetMultipleSuggestions', false), - MakesTextEdit: new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["RawContextKey"]('suggestionMakesTextEdit', true), - AcceptSuggestionsOnEnter: new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["RawContextKey"]('acceptSuggestionOnEnter', true), - HasInsertAndReplaceRange: new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["RawContextKey"]('suggestionHasInsertAndReplaceRange', false), - CanResolve: new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["RawContextKey"]('suggestionCanResolve', false), -}; -const suggestWidgetStatusbarMenu = new _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_9__["MenuId"]('suggestWidgetStatusBar'); -class CompletionItem { - constructor(position, completion, container, provider) { - this.position = position; - this.completion = completion; - this.container = container; - this.provider = provider; - // validation - this.isInvalid = false; - // sorting, filtering - this.score = _base_common_filters_js__WEBPACK_IMPORTED_MODULE_7__["FuzzyScore"].Default; - this.distance = 0; - this.textLabel = typeof completion.label === 'string' - ? completion.label - : completion.label.name; - // ensure lower-variants (perf) - this.labelLow = this.textLabel.toLowerCase(); - // validate label - this.isInvalid = !this.textLabel; - this.sortTextLow = completion.sortText && completion.sortText.toLowerCase(); - this.filterTextLow = completion.filterText && completion.filterText.toLowerCase(); - // normalize ranges - if (_common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].isIRange(completion.range)) { - this.editStart = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](completion.range.startLineNumber, completion.range.startColumn); - this.editInsertEnd = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](completion.range.endLineNumber, completion.range.endColumn); - this.editReplaceEnd = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](completion.range.endLineNumber, completion.range.endColumn); - // validate range - this.isInvalid = this.isInvalid - || _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].spansMultipleLines(completion.range) || completion.range.startLineNumber !== position.lineNumber; - } - else { - this.editStart = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](completion.range.insert.startLineNumber, completion.range.insert.startColumn); - this.editInsertEnd = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](completion.range.insert.endLineNumber, completion.range.insert.endColumn); - this.editReplaceEnd = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_3__["Position"](completion.range.replace.endLineNumber, completion.range.replace.endColumn); - // validate ranges - this.isInvalid = this.isInvalid - || _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].spansMultipleLines(completion.range.insert) || _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].spansMultipleLines(completion.range.replace) - || completion.range.insert.startLineNumber !== position.lineNumber || completion.range.replace.startLineNumber !== position.lineNumber - || completion.range.insert.startColumn !== completion.range.replace.startColumn; - } - // create the suggestion resolver - if (typeof provider.resolveCompletionItem !== 'function') { - this._resolveCache = Promise.resolve(); - this._isResolved = true; - } - } - // ---- resolving - get isResolved() { - return !!this._isResolved; - } - resolve(token) { - return __awaiter(this, void 0, void 0, function* () { - if (!this._resolveCache) { - const sub = token.onCancellationRequested(() => { - this._resolveCache = undefined; - this._isResolved = false; - }); - this._resolveCache = Promise.resolve(this.provider.resolveCompletionItem(this.completion, token)).then(value => { - Object.assign(this.completion, value); - this._isResolved = true; - sub.dispose(); - }, err => { - if (Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["isPromiseCanceledError"])(err)) { - // the IPC queue will reject the request with the - // cancellation error -> reset cached - this._resolveCache = undefined; - this._isResolved = false; - } - }); - } - return this._resolveCache; - }); - } -} -class CompletionOptions { - constructor(snippetSortOrder = 2 /* Bottom */, kindFilter = new Set(), providerFilter = new Set()) { - this.snippetSortOrder = snippetSortOrder; - this.kindFilter = kindFilter; - this.providerFilter = providerFilter; - } -} -CompletionOptions.default = new CompletionOptions(); -let _snippetSuggestSupport; -function getSnippetSuggestSupport() { - return _snippetSuggestSupport; -} -class CompletionItemModel { - constructor(items, needsClipboard, dispoables) { - this.items = items; - this.needsClipboard = needsClipboard; - this.dispoables = dispoables; - } -} -function provideSuggestionItems(model, position, options = CompletionOptions.default, context = { triggerKind: 0 /* Invoke */ }, token = _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_5__["CancellationToken"].None) { - return __awaiter(this, void 0, void 0, function* () { - // const t1 = Date.now(); - position = position.clone(); - const word = model.getWordAtPosition(position); - const defaultReplaceRange = word ? new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](position.lineNumber, word.startColumn, position.lineNumber, word.endColumn) : _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].fromPositions(position); - const defaultRange = { replace: defaultReplaceRange, insert: defaultReplaceRange.setEndPosition(position.lineNumber, position.column) }; - const result = []; - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_8__["DisposableStore"](); - let needsClipboard = false; - const onCompletionList = (provider, container) => { - if (!container) { - return; - } - for (let suggestion of container.suggestions) { - if (!options.kindFilter.has(suggestion.kind)) { - // fill in default range when missing - if (!suggestion.range) { - suggestion.range = defaultRange; - } - // fill in default sortText when missing - if (!suggestion.sortText) { - suggestion.sortText = typeof suggestion.label === 'string' ? suggestion.label : suggestion.label.name; - } - if (!needsClipboard && suggestion.insertTextRules && suggestion.insertTextRules & 4 /* InsertAsSnippet */) { - needsClipboard = _snippet_snippetParser_js__WEBPACK_IMPORTED_MODULE_10__["SnippetParser"].guessNeedsClipboard(suggestion.insertText); - } - result.push(new CompletionItem(position, suggestion, container, provider)); - } - } - if (Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_8__["isDisposable"])(container)) { - disposables.add(container); - } - }; - // ask for snippets in parallel to asking "real" providers. Only do something if configured to - // do so - no snippet filter, no special-providers-only request - const snippetCompletions = (() => __awaiter(this, void 0, void 0, function* () { - if (!_snippetSuggestSupport || options.kindFilter.has(27 /* Snippet */)) { - return; - } - if (options.providerFilter.size > 0 && !options.providerFilter.has(_snippetSuggestSupport)) { - return; - } - const list = yield _snippetSuggestSupport.provideCompletionItems(model, position, context, token); - onCompletionList(_snippetSuggestSupport, list); - }))(); - // add suggestions from contributed providers - providers are ordered in groups of - // equal score and once a group produces a result the process stops - // get provider groups, always add snippet suggestion provider - for (let providerGroup of _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["CompletionProviderRegistry"].orderedGroups(model)) { - // for each support in the group ask for suggestions - let lenBefore = result.length; - yield Promise.all(providerGroup.map((provider) => __awaiter(this, void 0, void 0, function* () { - if (options.providerFilter.size > 0 && !options.providerFilter.has(provider)) { - return; - } - try { - const list = yield provider.provideCompletionItems(model, position, context, token); - onCompletionList(provider, list); - } - catch (err) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedExternalError"])(err); - } - }))); - if (lenBefore !== result.length || token.isCancellationRequested) { - break; - } - } - yield snippetCompletions; - if (token.isCancellationRequested) { - disposables.dispose(); - return Promise.reject(Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["canceled"])()); - } - // console.log(`${result.length} items AFTER ${Date.now() - t1}ms`); - return new CompletionItemModel(result.sort(getSuggestionComparator(options.snippetSortOrder)), needsClipboard, disposables); - }); -} -function defaultComparator(a, b) { - // check with 'sortText' - if (a.sortTextLow && b.sortTextLow) { - if (a.sortTextLow < b.sortTextLow) { - return -1; - } - else if (a.sortTextLow > b.sortTextLow) { - return 1; - } - } - // check with 'label' - if (a.completion.label < b.completion.label) { - return -1; - } - else if (a.completion.label > b.completion.label) { - return 1; - } - // check with 'type' - return a.completion.kind - b.completion.kind; -} -function snippetUpComparator(a, b) { - if (a.completion.kind !== b.completion.kind) { - if (a.completion.kind === 27 /* Snippet */) { - return -1; - } - else if (b.completion.kind === 27 /* Snippet */) { - return 1; - } - } - return defaultComparator(a, b); -} -function snippetDownComparator(a, b) { - if (a.completion.kind !== b.completion.kind) { - if (a.completion.kind === 27 /* Snippet */) { - return 1; - } - else if (b.completion.kind === 27 /* Snippet */) { - return -1; - } - } - return defaultComparator(a, b); -} -const _snippetComparators = new Map(); -_snippetComparators.set(0 /* Top */, snippetUpComparator); -_snippetComparators.set(2 /* Bottom */, snippetDownComparator); -_snippetComparators.set(1 /* Inline */, defaultComparator); -function getSuggestionComparator(snippetConfig) { - return _snippetComparators.get(snippetConfig); -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerDefaultLanguageCommand"])('_executeCompletionItemProvider', (model, position, args) => __awaiter(void 0, void 0, void 0, function* () { - const result = { - incomplete: false, - suggestions: [] - }; - const resolving = []; - const maxItemsToResolve = args['maxItemsToResolve'] || 0; - const completions = yield provideSuggestionItems(model, position); - for (const item of completions.items) { - if (resolving.length < maxItemsToResolve) { - resolving.push(item.resolve(_base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_5__["CancellationToken"].None)); - } - result.incomplete = result.incomplete || item.container.incomplete; - result.suggestions.push(item.completion); - } - try { - yield Promise.all(resolving); - return result; - } - finally { - setTimeout(() => completions.dispoables.dispose(), 100); - } -})); -const _provider = new class { - constructor() { - this.onlyOnceSuggestions = []; - } - provideCompletionItems() { - let suggestions = this.onlyOnceSuggestions.slice(0); - let result = { suggestions }; - this.onlyOnceSuggestions.length = 0; - return result; - } -}; -_common_modes_js__WEBPACK_IMPORTED_MODULE_2__["CompletionProviderRegistry"].register('*', _provider); -function showSimpleSuggestions(editor, suggestions) { - setTimeout(() => { - _provider.onlyOnceSuggestions.push(...suggestions); - editor.getContribution('editor.contrib.suggestController').triggerSuggest(new Set().add(_provider)); - }, 0); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestAlternatives.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestAlternatives.js ***! - \*****************************************************************************************/ -/*! exports provided: SuggestAlternatives */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SuggestAlternatives", function() { return SuggestAlternatives; }); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - -let SuggestAlternatives = class SuggestAlternatives { - constructor(_editor, contextKeyService) { - this._editor = _editor; - this._index = 0; - this._ckOtherSuggestions = SuggestAlternatives.OtherSuggestions.bindTo(contextKeyService); - } - dispose() { - this.reset(); - } - reset() { - this._ckOtherSuggestions.reset(); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["dispose"])(this._listener); - this._model = undefined; - this._acceptNext = undefined; - this._ignore = false; - } - set({ model, index }, acceptNext) { - // no suggestions -> nothing to do - if (model.items.length === 0) { - this.reset(); - return; - } - // no alternative suggestions -> nothing to do - let nextIndex = SuggestAlternatives._moveIndex(true, model, index); - if (nextIndex === index) { - this.reset(); - return; - } - this._acceptNext = acceptNext; - this._model = model; - this._index = index; - this._listener = this._editor.onDidChangeCursorPosition(() => { - if (!this._ignore) { - this.reset(); - } - }); - this._ckOtherSuggestions.set(true); - } - static _moveIndex(fwd, model, index) { - let newIndex = index; - while (true) { - newIndex = (newIndex + model.items.length + (fwd ? +1 : -1)) % model.items.length; - if (newIndex === index) { - break; - } - if (!model.items[newIndex].completion.additionalTextEdits) { - break; - } - } - return newIndex; - } - next() { - this._move(true); - } - prev() { - this._move(false); - } - _move(fwd) { - if (!this._model) { - // nothing to reason about - return; - } - try { - this._ignore = true; - this._index = SuggestAlternatives._moveIndex(fwd, this._model, this._index); - this._acceptNext({ index: this._index, item: this._model.items[this._index], model: this._model }); - } - finally { - this._ignore = false; - } - } -}; -SuggestAlternatives.OtherSuggestions = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_1__["RawContextKey"]('hasOtherSuggestions', false); -SuggestAlternatives = __decorate([ - __param(1, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_1__["IContextKeyService"]) -], SuggestAlternatives); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestCommitCharacters.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestCommitCharacters.js ***! - \*********************************************************************************************/ -/*! exports provided: CommitCharacterController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommitCharacterController", function() { return CommitCharacterController; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class CommitCharacterController { - constructor(editor, widget, accept) { - this._disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this._disposables.add(widget.onDidShow(() => this._onItem(widget.getFocusedItem()))); - this._disposables.add(widget.onDidFocus(this._onItem, this)); - this._disposables.add(widget.onDidHide(this.reset, this)); - this._disposables.add(editor.onWillType(text => { - if (this._active && !widget.isFrozen()) { - const ch = text.charCodeAt(text.length - 1); - if (this._active.acceptCharacters.has(ch) && editor.getOption(0 /* acceptSuggestionOnCommitCharacter */)) { - accept(this._active.item); - } - } - })); - } - _onItem(selected) { - if (!selected || !Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["isNonEmptyArray"])(selected.item.completion.commitCharacters)) { - // no item or no commit characters - this.reset(); - return; - } - if (this._active && this._active.item.item === selected.item) { - // still the same item - return; - } - // keep item and its commit characters - const acceptCharacters = new _common_core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_2__["CharacterSet"](); - for (const ch of selected.item.completion.commitCharacters) { - if (ch.length > 0) { - acceptCharacters.add(ch.charCodeAt(0)); - } - } - this._active = { acceptCharacters, item: selected }; - } - reset() { - this._active = undefined; - } - dispose() { - this._disposables.dispose(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestController.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestController.js ***! - \***************************************************************************************/ -/*! exports provided: SuggestController, TriggerSuggestAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SuggestController", function() { return SuggestController; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TriggerSuggestAction", function() { return TriggerSuggestAction; }); -/* harmony import */ var _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/ui/aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../browser/core/editorState.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/core/editorState.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/editOperation.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _snippet_snippetController2_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../snippet/snippetController2.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetController2.js"); -/* harmony import */ var _snippet_snippetParser_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../snippet/snippetParser.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetParser.js"); -/* harmony import */ var _suggestMemory_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./suggestMemory.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestMemory.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybindingsRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js"); -/* harmony import */ var _suggest_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./suggest.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggest.js"); -/* harmony import */ var _suggestAlternatives_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./suggestAlternatives.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestAlternatives.js"); -/* harmony import */ var _suggestModel_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./suggestModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestModel.js"); -/* harmony import */ var _suggestWidget_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./suggestWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestWidget.js"); -/* harmony import */ var _wordContextKey_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./wordContextKey.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/wordContextKey.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../common/services/editorWorkerService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerService.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _suggestCommitCharacters_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./suggestCommitCharacters.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestCommitCharacters.js"); -/* harmony import */ var _suggestOvertypingCapturer_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./suggestOvertypingCapturer.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestOvertypingCapturer.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../../platform/log/common/log.js */ "./node_modules/monaco-editor/esm/vs/platform/log/common/log.js"); -/* harmony import */ var _base_common_stopwatch_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../../../base/common/stopwatch.js */ "./node_modules/monaco-editor/esm/vs/base/common/stopwatch.js"); -/* harmony import */ var _platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../../platform/clipboard/common/clipboardService.js */ "./node_modules/monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// sticky suggest widget which doesn't disappear on focus out and such -let _sticky = false; -// _sticky = Boolean("true"); // done "weirdly" so that a lint warning prevents you from pushing this -class LineSuffix { - constructor(_model, _position) { - this._model = _model; - this._position = _position; - // spy on what's happening right of the cursor. two cases: - // 1. end of line -> check that it's still end of line - // 2. mid of line -> add a marker and compute the delta - const maxColumn = _model.getLineMaxColumn(_position.lineNumber); - if (maxColumn !== _position.column) { - const offset = _model.getOffsetAt(_position); - const end = _model.getPositionAt(offset + 1); - this._marker = _model.deltaDecorations([], [{ - range: _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].fromPositions(_position, end), - options: { stickiness: 1 /* NeverGrowsWhenTypingAtEdges */ } - }]); - } - } - dispose() { - if (this._marker && !this._model.isDisposed()) { - this._model.deltaDecorations(this._marker, []); - } - } - delta(position) { - if (this._model.isDisposed() || this._position.lineNumber !== position.lineNumber) { - // bail out early if things seems fishy - return 0; - } - // read the marker (in case suggest was triggered at line end) or compare - // the cursor to the line end. - if (this._marker) { - const range = this._model.getDecorationRange(this._marker[0]); - const end = this._model.getOffsetAt(range.getStartPosition()); - return end - this._model.getOffsetAt(position); - } - else { - return this._model.getLineMaxColumn(position.lineNumber) - position.column; - } - } -} -let SuggestController = class SuggestController { - constructor(editor, editorWorker, _memoryService, _commandService, _contextKeyService, _instantiationService, _logService, clipboardService) { - this._memoryService = _memoryService; - this._commandService = _commandService; - this._contextKeyService = _contextKeyService; - this._instantiationService = _instantiationService; - this._logService = _logService; - this._lineSuffix = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["MutableDisposable"](); - this._toDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - this.editor = editor; - this.model = new _suggestModel_js__WEBPACK_IMPORTED_MODULE_20__["SuggestModel"](this.editor, editorWorker, clipboardService); - this.widget = this._toDispose.add(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_25__["IdleValue"](() => { - const widget = this._instantiationService.createInstance(_suggestWidget_js__WEBPACK_IMPORTED_MODULE_21__["SuggestWidget"], this.editor); - this._toDispose.add(widget); - this._toDispose.add(widget.onDidSelect(item => this._insertSuggestion(item, 0), this)); - // Wire up logic to accept a suggestion on certain characters - const commitCharacterController = new _suggestCommitCharacters_js__WEBPACK_IMPORTED_MODULE_27__["CommitCharacterController"](this.editor, widget, item => this._insertSuggestion(item, 2 /* NoAfterUndoStop */)); - this._toDispose.add(commitCharacterController); - this._toDispose.add(this.model.onDidSuggest(e => { - if (e.completionModel.items.length === 0) { - commitCharacterController.reset(); - } - })); - // Wire up makes text edit context key - const ctxMakesTextEdit = _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].MakesTextEdit.bindTo(this._contextKeyService); - const ctxHasInsertAndReplace = _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].HasInsertAndReplaceRange.bindTo(this._contextKeyService); - const ctxCanResolve = _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].CanResolve.bindTo(this._contextKeyService); - this._toDispose.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["toDisposable"])(() => { - ctxMakesTextEdit.reset(); - ctxHasInsertAndReplace.reset(); - ctxCanResolve.reset(); - })); - this._toDispose.add(widget.onDidFocus(({ item }) => { - // (ctx: makesTextEdit) - const position = this.editor.getPosition(); - const startColumn = item.editStart.column; - const endColumn = position.column; - let value = true; - if (this.editor.getOption(1 /* acceptSuggestionOnEnter */) === 'smart' - && this.model.state === 2 /* Auto */ - && !item.completion.command - && !item.completion.additionalTextEdits - && !(item.completion.insertTextRules & 4 /* InsertAsSnippet */) - && endColumn - startColumn === item.completion.insertText.length) { - const oldText = this.editor.getModel().getValueInRange({ - startLineNumber: position.lineNumber, - startColumn, - endLineNumber: position.lineNumber, - endColumn - }); - value = oldText !== item.completion.insertText; - } - ctxMakesTextEdit.set(value); - // (ctx: hasInsertAndReplaceRange) - ctxHasInsertAndReplace.set(!_common_core_position_js__WEBPACK_IMPORTED_MODULE_29__["Position"].equals(item.editInsertEnd, item.editReplaceEnd)); - // (ctx: canResolve) - ctxCanResolve.set(Boolean(item.provider.resolveCompletionItem) || Boolean(item.completion.documentation) || item.completion.detail !== item.completion.label); - })); - this._toDispose.add(widget.onDetailsKeyDown(e => { - // cmd + c on macOS, ctrl + c on Win / Linux - if (e.toKeybinding().equals(new _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__["SimpleKeybinding"](true, false, false, false, 33 /* KEY_C */)) || - (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_30__["isMacintosh"] && e.toKeybinding().equals(new _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__["SimpleKeybinding"](false, false, false, true, 33 /* KEY_C */)))) { - e.stopPropagation(); - return; - } - if (!e.toKeybinding().isModifierKey()) { - this.editor.focus(); - } - })); - return widget; - })); - // Wire up text overtyping capture - this._overtypingCapturer = this._toDispose.add(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_25__["IdleValue"](() => { - return this._toDispose.add(new _suggestOvertypingCapturer_js__WEBPACK_IMPORTED_MODULE_28__["OvertypingCapturer"](this.editor, this.model)); - })); - this._alternatives = this._toDispose.add(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_25__["IdleValue"](() => { - return this._toDispose.add(new _suggestAlternatives_js__WEBPACK_IMPORTED_MODULE_19__["SuggestAlternatives"](this.editor, this._contextKeyService)); - })); - this._toDispose.add(_instantiationService.createInstance(_wordContextKey_js__WEBPACK_IMPORTED_MODULE_22__["WordContextKey"], editor)); - this._toDispose.add(this.model.onDidTrigger(e => { - this.widget.value.showTriggered(e.auto, e.shy ? 250 : 50); - this._lineSuffix.value = new LineSuffix(this.editor.getModel(), e.position); - })); - this._toDispose.add(this.model.onDidSuggest(e => { - if (!e.shy) { - let index = this._memoryService.select(this.editor.getModel(), this.editor.getPosition(), e.completionModel.items); - this.widget.value.showSuggestions(e.completionModel, index, e.isFrozen, e.auto); - } - })); - this._toDispose.add(this.model.onDidCancel(e => { - if (!e.retrigger) { - this.widget.value.hideWidget(); - } - })); - this._toDispose.add(this.editor.onDidBlurEditorWidget(() => { - if (!_sticky) { - this.model.cancel(); - this.model.clear(); - } - })); - // Manage the acceptSuggestionsOnEnter context key - let acceptSuggestionsOnEnter = _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].AcceptSuggestionsOnEnter.bindTo(_contextKeyService); - let updateFromConfig = () => { - const acceptSuggestionOnEnter = this.editor.getOption(1 /* acceptSuggestionOnEnter */); - acceptSuggestionsOnEnter.set(acceptSuggestionOnEnter === 'on' || acceptSuggestionOnEnter === 'smart'); - }; - this._toDispose.add(this.editor.onDidChangeConfiguration(() => updateFromConfig())); - updateFromConfig(); - } - static get(editor) { - return editor.getContribution(SuggestController.ID); - } - dispose() { - this._alternatives.dispose(); - this._toDispose.dispose(); - this.widget.dispose(); - this.model.dispose(); - this._lineSuffix.dispose(); - } - _insertSuggestion(event, flags) { - if (!event || !event.item) { - this._alternatives.value.reset(); - this.model.cancel(); - this.model.clear(); - return; - } - if (!this.editor.hasModel()) { - return; - } - const model = this.editor.getModel(); - const modelVersionNow = model.getAlternativeVersionId(); - const { item } = event; - // - const tasks = []; - const cts = new _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_32__["CancellationTokenSource"](); - // pushing undo stops *before* additional text edits and - // *after* the main edit - if (!(flags & 1 /* NoBeforeUndoStop */)) { - this.editor.pushUndoStop(); - } - // compute overwrite[Before|After] deltas BEFORE applying extra edits - const info = this.getOverwriteInfo(item, Boolean(flags & 8 /* AlternativeOverwriteConfig */)); - // keep item in memory - this._memoryService.memorize(model, this.editor.getPosition(), item); - if (Array.isArray(item.completion.additionalTextEdits)) { - // sync additional edits - const scrollState = _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_5__["StableEditorScrollState"].capture(this.editor); - this.editor.executeEdits('suggestController.additionalTextEdits.sync', item.completion.additionalTextEdits.map(edit => _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_7__["EditOperation"].replace(_common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].lift(edit.range), edit.text))); - scrollState.restoreRelativeVerticalPositionOfCursor(this.editor); - } - else if (!item.isResolved) { - // async additional edits - const sw = new _base_common_stopwatch_js__WEBPACK_IMPORTED_MODULE_34__["StopWatch"](true); - let position; - const docListener = model.onDidChangeContent(e => { - if (e.isFlush) { - cts.cancel(); - docListener.dispose(); - return; - } - for (let change of e.changes) { - const thisPosition = _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].getEndPosition(change.range); - if (!position || _common_core_position_js__WEBPACK_IMPORTED_MODULE_29__["Position"].isBefore(thisPosition, position)) { - position = thisPosition; - } - } - }); - let oldFlags = flags; - flags |= 2 /* NoAfterUndoStop */; - let didType = false; - let typeListener = this.editor.onWillType(() => { - typeListener.dispose(); - didType = true; - if (!(oldFlags & 2 /* NoAfterUndoStop */)) { - this.editor.pushUndoStop(); - } - }); - tasks.push(item.resolve(cts.token).then(() => { - if (!item.completion.additionalTextEdits || cts.token.isCancellationRequested) { - return false; - } - if (position && item.completion.additionalTextEdits.some(edit => _common_core_position_js__WEBPACK_IMPORTED_MODULE_29__["Position"].isBefore(position, _common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].getStartPosition(edit.range)))) { - return false; - } - if (didType) { - this.editor.pushUndoStop(); - } - const scrollState = _browser_core_editorState_js__WEBPACK_IMPORTED_MODULE_5__["StableEditorScrollState"].capture(this.editor); - this.editor.executeEdits('suggestController.additionalTextEdits.async', item.completion.additionalTextEdits.map(edit => _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_7__["EditOperation"].replace(_common_core_range_js__WEBPACK_IMPORTED_MODULE_8__["Range"].lift(edit.range), edit.text))); - scrollState.restoreRelativeVerticalPositionOfCursor(this.editor); - if (didType || !(oldFlags & 2 /* NoAfterUndoStop */)) { - this.editor.pushUndoStop(); - } - return true; - }).then(applied => { - this._logService.trace('[suggest] async resolving of edits DONE (ms, applied?)', sw.elapsed(), applied); - docListener.dispose(); - typeListener.dispose(); - })); - } - let { insertText } = item.completion; - if (!(item.completion.insertTextRules & 4 /* InsertAsSnippet */)) { - insertText = _snippet_snippetParser_js__WEBPACK_IMPORTED_MODULE_11__["SnippetParser"].escape(insertText); - } - _snippet_snippetController2_js__WEBPACK_IMPORTED_MODULE_10__["SnippetController2"].get(this.editor).insert(insertText, { - overwriteBefore: info.overwriteBefore, - overwriteAfter: info.overwriteAfter, - undoStopBefore: false, - undoStopAfter: false, - adjustWhitespace: !(item.completion.insertTextRules & 1 /* KeepWhitespace */), - clipboardText: event.model.clipboardText, - overtypingCapturer: this._overtypingCapturer.value - }); - if (!(flags & 2 /* NoAfterUndoStop */)) { - this.editor.pushUndoStop(); - } - if (!item.completion.command) { - // done - this.model.cancel(); - } - else if (item.completion.command.id === TriggerSuggestAction.id) { - // retigger - this.model.trigger({ auto: true, shy: false }, true); - } - else { - // exec command, done - tasks.push(this._commandService.executeCommand(item.completion.command.id, ...(item.completion.command.arguments ? [...item.completion.command.arguments] : [])).catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["onUnexpectedError"])); - this.model.cancel(); - } - if (flags & 4 /* KeepAlternativeSuggestions */) { - this._alternatives.value.set(event, next => { - // cancel resolving of additional edits - cts.cancel(); - // this is not so pretty. when inserting the 'next' - // suggestion we undo until we are at the state at - // which we were before inserting the previous suggestion... - while (model.canUndo()) { - if (modelVersionNow !== model.getAlternativeVersionId()) { - model.undo(); - } - this._insertSuggestion(next, 1 /* NoBeforeUndoStop */ | 2 /* NoAfterUndoStop */ | (flags & 8 /* AlternativeOverwriteConfig */ ? 8 /* AlternativeOverwriteConfig */ : 0)); - break; - } - }); - } - this._alertCompletionItem(item); - // clear only now - after all tasks are done - Promise.all(tasks).finally(() => { - this.model.clear(); - cts.dispose(); - }); - } - getOverwriteInfo(item, toggleMode) { - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_26__["assertType"])(this.editor.hasModel()); - let replace = this.editor.getOption(96 /* suggest */).insertMode === 'replace'; - if (toggleMode) { - replace = !replace; - } - const overwriteBefore = item.position.column - item.editStart.column; - const overwriteAfter = (replace ? item.editReplaceEnd.column : item.editInsertEnd.column) - item.position.column; - const columnDelta = this.editor.getPosition().column - item.position.column; - const suffixDelta = this._lineSuffix.value ? this._lineSuffix.value.delta(this.editor.getPosition()) : 0; - return { - overwriteBefore: overwriteBefore + columnDelta, - overwriteAfter: overwriteAfter + suffixDelta - }; - } - _alertCompletionItem({ completion: suggestion }) { - const textLabel = typeof suggestion.label === 'string' ? suggestion.label : suggestion.label.name; - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["isNonEmptyArray"])(suggestion.additionalTextEdits)) { - let msg = _nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"]('arai.alert.snippet', "Accepting '{0}' made {1} additional edits", textLabel, suggestion.additionalTextEdits.length); - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_0__["alert"])(msg); - } - } - triggerSuggest(onlyFrom) { - if (this.editor.hasModel()) { - this.model.trigger({ auto: false, shy: false }, false, onlyFrom); - this.editor.revealLine(this.editor.getPosition().lineNumber, 0 /* Smooth */); - this.editor.focus(); - } - } - triggerSuggestAndAcceptBest(arg) { - if (!this.editor.hasModel()) { - return; - } - const positionNow = this.editor.getPosition(); - const fallback = () => { - if (positionNow.equals(this.editor.getPosition())) { - this._commandService.executeCommand(arg.fallback); - } - }; - const makesTextEdit = (item) => { - if (item.completion.insertTextRules & 4 /* InsertAsSnippet */ || item.completion.additionalTextEdits) { - // snippet, other editor -> makes edit - return true; - } - const position = this.editor.getPosition(); - const startColumn = item.editStart.column; - const endColumn = position.column; - if (endColumn - startColumn !== item.completion.insertText.length) { - // unequal lengths -> makes edit - return true; - } - const textNow = this.editor.getModel().getValueInRange({ - startLineNumber: position.lineNumber, - startColumn, - endLineNumber: position.lineNumber, - endColumn - }); - // unequal text -> makes edit - return textNow !== item.completion.insertText; - }; - _base_common_event_js__WEBPACK_IMPORTED_MODULE_23__["Event"].once(this.model.onDidTrigger)(_ => { - // wait for trigger because only then the cancel-event is trustworthy - let listener = []; - _base_common_event_js__WEBPACK_IMPORTED_MODULE_23__["Event"].any(this.model.onDidTrigger, this.model.onDidCancel)(() => { - // retrigger or cancel -> try to type default text - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])(listener); - fallback(); - }, undefined, listener); - this.model.onDidSuggest(({ completionModel }) => { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])(listener); - if (completionModel.items.length === 0) { - fallback(); - return; - } - const index = this._memoryService.select(this.editor.getModel(), this.editor.getPosition(), completionModel.items); - const item = completionModel.items[index]; - if (!makesTextEdit(item)) { - fallback(); - return; - } - this.editor.pushUndoStop(); - this._insertSuggestion({ index, item, model: completionModel }, 4 /* KeepAlternativeSuggestions */ | 1 /* NoBeforeUndoStop */ | 2 /* NoAfterUndoStop */); - }, undefined, listener); - }); - this.model.trigger({ auto: false, shy: true }); - this.editor.revealLine(positionNow.lineNumber, 0 /* Smooth */); - this.editor.focus(); - } - acceptSelectedSuggestion(keepAlternativeSuggestions, alternativeOverwriteConfig) { - const item = this.widget.value.getFocusedItem(); - let flags = 0; - if (keepAlternativeSuggestions) { - flags |= 4 /* KeepAlternativeSuggestions */; - } - if (alternativeOverwriteConfig) { - flags |= 8 /* AlternativeOverwriteConfig */; - } - this._insertSuggestion(item, flags); - } - acceptNextSuggestion() { - this._alternatives.value.next(); - } - acceptPrevSuggestion() { - this._alternatives.value.prev(); - } - cancelSuggestWidget() { - this.model.cancel(); - this.model.clear(); - this.widget.value.hideWidget(); - } - selectNextSuggestion() { - this.widget.value.selectNext(); - } - selectNextPageSuggestion() { - this.widget.value.selectNextPage(); - } - selectLastSuggestion() { - this.widget.value.selectLast(); - } - selectPrevSuggestion() { - this.widget.value.selectPrevious(); - } - selectPrevPageSuggestion() { - this.widget.value.selectPreviousPage(); - } - selectFirstSuggestion() { - this.widget.value.selectFirst(); - } - toggleSuggestionDetails() { - this.widget.value.toggleDetails(); - } - toggleExplainMode() { - this.widget.value.toggleExplainMode(); - } - toggleSuggestionFocus() { - this.widget.value.toggleDetailsFocus(); - } -}; -SuggestController.ID = 'editor.contrib.suggestController'; -SuggestController = __decorate([ - __param(1, _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_24__["IEditorWorkerService"]), - __param(2, _suggestMemory_js__WEBPACK_IMPORTED_MODULE_12__["ISuggestMemoryService"]), - __param(3, _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_14__["ICommandService"]), - __param(4, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["IContextKeyService"]), - __param(5, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_16__["IInstantiationService"]), - __param(6, _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_33__["ILogService"]), - __param(7, _platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_35__["IClipboardService"]) -], SuggestController); - -class TriggerSuggestAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["EditorAction"] { - constructor() { - super({ - id: TriggerSuggestAction.id, - label: _nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"]('suggest.trigger.label', "Trigger Suggest"), - alias: 'Trigger Suggest', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].writable, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].hasCompletionItemProvider), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 10 /* Space */, - mac: { primary: 256 /* WinCtrl */ | 10 /* Space */, secondary: [512 /* Alt */ | 9 /* Escape */] }, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - const controller = SuggestController.get(editor); - if (!controller) { - return; - } - controller.triggerSuggest(); - } -} -TriggerSuggestAction.id = 'editor.action.triggerSuggest'; -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorContribution"])(SuggestController.ID, SuggestController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorAction"])(TriggerSuggestAction); -const weight = 100 /* EditorContrib */ + 90; -const SuggestCommand = _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["EditorCommand"].bindToContribution(SuggestController.get); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'acceptSelectedSuggestion', - precondition: _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, - handler(x) { - x.acceptSelectedSuggestion(true, false); - } -})); -// normal tab -_platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_17__["KeybindingsRegistry"].registerKeybindingRule({ - id: 'acceptSelectedSuggestion', - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus), - primary: 2 /* Tab */, - weight -}); -// accept on enter has special rules -_platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_17__["KeybindingsRegistry"].registerKeybindingRule({ - id: 'acceptSelectedSuggestion', - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].AcceptSuggestionsOnEnter, _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].MakesTextEdit), - primary: 3 /* Enter */, - weight, -}); -_platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_31__["MenuRegistry"].appendMenuItem(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["suggestWidgetStatusbarMenu"], { - command: { id: 'acceptSelectedSuggestion', title: _nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"]({ key: 'accept.accept', comment: ['{0} will be a keybinding, e.g "Enter to insert"'] }, "{0} to insert") }, - group: 'left', - order: 1, - when: _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].HasInsertAndReplaceRange.toNegated() -}); -_platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_31__["MenuRegistry"].appendMenuItem(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["suggestWidgetStatusbarMenu"], { - command: { id: 'acceptSelectedSuggestion', title: _nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"]({ key: 'accept.insert', comment: ['{0} will be a keybinding, e.g "Enter to insert"'] }, "{0} to insert") }, - group: 'left', - order: 1, - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].HasInsertAndReplaceRange, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].equals('config.editor.suggest.insertMode', 'insert')) -}); -_platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_31__["MenuRegistry"].appendMenuItem(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["suggestWidgetStatusbarMenu"], { - command: { id: 'acceptSelectedSuggestion', title: _nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"]({ key: 'accept.replace', comment: ['{0} will be a keybinding, e.g "Enter to replace"'] }, "{0} to replace") }, - group: 'left', - order: 1, - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].HasInsertAndReplaceRange, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].equals('config.editor.suggest.insertMode', 'replace')) -}); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'acceptAlternativeSelectedSuggestion', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, - primary: 1024 /* Shift */ | 3 /* Enter */, - secondary: [1024 /* Shift */ | 2 /* Tab */], - }, - handler(x) { - x.acceptSelectedSuggestion(false, true); - }, - menuOpts: [{ - menuId: _suggest_js__WEBPACK_IMPORTED_MODULE_18__["suggestWidgetStatusbarMenu"], - group: 'left', - order: 2, - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].HasInsertAndReplaceRange, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].equals('config.editor.suggest.insertMode', 'insert')), - title: _nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"]({ key: 'accept.replace', comment: ['{0} will be a keybinding, e.g "Enter to replace"'] }, "{0} to replace") - }, { - menuId: _suggest_js__WEBPACK_IMPORTED_MODULE_18__["suggestWidgetStatusbarMenu"], - group: 'left', - order: 2, - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].HasInsertAndReplaceRange, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].equals('config.editor.suggest.insertMode', 'replace')), - title: _nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"]({ key: 'accept.insert', comment: ['{0} will be a keybinding, e.g "Enter to insert"'] }, "{0} to insert") - }] -})); -// continue to support the old command -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_14__["CommandsRegistry"].registerCommandAlias('acceptSelectedSuggestionOnEnter', 'acceptSelectedSuggestion'); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'hideSuggestWidget', - precondition: _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, - handler: x => x.cancelSuggestWidget(), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, - primary: 9 /* Escape */, - secondary: [1024 /* Shift */ | 9 /* Escape */] - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'selectNextSuggestion', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].MultipleSuggestions), - handler: c => c.selectNextSuggestion(), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, - primary: 18 /* DownArrow */, - secondary: [2048 /* CtrlCmd */ | 18 /* DownArrow */], - mac: { primary: 18 /* DownArrow */, secondary: [2048 /* CtrlCmd */ | 18 /* DownArrow */, 256 /* WinCtrl */ | 44 /* KEY_N */] } - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'selectNextPageSuggestion', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].MultipleSuggestions), - handler: c => c.selectNextPageSuggestion(), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, - primary: 12 /* PageDown */, - secondary: [2048 /* CtrlCmd */ | 12 /* PageDown */] - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'selectLastSuggestion', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].MultipleSuggestions), - handler: c => c.selectLastSuggestion() -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'selectPrevSuggestion', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].MultipleSuggestions), - handler: c => c.selectPrevSuggestion(), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, - primary: 16 /* UpArrow */, - secondary: [2048 /* CtrlCmd */ | 16 /* UpArrow */], - mac: { primary: 16 /* UpArrow */, secondary: [2048 /* CtrlCmd */ | 16 /* UpArrow */, 256 /* WinCtrl */ | 46 /* KEY_P */] } - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'selectPrevPageSuggestion', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].MultipleSuggestions), - handler: c => c.selectPrevPageSuggestion(), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, - primary: 11 /* PageUp */, - secondary: [2048 /* CtrlCmd */ | 11 /* PageUp */] - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'selectFirstSuggestion', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].MultipleSuggestions), - handler: c => c.selectFirstSuggestion() -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'toggleSuggestionDetails', - precondition: _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, - handler: x => x.toggleSuggestionDetails(), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 10 /* Space */, - mac: { primary: 256 /* WinCtrl */ | 10 /* Space */ } - }, - menuOpts: [{ - menuId: _suggest_js__WEBPACK_IMPORTED_MODULE_18__["suggestWidgetStatusbarMenu"], - group: 'right', - order: 1, - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].DetailsVisible, _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].CanResolve), - title: _nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"]('detail.more', "show less") - }, { - menuId: _suggest_js__WEBPACK_IMPORTED_MODULE_18__["suggestWidgetStatusbarMenu"], - group: 'right', - order: 1, - when: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].DetailsVisible.toNegated(), _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].CanResolve), - title: _nls_js__WEBPACK_IMPORTED_MODULE_13__["localize"]('detail.less', "show more") - }] -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'toggleExplainMode', - precondition: _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, - handler: x => x.toggleExplainMode(), - kbOpts: { - weight: 100 /* EditorContrib */, - primary: 2048 /* CtrlCmd */ | 85 /* US_SLASH */, - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'toggleSuggestionFocus', - precondition: _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible, - handler: x => x.toggleSuggestionFocus(), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 512 /* Alt */ | 10 /* Space */, - mac: { primary: 256 /* WinCtrl */ | 512 /* Alt */ | 10 /* Space */ } - } -})); -//#region tab completions -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'insertBestCompletion', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].equals('config.editor.tabCompletion', 'on'), _wordContextKey_js__WEBPACK_IMPORTED_MODULE_22__["WordContextKey"].AtEnd, _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible.toNegated(), _suggestAlternatives_js__WEBPACK_IMPORTED_MODULE_19__["SuggestAlternatives"].OtherSuggestions.toNegated(), _snippet_snippetController2_js__WEBPACK_IMPORTED_MODULE_10__["SnippetController2"].InSnippetMode.toNegated()), - handler: (x, arg) => { - x.triggerSuggestAndAcceptBest(Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_26__["isObject"])(arg) ? Object.assign({ fallback: 'tab' }, arg) : { fallback: 'tab' }); - }, - kbOpts: { - weight, - primary: 2 /* Tab */ - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'insertNextSuggestion', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].equals('config.editor.tabCompletion', 'on'), _suggestAlternatives_js__WEBPACK_IMPORTED_MODULE_19__["SuggestAlternatives"].OtherSuggestions, _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible.toNegated(), _snippet_snippetController2_js__WEBPACK_IMPORTED_MODULE_10__["SnippetController2"].InSnippetMode.toNegated()), - handler: x => x.acceptNextSuggestion(), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, - primary: 2 /* Tab */ - } -})); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorCommand"])(new SuggestCommand({ - id: 'insertPrevSuggestion', - precondition: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_15__["ContextKeyExpr"].equals('config.editor.tabCompletion', 'on'), _suggestAlternatives_js__WEBPACK_IMPORTED_MODULE_19__["SuggestAlternatives"].OtherSuggestions, _suggest_js__WEBPACK_IMPORTED_MODULE_18__["Context"].Visible.toNegated(), _snippet_snippetController2_js__WEBPACK_IMPORTED_MODULE_10__["SnippetController2"].InSnippetMode.toNegated()), - handler: x => x.acceptPrevSuggestion(), - kbOpts: { - weight: weight, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_9__["EditorContextKeys"].textInputFocus, - primary: 1024 /* Shift */ | 2 /* Tab */ - } -})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestMemory.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestMemory.js ***! - \***********************************************************************************/ -/*! exports provided: Memory, NoMemory, LRUMemory, PrefixMemory, SuggestMemoryService, ISuggestMemoryService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Memory", function() { return Memory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoMemory", function() { return NoMemory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LRUMemory", function() { return LRUMemory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixMemory", function() { return PrefixMemory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SuggestMemoryService", function() { return SuggestMemoryService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ISuggestMemoryService", function() { return ISuggestMemoryService; }); -/* harmony import */ var _base_common_map_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/map.js */ "./node_modules/monaco-editor/esm/vs/base/common/map.js"); -/* harmony import */ var _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../platform/storage/common/storage.js */ "./node_modules/monaco-editor/esm/vs/platform/storage/common/storage.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/* harmony import */ var _platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/instantiation/common/extensions.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/extensions.js"); -/* harmony import */ var _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/services/modeService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modeService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - -class Memory { - constructor(name) { - this.name = name; - } - select(model, pos, items) { - if (items.length === 0) { - return 0; - } - let topScore = items[0].score[0]; - for (let i = 0; i < items.length; i++) { - const { score, completion: suggestion } = items[i]; - if (score[0] !== topScore) { - // stop when leaving the group of top matches - break; - } - if (suggestion.preselect) { - // stop when seeing an auto-select-item - return i; - } - } - return 0; - } -} -class NoMemory extends Memory { - constructor() { - super('first'); - } - memorize(model, pos, item) { - // no-op - } - toJSON() { - return undefined; - } - fromJSON() { - // - } -} -class LRUMemory extends Memory { - constructor() { - super('recentlyUsed'); - this._cache = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_0__["LRUCache"](300, 0.66); - this._seq = 0; - } - memorize(model, pos, item) { - const { label } = item.completion; - const key = `${model.getLanguageIdentifier().language}/${label}`; - this._cache.set(key, { - touch: this._seq++, - type: item.completion.kind, - insertText: item.completion.insertText - }); - } - select(model, pos, items) { - if (items.length === 0) { - return 0; - } - const lineSuffix = model.getLineContent(pos.lineNumber).substr(pos.column - 10, pos.column - 1); - if (/\s$/.test(lineSuffix)) { - return super.select(model, pos, items); - } - let topScore = items[0].score[0]; - let indexPreselect = -1; - let indexRecency = -1; - let seq = -1; - for (let i = 0; i < items.length; i++) { - if (items[i].score[0] !== topScore) { - // consider only top items - break; - } - const key = `${model.getLanguageIdentifier().language}/${items[i].completion.label}`; - const item = this._cache.peek(key); - if (item && item.touch > seq && item.type === items[i].completion.kind && item.insertText === items[i].completion.insertText) { - seq = item.touch; - indexRecency = i; - } - if (items[i].completion.preselect && indexPreselect === -1) { - // stop when seeing an auto-select-item - return indexPreselect = i; - } - } - if (indexRecency !== -1) { - return indexRecency; - } - else if (indexPreselect !== -1) { - return indexPreselect; - } - else { - return 0; - } - } - toJSON() { - return this._cache.toJSON(); - } - fromJSON(data) { - this._cache.clear(); - let seq = 0; - for (const [key, value] of data) { - value.touch = seq; - value.type = typeof value.type === 'number' ? value.type : Object(_common_modes_js__WEBPACK_IMPORTED_MODULE_2__["completionKindFromString"])(value.type); - this._cache.set(key, value); - } - this._seq = this._cache.size; - } -} -class PrefixMemory extends Memory { - constructor() { - super('recentlyUsedByPrefix'); - this._trie = _base_common_map_js__WEBPACK_IMPORTED_MODULE_0__["TernarySearchTree"].forStrings(); - this._seq = 0; - } - memorize(model, pos, item) { - const { word } = model.getWordUntilPosition(pos); - const key = `${model.getLanguageIdentifier().language}/${word}`; - this._trie.set(key, { - type: item.completion.kind, - insertText: item.completion.insertText, - touch: this._seq++ - }); - } - select(model, pos, items) { - let { word } = model.getWordUntilPosition(pos); - if (!word) { - return super.select(model, pos, items); - } - let key = `${model.getLanguageIdentifier().language}/${word}`; - let item = this._trie.get(key); - if (!item) { - item = this._trie.findSubstr(key); - } - if (item) { - for (let i = 0; i < items.length; i++) { - let { kind, insertText } = items[i].completion; - if (kind === item.type && insertText === item.insertText) { - return i; - } - } - } - return super.select(model, pos, items); - } - toJSON() { - let entries = []; - this._trie.forEach((value, key) => entries.push([key, value])); - // sort by last recently used (touch), then - // take the top 200 item and normalize their - // touch - entries - .sort((a, b) => -(a[1].touch - b[1].touch)) - .forEach((value, i) => value[1].touch = i); - return entries.slice(0, 200); - } - fromJSON(data) { - this._trie.clear(); - if (data.length > 0) { - this._seq = data[0][1].touch + 1; - for (const [key, value] of data) { - value.type = typeof value.type === 'number' ? value.type : Object(_common_modes_js__WEBPACK_IMPORTED_MODULE_2__["completionKindFromString"])(value.type); - this._trie.set(key, value); - } - } - } -} -let SuggestMemoryService = class SuggestMemoryService { - constructor(_storageService, _modeService, _configService) { - this._storageService = _storageService; - this._modeService = _modeService; - this._configService = _configService; - this._disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["DisposableStore"](); - this._persistSoon = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_4__["RunOnceScheduler"](() => this._saveState(), 500); - this._disposables.add(_storageService.onWillSaveState(e => { - if (e.reason === _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_1__["WillSaveStateReason"].SHUTDOWN) { - this._saveState(); - } - })); - } - dispose() { - this._disposables.dispose(); - this._persistSoon.dispose(); - } - memorize(model, pos, item) { - this._withStrategy(model, pos).memorize(model, pos, item); - this._persistSoon.schedule(); - } - select(model, pos, items) { - return this._withStrategy(model, pos).select(model, pos, items); - } - _withStrategy(model, pos) { - var _a, _b; - const mode = this._configService.getValue('editor.suggestSelection', { - overrideIdentifier: (_a = this._modeService.getLanguageIdentifier(model.getLanguageIdAtPosition(pos.lineNumber, pos.column))) === null || _a === void 0 ? void 0 : _a.language, - resource: model.uri - }); - if (((_b = this._strategy) === null || _b === void 0 ? void 0 : _b.name) !== mode) { - this._saveState(); - const ctor = SuggestMemoryService._strategyCtors.get(mode) || NoMemory; - this._strategy = new ctor(); - try { - const share = this._configService.getValue('editor.suggest.shareSuggestSelections'); - const scope = share ? 0 /* GLOBAL */ : 1 /* WORKSPACE */; - const raw = this._storageService.get(`${SuggestMemoryService._storagePrefix}/${mode}`, scope); - if (raw) { - this._strategy.fromJSON(JSON.parse(raw)); - } - } - catch (e) { - // things can go wrong with JSON... - } - } - return this._strategy; - } - _saveState() { - if (this._strategy) { - const share = this._configService.getValue('editor.suggest.shareSuggestSelections'); - const scope = share ? 0 /* GLOBAL */ : 1 /* WORKSPACE */; - const raw = JSON.stringify(this._strategy); - this._storageService.store(`${SuggestMemoryService._storagePrefix}/${this._strategy.name}`, raw, scope); - } - } -}; -SuggestMemoryService._strategyCtors = new Map([ - ['recentlyUsedByPrefix', PrefixMemory], - ['recentlyUsed', LRUMemory], - ['first', NoMemory] -]); -SuggestMemoryService._storagePrefix = 'suggest/memories'; -SuggestMemoryService = __decorate([ - __param(0, _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_1__["IStorageService"]), - __param(1, _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_8__["IModeService"]), - __param(2, _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__["IConfigurationService"]) -], SuggestMemoryService); - -const ISuggestMemoryService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_5__["createDecorator"])('ISuggestMemories'); -Object(_platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_7__["registerSingleton"])(ISuggestMemoryService, SuggestMemoryService, true); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestModel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestModel.js ***! - \**********************************************************************************/ -/*! exports provided: LineContext, SuggestModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineContext", function() { return LineContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SuggestModel", function() { return SuggestModel; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _completionModel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./completionModel.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/completionModel.js"); -/* harmony import */ var _suggest_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./suggest.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggest.js"); -/* harmony import */ var _snippet_snippetController2_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../snippet/snippetController2.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetController2.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _wordDistance_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./wordDistance.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/wordDistance.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - -class LineContext { - constructor(model, position, auto, shy) { - this.leadingLineContent = model.getLineContent(position.lineNumber).substr(0, position.column - 1); - this.leadingWord = model.getWordUntilPosition(position); - this.lineNumber = position.lineNumber; - this.column = position.column; - this.auto = auto; - this.shy = shy; - } - static shouldAutoTrigger(editor) { - if (!editor.hasModel()) { - return false; - } - const model = editor.getModel(); - const pos = editor.getPosition(); - model.tokenizeIfCheap(pos.lineNumber); - const word = model.getWordAtPosition(pos); - if (!word) { - return false; - } - if (word.endColumn !== pos.column) { - return false; - } - if (!isNaN(Number(word.word))) { - return false; - } - return true; - } -} -class SuggestModel { - constructor(_editor, _editorWorkerService, _clipboardService) { - this._editor = _editor; - this._editorWorkerService = _editorWorkerService; - this._clipboardService = _clipboardService; - this._toDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - this._quickSuggestDelay = 10; - this._triggerCharacterListener = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - this._triggerQuickSuggest = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_1__["TimeoutTimer"](); - this._state = 0 /* Idle */; - this._completionDisposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - this._onDidCancel = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - this._onDidTrigger = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - this._onDidSuggest = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - this.onDidCancel = this._onDidCancel.event; - this.onDidTrigger = this._onDidTrigger.event; - this.onDidSuggest = this._onDidSuggest.event; - this._currentSelection = this._editor.getSelection() || new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_5__["Selection"](1, 1, 1, 1); - // wire up various listeners - this._toDispose.add(this._editor.onDidChangeModel(() => { - this._updateTriggerCharacters(); - this.cancel(); - })); - this._toDispose.add(this._editor.onDidChangeModelLanguage(() => { - this._updateTriggerCharacters(); - this.cancel(); - })); - this._toDispose.add(this._editor.onDidChangeConfiguration(() => { - this._updateTriggerCharacters(); - this._updateQuickSuggest(); - })); - this._toDispose.add(_common_modes_js__WEBPACK_IMPORTED_MODULE_6__["CompletionProviderRegistry"].onDidChange(() => { - this._updateTriggerCharacters(); - this._updateActiveSuggestSession(); - })); - this._toDispose.add(this._editor.onDidChangeCursorSelection(e => { - this._onCursorChange(e); - })); - let editorIsComposing = false; - this._toDispose.add(this._editor.onDidCompositionStart(() => { - editorIsComposing = true; - })); - this._toDispose.add(this._editor.onDidCompositionEnd(() => { - // refilter when composition ends - editorIsComposing = false; - this._refilterCompletionItems(); - })); - this._toDispose.add(this._editor.onDidChangeModelContent(() => { - // only filter completions when the editor isn't - // composing a character, e.g. ¨ + u makes ü but just - // ¨ cannot be used for filtering - if (!editorIsComposing) { - this._refilterCompletionItems(); - } - })); - this._updateTriggerCharacters(); - this._updateQuickSuggest(); - } - dispose() { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])(this._triggerCharacterListener); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])([this._onDidCancel, this._onDidSuggest, this._onDidTrigger, this._triggerQuickSuggest]); - this._toDispose.dispose(); - this._completionDisposables.dispose(); - this.cancel(); - } - // --- handle configuration & precondition changes - _updateQuickSuggest() { - this._quickSuggestDelay = this._editor.getOption(71 /* quickSuggestionsDelay */); - if (isNaN(this._quickSuggestDelay) || (!this._quickSuggestDelay && this._quickSuggestDelay !== 0) || this._quickSuggestDelay < 0) { - this._quickSuggestDelay = 10; - } - } - _updateTriggerCharacters() { - this._triggerCharacterListener.clear(); - if (this._editor.getOption(72 /* readOnly */) - || !this._editor.hasModel() - || !this._editor.getOption(99 /* suggestOnTriggerCharacters */)) { - return; - } - const supportsByTriggerCharacter = new Map(); - for (const support of _common_modes_js__WEBPACK_IMPORTED_MODULE_6__["CompletionProviderRegistry"].all(this._editor.getModel())) { - for (const ch of support.triggerCharacters || []) { - let set = supportsByTriggerCharacter.get(ch); - if (!set) { - set = new Set(); - set.add(Object(_suggest_js__WEBPACK_IMPORTED_MODULE_8__["getSnippetSuggestSupport"])()); - supportsByTriggerCharacter.set(ch, set); - } - set.add(support); - } - } - const checkTriggerCharacter = (text) => { - var _a; - if (!text) { - // came here from the compositionEnd-event - const position = this._editor.getPosition(); - const model = this._editor.getModel(); - text = model.getLineContent(position.lineNumber).substr(0, position.column - 1); - } - let lastChar = ''; - if (Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_12__["isLowSurrogate"])(text.charCodeAt(text.length - 1))) { - if (Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_12__["isHighSurrogate"])(text.charCodeAt(text.length - 2))) { - lastChar = text.substr(text.length - 2); - } - } - else { - lastChar = text.charAt(text.length - 1); - } - const supports = supportsByTriggerCharacter.get(lastChar); - if (supports) { - // keep existing items that where not computed by the - // supports/providers that want to trigger now - const items = (_a = this._completionModel) === null || _a === void 0 ? void 0 : _a.adopt(supports); - this.trigger({ auto: true, shy: false, triggerCharacter: lastChar }, Boolean(this._completionModel), supports, items); - } - }; - this._triggerCharacterListener.add(this._editor.onDidType(checkTriggerCharacter)); - this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(checkTriggerCharacter)); - } - // --- trigger/retrigger/cancel suggest - get state() { - return this._state; - } - cancel(retrigger = false) { - if (this._state !== 0 /* Idle */) { - this._triggerQuickSuggest.cancel(); - if (this._requestToken) { - this._requestToken.cancel(); - this._requestToken = undefined; - } - this._state = 0 /* Idle */; - this._completionModel = undefined; - this._context = undefined; - this._onDidCancel.fire({ retrigger }); - } - } - clear() { - this._completionDisposables.clear(); - } - _updateActiveSuggestSession() { - if (this._state !== 0 /* Idle */) { - if (!this._editor.hasModel() || !_common_modes_js__WEBPACK_IMPORTED_MODULE_6__["CompletionProviderRegistry"].has(this._editor.getModel())) { - this.cancel(); - } - else { - this.trigger({ auto: this._state === 2 /* Auto */, shy: false }, true); - } - } - } - _onCursorChange(e) { - if (!this._editor.hasModel()) { - return; - } - const model = this._editor.getModel(); - const prevSelection = this._currentSelection; - this._currentSelection = this._editor.getSelection(); - if (!e.selection.isEmpty() - || e.reason !== 0 /* NotSet */ - || (e.source !== 'keyboard' && e.source !== 'deleteLeft')) { - // Early exit if nothing needs to be done! - // Leave some form of early exit check here if you wish to continue being a cursor position change listener ;) - this.cancel(); - return; - } - if (!_common_modes_js__WEBPACK_IMPORTED_MODULE_6__["CompletionProviderRegistry"].has(model)) { - return; - } - if (this._state === 0 /* Idle */) { - if (this._editor.getOption(70 /* quickSuggestions */) === false) { - // not enabled - return; - } - if (!prevSelection.containsRange(this._currentSelection) && !prevSelection.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition())) { - // cursor didn't move RIGHT - return; - } - if (this._editor.getOption(96 /* suggest */).snippetsPreventQuickSuggestions && _snippet_snippetController2_js__WEBPACK_IMPORTED_MODULE_9__["SnippetController2"].get(this._editor).isInSnippet()) { - // no quick suggestion when in snippet mode - return; - } - this.cancel(); - this._triggerQuickSuggest.cancelAndSet(() => { - if (this._state !== 0 /* Idle */) { - return; - } - if (!LineContext.shouldAutoTrigger(this._editor)) { - return; - } - if (!this._editor.hasModel()) { - return; - } - const model = this._editor.getModel(); - const pos = this._editor.getPosition(); - // validate enabled now - const quickSuggestions = this._editor.getOption(70 /* quickSuggestions */); - if (quickSuggestions === false) { - return; - } - else if (quickSuggestions === true) { - // all good - } - else { - // Check the type of the token that triggered this - model.tokenizeIfCheap(pos.lineNumber); - const lineTokens = model.getLineTokens(pos.lineNumber); - const tokenType = lineTokens.getStandardTokenType(lineTokens.findTokenIndexAtOffset(Math.max(pos.column - 1 - 1, 0))); - const inValidScope = quickSuggestions.other && tokenType === 0 /* Other */ - || quickSuggestions.comments && tokenType === 1 /* Comment */ - || quickSuggestions.strings && tokenType === 2 /* String */; - if (!inValidScope) { - return; - } - } - // we made it till here -> trigger now - this.trigger({ auto: true, shy: false }); - }, this._quickSuggestDelay); - } - } - _refilterCompletionItems() { - // Re-filter suggestions. This MUST run async because filtering/scoring - // uses the model content AND the cursor position. The latter is NOT - // updated when the document has changed (the event which drives this method) - // and therefore a little pause (next mirco task) is needed. See: - // https://stackoverflow.com/questions/25915634/difference-between-microtask-and-macrotask-within-an-event-loop-context#25933985 - Promise.resolve().then(() => { - if (this._state === 0 /* Idle */) { - return; - } - if (!this._editor.hasModel()) { - return; - } - const model = this._editor.getModel(); - const position = this._editor.getPosition(); - const ctx = new LineContext(model, position, this._state === 2 /* Auto */, false); - this._onNewContext(ctx); - }); - } - trigger(context, retrigger = false, onlyFrom, existingItems) { - var _a; - if (!this._editor.hasModel()) { - return; - } - const model = this._editor.getModel(); - const auto = context.auto; - const ctx = new LineContext(model, this._editor.getPosition(), auto, context.shy); - // Cancel previous requests, change state & update UI - this.cancel(retrigger); - this._state = auto ? 2 /* Auto */ : 1 /* Manual */; - this._onDidTrigger.fire({ auto, shy: context.shy, position: this._editor.getPosition() }); - // Capture context when request was sent - this._context = ctx; - // Build context for request - let suggestCtx = { triggerKind: (_a = context.triggerKind) !== null && _a !== void 0 ? _a : 0 /* Invoke */ }; - if (context.triggerCharacter) { - suggestCtx = { - triggerKind: 1 /* TriggerCharacter */, - triggerCharacter: context.triggerCharacter - }; - } - this._requestToken = new _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_10__["CancellationTokenSource"](); - // kind filter and snippet sort rules - const snippetSuggestions = this._editor.getOption(93 /* snippetSuggestions */); - let snippetSortOrder = 1 /* Inline */; - switch (snippetSuggestions) { - case 'top': - snippetSortOrder = 0 /* Top */; - break; - // ↓ that's the default anyways... - // case 'inline': - // snippetSortOrder = SnippetSortOrder.Inline; - // break; - case 'bottom': - snippetSortOrder = 2 /* Bottom */; - break; - } - let itemKindFilter = SuggestModel._createItemKindFilter(this._editor); - let wordDistance = _wordDistance_js__WEBPACK_IMPORTED_MODULE_11__["WordDistance"].create(this._editorWorkerService, this._editor); - let completions = Object(_suggest_js__WEBPACK_IMPORTED_MODULE_8__["provideSuggestionItems"])(model, this._editor.getPosition(), new _suggest_js__WEBPACK_IMPORTED_MODULE_8__["CompletionOptions"](snippetSortOrder, itemKindFilter, onlyFrom), suggestCtx, this._requestToken.token); - Promise.all([completions, wordDistance]).then(([completions, wordDistance]) => __awaiter(this, void 0, void 0, function* () { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])(this._requestToken); - if (this._state === 0 /* Idle */) { - return; - } - if (!this._editor.hasModel()) { - return; - } - let clipboardText; - if (completions.needsClipboard || Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["isNonEmptyArray"])(existingItems)) { - clipboardText = yield this._clipboardService.readText(); - } - const model = this._editor.getModel(); - let items = completions.items; - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["isNonEmptyArray"])(existingItems)) { - const cmpFn = Object(_suggest_js__WEBPACK_IMPORTED_MODULE_8__["getSuggestionComparator"])(snippetSortOrder); - items = items.concat(existingItems).sort(cmpFn); - } - const ctx = new LineContext(model, this._editor.getPosition(), auto, context.shy); - this._completionModel = new _completionModel_js__WEBPACK_IMPORTED_MODULE_7__["CompletionModel"](items, this._context.column, { - leadingLineContent: ctx.leadingLineContent, - characterCountDelta: ctx.column - this._context.column - }, wordDistance, this._editor.getOption(96 /* suggest */), this._editor.getOption(93 /* snippetSuggestions */), clipboardText); - // store containers so that they can be disposed later - this._completionDisposables.add(completions.dispoables); - this._onNewContext(ctx); - })).catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["onUnexpectedError"]); - } - static _createItemKindFilter(editor) { - // kind filter and snippet sort rules - const result = new Set(); - // snippet setting - const snippetSuggestions = editor.getOption(93 /* snippetSuggestions */); - if (snippetSuggestions === 'none') { - result.add(27 /* Snippet */); - } - // type setting - const suggestOptions = editor.getOption(96 /* suggest */); - if (!suggestOptions.showMethods) { - result.add(0 /* Method */); - } - if (!suggestOptions.showFunctions) { - result.add(1 /* Function */); - } - if (!suggestOptions.showConstructors) { - result.add(2 /* Constructor */); - } - if (!suggestOptions.showFields) { - result.add(3 /* Field */); - } - if (!suggestOptions.showVariables) { - result.add(4 /* Variable */); - } - if (!suggestOptions.showClasses) { - result.add(5 /* Class */); - } - if (!suggestOptions.showStructs) { - result.add(6 /* Struct */); - } - if (!suggestOptions.showInterfaces) { - result.add(7 /* Interface */); - } - if (!suggestOptions.showModules) { - result.add(8 /* Module */); - } - if (!suggestOptions.showProperties) { - result.add(9 /* Property */); - } - if (!suggestOptions.showEvents) { - result.add(10 /* Event */); - } - if (!suggestOptions.showOperators) { - result.add(11 /* Operator */); - } - if (!suggestOptions.showUnits) { - result.add(12 /* Unit */); - } - if (!suggestOptions.showValues) { - result.add(13 /* Value */); - } - if (!suggestOptions.showConstants) { - result.add(14 /* Constant */); - } - if (!suggestOptions.showEnums) { - result.add(15 /* Enum */); - } - if (!suggestOptions.showEnumMembers) { - result.add(16 /* EnumMember */); - } - if (!suggestOptions.showKeywords) { - result.add(17 /* Keyword */); - } - if (!suggestOptions.showWords) { - result.add(18 /* Text */); - } - if (!suggestOptions.showColors) { - result.add(19 /* Color */); - } - if (!suggestOptions.showFiles) { - result.add(20 /* File */); - } - if (!suggestOptions.showReferences) { - result.add(21 /* Reference */); - } - if (!suggestOptions.showColors) { - result.add(22 /* Customcolor */); - } - if (!suggestOptions.showFolders) { - result.add(23 /* Folder */); - } - if (!suggestOptions.showTypeParameters) { - result.add(24 /* TypeParameter */); - } - if (!suggestOptions.showSnippets) { - result.add(27 /* Snippet */); - } - if (!suggestOptions.showUsers) { - result.add(25 /* User */); - } - if (!suggestOptions.showIssues) { - result.add(26 /* Issue */); - } - return result; - } - _onNewContext(ctx) { - if (!this._context) { - // happens when 24x7 IntelliSense is enabled and still in its delay - return; - } - if (ctx.lineNumber !== this._context.lineNumber) { - // e.g. happens when pressing Enter while IntelliSense is computed - this.cancel(); - return; - } - if (ctx.leadingWord.startColumn < this._context.leadingWord.startColumn) { - // happens when the current word gets outdented - this.cancel(); - return; - } - if (ctx.column < this._context.column) { - // typed -> moved cursor LEFT -> retrigger if still on a word - if (ctx.leadingWord.word) { - this.trigger({ auto: this._context.auto, shy: false }, true); - } - else { - this.cancel(); - } - return; - } - if (!this._completionModel) { - // happens when IntelliSense is not yet computed - return; - } - if (ctx.leadingWord.word.length !== 0 && ctx.leadingWord.startColumn > this._context.leadingWord.startColumn) { - // started a new word while IntelliSense shows -> retrigger - // Select those providers have not contributed to this completion model and re-trigger completions for - // them. Also adopt the existing items and merge them into the new completion model - const inactiveProvider = new Set(_common_modes_js__WEBPACK_IMPORTED_MODULE_6__["CompletionProviderRegistry"].all(this._editor.getModel())); - this._completionModel.allProvider.forEach(provider => inactiveProvider.delete(provider)); - const items = this._completionModel.adopt(new Set()); - this.trigger({ auto: this._context.auto, shy: false }, true, inactiveProvider, items); - return; - } - if (ctx.column > this._context.column && this._completionModel.incomplete.size > 0 && ctx.leadingWord.word.length !== 0) { - // typed -> moved cursor RIGHT & incomple model & still on a word -> retrigger - const { incomplete } = this._completionModel; - const adopted = this._completionModel.adopt(incomplete); - this.trigger({ auto: this._state === 2 /* Auto */, shy: false, triggerKind: 2 /* TriggerForIncompleteCompletions */ }, true, incomplete, adopted); - } - else { - // typed -> moved cursor RIGHT -> update UI - let oldLineContext = this._completionModel.lineContext; - let isFrozen = false; - this._completionModel.lineContext = { - leadingLineContent: ctx.leadingLineContent, - characterCountDelta: ctx.column - this._context.column - }; - if (this._completionModel.items.length === 0) { - if (LineContext.shouldAutoTrigger(this._editor) && this._context.leadingWord.endColumn < ctx.leadingWord.startColumn) { - // retrigger when heading into a new word - this.trigger({ auto: this._context.auto, shy: false }, true); - return; - } - if (!this._context.auto) { - // freeze when IntelliSense was manually requested - this._completionModel.lineContext = oldLineContext; - isFrozen = this._completionModel.items.length > 0; - if (isFrozen && ctx.leadingWord.word.length === 0) { - // there were results before but now there aren't - // and also we are not on a word anymore -> cancel - this.cancel(); - return; - } - } - else { - // nothing left - this.cancel(); - return; - } - } - this._onDidSuggest.fire({ - completionModel: this._completionModel, - auto: this._context.auto, - shy: this._context.shy, - isFrozen, - }); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestOvertypingCapturer.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestOvertypingCapturer.js ***! - \***********************************************************************************************/ -/*! exports provided: OvertypingCapturer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OvertypingCapturer", function() { return OvertypingCapturer; }); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class OvertypingCapturer { - constructor(editor, suggestModel) { - this._disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["DisposableStore"](); - this._lastOvertyped = []; - this._empty = true; - this._disposables.add(editor.onWillType(() => { - if (!this._empty) { - return; - } - if (!editor.hasModel()) { - return; - } - const selections = editor.getSelections(); - const selectionsLength = selections.length; - // Check if it will overtype any selections - let willOvertype = false; - for (let i = 0; i < selectionsLength; i++) { - if (!selections[i].isEmpty()) { - willOvertype = true; - break; - } - } - if (!willOvertype) { - return; - } - this._lastOvertyped = []; - const model = editor.getModel(); - for (let i = 0; i < selectionsLength; i++) { - const selection = selections[i]; - // Check for overtyping capturer restrictions - if (model.getValueLengthInRange(selection) > OvertypingCapturer._maxSelectionLength) { - return; - } - this._lastOvertyped[i] = { value: model.getValueInRange(selection), multiline: selection.startLineNumber !== selection.endLineNumber }; - } - this._empty = false; - })); - this._disposables.add(suggestModel.onDidCancel(e => { - if (!this._empty) { - this._empty = true; - } - })); - } - getLastOvertypedInfo(idx) { - if (!this._empty && idx >= 0 && idx < this._lastOvertyped.length) { - return this._lastOvertyped[idx]; - } - return undefined; - } - dispose() { - this._disposables.dispose(); - } -} -OvertypingCapturer._maxSelectionLength = 51200; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestWidget.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestWidget.js ***! - \***********************************************************************************/ -/*! exports provided: editorSuggestWidgetBackground, editorSuggestWidgetBorder, editorSuggestWidgetForeground, editorSuggestWidgetSelectedBackground, editorSuggestWidgetHighlightForeground, SuggestWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorSuggestWidgetBackground", function() { return editorSuggestWidgetBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorSuggestWidgetBorder", function() { return editorSuggestWidgetBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorSuggestWidgetForeground", function() { return editorSuggestWidgetForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorSuggestWidgetSelectedBackground", function() { return editorSuggestWidgetSelectedBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorSuggestWidgetHighlightForeground", function() { return editorSuggestWidgetHighlightForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SuggestWidget", function() { return SuggestWidget; }); -/* harmony import */ var _media_suggest_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media/suggest.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/media/suggest.css"); -/* harmony import */ var _media_suggestStatusBar_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./media/suggestStatusBar.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/media/suggestStatusBar.css"); -/* harmony import */ var _base_browser_ui_codicons_codiconStyles_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/ui/codicons/codiconStyles.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codiconStyles.js"); -/* harmony import */ var _documentSymbols_outlineTree_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../documentSymbols/outlineTree.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/documentSymbols/outlineTree.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_filters_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/filters.js */ "./node_modules/monaco-editor/esm/vs/base/common/filters.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_ui_list_listWidget_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../base/browser/ui/list/listWidget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listWidget.js"); -/* harmony import */ var _base_browser_ui_scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../base/browser/ui/scrollbar/scrollableElement.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _suggest_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./suggest.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggest.js"); -/* harmony import */ var _platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/telemetry/common/telemetry.js */ "./node_modules/monaco-editor/esm/vs/platform/telemetry/common/telemetry.js"); -/* harmony import */ var _platform_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../platform/theme/common/styler.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/styler.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../platform/storage/common/storage.js */ "./node_modules/monaco-editor/esm/vs/platform/storage/common/storage.js"); -/* harmony import */ var _markdown_markdownRenderer_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../markdown/markdownRenderer.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/markdown/markdownRenderer.js"); -/* harmony import */ var _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../common/services/modeService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modeService.js"); -/* harmony import */ var _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../platform/opener/common/opener.js */ "./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _base_browser_ui_iconLabel_iconLabel_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../../base/browser/ui/iconLabel/iconLabel.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabel.js"); -/* harmony import */ var _common_services_getIconClasses_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../common/services/getIconClasses.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/getIconClasses.js"); -/* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../common/services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_files_common_files_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../../platform/files/common/files.js */ "./node_modules/monaco-editor/esm/vs/platform/files/common/files.js"); -/* harmony import */ var _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../../base/common/htmlContent.js */ "./node_modules/monaco-editor/esm/vs/base/common/htmlContent.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _base_browser_ui_actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../../base/browser/ui/actionbar/actionbar.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/* harmony import */ var _base_browser_ui_actionbar_actionViewItems_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../../../base/browser/ui/actionbar/actionViewItems.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - // The codicon symbol styles are defined here and must be loaded - // The codicon symbol colors are defined here and must be loaded - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const expandSuggestionDocsByDefault = false; -const suggestMoreInfoIcon = Object(_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_36__["registerIcon"])('suggest-more-info', _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_36__["Codicon"].chevronRight); -/** - * Suggest widget colors - */ -const editorSuggestWidgetBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["registerColor"])('editorSuggestWidget.background', { dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["editorWidgetBackground"], light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["editorWidgetBackground"], hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["editorWidgetBackground"] }, _nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"]('editorSuggestWidgetBackground', 'Background color of the suggest widget.')); -const editorSuggestWidgetBorder = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["registerColor"])('editorSuggestWidget.border', { dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["editorWidgetBorder"], light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["editorWidgetBorder"], hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["editorWidgetBorder"] }, _nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"]('editorSuggestWidgetBorder', 'Border color of the suggest widget.')); -const editorSuggestWidgetForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["registerColor"])('editorSuggestWidget.foreground', { dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["editorForeground"], light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["editorForeground"], hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["editorForeground"] }, _nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"]('editorSuggestWidgetForeground', 'Foreground color of the suggest widget.')); -const editorSuggestWidgetSelectedBackground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["registerColor"])('editorSuggestWidget.selectedBackground', { dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["listFocusBackground"], light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["listFocusBackground"], hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["listFocusBackground"] }, _nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"]('editorSuggestWidgetSelectedBackground', 'Background color of the selected entry in the suggest widget.')); -const editorSuggestWidgetHighlightForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["registerColor"])('editorSuggestWidget.highlightForeground', { dark: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["listHighlightForeground"], light: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["listHighlightForeground"], hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["listHighlightForeground"] }, _nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"]('editorSuggestWidgetHighlightForeground', 'Color of the match highlights in the suggest widget.')); -const colorRegExp = /^(#([\da-f]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))$/i; -function extractColor(item, out) { - const label = typeof item.completion.label === 'string' - ? item.completion.label - : item.completion.label.name; - if (label.match(colorRegExp)) { - out[0] = label; - return true; - } - if (typeof item.completion.documentation === 'string' && item.completion.documentation.match(colorRegExp)) { - out[0] = item.completion.documentation; - return true; - } - return false; -} -function canExpandCompletionItem(item) { - if (!item) { - return false; - } - const suggestion = item.completion; - if (suggestion.documentation) { - return true; - } - return (suggestion.detail && suggestion.detail !== suggestion.label); -} -function getAriaId(index) { - return `suggest-aria-id:${index}`; -} -let ItemRenderer = class ItemRenderer { - constructor(widget, editor, triggerKeybindingLabel, _modelService, _modeService, _themeService) { - this.widget = widget; - this.editor = editor; - this.triggerKeybindingLabel = triggerKeybindingLabel; - this._modelService = _modelService; - this._modeService = _modeService; - this._themeService = _themeService; - } - get templateId() { - return 'suggestion'; - } - renderTemplate(container) { - const data = Object.create(null); - data.disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["DisposableStore"](); - data.root = container; - data.root.classList.add('show-file-icons'); - data.icon = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(container, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('.icon')); - data.colorspan = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(data.icon, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('span.colorspan')); - const text = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(container, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('.contents')); - const main = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(text, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('.main')); - data.iconContainer = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(main, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('.icon-label.codicon')); - data.left = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(main, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('span.left')); - data.right = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(main, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('span.right')); - data.iconLabel = new _base_browser_ui_iconLabel_iconLabel_js__WEBPACK_IMPORTED_MODULE_26__["IconLabel"](data.left, { supportHighlights: true, supportCodicons: true }); - data.disposables.add(data.iconLabel); - data.parametersLabel = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(data.left, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('span.signature-label')); - data.qualifierLabel = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(data.left, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('span.qualifier-label')); - data.detailsLabel = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(data.right, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('span.details-label')); - data.readMore = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(data.right, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('span.readMore' + suggestMoreInfoIcon.cssSelector)); - data.readMore.title = _nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"]('readMore', "Read More ({0})", this.triggerKeybindingLabel); - const configureFont = () => { - const options = this.editor.getOptions(); - const fontInfo = options.get(36 /* fontInfo */); - const fontFamily = fontInfo.fontFamily; - const fontFeatureSettings = fontInfo.fontFeatureSettings; - const fontSize = options.get(97 /* suggestFontSize */) || fontInfo.fontSize; - const lineHeight = options.get(98 /* suggestLineHeight */) || fontInfo.lineHeight; - const fontWeight = fontInfo.fontWeight; - const fontSizePx = `${fontSize}px`; - const lineHeightPx = `${lineHeight}px`; - data.root.style.fontSize = fontSizePx; - data.root.style.fontWeight = fontWeight; - main.style.fontFamily = fontFamily; - main.style.fontFeatureSettings = fontFeatureSettings; - main.style.lineHeight = lineHeightPx; - data.icon.style.height = lineHeightPx; - data.icon.style.width = lineHeightPx; - data.readMore.style.height = lineHeightPx; - data.readMore.style.width = lineHeightPx; - }; - configureFont(); - data.disposables.add(_base_common_event_js__WEBPACK_IMPORTED_MODULE_7__["Event"].chain(this.editor.onDidChangeConfiguration.bind(this.editor)) - .filter(e => e.hasChanged(36 /* fontInfo */) || e.hasChanged(97 /* suggestFontSize */) || e.hasChanged(98 /* suggestLineHeight */)) - .on(configureFont, null)); - return data; - } - renderElement(element, index, templateData) { - const data = templateData; - const suggestion = element.completion; - const textLabel = typeof suggestion.label === 'string' ? suggestion.label : suggestion.label.name; - data.root.id = getAriaId(index); - data.colorspan.style.backgroundColor = ''; - const labelOptions = { - labelEscapeNewLines: true, - matches: Object(_base_common_filters_js__WEBPACK_IMPORTED_MODULE_5__["createMatches"])(element.score) - }; - let color = []; - if (suggestion.kind === 19 /* Color */ && extractColor(element, color)) { - // special logic for 'color' completion items - data.icon.className = 'icon customcolor'; - data.iconContainer.className = 'icon hide'; - data.colorspan.style.backgroundColor = color[0]; - } - else if (suggestion.kind === 20 /* File */ && this._themeService.getFileIconTheme().hasFileIcons) { - // special logic for 'file' completion items - data.icon.className = 'icon hide'; - data.iconContainer.className = 'icon hide'; - const labelClasses = Object(_common_services_getIconClasses_js__WEBPACK_IMPORTED_MODULE_27__["getIconClasses"])(this._modelService, this._modeService, _base_common_uri_js__WEBPACK_IMPORTED_MODULE_29__["URI"].from({ scheme: 'fake', path: textLabel }), _platform_files_common_files_js__WEBPACK_IMPORTED_MODULE_31__["FileKind"].FILE); - const detailClasses = Object(_common_services_getIconClasses_js__WEBPACK_IMPORTED_MODULE_27__["getIconClasses"])(this._modelService, this._modeService, _base_common_uri_js__WEBPACK_IMPORTED_MODULE_29__["URI"].from({ scheme: 'fake', path: suggestion.detail }), _platform_files_common_files_js__WEBPACK_IMPORTED_MODULE_31__["FileKind"].FILE); - labelOptions.extraClasses = labelClasses.length > detailClasses.length ? labelClasses : detailClasses; - } - else if (suggestion.kind === 23 /* Folder */ && this._themeService.getFileIconTheme().hasFolderIcons) { - // special logic for 'folder' completion items - data.icon.className = 'icon hide'; - data.iconContainer.className = 'icon hide'; - labelOptions.extraClasses = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_33__["flatten"])([ - Object(_common_services_getIconClasses_js__WEBPACK_IMPORTED_MODULE_27__["getIconClasses"])(this._modelService, this._modeService, _base_common_uri_js__WEBPACK_IMPORTED_MODULE_29__["URI"].from({ scheme: 'fake', path: textLabel }), _platform_files_common_files_js__WEBPACK_IMPORTED_MODULE_31__["FileKind"].FOLDER), - Object(_common_services_getIconClasses_js__WEBPACK_IMPORTED_MODULE_27__["getIconClasses"])(this._modelService, this._modeService, _base_common_uri_js__WEBPACK_IMPORTED_MODULE_29__["URI"].from({ scheme: 'fake', path: suggestion.detail }), _platform_files_common_files_js__WEBPACK_IMPORTED_MODULE_31__["FileKind"].FOLDER) - ]); - } - else { - // normal icon - data.icon.className = 'icon hide'; - data.iconContainer.className = ''; - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["addClasses"])(data.iconContainer, `suggest-icon ${Object(_common_modes_js__WEBPACK_IMPORTED_MODULE_25__["completionKindToCssClass"])(suggestion.kind)}`); - } - if (suggestion.tags && suggestion.tags.indexOf(1 /* Deprecated */) >= 0) { - labelOptions.extraClasses = (labelOptions.extraClasses || []).concat(['deprecated']); - labelOptions.matches = []; - } - data.iconLabel.setLabel(textLabel, undefined, labelOptions); - if (typeof suggestion.label === 'string') { - data.parametersLabel.textContent = ''; - data.qualifierLabel.textContent = ''; - data.detailsLabel.textContent = (suggestion.detail || '').replace(/\n.*$/m, ''); - data.root.classList.add('string-label'); - } - else { - data.parametersLabel.textContent = (suggestion.label.parameters || '').replace(/\n.*$/m, ''); - data.qualifierLabel.textContent = (suggestion.label.qualifier || '').replace(/\n.*$/m, ''); - data.detailsLabel.textContent = (suggestion.label.type || '').replace(/\n.*$/m, ''); - data.root.classList.remove('string-label'); - } - if (canExpandCompletionItem(element)) { - data.right.classList.add('can-expand-details'); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["show"])(data.readMore); - data.readMore.onmousedown = e => { - e.stopPropagation(); - e.preventDefault(); - }; - data.readMore.onclick = e => { - e.stopPropagation(); - e.preventDefault(); - this.widget.toggleDetails(); - }; - } - else { - data.right.classList.remove('can-expand-details'); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["hide"])(data.readMore); - data.readMore.onmousedown = null; - data.readMore.onclick = null; - } - } - disposeTemplate(templateData) { - templateData.disposables.dispose(); - } -}; -ItemRenderer = __decorate([ - __param(3, _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_28__["IModelService"]), - __param(4, _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_22__["IModeService"]), - __param(5, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_18__["IThemeService"]) -], ItemRenderer); -class SuggestionDetails { - constructor(container, widget, editor, markdownRenderer, kbToggleDetails) { - this.widget = widget; - this.editor = editor; - this.markdownRenderer = markdownRenderer; - this.kbToggleDetails = kbToggleDetails; - this.borderWidth = 1; - this.disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["DisposableStore"](); - this.el = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(container, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('.details')); - this.disposables.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["toDisposable"])(() => container.removeChild(this.el))); - this.body = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('.body'); - this.scrollbar = new _base_browser_ui_scrollbar_scrollableElement_js__WEBPACK_IMPORTED_MODULE_12__["DomScrollableElement"](this.body, {}); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(this.el, this.scrollbar.getDomNode()); - this.disposables.add(this.scrollbar); - this.header = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(this.body, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('.header')); - this.close = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(this.header, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('span' + _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_36__["Codicon"].close.cssSelector)); - this.close.title = _nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"]('readLess', "Read Less ({0})", this.kbToggleDetails); - this.type = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(this.header, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('p.type')); - this.docs = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(this.body, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('p.docs')); - this.configureFont(); - _base_common_event_js__WEBPACK_IMPORTED_MODULE_7__["Event"].chain(this.editor.onDidChangeConfiguration.bind(this.editor)) - .filter(e => e.hasChanged(36 /* fontInfo */)) - .on(this.configureFont, this, this.disposables); - markdownRenderer.onDidRenderCodeBlock(() => this.scrollbar.scanDomNode(), this, this.disposables); - } - get element() { - return this.el; - } - renderLoading() { - this.type.textContent = _nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"]('loading', "Loading..."); - this.docs.textContent = ''; - } - renderItem(item, explainMode) { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["dispose"])(this.renderDisposeable); - this.renderDisposeable = undefined; - let { documentation, detail } = item.completion; - // --- documentation - if (explainMode) { - let md = ''; - md += `score: ${item.score[0]}${item.word ? `, compared '${item.completion.filterText && (item.completion.filterText + ' (filterText)') || item.completion.label}' with '${item.word}'` : ' (no prefix)'}\n`; - md += `distance: ${item.distance}, see localityBonus-setting\n`; - md += `index: ${item.idx}, based on ${item.completion.sortText && `sortText: "${item.completion.sortText}"` || 'label'}\n`; - documentation = new _base_common_htmlContent_js__WEBPACK_IMPORTED_MODULE_32__["MarkdownString"]().appendCodeblock('empty', md); - detail = `Provider: ${item.provider._debugDisplayName}`; - } - if (!explainMode && !canExpandCompletionItem(item)) { - this.type.textContent = ''; - this.docs.textContent = ''; - this.el.classList.add('no-docs'); - return; - } - this.el.classList.remove('no-docs'); - if (typeof documentation === 'string') { - this.docs.classList.remove('markdown-docs'); - this.docs.textContent = documentation; - } - else { - this.docs.classList.add('markdown-docs'); - this.docs.innerText = ''; - const renderedContents = this.markdownRenderer.render(documentation); - this.renderDisposeable = renderedContents; - this.docs.appendChild(renderedContents.element); - } - // --- details - if (detail) { - this.type.innerText = detail.length > 100000 ? `${detail.substr(0, 100000)}…` : detail; - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["show"])(this.type); - } - else { - this.type.innerText = ''; - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["hide"])(this.type); - } - this.el.style.height = this.header.offsetHeight + this.docs.offsetHeight + (this.borderWidth * 2) + 'px'; - this.el.style.userSelect = 'text'; - this.el.tabIndex = -1; - this.close.onmousedown = e => { - e.preventDefault(); - e.stopPropagation(); - }; - this.close.onclick = e => { - e.preventDefault(); - e.stopPropagation(); - this.widget.toggleDetails(); - }; - this.body.scrollTop = 0; - this.scrollbar.scanDomNode(); - } - scrollDown(much = 8) { - this.body.scrollTop += much; - } - scrollUp(much = 8) { - this.body.scrollTop -= much; - } - scrollTop() { - this.body.scrollTop = 0; - } - scrollBottom() { - this.body.scrollTop = this.body.scrollHeight; - } - pageDown() { - this.scrollDown(80); - } - pageUp() { - this.scrollUp(80); - } - setBorderWidth(width) { - this.borderWidth = width; - } - configureFont() { - const options = this.editor.getOptions(); - const fontInfo = options.get(36 /* fontInfo */); - const fontFamily = fontInfo.fontFamily; - const fontSize = options.get(97 /* suggestFontSize */) || fontInfo.fontSize; - const lineHeight = options.get(98 /* suggestLineHeight */) || fontInfo.lineHeight; - const fontWeight = fontInfo.fontWeight; - const fontSizePx = `${fontSize}px`; - const lineHeightPx = `${lineHeight}px`; - this.el.style.fontSize = fontSizePx; - this.el.style.fontWeight = fontWeight; - this.el.style.fontFeatureSettings = fontInfo.fontFeatureSettings; - this.type.style.fontFamily = fontFamily; - this.close.style.height = lineHeightPx; - this.close.style.width = lineHeightPx; - } - dispose() { - this.disposables.dispose(); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["dispose"])(this.renderDisposeable); - this.renderDisposeable = undefined; - } -} -let SuggestWidget = class SuggestWidget { - constructor(editor, telemetryService, keybindingService, contextKeyService, themeService, storageService, modeService, openerService, menuService, instantiationService) { - var _a, _b; - this.editor = editor; - this.telemetryService = telemetryService; - // Editor.IContentWidget.allowEditorOverflow - this.allowEditorOverflow = true; - this.suppressMouseDown = false; - this.state = 0 /* Hidden */; - this.isAddedAsContentWidget = false; - this.isAuto = false; - this.loadingTimeout = _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["Disposable"].None; - this.currentSuggestionDetails = null; - this.ignoreFocusEvents = false; - this.completionModel = null; - this.showTimeout = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_24__["TimeoutTimer"](); - this.toDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["DisposableStore"](); - this.onDidSelectEmitter = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_7__["Emitter"](); - this.onDidFocusEmitter = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_7__["Emitter"](); - this.onDidHideEmitter = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_7__["Emitter"](); - this.onDidShowEmitter = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_7__["Emitter"](); - this.onDidSelect = this.onDidSelectEmitter.event; - this.onDidFocus = this.onDidFocusEmitter.event; - this.onDidHide = this.onDidHideEmitter.event; - this.onDidShow = this.onDidShowEmitter.event; - this.maxWidgetWidth = 660; - this.listWidth = 330; - this.firstFocusInCurrentList = false; - this.preferDocPositionTop = false; - this.docsPositionPreviousWidgetY = null; - this.explainMode = false; - this._onDetailsKeydown = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_7__["Emitter"](); - this.onDetailsKeyDown = this._onDetailsKeydown.event; - const markdownRenderer = this.toDispose.add(new _markdown_markdownRenderer_js__WEBPACK_IMPORTED_MODULE_21__["MarkdownRenderer"](editor, modeService, openerService)); - const kbToggleDetails = (_b = (_a = keybindingService.lookupKeybinding('toggleSuggestionDetails')) === null || _a === void 0 ? void 0 : _a.getLabel()) !== null && _b !== void 0 ? _b : ''; - this.isAuto = false; - this.focusedItem = null; - this.storageService = storageService; - this.element = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('.editor-widget.suggest-widget'); - this.toDispose.add(Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["addDisposableListener"])(this.element, 'click', e => { - if (e.target === this.element) { - this.hideWidget(); - } - })); - this.messageElement = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(this.element, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('.message')); - this.listElement = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(this.element, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('.tree')); - const applyStatusBarStyle = () => this.element.classList.toggle('with-status-bar', this.editor.getOption(96 /* suggest */).statusBar.visible); - applyStatusBarStyle(); - this.statusBarElement = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["append"])(this.element, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["$"])('.suggest-status-bar')); - const actionViewItemProvider = (action => { - const kb = keybindingService.lookupKeybindings(action.id); - return new class extends _base_browser_ui_actionbar_actionViewItems_js__WEBPACK_IMPORTED_MODULE_37__["ActionViewItem"] { - constructor() { - super(undefined, action, { label: true, icon: false }); - } - updateLabel() { - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_33__["isFalsyOrEmpty"])(kb) || !this.label) { - return super.updateLabel(); - } - const { label } = this.getAction(); - this.label.textContent = /{\d}/.test(label) - ? _base_common_strings_js__WEBPACK_IMPORTED_MODULE_6__["format"](this.getAction().label, kb[0].getLabel()) - : `${this.getAction().label} (${kb[0].getLabel()})`; - } - }; - }); - const leftActions = new _base_browser_ui_actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_35__["ActionBar"](this.statusBarElement, { actionViewItemProvider }); - const rightActions = new _base_browser_ui_actionbar_actionbar_js__WEBPACK_IMPORTED_MODULE_35__["ActionBar"](this.statusBarElement, { actionViewItemProvider }); - const menu = menuService.createMenu(_suggest_js__WEBPACK_IMPORTED_MODULE_15__["suggestWidgetStatusbarMenu"], contextKeyService); - const renderMenu = () => { - const left = []; - const right = []; - for (let [group, actions] of menu.getActions()) { - if (group === 'left') { - left.push(...actions); - } - else { - right.push(...actions); - } - } - leftActions.clear(); - leftActions.push(left); - rightActions.clear(); - rightActions.push(right); - }; - this.toDispose.add(menu.onDidChange(() => renderMenu())); - this.toDispose.add(menu); - this.details = instantiationService.createInstance(SuggestionDetails, this.element, this, this.editor, markdownRenderer, kbToggleDetails); - const applyIconStyle = () => this.element.classList.toggle('no-icons', !this.editor.getOption(96 /* suggest */).showIcons); - applyIconStyle(); - let renderer = instantiationService.createInstance(ItemRenderer, this, this.editor, kbToggleDetails); - this.list = new _base_browser_ui_list_listWidget_js__WEBPACK_IMPORTED_MODULE_11__["List"]('SuggestWidget', this.listElement, this, [renderer], { - useShadows: false, - mouseSupport: false, - accessibilityProvider: { - getRole: () => 'option', - getAriaLabel: (item) => { - const textLabel = typeof item.completion.label === 'string' ? item.completion.label : item.completion.label.name; - if (item.isResolved && this.expandDocsSettingFromStorage()) { - const { documentation, detail } = item.completion; - const docs = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_6__["format"]('{0}{1}', detail || '', documentation ? (typeof documentation === 'string' ? documentation : documentation.value) : ''); - return _nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"]('ariaCurrenttSuggestionReadDetails', "{0}, docs: {1}", textLabel, docs); - } - else { - return textLabel; - } - }, - getWidgetAriaLabel: () => _nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"]('suggest', "Suggest"), - getWidgetRole: () => 'listbox' - } - }); - this.toDispose.add(Object(_platform_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_17__["attachListStyler"])(this.list, themeService, { - listInactiveFocusBackground: editorSuggestWidgetSelectedBackground, - listInactiveFocusOutline: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["activeContrastBorder"] - })); - this.toDispose.add(themeService.onDidColorThemeChange(t => this.onThemeChange(t))); - this.toDispose.add(editor.onDidLayoutChange(() => this.onEditorLayoutChange())); - this.toDispose.add(this.list.onMouseDown(e => this.onListMouseDownOrTap(e))); - this.toDispose.add(this.list.onTap(e => this.onListMouseDownOrTap(e))); - this.toDispose.add(this.list.onDidChangeSelection(e => this.onListSelection(e))); - this.toDispose.add(this.list.onDidChangeFocus(e => this.onListFocus(e))); - this.toDispose.add(this.editor.onDidChangeCursorSelection(() => this.onCursorSelectionChanged())); - this.toDispose.add(this.editor.onDidChangeConfiguration(e => { - if (e.hasChanged(96 /* suggest */)) { - applyStatusBarStyle(); - applyIconStyle(); - } - })); - this.ctxSuggestWidgetVisible = _suggest_js__WEBPACK_IMPORTED_MODULE_15__["Context"].Visible.bindTo(contextKeyService); - this.ctxSuggestWidgetDetailsVisible = _suggest_js__WEBPACK_IMPORTED_MODULE_15__["Context"].DetailsVisible.bindTo(contextKeyService); - this.ctxSuggestWidgetMultipleSuggestions = _suggest_js__WEBPACK_IMPORTED_MODULE_15__["Context"].MultipleSuggestions.bindTo(contextKeyService); - this.onThemeChange(themeService.getColorTheme()); - this.toDispose.add(Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["addStandardDisposableListener"])(this.details.element, 'keydown', e => { - this._onDetailsKeydown.fire(e); - })); - this.toDispose.add(this.editor.onMouseDown((e) => this.onEditorMouseDown(e))); - } - onEditorMouseDown(mouseEvent) { - // Clicking inside details - if (this.details.element.contains(mouseEvent.target.element)) { - this.details.element.focus(); - } - // Clicking outside details and inside suggest - else { - if (this.element.contains(mouseEvent.target.element)) { - this.editor.focus(); - } - } - } - onCursorSelectionChanged() { - if (this.state === 0 /* Hidden */) { - return; - } - this.editor.layoutContentWidget(this); - } - onEditorLayoutChange() { - if ((this.state === 3 /* Open */ || this.state === 5 /* Details */) && this.expandDocsSettingFromStorage()) { - this.expandSideOrBelow(); - } - } - onListMouseDownOrTap(e) { - if (typeof e.element === 'undefined' || typeof e.index === 'undefined') { - return; - } - // prevent stealing browser focus from the editor - e.browserEvent.preventDefault(); - e.browserEvent.stopPropagation(); - this.select(e.element, e.index); - } - onListSelection(e) { - if (!e.elements.length) { - return; - } - this.select(e.elements[0], e.indexes[0]); - } - select(item, index) { - const completionModel = this.completionModel; - if (!completionModel) { - return; - } - this.onDidSelectEmitter.fire({ item, index, model: completionModel }); - this.editor.focus(); - } - onThemeChange(theme) { - const backgroundColor = theme.getColor(editorSuggestWidgetBackground); - if (backgroundColor) { - this.listElement.style.backgroundColor = backgroundColor.toString(); - this.statusBarElement.style.backgroundColor = backgroundColor.toString(); - this.details.element.style.backgroundColor = backgroundColor.toString(); - this.messageElement.style.backgroundColor = backgroundColor.toString(); - } - const borderColor = theme.getColor(editorSuggestWidgetBorder); - if (borderColor) { - this.listElement.style.borderColor = borderColor.toString(); - this.statusBarElement.style.borderColor = borderColor.toString(); - this.details.element.style.borderColor = borderColor.toString(); - this.messageElement.style.borderColor = borderColor.toString(); - this.detailsBorderColor = borderColor.toString(); - } - const focusBorderColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["focusBorder"]); - if (focusBorderColor) { - this.detailsFocusBorderColor = focusBorderColor.toString(); - } - this.details.setBorderWidth(theme.type === 'hc' ? 2 : 1); - } - onListFocus(e) { - if (this.ignoreFocusEvents) { - return; - } - if (!e.elements.length) { - if (this.currentSuggestionDetails) { - this.currentSuggestionDetails.cancel(); - this.currentSuggestionDetails = null; - this.focusedItem = null; - } - this.editor.setAriaOptions({ activeDescendant: undefined }); - return; - } - if (!this.completionModel) { - return; - } - const item = e.elements[0]; - const index = e.indexes[0]; - this.firstFocusInCurrentList = !this.focusedItem; - if (item !== this.focusedItem) { - if (this.currentSuggestionDetails) { - this.currentSuggestionDetails.cancel(); - this.currentSuggestionDetails = null; - } - this.focusedItem = item; - this.list.reveal(index); - this.currentSuggestionDetails = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_24__["createCancelablePromise"])((token) => __awaiter(this, void 0, void 0, function* () { - const loading = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_24__["disposableTimeout"])(() => this.showDetails(true), 250); - token.onCancellationRequested(() => loading.dispose()); - const result = yield item.resolve(token); - loading.dispose(); - return result; - })); - this.currentSuggestionDetails.then(() => { - if (index >= this.list.length || item !== this.list.element(index)) { - return; - } - // item can have extra information, so re-render - this.ignoreFocusEvents = true; - this.list.splice(index, 1, [item]); - this.list.setFocus([index]); - this.ignoreFocusEvents = false; - if (this.expandDocsSettingFromStorage()) { - this.showDetails(false); - } - else { - this.element.classList.remove('docs-side'); - } - this.editor.setAriaOptions({ activeDescendant: getAriaId(index) }); - }).catch(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_8__["onUnexpectedError"]); - } - // emit an event - this.onDidFocusEmitter.fire({ item, index, model: this.completionModel }); - } - setState(state) { - if (!this.element) { - return; - } - if (!this.isAddedAsContentWidget && state !== 0 /* Hidden */) { - this.isAddedAsContentWidget = true; - this.editor.addContentWidget(this); - } - const stateChanged = this.state !== state; - this.state = state; - this.element.classList.toggle('frozen', state === 4 /* Frozen */); - switch (state) { - case 0 /* Hidden */: - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["hide"])(this.messageElement, this.details.element, this.listElement, this.statusBarElement); - this.hide(); - this.listHeight = 0; - if (stateChanged) { - this.list.splice(0, this.list.length); - } - this.focusedItem = null; - break; - case 1 /* Loading */: - this.messageElement.textContent = SuggestWidget.LOADING_MESSAGE; - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["hide"])(this.listElement, this.details.element, this.statusBarElement); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["show"])(this.messageElement); - this.element.classList.remove('docs-side'); - this.show(); - this.focusedItem = null; - break; - case 2 /* Empty */: - this.messageElement.textContent = SuggestWidget.NO_SUGGESTIONS_MESSAGE; - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["hide"])(this.listElement, this.details.element, this.statusBarElement); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["show"])(this.messageElement); - this.element.classList.remove('docs-side'); - this.show(); - this.focusedItem = null; - break; - case 3 /* Open */: - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["hide"])(this.messageElement); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["show"])(this.listElement, this.statusBarElement); - this.show(); - break; - case 4 /* Frozen */: - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["hide"])(this.messageElement); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["show"])(this.listElement); - this.show(); - break; - case 5 /* Details */: - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["hide"])(this.messageElement); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["show"])(this.details.element, this.listElement, this.statusBarElement); - this.show(); - break; - } - } - showTriggered(auto, delay) { - if (this.state !== 0 /* Hidden */) { - return; - } - this.isAuto = !!auto; - if (!this.isAuto) { - this.loadingTimeout = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_24__["disposableTimeout"])(() => this.setState(1 /* Loading */), delay); - } - } - showSuggestions(completionModel, selectionIndex, isFrozen, isAuto) { - this.preferDocPositionTop = false; - this.docsPositionPreviousWidgetY = null; - this.loadingTimeout.dispose(); - if (this.currentSuggestionDetails) { - this.currentSuggestionDetails.cancel(); - this.currentSuggestionDetails = null; - } - if (this.completionModel !== completionModel) { - this.completionModel = completionModel; - } - if (isFrozen && this.state !== 2 /* Empty */ && this.state !== 0 /* Hidden */) { - this.setState(4 /* Frozen */); - return; - } - let visibleCount = this.completionModel.items.length; - const isEmpty = visibleCount === 0; - this.ctxSuggestWidgetMultipleSuggestions.set(visibleCount > 1); - if (isEmpty) { - if (isAuto) { - this.setState(0 /* Hidden */); - } - else { - this.setState(2 /* Empty */); - } - this.completionModel = null; - } - else { - if (this.state !== 3 /* Open */) { - const { stats } = this.completionModel; - stats['wasAutomaticallyTriggered'] = !!isAuto; - /* __GDPR__ - "suggestWidget" : { - "wasAutomaticallyTriggered" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "${include}": [ - "${ICompletionStats}" - ] - } - */ - this.telemetryService.publicLog('suggestWidget', Object.assign({}, stats)); - } - this.focusedItem = null; - this.list.splice(0, this.list.length, this.completionModel.items); - if (isFrozen) { - this.setState(4 /* Frozen */); - } - else { - this.setState(3 /* Open */); - } - this.list.reveal(selectionIndex, 0); - this.list.setFocus([selectionIndex]); - // Reset focus border - if (this.detailsBorderColor) { - this.details.element.style.borderColor = this.detailsBorderColor; - } - } - } - selectNextPage() { - switch (this.state) { - case 0 /* Hidden */: - return false; - case 5 /* Details */: - this.details.pageDown(); - return true; - case 1 /* Loading */: - return !this.isAuto; - default: - this.list.focusNextPage(); - return true; - } - } - selectNext() { - switch (this.state) { - case 0 /* Hidden */: - return false; - case 1 /* Loading */: - return !this.isAuto; - default: - this.list.focusNext(1, true); - return true; - } - } - selectLast() { - switch (this.state) { - case 0 /* Hidden */: - return false; - case 5 /* Details */: - this.details.scrollBottom(); - return true; - case 1 /* Loading */: - return !this.isAuto; - default: - this.list.focusLast(); - return true; - } - } - selectPreviousPage() { - switch (this.state) { - case 0 /* Hidden */: - return false; - case 5 /* Details */: - this.details.pageUp(); - return true; - case 1 /* Loading */: - return !this.isAuto; - default: - this.list.focusPreviousPage(); - return true; - } - } - selectPrevious() { - switch (this.state) { - case 0 /* Hidden */: - return false; - case 1 /* Loading */: - return !this.isAuto; - default: - this.list.focusPrevious(1, true); - return false; - } - } - selectFirst() { - switch (this.state) { - case 0 /* Hidden */: - return false; - case 5 /* Details */: - this.details.scrollTop(); - return true; - case 1 /* Loading */: - return !this.isAuto; - default: - this.list.focusFirst(); - return true; - } - } - getFocusedItem() { - if (this.state !== 0 /* Hidden */ - && this.state !== 2 /* Empty */ - && this.state !== 1 /* Loading */ - && this.completionModel) { - return { - item: this.list.getFocusedElements()[0], - index: this.list.getFocus()[0], - model: this.completionModel - }; - } - return undefined; - } - toggleDetailsFocus() { - if (this.state === 5 /* Details */) { - this.setState(3 /* Open */); - if (this.detailsBorderColor) { - this.details.element.style.borderColor = this.detailsBorderColor; - } - } - else if (this.state === 3 /* Open */ && this.expandDocsSettingFromStorage()) { - this.setState(5 /* Details */); - if (this.detailsFocusBorderColor) { - this.details.element.style.borderColor = this.detailsFocusBorderColor; - } - } - this.telemetryService.publicLog2('suggestWidget:toggleDetailsFocus'); - } - toggleDetails() { - if (!canExpandCompletionItem(this.list.getFocusedElements()[0])) { - return; - } - if (this.expandDocsSettingFromStorage()) { - this.ctxSuggestWidgetDetailsVisible.set(false); - this.updateExpandDocsSetting(false); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["hide"])(this.details.element); - this.element.classList.remove('docs-side', 'doc-below'); - this.editor.layoutContentWidget(this); - this.telemetryService.publicLog2('suggestWidget:collapseDetails'); - } - else { - if (this.state !== 3 /* Open */ && this.state !== 5 /* Details */ && this.state !== 4 /* Frozen */) { - return; - } - this.ctxSuggestWidgetDetailsVisible.set(true); - this.updateExpandDocsSetting(true); - this.showDetails(false); - this.telemetryService.publicLog2('suggestWidget:expandDetails'); - } - } - showDetails(loading) { - if (!loading) { - // When loading, don't re-layout docs, as item is not resolved yet #88731 - this.expandSideOrBelow(); - } - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["show"])(this.details.element); - this.details.element.style.maxHeight = this.maxWidgetHeight + 'px'; - if (loading) { - this.details.renderLoading(); - } - else { - this.details.renderItem(this.list.getFocusedElements()[0], this.explainMode); - } - // Reset margin-top that was set as Fix for #26416 - this.listElement.style.marginTop = '0px'; - // with docs showing up widget width/height may change, so reposition the widget - this.editor.layoutContentWidget(this); - this.adjustDocsPosition(); - this.editor.focus(); - } - toggleExplainMode() { - if (this.list.getFocusedElements()[0] && this.expandDocsSettingFromStorage()) { - this.explainMode = !this.explainMode; - this.showDetails(false); - } - } - show() { - const newHeight = this.updateListHeight(); - if (newHeight !== this.listHeight) { - this.editor.layoutContentWidget(this); - this.listHeight = newHeight; - } - this.ctxSuggestWidgetVisible.set(true); - this.showTimeout.cancelAndSet(() => { - this.element.classList.add('visible'); - this.onDidShowEmitter.fire(this); - }, 100); - } - hide() { - // let the editor know that the widget is hidden - this.editor.layoutContentWidget(this); - this.ctxSuggestWidgetVisible.reset(); - this.ctxSuggestWidgetMultipleSuggestions.reset(); - this.element.classList.remove('visible'); - } - hideWidget() { - this.loadingTimeout.dispose(); - this.setState(0 /* Hidden */); - this.onDidHideEmitter.fire(this); - } - getPosition() { - if (this.state === 0 /* Hidden */) { - return null; - } - let preference = [2 /* BELOW */, 1 /* ABOVE */]; - if (this.preferDocPositionTop) { - preference = [1 /* ABOVE */]; - } - return { - position: this.editor.getPosition(), - preference: preference - }; - } - getDomNode() { - return this.element; - } - getId() { - return SuggestWidget.ID; - } - isFrozen() { - return this.state === 4 /* Frozen */; - } - updateListHeight() { - let height = 0; - if (this.state === 2 /* Empty */ || this.state === 1 /* Loading */) { - height = this.unfocusedHeight; - } - else { - const suggestionCount = this.list.contentHeight / this.unfocusedHeight; - const { maxVisibleSuggestions } = this.editor.getOption(96 /* suggest */); - height = Math.min(suggestionCount, maxVisibleSuggestions) * this.unfocusedHeight; - } - this.element.style.lineHeight = `${this.unfocusedHeight}px`; - this.listElement.style.height = `${height}px`; - this.statusBarElement.style.top = `${height}px`; - this.list.layout(height); - return height; - } - /** - * Adds the propert classes, margins when positioning the docs to the side - */ - adjustDocsPosition() { - if (!this.editor.hasModel()) { - return; - } - const lineHeight = this.editor.getOption(51 /* lineHeight */); - const cursorCoords = this.editor.getScrolledVisiblePosition(this.editor.getPosition()); - const editorCoords = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["getDomNodePagePosition"])(this.editor.getDomNode()); - const cursorX = editorCoords.left + cursorCoords.left; - const cursorY = editorCoords.top + cursorCoords.top + cursorCoords.height; - const widgetCoords = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_10__["getDomNodePagePosition"])(this.element); - const widgetX = widgetCoords.left; - const widgetY = widgetCoords.top; - // Fixes #27649 - // Check if the Y changed to the top of the cursor and keep the widget flagged to prefer top - if (this.docsPositionPreviousWidgetY && - this.docsPositionPreviousWidgetY < widgetY && - !this.preferDocPositionTop) { - this.preferDocPositionTop = true; - this.adjustDocsPosition(); - return; - } - this.docsPositionPreviousWidgetY = widgetY; - if (widgetX < cursorX - this.listWidth) { - // Widget is too far to the left of cursor, swap list and docs - this.element.classList.add('list-right'); - } - else { - this.element.classList.remove('list-right'); - } - // Compare top of the cursor (cursorY - lineheight) with widgetTop to determine if - // margin-top needs to be applied on list to make it appear right above the cursor - // Cannot compare cursorY directly as it may be a few decimals off due to zoooming - if (this.element.classList.contains('docs-side') - && cursorY - lineHeight > widgetY - && this.details.element.offsetHeight > this.listElement.offsetHeight) { - // Fix for #26416 - // Docs is bigger than list and widget is above cursor, apply margin-top so that list appears right above cursor - this.listElement.style.marginTop = `${this.details.element.offsetHeight - this.listElement.offsetHeight}px`; - } - } - /** - * Adds the proper classes for positioning the docs to the side or below depending on item - */ - expandSideOrBelow() { - if (!canExpandCompletionItem(this.focusedItem) && this.firstFocusInCurrentList) { - this.element.classList.remove('docs-side', 'docs-below'); - return; - } - let matches = this.element.style.maxWidth.match(/(\d+)px/); - if (!matches || Number(matches[1]) < this.maxWidgetWidth) { - this.element.classList.add('docs-below'); - this.element.classList.remove('docs-side'); - } - else if (canExpandCompletionItem(this.focusedItem)) { - this.element.classList.add('docs-side'); - this.element.classList.remove('docs-below'); - } - } - // Heights - get maxWidgetHeight() { - return this.unfocusedHeight * this.editor.getOption(96 /* suggest */).maxVisibleSuggestions; - } - get unfocusedHeight() { - const options = this.editor.getOptions(); - return options.get(98 /* suggestLineHeight */) || options.get(36 /* fontInfo */).lineHeight; - } - // IDelegate - getHeight(element) { - return this.unfocusedHeight; - } - getTemplateId(element) { - return 'suggestion'; - } - expandDocsSettingFromStorage() { - return this.storageService.getBoolean('expandSuggestionDocs', 0 /* GLOBAL */, expandSuggestionDocsByDefault); - } - updateExpandDocsSetting(value) { - this.storageService.store('expandSuggestionDocs', value, 0 /* GLOBAL */); - } - dispose() { - this.details.dispose(); - this.list.dispose(); - this.toDispose.dispose(); - this.loadingTimeout.dispose(); - this.showTimeout.dispose(); - this.editor.removeContentWidget(this); - } -}; -SuggestWidget.ID = 'editor.widget.suggestWidget'; -SuggestWidget.LOADING_MESSAGE = _nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"]('suggestWidget.loading', "Loading..."); -SuggestWidget.NO_SUGGESTIONS_MESSAGE = _nls_js__WEBPACK_IMPORTED_MODULE_4__["localize"]('suggestWidget.noSuggestions', "No suggestions."); -SuggestWidget = __decorate([ - __param(1, _platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_16__["ITelemetryService"]), - __param(2, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_13__["IKeybindingService"]), - __param(3, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_14__["IContextKeyService"]), - __param(4, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_18__["IThemeService"]), - __param(5, _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_20__["IStorageService"]), - __param(6, _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_22__["IModeService"]), - __param(7, _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_23__["IOpenerService"]), - __param(8, _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_34__["IMenuService"]), - __param(9, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_30__["IInstantiationService"]) -], SuggestWidget); - -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_18__["registerThemingParticipant"])((theme, collector) => { - const matchHighlight = theme.getColor(editorSuggestWidgetHighlightForeground); - if (matchHighlight) { - collector.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight { color: ${matchHighlight}; }`); - } - const foreground = theme.getColor(editorSuggestWidgetForeground); - if (foreground) { - collector.addRule(`.monaco-editor .suggest-widget { color: ${foreground}; }`); - } - const link = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["textLinkForeground"]); - if (link) { - collector.addRule(`.monaco-editor .suggest-widget a { color: ${link}; }`); - } - const codeBackground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_19__["textCodeBlockBackground"]); - if (codeBackground) { - collector.addRule(`.monaco-editor .suggest-widget code { background-color: ${codeBackground}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/wordContextKey.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/wordContextKey.js ***! - \************************************************************************************/ -/*! exports provided: WordContextKey */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WordContextKey", function() { return WordContextKey; }); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - -let WordContextKey = class WordContextKey extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(_editor, contextKeyService) { - super(); - this._editor = _editor; - this._enabled = false; - this._ckAtEnd = WordContextKey.AtEnd.bindTo(contextKeyService); - this._register(this._editor.onDidChangeConfiguration(e => e.hasChanged(101 /* tabCompletion */) && this._update())); - this._update(); - } - dispose() { - super.dispose(); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["dispose"])(this._selectionListener); - this._ckAtEnd.reset(); - } - _update() { - // only update this when tab completions are enabled - const enabled = this._editor.getOption(101 /* tabCompletion */) === 'on'; - if (this._enabled === enabled) { - return; - } - this._enabled = enabled; - if (this._enabled) { - const checkForWordEnd = () => { - if (!this._editor.hasModel()) { - this._ckAtEnd.set(false); - return; - } - const model = this._editor.getModel(); - const selection = this._editor.getSelection(); - const word = model.getWordAtPosition(selection.getStartPosition()); - if (!word) { - this._ckAtEnd.set(false); - return; - } - this._ckAtEnd.set(word.endColumn === selection.getStartPosition().column); - }; - this._selectionListener = this._editor.onDidChangeCursorSelection(checkForWordEnd); - checkForWordEnd(); - } - else if (this._selectionListener) { - this._ckAtEnd.reset(); - this._selectionListener.dispose(); - this._selectionListener = undefined; - } - } -}; -WordContextKey.AtEnd = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"]('atEndOfWord', false); -WordContextKey = __decorate([ - __param(1, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["IContextKeyService"]) -], WordContextKey); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/wordDistance.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/wordDistance.js ***! - \**********************************************************************************/ -/*! exports provided: WordDistance */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WordDistance", function() { return WordDistance; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _smartSelect_bracketSelections_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../smartSelect/bracketSelections.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/bracketSelections.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - -class WordDistance { - static create(service, editor) { - return __awaiter(this, void 0, void 0, function* () { - if (!editor.getOption(96 /* suggest */).localityBonus) { - return WordDistance.None; - } - if (!editor.hasModel()) { - return WordDistance.None; - } - const model = editor.getModel(); - const position = editor.getPosition(); - if (!service.canComputeWordRanges(model.uri)) { - return WordDistance.None; - } - const [ranges] = yield new _smartSelect_bracketSelections_js__WEBPACK_IMPORTED_MODULE_2__["BracketSelectionRangeProvider"]().provideSelectionRanges(model, [position]); - if (ranges.length === 0) { - return WordDistance.None; - } - const wordRanges = yield service.computeWordRanges(model.uri, ranges[0].range); - if (!wordRanges) { - return WordDistance.None; - } - // remove current word - const wordUntilPos = model.getWordUntilPosition(position); - delete wordRanges[wordUntilPos.word]; - return new class extends WordDistance { - distance(anchor, suggestion) { - if (!position.equals(editor.getPosition())) { - return 0; - } - if (suggestion.kind === 17 /* Keyword */) { - return 2 << 20; - } - let word = typeof suggestion.label === 'string' ? suggestion.label : suggestion.label.name; - let wordLines = wordRanges[word]; - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["isFalsyOrEmpty"])(wordLines)) { - return 2 << 20; - } - let idx = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["binarySearch"])(wordLines, _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].fromPositions(anchor), _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].compareRangesUsingStarts); - let bestWordRange = idx >= 0 ? wordLines[idx] : wordLines[Math.max(0, ~idx - 1)]; - let blockDistance = ranges.length; - for (const range of ranges) { - if (!_common_core_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"].containsRange(range.range, bestWordRange)) { - break; - } - blockDistance -= 1; - } - return blockDistance; - } - }; - }); - } -} -WordDistance.None = new class extends WordDistance { - distance() { return 0; } -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode.js ***! - \***************************************************************************************************/ -/*! exports provided: ToggleTabFocusModeAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ToggleTabFocusModeAction", function() { return ToggleTabFocusModeAction; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/ui/aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_config_commonEditorConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/config/commonEditorConfig.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/commonEditorConfig.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class ToggleTabFocusModeAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["EditorAction"] { - constructor() { - super({ - id: ToggleTabFocusModeAction.ID, - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'toggle.tabMovesFocus', comment: ['Turn on/off use of tab key for moving focus around VS Code'] }, "Toggle Tab Key Moves Focus"), - alias: 'Toggle Tab Key Moves Focus', - precondition: undefined, - kbOpts: { - kbExpr: null, - primary: 2048 /* CtrlCmd */ | 43 /* KEY_M */, - mac: { primary: 256 /* WinCtrl */ | 1024 /* Shift */ | 43 /* KEY_M */ }, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor) { - const oldValue = _common_config_commonEditorConfig_js__WEBPACK_IMPORTED_MODULE_3__["TabFocus"].getTabFocusMode(); - const newValue = !oldValue; - _common_config_commonEditorConfig_js__WEBPACK_IMPORTED_MODULE_3__["TabFocus"].setTabFocusMode(newValue); - if (newValue) { - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_1__["alert"])(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('toggle.tabMovesFocus.on', "Pressing Tab will now move focus to the next focusable element")); - } - else { - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_1__["alert"])(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('toggle.tabMovesFocus.off', "Pressing Tab will now insert the tab character")); - } - } -} -ToggleTabFocusModeAction.ID = 'editor.action.toggleTabFocusMode'; -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorAction"])(ToggleTabFocusModeAction); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/tokenization/tokenization.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/tokenization/tokenization.js ***! - \***************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _base_common_stopwatch_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/stopwatch.js */ "./node_modules/monaco-editor/esm/vs/base/common/stopwatch.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class ForceRetokenizeAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.forceRetokenize', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('forceRetokenize', "Developer: Force Retokenize"), - alias: 'Developer: Force Retokenize', - precondition: undefined - }); - } - run(accessor, editor) { - if (!editor.hasModel()) { - return; - } - const model = editor.getModel(); - model.resetTokenization(); - const sw = new _base_common_stopwatch_js__WEBPACK_IMPORTED_MODULE_2__["StopWatch"](true); - model.forceTokenization(model.getLineCount()); - sw.stop(); - console.log(`tokenization took ${sw.elapsed()}`); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorAction"])(ForceRetokenizeAction); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/unusualLineTerminators/unusualLineTerminators.js": -/*!***********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/unusualLineTerminators/unusualLineTerminators.js ***! - \***********************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _platform_dialogs_common_dialogs_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../platform/dialogs/common/dialogs.js */ "./node_modules/monaco-editor/esm/vs/platform/dialogs/common/dialogs.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - -const ignoreUnusualLineTerminators = 'ignoreUnusualLineTerminators'; -function writeIgnoreState(codeEditorService, model, state) { - codeEditorService.setModelProperty(model.uri, ignoreUnusualLineTerminators, state); -} -function readIgnoreState(codeEditorService, model) { - return codeEditorService.getModelProperty(model.uri, ignoreUnusualLineTerminators); -} -let UnusualLineTerminatorsDetector = class UnusualLineTerminatorsDetector extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(_editor, _dialogService, _codeEditorService) { - super(); - this._editor = _editor; - this._dialogService = _dialogService; - this._codeEditorService = _codeEditorService; - this._config = this._editor.getOption(103 /* unusualLineTerminators */); - this._register(this._editor.onDidChangeConfiguration((e) => { - if (e.hasChanged(103 /* unusualLineTerminators */)) { - this._config = this._editor.getOption(103 /* unusualLineTerminators */); - this._checkForUnusualLineTerminators(); - } - })); - this._register(this._editor.onDidChangeModel(() => { - this._checkForUnusualLineTerminators(); - })); - this._register(this._editor.onDidChangeModelContent((e) => { - if (e.isUndoing) { - // skip checking in case of undoing - return; - } - this._checkForUnusualLineTerminators(); - })); - } - _checkForUnusualLineTerminators() { - return __awaiter(this, void 0, void 0, function* () { - if (this._config === 'off') { - return; - } - if (!this._editor.hasModel()) { - return; - } - const model = this._editor.getModel(); - if (!model.mightContainUnusualLineTerminators()) { - return; - } - const ignoreState = readIgnoreState(this._codeEditorService, model); - if (ignoreState === true) { - // this model should be ignored - return; - } - if (this._editor.getOption(72 /* readOnly */)) { - // read only editor => sorry! - return; - } - if (this._config === 'auto') { - // just do it! - model.removeUnusualLineTerminators(this._editor.getSelections()); - return; - } - const result = yield this._dialogService.confirm({ - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('unusualLineTerminators.title', "Unusual Line Terminators"), - message: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('unusualLineTerminators.message', "Detected unusual line terminators"), - detail: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('unusualLineTerminators.detail', "This file contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`."), - primaryButton: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('unusualLineTerminators.fix', "Fix this file"), - secondaryButton: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('unusualLineTerminators.ignore', "Ignore problem for this file") - }); - if (!result.confirmed) { - // this model should be ignored - writeIgnoreState(this._codeEditorService, model, true); - return; - } - model.removeUnusualLineTerminators(this._editor.getSelections()); - }); - } -}; -UnusualLineTerminatorsDetector.ID = 'editor.contrib.unusualLineTerminatorsDetector'; -UnusualLineTerminatorsDetector = __decorate([ - __param(1, _platform_dialogs_common_dialogs_js__WEBPACK_IMPORTED_MODULE_4__["IDialogService"]), - __param(2, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__["ICodeEditorService"]) -], UnusualLineTerminatorsDetector); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorContribution"])(UnusualLineTerminatorsDetector.ID, UnusualLineTerminatorsDetector); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/viewportSemanticTokens/viewportSemanticTokens.js": -/*!***********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/viewportSemanticTokens/viewportSemanticTokens.js ***! - \***********************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _common_services_semanticTokensProviderStyling_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/services/semanticTokensProviderStyling.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/semanticTokensProviderStyling.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/* harmony import */ var _common_services_modelServiceImpl_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/services/modelServiceImpl.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelServiceImpl.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - -let ViewportSemanticTokensContribution = class ViewportSemanticTokensContribution extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(editor, _modelService, _themeService, _configurationService) { - super(); - this._modelService = _modelService; - this._themeService = _themeService; - this._configurationService = _configurationService; - this._editor = editor; - this._tokenizeViewport = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["RunOnceScheduler"](() => this._tokenizeViewportNow(), 100); - this._outstandingRequests = []; - this._register(this._editor.onDidScrollChange(() => { - this._tokenizeViewport.schedule(); - })); - this._register(this._editor.onDidChangeModel(() => { - this._cancelAll(); - this._tokenizeViewport.schedule(); - })); - this._register(this._editor.onDidChangeModelContent((e) => { - this._cancelAll(); - this._tokenizeViewport.schedule(); - })); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_3__["DocumentRangeSemanticTokensProviderRegistry"].onDidChange(() => { - this._cancelAll(); - this._tokenizeViewport.schedule(); - })); - this._register(this._configurationService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration(_common_services_modelServiceImpl_js__WEBPACK_IMPORTED_MODULE_8__["SEMANTIC_HIGHLIGHTING_SETTING_ID"])) { - this._cancelAll(); - this._tokenizeViewport.schedule(); - } - })); - this._register(this._themeService.onDidColorThemeChange(() => { - this._cancelAll(); - this._tokenizeViewport.schedule(); - })); - } - static _getSemanticColoringProvider(model) { - const result = _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["DocumentRangeSemanticTokensProviderRegistry"].ordered(model); - return (result.length > 0 ? result[0] : null); - } - _cancelAll() { - for (const request of this._outstandingRequests) { - request.cancel(); - } - this._outstandingRequests = []; - } - _removeOutstandingRequest(req) { - for (let i = 0, len = this._outstandingRequests.length; i < len; i++) { - if (this._outstandingRequests[i] === req) { - this._outstandingRequests.splice(i, 1); - return; - } - } - } - _tokenizeViewportNow() { - if (!this._editor.hasModel()) { - return; - } - const model = this._editor.getModel(); - if (model.hasSemanticTokens()) { - return; - } - if (!Object(_common_services_modelServiceImpl_js__WEBPACK_IMPORTED_MODULE_8__["isSemanticColoringEnabled"])(model, this._themeService, this._configurationService)) { - return; - } - const provider = ViewportSemanticTokensContribution._getSemanticColoringProvider(model); - if (!provider) { - return; - } - const styling = this._modelService.getSemanticTokensProviderStyling(provider); - const visibleRanges = this._editor.getVisibleRangesPlusViewportAboveBelow(); - this._outstandingRequests = this._outstandingRequests.concat(visibleRanges.map(range => this._requestRange(model, range, provider, styling))); - } - _requestRange(model, range, provider, styling) { - const requestVersionId = model.getVersionId(); - const request = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["createCancelablePromise"])(token => Promise.resolve(provider.provideDocumentRangeSemanticTokens(model, range, token))); - request.then((r) => { - if (!r || model.isDisposed() || model.getVersionId() !== requestVersionId) { - return; - } - model.setPartialSemanticTokens(range, Object(_common_services_semanticTokensProviderStyling_js__WEBPACK_IMPORTED_MODULE_5__["toMultilineTokens2"])(r, styling, model.getLanguageIdentifier())); - }).then(() => this._removeOutstandingRequest(request), () => this._removeOutstandingRequest(request)); - return request; - } -}; -ViewportSemanticTokensContribution.ID = 'editor.contrib.viewportSemanticTokens'; -ViewportSemanticTokensContribution = __decorate([ - __param(1, _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_4__["IModelService"]), - __param(2, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_6__["IThemeService"]), - __param(3, _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_7__["IConfigurationService"]) -], ViewportSemanticTokensContribution); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_2__["registerEditorContribution"])(ViewportSemanticTokensContribution.ID, ViewportSemanticTokensContribution); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/wordHighlighter/wordHighlighter.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/wordHighlighter/wordHighlighter.js ***! - \*********************************************************************************************/ -/*! exports provided: getOccurrencesAtPosition */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOccurrencesAtPosition", function() { return getOccurrencesAtPosition; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _common_model_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../base/browser/ui/aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - -const editorWordHighlight = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["registerColor"])('editor.wordHighlightBackground', { dark: '#575757B8', light: '#57575740', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wordHighlight', 'Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations.'), true); -const editorWordHighlightStrong = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["registerColor"])('editor.wordHighlightStrongBackground', { dark: '#004972B8', light: '#0e639c40', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wordHighlightStrong', 'Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations.'), true); -const editorWordHighlightBorder = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["registerColor"])('editor.wordHighlightBorder', { light: null, dark: null, hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["activeContrastBorder"] }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wordHighlightBorder', 'Border color of a symbol during read-access, like reading a variable.')); -const editorWordHighlightStrongBorder = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["registerColor"])('editor.wordHighlightStrongBorder', { light: null, dark: null, hc: _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["activeContrastBorder"] }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wordHighlightStrongBorder', 'Border color of a symbol during write-access, like writing to a variable.')); -const overviewRulerWordHighlightForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["registerColor"])('editorOverviewRuler.wordHighlightForeground', { dark: '#A0A0A0CC', light: '#A0A0A0CC', hc: '#A0A0A0CC' }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('overviewRulerWordHighlightForeground', 'Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations.'), true); -const overviewRulerWordHighlightStrongForeground = Object(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["registerColor"])('editorOverviewRuler.wordHighlightStrongForeground', { dark: '#C0A0C0CC', light: '#C0A0C0CC', hc: '#C0A0C0CC' }, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('overviewRulerWordHighlightStrongForeground', 'Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations.'), true); -const ctxHasWordHighlights = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["RawContextKey"]('hasWordHighlights', false); -function getOccurrencesAtPosition(model, position, token) { - const orderedByScore = _common_modes_js__WEBPACK_IMPORTED_MODULE_11__["DocumentHighlightProviderRegistry"].ordered(model); - // in order of score ask the occurrences provider - // until someone response with a good result - // (good = none empty array) - return Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["first"])(orderedByScore.map(provider => () => { - return Promise.resolve(provider.provideDocumentHighlights(model, position, token)) - .then(undefined, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_4__["onUnexpectedExternalError"]); - }), _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["isNonEmptyArray"]); -} -class OccurenceAtPositionRequest { - constructor(model, selection, wordSeparators) { - this._wordRange = this._getCurrentWordRange(model, selection); - this.result = Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["createCancelablePromise"])(token => this._compute(model, selection, wordSeparators, token)); - } - _getCurrentWordRange(model, selection) { - const word = model.getWordAtPosition(selection.getPosition()); - if (word) { - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"](selection.startLineNumber, word.startColumn, selection.startLineNumber, word.endColumn); - } - return null; - } - isValid(model, selection, decorationIds) { - const lineNumber = selection.startLineNumber; - const startColumn = selection.startColumn; - const endColumn = selection.endColumn; - const currentWordRange = this._getCurrentWordRange(model, selection); - let requestIsValid = Boolean(this._wordRange && this._wordRange.equalsRange(currentWordRange)); - // Even if we are on a different word, if that word is in the decorations ranges, the request is still valid - // (Same symbol) - for (let i = 0, len = decorationIds.length; !requestIsValid && i < len; i++) { - let range = model.getDecorationRange(decorationIds[i]); - if (range && range.startLineNumber === lineNumber) { - if (range.startColumn <= startColumn && range.endColumn >= endColumn) { - requestIsValid = true; - } - } - } - return requestIsValid; - } - cancel() { - this.result.cancel(); - } -} -class SemanticOccurenceAtPositionRequest extends OccurenceAtPositionRequest { - _compute(model, selection, wordSeparators, token) { - return getOccurrencesAtPosition(model, selection.getPosition(), token).then(value => value || []); - } -} -class TextualOccurenceAtPositionRequest extends OccurenceAtPositionRequest { - constructor(model, selection, wordSeparators) { - super(model, selection, wordSeparators); - this._selectionIsEmpty = selection.isEmpty(); - } - _compute(model, selection, wordSeparators, token) { - return Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["timeout"])(250, token).then(() => { - if (!selection.isEmpty()) { - return []; - } - const word = model.getWordAtPosition(selection.getPosition()); - if (!word || word.word.length > 1000) { - return []; - } - const matches = model.findMatches(word.word, true, false, true, wordSeparators, false); - return matches.map(m => { - return { - range: m.range, - kind: _common_modes_js__WEBPACK_IMPORTED_MODULE_11__["DocumentHighlightKind"].Text - }; - }); - }); - } - isValid(model, selection, decorationIds) { - const currentSelectionIsEmpty = selection.isEmpty(); - if (this._selectionIsEmpty !== currentSelectionIsEmpty) { - return false; - } - return super.isValid(model, selection, decorationIds); - } -} -function computeOccurencesAtPosition(model, selection, wordSeparators) { - if (_common_modes_js__WEBPACK_IMPORTED_MODULE_11__["DocumentHighlightProviderRegistry"].has(model)) { - return new SemanticOccurenceAtPositionRequest(model, selection, wordSeparators); - } - return new TextualOccurenceAtPositionRequest(model, selection, wordSeparators); -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerModelAndPositionCommand"])('_executeDocumentHighlights', (model, position) => getOccurrencesAtPosition(model, position, _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_3__["CancellationToken"].None)); -class WordHighlighter { - constructor(editor, contextKeyService) { - this.toUnhook = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["DisposableStore"](); - this.workerRequestTokenId = 0; - this.workerRequestCompleted = false; - this.workerRequestValue = []; - this.lastCursorPositionChangeTime = 0; - this.renderDecorationsTimer = -1; - this.editor = editor; - this._hasWordHighlights = ctxHasWordHighlights.bindTo(contextKeyService); - this._ignorePositionChangeEvent = false; - this.occurrencesHighlight = this.editor.getOption(63 /* occurrencesHighlight */); - this.model = this.editor.getModel(); - this.toUnhook.add(editor.onDidChangeCursorPosition((e) => { - if (this._ignorePositionChangeEvent) { - // We are changing the position => ignore this event - return; - } - if (!this.occurrencesHighlight) { - // Early exit if nothing needs to be done! - // Leave some form of early exit check here if you wish to continue being a cursor position change listener ;) - return; - } - this._onPositionChanged(e); - })); - this.toUnhook.add(editor.onDidChangeModelContent((e) => { - this._stopAll(); - })); - this.toUnhook.add(editor.onDidChangeConfiguration((e) => { - let newValue = this.editor.getOption(63 /* occurrencesHighlight */); - if (this.occurrencesHighlight !== newValue) { - this.occurrencesHighlight = newValue; - this._stopAll(); - } - })); - this._decorationIds = []; - this.workerRequestTokenId = 0; - this.workerRequest = null; - this.workerRequestCompleted = false; - this.lastCursorPositionChangeTime = 0; - this.renderDecorationsTimer = -1; - } - hasDecorations() { - return (this._decorationIds.length > 0); - } - restore() { - if (!this.occurrencesHighlight) { - return; - } - this._run(); - } - _getSortedHighlights() { - return _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["coalesce"](this._decorationIds - .map((id) => this.model.getDecorationRange(id)) - .sort(_common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].compareRangesUsingStarts)); - } - moveNext() { - let highlights = this._getSortedHighlights(); - let index = _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["firstIndex"](highlights, (range) => range.containsPosition(this.editor.getPosition())); - let newIndex = ((index + 1) % highlights.length); - let dest = highlights[newIndex]; - try { - this._ignorePositionChangeEvent = true; - this.editor.setPosition(dest.getStartPosition()); - this.editor.revealRangeInCenterIfOutsideViewport(dest); - const word = this._getWord(); - if (word) { - const lineContent = this.editor.getModel().getLineContent(dest.startLineNumber); - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_15__["alert"])(`${lineContent}, ${newIndex + 1} of ${highlights.length} for '${word.word}'`); - } - } - finally { - this._ignorePositionChangeEvent = false; - } - } - moveBack() { - let highlights = this._getSortedHighlights(); - let index = _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["firstIndex"](highlights, (range) => range.containsPosition(this.editor.getPosition())); - let newIndex = ((index - 1 + highlights.length) % highlights.length); - let dest = highlights[newIndex]; - try { - this._ignorePositionChangeEvent = true; - this.editor.setPosition(dest.getStartPosition()); - this.editor.revealRangeInCenterIfOutsideViewport(dest); - const word = this._getWord(); - if (word) { - const lineContent = this.editor.getModel().getLineContent(dest.startLineNumber); - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_15__["alert"])(`${lineContent}, ${newIndex + 1} of ${highlights.length} for '${word.word}'`); - } - } - finally { - this._ignorePositionChangeEvent = false; - } - } - _removeDecorations() { - if (this._decorationIds.length > 0) { - // remove decorations - this._decorationIds = this.editor.deltaDecorations(this._decorationIds, []); - this._hasWordHighlights.set(false); - } - } - _stopAll() { - // Remove any existing decorations - this._removeDecorations(); - // Cancel any renderDecorationsTimer - if (this.renderDecorationsTimer !== -1) { - clearTimeout(this.renderDecorationsTimer); - this.renderDecorationsTimer = -1; - } - // Cancel any worker request - if (this.workerRequest !== null) { - this.workerRequest.cancel(); - this.workerRequest = null; - } - // Invalidate any worker request callback - if (!this.workerRequestCompleted) { - this.workerRequestTokenId++; - this.workerRequestCompleted = true; - } - } - _onPositionChanged(e) { - // disabled - if (!this.occurrencesHighlight) { - this._stopAll(); - return; - } - // ignore typing & other - if (e.reason !== 3 /* Explicit */) { - this._stopAll(); - return; - } - this._run(); - } - _getWord() { - let editorSelection = this.editor.getSelection(); - let lineNumber = editorSelection.startLineNumber; - let startColumn = editorSelection.startColumn; - return this.model.getWordAtPosition({ - lineNumber: lineNumber, - column: startColumn - }); - } - _run() { - let editorSelection = this.editor.getSelection(); - // ignore multiline selection - if (editorSelection.startLineNumber !== editorSelection.endLineNumber) { - this._stopAll(); - return; - } - let startColumn = editorSelection.startColumn; - let endColumn = editorSelection.endColumn; - const word = this._getWord(); - // The selection must be inside a word or surround one word at most - if (!word || word.startColumn > startColumn || word.endColumn < endColumn) { - this._stopAll(); - return; - } - // All the effort below is trying to achieve this: - // - when cursor is moved to a word, trigger immediately a findOccurrences request - // - 250ms later after the last cursor move event, render the occurrences - // - no flickering! - const workerRequestIsValid = (this.workerRequest && this.workerRequest.isValid(this.model, editorSelection, this._decorationIds)); - // There are 4 cases: - // a) old workerRequest is valid & completed, renderDecorationsTimer fired - // b) old workerRequest is valid & completed, renderDecorationsTimer not fired - // c) old workerRequest is valid, but not completed - // d) old workerRequest is not valid - // For a) no action is needed - // For c), member 'lastCursorPositionChangeTime' will be used when installing the timer so no action is needed - this.lastCursorPositionChangeTime = (new Date()).getTime(); - if (workerRequestIsValid) { - if (this.workerRequestCompleted && this.renderDecorationsTimer !== -1) { - // case b) - // Delay the firing of renderDecorationsTimer by an extra 250 ms - clearTimeout(this.renderDecorationsTimer); - this.renderDecorationsTimer = -1; - this._beginRenderDecorations(); - } - } - else { - // case d) - // Stop all previous actions and start fresh - this._stopAll(); - let myRequestId = ++this.workerRequestTokenId; - this.workerRequestCompleted = false; - this.workerRequest = computeOccurencesAtPosition(this.model, this.editor.getSelection(), this.editor.getOption(105 /* wordSeparators */)); - this.workerRequest.result.then(data => { - if (myRequestId === this.workerRequestTokenId) { - this.workerRequestCompleted = true; - this.workerRequestValue = data || []; - this._beginRenderDecorations(); - } - }, _base_common_errors_js__WEBPACK_IMPORTED_MODULE_4__["onUnexpectedError"]); - } - } - _beginRenderDecorations() { - let currentTime = (new Date()).getTime(); - let minimumRenderTime = this.lastCursorPositionChangeTime + 250; - if (currentTime >= minimumRenderTime) { - // Synchronous - this.renderDecorationsTimer = -1; - this.renderDecorations(); - } - else { - // Asynchronous - this.renderDecorationsTimer = setTimeout(() => { - this.renderDecorations(); - }, (minimumRenderTime - currentTime)); - } - } - renderDecorations() { - this.renderDecorationsTimer = -1; - let decorations = []; - for (const info of this.workerRequestValue) { - if (info.range) { - decorations.push({ - range: info.range, - options: WordHighlighter._getDecorationOptions(info.kind) - }); - } - } - this._decorationIds = this.editor.deltaDecorations(this._decorationIds, decorations); - this._hasWordHighlights.set(this.hasDecorations()); - } - static _getDecorationOptions(kind) { - if (kind === _common_modes_js__WEBPACK_IMPORTED_MODULE_11__["DocumentHighlightKind"].Write) { - return this._WRITE_OPTIONS; - } - else if (kind === _common_modes_js__WEBPACK_IMPORTED_MODULE_11__["DocumentHighlightKind"].Text) { - return this._TEXT_OPTIONS; - } - else { - return this._REGULAR_OPTIONS; - } - } - dispose() { - this._stopAll(); - this.toUnhook.dispose(); - } -} -WordHighlighter._WRITE_OPTIONS = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - className: 'wordHighlightStrong', - overviewRuler: { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_14__["themeColorFromId"])(overviewRulerWordHighlightStrongForeground), - position: _common_model_js__WEBPACK_IMPORTED_MODULE_9__["OverviewRulerLane"].Center - } -}); -WordHighlighter._TEXT_OPTIONS = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - className: 'selectionHighlight', - overviewRuler: { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_14__["themeColorFromId"])(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["overviewRulerSelectionHighlightForeground"]), - position: _common_model_js__WEBPACK_IMPORTED_MODULE_9__["OverviewRulerLane"].Center - } -}); -WordHighlighter._REGULAR_OPTIONS = _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_10__["ModelDecorationOptions"].register({ - stickiness: 1 /* NeverGrowsWhenTypingAtEdges */, - className: 'wordHighlight', - overviewRuler: { - color: Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_14__["themeColorFromId"])(overviewRulerWordHighlightForeground), - position: _common_model_js__WEBPACK_IMPORTED_MODULE_9__["OverviewRulerLane"].Center - } -}); -let WordHighlighterContribution = class WordHighlighterContribution extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["Disposable"] { - constructor(editor, contextKeyService) { - super(); - this.wordHighlighter = null; - const createWordHighlighterIfPossible = () => { - if (editor.hasModel()) { - this.wordHighlighter = new WordHighlighter(editor, contextKeyService); - } - }; - this._register(editor.onDidChangeModel((e) => { - if (this.wordHighlighter) { - this.wordHighlighter.dispose(); - this.wordHighlighter = null; - } - createWordHighlighterIfPossible(); - })); - createWordHighlighterIfPossible(); - } - static get(editor) { - return editor.getContribution(WordHighlighterContribution.ID); - } - saveViewState() { - if (this.wordHighlighter && this.wordHighlighter.hasDecorations()) { - return true; - } - return false; - } - moveNext() { - if (this.wordHighlighter) { - this.wordHighlighter.moveNext(); - } - } - moveBack() { - if (this.wordHighlighter) { - this.wordHighlighter.moveBack(); - } - } - restoreViewState(state) { - if (this.wordHighlighter && state) { - this.wordHighlighter.restore(); - } - } - dispose() { - if (this.wordHighlighter) { - this.wordHighlighter.dispose(); - this.wordHighlighter = null; - } - super.dispose(); - } -}; -WordHighlighterContribution.ID = 'editor.contrib.wordHighlighter'; -WordHighlighterContribution = __decorate([ - __param(1, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["IContextKeyService"]) -], WordHighlighterContribution); -class WordHighlightNavigationAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["EditorAction"] { - constructor(next, opts) { - super(opts); - this._isNext = next; - } - run(accessor, editor) { - const controller = WordHighlighterContribution.get(editor); - if (!controller) { - return; - } - if (this._isNext) { - controller.moveNext(); - } - else { - controller.moveBack(); - } - } -} -class NextWordHighlightAction extends WordHighlightNavigationAction { - constructor() { - super(true, { - id: 'editor.action.wordHighlight.next', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wordHighlight.next.label', "Go to Next Symbol Highlight"), - alias: 'Go to Next Symbol Highlight', - precondition: ctxHasWordHighlights, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].editorTextFocus, - primary: 65 /* F7 */, - weight: 100 /* EditorContrib */ - } - }); - } -} -class PrevWordHighlightAction extends WordHighlightNavigationAction { - constructor() { - super(false, { - id: 'editor.action.wordHighlight.prev', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wordHighlight.previous.label', "Go to Previous Symbol Highlight"), - alias: 'Go to Previous Symbol Highlight', - precondition: ctxHasWordHighlights, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].editorTextFocus, - primary: 1024 /* Shift */ | 65 /* F7 */, - weight: 100 /* EditorContrib */ - } - }); - } -} -class TriggerWordHighlightAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.wordHighlight.trigger', - label: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('wordHighlight.trigger.label', "Trigger Symbol Highlight"), - alias: 'Trigger Symbol Highlight', - precondition: ctxHasWordHighlights.toNegated(), - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].editorTextFocus, - primary: 0, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor, editor, args) { - const controller = WordHighlighterContribution.get(editor); - if (!controller) { - return; - } - controller.restoreViewState(true); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorContribution"])(WordHighlighterContribution.ID, WordHighlighterContribution); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorAction"])(NextWordHighlightAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorAction"])(PrevWordHighlightAction); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_6__["registerEditorAction"])(TriggerWordHighlightAction); -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_14__["registerThemingParticipant"])((theme, collector) => { - const selectionHighlight = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["editorSelectionHighlight"]); - if (selectionHighlight) { - collector.addRule(`.monaco-editor .focused .selectionHighlight { background-color: ${selectionHighlight}; }`); - collector.addRule(`.monaco-editor .selectionHighlight { background-color: ${selectionHighlight.transparent(0.5)}; }`); - } - const wordHighlight = theme.getColor(editorWordHighlight); - if (wordHighlight) { - collector.addRule(`.monaco-editor .wordHighlight { background-color: ${wordHighlight}; }`); - } - const wordHighlightStrong = theme.getColor(editorWordHighlightStrong); - if (wordHighlightStrong) { - collector.addRule(`.monaco-editor .wordHighlightStrong { background-color: ${wordHighlightStrong}; }`); - } - const selectionHighlightBorder = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_13__["editorSelectionHighlightBorder"]); - if (selectionHighlightBorder) { - collector.addRule(`.monaco-editor .selectionHighlight { border: 1px ${theme.type === 'hc' ? 'dotted' : 'solid'} ${selectionHighlightBorder}; box-sizing: border-box; }`); - } - const wordHighlightBorder = theme.getColor(editorWordHighlightBorder); - if (wordHighlightBorder) { - collector.addRule(`.monaco-editor .wordHighlight { border: 1px ${theme.type === 'hc' ? 'dashed' : 'solid'} ${wordHighlightBorder}; box-sizing: border-box; }`); - } - const wordHighlightStrongBorder = theme.getColor(editorWordHighlightStrongBorder); - if (wordHighlightStrongBorder) { - collector.addRule(`.monaco-editor .wordHighlightStrong { border: 1px ${theme.type === 'hc' ? 'dashed' : 'solid'} ${wordHighlightStrongBorder}; box-sizing: border-box; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/wordOperations/wordOperations.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/wordOperations/wordOperations.js ***! - \*******************************************************************************************/ -/*! exports provided: MoveWordCommand, WordLeftCommand, WordRightCommand, CursorWordStartLeft, CursorWordEndLeft, CursorWordLeft, CursorWordStartLeftSelect, CursorWordEndLeftSelect, CursorWordLeftSelect, CursorWordAccessibilityLeft, CursorWordAccessibilityLeftSelect, CursorWordStartRight, CursorWordEndRight, CursorWordRight, CursorWordStartRightSelect, CursorWordEndRightSelect, CursorWordRightSelect, CursorWordAccessibilityRight, CursorWordAccessibilityRightSelect, DeleteWordCommand, DeleteWordLeftCommand, DeleteWordRightCommand, DeleteWordStartLeft, DeleteWordEndLeft, DeleteWordLeft, DeleteWordStartRight, DeleteWordEndRight, DeleteWordRight */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MoveWordCommand", function() { return MoveWordCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WordLeftCommand", function() { return WordLeftCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WordRightCommand", function() { return WordRightCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordStartLeft", function() { return CursorWordStartLeft; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordEndLeft", function() { return CursorWordEndLeft; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordLeft", function() { return CursorWordLeft; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordStartLeftSelect", function() { return CursorWordStartLeftSelect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordEndLeftSelect", function() { return CursorWordEndLeftSelect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordLeftSelect", function() { return CursorWordLeftSelect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordAccessibilityLeft", function() { return CursorWordAccessibilityLeft; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordAccessibilityLeftSelect", function() { return CursorWordAccessibilityLeftSelect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordStartRight", function() { return CursorWordStartRight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordEndRight", function() { return CursorWordEndRight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordRight", function() { return CursorWordRight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordStartRightSelect", function() { return CursorWordStartRightSelect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordEndRightSelect", function() { return CursorWordEndRightSelect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordRightSelect", function() { return CursorWordRightSelect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordAccessibilityRight", function() { return CursorWordAccessibilityRight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordAccessibilityRightSelect", function() { return CursorWordAccessibilityRightSelect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteWordCommand", function() { return DeleteWordCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteWordLeftCommand", function() { return DeleteWordLeftCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteWordRightCommand", function() { return DeleteWordRightCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteWordStartLeft", function() { return DeleteWordStartLeft; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteWordEndLeft", function() { return DeleteWordEndLeft; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteWordLeft", function() { return DeleteWordLeft; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteWordStartRight", function() { return DeleteWordStartRight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteWordEndRight", function() { return DeleteWordEndRight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteWordRight", function() { return DeleteWordRight; }); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/commands/replaceCommand.js */ "./node_modules/monaco-editor/esm/vs/editor/common/commands/replaceCommand.js"); -/* harmony import */ var _common_controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/controller/cursorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorCommon.js"); -/* harmony import */ var _common_controller_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/controller/cursorWordOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorWordOperations.js"); -/* harmony import */ var _common_controller_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/controller/wordCharacterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/wordCharacterClassifier.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/accessibility/common/accessibility.js */ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../common/config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - -class MoveWordCommand extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["EditorCommand"] { - constructor(opts) { - super(opts); - this._inSelectionMode = opts.inSelectionMode; - this._wordNavigationType = opts.wordNavigationType; - } - runEditorCommand(accessor, editor, args) { - if (!editor.hasModel()) { - return; - } - const wordSeparators = Object(_common_controller_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_4__["getMapForWordSeparators"])(editor.getOption(105 /* wordSeparators */)); - const model = editor.getModel(); - const selections = editor.getSelections(); - const result = selections.map((sel) => { - const inPosition = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"](sel.positionLineNumber, sel.positionColumn); - const outPosition = this._move(wordSeparators, model, inPosition, this._wordNavigationType); - return this._moveTo(sel, outPosition, this._inSelectionMode); - }); - model.pushStackElement(); - editor._getViewModel().setCursorStates('moveWordCommand', 0 /* NotSet */, result.map(r => _common_controller_cursorCommon_js__WEBPACK_IMPORTED_MODULE_2__["CursorState"].fromModelSelection(r))); - if (result.length === 1) { - const pos = new _common_core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"](result[0].positionLineNumber, result[0].positionColumn); - editor.revealPosition(pos, 0 /* Smooth */); - } - } - _moveTo(from, to, inSelectionMode) { - if (inSelectionMode) { - // move just position - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](from.selectionStartLineNumber, from.selectionStartColumn, to.lineNumber, to.column); - } - else { - // move everything - return new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"](to.lineNumber, to.column, to.lineNumber, to.column); - } - } -} -class WordLeftCommand extends MoveWordCommand { - _move(wordSeparators, model, position, wordNavigationType) { - return _common_controller_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_3__["WordOperations"].moveWordLeft(wordSeparators, model, position, wordNavigationType); - } -} -class WordRightCommand extends MoveWordCommand { - _move(wordSeparators, model, position, wordNavigationType) { - return _common_controller_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_3__["WordOperations"].moveWordRight(wordSeparators, model, position, wordNavigationType); - } -} -class CursorWordStartLeft extends WordLeftCommand { - constructor() { - super({ - inSelectionMode: false, - wordNavigationType: 0 /* WordStart */, - id: 'cursorWordStartLeft', - precondition: undefined - }); - } -} -class CursorWordEndLeft extends WordLeftCommand { - constructor() { - super({ - inSelectionMode: false, - wordNavigationType: 2 /* WordEnd */, - id: 'cursorWordEndLeft', - precondition: undefined - }); - } -} -class CursorWordLeft extends WordLeftCommand { - constructor() { - super({ - inSelectionMode: false, - wordNavigationType: 1 /* WordStartFast */, - id: 'cursorWordLeft', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 15 /* LeftArrow */, - mac: { primary: 512 /* Alt */ | 15 /* LeftArrow */ }, - weight: 100 /* EditorContrib */ - } - }); - } -} -class CursorWordStartLeftSelect extends WordLeftCommand { - constructor() { - super({ - inSelectionMode: true, - wordNavigationType: 0 /* WordStart */, - id: 'cursorWordStartLeftSelect', - precondition: undefined - }); - } -} -class CursorWordEndLeftSelect extends WordLeftCommand { - constructor() { - super({ - inSelectionMode: true, - wordNavigationType: 2 /* WordEnd */, - id: 'cursorWordEndLeftSelect', - precondition: undefined - }); - } -} -class CursorWordLeftSelect extends WordLeftCommand { - constructor() { - super({ - inSelectionMode: true, - wordNavigationType: 1 /* WordStartFast */, - id: 'cursorWordLeftSelect', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 15 /* LeftArrow */, - mac: { primary: 512 /* Alt */ | 1024 /* Shift */ | 15 /* LeftArrow */ }, - weight: 100 /* EditorContrib */ - } - }); - } -} -// Accessibility navigation commands should only be enabled on windows since they are tuned to what NVDA expects -class CursorWordAccessibilityLeft extends WordLeftCommand { - constructor() { - super({ - inSelectionMode: false, - wordNavigationType: 3 /* WordAccessibility */, - id: 'cursorWordAccessibilityLeft', - precondition: undefined, - kbOpts: { - kbExpr: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_10__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].textInputFocus, _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_9__["CONTEXT_ACCESSIBILITY_MODE_ENABLED"]), - win: { primary: 2048 /* CtrlCmd */ | 15 /* LeftArrow */ }, - weight: 100 /* EditorContrib */ + 1 - } - }); - } - _move(_, model, position, wordNavigationType) { - return super._move(Object(_common_controller_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_4__["getMapForWordSeparators"])(_common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_11__["EditorOptions"].wordSeparators.defaultValue), model, position, wordNavigationType); - } -} -class CursorWordAccessibilityLeftSelect extends WordLeftCommand { - constructor() { - super({ - inSelectionMode: true, - wordNavigationType: 3 /* WordAccessibility */, - id: 'cursorWordAccessibilityLeftSelect', - precondition: undefined, - kbOpts: { - kbExpr: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_10__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].textInputFocus, _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_9__["CONTEXT_ACCESSIBILITY_MODE_ENABLED"]), - win: { primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 15 /* LeftArrow */ }, - weight: 100 /* EditorContrib */ + 1 - } - }); - } - _move(_, model, position, wordNavigationType) { - return super._move(Object(_common_controller_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_4__["getMapForWordSeparators"])(_common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_11__["EditorOptions"].wordSeparators.defaultValue), model, position, wordNavigationType); - } -} -class CursorWordStartRight extends WordRightCommand { - constructor() { - super({ - inSelectionMode: false, - wordNavigationType: 0 /* WordStart */, - id: 'cursorWordStartRight', - precondition: undefined - }); - } -} -class CursorWordEndRight extends WordRightCommand { - constructor() { - super({ - inSelectionMode: false, - wordNavigationType: 2 /* WordEnd */, - id: 'cursorWordEndRight', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 17 /* RightArrow */, - mac: { primary: 512 /* Alt */ | 17 /* RightArrow */ }, - weight: 100 /* EditorContrib */ - } - }); - } -} -class CursorWordRight extends WordRightCommand { - constructor() { - super({ - inSelectionMode: false, - wordNavigationType: 2 /* WordEnd */, - id: 'cursorWordRight', - precondition: undefined - }); - } -} -class CursorWordStartRightSelect extends WordRightCommand { - constructor() { - super({ - inSelectionMode: true, - wordNavigationType: 0 /* WordStart */, - id: 'cursorWordStartRightSelect', - precondition: undefined - }); - } -} -class CursorWordEndRightSelect extends WordRightCommand { - constructor() { - super({ - inSelectionMode: true, - wordNavigationType: 2 /* WordEnd */, - id: 'cursorWordEndRightSelect', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 17 /* RightArrow */, - mac: { primary: 512 /* Alt */ | 1024 /* Shift */ | 17 /* RightArrow */ }, - weight: 100 /* EditorContrib */ - } - }); - } -} -class CursorWordRightSelect extends WordRightCommand { - constructor() { - super({ - inSelectionMode: true, - wordNavigationType: 2 /* WordEnd */, - id: 'cursorWordRightSelect', - precondition: undefined - }); - } -} -class CursorWordAccessibilityRight extends WordRightCommand { - constructor() { - super({ - inSelectionMode: false, - wordNavigationType: 3 /* WordAccessibility */, - id: 'cursorWordAccessibilityRight', - precondition: undefined, - kbOpts: { - kbExpr: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_10__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].textInputFocus, _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_9__["CONTEXT_ACCESSIBILITY_MODE_ENABLED"]), - win: { primary: 2048 /* CtrlCmd */ | 17 /* RightArrow */ }, - weight: 100 /* EditorContrib */ + 1 - } - }); - } - _move(_, model, position, wordNavigationType) { - return super._move(Object(_common_controller_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_4__["getMapForWordSeparators"])(_common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_11__["EditorOptions"].wordSeparators.defaultValue), model, position, wordNavigationType); - } -} -class CursorWordAccessibilityRightSelect extends WordRightCommand { - constructor() { - super({ - inSelectionMode: true, - wordNavigationType: 3 /* WordAccessibility */, - id: 'cursorWordAccessibilityRightSelect', - precondition: undefined, - kbOpts: { - kbExpr: _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_10__["ContextKeyExpr"].and(_common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].textInputFocus, _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_9__["CONTEXT_ACCESSIBILITY_MODE_ENABLED"]), - win: { primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 17 /* RightArrow */ }, - weight: 100 /* EditorContrib */ + 1 - } - }); - } - _move(_, model, position, wordNavigationType) { - return super._move(Object(_common_controller_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_4__["getMapForWordSeparators"])(_common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_11__["EditorOptions"].wordSeparators.defaultValue), model, position, wordNavigationType); - } -} -class DeleteWordCommand extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["EditorCommand"] { - constructor(opts) { - super(opts); - this._whitespaceHeuristics = opts.whitespaceHeuristics; - this._wordNavigationType = opts.wordNavigationType; - } - runEditorCommand(accessor, editor, args) { - if (!editor.hasModel()) { - return; - } - const wordSeparators = Object(_common_controller_wordCharacterClassifier_js__WEBPACK_IMPORTED_MODULE_4__["getMapForWordSeparators"])(editor.getOption(105 /* wordSeparators */)); - const model = editor.getModel(); - const selections = editor.getSelections(); - const commands = selections.map((sel) => { - const deleteRange = this._delete(wordSeparators, model, sel, this._whitespaceHeuristics, this._wordNavigationType); - return new _common_commands_replaceCommand_js__WEBPACK_IMPORTED_MODULE_1__["ReplaceCommand"](deleteRange, ''); - }); - editor.pushUndoStop(); - editor.executeCommands(this.id, commands); - editor.pushUndoStop(); - } -} -class DeleteWordLeftCommand extends DeleteWordCommand { - _delete(wordSeparators, model, selection, whitespaceHeuristics, wordNavigationType) { - let r = _common_controller_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_3__["WordOperations"].deleteWordLeft(wordSeparators, model, selection, whitespaceHeuristics, wordNavigationType); - if (r) { - return r; - } - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](1, 1, 1, 1); - } -} -class DeleteWordRightCommand extends DeleteWordCommand { - _delete(wordSeparators, model, selection, whitespaceHeuristics, wordNavigationType) { - let r = _common_controller_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_3__["WordOperations"].deleteWordRight(wordSeparators, model, selection, whitespaceHeuristics, wordNavigationType); - if (r) { - return r; - } - const lineCount = model.getLineCount(); - const maxColumn = model.getLineMaxColumn(lineCount); - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](lineCount, maxColumn, lineCount, maxColumn); - } -} -class DeleteWordStartLeft extends DeleteWordLeftCommand { - constructor() { - super({ - whitespaceHeuristics: false, - wordNavigationType: 0 /* WordStart */, - id: 'deleteWordStartLeft', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable - }); - } -} -class DeleteWordEndLeft extends DeleteWordLeftCommand { - constructor() { - super({ - whitespaceHeuristics: false, - wordNavigationType: 2 /* WordEnd */, - id: 'deleteWordEndLeft', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable - }); - } -} -class DeleteWordLeft extends DeleteWordLeftCommand { - constructor() { - super({ - whitespaceHeuristics: true, - wordNavigationType: 0 /* WordStart */, - id: 'deleteWordLeft', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 1 /* Backspace */, - mac: { primary: 512 /* Alt */ | 1 /* Backspace */ }, - weight: 100 /* EditorContrib */ - } - }); - } -} -class DeleteWordStartRight extends DeleteWordRightCommand { - constructor() { - super({ - whitespaceHeuristics: false, - wordNavigationType: 0 /* WordStart */, - id: 'deleteWordStartRight', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable - }); - } -} -class DeleteWordEndRight extends DeleteWordRightCommand { - constructor() { - super({ - whitespaceHeuristics: false, - wordNavigationType: 2 /* WordEnd */, - id: 'deleteWordEndRight', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable - }); - } -} -class DeleteWordRight extends DeleteWordRightCommand { - constructor() { - super({ - whitespaceHeuristics: true, - wordNavigationType: 2 /* WordEnd */, - id: 'deleteWordRight', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].textInputFocus, - primary: 2048 /* CtrlCmd */ | 20 /* Delete */, - mac: { primary: 512 /* Alt */ | 20 /* Delete */ }, - weight: 100 /* EditorContrib */ - } - }); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordStartLeft()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordEndLeft()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordLeft()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordStartLeftSelect()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordEndLeftSelect()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordLeftSelect()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordStartRight()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordEndRight()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordRight()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordStartRightSelect()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordEndRightSelect()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordRightSelect()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordAccessibilityLeft()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordAccessibilityLeftSelect()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordAccessibilityRight()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordAccessibilityRightSelect()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new DeleteWordStartLeft()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new DeleteWordEndLeft()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new DeleteWordLeft()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new DeleteWordStartRight()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new DeleteWordEndRight()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new DeleteWordRight()); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/wordPartOperations/wordPartOperations.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/wordPartOperations/wordPartOperations.js ***! - \***************************************************************************************************/ -/*! exports provided: DeleteWordPartLeft, DeleteWordPartRight, WordPartLeftCommand, CursorWordPartLeft, CursorWordPartLeftSelect, WordPartRightCommand, CursorWordPartRight, CursorWordPartRightSelect */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteWordPartLeft", function() { return DeleteWordPartLeft; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteWordPartRight", function() { return DeleteWordPartRight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WordPartLeftCommand", function() { return WordPartLeftCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordPartLeft", function() { return CursorWordPartLeft; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordPartLeftSelect", function() { return CursorWordPartLeftSelect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WordPartRightCommand", function() { return WordPartRightCommand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordPartRight", function() { return CursorWordPartRight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorWordPartRightSelect", function() { return CursorWordPartRightSelect; }); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_controller_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/controller/cursorWordOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/common/controller/cursorWordOperations.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _wordOperations_wordOperations_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../wordOperations/wordOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/wordOperations/wordOperations.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -class DeleteWordPartLeft extends _wordOperations_wordOperations_js__WEBPACK_IMPORTED_MODULE_4__["DeleteWordCommand"] { - constructor() { - super({ - whitespaceHeuristics: true, - wordNavigationType: 0 /* WordStart */, - id: 'deleteWordPartLeft', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 512 /* Alt */ | 1 /* Backspace */ }, - weight: 100 /* EditorContrib */ - } - }); - } - _delete(wordSeparators, model, selection, whitespaceHeuristics, wordNavigationType) { - let r = _common_controller_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_1__["WordPartOperations"].deleteWordPartLeft(wordSeparators, model, selection, whitespaceHeuristics); - if (r) { - return r; - } - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](1, 1, 1, 1); - } -} -class DeleteWordPartRight extends _wordOperations_wordOperations_js__WEBPACK_IMPORTED_MODULE_4__["DeleteWordCommand"] { - constructor() { - super({ - whitespaceHeuristics: true, - wordNavigationType: 2 /* WordEnd */, - id: 'deleteWordPartRight', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].writable, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 512 /* Alt */ | 20 /* Delete */ }, - weight: 100 /* EditorContrib */ - } - }); - } - _delete(wordSeparators, model, selection, whitespaceHeuristics, wordNavigationType) { - let r = _common_controller_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_1__["WordPartOperations"].deleteWordPartRight(wordSeparators, model, selection, whitespaceHeuristics); - if (r) { - return r; - } - const lineCount = model.getLineCount(); - const maxColumn = model.getLineMaxColumn(lineCount); - return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_2__["Range"](lineCount, maxColumn, lineCount, maxColumn); - } -} -class WordPartLeftCommand extends _wordOperations_wordOperations_js__WEBPACK_IMPORTED_MODULE_4__["MoveWordCommand"] { - _move(wordSeparators, model, position, wordNavigationType) { - return _common_controller_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_1__["WordPartOperations"].moveWordPartLeft(wordSeparators, model, position); - } -} -class CursorWordPartLeft extends WordPartLeftCommand { - constructor() { - super({ - inSelectionMode: false, - wordNavigationType: 0 /* WordStart */, - id: 'cursorWordPartLeft', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 512 /* Alt */ | 15 /* LeftArrow */ }, - weight: 100 /* EditorContrib */ - } - }); - } -} -// Register previous id for compatibility purposes -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_5__["CommandsRegistry"].registerCommandAlias('cursorWordPartStartLeft', 'cursorWordPartLeft'); -class CursorWordPartLeftSelect extends WordPartLeftCommand { - constructor() { - super({ - inSelectionMode: true, - wordNavigationType: 0 /* WordStart */, - id: 'cursorWordPartLeftSelect', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 512 /* Alt */ | 1024 /* Shift */ | 15 /* LeftArrow */ }, - weight: 100 /* EditorContrib */ - } - }); - } -} -// Register previous id for compatibility purposes -_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_5__["CommandsRegistry"].registerCommandAlias('cursorWordPartStartLeftSelect', 'cursorWordPartLeftSelect'); -class WordPartRightCommand extends _wordOperations_wordOperations_js__WEBPACK_IMPORTED_MODULE_4__["MoveWordCommand"] { - _move(wordSeparators, model, position, wordNavigationType) { - return _common_controller_cursorWordOperations_js__WEBPACK_IMPORTED_MODULE_1__["WordPartOperations"].moveWordPartRight(wordSeparators, model, position); - } -} -class CursorWordPartRight extends WordPartRightCommand { - constructor() { - super({ - inSelectionMode: false, - wordNavigationType: 2 /* WordEnd */, - id: 'cursorWordPartRight', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 512 /* Alt */ | 17 /* RightArrow */ }, - weight: 100 /* EditorContrib */ - } - }); - } -} -class CursorWordPartRightSelect extends WordPartRightCommand { - constructor() { - super({ - inSelectionMode: true, - wordNavigationType: 2 /* WordEnd */, - id: 'cursorWordPartRightSelect', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_3__["EditorContextKeys"].textInputFocus, - primary: 0, - mac: { primary: 256 /* WinCtrl */ | 512 /* Alt */ | 1024 /* Shift */ | 17 /* RightArrow */ }, - weight: 100 /* EditorContrib */ - } - }); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new DeleteWordPartLeft()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new DeleteWordPartRight()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordPartLeft()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordPartLeftSelect()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordPartRight()); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorCommand"])(new CursorWordPartRightSelect()); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/zoneWidget/zoneWidget.css": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/zoneWidget/zoneWidget.css ***! - \************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_zoneWidget_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./zoneWidget.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/contrib/zoneWidget/zoneWidget.css"); -/* harmony import */ var _css_loader_dist_cjs_js_zoneWidget_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_zoneWidget_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_zoneWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_zoneWidget_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/contrib/zoneWidget/zoneWidget.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/contrib/zoneWidget/zoneWidget.js ***! - \***********************************************************************************/ -/*! exports provided: ViewZoneDelegate, OverlayWidgetDelegate, ZoneWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewZoneDelegate", function() { return ViewZoneDelegate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayWidgetDelegate", function() { return OverlayWidgetDelegate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZoneWidget", function() { return ZoneWidget; }); -/* harmony import */ var _zoneWidget_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./zoneWidget.css */ "./node_modules/monaco-editor/esm/vs/editor/contrib/zoneWidget/zoneWidget.css"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_ui_sash_sash_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/ui/sash/sash.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/sash/sash.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _base_common_idGenerator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/idGenerator.js */ "./node_modules/monaco-editor/esm/vs/base/common/idGenerator.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_objects_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/model/textModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/textModel.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -const defaultColor = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_3__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_3__["RGBA"](0, 122, 204)); -const defaultOptions = { - showArrow: true, - showFrame: true, - className: '', - frameColor: defaultColor, - arrowColor: defaultColor, - keepEditorSelection: false -}; -const WIDGET_ID = 'vs.editor.contrib.zoneWidget'; -class ViewZoneDelegate { - constructor(domNode, afterLineNumber, afterColumn, heightInLines, onDomNodeTop, onComputedHeight) { - this.id = ''; // A valid zone id should be greater than 0 - this.domNode = domNode; - this.afterLineNumber = afterLineNumber; - this.afterColumn = afterColumn; - this.heightInLines = heightInLines; - this._onDomNodeTop = onDomNodeTop; - this._onComputedHeight = onComputedHeight; - } - onDomNodeTop(top) { - this._onDomNodeTop(top); - } - onComputedHeight(height) { - this._onComputedHeight(height); - } -} -class OverlayWidgetDelegate { - constructor(id, domNode) { - this._id = id; - this._domNode = domNode; - } - getId() { - return this._id; - } - getDomNode() { - return this._domNode; - } - getPosition() { - return null; - } -} -class Arrow { - constructor(_editor) { - this._editor = _editor; - this._ruleName = Arrow._IdGenerator.nextId(); - this._decorations = []; - this._color = null; - this._height = -1; - // - } - dispose() { - this.hide(); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["removeCSSRulesContainingSelector"](this._ruleName); - } - set color(value) { - if (this._color !== value) { - this._color = value; - this._updateStyle(); - } - } - set height(value) { - if (this._height !== value) { - this._height = value; - this._updateStyle(); - } - } - _updateStyle() { - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["removeCSSRulesContainingSelector"](this._ruleName); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["createCSSRule"](`.monaco-editor ${this._ruleName}`, `border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `); - } - show(where) { - this._decorations = this._editor.deltaDecorations(this._decorations, [{ range: _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].fromPositions(where), options: { className: this._ruleName, stickiness: 1 /* NeverGrowsWhenTypingAtEdges */ } }]); - } - hide() { - this._editor.deltaDecorations(this._decorations, []); - } -} -Arrow._IdGenerator = new _base_common_idGenerator_js__WEBPACK_IMPORTED_MODULE_4__["IdGenerator"]('.arrow-decoration-'); -class ZoneWidget { - constructor(editor, options = {}) { - this._arrow = null; - this._overlayWidget = null; - this._resizeSash = null; - this._positionMarkerId = []; - this._viewZone = null; - this._disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["DisposableStore"](); - this.container = null; - this._isShowing = false; - this.editor = editor; - this.options = _base_common_objects_js__WEBPACK_IMPORTED_MODULE_6__["deepClone"](options); - _base_common_objects_js__WEBPACK_IMPORTED_MODULE_6__["mixin"](this.options, defaultOptions, false); - this.domNode = document.createElement('div'); - if (!this.options.isAccessible) { - this.domNode.setAttribute('aria-hidden', 'true'); - this.domNode.setAttribute('role', 'presentation'); - } - this._disposables.add(this.editor.onDidLayoutChange((info) => { - const width = this._getWidth(info); - this.domNode.style.width = width + 'px'; - this.domNode.style.left = this._getLeft(info) + 'px'; - this._onWidth(width); - })); - } - dispose() { - if (this._overlayWidget) { - this.editor.removeOverlayWidget(this._overlayWidget); - this._overlayWidget = null; - } - if (this._viewZone) { - this.editor.changeViewZones(accessor => { - if (this._viewZone) { - accessor.removeZone(this._viewZone.id); - } - this._viewZone = null; - }); - } - this.editor.deltaDecorations(this._positionMarkerId, []); - this._positionMarkerId = []; - this._disposables.dispose(); - } - create() { - this.domNode.classList.add('zone-widget'); - if (this.options.className) { - this.domNode.classList.add(this.options.className); - } - this.container = document.createElement('div'); - this.container.classList.add('zone-widget-container'); - this.domNode.appendChild(this.container); - if (this.options.showArrow) { - this._arrow = new Arrow(this.editor); - this._disposables.add(this._arrow); - } - this._fillContainer(this.container); - this._initSash(); - this._applyStyles(); - } - style(styles) { - if (styles.frameColor) { - this.options.frameColor = styles.frameColor; - } - if (styles.arrowColor) { - this.options.arrowColor = styles.arrowColor; - } - this._applyStyles(); - } - _applyStyles() { - if (this.container && this.options.frameColor) { - let frameColor = this.options.frameColor.toString(); - this.container.style.borderTopColor = frameColor; - this.container.style.borderBottomColor = frameColor; - } - if (this._arrow && this.options.arrowColor) { - let arrowColor = this.options.arrowColor.toString(); - this._arrow.color = arrowColor; - } - } - _getWidth(info) { - return info.width - info.minimap.minimapWidth - info.verticalScrollbarWidth; - } - _getLeft(info) { - // If minimap is to the left, we move beyond it - if (info.minimap.minimapWidth > 0 && info.minimap.minimapLeft === 0) { - return info.minimap.minimapWidth; - } - return 0; - } - _onViewZoneTop(top) { - this.domNode.style.top = top + 'px'; - } - _onViewZoneHeight(height) { - this.domNode.style.height = `${height}px`; - if (this.container) { - let containerHeight = height - this._decoratingElementsHeight(); - this.container.style.height = `${containerHeight}px`; - const layoutInfo = this.editor.getLayoutInfo(); - this._doLayout(containerHeight, this._getWidth(layoutInfo)); - } - if (this._resizeSash) { - this._resizeSash.layout(); - } - } - get position() { - const [id] = this._positionMarkerId; - if (!id) { - return undefined; - } - const model = this.editor.getModel(); - if (!model) { - return undefined; - } - const range = model.getDecorationRange(id); - if (!range) { - return undefined; - } - return range.getStartPosition(); - } - show(rangeOrPos, heightInLines) { - const range = _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].isIRange(rangeOrPos) ? _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].lift(rangeOrPos) : _common_core_range_js__WEBPACK_IMPORTED_MODULE_7__["Range"].fromPositions(rangeOrPos); - this._isShowing = true; - this._showImpl(range, heightInLines); - this._isShowing = false; - this._positionMarkerId = this.editor.deltaDecorations(this._positionMarkerId, [{ range, options: _common_model_textModel_js__WEBPACK_IMPORTED_MODULE_8__["ModelDecorationOptions"].EMPTY }]); - } - hide() { - if (this._viewZone) { - this.editor.changeViewZones(accessor => { - if (this._viewZone) { - accessor.removeZone(this._viewZone.id); - } - }); - this._viewZone = null; - } - if (this._overlayWidget) { - this.editor.removeOverlayWidget(this._overlayWidget); - this._overlayWidget = null; - } - if (this._arrow) { - this._arrow.hide(); - } - } - _decoratingElementsHeight() { - let lineHeight = this.editor.getOption(51 /* lineHeight */); - let result = 0; - if (this.options.showArrow) { - let arrowHeight = Math.round(lineHeight / 3); - result += 2 * arrowHeight; - } - if (this.options.showFrame) { - let frameThickness = Math.round(lineHeight / 9); - result += 2 * frameThickness; - } - return result; - } - _showImpl(where, heightInLines) { - const position = where.getStartPosition(); - const layoutInfo = this.editor.getLayoutInfo(); - const width = this._getWidth(layoutInfo); - this.domNode.style.width = `${width}px`; - this.domNode.style.left = this._getLeft(layoutInfo) + 'px'; - // Render the widget as zone (rendering) and widget (lifecycle) - const viewZoneDomNode = document.createElement('div'); - viewZoneDomNode.style.overflow = 'hidden'; - const lineHeight = this.editor.getOption(51 /* lineHeight */); - // adjust heightInLines to viewport - const maxHeightInLines = Math.max(12, (this.editor.getLayoutInfo().height / lineHeight) * 0.8); - heightInLines = Math.min(heightInLines, maxHeightInLines); - let arrowHeight = 0; - let frameThickness = 0; - // Render the arrow one 1/3 of an editor line height - if (this._arrow && this.options.showArrow) { - arrowHeight = Math.round(lineHeight / 3); - this._arrow.height = arrowHeight; - this._arrow.show(position); - } - // Render the frame as 1/9 of an editor line height - if (this.options.showFrame) { - frameThickness = Math.round(lineHeight / 9); - } - // insert zone widget - this.editor.changeViewZones((accessor) => { - if (this._viewZone) { - accessor.removeZone(this._viewZone.id); - } - if (this._overlayWidget) { - this.editor.removeOverlayWidget(this._overlayWidget); - this._overlayWidget = null; - } - this.domNode.style.top = '-1000px'; - this._viewZone = new ViewZoneDelegate(viewZoneDomNode, position.lineNumber, position.column, heightInLines, (top) => this._onViewZoneTop(top), (height) => this._onViewZoneHeight(height)); - this._viewZone.id = accessor.addZone(this._viewZone); - this._overlayWidget = new OverlayWidgetDelegate(WIDGET_ID + this._viewZone.id, this.domNode); - this.editor.addOverlayWidget(this._overlayWidget); - }); - if (this.container && this.options.showFrame) { - const width = this.options.frameWidth ? this.options.frameWidth : frameThickness; - this.container.style.borderTopWidth = width + 'px'; - this.container.style.borderBottomWidth = width + 'px'; - } - let containerHeight = heightInLines * lineHeight - this._decoratingElementsHeight(); - if (this.container) { - this.container.style.top = arrowHeight + 'px'; - this.container.style.height = containerHeight + 'px'; - this.container.style.overflow = 'hidden'; - } - this._doLayout(containerHeight, width); - if (!this.options.keepEditorSelection) { - this.editor.setSelection(where); - } - const model = this.editor.getModel(); - if (model) { - const revealLine = where.endLineNumber + 1; - if (revealLine <= model.getLineCount()) { - // reveal line below the zone widget - this.revealLine(revealLine, false); - } - else { - // reveal last line atop - this.revealLine(model.getLineCount(), true); - } - } - } - revealLine(lineNumber, isLastLine) { - if (isLastLine) { - this.editor.revealLineInCenter(lineNumber, 0 /* Smooth */); - } - else { - this.editor.revealLine(lineNumber, 0 /* Smooth */); - } - } - setCssClass(className, classToReplace) { - if (!this.container) { - return; - } - if (classToReplace) { - this.container.classList.remove(classToReplace); - } - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addClass"](this.container, className); - } - _onWidth(widthInPixel) { - // implement in subclass - } - _doLayout(heightInPixel, widthInPixel) { - // implement in subclass - } - _relayout(newHeightInLines) { - if (this._viewZone && this._viewZone.heightInLines !== newHeightInLines) { - this.editor.changeViewZones(accessor => { - if (this._viewZone) { - this._viewZone.heightInLines = newHeightInLines; - accessor.layoutZone(this._viewZone.id); - } - }); - } - } - // --- sash - _initSash() { - if (this._resizeSash) { - return; - } - this._resizeSash = this._disposables.add(new _base_browser_ui_sash_sash_js__WEBPACK_IMPORTED_MODULE_2__["Sash"](this.domNode, this, { orientation: 1 /* HORIZONTAL */ })); - if (!this.options.isResizeable) { - this._resizeSash.hide(); - this._resizeSash.state = 0 /* Disabled */; - } - let data; - this._disposables.add(this._resizeSash.onDidStart((e) => { - if (this._viewZone) { - data = { - startY: e.startY, - heightInLines: this._viewZone.heightInLines, - }; - } - })); - this._disposables.add(this._resizeSash.onDidEnd(() => { - data = undefined; - })); - this._disposables.add(this._resizeSash.onDidChange((evt) => { - if (data) { - let lineDelta = (evt.currentY - data.startY) / this.editor.getOption(51 /* lineHeight */); - let roundedLineDelta = lineDelta < 0 ? Math.ceil(lineDelta) : Math.floor(lineDelta); - let newHeightInLines = data.heightInLines + roundedLineDelta; - if (newHeightInLines > 5 && newHeightInLines < 35) { - this._relayout(newHeightInLines); - } - } - })); - } - getHorizontalSashLeft() { - return 0; - } - getHorizontalSashTop() { - return (this.domNode.style.height === null ? 0 : parseInt(this.domNode.style.height)) - (this._decoratingElementsHeight() / 2); - } - getHorizontalSashWidth() { - const layoutInfo = this.editor.getLayoutInfo(); - return layoutInfo.width - layoutInfo.minimap.minimapWidth; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/edcore.main.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/edcore.main.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _editor_all_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.all.js */ "./node_modules/monaco-editor/esm/vs/editor/editor.all.js"); -/* harmony import */ var _standalone_browser_accessibilityHelp_accessibilityHelp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./standalone/browser/accessibilityHelp/accessibilityHelp.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.js"); -/* harmony import */ var _standalone_browser_iPadShowKeyboard_iPadShowKeyboard_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js"); -/* harmony import */ var _standalone_browser_inspectTokens_inspectTokens_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./standalone/browser/inspectTokens/inspectTokens.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.js"); -/* harmony import */ var _standalone_browser_quickAccess_standaloneHelpQuickAccess_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./standalone/browser/quickAccess/standaloneHelpQuickAccess.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js"); -/* harmony import */ var _standalone_browser_quickAccess_standaloneGotoLineQuickAccess_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js"); -/* harmony import */ var _standalone_browser_quickAccess_standaloneGotoSymbolQuickAccess_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js"); -/* harmony import */ var _standalone_browser_quickAccess_standaloneCommandsQuickAccess_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./standalone/browser/quickAccess/standaloneCommandsQuickAccess.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js"); -/* harmony import */ var _standalone_browser_referenceSearch_standaloneReferenceSearch_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./standalone/browser/referenceSearch/standaloneReferenceSearch.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.js"); -/* harmony import */ var _standalone_browser_toggleHighContrast_toggleHighContrast_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./standalone/browser/toggleHighContrast/toggleHighContrast.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.js"); -/* harmony import */ var _editor_api_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./editor.api.js */ "./include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js"); -/* harmony import */ var _editor_api_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_editor_api_js__WEBPACK_IMPORTED_MODULE_10__); -/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _editor_api_js__WEBPACK_IMPORTED_MODULE_10__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _editor_api_js__WEBPACK_IMPORTED_MODULE_10__[key]; }) }(__WEBPACK_IMPORT_KEY__)); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/editor.all.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/editor.all.js ***! - \****************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _browser_controller_coreCommands_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser/controller/coreCommands.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/controller/coreCommands.js"); -/* harmony import */ var _browser_widget_codeEditorWidget_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./browser/widget/codeEditorWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js"); -/* harmony import */ var _browser_widget_diffEditorWidget_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./browser/widget/diffEditorWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditorWidget.js"); -/* harmony import */ var _browser_widget_diffNavigator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./browser/widget/diffNavigator.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/diffNavigator.js"); -/* harmony import */ var _contrib_anchorSelect_anchorSelect_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./contrib/anchorSelect/anchorSelect.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/anchorSelect/anchorSelect.js"); -/* harmony import */ var _contrib_bracketMatching_bracketMatching_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contrib/bracketMatching/bracketMatching.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/bracketMatching/bracketMatching.js"); -/* harmony import */ var _contrib_caretOperations_caretOperations_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./contrib/caretOperations/caretOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/caretOperations/caretOperations.js"); -/* harmony import */ var _contrib_caretOperations_transpose_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./contrib/caretOperations/transpose.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/caretOperations/transpose.js"); -/* harmony import */ var _contrib_clipboard_clipboard_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./contrib/clipboard/clipboard.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/clipboard/clipboard.js"); -/* harmony import */ var _contrib_codeAction_codeActionContributions_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./contrib/codeAction/codeActionContributions.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/codeActionContributions.js"); -/* harmony import */ var _contrib_codelens_codelensController_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./contrib/codelens/codelensController.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/codelens/codelensController.js"); -/* harmony import */ var _contrib_colorPicker_colorDetector_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./contrib/colorPicker/colorDetector.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/colorPicker/colorDetector.js"); -/* harmony import */ var _contrib_comment_comment_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./contrib/comment/comment.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/comment/comment.js"); -/* harmony import */ var _contrib_contextmenu_contextmenu_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./contrib/contextmenu/contextmenu.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/contextmenu/contextmenu.js"); -/* harmony import */ var _contrib_cursorUndo_cursorUndo_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./contrib/cursorUndo/cursorUndo.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/cursorUndo/cursorUndo.js"); -/* harmony import */ var _contrib_dnd_dnd_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./contrib/dnd/dnd.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/dnd/dnd.js"); -/* harmony import */ var _contrib_find_findController_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./contrib/find/findController.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/find/findController.js"); -/* harmony import */ var _contrib_folding_folding_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./contrib/folding/folding.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/folding/folding.js"); -/* harmony import */ var _contrib_fontZoom_fontZoom_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./contrib/fontZoom/fontZoom.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/fontZoom/fontZoom.js"); -/* harmony import */ var _contrib_format_formatActions_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./contrib/format/formatActions.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/format/formatActions.js"); -/* harmony import */ var _contrib_gotoSymbol_documentSymbols_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./contrib/gotoSymbol/documentSymbols.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/documentSymbols.js"); -/* harmony import */ var _contrib_gotoSymbol_goToCommands_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./contrib/gotoSymbol/goToCommands.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/goToCommands.js"); -/* harmony import */ var _contrib_gotoSymbol_link_goToDefinitionAtPosition_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./contrib/gotoSymbol/link/goToDefinitionAtPosition.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/link/goToDefinitionAtPosition.js"); -/* harmony import */ var _contrib_gotoError_gotoError_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./contrib/gotoError/gotoError.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoError/gotoError.js"); -/* harmony import */ var _contrib_hover_hover_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./contrib/hover/hover.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/hover/hover.js"); -/* harmony import */ var _contrib_indentation_indentation_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./contrib/indentation/indentation.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/indentation/indentation.js"); -/* harmony import */ var _contrib_inPlaceReplace_inPlaceReplace_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./contrib/inPlaceReplace/inPlaceReplace.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/inPlaceReplace/inPlaceReplace.js"); -/* harmony import */ var _contrib_linesOperations_linesOperations_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./contrib/linesOperations/linesOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/linesOperations/linesOperations.js"); -/* harmony import */ var _contrib_links_links_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./contrib/links/links.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/links/links.js"); -/* harmony import */ var _contrib_multicursor_multicursor_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./contrib/multicursor/multicursor.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/multicursor/multicursor.js"); -/* harmony import */ var _contrib_parameterHints_parameterHints_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./contrib/parameterHints/parameterHints.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHints.js"); -/* harmony import */ var _contrib_rename_onTypeRename_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./contrib/rename/onTypeRename.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/rename/onTypeRename.js"); -/* harmony import */ var _contrib_rename_rename_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./contrib/rename/rename.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/rename/rename.js"); -/* harmony import */ var _contrib_smartSelect_smartSelect_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./contrib/smartSelect/smartSelect.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/smartSelect/smartSelect.js"); -/* harmony import */ var _contrib_snippet_snippetController2_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./contrib/snippet/snippetController2.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/snippet/snippetController2.js"); -/* harmony import */ var _contrib_suggest_suggestController_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./contrib/suggest/suggestController.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/suggest/suggestController.js"); -/* harmony import */ var _contrib_tokenization_tokenization_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./contrib/tokenization/tokenization.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/tokenization/tokenization.js"); -/* harmony import */ var _contrib_toggleTabFocusMode_toggleTabFocusMode_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./contrib/toggleTabFocusMode/toggleTabFocusMode.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode.js"); -/* harmony import */ var _contrib_unusualLineTerminators_unusualLineTerminators_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./contrib/unusualLineTerminators/unusualLineTerminators.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/unusualLineTerminators/unusualLineTerminators.js"); -/* harmony import */ var _contrib_viewportSemanticTokens_viewportSemanticTokens_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./contrib/viewportSemanticTokens/viewportSemanticTokens.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/viewportSemanticTokens/viewportSemanticTokens.js"); -/* harmony import */ var _contrib_wordHighlighter_wordHighlighter_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./contrib/wordHighlighter/wordHighlighter.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/wordHighlighter/wordHighlighter.js"); -/* harmony import */ var _contrib_wordOperations_wordOperations_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./contrib/wordOperations/wordOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/wordOperations/wordOperations.js"); -/* harmony import */ var _contrib_wordPartOperations_wordPartOperations_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./contrib/wordPartOperations/wordPartOperations.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/wordPartOperations/wordPartOperations.js"); -/* harmony import */ var _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./common/standaloneStrings.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js"); -/* harmony import */ var _base_browser_ui_codicons_codiconStyles_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ../base/browser/ui/codicons/codiconStyles.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codiconStyles.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// Load up these strings even in VSCode, even if they are not used -// in order to get them translated - - // The codicons are defined here and must be loaded - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/editor.api.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/editor.api.js ***! - \****************************************************************/ -/*! exports provided: CancellationTokenSource, Emitter, KeyCode, KeyMod, Position, Range, Selection, SelectionDirection, MarkerSeverity, MarkerTag, Uri, Token, editor, languages */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationTokenSource", function() { return CancellationTokenSource; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Emitter", function() { return Emitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCode", function() { return KeyCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyMod", function() { return KeyMod; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return Selection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionDirection", function() { return SelectionDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerSeverity", function() { return MarkerSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerTag", function() { return MarkerTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uri", function() { return Uri; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editor", function() { return editor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "languages", function() { return languages; }); -/* harmony import */ var _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common/config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _common_standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/standalone/standaloneBase.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js"); -/* harmony import */ var _standalone_browser_standaloneEditor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./standalone/browser/standaloneEditor.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneEditor.js"); -/* harmony import */ var _standalone_browser_standaloneLanguages_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./standalone/browser/standaloneLanguages.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneLanguages.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -const global = self; -// Set defaults for standalone editor -_common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_0__["EditorOptions"].wrappingIndent.defaultValue = 0 /* None */; -_common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_0__["EditorOptions"].glyphMargin.defaultValue = false; -_common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_0__["EditorOptions"].autoIndent.defaultValue = 3 /* Advanced */; -_common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_0__["EditorOptions"].overviewRulerLanes.defaultValue = 2; -const api = Object(_common_standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_1__["createMonacoBaseAPI"])(); -api.editor = Object(_standalone_browser_standaloneEditor_js__WEBPACK_IMPORTED_MODULE_2__["createMonacoEditorAPI"])(); -api.languages = Object(_standalone_browser_standaloneLanguages_js__WEBPACK_IMPORTED_MODULE_3__["createMonacoLanguagesAPI"])(); -const CancellationTokenSource = api.CancellationTokenSource; -const Emitter = api.Emitter; -const KeyCode = api.KeyCode; -const KeyMod = api.KeyMod; -const Position = api.Position; -const Range = api.Range; -const Selection = api.Selection; -const SelectionDirection = api.SelectionDirection; -const MarkerSeverity = api.MarkerSeverity; -const MarkerTag = api.MarkerTag; -const Uri = api.Uri; -const Token = api.Token; -const editor = api.editor; -const languages = api.languages; -global.monaco = api; -if (typeof global.require !== 'undefined' && typeof global.require.config === 'function') { - global.require.config({ - ignoreDuplicateModules: [ - 'vscode-languageserver-types', - 'vscode-languageserver-types/main', - 'vscode-languageserver-textdocument', - 'vscode-languageserver-textdocument/main', - 'vscode-nls', - 'vscode-nls/vscode-nls', - 'jsonc-parser', - 'jsonc-parser/main', - 'vscode-uri', - 'vscode-uri/index', - 'vs/basic-languages/typescript/typescript' - ] - }); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/editor.main.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/editor.main.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _language_typescript_monaco_contribution__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../language/typescript/monaco.contribution */ "./node_modules/monaco-editor/esm/vs/language/typescript/monaco.contribution.js"); -/* harmony import */ var _language_css_monaco_contribution__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../language/css/monaco.contribution */ "./node_modules/monaco-editor/esm/vs/language/css/monaco.contribution.js"); -/* harmony import */ var _language_json_monaco_contribution__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../language/json/monaco.contribution */ "./node_modules/monaco-editor/esm/vs/language/json/monaco.contribution.js"); -/* harmony import */ var _language_html_monaco_contribution__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../language/html/monaco.contribution */ "./node_modules/monaco-editor/esm/vs/language/html/monaco.contribution.js"); -/* harmony import */ var _basic_languages_monaco_contribution__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../basic-languages/monaco.contribution */ "./node_modules/monaco-editor/esm/vs/basic-languages/monaco.contribution.js"); -/* harmony import */ var _edcore_main__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./edcore.main */ "./node_modules/monaco-editor/esm/vs/editor/edcore.main.js"); -/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _edcore_main__WEBPACK_IMPORTED_MODULE_5__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _edcore_main__WEBPACK_IMPORTED_MODULE_5__[key]; }) }(__WEBPACK_IMPORT_KEY__)); - - - - - - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.css": -/*!*************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.css ***! - \*************************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_accessibilityHelp_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./accessibilityHelp.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.css"); -/* harmony import */ var _css_loader_dist_cjs_js_accessibilityHelp_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_accessibilityHelp_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_accessibilityHelp_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_accessibilityHelp_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.js": -/*!************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.js ***! - \************************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _accessibilityHelp_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./accessibilityHelp.css */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.css"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/browser/fastDomNode.js */ "./node_modules/monaco-editor/esm/vs/base/browser/fastDomNode.js"); -/* harmony import */ var _base_browser_formattedTextRenderer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../base/browser/formattedTextRenderer.js */ "./node_modules/monaco-editor/esm/vs/base/browser/formattedTextRenderer.js"); -/* harmony import */ var _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../base/browser/ui/aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/* harmony import */ var _base_browser_ui_widget_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../base/browser/ui/widget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/widget.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _contrib_toggleTabFocusMode_toggleTabFocusMode_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../contrib/toggleTabFocusMode/toggleTabFocusMode.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../../platform/opener/common/opener.js */ "./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../common/standaloneStrings.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - - - - - -const CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = new _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_13__["RawContextKey"]('accessibilityHelpWidgetVisible', false); -let AccessibilityHelpController = class AccessibilityHelpController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_6__["Disposable"] { - constructor(editor, instantiationService) { - super(); - this._editor = editor; - this._widget = this._register(instantiationService.createInstance(AccessibilityHelpWidget, this._editor)); - } - static get(editor) { - return editor.getContribution(AccessibilityHelpController.ID); - } - show() { - this._widget.show(); - } - hide() { - this._widget.hide(); - } -}; -AccessibilityHelpController.ID = 'editor.contrib.accessibilityHelpController'; -AccessibilityHelpController = __decorate([ - __param(1, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_14__["IInstantiationService"]) -], AccessibilityHelpController); -function getSelectionLabel(selections, charactersSelected) { - if (!selections || selections.length === 0) { - return _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].noSelection; - } - if (selections.length === 1) { - if (charactersSelected) { - return _base_common_strings_js__WEBPACK_IMPORTED_MODULE_8__["format"](_common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].singleSelectionRange, selections[0].positionLineNumber, selections[0].positionColumn, charactersSelected); - } - return _base_common_strings_js__WEBPACK_IMPORTED_MODULE_8__["format"](_common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].singleSelection, selections[0].positionLineNumber, selections[0].positionColumn); - } - if (charactersSelected) { - return _base_common_strings_js__WEBPACK_IMPORTED_MODULE_8__["format"](_common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].multiSelectionRange, selections.length, charactersSelected); - } - if (selections.length > 0) { - return _base_common_strings_js__WEBPACK_IMPORTED_MODULE_8__["format"](_common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].multiSelection, selections.length); - } - return ''; -} -let AccessibilityHelpWidget = class AccessibilityHelpWidget extends _base_browser_ui_widget_js__WEBPACK_IMPORTED_MODULE_5__["Widget"] { - constructor(editor, _contextKeyService, _keybindingService, _openerService) { - super(); - this._contextKeyService = _contextKeyService; - this._keybindingService = _keybindingService; - this._openerService = _openerService; - this._editor = editor; - this._isVisibleKey = CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE.bindTo(this._contextKeyService); - this._domNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('div')); - this._domNode.setClassName('accessibilityHelpWidget'); - this._domNode.setDisplay('none'); - this._domNode.setAttribute('role', 'dialog'); - this._domNode.setAttribute('aria-hidden', 'true'); - this._contentDomNode = Object(_base_browser_fastDomNode_js__WEBPACK_IMPORTED_MODULE_2__["createFastDomNode"])(document.createElement('div')); - this._contentDomNode.setAttribute('role', 'document'); - this._domNode.appendChild(this._contentDomNode); - this._isVisible = false; - this._register(this._editor.onDidLayoutChange(() => { - if (this._isVisible) { - this._layout(); - } - })); - // Intentionally not configurable! - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addStandardDisposableListener"](this._contentDomNode.domNode, 'keydown', (e) => { - if (!this._isVisible) { - return; - } - if (e.equals(2048 /* CtrlCmd */ | 35 /* KEY_E */)) { - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_4__["alert"])(_common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].emergencyConfOn); - this._editor.updateOptions({ - accessibilitySupport: 'on' - }); - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["clearNode"](this._contentDomNode.domNode); - this._buildContent(); - this._contentDomNode.domNode.focus(); - e.preventDefault(); - e.stopPropagation(); - } - if (e.equals(2048 /* CtrlCmd */ | 38 /* KEY_H */)) { - Object(_base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_4__["alert"])(_common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].openingDocs); - let url = this._editor.getRawOptions().accessibilityHelpUrl; - if (typeof url === 'undefined') { - url = 'https://go.microsoft.com/fwlink/?linkid=852450'; - } - this._openerService.open(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_9__["URI"].parse(url)); - e.preventDefault(); - e.stopPropagation(); - } - })); - this.onblur(this._contentDomNode.domNode, () => { - this.hide(); - }); - this._editor.addOverlayWidget(this); - } - dispose() { - this._editor.removeOverlayWidget(this); - super.dispose(); - } - getId() { - return AccessibilityHelpWidget.ID; - } - getDomNode() { - return this._domNode.domNode; - } - getPosition() { - return { - preference: null - }; - } - show() { - if (this._isVisible) { - return; - } - this._isVisible = true; - this._isVisibleKey.set(true); - this._layout(); - this._domNode.setDisplay('block'); - this._domNode.setAttribute('aria-hidden', 'false'); - this._contentDomNode.domNode.tabIndex = 0; - this._buildContent(); - this._contentDomNode.domNode.focus(); - } - _descriptionForCommand(commandId, msg, noKbMsg) { - let kb = this._keybindingService.lookupKeybinding(commandId); - if (kb) { - return _base_common_strings_js__WEBPACK_IMPORTED_MODULE_8__["format"](msg, kb.getAriaLabel()); - } - return _base_common_strings_js__WEBPACK_IMPORTED_MODULE_8__["format"](noKbMsg, commandId); - } - _buildContent() { - const options = this._editor.getOptions(); - const selections = this._editor.getSelections(); - let charactersSelected = 0; - if (selections) { - const model = this._editor.getModel(); - if (model) { - selections.forEach((selection) => { - charactersSelected += model.getValueLengthInRange(selection); - }); - } - } - let text = getSelectionLabel(selections, charactersSelected); - if (options.get(47 /* inDiffEditor */)) { - if (options.get(72 /* readOnly */)) { - text += _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].readonlyDiffEditor; - } - else { - text += _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].editableDiffEditor; - } - } - else { - if (options.get(72 /* readOnly */)) { - text += _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].readonlyEditor; - } - else { - text += _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].editableEditor; - } - } - const turnOnMessage = (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_7__["isMacintosh"] - ? _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].changeConfigToOnMac - : _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].changeConfigToOnWinLinux); - switch (options.get(2 /* accessibilitySupport */)) { - case 0 /* Unknown */: - text += '\n\n - ' + turnOnMessage; - break; - case 2 /* Enabled */: - text += '\n\n - ' + _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].auto_on; - break; - case 1 /* Disabled */: - text += '\n\n - ' + _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].auto_off; - text += ' ' + turnOnMessage; - break; - } - if (options.get(116 /* tabFocusMode */)) { - text += '\n\n - ' + this._descriptionForCommand(_contrib_toggleTabFocusMode_toggleTabFocusMode_js__WEBPACK_IMPORTED_MODULE_12__["ToggleTabFocusModeAction"].ID, _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].tabFocusModeOnMsg, _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].tabFocusModeOnMsgNoKb); - } - else { - text += '\n\n - ' + this._descriptionForCommand(_contrib_toggleTabFocusMode_toggleTabFocusMode_js__WEBPACK_IMPORTED_MODULE_12__["ToggleTabFocusModeAction"].ID, _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].tabFocusModeOffMsg, _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].tabFocusModeOffMsgNoKb); - } - const openDocMessage = (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_7__["isMacintosh"] - ? _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].openDocMac - : _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].openDocWinLinux); - text += '\n\n - ' + openDocMessage; - text += '\n\n' + _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].outroMsg; - this._contentDomNode.domNode.appendChild(Object(_base_browser_formattedTextRenderer_js__WEBPACK_IMPORTED_MODULE_3__["renderFormattedText"])(text)); - // Per https://www.w3.org/TR/wai-aria/roles#document, Authors SHOULD provide a title or label for documents - this._contentDomNode.domNode.setAttribute('aria-label', text); - } - hide() { - if (!this._isVisible) { - return; - } - this._isVisible = false; - this._isVisibleKey.reset(); - this._domNode.setDisplay('none'); - this._domNode.setAttribute('aria-hidden', 'true'); - this._contentDomNode.domNode.tabIndex = -1; - _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["clearNode"](this._contentDomNode.domNode); - this._editor.focus(); - } - _layout() { - let editorLayout = this._editor.getLayoutInfo(); - let w = Math.max(5, Math.min(AccessibilityHelpWidget.WIDTH, editorLayout.width - 40)); - let h = Math.max(5, Math.min(AccessibilityHelpWidget.HEIGHT, editorLayout.height - 40)); - this._domNode.setWidth(w); - this._domNode.setHeight(h); - let top = Math.round((editorLayout.height - h) / 2); - this._domNode.setTop(top); - let left = Math.round((editorLayout.width - w) / 2); - this._domNode.setLeft(left); - } -}; -AccessibilityHelpWidget.ID = 'editor.contrib.accessibilityHelpWidget'; -AccessibilityHelpWidget.WIDTH = 500; -AccessibilityHelpWidget.HEIGHT = 300; -AccessibilityHelpWidget = __decorate([ - __param(1, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_13__["IContextKeyService"]), - __param(2, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_15__["IKeybindingService"]), - __param(3, _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_16__["IOpenerService"]) -], AccessibilityHelpWidget); -class ShowAccessibilityHelpAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_10__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.showAccessibilityHelp', - label: _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["AccessibilityHelpNLS"].showAccessibilityHelpAction, - alias: 'Show Accessibility Help', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].focus, - primary: 512 /* Alt */ | 59 /* F1 */, - weight: 100 /* EditorContrib */, - linux: { - primary: 512 /* Alt */ | 1024 /* Shift */ | 59 /* F1 */, - secondary: [512 /* Alt */ | 59 /* F1 */] - } - } - }); - } - run(accessor, editor) { - let controller = AccessibilityHelpController.get(editor); - if (controller) { - controller.show(); - } - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_10__["registerEditorContribution"])(AccessibilityHelpController.ID, AccessibilityHelpController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_10__["registerEditorAction"])(ShowAccessibilityHelpAction); -const AccessibilityHelpCommand = _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_10__["EditorCommand"].bindToContribution(AccessibilityHelpController.get); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_10__["registerEditorCommand"])(new AccessibilityHelpCommand({ - id: 'closeAccessibilityHelp', - precondition: CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE, - handler: x => x.hide(), - kbOpts: { - weight: 100 /* EditorContrib */ + 100, - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_11__["EditorContextKeys"].focus, - primary: 9 /* Escape */, - secondary: [1024 /* Shift */ | 9 /* Escape */] - } -})); -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_18__["registerThemingParticipant"])((theme, collector) => { - const widgetBackground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_17__["editorWidgetBackground"]); - if (widgetBackground) { - collector.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${widgetBackground}; }`); - } - const widgetForeground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_17__["editorWidgetForeground"]); - if (widgetForeground) { - collector.addRule(`.monaco-editor .accessibilityHelpWidget { color: ${widgetForeground}; }`); - } - const widgetShadowColor = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_17__["widgetShadow"]); - if (widgetShadowColor) { - collector.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`); - } - const hcBorder = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_17__["contrastBorder"]); - if (hcBorder) { - collector.addRule(`.monaco-editor .accessibilityHelpWidget { border: 2px solid ${hcBorder}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/colorizer.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/colorizer.js ***! - \**********************************************************************************/ -/*! exports provided: Colorizer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Colorizer", function() { return Colorizer; }); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _common_core_lineTokens_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/lineTokens.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/lineTokens.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/viewLayout/viewLineRenderer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewLayout/viewLineRenderer.js"); -/* harmony import */ var _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/viewModel/viewModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModel.js"); -/* harmony import */ var _common_monarch_monarchLexer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/monarch/monarchLexer.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchLexer.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -class Colorizer { - static colorizeElement(themeService, modeService, domNode, options) { - options = options || {}; - let theme = options.theme || 'vs'; - let mimeType = options.mimeType || domNode.getAttribute('lang') || domNode.getAttribute('data-lang'); - if (!mimeType) { - console.error('Mode not detected'); - return Promise.resolve(); - } - themeService.setTheme(theme); - let text = domNode.firstChild ? domNode.firstChild.nodeValue : ''; - domNode.className += ' ' + theme; - let render = (str) => { - domNode.innerHTML = str; - }; - return this.colorize(modeService, text || '', mimeType, options).then(render, (err) => console.error(err)); - } - static colorize(modeService, text, mimeType, options) { - let tabSize = 4; - if (options && typeof options.tabSize === 'number') { - tabSize = options.tabSize; - } - if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["startsWithUTF8BOM"](text)) { - text = text.substr(1); - } - let lines = text.split(/\r\n|\r|\n/); - let language = modeService.getModeId(mimeType); - if (!language) { - return Promise.resolve(_fakeColorize(lines, tabSize)); - } - // Send out the event to create the mode - modeService.triggerMode(language); - const tokenizationSupport = _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["TokenizationRegistry"].get(language); - if (tokenizationSupport) { - return _colorize(lines, tabSize, tokenizationSupport); - } - const tokenizationSupportPromise = _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["TokenizationRegistry"].getPromise(language); - if (tokenizationSupportPromise) { - // A tokenizer will be registered soon - return new Promise((resolve, reject) => { - tokenizationSupportPromise.then(tokenizationSupport => { - _colorize(lines, tabSize, tokenizationSupport).then(resolve, reject); - }, reject); - }); - } - return new Promise((resolve, reject) => { - let listener = null; - let timeout = null; - const execute = () => { - if (listener) { - listener.dispose(); - listener = null; - } - if (timeout) { - timeout.dispose(); - timeout = null; - } - const tokenizationSupport = _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["TokenizationRegistry"].get(language); - if (tokenizationSupport) { - _colorize(lines, tabSize, tokenizationSupport).then(resolve, reject); - return; - } - resolve(_fakeColorize(lines, tabSize)); - }; - // wait 500ms for mode to load, then give up - timeout = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_0__["TimeoutTimer"](); - timeout.cancelAndSet(execute, 500); - listener = _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["TokenizationRegistry"].onDidChange((e) => { - if (e.changedLanguages.indexOf(language) >= 0) { - execute(); - } - }); - }); - } - static colorizeLine(line, mightContainNonBasicASCII, mightContainRTL, tokens, tabSize = 4) { - const isBasicASCII = _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_5__["ViewLineRenderingData"].isBasicASCII(line, mightContainNonBasicASCII); - const containsRTL = _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_5__["ViewLineRenderingData"].containsRTL(line, isBasicASCII, mightContainRTL); - let renderResult = Object(_common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_4__["renderViewLine2"])(new _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_4__["RenderLineInput"](false, true, line, false, isBasicASCII, containsRTL, 0, tokens, [], tabSize, 0, 0, 0, 0, -1, 'none', false, false, null)); - return renderResult.html; - } - static colorizeModelLine(model, lineNumber, tabSize = 4) { - let content = model.getLineContent(lineNumber); - model.forceTokenization(lineNumber); - let tokens = model.getLineTokens(lineNumber); - let inflatedTokens = tokens.inflate(); - return this.colorizeLine(content, model.mightContainNonBasicASCII(), model.mightContainRTL(), inflatedTokens, tabSize); - } -} -function _colorize(lines, tabSize, tokenizationSupport) { - return new Promise((c, e) => { - const execute = () => { - const result = _actualColorize(lines, tabSize, tokenizationSupport); - if (tokenizationSupport instanceof _common_monarch_monarchLexer_js__WEBPACK_IMPORTED_MODULE_6__["MonarchTokenizer"]) { - const status = tokenizationSupport.getLoadStatus(); - if (status.loaded === false) { - status.promise.then(execute, e); - return; - } - } - c(result); - }; - execute(); - }); -} -function _fakeColorize(lines, tabSize) { - let html = []; - const defaultMetadata = ((0 /* None */ << 11 /* FONT_STYLE_OFFSET */) - | (1 /* DefaultForeground */ << 14 /* FOREGROUND_OFFSET */) - | (2 /* DefaultBackground */ << 23 /* BACKGROUND_OFFSET */)) >>> 0; - const tokens = new Uint32Array(2); - tokens[0] = 0; - tokens[1] = defaultMetadata; - for (let i = 0, length = lines.length; i < length; i++) { - let line = lines[i]; - tokens[0] = line.length; - const lineTokens = new _common_core_lineTokens_js__WEBPACK_IMPORTED_MODULE_2__["LineTokens"](tokens, line); - const isBasicASCII = _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_5__["ViewLineRenderingData"].isBasicASCII(line, /* check for basic ASCII */ true); - const containsRTL = _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_5__["ViewLineRenderingData"].containsRTL(line, isBasicASCII, /* check for RTL */ true); - let renderResult = Object(_common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_4__["renderViewLine2"])(new _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_4__["RenderLineInput"](false, true, line, false, isBasicASCII, containsRTL, 0, lineTokens, [], tabSize, 0, 0, 0, 0, -1, 'none', false, false, null)); - html = html.concat(renderResult.html); - html.push('
    '); - } - return html.join(''); -} -function _actualColorize(lines, tabSize, tokenizationSupport) { - let html = []; - let state = tokenizationSupport.getInitialState(); - for (let i = 0, length = lines.length; i < length; i++) { - let line = lines[i]; - let tokenizeResult = tokenizationSupport.tokenize2(line, state, 0); - _common_core_lineTokens_js__WEBPACK_IMPORTED_MODULE_2__["LineTokens"].convertToEndOffset(tokenizeResult.tokens, line.length); - let lineTokens = new _common_core_lineTokens_js__WEBPACK_IMPORTED_MODULE_2__["LineTokens"](tokenizeResult.tokens, line); - const isBasicASCII = _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_5__["ViewLineRenderingData"].isBasicASCII(line, /* check for basic ASCII */ true); - const containsRTL = _common_viewModel_viewModel_js__WEBPACK_IMPORTED_MODULE_5__["ViewLineRenderingData"].containsRTL(line, isBasicASCII, /* check for RTL */ true); - let renderResult = Object(_common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_4__["renderViewLine2"])(new _common_viewLayout_viewLineRenderer_js__WEBPACK_IMPORTED_MODULE_4__["RenderLineInput"](false, true, line, false, isBasicASCII, containsRTL, 0, lineTokens.inflate(), [], tabSize, 0, 0, 0, 0, -1, 'none', false, false, null)); - html = html.concat(renderResult.html); - html.push('
    '); - state = tokenizeResult.endState; - } - return html.join(''); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.css": -/*!***********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.css ***! - \***********************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_iPadShowKeyboard_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./iPadShowKeyboard.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.css"); -/* harmony import */ var _css_loader_dist_cjs_js_iPadShowKeyboard_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_iPadShowKeyboard_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_iPadShowKeyboard_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_iPadShowKeyboard_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js ***! - \**********************************************************************************************************/ -/*! exports provided: IPadShowKeyboard */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IPadShowKeyboard", function() { return IPadShowKeyboard; }); -/* harmony import */ var _iPadShowKeyboard_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iPadShowKeyboard.css */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.css"); -/* harmony import */ var _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/browser.js */ "./node_modules/monaco-editor/esm/vs/base/browser/browser.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -class IPadShowKeyboard extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(editor) { - super(); - this.editor = editor; - this.widget = null; - if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_1__["isIPad"]) { - this._register(editor.onDidChangeConfiguration(() => this.update())); - this.update(); - } - } - update() { - const shouldHaveWidget = (!this.editor.getOption(72 /* readOnly */)); - if (!this.widget && shouldHaveWidget) { - this.widget = new ShowKeyboardWidget(this.editor); - } - else if (this.widget && !shouldHaveWidget) { - this.widget.dispose(); - this.widget = null; - } - } - dispose() { - super.dispose(); - if (this.widget) { - this.widget.dispose(); - this.widget = null; - } - } -} -IPadShowKeyboard.ID = 'editor.contrib.iPadShowKeyboard'; -class ShowKeyboardWidget extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(editor) { - super(); - this.editor = editor; - this._domNode = document.createElement('textarea'); - this._domNode.className = 'iPadShowKeyboard'; - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](this._domNode, 'touchstart', (e) => { - this.editor.focus(); - })); - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_2__["addDisposableListener"](this._domNode, 'focus', (e) => { - this.editor.focus(); - })); - this.editor.addOverlayWidget(this); - } - dispose() { - this.editor.removeOverlayWidget(this); - super.dispose(); - } - // ----- IOverlayWidget API - getId() { - return ShowKeyboardWidget.ID; - } - getDomNode() { - return this._domNode; - } - getPosition() { - return { - preference: 1 /* BOTTOM_RIGHT_CORNER */ - }; - } -} -ShowKeyboardWidget.ID = 'editor.contrib.ShowKeyboardWidget'; -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorContribution"])(IPadShowKeyboard.ID, IPadShowKeyboard); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.css": -/*!*****************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.css ***! - \*****************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_inspectTokens_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./inspectTokens.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.css"); -/* harmony import */ var _css_loader_dist_cjs_js_inspectTokens_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_inspectTokens_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_inspectTokens_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_inspectTokens_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.js": -/*!****************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.js ***! - \****************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _inspectTokens_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./inspectTokens.css */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.css"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_modes_nullMode_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/modes/nullMode.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/nullMode.js"); -/* harmony import */ var _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../common/services/modeService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modeService.js"); -/* harmony import */ var _common_standaloneThemeService_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/standaloneThemeService.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/standaloneThemeService.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../common/standaloneStrings.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - -let InspectTokensController = class InspectTokensController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(editor, standaloneColorService, modeService) { - super(); - this._editor = editor; - this._modeService = modeService; - this._widget = null; - this._register(this._editor.onDidChangeModel((e) => this.stop())); - this._register(this._editor.onDidChangeModelLanguage((e) => this.stop())); - this._register(_common_modes_js__WEBPACK_IMPORTED_MODULE_5__["TokenizationRegistry"].onDidChange((e) => this.stop())); - this._register(this._editor.onKeyUp((e) => e.keyCode === 9 /* Escape */ && this.stop())); - } - static get(editor) { - return editor.getContribution(InspectTokensController.ID); - } - dispose() { - this.stop(); - super.dispose(); - } - launch() { - if (this._widget) { - return; - } - if (!this._editor.hasModel()) { - return; - } - this._widget = new InspectTokensWidget(this._editor, this._modeService); - } - stop() { - if (this._widget) { - this._widget.dispose(); - this._widget = null; - } - } -}; -InspectTokensController.ID = 'editor.contrib.inspectTokens'; -InspectTokensController = __decorate([ - __param(1, _common_standaloneThemeService_js__WEBPACK_IMPORTED_MODULE_8__["IStandaloneThemeService"]), - __param(2, _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_7__["IModeService"]) -], InspectTokensController); -class InspectTokens extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.inspectTokens', - label: _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_11__["InspectTokensNLS"].inspectTokensAction, - alias: 'Developer: Inspect Tokens', - precondition: undefined - }); - } - run(accessor, editor) { - let controller = InspectTokensController.get(editor); - if (controller) { - controller.launch(); - } - } -} -function renderTokenText(tokenText) { - let result = ''; - for (let charIndex = 0, len = tokenText.length; charIndex < len; charIndex++) { - let charCode = tokenText.charCodeAt(charIndex); - switch (charCode) { - case 9 /* Tab */: - result += '\u2192'; // → - break; - case 32 /* Space */: - result += '\u00B7'; // · - break; - default: - result += String.fromCharCode(charCode); - } - } - return result; -} -function getSafeTokenizationSupport(languageIdentifier) { - let tokenizationSupport = _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["TokenizationRegistry"].get(languageIdentifier.language); - if (tokenizationSupport) { - return tokenizationSupport; - } - return { - getInitialState: () => _common_modes_nullMode_js__WEBPACK_IMPORTED_MODULE_6__["NULL_STATE"], - tokenize: (line, state, deltaOffset) => Object(_common_modes_nullMode_js__WEBPACK_IMPORTED_MODULE_6__["nullTokenize"])(languageIdentifier.language, line, state, deltaOffset), - tokenize2: (line, state, deltaOffset) => Object(_common_modes_nullMode_js__WEBPACK_IMPORTED_MODULE_6__["nullTokenize2"])(languageIdentifier.id, line, state, deltaOffset) - }; -} -class InspectTokensWidget extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_3__["Disposable"] { - constructor(editor, modeService) { - super(); - // Editor.IContentWidget.allowEditorOverflow - this.allowEditorOverflow = true; - this._editor = editor; - this._modeService = modeService; - this._model = this._editor.getModel(); - this._domNode = document.createElement('div'); - this._domNode.className = 'tokens-inspect-widget'; - this._tokenizationSupport = getSafeTokenizationSupport(this._model.getLanguageIdentifier()); - this._compute(this._editor.getPosition()); - this._register(this._editor.onDidChangeCursorPosition((e) => this._compute(this._editor.getPosition()))); - this._editor.addContentWidget(this); - } - dispose() { - this._editor.removeContentWidget(this); - super.dispose(); - } - getId() { - return InspectTokensWidget._ID; - } - _compute(position) { - let data = this._getTokensAtLine(position.lineNumber); - let token1Index = 0; - for (let i = data.tokens1.length - 1; i >= 0; i--) { - let t = data.tokens1[i]; - if (position.column - 1 >= t.offset) { - token1Index = i; - break; - } - } - let token2Index = 0; - for (let i = (data.tokens2.length >>> 1); i >= 0; i--) { - if (position.column - 1 >= data.tokens2[(i << 1)]) { - token2Index = i; - break; - } - } - let lineContent = this._model.getLineContent(position.lineNumber); - let tokenText = ''; - if (token1Index < data.tokens1.length) { - let tokenStartIndex = data.tokens1[token1Index].offset; - let tokenEndIndex = token1Index + 1 < data.tokens1.length ? data.tokens1[token1Index + 1].offset : lineContent.length; - tokenText = lineContent.substring(tokenStartIndex, tokenEndIndex); - } - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["reset"])(this._domNode, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('h2.tm-token', undefined, renderTokenText(tokenText), Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('span.tm-token-length', undefined, `${tokenText.length} ${tokenText.length === 1 ? 'char' : 'chars'}`))); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"])(this._domNode, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('hr.tokens-inspect-separator', { 'style': 'clear:both' })); - const metadata = (token2Index << 1) + 1 < data.tokens2.length ? this._decodeMetadata(data.tokens2[(token2Index << 1) + 1]) : null; - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"])(this._domNode, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('table.tm-metadata-table', undefined, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('tbody', undefined, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('tr', undefined, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('td.tm-metadata-key', undefined, 'language'), Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('td.tm-metadata-value', undefined, `${metadata ? metadata.languageIdentifier.language : '-?-'}`)), Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('tr', undefined, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('td.tm-metadata-key', undefined, 'token type'), Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('td.tm-metadata-value', undefined, `${metadata ? this._tokenTypeToString(metadata.tokenType) : '-?-'}`)), Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('tr', undefined, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('td.tm-metadata-key', undefined, 'font style'), Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('td.tm-metadata-value', undefined, `${metadata ? this._fontStyleToString(metadata.fontStyle) : '-?-'}`)), Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('tr', undefined, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('td.tm-metadata-key', undefined, 'foreground'), Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('td.tm-metadata-value', undefined, `${metadata ? _base_common_color_js__WEBPACK_IMPORTED_MODULE_2__["Color"].Format.CSS.formatHex(metadata.foreground) : '-?-'}`)), Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('tr', undefined, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('td.tm-metadata-key', undefined, 'background'), Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('td.tm-metadata-value', undefined, `${metadata ? _base_common_color_js__WEBPACK_IMPORTED_MODULE_2__["Color"].Format.CSS.formatHex(metadata.background) : '-?-'}`))))); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"])(this._domNode, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('hr.tokens-inspect-separator')); - if (token1Index < data.tokens1.length) { - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["append"])(this._domNode, Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["$"])('span.tm-token-type', undefined, data.tokens1[token1Index].type)); - } - this._editor.layoutContentWidget(this); - } - _decodeMetadata(metadata) { - let colorMap = _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["TokenizationRegistry"].getColorMap(); - let languageId = _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["TokenMetadata"].getLanguageId(metadata); - let tokenType = _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["TokenMetadata"].getTokenType(metadata); - let fontStyle = _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["TokenMetadata"].getFontStyle(metadata); - let foreground = _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["TokenMetadata"].getForeground(metadata); - let background = _common_modes_js__WEBPACK_IMPORTED_MODULE_5__["TokenMetadata"].getBackground(metadata); - return { - languageIdentifier: this._modeService.getLanguageIdentifier(languageId), - tokenType: tokenType, - fontStyle: fontStyle, - foreground: colorMap[foreground], - background: colorMap[background] - }; - } - _tokenTypeToString(tokenType) { - switch (tokenType) { - case 0 /* Other */: return 'Other'; - case 1 /* Comment */: return 'Comment'; - case 2 /* String */: return 'String'; - case 4 /* RegEx */: return 'RegEx'; - default: return '??'; - } - } - _fontStyleToString(fontStyle) { - let r = ''; - if (fontStyle & 1 /* Italic */) { - r += 'italic '; - } - if (fontStyle & 2 /* Bold */) { - r += 'bold '; - } - if (fontStyle & 4 /* Underline */) { - r += 'underline '; - } - if (r.length === 0) { - r = '---'; - } - return r; - } - _getTokensAtLine(lineNumber) { - let stateBeforeLine = this._getStateBeforeLine(lineNumber); - let tokenizationResult1 = this._tokenizationSupport.tokenize(this._model.getLineContent(lineNumber), stateBeforeLine, 0); - let tokenizationResult2 = this._tokenizationSupport.tokenize2(this._model.getLineContent(lineNumber), stateBeforeLine, 0); - return { - startState: stateBeforeLine, - tokens1: tokenizationResult1.tokens, - tokens2: tokenizationResult2.tokens, - endState: tokenizationResult1.endState - }; - } - _getStateBeforeLine(lineNumber) { - let state = this._tokenizationSupport.getInitialState(); - for (let i = 1; i < lineNumber; i++) { - let tokenizationResult = this._tokenizationSupport.tokenize(this._model.getLineContent(i), state, 0); - state = tokenizationResult.endState; - } - return state; - } - getDomNode() { - return this._domNode; - } - getPosition() { - return { - position: this._editor.getPosition(), - preference: [2 /* BELOW */, 1 /* ABOVE */] - }; - } -} -InspectTokensWidget._ID = 'editor.contrib.inspectTokensWidget'; -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorContribution"])(InspectTokensController.ID, InspectTokensController); -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_4__["registerEditorAction"])(InspectTokens); -Object(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_10__["registerThemingParticipant"])((theme, collector) => { - const border = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__["editorHoverBorder"]); - if (border) { - let borderWidth = theme.type === _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_10__["HIGH_CONTRAST"] ? 2 : 1; - collector.addRule(`.monaco-editor .tokens-inspect-widget { border: ${borderWidth}px solid ${border}; }`); - collector.addRule(`.monaco-editor .tokens-inspect-widget .tokens-inspect-separator { background-color: ${border}; }`); - } - const background = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__["editorHoverBackground"]); - if (background) { - collector.addRule(`.monaco-editor .tokens-inspect-widget { background-color: ${background}; }`); - } - const foreground = theme.getColor(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_9__["editorHoverForeground"]); - if (foreground) { - collector.addRule(`.monaco-editor .tokens-inspect-widget { color: ${foreground}; }`); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js": -/*!******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js ***! - \******************************************************************************************************************/ -/*! exports provided: StandaloneCommandsQuickAccessProvider, GotoLineAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneCommandsQuickAccessProvider", function() { return StandaloneCommandsQuickAccessProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GotoLineAction", function() { return GotoLineAction; }); -/* harmony import */ var _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../platform/registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _platform_quickinput_common_quickAccess_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../platform/quickinput/common/quickAccess.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js"); -/* harmony import */ var _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/standaloneStrings.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _contrib_quickAccess_commandsQuickAccess_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../contrib/quickAccess/commandsQuickAccess.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/commandsQuickAccess.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../platform/telemetry/common/telemetry.js */ "./node_modules/monaco-editor/esm/vs/platform/telemetry/common/telemetry.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _platform_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../platform/quickinput/common/quickInput.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickInput.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - -let StandaloneCommandsQuickAccessProvider = class StandaloneCommandsQuickAccessProvider extends _contrib_quickAccess_commandsQuickAccess_js__WEBPACK_IMPORTED_MODULE_4__["AbstractEditorCommandsQuickAccessProvider"] { - constructor(instantiationService, codeEditorService, keybindingService, commandService, telemetryService, notificationService) { - super({ showAlias: false }, instantiationService, keybindingService, commandService, telemetryService, notificationService); - this.codeEditorService = codeEditorService; - } - get activeTextEditorControl() { return Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_5__["withNullAsUndefined"])(this.codeEditorService.getFocusedCodeEditor()); } - getCommandPicks() { - return __awaiter(this, void 0, void 0, function* () { - return this.getCodeEditorCommandPicks(); - }); - } -}; -StandaloneCommandsQuickAccessProvider = __decorate([ - __param(0, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_6__["IInstantiationService"]), - __param(1, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__["ICodeEditorService"]), - __param(2, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_7__["IKeybindingService"]), - __param(3, _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_8__["ICommandService"]), - __param(4, _platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_9__["ITelemetryService"]), - __param(5, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_10__["INotificationService"]) -], StandaloneCommandsQuickAccessProvider); - -_platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__["Registry"].as(_platform_quickinput_common_quickAccess_js__WEBPACK_IMPORTED_MODULE_1__["Extensions"].Quickaccess).registerQuickAccessProvider({ - ctor: StandaloneCommandsQuickAccessProvider, - prefix: StandaloneCommandsQuickAccessProvider.PREFIX, - helpEntries: [{ description: _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_2__["QuickCommandNLS"].quickCommandHelp, needsEditor: true }] -}); -class GotoLineAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_11__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.quickCommand', - label: _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_2__["QuickCommandNLS"].quickCommandActionLabel, - alias: 'Command Palette', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_12__["EditorContextKeys"].focus, - primary: 59 /* F1 */, - weight: 100 /* EditorContrib */ - }, - contextMenuOpts: { - group: 'z_commands', - order: 1 - } - }); - } - run(accessor) { - accessor.get(_platform_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_13__["IQuickInputService"]).quickAccess.show(StandaloneCommandsQuickAccessProvider.PREFIX); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_11__["registerEditorAction"])(GotoLineAction); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js": -/*!******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js ***! - \******************************************************************************************************************/ -/*! exports provided: StandaloneGotoLineQuickAccessProvider, GotoLineAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneGotoLineQuickAccessProvider", function() { return StandaloneGotoLineQuickAccessProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GotoLineAction", function() { return GotoLineAction; }); -/* harmony import */ var _contrib_quickAccess_gotoLineQuickAccess_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../contrib/quickAccess/gotoLineQuickAccess.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/gotoLineQuickAccess.js"); -/* harmony import */ var _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../platform/registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _platform_quickinput_common_quickAccess_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../platform/quickinput/common/quickAccess.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/standaloneStrings.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _platform_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../platform/quickinput/common/quickInput.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickInput.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - -let StandaloneGotoLineQuickAccessProvider = class StandaloneGotoLineQuickAccessProvider extends _contrib_quickAccess_gotoLineQuickAccess_js__WEBPACK_IMPORTED_MODULE_0__["AbstractGotoLineQuickAccessProvider"] { - constructor(editorService) { - super(); - this.editorService = editorService; - this.onDidActiveTextEditorControlChange = _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__["Event"].None; - } - get activeTextEditorControl() { - return Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_4__["withNullAsUndefined"])(this.editorService.getFocusedCodeEditor()); - } -}; -StandaloneGotoLineQuickAccessProvider = __decorate([ - __param(0, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__["ICodeEditorService"]) -], StandaloneGotoLineQuickAccessProvider); - -_platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["Registry"].as(_platform_quickinput_common_quickAccess_js__WEBPACK_IMPORTED_MODULE_2__["Extensions"].Quickaccess).registerQuickAccessProvider({ - ctor: StandaloneGotoLineQuickAccessProvider, - prefix: StandaloneGotoLineQuickAccessProvider.PREFIX, - helpEntries: [{ description: _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_5__["GoToLineNLS"].gotoLineActionLabel, needsEditor: true }] -}); -class GotoLineAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.gotoLine', - label: _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_5__["GoToLineNLS"].gotoLineActionLabel, - alias: 'Go to Line/Column...', - precondition: undefined, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].focus, - primary: 2048 /* CtrlCmd */ | 37 /* KEY_G */, - mac: { primary: 256 /* WinCtrl */ | 37 /* KEY_G */ }, - weight: 100 /* EditorContrib */ - } - }); - } - run(accessor) { - accessor.get(_platform_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_9__["IQuickInputService"]).quickAccess.show(StandaloneGotoLineQuickAccessProvider.PREFIX); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorAction"])(GotoLineAction); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js": -/*!********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js ***! - \********************************************************************************************************************/ -/*! exports provided: StandaloneGotoSymbolQuickAccessProvider, GotoLineAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneGotoSymbolQuickAccessProvider", function() { return StandaloneGotoSymbolQuickAccessProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GotoLineAction", function() { return GotoLineAction; }); -/* harmony import */ var _contrib_quickAccess_gotoSymbolQuickAccess_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../contrib/quickAccess/gotoSymbolQuickAccess.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/quickAccess/gotoSymbolQuickAccess.js"); -/* harmony import */ var _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../platform/registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _platform_quickinput_common_quickAccess_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../platform/quickinput/common/quickAccess.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/standaloneStrings.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/editorContextKeys.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorContextKeys.js"); -/* harmony import */ var _platform_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../platform/quickinput/common/quickInput.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickInput.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - -let StandaloneGotoSymbolQuickAccessProvider = class StandaloneGotoSymbolQuickAccessProvider extends _contrib_quickAccess_gotoSymbolQuickAccess_js__WEBPACK_IMPORTED_MODULE_0__["AbstractGotoSymbolQuickAccessProvider"] { - constructor(editorService) { - super(); - this.editorService = editorService; - this.onDidActiveTextEditorControlChange = _base_common_event_js__WEBPACK_IMPORTED_MODULE_6__["Event"].None; - } - get activeTextEditorControl() { - return Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_4__["withNullAsUndefined"])(this.editorService.getFocusedCodeEditor()); - } -}; -StandaloneGotoSymbolQuickAccessProvider = __decorate([ - __param(0, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_3__["ICodeEditorService"]) -], StandaloneGotoSymbolQuickAccessProvider); - -_platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["Registry"].as(_platform_quickinput_common_quickAccess_js__WEBPACK_IMPORTED_MODULE_2__["Extensions"].Quickaccess).registerQuickAccessProvider({ - ctor: StandaloneGotoSymbolQuickAccessProvider, - prefix: _contrib_quickAccess_gotoSymbolQuickAccess_js__WEBPACK_IMPORTED_MODULE_0__["AbstractGotoSymbolQuickAccessProvider"].PREFIX, - helpEntries: [ - { description: _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_5__["QuickOutlineNLS"].quickOutlineActionLabel, prefix: _contrib_quickAccess_gotoSymbolQuickAccess_js__WEBPACK_IMPORTED_MODULE_0__["AbstractGotoSymbolQuickAccessProvider"].PREFIX, needsEditor: true }, - { description: _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_5__["QuickOutlineNLS"].quickOutlineByCategoryActionLabel, prefix: _contrib_quickAccess_gotoSymbolQuickAccess_js__WEBPACK_IMPORTED_MODULE_0__["AbstractGotoSymbolQuickAccessProvider"].PREFIX_BY_CATEGORY, needsEditor: true } - ] -}); -class GotoLineAction extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.quickOutline', - label: _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_5__["QuickOutlineNLS"].quickOutlineActionLabel, - alias: 'Go to Symbol...', - precondition: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].hasDocumentSymbolProvider, - kbOpts: { - kbExpr: _common_editorContextKeys_js__WEBPACK_IMPORTED_MODULE_8__["EditorContextKeys"].focus, - primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 45 /* KEY_O */, - weight: 100 /* EditorContrib */ - }, - contextMenuOpts: { - group: 'navigation', - order: 3 - } - }); - } - run(accessor) { - accessor.get(_platform_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_9__["IQuickInputService"]).quickAccess.show(_contrib_quickAccess_gotoSymbolQuickAccess_js__WEBPACK_IMPORTED_MODULE_0__["AbstractGotoSymbolQuickAccessProvider"].PREFIX); - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_7__["registerEditorAction"])(GotoLineAction); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js": -/*!**************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js ***! - \**************************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../platform/registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _platform_quickinput_common_quickAccess_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../platform/quickinput/common/quickAccess.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js"); -/* harmony import */ var _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/standaloneStrings.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js"); -/* harmony import */ var _platform_quickinput_browser_helpQuickAccess_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../platform/quickinput/browser/helpQuickAccess.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/helpQuickAccess.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -_platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__["Registry"].as(_platform_quickinput_common_quickAccess_js__WEBPACK_IMPORTED_MODULE_1__["Extensions"].Quickaccess).registerQuickAccessProvider({ - ctor: _platform_quickinput_browser_helpQuickAccess_js__WEBPACK_IMPORTED_MODULE_3__["HelpQuickAccessProvider"], - prefix: '', - helpEntries: [{ description: _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_2__["QuickHelpNLS"].helpQuickAccessActionLabel, needsEditor: true }] -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInput.css": -/*!*********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInput.css ***! - \*********************************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_standaloneQuickInput_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../../css-loader/dist/cjs.js!./standaloneQuickInput.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInput.css"); -/* harmony import */ var _css_loader_dist_cjs_js_standaloneQuickInput_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_standaloneQuickInput_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_standaloneQuickInput_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_standaloneQuickInput_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputServiceImpl.js": -/*!*******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputServiceImpl.js ***! - \*******************************************************************************************************************/ -/*! exports provided: EditorScopedQuickInputServiceImpl, StandaloneQuickInputServiceImpl, QuickInputEditorContribution, QuickInputEditorWidget */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorScopedQuickInputServiceImpl", function() { return EditorScopedQuickInputServiceImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneQuickInputServiceImpl", function() { return StandaloneQuickInputServiceImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickInputEditorContribution", function() { return QuickInputEditorContribution; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickInputEditorWidget", function() { return QuickInputEditorWidget; }); -/* harmony import */ var _standaloneQuickInput_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./standaloneQuickInput.css */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInput.css"); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../platform/accessibility/common/accessibility.js */ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js"); -/* harmony import */ var _platform_layout_browser_layoutService_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../platform/layout/browser/layoutService.js */ "./node_modules/monaco-editor/esm/vs/platform/layout/browser/layoutService.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _platform_quickinput_browser_quickInput_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../platform/quickinput/browser/quickInput.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickInput.js"); -/* harmony import */ var _base_common_functional_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../base/common/functional.js */ "./node_modules/monaco-editor/esm/vs/base/common/functional.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - -let EditorScopedQuickInputServiceImpl = class EditorScopedQuickInputServiceImpl extends _platform_quickinput_browser_quickInput_js__WEBPACK_IMPORTED_MODULE_9__["QuickInputService"] { - constructor(editor, instantiationService, contextKeyService, themeService, accessibilityService, layoutService) { - super(instantiationService, contextKeyService, themeService, accessibilityService, layoutService); - this.host = undefined; - // Use the passed in code editor as host for the quick input widget - const contribution = QuickInputEditorContribution.get(editor); - this.host = { - _serviceBrand: undefined, - get container() { return contribution.widget.getDomNode(); }, - get dimension() { return editor.getLayoutInfo(); }, - get onLayout() { return editor.onDidLayoutChange; }, - focus: () => editor.focus() - }; - } - createController() { - return super.createController(this.host); - } -}; -EditorScopedQuickInputServiceImpl = __decorate([ - __param(1, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_4__["IInstantiationService"]), - __param(2, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_5__["IContextKeyService"]), - __param(3, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_2__["IThemeService"]), - __param(4, _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_6__["IAccessibilityService"]), - __param(5, _platform_layout_browser_layoutService_js__WEBPACK_IMPORTED_MODULE_7__["ILayoutService"]) -], EditorScopedQuickInputServiceImpl); - -let StandaloneQuickInputServiceImpl = class StandaloneQuickInputServiceImpl { - constructor(instantiationService, codeEditorService) { - this.instantiationService = instantiationService; - this.codeEditorService = codeEditorService; - this.mapEditorToService = new Map(); - } - get activeService() { - const editor = this.codeEditorService.getFocusedCodeEditor(); - if (!editor) { - throw new Error('Quick input service needs a focused editor to work.'); - } - // Find the quick input implementation for the focused - // editor or create it lazily if not yet created - let quickInputService = this.mapEditorToService.get(editor); - if (!quickInputService) { - const newQuickInputService = quickInputService = this.instantiationService.createInstance(EditorScopedQuickInputServiceImpl, editor); - this.mapEditorToService.set(editor, quickInputService); - Object(_base_common_functional_js__WEBPACK_IMPORTED_MODULE_10__["once"])(editor.onDidDispose)(() => { - newQuickInputService.dispose(); - this.mapEditorToService.delete(editor); - }); - } - return quickInputService; - } - get quickAccess() { return this.activeService.quickAccess; } - pick(picks, options = {}, token = _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_3__["CancellationToken"].None) { - return this.activeService /* TS fail */.pick(picks, options, token); - } - createQuickPick() { - return this.activeService.createQuickPick(); - } -}; -StandaloneQuickInputServiceImpl = __decorate([ - __param(0, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_4__["IInstantiationService"]), - __param(1, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_8__["ICodeEditorService"]) -], StandaloneQuickInputServiceImpl); - -class QuickInputEditorContribution { - constructor(editor) { - this.editor = editor; - this.widget = new QuickInputEditorWidget(this.editor); - } - static get(editor) { - return editor.getContribution(QuickInputEditorContribution.ID); - } - dispose() { - this.widget.dispose(); - } -} -QuickInputEditorContribution.ID = 'editor.controller.quickInput'; -class QuickInputEditorWidget { - constructor(codeEditor) { - this.codeEditor = codeEditor; - this.domNode = document.createElement('div'); - this.codeEditor.addOverlayWidget(this); - } - getId() { - return QuickInputEditorWidget.ID; - } - getDomNode() { - return this.domNode; - } - getPosition() { - return { preference: 2 /* TOP_CENTER */ }; - } - dispose() { - this.codeEditor.removeOverlayWidget(this); - } -} -QuickInputEditorWidget.ID = 'editor.contrib.quickInputWidget'; -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_1__["registerEditorContribution"])(QuickInputEditorContribution.ID, QuickInputEditorContribution); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.js": -/*!******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.js ***! - \******************************************************************************************************************/ -/*! exports provided: StandaloneReferencesController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneReferencesController", function() { return StandaloneReferencesController; }); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _contrib_gotoSymbol_peek_referencesController_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../contrib/gotoSymbol/peek/referencesController.js */ "./node_modules/monaco-editor/esm/vs/editor/contrib/gotoSymbol/peek/referencesController.js"); -/* harmony import */ var _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../platform/configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../platform/storage/common/storage.js */ "./node_modules/monaco-editor/esm/vs/platform/storage/common/storage.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - -let StandaloneReferencesController = class StandaloneReferencesController extends _contrib_gotoSymbol_peek_referencesController_js__WEBPACK_IMPORTED_MODULE_2__["ReferencesController"] { - constructor(editor, contextKeyService, editorService, notificationService, instantiationService, storageService, configurationService) { - super(true, editor, contextKeyService, editorService, notificationService, instantiationService, storageService, configurationService); - } -}; -StandaloneReferencesController = __decorate([ - __param(1, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["IContextKeyService"]), - __param(2, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_1__["ICodeEditorService"]), - __param(3, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_6__["INotificationService"]), - __param(4, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_5__["IInstantiationService"]), - __param(5, _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_7__["IStorageService"]), - __param(6, _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_3__["IConfigurationService"]) -], StandaloneReferencesController); - -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorContribution"])(_contrib_gotoSymbol_peek_referencesController_js__WEBPACK_IMPORTED_MODULE_2__["ReferencesController"].ID, StandaloneReferencesController); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/simpleServices.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/simpleServices.js ***! - \***************************************************************************************/ -/*! exports provided: SimpleModel, SimpleEditorModelResolverService, SimpleEditorProgressService, SimpleDialogService, SimpleNotificationService, StandaloneCommandService, StandaloneKeybindingService, SimpleConfigurationService, SimpleResourceConfigurationService, SimpleResourcePropertiesService, StandaloneTelemetryService, SimpleWorkspaceContextService, applyConfigurationValues, SimpleBulkEditService, SimpleUriLabelService, SimpleLayoutService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleModel", function() { return SimpleModel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleEditorModelResolverService", function() { return SimpleEditorModelResolverService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleEditorProgressService", function() { return SimpleEditorProgressService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleDialogService", function() { return SimpleDialogService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleNotificationService", function() { return SimpleNotificationService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneCommandService", function() { return StandaloneCommandService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneKeybindingService", function() { return StandaloneKeybindingService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleConfigurationService", function() { return SimpleConfigurationService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleResourceConfigurationService", function() { return SimpleResourceConfigurationService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleResourcePropertiesService", function() { return SimpleResourcePropertiesService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneTelemetryService", function() { return StandaloneTelemetryService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkspaceContextService", function() { return SimpleWorkspaceContextService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyConfigurationValues", function() { return applyConfigurationValues; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleBulkEditService", function() { return SimpleBulkEditService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleUriLabelService", function() { return SimpleUriLabelService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleLayoutService", function() { return SimpleLayoutService; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_keyboardEvent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/keyboardEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/keyboardEvent.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_severity_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/severity.js */ "./node_modules/monaco-editor/esm/vs/base/common/severity.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../browser/editorBrowser.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorBrowser.js"); -/* harmony import */ var _browser_services_bulkEditService_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../browser/services/bulkEditService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/bulkEditService.js"); -/* harmony import */ var _common_config_commonEditorConfig_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../common/config/commonEditorConfig.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/commonEditorConfig.js"); -/* harmony import */ var _common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../common/core/editOperation.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/editOperation.js"); -/* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../common/core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../common/services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../platform/configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/* harmony import */ var _platform_configuration_common_configurationModels_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/configuration/common/configurationModels.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationModels.js"); -/* harmony import */ var _platform_keybinding_common_abstractKeybindingService_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../platform/keybinding/common/abstractKeybindingService.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/abstractKeybindingService.js"); -/* harmony import */ var _platform_keybinding_common_keybindingResolver_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybindingResolver.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingResolver.js"); -/* harmony import */ var _platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybindingsRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js"); -/* harmony import */ var _platform_keybinding_common_resolvedKeybindingItem_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../../platform/keybinding/common/resolvedKeybindingItem.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/resolvedKeybindingItem.js"); -/* harmony import */ var _platform_keybinding_common_usLayoutResolvedKeybinding_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../platform/keybinding/common/usLayoutResolvedKeybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/usLayoutResolvedKeybinding.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _platform_workspace_common_workspace_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../../platform/workspace/common/workspace.js */ "./node_modules/monaco-editor/esm/vs/platform/workspace/common/workspace.js"); -/* harmony import */ var _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../common/standaloneStrings.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - -class SimpleModel { - constructor(model) { - this.disposed = false; - this.model = model; - this._onDispose = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - } - get textEditorModel() { - return this.model; - } - dispose() { - this.disposed = true; - this._onDispose.fire(); - } -} -function withTypedEditor(widget, codeEditorCallback, diffEditorCallback) { - if (Object(_browser_editorBrowser_js__WEBPACK_IMPORTED_MODULE_9__["isCodeEditor"])(widget)) { - // Single Editor - return codeEditorCallback(widget); - } - else { - // Diff Editor - return diffEditorCallback(widget); - } -} -let SimpleEditorModelResolverService = class SimpleEditorModelResolverService { - constructor(modelService) { - this.modelService = modelService; - } - setEditor(editor) { - this.editor = editor; - } - createModelReference(resource) { - let model = null; - if (this.editor) { - model = withTypedEditor(this.editor, (editor) => this.findModel(editor, resource), (diffEditor) => this.findModel(diffEditor.getOriginalEditor(), resource) || this.findModel(diffEditor.getModifiedEditor(), resource)); - } - if (!model) { - return Promise.reject(new Error(`Model not found`)); - } - return Promise.resolve(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["ImmortalReference"](new SimpleModel(model))); - } - findModel(editor, resource) { - let model = this.modelService.getModel(resource); - if (model && model.uri.toString() !== resource.toString()) { - return null; - } - return model; - } -}; -SimpleEditorModelResolverService = __decorate([ - __param(0, _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_15__["IModelService"]) -], SimpleEditorModelResolverService); - -class SimpleEditorProgressService { - show() { - return SimpleEditorProgressService.NULL_PROGRESS_RUNNER; - } - showWhile(promise, delay) { - return Promise.resolve(undefined); - } -} -SimpleEditorProgressService.NULL_PROGRESS_RUNNER = { - done: () => { }, - total: () => { }, - worked: () => { } -}; -class SimpleDialogService { - confirm(confirmation) { - return this.doConfirm(confirmation).then(confirmed => { - return { - confirmed, - checkboxChecked: false // unsupported - }; - }); - } - doConfirm(confirmation) { - let messageText = confirmation.message; - if (confirmation.detail) { - messageText = messageText + '\n\n' + confirmation.detail; - } - return Promise.resolve(window.confirm(messageText)); - } - show(severity, message, buttons, options) { - return Promise.resolve({ choice: 0 }); - } -} -class SimpleNotificationService { - info(message) { - return this.notify({ severity: _base_common_severity_js__WEBPACK_IMPORTED_MODULE_7__["default"].Info, message }); - } - warn(message) { - return this.notify({ severity: _base_common_severity_js__WEBPACK_IMPORTED_MODULE_7__["default"].Warning, message }); - } - error(error) { - return this.notify({ severity: _base_common_severity_js__WEBPACK_IMPORTED_MODULE_7__["default"].Error, message: error }); - } - notify(notification) { - switch (notification.severity) { - case _base_common_severity_js__WEBPACK_IMPORTED_MODULE_7__["default"].Error: - console.error(notification.message); - break; - case _base_common_severity_js__WEBPACK_IMPORTED_MODULE_7__["default"].Warning: - console.warn(notification.message); - break; - default: - console.log(notification.message); - break; - } - return SimpleNotificationService.NO_OP; - } - status(message, options) { - return _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["Disposable"].None; - } -} -SimpleNotificationService.NO_OP = new _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_24__["NoOpNotification"](); -class StandaloneCommandService { - constructor(instantiationService) { - this._onWillExecuteCommand = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - this._onDidExecuteCommand = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - this._instantiationService = instantiationService; - } - executeCommand(id, ...args) { - const command = _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_16__["CommandsRegistry"].getCommand(id); - if (!command) { - return Promise.reject(new Error(`command '${id}' not found`)); - } - try { - this._onWillExecuteCommand.fire({ commandId: id, args }); - const result = this._instantiationService.invokeFunction.apply(this._instantiationService, [command.handler, ...args]); - this._onDidExecuteCommand.fire({ commandId: id, args }); - return Promise.resolve(result); - } - catch (err) { - return Promise.reject(err); - } - } -} -class StandaloneKeybindingService extends _platform_keybinding_common_abstractKeybindingService_js__WEBPACK_IMPORTED_MODULE_19__["AbstractKeybindingService"] { - constructor(contextKeyService, commandService, telemetryService, notificationService, logService, domNode) { - super(contextKeyService, commandService, telemetryService, notificationService, logService); - this._cachedResolver = null; - this._dynamicKeybindings = []; - this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["addDisposableListener"](domNode, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["EventType"].KEY_DOWN, (e) => { - let keyEvent = new _base_browser_keyboardEvent_js__WEBPACK_IMPORTED_MODULE_2__["StandardKeyboardEvent"](e); - let shouldPreventDefault = this._dispatch(keyEvent, keyEvent.target); - if (shouldPreventDefault) { - keyEvent.preventDefault(); - keyEvent.stopPropagation(); - } - })); - } - addDynamicKeybinding(commandId, _keybinding, handler, when) { - const keybinding = Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_4__["createKeybinding"])(_keybinding, _base_common_platform_js__WEBPACK_IMPORTED_MODULE_6__["OS"]); - const toDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["DisposableStore"](); - if (keybinding) { - this._dynamicKeybindings.push({ - keybinding: keybinding, - command: commandId, - when: when, - weight1: 1000, - weight2: 0, - extensionId: null - }); - toDispose.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["toDisposable"])(() => { - for (let i = 0; i < this._dynamicKeybindings.length; i++) { - let kb = this._dynamicKeybindings[i]; - if (kb.command === commandId) { - this._dynamicKeybindings.splice(i, 1); - this.updateResolver({ source: 1 /* Default */ }); - return; - } - } - })); - } - toDispose.add(_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_16__["CommandsRegistry"].registerCommand(commandId, handler)); - this.updateResolver({ source: 1 /* Default */ }); - return toDispose; - } - updateResolver(event) { - this._cachedResolver = null; - this._onDidUpdateKeybindings.fire(event); - } - _getResolver() { - if (!this._cachedResolver) { - const defaults = this._toNormalizedKeybindingItems(_platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_21__["KeybindingsRegistry"].getDefaultKeybindings(), true); - const overrides = this._toNormalizedKeybindingItems(this._dynamicKeybindings, false); - this._cachedResolver = new _platform_keybinding_common_keybindingResolver_js__WEBPACK_IMPORTED_MODULE_20__["KeybindingResolver"](defaults, overrides, (str) => this._log(str)); - } - return this._cachedResolver; - } - _documentHasFocus() { - return document.hasFocus(); - } - _toNormalizedKeybindingItems(items, isDefault) { - let result = [], resultLen = 0; - for (const item of items) { - const when = item.when || undefined; - const keybinding = item.keybinding; - if (!keybinding) { - // This might be a removal keybinding item in user settings => accept it - result[resultLen++] = new _platform_keybinding_common_resolvedKeybindingItem_js__WEBPACK_IMPORTED_MODULE_22__["ResolvedKeybindingItem"](undefined, item.command, item.commandArgs, when, isDefault, null); - } - else { - const resolvedKeybindings = this.resolveKeybinding(keybinding); - for (const resolvedKeybinding of resolvedKeybindings) { - result[resultLen++] = new _platform_keybinding_common_resolvedKeybindingItem_js__WEBPACK_IMPORTED_MODULE_22__["ResolvedKeybindingItem"](resolvedKeybinding, item.command, item.commandArgs, when, isDefault, null); - } - } - } - return result; - } - resolveKeybinding(keybinding) { - return [new _platform_keybinding_common_usLayoutResolvedKeybinding_js__WEBPACK_IMPORTED_MODULE_23__["USLayoutResolvedKeybinding"](keybinding, _base_common_platform_js__WEBPACK_IMPORTED_MODULE_6__["OS"])]; - } - resolveKeyboardEvent(keyboardEvent) { - let keybinding = new _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_4__["SimpleKeybinding"](keyboardEvent.ctrlKey, keyboardEvent.shiftKey, keyboardEvent.altKey, keyboardEvent.metaKey, keyboardEvent.keyCode).toChord(); - return new _platform_keybinding_common_usLayoutResolvedKeybinding_js__WEBPACK_IMPORTED_MODULE_23__["USLayoutResolvedKeybinding"](keybinding, _base_common_platform_js__WEBPACK_IMPORTED_MODULE_6__["OS"]); - } -} -function isConfigurationOverrides(thing) { - return thing - && typeof thing === 'object' - && (!thing.overrideIdentifier || typeof thing.overrideIdentifier === 'string') - && (!thing.resource || thing.resource instanceof _base_common_uri_js__WEBPACK_IMPORTED_MODULE_8__["URI"]); -} -class SimpleConfigurationService { - constructor() { - this._onDidChangeConfiguration = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - this.onDidChangeConfiguration = this._onDidChangeConfiguration.event; - this._configuration = new _platform_configuration_common_configurationModels_js__WEBPACK_IMPORTED_MODULE_18__["Configuration"](new _platform_configuration_common_configurationModels_js__WEBPACK_IMPORTED_MODULE_18__["DefaultConfigurationModel"](), new _platform_configuration_common_configurationModels_js__WEBPACK_IMPORTED_MODULE_18__["ConfigurationModel"]()); - } - getValue(arg1, arg2) { - const section = typeof arg1 === 'string' ? arg1 : undefined; - const overrides = isConfigurationOverrides(arg1) ? arg1 : isConfigurationOverrides(arg2) ? arg2 : {}; - return this._configuration.getValue(section, overrides, undefined); - } - updateValues(values) { - const previous = { data: this._configuration.toData() }; - let changedKeys = []; - for (const entry of values) { - const [key, value] = entry; - if (this.getValue(key) === value) { - continue; - } - this._configuration.updateValue(key, value); - changedKeys.push(key); - } - if (changedKeys.length > 0) { - const configurationChangeEvent = new _platform_configuration_common_configurationModels_js__WEBPACK_IMPORTED_MODULE_18__["ConfigurationChangeEvent"]({ keys: changedKeys, overrides: [] }, previous, this._configuration); - configurationChangeEvent.source = 7 /* MEMORY */; - configurationChangeEvent.sourceConfig = null; - this._onDidChangeConfiguration.fire(configurationChangeEvent); - } - return Promise.resolve(); - } -} -class SimpleResourceConfigurationService { - constructor(configurationService) { - this.configurationService = configurationService; - this._onDidChangeConfiguration = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - this.configurationService.onDidChangeConfiguration((e) => { - this._onDidChangeConfiguration.fire({ affectedKeys: e.affectedKeys, affectsConfiguration: (resource, configuration) => e.affectsConfiguration(configuration) }); - }); - } - getValue(resource, arg2, arg3) { - const position = _common_core_position_js__WEBPACK_IMPORTED_MODULE_13__["Position"].isIPosition(arg2) ? arg2 : null; - const section = position ? (typeof arg3 === 'string' ? arg3 : undefined) : (typeof arg2 === 'string' ? arg2 : undefined); - if (typeof section === 'undefined') { - return this.configurationService.getValue(); - } - return this.configurationService.getValue(section); - } -} -let SimpleResourcePropertiesService = class SimpleResourcePropertiesService { - constructor(configurationService) { - this.configurationService = configurationService; - } - getEOL(resource, language) { - const eol = this.configurationService.getValue('files.eol', { overrideIdentifier: language, resource }); - if (eol && eol !== 'auto') { - return eol; - } - return (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_6__["isLinux"] || _base_common_platform_js__WEBPACK_IMPORTED_MODULE_6__["isMacintosh"]) ? '\n' : '\r\n'; - } -}; -SimpleResourcePropertiesService = __decorate([ - __param(0, _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_17__["IConfigurationService"]) -], SimpleResourcePropertiesService); - -class StandaloneTelemetryService { - publicLog(eventName, data) { - return Promise.resolve(undefined); - } - publicLog2(eventName, data) { - return this.publicLog(eventName, data); - } -} -class SimpleWorkspaceContextService { - constructor() { - const resource = _base_common_uri_js__WEBPACK_IMPORTED_MODULE_8__["URI"].from({ scheme: SimpleWorkspaceContextService.SCHEME, authority: 'model', path: '/' }); - this.workspace = { id: '4064f6ec-cb38-4ad0-af64-ee6467e63c82', folders: [new _platform_workspace_common_workspace_js__WEBPACK_IMPORTED_MODULE_25__["WorkspaceFolder"]({ uri: resource, name: '', index: 0 })] }; - } - getWorkspace() { - return this.workspace; - } - getWorkspaceFolder(resource) { - return resource && resource.scheme === SimpleWorkspaceContextService.SCHEME ? this.workspace.folders[0] : null; - } -} -SimpleWorkspaceContextService.SCHEME = 'inmemory'; -function applyConfigurationValues(configurationService, source, isDiffEditor) { - if (!source) { - return; - } - if (!(configurationService instanceof SimpleConfigurationService)) { - return; - } - let toUpdate = []; - Object.keys(source).forEach((key) => { - if (Object(_common_config_commonEditorConfig_js__WEBPACK_IMPORTED_MODULE_11__["isEditorConfigurationKey"])(key)) { - toUpdate.push([`editor.${key}`, source[key]]); - } - if (isDiffEditor && Object(_common_config_commonEditorConfig_js__WEBPACK_IMPORTED_MODULE_11__["isDiffEditorConfigurationKey"])(key)) { - toUpdate.push([`diffEditor.${key}`, source[key]]); - } - }); - if (toUpdate.length > 0) { - configurationService.updateValues(toUpdate); - } -} -class SimpleBulkEditService { - constructor(_modelService) { - this._modelService = _modelService; - // - } - hasPreviewHandler() { - return false; - } - apply(edits, _options) { - return __awaiter(this, void 0, void 0, function* () { - const textEdits = new Map(); - for (let edit of edits) { - if (!(edit instanceof _browser_services_bulkEditService_js__WEBPACK_IMPORTED_MODULE_10__["ResourceTextEdit"])) { - throw new Error('bad edit - only text edits are supported'); - } - const model = this._modelService.getModel(edit.resource); - if (!model) { - throw new Error('bad edit - model not found'); - } - if (typeof edit.versionId === 'number' && model.getVersionId() !== edit.versionId) { - throw new Error('bad state - model changed in the meantime'); - } - let array = textEdits.get(model); - if (!array) { - array = []; - textEdits.set(model, array); - } - array.push(_common_core_editOperation_js__WEBPACK_IMPORTED_MODULE_12__["EditOperation"].replaceMove(_common_core_range_js__WEBPACK_IMPORTED_MODULE_14__["Range"].lift(edit.textEdit.range), edit.textEdit.text)); - } - let totalEdits = 0; - let totalFiles = 0; - for (const [model, edits] of textEdits) { - model.pushStackElement(); - model.pushEditOperations([], edits, () => []); - model.pushStackElement(); - totalFiles += 1; - totalEdits += edits.length; - } - return { - ariaSummary: _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["format"](_common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_26__["SimpleServicesNLS"].bulkEditServiceSummary, totalEdits, totalFiles) - }; - }); - } -} -class SimpleUriLabelService { - getUriLabel(resource, options) { - if (resource.scheme === 'file') { - return resource.fsPath; - } - return resource.path; - } -} -class SimpleLayoutService { - constructor(_codeEditorService, _container) { - this._codeEditorService = _codeEditorService; - this._container = _container; - this.onLayout = _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Event"].None; - } - get dimension() { - if (!this._dimension) { - this._dimension = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__["getClientArea"](window.document.body); - } - return this._dimension; - } - get container() { - return this._container; - } - focus() { - var _a; - (_a = this._codeEditorService.getFocusedCodeEditor()) === null || _a === void 0 ? void 0 : _a.focus(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standalone-tokens.css": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standalone-tokens.css ***! - \*******************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_standalone_tokens_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./standalone-tokens.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standalone-tokens.css"); -/* harmony import */ var _css_loader_dist_cjs_js_standalone_tokens_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_standalone_tokens_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_standalone_tokens_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_standalone_tokens_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js ***! - \*********************************************************************************************/ -/*! exports provided: StandaloneCodeEditor, StandaloneEditor, StandaloneDiffEditor */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneCodeEditor", function() { return StandaloneCodeEditor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneEditor", function() { return StandaloneEditor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneDiffEditor", function() { return StandaloneDiffEditor; }); -/* harmony import */ var _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/ui/aria/aria.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/aria/aria.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _browser_widget_codeEditorWidget_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/widget/codeEditorWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js"); -/* harmony import */ var _browser_widget_diffEditorWidget_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../browser/widget/diffEditorWidget.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/diffEditorWidget.js"); -/* harmony import */ var _common_editorAction_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/editorAction.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorAction.js"); -/* harmony import */ var _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/services/editorWorkerService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerService.js"); -/* harmony import */ var _simpleServices_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./simpleServices.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/simpleServices.js"); -/* harmony import */ var _common_standaloneThemeService_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/standaloneThemeService.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/standaloneThemeService.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../platform/configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../platform/contextview/browser/contextView.js */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextView.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/accessibility/common/accessibility.js */ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js"); -/* harmony import */ var _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../common/standaloneStrings.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js"); -/* harmony import */ var _platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../platform/clipboard/common/clipboardService.js */ "./node_modules/monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js"); -/* harmony import */ var _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../platform/progress/common/progress.js */ "./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - - - - - - - -let LAST_GENERATED_COMMAND_ID = 0; -let ariaDomNodeCreated = false; -function createAriaDomNode() { - if (ariaDomNodeCreated) { - return; - } - ariaDomNodeCreated = true; - _base_browser_ui_aria_aria_js__WEBPACK_IMPORTED_MODULE_0__["setARIAContainer"](document.body); -} -/** - * A code editor to be used both by the standalone editor and the standalone diff editor. - */ -let StandaloneCodeEditor = class StandaloneCodeEditor extends _browser_widget_codeEditorWidget_js__WEBPACK_IMPORTED_MODULE_3__["CodeEditorWidget"] { - constructor(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, keybindingService, themeService, notificationService, accessibilityService) { - options = options || {}; - options.ariaLabel = options.ariaLabel || _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["StandaloneCodeEditorNLS"].editorViewAccessibleLabel; - options.ariaLabel = options.ariaLabel + ';' + (_common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_19__["StandaloneCodeEditorNLS"].accessibilityHelpMessage); - super(domElement, options, {}, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService); - if (keybindingService instanceof _simpleServices_js__WEBPACK_IMPORTED_MODULE_7__["StandaloneKeybindingService"]) { - this._standaloneKeybindingService = keybindingService; - } - else { - this._standaloneKeybindingService = null; - } - // Create the ARIA dom node as soon as the first editor is instantiated - createAriaDomNode(); - } - addCommand(keybinding, handler, context) { - if (!this._standaloneKeybindingService) { - console.warn('Cannot add command because the editor is configured with an unrecognized KeybindingService'); - return null; - } - let commandId = 'DYNAMIC_' + (++LAST_GENERATED_COMMAND_ID); - let whenExpression = _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].deserialize(context); - this._standaloneKeybindingService.addDynamicKeybinding(commandId, keybinding, handler, whenExpression); - return commandId; - } - createContextKey(key, defaultValue) { - return this._contextKeyService.createKey(key, defaultValue); - } - addAction(_descriptor) { - if ((typeof _descriptor.id !== 'string') || (typeof _descriptor.label !== 'string') || (typeof _descriptor.run !== 'function')) { - throw new Error('Invalid action descriptor, `id`, `label` and `run` are required properties!'); - } - if (!this._standaloneKeybindingService) { - console.warn('Cannot add keybinding because the editor is configured with an unrecognized KeybindingService'); - return _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - } - // Read descriptor options - const id = _descriptor.id; - const label = _descriptor.label; - const precondition = _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].and(_platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].equals('editorId', this.getId()), _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].deserialize(_descriptor.precondition)); - const keybindings = _descriptor.keybindings; - const keybindingsWhen = _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].and(precondition, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["ContextKeyExpr"].deserialize(_descriptor.keybindingContext)); - const contextMenuGroupId = _descriptor.contextMenuGroupId || null; - const contextMenuOrder = _descriptor.contextMenuOrder || 0; - const run = (accessor, ...args) => { - return Promise.resolve(_descriptor.run(this, ...args)); - }; - const toDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - // Generate a unique id to allow the same descriptor.id across multiple editor instances - const uniqueId = this.getId() + ':' + id; - // Register the command - toDispose.add(_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_10__["CommandsRegistry"].registerCommand(uniqueId, run)); - // Register the context menu item - if (contextMenuGroupId) { - let menuItem = { - command: { - id: uniqueId, - title: label - }, - when: precondition, - group: contextMenuGroupId, - order: contextMenuOrder - }; - toDispose.add(_platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_9__["MenuRegistry"].appendMenuItem(_platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_9__["MenuId"].EditorContext, menuItem)); - } - // Register the keybindings - if (Array.isArray(keybindings)) { - for (const kb of keybindings) { - toDispose.add(this._standaloneKeybindingService.addDynamicKeybinding(uniqueId, kb, run, keybindingsWhen)); - } - } - // Finally, register an internal editor action - let internalAction = new _common_editorAction_js__WEBPACK_IMPORTED_MODULE_5__["InternalEditorAction"](uniqueId, label, label, precondition, run, this._contextKeyService); - // Store it under the original id, such that trigger with the original id will work - this._actions[id] = internalAction; - toDispose.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => { - delete this._actions[id]; - })); - return toDispose; - } -}; -StandaloneCodeEditor = __decorate([ - __param(2, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_14__["IInstantiationService"]), - __param(3, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_2__["ICodeEditorService"]), - __param(4, _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_10__["ICommandService"]), - __param(5, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["IContextKeyService"]), - __param(6, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_15__["IKeybindingService"]), - __param(7, _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_17__["IThemeService"]), - __param(8, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_16__["INotificationService"]), - __param(9, _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_18__["IAccessibilityService"]) -], StandaloneCodeEditor); - -let StandaloneEditor = class StandaloneEditor extends StandaloneCodeEditor { - constructor(domElement, options, toDispose, instantiationService, codeEditorService, commandService, contextKeyService, keybindingService, contextViewService, themeService, notificationService, configurationService, accessibilityService) { - Object(_simpleServices_js__WEBPACK_IMPORTED_MODULE_7__["applyConfigurationValues"])(configurationService, options, false); - const themeDomRegistration = themeService.registerEditorContainer(domElement); - options = options || {}; - if (typeof options.theme === 'string') { - themeService.setTheme(options.theme); - } - let _model = options.model; - delete options.model; - super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, keybindingService, themeService, notificationService, accessibilityService); - this._contextViewService = contextViewService; - this._configurationService = configurationService; - this._standaloneThemeService = themeService; - this._register(toDispose); - this._register(themeDomRegistration); - let model; - if (typeof _model === 'undefined') { - model = self.monaco.editor.createModel(options.value || '', options.language || 'text/plain'); - this._ownsModel = true; - } - else { - model = _model; - this._ownsModel = false; - } - this._attachModel(model); - if (model) { - let e = { - oldModelUrl: null, - newModelUrl: model.uri - }; - this._onDidChangeModel.fire(e); - } - } - dispose() { - super.dispose(); - } - updateOptions(newOptions) { - Object(_simpleServices_js__WEBPACK_IMPORTED_MODULE_7__["applyConfigurationValues"])(this._configurationService, newOptions, false); - if (typeof newOptions.theme === 'string') { - this._standaloneThemeService.setTheme(newOptions.theme); - } - super.updateOptions(newOptions); - } - _attachModel(model) { - super._attachModel(model); - if (this._modelData) { - this._contextViewService.setContainer(this._modelData.view.domNode.domNode); - } - } - _postDetachModelCleanup(detachedModel) { - super._postDetachModelCleanup(detachedModel); - if (detachedModel && this._ownsModel) { - detachedModel.dispose(); - this._ownsModel = false; - } - } -}; -StandaloneEditor = __decorate([ - __param(3, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_14__["IInstantiationService"]), - __param(4, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_2__["ICodeEditorService"]), - __param(5, _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_10__["ICommandService"]), - __param(6, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["IContextKeyService"]), - __param(7, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_15__["IKeybindingService"]), - __param(8, _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_13__["IContextViewService"]), - __param(9, _common_standaloneThemeService_js__WEBPACK_IMPORTED_MODULE_8__["IStandaloneThemeService"]), - __param(10, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_16__["INotificationService"]), - __param(11, _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_11__["IConfigurationService"]), - __param(12, _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_18__["IAccessibilityService"]) -], StandaloneEditor); - -let StandaloneDiffEditor = class StandaloneDiffEditor extends _browser_widget_diffEditorWidget_js__WEBPACK_IMPORTED_MODULE_4__["DiffEditorWidget"] { - constructor(domElement, options, toDispose, instantiationService, contextKeyService, keybindingService, contextViewService, editorWorkerService, codeEditorService, themeService, notificationService, configurationService, contextMenuService, editorProgressService, clipboardService) { - Object(_simpleServices_js__WEBPACK_IMPORTED_MODULE_7__["applyConfigurationValues"])(configurationService, options, true); - const themeDomRegistration = themeService.registerEditorContainer(domElement); - options = options || {}; - if (typeof options.theme === 'string') { - options.theme = themeService.setTheme(options.theme); - } - super(domElement, options, clipboardService, editorWorkerService, contextKeyService, instantiationService, codeEditorService, themeService, notificationService, contextMenuService, editorProgressService); - this._contextViewService = contextViewService; - this._configurationService = configurationService; - this._standaloneThemeService = themeService; - this._register(toDispose); - this._register(themeDomRegistration); - this._contextViewService.setContainer(this._containerDomElement); - } - dispose() { - super.dispose(); - } - updateOptions(newOptions) { - Object(_simpleServices_js__WEBPACK_IMPORTED_MODULE_7__["applyConfigurationValues"])(this._configurationService, newOptions, true); - if (typeof newOptions.theme === 'string') { - this._standaloneThemeService.setTheme(newOptions.theme); - } - super.updateOptions(newOptions); - } - _createInnerEditor(instantiationService, container, options) { - return instantiationService.createInstance(StandaloneCodeEditor, container, options); - } - getOriginalEditor() { - return super.getOriginalEditor(); - } - getModifiedEditor() { - return super.getModifiedEditor(); - } - addCommand(keybinding, handler, context) { - return this.getModifiedEditor().addCommand(keybinding, handler, context); - } - createContextKey(key, defaultValue) { - return this.getModifiedEditor().createContextKey(key, defaultValue); - } - addAction(descriptor) { - return this.getModifiedEditor().addAction(descriptor); - } -}; -StandaloneDiffEditor = __decorate([ - __param(3, _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_14__["IInstantiationService"]), - __param(4, _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_12__["IContextKeyService"]), - __param(5, _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_15__["IKeybindingService"]), - __param(6, _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_13__["IContextViewService"]), - __param(7, _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_6__["IEditorWorkerService"]), - __param(8, _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_2__["ICodeEditorService"]), - __param(9, _common_standaloneThemeService_js__WEBPACK_IMPORTED_MODULE_8__["IStandaloneThemeService"]), - __param(10, _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_16__["INotificationService"]), - __param(11, _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_11__["IConfigurationService"]), - __param(12, _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_13__["IContextMenuService"]), - __param(13, _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_21__["IEditorProgressService"]), - __param(14, _platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_20__["IClipboardService"]) -], StandaloneDiffEditor); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeServiceImpl.js": -/*!**************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeServiceImpl.js ***! - \**************************************************************************************************/ -/*! exports provided: StandaloneCodeEditorServiceImpl */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneCodeEditorServiceImpl", function() { return StandaloneCodeEditorServiceImpl; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_network_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _browser_services_codeEditorServiceImpl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/services/codeEditorServiceImpl.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorServiceImpl.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class StandaloneCodeEditorServiceImpl extends _browser_services_codeEditorServiceImpl_js__WEBPACK_IMPORTED_MODULE_2__["CodeEditorServiceImpl"] { - getActiveCodeEditor() { - return null; // not supported in the standalone case - } - openCodeEditor(input, source, sideBySide) { - if (!source) { - return Promise.resolve(null); - } - return Promise.resolve(this.doOpenEditor(source, input)); - } - doOpenEditor(editor, input) { - const model = this.findModel(editor, input.resource); - if (!model) { - if (input.resource) { - const schema = input.resource.scheme; - if (schema === _base_common_network_js__WEBPACK_IMPORTED_MODULE_1__["Schemas"].http || schema === _base_common_network_js__WEBPACK_IMPORTED_MODULE_1__["Schemas"].https) { - // This is a fully qualified http or https URL - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["windowOpenNoOpener"])(input.resource.toString()); - return editor; - } - } - return null; - } - const selection = (input.options ? input.options.selection : null); - if (selection) { - if (typeof selection.endLineNumber === 'number' && typeof selection.endColumn === 'number') { - editor.setSelection(selection); - editor.revealRangeInCenter(selection, 1 /* Immediate */); - } - else { - const pos = { - lineNumber: selection.startLineNumber, - column: selection.startColumn - }; - editor.setPosition(pos); - editor.revealPositionInCenter(pos, 1 /* Immediate */); - } - } - return editor; - } - findModel(editor, resource) { - const model = editor.getModel(); - if (model && model.uri.toString() !== resource.toString()) { - return null; - } - return model; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneEditor.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneEditor.js ***! - \*****************************************************************************************/ -/*! exports provided: create, onDidCreateEditor, createDiffEditor, createDiffNavigator, createModel, setModelLanguage, setModelMarkers, getModelMarkers, getModel, getModels, onDidCreateModel, onWillDisposeModel, onDidChangeModelLanguage, createWebWorker, colorizeElement, colorize, colorizeModelLine, tokenize, defineTheme, setTheme, remeasureFonts, createMonacoEditorAPI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onDidCreateEditor", function() { return onDidCreateEditor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDiffEditor", function() { return createDiffEditor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDiffNavigator", function() { return createDiffNavigator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createModel", function() { return createModel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setModelLanguage", function() { return setModelLanguage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setModelMarkers", function() { return setModelMarkers; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getModelMarkers", function() { return getModelMarkers; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getModel", function() { return getModel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getModels", function() { return getModels; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onDidCreateModel", function() { return onDidCreateModel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onWillDisposeModel", function() { return onWillDisposeModel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onDidChangeModelLanguage", function() { return onDidChangeModelLanguage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createWebWorker", function() { return createWebWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorizeElement", function() { return colorizeElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorize", function() { return colorize; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorizeModelLine", function() { return colorizeModelLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tokenize", function() { return tokenize; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defineTheme", function() { return defineTheme; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTheme", function() { return setTheme; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "remeasureFonts", function() { return remeasureFonts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMonacoEditorAPI", function() { return createMonacoEditorAPI; }); -/* harmony import */ var _standalone_tokens_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./standalone-tokens.css */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standalone-tokens.css"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _browser_services_openerService_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/services/openerService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/openerService.js"); -/* harmony import */ var _browser_widget_diffNavigator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../browser/widget/diffNavigator.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/widget/diffNavigator.js"); -/* harmony import */ var _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/config/editorOptions.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"); -/* harmony import */ var _common_config_fontInfo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/config/fontInfo.js */ "./node_modules/monaco-editor/esm/vs/editor/common/config/fontInfo.js"); -/* harmony import */ var _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/editorCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/common/editorCommon.js"); -/* harmony import */ var _common_model_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/model.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_modes_nullMode_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/modes/nullMode.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/nullMode.js"); -/* harmony import */ var _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/services/editorWorkerService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerService.js"); -/* harmony import */ var _common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../common/services/resolverService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/resolverService.js"); -/* harmony import */ var _common_services_webWorker_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../common/services/webWorker.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/webWorker.js"); -/* harmony import */ var _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../common/standalone/standaloneEnums.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js"); -/* harmony import */ var _colorizer_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./colorizer.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/colorizer.js"); -/* harmony import */ var _simpleServices_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./simpleServices.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/simpleServices.js"); -/* harmony import */ var _standaloneCodeEditor_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./standaloneCodeEditor.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js"); -/* harmony import */ var _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./standaloneServices.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js"); -/* harmony import */ var _common_standaloneThemeService_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../common/standaloneThemeService.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/standaloneThemeService.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../platform/configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../../platform/contextview/browser/contextView.js */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextView.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../../platform/opener/common/opener.js */ "./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js"); -/* harmony import */ var _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../../platform/accessibility/common/accessibility.js */ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js"); -/* harmony import */ var _browser_config_configuration_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../browser/config/configuration.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/config/configuration.js"); -/* harmony import */ var _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../../platform/progress/common/progress.js */ "./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js"); -/* harmony import */ var _platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../../platform/clipboard/common/clipboardService.js */ "./node_modules/monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function withAllStandaloneServices(domElement, override, callback) { - let services = new _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["DynamicStandaloneServices"](domElement, override); - let simpleEditorModelResolverService = null; - if (!services.has(_common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_11__["ITextModelService"])) { - simpleEditorModelResolverService = new _simpleServices_js__WEBPACK_IMPORTED_MODULE_15__["SimpleEditorModelResolverService"](_standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modelService.get()); - services.set(_common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_11__["ITextModelService"], simpleEditorModelResolverService); - } - if (!services.has(_platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_26__["IOpenerService"])) { - services.set(_platform_opener_common_opener_js__WEBPACK_IMPORTED_MODULE_26__["IOpenerService"], new _browser_services_openerService_js__WEBPACK_IMPORTED_MODULE_2__["OpenerService"](services.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_1__["ICodeEditorService"]), services.get(_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_19__["ICommandService"]))); - } - let result = callback(services); - if (simpleEditorModelResolverService) { - simpleEditorModelResolverService.setEditor(result); - } - return result; -} -/** - * Create a new editor under `domElement`. - * `domElement` should be empty (not contain other dom nodes). - * The editor will read the size of `domElement`. - */ -function create(domElement, options, override) { - return withAllStandaloneServices(domElement, override || {}, (services) => { - return new _standaloneCodeEditor_js__WEBPACK_IMPORTED_MODULE_16__["StandaloneEditor"](domElement, options, services, services.get(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_23__["IInstantiationService"]), services.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_1__["ICodeEditorService"]), services.get(_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_19__["ICommandService"]), services.get(_platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_21__["IContextKeyService"]), services.get(_platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_24__["IKeybindingService"]), services.get(_platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_22__["IContextViewService"]), services.get(_common_standaloneThemeService_js__WEBPACK_IMPORTED_MODULE_18__["IStandaloneThemeService"]), services.get(_platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_25__["INotificationService"]), services.get(_platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_20__["IConfigurationService"]), services.get(_platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_27__["IAccessibilityService"])); - }); -} -/** - * Emitted when an editor is created. - * Creating a diff editor might cause this listener to be invoked with the two editors. - * @event - */ -function onDidCreateEditor(listener) { - return _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].codeEditorService.get().onCodeEditorAdd((editor) => { - listener(editor); - }); -} -/** - * Create a new diff editor under `domElement`. - * `domElement` should be empty (not contain other dom nodes). - * The editor will read the size of `domElement`. - */ -function createDiffEditor(domElement, options, override) { - return withAllStandaloneServices(domElement, override || {}, (services) => { - return new _standaloneCodeEditor_js__WEBPACK_IMPORTED_MODULE_16__["StandaloneDiffEditor"](domElement, options, services, services.get(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_23__["IInstantiationService"]), services.get(_platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_21__["IContextKeyService"]), services.get(_platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_24__["IKeybindingService"]), services.get(_platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_22__["IContextViewService"]), services.get(_common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_10__["IEditorWorkerService"]), services.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_1__["ICodeEditorService"]), services.get(_common_standaloneThemeService_js__WEBPACK_IMPORTED_MODULE_18__["IStandaloneThemeService"]), services.get(_platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_25__["INotificationService"]), services.get(_platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_20__["IConfigurationService"]), services.get(_platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_22__["IContextMenuService"]), services.get(_platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_29__["IEditorProgressService"]), services.get(_platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_30__["IClipboardService"])); - }); -} -function createDiffNavigator(diffEditor, opts) { - return new _browser_widget_diffNavigator_js__WEBPACK_IMPORTED_MODULE_3__["DiffNavigator"](diffEditor, opts); -} -function doCreateModel(value, languageSelection, uri) { - return _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modelService.get().createModel(value, languageSelection, uri); -} -/** - * Create a new editor model. - * You can specify the language that should be set for this model or let the language be inferred from the `uri`. - */ -function createModel(value, language, uri) { - value = value || ''; - if (!language) { - let firstLF = value.indexOf('\n'); - let firstLine = value; - if (firstLF !== -1) { - firstLine = value.substring(0, firstLF); - } - return doCreateModel(value, _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modeService.get().createByFilepathOrFirstLine(uri || null, firstLine), uri); - } - return doCreateModel(value, _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modeService.get().create(language), uri); -} -/** - * Change the language for a model. - */ -function setModelLanguage(model, languageId) { - _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modelService.get().setMode(model, _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modeService.get().create(languageId)); -} -/** - * Set the markers for a model. - */ -function setModelMarkers(model, owner, markers) { - if (model) { - _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].markerService.get().changeOne(owner, model.uri, markers); - } -} -/** - * Get markers for owner and/or resource - * - * @returns list of markers - */ -function getModelMarkers(filter) { - return _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].markerService.get().read(filter); -} -/** - * Get the model that has `uri` if it exists. - */ -function getModel(uri) { - return _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modelService.get().getModel(uri); -} -/** - * Get all the created models. - */ -function getModels() { - return _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modelService.get().getModels(); -} -/** - * Emitted when a model is created. - * @event - */ -function onDidCreateModel(listener) { - return _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modelService.get().onModelAdded(listener); -} -/** - * Emitted right before a model is disposed. - * @event - */ -function onWillDisposeModel(listener) { - return _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modelService.get().onModelRemoved(listener); -} -/** - * Emitted when a different language is set to a model. - * @event - */ -function onDidChangeModelLanguage(listener) { - return _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modelService.get().onModelModeChanged((e) => { - listener({ - model: e.model, - oldLanguage: e.oldModeId - }); - }); -} -/** - * Create a new web worker that has model syncing capabilities built in. - * Specify an AMD module to load that will `create` an object that will be proxied. - */ -function createWebWorker(opts) { - return Object(_common_services_webWorker_js__WEBPACK_IMPORTED_MODULE_12__["createWebWorker"])(_standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modelService.get(), opts); -} -/** - * Colorize the contents of `domNode` using attribute `data-lang`. - */ -function colorizeElement(domNode, options) { - const themeService = _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].standaloneThemeService.get(); - themeService.registerEditorContainer(domNode); - return _colorizer_js__WEBPACK_IMPORTED_MODULE_14__["Colorizer"].colorizeElement(themeService, _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modeService.get(), domNode, options); -} -/** - * Colorize `text` using language `languageId`. - */ -function colorize(text, languageId, options) { - const themeService = _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].standaloneThemeService.get(); - themeService.registerEditorContainer(document.body); - return _colorizer_js__WEBPACK_IMPORTED_MODULE_14__["Colorizer"].colorize(_standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modeService.get(), text, languageId, options); -} -/** - * Colorize a line in a model. - */ -function colorizeModelLine(model, lineNumber, tabSize = 4) { - const themeService = _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].standaloneThemeService.get(); - themeService.registerEditorContainer(document.body); - return _colorizer_js__WEBPACK_IMPORTED_MODULE_14__["Colorizer"].colorizeModelLine(model, lineNumber, tabSize); -} -/** - * @internal - */ -function getSafeTokenizationSupport(language) { - let tokenizationSupport = _common_modes_js__WEBPACK_IMPORTED_MODULE_8__["TokenizationRegistry"].get(language); - if (tokenizationSupport) { - return tokenizationSupport; - } - return { - getInitialState: () => _common_modes_nullMode_js__WEBPACK_IMPORTED_MODULE_9__["NULL_STATE"], - tokenize: (line, state, deltaOffset) => Object(_common_modes_nullMode_js__WEBPACK_IMPORTED_MODULE_9__["nullTokenize"])(language, line, state, deltaOffset) - }; -} -/** - * Tokenize `text` using language `languageId` - */ -function tokenize(text, languageId) { - let modeService = _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].modeService.get(); - // Needed in order to get the mode registered for subsequent look-ups - modeService.triggerMode(languageId); - let tokenizationSupport = getSafeTokenizationSupport(languageId); - let lines = text.split(/\r\n|\r|\n/); - let result = []; - let state = tokenizationSupport.getInitialState(); - for (let i = 0, len = lines.length; i < len; i++) { - let line = lines[i]; - let tokenizationResult = tokenizationSupport.tokenize(line, state, 0); - result[i] = tokenizationResult.tokens; - state = tokenizationResult.endState; - } - return result; -} -/** - * Define a new theme or update an existing theme. - */ -function defineTheme(themeName, themeData) { - _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].standaloneThemeService.get().defineTheme(themeName, themeData); -} -/** - * Switches to a theme. - */ -function setTheme(themeName) { - _standaloneServices_js__WEBPACK_IMPORTED_MODULE_17__["StaticServices"].standaloneThemeService.get().setTheme(themeName); -} -/** - * Clears all cached font measurements and triggers re-measurement. - */ -function remeasureFonts() { - Object(_browser_config_configuration_js__WEBPACK_IMPORTED_MODULE_28__["clearAllFontInfos"])(); -} -/** - * @internal - */ -function createMonacoEditorAPI() { - return { - // methods - create: create, - onDidCreateEditor: onDidCreateEditor, - createDiffEditor: createDiffEditor, - createDiffNavigator: createDiffNavigator, - createModel: createModel, - setModelLanguage: setModelLanguage, - setModelMarkers: setModelMarkers, - getModelMarkers: getModelMarkers, - getModels: getModels, - getModel: getModel, - onDidCreateModel: onDidCreateModel, - onWillDisposeModel: onWillDisposeModel, - onDidChangeModelLanguage: onDidChangeModelLanguage, - createWebWorker: createWebWorker, - colorizeElement: colorizeElement, - colorize: colorize, - colorizeModelLine: colorizeModelLine, - tokenize: tokenize, - defineTheme: defineTheme, - setTheme: setTheme, - remeasureFonts: remeasureFonts, - // enums - AccessibilitySupport: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["AccessibilitySupport"], - ContentWidgetPositionPreference: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["ContentWidgetPositionPreference"], - CursorChangeReason: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["CursorChangeReason"], - DefaultEndOfLine: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["DefaultEndOfLine"], - EditorAutoIndentStrategy: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["EditorAutoIndentStrategy"], - EditorOption: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["EditorOption"], - EndOfLinePreference: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["EndOfLinePreference"], - EndOfLineSequence: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["EndOfLineSequence"], - MinimapPosition: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["MinimapPosition"], - MouseTargetType: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["MouseTargetType"], - OverlayWidgetPositionPreference: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["OverlayWidgetPositionPreference"], - OverviewRulerLane: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["OverviewRulerLane"], - RenderLineNumbersType: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["RenderLineNumbersType"], - RenderMinimap: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["RenderMinimap"], - ScrollbarVisibility: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["ScrollbarVisibility"], - ScrollType: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["ScrollType"], - TextEditorCursorBlinkingStyle: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["TextEditorCursorBlinkingStyle"], - TextEditorCursorStyle: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["TextEditorCursorStyle"], - TrackedRangeStickiness: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["TrackedRangeStickiness"], - WrappingIndent: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_13__["WrappingIndent"], - // classes - ConfigurationChangedEvent: _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["ConfigurationChangedEvent"], - BareFontInfo: _common_config_fontInfo_js__WEBPACK_IMPORTED_MODULE_5__["BareFontInfo"], - FontInfo: _common_config_fontInfo_js__WEBPACK_IMPORTED_MODULE_5__["FontInfo"], - TextModelResolvedOptions: _common_model_js__WEBPACK_IMPORTED_MODULE_7__["TextModelResolvedOptions"], - FindMatch: _common_model_js__WEBPACK_IMPORTED_MODULE_7__["FindMatch"], - // vars - EditorType: _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_6__["EditorType"], - EditorOptions: _common_config_editorOptions_js__WEBPACK_IMPORTED_MODULE_4__["EditorOptions"] - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneLanguages.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneLanguages.js ***! - \********************************************************************************************/ -/*! exports provided: register, getLanguages, getEncodedLanguageId, onLanguage, setLanguageConfiguration, EncodedTokenizationSupport2Adapter, TokenizationSupport2Adapter, setTokensProvider, setMonarchTokensProvider, registerReferenceProvider, registerRenameProvider, registerSignatureHelpProvider, registerHoverProvider, registerDocumentSymbolProvider, registerDocumentHighlightProvider, registerOnTypeRenameProvider, registerDefinitionProvider, registerImplementationProvider, registerTypeDefinitionProvider, registerCodeLensProvider, registerCodeActionProvider, registerDocumentFormattingEditProvider, registerDocumentRangeFormattingEditProvider, registerOnTypeFormattingEditProvider, registerLinkProvider, registerCompletionItemProvider, registerColorProvider, registerFoldingRangeProvider, registerDeclarationProvider, registerSelectionRangeProvider, registerDocumentSemanticTokensProvider, registerDocumentRangeSemanticTokensProvider, createMonacoLanguagesAPI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "register", function() { return register; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLanguages", function() { return getLanguages; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEncodedLanguageId", function() { return getEncodedLanguageId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onLanguage", function() { return onLanguage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLanguageConfiguration", function() { return setLanguageConfiguration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EncodedTokenizationSupport2Adapter", function() { return EncodedTokenizationSupport2Adapter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationSupport2Adapter", function() { return TokenizationSupport2Adapter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTokensProvider", function() { return setTokensProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMonarchTokensProvider", function() { return setMonarchTokensProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerReferenceProvider", function() { return registerReferenceProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerRenameProvider", function() { return registerRenameProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerSignatureHelpProvider", function() { return registerSignatureHelpProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerHoverProvider", function() { return registerHoverProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerDocumentSymbolProvider", function() { return registerDocumentSymbolProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerDocumentHighlightProvider", function() { return registerDocumentHighlightProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerOnTypeRenameProvider", function() { return registerOnTypeRenameProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerDefinitionProvider", function() { return registerDefinitionProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerImplementationProvider", function() { return registerImplementationProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerTypeDefinitionProvider", function() { return registerTypeDefinitionProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerCodeLensProvider", function() { return registerCodeLensProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerCodeActionProvider", function() { return registerCodeActionProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerDocumentFormattingEditProvider", function() { return registerDocumentFormattingEditProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerDocumentRangeFormattingEditProvider", function() { return registerDocumentRangeFormattingEditProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerOnTypeFormattingEditProvider", function() { return registerOnTypeFormattingEditProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerLinkProvider", function() { return registerLinkProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerCompletionItemProvider", function() { return registerCompletionItemProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerColorProvider", function() { return registerColorProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerFoldingRangeProvider", function() { return registerFoldingRangeProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerDeclarationProvider", function() { return registerDeclarationProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerSelectionRangeProvider", function() { return registerSelectionRangeProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerDocumentSemanticTokensProvider", function() { return registerDocumentSemanticTokensProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerDocumentRangeSemanticTokensProvider", function() { return registerDocumentRangeSemanticTokensProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMonacoLanguagesAPI", function() { return createMonacoLanguagesAPI; }); -/* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _common_core_token_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/token.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/modes/languageConfigurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/languageConfigurationRegistry.js"); -/* harmony import */ var _common_modes_modesRegistry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/modes/modesRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/modesRegistry.js"); -/* harmony import */ var _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/standalone/standaloneEnums.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js"); -/* harmony import */ var _standaloneServices_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./standaloneServices.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js"); -/* harmony import */ var _common_monarch_monarchCompile_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/monarch/monarchCompile.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchCompile.js"); -/* harmony import */ var _common_monarch_monarchLexer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/monarch/monarchLexer.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchLexer.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -/** - * Register information about a new language. - */ -function register(language) { - _common_modes_modesRegistry_js__WEBPACK_IMPORTED_MODULE_4__["ModesRegistry"].registerLanguage(language); -} -/** - * Get the information of all the registered languages. - */ -function getLanguages() { - let result = []; - result = result.concat(_common_modes_modesRegistry_js__WEBPACK_IMPORTED_MODULE_4__["ModesRegistry"].getLanguages()); - return result; -} -function getEncodedLanguageId(languageId) { - let lid = _standaloneServices_js__WEBPACK_IMPORTED_MODULE_6__["StaticServices"].modeService.get().getLanguageIdentifier(languageId); - return lid ? lid.id : 0; -} -/** - * An event emitted when a language is first time needed (e.g. a model has it set). - * @event - */ -function onLanguage(languageId, callback) { - let disposable = _standaloneServices_js__WEBPACK_IMPORTED_MODULE_6__["StaticServices"].modeService.get().onDidCreateMode((mode) => { - if (mode.getId() === languageId) { - // stop listening - disposable.dispose(); - // invoke actual listener - callback(); - } - }); - return disposable; -} -/** - * Set the editing configuration for a language. - */ -function setLanguageConfiguration(languageId, configuration) { - let languageIdentifier = _standaloneServices_js__WEBPACK_IMPORTED_MODULE_6__["StaticServices"].modeService.get().getLanguageIdentifier(languageId); - if (!languageIdentifier) { - throw new Error(`Cannot set configuration for unknown language ${languageId}`); - } - return _common_modes_languageConfigurationRegistry_js__WEBPACK_IMPORTED_MODULE_3__["LanguageConfigurationRegistry"].register(languageIdentifier, configuration); -} -/** - * @internal - */ -class EncodedTokenizationSupport2Adapter { - constructor(actual) { - this._actual = actual; - } - getInitialState() { - return this._actual.getInitialState(); - } - tokenize(line, state, offsetDelta) { - throw new Error('Not supported!'); - } - tokenize2(line, state) { - let result = this._actual.tokenizeEncoded(line, state); - return new _common_core_token_js__WEBPACK_IMPORTED_MODULE_1__["TokenizationResult2"](result.tokens, result.endState); - } -} -/** - * @internal - */ -class TokenizationSupport2Adapter { - constructor(standaloneThemeService, languageIdentifier, actual) { - this._standaloneThemeService = standaloneThemeService; - this._languageIdentifier = languageIdentifier; - this._actual = actual; - } - getInitialState() { - return this._actual.getInitialState(); - } - _toClassicTokens(tokens, language, offsetDelta) { - let result = []; - let previousStartIndex = 0; - for (let i = 0, len = tokens.length; i < len; i++) { - const t = tokens[i]; - let startIndex = t.startIndex; - // Prevent issues stemming from a buggy external tokenizer. - if (i === 0) { - // Force first token to start at first index! - startIndex = 0; - } - else if (startIndex < previousStartIndex) { - // Force tokens to be after one another! - startIndex = previousStartIndex; - } - result[i] = new _common_core_token_js__WEBPACK_IMPORTED_MODULE_1__["Token"](startIndex + offsetDelta, t.scopes, language); - previousStartIndex = startIndex; - } - return result; - } - tokenize(line, state, offsetDelta) { - let actualResult = this._actual.tokenize(line, state); - let tokens = this._toClassicTokens(actualResult.tokens, this._languageIdentifier.language, offsetDelta); - let endState; - // try to save an object if possible - if (actualResult.endState.equals(state)) { - endState = state; - } - else { - endState = actualResult.endState; - } - return new _common_core_token_js__WEBPACK_IMPORTED_MODULE_1__["TokenizationResult"](tokens, endState); - } - _toBinaryTokens(tokens, offsetDelta) { - const languageId = this._languageIdentifier.id; - const tokenTheme = this._standaloneThemeService.getColorTheme().tokenTheme; - let result = [], resultLen = 0; - let previousStartIndex = 0; - for (let i = 0, len = tokens.length; i < len; i++) { - const t = tokens[i]; - const metadata = tokenTheme.match(languageId, t.scopes); - if (resultLen > 0 && result[resultLen - 1] === metadata) { - // same metadata - continue; - } - let startIndex = t.startIndex; - // Prevent issues stemming from a buggy external tokenizer. - if (i === 0) { - // Force first token to start at first index! - startIndex = 0; - } - else if (startIndex < previousStartIndex) { - // Force tokens to be after one another! - startIndex = previousStartIndex; - } - result[resultLen++] = startIndex + offsetDelta; - result[resultLen++] = metadata; - previousStartIndex = startIndex; - } - let actualResult = new Uint32Array(resultLen); - for (let i = 0; i < resultLen; i++) { - actualResult[i] = result[i]; - } - return actualResult; - } - tokenize2(line, state, offsetDelta) { - let actualResult = this._actual.tokenize(line, state); - let tokens = this._toBinaryTokens(actualResult.tokens, offsetDelta); - let endState; - // try to save an object if possible - if (actualResult.endState.equals(state)) { - endState = state; - } - else { - endState = actualResult.endState; - } - return new _common_core_token_js__WEBPACK_IMPORTED_MODULE_1__["TokenizationResult2"](tokens, endState); - } -} -function isEncodedTokensProvider(provider) { - return 'tokenizeEncoded' in provider; -} -function isThenable(obj) { - return obj && typeof obj.then === 'function'; -} -/** - * Set the tokens provider for a language (manual implementation). - */ -function setTokensProvider(languageId, provider) { - let languageIdentifier = _standaloneServices_js__WEBPACK_IMPORTED_MODULE_6__["StaticServices"].modeService.get().getLanguageIdentifier(languageId); - if (!languageIdentifier) { - throw new Error(`Cannot set tokens provider for unknown language ${languageId}`); - } - const create = (provider) => { - if (isEncodedTokensProvider(provider)) { - return new EncodedTokenizationSupport2Adapter(provider); - } - else { - return new TokenizationSupport2Adapter(_standaloneServices_js__WEBPACK_IMPORTED_MODULE_6__["StaticServices"].standaloneThemeService.get(), languageIdentifier, provider); - } - }; - if (isThenable(provider)) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["TokenizationRegistry"].registerPromise(languageId, provider.then(provider => create(provider))); - } - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["TokenizationRegistry"].register(languageId, create(provider)); -} -/** - * Set the tokens provider for a language (monarch implementation). - */ -function setMonarchTokensProvider(languageId, languageDef) { - const create = (languageDef) => { - return Object(_common_monarch_monarchLexer_js__WEBPACK_IMPORTED_MODULE_8__["createTokenizationSupport"])(_standaloneServices_js__WEBPACK_IMPORTED_MODULE_6__["StaticServices"].modeService.get(), _standaloneServices_js__WEBPACK_IMPORTED_MODULE_6__["StaticServices"].standaloneThemeService.get(), languageId, Object(_common_monarch_monarchCompile_js__WEBPACK_IMPORTED_MODULE_7__["compile"])(languageId, languageDef)); - }; - if (isThenable(languageDef)) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["TokenizationRegistry"].registerPromise(languageId, languageDef.then(languageDef => create(languageDef))); - } - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["TokenizationRegistry"].register(languageId, create(languageDef)); -} -/** - * Register a reference provider (used by e.g. reference search). - */ -function registerReferenceProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["ReferenceProviderRegistry"].register(languageId, provider); -} -/** - * Register a rename provider (used by e.g. rename symbol). - */ -function registerRenameProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["RenameProviderRegistry"].register(languageId, provider); -} -/** - * Register a signature help provider (used by e.g. parameter hints). - */ -function registerSignatureHelpProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["SignatureHelpProviderRegistry"].register(languageId, provider); -} -/** - * Register a hover provider (used by e.g. editor hover). - */ -function registerHoverProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["HoverProviderRegistry"].register(languageId, { - provideHover: (model, position, token) => { - let word = model.getWordAtPosition(position); - return Promise.resolve(provider.provideHover(model, position, token)).then((value) => { - if (!value) { - return undefined; - } - if (!value.range && word) { - value.range = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](position.lineNumber, word.startColumn, position.lineNumber, word.endColumn); - } - if (!value.range) { - value.range = new _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"](position.lineNumber, position.column, position.lineNumber, position.column); - } - return value; - }); - } - }); -} -/** - * Register a document symbol provider (used by e.g. outline). - */ -function registerDocumentSymbolProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["DocumentSymbolProviderRegistry"].register(languageId, provider); -} -/** - * Register a document highlight provider (used by e.g. highlight occurrences). - */ -function registerDocumentHighlightProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["DocumentHighlightProviderRegistry"].register(languageId, provider); -} -/** - * Register an on type rename provider. - */ -function registerOnTypeRenameProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["OnTypeRenameProviderRegistry"].register(languageId, provider); -} -/** - * Register a definition provider (used by e.g. go to definition). - */ -function registerDefinitionProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["DefinitionProviderRegistry"].register(languageId, provider); -} -/** - * Register a implementation provider (used by e.g. go to implementation). - */ -function registerImplementationProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["ImplementationProviderRegistry"].register(languageId, provider); -} -/** - * Register a type definition provider (used by e.g. go to type definition). - */ -function registerTypeDefinitionProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["TypeDefinitionProviderRegistry"].register(languageId, provider); -} -/** - * Register a code lens provider (used by e.g. inline code lenses). - */ -function registerCodeLensProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["CodeLensProviderRegistry"].register(languageId, provider); -} -/** - * Register a code action provider (used by e.g. quick fix). - */ -function registerCodeActionProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["CodeActionProviderRegistry"].register(languageId, { - provideCodeActions: (model, range, context, token) => { - let markers = _standaloneServices_js__WEBPACK_IMPORTED_MODULE_6__["StaticServices"].markerService.get().read({ resource: model.uri }).filter(m => { - return _common_core_range_js__WEBPACK_IMPORTED_MODULE_0__["Range"].areIntersectingOrTouching(m, range); - }); - return provider.provideCodeActions(model, range, { markers, only: context.only }, token); - } - }); -} -/** - * Register a formatter that can handle only entire models. - */ -function registerDocumentFormattingEditProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["DocumentFormattingEditProviderRegistry"].register(languageId, provider); -} -/** - * Register a formatter that can handle a range inside a model. - */ -function registerDocumentRangeFormattingEditProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["DocumentRangeFormattingEditProviderRegistry"].register(languageId, provider); -} -/** - * Register a formatter than can do formatting as the user types. - */ -function registerOnTypeFormattingEditProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["OnTypeFormattingEditProviderRegistry"].register(languageId, provider); -} -/** - * Register a link provider that can find links in text. - */ -function registerLinkProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["LinkProviderRegistry"].register(languageId, provider); -} -/** - * Register a completion item provider (use by e.g. suggestions). - */ -function registerCompletionItemProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["CompletionProviderRegistry"].register(languageId, provider); -} -/** - * Register a document color provider (used by Color Picker, Color Decorator). - */ -function registerColorProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["ColorProviderRegistry"].register(languageId, provider); -} -/** - * Register a folding range provider - */ -function registerFoldingRangeProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["FoldingRangeProviderRegistry"].register(languageId, provider); -} -/** - * Register a declaration provider - */ -function registerDeclarationProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["DeclarationProviderRegistry"].register(languageId, provider); -} -/** - * Register a selection range provider - */ -function registerSelectionRangeProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["SelectionRangeRegistry"].register(languageId, provider); -} -/** - * Register a document semantic tokens provider - */ -function registerDocumentSemanticTokensProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["DocumentSemanticTokensProviderRegistry"].register(languageId, provider); -} -/** - * Register a document range semantic tokens provider - */ -function registerDocumentRangeSemanticTokensProvider(languageId, provider) { - return _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["DocumentRangeSemanticTokensProviderRegistry"].register(languageId, provider); -} -/** - * @internal - */ -function createMonacoLanguagesAPI() { - return { - register: register, - getLanguages: getLanguages, - onLanguage: onLanguage, - getEncodedLanguageId: getEncodedLanguageId, - // provider methods - setLanguageConfiguration: setLanguageConfiguration, - setTokensProvider: setTokensProvider, - setMonarchTokensProvider: setMonarchTokensProvider, - registerReferenceProvider: registerReferenceProvider, - registerRenameProvider: registerRenameProvider, - registerCompletionItemProvider: registerCompletionItemProvider, - registerSignatureHelpProvider: registerSignatureHelpProvider, - registerHoverProvider: registerHoverProvider, - registerDocumentSymbolProvider: registerDocumentSymbolProvider, - registerDocumentHighlightProvider: registerDocumentHighlightProvider, - registerOnTypeRenameProvider: registerOnTypeRenameProvider, - registerDefinitionProvider: registerDefinitionProvider, - registerImplementationProvider: registerImplementationProvider, - registerTypeDefinitionProvider: registerTypeDefinitionProvider, - registerCodeLensProvider: registerCodeLensProvider, - registerCodeActionProvider: registerCodeActionProvider, - registerDocumentFormattingEditProvider: registerDocumentFormattingEditProvider, - registerDocumentRangeFormattingEditProvider: registerDocumentRangeFormattingEditProvider, - registerOnTypeFormattingEditProvider: registerOnTypeFormattingEditProvider, - registerLinkProvider: registerLinkProvider, - registerColorProvider: registerColorProvider, - registerFoldingRangeProvider: registerFoldingRangeProvider, - registerDeclarationProvider: registerDeclarationProvider, - registerSelectionRangeProvider: registerSelectionRangeProvider, - registerDocumentSemanticTokensProvider: registerDocumentSemanticTokensProvider, - registerDocumentRangeSemanticTokensProvider: registerDocumentRangeSemanticTokensProvider, - // enums - DocumentHighlightKind: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_5__["DocumentHighlightKind"], - CompletionItemKind: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"], - CompletionItemTag: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemTag"], - CompletionItemInsertTextRule: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemInsertTextRule"], - SymbolKind: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_5__["SymbolKind"], - SymbolTag: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_5__["SymbolTag"], - IndentAction: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_5__["IndentAction"], - CompletionTriggerKind: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_5__["CompletionTriggerKind"], - SignatureHelpTriggerKind: _common_standalone_standaloneEnums_js__WEBPACK_IMPORTED_MODULE_5__["SignatureHelpTriggerKind"], - // classes - FoldingRangeKind: _common_modes_js__WEBPACK_IMPORTED_MODULE_2__["FoldingRangeKind"], - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js ***! - \*******************************************************************************************/ -/*! exports provided: StaticServices, DynamicStandaloneServices */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticServices", function() { return StaticServices; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DynamicStandaloneServices", function() { return DynamicStandaloneServices; }); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _browser_services_bulkEditService_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../browser/services/bulkEditService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/bulkEditService.js"); -/* harmony import */ var _browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../browser/services/codeEditorService.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/services/codeEditorService.js"); -/* harmony import */ var _common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/services/editorWorkerService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerService.js"); -/* harmony import */ var _common_services_editorWorkerServiceImpl_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/services/editorWorkerServiceImpl.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerServiceImpl.js"); -/* harmony import */ var _common_services_modeService_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/services/modeService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modeService.js"); -/* harmony import */ var _common_services_modeServiceImpl_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common/services/modeServiceImpl.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modeServiceImpl.js"); -/* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../common/services/modelService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelService.js"); -/* harmony import */ var _common_services_modelServiceImpl_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../common/services/modelServiceImpl.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/modelServiceImpl.js"); -/* harmony import */ var _common_services_textResourceConfigurationService_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/services/textResourceConfigurationService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/textResourceConfigurationService.js"); -/* harmony import */ var _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./simpleServices.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/simpleServices.js"); -/* harmony import */ var _standaloneCodeServiceImpl_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./standaloneCodeServiceImpl.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeServiceImpl.js"); -/* harmony import */ var _standaloneThemeServiceImpl_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./standaloneThemeServiceImpl.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneThemeServiceImpl.js"); -/* harmony import */ var _common_standaloneThemeService_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/standaloneThemeService.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/standaloneThemeService.js"); -/* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../platform/actions/common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../platform/commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../platform/configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/* harmony import */ var _platform_contextkey_browser_contextKeyService_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../platform/contextkey/browser/contextKeyService.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/browser/contextKeyService.js"); -/* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../platform/contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _platform_contextview_browser_contextMenuService_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../platform/contextview/browser/contextMenuService.js */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextMenuService.js"); -/* harmony import */ var _platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../platform/contextview/browser/contextView.js */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextView.js"); -/* harmony import */ var _platform_contextview_browser_contextViewService_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../platform/contextview/browser/contextViewService.js */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextViewService.js"); -/* harmony import */ var _platform_dialogs_common_dialogs_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../../platform/dialogs/common/dialogs.js */ "./node_modules/monaco-editor/esm/vs/platform/dialogs/common/dialogs.js"); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _platform_instantiation_common_instantiationService_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiationService.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiationService.js"); -/* harmony import */ var _platform_instantiation_common_serviceCollection_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../../platform/instantiation/common/serviceCollection.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js"); -/* harmony import */ var _platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../../platform/keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _platform_label_common_label_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../../platform/label/common/label.js */ "./node_modules/monaco-editor/esm/vs/platform/label/common/label.js"); -/* harmony import */ var _platform_list_browser_listService_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../../../platform/list/browser/listService.js */ "./node_modules/monaco-editor/esm/vs/platform/list/browser/listService.js"); -/* harmony import */ var _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../../platform/log/common/log.js */ "./node_modules/monaco-editor/esm/vs/platform/log/common/log.js"); -/* harmony import */ var _platform_markers_common_markerService_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../../platform/markers/common/markerService.js */ "./node_modules/monaco-editor/esm/vs/platform/markers/common/markerService.js"); -/* harmony import */ var _platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../../platform/markers/common/markers.js */ "./node_modules/monaco-editor/esm/vs/platform/markers/common/markers.js"); -/* harmony import */ var _platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../../platform/notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../../../platform/progress/common/progress.js */ "./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js"); -/* harmony import */ var _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../../../platform/storage/common/storage.js */ "./node_modules/monaco-editor/esm/vs/platform/storage/common/storage.js"); -/* harmony import */ var _platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../../../platform/telemetry/common/telemetry.js */ "./node_modules/monaco-editor/esm/vs/platform/telemetry/common/telemetry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _platform_workspace_common_workspace_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../../../platform/workspace/common/workspace.js */ "./node_modules/monaco-editor/esm/vs/platform/workspace/common/workspace.js"); -/* harmony import */ var _platform_actions_common_menuService_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../../../platform/actions/common/menuService.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/menuService.js"); -/* harmony import */ var _common_services_markersDecorationService_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../../common/services/markersDecorationService.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/markersDecorationService.js"); -/* harmony import */ var _common_services_markerDecorationsServiceImpl_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../../common/services/markerDecorationsServiceImpl.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/markerDecorationsServiceImpl.js"); -/* harmony import */ var _platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../../../platform/accessibility/common/accessibility.js */ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js"); -/* harmony import */ var _platform_layout_browser_layoutService_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../../../platform/layout/browser/layoutService.js */ "./node_modules/monaco-editor/esm/vs/platform/layout/browser/layoutService.js"); -/* harmony import */ var _platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ../../../platform/instantiation/common/extensions.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/extensions.js"); -/* harmony import */ var _platform_accessibility_common_accessibilityService_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ../../../platform/accessibility/common/accessibilityService.js */ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibilityService.js"); -/* harmony import */ var _platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ../../../platform/clipboard/common/clipboardService.js */ "./node_modules/monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js"); -/* harmony import */ var _platform_clipboard_browser_clipboardService_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ../../../platform/clipboard/browser/clipboardService.js */ "./node_modules/monaco-editor/esm/vs/platform/clipboard/browser/clipboardService.js"); -/* harmony import */ var _platform_undoRedo_common_undoRedo_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ../../../platform/undoRedo/common/undoRedo.js */ "./node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js"); -/* harmony import */ var _platform_undoRedo_common_undoRedoService_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ../../../platform/undoRedo/common/undoRedoService.js */ "./node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedoService.js"); -/* harmony import */ var _quickInput_standaloneQuickInputServiceImpl_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./quickInput/standaloneQuickInputServiceImpl.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputServiceImpl.js"); -/* harmony import */ var _platform_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ../../../platform/quickinput/common/quickInput.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickInput.js"); -/* harmony import */ var _platform_userDataSync_common_storageKeys_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ../../../platform/userDataSync/common/storageKeys.js */ "./node_modules/monaco-editor/esm/vs/platform/userDataSync/common/storageKeys.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var StaticServices; -(function (StaticServices) { - const _serviceCollection = new _platform_instantiation_common_serviceCollection_js__WEBPACK_IMPORTED_MODULE_25__["ServiceCollection"](); - class LazyStaticService { - constructor(serviceId, factory) { - this._serviceId = serviceId; - this._factory = factory; - this._value = null; - } - get id() { return this._serviceId; } - get(overrides) { - if (!this._value) { - if (overrides) { - this._value = overrides[this._serviceId.toString()]; - } - if (!this._value) { - this._value = this._factory(overrides); - } - if (!this._value) { - throw new Error('Service ' + this._serviceId + ' is missing!'); - } - _serviceCollection.set(this._serviceId, this._value); - } - return this._value; - } - } - StaticServices.LazyStaticService = LazyStaticService; - let _all = []; - function define(serviceId, factory) { - let r = new LazyStaticService(serviceId, factory); - _all.push(r); - return r; - } - function init(overrides) { - // Create a fresh service collection - let result = new _platform_instantiation_common_serviceCollection_js__WEBPACK_IMPORTED_MODULE_25__["ServiceCollection"](); - // make sure to add all services that use `registerSingleton` - for (const [id, descriptor] of Object(_platform_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_43__["getSingletonServiceDescriptors"])()) { - result.set(id, descriptor); - } - // Initialize the service collection with the overrides - for (let serviceId in overrides) { - if (overrides.hasOwnProperty(serviceId)) { - result.set(Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_23__["createDecorator"])(serviceId), overrides[serviceId]); - } - } - // Make sure the same static services are present in all service collections - _all.forEach(service => result.set(service.id, service.get(overrides))); - // Ensure the collection gets the correct instantiation service - let instantiationService = new _platform_instantiation_common_instantiationService_js__WEBPACK_IMPORTED_MODULE_24__["InstantiationService"](result, true); - result.set(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_23__["IInstantiationService"], instantiationService); - return [result, instantiationService]; - } - StaticServices.init = init; - StaticServices.instantiationService = define(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_23__["IInstantiationService"], () => new _platform_instantiation_common_instantiationService_js__WEBPACK_IMPORTED_MODULE_24__["InstantiationService"](_serviceCollection, true)); - const configurationServiceImpl = new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["SimpleConfigurationService"](); - StaticServices.configurationService = define(_platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_16__["IConfigurationService"], () => configurationServiceImpl); - StaticServices.resourceConfigurationService = define(_common_services_textResourceConfigurationService_js__WEBPACK_IMPORTED_MODULE_9__["ITextResourceConfigurationService"], () => new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["SimpleResourceConfigurationService"](configurationServiceImpl)); - StaticServices.resourcePropertiesService = define(_common_services_textResourceConfigurationService_js__WEBPACK_IMPORTED_MODULE_9__["ITextResourcePropertiesService"], () => new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["SimpleResourcePropertiesService"](configurationServiceImpl)); - StaticServices.contextService = define(_platform_workspace_common_workspace_js__WEBPACK_IMPORTED_MODULE_37__["IWorkspaceContextService"], () => new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["SimpleWorkspaceContextService"]()); - StaticServices.labelService = define(_platform_label_common_label_js__WEBPACK_IMPORTED_MODULE_27__["ILabelService"], () => new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["SimpleUriLabelService"]()); - StaticServices.telemetryService = define(_platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_35__["ITelemetryService"], () => new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["StandaloneTelemetryService"]()); - StaticServices.dialogService = define(_platform_dialogs_common_dialogs_js__WEBPACK_IMPORTED_MODULE_22__["IDialogService"], () => new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["SimpleDialogService"]()); - StaticServices.notificationService = define(_platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_32__["INotificationService"], () => new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["SimpleNotificationService"]()); - StaticServices.markerService = define(_platform_markers_common_markers_js__WEBPACK_IMPORTED_MODULE_31__["IMarkerService"], () => new _platform_markers_common_markerService_js__WEBPACK_IMPORTED_MODULE_30__["MarkerService"]()); - StaticServices.modeService = define(_common_services_modeService_js__WEBPACK_IMPORTED_MODULE_5__["IModeService"], (o) => new _common_services_modeServiceImpl_js__WEBPACK_IMPORTED_MODULE_6__["ModeServiceImpl"]()); - StaticServices.standaloneThemeService = define(_common_standaloneThemeService_js__WEBPACK_IMPORTED_MODULE_13__["IStandaloneThemeService"], () => new _standaloneThemeServiceImpl_js__WEBPACK_IMPORTED_MODULE_12__["StandaloneThemeServiceImpl"]()); - StaticServices.logService = define(_platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_29__["ILogService"], () => new _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_29__["ConsoleLogService"]()); - StaticServices.undoRedoService = define(_platform_undoRedo_common_undoRedo_js__WEBPACK_IMPORTED_MODULE_47__["IUndoRedoService"], (o) => new _platform_undoRedo_common_undoRedoService_js__WEBPACK_IMPORTED_MODULE_48__["UndoRedoService"](StaticServices.dialogService.get(o), StaticServices.notificationService.get(o))); - StaticServices.modelService = define(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_7__["IModelService"], (o) => new _common_services_modelServiceImpl_js__WEBPACK_IMPORTED_MODULE_8__["ModelServiceImpl"](StaticServices.configurationService.get(o), StaticServices.resourcePropertiesService.get(o), StaticServices.standaloneThemeService.get(o), StaticServices.logService.get(o), StaticServices.undoRedoService.get(o))); - StaticServices.markerDecorationsService = define(_common_services_markersDecorationService_js__WEBPACK_IMPORTED_MODULE_39__["IMarkerDecorationsService"], (o) => new _common_services_markerDecorationsServiceImpl_js__WEBPACK_IMPORTED_MODULE_40__["MarkerDecorationsService"](StaticServices.modelService.get(o), StaticServices.markerService.get(o))); - StaticServices.codeEditorService = define(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_2__["ICodeEditorService"], (o) => new _standaloneCodeServiceImpl_js__WEBPACK_IMPORTED_MODULE_11__["StandaloneCodeEditorServiceImpl"](StaticServices.standaloneThemeService.get(o))); - StaticServices.editorProgressService = define(_platform_progress_common_progress_js__WEBPACK_IMPORTED_MODULE_33__["IEditorProgressService"], () => new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["SimpleEditorProgressService"]()); - StaticServices.storageService = define(_platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_34__["IStorageService"], () => new _platform_storage_common_storage_js__WEBPACK_IMPORTED_MODULE_34__["InMemoryStorageService"]()); - StaticServices.storageSyncService = define(_platform_userDataSync_common_storageKeys_js__WEBPACK_IMPORTED_MODULE_51__["IStorageKeysSyncRegistryService"], () => new _platform_userDataSync_common_storageKeys_js__WEBPACK_IMPORTED_MODULE_51__["StorageKeysSyncRegistryService"]()); - StaticServices.editorWorkerService = define(_common_services_editorWorkerService_js__WEBPACK_IMPORTED_MODULE_3__["IEditorWorkerService"], (o) => new _common_services_editorWorkerServiceImpl_js__WEBPACK_IMPORTED_MODULE_4__["EditorWorkerServiceImpl"](StaticServices.modelService.get(o), StaticServices.resourceConfigurationService.get(o), StaticServices.logService.get(o))); -})(StaticServices || (StaticServices = {})); -class DynamicStandaloneServices extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["Disposable"] { - constructor(domElement, overrides) { - super(); - const [_serviceCollection, _instantiationService] = StaticServices.init(overrides); - this._serviceCollection = _serviceCollection; - this._instantiationService = _instantiationService; - const configurationService = this.get(_platform_configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_16__["IConfigurationService"]); - const notificationService = this.get(_platform_notification_common_notification_js__WEBPACK_IMPORTED_MODULE_32__["INotificationService"]); - const telemetryService = this.get(_platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_35__["ITelemetryService"]); - const themeService = this.get(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_36__["IThemeService"]); - const logService = this.get(_platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_29__["ILogService"]); - let ensure = (serviceId, factory) => { - let value = null; - if (overrides) { - value = overrides[serviceId.toString()]; - } - if (!value) { - value = factory(); - } - this._serviceCollection.set(serviceId, value); - return value; - }; - let contextKeyService = ensure(_platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_18__["IContextKeyService"], () => this._register(new _platform_contextkey_browser_contextKeyService_js__WEBPACK_IMPORTED_MODULE_17__["ContextKeyService"](configurationService))); - ensure(_platform_accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_41__["IAccessibilityService"], () => new _platform_accessibility_common_accessibilityService_js__WEBPACK_IMPORTED_MODULE_44__["AccessibilityService"](contextKeyService, configurationService)); - ensure(_platform_list_browser_listService_js__WEBPACK_IMPORTED_MODULE_28__["IListService"], () => new _platform_list_browser_listService_js__WEBPACK_IMPORTED_MODULE_28__["ListService"](themeService)); - let commandService = ensure(_platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_15__["ICommandService"], () => new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["StandaloneCommandService"](this._instantiationService)); - let keybindingService = ensure(_platform_keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_26__["IKeybindingService"], () => this._register(new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["StandaloneKeybindingService"](contextKeyService, commandService, telemetryService, notificationService, logService, domElement))); - let layoutService = ensure(_platform_layout_browser_layoutService_js__WEBPACK_IMPORTED_MODULE_42__["ILayoutService"], () => new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["SimpleLayoutService"](StaticServices.codeEditorService.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_2__["ICodeEditorService"]), domElement)); - ensure(_platform_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_50__["IQuickInputService"], () => new _quickInput_standaloneQuickInputServiceImpl_js__WEBPACK_IMPORTED_MODULE_49__["StandaloneQuickInputServiceImpl"](_instantiationService, StaticServices.codeEditorService.get(_browser_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_2__["ICodeEditorService"]))); - let contextViewService = ensure(_platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_20__["IContextViewService"], () => this._register(new _platform_contextview_browser_contextViewService_js__WEBPACK_IMPORTED_MODULE_21__["ContextViewService"](layoutService))); - ensure(_platform_clipboard_common_clipboardService_js__WEBPACK_IMPORTED_MODULE_45__["IClipboardService"], () => new _platform_clipboard_browser_clipboardService_js__WEBPACK_IMPORTED_MODULE_46__["BrowserClipboardService"]()); - ensure(_platform_contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_20__["IContextMenuService"], () => { - const contextMenuService = new _platform_contextview_browser_contextMenuService_js__WEBPACK_IMPORTED_MODULE_19__["ContextMenuService"](telemetryService, notificationService, contextViewService, keybindingService, themeService); - contextMenuService.configure({ blockMouse: false }); // we do not want that in the standalone editor - return this._register(contextMenuService); - }); - ensure(_platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_14__["IMenuService"], () => new _platform_actions_common_menuService_js__WEBPACK_IMPORTED_MODULE_38__["MenuService"](commandService)); - ensure(_browser_services_bulkEditService_js__WEBPACK_IMPORTED_MODULE_1__["IBulkEditService"], () => new _simpleServices_js__WEBPACK_IMPORTED_MODULE_10__["SimpleBulkEditService"](StaticServices.modelService.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_7__["IModelService"]))); - } - get(serviceId) { - let r = this._serviceCollection.get(serviceId); - if (!r) { - throw new Error('Missing service ' + serviceId); - } - return r; - } - set(serviceId, instance) { - this._serviceCollection.set(serviceId, instance); - } - has(serviceId) { - return this._serviceCollection.has(serviceId); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneThemeServiceImpl.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/standaloneThemeServiceImpl.js ***! - \***************************************************************************************************/ -/*! exports provided: StandaloneThemeServiceImpl */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandaloneThemeServiceImpl", function() { return StandaloneThemeServiceImpl; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_modes_supports_tokenization_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/modes/supports/tokenization.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/tokenization.js"); -/* harmony import */ var _common_themes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/themes.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/themes.js"); -/* harmony import */ var _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../platform/registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../platform/theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_browser_ui_codicons_codiconStyles_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../base/browser/ui/codicons/codiconStyles.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/codicons/codiconStyles.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - -const VS_THEME_NAME = 'vs'; -const VS_DARK_THEME_NAME = 'vs-dark'; -const HC_BLACK_THEME_NAME = 'hc-black'; -const colorRegistry = _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_6__["Registry"].as(_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_7__["Extensions"].ColorContribution); -const themingRegistry = _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_6__["Registry"].as(_platform_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_8__["Extensions"].ThemingContribution); -class StandaloneTheme { - constructor(name, standaloneThemeData) { - this.semanticHighlighting = false; - this.themeData = standaloneThemeData; - let base = standaloneThemeData.base; - if (name.length > 0) { - this.id = base + ' ' + name; - this.themeName = name; - } - else { - this.id = base; - this.themeName = base; - } - this.colors = null; - this.defaultColors = Object.create(null); - this._tokenTheme = null; - } - get base() { - return this.themeData.base; - } - notifyBaseUpdated() { - if (this.themeData.inherit) { - this.colors = null; - this._tokenTheme = null; - } - } - getColors() { - if (!this.colors) { - const colors = new Map(); - for (let id in this.themeData.colors) { - colors.set(id, _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex(this.themeData.colors[id])); - } - if (this.themeData.inherit) { - let baseData = getBuiltinRules(this.themeData.base); - for (let id in baseData.colors) { - if (!colors.has(id)) { - colors.set(id, _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex(baseData.colors[id])); - } - } - } - this.colors = colors; - } - return this.colors; - } - getColor(colorId, useDefault) { - const color = this.getColors().get(colorId); - if (color) { - return color; - } - if (useDefault !== false) { - return this.getDefault(colorId); - } - return undefined; - } - getDefault(colorId) { - let color = this.defaultColors[colorId]; - if (color) { - return color; - } - color = colorRegistry.resolveDefaultColor(colorId, this); - this.defaultColors[colorId] = color; - return color; - } - defines(colorId) { - return Object.prototype.hasOwnProperty.call(this.getColors(), colorId); - } - get type() { - switch (this.base) { - case VS_THEME_NAME: return 'light'; - case HC_BLACK_THEME_NAME: return 'hc'; - default: return 'dark'; - } - } - get tokenTheme() { - if (!this._tokenTheme) { - let rules = []; - let encodedTokensColors = []; - if (this.themeData.inherit) { - let baseData = getBuiltinRules(this.themeData.base); - rules = baseData.rules; - if (baseData.encodedTokensColors) { - encodedTokensColors = baseData.encodedTokensColors; - } - } - rules = rules.concat(this.themeData.rules); - if (this.themeData.encodedTokensColors) { - encodedTokensColors = this.themeData.encodedTokensColors; - } - this._tokenTheme = _common_modes_supports_tokenization_js__WEBPACK_IMPORTED_MODULE_4__["TokenTheme"].createFromRawTokenTheme(rules, encodedTokensColors); - } - return this._tokenTheme; - } - getTokenStyleMetadata(type, modifiers, modelLanguage) { - // use theme rules match - const style = this.tokenTheme._match([type].concat(modifiers).join('.')); - const metadata = style.metadata; - const foreground = _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["TokenMetadata"].getForeground(metadata); - const fontStyle = _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["TokenMetadata"].getFontStyle(metadata); - return { - foreground: foreground, - italic: Boolean(fontStyle & 1 /* Italic */), - bold: Boolean(fontStyle & 2 /* Bold */), - underline: Boolean(fontStyle & 4 /* Underline */) - }; - } -} -function isBuiltinTheme(themeName) { - return (themeName === VS_THEME_NAME - || themeName === VS_DARK_THEME_NAME - || themeName === HC_BLACK_THEME_NAME); -} -function getBuiltinRules(builtinTheme) { - switch (builtinTheme) { - case VS_THEME_NAME: - return _common_themes_js__WEBPACK_IMPORTED_MODULE_5__["vs"]; - case VS_DARK_THEME_NAME: - return _common_themes_js__WEBPACK_IMPORTED_MODULE_5__["vs_dark"]; - case HC_BLACK_THEME_NAME: - return _common_themes_js__WEBPACK_IMPORTED_MODULE_5__["hc_black"]; - } -} -function newBuiltInTheme(builtinTheme) { - let themeData = getBuiltinRules(builtinTheme); - return new StandaloneTheme(builtinTheme, themeData); -} -class StandaloneThemeServiceImpl extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["Disposable"] { - constructor() { - super(); - this._onColorThemeChange = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"]()); - this.onDidColorThemeChange = this._onColorThemeChange.event; - this._environment = Object.create(null); - this._knownThemes = new Map(); - this._knownThemes.set(VS_THEME_NAME, newBuiltInTheme(VS_THEME_NAME)); - this._knownThemes.set(VS_DARK_THEME_NAME, newBuiltInTheme(VS_DARK_THEME_NAME)); - this._knownThemes.set(HC_BLACK_THEME_NAME, newBuiltInTheme(HC_BLACK_THEME_NAME)); - this._codiconCSS = _base_browser_ui_codicons_codiconStyles_js__WEBPACK_IMPORTED_MODULE_10__["CodiconStyles"].getCSS(); - this._themeCSS = ''; - this._allCSS = `${this._codiconCSS}\n${this._themeCSS}`; - this._globalStyleElement = null; - this._styleElements = []; - this.setTheme(VS_THEME_NAME); - _base_browser_ui_codicons_codiconStyles_js__WEBPACK_IMPORTED_MODULE_10__["CodiconStyles"].onDidChange(() => { - this._codiconCSS = _base_browser_ui_codicons_codiconStyles_js__WEBPACK_IMPORTED_MODULE_10__["CodiconStyles"].getCSS(); - this._updateCSS(); - }); - } - registerEditorContainer(domNode) { - if (_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["isInShadowDOM"](domNode)) { - return this._registerShadowDomContainer(domNode); - } - return this._registerRegularEditorContainer(); - } - _registerRegularEditorContainer() { - if (!this._globalStyleElement) { - this._globalStyleElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["createStyleSheet"](); - this._globalStyleElement.className = 'monaco-colors'; - this._globalStyleElement.innerHTML = this._allCSS; - this._styleElements.push(this._globalStyleElement); - } - return _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_9__["Disposable"].None; - } - _registerShadowDomContainer(domNode) { - const styleElement = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["createStyleSheet"](domNode); - styleElement.className = 'monaco-colors'; - styleElement.innerHTML = this._allCSS; - this._styleElements.push(styleElement); - return { - dispose: () => { - for (let i = 0; i < this._styleElements.length; i++) { - if (this._styleElements[i] === styleElement) { - this._styleElements.splice(i, 1); - return; - } - } - } - }; - } - defineTheme(themeName, themeData) { - if (!/^[a-z0-9\-]+$/i.test(themeName)) { - throw new Error('Illegal theme name!'); - } - if (!isBuiltinTheme(themeData.base) && !isBuiltinTheme(themeName)) { - throw new Error('Illegal theme base!'); - } - // set or replace theme - this._knownThemes.set(themeName, new StandaloneTheme(themeName, themeData)); - if (isBuiltinTheme(themeName)) { - this._knownThemes.forEach(theme => { - if (theme.base === themeName) { - theme.notifyBaseUpdated(); - } - }); - } - if (this._theme && this._theme.themeName === themeName) { - this.setTheme(themeName); // refresh theme - } - } - getColorTheme() { - return this._theme; - } - setTheme(themeName) { - let theme; - if (this._knownThemes.has(themeName)) { - theme = this._knownThemes.get(themeName); - } - else { - theme = this._knownThemes.get(VS_THEME_NAME); - } - if (this._theme === theme) { - // Nothing to do - return theme.id; - } - this._theme = theme; - let cssRules = []; - let hasRule = {}; - let ruleCollector = { - addRule: (rule) => { - if (!hasRule[rule]) { - cssRules.push(rule); - hasRule[rule] = true; - } - } - }; - themingRegistry.getThemingParticipants().forEach(p => p(theme, ruleCollector, this._environment)); - let tokenTheme = theme.tokenTheme; - let colorMap = tokenTheme.getColorMap(); - ruleCollector.addRule(Object(_common_modes_supports_tokenization_js__WEBPACK_IMPORTED_MODULE_4__["generateTokensCSSForColorMap"])(colorMap)); - this._themeCSS = cssRules.join('\n'); - this._updateCSS(); - _common_modes_js__WEBPACK_IMPORTED_MODULE_3__["TokenizationRegistry"].setColorMap(colorMap); - this._onColorThemeChange.fire(theme); - return theme.id; - } - _updateCSS() { - this._allCSS = `${this._codiconCSS}\n${this._themeCSS}`; - this._styleElements.forEach(styleElement => styleElement.innerHTML = this._allCSS); - } - getFileIconTheme() { - return { - hasFileIcons: false, - hasFolderIcons: false, - hidesExplorerArrows: false - }; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.js": -/*!**************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.js ***! - \**************************************************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../browser/editorExtensions.js */ "./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js"); -/* harmony import */ var _common_standaloneThemeService_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/standaloneThemeService.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/standaloneThemeService.js"); -/* harmony import */ var _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/standaloneStrings.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standaloneStrings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class ToggleHighContrast extends _browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["EditorAction"] { - constructor() { - super({ - id: 'editor.action.toggleHighContrast', - label: _common_standaloneStrings_js__WEBPACK_IMPORTED_MODULE_2__["ToggleHighContrastNLS"].toggleHighContrast, - alias: 'Toggle High Contrast Theme', - precondition: undefined - }); - this._originalThemeName = null; - } - run(accessor, editor) { - const standaloneThemeService = accessor.get(_common_standaloneThemeService_js__WEBPACK_IMPORTED_MODULE_1__["IStandaloneThemeService"]); - if (this._originalThemeName) { - // We must toggle back to the integrator's theme - standaloneThemeService.setTheme(this._originalThemeName); - this._originalThemeName = null; - } - else { - this._originalThemeName = standaloneThemeService.getColorTheme().themeName; - standaloneThemeService.setTheme('hc-black'); - } - } -} -Object(_browser_editorExtensions_js__WEBPACK_IMPORTED_MODULE_0__["registerEditorAction"])(ToggleHighContrast); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchCommon.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchCommon.js ***! - \*********************************************************************************************/ -/*! exports provided: isFuzzyActionArr, isFuzzyAction, isString, isIAction, empty, fixCase, sanitize, log, createError, substituteMatches, findRules, stateExists */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFuzzyActionArr", function() { return isFuzzyActionArr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFuzzyAction", function() { return isFuzzyAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIAction", function() { return isIAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fixCase", function() { return fixCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sanitize", function() { return sanitize; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "log", function() { return log; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createError", function() { return createError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "substituteMatches", function() { return substituteMatches; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findRules", function() { return findRules; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stateExists", function() { return stateExists; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function isFuzzyActionArr(what) { - return (Array.isArray(what)); -} -function isFuzzyAction(what) { - return !isFuzzyActionArr(what); -} -function isString(what) { - return (typeof what === 'string'); -} -function isIAction(what) { - return !isString(what); -} -// Small helper functions -/** - * Is a string null, undefined, or empty? - */ -function empty(s) { - return (s ? false : true); -} -/** - * Puts a string to lower case if 'ignoreCase' is set. - */ -function fixCase(lexer, str) { - return (lexer.ignoreCase && str ? str.toLowerCase() : str); -} -/** - * Ensures there are no bad characters in a CSS token class. - */ -function sanitize(s) { - return s.replace(/[&<>'"_]/g, '-'); // used on all output token CSS classes -} -// Logging -/** - * Logs a message. - */ -function log(lexer, msg) { - console.log(`${lexer.languageId}: ${msg}`); -} -// Throwing errors -function createError(lexer, msg) { - return new Error(`${lexer.languageId}: ${msg}`); -} -// Helper functions for rule finding and substitution -/** - * substituteMatches is used on lexer strings and can substitutes predefined patterns: - * $$ => $ - * $# => id - * $n => matched entry n - * @attr => contents of lexer[attr] - * - * See documentation for more info - */ -function substituteMatches(lexer, str, id, matches, state) { - const re = /\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g; - let stateMatches = null; - return str.replace(re, function (full, sub, dollar, hash, n, s, attr, ofs, total) { - if (!empty(dollar)) { - return '$'; // $$ - } - if (!empty(hash)) { - return fixCase(lexer, id); // default $# - } - if (!empty(n) && n < matches.length) { - return fixCase(lexer, matches[n]); // $n - } - if (!empty(attr) && lexer && typeof (lexer[attr]) === 'string') { - return lexer[attr]; //@attribute - } - if (stateMatches === null) { // split state on demand - stateMatches = state.split('.'); - stateMatches.unshift(state); - } - if (!empty(s) && s < stateMatches.length) { - return fixCase(lexer, stateMatches[s]); //$Sn - } - return ''; - }); -} -/** - * Find the tokenizer rules for a specific state (i.e. next action) - */ -function findRules(lexer, inState) { - let state = inState; - while (state && state.length > 0) { - const rules = lexer.tokenizer[state]; - if (rules) { - return rules; - } - const idx = state.lastIndexOf('.'); - if (idx < 0) { - state = null; // no further parent - } - else { - state = state.substr(0, idx); - } - } - return null; -} -/** - * Is a certain state defined? In contrast to 'findRules' this works on a ILexerMin. - * This is used during compilation where we may know the defined states - * but not yet whether the corresponding rules are correct. - */ -function stateExists(lexer, inState) { - let state = inState; - while (state && state.length > 0) { - const exist = lexer.stateNames[state]; - if (exist) { - return true; - } - const idx = state.lastIndexOf('.'); - if (idx < 0) { - state = null; // no further parent - } - else { - state = state.substr(0, idx); - } - } - return false; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchCompile.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchCompile.js ***! - \**********************************************************************************************/ -/*! exports provided: compile */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compile", function() { return compile; }); -/* harmony import */ var _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./monarchCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchCommon.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/* - * This module only exports 'compile' which compiles a JSON language definition - * into a typed and checked ILexer definition. - */ - -/* - * Type helpers - * - * Note: this is just for sanity checks on the JSON description which is - * helpful for the programmer. No checks are done anymore once the lexer is - * already 'compiled and checked'. - * - */ -function isArrayOf(elemType, obj) { - if (!obj) { - return false; - } - if (!(Array.isArray(obj))) { - return false; - } - for (const el of obj) { - if (!(elemType(el))) { - return false; - } - } - return true; -} -function bool(prop, defValue) { - if (typeof prop === 'boolean') { - return prop; - } - return defValue; -} -function string(prop, defValue) { - if (typeof (prop) === 'string') { - return prop; - } - return defValue; -} -function arrayToHash(array) { - const result = {}; - for (const e of array) { - result[e] = true; - } - return result; -} -function createKeywordMatcher(arr, caseInsensitive = false) { - if (caseInsensitive) { - arr = arr.map(function (x) { return x.toLowerCase(); }); - } - const hash = arrayToHash(arr); - if (caseInsensitive) { - return function (word) { - return hash[word.toLowerCase()] !== undefined && hash.hasOwnProperty(word.toLowerCase()); - }; - } - else { - return function (word) { - return hash[word] !== undefined && hash.hasOwnProperty(word); - }; - } -} -// Lexer helpers -/** - * Compiles a regular expression string, adding the 'i' flag if 'ignoreCase' is set, and the 'u' flag if 'unicode' is set. - * Also replaces @\w+ or sequences with the content of the specified attribute - */ -function compileRegExp(lexer, str) { - let n = 0; - while (str.indexOf('@') >= 0 && n < 5) { // at most 5 expansions - n++; - str = str.replace(/@(\w+)/g, function (s, attr) { - let sub = ''; - if (typeof (lexer[attr]) === 'string') { - sub = lexer[attr]; - } - else if (lexer[attr] && lexer[attr] instanceof RegExp) { - sub = lexer[attr].source; - } - else { - if (lexer[attr] === undefined) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'language definition does not contain attribute \'' + attr + '\', used at: ' + str); - } - else { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'attribute reference \'' + attr + '\' must be a string, used at: ' + str); - } - } - return (_monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["empty"](sub) ? '' : '(?:' + sub + ')'); - }); - } - let flags = (lexer.ignoreCase ? 'i' : '') + (lexer.unicode ? 'u' : ''); - return new RegExp(str, flags); -} -/** - * Compiles guard functions for case matches. - * This compiles 'cases' attributes into efficient match functions. - * - */ -function selectScrutinee(id, matches, state, num) { - if (num < 0) { - return id; - } - if (num < matches.length) { - return matches[num]; - } - if (num >= 100) { - num = num - 100; - let parts = state.split('.'); - parts.unshift(state); - if (num < parts.length) { - return parts[num]; - } - } - return null; -} -function createGuard(lexer, ruleName, tkey, val) { - // get the scrutinee and pattern - let scrut = -1; // -1: $!, 0-99: $n, 100+n: $Sn - let oppat = tkey; - let matches = tkey.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/); - if (matches) { - if (matches[3]) { // if digits - scrut = parseInt(matches[3]); - if (matches[2]) { - scrut = scrut + 100; // if [sS] present - } - } - oppat = matches[4]; - } - // get operator - let op = '~'; - let pat = oppat; - if (!oppat || oppat.length === 0) { - op = '!='; - pat = ''; - } - else if (/^\w*$/.test(pat)) { // just a word - op = '=='; - } - else { - matches = oppat.match(/^(@|!@|~|!~|==|!=)(.*)$/); - if (matches) { - op = matches[1]; - pat = matches[2]; - } - } - // set the tester function - let tester; - // special case a regexp that matches just words - if ((op === '~' || op === '!~') && /^(\w|\|)*$/.test(pat)) { - let inWords = createKeywordMatcher(pat.split('|'), lexer.ignoreCase); - tester = function (s) { return (op === '~' ? inWords(s) : !inWords(s)); }; - } - else if (op === '@' || op === '!@') { - let words = lexer[pat]; - if (!words) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'the @ match target \'' + pat + '\' is not defined, in rule: ' + ruleName); - } - if (!(isArrayOf(function (elem) { return (typeof (elem) === 'string'); }, words))) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'the @ match target \'' + pat + '\' must be an array of strings, in rule: ' + ruleName); - } - let inWords = createKeywordMatcher(words, lexer.ignoreCase); - tester = function (s) { return (op === '@' ? inWords(s) : !inWords(s)); }; - } - else if (op === '~' || op === '!~') { - if (pat.indexOf('$') < 0) { - // precompile regular expression - let re = compileRegExp(lexer, '^' + pat + '$'); - tester = function (s) { return (op === '~' ? re.test(s) : !re.test(s)); }; - } - else { - tester = function (s, id, matches, state) { - let re = compileRegExp(lexer, '^' + _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["substituteMatches"](lexer, pat, id, matches, state) + '$'); - return re.test(s); - }; - } - } - else { // if (op==='==' || op==='!=') { - if (pat.indexOf('$') < 0) { - let patx = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["fixCase"](lexer, pat); - tester = function (s) { return (op === '==' ? s === patx : s !== patx); }; - } - else { - let patx = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["fixCase"](lexer, pat); - tester = function (s, id, matches, state, eos) { - let patexp = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["substituteMatches"](lexer, patx, id, matches, state); - return (op === '==' ? s === patexp : s !== patexp); - }; - } - } - // return the branch object - if (scrut === -1) { - return { - name: tkey, value: val, test: function (id, matches, state, eos) { - return tester(id, id, matches, state, eos); - } - }; - } - else { - return { - name: tkey, value: val, test: function (id, matches, state, eos) { - let scrutinee = selectScrutinee(id, matches, state, scrut); - return tester(!scrutinee ? '' : scrutinee, id, matches, state, eos); - } - }; - } -} -/** - * Compiles an action: i.e. optimize regular expressions and case matches - * and do many sanity checks. - * - * This is called only during compilation but if the lexer definition - * contains user functions as actions (which is usually not allowed), then this - * may be called during lexing. It is important therefore to compile common cases efficiently - */ -function compileAction(lexer, ruleName, action) { - if (!action) { - return { token: '' }; - } - else if (typeof (action) === 'string') { - return action; // { token: action }; - } - else if (action.token || action.token === '') { - if (typeof (action.token) !== 'string') { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'a \'token\' attribute must be of type string, in rule: ' + ruleName); - } - else { - // only copy specific typed fields (only happens once during compile Lexer) - let newAction = { token: action.token }; - if (action.token.indexOf('$') >= 0) { - newAction.tokenSubst = true; - } - if (typeof (action.bracket) === 'string') { - if (action.bracket === '@open') { - newAction.bracket = 1 /* Open */; - } - else if (action.bracket === '@close') { - newAction.bracket = -1 /* Close */; - } - else { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'a \'bracket\' attribute must be either \'@open\' or \'@close\', in rule: ' + ruleName); - } - } - if (action.next) { - if (typeof (action.next) !== 'string') { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'the next state must be a string value in rule: ' + ruleName); - } - else { - let next = action.next; - if (!/^(@pop|@push|@popall)$/.test(next)) { - if (next[0] === '@') { - next = next.substr(1); // peel off starting @ sign - } - if (next.indexOf('$') < 0) { // no dollar substitution, we can check if the state exists - if (!_monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["stateExists"](lexer, _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["substituteMatches"](lexer, next, '', [], ''))) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'the next state \'' + action.next + '\' is not defined in rule: ' + ruleName); - } - } - } - newAction.next = next; - } - } - if (typeof (action.goBack) === 'number') { - newAction.goBack = action.goBack; - } - if (typeof (action.switchTo) === 'string') { - newAction.switchTo = action.switchTo; - } - if (typeof (action.log) === 'string') { - newAction.log = action.log; - } - if (typeof (action.nextEmbedded) === 'string') { - newAction.nextEmbedded = action.nextEmbedded; - lexer.usesEmbedded = true; - } - return newAction; - } - } - else if (Array.isArray(action)) { - let results = []; - for (let i = 0, len = action.length; i < len; i++) { - results[i] = compileAction(lexer, ruleName, action[i]); - } - return { group: results }; - } - else if (action.cases) { - // build an array of test cases - let cases = []; - // for each case, push a test function and result value - for (let tkey in action.cases) { - if (action.cases.hasOwnProperty(tkey)) { - const val = compileAction(lexer, ruleName, action.cases[tkey]); - // what kind of case - if (tkey === '@default' || tkey === '@' || tkey === '') { - cases.push({ test: undefined, value: val, name: tkey }); - } - else if (tkey === '@eos') { - cases.push({ test: function (id, matches, state, eos) { return eos; }, value: val, name: tkey }); - } - else { - cases.push(createGuard(lexer, ruleName, tkey, val)); // call separate function to avoid local variable capture - } - } - } - // create a matching function - const def = lexer.defaultToken; - return { - test: function (id, matches, state, eos) { - for (const _case of cases) { - const didmatch = (!_case.test || _case.test(id, matches, state, eos)); - if (didmatch) { - return _case.value; - } - } - return def; - } - }; - } - else { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'an action must be a string, an object with a \'token\' or \'cases\' attribute, or an array of actions; in rule: ' + ruleName); - } -} -/** - * Helper class for creating matching rules - */ -class Rule { - constructor(name) { - this.regex = new RegExp(''); - this.action = { token: '' }; - this.matchOnlyAtLineStart = false; - this.name = ''; - this.name = name; - } - setRegex(lexer, re) { - let sregex; - if (typeof (re) === 'string') { - sregex = re; - } - else if (re instanceof RegExp) { - sregex = re.source; - } - else { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'rules must start with a match string or regular expression: ' + this.name); - } - this.matchOnlyAtLineStart = (sregex.length > 0 && sregex[0] === '^'); - this.name = this.name + ': ' + sregex; - this.regex = compileRegExp(lexer, '^(?:' + (this.matchOnlyAtLineStart ? sregex.substr(1) : sregex) + ')'); - } - setAction(lexer, act) { - this.action = compileAction(lexer, this.name, act); - } -} -/** - * Compiles a json description function into json where all regular expressions, - * case matches etc, are compiled and all include rules are expanded. - * We also compile the bracket definitions, supply defaults, and do many sanity checks. - * If the 'jsonStrict' parameter is 'false', we allow at certain locations - * regular expression objects and functions that get called during lexing. - * (Currently we have no samples that need this so perhaps we should always have - * jsonStrict to true). - */ -function compile(languageId, json) { - if (!json || typeof (json) !== 'object') { - throw new Error('Monarch: expecting a language definition object'); - } - // Create our lexer - let lexer = {}; - lexer.languageId = languageId; - lexer.noThrow = false; // raise exceptions during compilation - lexer.maxStack = 100; - // Set standard fields: be defensive about types - lexer.start = (typeof json.start === 'string' ? json.start : null); - lexer.ignoreCase = bool(json.ignoreCase, false); - lexer.unicode = bool(json.unicode, false); - lexer.tokenPostfix = string(json.tokenPostfix, '.' + lexer.languageId); - lexer.defaultToken = string(json.defaultToken, 'source'); - lexer.usesEmbedded = false; // becomes true if we find a nextEmbedded action - // For calling compileAction later on - let lexerMin = json; - lexerMin.languageId = languageId; - lexerMin.ignoreCase = lexer.ignoreCase; - lexerMin.unicode = lexer.unicode; - lexerMin.noThrow = lexer.noThrow; - lexerMin.usesEmbedded = lexer.usesEmbedded; - lexerMin.stateNames = json.tokenizer; - lexerMin.defaultToken = lexer.defaultToken; - // Compile an array of rules into newrules where RegExp objects are created. - function addRules(state, newrules, rules) { - for (const rule of rules) { - let include = rule.include; - if (include) { - if (typeof (include) !== 'string') { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'an \'include\' attribute must be a string at: ' + state); - } - if (include[0] === '@') { - include = include.substr(1); // peel off starting @ - } - if (!json.tokenizer[include]) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'include target \'' + include + '\' is not defined at: ' + state); - } - addRules(state + '.' + include, newrules, json.tokenizer[include]); - } - else { - const newrule = new Rule(state); - // Set up new rule attributes - if (Array.isArray(rule) && rule.length >= 1 && rule.length <= 3) { - newrule.setRegex(lexerMin, rule[0]); - if (rule.length >= 3) { - if (typeof (rule[1]) === 'string') { - newrule.setAction(lexerMin, { token: rule[1], next: rule[2] }); - } - else if (typeof (rule[1]) === 'object') { - const rule1 = rule[1]; - rule1.next = rule[2]; - newrule.setAction(lexerMin, rule1); - } - else { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'a next state as the last element of a rule can only be given if the action is either an object or a string, at: ' + state); - } - } - else { - newrule.setAction(lexerMin, rule[1]); - } - } - else { - if (!rule.regex) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'a rule must either be an array, or an object with a \'regex\' or \'include\' field at: ' + state); - } - if (rule.name) { - if (typeof rule.name === 'string') { - newrule.name = rule.name; - } - } - if (rule.matchOnlyAtStart) { - newrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart, false); - } - newrule.setRegex(lexerMin, rule.regex); - newrule.setAction(lexerMin, rule.action); - } - newrules.push(newrule); - } - } - } - // compile the tokenizer rules - if (!json.tokenizer || typeof (json.tokenizer) !== 'object') { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'a language definition must define the \'tokenizer\' attribute as an object'); - } - lexer.tokenizer = []; - for (let key in json.tokenizer) { - if (json.tokenizer.hasOwnProperty(key)) { - if (!lexer.start) { - lexer.start = key; - } - const rules = json.tokenizer[key]; - lexer.tokenizer[key] = new Array(); - addRules('tokenizer.' + key, lexer.tokenizer[key], rules); - } - } - lexer.usesEmbedded = lexerMin.usesEmbedded; // can be set during compileAction - // Set simple brackets - if (json.brackets) { - if (!(Array.isArray(json.brackets))) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'the \'brackets\' attribute must be defined as an array'); - } - } - else { - json.brackets = [ - { open: '{', close: '}', token: 'delimiter.curly' }, - { open: '[', close: ']', token: 'delimiter.square' }, - { open: '(', close: ')', token: 'delimiter.parenthesis' }, - { open: '<', close: '>', token: 'delimiter.angle' } - ]; - } - let brackets = []; - for (let el of json.brackets) { - let desc = el; - if (desc && Array.isArray(desc) && desc.length === 3) { - desc = { token: desc[2], open: desc[0], close: desc[1] }; - } - if (desc.open === desc.close) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'open and close brackets in a \'brackets\' attribute must be different: ' + desc.open + - '\n hint: use the \'bracket\' attribute if matching on equal brackets is required.'); - } - if (typeof desc.open === 'string' && typeof desc.token === 'string' && typeof desc.close === 'string') { - brackets.push({ - token: desc.token + lexer.tokenPostfix, - open: _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["fixCase"](lexer, desc.open), - close: _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["fixCase"](lexer, desc.close) - }); - } - else { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_0__["createError"](lexer, 'every element in the \'brackets\' array must be a \'{open,close,token}\' object or array'); - } - } - lexer.brackets = brackets; - // Disable throw so the syntax highlighter goes, no matter what - lexer.noThrow = true; - return lexer; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchLexer.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchLexer.js ***! - \********************************************************************************************/ -/*! exports provided: MonarchTokenizer, createTokenizationSupport */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MonarchTokenizer", function() { return MonarchTokenizer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTokenizationSupport", function() { return createTokenizationSupport; }); -/* harmony import */ var _common_core_token_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../common/core/token.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js"); -/* harmony import */ var _common_modes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/modes.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes.js"); -/* harmony import */ var _common_modes_nullMode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/modes/nullMode.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/nullMode.js"); -/* harmony import */ var _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./monarchCommon.js */ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/monarch/monarchCommon.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -const CACHE_STACK_DEPTH = 5; -/** - * Reuse the same stack elements up to a certain depth. - */ -class MonarchStackElementFactory { - constructor(maxCacheDepth) { - this._maxCacheDepth = maxCacheDepth; - this._entries = Object.create(null); - } - static create(parent, state) { - return this._INSTANCE.create(parent, state); - } - create(parent, state) { - if (parent !== null && parent.depth >= this._maxCacheDepth) { - // no caching above a certain depth - return new MonarchStackElement(parent, state); - } - let stackElementId = MonarchStackElement.getStackElementId(parent); - if (stackElementId.length > 0) { - stackElementId += '|'; - } - stackElementId += state; - let result = this._entries[stackElementId]; - if (result) { - return result; - } - result = new MonarchStackElement(parent, state); - this._entries[stackElementId] = result; - return result; - } -} -MonarchStackElementFactory._INSTANCE = new MonarchStackElementFactory(CACHE_STACK_DEPTH); -class MonarchStackElement { - constructor(parent, state) { - this.parent = parent; - this.state = state; - this.depth = (this.parent ? this.parent.depth : 0) + 1; - } - static getStackElementId(element) { - let result = ''; - while (element !== null) { - if (result.length > 0) { - result += '|'; - } - result += element.state; - element = element.parent; - } - return result; - } - static _equals(a, b) { - while (a !== null && b !== null) { - if (a === b) { - return true; - } - if (a.state !== b.state) { - return false; - } - a = a.parent; - b = b.parent; - } - if (a === null && b === null) { - return true; - } - return false; - } - equals(other) { - return MonarchStackElement._equals(this, other); - } - push(state) { - return MonarchStackElementFactory.create(this, state); - } - pop() { - return this.parent; - } - popall() { - let result = this; - while (result.parent) { - result = result.parent; - } - return result; - } - switchTo(state) { - return MonarchStackElementFactory.create(this.parent, state); - } -} -class EmbeddedModeData { - constructor(modeId, state) { - this.modeId = modeId; - this.state = state; - } - equals(other) { - return (this.modeId === other.modeId - && this.state.equals(other.state)); - } - clone() { - let stateClone = this.state.clone(); - // save an object - if (stateClone === this.state) { - return this; - } - return new EmbeddedModeData(this.modeId, this.state); - } -} -/** - * Reuse the same line states up to a certain depth. - */ -class MonarchLineStateFactory { - constructor(maxCacheDepth) { - this._maxCacheDepth = maxCacheDepth; - this._entries = Object.create(null); - } - static create(stack, embeddedModeData) { - return this._INSTANCE.create(stack, embeddedModeData); - } - create(stack, embeddedModeData) { - if (embeddedModeData !== null) { - // no caching when embedding - return new MonarchLineState(stack, embeddedModeData); - } - if (stack !== null && stack.depth >= this._maxCacheDepth) { - // no caching above a certain depth - return new MonarchLineState(stack, embeddedModeData); - } - let stackElementId = MonarchStackElement.getStackElementId(stack); - let result = this._entries[stackElementId]; - if (result) { - return result; - } - result = new MonarchLineState(stack, null); - this._entries[stackElementId] = result; - return result; - } -} -MonarchLineStateFactory._INSTANCE = new MonarchLineStateFactory(CACHE_STACK_DEPTH); -class MonarchLineState { - constructor(stack, embeddedModeData) { - this.stack = stack; - this.embeddedModeData = embeddedModeData; - } - clone() { - let embeddedModeDataClone = this.embeddedModeData ? this.embeddedModeData.clone() : null; - // save an object - if (embeddedModeDataClone === this.embeddedModeData) { - return this; - } - return MonarchLineStateFactory.create(this.stack, this.embeddedModeData); - } - equals(other) { - if (!(other instanceof MonarchLineState)) { - return false; - } - if (!this.stack.equals(other.stack)) { - return false; - } - if (this.embeddedModeData === null && other.embeddedModeData === null) { - return true; - } - if (this.embeddedModeData === null || other.embeddedModeData === null) { - return false; - } - return this.embeddedModeData.equals(other.embeddedModeData); - } -} -class MonarchClassicTokensCollector { - constructor() { - this._tokens = []; - this._language = null; - this._lastTokenType = null; - this._lastTokenLanguage = null; - } - enterMode(startOffset, modeId) { - this._language = modeId; - } - emit(startOffset, type) { - if (this._lastTokenType === type && this._lastTokenLanguage === this._language) { - return; - } - this._lastTokenType = type; - this._lastTokenLanguage = this._language; - this._tokens.push(new _common_core_token_js__WEBPACK_IMPORTED_MODULE_0__["Token"](startOffset, type, this._language)); - } - nestedModeTokenize(embeddedModeLine, embeddedModeData, offsetDelta) { - const nestedModeId = embeddedModeData.modeId; - const embeddedModeState = embeddedModeData.state; - const nestedModeTokenizationSupport = _common_modes_js__WEBPACK_IMPORTED_MODULE_1__["TokenizationRegistry"].get(nestedModeId); - if (!nestedModeTokenizationSupport) { - this.enterMode(offsetDelta, nestedModeId); - this.emit(offsetDelta, ''); - return embeddedModeState; - } - let nestedResult = nestedModeTokenizationSupport.tokenize(embeddedModeLine, embeddedModeState, offsetDelta); - this._tokens = this._tokens.concat(nestedResult.tokens); - this._lastTokenType = null; - this._lastTokenLanguage = null; - this._language = null; - return nestedResult.endState; - } - finalize(endState) { - return new _common_core_token_js__WEBPACK_IMPORTED_MODULE_0__["TokenizationResult"](this._tokens, endState); - } -} -class MonarchModernTokensCollector { - constructor(modeService, theme) { - this._modeService = modeService; - this._theme = theme; - this._prependTokens = null; - this._tokens = []; - this._currentLanguageId = 0 /* Null */; - this._lastTokenMetadata = 0; - } - enterMode(startOffset, modeId) { - this._currentLanguageId = this._modeService.getLanguageIdentifier(modeId).id; - } - emit(startOffset, type) { - let metadata = this._theme.match(this._currentLanguageId, type); - if (this._lastTokenMetadata === metadata) { - return; - } - this._lastTokenMetadata = metadata; - this._tokens.push(startOffset); - this._tokens.push(metadata); - } - static _merge(a, b, c) { - let aLen = (a !== null ? a.length : 0); - let bLen = b.length; - let cLen = (c !== null ? c.length : 0); - if (aLen === 0 && bLen === 0 && cLen === 0) { - return new Uint32Array(0); - } - if (aLen === 0 && bLen === 0) { - return c; - } - if (bLen === 0 && cLen === 0) { - return a; - } - let result = new Uint32Array(aLen + bLen + cLen); - if (a !== null) { - result.set(a); - } - for (let i = 0; i < bLen; i++) { - result[aLen + i] = b[i]; - } - if (c !== null) { - result.set(c, aLen + bLen); - } - return result; - } - nestedModeTokenize(embeddedModeLine, embeddedModeData, offsetDelta) { - const nestedModeId = embeddedModeData.modeId; - const embeddedModeState = embeddedModeData.state; - const nestedModeTokenizationSupport = _common_modes_js__WEBPACK_IMPORTED_MODULE_1__["TokenizationRegistry"].get(nestedModeId); - if (!nestedModeTokenizationSupport) { - this.enterMode(offsetDelta, nestedModeId); - this.emit(offsetDelta, ''); - return embeddedModeState; - } - let nestedResult = nestedModeTokenizationSupport.tokenize2(embeddedModeLine, embeddedModeState, offsetDelta); - this._prependTokens = MonarchModernTokensCollector._merge(this._prependTokens, this._tokens, nestedResult.tokens); - this._tokens = []; - this._currentLanguageId = 0; - this._lastTokenMetadata = 0; - return nestedResult.endState; - } - finalize(endState) { - return new _common_core_token_js__WEBPACK_IMPORTED_MODULE_0__["TokenizationResult2"](MonarchModernTokensCollector._merge(this._prependTokens, this._tokens, null), endState); - } -} -class MonarchTokenizer { - constructor(modeService, standaloneThemeService, modeId, lexer) { - this._modeService = modeService; - this._standaloneThemeService = standaloneThemeService; - this._modeId = modeId; - this._lexer = lexer; - this._embeddedModes = Object.create(null); - this.embeddedLoaded = Promise.resolve(undefined); - // Set up listening for embedded modes - let emitting = false; - this._tokenizationRegistryListener = _common_modes_js__WEBPACK_IMPORTED_MODULE_1__["TokenizationRegistry"].onDidChange((e) => { - if (emitting) { - return; - } - let isOneOfMyEmbeddedModes = false; - for (let i = 0, len = e.changedLanguages.length; i < len; i++) { - let language = e.changedLanguages[i]; - if (this._embeddedModes[language]) { - isOneOfMyEmbeddedModes = true; - break; - } - } - if (isOneOfMyEmbeddedModes) { - emitting = true; - _common_modes_js__WEBPACK_IMPORTED_MODULE_1__["TokenizationRegistry"].fire([this._modeId]); - emitting = false; - } - }); - } - dispose() { - this._tokenizationRegistryListener.dispose(); - } - getLoadStatus() { - let promises = []; - for (let nestedModeId in this._embeddedModes) { - const tokenizationSupport = _common_modes_js__WEBPACK_IMPORTED_MODULE_1__["TokenizationRegistry"].get(nestedModeId); - if (tokenizationSupport) { - // The nested mode is already loaded - if (tokenizationSupport instanceof MonarchTokenizer) { - const nestedModeStatus = tokenizationSupport.getLoadStatus(); - if (nestedModeStatus.loaded === false) { - promises.push(nestedModeStatus.promise); - } - } - continue; - } - const tokenizationSupportPromise = _common_modes_js__WEBPACK_IMPORTED_MODULE_1__["TokenizationRegistry"].getPromise(nestedModeId); - if (tokenizationSupportPromise) { - // The nested mode is in the process of being loaded - promises.push(tokenizationSupportPromise); - } - } - if (promises.length === 0) { - return { - loaded: true - }; - } - return { - loaded: false, - promise: Promise.all(promises).then(_ => undefined) - }; - } - getInitialState() { - let rootState = MonarchStackElementFactory.create(null, this._lexer.start); - return MonarchLineStateFactory.create(rootState, null); - } - tokenize(line, lineState, offsetDelta) { - let tokensCollector = new MonarchClassicTokensCollector(); - let endLineState = this._tokenize(line, lineState, offsetDelta, tokensCollector); - return tokensCollector.finalize(endLineState); - } - tokenize2(line, lineState, offsetDelta) { - let tokensCollector = new MonarchModernTokensCollector(this._modeService, this._standaloneThemeService.getColorTheme().tokenTheme); - let endLineState = this._tokenize(line, lineState, offsetDelta, tokensCollector); - return tokensCollector.finalize(endLineState); - } - _tokenize(line, lineState, offsetDelta, collector) { - if (lineState.embeddedModeData) { - return this._nestedTokenize(line, lineState, offsetDelta, collector); - } - else { - return this._myTokenize(line, lineState, offsetDelta, collector); - } - } - _findLeavingNestedModeOffset(line, state) { - let rules = this._lexer.tokenizer[state.stack.state]; - if (!rules) { - rules = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["findRules"](this._lexer, state.stack.state); // do parent matching - if (!rules) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'tokenizer state is not defined: ' + state.stack.state); - } - } - let popOffset = -1; - let hasEmbeddedPopRule = false; - for (const rule of rules) { - if (!_monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["isIAction"](rule.action) || rule.action.nextEmbedded !== '@pop') { - continue; - } - hasEmbeddedPopRule = true; - let regex = rule.regex; - let regexSource = rule.regex.source; - if (regexSource.substr(0, 4) === '^(?:' && regexSource.substr(regexSource.length - 1, 1) === ')') { - let flags = (regex.ignoreCase ? 'i' : '') + (regex.unicode ? 'u' : ''); - regex = new RegExp(regexSource.substr(4, regexSource.length - 5), flags); - } - let result = line.search(regex); - if (result === -1 || (result !== 0 && rule.matchOnlyAtLineStart)) { - continue; - } - if (popOffset === -1 || result < popOffset) { - popOffset = result; - } - } - if (!hasEmbeddedPopRule) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: ' + state.stack.state); - } - return popOffset; - } - _nestedTokenize(line, lineState, offsetDelta, tokensCollector) { - let popOffset = this._findLeavingNestedModeOffset(line, lineState); - if (popOffset === -1) { - // tokenization will not leave nested mode - let nestedEndState = tokensCollector.nestedModeTokenize(line, lineState.embeddedModeData, offsetDelta); - return MonarchLineStateFactory.create(lineState.stack, new EmbeddedModeData(lineState.embeddedModeData.modeId, nestedEndState)); - } - let nestedModeLine = line.substring(0, popOffset); - if (nestedModeLine.length > 0) { - // tokenize with the nested mode - tokensCollector.nestedModeTokenize(nestedModeLine, lineState.embeddedModeData, offsetDelta); - } - let restOfTheLine = line.substring(popOffset); - return this._myTokenize(restOfTheLine, lineState, offsetDelta + popOffset, tokensCollector); - } - _safeRuleName(rule) { - if (rule) { - return rule.name; - } - return '(unknown)'; - } - _myTokenize(line, lineState, offsetDelta, tokensCollector) { - tokensCollector.enterMode(offsetDelta, this._modeId); - const lineLength = line.length; - let embeddedModeData = lineState.embeddedModeData; - let stack = lineState.stack; - let pos = 0; - let groupMatching = null; - // See https://github.com/Microsoft/monaco-editor/issues/1235: - // Evaluate rules at least once for an empty line - let forceEvaluation = true; - while (forceEvaluation || pos < lineLength) { - const pos0 = pos; - const stackLen0 = stack.depth; - const groupLen0 = groupMatching ? groupMatching.groups.length : 0; - const state = stack.state; - let matches = null; - let matched = null; - let action = null; - let rule = null; - let enteringEmbeddedMode = null; - // check if we need to process group matches first - if (groupMatching) { - matches = groupMatching.matches; - const groupEntry = groupMatching.groups.shift(); - matched = groupEntry.matched; - action = groupEntry.action; - rule = groupMatching.rule; - // cleanup if necessary - if (groupMatching.groups.length === 0) { - groupMatching = null; - } - } - else { - // otherwise we match on the token stream - if (!forceEvaluation && pos >= lineLength) { - // nothing to do - break; - } - forceEvaluation = false; - // get the rules for this state - let rules = this._lexer.tokenizer[state]; - if (!rules) { - rules = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["findRules"](this._lexer, state); // do parent matching - if (!rules) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'tokenizer state is not defined: ' + state); - } - } - // try each rule until we match - let restOfLine = line.substr(pos); - for (const rule of rules) { - if (pos === 0 || !rule.matchOnlyAtLineStart) { - matches = restOfLine.match(rule.regex); - if (matches) { - matched = matches[0]; - action = rule.action; - break; - } - } - } - } - // We matched 'rule' with 'matches' and 'action' - if (!matches) { - matches = ['']; - matched = ''; - } - if (!action) { - // bad: we didn't match anything, and there is no action to take - // we need to advance the stream or we get progress trouble - if (pos < lineLength) { - matches = [line.charAt(pos)]; - matched = matches[0]; - } - action = this._lexer.defaultToken; - } - if (matched === null) { - // should never happen, needed for strict null checking - break; - } - // advance stream - pos += matched.length; - // maybe call action function (used for 'cases') - while (_monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["isFuzzyAction"](action) && _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["isIAction"](action) && action.test) { - action = action.test(matched, matches, state, pos === lineLength); - } - let result = null; - // set the result: either a string or an array of actions - if (typeof action === 'string' || Array.isArray(action)) { - result = action; - } - else if (action.group) { - result = action.group; - } - else if (action.token !== null && action.token !== undefined) { - // do $n replacements? - if (action.tokenSubst) { - result = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["substituteMatches"](this._lexer, action.token, matched, matches, state); - } - else { - result = action.token; - } - // enter embedded mode? - if (action.nextEmbedded) { - if (action.nextEmbedded === '@pop') { - if (!embeddedModeData) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'cannot pop embedded mode if not inside one'); - } - embeddedModeData = null; - } - else if (embeddedModeData) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'cannot enter embedded mode from within an embedded mode'); - } - else { - enteringEmbeddedMode = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["substituteMatches"](this._lexer, action.nextEmbedded, matched, matches, state); - } - } - // state transformations - if (action.goBack) { // back up the stream.. - pos = Math.max(0, pos - action.goBack); - } - if (action.switchTo && typeof action.switchTo === 'string') { - let nextState = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["substituteMatches"](this._lexer, action.switchTo, matched, matches, state); // switch state without a push... - if (nextState[0] === '@') { - nextState = nextState.substr(1); // peel off starting '@' - } - if (!_monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["findRules"](this._lexer, nextState)) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'trying to switch to a state \'' + nextState + '\' that is undefined in rule: ' + this._safeRuleName(rule)); - } - else { - stack = stack.switchTo(nextState); - } - } - else if (action.transform && typeof action.transform === 'function') { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'action.transform not supported'); - } - else if (action.next) { - if (action.next === '@push') { - if (stack.depth >= this._lexer.maxStack) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'maximum tokenizer stack size reached: [' + - stack.state + ',' + stack.parent.state + ',...]'); - } - else { - stack = stack.push(state); - } - } - else if (action.next === '@pop') { - if (stack.depth <= 1) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'trying to pop an empty stack in rule: ' + this._safeRuleName(rule)); - } - else { - stack = stack.pop(); - } - } - else if (action.next === '@popall') { - stack = stack.popall(); - } - else { - let nextState = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["substituteMatches"](this._lexer, action.next, matched, matches, state); - if (nextState[0] === '@') { - nextState = nextState.substr(1); // peel off starting '@' - } - if (!_monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["findRules"](this._lexer, nextState)) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'trying to set a next state \'' + nextState + '\' that is undefined in rule: ' + this._safeRuleName(rule)); - } - else { - stack = stack.push(nextState); - } - } - } - if (action.log && typeof (action.log) === 'string') { - _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["log"](this._lexer, this._lexer.languageId + ': ' + _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["substituteMatches"](this._lexer, action.log, matched, matches, state)); - } - } - // check result - if (result === null) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'lexer rule has no well-defined action in rule: ' + this._safeRuleName(rule)); - } - const computeNewStateForEmbeddedMode = (enteringEmbeddedMode) => { - // substitute language alias to known modes to support syntax highlighting - let enteringEmbeddedModeId = this._modeService.getModeIdForLanguageName(enteringEmbeddedMode); - if (enteringEmbeddedModeId) { - enteringEmbeddedMode = enteringEmbeddedModeId; - } - const embeddedModeData = this._getNestedEmbeddedModeData(enteringEmbeddedMode); - if (pos < lineLength) { - // there is content from the embedded mode on this line - const restOfLine = line.substr(pos); - return this._nestedTokenize(restOfLine, MonarchLineStateFactory.create(stack, embeddedModeData), offsetDelta + pos, tokensCollector); - } - else { - return MonarchLineStateFactory.create(stack, embeddedModeData); - } - }; - // is the result a group match? - if (Array.isArray(result)) { - if (groupMatching && groupMatching.groups.length > 0) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'groups cannot be nested: ' + this._safeRuleName(rule)); - } - if (matches.length !== result.length + 1) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'matched number of groups does not match the number of actions in rule: ' + this._safeRuleName(rule)); - } - let totalLen = 0; - for (let i = 1; i < matches.length; i++) { - totalLen += matches[i].length; - } - if (totalLen !== matched.length) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'with groups, all characters should be matched in consecutive groups in rule: ' + this._safeRuleName(rule)); - } - groupMatching = { - rule: rule, - matches: matches, - groups: [] - }; - for (let i = 0; i < result.length; i++) { - groupMatching.groups[i] = { - action: result[i], - matched: matches[i + 1] - }; - } - pos -= matched.length; - // call recursively to initiate first result match - continue; - } - else { - // regular result - // check for '@rematch' - if (result === '@rematch') { - pos -= matched.length; - matched = ''; // better set the next state too.. - matches = null; - result = ''; - // Even though `@rematch` was specified, if `nextEmbedded` also specified, - // a state transition should occur. - if (enteringEmbeddedMode !== null) { - return computeNewStateForEmbeddedMode(enteringEmbeddedMode); - } - } - // check progress - if (matched.length === 0) { - if (lineLength === 0 || stackLen0 !== stack.depth || state !== stack.state || (!groupMatching ? 0 : groupMatching.groups.length) !== groupLen0) { - continue; - } - else { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, 'no progress in tokenizer in rule: ' + this._safeRuleName(rule)); - } - } - // return the result (and check for brace matching) - // todo: for efficiency we could pre-sanitize tokenPostfix and substitutions - let tokenType = null; - if (_monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["isString"](result) && result.indexOf('@brackets') === 0) { - let rest = result.substr('@brackets'.length); - let bracket = findBracket(this._lexer, matched); - if (!bracket) { - throw _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["createError"](this._lexer, '@brackets token returned but no bracket defined as: ' + matched); - } - tokenType = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["sanitize"](bracket.token + rest); - } - else { - let token = (result === '' ? '' : result + this._lexer.tokenPostfix); - tokenType = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["sanitize"](token); - } - tokensCollector.emit(pos0 + offsetDelta, tokenType); - } - if (enteringEmbeddedMode !== null) { - return computeNewStateForEmbeddedMode(enteringEmbeddedMode); - } - } - return MonarchLineStateFactory.create(stack, embeddedModeData); - } - _getNestedEmbeddedModeData(mimetypeOrModeId) { - let nestedModeId = this._locateMode(mimetypeOrModeId); - if (nestedModeId) { - let tokenizationSupport = _common_modes_js__WEBPACK_IMPORTED_MODULE_1__["TokenizationRegistry"].get(nestedModeId); - if (tokenizationSupport) { - return new EmbeddedModeData(nestedModeId, tokenizationSupport.getInitialState()); - } - } - return new EmbeddedModeData(nestedModeId || _common_modes_nullMode_js__WEBPACK_IMPORTED_MODULE_2__["NULL_MODE_ID"], _common_modes_nullMode_js__WEBPACK_IMPORTED_MODULE_2__["NULL_STATE"]); - } - _locateMode(mimetypeOrModeId) { - if (!mimetypeOrModeId || !this._modeService.isRegisteredMode(mimetypeOrModeId)) { - return null; - } - if (mimetypeOrModeId === this._modeId) { - // embedding myself... - return mimetypeOrModeId; - } - let modeId = this._modeService.getModeId(mimetypeOrModeId); - if (modeId) { - // Fire mode loading event - this._modeService.triggerMode(modeId); - this._embeddedModes[modeId] = true; - } - return modeId; - } -} -/** - * Searches for a bracket in the 'brackets' attribute that matches the input. - */ -function findBracket(lexer, matched) { - if (!matched) { - return null; - } - matched = _monarchCommon_js__WEBPACK_IMPORTED_MODULE_3__["fixCase"](lexer, matched); - let brackets = lexer.brackets; - for (const bracket of brackets) { - if (bracket.open === matched) { - return { token: bracket.token, bracketType: 1 /* Open */ }; - } - else if (bracket.close === matched) { - return { token: bracket.token, bracketType: -1 /* Close */ }; - } - } - return null; -} -function createTokenizationSupport(modeService, standaloneThemeService, modeId, lexer) { - return new MonarchTokenizer(modeService, standaloneThemeService, modeId, lexer); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/standaloneThemeService.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/common/standaloneThemeService.js ***! - \**********************************************************************************************/ -/*! exports provided: IStandaloneThemeService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IStandaloneThemeService", function() { return IStandaloneThemeService; }); -/* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const IStandaloneThemeService = Object(_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('themeService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/standalone/common/themes.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/standalone/common/themes.js ***! - \******************************************************************************/ -/*! exports provided: vs, vs_dark, hc_black */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vs", function() { return vs; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vs_dark", function() { return vs_dark; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hc_black", function() { return hc_black; }); -/* harmony import */ var _common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../common/view/editorColorRegistry.js */ "./node_modules/monaco-editor/esm/vs/editor/common/view/editorColorRegistry.js"); -/* harmony import */ var _platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../platform/theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -/* -------------------------------- Begin vs theme -------------------------------- */ -const vs = { - base: 'vs', - inherit: false, - rules: [ - { token: '', foreground: '000000', background: 'fffffe' }, - { token: 'invalid', foreground: 'cd3131' }, - { token: 'emphasis', fontStyle: 'italic' }, - { token: 'strong', fontStyle: 'bold' }, - { token: 'variable', foreground: '001188' }, - { token: 'variable.predefined', foreground: '4864AA' }, - { token: 'constant', foreground: 'dd0000' }, - { token: 'comment', foreground: '008000' }, - { token: 'number', foreground: '098658' }, - { token: 'number.hex', foreground: '3030c0' }, - { token: 'regexp', foreground: '800000' }, - { token: 'annotation', foreground: '808080' }, - { token: 'type', foreground: '008080' }, - { token: 'delimiter', foreground: '000000' }, - { token: 'delimiter.html', foreground: '383838' }, - { token: 'delimiter.xml', foreground: '0000FF' }, - { token: 'tag', foreground: '800000' }, - { token: 'tag.id.pug', foreground: '4F76AC' }, - { token: 'tag.class.pug', foreground: '4F76AC' }, - { token: 'meta.scss', foreground: '800000' }, - { token: 'metatag', foreground: 'e00000' }, - { token: 'metatag.content.html', foreground: 'FF0000' }, - { token: 'metatag.html', foreground: '808080' }, - { token: 'metatag.xml', foreground: '808080' }, - { token: 'metatag.php', fontStyle: 'bold' }, - { token: 'key', foreground: '863B00' }, - { token: 'string.key.json', foreground: 'A31515' }, - { token: 'string.value.json', foreground: '0451A5' }, - { token: 'attribute.name', foreground: 'FF0000' }, - { token: 'attribute.value', foreground: '0451A5' }, - { token: 'attribute.value.number', foreground: '098658' }, - { token: 'attribute.value.unit', foreground: '098658' }, - { token: 'attribute.value.html', foreground: '0000FF' }, - { token: 'attribute.value.xml', foreground: '0000FF' }, - { token: 'string', foreground: 'A31515' }, - { token: 'string.html', foreground: '0000FF' }, - { token: 'string.sql', foreground: 'FF0000' }, - { token: 'string.yaml', foreground: '0451A5' }, - { token: 'keyword', foreground: '0000FF' }, - { token: 'keyword.json', foreground: '0451A5' }, - { token: 'keyword.flow', foreground: 'AF00DB' }, - { token: 'keyword.flow.scss', foreground: '0000FF' }, - { token: 'operator.scss', foreground: '666666' }, - { token: 'operator.sql', foreground: '778899' }, - { token: 'operator.swift', foreground: '666666' }, - { token: 'predefined.sql', foreground: 'FF00FF' }, - ], - colors: { - [_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_1__["editorBackground"]]: '#FFFFFE', - [_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_1__["editorForeground"]]: '#000000', - [_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_1__["editorInactiveSelection"]]: '#E5EBF1', - [_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["editorIndentGuides"]]: '#D3D3D3', - [_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["editorActiveIndentGuides"]]: '#939393', - [_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_1__["editorSelectionHighlight"]]: '#ADD6FF4D' - } -}; -/* -------------------------------- End vs theme -------------------------------- */ -/* -------------------------------- Begin vs-dark theme -------------------------------- */ -const vs_dark = { - base: 'vs-dark', - inherit: false, - rules: [ - { token: '', foreground: 'D4D4D4', background: '1E1E1E' }, - { token: 'invalid', foreground: 'f44747' }, - { token: 'emphasis', fontStyle: 'italic' }, - { token: 'strong', fontStyle: 'bold' }, - { token: 'variable', foreground: '74B0DF' }, - { token: 'variable.predefined', foreground: '4864AA' }, - { token: 'variable.parameter', foreground: '9CDCFE' }, - { token: 'constant', foreground: '569CD6' }, - { token: 'comment', foreground: '608B4E' }, - { token: 'number', foreground: 'B5CEA8' }, - { token: 'number.hex', foreground: '5BB498' }, - { token: 'regexp', foreground: 'B46695' }, - { token: 'annotation', foreground: 'cc6666' }, - { token: 'type', foreground: '3DC9B0' }, - { token: 'delimiter', foreground: 'DCDCDC' }, - { token: 'delimiter.html', foreground: '808080' }, - { token: 'delimiter.xml', foreground: '808080' }, - { token: 'tag', foreground: '569CD6' }, - { token: 'tag.id.pug', foreground: '4F76AC' }, - { token: 'tag.class.pug', foreground: '4F76AC' }, - { token: 'meta.scss', foreground: 'A79873' }, - { token: 'meta.tag', foreground: 'CE9178' }, - { token: 'metatag', foreground: 'DD6A6F' }, - { token: 'metatag.content.html', foreground: '9CDCFE' }, - { token: 'metatag.html', foreground: '569CD6' }, - { token: 'metatag.xml', foreground: '569CD6' }, - { token: 'metatag.php', fontStyle: 'bold' }, - { token: 'key', foreground: '9CDCFE' }, - { token: 'string.key.json', foreground: '9CDCFE' }, - { token: 'string.value.json', foreground: 'CE9178' }, - { token: 'attribute.name', foreground: '9CDCFE' }, - { token: 'attribute.value', foreground: 'CE9178' }, - { token: 'attribute.value.number.css', foreground: 'B5CEA8' }, - { token: 'attribute.value.unit.css', foreground: 'B5CEA8' }, - { token: 'attribute.value.hex.css', foreground: 'D4D4D4' }, - { token: 'string', foreground: 'CE9178' }, - { token: 'string.sql', foreground: 'FF0000' }, - { token: 'keyword', foreground: '569CD6' }, - { token: 'keyword.flow', foreground: 'C586C0' }, - { token: 'keyword.json', foreground: 'CE9178' }, - { token: 'keyword.flow.scss', foreground: '569CD6' }, - { token: 'operator.scss', foreground: '909090' }, - { token: 'operator.sql', foreground: '778899' }, - { token: 'operator.swift', foreground: '909090' }, - { token: 'predefined.sql', foreground: 'FF00FF' }, - ], - colors: { - [_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_1__["editorBackground"]]: '#1E1E1E', - [_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_1__["editorForeground"]]: '#D4D4D4', - [_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_1__["editorInactiveSelection"]]: '#3A3D41', - [_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["editorIndentGuides"]]: '#404040', - [_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["editorActiveIndentGuides"]]: '#707070', - [_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_1__["editorSelectionHighlight"]]: '#ADD6FF26' - } -}; -/* -------------------------------- End vs-dark theme -------------------------------- */ -/* -------------------------------- Begin hc-black theme -------------------------------- */ -const hc_black = { - base: 'hc-black', - inherit: false, - rules: [ - { token: '', foreground: 'FFFFFF', background: '000000' }, - { token: 'invalid', foreground: 'f44747' }, - { token: 'emphasis', fontStyle: 'italic' }, - { token: 'strong', fontStyle: 'bold' }, - { token: 'variable', foreground: '1AEBFF' }, - { token: 'variable.parameter', foreground: '9CDCFE' }, - { token: 'constant', foreground: '569CD6' }, - { token: 'comment', foreground: '608B4E' }, - { token: 'number', foreground: 'FFFFFF' }, - { token: 'regexp', foreground: 'C0C0C0' }, - { token: 'annotation', foreground: '569CD6' }, - { token: 'type', foreground: '3DC9B0' }, - { token: 'delimiter', foreground: 'FFFF00' }, - { token: 'delimiter.html', foreground: 'FFFF00' }, - { token: 'tag', foreground: '569CD6' }, - { token: 'tag.id.pug', foreground: '4F76AC' }, - { token: 'tag.class.pug', foreground: '4F76AC' }, - { token: 'meta', foreground: 'D4D4D4' }, - { token: 'meta.tag', foreground: 'CE9178' }, - { token: 'metatag', foreground: '569CD6' }, - { token: 'metatag.content.html', foreground: '1AEBFF' }, - { token: 'metatag.html', foreground: '569CD6' }, - { token: 'metatag.xml', foreground: '569CD6' }, - { token: 'metatag.php', fontStyle: 'bold' }, - { token: 'key', foreground: '9CDCFE' }, - { token: 'string.key', foreground: '9CDCFE' }, - { token: 'string.value', foreground: 'CE9178' }, - { token: 'attribute.name', foreground: '569CD6' }, - { token: 'attribute.value', foreground: '3FF23F' }, - { token: 'string', foreground: 'CE9178' }, - { token: 'string.sql', foreground: 'FF0000' }, - { token: 'keyword', foreground: '569CD6' }, - { token: 'keyword.flow', foreground: 'C586C0' }, - { token: 'operator.sql', foreground: '778899' }, - { token: 'operator.swift', foreground: '909090' }, - { token: 'predefined.sql', foreground: 'FF00FF' }, - ], - colors: { - [_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_1__["editorBackground"]]: '#000000', - [_platform_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_1__["editorForeground"]]: '#FFFFFF', - [_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["editorIndentGuides"]]: '#FFFFFF', - [_common_view_editorColorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["editorActiveIndentGuides"]]: '#FFFFFF', - } -}; -/* -------------------------------- End hc-black theme -------------------------------- */ - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/fillers/monaco-editor-core.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/fillers/monaco-editor-core.js ***! - \**************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../editor/editor.api.js */ "./include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js"); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/monaco.contribution.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/monaco.contribution.js ***! - \*******************************************************************************/ -/*! exports provided: cssDefaults, scssDefaults, lessDefaults */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cssDefaults", function() { return cssDefaults; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scssDefaults", function() { return scssDefaults; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lessDefaults", function() { return lessDefaults; }); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.api.js */ "./include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js"); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fillers/monaco-editor-core.js */ "./node_modules/monaco-editor/esm/vs/language/css/fillers/monaco-editor-core.js"); - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -// --- CSS configuration and defaults --------- -var LanguageServiceDefaultsImpl = /** @class */ (function () { - function LanguageServiceDefaultsImpl(languageId, diagnosticsOptions, modeConfiguration) { - this._onDidChange = new _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"](); - this._languageId = languageId; - this.setDiagnosticsOptions(diagnosticsOptions); - this.setModeConfiguration(modeConfiguration); - } - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "onDidChange", { - get: function () { - return this._onDidChange.event; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "modeConfiguration", { - get: function () { - return this._modeConfiguration; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "diagnosticsOptions", { - get: function () { - return this._diagnosticsOptions; - }, - enumerable: false, - configurable: true - }); - LanguageServiceDefaultsImpl.prototype.setDiagnosticsOptions = function (options) { - this._diagnosticsOptions = options || Object.create(null); - this._onDidChange.fire(this); - }; - LanguageServiceDefaultsImpl.prototype.setModeConfiguration = function (modeConfiguration) { - this._modeConfiguration = modeConfiguration || Object.create(null); - this._onDidChange.fire(this); - }; - return LanguageServiceDefaultsImpl; -}()); -var diagnosticDefault = { - validate: true, - lint: { - compatibleVendorPrefixes: 'ignore', - vendorPrefix: 'warning', - duplicateProperties: 'warning', - emptyRules: 'warning', - importStatement: 'ignore', - boxModel: 'ignore', - universalSelector: 'ignore', - zeroUnits: 'ignore', - fontFaceProperties: 'warning', - hexColorLength: 'error', - argumentsInColorFunction: 'error', - unknownProperties: 'warning', - ieHack: 'ignore', - unknownVendorSpecificProperties: 'ignore', - propertyIgnoredDueToDisplay: 'warning', - important: 'ignore', - float: 'ignore', - idSelector: 'ignore' - } -}; -var modeConfigurationDefault = { - completionItems: true, - hovers: true, - documentSymbols: true, - definitions: true, - references: true, - documentHighlights: true, - rename: true, - colors: true, - foldingRanges: true, - diagnostics: true, - selectionRanges: true -}; -var cssDefaults = new LanguageServiceDefaultsImpl('css', diagnosticDefault, modeConfigurationDefault); -var scssDefaults = new LanguageServiceDefaultsImpl('scss', diagnosticDefault, modeConfigurationDefault); -var lessDefaults = new LanguageServiceDefaultsImpl('less', diagnosticDefault, modeConfigurationDefault); -// export to the global based API -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["languages"].css = { cssDefaults: cssDefaults, lessDefaults: lessDefaults, scssDefaults: scssDefaults }; -// --- Registration to monaco editor --- -function getMode() { - return __webpack_require__.e(/*! import() */ 2).then(__webpack_require__.bind(null, /*! ./cssMode.js */ "./node_modules/monaco-editor/esm/vs/language/css/cssMode.js")); -} -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["languages"].onLanguage('less', function () { - getMode().then(function (mode) { return mode.setupMode(lessDefaults); }); -}); -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["languages"].onLanguage('scss', function () { - getMode().then(function (mode) { return mode.setupMode(scssDefaults); }); -}); -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["languages"].onLanguage('css', function () { - getMode().then(function (mode) { return mode.setupMode(cssDefaults); }); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/fillers/monaco-editor-core.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/fillers/monaco-editor-core.js ***! - \***************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../editor/editor.api.js */ "./include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js"); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/monaco.contribution.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/monaco.contribution.js ***! - \********************************************************************************/ -/*! exports provided: htmlDefaults, handlebarDefaults, razorDefaults */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "htmlDefaults", function() { return htmlDefaults; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handlebarDefaults", function() { return handlebarDefaults; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "razorDefaults", function() { return razorDefaults; }); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.api.js */ "./include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js"); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fillers/monaco-editor-core.js */ "./node_modules/monaco-editor/esm/vs/language/html/fillers/monaco-editor-core.js"); - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -// --- HTML configuration and defaults --------- -var LanguageServiceDefaultsImpl = /** @class */ (function () { - function LanguageServiceDefaultsImpl(languageId, options, modeConfiguration) { - this._onDidChange = new _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"](); - this._languageId = languageId; - this.setOptions(options); - this.setModeConfiguration(modeConfiguration); - } - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "onDidChange", { - get: function () { - return this._onDidChange.event; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "options", { - get: function () { - return this._options; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "modeConfiguration", { - get: function () { - return this._modeConfiguration; - }, - enumerable: false, - configurable: true - }); - LanguageServiceDefaultsImpl.prototype.setOptions = function (options) { - this._options = options || Object.create(null); - this._onDidChange.fire(this); - }; - LanguageServiceDefaultsImpl.prototype.setModeConfiguration = function (modeConfiguration) { - this._modeConfiguration = modeConfiguration || Object.create(null); - this._onDidChange.fire(this); - }; - return LanguageServiceDefaultsImpl; -}()); -var formatDefaults = { - tabSize: 4, - insertSpaces: false, - wrapLineLength: 120, - unformatted: 'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var', - contentUnformatted: 'pre', - indentInnerHtml: false, - preserveNewLines: true, - maxPreserveNewLines: null, - indentHandlebars: false, - endWithNewline: false, - extraLiners: 'head, body, /html', - wrapAttributes: 'auto' -}; -var htmlOptionsDefault = { - format: formatDefaults, - suggest: { html5: true, angular1: true, ionic: true } -}; -var handlebarOptionsDefault = { - format: formatDefaults, - suggest: { html5: true } -}; -var razorOptionsDefault = { - format: formatDefaults, - suggest: { html5: true, razor: true } -}; -function getConfigurationDefault(languageId) { - return { - completionItems: true, - hovers: true, - documentSymbols: true, - links: true, - documentHighlights: true, - rename: true, - colors: true, - foldingRanges: true, - selectionRanges: true, - diagnostics: languageId === htmlLanguageId, - documentFormattingEdits: languageId === htmlLanguageId, - documentRangeFormattingEdits: languageId === htmlLanguageId // turned off for Razor and Handlebar - }; -} -var htmlLanguageId = 'html'; -var handlebarsLanguageId = 'handlebars'; -var razorLanguageId = 'razor'; -var htmlDefaults = new LanguageServiceDefaultsImpl(htmlLanguageId, htmlOptionsDefault, getConfigurationDefault(htmlLanguageId)); -var handlebarDefaults = new LanguageServiceDefaultsImpl(handlebarsLanguageId, handlebarOptionsDefault, getConfigurationDefault(handlebarsLanguageId)); -var razorDefaults = new LanguageServiceDefaultsImpl(razorLanguageId, razorOptionsDefault, getConfigurationDefault(razorLanguageId)); -// export to the global based API -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["languages"].html = { htmlDefaults: htmlDefaults, razorDefaults: razorDefaults, handlebarDefaults: handlebarDefaults }; -// --- Registration to monaco editor --- -function getMode() { - return __webpack_require__.e(/*! import() */ 3).then(__webpack_require__.bind(null, /*! ./htmlMode.js */ "./node_modules/monaco-editor/esm/vs/language/html/htmlMode.js")); -} -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["languages"].onLanguage(htmlLanguageId, function () { - getMode().then(function (mode) { return mode.setupMode(htmlDefaults); }); -}); -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["languages"].onLanguage(handlebarsLanguageId, function () { - getMode().then(function (mode) { return mode.setupMode(handlebarDefaults); }); -}); -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["languages"].onLanguage(razorLanguageId, function () { - getMode().then(function (mode) { return mode.setupMode(razorDefaults); }); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/fillers/monaco-editor-core.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/fillers/monaco-editor-core.js ***! - \***************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../editor/editor.api.js */ "./include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js"); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/monaco.contribution.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/monaco.contribution.js ***! - \********************************************************************************/ -/*! exports provided: jsonDefaults */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jsonDefaults", function() { return jsonDefaults; }); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.api.js */ "./include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js"); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fillers/monaco-editor-core.js */ "./node_modules/monaco-editor/esm/vs/language/json/fillers/monaco-editor-core.js"); - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var LanguageServiceDefaultsImpl = /** @class */ (function () { - function LanguageServiceDefaultsImpl(languageId, diagnosticsOptions, modeConfiguration) { - this._onDidChange = new _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"](); - this._languageId = languageId; - this.setDiagnosticsOptions(diagnosticsOptions); - this.setModeConfiguration(modeConfiguration); - } - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "onDidChange", { - get: function () { - return this._onDidChange.event; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "modeConfiguration", { - get: function () { - return this._modeConfiguration; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "diagnosticsOptions", { - get: function () { - return this._diagnosticsOptions; - }, - enumerable: false, - configurable: true - }); - LanguageServiceDefaultsImpl.prototype.setDiagnosticsOptions = function (options) { - this._diagnosticsOptions = options || Object.create(null); - this._onDidChange.fire(this); - }; - LanguageServiceDefaultsImpl.prototype.setModeConfiguration = function (modeConfiguration) { - this._modeConfiguration = modeConfiguration || Object.create(null); - this._onDidChange.fire(this); - }; - return LanguageServiceDefaultsImpl; -}()); -var diagnosticDefault = { - validate: true, - allowComments: true, - schemas: [], - enableSchemaRequest: false -}; -var modeConfigurationDefault = { - documentFormattingEdits: true, - documentRangeFormattingEdits: true, - completionItems: true, - hovers: true, - documentSymbols: true, - tokens: true, - colors: true, - foldingRanges: true, - diagnostics: true, - selectionRanges: true -}; -var jsonDefaults = new LanguageServiceDefaultsImpl('json', diagnosticDefault, modeConfigurationDefault); -// export to the global based API -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["languages"].json = { jsonDefaults: jsonDefaults }; -// --- Registration to monaco editor --- -function getMode() { - return __webpack_require__.e(/*! import() */ 4).then(__webpack_require__.bind(null, /*! ./jsonMode.js */ "./node_modules/monaco-editor/esm/vs/language/json/jsonMode.js")); -} -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["languages"].register({ - id: 'json', - extensions: ['.json', '.bowerrc', '.jshintrc', '.jscsrc', '.eslintrc', '.babelrc', '.har'], - aliases: ['JSON', 'json'], - mimetypes: ['application/json'] -}); -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_1__["languages"].onLanguage('json', function () { - getMode().then(function (mode) { return mode.setupMode(jsonDefaults); }); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/typescript/fillers/monaco-editor-core.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/typescript/fillers/monaco-editor-core.js ***! - \*********************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../editor/editor.api.js */ "./include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js"); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/typescript/lib/typescriptServicesMetadata.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/typescript/lib/typescriptServicesMetadata.js ***! - \*************************************************************************************************/ -/*! exports provided: typescriptVersion */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "typescriptVersion", function() { return typescriptVersion; }); -// -// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript` -// -var typescriptVersion = "4.0.3"; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/typescript/monaco.contribution.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/typescript/monaco.contribution.js ***! - \**************************************************************************************/ -/*! exports provided: ModuleKind, JsxEmit, NewLineKind, ScriptTarget, ModuleResolutionKind, typescriptVersion, typescriptDefaults, javascriptDefaults, getTypeScriptWorker, getJavaScriptWorker */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModuleKind", function() { return ModuleKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsxEmit", function() { return JsxEmit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NewLineKind", function() { return NewLineKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScriptTarget", function() { return ScriptTarget; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModuleResolutionKind", function() { return ModuleResolutionKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "typescriptVersion", function() { return typescriptVersion; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "typescriptDefaults", function() { return typescriptDefaults; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "javascriptDefaults", function() { return javascriptDefaults; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTypeScriptWorker", function() { return getTypeScriptWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getJavaScriptWorker", function() { return getJavaScriptWorker; }); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.api.js */ "./include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js"); -/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _lib_typescriptServicesMetadata_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/typescriptServicesMetadata.js */ "./node_modules/monaco-editor/esm/vs/language/typescript/lib/typescriptServicesMetadata.js"); -/* harmony import */ var _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fillers/monaco-editor-core.js */ "./node_modules/monaco-editor/esm/vs/language/typescript/fillers/monaco-editor-core.js"); - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - // do not import the whole typescriptServices here - -//#region enums copied from typescript to prevent loading the entire typescriptServices --- -var ModuleKind; -(function (ModuleKind) { - ModuleKind[ModuleKind["None"] = 0] = "None"; - ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; - ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; - ModuleKind[ModuleKind["UMD"] = 3] = "UMD"; - ModuleKind[ModuleKind["System"] = 4] = "System"; - ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015"; - ModuleKind[ModuleKind["ESNext"] = 99] = "ESNext"; -})(ModuleKind || (ModuleKind = {})); -var JsxEmit; -(function (JsxEmit) { - JsxEmit[JsxEmit["None"] = 0] = "None"; - JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; - JsxEmit[JsxEmit["React"] = 2] = "React"; - JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; -})(JsxEmit || (JsxEmit = {})); -var NewLineKind; -(function (NewLineKind) { - NewLineKind[NewLineKind["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; - NewLineKind[NewLineKind["LineFeed"] = 1] = "LineFeed"; -})(NewLineKind || (NewLineKind = {})); -var ScriptTarget; -(function (ScriptTarget) { - ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; - ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; - ScriptTarget[ScriptTarget["ES2015"] = 2] = "ES2015"; - ScriptTarget[ScriptTarget["ES2016"] = 3] = "ES2016"; - ScriptTarget[ScriptTarget["ES2017"] = 4] = "ES2017"; - ScriptTarget[ScriptTarget["ES2018"] = 5] = "ES2018"; - ScriptTarget[ScriptTarget["ES2019"] = 6] = "ES2019"; - ScriptTarget[ScriptTarget["ES2020"] = 7] = "ES2020"; - ScriptTarget[ScriptTarget["ESNext"] = 99] = "ESNext"; - ScriptTarget[ScriptTarget["JSON"] = 100] = "JSON"; - ScriptTarget[ScriptTarget["Latest"] = 99] = "Latest"; -})(ScriptTarget || (ScriptTarget = {})); -var ModuleResolutionKind; -(function (ModuleResolutionKind) { - ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic"; - ModuleResolutionKind[ModuleResolutionKind["NodeJs"] = 2] = "NodeJs"; -})(ModuleResolutionKind || (ModuleResolutionKind = {})); -// --- TypeScript configuration and defaults --------- -var LanguageServiceDefaultsImpl = /** @class */ (function () { - function LanguageServiceDefaultsImpl(compilerOptions, diagnosticsOptions, workerOptions) { - this._onDidChange = new _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"](); - this._onDidExtraLibsChange = new _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"](); - this._extraLibs = Object.create(null); - this._removedExtraLibs = Object.create(null); - this._eagerModelSync = false; - this.setCompilerOptions(compilerOptions); - this.setDiagnosticsOptions(diagnosticsOptions); - this.setWorkerOptions(workerOptions); - this._onDidExtraLibsChangeTimeout = -1; - } - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "onDidChange", { - get: function () { - return this._onDidChange.event; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "onDidExtraLibsChange", { - get: function () { - return this._onDidExtraLibsChange.event; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LanguageServiceDefaultsImpl.prototype, "workerOptions", { - get: function () { - return this._workerOptions; - }, - enumerable: false, - configurable: true - }); - LanguageServiceDefaultsImpl.prototype.getExtraLibs = function () { - return this._extraLibs; - }; - LanguageServiceDefaultsImpl.prototype.addExtraLib = function (content, _filePath) { - var _this = this; - var filePath; - if (typeof _filePath === 'undefined') { - filePath = "ts:extralib-" + Math.random().toString(36).substring(2, 15); - } - else { - filePath = _filePath; - } - if (this._extraLibs[filePath] && this._extraLibs[filePath].content === content) { - // no-op, there already exists an extra lib with this content - return { - dispose: function () { } - }; - } - var myVersion = 1; - if (this._removedExtraLibs[filePath]) { - myVersion = this._removedExtraLibs[filePath] + 1; - } - if (this._extraLibs[filePath]) { - myVersion = this._extraLibs[filePath].version + 1; - } - this._extraLibs[filePath] = { - content: content, - version: myVersion - }; - this._fireOnDidExtraLibsChangeSoon(); - return { - dispose: function () { - var extraLib = _this._extraLibs[filePath]; - if (!extraLib) { - return; - } - if (extraLib.version !== myVersion) { - return; - } - delete _this._extraLibs[filePath]; - _this._removedExtraLibs[filePath] = myVersion; - _this._fireOnDidExtraLibsChangeSoon(); - } - }; - }; - LanguageServiceDefaultsImpl.prototype.setExtraLibs = function (libs) { - for (var filePath in this._extraLibs) { - this._removedExtraLibs[filePath] = this._extraLibs[filePath].version; - } - // clear out everything - this._extraLibs = Object.create(null); - if (libs && libs.length > 0) { - for (var _i = 0, libs_1 = libs; _i < libs_1.length; _i++) { - var lib = libs_1[_i]; - var filePath = lib.filePath || "ts:extralib-" + Math.random().toString(36).substring(2, 15); - var content = lib.content; - var myVersion = 1; - if (this._removedExtraLibs[filePath]) { - myVersion = this._removedExtraLibs[filePath] + 1; - } - this._extraLibs[filePath] = { - content: content, - version: myVersion - }; - } - } - this._fireOnDidExtraLibsChangeSoon(); - }; - LanguageServiceDefaultsImpl.prototype._fireOnDidExtraLibsChangeSoon = function () { - var _this = this; - if (this._onDidExtraLibsChangeTimeout !== -1) { - // already scheduled - return; - } - this._onDidExtraLibsChangeTimeout = setTimeout(function () { - _this._onDidExtraLibsChangeTimeout = -1; - _this._onDidExtraLibsChange.fire(undefined); - }, 0); - }; - LanguageServiceDefaultsImpl.prototype.getCompilerOptions = function () { - return this._compilerOptions; - }; - LanguageServiceDefaultsImpl.prototype.setCompilerOptions = function (options) { - this._compilerOptions = options || Object.create(null); - this._onDidChange.fire(undefined); - }; - LanguageServiceDefaultsImpl.prototype.getDiagnosticsOptions = function () { - return this._diagnosticsOptions; - }; - LanguageServiceDefaultsImpl.prototype.setDiagnosticsOptions = function (options) { - this._diagnosticsOptions = options || Object.create(null); - this._onDidChange.fire(undefined); - }; - LanguageServiceDefaultsImpl.prototype.setWorkerOptions = function (options) { - this._workerOptions = options || Object.create(null); - this._onDidChange.fire(undefined); - }; - LanguageServiceDefaultsImpl.prototype.setMaximumWorkerIdleTime = function (value) { }; - LanguageServiceDefaultsImpl.prototype.setEagerModelSync = function (value) { - // doesn't fire an event since no - // worker restart is required here - this._eagerModelSync = value; - }; - LanguageServiceDefaultsImpl.prototype.getEagerModelSync = function () { - return this._eagerModelSync; - }; - return LanguageServiceDefaultsImpl; -}()); -var typescriptVersion = _lib_typescriptServicesMetadata_js__WEBPACK_IMPORTED_MODULE_1__["typescriptVersion"]; -var typescriptDefaults = new LanguageServiceDefaultsImpl({ allowNonTsExtensions: true, target: ScriptTarget.Latest }, { noSemanticValidation: false, noSyntaxValidation: false }, {}); -var javascriptDefaults = new LanguageServiceDefaultsImpl({ allowNonTsExtensions: true, allowJs: true, target: ScriptTarget.Latest }, { noSemanticValidation: true, noSyntaxValidation: false }, {}); -var getTypeScriptWorker = function () { - return getMode().then(function (mode) { return mode.getTypeScriptWorker(); }); -}; -var getJavaScriptWorker = function () { - return getMode().then(function (mode) { return mode.getJavaScriptWorker(); }); -}; -// export to the global based API -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_2__["languages"].typescript = { - ModuleKind: ModuleKind, - JsxEmit: JsxEmit, - NewLineKind: NewLineKind, - ScriptTarget: ScriptTarget, - ModuleResolutionKind: ModuleResolutionKind, - typescriptVersion: typescriptVersion, - typescriptDefaults: typescriptDefaults, - javascriptDefaults: javascriptDefaults, - getTypeScriptWorker: getTypeScriptWorker, - getJavaScriptWorker: getJavaScriptWorker -}; -// --- Registration to monaco editor --- -function getMode() { - return __webpack_require__.e(/*! import() */ 5).then(__webpack_require__.bind(null, /*! ./tsMode.js */ "./node_modules/monaco-editor/esm/vs/language/typescript/tsMode.js")); -} -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_2__["languages"].onLanguage('typescript', function () { - return getMode().then(function (mode) { return mode.setupTypeScript(typescriptDefaults); }); -}); -_fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_2__["languages"].onLanguage('javascript', function () { - return getMode().then(function (mode) { return mode.setupJavaScript(javascriptDefaults); }); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/nls.js": -/*!**************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/nls.js ***! - \**************************************************/ -/*! exports provided: localize */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "localize", function() { return localize; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function _format(message, args) { - let result; - if (args.length === 0) { - result = message; - } - else { - result = message.replace(/\{(\d+)\}/g, function (match, rest) { - const index = rest[0]; - return typeof args[index] !== 'undefined' ? args[index] : match; - }); - } - return result; -} -function localize(data, message, ...args) { - return _format(message, args); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js ***! - \******************************************************************************************/ -/*! exports provided: IAccessibilityService, CONTEXT_ACCESSIBILITY_MODE_ENABLED */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IAccessibilityService", function() { return IAccessibilityService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CONTEXT_ACCESSIBILITY_MODE_ENABLED", function() { return CONTEXT_ACCESSIBILITY_MODE_ENABLED; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -const IAccessibilityService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('accessibilityService'); -const CONTEXT_ACCESSIBILITY_MODE_ENABLED = new _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_1__["RawContextKey"]('accessibilityModeEnabled', false); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibilityService.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibilityService.js ***! - \*************************************************************************************************/ -/*! exports provided: AccessibilityService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccessibilityService", function() { return AccessibilityService; }); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _accessibility_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./accessibility.js */ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - -let AccessibilityService = class AccessibilityService extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["Disposable"] { - constructor(_contextKeyService, _configurationService) { - super(); - this._contextKeyService = _contextKeyService; - this._configurationService = _configurationService; - this._accessibilitySupport = 0 /* Unknown */; - this._onDidChangeScreenReaderOptimized = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"](); - this._accessibilityModeEnabledContext = _accessibility_js__WEBPACK_IMPORTED_MODULE_1__["CONTEXT_ACCESSIBILITY_MODE_ENABLED"].bindTo(this._contextKeyService); - const updateContextKey = () => this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized()); - this._register(this._configurationService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration('editor.accessibilitySupport')) { - updateContextKey(); - this._onDidChangeScreenReaderOptimized.fire(); - } - })); - updateContextKey(); - this.onDidChangeScreenReaderOptimized(() => updateContextKey()); - } - get onDidChangeScreenReaderOptimized() { - return this._onDidChangeScreenReaderOptimized.event; - } - isScreenReaderOptimized() { - const config = this._configurationService.getValue('editor.accessibilitySupport'); - return config === 'on' || (config === 'auto' && this._accessibilitySupport === 2 /* Enabled */); - } - getAccessibilitySupport() { - return this._accessibilitySupport; - } -}; -AccessibilityService = __decorate([ - __param(0, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_3__["IContextKeyService"]), - __param(1, _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_4__["IConfigurationService"]) -], AccessibilityService); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js ***! - \***********************************************************************************************/ -/*! exports provided: createAndFillInActionBarActions, MenuEntryActionViewItem, SubmenuEntryActionViewItem */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAndFillInActionBarActions", function() { return createAndFillInActionBarActions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuEntryActionViewItem", function() { return MenuEntryActionViewItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubmenuEntryActionViewItem", function() { return SubmenuEntryActionViewItem; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/event.js */ "./node_modules/monaco-editor/esm/vs/base/browser/event.js"); -/* harmony import */ var _base_common_actions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_idGenerator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/idGenerator.js */ "./node_modules/monaco-editor/esm/vs/base/common/idGenerator.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _common_actions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../contextview/browser/contextView.js */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextView.js"); -/* harmony import */ var _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _notification_common_notification_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _base_browser_ui_actionbar_actionViewItems_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../base/browser/ui/actionbar/actionViewItems.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js"); -/* harmony import */ var _base_browser_ui_dropdown_dropdownActionViewItem_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../base/browser/ui/dropdown/dropdownActionViewItem.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - -// The alternative key on all platforms is alt. On windows we also support shift as an alternative key #44136 -class AlternativeKeyEmitter extends _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"] { - constructor(contextMenuService) { - super(); - this._subscriptions = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["DisposableStore"](); - this._isPressed = false; - this._suppressAltKeyUp = false; - this._subscriptions.add(Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_1__["domEvent"])(document.body, 'keydown')(e => { - this.isPressed = e.altKey || ((_base_common_platform_js__WEBPACK_IMPORTED_MODULE_6__["isWindows"] || _base_common_platform_js__WEBPACK_IMPORTED_MODULE_6__["isLinux"]) && e.shiftKey); - })); - this._subscriptions.add(Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_1__["domEvent"])(document.body, 'keyup')(e => { - if (this.isPressed) { - if (this._suppressAltKeyUp) { - e.preventDefault(); - } - } - this._suppressAltKeyUp = false; - this.isPressed = false; - })); - this._subscriptions.add(Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_1__["domEvent"])(document.body, 'mouseleave')(e => this.isPressed = false)); - this._subscriptions.add(Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_1__["domEvent"])(document.body, 'blur')(e => this.isPressed = false)); - // Workaround since we do not get any events while a context menu is shown - this._subscriptions.add(contextMenuService.onDidContextMenu(() => this.isPressed = false)); - } - get isPressed() { - return this._isPressed; - } - set isPressed(value) { - this._isPressed = value; - this.fire(this._isPressed); - } - suppressAltKeyUp() { - // Sometimes the native alt behavior needs to be suppresed since the alt was already used as an alternative key - // Example: windows behavior to toggle tha top level menu #44396 - this._suppressAltKeyUp = true; - } - static getInstance(contextMenuService) { - if (!AlternativeKeyEmitter.instance) { - AlternativeKeyEmitter.instance = new AlternativeKeyEmitter(contextMenuService); - } - return AlternativeKeyEmitter.instance; - } - dispose() { - super.dispose(); - this._subscriptions.dispose(); - } -} -function createAndFillInActionBarActions(menu, options, target, isPrimaryGroup) { - const groups = menu.getActions(options); - // Action bars handle alternative actions on their own so the alternative actions should be ignored - fillInActions(groups, target, false, isPrimaryGroup); - return asDisposable(groups); -} -function asDisposable(groups) { - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["DisposableStore"](); - for (const [, actions] of groups) { - for (const action of actions) { - disposables.add(action); - } - } - return disposables; -} -function fillInActions(groups, target, useAlternativeActions, isPrimaryGroup = group => group === 'navigation') { - for (let tuple of groups) { - let [group, actions] = tuple; - if (useAlternativeActions) { - actions = actions.map(a => (a instanceof _common_actions_js__WEBPACK_IMPORTED_MODULE_8__["MenuItemAction"]) && !!a.alt ? a.alt : a); - } - if (isPrimaryGroup(group)) { - const to = Array.isArray(target) ? target : target.primary; - to.unshift(...actions); - } - else { - const to = Array.isArray(target) ? target : target.secondary; - if (to.length > 0) { - to.push(new _base_common_actions_js__WEBPACK_IMPORTED_MODULE_2__["Separator"]()); - } - to.push(...actions); - } - } -} -const ids = new _base_common_idGenerator_js__WEBPACK_IMPORTED_MODULE_4__["IdGenerator"]('menu-item-action-item-icon-'); -const ICON_PATH_TO_CSS_RULES = new Map(); -let MenuEntryActionViewItem = class MenuEntryActionViewItem extends _base_browser_ui_actionbar_actionViewItems_js__WEBPACK_IMPORTED_MODULE_13__["ActionViewItem"] { - constructor(_action, _keybindingService, _notificationService, _contextMenuService) { - super(undefined, _action, { icon: !!(_action.class || _action.item.icon), label: !_action.class && !_action.item.icon }); - this._action = _action; - this._keybindingService = _keybindingService; - this._notificationService = _notificationService; - this._wantsAltCommand = false; - this._itemClassDispose = this._register(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["MutableDisposable"]()); - this._altKey = AlternativeKeyEmitter.getInstance(_contextMenuService); - } - get _commandAction() { - return this._wantsAltCommand && this._action.alt || this._action; - } - onClick(event) { - event.preventDefault(); - event.stopPropagation(); - if (this._altKey.isPressed) { - this._altKey.suppressAltKeyUp(); - } - this.actionRunner.run(this._commandAction, this._context) - .then(undefined, err => this._notificationService.error(err)); - } - render(container) { - super.render(container); - this._updateItemClass(this._action.item); - let mouseOver = false; - let alternativeKeyDown = this._altKey.isPressed; - const updateAltState = () => { - const wantsAltCommand = mouseOver && alternativeKeyDown; - if (wantsAltCommand !== this._wantsAltCommand) { - this._wantsAltCommand = wantsAltCommand; - this.updateLabel(); - this.updateTooltip(); - this.updateClass(); - } - }; - if (this._action.alt) { - this._register(this._altKey.event(value => { - alternativeKeyDown = value; - updateAltState(); - })); - } - this._register(Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_1__["domEvent"])(container, 'mouseleave')(_ => { - mouseOver = false; - updateAltState(); - })); - this._register(Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_1__["domEvent"])(container, 'mouseenter')(e => { - mouseOver = true; - updateAltState(); - })); - } - updateLabel() { - if (this.options.label && this.label) { - this.label.textContent = this._commandAction.label; - } - } - updateTooltip() { - if (this.label) { - const keybinding = this._keybindingService.lookupKeybinding(this._commandAction.id); - const keybindingLabel = keybinding && keybinding.getLabel(); - const tooltip = this._commandAction.tooltip || this._commandAction.label; - this.label.title = keybindingLabel - ? Object(_nls_js__WEBPACK_IMPORTED_MODULE_7__["localize"])('titleAndKb', "{0} ({1})", tooltip, keybindingLabel) - : tooltip; - } - } - updateClass() { - if (this.options.icon) { - if (this._commandAction !== this._action) { - if (this._action.alt) { - this._updateItemClass(this._action.alt.item); - } - } - else if (this._action.alt) { - this._updateItemClass(this._action.item); - } - } - } - _updateItemClass(item) { - var _a, _b; - this._itemClassDispose.value = undefined; - const icon = this._commandAction.checked && ((_a = item.toggled) === null || _a === void 0 ? void 0 : _a.icon) ? item.toggled.icon : item.icon; - if (_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_12__["ThemeIcon"].isThemeIcon(icon)) { - // theme icons - const iconClass = _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_12__["ThemeIcon"].asClassName(icon); - if (this.label && iconClass) { - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addClasses"])(this.label, iconClass); - this._itemClassDispose.value = Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["toDisposable"])(() => { - if (this.label) { - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["removeClasses"])(this.label, iconClass); - } - }); - } - } - else if (icon) { - // icon path - let iconClass; - if ((_b = icon.dark) === null || _b === void 0 ? void 0 : _b.scheme) { - const iconPathMapKey = icon.dark.toString(); - if (ICON_PATH_TO_CSS_RULES.has(iconPathMapKey)) { - iconClass = ICON_PATH_TO_CSS_RULES.get(iconPathMapKey); - } - else { - iconClass = ids.nextId(); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["createCSSRule"])(`.icon.${iconClass}`, `background-image: ${Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["asCSSUrl"])(icon.light || icon.dark)}`); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["createCSSRule"])(`.vs-dark .icon.${iconClass}, .hc-black .icon.${iconClass}`, `background-image: ${Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["asCSSUrl"])(icon.dark)}`); - ICON_PATH_TO_CSS_RULES.set(iconPathMapKey, iconClass); - } - if (this.label) { - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["addClasses"])(this.label, 'icon', iconClass); - this._itemClassDispose.value = Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__["toDisposable"])(() => { - if (this.label) { - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["removeClasses"])(this.label, 'icon', iconClass); - } - }); - } - } - } - } -}; -MenuEntryActionViewItem = __decorate([ - __param(1, _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__["IKeybindingService"]), - __param(2, _notification_common_notification_js__WEBPACK_IMPORTED_MODULE_11__["INotificationService"]), - __param(3, _contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_9__["IContextMenuService"]) -], MenuEntryActionViewItem); - -let SubmenuEntryActionViewItem = class SubmenuEntryActionViewItem extends _base_browser_ui_dropdown_dropdownActionViewItem_js__WEBPACK_IMPORTED_MODULE_14__["DropdownMenuActionViewItem"] { - constructor(action, _notificationService, _contextMenuService) { - var _a; - const classNames = []; - if (action.item.icon) { - if (_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_12__["ThemeIcon"].isThemeIcon(action.item.icon)) { - classNames.push(_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_12__["ThemeIcon"].asClassName(action.item.icon)); - } - else if ((_a = action.item.icon.dark) === null || _a === void 0 ? void 0 : _a.scheme) { - const iconPathMapKey = action.item.icon.dark.toString(); - if (ICON_PATH_TO_CSS_RULES.has(iconPathMapKey)) { - classNames.push('icon', ICON_PATH_TO_CSS_RULES.get(iconPathMapKey)); - } - else { - const className = ids.nextId(); - classNames.push('icon', className); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["createCSSRule"])(`.icon.${className}`, `background-image: ${Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["asCSSUrl"])(action.item.icon.light || action.item.icon.dark)}`); - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["createCSSRule"])(`.vs-dark .icon.${className}, .hc-black .icon.${className}`, `background-image: ${Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["asCSSUrl"])(action.item.icon.dark)}`); - ICON_PATH_TO_CSS_RULES.set(iconPathMapKey, className); - } - } - } - super(action, action.actions, _contextMenuService, { classNames }); - } -}; -SubmenuEntryActionViewItem = __decorate([ - __param(1, _notification_common_notification_js__WEBPACK_IMPORTED_MODULE_11__["INotificationService"]), - __param(2, _contextview_browser_contextView_js__WEBPACK_IMPORTED_MODULE_9__["IContextMenuService"]) -], SubmenuEntryActionViewItem); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js ***! - \******************************************************************************/ -/*! exports provided: isIMenuItem, MenuId, IMenuService, MenuRegistry, ExecuteCommandAction, SubmenuItemAction, MenuItemAction */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIMenuItem", function() { return isIMenuItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuId", function() { return MenuId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IMenuService", function() { return IMenuService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuRegistry", function() { return MenuRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExecuteCommandAction", function() { return ExecuteCommandAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubmenuItemAction", function() { return SubmenuItemAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuItemAction", function() { return MenuItemAction; }); -/* harmony import */ var _base_common_actions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/* harmony import */ var _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - -function isIMenuItem(item) { - return item.command !== undefined; -} -class MenuId { - constructor(debugName) { - this.id = MenuId._idPool++; - this._debugName = debugName; - } -} -MenuId._idPool = 0; -MenuId.CommandPalette = new MenuId('CommandPalette'); -MenuId.EditorContext = new MenuId('EditorContext'); -MenuId.EditorContextPeek = new MenuId('EditorContextPeek'); -MenuId.MenubarEditMenu = new MenuId('MenubarEditMenu'); -MenuId.MenubarGoMenu = new MenuId('MenubarGoMenu'); -MenuId.MenubarSelectionMenu = new MenuId('MenubarSelectionMenu'); -const IMenuService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__["createDecorator"])('menuService'); -const MenuRegistry = new class { - constructor() { - this._commands = new Map(); - this._menuItems = new Map(); - this._onDidChangeMenu = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_5__["Emitter"](); - this.onDidChangeMenu = this._onDidChangeMenu.event; - this._commandPaletteChangeEvent = { - has: id => id === MenuId.CommandPalette - }; - } - addCommand(command) { - return this.addCommands(_base_common_iterator_js__WEBPACK_IMPORTED_MODULE_6__["Iterable"].single(command)); - } - addCommands(commands) { - for (const command of commands) { - this._commands.set(command.id, command); - } - this._onDidChangeMenu.fire(this._commandPaletteChangeEvent); - return Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["toDisposable"])(() => { - let didChange = false; - for (const command of commands) { - didChange = this._commands.delete(command.id) || didChange; - } - if (didChange) { - this._onDidChangeMenu.fire(this._commandPaletteChangeEvent); - } - }); - } - getCommand(id) { - return this._commands.get(id); - } - getCommands() { - const map = new Map(); - this._commands.forEach((value, key) => map.set(key, value)); - return map; - } - appendMenuItem(id, item) { - return this.appendMenuItems(_base_common_iterator_js__WEBPACK_IMPORTED_MODULE_6__["Iterable"].single({ id, item })); - } - appendMenuItems(items) { - const changedIds = new Set(); - const toRemove = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_7__["LinkedList"](); - for (const { id, item } of items) { - let list = this._menuItems.get(id); - if (!list) { - list = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_7__["LinkedList"](); - this._menuItems.set(id, list); - } - toRemove.push(list.push(item)); - changedIds.add(id); - } - this._onDidChangeMenu.fire(changedIds); - return Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["toDisposable"])(() => { - if (toRemove.size > 0) { - for (let fn of toRemove) { - fn(); - } - this._onDidChangeMenu.fire(changedIds); - toRemove.clear(); - } - }); - } - getMenuItems(id) { - let result; - if (this._menuItems.has(id)) { - result = [...this._menuItems.get(id)]; - } - else { - result = []; - } - if (id === MenuId.CommandPalette) { - // CommandPalette is special because it shows - // all commands by default - this._appendImplicitItems(result); - } - return result; - } - _appendImplicitItems(result) { - const set = new Set(); - for (const item of result) { - if (isIMenuItem(item)) { - set.add(item.command.id); - if (item.alt) { - set.add(item.alt.id); - } - } - } - this._commands.forEach((command, id) => { - if (!set.has(id)) { - result.push({ command }); - } - }); - } -}; -let ExecuteCommandAction = class ExecuteCommandAction extends _base_common_actions_js__WEBPACK_IMPORTED_MODULE_0__["Action"] { - constructor(id, label, _commandService) { - super(id, label); - this._commandService = _commandService; - } - run(...args) { - return this._commandService.executeCommand(this.id, ...args); - } -}; -ExecuteCommandAction = __decorate([ - __param(2, _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_3__["ICommandService"]) -], ExecuteCommandAction); - -class SubmenuItemAction extends _base_common_actions_js__WEBPACK_IMPORTED_MODULE_0__["SubmenuAction"] { - constructor(item, menuService, contextKeyService, options) { - super(`submenuitem.${item.submenu.id}`, typeof item.title === 'string' ? item.title : item.title.value, () => { - const result = []; - const menu = menuService.createMenu(item.submenu, contextKeyService); - const groups = menu.getActions(options); - menu.dispose(); - for (let group of groups) { - const [, actions] = group; - if (actions.length > 0) { - result.push(...actions); - result.push(new _base_common_actions_js__WEBPACK_IMPORTED_MODULE_0__["Separator"]()); - } - } - if (result.length) { - result.pop(); // remove last separator - } - return result; - }, 'submenu'); - this.item = item; - } -} -let MenuItemAction = class MenuItemAction extends ExecuteCommandAction { - constructor(item, alt, options, contextKeyService, commandService) { - typeof item.title === 'string' ? super(item.id, item.title, commandService) : super(item.id, item.title.value, commandService); - this._cssClass = undefined; - this._enabled = !item.precondition || contextKeyService.contextMatchesRules(item.precondition); - this._tooltip = item.tooltip ? typeof item.tooltip === 'string' ? item.tooltip : item.tooltip.value : undefined; - if (item.toggled) { - const toggled = (item.toggled.condition ? item.toggled : { condition: item.toggled }); - this._checked = contextKeyService.contextMatchesRules(toggled.condition); - if (this._checked && toggled.tooltip) { - this._tooltip = typeof toggled.tooltip === 'string' ? toggled.tooltip : toggled.tooltip.value; - } - } - this._options = options || {}; - this.item = item; - this.alt = alt ? new MenuItemAction(alt, undefined, this._options, contextKeyService, commandService) : undefined; - } - dispose() { - if (this.alt) { - this.alt.dispose(); - } - super.dispose(); - } - run(...args) { - let runArgs = []; - if (this._options.arg) { - runArgs = [...runArgs, this._options.arg]; - } - if (this._options.shouldForwardArgs) { - runArgs = [...runArgs, ...args]; - } - return super.run(...runArgs); - } -}; -MenuItemAction = __decorate([ - __param(3, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_2__["IContextKeyService"]), - __param(4, _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_3__["ICommandService"]) -], MenuItemAction); - -//#endregion - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/actions/common/menuService.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/actions/common/menuService.js ***! - \**********************************************************************************/ -/*! exports provided: MenuService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MenuService", function() { return MenuService; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _actions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actions.js */ "./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js"); -/* harmony import */ var _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - -let MenuService = class MenuService { - constructor(_commandService) { - this._commandService = _commandService; - // - } - createMenu(id, contextKeyService) { - return new Menu(id, this._commandService, contextKeyService, this); - } -}; -MenuService = __decorate([ - __param(0, _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_3__["ICommandService"]) -], MenuService); - -let Menu = class Menu { - constructor(_id, _commandService, _contextKeyService, _menuService) { - this._id = _id; - this._commandService = _commandService; - this._contextKeyService = _contextKeyService; - this._menuService = _menuService; - this._onDidChange = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - this._dispoables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this._menuGroups = []; - this._contextKeys = new Set(); - this._build(); - // rebuild this menu whenever the menu registry reports an - // event for this MenuId - this._dispoables.add(_base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].debounce(_base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].filter(_actions_js__WEBPACK_IMPORTED_MODULE_2__["MenuRegistry"].onDidChangeMenu, set => set.has(this._id)), () => { }, 50)(this._build, this)); - // when context keys change we need to check if the menu also - // has changed - this._dispoables.add(_base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].debounce(this._contextKeyService.onDidChangeContext, (last, event) => last || event.affectsSome(this._contextKeys), 50)(e => e && this._onDidChange.fire(undefined), this)); - } - dispose() { - this._dispoables.dispose(); - this._onDidChange.dispose(); - } - _build() { - // reset - this._menuGroups.length = 0; - this._contextKeys.clear(); - const menuItems = _actions_js__WEBPACK_IMPORTED_MODULE_2__["MenuRegistry"].getMenuItems(this._id); - let group; - menuItems.sort(Menu._compareMenuItems); - for (let item of menuItems) { - // group by groupId - const groupName = item.group || ''; - if (!group || group[0] !== groupName) { - group = [groupName, []]; - this._menuGroups.push(group); - } - group[1].push(item); - // keep keys for eventing - Menu._fillInKbExprKeys(item.when, this._contextKeys); - // keep precondition keys for event if applicable - if (Object(_actions_js__WEBPACK_IMPORTED_MODULE_2__["isIMenuItem"])(item) && item.command.precondition) { - Menu._fillInKbExprKeys(item.command.precondition, this._contextKeys); - } - // keep toggled keys for event if applicable - if (Object(_actions_js__WEBPACK_IMPORTED_MODULE_2__["isIMenuItem"])(item) && item.command.toggled) { - const toggledExpression = item.command.toggled.condition || item.command.toggled; - Menu._fillInKbExprKeys(toggledExpression, this._contextKeys); - } - } - this._onDidChange.fire(this); - } - get onDidChange() { - return this._onDidChange.event; - } - getActions(options) { - const result = []; - for (let group of this._menuGroups) { - const [id, items] = group; - const activeActions = []; - for (const item of items) { - if (this._contextKeyService.contextMatchesRules(item.when)) { - const action = Object(_actions_js__WEBPACK_IMPORTED_MODULE_2__["isIMenuItem"])(item) - ? new _actions_js__WEBPACK_IMPORTED_MODULE_2__["MenuItemAction"](item.command, item.alt, options, this._contextKeyService, this._commandService) - : new _actions_js__WEBPACK_IMPORTED_MODULE_2__["SubmenuItemAction"](item, this._menuService, this._contextKeyService, options); - activeActions.push(action); - } - } - if (activeActions.length > 0) { - result.push([id, activeActions]); - } - } - return result; - } - static _fillInKbExprKeys(exp, set) { - if (exp) { - for (let key of exp.keys()) { - set.add(key); - } - } - } - static _compareMenuItems(a, b) { - let aGroup = a.group; - let bGroup = b.group; - if (aGroup !== bGroup) { - // Falsy groups come last - if (!aGroup) { - return 1; - } - else if (!bGroup) { - return -1; - } - // 'navigation' group comes first - if (aGroup === 'navigation') { - return -1; - } - else if (bGroup === 'navigation') { - return 1; - } - // lexical sort for groups - let value = aGroup.localeCompare(bGroup); - if (value !== 0) { - return value; - } - } - // sort on priority - default is 0 - let aPrio = a.order || 0; - let bPrio = b.order || 0; - if (aPrio < bPrio) { - return -1; - } - else if (aPrio > bPrio) { - return 1; - } - // sort on titles - return Menu._compareTitles(Object(_actions_js__WEBPACK_IMPORTED_MODULE_2__["isIMenuItem"])(a) ? a.command.title : a.title, Object(_actions_js__WEBPACK_IMPORTED_MODULE_2__["isIMenuItem"])(b) ? b.command.title : b.title); - } - static _compareTitles(a, b) { - const aStr = typeof a === 'string' ? a : a.value; - const bStr = typeof b === 'string' ? b : b.value; - return aStr.localeCompare(bStr); - } -}; -Menu = __decorate([ - __param(1, _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_3__["ICommandService"]), - __param(2, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["IContextKeyService"]), - __param(3, _actions_js__WEBPACK_IMPORTED_MODULE_2__["IMenuService"]) -], Menu); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/browser/contextScopedHistoryWidget.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/browser/contextScopedHistoryWidget.js ***! - \******************************************************************************************/ -/*! exports provided: HistoryNavigationWidgetContext, HistoryNavigationEnablementContext, createAndBindHistoryNavigationWidgetScopedContextKeyService, ContextScopedFindInput, ContextScopedReplaceInput */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HistoryNavigationWidgetContext", function() { return HistoryNavigationWidgetContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HistoryNavigationEnablementContext", function() { return HistoryNavigationEnablementContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAndBindHistoryNavigationWidgetScopedContextKeyService", function() { return createAndBindHistoryNavigationWidgetScopedContextKeyService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextScopedFindInput", function() { return ContextScopedFindInput; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextScopedReplaceInput", function() { return ContextScopedReplaceInput; }); -/* harmony import */ var _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _base_browser_ui_findinput_findInput_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../base/browser/ui/findinput/findInput.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/findInput.js"); -/* harmony import */ var _keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../keybinding/common/keybindingsRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js"); -/* harmony import */ var _base_browser_ui_findinput_replaceInput_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../base/browser/ui/findinput/replaceInput.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/findinput/replaceInput.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - -const HistoryNavigationWidgetContext = 'historyNavigationWidget'; -const HistoryNavigationEnablementContext = 'historyNavigationEnabled'; -function bindContextScopedWidget(contextKeyService, widget, contextKey) { - new _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"](contextKey, widget).bindTo(contextKeyService); -} -function createWidgetScopedContextKeyService(contextKeyService, widget) { - return contextKeyService.createScoped(widget.target); -} -function getContextScopedWidget(contextKeyService, contextKey) { - return contextKeyService.getContext(document.activeElement).getValue(contextKey); -} -function createAndBindHistoryNavigationWidgetScopedContextKeyService(contextKeyService, widget) { - const scopedContextKeyService = createWidgetScopedContextKeyService(contextKeyService, widget); - bindContextScopedWidget(scopedContextKeyService, widget, HistoryNavigationWidgetContext); - const historyNavigationEnablement = new _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["RawContextKey"](HistoryNavigationEnablementContext, true).bindTo(scopedContextKeyService); - return { scopedContextKeyService, historyNavigationEnablement }; -} -let ContextScopedFindInput = class ContextScopedFindInput extends _base_browser_ui_findinput_findInput_js__WEBPACK_IMPORTED_MODULE_1__["FindInput"] { - constructor(container, contextViewProvider, options, contextKeyService, showFindOptions = false) { - super(container, contextViewProvider, showFindOptions, options); - this._register(createAndBindHistoryNavigationWidgetScopedContextKeyService(contextKeyService, { target: this.inputBox.element, historyNavigator: this.inputBox }).scopedContextKeyService); - } -}; -ContextScopedFindInput = __decorate([ - __param(3, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["IContextKeyService"]) -], ContextScopedFindInput); - -let ContextScopedReplaceInput = class ContextScopedReplaceInput extends _base_browser_ui_findinput_replaceInput_js__WEBPACK_IMPORTED_MODULE_3__["ReplaceInput"] { - constructor(container, contextViewProvider, options, contextKeyService, showReplaceOptions = false) { - super(container, contextViewProvider, showReplaceOptions, options); - this._register(createAndBindHistoryNavigationWidgetScopedContextKeyService(contextKeyService, { target: this.inputBox.element, historyNavigator: this.inputBox }).scopedContextKeyService); - } -}; -ContextScopedReplaceInput = __decorate([ - __param(3, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["IContextKeyService"]) -], ContextScopedReplaceInput); - -_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_2__["KeybindingsRegistry"].registerCommandAndKeybindingRule({ - id: 'history.showPrevious', - weight: 200 /* WorkbenchContrib */, - when: _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["ContextKeyExpr"].and(_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["ContextKeyExpr"].has(HistoryNavigationWidgetContext), _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["ContextKeyExpr"].equals(HistoryNavigationEnablementContext, true)), - primary: 16 /* UpArrow */, - secondary: [512 /* Alt */ | 16 /* UpArrow */], - handler: (accessor, arg2) => { - const widget = getContextScopedWidget(accessor.get(_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["IContextKeyService"]), HistoryNavigationWidgetContext); - if (widget) { - const historyInputBox = widget.historyNavigator; - historyInputBox.showPreviousValue(); - } - } -}); -_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_2__["KeybindingsRegistry"].registerCommandAndKeybindingRule({ - id: 'history.showNext', - weight: 200 /* WorkbenchContrib */, - when: _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["ContextKeyExpr"].and(_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["ContextKeyExpr"].has(HistoryNavigationWidgetContext), _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["ContextKeyExpr"].equals(HistoryNavigationEnablementContext, true)), - primary: 18 /* DownArrow */, - secondary: [512 /* Alt */ | 18 /* DownArrow */], - handler: (accessor, arg2) => { - const widget = getContextScopedWidget(accessor.get(_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_0__["IContextKeyService"]), HistoryNavigationWidgetContext); - if (widget) { - const historyInputBox = widget.historyNavigator; - historyInputBox.showNextValue(); - } - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/clipboard/browser/clipboardService.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/clipboard/browser/clipboardService.js ***! - \******************************************************************************************/ -/*! exports provided: BrowserClipboardService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserClipboardService", function() { return BrowserClipboardService; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - -class BrowserClipboardService { - constructor() { - this.mapTextToType = new Map(); // unsupported in web (only in-memory) - this.findText = ''; // unsupported in web (only in-memory) - } - writeText(text, type) { - return __awaiter(this, void 0, void 0, function* () { - // With type: only in-memory is supported - if (type) { - this.mapTextToType.set(type, text); - return; - } - // Guard access to navigator.clipboard with try/catch - // as we have seen DOMExceptions in certain browsers - // due to security policies. - try { - return yield navigator.clipboard.writeText(text); - } - catch (error) { - console.error(error); - } - // Fallback to textarea and execCommand solution - const activeElement = document.activeElement; - const textArea = document.body.appendChild(Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["$"])('textarea', { 'aria-hidden': true })); - textArea.style.height = '1px'; - textArea.style.width = '1px'; - textArea.style.position = 'absolute'; - textArea.value = text; - textArea.focus(); - textArea.select(); - document.execCommand('copy'); - if (activeElement instanceof HTMLElement) { - activeElement.focus(); - } - document.body.removeChild(textArea); - return; - }); - } - readText(type) { - return __awaiter(this, void 0, void 0, function* () { - // With type: only in-memory is supported - if (type) { - return this.mapTextToType.get(type) || ''; - } - // Guard access to navigator.clipboard with try/catch - // as we have seen DOMExceptions in certain browsers - // due to security policies. - try { - return yield navigator.clipboard.readText(); - } - catch (error) { - console.error(error); - return ''; - } - }); - } - readFindText() { - return __awaiter(this, void 0, void 0, function* () { - return this.findText; - }); - } - writeFindText(text) { - return __awaiter(this, void 0, void 0, function* () { - this.findText = text; - }); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js ***! - \*****************************************************************************************/ -/*! exports provided: IClipboardService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IClipboardService", function() { return IClipboardService; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const IClipboardService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('clipboardService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js ***! - \********************************************************************************/ -/*! exports provided: ICommandService, CommandsRegistry */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ICommandService", function() { return ICommandService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommandsRegistry", function() { return CommandsRegistry; }); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -const ICommandService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_2__["createDecorator"])('commandService'); -const CommandsRegistry = new class { - constructor() { - this._commands = new Map(); - this._onDidRegisterCommand = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - this.onDidRegisterCommand = this._onDidRegisterCommand.event; - } - registerCommand(idOrCommand, handler) { - if (!idOrCommand) { - throw new Error(`invalid command`); - } - if (typeof idOrCommand === 'string') { - if (!handler) { - throw new Error(`invalid command`); - } - return this.registerCommand({ id: idOrCommand, handler }); - } - // add argument validation if rich command metadata is provided - if (idOrCommand.description) { - const constraints = []; - for (let arg of idOrCommand.description.args) { - constraints.push(arg.constraint); - } - const actualHandler = idOrCommand.handler; - idOrCommand.handler = function (accessor, ...args) { - Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__["validateConstraints"])(args, constraints); - return actualHandler(accessor, ...args); - }; - } - // find a place to store the command - const { id } = idOrCommand; - let commands = this._commands.get(id); - if (!commands) { - commands = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_4__["LinkedList"](); - this._commands.set(id, commands); - } - let removeFn = commands.unshift(idOrCommand); - let ret = Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__["toDisposable"])(() => { - removeFn(); - const command = this._commands.get(id); - if (command === null || command === void 0 ? void 0 : command.isEmpty()) { - this._commands.delete(id); - } - }); - // tell the world about this command - this._onDidRegisterCommand.fire(id); - return ret; - } - registerCommandAlias(oldId, newId) { - return CommandsRegistry.registerCommand(oldId, (accessor, ...args) => accessor.get(ICommandService).executeCommand(newId, ...args)); - } - getCommand(id) { - const list = this._commands.get(id); - if (!list || list.isEmpty()) { - return undefined; - } - return _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_5__["Iterable"].first(list); - } - getCommands() { - const result = new Map(); - for (const key of this._commands.keys()) { - const command = this.getCommand(key); - if (command) { - result.set(key, command); - } - } - return result; - } -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js ***! - \******************************************************************************************/ -/*! exports provided: IConfigurationService, toValuesTree, addToValueTree, removeFromValueTree, getConfigurationValue, getConfigurationKeys, getDefaultValues */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IConfigurationService", function() { return IConfigurationService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toValuesTree", function() { return toValuesTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addToValueTree", function() { return addToValueTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFromValueTree", function() { return removeFromValueTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getConfigurationValue", function() { return getConfigurationValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getConfigurationKeys", function() { return getConfigurationKeys; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDefaultValues", function() { return getDefaultValues; }); -/* harmony import */ var _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _configurationRegistry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./configurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js"); - - - -const IConfigurationService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__["createDecorator"])('configurationService'); -function toValuesTree(properties, conflictReporter) { - const root = Object.create(null); - for (let key in properties) { - addToValueTree(root, key, properties[key], conflictReporter); - } - return root; -} -function addToValueTree(settingsTreeRoot, key, value, conflictReporter) { - const segments = key.split('.'); - const last = segments.pop(); - let curr = settingsTreeRoot; - for (let i = 0; i < segments.length; i++) { - let s = segments[i]; - let obj = curr[s]; - switch (typeof obj) { - case 'undefined': - obj = curr[s] = Object.create(null); - break; - case 'object': - break; - default: - conflictReporter(`Ignoring ${key} as ${segments.slice(0, i + 1).join('.')} is ${JSON.stringify(obj)}`); - return; - } - curr = obj; - } - if (typeof curr === 'object' && curr !== null) { - try { - curr[last] = value; // workaround https://github.com/Microsoft/vscode/issues/13606 - } - catch (e) { - conflictReporter(`Ignoring ${key} as ${segments.join('.')} is ${JSON.stringify(curr)}`); - } - } - else { - conflictReporter(`Ignoring ${key} as ${segments.join('.')} is ${JSON.stringify(curr)}`); - } -} -function removeFromValueTree(valueTree, key) { - const segments = key.split('.'); - doRemoveFromValueTree(valueTree, segments); -} -function doRemoveFromValueTree(valueTree, segments) { - const first = segments.shift(); - if (segments.length === 0) { - // Reached last segment - delete valueTree[first]; - return; - } - if (Object.keys(valueTree).indexOf(first) !== -1) { - const value = valueTree[first]; - if (typeof value === 'object' && !Array.isArray(value)) { - doRemoveFromValueTree(value, segments); - if (Object.keys(value).length === 0) { - delete valueTree[first]; - } - } - } -} -/** - * A helper function to get the configuration value with a specific settings path (e.g. config.some.setting) - */ -function getConfigurationValue(config, settingPath, defaultValue) { - function accessSetting(config, path) { - let current = config; - for (const component of path) { - if (typeof current !== 'object' || current === null) { - return undefined; - } - current = current[component]; - } - return current; - } - const path = settingPath.split('.'); - const result = accessSetting(config, path); - return typeof result === 'undefined' ? defaultValue : result; -} -function getConfigurationKeys() { - const properties = _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__["Registry"].as(_configurationRegistry_js__WEBPACK_IMPORTED_MODULE_2__["Extensions"].Configuration).getConfigurationProperties(); - return Object.keys(properties); -} -function getDefaultValues() { - const valueTreeRoot = Object.create(null); - const properties = _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__["Registry"].as(_configurationRegistry_js__WEBPACK_IMPORTED_MODULE_2__["Extensions"].Configuration).getConfigurationProperties(); - for (let key in properties) { - let value = properties[key].default; - addToValueTree(valueTreeRoot, key, value, message => console.error(`Conflict in default settings: ${message}`)); - } - return valueTreeRoot; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationModels.js": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationModels.js ***! - \************************************************************************************************/ -/*! exports provided: ConfigurationModel, DefaultConfigurationModel, Configuration, ConfigurationChangeEvent */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConfigurationModel", function() { return ConfigurationModel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultConfigurationModel", function() { return DefaultConfigurationModel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Configuration", function() { return Configuration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConfigurationChangeEvent", function() { return ConfigurationChangeEvent; }); -/* harmony import */ var _base_common_map_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/map.js */ "./node_modules/monaco-editor/esm/vs/base/common/map.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/objects.js */ "./node_modules/monaco-editor/esm/vs/base/common/objects.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _configurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./configurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js"); -/* harmony import */ var _configuration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); - - - - - - - -class ConfigurationModel { - constructor(_contents = {}, _keys = [], _overrides = []) { - this._contents = _contents; - this._keys = _keys; - this._overrides = _overrides; - this.isFrozen = false; - } - get contents() { - return this.checkAndFreeze(this._contents); - } - get overrides() { - return this.checkAndFreeze(this._overrides); - } - get keys() { - return this.checkAndFreeze(this._keys); - } - isEmpty() { - return this._keys.length === 0 && Object.keys(this._contents).length === 0 && this._overrides.length === 0; - } - getValue(section) { - return section ? Object(_configuration_js__WEBPACK_IMPORTED_MODULE_6__["getConfigurationValue"])(this.contents, section) : this.contents; - } - override(identifier) { - const overrideContents = this.getContentsForOverrideIdentifer(identifier); - if (!overrideContents || typeof overrideContents !== 'object' || !Object.keys(overrideContents).length) { - // If there are no valid overrides, return self - return this; - } - let contents = {}; - for (const key of _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["distinct"]([...Object.keys(this.contents), ...Object.keys(overrideContents)])) { - let contentsForKey = this.contents[key]; - let overrideContentsForKey = overrideContents[key]; - // If there are override contents for the key, clone and merge otherwise use base contents - if (overrideContentsForKey) { - // Clone and merge only if base contents and override contents are of type object otherwise just override - if (typeof contentsForKey === 'object' && typeof overrideContentsForKey === 'object') { - contentsForKey = _base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__["deepClone"](contentsForKey); - this.mergeContents(contentsForKey, overrideContentsForKey); - } - else { - contentsForKey = overrideContentsForKey; - } - } - contents[key] = contentsForKey; - } - return new ConfigurationModel(contents, this.keys, this.overrides); - } - merge(...others) { - const contents = _base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__["deepClone"](this.contents); - const overrides = _base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__["deepClone"](this.overrides); - const keys = [...this.keys]; - for (const other of others) { - this.mergeContents(contents, other.contents); - for (const otherOverride of other.overrides) { - const [override] = overrides.filter(o => _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["equals"](o.identifiers, otherOverride.identifiers)); - if (override) { - this.mergeContents(override.contents, otherOverride.contents); - } - else { - overrides.push(_base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__["deepClone"](otherOverride)); - } - } - for (const key of other.keys) { - if (keys.indexOf(key) === -1) { - keys.push(key); - } - } - } - return new ConfigurationModel(contents, keys, overrides); - } - freeze() { - this.isFrozen = true; - return this; - } - mergeContents(source, target) { - for (const key of Object.keys(target)) { - if (key in source) { - if (_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isObject"](source[key]) && _base_common_types_js__WEBPACK_IMPORTED_MODULE_2__["isObject"](target[key])) { - this.mergeContents(source[key], target[key]); - continue; - } - } - source[key] = _base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__["deepClone"](target[key]); - } - } - checkAndFreeze(data) { - if (this.isFrozen && !Object.isFrozen(data)) { - return _base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__["deepFreeze"](data); - } - return data; - } - getContentsForOverrideIdentifer(identifier) { - for (const override of this.overrides) { - if (override.identifiers.indexOf(identifier) !== -1) { - return override.contents; - } - } - return null; - } - toJSON() { - return { - contents: this.contents, - overrides: this.overrides, - keys: this.keys - }; - } - // Update methods - setValue(key, value) { - this.addKey(key); - Object(_configuration_js__WEBPACK_IMPORTED_MODULE_6__["addToValueTree"])(this.contents, key, value, e => { throw new Error(e); }); - } - removeValue(key) { - if (this.removeKey(key)) { - Object(_configuration_js__WEBPACK_IMPORTED_MODULE_6__["removeFromValueTree"])(this.contents, key); - } - } - addKey(key) { - let index = this.keys.length; - for (let i = 0; i < index; i++) { - if (key.indexOf(this.keys[i]) === 0) { - index = i; - } - } - this.keys.splice(index, 1, key); - } - removeKey(key) { - let index = this.keys.indexOf(key); - if (index !== -1) { - this.keys.splice(index, 1); - return true; - } - return false; - } -} -class DefaultConfigurationModel extends ConfigurationModel { - constructor() { - const contents = Object(_configuration_js__WEBPACK_IMPORTED_MODULE_6__["getDefaultValues"])(); - const keys = Object(_configuration_js__WEBPACK_IMPORTED_MODULE_6__["getConfigurationKeys"])(); - const overrides = []; - for (const key of Object.keys(contents)) { - if (_configurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__["OVERRIDE_PROPERTY_PATTERN"].test(key)) { - overrides.push({ - identifiers: [Object(_configurationRegistry_js__WEBPACK_IMPORTED_MODULE_5__["overrideIdentifierFromKey"])(key).trim()], - keys: Object.keys(contents[key]), - contents: Object(_configuration_js__WEBPACK_IMPORTED_MODULE_6__["toValuesTree"])(contents[key], message => console.error(`Conflict in default settings file: ${message}`)), - }); - } - } - super(contents, keys, overrides); - } -} -class Configuration { - constructor(_defaultConfiguration, _localUserConfiguration, _remoteUserConfiguration = new ConfigurationModel(), _workspaceConfiguration = new ConfigurationModel(), _folderConfigurations = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_0__["ResourceMap"](), _memoryConfiguration = new ConfigurationModel(), _memoryConfigurationByResource = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_0__["ResourceMap"](), _freeze = true) { - this._defaultConfiguration = _defaultConfiguration; - this._localUserConfiguration = _localUserConfiguration; - this._remoteUserConfiguration = _remoteUserConfiguration; - this._workspaceConfiguration = _workspaceConfiguration; - this._folderConfigurations = _folderConfigurations; - this._memoryConfiguration = _memoryConfiguration; - this._memoryConfigurationByResource = _memoryConfigurationByResource; - this._freeze = _freeze; - this._workspaceConsolidatedConfiguration = null; - this._foldersConsolidatedConfigurations = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_0__["ResourceMap"](); - this._userConfiguration = null; - } - getValue(section, overrides, workspace) { - const consolidateConfigurationModel = this.getConsolidateConfigurationModel(overrides, workspace); - return consolidateConfigurationModel.getValue(section); - } - updateValue(key, value, overrides = {}) { - let memoryConfiguration; - if (overrides.resource) { - memoryConfiguration = this._memoryConfigurationByResource.get(overrides.resource); - if (!memoryConfiguration) { - memoryConfiguration = new ConfigurationModel(); - this._memoryConfigurationByResource.set(overrides.resource, memoryConfiguration); - } - } - else { - memoryConfiguration = this._memoryConfiguration; - } - if (value === undefined) { - memoryConfiguration.removeValue(key); - } - else { - memoryConfiguration.setValue(key, value); - } - if (!overrides.resource) { - this._workspaceConsolidatedConfiguration = null; - } - } - get userConfiguration() { - if (!this._userConfiguration) { - this._userConfiguration = this._remoteUserConfiguration.isEmpty() ? this._localUserConfiguration : this._localUserConfiguration.merge(this._remoteUserConfiguration); - if (this._freeze) { - this._userConfiguration.freeze(); - } - } - return this._userConfiguration; - } - getConsolidateConfigurationModel(overrides, workspace) { - let configurationModel = this.getConsolidatedConfigurationModelForResource(overrides, workspace); - return overrides.overrideIdentifier ? configurationModel.override(overrides.overrideIdentifier) : configurationModel; - } - getConsolidatedConfigurationModelForResource({ resource }, workspace) { - let consolidateConfiguration = this.getWorkspaceConsolidatedConfiguration(); - if (workspace && resource) { - const root = workspace.getFolder(resource); - if (root) { - consolidateConfiguration = this.getFolderConsolidatedConfiguration(root.uri) || consolidateConfiguration; - } - const memoryConfigurationForResource = this._memoryConfigurationByResource.get(resource); - if (memoryConfigurationForResource) { - consolidateConfiguration = consolidateConfiguration.merge(memoryConfigurationForResource); - } - } - return consolidateConfiguration; - } - getWorkspaceConsolidatedConfiguration() { - if (!this._workspaceConsolidatedConfiguration) { - this._workspaceConsolidatedConfiguration = this._defaultConfiguration.merge(this.userConfiguration, this._workspaceConfiguration, this._memoryConfiguration); - if (this._freeze) { - this._workspaceConfiguration = this._workspaceConfiguration.freeze(); - } - } - return this._workspaceConsolidatedConfiguration; - } - getFolderConsolidatedConfiguration(folder) { - let folderConsolidatedConfiguration = this._foldersConsolidatedConfigurations.get(folder); - if (!folderConsolidatedConfiguration) { - const workspaceConsolidateConfiguration = this.getWorkspaceConsolidatedConfiguration(); - const folderConfiguration = this._folderConfigurations.get(folder); - if (folderConfiguration) { - folderConsolidatedConfiguration = workspaceConsolidateConfiguration.merge(folderConfiguration); - if (this._freeze) { - folderConsolidatedConfiguration = folderConsolidatedConfiguration.freeze(); - } - this._foldersConsolidatedConfigurations.set(folder, folderConsolidatedConfiguration); - } - else { - folderConsolidatedConfiguration = workspaceConsolidateConfiguration; - } - } - return folderConsolidatedConfiguration; - } - toData() { - return { - defaults: { - contents: this._defaultConfiguration.contents, - overrides: this._defaultConfiguration.overrides, - keys: this._defaultConfiguration.keys - }, - user: { - contents: this.userConfiguration.contents, - overrides: this.userConfiguration.overrides, - keys: this.userConfiguration.keys - }, - workspace: { - contents: this._workspaceConfiguration.contents, - overrides: this._workspaceConfiguration.overrides, - keys: this._workspaceConfiguration.keys - }, - folders: [...this._folderConfigurations.keys()].reduce((result, folder) => { - const { contents, overrides, keys } = this._folderConfigurations.get(folder); - result.push([folder, { contents, overrides, keys }]); - return result; - }, []) - }; - } - static parse(data) { - const defaultConfiguration = this.parseConfigurationModel(data.defaults); - const userConfiguration = this.parseConfigurationModel(data.user); - const workspaceConfiguration = this.parseConfigurationModel(data.workspace); - const folders = data.folders.reduce((result, value) => { - result.set(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"].revive(value[0]), this.parseConfigurationModel(value[1])); - return result; - }, new _base_common_map_js__WEBPACK_IMPORTED_MODULE_0__["ResourceMap"]()); - return new Configuration(defaultConfiguration, userConfiguration, new ConfigurationModel(), workspaceConfiguration, folders, new ConfigurationModel(), new _base_common_map_js__WEBPACK_IMPORTED_MODULE_0__["ResourceMap"](), false); - } - static parseConfigurationModel(model) { - return new ConfigurationModel(model.contents, model.keys, model.overrides).freeze(); - } -} -class ConfigurationChangeEvent { - constructor(change, previous, currentConfiguraiton, currentWorkspace) { - this.change = change; - this.previous = previous; - this.currentConfiguraiton = currentConfiguraiton; - this.currentWorkspace = currentWorkspace; - this._previousConfiguration = undefined; - const keysSet = new Set(); - change.keys.forEach(key => keysSet.add(key)); - change.overrides.forEach(([, keys]) => keys.forEach(key => keysSet.add(key))); - this.affectedKeys = [...keysSet.values()]; - const configurationModel = new ConfigurationModel(); - this.affectedKeys.forEach(key => configurationModel.setValue(key, {})); - this.affectedKeysTree = configurationModel.contents; - } - get previousConfiguration() { - if (!this._previousConfiguration && this.previous) { - this._previousConfiguration = Configuration.parse(this.previous.data); - } - return this._previousConfiguration; - } - affectsConfiguration(section, overrides) { - var _a; - if (this.doesAffectedKeysTreeContains(this.affectedKeysTree, section)) { - if (overrides) { - const value1 = this.previousConfiguration ? this.previousConfiguration.getValue(section, overrides, (_a = this.previous) === null || _a === void 0 ? void 0 : _a.workspace) : undefined; - const value2 = this.currentConfiguraiton.getValue(section, overrides, this.currentWorkspace); - return !_base_common_objects_js__WEBPACK_IMPORTED_MODULE_3__["equals"](value1, value2); - } - return true; - } - return false; - } - doesAffectedKeysTreeContains(affectedKeysTree, section) { - let requestedTree = Object(_configuration_js__WEBPACK_IMPORTED_MODULE_6__["toValuesTree"])({ [section]: true }, () => { }); - let key; - while (typeof requestedTree === 'object' && (key = Object.keys(requestedTree)[0])) { // Only one key should present, since we added only one property - affectedKeysTree = affectedKeysTree[key]; - if (!affectedKeysTree) { - return false; // Requested tree is not found - } - requestedTree = requestedTree[key]; - } - return true; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js": -/*!**************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js ***! - \**************************************************************************************************/ -/*! exports provided: Extensions, allSettings, applicationSettings, machineSettings, machineOverridableSettings, windowSettings, resourceSettings, resourceLanguageSettingsSchemaId, OVERRIDE_PROPERTY_PATTERN, overrideIdentifierFromKey, getDefaultValue, validateProperty */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Extensions", function() { return Extensions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "allSettings", function() { return allSettings; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applicationSettings", function() { return applicationSettings; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "machineSettings", function() { return machineSettings; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "machineOverridableSettings", function() { return machineOverridableSettings; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowSettings", function() { return windowSettings; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resourceSettings", function() { return resourceSettings; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resourceLanguageSettingsSchemaId", function() { return resourceLanguageSettingsSchemaId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OVERRIDE_PROPERTY_PATTERN", function() { return OVERRIDE_PROPERTY_PATTERN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "overrideIdentifierFromKey", function() { return overrideIdentifierFromKey; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDefaultValue", function() { return getDefaultValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateProperty", function() { return validateProperty; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _jsonschemas_common_jsonContributionRegistry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../jsonschemas/common/jsonContributionRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -const Extensions = { - Configuration: 'base.contributions.configuration' -}; -const allSettings = { properties: {}, patternProperties: {} }; -const applicationSettings = { properties: {}, patternProperties: {} }; -const machineSettings = { properties: {}, patternProperties: {} }; -const machineOverridableSettings = { properties: {}, patternProperties: {} }; -const windowSettings = { properties: {}, patternProperties: {} }; -const resourceSettings = { properties: {}, patternProperties: {} }; -const resourceLanguageSettingsSchemaId = 'vscode://schemas/settings/resourceLanguage'; -const contributionRegistry = _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["Registry"].as(_jsonschemas_common_jsonContributionRegistry_js__WEBPACK_IMPORTED_MODULE_4__["Extensions"].JSONContribution); -class ConfigurationRegistry { - constructor() { - this.overrideIdentifiers = new Set(); - this._onDidSchemaChange = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"](); - this._onDidUpdateConfiguration = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"](); - this.defaultValues = {}; - this.defaultLanguageConfigurationOverridesNode = { - id: 'defaultOverrides', - title: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('defaultLanguageConfigurationOverrides.title', "Default Language Configuration Overrides"), - properties: {} - }; - this.configurationContributors = [this.defaultLanguageConfigurationOverridesNode]; - this.resourceLanguageSettingsSchema = { properties: {}, patternProperties: {}, additionalProperties: false, errorMessage: 'Unknown editor configuration setting', allowTrailingCommas: true, allowComments: true }; - this.configurationProperties = {}; - this.excludedConfigurationProperties = {}; - contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema); - } - registerConfiguration(configuration, validate = true) { - this.registerConfigurations([configuration], validate); - } - registerConfigurations(configurations, validate = true) { - const properties = []; - configurations.forEach(configuration => { - properties.push(...this.validateAndRegisterProperties(configuration, validate)); // fills in defaults - this.configurationContributors.push(configuration); - this.registerJSONConfiguration(configuration); - }); - contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema); - this._onDidSchemaChange.fire(); - this._onDidUpdateConfiguration.fire(properties); - } - registerOverrideIdentifiers(overrideIdentifiers) { - for (const overrideIdentifier of overrideIdentifiers) { - this.overrideIdentifiers.add(overrideIdentifier); - } - this.updateOverridePropertyPatternKey(); - } - validateAndRegisterProperties(configuration, validate = true, scope = 3 /* WINDOW */) { - scope = _base_common_types_js__WEBPACK_IMPORTED_MODULE_3__["isUndefinedOrNull"](configuration.scope) ? scope : configuration.scope; - let propertyKeys = []; - let properties = configuration.properties; - if (properties) { - for (let key in properties) { - if (validate && validateProperty(key)) { - delete properties[key]; - continue; - } - const property = properties[key]; - // update default value - this.updatePropertyDefaultValue(key, property); - // update scope - if (OVERRIDE_PROPERTY_PATTERN.test(key)) { - property.scope = undefined; // No scope for overridable properties `[${identifier}]` - } - else { - property.scope = _base_common_types_js__WEBPACK_IMPORTED_MODULE_3__["isUndefinedOrNull"](property.scope) ? scope : property.scope; - } - // Add to properties maps - // Property is included by default if 'included' is unspecified - if (properties[key].hasOwnProperty('included') && !properties[key].included) { - this.excludedConfigurationProperties[key] = properties[key]; - delete properties[key]; - continue; - } - else { - this.configurationProperties[key] = properties[key]; - } - if (!properties[key].deprecationMessage && properties[key].markdownDeprecationMessage) { - // If not set, default deprecationMessage to the markdown source - properties[key].deprecationMessage = properties[key].markdownDeprecationMessage; - } - propertyKeys.push(key); - } - } - let subNodes = configuration.allOf; - if (subNodes) { - for (let node of subNodes) { - propertyKeys.push(...this.validateAndRegisterProperties(node, validate, scope)); - } - } - return propertyKeys; - } - getConfigurationProperties() { - return this.configurationProperties; - } - registerJSONConfiguration(configuration) { - const register = (configuration) => { - let properties = configuration.properties; - if (properties) { - for (const key in properties) { - this.updateSchema(key, properties[key]); - } - } - let subNodes = configuration.allOf; - if (subNodes) { - subNodes.forEach(register); - } - }; - register(configuration); - } - updateSchema(key, property) { - allSettings.properties[key] = property; - switch (property.scope) { - case 1 /* APPLICATION */: - applicationSettings.properties[key] = property; - break; - case 2 /* MACHINE */: - machineSettings.properties[key] = property; - break; - case 6 /* MACHINE_OVERRIDABLE */: - machineOverridableSettings.properties[key] = property; - break; - case 3 /* WINDOW */: - windowSettings.properties[key] = property; - break; - case 4 /* RESOURCE */: - resourceSettings.properties[key] = property; - break; - case 5 /* LANGUAGE_OVERRIDABLE */: - resourceSettings.properties[key] = property; - this.resourceLanguageSettingsSchema.properties[key] = property; - break; - } - } - updateOverridePropertyPatternKey() { - for (const overrideIdentifier of this.overrideIdentifiers.values()) { - const overrideIdentifierProperty = `[${overrideIdentifier}]`; - const resourceLanguagePropertiesSchema = { - type: 'object', - description: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('overrideSettings.defaultDescription', "Configure editor settings to be overridden for a language."), - errorMessage: _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('overrideSettings.errorMessage', "This setting does not support per-language configuration."), - $ref: resourceLanguageSettingsSchemaId, - }; - this.updatePropertyDefaultValue(overrideIdentifierProperty, resourceLanguagePropertiesSchema); - allSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; - applicationSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; - machineSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; - machineOverridableSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; - windowSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; - resourceSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema; - } - this._onDidSchemaChange.fire(); - } - updatePropertyDefaultValue(key, property) { - let defaultValue = this.defaultValues[key]; - if (_base_common_types_js__WEBPACK_IMPORTED_MODULE_3__["isUndefined"](defaultValue)) { - defaultValue = property.default; - } - if (_base_common_types_js__WEBPACK_IMPORTED_MODULE_3__["isUndefined"](defaultValue)) { - defaultValue = getDefaultValue(property.type); - } - property.default = defaultValue; - } -} -const OVERRIDE_PROPERTY = '\\[.*\\]$'; -const OVERRIDE_PROPERTY_PATTERN = new RegExp(OVERRIDE_PROPERTY); -function overrideIdentifierFromKey(key) { - return key.substring(1, key.length - 1); -} -function getDefaultValue(type) { - const t = Array.isArray(type) ? type[0] : type; - switch (t) { - case 'boolean': - return false; - case 'integer': - case 'number': - return 0; - case 'string': - return ''; - case 'array': - return []; - case 'object': - return {}; - default: - return null; - } -} -const configurationRegistry = new ConfigurationRegistry(); -_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["Registry"].add(Extensions.Configuration, configurationRegistry); -function validateProperty(property) { - if (OVERRIDE_PROPERTY_PATTERN.test(property)) { - return _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('config.property.languageDefault', "Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.", property); - } - if (configurationRegistry.getConfigurationProperties()[property] !== undefined) { - return _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('config.property.duplicate', "Cannot register '{0}'. This property is already registered.", property); - } - return null; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/contextkey/browser/contextKeyService.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/contextkey/browser/contextKeyService.js ***! - \********************************************************************************************/ -/*! exports provided: Context, AbstractContextKeyService, ContextKeyService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return Context; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractContextKeyService", function() { return AbstractContextKeyService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyService", function() { return ContextKeyService; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/* harmony import */ var _common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _keybinding_common_keybindingResolver_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../keybinding/common/keybindingResolver.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingResolver.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - -const KEYBINDING_CONTEXT_ATTR = 'data-keybinding-context'; -class Context { - constructor(id, parent) { - this._id = id; - this._parent = parent; - this._value = Object.create(null); - this._value['_contextId'] = id; - } - setValue(key, value) { - // console.log('SET ' + key + ' = ' + value + ' ON ' + this._id); - if (this._value[key] !== value) { - this._value[key] = value; - return true; - } - return false; - } - removeValue(key) { - // console.log('REMOVE ' + key + ' FROM ' + this._id); - if (key in this._value) { - delete this._value[key]; - return true; - } - return false; - } - getValue(key) { - const ret = this._value[key]; - if (typeof ret === 'undefined' && this._parent) { - return this._parent.getValue(key); - } - return ret; - } -} -class NullContext extends Context { - constructor() { - super(-1, null); - } - setValue(key, value) { - return false; - } - removeValue(key) { - return false; - } - getValue(key) { - return undefined; - } -} -NullContext.INSTANCE = new NullContext(); -class ConfigAwareContextValuesContainer extends Context { - constructor(id, _configurationService, emitter) { - super(id, null); - this._configurationService = _configurationService; - this._values = new Map(); - this._listener = this._configurationService.onDidChangeConfiguration(event => { - if (event.source === 6 /* DEFAULT */) { - // new setting, reset everything - const allKeys = Array.from(this._values.keys()); - this._values.clear(); - emitter.fire(new ArrayContextKeyChangeEvent(allKeys)); - } - else { - const changedKeys = []; - for (const configKey of event.affectedKeys) { - const contextKey = `config.${configKey}`; - if (this._values.has(contextKey)) { - this._values.delete(contextKey); - changedKeys.push(contextKey); - } - } - emitter.fire(new ArrayContextKeyChangeEvent(changedKeys)); - } - }); - } - dispose() { - this._listener.dispose(); - } - getValue(key) { - if (key.indexOf(ConfigAwareContextValuesContainer._keyPrefix) !== 0) { - return super.getValue(key); - } - if (this._values.has(key)) { - return this._values.get(key); - } - const configKey = key.substr(ConfigAwareContextValuesContainer._keyPrefix.length); - const configValue = this._configurationService.getValue(configKey); - let value = undefined; - switch (typeof configValue) { - case 'number': - case 'boolean': - case 'string': - value = configValue; - break; - default: - if (Array.isArray(configValue)) { - value = JSON.stringify(configValue); - } - } - this._values.set(key, value); - return value; - } - setValue(key, value) { - return super.setValue(key, value); - } - removeValue(key) { - return super.removeValue(key); - } -} -ConfigAwareContextValuesContainer._keyPrefix = 'config.'; -class ContextKey { - constructor(service, key, defaultValue) { - this._service = service; - this._key = key; - this._defaultValue = defaultValue; - this.reset(); - } - set(value) { - this._service.setContext(this._key, value); - } - reset() { - if (typeof this._defaultValue === 'undefined') { - this._service.removeContext(this._key); - } - else { - this._service.setContext(this._key, this._defaultValue); - } - } - get() { - return this._service.getContextKeyValue(this._key); - } -} -class SimpleContextKeyChangeEvent { - constructor(key) { - this.key = key; - } - affectsSome(keys) { - return keys.has(this.key); - } -} -class ArrayContextKeyChangeEvent { - constructor(keys) { - this.keys = keys; - } - affectsSome(keys) { - for (const key of this.keys) { - if (keys.has(key)) { - return true; - } - } - return false; - } -} -class CompositeContextKeyChangeEvent { - constructor(events) { - this.events = events; - } - affectsSome(keys) { - for (const e of this.events) { - if (e.affectsSome(keys)) { - return true; - } - } - return false; - } -} -class AbstractContextKeyService { - constructor(myContextId) { - this._onDidChangeContext = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["PauseableEmitter"]({ merge: input => new CompositeContextKeyChangeEvent(input) }); - this._isDisposed = false; - this._myContextId = myContextId; - } - createKey(key, defaultValue) { - if (this._isDisposed) { - throw new Error(`AbstractContextKeyService has been disposed`); - } - return new ContextKey(this, key, defaultValue); - } - get onDidChangeContext() { - return this._onDidChangeContext.event; - } - bufferChangeEvents(callback) { - this._onDidChangeContext.pause(); - try { - callback(); - } - finally { - this._onDidChangeContext.resume(); - } - } - createScoped(domNode) { - if (this._isDisposed) { - throw new Error(`AbstractContextKeyService has been disposed`); - } - return new ScopedContextKeyService(this, domNode); - } - contextMatchesRules(rules) { - if (this._isDisposed) { - throw new Error(`AbstractContextKeyService has been disposed`); - } - const context = this.getContextValuesContainer(this._myContextId); - const result = _keybinding_common_keybindingResolver_js__WEBPACK_IMPORTED_MODULE_5__["KeybindingResolver"].contextMatchesRules(context, rules); - // console.group(rules.serialize() + ' -> ' + result); - // rules.keys().forEach(key => { console.log(key, ctx[key]); }); - // console.groupEnd(); - return result; - } - getContextKeyValue(key) { - if (this._isDisposed) { - return undefined; - } - return this.getContextValuesContainer(this._myContextId).getValue(key); - } - setContext(key, value) { - if (this._isDisposed) { - return; - } - const myContext = this.getContextValuesContainer(this._myContextId); - if (!myContext) { - return; - } - if (myContext.setValue(key, value)) { - this._onDidChangeContext.fire(new SimpleContextKeyChangeEvent(key)); - } - } - removeContext(key) { - if (this._isDisposed) { - return; - } - if (this.getContextValuesContainer(this._myContextId).removeValue(key)) { - this._onDidChangeContext.fire(new SimpleContextKeyChangeEvent(key)); - } - } - getContext(target) { - if (this._isDisposed) { - return NullContext.INSTANCE; - } - return this.getContextValuesContainer(findContextAttr(target)); - } -} -let ContextKeyService = class ContextKeyService extends AbstractContextKeyService { - constructor(configurationService) { - super(0); - this._contexts = new Map(); - this._toDispose = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - this._lastContextId = 0; - const myContext = new ConfigAwareContextValuesContainer(this._myContextId, configurationService, this._onDidChangeContext); - this._contexts.set(this._myContextId, myContext); - this._toDispose.add(myContext); - // Uncomment this to see the contexts continuously logged - // let lastLoggedValue: string | null = null; - // setInterval(() => { - // let values = Object.keys(this._contexts).map((key) => this._contexts[key]); - // let logValue = values.map(v => JSON.stringify(v._value, null, '\t')).join('\n'); - // if (lastLoggedValue !== logValue) { - // lastLoggedValue = logValue; - // console.log(lastLoggedValue); - // } - // }, 2000); - } - dispose() { - this._isDisposed = true; - this._toDispose.dispose(); - } - getContextValuesContainer(contextId) { - if (this._isDisposed) { - return NullContext.INSTANCE; - } - return this._contexts.get(contextId) || NullContext.INSTANCE; - } - createChildContext(parentContextId = this._myContextId) { - if (this._isDisposed) { - throw new Error(`ContextKeyService has been disposed`); - } - let id = (++this._lastContextId); - this._contexts.set(id, new Context(id, this.getContextValuesContainer(parentContextId))); - return id; - } - disposeContext(contextId) { - if (!this._isDisposed) { - this._contexts.delete(contextId); - } - } -}; -ContextKeyService = __decorate([ - __param(0, _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_3__["IConfigurationService"]) -], ContextKeyService); - -class ScopedContextKeyService extends AbstractContextKeyService { - constructor(parent, domNode) { - super(parent.createChildContext()); - this._parent = parent; - if (domNode) { - this._domNode = domNode; - this._domNode.setAttribute(KEYBINDING_CONTEXT_ATTR, String(this._myContextId)); - } - } - dispose() { - this._isDisposed = true; - this._parent.disposeContext(this._myContextId); - if (this._domNode) { - this._domNode.removeAttribute(KEYBINDING_CONTEXT_ATTR); - this._domNode = undefined; - } - } - get onDidChangeContext() { - return _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].any(this._parent.onDidChangeContext, this._onDidChangeContext.event); - } - getContextValuesContainer(contextId) { - if (this._isDisposed) { - return NullContext.INSTANCE; - } - return this._parent.getContextValuesContainer(contextId); - } - createChildContext(parentContextId = this._myContextId) { - if (this._isDisposed) { - throw new Error(`ScopedContextKeyService has been disposed`); - } - return this._parent.createChildContext(parentContextId); - } - disposeContext(contextId) { - if (this._isDisposed) { - return; - } - this._parent.disposeContext(contextId); - } -} -function findContextAttr(domNode) { - while (domNode) { - if (domNode.hasAttribute(KEYBINDING_CONTEXT_ATTR)) { - const attr = domNode.getAttribute(KEYBINDING_CONTEXT_ATTR); - if (attr) { - return parseInt(attr, 10); - } - return NaN; - } - domNode = domNode.parentElement; - } - return 0; -} -_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_2__["CommandsRegistry"].registerCommand(_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["SET_CONTEXT_COMMAND_ID"], function (accessor, contextKey, contextValue) { - accessor.get(_common_contextkey_js__WEBPACK_IMPORTED_MODULE_4__["IContextKeyService"]).createKey(String(contextKey), contextValue); -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js ***! - \************************************************************************************/ -/*! exports provided: ContextKeyExpr, ContextKeyFalseExpr, ContextKeyTrueExpr, ContextKeyDefinedExpr, ContextKeyEqualsExpr, ContextKeyInExpr, ContextKeyNotInExpr, ContextKeyNotEqualsExpr, ContextKeyNotExpr, ContextKeyRegexExpr, ContextKeyNotRegexExpr, ContextKeyAndExpr, ContextKeyOrExpr, RawContextKey, IContextKeyService, SET_CONTEXT_COMMAND_ID */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyExpr", function() { return ContextKeyExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyFalseExpr", function() { return ContextKeyFalseExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyTrueExpr", function() { return ContextKeyTrueExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyDefinedExpr", function() { return ContextKeyDefinedExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyEqualsExpr", function() { return ContextKeyEqualsExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyInExpr", function() { return ContextKeyInExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyNotInExpr", function() { return ContextKeyNotInExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyNotEqualsExpr", function() { return ContextKeyNotEqualsExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyNotExpr", function() { return ContextKeyNotExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyRegexExpr", function() { return ContextKeyRegexExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyNotRegexExpr", function() { return ContextKeyNotRegexExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyAndExpr", function() { return ContextKeyAndExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextKeyOrExpr", function() { return ContextKeyOrExpr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RawContextKey", function() { return RawContextKey; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IContextKeyService", function() { return IContextKeyService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SET_CONTEXT_COMMAND_ID", function() { return SET_CONTEXT_COMMAND_ID; }); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -const STATIC_VALUES = new Map(); -STATIC_VALUES.set('false', false); -STATIC_VALUES.set('true', true); -STATIC_VALUES.set('isMac', _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"]); -STATIC_VALUES.set('isLinux', _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isLinux"]); -STATIC_VALUES.set('isWindows', _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWindows"]); -STATIC_VALUES.set('isWeb', _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWeb"]); -STATIC_VALUES.set('isMacNative', _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isMacintosh"] && !_base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWeb"]); -const hasOwnProperty = Object.prototype.hasOwnProperty; -class ContextKeyExpr { - static has(key) { - return ContextKeyDefinedExpr.create(key); - } - static equals(key, value) { - return ContextKeyEqualsExpr.create(key, value); - } - static regex(key, value) { - return ContextKeyRegexExpr.create(key, value); - } - static not(key) { - return ContextKeyNotExpr.create(key); - } - static and(...expr) { - return ContextKeyAndExpr.create(expr); - } - static or(...expr) { - return ContextKeyOrExpr.create(expr); - } - static deserialize(serialized, strict = false) { - if (!serialized) { - return undefined; - } - return this._deserializeOrExpression(serialized, strict); - } - static _deserializeOrExpression(serialized, strict) { - let pieces = serialized.split('||'); - return ContextKeyOrExpr.create(pieces.map(p => this._deserializeAndExpression(p, strict))); - } - static _deserializeAndExpression(serialized, strict) { - let pieces = serialized.split('&&'); - return ContextKeyAndExpr.create(pieces.map(p => this._deserializeOne(p, strict))); - } - static _deserializeOne(serializedOne, strict) { - serializedOne = serializedOne.trim(); - if (serializedOne.indexOf('!=') >= 0) { - let pieces = serializedOne.split('!='); - return ContextKeyNotEqualsExpr.create(pieces[0].trim(), this._deserializeValue(pieces[1], strict)); - } - if (serializedOne.indexOf('==') >= 0) { - let pieces = serializedOne.split('=='); - return ContextKeyEqualsExpr.create(pieces[0].trim(), this._deserializeValue(pieces[1], strict)); - } - if (serializedOne.indexOf('=~') >= 0) { - let pieces = serializedOne.split('=~'); - return ContextKeyRegexExpr.create(pieces[0].trim(), this._deserializeRegexValue(pieces[1], strict)); - } - if (serializedOne.indexOf(' in ') >= 0) { - let pieces = serializedOne.split(' in '); - return ContextKeyInExpr.create(pieces[0].trim(), pieces[1].trim()); - } - if (/^\!\s*/.test(serializedOne)) { - return ContextKeyNotExpr.create(serializedOne.substr(1).trim()); - } - return ContextKeyDefinedExpr.create(serializedOne); - } - static _deserializeValue(serializedValue, strict) { - serializedValue = serializedValue.trim(); - if (serializedValue === 'true') { - return true; - } - if (serializedValue === 'false') { - return false; - } - let m = /^'([^']*)'$/.exec(serializedValue); - if (m) { - return m[1].trim(); - } - return serializedValue; - } - static _deserializeRegexValue(serializedValue, strict) { - if (Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__["isFalsyOrWhitespace"])(serializedValue)) { - if (strict) { - throw new Error('missing regexp-value for =~-expression'); - } - else { - console.warn('missing regexp-value for =~-expression'); - } - return null; - } - let start = serializedValue.indexOf('/'); - let end = serializedValue.lastIndexOf('/'); - if (start === end || start < 0 /* || to < 0 */) { - if (strict) { - throw new Error(`bad regexp-value '${serializedValue}', missing /-enclosure`); - } - else { - console.warn(`bad regexp-value '${serializedValue}', missing /-enclosure`); - } - return null; - } - let value = serializedValue.slice(start + 1, end); - let caseIgnoreFlag = serializedValue[end + 1] === 'i' ? 'i' : ''; - try { - return new RegExp(value, caseIgnoreFlag); - } - catch (e) { - if (strict) { - throw new Error(`bad regexp-value '${serializedValue}', parse error: ${e}`); - } - else { - console.warn(`bad regexp-value '${serializedValue}', parse error: ${e}`); - } - return null; - } - } -} -function cmp(a, b) { - return a.cmp(b); -} -class ContextKeyFalseExpr { - constructor() { - this.type = 0 /* False */; - } - cmp(other) { - return this.type - other.type; - } - equals(other) { - return (other.type === this.type); - } - evaluate(context) { - return false; - } - serialize() { - return 'false'; - } - keys() { - return []; - } - negate() { - return ContextKeyTrueExpr.INSTANCE; - } -} -ContextKeyFalseExpr.INSTANCE = new ContextKeyFalseExpr(); -class ContextKeyTrueExpr { - constructor() { - this.type = 1 /* True */; - } - cmp(other) { - return this.type - other.type; - } - equals(other) { - return (other.type === this.type); - } - evaluate(context) { - return true; - } - serialize() { - return 'true'; - } - keys() { - return []; - } - negate() { - return ContextKeyFalseExpr.INSTANCE; - } -} -ContextKeyTrueExpr.INSTANCE = new ContextKeyTrueExpr(); -class ContextKeyDefinedExpr { - constructor(key) { - this.key = key; - this.type = 2 /* Defined */; - } - static create(key) { - const staticValue = STATIC_VALUES.get(key); - if (typeof staticValue === 'boolean') { - return staticValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE; - } - return new ContextKeyDefinedExpr(key); - } - cmp(other) { - if (other.type !== this.type) { - return this.type - other.type; - } - if (this.key < other.key) { - return -1; - } - if (this.key > other.key) { - return 1; - } - return 0; - } - equals(other) { - if (other.type === this.type) { - return (this.key === other.key); - } - return false; - } - evaluate(context) { - return (!!context.getValue(this.key)); - } - serialize() { - return this.key; - } - keys() { - return [this.key]; - } - negate() { - return ContextKeyNotExpr.create(this.key); - } -} -class ContextKeyEqualsExpr { - constructor(key, value) { - this.key = key; - this.value = value; - this.type = 4 /* Equals */; - } - static create(key, value) { - if (typeof value === 'boolean') { - return (value ? ContextKeyDefinedExpr.create(key) : ContextKeyNotExpr.create(key)); - } - const staticValue = STATIC_VALUES.get(key); - if (typeof staticValue === 'boolean') { - const trueValue = staticValue ? 'true' : 'false'; - return (value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE); - } - return new ContextKeyEqualsExpr(key, value); - } - cmp(other) { - if (other.type !== this.type) { - return this.type - other.type; - } - if (this.key < other.key) { - return -1; - } - if (this.key > other.key) { - return 1; - } - if (this.value < other.value) { - return -1; - } - if (this.value > other.value) { - return 1; - } - return 0; - } - equals(other) { - if (other.type === this.type) { - return (this.key === other.key && this.value === other.value); - } - return false; - } - evaluate(context) { - // Intentional == - // eslint-disable-next-line eqeqeq - return (context.getValue(this.key) == this.value); - } - serialize() { - return this.key + ' == \'' + this.value + '\''; - } - keys() { - return [this.key]; - } - negate() { - return ContextKeyNotEqualsExpr.create(this.key, this.value); - } -} -class ContextKeyInExpr { - constructor(key, valueKey) { - this.key = key; - this.valueKey = valueKey; - this.type = 10 /* In */; - } - static create(key, valueKey) { - return new ContextKeyInExpr(key, valueKey); - } - cmp(other) { - if (other.type !== this.type) { - return this.type - other.type; - } - if (this.key < other.key) { - return -1; - } - if (this.key > other.key) { - return 1; - } - if (this.valueKey < other.valueKey) { - return -1; - } - if (this.valueKey > other.valueKey) { - return 1; - } - return 0; - } - equals(other) { - if (other.type === this.type) { - return (this.key === other.key && this.valueKey === other.valueKey); - } - return false; - } - evaluate(context) { - const source = context.getValue(this.valueKey); - const item = context.getValue(this.key); - if (Array.isArray(source)) { - return (source.indexOf(item) >= 0); - } - if (typeof item === 'string' && typeof source === 'object' && source !== null) { - return hasOwnProperty.call(source, item); - } - return false; - } - serialize() { - return this.key + ' in \'' + this.valueKey + '\''; - } - keys() { - return [this.key, this.valueKey]; - } - negate() { - return ContextKeyNotInExpr.create(this); - } -} -class ContextKeyNotInExpr { - constructor(_actual) { - this._actual = _actual; - this.type = 11 /* NotIn */; - // - } - static create(actual) { - return new ContextKeyNotInExpr(actual); - } - cmp(other) { - if (other.type !== this.type) { - return this.type - other.type; - } - return this._actual.cmp(other._actual); - } - equals(other) { - if (other.type === this.type) { - return this._actual.equals(other._actual); - } - return false; - } - evaluate(context) { - return !this._actual.evaluate(context); - } - serialize() { - throw new Error('Method not implemented.'); - } - keys() { - return this._actual.keys(); - } - negate() { - return this._actual; - } -} -class ContextKeyNotEqualsExpr { - constructor(key, value) { - this.key = key; - this.value = value; - this.type = 5 /* NotEquals */; - } - static create(key, value) { - if (typeof value === 'boolean') { - if (value) { - return ContextKeyNotExpr.create(key); - } - return ContextKeyDefinedExpr.create(key); - } - const staticValue = STATIC_VALUES.get(key); - if (typeof staticValue === 'boolean') { - const falseValue = staticValue ? 'true' : 'false'; - return (value === falseValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE); - } - return new ContextKeyNotEqualsExpr(key, value); - } - cmp(other) { - if (other.type !== this.type) { - return this.type - other.type; - } - if (this.key < other.key) { - return -1; - } - if (this.key > other.key) { - return 1; - } - if (this.value < other.value) { - return -1; - } - if (this.value > other.value) { - return 1; - } - return 0; - } - equals(other) { - if (other.type === this.type) { - return (this.key === other.key && this.value === other.value); - } - return false; - } - evaluate(context) { - // Intentional != - // eslint-disable-next-line eqeqeq - return (context.getValue(this.key) != this.value); - } - serialize() { - return this.key + ' != \'' + this.value + '\''; - } - keys() { - return [this.key]; - } - negate() { - return ContextKeyEqualsExpr.create(this.key, this.value); - } -} -class ContextKeyNotExpr { - constructor(key) { - this.key = key; - this.type = 3 /* Not */; - } - static create(key) { - const staticValue = STATIC_VALUES.get(key); - if (typeof staticValue === 'boolean') { - return (staticValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE); - } - return new ContextKeyNotExpr(key); - } - cmp(other) { - if (other.type !== this.type) { - return this.type - other.type; - } - if (this.key < other.key) { - return -1; - } - if (this.key > other.key) { - return 1; - } - return 0; - } - equals(other) { - if (other.type === this.type) { - return (this.key === other.key); - } - return false; - } - evaluate(context) { - return (!context.getValue(this.key)); - } - serialize() { - return '!' + this.key; - } - keys() { - return [this.key]; - } - negate() { - return ContextKeyDefinedExpr.create(this.key); - } -} -class ContextKeyRegexExpr { - constructor(key, regexp) { - this.key = key; - this.regexp = regexp; - this.type = 7 /* Regex */; - // - } - static create(key, regexp) { - return new ContextKeyRegexExpr(key, regexp); - } - cmp(other) { - if (other.type !== this.type) { - return this.type - other.type; - } - if (this.key < other.key) { - return -1; - } - if (this.key > other.key) { - return 1; - } - const thisSource = this.regexp ? this.regexp.source : ''; - const otherSource = other.regexp ? other.regexp.source : ''; - if (thisSource < otherSource) { - return -1; - } - if (thisSource > otherSource) { - return 1; - } - return 0; - } - equals(other) { - if (other.type === this.type) { - const thisSource = this.regexp ? this.regexp.source : ''; - const otherSource = other.regexp ? other.regexp.source : ''; - return (this.key === other.key && thisSource === otherSource); - } - return false; - } - evaluate(context) { - let value = context.getValue(this.key); - return this.regexp ? this.regexp.test(value) : false; - } - serialize() { - const value = this.regexp - ? `/${this.regexp.source}/${this.regexp.ignoreCase ? 'i' : ''}` - : '/invalid/'; - return `${this.key} =~ ${value}`; - } - keys() { - return [this.key]; - } - negate() { - return ContextKeyNotRegexExpr.create(this); - } -} -class ContextKeyNotRegexExpr { - constructor(_actual) { - this._actual = _actual; - this.type = 8 /* NotRegex */; - // - } - static create(actual) { - return new ContextKeyNotRegexExpr(actual); - } - cmp(other) { - if (other.type !== this.type) { - return this.type - other.type; - } - return this._actual.cmp(other._actual); - } - equals(other) { - if (other.type === this.type) { - return this._actual.equals(other._actual); - } - return false; - } - evaluate(context) { - return !this._actual.evaluate(context); - } - serialize() { - throw new Error('Method not implemented.'); - } - keys() { - return this._actual.keys(); - } - negate() { - return this._actual; - } -} -class ContextKeyAndExpr { - constructor(expr) { - this.expr = expr; - this.type = 6 /* And */; - } - static create(_expr) { - return ContextKeyAndExpr._normalizeArr(_expr); - } - cmp(other) { - if (other.type !== this.type) { - return this.type - other.type; - } - if (this.expr.length < other.expr.length) { - return -1; - } - if (this.expr.length > other.expr.length) { - return 1; - } - for (let i = 0, len = this.expr.length; i < len; i++) { - const r = cmp(this.expr[i], other.expr[i]); - if (r !== 0) { - return r; - } - } - return 0; - } - equals(other) { - if (other.type === this.type) { - if (this.expr.length !== other.expr.length) { - return false; - } - for (let i = 0, len = this.expr.length; i < len; i++) { - if (!this.expr[i].equals(other.expr[i])) { - return false; - } - } - return true; - } - return false; - } - evaluate(context) { - for (let i = 0, len = this.expr.length; i < len; i++) { - if (!this.expr[i].evaluate(context)) { - return false; - } - } - return true; - } - static _normalizeArr(arr) { - const expr = []; - let hasTrue = false; - for (const e of arr) { - if (!e) { - continue; - } - if (e.type === 1 /* True */) { - // anything && true ==> anything - hasTrue = true; - continue; - } - if (e.type === 0 /* False */) { - // anything && false ==> false - return ContextKeyFalseExpr.INSTANCE; - } - if (e.type === 6 /* And */) { - expr.push(...e.expr); - continue; - } - expr.push(e); - } - if (expr.length === 0 && hasTrue) { - return ContextKeyTrueExpr.INSTANCE; - } - if (expr.length === 0) { - return undefined; - } - if (expr.length === 1) { - return expr[0]; - } - expr.sort(cmp); - // We must distribute any OR expression because we don't support parens - // OR extensions will be at the end (due to sorting rules) - while (expr.length > 1) { - const lastElement = expr[expr.length - 1]; - if (lastElement.type !== 9 /* Or */) { - break; - } - // pop the last element - expr.pop(); - // pop the second to last element - const secondToLastElement = expr.pop(); - // distribute `lastElement` over `secondToLastElement` - const resultElement = ContextKeyOrExpr.create(lastElement.expr.map(el => ContextKeyAndExpr.create([el, secondToLastElement]))); - if (resultElement) { - expr.push(resultElement); - expr.sort(cmp); - } - } - return new ContextKeyAndExpr(expr); - } - serialize() { - return this.expr.map(e => e.serialize()).join(' && '); - } - keys() { - const result = []; - for (let expr of this.expr) { - result.push(...expr.keys()); - } - return result; - } - negate() { - let result = []; - for (let expr of this.expr) { - result.push(expr.negate()); - } - return ContextKeyOrExpr.create(result); - } -} -class ContextKeyOrExpr { - constructor(expr) { - this.expr = expr; - this.type = 9 /* Or */; - } - static create(_expr) { - const expr = ContextKeyOrExpr._normalizeArr(_expr); - if (expr.length === 0) { - return undefined; - } - if (expr.length === 1) { - return expr[0]; - } - return new ContextKeyOrExpr(expr); - } - cmp(other) { - if (other.type !== this.type) { - return this.type - other.type; - } - if (this.expr.length < other.expr.length) { - return -1; - } - if (this.expr.length > other.expr.length) { - return 1; - } - for (let i = 0, len = this.expr.length; i < len; i++) { - const r = cmp(this.expr[i], other.expr[i]); - if (r !== 0) { - return r; - } - } - return 0; - } - equals(other) { - if (other.type === this.type) { - if (this.expr.length !== other.expr.length) { - return false; - } - for (let i = 0, len = this.expr.length; i < len; i++) { - if (!this.expr[i].equals(other.expr[i])) { - return false; - } - } - return true; - } - return false; - } - evaluate(context) { - for (let i = 0, len = this.expr.length; i < len; i++) { - if (this.expr[i].evaluate(context)) { - return true; - } - } - return false; - } - static _normalizeArr(arr) { - let expr = []; - let hasFalse = false; - if (arr) { - for (let i = 0, len = arr.length; i < len; i++) { - const e = arr[i]; - if (!e) { - continue; - } - if (e.type === 0 /* False */) { - // anything || false ==> anything - hasFalse = true; - continue; - } - if (e.type === 1 /* True */) { - // anything || true ==> true - return [ContextKeyTrueExpr.INSTANCE]; - } - if (e.type === 9 /* Or */) { - expr = expr.concat(e.expr); - continue; - } - expr.push(e); - } - if (expr.length === 0 && hasFalse) { - return [ContextKeyFalseExpr.INSTANCE]; - } - expr.sort(cmp); - } - return expr; - } - serialize() { - return this.expr.map(e => e.serialize()).join(' || '); - } - keys() { - const result = []; - for (let expr of this.expr) { - result.push(...expr.keys()); - } - return result; - } - negate() { - let result = []; - for (let expr of this.expr) { - result.push(expr.negate()); - } - const terminals = (node) => { - if (node.type === 9 /* Or */) { - return node.expr; - } - return [node]; - }; - // We don't support parens, so here we distribute the AND over the OR terminals - // We always take the first 2 AND pairs and distribute them - while (result.length > 1) { - const LEFT = result.shift(); - const RIGHT = result.shift(); - const all = []; - for (const left of terminals(LEFT)) { - for (const right of terminals(RIGHT)) { - all.push(ContextKeyExpr.and(left, right)); - } - } - result.unshift(ContextKeyExpr.or(...all)); - } - return result[0]; - } -} -class RawContextKey extends ContextKeyDefinedExpr { - constructor(key, defaultValue) { - super(key); - this._defaultValue = defaultValue; - } - bindTo(target) { - return target.createKey(this.key, this._defaultValue); - } - getValue(target) { - return target.getContextKeyValue(this.key); - } - toNegated() { - return ContextKeyExpr.not(this.key); - } -} -const IContextKeyService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__["createDecorator"])('contextKeyService'); -const SET_CONTEXT_COMMAND_ID = 'setContext'; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkeys.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkeys.js ***! - \*************************************************************************************/ -/*! exports provided: InputFocusedContextKey */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputFocusedContextKey", function() { return InputFocusedContextKey; }); -const InputFocusedContextKey = 'inputFocus'; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextMenuHandler.css": -/*!***********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextMenuHandler.css ***! - \***********************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); -/* harmony import */ var _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _css_loader_dist_cjs_js_contextMenuHandler_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../../css-loader/dist/cjs.js!./contextMenuHandler.css */ "./node_modules/css-loader/dist/cjs.js!./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextMenuHandler.css"); -/* harmony import */ var _css_loader_dist_cjs_js_contextMenuHandler_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_cjs_js_contextMenuHandler_css__WEBPACK_IMPORTED_MODULE_1__); - - - -var options = {}; - -options.insert = "head"; -options.singleton = false; - -var update = _style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_css_loader_dist_cjs_js_contextMenuHandler_css__WEBPACK_IMPORTED_MODULE_1___default.a, options); - - - -/* harmony default export */ __webpack_exports__["default"] = (_css_loader_dist_cjs_js_contextMenuHandler_css__WEBPACK_IMPORTED_MODULE_1___default.a.locals || {}); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextMenuHandler.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextMenuHandler.js ***! - \**********************************************************************************************/ -/*! exports provided: ContextMenuHandler */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextMenuHandler", function() { return ContextMenuHandler; }); -/* harmony import */ var _contextMenuHandler_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contextMenuHandler.css */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextMenuHandler.css"); -/* harmony import */ var _base_common_actions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/actions.js */ "./node_modules/monaco-editor/esm/vs/base/common/actions.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_browser_ui_menu_menu_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/browser/ui/menu/menu.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/menu/menu.js"); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _theme_common_styler_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/common/styler.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/styler.js"); -/* harmony import */ var _base_browser_event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/browser/event.js */ "./node_modules/monaco-editor/esm/vs/base/browser/event.js"); -/* harmony import */ var _base_browser_mouseEvent_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/browser/mouseEvent.js */ "./node_modules/monaco-editor/esm/vs/base/browser/mouseEvent.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - -class ContextMenuHandler { - constructor(contextViewService, telemetryService, notificationService, keybindingService, themeService) { - this.contextViewService = contextViewService; - this.telemetryService = telemetryService; - this.notificationService = notificationService; - this.keybindingService = keybindingService; - this.themeService = themeService; - this.focusToReturn = null; - this.block = null; - this.options = { blockMouse: true }; - } - configure(options) { - this.options = options; - } - showContextMenu(delegate) { - const actions = delegate.getActions(); - if (!actions.length) { - return; // Don't render an empty context menu - } - this.focusToReturn = document.activeElement; - let menu; - let shadowRootElement = Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_4__["isHTMLElement"])(delegate.domForShadowRoot) ? delegate.domForShadowRoot : undefined; - this.contextViewService.showContextView({ - getAnchor: () => delegate.getAnchor(), - canRelayout: false, - anchorAlignment: delegate.anchorAlignment, - render: (container) => { - let className = delegate.getMenuClassName ? delegate.getMenuClassName() : ''; - if (className) { - container.className += ' ' + className; - } - // Render invisible div to block mouse interaction in the rest of the UI - if (this.options.blockMouse) { - this.block = container.appendChild(Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_4__["$"])('.context-view-block')); - this.block.style.position = 'fixed'; - this.block.style.cursor = 'initial'; - this.block.style.left = '0'; - this.block.style.top = '0'; - this.block.style.width = '100%'; - this.block.style.height = '100%'; - this.block.style.zIndex = '-1'; - Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_6__["domEvent"])(this.block, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].MOUSE_DOWN)((e) => e.stopPropagation()); - } - const menuDisposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["DisposableStore"](); - const actionRunner = delegate.actionRunner || new _base_common_actions_js__WEBPACK_IMPORTED_MODULE_1__["ActionRunner"](); - actionRunner.onDidBeforeRun(this.onActionRun, this, menuDisposables); - actionRunner.onDidRun(this.onDidActionRun, this, menuDisposables); - menu = new _base_browser_ui_menu_menu_js__WEBPACK_IMPORTED_MODULE_3__["Menu"](container, actions, { - actionViewItemProvider: delegate.getActionViewItem, - context: delegate.getActionsContext ? delegate.getActionsContext() : null, - actionRunner, - getKeyBinding: delegate.getKeyBinding ? delegate.getKeyBinding : action => this.keybindingService.lookupKeybinding(action.id) - }); - menuDisposables.add(Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_5__["attachMenuStyler"])(menu, this.themeService)); - menu.onDidCancel(() => this.contextViewService.hideContextView(true), null, menuDisposables); - menu.onDidBlur(() => this.contextViewService.hideContextView(true), null, menuDisposables); - Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_6__["domEvent"])(window, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].BLUR)(() => { this.contextViewService.hideContextView(true); }, null, menuDisposables); - Object(_base_browser_event_js__WEBPACK_IMPORTED_MODULE_6__["domEvent"])(window, _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_4__["EventType"].MOUSE_DOWN)((e) => { - if (e.defaultPrevented) { - return; - } - let event = new _base_browser_mouseEvent_js__WEBPACK_IMPORTED_MODULE_7__["StandardMouseEvent"](e); - let element = event.target; - // Don't do anything as we are likely creating a context menu - if (event.rightButton) { - return; - } - while (element) { - if (element === container) { - return; - } - element = element.parentElement; - } - this.contextViewService.hideContextView(true); - }, null, menuDisposables); - return Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["combinedDisposable"])(menuDisposables, menu); - }, - focus: () => { - if (menu) { - menu.focus(!!delegate.autoSelectFirstItem); - } - }, - onHide: (didCancel) => { - if (delegate.onHide) { - delegate.onHide(!!didCancel); - } - if (this.block) { - Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_4__["removeNode"])(this.block); - this.block = null; - } - if (this.focusToReturn) { - this.focusToReturn.focus(); - } - } - }, shadowRootElement, !!shadowRootElement); - } - onActionRun(e) { - if (this.telemetryService) { - this.telemetryService.publicLog2('workbenchActionExecuted', { id: e.action.id, from: 'contextMenu' }); - } - this.contextViewService.hideContextView(false); - // Restore focus here - if (this.focusToReturn) { - this.focusToReturn.focus(); - } - } - onDidActionRun(e) { - if (e.error && this.notificationService) { - this.notificationService.error(e.error); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextMenuService.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextMenuService.js ***! - \**********************************************************************************************/ -/*! exports provided: ContextMenuService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextMenuService", function() { return ContextMenuService; }); -/* harmony import */ var _contextMenuHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contextMenuHandler.js */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextMenuHandler.js"); -/* harmony import */ var _contextView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contextView.js */ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextView.js"); -/* harmony import */ var _telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../telemetry/common/telemetry.js */ "./node_modules/monaco-editor/esm/vs/platform/telemetry/common/telemetry.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _notification_common_notification_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - -let ContextMenuService = class ContextMenuService extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__["Disposable"] { - constructor(telemetryService, notificationService, contextViewService, keybindingService, themeService) { - super(); - this._onDidContextMenu = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this.onDidContextMenu = this._onDidContextMenu.event; - this.contextMenuHandler = new _contextMenuHandler_js__WEBPACK_IMPORTED_MODULE_0__["ContextMenuHandler"](contextViewService, telemetryService, notificationService, keybindingService, themeService); - } - configure(options) { - this.contextMenuHandler.configure(options); - } - // ContextMenu - showContextMenu(delegate) { - this.contextMenuHandler.showContextMenu(delegate); - this._onDidContextMenu.fire(); - } -}; -ContextMenuService = __decorate([ - __param(0, _telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_2__["ITelemetryService"]), - __param(1, _notification_common_notification_js__WEBPACK_IMPORTED_MODULE_4__["INotificationService"]), - __param(2, _contextView_js__WEBPACK_IMPORTED_MODULE_1__["IContextViewService"]), - __param(3, _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_6__["IKeybindingService"]), - __param(4, _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_5__["IThemeService"]) -], ContextMenuService); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextView.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextView.js ***! - \***************************************************************************************/ -/*! exports provided: IContextViewService, IContextMenuService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IContextViewService", function() { return IContextViewService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IContextMenuService", function() { return IContextMenuService; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const IContextViewService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('contextViewService'); -const IContextMenuService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('contextMenuService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextViewService.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/contextview/browser/contextViewService.js ***! - \**********************************************************************************************/ -/*! exports provided: ContextViewService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContextViewService", function() { return ContextViewService; }); -/* harmony import */ var _base_browser_ui_contextview_contextview_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/ui/contextview/contextview.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/contextview/contextview.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _layout_browser_layoutService_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../layout/browser/layoutService.js */ "./node_modules/monaco-editor/esm/vs/platform/layout/browser/layoutService.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - -let ContextViewService = class ContextViewService extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(layoutService) { - super(); - this.layoutService = layoutService; - this.currentViewDisposable = _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - this.container = layoutService.container; - this.contextView = this._register(new _base_browser_ui_contextview_contextview_js__WEBPACK_IMPORTED_MODULE_0__["ContextView"](this.container, 1 /* ABSOLUTE */)); - this.layout(); - this._register(layoutService.onLayout(() => this.layout())); - } - // ContextView - setContainer(container, domPosition) { - this.contextView.setContainer(container, domPosition || 1 /* ABSOLUTE */); - } - showContextView(delegate, container, shadowRoot) { - if (container) { - if (container !== this.container) { - this.container = container; - this.setContainer(container, shadowRoot ? 3 /* FIXED_SHADOW */ : 2 /* FIXED */); - } - } - else { - if (this.container !== this.layoutService.container) { - this.container = this.layoutService.container; - this.setContainer(this.container, 1 /* ABSOLUTE */); - } - } - this.contextView.show(delegate); - const disposable = Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => { - if (this.currentViewDisposable === disposable) { - this.hideContextView(); - } - }); - this.currentViewDisposable = disposable; - return disposable; - } - getContextViewElement() { - return this.contextView.getViewElement(); - } - layout() { - this.contextView.layout(); - } - hideContextView(data) { - this.contextView.hide(data); - } -}; -ContextViewService = __decorate([ - __param(0, _layout_browser_layoutService_js__WEBPACK_IMPORTED_MODULE_2__["ILayoutService"]) -], ContextViewService); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/dialogs/common/dialogs.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/dialogs/common/dialogs.js ***! - \******************************************************************************/ -/*! exports provided: IDialogService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IDialogService", function() { return IDialogService; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const IDialogService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('dialogService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/editor/common/editor.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/editor/common/editor.js ***! - \****************************************************************************/ -/*! exports provided: EditorOpenContext */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorOpenContext", function() { return EditorOpenContext; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var EditorOpenContext; -(function (EditorOpenContext) { - /** - * Default: the editor is opening via a programmatic call - * to the editor service API. - */ - EditorOpenContext[EditorOpenContext["API"] = 0] = "API"; - /** - * Indicates that a user action triggered the opening, e.g. - * via mouse or keyboard use. - */ - EditorOpenContext[EditorOpenContext["USER"] = 1] = "USER"; -})(EditorOpenContext || (EditorOpenContext = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/extensions/common/extensions.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/extensions/common/extensions.js ***! - \************************************************************************************/ -/*! exports provided: ExtensionIdentifier */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExtensionIdentifier", function() { return ExtensionIdentifier; }); -/** - * **!Do not construct directly!** - * - * **!Only static methods because it gets serialized!** - * - * This represents the "canonical" version for an extension identifier. Extension ids - * have to be case-insensitive (due to the marketplace), but we must ensure case - * preservation because the extension API is already public at this time. - * - * For example, given an extension with the publisher `"Hello"` and the name `"World"`, - * its canonical extension identifier is `"Hello.World"`. This extension could be - * referenced in some other extension's dependencies using the string `"hello.world"`. - * - * To make matters more complicated, an extension can optionally have an UUID. When two - * extensions have the same UUID, they are considered equal even if their identifier is different. - */ -class ExtensionIdentifier { - constructor(value) { - this.value = value; - this._lower = value.toLowerCase(); - } - /** - * Gives the value by which to index (for equality). - */ - static toKey(id) { - if (typeof id === 'string') { - return id.toLowerCase(); - } - return id._lower; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/files/common/files.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/files/common/files.js ***! - \**************************************************************************/ -/*! exports provided: FileKind */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FileKind", function() { return FileKind; }); -var FileKind; -(function (FileKind) { - FileKind[FileKind["FILE"] = 0] = "FILE"; - FileKind[FileKind["FOLDER"] = 1] = "FOLDER"; - FileKind[FileKind["ROOT_FOLDER"] = 2] = "ROOT_FOLDER"; -})(FileKind || (FileKind = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/descriptors.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/instantiation/common/descriptors.js ***! - \****************************************************************************************/ -/*! exports provided: SyncDescriptor */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyncDescriptor", function() { return SyncDescriptor; }); -class SyncDescriptor { - constructor(ctor, staticArguments = [], supportsDelayedInstantiation = false) { - this.ctor = ctor; - this.staticArguments = staticArguments; - this.supportsDelayedInstantiation = supportsDelayedInstantiation; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/extensions.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/instantiation/common/extensions.js ***! - \***************************************************************************************/ -/*! exports provided: registerSingleton, getSingletonServiceDescriptors */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerSingleton", function() { return registerSingleton; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSingletonServiceDescriptors", function() { return getSingletonServiceDescriptors; }); -/* harmony import */ var _descriptors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./descriptors.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/descriptors.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const _registry = []; -function registerSingleton(id, ctor, supportsDelayedInstantiation) { - _registry.push([id, new _descriptors_js__WEBPACK_IMPORTED_MODULE_0__["SyncDescriptor"](ctor, [], supportsDelayedInstantiation)]); -} -function getSingletonServiceDescriptors() { - return _registry; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/graph.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/instantiation/common/graph.js ***! - \**********************************************************************************/ -/*! exports provided: Node, Graph */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Node", function() { return Node; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Graph", function() { return Graph; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class Node { - constructor(data) { - this.incoming = new Map(); - this.outgoing = new Map(); - this.data = data; - } -} -class Graph { - constructor(_hashFn) { - this._hashFn = _hashFn; - this._nodes = new Map(); - // empty - } - roots() { - const ret = []; - for (let node of this._nodes.values()) { - if (node.outgoing.size === 0) { - ret.push(node); - } - } - return ret; - } - insertEdge(from, to) { - const fromNode = this.lookupOrInsertNode(from); - const toNode = this.lookupOrInsertNode(to); - fromNode.outgoing.set(this._hashFn(to), toNode); - toNode.incoming.set(this._hashFn(from), fromNode); - } - removeNode(data) { - const key = this._hashFn(data); - this._nodes.delete(key); - for (let node of this._nodes.values()) { - node.outgoing.delete(key); - node.incoming.delete(key); - } - } - lookupOrInsertNode(data) { - const key = this._hashFn(data); - let node = this._nodes.get(key); - if (!node) { - node = new Node(data); - this._nodes.set(key, node); - } - return node; - } - isEmpty() { - return this._nodes.size === 0; - } - toString() { - let data = []; - for (let [key, value] of this._nodes) { - data.push(`${key}, (incoming)[${[...value.incoming.keys()].join(', ')}], (outgoing)[${[...value.outgoing.keys()].join(',')}]`); - } - return data.join('\n'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js ***! - \******************************************************************************************/ -/*! exports provided: _util, IInstantiationService, createDecorator, optional */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_util", function() { return _util; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IInstantiationService", function() { return IInstantiationService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDecorator", function() { return createDecorator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "optional", function() { return optional; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// ------ internal util -var _util; -(function (_util) { - _util.serviceIds = new Map(); - _util.DI_TARGET = '$di$target'; - _util.DI_DEPENDENCIES = '$di$dependencies'; - function getServiceDependencies(ctor) { - return ctor[_util.DI_DEPENDENCIES] || []; - } - _util.getServiceDependencies = getServiceDependencies; -})(_util || (_util = {})); -const IInstantiationService = createDecorator('instantiationService'); -function storeServiceDependency(id, target, index, optional) { - if (target[_util.DI_TARGET] === target) { - target[_util.DI_DEPENDENCIES].push({ id, index, optional }); - } - else { - target[_util.DI_DEPENDENCIES] = [{ id, index, optional }]; - target[_util.DI_TARGET] = target; - } -} -/** - * The *only* valid way to create a {{ServiceIdentifier}}. - */ -function createDecorator(serviceId) { - if (_util.serviceIds.has(serviceId)) { - return _util.serviceIds.get(serviceId); - } - const id = function (target, key, index) { - if (arguments.length !== 3) { - throw new Error('@IServiceName-decorator can only be used to decorate a parameter'); - } - storeServiceDependency(id, target, index, false); - }; - id.toString = () => serviceId; - _util.serviceIds.set(serviceId, id); - return id; -} -/** - * Mark a service dependency as optional. - */ -function optional(serviceIdentifier) { - return function (target, key, index) { - if (arguments.length !== 3) { - throw new Error('@optional-decorator can only be used to decorate a parameter'); - } - storeServiceDependency(serviceIdentifier, target, index, true); - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiationService.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiationService.js ***! - \*************************************************************************************************/ -/*! exports provided: InstantiationService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InstantiationService", function() { return InstantiationService; }); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _graph_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./graph.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/graph.js"); -/* harmony import */ var _descriptors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./descriptors.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/descriptors.js"); -/* harmony import */ var _instantiation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _serviceCollection_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./serviceCollection.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -// TRACING -const _enableTracing = false; -class CyclicDependencyError extends Error { - constructor(graph) { - super('cyclic dependency between services'); - this.message = graph.toString(); - } -} -class InstantiationService { - constructor(services = new _serviceCollection_js__WEBPACK_IMPORTED_MODULE_4__["ServiceCollection"](), strict = false, parent) { - this._services = services; - this._strict = strict; - this._parent = parent; - this._services.set(_instantiation_js__WEBPACK_IMPORTED_MODULE_3__["IInstantiationService"], this); - } - createChild(services) { - return new InstantiationService(services, this._strict, this); - } - invokeFunction(fn, ...args) { - let _trace = Trace.traceInvocation(fn); - let _done = false; - try { - const accessor = { - get: (id, isOptional) => { - if (_done) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["illegalState"])('service accessor is only valid during the invocation of its target method'); - } - const result = this._getOrCreateServiceInstance(id, _trace); - if (!result && isOptional !== _instantiation_js__WEBPACK_IMPORTED_MODULE_3__["optional"]) { - throw new Error(`[invokeFunction] unknown service '${id}'`); - } - return result; - } - }; - return fn(accessor, ...args); - } - finally { - _done = true; - _trace.stop(); - } - } - createInstance(ctorOrDescriptor, ...rest) { - let _trace; - let result; - if (ctorOrDescriptor instanceof _descriptors_js__WEBPACK_IMPORTED_MODULE_2__["SyncDescriptor"]) { - _trace = Trace.traceCreation(ctorOrDescriptor.ctor); - result = this._createInstance(ctorOrDescriptor.ctor, ctorOrDescriptor.staticArguments.concat(rest), _trace); - } - else { - _trace = Trace.traceCreation(ctorOrDescriptor); - result = this._createInstance(ctorOrDescriptor, rest, _trace); - } - _trace.stop(); - return result; - } - _createInstance(ctor, args = [], _trace) { - // arguments defined by service decorators - let serviceDependencies = _instantiation_js__WEBPACK_IMPORTED_MODULE_3__["_util"].getServiceDependencies(ctor).sort((a, b) => a.index - b.index); - let serviceArgs = []; - for (const dependency of serviceDependencies) { - let service = this._getOrCreateServiceInstance(dependency.id, _trace); - if (!service && this._strict && !dependency.optional) { - throw new Error(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id}.`); - } - serviceArgs.push(service); - } - let firstServiceArgPos = serviceDependencies.length > 0 ? serviceDependencies[0].index : args.length; - // check for argument mismatches, adjust static args if needed - if (args.length !== firstServiceArgPos) { - console.warn(`[createInstance] First service dependency of ${ctor.name} at position ${firstServiceArgPos + 1} conflicts with ${args.length} static arguments`); - let delta = firstServiceArgPos - args.length; - if (delta > 0) { - args = args.concat(new Array(delta)); - } - else { - args = args.slice(0, firstServiceArgPos); - } - } - // now create the instance - return new ctor(...[...args, ...serviceArgs]); - } - _setServiceInstance(id, instance) { - if (this._services.get(id) instanceof _descriptors_js__WEBPACK_IMPORTED_MODULE_2__["SyncDescriptor"]) { - this._services.set(id, instance); - } - else if (this._parent) { - this._parent._setServiceInstance(id, instance); - } - else { - throw new Error('illegalState - setting UNKNOWN service instance'); - } - } - _getServiceInstanceOrDescriptor(id) { - let instanceOrDesc = this._services.get(id); - if (!instanceOrDesc && this._parent) { - return this._parent._getServiceInstanceOrDescriptor(id); - } - else { - return instanceOrDesc; - } - } - _getOrCreateServiceInstance(id, _trace) { - let thing = this._getServiceInstanceOrDescriptor(id); - if (thing instanceof _descriptors_js__WEBPACK_IMPORTED_MODULE_2__["SyncDescriptor"]) { - return this._createAndCacheServiceInstance(id, thing, _trace.branch(id, true)); - } - else { - _trace.branch(id, false); - return thing; - } - } - _createAndCacheServiceInstance(id, desc, _trace) { - const graph = new _graph_js__WEBPACK_IMPORTED_MODULE_1__["Graph"](data => data.id.toString()); - let cycleCount = 0; - const stack = [{ id, desc, _trace }]; - while (stack.length) { - const item = stack.pop(); - graph.lookupOrInsertNode(item); - // a weak but working heuristic for cycle checks - if (cycleCount++ > 1000) { - throw new CyclicDependencyError(graph); - } - // check all dependencies for existence and if they need to be created first - for (let dependency of _instantiation_js__WEBPACK_IMPORTED_MODULE_3__["_util"].getServiceDependencies(item.desc.ctor)) { - let instanceOrDesc = this._getServiceInstanceOrDescriptor(dependency.id); - if (!instanceOrDesc && !dependency.optional) { - console.warn(`[createInstance] ${id} depends on ${dependency.id} which is NOT registered.`); - } - if (instanceOrDesc instanceof _descriptors_js__WEBPACK_IMPORTED_MODULE_2__["SyncDescriptor"]) { - const d = { id: dependency.id, desc: instanceOrDesc, _trace: item._trace.branch(dependency.id, true) }; - graph.insertEdge(item, d); - stack.push(d); - } - } - } - while (true) { - const roots = graph.roots(); - // if there is no more roots but still - // nodes in the graph we have a cycle - if (roots.length === 0) { - if (!graph.isEmpty()) { - throw new CyclicDependencyError(graph); - } - break; - } - for (const { data } of roots) { - // create instance and overwrite the service collections - const instance = this._createServiceInstanceWithOwner(data.id, data.desc.ctor, data.desc.staticArguments, data.desc.supportsDelayedInstantiation, data._trace); - this._setServiceInstance(data.id, instance); - graph.removeNode(data); - } - } - return this._getServiceInstanceOrDescriptor(id); - } - _createServiceInstanceWithOwner(id, ctor, args = [], supportsDelayedInstantiation, _trace) { - if (this._services.get(id) instanceof _descriptors_js__WEBPACK_IMPORTED_MODULE_2__["SyncDescriptor"]) { - return this._createServiceInstance(ctor, args, supportsDelayedInstantiation, _trace); - } - else if (this._parent) { - return this._parent._createServiceInstanceWithOwner(id, ctor, args, supportsDelayedInstantiation, _trace); - } - else { - throw new Error(`illegalState - creating UNKNOWN service instance ${ctor.name}`); - } - } - _createServiceInstance(ctor, args = [], _supportsDelayedInstantiation, _trace) { - if (!_supportsDelayedInstantiation) { - // eager instantiation - return this._createInstance(ctor, args, _trace); - } - else { - // Return a proxy object that's backed by an idle value. That - // strategy is to instantiate services in our idle time or when actually - // needed but not when injected into a consumer - const idle = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_5__["IdleValue"](() => this._createInstance(ctor, args, _trace)); - return new Proxy(Object.create(null), { - get(target, key) { - if (key in target) { - return target[key]; - } - let obj = idle.value; - let prop = obj[key]; - if (typeof prop !== 'function') { - return prop; - } - prop = prop.bind(obj); - target[key] = prop; - return prop; - }, - set(_target, p, value) { - idle.value[p] = value; - return true; - } - }); - } - } -} -class Trace { - constructor(type, name) { - this.type = type; - this.name = name; - this._start = Date.now(); - this._dep = []; - } - static traceInvocation(ctor) { - return !_enableTracing ? Trace._None : new Trace(1 /* Invocation */, ctor.name || ctor.toString().substring(0, 42).replace(/\n/g, '')); - } - static traceCreation(ctor) { - return !_enableTracing ? Trace._None : new Trace(0 /* Creation */, ctor.name); - } - branch(id, first) { - let child = new Trace(2 /* Branch */, id.toString()); - this._dep.push([id, first, child]); - return child; - } - stop() { - let dur = Date.now() - this._start; - Trace._totals += dur; - let causedCreation = false; - function printChild(n, trace) { - let res = []; - let prefix = new Array(n + 1).join('\t'); - for (const [id, first, child] of trace._dep) { - if (first && child) { - causedCreation = true; - res.push(`${prefix}CREATES -> ${id}`); - let nested = printChild(n + 1, child); - if (nested) { - res.push(nested); - } - } - else { - res.push(`${prefix}uses -> ${id}`); - } - } - return res.join('\n'); - } - let lines = [ - `${this.type === 0 /* Creation */ ? 'CREATE' : 'CALL'} ${this.name}`, - `${printChild(1, this)}`, - `DONE, took ${dur.toFixed(2)}ms (grand total ${Trace._totals.toFixed(2)}ms)` - ]; - if (dur > 2 || causedCreation) { - console.log(lines.join('\n')); - } - } -} -Trace._None = new class extends Trace { - constructor() { super(-1, null); } - stop() { } - branch() { return this; } -}; -Trace._totals = 0; -//#endregion - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js ***! - \**********************************************************************************************/ -/*! exports provided: ServiceCollection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ServiceCollection", function() { return ServiceCollection; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class ServiceCollection { - constructor(...entries) { - this._entries = new Map(); - for (let [id, service] of entries) { - this.set(id, service); - } - } - set(id, instanceOrDescriptor) { - const result = this._entries.get(id); - this._entries.set(id, instanceOrDescriptor); - return result; - } - has(id) { - return this._entries.has(id); - } - get(id) { - return this._entries.get(id); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js ***! - \***************************************************************************************************/ -/*! exports provided: Extensions */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Extensions", function() { return Extensions; }); -/* harmony import */ var _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -const Extensions = { - JSONContribution: 'base.contributions.json' -}; -function normalizeId(id) { - if (id.length > 0 && id.charAt(id.length - 1) === '#') { - return id.substring(0, id.length - 1); - } - return id; -} -class JSONContributionRegistry { - constructor() { - this._onDidChangeSchema = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"](); - this.schemasById = {}; - } - registerSchema(uri, unresolvedSchemaContent) { - this.schemasById[normalizeId(uri)] = unresolvedSchemaContent; - this._onDidChangeSchema.fire(uri); - } - notifySchemaChanged(uri) { - this._onDidChangeSchema.fire(uri); - } -} -const jsonContributionRegistry = new JSONContributionRegistry(); -_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__["Registry"].add(Extensions.JSONContribution, jsonContributionRegistry); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/abstractKeybindingService.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/keybinding/common/abstractKeybindingService.js ***! - \***************************************************************************************************/ -/*! exports provided: AbstractKeybindingService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractKeybindingService", function() { return AbstractKeybindingService; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -class AbstractKeybindingService extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["Disposable"] { - constructor(_contextKeyService, _commandService, _telemetryService, _notificationService, _logService) { - super(); - this._contextKeyService = _contextKeyService; - this._commandService = _commandService; - this._telemetryService = _telemetryService; - this._notificationService = _notificationService; - this._logService = _logService; - this._onDidUpdateKeybindings = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"]()); - this._currentChord = null; - this._currentChordChecker = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["IntervalTimer"](); - this._currentChordStatusMessage = null; - this._logging = false; - } - get onDidUpdateKeybindings() { - return this._onDidUpdateKeybindings ? this._onDidUpdateKeybindings.event : _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Event"].None; // Sinon stubbing walks properties on prototype - } - dispose() { - super.dispose(); - } - _log(str) { - if (this._logging) { - this._logService.info(`[KeybindingService]: ${str}`); - } - } - getKeybindings() { - return this._getResolver().getKeybindings(); - } - lookupKeybindings(commandId) { - return _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["coalesce"](this._getResolver().lookupKeybindings(commandId).map(item => item.resolvedKeybinding)); - } - lookupKeybinding(commandId) { - const result = this._getResolver().lookupPrimaryKeybinding(commandId); - if (!result) { - return undefined; - } - return result.resolvedKeybinding; - } - dispatchEvent(e, target) { - return this._dispatch(e, target); - } - softDispatch(e, target) { - const keybinding = this.resolveKeyboardEvent(e); - if (keybinding.isChord()) { - console.warn('Unexpected keyboard event mapped to a chord'); - return null; - } - const [firstPart,] = keybinding.getDispatchParts(); - if (firstPart === null) { - // cannot be dispatched, probably only modifier keys - return null; - } - const contextValue = this._contextKeyService.getContext(target); - const currentChord = this._currentChord ? this._currentChord.keypress : null; - return this._getResolver().resolve(contextValue, currentChord, firstPart); - } - _enterChordMode(firstPart, keypressLabel) { - this._currentChord = { - keypress: firstPart, - label: keypressLabel - }; - this._currentChordStatusMessage = this._notificationService.status(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('first.chord', "({0}) was pressed. Waiting for second key of chord...", keypressLabel)); - const chordEnterTime = Date.now(); - this._currentChordChecker.cancelAndSet(() => { - if (!this._documentHasFocus()) { - // Focus has been lost => leave chord mode - this._leaveChordMode(); - return; - } - if (Date.now() - chordEnterTime > 5000) { - // 5 seconds elapsed => leave chord mode - this._leaveChordMode(); - } - }, 500); - } - _leaveChordMode() { - if (this._currentChordStatusMessage) { - this._currentChordStatusMessage.dispose(); - this._currentChordStatusMessage = null; - } - this._currentChordChecker.cancel(); - this._currentChord = null; - } - _dispatch(e, target) { - return this._doDispatch(this.resolveKeyboardEvent(e), target); - } - _doDispatch(keybinding, target) { - let shouldPreventDefault = false; - if (keybinding.isChord()) { - console.warn('Unexpected keyboard event mapped to a chord'); - return false; - } - const [firstPart,] = keybinding.getDispatchParts(); - if (firstPart === null) { - this._log(`\\ Keyboard event cannot be dispatched.`); - // cannot be dispatched, probably only modifier keys - return shouldPreventDefault; - } - const contextValue = this._contextKeyService.getContext(target); - const currentChord = this._currentChord ? this._currentChord.keypress : null; - const keypressLabel = keybinding.getLabel(); - const resolveResult = this._getResolver().resolve(contextValue, currentChord, firstPart); - this._logService.trace('KeybindingService#dispatch', keypressLabel, resolveResult === null || resolveResult === void 0 ? void 0 : resolveResult.commandId); - if (resolveResult && resolveResult.enterChord) { - shouldPreventDefault = true; - this._enterChordMode(firstPart, keypressLabel); - return shouldPreventDefault; - } - if (this._currentChord) { - if (!resolveResult || !resolveResult.commandId) { - this._notificationService.status(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('missing.chord', "The key combination ({0}, {1}) is not a command.", this._currentChord.label, keypressLabel), { hideAfter: 10 * 1000 /* 10s */ }); - shouldPreventDefault = true; - } - } - this._leaveChordMode(); - if (resolveResult && resolveResult.commandId) { - if (!resolveResult.bubble) { - shouldPreventDefault = true; - } - if (typeof resolveResult.commandArgs === 'undefined') { - this._commandService.executeCommand(resolveResult.commandId).then(undefined, err => this._notificationService.warn(err)); - } - else { - this._commandService.executeCommand(resolveResult.commandId, resolveResult.commandArgs).then(undefined, err => this._notificationService.warn(err)); - } - this._telemetryService.publicLog2('workbenchActionExecuted', { id: resolveResult.commandId, from: 'keybinding' }); - } - return shouldPreventDefault; - } - mightProducePrintableCharacter(event) { - if (event.ctrlKey || event.metaKey) { - // ignore ctrl/cmd-combination but not shift/alt-combinatios - return false; - } - // weak check for certain ranges. this is properly implemented in a subclass - // with access to the KeyboardMapperFactory. - if ((event.keyCode >= 31 /* KEY_A */ && event.keyCode <= 56 /* KEY_Z */) - || (event.keyCode >= 21 /* KEY_0 */ && event.keyCode <= 30 /* KEY_9 */)) { - return true; - } - return false; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/baseResolvedKeybinding.js": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/keybinding/common/baseResolvedKeybinding.js ***! - \************************************************************************************************/ -/*! exports provided: BaseResolvedKeybinding */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseResolvedKeybinding", function() { return BaseResolvedKeybinding; }); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _base_common_keybindingLabels_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/keybindingLabels.js */ "./node_modules/monaco-editor/esm/vs/base/common/keybindingLabels.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -class BaseResolvedKeybinding extends _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__["ResolvedKeybinding"] { - constructor(os, parts) { - super(); - if (parts.length === 0) { - throw Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_0__["illegalArgument"])(`parts`); - } - this._os = os; - this._parts = parts; - } - getLabel() { - return _base_common_keybindingLabels_js__WEBPACK_IMPORTED_MODULE_1__["UILabelProvider"].toLabel(this._os, this._parts, (keybinding) => this._getLabel(keybinding)); - } - getAriaLabel() { - return _base_common_keybindingLabels_js__WEBPACK_IMPORTED_MODULE_1__["AriaLabelProvider"].toLabel(this._os, this._parts, (keybinding) => this._getAriaLabel(keybinding)); - } - isChord() { - return (this._parts.length > 1); - } - getParts() { - return this._parts.map((keybinding) => this._getPart(keybinding)); - } - _getPart(keybinding) { - return new _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__["ResolvedKeybindingPart"](keybinding.ctrlKey, keybinding.shiftKey, keybinding.altKey, keybinding.metaKey, this._getLabel(keybinding), this._getAriaLabel(keybinding)); - } - getDispatchParts() { - return this._parts.map((keybinding) => this._getDispatchPart(keybinding)); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js ***! - \************************************************************************************/ -/*! exports provided: IKeybindingService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IKeybindingService", function() { return IKeybindingService; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const IKeybindingService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('keybindingService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingResolver.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingResolver.js ***! - \********************************************************************************************/ -/*! exports provided: KeybindingResolver */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeybindingResolver", function() { return KeybindingResolver; }); -class KeybindingResolver { - constructor(defaultKeybindings, overrides, log) { - this._log = log; - this._defaultKeybindings = defaultKeybindings; - this._defaultBoundCommands = new Map(); - for (let i = 0, len = defaultKeybindings.length; i < len; i++) { - const command = defaultKeybindings[i].command; - if (command) { - this._defaultBoundCommands.set(command, true); - } - } - this._map = new Map(); - this._lookupMap = new Map(); - this._keybindings = KeybindingResolver.combine(defaultKeybindings, overrides); - for (let i = 0, len = this._keybindings.length; i < len; i++) { - let k = this._keybindings[i]; - if (k.keypressParts.length === 0) { - // unbound - continue; - } - if (k.when && k.when.type === 0 /* False */) { - // when condition is false - continue; - } - // TODO@chords - this._addKeyPress(k.keypressParts[0], k); - } - } - static _isTargetedForRemoval(defaultKb, keypressFirstPart, keypressChordPart, command, when) { - if (defaultKb.command !== command) { - return false; - } - // TODO@chords - if (keypressFirstPart && defaultKb.keypressParts[0] !== keypressFirstPart) { - return false; - } - // TODO@chords - if (keypressChordPart && defaultKb.keypressParts[1] !== keypressChordPart) { - return false; - } - if (when) { - if (!defaultKb.when) { - return false; - } - if (!when.equals(defaultKb.when)) { - return false; - } - } - return true; - } - /** - * Looks for rules containing -command in `overrides` and removes them directly from `defaults`. - */ - static combine(defaults, rawOverrides) { - defaults = defaults.slice(0); - let overrides = []; - for (const override of rawOverrides) { - if (!override.command || override.command.length === 0 || override.command.charAt(0) !== '-') { - overrides.push(override); - continue; - } - const command = override.command.substr(1); - // TODO@chords - const keypressFirstPart = override.keypressParts[0]; - const keypressChordPart = override.keypressParts[1]; - const when = override.when; - for (let j = defaults.length - 1; j >= 0; j--) { - if (this._isTargetedForRemoval(defaults[j], keypressFirstPart, keypressChordPart, command, when)) { - defaults.splice(j, 1); - } - } - } - return defaults.concat(overrides); - } - _addKeyPress(keypress, item) { - const conflicts = this._map.get(keypress); - if (typeof conflicts === 'undefined') { - // There is no conflict so far - this._map.set(keypress, [item]); - this._addToLookupMap(item); - return; - } - for (let i = conflicts.length - 1; i >= 0; i--) { - let conflict = conflicts[i]; - if (conflict.command === item.command) { - continue; - } - const conflictIsChord = (conflict.keypressParts.length > 1); - const itemIsChord = (item.keypressParts.length > 1); - // TODO@chords - if (conflictIsChord && itemIsChord && conflict.keypressParts[1] !== item.keypressParts[1]) { - // The conflict only shares the chord start with this command - continue; - } - if (KeybindingResolver.whenIsEntirelyIncluded(conflict.when, item.when)) { - // `item` completely overwrites `conflict` - // Remove conflict from the lookupMap - this._removeFromLookupMap(conflict); - } - } - conflicts.push(item); - this._addToLookupMap(item); - } - _addToLookupMap(item) { - if (!item.command) { - return; - } - let arr = this._lookupMap.get(item.command); - if (typeof arr === 'undefined') { - arr = [item]; - this._lookupMap.set(item.command, arr); - } - else { - arr.push(item); - } - } - _removeFromLookupMap(item) { - if (!item.command) { - return; - } - let arr = this._lookupMap.get(item.command); - if (typeof arr === 'undefined') { - return; - } - for (let i = 0, len = arr.length; i < len; i++) { - if (arr[i] === item) { - arr.splice(i, 1); - return; - } - } - } - /** - * Returns true if it is provable `a` implies `b`. - */ - static whenIsEntirelyIncluded(a, b) { - if (!b) { - return true; - } - if (!a) { - return false; - } - return this._implies(a, b); - } - /** - * Returns true if it is provable `p` implies `q`. - */ - static _implies(p, q) { - const notP = p.negate(); - const terminals = (node) => { - if (node.type === 9 /* Or */) { - return node.expr; - } - return [node]; - }; - let expr = terminals(notP).concat(terminals(q)); - for (let i = 0; i < expr.length; i++) { - const a = expr[i]; - const notA = a.negate(); - for (let j = i + 1; j < expr.length; j++) { - const b = expr[j]; - if (notA.equals(b)) { - return true; - } - } - } - return false; - } - getKeybindings() { - return this._keybindings; - } - lookupKeybindings(commandId) { - let items = this._lookupMap.get(commandId); - if (typeof items === 'undefined' || items.length === 0) { - return []; - } - // Reverse to get the most specific item first - let result = [], resultLen = 0; - for (let i = items.length - 1; i >= 0; i--) { - result[resultLen++] = items[i]; - } - return result; - } - lookupPrimaryKeybinding(commandId) { - let items = this._lookupMap.get(commandId); - if (typeof items === 'undefined' || items.length === 0) { - return null; - } - return items[items.length - 1]; - } - resolve(context, currentChord, keypress) { - this._log(`| Resolving ${keypress}${currentChord ? ` chorded from ${currentChord}` : ``}`); - let lookupMap = null; - if (currentChord !== null) { - // Fetch all chord bindings for `currentChord` - const candidates = this._map.get(currentChord); - if (typeof candidates === 'undefined') { - // No chords starting with `currentChord` - this._log(`\\ No keybinding entries.`); - return null; - } - lookupMap = []; - for (let i = 0, len = candidates.length; i < len; i++) { - let candidate = candidates[i]; - // TODO@chords - if (candidate.keypressParts[1] === keypress) { - lookupMap.push(candidate); - } - } - } - else { - const candidates = this._map.get(keypress); - if (typeof candidates === 'undefined') { - // No bindings with `keypress` - this._log(`\\ No keybinding entries.`); - return null; - } - lookupMap = candidates; - } - let result = this._findCommand(context, lookupMap); - if (!result) { - this._log(`\\ From ${lookupMap.length} keybinding entries, no when clauses matched the context.`); - return null; - } - // TODO@chords - if (currentChord === null && result.keypressParts.length > 1 && result.keypressParts[1] !== null) { - this._log(`\\ From ${lookupMap.length} keybinding entries, matched chord, when: ${printWhenExplanation(result.when)}, source: ${printSourceExplanation(result)}.`); - return { - enterChord: true, - leaveChord: false, - commandId: null, - commandArgs: null, - bubble: false - }; - } - this._log(`\\ From ${lookupMap.length} keybinding entries, matched ${result.command}, when: ${printWhenExplanation(result.when)}, source: ${printSourceExplanation(result)}.`); - return { - enterChord: false, - leaveChord: result.keypressParts.length > 1, - commandId: result.command, - commandArgs: result.commandArgs, - bubble: result.bubble - }; - } - _findCommand(context, matches) { - for (let i = matches.length - 1; i >= 0; i--) { - let k = matches[i]; - if (!KeybindingResolver.contextMatchesRules(context, k.when)) { - continue; - } - return k; - } - return null; - } - static contextMatchesRules(context, rules) { - if (!rules) { - return true; - } - return rules.evaluate(context); - } -} -function printWhenExplanation(when) { - if (!when) { - return `no when condition`; - } - return `${when.serialize()}`; -} -function printSourceExplanation(kb) { - if (kb.isDefault) { - if (kb.extensionId) { - return `built-in extension ${kb.extensionId}`; - } - return `built-in`; - } - if (kb.extensionId) { - return `user extension ${kb.extensionId}`; - } - return `user`; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js": -/*!*********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js ***! - \*********************************************************************************************/ -/*! exports provided: KeybindingsRegistry, Extensions */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeybindingsRegistry", function() { return KeybindingsRegistry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Extensions", function() { return Extensions; }); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -class KeybindingsRegistryImpl { - constructor() { - this._coreKeybindings = []; - this._extensionKeybindings = []; - this._cachedMergedKeybindings = null; - } - /** - * Take current platform into account and reduce to primary & secondary. - */ - static bindToCurrentPlatform(kb) { - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["OS"] === 1 /* Windows */) { - if (kb && kb.win) { - return kb.win; - } - } - else if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["OS"] === 2 /* Macintosh */) { - if (kb && kb.mac) { - return kb.mac; - } - } - else { - if (kb && kb.linux) { - return kb.linux; - } - } - return kb; - } - registerKeybindingRule(rule) { - const actualKb = KeybindingsRegistryImpl.bindToCurrentPlatform(rule); - if (actualKb && actualKb.primary) { - const kk = Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_0__["createKeybinding"])(actualKb.primary, _base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["OS"]); - if (kk) { - this._registerDefaultKeybinding(kk, rule.id, rule.args, rule.weight, 0, rule.when); - } - } - if (actualKb && Array.isArray(actualKb.secondary)) { - for (let i = 0, len = actualKb.secondary.length; i < len; i++) { - const k = actualKb.secondary[i]; - const kk = Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_0__["createKeybinding"])(k, _base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["OS"]); - if (kk) { - this._registerDefaultKeybinding(kk, rule.id, rule.args, rule.weight, -i - 1, rule.when); - } - } - } - } - registerCommandAndKeybindingRule(desc) { - this.registerKeybindingRule(desc); - _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_2__["CommandsRegistry"].registerCommand(desc); - } - static _mightProduceChar(keyCode) { - if (keyCode >= 21 /* KEY_0 */ && keyCode <= 30 /* KEY_9 */) { - return true; - } - if (keyCode >= 31 /* KEY_A */ && keyCode <= 56 /* KEY_Z */) { - return true; - } - return (keyCode === 80 /* US_SEMICOLON */ - || keyCode === 81 /* US_EQUAL */ - || keyCode === 82 /* US_COMMA */ - || keyCode === 83 /* US_MINUS */ - || keyCode === 84 /* US_DOT */ - || keyCode === 85 /* US_SLASH */ - || keyCode === 86 /* US_BACKTICK */ - || keyCode === 110 /* ABNT_C1 */ - || keyCode === 111 /* ABNT_C2 */ - || keyCode === 87 /* US_OPEN_SQUARE_BRACKET */ - || keyCode === 88 /* US_BACKSLASH */ - || keyCode === 89 /* US_CLOSE_SQUARE_BRACKET */ - || keyCode === 90 /* US_QUOTE */ - || keyCode === 91 /* OEM_8 */ - || keyCode === 92 /* OEM_102 */); - } - _assertNoCtrlAlt(keybinding, commandId) { - if (keybinding.ctrlKey && keybinding.altKey && !keybinding.metaKey) { - if (KeybindingsRegistryImpl._mightProduceChar(keybinding.keyCode)) { - console.warn('Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ', keybinding, ' for ', commandId); - } - } - } - _registerDefaultKeybinding(keybinding, commandId, commandArgs, weight1, weight2, when) { - if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_1__["OS"] === 1 /* Windows */) { - this._assertNoCtrlAlt(keybinding.parts[0], commandId); - } - this._coreKeybindings.push({ - keybinding: keybinding, - command: commandId, - commandArgs: commandArgs, - when: when, - weight1: weight1, - weight2: weight2, - extensionId: null - }); - this._cachedMergedKeybindings = null; - } - getDefaultKeybindings() { - if (!this._cachedMergedKeybindings) { - this._cachedMergedKeybindings = [].concat(this._coreKeybindings).concat(this._extensionKeybindings); - this._cachedMergedKeybindings.sort(sorter); - } - return this._cachedMergedKeybindings.slice(0); - } -} -const KeybindingsRegistry = new KeybindingsRegistryImpl(); -// Define extension point ids -const Extensions = { - EditorModes: 'platform.keybindingsRegistry' -}; -_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_3__["Registry"].add(Extensions.EditorModes, KeybindingsRegistry); -function sorter(a, b) { - if (a.weight1 !== b.weight1) { - return a.weight1 - b.weight1; - } - if (a.command < b.command) { - return -1; - } - if (a.command > b.command) { - return 1; - } - return a.weight2 - b.weight2; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/resolvedKeybindingItem.js": -/*!************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/keybinding/common/resolvedKeybindingItem.js ***! - \************************************************************************************************/ -/*! exports provided: ResolvedKeybindingItem, removeElementsAfterNulls */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybindingItem", function() { return ResolvedKeybindingItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeElementsAfterNulls", function() { return removeElementsAfterNulls; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class ResolvedKeybindingItem { - constructor(resolvedKeybinding, command, commandArgs, when, isDefault, extensionId) { - this.resolvedKeybinding = resolvedKeybinding; - this.keypressParts = resolvedKeybinding ? removeElementsAfterNulls(resolvedKeybinding.getDispatchParts()) : []; - this.bubble = (command ? command.charCodeAt(0) === 94 /* Caret */ : false); - this.command = this.bubble ? command.substr(1) : command; - this.commandArgs = commandArgs; - this.when = when; - this.isDefault = isDefault; - this.extensionId = extensionId; - } -} -function removeElementsAfterNulls(arr) { - let result = []; - for (let i = 0, len = arr.length; i < len; i++) { - const element = arr[i]; - if (!element) { - // stop processing at first encountered null - return result; - } - result.push(element); - } - return result; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/usLayoutResolvedKeybinding.js": -/*!****************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/keybinding/common/usLayoutResolvedKeybinding.js ***! - \****************************************************************************************************/ -/*! exports provided: USLayoutResolvedKeybinding */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USLayoutResolvedKeybinding", function() { return USLayoutResolvedKeybinding; }); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _baseResolvedKeybinding_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./baseResolvedKeybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/baseResolvedKeybinding.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -/** - * Do not instantiate. Use KeybindingService to get a ResolvedKeybinding seeded with information about the current kb layout. - */ -class USLayoutResolvedKeybinding extends _baseResolvedKeybinding_js__WEBPACK_IMPORTED_MODULE_1__["BaseResolvedKeybinding"] { - constructor(actual, os) { - super(os, actual.parts); - } - _keyCodeToUILabel(keyCode) { - if (this._os === 2 /* Macintosh */) { - switch (keyCode) { - case 15 /* LeftArrow */: - return '←'; - case 16 /* UpArrow */: - return '↑'; - case 17 /* RightArrow */: - return '→'; - case 18 /* DownArrow */: - return '↓'; - } - } - return _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_0__["KeyCodeUtils"].toString(keyCode); - } - _getLabel(keybinding) { - if (keybinding.isDuplicateModifierCase()) { - return ''; - } - return this._keyCodeToUILabel(keybinding.keyCode); - } - _getAriaLabel(keybinding) { - if (keybinding.isDuplicateModifierCase()) { - return ''; - } - return _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_0__["KeyCodeUtils"].toString(keybinding.keyCode); - } - _getDispatchPart(keybinding) { - return USLayoutResolvedKeybinding.getDispatchStr(keybinding); - } - static getDispatchStr(keybinding) { - if (keybinding.isModifierKey()) { - return null; - } - let result = ''; - if (keybinding.ctrlKey) { - result += 'ctrl+'; - } - if (keybinding.shiftKey) { - result += 'shift+'; - } - if (keybinding.altKey) { - result += 'alt+'; - } - if (keybinding.metaKey) { - result += 'meta+'; - } - result += _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_0__["KeyCodeUtils"].toString(keybinding.keyCode); - return result; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/label/common/label.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/label/common/label.js ***! - \**************************************************************************/ -/*! exports provided: ILabelService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ILabelService", function() { return ILabelService; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const ILabelService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('labelService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/layout/browser/layoutService.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/layout/browser/layoutService.js ***! - \************************************************************************************/ -/*! exports provided: ILayoutService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ILayoutService", function() { return ILayoutService; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const ILayoutService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('layoutService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/list/browser/listService.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/list/browser/listService.js ***! - \********************************************************************************/ -/*! exports provided: IListService, ListService, WorkbenchListSupportsMultiSelectContextKey, WorkbenchListFocusContextKey, WorkbenchListHasSelectionOrFocus, WorkbenchListDoubleSelection, WorkbenchListMultiSelection, WorkbenchListSupportsKeyboardNavigation, WorkbenchListAutomaticKeyboardNavigationKey, WorkbenchListAutomaticKeyboardNavigation, didBindWorkbenchListAutomaticKeyboardNavigation, multiSelectModifierSettingKey, openModeSettingKey, horizontalScrollingKey, keyboardNavigationSettingKey, automaticKeyboardNavigationSettingKey, WorkbenchList, WorkbenchPagedList, WorkbenchObjectTree, WorkbenchCompressibleObjectTree, WorkbenchDataTree, WorkbenchAsyncDataTree, WorkbenchCompressibleAsyncDataTree */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IListService", function() { return IListService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListService", function() { return ListService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchListSupportsMultiSelectContextKey", function() { return WorkbenchListSupportsMultiSelectContextKey; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchListFocusContextKey", function() { return WorkbenchListFocusContextKey; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchListHasSelectionOrFocus", function() { return WorkbenchListHasSelectionOrFocus; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchListDoubleSelection", function() { return WorkbenchListDoubleSelection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchListMultiSelection", function() { return WorkbenchListMultiSelection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchListSupportsKeyboardNavigation", function() { return WorkbenchListSupportsKeyboardNavigation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchListAutomaticKeyboardNavigationKey", function() { return WorkbenchListAutomaticKeyboardNavigationKey; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchListAutomaticKeyboardNavigation", function() { return WorkbenchListAutomaticKeyboardNavigation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "didBindWorkbenchListAutomaticKeyboardNavigation", function() { return didBindWorkbenchListAutomaticKeyboardNavigation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiSelectModifierSettingKey", function() { return multiSelectModifierSettingKey; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openModeSettingKey", function() { return openModeSettingKey; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "horizontalScrollingKey", function() { return horizontalScrollingKey; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyboardNavigationSettingKey", function() { return keyboardNavigationSettingKey; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "automaticKeyboardNavigationSettingKey", function() { return automaticKeyboardNavigationSettingKey; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchList", function() { return WorkbenchList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchPagedList", function() { return WorkbenchPagedList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchObjectTree", function() { return WorkbenchObjectTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchCompressibleObjectTree", function() { return WorkbenchCompressibleObjectTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchDataTree", function() { return WorkbenchDataTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchAsyncDataTree", function() { return WorkbenchAsyncDataTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkbenchCompressibleAsyncDataTree", function() { return WorkbenchCompressibleAsyncDataTree; }); -/* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/dom.js */ "./node_modules/monaco-editor/esm/vs/base/browser/dom.js"); -/* harmony import */ var _base_browser_ui_list_listPaging_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/ui/list/listPaging.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listPaging.js"); -/* harmony import */ var _base_browser_ui_list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/browser/ui/list/listWidget.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/list/listWidget.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/* harmony import */ var _configuration_common_configurationRegistry_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../configuration/common/configurationRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js"); -/* harmony import */ var _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _theme_common_styler_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../theme/common/styler.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/styler.js"); -/* harmony import */ var _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _contextkey_common_contextkeys_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../contextkey/common/contextkeys.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkeys.js"); -/* harmony import */ var _base_browser_ui_tree_objectTree_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../base/browser/ui/tree/objectTree.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/objectTree.js"); -/* harmony import */ var _base_browser_ui_tree_asyncDataTree_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../base/browser/ui/tree/asyncDataTree.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/asyncDataTree.js"); -/* harmony import */ var _base_browser_ui_tree_dataTree_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../base/browser/ui/tree/dataTree.js */ "./node_modules/monaco-editor/esm/vs/base/browser/ui/tree/dataTree.js"); -/* harmony import */ var _accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../accessibility/common/accessibility.js */ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - - - - - - - - - -const IListService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_9__["createDecorator"])('listService'); -let ListService = class ListService { - constructor(_themeService) { - this._themeService = _themeService; - this.disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - this.lists = []; - this._lastFocusedWidget = undefined; - this._hasCreatedStyleController = false; - } - get lastFocusedList() { - return this._lastFocusedWidget; - } - register(widget, extraContextKeys) { - if (!this._hasCreatedStyleController) { - this._hasCreatedStyleController = true; - // create a shared default tree style sheet for performance reasons - const styleController = new _base_browser_ui_list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__["DefaultStyleController"](Object(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_0__["createStyleSheet"])(), ''); - this.disposables.add(Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_12__["attachListStyler"])(styleController, this._themeService)); - } - if (this.lists.some(l => l.widget === widget)) { - throw new Error('Cannot register the same widget multiple times'); - } - // Keep in our lists list - const registeredList = { widget, extraContextKeys }; - this.lists.push(registeredList); - // Check for currently being focused - if (widget.getHTMLElement() === document.activeElement) { - this._lastFocusedWidget = widget; - } - return Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["combinedDisposable"])(widget.onDidFocus(() => this._lastFocusedWidget = widget), Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["toDisposable"])(() => this.lists.splice(this.lists.indexOf(registeredList), 1)), widget.onDidDispose(() => { - this.lists = this.lists.filter(l => l !== registeredList); - if (this._lastFocusedWidget === widget) { - this._lastFocusedWidget = undefined; - } - })); - } - dispose() { - this.disposables.dispose(); - } -}; -ListService = __decorate([ - __param(0, _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__["IThemeService"]) -], ListService); - -const RawWorkbenchListFocusContextKey = new _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["RawContextKey"]('listFocus', true); -const WorkbenchListSupportsMultiSelectContextKey = new _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["RawContextKey"]('listSupportsMultiselect', true); -const WorkbenchListFocusContextKey = _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["ContextKeyExpr"].and(RawWorkbenchListFocusContextKey, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["ContextKeyExpr"].not(_contextkey_common_contextkeys_js__WEBPACK_IMPORTED_MODULE_14__["InputFocusedContextKey"])); -const WorkbenchListHasSelectionOrFocus = new _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["RawContextKey"]('listHasSelectionOrFocus', false); -const WorkbenchListDoubleSelection = new _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["RawContextKey"]('listDoubleSelection', false); -const WorkbenchListMultiSelection = new _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["RawContextKey"]('listMultiSelection', false); -const WorkbenchListSupportsKeyboardNavigation = new _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["RawContextKey"]('listSupportsKeyboardNavigation', true); -const WorkbenchListAutomaticKeyboardNavigationKey = 'listAutomaticKeyboardNavigation'; -const WorkbenchListAutomaticKeyboardNavigation = new _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["RawContextKey"](WorkbenchListAutomaticKeyboardNavigationKey, true); -let didBindWorkbenchListAutomaticKeyboardNavigation = false; -function createScopedContextKeyService(contextKeyService, widget) { - const result = contextKeyService.createScoped(widget.getHTMLElement()); - RawWorkbenchListFocusContextKey.bindTo(result); - return result; -} -const multiSelectModifierSettingKey = 'workbench.list.multiSelectModifier'; -const openModeSettingKey = 'workbench.list.openMode'; -const horizontalScrollingKey = 'workbench.list.horizontalScrolling'; -const keyboardNavigationSettingKey = 'workbench.list.keyboardNavigation'; -const automaticKeyboardNavigationSettingKey = 'workbench.list.automaticKeyboardNavigation'; -const treeIndentKey = 'workbench.tree.indent'; -const treeRenderIndentGuidesKey = 'workbench.tree.renderIndentGuides'; -const listSmoothScrolling = 'workbench.list.smoothScrolling'; -function useAltAsMultipleSelectionModifier(configurationService) { - return configurationService.getValue(multiSelectModifierSettingKey) === 'alt'; -} -class MultipleSelectionController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["Disposable"] { - constructor(configurationService) { - super(); - this.configurationService = configurationService; - this.useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); - this.registerListeners(); - } - registerListeners() { - this._register(this.configurationService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration(multiSelectModifierSettingKey)) { - this.useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(this.configurationService); - } - })); - } - isSelectionSingleChangeEvent(event) { - if (this.useAltAsMultipleSelectionModifier) { - return event.browserEvent.altKey; - } - return Object(_base_browser_ui_list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__["isSelectionSingleChangeEvent"])(event); - } - isSelectionRangeChangeEvent(event) { - return Object(_base_browser_ui_list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__["isSelectionRangeChangeEvent"])(event); - } -} -function toWorkbenchListOptions(options, configurationService, keybindingService) { - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - const result = Object.assign({}, options); - if (options.multipleSelectionSupport !== false && !options.multipleSelectionController) { - const multipleSelectionController = new MultipleSelectionController(configurationService); - result.multipleSelectionController = multipleSelectionController; - disposables.add(multipleSelectionController); - } - result.keyboardNavigationDelegate = { - mightProducePrintableCharacter(e) { - return keybindingService.mightProducePrintableCharacter(e); - } - }; - result.smoothScrolling = configurationService.getValue(listSmoothScrolling); - return [result, disposables]; -} -let WorkbenchList = class WorkbenchList extends _base_browser_ui_list_listWidget_js__WEBPACK_IMPORTED_MODULE_2__["List"] { - constructor(user, container, delegate, renderers, options, contextKeyService, listService, themeService, configurationService, keybindingService) { - const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); - const [workbenchListOptions, workbenchListOptionsDisposable] = toWorkbenchListOptions(options, configurationService, keybindingService); - super(user, container, delegate, renderers, Object.assign(Object.assign(Object.assign({ keyboardSupport: false }, Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_12__["computeStyles"])(themeService.getColorTheme(), _theme_common_styler_js__WEBPACK_IMPORTED_MODULE_12__["defaultListStyles"])), workbenchListOptions), { horizontalScrolling })); - this.disposables.add(workbenchListOptionsDisposable); - this.contextKeyService = createScopedContextKeyService(contextKeyService, this); - this.themeService = themeService; - const listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService); - listSupportsMultiSelect.set(!(options.multipleSelectionSupport === false)); - this.listHasSelectionOrFocus = WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService); - this.listDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService); - this.listMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService); - this.horizontalScrolling = options.horizontalScrolling; - this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); - this.disposables.add(this.contextKeyService); - this.disposables.add(listService.register(this)); - if (options.overrideStyles) { - this.updateStyles(options.overrideStyles); - } - this.disposables.add(this.onDidChangeSelection(() => { - const selection = this.getSelection(); - const focus = this.getFocus(); - this.contextKeyService.bufferChangeEvents(() => { - this.listHasSelectionOrFocus.set(selection.length > 0 || focus.length > 0); - this.listMultiSelection.set(selection.length > 1); - this.listDoubleSelection.set(selection.length === 2); - }); - })); - this.disposables.add(this.onDidChangeFocus(() => { - const selection = this.getSelection(); - const focus = this.getFocus(); - this.listHasSelectionOrFocus.set(selection.length > 0 || focus.length > 0); - })); - this.disposables.add(configurationService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration(multiSelectModifierSettingKey)) { - this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); - } - let options = {}; - if (e.affectsConfiguration(horizontalScrollingKey) && this.horizontalScrolling === undefined) { - const horizontalScrolling = configurationService.getValue(horizontalScrollingKey); - options = Object.assign(Object.assign({}, options), { horizontalScrolling }); - } - if (e.affectsConfiguration(listSmoothScrolling)) { - const smoothScrolling = configurationService.getValue(listSmoothScrolling); - options = Object.assign(Object.assign({}, options), { smoothScrolling }); - } - if (Object.keys(options).length > 0) { - this.updateOptions(options); - } - })); - } - updateOptions(options) { - super.updateOptions(options); - if (options.overrideStyles) { - this.updateStyles(options.overrideStyles); - } - } - dispose() { - super.dispose(); - if (this._styler) { - this._styler.dispose(); - } - } - updateStyles(styles) { - if (this._styler) { - this._styler.dispose(); - } - this._styler = Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_12__["attachListStyler"])(this, this.themeService, styles); - } -}; -WorkbenchList = __decorate([ - __param(5, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["IContextKeyService"]), - __param(6, IListService), - __param(7, _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__["IThemeService"]), - __param(8, _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__["IConfigurationService"]), - __param(9, _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__["IKeybindingService"]) -], WorkbenchList); - -let WorkbenchPagedList = class WorkbenchPagedList extends _base_browser_ui_list_listPaging_js__WEBPACK_IMPORTED_MODULE_1__["PagedList"] { - constructor(user, container, delegate, renderers, options, contextKeyService, listService, themeService, configurationService, keybindingService) { - const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); - const [workbenchListOptions, workbenchListOptionsDisposable] = toWorkbenchListOptions(options, configurationService, keybindingService); - super(user, container, delegate, renderers, Object.assign(Object.assign(Object.assign({ keyboardSupport: false }, Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_12__["computeStyles"])(themeService.getColorTheme(), _theme_common_styler_js__WEBPACK_IMPORTED_MODULE_12__["defaultListStyles"])), workbenchListOptions), { horizontalScrolling })); - this.disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - this.disposables.add(workbenchListOptionsDisposable); - this.contextKeyService = createScopedContextKeyService(contextKeyService, this); - this.horizontalScrolling = options.horizontalScrolling; - const listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService); - listSupportsMultiSelect.set(!(options.multipleSelectionSupport === false)); - this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); - this.disposables.add(this.contextKeyService); - this.disposables.add(listService.register(this)); - if (options.overrideStyles) { - this.disposables.add(Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_12__["attachListStyler"])(this, themeService, options.overrideStyles)); - } - this.disposables.add(configurationService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration(multiSelectModifierSettingKey)) { - this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); - } - let options = {}; - if (e.affectsConfiguration(horizontalScrollingKey) && this.horizontalScrolling === undefined) { - const horizontalScrolling = configurationService.getValue(horizontalScrollingKey); - options = Object.assign(Object.assign({}, options), { horizontalScrolling }); - } - if (e.affectsConfiguration(listSmoothScrolling)) { - const smoothScrolling = configurationService.getValue(listSmoothScrolling); - options = Object.assign(Object.assign({}, options), { smoothScrolling }); - } - if (Object.keys(options).length > 0) { - this.updateOptions(options); - } - })); - } - dispose() { - super.dispose(); - this.disposables.dispose(); - } -}; -WorkbenchPagedList = __decorate([ - __param(5, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["IContextKeyService"]), - __param(6, IListService), - __param(7, _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__["IThemeService"]), - __param(8, _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__["IConfigurationService"]), - __param(9, _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__["IKeybindingService"]) -], WorkbenchPagedList); - -class ResourceNavigator extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["Disposable"] { - constructor(widget, options) { - var _a, _b; - super(); - this.widget = widget; - this._onDidOpen = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - this.onDidOpen = this._onDidOpen.event; - this.openOnFocus = (_a = options === null || options === void 0 ? void 0 : options.openOnFocus) !== null && _a !== void 0 ? _a : false; - this._register(_base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Event"].filter(this.widget.onDidChangeSelection, e => e.browserEvent instanceof KeyboardEvent)(e => this.onSelectionFromKeyboard(e))); - this._register(this.widget.onPointer((e) => this.onPointer(e.browserEvent))); - this._register(this.widget.onMouseDblClick((e) => this.onMouseDblClick(e.browserEvent))); - if (this.openOnFocus) { - this._register(_base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Event"].filter(this.widget.onDidChangeFocus, e => e.browserEvent instanceof KeyboardEvent)(e => this.onFocusFromKeyboard(e))); - } - if (typeof (options === null || options === void 0 ? void 0 : options.openOnSingleClick) !== 'boolean' && (options === null || options === void 0 ? void 0 : options.configurationService)) { - this.openOnSingleClick = (options === null || options === void 0 ? void 0 : options.configurationService.getValue(openModeSettingKey)) !== 'doubleClick'; - this._register(options === null || options === void 0 ? void 0 : options.configurationService.onDidChangeConfiguration(() => { - this.openOnSingleClick = (options === null || options === void 0 ? void 0 : options.configurationService.getValue(openModeSettingKey)) !== 'doubleClick'; - })); - } - else { - this.openOnSingleClick = (_b = options === null || options === void 0 ? void 0 : options.openOnSingleClick) !== null && _b !== void 0 ? _b : true; - } - } - onFocusFromKeyboard(event) { - const focus = this.widget.getFocus(); - this.widget.setSelection(focus, event.browserEvent); - const preserveFocus = typeof event.browserEvent.preserveFocus === 'boolean' ? event.browserEvent.preserveFocus : true; - const pinned = false; - const sideBySide = false; - this._open(preserveFocus, pinned, sideBySide, event.browserEvent); - } - onSelectionFromKeyboard(event) { - if (event.elements.length !== 1) { - return; - } - const preserveFocus = typeof event.browserEvent.preserveFocus === 'boolean' ? event.browserEvent.preserveFocus : true; - const pinned = false; - const sideBySide = false; - this._open(preserveFocus, pinned, sideBySide, event.browserEvent); - } - onPointer(browserEvent) { - if (!this.openOnSingleClick) { - return; - } - const isDoubleClick = browserEvent.detail === 2; - if (isDoubleClick) { - return; - } - const isMiddleClick = browserEvent.button === 1; - const preserveFocus = true; - const pinned = isMiddleClick; - const sideBySide = browserEvent.ctrlKey || browserEvent.metaKey || browserEvent.altKey; - this._open(preserveFocus, pinned, sideBySide, browserEvent); - } - onMouseDblClick(browserEvent) { - if (!browserEvent) { - return; - } - const preserveFocus = false; - const pinned = true; - const sideBySide = (browserEvent.ctrlKey || browserEvent.metaKey || browserEvent.altKey); - this._open(preserveFocus, pinned, sideBySide, browserEvent); - } - _open(preserveFocus, pinned, sideBySide, browserEvent) { - this._onDidOpen.fire({ - editorOptions: { - preserveFocus, - pinned, - revealIfVisible: true - }, - sideBySide, - element: this.widget.getSelection()[0], - browserEvent - }); - } -} -class TreeResourceNavigator extends ResourceNavigator { - constructor(tree, options) { - super(tree, options); - } -} -function createKeyboardNavigationEventFilter(container, keybindingService) { - let inChord = false; - return event => { - if (inChord) { - inChord = false; - return false; - } - const result = keybindingService.softDispatch(event, container); - if (result && result.enterChord) { - inChord = true; - return false; - } - inChord = false; - return true; - }; -} -let WorkbenchObjectTree = class WorkbenchObjectTree extends _base_browser_ui_tree_objectTree_js__WEBPACK_IMPORTED_MODULE_15__["ObjectTree"] { - constructor(user, container, delegate, renderers, options, contextKeyService, listService, themeService, configurationService, keybindingService, accessibilityService) { - const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble(container, options, contextKeyService, configurationService, keybindingService, accessibilityService); - super(user, container, delegate, renderers, treeOptions); - this.disposables.add(disposable); - this.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService); - this.disposables.add(this.internals); - } -}; -WorkbenchObjectTree = __decorate([ - __param(5, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["IContextKeyService"]), - __param(6, IListService), - __param(7, _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__["IThemeService"]), - __param(8, _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__["IConfigurationService"]), - __param(9, _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__["IKeybindingService"]), - __param(10, _accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_18__["IAccessibilityService"]) -], WorkbenchObjectTree); - -let WorkbenchCompressibleObjectTree = class WorkbenchCompressibleObjectTree extends _base_browser_ui_tree_objectTree_js__WEBPACK_IMPORTED_MODULE_15__["CompressibleObjectTree"] { - constructor(user, container, delegate, renderers, options, contextKeyService, listService, themeService, configurationService, keybindingService, accessibilityService) { - const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble(container, options, contextKeyService, configurationService, keybindingService, accessibilityService); - super(user, container, delegate, renderers, treeOptions); - this.disposables.add(disposable); - this.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService); - this.disposables.add(this.internals); - } - updateOptions(options = {}) { - super.updateOptions(options); - if (options.overrideStyles) { - this.internals.updateStyleOverrides(options.overrideStyles); - } - } -}; -WorkbenchCompressibleObjectTree = __decorate([ - __param(5, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["IContextKeyService"]), - __param(6, IListService), - __param(7, _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__["IThemeService"]), - __param(8, _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__["IConfigurationService"]), - __param(9, _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__["IKeybindingService"]), - __param(10, _accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_18__["IAccessibilityService"]) -], WorkbenchCompressibleObjectTree); - -let WorkbenchDataTree = class WorkbenchDataTree extends _base_browser_ui_tree_dataTree_js__WEBPACK_IMPORTED_MODULE_17__["DataTree"] { - constructor(user, container, delegate, renderers, dataSource, options, contextKeyService, listService, themeService, configurationService, keybindingService, accessibilityService) { - const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble(container, options, contextKeyService, configurationService, keybindingService, accessibilityService); - super(user, container, delegate, renderers, dataSource, treeOptions); - this.disposables.add(disposable); - this.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService); - this.disposables.add(this.internals); - } - updateOptions(options = {}) { - super.updateOptions(options); - if (options.overrideStyles) { - this.internals.updateStyleOverrides(options.overrideStyles); - } - } -}; -WorkbenchDataTree = __decorate([ - __param(6, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["IContextKeyService"]), - __param(7, IListService), - __param(8, _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__["IThemeService"]), - __param(9, _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__["IConfigurationService"]), - __param(10, _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__["IKeybindingService"]), - __param(11, _accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_18__["IAccessibilityService"]) -], WorkbenchDataTree); - -let WorkbenchAsyncDataTree = class WorkbenchAsyncDataTree extends _base_browser_ui_tree_asyncDataTree_js__WEBPACK_IMPORTED_MODULE_16__["AsyncDataTree"] { - constructor(user, container, delegate, renderers, dataSource, options, contextKeyService, listService, themeService, configurationService, keybindingService, accessibilityService) { - const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble(container, options, contextKeyService, configurationService, keybindingService, accessibilityService); - super(user, container, delegate, renderers, dataSource, treeOptions); - this.disposables.add(disposable); - this.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService); - this.disposables.add(this.internals); - } - get onDidOpen() { return this.internals.onDidOpen; } - updateOptions(options = {}) { - super.updateOptions(options); - if (options.overrideStyles) { - this.internals.updateStyleOverrides(options.overrideStyles); - } - } -}; -WorkbenchAsyncDataTree = __decorate([ - __param(6, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["IContextKeyService"]), - __param(7, IListService), - __param(8, _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__["IThemeService"]), - __param(9, _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__["IConfigurationService"]), - __param(10, _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__["IKeybindingService"]), - __param(11, _accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_18__["IAccessibilityService"]) -], WorkbenchAsyncDataTree); - -let WorkbenchCompressibleAsyncDataTree = class WorkbenchCompressibleAsyncDataTree extends _base_browser_ui_tree_asyncDataTree_js__WEBPACK_IMPORTED_MODULE_16__["CompressibleAsyncDataTree"] { - constructor(user, container, virtualDelegate, compressionDelegate, renderers, dataSource, options, contextKeyService, listService, themeService, configurationService, keybindingService, accessibilityService) { - const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble(container, options, contextKeyService, configurationService, keybindingService, accessibilityService); - super(user, container, virtualDelegate, compressionDelegate, renderers, dataSource, treeOptions); - this.disposables.add(disposable); - this.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService); - this.disposables.add(this.internals); - } -}; -WorkbenchCompressibleAsyncDataTree = __decorate([ - __param(7, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["IContextKeyService"]), - __param(8, IListService), - __param(9, _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__["IThemeService"]), - __param(10, _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__["IConfigurationService"]), - __param(11, _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_10__["IKeybindingService"]), - __param(12, _accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_18__["IAccessibilityService"]) -], WorkbenchCompressibleAsyncDataTree); - -function workbenchTreeDataPreamble(container, options, contextKeyService, configurationService, keybindingService, accessibilityService) { - WorkbenchListSupportsKeyboardNavigation.bindTo(contextKeyService); - if (!didBindWorkbenchListAutomaticKeyboardNavigation) { - WorkbenchListAutomaticKeyboardNavigation.bindTo(contextKeyService); - didBindWorkbenchListAutomaticKeyboardNavigation = true; - } - const getAutomaticKeyboardNavigation = () => { - // give priority to the context key value to disable this completely - let automaticKeyboardNavigation = contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey); - if (automaticKeyboardNavigation) { - automaticKeyboardNavigation = configurationService.getValue(automaticKeyboardNavigationSettingKey); - } - return automaticKeyboardNavigation; - }; - const accessibilityOn = accessibilityService.isScreenReaderOptimized(); - const keyboardNavigation = accessibilityOn ? 'simple' : configurationService.getValue(keyboardNavigationSettingKey); - const horizontalScrolling = options.horizontalScrolling !== undefined ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); - const [workbenchListOptions, disposable] = toWorkbenchListOptions(options, configurationService, keybindingService); - const additionalScrollHeight = options.additionalScrollHeight; - return { - getAutomaticKeyboardNavigation, - disposable, - options: Object.assign(Object.assign({ - // ...options, // TODO@Joao why is this not splatted here? - keyboardSupport: false }, workbenchListOptions), { indent: configurationService.getValue(treeIndentKey), renderIndentGuides: configurationService.getValue(treeRenderIndentGuidesKey), smoothScrolling: configurationService.getValue(listSmoothScrolling), automaticKeyboardNavigation: getAutomaticKeyboardNavigation(), simpleKeyboardNavigation: keyboardNavigation === 'simple', filterOnType: keyboardNavigation === 'filter', horizontalScrolling, keyboardNavigationEventFilter: createKeyboardNavigationEventFilter(container, keybindingService), additionalScrollHeight, hideTwistiesOfChildlessElements: options.hideTwistiesOfChildlessElements, expandOnlyOnDoubleClick: configurationService.getValue(openModeSettingKey) === 'doubleClick' }) - }; -} -let WorkbenchTreeInternals = class WorkbenchTreeInternals { - constructor(tree, options, getAutomaticKeyboardNavigation, overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService) { - this.tree = tree; - this.themeService = themeService; - this.disposables = []; - this.contextKeyService = createScopedContextKeyService(contextKeyService, tree); - const listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService); - listSupportsMultiSelect.set(!(options.multipleSelectionSupport === false)); - this.hasSelectionOrFocus = WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService); - this.hasDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService); - this.hasMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService); - this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); - const interestingContextKeys = new Set(); - interestingContextKeys.add(WorkbenchListAutomaticKeyboardNavigationKey); - const updateKeyboardNavigation = () => { - const accessibilityOn = accessibilityService.isScreenReaderOptimized(); - const keyboardNavigation = accessibilityOn ? 'simple' : configurationService.getValue(keyboardNavigationSettingKey); - tree.updateOptions({ - simpleKeyboardNavigation: keyboardNavigation === 'simple', - filterOnType: keyboardNavigation === 'filter' - }); - }; - this.updateStyleOverrides(overrideStyles); - this.disposables.push(this.contextKeyService, listService.register(tree), tree.onDidChangeSelection(() => { - const selection = tree.getSelection(); - const focus = tree.getFocus(); - this.contextKeyService.bufferChangeEvents(() => { - this.hasSelectionOrFocus.set(selection.length > 0 || focus.length > 0); - this.hasMultiSelection.set(selection.length > 1); - this.hasDoubleSelection.set(selection.length === 2); - }); - }), tree.onDidChangeFocus(() => { - const selection = tree.getSelection(); - const focus = tree.getFocus(); - this.hasSelectionOrFocus.set(selection.length > 0 || focus.length > 0); - }), configurationService.onDidChangeConfiguration(e => { - let newOptions = {}; - if (e.affectsConfiguration(multiSelectModifierSettingKey)) { - this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); - } - if (e.affectsConfiguration(treeIndentKey)) { - const indent = configurationService.getValue(treeIndentKey); - newOptions = Object.assign(Object.assign({}, newOptions), { indent }); - } - if (e.affectsConfiguration(treeRenderIndentGuidesKey)) { - const renderIndentGuides = configurationService.getValue(treeRenderIndentGuidesKey); - newOptions = Object.assign(Object.assign({}, newOptions), { renderIndentGuides }); - } - if (e.affectsConfiguration(listSmoothScrolling)) { - const smoothScrolling = configurationService.getValue(listSmoothScrolling); - newOptions = Object.assign(Object.assign({}, newOptions), { smoothScrolling }); - } - if (e.affectsConfiguration(keyboardNavigationSettingKey)) { - updateKeyboardNavigation(); - } - if (e.affectsConfiguration(automaticKeyboardNavigationSettingKey)) { - newOptions = Object.assign(Object.assign({}, newOptions), { automaticKeyboardNavigation: getAutomaticKeyboardNavigation() }); - } - if (e.affectsConfiguration(horizontalScrollingKey) && options.horizontalScrolling === undefined) { - const horizontalScrolling = configurationService.getValue(horizontalScrollingKey); - newOptions = Object.assign(Object.assign({}, newOptions), { horizontalScrolling }); - } - if (e.affectsConfiguration(openModeSettingKey)) { - newOptions = Object.assign(Object.assign({}, newOptions), { expandOnlyOnDoubleClick: configurationService.getValue(openModeSettingKey) === 'doubleClick' }); - } - if (Object.keys(newOptions).length > 0) { - tree.updateOptions(newOptions); - } - }), this.contextKeyService.onDidChangeContext(e => { - if (e.affectsSome(interestingContextKeys)) { - tree.updateOptions({ automaticKeyboardNavigation: getAutomaticKeyboardNavigation() }); - } - }), accessibilityService.onDidChangeScreenReaderOptimized(() => updateKeyboardNavigation())); - this.navigator = new TreeResourceNavigator(tree, Object.assign({ configurationService }, options)); - this.disposables.push(this.navigator); - } - get onDidOpen() { return this.navigator.onDidOpen; } - updateStyleOverrides(overrideStyles) { - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])(this.styler); - this.styler = overrideStyles ? Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_12__["attachListStyler"])(this.tree, this.themeService, overrideStyles) : _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["Disposable"].None; - } - dispose() { - this.disposables = Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])(this.disposables); - Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["dispose"])(this.styler); - this.styler = undefined; - } -}; -WorkbenchTreeInternals = __decorate([ - __param(4, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_8__["IContextKeyService"]), - __param(5, IListService), - __param(6, _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_13__["IThemeService"]), - __param(7, _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_6__["IConfigurationService"]), - __param(8, _accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_18__["IAccessibilityService"]) -], WorkbenchTreeInternals); -const configurationRegistry = _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_11__["Registry"].as(_configuration_common_configurationRegistry_js__WEBPACK_IMPORTED_MODULE_7__["Extensions"].Configuration); -configurationRegistry.registerConfiguration({ - 'id': 'workbench', - 'order': 7, - 'title': Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])('workbenchConfigurationTitle', "Workbench"), - 'type': 'object', - 'properties': { - [multiSelectModifierSettingKey]: { - 'type': 'string', - 'enum': ['ctrlCmd', 'alt'], - 'enumDescriptions': [ - Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])('multiSelectModifier.ctrlCmd', "Maps to `Control` on Windows and Linux and to `Command` on macOS."), - Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])('multiSelectModifier.alt', "Maps to `Alt` on Windows and Linux and to `Option` on macOS.") - ], - 'default': 'ctrlCmd', - 'description': Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])({ - key: 'multiSelectModifier', - comment: [ - '- `ctrlCmd` refers to a value the setting can take and should not be localized.', - '- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized.' - ] - }, "The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.") - }, - [openModeSettingKey]: { - 'type': 'string', - 'enum': ['singleClick', 'doubleClick'], - 'default': 'singleClick', - 'description': Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])({ - key: 'openModeModifier', - comment: ['`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized.'] - }, "Controls how to open items in trees and lists using the mouse (if supported). For parents with children in trees, this setting will control if a single click expands the parent or a double click. Note that some trees and lists might choose to ignore this setting if it is not applicable. ") - }, - [horizontalScrollingKey]: { - 'type': 'boolean', - 'default': false, - 'description': Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])('horizontalScrolling setting', "Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.") - }, - [treeIndentKey]: { - 'type': 'number', - 'default': 8, - minimum: 0, - maximum: 40, - 'description': Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])('tree indent setting', "Controls tree indentation in pixels.") - }, - [treeRenderIndentGuidesKey]: { - type: 'string', - enum: ['none', 'onHover', 'always'], - default: 'onHover', - description: Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])('render tree indent guides', "Controls whether the tree should render indent guides.") - }, - [listSmoothScrolling]: { - type: 'boolean', - default: false, - description: Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])('list smoothScrolling setting', "Controls whether lists and trees have smooth scrolling."), - }, - [keyboardNavigationSettingKey]: { - 'type': 'string', - 'enum': ['simple', 'highlight', 'filter'], - 'enumDescriptions': [ - Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])('keyboardNavigationSettingKey.simple', "Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."), - Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])('keyboardNavigationSettingKey.highlight', "Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."), - Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])('keyboardNavigationSettingKey.filter', "Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.") - ], - 'default': 'highlight', - 'description': Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])('keyboardNavigationSettingKey', "Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.") - }, - [automaticKeyboardNavigationSettingKey]: { - 'type': 'boolean', - 'default': true, - markdownDescription: Object(_nls_js__WEBPACK_IMPORTED_MODULE_5__["localize"])('automatic keyboard navigation setting', "Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to `false`, keyboard navigation is only triggered when executing the `list.toggleKeyboardNavigation` command, for which you can assign a keyboard shortcut.") - } - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/log/common/log.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/log/common/log.js ***! - \**********************************************************************/ -/*! exports provided: ILogService, LogLevel, DEFAULT_LOG_LEVEL, AbstractLogService, ConsoleLogService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ILogService", function() { return ILogService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogLevel", function() { return LogLevel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_LOG_LEVEL", function() { return DEFAULT_LOG_LEVEL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractLogService", function() { return AbstractLogService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConsoleLogService", function() { return ConsoleLogService; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -const ILogService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('logService'); -var LogLevel; -(function (LogLevel) { - LogLevel[LogLevel["Trace"] = 0] = "Trace"; - LogLevel[LogLevel["Debug"] = 1] = "Debug"; - LogLevel[LogLevel["Info"] = 2] = "Info"; - LogLevel[LogLevel["Warning"] = 3] = "Warning"; - LogLevel[LogLevel["Error"] = 4] = "Error"; - LogLevel[LogLevel["Critical"] = 5] = "Critical"; - LogLevel[LogLevel["Off"] = 6] = "Off"; -})(LogLevel || (LogLevel = {})); -const DEFAULT_LOG_LEVEL = LogLevel.Info; -class AbstractLogService extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor() { - super(...arguments); - this.level = DEFAULT_LOG_LEVEL; - this._onDidChangeLogLevel = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"]()); - } - setLevel(level) { - if (this.level !== level) { - this.level = level; - this._onDidChangeLogLevel.fire(this.level); - } - } - getLevel() { - return this.level; - } -} -class ConsoleLogService extends AbstractLogService { - constructor(logLevel = DEFAULT_LOG_LEVEL) { - super(); - this.setLevel(logLevel); - } - trace(message, ...args) { - if (this.getLevel() <= LogLevel.Trace) { - console.log('%cTRACE', 'color: #888', message, ...args); - } - } - info(message, ...args) { - if (this.getLevel() <= LogLevel.Info) { - console.log('%c INFO', 'color: #33f', message, ...args); - } - } - error(message, ...args) { - if (this.getLevel() <= LogLevel.Error) { - console.log('%c ERR', 'color: #f33', message, ...args); - } - } - dispose() { - // noop - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/markers/common/markerService.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/markers/common/markerService.js ***! - \************************************************************************************/ -/*! exports provided: MarkerService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerService", function() { return MarkerService; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_network_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _markers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./markers.js */ "./node_modules/monaco-editor/esm/vs/platform/markers/common/markers.js"); -/* harmony import */ var _base_common_map_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/map.js */ "./node_modules/monaco-editor/esm/vs/base/common/map.js"); -/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -class DoubleResourceMap { - constructor() { - this._byResource = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_5__["ResourceMap"](); - this._byOwner = new Map(); - } - set(resource, owner, value) { - let ownerMap = this._byResource.get(resource); - if (!ownerMap) { - ownerMap = new Map(); - this._byResource.set(resource, ownerMap); - } - ownerMap.set(owner, value); - let resourceMap = this._byOwner.get(owner); - if (!resourceMap) { - resourceMap = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_5__["ResourceMap"](); - this._byOwner.set(owner, resourceMap); - } - resourceMap.set(resource, value); - } - get(resource, owner) { - let ownerMap = this._byResource.get(resource); - return ownerMap === null || ownerMap === void 0 ? void 0 : ownerMap.get(owner); - } - delete(resource, owner) { - let removedA = false; - let removedB = false; - let ownerMap = this._byResource.get(resource); - if (ownerMap) { - removedA = ownerMap.delete(owner); - } - let resourceMap = this._byOwner.get(owner); - if (resourceMap) { - removedB = resourceMap.delete(resource); - } - if (removedA !== removedB) { - throw new Error('illegal state'); - } - return removedA && removedB; - } - values(key) { - var _a, _b, _c, _d; - if (typeof key === 'string') { - return (_b = (_a = this._byOwner.get(key)) === null || _a === void 0 ? void 0 : _a.values()) !== null && _b !== void 0 ? _b : _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_6__["Iterable"].empty(); - } - if (_base_common_uri_js__WEBPACK_IMPORTED_MODULE_2__["URI"].isUri(key)) { - return (_d = (_c = this._byResource.get(key)) === null || _c === void 0 ? void 0 : _c.values()) !== null && _d !== void 0 ? _d : _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_6__["Iterable"].empty(); - } - return _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_6__["Iterable"].map(_base_common_iterator_js__WEBPACK_IMPORTED_MODULE_6__["Iterable"].concat(...this._byOwner.values()), map => map[1]); - } -} -class MarkerStats { - constructor(service) { - this.errors = 0; - this.infos = 0; - this.warnings = 0; - this.unknowns = 0; - this._data = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_5__["ResourceMap"](); - this._service = service; - this._subscription = service.onMarkerChanged(this._update, this); - } - dispose() { - this._subscription.dispose(); - } - _update(resources) { - for (const resource of resources) { - const oldStats = this._data.get(resource); - if (oldStats) { - this._substract(oldStats); - } - const newStats = this._resourceStats(resource); - this._add(newStats); - this._data.set(resource, newStats); - } - } - _resourceStats(resource) { - const result = { errors: 0, warnings: 0, infos: 0, unknowns: 0 }; - // TODO this is a hack - if (resource.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_1__["Schemas"].inMemory || resource.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_1__["Schemas"].walkThrough || resource.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_1__["Schemas"].walkThroughSnippet) { - return result; - } - for (const { severity } of this._service.read({ resource })) { - if (severity === _markers_js__WEBPACK_IMPORTED_MODULE_4__["MarkerSeverity"].Error) { - result.errors += 1; - } - else if (severity === _markers_js__WEBPACK_IMPORTED_MODULE_4__["MarkerSeverity"].Warning) { - result.warnings += 1; - } - else if (severity === _markers_js__WEBPACK_IMPORTED_MODULE_4__["MarkerSeverity"].Info) { - result.infos += 1; - } - else { - result.unknowns += 1; - } - } - return result; - } - _substract(op) { - this.errors -= op.errors; - this.warnings -= op.warnings; - this.infos -= op.infos; - this.unknowns -= op.unknowns; - } - _add(op) { - this.errors += op.errors; - this.warnings += op.warnings; - this.infos += op.infos; - this.unknowns += op.unknowns; - } -} -class MarkerService { - constructor() { - this._onMarkerChanged = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - this.onMarkerChanged = _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Event"].debounce(this._onMarkerChanged.event, MarkerService._debouncer, 0); - this._data = new DoubleResourceMap(); - this._stats = new MarkerStats(this); - } - dispose() { - this._stats.dispose(); - } - remove(owner, resources) { - for (const resource of resources || []) { - this.changeOne(owner, resource, []); - } - } - changeOne(owner, resource, markerData) { - if (Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["isFalsyOrEmpty"])(markerData)) { - // remove marker for this (owner,resource)-tuple - const removed = this._data.delete(resource, owner); - if (removed) { - this._onMarkerChanged.fire([resource]); - } - } - else { - // insert marker for this (owner,resource)-tuple - const markers = []; - for (const data of markerData) { - const marker = MarkerService._toMarker(owner, resource, data); - if (marker) { - markers.push(marker); - } - } - this._data.set(resource, owner, markers); - this._onMarkerChanged.fire([resource]); - } - } - static _toMarker(owner, resource, data) { - let { code, severity, message, source, startLineNumber, startColumn, endLineNumber, endColumn, relatedInformation, tags, } = data; - if (!message) { - return undefined; - } - // santize data - startLineNumber = startLineNumber > 0 ? startLineNumber : 1; - startColumn = startColumn > 0 ? startColumn : 1; - endLineNumber = endLineNumber >= startLineNumber ? endLineNumber : startLineNumber; - endColumn = endColumn > 0 ? endColumn : startColumn; - return { - resource, - owner, - code, - severity, - message, - source, - startLineNumber, - startColumn, - endLineNumber, - endColumn, - relatedInformation, - tags, - }; - } - read(filter = Object.create(null)) { - let { owner, resource, severities, take } = filter; - if (!take || take < 0) { - take = -1; - } - if (owner && resource) { - // exactly one owner AND resource - const data = this._data.get(resource, owner); - if (!data) { - return []; - } - else { - const result = []; - for (const marker of data) { - if (MarkerService._accept(marker, severities)) { - const newLen = result.push(marker); - if (take > 0 && newLen === take) { - break; - } - } - } - return result; - } - } - else if (!owner && !resource) { - // all - const result = []; - for (let markers of this._data.values()) { - for (let data of markers) { - if (MarkerService._accept(data, severities)) { - const newLen = result.push(data); - if (take > 0 && newLen === take) { - return result; - } - } - } - } - return result; - } - else { - // of one resource OR owner - const iterable = this._data.values(resource !== null && resource !== void 0 ? resource : owner); - const result = []; - for (const markers of iterable) { - for (const data of markers) { - if (MarkerService._accept(data, severities)) { - const newLen = result.push(data); - if (take > 0 && newLen === take) { - return result; - } - } - } - } - return result; - } - } - static _accept(marker, severities) { - return severities === undefined || (severities & marker.severity) === marker.severity; - } - static _debouncer(last, event) { - if (!last) { - MarkerService._dedupeMap = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_5__["ResourceMap"](); - last = []; - } - for (const uri of event) { - if (!MarkerService._dedupeMap.has(uri)) { - MarkerService._dedupeMap.set(uri, true); - last.push(uri); - } - } - return last; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/markers/common/markers.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/markers/common/markers.js ***! - \******************************************************************************/ -/*! exports provided: MarkerSeverity, IMarkerData, IMarkerService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerSeverity", function() { return MarkerSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IMarkerData", function() { return IMarkerData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IMarkerService", function() { return IMarkerService; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_severity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/severity.js */ "./node_modules/monaco-editor/esm/vs/base/common/severity.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -var MarkerSeverity; -(function (MarkerSeverity) { - MarkerSeverity[MarkerSeverity["Hint"] = 1] = "Hint"; - MarkerSeverity[MarkerSeverity["Info"] = 2] = "Info"; - MarkerSeverity[MarkerSeverity["Warning"] = 4] = "Warning"; - MarkerSeverity[MarkerSeverity["Error"] = 8] = "Error"; -})(MarkerSeverity || (MarkerSeverity = {})); -(function (MarkerSeverity) { - function compare(a, b) { - return b - a; - } - MarkerSeverity.compare = compare; - const _displayStrings = Object.create(null); - _displayStrings[MarkerSeverity.Error] = Object(_nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"])('sev.error', "Error"); - _displayStrings[MarkerSeverity.Warning] = Object(_nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"])('sev.warning', "Warning"); - _displayStrings[MarkerSeverity.Info] = Object(_nls_js__WEBPACK_IMPORTED_MODULE_1__["localize"])('sev.info', "Info"); - function toString(a) { - return _displayStrings[a] || ''; - } - MarkerSeverity.toString = toString; - function fromSeverity(severity) { - switch (severity) { - case _base_common_severity_js__WEBPACK_IMPORTED_MODULE_2__["default"].Error: return MarkerSeverity.Error; - case _base_common_severity_js__WEBPACK_IMPORTED_MODULE_2__["default"].Warning: return MarkerSeverity.Warning; - case _base_common_severity_js__WEBPACK_IMPORTED_MODULE_2__["default"].Info: return MarkerSeverity.Info; - case _base_common_severity_js__WEBPACK_IMPORTED_MODULE_2__["default"].Ignore: return MarkerSeverity.Hint; - } - } - MarkerSeverity.fromSeverity = fromSeverity; - function toSeverity(severity) { - switch (severity) { - case MarkerSeverity.Error: return _base_common_severity_js__WEBPACK_IMPORTED_MODULE_2__["default"].Error; - case MarkerSeverity.Warning: return _base_common_severity_js__WEBPACK_IMPORTED_MODULE_2__["default"].Warning; - case MarkerSeverity.Info: return _base_common_severity_js__WEBPACK_IMPORTED_MODULE_2__["default"].Info; - case MarkerSeverity.Hint: return _base_common_severity_js__WEBPACK_IMPORTED_MODULE_2__["default"].Ignore; - } - } - MarkerSeverity.toSeverity = toSeverity; -})(MarkerSeverity || (MarkerSeverity = {})); -var IMarkerData; -(function (IMarkerData) { - const emptyString = ''; - function makeKey(markerData) { - return makeKeyOptionalMessage(markerData, true); - } - IMarkerData.makeKey = makeKey; - function makeKeyOptionalMessage(markerData, useMessage) { - let result = [emptyString]; - if (markerData.source) { - result.push(markerData.source.replace('¦', '\\¦')); - } - else { - result.push(emptyString); - } - if (markerData.code) { - if (typeof markerData.code === 'string') { - result.push(markerData.code.replace('¦', '\\¦')); - } - else { - result.push(markerData.code.value.replace('¦', '\\¦')); - } - } - else { - result.push(emptyString); - } - if (markerData.severity !== undefined && markerData.severity !== null) { - result.push(MarkerSeverity.toString(markerData.severity)); - } - else { - result.push(emptyString); - } - // Modifed to not include the message as part of the marker key to work around - // https://github.com/microsoft/vscode/issues/77475 - if (markerData.message && useMessage) { - result.push(markerData.message.replace('¦', '\\¦')); - } - else { - result.push(emptyString); - } - if (markerData.startLineNumber !== undefined && markerData.startLineNumber !== null) { - result.push(markerData.startLineNumber.toString()); - } - else { - result.push(emptyString); - } - if (markerData.startColumn !== undefined && markerData.startColumn !== null) { - result.push(markerData.startColumn.toString()); - } - else { - result.push(emptyString); - } - if (markerData.endLineNumber !== undefined && markerData.endLineNumber !== null) { - result.push(markerData.endLineNumber.toString()); - } - else { - result.push(emptyString); - } - if (markerData.endColumn !== undefined && markerData.endColumn !== null) { - result.push(markerData.endColumn.toString()); - } - else { - result.push(emptyString); - } - result.push(emptyString); - return result.join('¦'); - } - IMarkerData.makeKeyOptionalMessage = makeKeyOptionalMessage; -})(IMarkerData || (IMarkerData = {})); -const IMarkerService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('markerService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js ***! - \****************************************************************************************/ -/*! exports provided: Severity, INotificationService, NoOpNotification */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Severity", function() { return Severity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INotificationService", function() { return INotificationService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoOpNotification", function() { return NoOpNotification; }); -/* harmony import */ var _base_common_severity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/severity.js */ "./node_modules/monaco-editor/esm/vs/base/common/severity.js"); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -var Severity = _base_common_severity_js__WEBPACK_IMPORTED_MODULE_0__["default"]; -const INotificationService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__["createDecorator"])('notificationService'); -class NoOpNotification { -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/opener/common/opener.js ***! - \****************************************************************************/ -/*! exports provided: IOpenerService, NullOpenerService, matchesScheme */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IOpenerService", function() { return IOpenerService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NullOpenerService", function() { return NullOpenerService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchesScheme", function() { return matchesScheme; }); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - -const IOpenerService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__["createDecorator"])('openerService'); -const NullOpenerService = Object.freeze({ - _serviceBrand: undefined, - registerOpener() { return _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"].None; }, - registerValidator() { return _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"].None; }, - registerExternalUriResolver() { return _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"].None; }, - setExternalOpener() { }, - open() { - return __awaiter(this, void 0, void 0, function* () { return false; }); - }, - resolveExternalUri(uri) { - return __awaiter(this, void 0, void 0, function* () { return { resolved: uri, dispose() { } }; }); - }, -}); -function matchesScheme(target, scheme) { - if (_base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__["URI"].isUri(target)) { - return Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["equalsIgnoreCase"])(target.scheme, scheme); - } - else { - return Object(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_3__["startsWithIgnoreCase"])(target, scheme + ':'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/progress/common/progress.js ***! - \********************************************************************************/ -/*! exports provided: Progress, IEditorProgressService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Progress", function() { return Progress; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IEditorProgressService", function() { return IEditorProgressService; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class Progress { - constructor(callback) { - this.callback = callback; - } - report(item) { - this._value = item; - this.callback(this._value); - } -} -Progress.None = Object.freeze({ report() { } }); -const IEditorProgressService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('editorProgressService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/commandsQuickAccess.js": -/*!**********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/commandsQuickAccess.js ***! - \**********************************************************************************************/ -/*! exports provided: AbstractCommandsQuickAccessProvider, CommandsHistory */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractCommandsQuickAccessProvider", function() { return AbstractCommandsQuickAccessProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommandsHistory", function() { return CommandsHistory; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _pickerQuickAccess_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pickerQuickAccess.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/pickerQuickAccess.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_filters_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/filters.js */ "./node_modules/monaco-editor/esm/vs/base/common/filters.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _base_common_map_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/map.js */ "./node_modules/monaco-editor/esm/vs/base/common/map.js"); -/* harmony import */ var _storage_common_storage_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../storage/common/storage.js */ "./node_modules/monaco-editor/esm/vs/platform/storage/common/storage.js"); -/* harmony import */ var _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../configuration/common/configuration.js */ "./node_modules/monaco-editor/esm/vs/platform/configuration/common/configuration.js"); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../keybinding/common/keybinding.js */ "./node_modules/monaco-editor/esm/vs/platform/keybinding/common/keybinding.js"); -/* harmony import */ var _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../commands/common/commands.js */ "./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js"); -/* harmony import */ var _telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../telemetry/common/telemetry.js */ "./node_modules/monaco-editor/esm/vs/platform/telemetry/common/telemetry.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _notification_common_notification_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _base_common_errorMessage_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../base/common/errorMessage.js */ "./node_modules/monaco-editor/esm/vs/base/common/errorMessage.js"); -/* harmony import */ var _userDataSync_common_storageKeys_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../userDataSync/common/storageKeys.js */ "./node_modules/monaco-editor/esm/vs/platform/userDataSync/common/storageKeys.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - - - - -let AbstractCommandsQuickAccessProvider = class AbstractCommandsQuickAccessProvider extends _pickerQuickAccess_js__WEBPACK_IMPORTED_MODULE_1__["PickerQuickAccessProvider"] { - constructor(options, instantiationService, keybindingService, commandService, telemetryService, notificationService) { - super(AbstractCommandsQuickAccessProvider.PREFIX, options); - this.options = options; - this.instantiationService = instantiationService; - this.keybindingService = keybindingService; - this.commandService = commandService; - this.telemetryService = telemetryService; - this.notificationService = notificationService; - this.commandsHistory = this._register(this.instantiationService.createInstance(CommandsHistory)); - } - getPicks(filter, disposables, token) { - return __awaiter(this, void 0, void 0, function* () { - // Ask subclass for all command picks - const allCommandPicks = yield this.getCommandPicks(disposables, token); - if (token.isCancellationRequested) { - return []; - } - // Filter - const filteredCommandPicks = []; - for (const commandPick of allCommandPicks) { - const labelHighlights = Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_4__["withNullAsUndefined"])(AbstractCommandsQuickAccessProvider.WORD_FILTER(filter, commandPick.label)); - const aliasHighlights = commandPick.commandAlias ? Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_4__["withNullAsUndefined"])(AbstractCommandsQuickAccessProvider.WORD_FILTER(filter, commandPick.commandAlias)) : undefined; - // Add if matching in label or alias - if (labelHighlights || aliasHighlights) { - commandPick.highlights = { - label: labelHighlights, - detail: this.options.showAlias ? aliasHighlights : undefined - }; - filteredCommandPicks.push(commandPick); - } - // Also add if we have a 100% command ID match - else if (filter === commandPick.commandId) { - filteredCommandPicks.push(commandPick); - } - } - // Add description to commands that have duplicate labels - const mapLabelToCommand = new Map(); - for (const commandPick of filteredCommandPicks) { - const existingCommandForLabel = mapLabelToCommand.get(commandPick.label); - if (existingCommandForLabel) { - commandPick.description = commandPick.commandId; - existingCommandForLabel.description = existingCommandForLabel.commandId; - } - else { - mapLabelToCommand.set(commandPick.label, commandPick); - } - } - // Sort by MRU order and fallback to name otherwise - filteredCommandPicks.sort((commandPickA, commandPickB) => { - const commandACounter = this.commandsHistory.peek(commandPickA.commandId); - const commandBCounter = this.commandsHistory.peek(commandPickB.commandId); - if (commandACounter && commandBCounter) { - return commandACounter > commandBCounter ? -1 : 1; // use more recently used command before older - } - if (commandACounter) { - return -1; // first command was used, so it wins over the non used one - } - if (commandBCounter) { - return 1; // other command was used so it wins over the command - } - // both commands were never used, so we sort by name - return commandPickA.label.localeCompare(commandPickB.label); - }); - const commandPicks = []; - let addSeparator = false; - for (let i = 0; i < filteredCommandPicks.length; i++) { - const commandPick = filteredCommandPicks[i]; - const keybinding = this.keybindingService.lookupKeybinding(commandPick.commandId); - const ariaLabel = keybinding ? - Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('commandPickAriaLabelWithKeybinding', "{0}, {1}", commandPick.label, keybinding.getAriaLabel()) : - commandPick.label; - // Separator: recently used - if (i === 0 && this.commandsHistory.peek(commandPick.commandId)) { - commandPicks.push({ type: 'separator', label: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('recentlyUsed', "recently used") }); - addSeparator = true; - } - // Separator: other commands - if (i !== 0 && addSeparator && !this.commandsHistory.peek(commandPick.commandId)) { - commandPicks.push({ type: 'separator', label: Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('morecCommands', "other commands") }); - addSeparator = false; // only once - } - // Command - commandPicks.push(Object.assign(Object.assign({}, commandPick), { ariaLabel, detail: this.options.showAlias && commandPick.commandAlias !== commandPick.label ? commandPick.commandAlias : undefined, keybinding, accept: () => __awaiter(this, void 0, void 0, function* () { - // Add to history - this.commandsHistory.push(commandPick.commandId); - // Telementry - this.telemetryService.publicLog2('workbenchActionExecuted', { - id: commandPick.commandId, - from: 'quick open' - }); - // Run - try { - yield this.commandService.executeCommand(commandPick.commandId); - } - catch (error) { - if (!Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_12__["isPromiseCanceledError"])(error)) { - this.notificationService.error(Object(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"])('canNotRun', "Command '{0}' resulted in an error ({1})", commandPick.label, Object(_base_common_errorMessage_js__WEBPACK_IMPORTED_MODULE_14__["toErrorMessage"])(error))); - } - } - }) })); - } - return commandPicks; - }); - } -}; -AbstractCommandsQuickAccessProvider.PREFIX = '>'; -AbstractCommandsQuickAccessProvider.WORD_FILTER = Object(_base_common_filters_js__WEBPACK_IMPORTED_MODULE_3__["or"])(_base_common_filters_js__WEBPACK_IMPORTED_MODULE_3__["matchesPrefix"], _base_common_filters_js__WEBPACK_IMPORTED_MODULE_3__["matchesWords"], _base_common_filters_js__WEBPACK_IMPORTED_MODULE_3__["matchesContiguousSubString"]); -AbstractCommandsQuickAccessProvider = __decorate([ - __param(1, _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_8__["IInstantiationService"]), - __param(2, _keybinding_common_keybinding_js__WEBPACK_IMPORTED_MODULE_9__["IKeybindingService"]), - __param(3, _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_10__["ICommandService"]), - __param(4, _telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_11__["ITelemetryService"]), - __param(5, _notification_common_notification_js__WEBPACK_IMPORTED_MODULE_13__["INotificationService"]) -], AbstractCommandsQuickAccessProvider); - -let CommandsHistory = class CommandsHistory extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor(storageService, configurationService, storageKeysSyncRegistryService) { - super(); - this.storageService = storageService; - this.configurationService = configurationService; - this.configuredCommandsHistoryLength = 0; - // opt-in to syncing - storageKeysSyncRegistryService.registerStorageKey({ key: CommandsHistory.PREF_KEY_CACHE, version: 1 }); - storageKeysSyncRegistryService.registerStorageKey({ key: CommandsHistory.PREF_KEY_COUNTER, version: 1 }); - this.updateConfiguration(); - this.load(); - this.registerListeners(); - } - registerListeners() { - this._register(this.configurationService.onDidChangeConfiguration(() => this.updateConfiguration())); - } - updateConfiguration() { - this.configuredCommandsHistoryLength = CommandsHistory.getConfiguredCommandHistoryLength(this.configurationService); - if (CommandsHistory.cache && CommandsHistory.cache.limit !== this.configuredCommandsHistoryLength) { - CommandsHistory.cache.limit = this.configuredCommandsHistoryLength; - CommandsHistory.saveState(this.storageService); - } - } - load() { - const raw = this.storageService.get(CommandsHistory.PREF_KEY_CACHE, 0 /* GLOBAL */); - let serializedCache; - if (raw) { - try { - serializedCache = JSON.parse(raw); - } - catch (error) { - // invalid data - } - } - const cache = CommandsHistory.cache = new _base_common_map_js__WEBPACK_IMPORTED_MODULE_5__["LRUCache"](this.configuredCommandsHistoryLength, 1); - if (serializedCache) { - let entries; - if (serializedCache.usesLRU) { - entries = serializedCache.entries; - } - else { - entries = serializedCache.entries.sort((a, b) => a.value - b.value); - } - entries.forEach(entry => cache.set(entry.key, entry.value)); - } - CommandsHistory.counter = this.storageService.getNumber(CommandsHistory.PREF_KEY_COUNTER, 0 /* GLOBAL */, CommandsHistory.counter); - } - push(commandId) { - if (!CommandsHistory.cache) { - return; - } - CommandsHistory.cache.set(commandId, CommandsHistory.counter++); // set counter to command - CommandsHistory.saveState(this.storageService); - } - peek(commandId) { - var _a; - return (_a = CommandsHistory.cache) === null || _a === void 0 ? void 0 : _a.peek(commandId); - } - static saveState(storageService) { - if (!CommandsHistory.cache) { - return; - } - const serializedCache = { usesLRU: true, entries: [] }; - CommandsHistory.cache.forEach((value, key) => serializedCache.entries.push({ key, value })); - storageService.store(CommandsHistory.PREF_KEY_CACHE, JSON.stringify(serializedCache), 0 /* GLOBAL */); - storageService.store(CommandsHistory.PREF_KEY_COUNTER, CommandsHistory.counter, 0 /* GLOBAL */); - } - static getConfiguredCommandHistoryLength(configurationService) { - var _a, _b; - const config = configurationService.getValue(); - const configuredCommandHistoryLength = (_b = (_a = config.workbench) === null || _a === void 0 ? void 0 : _a.commandPalette) === null || _b === void 0 ? void 0 : _b.history; - if (typeof configuredCommandHistoryLength === 'number') { - return configuredCommandHistoryLength; - } - return CommandsHistory.DEFAULT_COMMANDS_HISTORY_LENGTH; - } -}; -CommandsHistory.DEFAULT_COMMANDS_HISTORY_LENGTH = 50; -CommandsHistory.PREF_KEY_CACHE = 'commandPalette.mru.cache'; -CommandsHistory.PREF_KEY_COUNTER = 'commandPalette.mru.counter'; -CommandsHistory.counter = 1; -CommandsHistory = __decorate([ - __param(0, _storage_common_storage_js__WEBPACK_IMPORTED_MODULE_6__["IStorageService"]), - __param(1, _configuration_common_configuration_js__WEBPACK_IMPORTED_MODULE_7__["IConfigurationService"]), - __param(2, _userDataSync_common_storageKeys_js__WEBPACK_IMPORTED_MODULE_15__["IStorageKeysSyncRegistryService"]) -], CommandsHistory); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/helpQuickAccess.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/helpQuickAccess.js ***! - \******************************************************************************************/ -/*! exports provided: HelpQuickAccessProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HelpQuickAccessProvider", function() { return HelpQuickAccessProvider; }); -/* harmony import */ var _common_quickInput_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/quickInput.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickInput.js"); -/* harmony import */ var _common_quickAccess_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/quickAccess.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js"); -/* harmony import */ var _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - -let HelpQuickAccessProvider = class HelpQuickAccessProvider { - constructor(quickInputService) { - this.quickInputService = quickInputService; - this.registry = _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["Registry"].as(_common_quickAccess_js__WEBPACK_IMPORTED_MODULE_1__["Extensions"].Quickaccess); - } - provide(picker) { - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__["DisposableStore"](); - // Open a picker with the selected value if picked - disposables.add(picker.onDidAccept(() => { - const [item] = picker.selectedItems; - if (item) { - this.quickInputService.quickAccess.show(item.prefix, { preserveValue: true }); - } - })); - // Also open a picker when we detect the user typed the exact - // name of a provider (e.g. `?term` for terminals) - disposables.add(picker.onDidChangeValue(value => { - const providerDescriptor = this.registry.getQuickAccessProvider(value.substr(HelpQuickAccessProvider.PREFIX.length)); - if (providerDescriptor && providerDescriptor.prefix && providerDescriptor.prefix !== HelpQuickAccessProvider.PREFIX) { - this.quickInputService.quickAccess.show(providerDescriptor.prefix, { preserveValue: true }); - } - })); - // Fill in all providers separated by editor/global scope - const { editorProviders, globalProviders } = this.getQuickAccessProviders(); - picker.items = editorProviders.length === 0 || globalProviders.length === 0 ? - // Without groups - [ - ...(editorProviders.length === 0 ? globalProviders : editorProviders) - ] : - // With groups - [ - { label: Object(_nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"])('globalCommands', "global commands"), type: 'separator' }, - ...globalProviders, - { label: Object(_nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"])('editorCommands', "editor commands"), type: 'separator' }, - ...editorProviders - ]; - return disposables; - } - getQuickAccessProviders() { - const globalProviders = []; - const editorProviders = []; - for (const provider of this.registry.getQuickAccessProviders().sort((providerA, providerB) => providerA.prefix.localeCompare(providerB.prefix))) { - if (provider.prefix === HelpQuickAccessProvider.PREFIX) { - continue; // exclude help which is already active - } - for (const helpEntry of provider.helpEntries) { - const prefix = helpEntry.prefix || provider.prefix; - const label = prefix || '\u2026' /* ... */; - (helpEntry.needsEditor ? editorProviders : globalProviders).push({ - prefix, - label, - ariaLabel: Object(_nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"])('helpPickAriaLabel', "{0}, {1}", label, helpEntry.description), - description: helpEntry.description - }); - } - } - return { editorProviders, globalProviders }; - } -}; -HelpQuickAccessProvider.PREFIX = '?'; -HelpQuickAccessProvider = __decorate([ - __param(0, _common_quickInput_js__WEBPACK_IMPORTED_MODULE_0__["IQuickInputService"]) -], HelpQuickAccessProvider); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/pickerQuickAccess.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/pickerQuickAccess.js ***! - \********************************************************************************************/ -/*! exports provided: TriggerAction, PickerQuickAccessProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TriggerAction", function() { return TriggerAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PickerQuickAccessProvider", function() { return PickerQuickAccessProvider; }); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - -var TriggerAction; -(function (TriggerAction) { - /** - * Do nothing after the button was clicked. - */ - TriggerAction[TriggerAction["NO_ACTION"] = 0] = "NO_ACTION"; - /** - * Close the picker. - */ - TriggerAction[TriggerAction["CLOSE_PICKER"] = 1] = "CLOSE_PICKER"; - /** - * Update the results of the picker. - */ - TriggerAction[TriggerAction["REFRESH_PICKER"] = 2] = "REFRESH_PICKER"; - /** - * Remove the item from the picker. - */ - TriggerAction[TriggerAction["REMOVE_ITEM"] = 3] = "REMOVE_ITEM"; -})(TriggerAction || (TriggerAction = {})); -function isPicksWithActive(obj) { - const candidate = obj; - return Array.isArray(candidate.items); -} -function isFastAndSlowPicks(obj) { - const candidate = obj; - return !!candidate.picks && candidate.additionalPicks instanceof Promise; -} -class PickerQuickAccessProvider extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(prefix, options) { - super(); - this.prefix = prefix; - this.options = options; - } - provide(picker, token) { - var _a; - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - // Apply options if any - picker.canAcceptInBackground = !!((_a = this.options) === null || _a === void 0 ? void 0 : _a.canAcceptInBackground); - // Disable filtering & sorting, we control the results - picker.matchOnLabel = picker.matchOnDescription = picker.matchOnDetail = picker.sortByLabel = false; - // Set initial picks and update on type - let picksCts = undefined; - const picksDisposable = disposables.add(new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["MutableDisposable"]()); - const updatePickerItems = () => __awaiter(this, void 0, void 0, function* () { - const picksDisposables = picksDisposable.value = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - // Cancel any previous ask for picks and busy - picksCts === null || picksCts === void 0 ? void 0 : picksCts.dispose(true); - picker.busy = false; - // Create new cancellation source for this run - picksCts = new _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationTokenSource"](token); - // Collect picks and support both long running and short or combined - const picksToken = picksCts.token; - const picksFilter = picker.value.substr(this.prefix.length).trim(); - const providedPicks = this.getPicks(picksFilter, picksDisposables, picksToken); - const applyPicks = (picks, skipEmpty) => { - var _a; - let items; - let activeItem = undefined; - if (isPicksWithActive(picks)) { - items = picks.items; - activeItem = picks.active; - } - else { - items = picks; - } - if (items.length === 0) { - if (skipEmpty) { - return false; - } - if (picksFilter.length > 0 && ((_a = this.options) === null || _a === void 0 ? void 0 : _a.noResultsPick)) { - items = [this.options.noResultsPick]; - } - } - picker.items = items; - if (activeItem) { - picker.activeItems = [activeItem]; - } - return true; - }; - // No Picks - if (providedPicks === null) { - // Ignore - } - // Fast and Slow Picks - else if (isFastAndSlowPicks(providedPicks)) { - let fastPicksApplied = false; - let slowPicksApplied = false; - yield Promise.all([ - // Fast Picks: to reduce amount of flicker, we race against - // the slow picks over 500ms and then set the fast picks. - // If the slow picks are faster, we reduce the flicker by - // only setting the items once. - (() => __awaiter(this, void 0, void 0, function* () { - yield Object(_base_common_async_js__WEBPACK_IMPORTED_MODULE_2__["timeout"])(PickerQuickAccessProvider.FAST_PICKS_RACE_DELAY); - if (picksToken.isCancellationRequested) { - return; - } - if (!slowPicksApplied) { - fastPicksApplied = applyPicks(providedPicks.picks, true /* skip over empty to reduce flicker */); - } - }))(), - // Slow Picks: we await the slow picks and then set them at - // once together with the fast picks, but only if we actually - // have additional results. - (() => __awaiter(this, void 0, void 0, function* () { - picker.busy = true; - try { - const awaitedAdditionalPicks = yield providedPicks.additionalPicks; - if (picksToken.isCancellationRequested) { - return; - } - let picks; - let activePick = undefined; - if (isPicksWithActive(providedPicks.picks)) { - picks = providedPicks.picks.items; - activePick = providedPicks.picks.active; - } - else { - picks = providedPicks.picks; - } - let additionalPicks; - let additionalActivePick = undefined; - if (isPicksWithActive(awaitedAdditionalPicks)) { - additionalPicks = awaitedAdditionalPicks.items; - additionalActivePick = awaitedAdditionalPicks.active; - } - else { - additionalPicks = awaitedAdditionalPicks; - } - if (additionalPicks.length > 0 || !fastPicksApplied) { - // If we do not have any activePick or additionalActivePick - // we try to preserve the currently active pick from the - // fast results. This fixes an issue where the user might - // have made a pick active before the additional results - // kick in. - // See https://github.com/microsoft/vscode/issues/102480 - let fallbackActivePick = undefined; - if (!activePick && !additionalActivePick) { - const fallbackActivePickCandidate = picker.activeItems[0]; - if (fallbackActivePickCandidate && picks.indexOf(fallbackActivePickCandidate) !== -1) { - fallbackActivePick = fallbackActivePickCandidate; - } - } - applyPicks({ - items: [...picks, ...additionalPicks], - active: activePick || additionalActivePick || fallbackActivePick - }); - } - } - finally { - if (!picksToken.isCancellationRequested) { - picker.busy = false; - } - slowPicksApplied = true; - } - }))() - ]); - } - // Fast Picks - else if (!(providedPicks instanceof Promise)) { - applyPicks(providedPicks); - } - // Slow Picks - else { - picker.busy = true; - try { - const awaitedPicks = yield providedPicks; - if (picksToken.isCancellationRequested) { - return; - } - applyPicks(awaitedPicks); - } - finally { - if (!picksToken.isCancellationRequested) { - picker.busy = false; - } - } - } - }); - disposables.add(picker.onDidChangeValue(() => updatePickerItems())); - updatePickerItems(); - // Accept the pick on accept and hide picker - disposables.add(picker.onDidAccept(event => { - const [item] = picker.selectedItems; - if (typeof (item === null || item === void 0 ? void 0 : item.accept) === 'function') { - if (!event.inBackground) { - picker.hide(); // hide picker unless we accept in background - } - item.accept(picker.keyMods, event); - } - })); - // Trigger the pick with button index if button triggered - disposables.add(picker.onDidTriggerItemButton(({ button, item }) => __awaiter(this, void 0, void 0, function* () { - var _b, _c; - if (typeof item.trigger === 'function') { - const buttonIndex = (_c = (_b = item.buttons) === null || _b === void 0 ? void 0 : _b.indexOf(button)) !== null && _c !== void 0 ? _c : -1; - if (buttonIndex >= 0) { - const result = item.trigger(buttonIndex, picker.keyMods); - const action = (typeof result === 'number') ? result : yield result; - if (token.isCancellationRequested) { - return; - } - switch (action) { - case TriggerAction.NO_ACTION: - break; - case TriggerAction.CLOSE_PICKER: - picker.hide(); - break; - case TriggerAction.REFRESH_PICKER: - updatePickerItems(); - break; - case TriggerAction.REMOVE_ITEM: - const index = picker.items.indexOf(item); - if (index !== -1) { - const items = picker.items.slice(); - items.splice(index, 1); - picker.items = items; - } - break; - } - } - } - }))); - return disposables; - } -} -PickerQuickAccessProvider.FAST_PICKS_RACE_DELAY = 200; // timeout before we accept fast results before slow results are present - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickAccess.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickAccess.js ***! - \**************************************************************************************/ -/*! exports provided: QuickAccessController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickAccessController", function() { return QuickAccessController; }); -/* harmony import */ var _common_quickInput_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/quickInput.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickInput.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _common_quickAccess_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/quickAccess.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js"); -/* harmony import */ var _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_functional_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/functional.js */ "./node_modules/monaco-editor/esm/vs/base/common/functional.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - -let QuickAccessController = class QuickAccessController extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(quickInputService, instantiationService) { - super(); - this.quickInputService = quickInputService; - this.instantiationService = instantiationService; - this.registry = _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_3__["Registry"].as(_common_quickAccess_js__WEBPACK_IMPORTED_MODULE_2__["Extensions"].Quickaccess); - this.mapProviderToDescriptor = new Map(); - this.lastAcceptedPickerValues = new Map(); - this.visibleQuickAccess = undefined; - } - show(value = '', options) { - var _a; - // Find provider for the value to show - const [provider, descriptor] = this.getOrInstantiateProvider(value); - // Return early if quick access is already showing on that same prefix - const visibleQuickAccess = this.visibleQuickAccess; - const visibleDescriptor = visibleQuickAccess === null || visibleQuickAccess === void 0 ? void 0 : visibleQuickAccess.descriptor; - if (visibleQuickAccess && descriptor && visibleDescriptor === descriptor) { - // Apply value only if it is more specific than the prefix - // from the provider and we are not instructed to preserve - if (value !== descriptor.prefix && !(options === null || options === void 0 ? void 0 : options.preserveValue)) { - visibleQuickAccess.picker.value = value; - } - // Always adjust selection - this.adjustValueSelection(visibleQuickAccess.picker, descriptor, options); - return; - } - // Rewrite the filter value based on certain rules unless disabled - if (descriptor && !(options === null || options === void 0 ? void 0 : options.preserveValue)) { - let newValue = undefined; - // If we have a visible provider with a value, take it's filter value but - // rewrite to new provider prefix in case they differ - if (visibleQuickAccess && visibleDescriptor && visibleDescriptor !== descriptor) { - const newValueCandidateWithoutPrefix = visibleQuickAccess.value.substr(visibleDescriptor.prefix.length); - if (newValueCandidateWithoutPrefix) { - newValue = `${descriptor.prefix}${newValueCandidateWithoutPrefix}`; - } - } - // Otherwise, take a default value as instructed - if (!newValue) { - const defaultFilterValue = provider === null || provider === void 0 ? void 0 : provider.defaultFilterValue; - if (defaultFilterValue === _common_quickAccess_js__WEBPACK_IMPORTED_MODULE_2__["DefaultQuickAccessFilterValue"].LAST) { - newValue = this.lastAcceptedPickerValues.get(descriptor); - } - else if (typeof defaultFilterValue === 'string') { - newValue = `${descriptor.prefix}${defaultFilterValue}`; - } - } - if (typeof newValue === 'string') { - value = newValue; - } - } - // Create a picker for the provider to use with the initial value - // and adjust the filtering to exclude the prefix from filtering - const disposables = new _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"](); - const picker = disposables.add(this.quickInputService.createQuickPick()); - picker.value = value; - this.adjustValueSelection(picker, descriptor, options); - picker.placeholder = descriptor === null || descriptor === void 0 ? void 0 : descriptor.placeholder; - picker.quickNavigate = options === null || options === void 0 ? void 0 : options.quickNavigateConfiguration; - picker.hideInput = !!picker.quickNavigate && !visibleQuickAccess; // only hide input if there was no picker opened already - if (typeof (options === null || options === void 0 ? void 0 : options.itemActivation) === 'number' || (options === null || options === void 0 ? void 0 : options.quickNavigateConfiguration)) { - picker.itemActivation = (_a = options === null || options === void 0 ? void 0 : options.itemActivation) !== null && _a !== void 0 ? _a : _common_quickInput_js__WEBPACK_IMPORTED_MODULE_0__["ItemActivation"].SECOND /* quick nav is always second */; - } - picker.contextKey = descriptor === null || descriptor === void 0 ? void 0 : descriptor.contextKey; - picker.filterValue = (value) => value.substring(descriptor ? descriptor.prefix.length : 0); - if (descriptor === null || descriptor === void 0 ? void 0 : descriptor.placeholder) { - picker.ariaLabel = descriptor === null || descriptor === void 0 ? void 0 : descriptor.placeholder; - } - // Register listeners - const cancellationToken = this.registerPickerListeners(picker, provider, descriptor, value, disposables); - // Ask provider to fill the picker as needed if we have one - if (provider) { - disposables.add(provider.provide(picker, cancellationToken)); - } - // Finally, show the picker. This is important because a provider - // may not call this and then our disposables would leak that rely - // on the onDidHide event. - picker.show(); - } - adjustValueSelection(picker, descriptor, options) { - var _a; - let valueSelection; - // Preserve: just always put the cursor at the end - if (options === null || options === void 0 ? void 0 : options.preserveValue) { - valueSelection = [picker.value.length, picker.value.length]; - } - // Otherwise: select the value up until the prefix - else { - valueSelection = [(_a = descriptor === null || descriptor === void 0 ? void 0 : descriptor.prefix.length) !== null && _a !== void 0 ? _a : 0, picker.value.length]; - } - picker.valueSelection = valueSelection; - } - registerPickerListeners(picker, provider, descriptor, value, disposables) { - // Remember as last visible picker and clean up once picker get's disposed - const visibleQuickAccess = this.visibleQuickAccess = { picker, descriptor, value }; - disposables.add(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => { - if (visibleQuickAccess === this.visibleQuickAccess) { - this.visibleQuickAccess = undefined; - } - })); - // Whenever the value changes, check if the provider has - // changed and if so - re-create the picker from the beginning - disposables.add(picker.onDidChangeValue(value => { - const [providerForValue] = this.getOrInstantiateProvider(value); - if (providerForValue !== provider) { - this.show(value, { preserveValue: true } /* do not rewrite value from user typing! */); - } - else { - visibleQuickAccess.value = value; // remember the value in our visible one - } - })); - // Remember picker input for future use when accepting - if (descriptor) { - disposables.add(picker.onDidAccept(() => { - this.lastAcceptedPickerValues.set(descriptor, picker.value); - })); - } - // Create a cancellation token source that is valid as long as the - // picker has not been closed without picking an item - const cts = disposables.add(new _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_4__["CancellationTokenSource"]()); - Object(_base_common_functional_js__WEBPACK_IMPORTED_MODULE_6__["once"])(picker.onDidHide)(() => { - if (picker.selectedItems.length === 0) { - cts.cancel(); - } - // Start to dispose once picker hides - disposables.dispose(); - }); - return cts.token; - } - getOrInstantiateProvider(value) { - const providerDescriptor = this.registry.getQuickAccessProvider(value); - if (!providerDescriptor) { - return [undefined, undefined]; - } - let provider = this.mapProviderToDescriptor.get(providerDescriptor); - if (!provider) { - provider = this.instantiationService.createInstance(providerDescriptor.ctor); - this.mapProviderToDescriptor.set(providerDescriptor, provider); - } - return [provider, providerDescriptor]; - } -}; -QuickAccessController = __decorate([ - __param(0, _common_quickInput_js__WEBPACK_IMPORTED_MODULE_0__["IQuickInputService"]), - __param(1, _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_5__["IInstantiationService"]) -], QuickAccessController); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickInput.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickInput.js ***! - \*************************************************************************************/ -/*! exports provided: QuickInputService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickInputService", function() { return QuickInputService; }); -/* harmony import */ var _layout_browser_layoutService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../layout/browser/layoutService.js */ "./node_modules/monaco-editor/esm/vs/platform/layout/browser/layoutService.js"); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _theme_common_styler_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/common/styler.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/styler.js"); -/* harmony import */ var _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../contextkey/common/contextkey.js */ "./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js"); -/* harmony import */ var _accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../accessibility/common/accessibility.js */ "./node_modules/monaco-editor/esm/vs/platform/accessibility/common/accessibility.js"); -/* harmony import */ var _base_parts_quickinput_browser_quickInput_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/parts/quickinput/browser/quickInput.js */ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/browser/quickInput.js"); -/* harmony import */ var _list_browser_listService_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../list/browser/listService.js */ "./node_modules/monaco-editor/esm/vs/platform/list/browser/listService.js"); -/* harmony import */ var _quickAccess_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./quickAccess.js */ "./node_modules/monaco-editor/esm/vs/platform/quickinput/browser/quickAccess.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; - - - - - - - - - - - -let QuickInputService = class QuickInputService extends _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_2__["Themable"] { - constructor(instantiationService, contextKeyService, themeService, accessibilityService, layoutService) { - super(themeService); - this.instantiationService = instantiationService; - this.contextKeyService = contextKeyService; - this.accessibilityService = accessibilityService; - this.layoutService = layoutService; - this.contexts = new Map(); - } - get controller() { - if (!this._controller) { - this._controller = this._register(this.createController()); - } - return this._controller; - } - get quickAccess() { - if (!this._quickAccess) { - this._quickAccess = this._register(this.instantiationService.createInstance(_quickAccess_js__WEBPACK_IMPORTED_MODULE_10__["QuickAccessController"])); - } - return this._quickAccess; - } - createController(host = this.layoutService, options) { - var _a, _b; - const defaultOptions = { - idPrefix: 'quickInput_', - container: host.container, - ignoreFocusOut: () => false, - isScreenReaderOptimized: () => this.accessibilityService.isScreenReaderOptimized(), - backKeybindingLabel: () => undefined, - setContextKey: (id) => this.setContextKey(id), - returnFocus: () => host.focus(), - createList: (user, container, delegate, renderers, options) => this.instantiationService.createInstance(_list_browser_listService_js__WEBPACK_IMPORTED_MODULE_9__["WorkbenchList"], user, container, delegate, renderers, options), - styles: this.computeStyles() - }; - const controller = this._register(new _base_parts_quickinput_browser_quickInput_js__WEBPACK_IMPORTED_MODULE_8__["QuickInputController"](Object.assign(Object.assign({}, defaultOptions), options))); - controller.layout(host.dimension, (_b = (_a = host.offset) === null || _a === void 0 ? void 0 : _a.top) !== null && _b !== void 0 ? _b : 0); - // Layout changes - this._register(host.onLayout(dimension => { var _a, _b; return controller.layout(dimension, (_b = (_a = host.offset) === null || _a === void 0 ? void 0 : _a.top) !== null && _b !== void 0 ? _b : 0); })); - // Context keys - this._register(controller.onShow(() => this.resetContextKeys())); - this._register(controller.onHide(() => this.resetContextKeys())); - return controller; - } - setContextKey(id) { - let key; - if (id) { - key = this.contexts.get(id); - if (!key) { - key = new _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__["RawContextKey"](id, false) - .bindTo(this.contextKeyService); - this.contexts.set(id, key); - } - } - if (key && key.get()) { - return; // already active context - } - this.resetContextKeys(); - if (key) { - key.set(true); - } - } - resetContextKeys() { - this.contexts.forEach(context => { - if (context.get()) { - context.reset(); - } - }); - } - pick(picks, options = {}, token = _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_4__["CancellationToken"].None) { - return this.controller.pick(picks, options, token); - } - createQuickPick() { - return this.controller.createQuickPick(); - } - updateStyles() { - this.controller.applyStyles(this.computeStyles()); - } - computeStyles() { - return { - widget: Object.assign({}, Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_5__["computeStyles"])(this.theme, { - quickInputBackground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["quickInputBackground"], - quickInputForeground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["quickInputForeground"], - quickInputTitleBackground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["quickInputTitleBackground"], - contrastBorder: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["contrastBorder"], - widgetShadow: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["widgetShadow"] - })), - inputBox: Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_5__["computeStyles"])(this.theme, { - inputForeground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["inputForeground"], - inputBackground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["inputBackground"], - inputBorder: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["inputBorder"], - inputValidationInfoBackground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["inputValidationInfoBackground"], - inputValidationInfoForeground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["inputValidationInfoForeground"], - inputValidationInfoBorder: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["inputValidationInfoBorder"], - inputValidationWarningBackground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["inputValidationWarningBackground"], - inputValidationWarningForeground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["inputValidationWarningForeground"], - inputValidationWarningBorder: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["inputValidationWarningBorder"], - inputValidationErrorBackground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["inputValidationErrorBackground"], - inputValidationErrorForeground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["inputValidationErrorForeground"], - inputValidationErrorBorder: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["inputValidationErrorBorder"] - }), - countBadge: Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_5__["computeStyles"])(this.theme, { - badgeBackground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["badgeBackground"], - badgeForeground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["badgeForeground"], - badgeBorder: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["contrastBorder"] - }), - button: Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_5__["computeStyles"])(this.theme, { - buttonForeground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["buttonForeground"], - buttonBackground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["buttonBackground"], - buttonHoverBackground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["buttonHoverBackground"], - buttonBorder: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["contrastBorder"] - }), - progressBar: Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_5__["computeStyles"])(this.theme, { - progressBarBackground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["progressBarBackground"] - }), - list: Object(_theme_common_styler_js__WEBPACK_IMPORTED_MODULE_5__["computeStyles"])(this.theme, { - listBackground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["quickInputBackground"], - // Look like focused when inactive. - listInactiveFocusForeground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["listFocusForeground"], - listInactiveFocusBackground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["listFocusBackground"], - listFocusOutline: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["activeContrastBorder"], - listInactiveFocusOutline: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["activeContrastBorder"], - pickerGroupBorder: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["pickerGroupBorder"], - pickerGroupForeground: _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_3__["pickerGroupForeground"] - }) - }; - } -}; -QuickInputService = __decorate([ - __param(0, _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_1__["IInstantiationService"]), - __param(1, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__["IContextKeyService"]), - __param(2, _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_2__["IThemeService"]), - __param(3, _accessibility_common_accessibility_js__WEBPACK_IMPORTED_MODULE_7__["IAccessibilityService"]), - __param(4, _layout_browser_layoutService_js__WEBPACK_IMPORTED_MODULE_0__["ILayoutService"]) -], QuickInputService); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickAccess.js ***! - \*************************************************************************************/ -/*! exports provided: DefaultQuickAccessFilterValue, Extensions, QuickAccessRegistry */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultQuickAccessFilterValue", function() { return DefaultQuickAccessFilterValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Extensions", function() { return Extensions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuickAccessRegistry", function() { return QuickAccessRegistry; }); -/* harmony import */ var _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -var DefaultQuickAccessFilterValue; -(function (DefaultQuickAccessFilterValue) { - /** - * Keep the value as it is given to quick access. - */ - DefaultQuickAccessFilterValue[DefaultQuickAccessFilterValue["PRESERVE"] = 0] = "PRESERVE"; - /** - * Use the value that was used last time something was accepted from the picker. - */ - DefaultQuickAccessFilterValue[DefaultQuickAccessFilterValue["LAST"] = 1] = "LAST"; -})(DefaultQuickAccessFilterValue || (DefaultQuickAccessFilterValue = {})); -const Extensions = { - Quickaccess: 'workbench.contributions.quickaccess' -}; -class QuickAccessRegistry { - constructor() { - this.providers = []; - this.defaultProvider = undefined; - } - registerQuickAccessProvider(provider) { - // Extract the default provider when no prefix is present - if (provider.prefix.length === 0) { - this.defaultProvider = provider; - } - else { - this.providers.push(provider); - } - // sort the providers by decreasing prefix length, such that longer - // prefixes take priority: 'ext' vs 'ext install' - the latter should win - this.providers.sort((providerA, providerB) => providerB.prefix.length - providerA.prefix.length); - return Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["toDisposable"])(() => { - this.providers.splice(this.providers.indexOf(provider), 1); - if (this.defaultProvider === provider) { - this.defaultProvider = undefined; - } - }); - } - getQuickAccessProviders() { - return Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_1__["coalesce"])([this.defaultProvider, ...this.providers]); - } - getQuickAccessProvider(prefix) { - const result = prefix ? (this.providers.find(provider => prefix.startsWith(provider.prefix)) || undefined) : undefined; - return result || this.defaultProvider; - } -} -_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__["Registry"].add(Extensions.Quickaccess, new QuickAccessRegistry()); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickInput.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/quickinput/common/quickInput.js ***! - \************************************************************************************/ -/*! exports provided: IQuickInputService, NO_KEY_MODS, ItemActivation */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IQuickInputService", function() { return IQuickInputService; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_parts_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/parts/quickinput/common/quickInput.js */ "./node_modules/monaco-editor/esm/vs/base/parts/quickinput/common/quickInput.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NO_KEY_MODS", function() { return _base_parts_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__["NO_KEY_MODS"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ItemActivation", function() { return _base_parts_quickinput_common_quickInput_js__WEBPACK_IMPORTED_MODULE_1__["ItemActivation"]; }); - - - -const IQuickInputService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('quickInputService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js ***! - \********************************************************************************/ -/*! exports provided: Registry */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Registry", function() { return Registry; }); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/* harmony import */ var _base_common_assert_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/assert.js */ "./node_modules/monaco-editor/esm/vs/base/common/assert.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class RegistryImpl { - constructor() { - this.data = new Map(); - } - add(id, data) { - _base_common_assert_js__WEBPACK_IMPORTED_MODULE_1__["ok"](_base_common_types_js__WEBPACK_IMPORTED_MODULE_0__["isString"](id)); - _base_common_assert_js__WEBPACK_IMPORTED_MODULE_1__["ok"](_base_common_types_js__WEBPACK_IMPORTED_MODULE_0__["isObject"](data)); - _base_common_assert_js__WEBPACK_IMPORTED_MODULE_1__["ok"](!this.data.has(id), 'There is already an extension with this id'); - this.data.set(id, data); - } - as(id) { - return this.data.get(id) || null; - } -} -const Registry = new RegistryImpl(); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/severityIcon/common/severityIcon.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/severityIcon/common/severityIcon.js ***! - \****************************************************************************************/ -/*! exports provided: SeverityIcon */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SeverityIcon", function() { return SeverityIcon; }); -/* harmony import */ var _base_common_severity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/severity.js */ "./node_modules/monaco-editor/esm/vs/base/common/severity.js"); -/* harmony import */ var _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/common/themeService.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js"); -/* harmony import */ var _theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/common/colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/codicons.js */ "./node_modules/monaco-editor/esm/vs/base/common/codicons.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -var SeverityIcon; -(function (SeverityIcon) { - function className(severity) { - switch (severity) { - case _base_common_severity_js__WEBPACK_IMPORTED_MODULE_0__["default"].Ignore: - return 'severity-ignore ' + _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_3__["Codicon"].info.classNames; - case _base_common_severity_js__WEBPACK_IMPORTED_MODULE_0__["default"].Info: - return _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_3__["Codicon"].info.classNames; - case _base_common_severity_js__WEBPACK_IMPORTED_MODULE_0__["default"].Warning: - return _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_3__["Codicon"].warning.classNames; - case _base_common_severity_js__WEBPACK_IMPORTED_MODULE_0__["default"].Error: - return _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_3__["Codicon"].error.classNames; - default: - return ''; - } - } - SeverityIcon.className = className; -})(SeverityIcon || (SeverityIcon = {})); -Object(_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_1__["registerThemingParticipant"])((theme, collector) => { - const errorIconForeground = theme.getColor(_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["problemsErrorIconForeground"]); - if (errorIconForeground) { - const errorCodiconSelector = _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_3__["Codicon"].error.cssSelector; - collector.addRule(` - .monaco-editor .zone-widget ${errorCodiconSelector}, - .markers-panel .marker-icon${errorCodiconSelector}, - .extensions-viewlet > .extensions ${errorCodiconSelector} { - color: ${errorIconForeground}; - } - `); - } - const warningIconForeground = theme.getColor(_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["problemsWarningIconForeground"]); - if (warningIconForeground) { - const warningCodiconSelector = _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_3__["Codicon"].warning.cssSelector; - collector.addRule(` - .monaco-editor .zone-widget ${warningCodiconSelector}, - .markers-panel .marker-icon${warningCodiconSelector}, - .extensions-viewlet > .extensions ${warningCodiconSelector}, - .extension-editor ${warningCodiconSelector} { - color: ${warningIconForeground}; - } - `); - } - const infoIconForeground = theme.getColor(_theme_common_colorRegistry_js__WEBPACK_IMPORTED_MODULE_2__["problemsInfoIconForeground"]); - if (infoIconForeground) { - const infoCodiconSelector = _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_3__["Codicon"].info.cssSelector; - collector.addRule(` - .monaco-editor .zone-widget ${infoCodiconSelector}, - .markers-panel .marker-icon${infoCodiconSelector}, - .extensions-viewlet > .extensions ${infoCodiconSelector}, - .extension-editor ${infoCodiconSelector} { - color: ${infoIconForeground}; - } - `); - } -}); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/storage/common/storage.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/storage/common/storage.js ***! - \******************************************************************************/ -/*! exports provided: IStorageService, WillSaveStateReason, InMemoryStorageService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IStorageService", function() { return IStorageService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WillSaveStateReason", function() { return WillSaveStateReason; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InMemoryStorageService", function() { return InMemoryStorageService; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -const IStorageService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('storageService'); -var WillSaveStateReason; -(function (WillSaveStateReason) { - WillSaveStateReason[WillSaveStateReason["NONE"] = 0] = "NONE"; - WillSaveStateReason[WillSaveStateReason["SHUTDOWN"] = 1] = "SHUTDOWN"; -})(WillSaveStateReason || (WillSaveStateReason = {})); -class InMemoryStorageService extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"] { - constructor() { - super(...arguments); - this._onDidChangeStorage = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this._onWillSaveState = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"]()); - this.onWillSaveState = this._onWillSaveState.event; - this.globalCache = new Map(); - this.workspaceCache = new Map(); - } - getCache(scope) { - return scope === 0 /* GLOBAL */ ? this.globalCache : this.workspaceCache; - } - get(key, scope, fallbackValue) { - const value = this.getCache(scope).get(key); - if (Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_3__["isUndefinedOrNull"])(value)) { - return fallbackValue; - } - return value; - } - getBoolean(key, scope, fallbackValue) { - const value = this.getCache(scope).get(key); - if (Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_3__["isUndefinedOrNull"])(value)) { - return fallbackValue; - } - return value === 'true'; - } - getNumber(key, scope, fallbackValue) { - const value = this.getCache(scope).get(key); - if (Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_3__["isUndefinedOrNull"])(value)) { - return fallbackValue; - } - return parseInt(value, 10); - } - store(key, value, scope) { - // We remove the key for undefined/null values - if (Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_3__["isUndefinedOrNull"])(value)) { - return this.remove(key, scope); - } - // Otherwise, convert to String and store - const valueStr = String(value); - // Return early if value already set - const currentValue = this.getCache(scope).get(key); - if (currentValue === valueStr) { - return Promise.resolve(); - } - // Update in cache - this.getCache(scope).set(key, valueStr); - // Events - this._onDidChangeStorage.fire({ scope, key }); - return Promise.resolve(); - } - remove(key, scope) { - const wasDeleted = this.getCache(scope).delete(key); - if (!wasDeleted) { - return Promise.resolve(); // Return early if value already deleted - } - // Events - this._onDidChangeStorage.fire({ scope, key }); - return Promise.resolve(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/telemetry/common/telemetry.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/telemetry/common/telemetry.js ***! - \**********************************************************************************/ -/*! exports provided: ITelemetryService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ITelemetryService", function() { return ITelemetryService; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const ITelemetryService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('telemetryService'); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js ***! - \**********************************************************************************/ -/*! exports provided: Extensions, registerColor, foreground, errorForeground, iconForeground, focusBorder, contrastBorder, activeContrastBorder, textLinkForeground, textCodeBlockBackground, widgetShadow, inputBackground, inputForeground, inputBorder, inputActiveOptionBorder, inputActiveOptionBackground, inputActiveOptionForeground, inputValidationInfoBackground, inputValidationInfoForeground, inputValidationInfoBorder, inputValidationWarningBackground, inputValidationWarningForeground, inputValidationWarningBorder, inputValidationErrorBackground, inputValidationErrorForeground, inputValidationErrorBorder, selectBackground, selectForeground, buttonForeground, buttonBackground, buttonHoverBackground, badgeBackground, badgeForeground, scrollbarShadow, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, progressBarBackground, editorErrorForeground, editorErrorBorder, editorWarningForeground, editorWarningBorder, editorInfoForeground, editorInfoBorder, editorHintForeground, editorHintBorder, editorBackground, editorForeground, editorWidgetBackground, editorWidgetForeground, editorWidgetBorder, editorWidgetResizeBorder, quickInputBackground, quickInputForeground, quickInputTitleBackground, pickerGroupForeground, pickerGroupBorder, editorSelectionBackground, editorSelectionForeground, editorInactiveSelection, editorSelectionHighlight, editorSelectionHighlightBorder, editorFindMatch, editorFindMatchHighlight, editorFindRangeHighlight, editorFindMatchBorder, editorFindMatchHighlightBorder, editorFindRangeHighlightBorder, editorHoverHighlight, editorHoverBackground, editorHoverForeground, editorHoverBorder, editorHoverStatusBarBackground, editorActiveLinkForeground, editorLightBulbForeground, editorLightBulbAutoFixForeground, defaultInsertColor, defaultRemoveColor, diffInserted, diffRemoved, diffInsertedOutline, diffRemovedOutline, diffBorder, diffDiagonalFill, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionBackground, listInactiveSelectionForeground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, listHighlightForeground, listFilterWidgetBackground, listFilterWidgetOutline, listFilterWidgetNoMatchesOutline, treeIndentGuidesStroke, menuBorder, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuSeparatorBackground, snippetTabstopHighlightBackground, snippetTabstopHighlightBorder, snippetFinalTabstopHighlightBackground, snippetFinalTabstopHighlightBorder, overviewRulerFindMatchForeground, overviewRulerSelectionHighlightForeground, minimapFindMatch, minimapSelection, minimapError, minimapWarning, minimapBackground, minimapSliderBackground, minimapSliderHoverBackground, minimapSliderActiveBackground, problemsErrorIconForeground, problemsWarningIconForeground, problemsInfoIconForeground, darken, lighten, transparent, oneOf, resolveColorValue, workbenchColorsSchemaId */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Extensions", function() { return Extensions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerColor", function() { return registerColor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "foreground", function() { return foreground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "errorForeground", function() { return errorForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iconForeground", function() { return iconForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "focusBorder", function() { return focusBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "contrastBorder", function() { return contrastBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "activeContrastBorder", function() { return activeContrastBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "textLinkForeground", function() { return textLinkForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "textCodeBlockBackground", function() { return textCodeBlockBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "widgetShadow", function() { return widgetShadow; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputBackground", function() { return inputBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputForeground", function() { return inputForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputBorder", function() { return inputBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputActiveOptionBorder", function() { return inputActiveOptionBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputActiveOptionBackground", function() { return inputActiveOptionBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputActiveOptionForeground", function() { return inputActiveOptionForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputValidationInfoBackground", function() { return inputValidationInfoBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputValidationInfoForeground", function() { return inputValidationInfoForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputValidationInfoBorder", function() { return inputValidationInfoBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputValidationWarningBackground", function() { return inputValidationWarningBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputValidationWarningForeground", function() { return inputValidationWarningForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputValidationWarningBorder", function() { return inputValidationWarningBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputValidationErrorBackground", function() { return inputValidationErrorBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputValidationErrorForeground", function() { return inputValidationErrorForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inputValidationErrorBorder", function() { return inputValidationErrorBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectBackground", function() { return selectBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectForeground", function() { return selectForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buttonForeground", function() { return buttonForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buttonBackground", function() { return buttonBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buttonHoverBackground", function() { return buttonHoverBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "badgeBackground", function() { return badgeBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "badgeForeground", function() { return badgeForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollbarShadow", function() { return scrollbarShadow; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollbarSliderBackground", function() { return scrollbarSliderBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollbarSliderHoverBackground", function() { return scrollbarSliderHoverBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollbarSliderActiveBackground", function() { return scrollbarSliderActiveBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "progressBarBackground", function() { return progressBarBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorErrorForeground", function() { return editorErrorForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorErrorBorder", function() { return editorErrorBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorWarningForeground", function() { return editorWarningForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorWarningBorder", function() { return editorWarningBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorInfoForeground", function() { return editorInfoForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorInfoBorder", function() { return editorInfoBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorHintForeground", function() { return editorHintForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorHintBorder", function() { return editorHintBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorBackground", function() { return editorBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorForeground", function() { return editorForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorWidgetBackground", function() { return editorWidgetBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorWidgetForeground", function() { return editorWidgetForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorWidgetBorder", function() { return editorWidgetBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorWidgetResizeBorder", function() { return editorWidgetResizeBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quickInputBackground", function() { return quickInputBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quickInputForeground", function() { return quickInputForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "quickInputTitleBackground", function() { return quickInputTitleBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pickerGroupForeground", function() { return pickerGroupForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pickerGroupBorder", function() { return pickerGroupBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorSelectionBackground", function() { return editorSelectionBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorSelectionForeground", function() { return editorSelectionForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorInactiveSelection", function() { return editorInactiveSelection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorSelectionHighlight", function() { return editorSelectionHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorSelectionHighlightBorder", function() { return editorSelectionHighlightBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorFindMatch", function() { return editorFindMatch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorFindMatchHighlight", function() { return editorFindMatchHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorFindRangeHighlight", function() { return editorFindRangeHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorFindMatchBorder", function() { return editorFindMatchBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorFindMatchHighlightBorder", function() { return editorFindMatchHighlightBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorFindRangeHighlightBorder", function() { return editorFindRangeHighlightBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorHoverHighlight", function() { return editorHoverHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorHoverBackground", function() { return editorHoverBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorHoverForeground", function() { return editorHoverForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorHoverBorder", function() { return editorHoverBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorHoverStatusBarBackground", function() { return editorHoverStatusBarBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorActiveLinkForeground", function() { return editorActiveLinkForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorLightBulbForeground", function() { return editorLightBulbForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "editorLightBulbAutoFixForeground", function() { return editorLightBulbAutoFixForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultInsertColor", function() { return defaultInsertColor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultRemoveColor", function() { return defaultRemoveColor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "diffInserted", function() { return diffInserted; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "diffRemoved", function() { return diffRemoved; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "diffInsertedOutline", function() { return diffInsertedOutline; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "diffRemovedOutline", function() { return diffRemovedOutline; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "diffBorder", function() { return diffBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "diffDiagonalFill", function() { return diffDiagonalFill; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listFocusBackground", function() { return listFocusBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listFocusForeground", function() { return listFocusForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listActiveSelectionBackground", function() { return listActiveSelectionBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listActiveSelectionForeground", function() { return listActiveSelectionForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listInactiveSelectionBackground", function() { return listInactiveSelectionBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listInactiveSelectionForeground", function() { return listInactiveSelectionForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listInactiveFocusBackground", function() { return listInactiveFocusBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listHoverBackground", function() { return listHoverBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listHoverForeground", function() { return listHoverForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listDropBackground", function() { return listDropBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listHighlightForeground", function() { return listHighlightForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listFilterWidgetBackground", function() { return listFilterWidgetBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listFilterWidgetOutline", function() { return listFilterWidgetOutline; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "listFilterWidgetNoMatchesOutline", function() { return listFilterWidgetNoMatchesOutline; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "treeIndentGuidesStroke", function() { return treeIndentGuidesStroke; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "menuBorder", function() { return menuBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "menuForeground", function() { return menuForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "menuBackground", function() { return menuBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "menuSelectionForeground", function() { return menuSelectionForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "menuSelectionBackground", function() { return menuSelectionBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "menuSelectionBorder", function() { return menuSelectionBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "menuSeparatorBackground", function() { return menuSeparatorBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "snippetTabstopHighlightBackground", function() { return snippetTabstopHighlightBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "snippetTabstopHighlightBorder", function() { return snippetTabstopHighlightBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "snippetFinalTabstopHighlightBackground", function() { return snippetFinalTabstopHighlightBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "snippetFinalTabstopHighlightBorder", function() { return snippetFinalTabstopHighlightBorder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "overviewRulerFindMatchForeground", function() { return overviewRulerFindMatchForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "overviewRulerSelectionHighlightForeground", function() { return overviewRulerSelectionHighlightForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minimapFindMatch", function() { return minimapFindMatch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minimapSelection", function() { return minimapSelection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minimapError", function() { return minimapError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minimapWarning", function() { return minimapWarning; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minimapBackground", function() { return minimapBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minimapSliderBackground", function() { return minimapSliderBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minimapSliderHoverBackground", function() { return minimapSliderHoverBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minimapSliderActiveBackground", function() { return minimapSliderActiveBackground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "problemsErrorIconForeground", function() { return problemsErrorIconForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "problemsWarningIconForeground", function() { return problemsWarningIconForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "problemsInfoIconForeground", function() { return problemsInfoIconForeground; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "darken", function() { return darken; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lighten", function() { return lighten; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transparent", function() { return transparent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "oneOf", function() { return oneOf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolveColorValue", function() { return resolveColorValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "workbenchColorsSchemaId", function() { return workbenchColorsSchemaId; }); -/* harmony import */ var _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/color.js */ "./node_modules/monaco-editor/esm/vs/base/common/color.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _jsonschemas_common_jsonContributionRegistry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../jsonschemas/common/jsonContributionRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js"); -/* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/async.js */ "./node_modules/monaco-editor/esm/vs/base/common/async.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - -// color registry -const Extensions = { - ColorContribution: 'base.contributions.colors' -}; -class ColorRegistry { - constructor() { - this._onDidChangeSchema = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"](); - this.onDidChangeSchema = this._onDidChangeSchema.event; - this.colorSchema = { type: 'object', properties: {} }; - this.colorReferenceSchema = { type: 'string', enum: [], enumDescriptions: [] }; - this.colorsById = {}; - } - registerColor(id, defaults, description, needsTransparency = false, deprecationMessage) { - let colorContribution = { id, description, defaults, needsTransparency, deprecationMessage }; - this.colorsById[id] = colorContribution; - let propertySchema = { type: 'string', description, format: 'color-hex', defaultSnippets: [{ body: '${1:#ff0000}' }] }; - if (deprecationMessage) { - propertySchema.deprecationMessage = deprecationMessage; - } - this.colorSchema.properties[id] = propertySchema; - this.colorReferenceSchema.enum.push(id); - this.colorReferenceSchema.enumDescriptions.push(description); - this._onDidChangeSchema.fire(); - return id; - } - resolveDefaultColor(id, theme) { - const colorDesc = this.colorsById[id]; - if (colorDesc && colorDesc.defaults) { - const colorValue = colorDesc.defaults[theme.type]; - return resolveColorValue(colorValue, theme); - } - return undefined; - } - getColorSchema() { - return this.colorSchema; - } - toString() { - let sorter = (a, b) => { - let cat1 = a.indexOf('.') === -1 ? 0 : 1; - let cat2 = b.indexOf('.') === -1 ? 0 : 1; - if (cat1 !== cat2) { - return cat1 - cat2; - } - return a.localeCompare(b); - }; - return Object.keys(this.colorsById).sort(sorter).map(k => `- \`${k}\`: ${this.colorsById[k].description}`).join('\n'); - } -} -const colorRegistry = new ColorRegistry(); -_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__["Registry"].add(Extensions.ColorContribution, colorRegistry); -function registerColor(id, defaults, description, needsTransparency, deprecationMessage) { - return colorRegistry.registerColor(id, defaults, description, needsTransparency, deprecationMessage); -} -// ----- base colors -const foreground = registerColor('foreground', { dark: '#CCCCCC', light: '#616161', hc: '#FFFFFF' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('foreground', "Overall foreground color. This color is only used if not overridden by a component.")); -const errorForeground = registerColor('errorForeground', { dark: '#F48771', light: '#A1260D', hc: '#F48771' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('errorForeground', "Overall foreground color for error messages. This color is only used if not overridden by a component.")); -const iconForeground = registerColor('icon.foreground', { dark: '#C5C5C5', light: '#424242', hc: '#FFFFFF' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('iconForeground', "The default color for icons in the workbench.")); -const focusBorder = registerColor('focusBorder', { dark: '#007FD4', light: '#0090F1', hc: '#F38518' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('focusBorder', "Overall border color for focused elements. This color is only used if not overridden by a component.")); -const contrastBorder = registerColor('contrastBorder', { light: null, dark: null, hc: '#6FC3DF' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('contrastBorder', "An extra border around elements to separate them from others for greater contrast.")); -const activeContrastBorder = registerColor('contrastActiveBorder', { light: null, dark: null, hc: focusBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('activeContrastBorder', "An extra border around active elements to separate them from others for greater contrast.")); -const textLinkForeground = registerColor('textLink.foreground', { light: '#006AB1', dark: '#3794FF', hc: '#3794FF' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('textLinkForeground', "Foreground color for links in text.")); -const textCodeBlockBackground = registerColor('textCodeBlock.background', { light: '#dcdcdc66', dark: '#0a0a0a66', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].black }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('textCodeBlockBackground', "Background color for code blocks in text.")); -// ----- widgets -const widgetShadow = registerColor('widget.shadow', { dark: '#000000', light: '#A8A8A8', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('widgetShadow', 'Shadow color of widgets such as find/replace inside the editor.')); -const inputBackground = registerColor('input.background', { dark: '#3C3C3C', light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white, hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].black }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputBoxBackground', "Input box background.")); -const inputForeground = registerColor('input.foreground', { dark: foreground, light: foreground, hc: foreground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputBoxForeground', "Input box foreground.")); -const inputBorder = registerColor('input.border', { dark: null, light: null, hc: contrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputBoxBorder', "Input box border.")); -const inputActiveOptionBorder = registerColor('inputOption.activeBorder', { dark: '#007ACC00', light: '#007ACC00', hc: contrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputBoxActiveOptionBorder', "Border color of activated options in input fields.")); -const inputActiveOptionBackground = registerColor('inputOption.activeBackground', { dark: transparent(focusBorder, 0.4), light: transparent(focusBorder, 0.2), hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].transparent }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputOption.activeBackground', "Background color of activated options in input fields.")); -const inputActiveOptionForeground = registerColor('inputOption.activeForeground', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white, light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].black, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputOption.activeForeground', "Foreground color of activated options in input fields.")); -const inputValidationInfoBackground = registerColor('inputValidation.infoBackground', { dark: '#063B49', light: '#D6ECF2', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].black }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputValidationInfoBackground', "Input validation background color for information severity.")); -const inputValidationInfoForeground = registerColor('inputValidation.infoForeground', { dark: null, light: null, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputValidationInfoForeground', "Input validation foreground color for information severity.")); -const inputValidationInfoBorder = registerColor('inputValidation.infoBorder', { dark: '#007acc', light: '#007acc', hc: contrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputValidationInfoBorder', "Input validation border color for information severity.")); -const inputValidationWarningBackground = registerColor('inputValidation.warningBackground', { dark: '#352A05', light: '#F6F5D2', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].black }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputValidationWarningBackground', "Input validation background color for warning severity.")); -const inputValidationWarningForeground = registerColor('inputValidation.warningForeground', { dark: null, light: null, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputValidationWarningForeground', "Input validation foreground color for warning severity.")); -const inputValidationWarningBorder = registerColor('inputValidation.warningBorder', { dark: '#B89500', light: '#B89500', hc: contrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputValidationWarningBorder', "Input validation border color for warning severity.")); -const inputValidationErrorBackground = registerColor('inputValidation.errorBackground', { dark: '#5A1D1D', light: '#F2DEDE', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].black }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputValidationErrorBackground', "Input validation background color for error severity.")); -const inputValidationErrorForeground = registerColor('inputValidation.errorForeground', { dark: null, light: null, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputValidationErrorForeground', "Input validation foreground color for error severity.")); -const inputValidationErrorBorder = registerColor('inputValidation.errorBorder', { dark: '#BE1100', light: '#BE1100', hc: contrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('inputValidationErrorBorder', "Input validation border color for error severity.")); -const selectBackground = registerColor('dropdown.background', { dark: '#3C3C3C', light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white, hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].black }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('dropdownBackground', "Dropdown background.")); -const selectForeground = registerColor('dropdown.foreground', { dark: '#F0F0F0', light: null, hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('dropdownForeground', "Dropdown foreground.")); -const buttonForeground = registerColor('button.foreground', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white, light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white, hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('buttonForeground', "Button foreground color.")); -const buttonBackground = registerColor('button.background', { dark: '#0E639C', light: '#007ACC', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('buttonBackground', "Button background color.")); -const buttonHoverBackground = registerColor('button.hoverBackground', { dark: lighten(buttonBackground, 0.2), light: darken(buttonBackground, 0.2), hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('buttonHoverBackground', "Button background color when hovering.")); -const badgeBackground = registerColor('badge.background', { dark: '#4D4D4D', light: '#C4C4C4', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].black }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('badgeBackground', "Badge background color. Badges are small information labels, e.g. for search results count.")); -const badgeForeground = registerColor('badge.foreground', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white, light: '#333', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('badgeForeground', "Badge foreground color. Badges are small information labels, e.g. for search results count.")); -const scrollbarShadow = registerColor('scrollbar.shadow', { dark: '#000000', light: '#DDDDDD', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('scrollbarShadow', "Scrollbar shadow to indicate that the view is scrolled.")); -const scrollbarSliderBackground = registerColor('scrollbarSlider.background', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#797979').transparent(0.4), light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#646464').transparent(0.4), hc: transparent(contrastBorder, 0.6) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('scrollbarSliderBackground', "Scrollbar slider background color.")); -const scrollbarSliderHoverBackground = registerColor('scrollbarSlider.hoverBackground', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#646464').transparent(0.7), light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#646464').transparent(0.7), hc: transparent(contrastBorder, 0.8) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('scrollbarSliderHoverBackground', "Scrollbar slider background color when hovering.")); -const scrollbarSliderActiveBackground = registerColor('scrollbarSlider.activeBackground', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#BFBFBF').transparent(0.4), light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#000000').transparent(0.6), hc: contrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('scrollbarSliderActiveBackground', "Scrollbar slider background color when clicked on.")); -const progressBarBackground = registerColor('progressBar.background', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#0E70C0'), light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#0E70C0'), hc: contrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('progressBarBackground', "Background color of the progress bar that can show for long running operations.")); -const editorErrorForeground = registerColor('editorError.foreground', { dark: '#F48771', light: '#E51400', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorError.foreground', 'Foreground color of error squigglies in the editor.')); -const editorErrorBorder = registerColor('editorError.border', { dark: null, light: null, hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#E47777').transparent(0.8) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('errorBorder', 'Border color of error boxes in the editor.')); -const editorWarningForeground = registerColor('editorWarning.foreground', { dark: '#CCA700', light: '#E9A700', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorWarning.foreground', 'Foreground color of warning squigglies in the editor.')); -const editorWarningBorder = registerColor('editorWarning.border', { dark: null, light: null, hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#FFCC00').transparent(0.8) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('warningBorder', 'Border color of warning boxes in the editor.')); -const editorInfoForeground = registerColor('editorInfo.foreground', { dark: '#75BEFF', light: '#75BEFF', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorInfo.foreground', 'Foreground color of info squigglies in the editor.')); -const editorInfoBorder = registerColor('editorInfo.border', { dark: null, light: null, hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#75BEFF').transparent(0.8) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('infoBorder', 'Border color of info boxes in the editor.')); -const editorHintForeground = registerColor('editorHint.foreground', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#eeeeee').transparent(0.7), light: '#6c6c6c', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorHint.foreground', 'Foreground color of hint squigglies in the editor.')); -const editorHintBorder = registerColor('editorHint.border', { dark: null, light: null, hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex('#eeeeee').transparent(0.8) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('hintBorder', 'Border color of hint boxes in the editor.')); -/** - * Editor background color. - * Because of bug https://monacotools.visualstudio.com/DefaultCollection/Monaco/_workitems/edit/13254 - * we are *not* using the color white (or #ffffff, rgba(255,255,255)) but something very close to white. - */ -const editorBackground = registerColor('editor.background', { light: '#fffffe', dark: '#1E1E1E', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].black }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorBackground', "Editor background color.")); -/** - * Editor foreground color. - */ -const editorForeground = registerColor('editor.foreground', { light: '#333333', dark: '#BBBBBB', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorForeground', "Editor default foreground color.")); -/** - * Editor widgets - */ -const editorWidgetBackground = registerColor('editorWidget.background', { dark: '#252526', light: '#F3F3F3', hc: '#0C141F' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorWidgetBackground', 'Background color of editor widgets, such as find/replace.')); -const editorWidgetForeground = registerColor('editorWidget.foreground', { dark: foreground, light: foreground, hc: foreground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorWidgetForeground', 'Foreground color of editor widgets, such as find/replace.')); -const editorWidgetBorder = registerColor('editorWidget.border', { dark: '#454545', light: '#C8C8C8', hc: contrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorWidgetBorder', 'Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.')); -const editorWidgetResizeBorder = registerColor('editorWidget.resizeBorder', { light: null, dark: null, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorWidgetResizeBorder', "Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")); -/** - * Quick pick widget - */ -const quickInputBackground = registerColor('quickInput.background', { dark: editorWidgetBackground, light: editorWidgetBackground, hc: editorWidgetBackground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('pickerBackground', "Quick picker background color. The quick picker widget is the container for pickers like the command palette.")); -const quickInputForeground = registerColor('quickInput.foreground', { dark: editorWidgetForeground, light: editorWidgetForeground, hc: editorWidgetForeground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('pickerForeground', "Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")); -const quickInputTitleBackground = registerColor('quickInputTitle.background', { dark: new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](255, 255, 255, 0.105)), light: new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](0, 0, 0, 0.06)), hc: '#000000' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('pickerTitleBackground', "Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")); -const pickerGroupForeground = registerColor('pickerGroup.foreground', { dark: '#3794FF', light: '#0066BF', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('pickerGroupForeground', "Quick picker color for grouping labels.")); -const pickerGroupBorder = registerColor('pickerGroup.border', { dark: '#3F3F46', light: '#CCCEDB', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('pickerGroupBorder', "Quick picker color for grouping borders.")); -/** - * Editor selection colors. - */ -const editorSelectionBackground = registerColor('editor.selectionBackground', { light: '#ADD6FF', dark: '#264F78', hc: '#f3f518' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorSelectionBackground', "Color of the editor selection.")); -const editorSelectionForeground = registerColor('editor.selectionForeground', { light: null, dark: null, hc: '#000000' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorSelectionForeground', "Color of the selected text for high contrast.")); -const editorInactiveSelection = registerColor('editor.inactiveSelectionBackground', { light: transparent(editorSelectionBackground, 0.5), dark: transparent(editorSelectionBackground, 0.5), hc: transparent(editorSelectionBackground, 0.5) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorInactiveSelection', "Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."), true); -const editorSelectionHighlight = registerColor('editor.selectionHighlightBackground', { light: lessProminent(editorSelectionBackground, editorBackground, 0.3, 0.6), dark: lessProminent(editorSelectionBackground, editorBackground, 0.3, 0.6), hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorSelectionHighlight', 'Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations.'), true); -const editorSelectionHighlightBorder = registerColor('editor.selectionHighlightBorder', { light: null, dark: null, hc: activeContrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorSelectionHighlightBorder', "Border color for regions with the same content as the selection.")); -/** - * Editor find match colors. - */ -const editorFindMatch = registerColor('editor.findMatchBackground', { light: '#A8AC94', dark: '#515C6A', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorFindMatch', "Color of the current search match.")); -const editorFindMatchHighlight = registerColor('editor.findMatchHighlightBackground', { light: '#EA5C0055', dark: '#EA5C0055', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('findMatchHighlight', "Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."), true); -const editorFindRangeHighlight = registerColor('editor.findRangeHighlightBackground', { dark: '#3a3d4166', light: '#b4b4b44d', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('findRangeHighlight', "Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."), true); -const editorFindMatchBorder = registerColor('editor.findMatchBorder', { light: null, dark: null, hc: activeContrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorFindMatchBorder', "Border color of the current search match.")); -const editorFindMatchHighlightBorder = registerColor('editor.findMatchHighlightBorder', { light: null, dark: null, hc: activeContrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('findMatchHighlightBorder', "Border color of the other search matches.")); -const editorFindRangeHighlightBorder = registerColor('editor.findRangeHighlightBorder', { dark: null, light: null, hc: transparent(activeContrastBorder, 0.4) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('findRangeHighlightBorder', "Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."), true); -/** - * Editor hover - */ -const editorHoverHighlight = registerColor('editor.hoverHighlightBackground', { light: '#ADD6FF26', dark: '#264f7840', hc: '#ADD6FF26' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('hoverHighlight', 'Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations.'), true); -const editorHoverBackground = registerColor('editorHoverWidget.background', { light: editorWidgetBackground, dark: editorWidgetBackground, hc: editorWidgetBackground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('hoverBackground', 'Background color of the editor hover.')); -const editorHoverForeground = registerColor('editorHoverWidget.foreground', { light: editorWidgetForeground, dark: editorWidgetForeground, hc: editorWidgetForeground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('hoverForeground', 'Foreground color of the editor hover.')); -const editorHoverBorder = registerColor('editorHoverWidget.border', { light: editorWidgetBorder, dark: editorWidgetBorder, hc: editorWidgetBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('hoverBorder', 'Border color of the editor hover.')); -const editorHoverStatusBarBackground = registerColor('editorHoverWidget.statusBarBackground', { dark: lighten(editorHoverBackground, 0.2), light: darken(editorHoverBackground, 0.05), hc: editorWidgetBackground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('statusBarBackground', "Background color of the editor hover status bar.")); -/** - * Editor link colors - */ -const editorActiveLinkForeground = registerColor('editorLink.activeForeground', { dark: '#4E94CE', light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].blue, hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].cyan }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('activeLinkForeground', 'Color of active links.')); -/** - * Editor lighbulb icon colors - */ -const editorLightBulbForeground = registerColor('editorLightBulb.foreground', { dark: '#FFCC00', light: '#DDB100', hc: '#FFCC00' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorLightBulbForeground', "The color used for the lightbulb actions icon.")); -const editorLightBulbAutoFixForeground = registerColor('editorLightBulbAutoFix.foreground', { dark: '#75BEFF', light: '#007ACC', hc: '#75BEFF' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('editorLightBulbAutoFixForeground', "The color used for the lightbulb auto fix actions icon.")); -/** - * Diff Editor Colors - */ -const defaultInsertColor = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](155, 185, 85, 0.2)); -const defaultRemoveColor = new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](255, 0, 0, 0.2)); -const diffInserted = registerColor('diffEditor.insertedTextBackground', { dark: defaultInsertColor, light: defaultInsertColor, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('diffEditorInserted', 'Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations.'), true); -const diffRemoved = registerColor('diffEditor.removedTextBackground', { dark: defaultRemoveColor, light: defaultRemoveColor, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('diffEditorRemoved', 'Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations.'), true); -const diffInsertedOutline = registerColor('diffEditor.insertedTextBorder', { dark: null, light: null, hc: '#33ff2eff' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('diffEditorInsertedOutline', 'Outline color for the text that got inserted.')); -const diffRemovedOutline = registerColor('diffEditor.removedTextBorder', { dark: null, light: null, hc: '#FF008F' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('diffEditorRemovedOutline', 'Outline color for text that got removed.')); -const diffBorder = registerColor('diffEditor.border', { dark: null, light: null, hc: contrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('diffEditorBorder', 'Border color between the two text editors.')); -const diffDiagonalFill = registerColor('diffEditor.diagonalFill', { dark: '#cccccc33', light: '#22222233', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('diffDiagonalFill', "Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")); -/** - * List and tree colors - */ -const listFocusBackground = registerColor('list.focusBackground', { dark: '#062F4A', light: '#D6EBFF', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listFocusBackground', "List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); -const listFocusForeground = registerColor('list.focusForeground', { dark: null, light: null, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listFocusForeground', "List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); -const listActiveSelectionBackground = registerColor('list.activeSelectionBackground', { dark: '#094771', light: '#0074E8', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listActiveSelectionBackground', "List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); -const listActiveSelectionForeground = registerColor('list.activeSelectionForeground', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white, light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].white, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listActiveSelectionForeground', "List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")); -const listInactiveSelectionBackground = registerColor('list.inactiveSelectionBackground', { dark: '#37373D', light: '#E4E6F1', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listInactiveSelectionBackground', "List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); -const listInactiveSelectionForeground = registerColor('list.inactiveSelectionForeground', { dark: null, light: null, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listInactiveSelectionForeground', "List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); -const listInactiveFocusBackground = registerColor('list.inactiveFocusBackground', { dark: null, light: null, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listInactiveFocusBackground', "List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")); -const listHoverBackground = registerColor('list.hoverBackground', { dark: '#2A2D2E', light: '#F0F0F0', hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listHoverBackground', "List/Tree background when hovering over items using the mouse.")); -const listHoverForeground = registerColor('list.hoverForeground', { dark: null, light: null, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listHoverForeground', "List/Tree foreground when hovering over items using the mouse.")); -const listDropBackground = registerColor('list.dropBackground', { dark: listFocusBackground, light: listFocusBackground, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listDropBackground', "List/Tree drag and drop background when moving items around using the mouse.")); -const listHighlightForeground = registerColor('list.highlightForeground', { dark: '#0097fb', light: '#0066BF', hc: focusBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('highlight', 'List/Tree foreground color of the match highlights when searching inside the list/tree.')); -const listFilterWidgetBackground = registerColor('listFilterWidget.background', { light: '#efc1ad', dark: '#653723', hc: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].black }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listFilterWidgetBackground', 'Background color of the type filter widget in lists and trees.')); -const listFilterWidgetOutline = registerColor('listFilterWidget.outline', { dark: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].transparent, light: _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].transparent, hc: '#f38518' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listFilterWidgetOutline', 'Outline color of the type filter widget in lists and trees.')); -const listFilterWidgetNoMatchesOutline = registerColor('listFilterWidget.noMatchesOutline', { dark: '#BE1100', light: '#BE1100', hc: contrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('listFilterWidgetNoMatchesOutline', 'Outline color of the type filter widget in lists and trees, when there are no matches.')); -const treeIndentGuidesStroke = registerColor('tree.indentGuidesStroke', { dark: '#585858', light: '#a9a9a9', hc: '#a9a9a9' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('treeIndentGuidesStroke', "Tree stroke color for the indentation guides.")); -/** - * Menu colors - */ -const menuBorder = registerColor('menu.border', { dark: null, light: null, hc: contrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('menuBorder', "Border color of menus.")); -const menuForeground = registerColor('menu.foreground', { dark: selectForeground, light: foreground, hc: selectForeground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('menuForeground', "Foreground color of menu items.")); -const menuBackground = registerColor('menu.background', { dark: selectBackground, light: selectBackground, hc: selectBackground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('menuBackground', "Background color of menu items.")); -const menuSelectionForeground = registerColor('menu.selectionForeground', { dark: listActiveSelectionForeground, light: listActiveSelectionForeground, hc: listActiveSelectionForeground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('menuSelectionForeground', "Foreground color of the selected menu item in menus.")); -const menuSelectionBackground = registerColor('menu.selectionBackground', { dark: listActiveSelectionBackground, light: listActiveSelectionBackground, hc: listActiveSelectionBackground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('menuSelectionBackground', "Background color of the selected menu item in menus.")); -const menuSelectionBorder = registerColor('menu.selectionBorder', { dark: null, light: null, hc: activeContrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('menuSelectionBorder', "Border color of the selected menu item in menus.")); -const menuSeparatorBackground = registerColor('menu.separatorBackground', { dark: '#BBBBBB', light: '#888888', hc: contrastBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('menuSeparatorBackground', "Color of a separator menu item in menus.")); -/** - * Snippet placeholder colors - */ -const snippetTabstopHighlightBackground = registerColor('editor.snippetTabstopHighlightBackground', { dark: new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](124, 124, 124, 0.3)), light: new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](10, 50, 100, 0.2)), hc: new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](124, 124, 124, 0.3)) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('snippetTabstopHighlightBackground', "Highlight background color of a snippet tabstop.")); -const snippetTabstopHighlightBorder = registerColor('editor.snippetTabstopHighlightBorder', { dark: null, light: null, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('snippetTabstopHighlightBorder', "Highlight border color of a snippet tabstop.")); -const snippetFinalTabstopHighlightBackground = registerColor('editor.snippetFinalTabstopHighlightBackground', { dark: null, light: null, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('snippetFinalTabstopHighlightBackground', "Highlight background color of the final tabstop of a snippet.")); -const snippetFinalTabstopHighlightBorder = registerColor('editor.snippetFinalTabstopHighlightBorder', { dark: '#525252', light: new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](10, 50, 100, 0.5)), hc: '#525252' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('snippetFinalTabstopHighlightBorder', "Highlight border color of the final tabstop of a snippet.")); -const overviewRulerFindMatchForeground = registerColor('editorOverviewRuler.findMatchForeground', { dark: '#d186167e', light: '#d186167e', hc: '#AB5A00' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('overviewRulerFindMatchForeground', 'Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations.'), true); -const overviewRulerSelectionHighlightForeground = registerColor('editorOverviewRuler.selectionHighlightForeground', { dark: '#A0A0A0CC', light: '#A0A0A0CC', hc: '#A0A0A0CC' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('overviewRulerSelectionHighlightForeground', 'Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations.'), true); -const minimapFindMatch = registerColor('minimap.findMatchHighlight', { light: '#d18616', dark: '#d18616', hc: '#AB5A00' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('minimapFindMatchHighlight', 'Minimap marker color for find matches.'), true); -const minimapSelection = registerColor('minimap.selectionHighlight', { light: '#ADD6FF', dark: '#264F78', hc: '#ffffff' }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('minimapSelectionHighlight', 'Minimap marker color for the editor selection.'), true); -const minimapError = registerColor('minimap.errorHighlight', { dark: new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](255, 18, 18, 0.7)), light: new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](255, 18, 18, 0.7)), hc: new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"](new _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["RGBA"](255, 50, 50, 1)) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('minimapError', 'Minimap marker color for errors.')); -const minimapWarning = registerColor('minimap.warningHighlight', { dark: editorWarningForeground, light: editorWarningForeground, hc: editorWarningBorder }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('overviewRuleWarning', 'Minimap marker color for warnings.')); -const minimapBackground = registerColor('minimap.background', { dark: null, light: null, hc: null }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('minimapBackground', "Minimap background color.")); -const minimapSliderBackground = registerColor('minimapSlider.background', { light: transparent(scrollbarSliderBackground, 0.5), dark: transparent(scrollbarSliderBackground, 0.5), hc: transparent(scrollbarSliderBackground, 0.5) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('minimapSliderBackground', "Minimap slider background color.")); -const minimapSliderHoverBackground = registerColor('minimapSlider.hoverBackground', { light: transparent(scrollbarSliderHoverBackground, 0.5), dark: transparent(scrollbarSliderHoverBackground, 0.5), hc: transparent(scrollbarSliderHoverBackground, 0.5) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('minimapSliderHoverBackground', "Minimap slider background color when hovering.")); -const minimapSliderActiveBackground = registerColor('minimapSlider.activeBackground', { light: transparent(scrollbarSliderActiveBackground, 0.5), dark: transparent(scrollbarSliderActiveBackground, 0.5), hc: transparent(scrollbarSliderActiveBackground, 0.5) }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('minimapSliderActiveBackground', "Minimap slider background color when clicked on.")); -const problemsErrorIconForeground = registerColor('problemsErrorIcon.foreground', { dark: editorErrorForeground, light: editorErrorForeground, hc: editorErrorForeground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('problemsErrorIconForeground', "The color used for the problems error icon.")); -const problemsWarningIconForeground = registerColor('problemsWarningIcon.foreground', { dark: editorWarningForeground, light: editorWarningForeground, hc: editorWarningForeground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('problemsWarningIconForeground', "The color used for the problems warning icon.")); -const problemsInfoIconForeground = registerColor('problemsInfoIcon.foreground', { dark: editorInfoForeground, light: editorInfoForeground, hc: editorInfoForeground }, _nls_js__WEBPACK_IMPORTED_MODULE_3__["localize"]('problemsInfoIconForeground', "The color used for the problems info icon.")); -// ----- color functions -function darken(colorValue, factor) { - return (theme) => { - let color = resolveColorValue(colorValue, theme); - if (color) { - return color.darken(factor); - } - return undefined; - }; -} -function lighten(colorValue, factor) { - return (theme) => { - let color = resolveColorValue(colorValue, theme); - if (color) { - return color.lighten(factor); - } - return undefined; - }; -} -function transparent(colorValue, factor) { - return (theme) => { - let color = resolveColorValue(colorValue, theme); - if (color) { - return color.transparent(factor); - } - return undefined; - }; -} -function oneOf(...colorValues) { - return (theme) => { - for (let colorValue of colorValues) { - let color = resolveColorValue(colorValue, theme); - if (color) { - return color; - } - } - return undefined; - }; -} -function lessProminent(colorValue, backgroundColorValue, factor, transparency) { - return (theme) => { - let from = resolveColorValue(colorValue, theme); - if (from) { - let backgroundColor = resolveColorValue(backgroundColorValue, theme); - if (backgroundColor) { - if (from.isDarkerThan(backgroundColor)) { - return _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].getLighterColor(from, backgroundColor, factor).transparent(transparency); - } - return _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].getDarkerColor(from, backgroundColor, factor).transparent(transparency); - } - return from.transparent(factor * transparency); - } - return undefined; - }; -} -// ----- implementation -/** - * @param colorValue Resolve a color value in the context of a theme - */ -function resolveColorValue(colorValue, theme) { - if (colorValue === null) { - return undefined; - } - else if (typeof colorValue === 'string') { - if (colorValue[0] === '#') { - return _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHex(colorValue); - } - return theme.getColor(colorValue); - } - else if (colorValue instanceof _base_common_color_js__WEBPACK_IMPORTED_MODULE_1__["Color"]) { - return colorValue; - } - else if (typeof colorValue === 'function') { - return colorValue(theme); - } - return undefined; -} -const workbenchColorsSchemaId = 'vscode://schemas/workbench-colors'; -let schemaRegistry = _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_0__["Registry"].as(_jsonschemas_common_jsonContributionRegistry_js__WEBPACK_IMPORTED_MODULE_4__["Extensions"].JSONContribution); -schemaRegistry.registerSchema(workbenchColorsSchemaId, colorRegistry.getColorSchema()); -const delayer = new _base_common_async_js__WEBPACK_IMPORTED_MODULE_5__["RunOnceScheduler"](() => schemaRegistry.notifySchemaChanged(workbenchColorsSchemaId), 200); -colorRegistry.onDidChangeSchema(() => { - if (!delayer.isScheduled()) { - delayer.schedule(); - } -}); -// setTimeout(_ => console.log(colorRegistry.toString()), 5000); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/theme/common/styler.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/theme/common/styler.js ***! - \***************************************************************************/ -/*! exports provided: computeStyles, attachStyler, attachBadgeStyler, attachListStyler, defaultListStyles, defaultMenuStyles, attachMenuStyler */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeStyles", function() { return computeStyles; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "attachStyler", function() { return attachStyler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "attachBadgeStyler", function() { return attachBadgeStyler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "attachListStyler", function() { return attachListStyler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultListStyles", function() { return defaultListStyles; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultMenuStyles", function() { return defaultMenuStyles; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "attachMenuStyler", function() { return attachMenuStyler; }); -/* harmony import */ var _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./colorRegistry.js */ "./node_modules/monaco-editor/esm/vs/platform/theme/common/colorRegistry.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -function computeStyles(theme, styleMap) { - const styles = Object.create(null); - for (let key in styleMap) { - const value = styleMap[key]; - if (value) { - styles[key] = Object(_colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["resolveColorValue"])(value, theme); - } - } - return styles; -} -function attachStyler(themeService, styleMap, widgetOrCallback) { - function applyStyles(theme) { - const styles = computeStyles(themeService.getColorTheme(), styleMap); - if (typeof widgetOrCallback === 'function') { - widgetOrCallback(styles); - } - else { - widgetOrCallback.style(styles); - } - } - applyStyles(themeService.getColorTheme()); - return themeService.onDidColorThemeChange(applyStyles); -} -function attachBadgeStyler(widget, themeService, style) { - return attachStyler(themeService, { - badgeBackground: (style && style.badgeBackground) || _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["badgeBackground"], - badgeForeground: (style && style.badgeForeground) || _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["badgeForeground"], - badgeBorder: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["contrastBorder"] - }, widget); -} -function attachListStyler(widget, themeService, overrides) { - return attachStyler(themeService, Object.assign(Object.assign({}, defaultListStyles), (overrides || {})), widget); -} -const defaultListStyles = { - listFocusBackground: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listFocusBackground"], - listFocusForeground: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listFocusForeground"], - listActiveSelectionBackground: Object(_colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["darken"])(_colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listActiveSelectionBackground"], 0.1), - listActiveSelectionForeground: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listActiveSelectionForeground"], - listFocusAndSelectionBackground: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listActiveSelectionBackground"], - listFocusAndSelectionForeground: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listActiveSelectionForeground"], - listInactiveSelectionBackground: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listInactiveSelectionBackground"], - listInactiveSelectionForeground: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listInactiveSelectionForeground"], - listInactiveFocusBackground: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listInactiveFocusBackground"], - listHoverBackground: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listHoverBackground"], - listHoverForeground: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listHoverForeground"], - listDropBackground: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listDropBackground"], - listFocusOutline: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["activeContrastBorder"], - listSelectionOutline: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["activeContrastBorder"], - listHoverOutline: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["activeContrastBorder"], - listFilterWidgetBackground: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listFilterWidgetBackground"], - listFilterWidgetOutline: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listFilterWidgetOutline"], - listFilterWidgetNoMatchesOutline: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["listFilterWidgetNoMatchesOutline"], - listMatchesShadow: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["widgetShadow"], - treeIndentGuidesStroke: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["treeIndentGuidesStroke"] -}; -const defaultMenuStyles = { - shadowColor: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["widgetShadow"], - borderColor: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["menuBorder"], - foregroundColor: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["menuForeground"], - backgroundColor: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["menuBackground"], - selectionForegroundColor: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["menuSelectionForeground"], - selectionBackgroundColor: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["menuSelectionBackground"], - selectionBorderColor: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["menuSelectionBorder"], - separatorColor: _colorRegistry_js__WEBPACK_IMPORTED_MODULE_0__["menuSeparatorBackground"] -}; -function attachMenuStyler(widget, themeService, style) { - return attachStyler(themeService, Object.assign(Object.assign({}, defaultMenuStyles), style), widget); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/theme/common/themeService.js ***! - \*********************************************************************************/ -/*! exports provided: IThemeService, themeColorFromId, ThemeIcon, DARK, HIGH_CONTRAST, getThemeTypeSelector, Extensions, registerThemingParticipant, Themable */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IThemeService", function() { return IThemeService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "themeColorFromId", function() { return themeColorFromId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeIcon", function() { return ThemeIcon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DARK", function() { return DARK; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HIGH_CONTRAST", function() { return HIGH_CONTRAST; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getThemeTypeSelector", function() { return getThemeTypeSelector; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Extensions", function() { return Extensions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerThemingParticipant", function() { return registerThemingParticipant; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Themable", function() { return Themable; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../registry/common/platform.js */ "./node_modules/monaco-editor/esm/vs/platform/registry/common/platform.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -const IThemeService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('themeService'); -function themeColorFromId(id) { - return { id }; -} -var ThemeIcon; -(function (ThemeIcon) { - function isThemeIcon(obj) { - return obj && typeof obj === 'object' && typeof obj.id === 'string'; - } - ThemeIcon.isThemeIcon = isThemeIcon; - const _regexFromString = /^\$\(([a-z.]+\/)?([a-z-~]+)\)$/i; - function fromString(str) { - const match = _regexFromString.exec(str); - if (!match) { - return undefined; - } - let [, owner, name] = match; - if (!owner) { - owner = `codicon/`; - } - return { id: owner + name }; - } - ThemeIcon.fromString = fromString; - const _regexAsClassName = /^(codicon\/)?([a-z-]+)(~[a-z]+)?$/i; - function asClassName(icon) { - // todo@martin,joh -> this should go into the ThemeService - const match = _regexAsClassName.exec(icon.id); - if (!match) { - return undefined; - } - let [, , name, modifier] = match; - let className = `codicon codicon-${name}`; - if (modifier) { - className += ` ${modifier.substr(1)}`; - } - return className; - } - ThemeIcon.asClassName = asClassName; -})(ThemeIcon || (ThemeIcon = {})); -// base themes -const DARK = 'dark'; -const HIGH_CONTRAST = 'hc'; -function getThemeTypeSelector(type) { - switch (type) { - case DARK: return 'vs-dark'; - case HIGH_CONTRAST: return 'hc-black'; - default: return 'vs'; - } -} -// static theming participant -const Extensions = { - ThemingContribution: 'base.contributions.theming' -}; -class ThemingRegistry { - constructor() { - this.themingParticipants = []; - this.themingParticipants = []; - this.onThemingParticipantAddedEmitter = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__["Emitter"](); - } - onColorThemeChange(participant) { - this.themingParticipants.push(participant); - this.onThemingParticipantAddedEmitter.fire(participant); - return Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => { - const idx = this.themingParticipants.indexOf(participant); - this.themingParticipants.splice(idx, 1); - }); - } - getThemingParticipants() { - return this.themingParticipants; - } -} -let themingRegistry = new ThemingRegistry(); -_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["Registry"].add(Extensions.ThemingContribution, themingRegistry); -function registerThemingParticipant(participant) { - return themingRegistry.onColorThemeChange(participant); -} -/** - * Utility base class for all themable components. - */ -class Themable extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(themeService) { - super(); - this.themeService = themeService; - this.theme = themeService.getColorTheme(); - // Hook up to theme changes - this._register(this.themeService.onDidColorThemeChange(theme => this.onThemeChange(theme))); - } - onThemeChange(theme) { - this.theme = theme; - this.updateStyles(); - } - updateStyles() { - // Subclasses to override - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js": -/*!********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js ***! - \********************************************************************************/ -/*! exports provided: IUndoRedoService, ResourceEditStackSnapshot */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IUndoRedoService", function() { return IUndoRedoService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResourceEditStackSnapshot", function() { return ResourceEditStackSnapshot; }); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const IUndoRedoService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__["createDecorator"])('undoRedoService'); -class ResourceEditStackSnapshot { - constructor(resource, elements) { - this.resource = resource; - this.elements = elements; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedoService.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedoService.js ***! - \***************************************************************************************/ -/*! exports provided: UndoRedoService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UndoRedoService", function() { return UndoRedoService; }); -/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../nls.js */ "./node_modules/monaco-editor/esm/vs/nls.js"); -/* harmony import */ var _undoRedo_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./undoRedo.js */ "./node_modules/monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js"); -/* harmony import */ var _base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../instantiation/common/extensions.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/extensions.js"); -/* harmony import */ var _dialogs_common_dialogs_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../dialogs/common/dialogs.js */ "./node_modules/monaco-editor/esm/vs/platform/dialogs/common/dialogs.js"); -/* harmony import */ var _base_common_severity_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/severity.js */ "./node_modules/monaco-editor/esm/vs/base/common/severity.js"); -/* harmony import */ var _base_common_network_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/network.js */ "./node_modules/monaco-editor/esm/vs/base/common/network.js"); -/* harmony import */ var _notification_common_notification_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../notification/common/notification.js */ "./node_modules/monaco-editor/esm/vs/platform/notification/common/notification.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - -const DEBUG = false; -function getResourceLabel(resource) { - return resource.scheme === _base_common_network_js__WEBPACK_IMPORTED_MODULE_6__["Schemas"].file ? resource.fsPath : resource.path; -} -let stackElementCounter = 0; -class ResourceStackElement { - constructor(actual, resourceLabel, strResource) { - this.id = (++stackElementCounter); - this.type = 0 /* Resource */; - this.actual = actual; - this.label = actual.label; - this.resourceLabel = resourceLabel; - this.strResource = strResource; - this.resourceLabels = [this.resourceLabel]; - this.strResources = [this.strResource]; - this.isValid = true; - } - setValid(isValid) { - this.isValid = isValid; - } - toString() { - return `[${this.id}] [${this.isValid ? 'VALID' : 'INVALID'}] ${this.actual}`; - } -} -class ResourceReasonPair { - constructor(resourceLabel, reason) { - this.resourceLabel = resourceLabel; - this.reason = reason; - } -} -class RemovedResources { - constructor() { - this.elements = new Map(); - } - createMessage() { - const externalRemoval = []; - const noParallelUniverses = []; - for (const [, element] of this.elements) { - const dest = (element.reason === 0 /* ExternalRemoval */ - ? externalRemoval - : noParallelUniverses); - dest.push(element.resourceLabel); - } - let messages = []; - if (externalRemoval.length > 0) { - messages.push(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'externalRemoval', comment: ['{0} is a list of filenames'] }, "The following files have been closed and modified on disk: {0}.", externalRemoval.join(', '))); - } - if (noParallelUniverses.length > 0) { - messages.push(_nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'noParallelUniverses', comment: ['{0} is a list of filenames'] }, "The following files have been modified in an incompatible way: {0}.", noParallelUniverses.join(', '))); - } - return messages.join('\n'); - } - get size() { - return this.elements.size; - } - has(strResource) { - return this.elements.has(strResource); - } - set(strResource, value) { - this.elements.set(strResource, value); - } - delete(strResource) { - return this.elements.delete(strResource); - } -} -class WorkspaceStackElement { - constructor(actual, resourceLabels, strResources) { - this.id = (++stackElementCounter); - this.type = 1 /* Workspace */; - this.actual = actual; - this.label = actual.label; - this.resourceLabels = resourceLabels; - this.strResources = strResources; - this.removedResources = null; - this.invalidatedResources = null; - } - canSplit() { - return (typeof this.actual.split === 'function'); - } - removeResource(resourceLabel, strResource, reason) { - if (!this.removedResources) { - this.removedResources = new RemovedResources(); - } - if (!this.removedResources.has(strResource)) { - this.removedResources.set(strResource, new ResourceReasonPair(resourceLabel, reason)); - } - } - setValid(resourceLabel, strResource, isValid) { - if (isValid) { - if (this.invalidatedResources) { - this.invalidatedResources.delete(strResource); - if (this.invalidatedResources.size === 0) { - this.invalidatedResources = null; - } - } - } - else { - if (!this.invalidatedResources) { - this.invalidatedResources = new RemovedResources(); - } - if (!this.invalidatedResources.has(strResource)) { - this.invalidatedResources.set(strResource, new ResourceReasonPair(resourceLabel, 0 /* ExternalRemoval */)); - } - } - } - toString() { - return `[${this.id}] [${this.invalidatedResources ? 'INVALID' : 'VALID'}] ${this.actual}`; - } -} -class ResourceEditStack { - constructor(resourceLabel, strResource) { - this.resourceLabel = resourceLabel; - this.strResource = strResource; - this._past = []; - this._future = []; - this.locked = false; - this.versionId = 1; - } - dispose() { - for (const element of this._past) { - if (element.type === 1 /* Workspace */) { - element.removeResource(this.resourceLabel, this.strResource, 0 /* ExternalRemoval */); - } - } - for (const element of this._future) { - if (element.type === 1 /* Workspace */) { - element.removeResource(this.resourceLabel, this.strResource, 0 /* ExternalRemoval */); - } - } - this.versionId++; - } - toString() { - let result = []; - result.push(`* ${this.strResource}:`); - for (let i = 0; i < this._past.length; i++) { - result.push(` * [UNDO] ${this._past[i]}`); - } - for (let i = this._future.length - 1; i >= 0; i--) { - result.push(` * [REDO] ${this._future[i]}`); - } - return result.join('\n'); - } - flushAllElements() { - this._past = []; - this._future = []; - this.versionId++; - } - _setElementValidFlag(element, isValid) { - if (element.type === 1 /* Workspace */) { - element.setValid(this.resourceLabel, this.strResource, isValid); - } - else { - element.setValid(isValid); - } - } - setElementsValidFlag(isValid, filter) { - for (const element of this._past) { - if (filter(element.actual)) { - this._setElementValidFlag(element, isValid); - } - } - for (const element of this._future) { - if (filter(element.actual)) { - this._setElementValidFlag(element, isValid); - } - } - } - pushElement(element) { - // remove the future - for (const futureElement of this._future) { - if (futureElement.type === 1 /* Workspace */) { - futureElement.removeResource(this.resourceLabel, this.strResource, 1 /* NoParallelUniverses */); - } - } - this._future = []; - if (this._past.length > 0) { - const lastElement = this._past[this._past.length - 1]; - if (lastElement.type === 0 /* Resource */ && !lastElement.isValid) { - // clear undo stack - this._past = []; - } - } - this._past.push(element); - this.versionId++; - } - createSnapshot(resource) { - const elements = []; - for (let i = 0, len = this._past.length; i < len; i++) { - elements.push(this._past[i].id); - } - for (let i = this._future.length - 1; i >= 0; i--) { - elements.push(this._future[i].id); - } - return new _undoRedo_js__WEBPACK_IMPORTED_MODULE_1__["ResourceEditStackSnapshot"](resource, elements); - } - restoreSnapshot(snapshot) { - const snapshotLength = snapshot.elements.length; - let isOK = true; - let snapshotIndex = 0; - let removePastAfter = -1; - for (let i = 0, len = this._past.length; i < len; i++, snapshotIndex++) { - const element = this._past[i]; - if (isOK && (snapshotIndex >= snapshotLength || element.id !== snapshot.elements[snapshotIndex])) { - isOK = false; - removePastAfter = 0; - } - if (!isOK && element.type === 1 /* Workspace */) { - element.removeResource(this.resourceLabel, this.strResource, 0 /* ExternalRemoval */); - } - } - let removeFutureBefore = -1; - for (let i = this._future.length - 1; i >= 0; i--, snapshotIndex++) { - const element = this._future[i]; - if (isOK && (snapshotIndex >= snapshotLength || element.id !== snapshot.elements[snapshotIndex])) { - isOK = false; - removeFutureBefore = i; - } - if (!isOK && element.type === 1 /* Workspace */) { - element.removeResource(this.resourceLabel, this.strResource, 0 /* ExternalRemoval */); - } - } - if (removePastAfter !== -1) { - this._past = this._past.slice(0, removePastAfter); - } - if (removeFutureBefore !== -1) { - this._future = this._future.slice(removeFutureBefore + 1); - } - this.versionId++; - } - getElements() { - const past = []; - const future = []; - for (const element of this._past) { - past.push(element.actual); - } - for (const element of this._future) { - future.push(element.actual); - } - return { past, future }; - } - getClosestPastElement() { - if (this._past.length === 0) { - return null; - } - return this._past[this._past.length - 1]; - } - getClosestFutureElement() { - if (this._future.length === 0) { - return null; - } - return this._future[this._future.length - 1]; - } - hasPastElements() { - return (this._past.length > 0); - } - hasFutureElements() { - return (this._future.length > 0); - } - splitPastWorkspaceElement(toRemove, individualMap) { - for (let j = this._past.length - 1; j >= 0; j--) { - if (this._past[j] === toRemove) { - if (individualMap.has(this.strResource)) { - // gets replaced - this._past[j] = individualMap.get(this.strResource); - } - else { - // gets deleted - this._past.splice(j, 1); - } - break; - } - } - this.versionId++; - } - splitFutureWorkspaceElement(toRemove, individualMap) { - for (let j = this._future.length - 1; j >= 0; j--) { - if (this._future[j] === toRemove) { - if (individualMap.has(this.strResource)) { - // gets replaced - this._future[j] = individualMap.get(this.strResource); - } - else { - // gets deleted - this._future.splice(j, 1); - } - break; - } - } - this.versionId++; - } - moveBackward(element) { - this._past.pop(); - this._future.push(element); - this.versionId++; - } - moveForward(element) { - this._future.pop(); - this._past.push(element); - this.versionId++; - } -} -class EditStackSnapshot { - constructor(editStacks) { - this.editStacks = editStacks; - this._versionIds = []; - for (let i = 0, len = this.editStacks.length; i < len; i++) { - this._versionIds[i] = this.editStacks[i].versionId; - } - } - isValid() { - for (let i = 0, len = this.editStacks.length; i < len; i++) { - if (this._versionIds[i] !== this.editStacks[i].versionId) { - return false; - } - } - return true; - } -} -const missingEditStack = new ResourceEditStack('', ''); -missingEditStack.locked = true; -let UndoRedoService = class UndoRedoService { - constructor(_dialogService, _notificationService) { - this._dialogService = _dialogService; - this._notificationService = _notificationService; - this._editStacks = new Map(); - this._uriComparisonKeyComputers = []; - } - getUriComparisonKey(resource) { - for (const uriComparisonKeyComputer of this._uriComparisonKeyComputers) { - if (uriComparisonKeyComputer[0] === resource.scheme) { - return uriComparisonKeyComputer[1].getComparisonKey(resource); - } - } - return resource.toString(); - } - _print(label) { - console.log(`------------------------------------`); - console.log(`AFTER ${label}: `); - let str = []; - for (const element of this._editStacks) { - str.push(element[1].toString()); - } - console.log(str.join('\n')); - } - pushElement(element) { - if (element.type === 0 /* Resource */) { - const resourceLabel = getResourceLabel(element.resource); - const strResource = this.getUriComparisonKey(element.resource); - this._pushElement(new ResourceStackElement(element, resourceLabel, strResource)); - } - else { - const seen = new Set(); - const resourceLabels = []; - const strResources = []; - for (const resource of element.resources) { - const resourceLabel = getResourceLabel(resource); - const strResource = this.getUriComparisonKey(resource); - if (seen.has(strResource)) { - continue; - } - seen.add(strResource); - resourceLabels.push(resourceLabel); - strResources.push(strResource); - } - if (resourceLabels.length === 1) { - this._pushElement(new ResourceStackElement(element, resourceLabels[0], strResources[0])); - } - else { - this._pushElement(new WorkspaceStackElement(element, resourceLabels, strResources)); - } - } - if (DEBUG) { - this._print('pushElement'); - } - } - _pushElement(element) { - for (let i = 0, len = element.strResources.length; i < len; i++) { - const resourceLabel = element.resourceLabels[i]; - const strResource = element.strResources[i]; - let editStack; - if (this._editStacks.has(strResource)) { - editStack = this._editStacks.get(strResource); - } - else { - editStack = new ResourceEditStack(resourceLabel, strResource); - this._editStacks.set(strResource, editStack); - } - editStack.pushElement(element); - } - } - getLastElement(resource) { - const strResource = this.getUriComparisonKey(resource); - if (this._editStacks.has(strResource)) { - const editStack = this._editStacks.get(strResource); - if (editStack.hasFutureElements()) { - return null; - } - const closestPastElement = editStack.getClosestPastElement(); - return closestPastElement ? closestPastElement.actual : null; - } - return null; - } - _splitPastWorkspaceElement(toRemove, ignoreResources) { - const individualArr = toRemove.actual.split(); - const individualMap = new Map(); - for (const _element of individualArr) { - const resourceLabel = getResourceLabel(_element.resource); - const strResource = this.getUriComparisonKey(_element.resource); - const element = new ResourceStackElement(_element, resourceLabel, strResource); - individualMap.set(element.strResource, element); - } - for (const strResource of toRemove.strResources) { - if (ignoreResources && ignoreResources.has(strResource)) { - continue; - } - const editStack = this._editStacks.get(strResource); - editStack.splitPastWorkspaceElement(toRemove, individualMap); - } - } - _splitFutureWorkspaceElement(toRemove, ignoreResources) { - const individualArr = toRemove.actual.split(); - const individualMap = new Map(); - for (const _element of individualArr) { - const resourceLabel = getResourceLabel(_element.resource); - const strResource = this.getUriComparisonKey(_element.resource); - const element = new ResourceStackElement(_element, resourceLabel, strResource); - individualMap.set(element.strResource, element); - } - for (const strResource of toRemove.strResources) { - if (ignoreResources && ignoreResources.has(strResource)) { - continue; - } - const editStack = this._editStacks.get(strResource); - editStack.splitFutureWorkspaceElement(toRemove, individualMap); - } - } - removeElements(resource) { - const strResource = typeof resource === 'string' ? resource : this.getUriComparisonKey(resource); - if (this._editStacks.has(strResource)) { - const editStack = this._editStacks.get(strResource); - editStack.dispose(); - this._editStacks.delete(strResource); - } - if (DEBUG) { - this._print('removeElements'); - } - } - setElementsValidFlag(resource, isValid, filter) { - const strResource = this.getUriComparisonKey(resource); - if (this._editStacks.has(strResource)) { - const editStack = this._editStacks.get(strResource); - editStack.setElementsValidFlag(isValid, filter); - } - if (DEBUG) { - this._print('setElementsValidFlag'); - } - } - createSnapshot(resource) { - const strResource = this.getUriComparisonKey(resource); - if (this._editStacks.has(strResource)) { - const editStack = this._editStacks.get(strResource); - return editStack.createSnapshot(resource); - } - return new _undoRedo_js__WEBPACK_IMPORTED_MODULE_1__["ResourceEditStackSnapshot"](resource, []); - } - restoreSnapshot(snapshot) { - const strResource = this.getUriComparisonKey(snapshot.resource); - if (this._editStacks.has(strResource)) { - const editStack = this._editStacks.get(strResource); - editStack.restoreSnapshot(snapshot); - if (!editStack.hasPastElements() && !editStack.hasFutureElements()) { - // the edit stack is now empty, just remove it entirely - editStack.dispose(); - this._editStacks.delete(strResource); - } - } - if (DEBUG) { - this._print('restoreSnapshot'); - } - } - getElements(resource) { - const strResource = this.getUriComparisonKey(resource); - if (this._editStacks.has(strResource)) { - const editStack = this._editStacks.get(strResource); - return editStack.getElements(); - } - return { past: [], future: [] }; - } - canUndo(resource) { - const strResource = this.getUriComparisonKey(resource); - if (this._editStacks.has(strResource)) { - const editStack = this._editStacks.get(strResource); - return editStack.hasPastElements(); - } - return false; - } - _onError(err, element) { - Object(_base_common_errors_js__WEBPACK_IMPORTED_MODULE_2__["onUnexpectedError"])(err); - // An error occured while undoing or redoing => drop the undo/redo stack for all affected resources - for (const strResource of element.strResources) { - this.removeElements(strResource); - } - this._notificationService.error(err); - } - _acquireLocks(editStackSnapshot) { - // first, check if all locks can be acquired - for (const editStack of editStackSnapshot.editStacks) { - if (editStack.locked) { - throw new Error('Cannot acquire edit stack lock'); - } - } - // can acquire all locks - for (const editStack of editStackSnapshot.editStacks) { - editStack.locked = true; - } - return () => { - // release all locks - for (const editStack of editStackSnapshot.editStacks) { - editStack.locked = false; - } - }; - } - _safeInvokeWithLocks(element, invoke, editStackSnapshot, cleanup = _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_8__["Disposable"].None) { - const releaseLocks = this._acquireLocks(editStackSnapshot); - let result; - try { - result = invoke(); - } - catch (err) { - releaseLocks(); - cleanup.dispose(); - return this._onError(err, element); - } - if (result) { - // result is Promise - return result.then(() => { - releaseLocks(); - cleanup.dispose(); - }, (err) => { - releaseLocks(); - cleanup.dispose(); - return this._onError(err, element); - }); - } - else { - // result is void - releaseLocks(); - cleanup.dispose(); - } - } - _invokeWorkspacePrepare(element) { - return __awaiter(this, void 0, void 0, function* () { - if (typeof element.actual.prepareUndoRedo === 'undefined') { - return _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_8__["Disposable"].None; - } - const result = element.actual.prepareUndoRedo(); - if (typeof result === 'undefined') { - return _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_8__["Disposable"].None; - } - return result; - }); - } - _invokeResourcePrepare(element, callback) { - if (element.actual.type !== 1 /* Workspace */ || typeof element.actual.prepareUndoRedo === 'undefined') { - // no preparation needed - callback(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_8__["Disposable"].None); - return; - } - const r = element.actual.prepareUndoRedo(); - if (!r) { - // nothing to clean up - callback(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_8__["Disposable"].None); - return; - } - if (Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_8__["isDisposable"])(r)) { - callback(r); - return; - } - return r.then((disposable) => { - callback(disposable); - }); - } - _getAffectedEditStacks(element) { - const affectedEditStacks = []; - for (const strResource of element.strResources) { - affectedEditStacks.push(this._editStacks.get(strResource) || missingEditStack); - } - return new EditStackSnapshot(affectedEditStacks); - } - _tryToSplitAndUndo(strResource, element, ignoreResources, message) { - if (element.canSplit()) { - this._splitPastWorkspaceElement(element, ignoreResources); - this._notificationService.info(message); - return new WorkspaceVerificationError(this.undo(strResource)); - } - else { - // Cannot safely split this workspace element => flush all undo/redo stacks - for (const strResource of element.strResources) { - this.removeElements(strResource); - } - this._notificationService.info(message); - return new WorkspaceVerificationError(); - } - } - _checkWorkspaceUndo(strResource, element, editStackSnapshot, checkInvalidatedResources) { - if (element.removedResources) { - return this._tryToSplitAndUndo(strResource, element, element.removedResources, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cannotWorkspaceUndo', comment: ['{0} is a label for an operation. {1} is another message.'] }, "Could not undo '{0}' across all files. {1}", element.label, element.removedResources.createMessage())); - } - if (checkInvalidatedResources && element.invalidatedResources) { - return this._tryToSplitAndUndo(strResource, element, element.invalidatedResources, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cannotWorkspaceUndo', comment: ['{0} is a label for an operation. {1} is another message.'] }, "Could not undo '{0}' across all files. {1}", element.label, element.invalidatedResources.createMessage())); - } - // this must be the last past element in all the impacted resources! - const cannotUndoDueToResources = []; - for (const editStack of editStackSnapshot.editStacks) { - if (editStack.getClosestPastElement() !== element) { - cannotUndoDueToResources.push(editStack.resourceLabel); - } - } - if (cannotUndoDueToResources.length > 0) { - return this._tryToSplitAndUndo(strResource, element, null, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cannotWorkspaceUndoDueToChanges', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] }, "Could not undo '{0}' across all files because changes were made to {1}", element.label, cannotUndoDueToResources.join(', '))); - } - const cannotLockDueToResources = []; - for (const editStack of editStackSnapshot.editStacks) { - if (editStack.locked) { - cannotLockDueToResources.push(editStack.resourceLabel); - } - } - if (cannotLockDueToResources.length > 0) { - return this._tryToSplitAndUndo(strResource, element, null, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cannotWorkspaceUndoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] }, "Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}", element.label, cannotLockDueToResources.join(', '))); - } - // check if new stack elements were added in the meantime... - if (!editStackSnapshot.isValid()) { - return this._tryToSplitAndUndo(strResource, element, null, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cannotWorkspaceUndoDueToInMeantimeUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] }, "Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime", element.label)); - } - return null; - } - _workspaceUndo(strResource, element) { - const affectedEditStacks = this._getAffectedEditStacks(element); - const verificationError = this._checkWorkspaceUndo(strResource, element, affectedEditStacks, /*invalidated resources will be checked after the prepare call*/ false); - if (verificationError) { - return verificationError.returnValue; - } - return this._confirmAndExecuteWorkspaceUndo(strResource, element, affectedEditStacks); - } - _confirmAndExecuteWorkspaceUndo(strResource, element, editStackSnapshot) { - return __awaiter(this, void 0, void 0, function* () { - if (element.canSplit()) { - // this element can be split - const result = yield this._dialogService.show(_base_common_severity_js__WEBPACK_IMPORTED_MODULE_5__["default"].Info, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('confirmWorkspace', "Would you like to undo '{0}' across all files?", element.label), [ - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'ok', comment: ['{0} denotes a number that is > 1'] }, "Undo in {0} Files", editStackSnapshot.editStacks.length), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('nok', "Undo this File"), - _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]('cancel', "Cancel"), - ], { - cancelId: 2 - }); - if (result.choice === 2) { - // choice: cancel - return; - } - if (result.choice === 1) { - // choice: undo this file - this._splitPastWorkspaceElement(element, null); - return this.undo(strResource); - } - // choice: undo in all files - // At this point, it is possible that the element has been made invalid in the meantime (due to the confirmation await) - const verificationError1 = this._checkWorkspaceUndo(strResource, element, editStackSnapshot, /*invalidated resources will be checked after the prepare call*/ false); - if (verificationError1) { - return verificationError1.returnValue; - } - } - // prepare - let cleanup; - try { - cleanup = yield this._invokeWorkspacePrepare(element); - } - catch (err) { - return this._onError(err, element); - } - // At this point, it is possible that the element has been made invalid in the meantime (due to the prepare await) - const verificationError2 = this._checkWorkspaceUndo(strResource, element, editStackSnapshot, /*now also check that there are no more invalidated resources*/ true); - if (verificationError2) { - cleanup.dispose(); - return verificationError2.returnValue; - } - for (const editStack of editStackSnapshot.editStacks) { - editStack.moveBackward(element); - } - return this._safeInvokeWithLocks(element, () => element.actual.undo(), editStackSnapshot, cleanup); - }); - } - _resourceUndo(editStack, element) { - if (!element.isValid) { - // invalid element => immediately flush edit stack! - editStack.flushAllElements(); - return; - } - if (editStack.locked) { - const message = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cannotResourceUndoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation.'] }, "Could not undo '{0}' because there is already an undo or redo operation running.", element.label); - this._notificationService.info(message); - return; - } - return this._invokeResourcePrepare(element, (cleanup) => { - editStack.moveBackward(element); - return this._safeInvokeWithLocks(element, () => element.actual.undo(), new EditStackSnapshot([editStack]), cleanup); - }); - } - undo(resource) { - const strResource = typeof resource === 'string' ? resource : this.getUriComparisonKey(resource); - if (!this._editStacks.has(strResource)) { - return; - } - const editStack = this._editStacks.get(strResource); - const element = editStack.getClosestPastElement(); - if (!element) { - return; - } - try { - if (element.type === 1 /* Workspace */) { - return this._workspaceUndo(strResource, element); - } - else { - return this._resourceUndo(editStack, element); - } - } - finally { - if (DEBUG) { - this._print('undo'); - } - } - } - canRedo(resource) { - const strResource = this.getUriComparisonKey(resource); - if (this._editStacks.has(strResource)) { - const editStack = this._editStacks.get(strResource); - return editStack.hasFutureElements(); - } - return false; - } - _tryToSplitAndRedo(strResource, element, ignoreResources, message) { - if (element.canSplit()) { - this._splitFutureWorkspaceElement(element, ignoreResources); - this._notificationService.info(message); - return new WorkspaceVerificationError(this.redo(strResource)); - } - else { - // Cannot safely split this workspace element => flush all undo/redo stacks - for (const strResource of element.strResources) { - this.removeElements(strResource); - } - this._notificationService.info(message); - return new WorkspaceVerificationError(); - } - } - _checkWorkspaceRedo(strResource, element, editStackSnapshot, checkInvalidatedResources) { - if (element.removedResources) { - return this._tryToSplitAndRedo(strResource, element, element.removedResources, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cannotWorkspaceRedo', comment: ['{0} is a label for an operation. {1} is another message.'] }, "Could not redo '{0}' across all files. {1}", element.label, element.removedResources.createMessage())); - } - if (checkInvalidatedResources && element.invalidatedResources) { - return this._tryToSplitAndRedo(strResource, element, element.invalidatedResources, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cannotWorkspaceRedo', comment: ['{0} is a label for an operation. {1} is another message.'] }, "Could not redo '{0}' across all files. {1}", element.label, element.invalidatedResources.createMessage())); - } - // this must be the last future element in all the impacted resources! - const cannotRedoDueToResources = []; - for (const editStack of editStackSnapshot.editStacks) { - if (editStack.getClosestFutureElement() !== element) { - cannotRedoDueToResources.push(editStack.resourceLabel); - } - } - if (cannotRedoDueToResources.length > 0) { - return this._tryToSplitAndRedo(strResource, element, null, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cannotWorkspaceRedoDueToChanges', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] }, "Could not redo '{0}' across all files because changes were made to {1}", element.label, cannotRedoDueToResources.join(', '))); - } - const cannotLockDueToResources = []; - for (const editStack of editStackSnapshot.editStacks) { - if (editStack.locked) { - cannotLockDueToResources.push(editStack.resourceLabel); - } - } - if (cannotLockDueToResources.length > 0) { - return this._tryToSplitAndRedo(strResource, element, null, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cannotWorkspaceRedoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] }, "Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}", element.label, cannotLockDueToResources.join(', '))); - } - // check if new stack elements were added in the meantime... - if (!editStackSnapshot.isValid()) { - return this._tryToSplitAndRedo(strResource, element, null, _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cannotWorkspaceRedoDueToInMeantimeUndoRedo', comment: ['{0} is a label for an operation. {1} is a list of filenames.'] }, "Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime", element.label)); - } - return null; - } - _workspaceRedo(strResource, element) { - const affectedEditStacks = this._getAffectedEditStacks(element); - const verificationError = this._checkWorkspaceRedo(strResource, element, affectedEditStacks, /*invalidated resources will be checked after the prepare call*/ false); - if (verificationError) { - return verificationError.returnValue; - } - return this._executeWorkspaceRedo(strResource, element, affectedEditStacks); - } - _executeWorkspaceRedo(strResource, element, editStackSnapshot) { - return __awaiter(this, void 0, void 0, function* () { - // prepare - let cleanup; - try { - cleanup = yield this._invokeWorkspacePrepare(element); - } - catch (err) { - return this._onError(err, element); - } - // At this point, it is possible that the element has been made invalid in the meantime (due to the prepare await) - const verificationError = this._checkWorkspaceRedo(strResource, element, editStackSnapshot, /*now also check that there are no more invalidated resources*/ true); - if (verificationError) { - cleanup.dispose(); - return verificationError.returnValue; - } - for (const editStack of editStackSnapshot.editStacks) { - editStack.moveForward(element); - } - return this._safeInvokeWithLocks(element, () => element.actual.redo(), editStackSnapshot, cleanup); - }); - } - _resourceRedo(editStack, element) { - if (!element.isValid) { - // invalid element => immediately flush edit stack! - editStack.flushAllElements(); - return; - } - if (editStack.locked) { - const message = _nls_js__WEBPACK_IMPORTED_MODULE_0__["localize"]({ key: 'cannotResourceRedoDueToInProgressUndoRedo', comment: ['{0} is a label for an operation.'] }, "Could not redo '{0}' because there is already an undo or redo operation running.", element.label); - this._notificationService.info(message); - return; - } - return this._invokeResourcePrepare(element, (cleanup) => { - editStack.moveForward(element); - return this._safeInvokeWithLocks(element, () => element.actual.redo(), new EditStackSnapshot([editStack]), cleanup); - }); - } - redo(resource) { - const strResource = typeof resource === 'string' ? resource : this.getUriComparisonKey(resource); - if (!this._editStacks.has(strResource)) { - return; - } - const editStack = this._editStacks.get(strResource); - const element = editStack.getClosestFutureElement(); - if (!element) { - return; - } - try { - if (element.type === 1 /* Workspace */) { - return this._workspaceRedo(strResource, element); - } - else { - return this._resourceRedo(editStack, element); - } - } - finally { - if (DEBUG) { - this._print('redo'); - } - } - } -}; -UndoRedoService = __decorate([ - __param(0, _dialogs_common_dialogs_js__WEBPACK_IMPORTED_MODULE_4__["IDialogService"]), - __param(1, _notification_common_notification_js__WEBPACK_IMPORTED_MODULE_7__["INotificationService"]) -], UndoRedoService); - -class WorkspaceVerificationError { - constructor(returnValue) { - this.returnValue = returnValue; - } -} -Object(_instantiation_common_extensions_js__WEBPACK_IMPORTED_MODULE_3__["registerSingleton"])(_undoRedo_js__WEBPACK_IMPORTED_MODULE_1__["IUndoRedoService"], UndoRedoService); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/userDataSync/common/storageKeys.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/userDataSync/common/storageKeys.js ***! - \***************************************************************************************/ -/*! exports provided: IStorageKeysSyncRegistryService, StorageKeysSyncRegistryService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IStorageKeysSyncRegistryService", function() { return IStorageKeysSyncRegistryService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StorageKeysSyncRegistryService", function() { return StorageKeysSyncRegistryService; }); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -const IStorageKeysSyncRegistryService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_2__["createDecorator"])('IStorageKeysSyncRegistryService'); -class StorageKeysSyncRegistryService extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor() { - super(); - this._storageKeys = new Map(); - this._onDidChangeStorageKeys = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]()); - this._register(Object(_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["toDisposable"])(() => this._storageKeys.clear())); - } - get storageKeys() { return [...this._storageKeys.values()]; } - registerStorageKey(storageKey) { - if (!this._storageKeys.has(storageKey.key)) { - this._storageKeys.set(storageKey.key, storageKey); - this._onDidChangeStorageKeys.fire(this.storageKeys); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/workspace/common/workspace.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/workspace/common/workspace.js ***! - \**********************************************************************************/ -/*! exports provided: IWorkspaceContextService, IWorkspace, IWorkspaceFolder, Workspace, WorkspaceFolder */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IWorkspaceContextService", function() { return IWorkspaceContextService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IWorkspace", function() { return IWorkspace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IWorkspaceFolder", function() { return IWorkspaceFolder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Workspace", function() { return Workspace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceFolder", function() { return WorkspaceFolder; }); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _base_common_resources_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/resources.js */ "./node_modules/monaco-editor/esm/vs/base/common/resources.js"); -/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ "./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js"); -/* harmony import */ var _base_common_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/map.js */ "./node_modules/monaco-editor/esm/vs/base/common/map.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -const IWorkspaceContextService = Object(_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_2__["createDecorator"])('contextService'); -var IWorkspace; -(function (IWorkspace) { - function isIWorkspace(thing) { - return !!(thing && typeof thing === 'object' - && typeof thing.id === 'string' - && Array.isArray(thing.folders)); - } - IWorkspace.isIWorkspace = isIWorkspace; -})(IWorkspace || (IWorkspace = {})); -var IWorkspaceFolder; -(function (IWorkspaceFolder) { - function isIWorkspaceFolder(thing) { - return !!(thing && typeof thing === 'object' - && _base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__["URI"].isUri(thing.uri) - && typeof thing.name === 'string' - && typeof thing.toResource === 'function'); - } - IWorkspaceFolder.isIWorkspaceFolder = isIWorkspaceFolder; -})(IWorkspaceFolder || (IWorkspaceFolder = {})); -class Workspace { - constructor(_id, folders = [], _configuration = null) { - this._id = _id; - this._configuration = _configuration; - this._foldersMap = _base_common_map_js__WEBPACK_IMPORTED_MODULE_3__["TernarySearchTree"].forUris(); - this.folders = folders; - } - get folders() { - return this._folders; - } - set folders(folders) { - this._folders = folders; - this.updateFoldersMap(); - } - get id() { - return this._id; - } - get configuration() { - return this._configuration; - } - set configuration(configuration) { - this._configuration = configuration; - } - getFolder(resource) { - if (!resource) { - return null; - } - return this._foldersMap.findSubstr(resource.with({ - scheme: resource.scheme, - authority: resource.authority, - path: resource.path - })) || null; - } - updateFoldersMap() { - this._foldersMap = _base_common_map_js__WEBPACK_IMPORTED_MODULE_3__["TernarySearchTree"].forUris(); - for (const folder of this.folders) { - this._foldersMap.set(folder.uri, folder); - } - } - toJSON() { - return { id: this.id, folders: this.folders, configuration: this.configuration }; - } -} -class WorkspaceFolder { - constructor(data, raw) { - this.raw = raw; - this.uri = data.uri; - this.index = data.index; - this.name = data.name; - } - toResource(relativePath) { - return _base_common_resources_js__WEBPACK_IMPORTED_MODULE_1__["joinPath"](this.uri, relativePath); - } - toJSON() { - return { uri: this.uri, name: this.name, index: this.index }; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/platform/workspaces/common/workspaces.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/platform/workspaces/common/workspaces.js ***! - \************************************************************************************/ -/*! exports provided: WORKSPACE_EXTENSION, isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WORKSPACE_EXTENSION", function() { return WORKSPACE_EXTENSION; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSingleFolderWorkspaceIdentifier", function() { return isSingleFolderWorkspaceIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toWorkspaceIdentifier", function() { return toWorkspaceIdentifier; }); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); - -const WORKSPACE_EXTENSION = 'code-workspace'; -function isSingleFolderWorkspaceIdentifier(obj) { - return obj instanceof _base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__["URI"]; -} -function toWorkspaceIdentifier(workspace) { - if (workspace.configuration) { - return { - configPath: workspace.configuration, - id: workspace.id - }; - } - if (workspace.folders.length === 1) { - return workspace.folders[0].uri; - } - // Empty workspace - return undefined; -} -//#endregion - - -/***/ }), - -/***/ "./node_modules/process/browser.js": +/*! exports provided: setConf, draw, default */function(e,t,n){"use strict";n.r(t),n.d(t,"setConf",(function(){return u})),n.d(t,"draw",(function(){return h}));var i,r=n(/*! d3 */"d3"),o=n(/*! ./pieDb */"./src/diagrams/pie/pieDb.js"),s=n(/*! ./parser/pie */"./src/diagrams/pie/parser/pie.jison"),a=n.n(s),l=n(/*! ../../logger */"./src/logger.js"),c=n(/*! ../../utils */"./src/utils.js"),d={},u=function(e){Object.keys(e).forEach((function(t){d[t]=e[t]}))},h=function(e,t){try{var n=a.a.parser;n.yy=o.default,l.log.debug("Rendering info diagram\n"+e),n.yy.clear(),n.parse(e),l.log.debug("Parsed info diagram");var s=document.getElementById(t);void 0===(i=s.parentElement.offsetWidth)&&(i=1200),void 0!==d.useWidth&&(i=d.useWidth);var u=Object(r.select)("#"+t);Object(c.configureSvgSize)(u,450,i,d.useMaxWidth),s.setAttribute("viewBox","0 0 "+i+" 450");var h=Math.min(i,450)/2-40,f=u.append("g").attr("transform","translate("+i/2+",225)"),g=o.default.getSections(),p=0;Object.keys(g).forEach((function(e){p+=g[e]}));var m=Object(r.scaleOrdinal)().domain(g).range(r.schemeSet2),_=Object(r.pie)().value((function(e){return e.value}))(Object(r.entries)(g)),b=Object(r.arc)().innerRadius(0).outerRadius(h);f.selectAll("mySlices").data(_).enter().append("path").attr("d",b).attr("fill",(function(e){return m(e.data.key)})).attr("stroke","black").style("stroke-width","2px").style("opacity",.7),f.selectAll("mySlices").data(_.filter((function(e){return 0!==e.data.value}))).enter().append("text").text((function(e){return(e.data.value/p*100).toFixed(0)+"%"})).attr("transform",(function(e){return"translate("+b.centroid(e)+")"})).style("text-anchor","middle").attr("class","slice").style("font-size",17),f.append("text").text(n.yy.getTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");var v=f.selectAll(".legend").data(m.domain()).enter().append("g").attr("class","legend").attr("transform",(function(e,t){return"translate(216,"+(22*t-22*m.domain().length/2)+")"}));v.append("rect").attr("width",18).attr("height",18).style("fill",m).style("stroke",m),v.append("text").attr("x",22).attr("y",14).text((function(e){return e}))}catch(e){l.log.error("Error while rendering info diagram"),l.log.error(e)}};t.default={setConf:u,draw:h}},"./src/diagrams/pie/styles.js": +/*!************************************!*\ + !*** ./src/diagrams/pie/styles.js ***! + \************************************/ +/*! exports provided: default */function(e,t,n){"use strict";n.r(t),t.default=function(e){return".pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: ".concat(e.taskTextDarkColor,";\n font-family: ").concat(e.fontFamily,";\n }\n .slice {\n font-family: ").concat(e.fontFamily,";\n fill: ").concat(e.textColor,";\n // fill: white;\n }\n .legend text {\n fill: ").concat(e.taskTextDarkColor,";\n font-family: ").concat(e.fontFamily,";\n font-size: 17px;\n }\n")}},"./src/diagrams/sequence/parser/sequenceDiagram.jison": +/*!************************************************************!*\ + !*** ./src/diagrams/sequence/parser/sequenceDiagram.jison ***! + \************************************************************/ +/*! no static exports found */function(e,t,n){(function(e,i){var r=function(){var e=function(e,t,n,i){for(n=n||{},i=e.length;i--;n[e[i]]=t);return n},t=[1,2],n=[1,3],i=[1,5],r=[1,7],o=[2,5],s=[1,15],a=[1,17],l=[1,18],c=[1,20],d=[1,21],u=[1,22],h=[1,24],f=[1,25],g=[1,26],p=[1,27],m=[1,28],_=[1,29],b=[1,32],v=[1,33],y=[1,36],w=[1,4,5,16,21,22,23,25,27,28,29,30,31,33,35,36,37,48,58],C=[1,44],S=[4,5,16,21,22,23,25,27,28,29,30,31,33,37,48,58],k=[4,5,16,21,22,23,25,27,28,29,30,31,33,36,37,48,58],x=[4,5,16,21,22,23,25,27,28,29,30,31,33,35,37,48,58],L=[46,47,48],M=[1,4,5,7,16,21,22,23,25,27,28,29,30,31,33,35,36,37,48,58],D={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,directive:6,SD:7,document:8,line:9,statement:10,openDirective:11,typeDirective:12,closeDirective:13,":":14,argDirective:15,participant:16,actor:17,AS:18,restOfLine:19,signal:20,autonumber:21,activate:22,deactivate:23,note_statement:24,title:25,text2:26,loop:27,end:28,rect:29,opt:30,alt:31,else_sections:32,par:33,par_sections:34,and:35,else:36,note:37,placement:38,over:39,actor_pair:40,spaceList:41,",":42,left_of:43,right_of:44,signaltype:45,"+":46,"-":47,ACTOR:48,SOLID_OPEN_ARROW:49,DOTTED_OPEN_ARROW:50,SOLID_ARROW:51,DOTTED_ARROW:52,SOLID_CROSS:53,DOTTED_CROSS:54,SOLID_POINT:55,DOTTED_POINT:56,TXT:57,open_directive:58,type_directive:59,arg_directive:60,close_directive:61,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",7:"SD",14:":",16:"participant",18:"AS",19:"restOfLine",21:"autonumber",22:"activate",23:"deactivate",25:"title",27:"loop",28:"end",29:"rect",30:"opt",31:"alt",33:"par",35:"and",36:"else",37:"note",39:"over",42:",",43:"left_of",44:"right_of",46:"+",47:"-",48:"ACTOR",49:"SOLID_OPEN_ARROW",50:"DOTTED_OPEN_ARROW",51:"SOLID_ARROW",52:"DOTTED_ARROW",53:"SOLID_CROSS",54:"DOTTED_CROSS",55:"SOLID_POINT",56:"DOTTED_POINT",57:"TXT",58:"open_directive",59:"type_directive",60:"arg_directive",61:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[6,4],[6,6],[10,5],[10,3],[10,2],[10,1],[10,3],[10,3],[10,2],[10,3],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[34,1],[34,4],[32,1],[32,4],[24,4],[24,4],[41,2],[41,1],[40,3],[40,1],[38,1],[38,1],[20,5],[20,5],[20,4],[17,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[26,1],[11,1],[12,1],[15,1],[13,1]],performAction:function(e,t,n,i,r,o,s){var a=o.length-1;switch(r){case 4:return i.apply(o[a]),o[a];case 5:this.$=[];break;case 6:o[a-1].push(o[a]),this.$=o[a-1];break;case 7:case 8:this.$=o[a];break;case 9:this.$=[];break;case 12:o[a-3].description=i.parseMessage(o[a-1]),this.$=o[a-3];break;case 13:this.$=o[a-1];break;case 15:i.enableSequenceNumbers();break;case 16:this.$={type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:o[a-1]};break;case 17:this.$={type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:o[a-1]};break;case 19:this.$=[{type:"setTitle",text:o[a-1]}];break;case 20:o[a-1].unshift({type:"loopStart",loopText:i.parseMessage(o[a-2]),signalType:i.LINETYPE.LOOP_START}),o[a-1].push({type:"loopEnd",loopText:o[a-2],signalType:i.LINETYPE.LOOP_END}),this.$=o[a-1];break;case 21:o[a-1].unshift({type:"rectStart",color:i.parseMessage(o[a-2]),signalType:i.LINETYPE.RECT_START}),o[a-1].push({type:"rectEnd",color:i.parseMessage(o[a-2]),signalType:i.LINETYPE.RECT_END}),this.$=o[a-1];break;case 22:o[a-1].unshift({type:"optStart",optText:i.parseMessage(o[a-2]),signalType:i.LINETYPE.OPT_START}),o[a-1].push({type:"optEnd",optText:i.parseMessage(o[a-2]),signalType:i.LINETYPE.OPT_END}),this.$=o[a-1];break;case 23:o[a-1].unshift({type:"altStart",altText:i.parseMessage(o[a-2]),signalType:i.LINETYPE.ALT_START}),o[a-1].push({type:"altEnd",signalType:i.LINETYPE.ALT_END}),this.$=o[a-1];break;case 24:o[a-1].unshift({type:"parStart",parText:i.parseMessage(o[a-2]),signalType:i.LINETYPE.PAR_START}),o[a-1].push({type:"parEnd",signalType:i.LINETYPE.PAR_END}),this.$=o[a-1];break;case 27:this.$=o[a-3].concat([{type:"and",parText:i.parseMessage(o[a-1]),signalType:i.LINETYPE.PAR_AND},o[a]]);break;case 29:this.$=o[a-3].concat([{type:"else",altText:i.parseMessage(o[a-1]),signalType:i.LINETYPE.ALT_ELSE},o[a]]);break;case 30:this.$=[o[a-1],{type:"addNote",placement:o[a-2],actor:o[a-1].actor,text:o[a]}];break;case 31:o[a-2]=[].concat(o[a-1],o[a-1]).slice(0,2),o[a-2][0]=o[a-2][0].actor,o[a-2][1]=o[a-2][1].actor,this.$=[o[a-1],{type:"addNote",placement:i.PLACEMENT.OVER,actor:o[a-2].slice(0,2),text:o[a]}];break;case 34:this.$=[o[a-2],o[a]];break;case 35:this.$=o[a];break;case 36:this.$=i.PLACEMENT.LEFTOF;break;case 37:this.$=i.PLACEMENT.RIGHTOF;break;case 38:this.$=[o[a-4],o[a-1],{type:"addMessage",from:o[a-4].actor,to:o[a-1].actor,signalType:o[a-3],msg:o[a]},{type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:o[a-1]}];break;case 39:this.$=[o[a-4],o[a-1],{type:"addMessage",from:o[a-4].actor,to:o[a-1].actor,signalType:o[a-3],msg:o[a]},{type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:o[a-4]}];break;case 40:this.$=[o[a-3],o[a-1],{type:"addMessage",from:o[a-3].actor,to:o[a-1].actor,signalType:o[a-2],msg:o[a]}];break;case 41:this.$={type:"addActor",actor:o[a]};break;case 42:this.$=i.LINETYPE.SOLID_OPEN;break;case 43:this.$=i.LINETYPE.DOTTED_OPEN;break;case 44:this.$=i.LINETYPE.SOLID;break;case 45:this.$=i.LINETYPE.DOTTED;break;case 46:this.$=i.LINETYPE.SOLID_CROSS;break;case 47:this.$=i.LINETYPE.DOTTED_CROSS;break;case 48:this.$=i.LINETYPE.SOLID_POINT;break;case 49:this.$=i.LINETYPE.DOTTED_POINT;break;case 50:this.$=i.parseMessage(o[a].trim().substring(1));break;case 51:i.parseDirective("%%{","open_directive");break;case 52:i.parseDirective(o[a],"type_directive");break;case 53:o[a]=o[a].trim().replace(/'/g,'"'),i.parseDirective(o[a],"arg_directive");break;case 54:i.parseDirective("}%%","close_directive","sequence")}},table:[{3:1,4:t,5:n,6:4,7:i,11:6,58:r},{1:[3]},{3:8,4:t,5:n,6:4,7:i,11:6,58:r},{3:9,4:t,5:n,6:4,7:i,11:6,58:r},{3:10,4:t,5:n,6:4,7:i,11:6,58:r},e([1,4,5,16,21,22,23,25,27,29,30,31,33,37,48,58],o,{8:11}),{12:12,59:[1,13]},{59:[2,51]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:s,5:a,6:30,9:14,10:16,11:6,16:l,17:31,20:19,21:c,22:d,23:u,24:23,25:h,27:f,29:g,30:p,31:m,33:_,37:b,48:v,58:r},{13:34,14:[1,35],61:y},e([14,61],[2,52]),e(w,[2,6]),{6:30,10:37,11:6,16:l,17:31,20:19,21:c,22:d,23:u,24:23,25:h,27:f,29:g,30:p,31:m,33:_,37:b,48:v,58:r},e(w,[2,8]),e(w,[2,9]),{17:38,48:v},{5:[1,39]},e(w,[2,15]),{17:40,48:v},{17:41,48:v},{5:[1,42]},{26:43,57:C},{19:[1,45]},{19:[1,46]},{19:[1,47]},{19:[1,48]},{19:[1,49]},e(w,[2,25]),{45:50,49:[1,51],50:[1,52],51:[1,53],52:[1,54],53:[1,55],54:[1,56],55:[1,57],56:[1,58]},{38:59,39:[1,60],43:[1,61],44:[1,62]},e([5,18,42,49,50,51,52,53,54,55,56,57],[2,41]),{5:[1,63]},{15:64,60:[1,65]},{5:[2,54]},e(w,[2,7]),{5:[1,67],18:[1,66]},e(w,[2,14]),{5:[1,68]},{5:[1,69]},e(w,[2,18]),{5:[1,70]},{5:[2,50]},e(S,o,{8:71}),e(S,o,{8:72}),e(S,o,{8:73}),e(k,o,{32:74,8:75}),e(x,o,{34:76,8:77}),{17:80,46:[1,78],47:[1,79],48:v},e(L,[2,42]),e(L,[2,43]),e(L,[2,44]),e(L,[2,45]),e(L,[2,46]),e(L,[2,47]),e(L,[2,48]),e(L,[2,49]),{17:81,48:v},{17:83,40:82,48:v},{48:[2,36]},{48:[2,37]},e(M,[2,10]),{13:84,61:y},{61:[2,53]},{19:[1,85]},e(w,[2,13]),e(w,[2,16]),e(w,[2,17]),e(w,[2,19]),{4:s,5:a,6:30,9:14,10:16,11:6,16:l,17:31,20:19,21:c,22:d,23:u,24:23,25:h,27:f,28:[1,86],29:g,30:p,31:m,33:_,37:b,48:v,58:r},{4:s,5:a,6:30,9:14,10:16,11:6,16:l,17:31,20:19,21:c,22:d,23:u,24:23,25:h,27:f,28:[1,87],29:g,30:p,31:m,33:_,37:b,48:v,58:r},{4:s,5:a,6:30,9:14,10:16,11:6,16:l,17:31,20:19,21:c,22:d,23:u,24:23,25:h,27:f,28:[1,88],29:g,30:p,31:m,33:_,37:b,48:v,58:r},{28:[1,89]},{4:s,5:a,6:30,9:14,10:16,11:6,16:l,17:31,20:19,21:c,22:d,23:u,24:23,25:h,27:f,28:[2,28],29:g,30:p,31:m,33:_,36:[1,90],37:b,48:v,58:r},{28:[1,91]},{4:s,5:a,6:30,9:14,10:16,11:6,16:l,17:31,20:19,21:c,22:d,23:u,24:23,25:h,27:f,28:[2,26],29:g,30:p,31:m,33:_,35:[1,92],37:b,48:v,58:r},{17:93,48:v},{17:94,48:v},{26:95,57:C},{26:96,57:C},{26:97,57:C},{42:[1,98],57:[2,35]},{5:[1,99]},{5:[1,100]},e(w,[2,20]),e(w,[2,21]),e(w,[2,22]),e(w,[2,23]),{19:[1,101]},e(w,[2,24]),{19:[1,102]},{26:103,57:C},{26:104,57:C},{5:[2,40]},{5:[2,30]},{5:[2,31]},{17:105,48:v},e(M,[2,11]),e(w,[2,12]),e(k,o,{8:75,32:106}),e(x,o,{8:77,34:107}),{5:[2,38]},{5:[2,39]},{57:[2,34]},{28:[2,29]},{28:[2,27]}],defaultActions:{7:[2,51],8:[2,1],9:[2,2],10:[2,3],36:[2,54],44:[2,50],61:[2,36],62:[2,37],65:[2,53],95:[2,40],96:[2,30],97:[2,31],103:[2,38],104:[2,39],105:[2,34],106:[2,29],107:[2,27]},parseError:function(e,t){if(!t.recoverable){var n=new Error(e);throw n.hash=t,n}this.trace(e)},parse:function(e){var t=this,n=[0],i=[],r=[null],o=[],s=this.table,a="",l=0,c=0,d=0,u=2,h=1,f=o.slice.call(arguments,1),g=Object.create(this.lexer),p={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(p.yy[m]=this.yy[m]);g.setInput(e,p.yy),p.yy.lexer=g,p.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var _=g.yylloc;o.push(_);var b=g.options&&g.options.ranges;function v(){var e;return"number"!=typeof(e=i.pop()||g.lex()||h)&&(e instanceof Array&&(e=(i=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var y,w,C,S,k,x,L,M,D,E={};;){if(C=n[n.length-1],this.defaultActions[C]?S=this.defaultActions[C]:(null==y&&(y=v()),S=s[C]&&s[C][y]),void 0===S||!S.length||!S[0]){var T="";for(x in D=[],s[C])this.terminals_[x]&&x>u&&D.push("'"+this.terminals_[x]+"'");T=g.showPosition?"Parse error on line "+(l+1)+":\n"+g.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(l+1)+": Unexpected "+(y==h?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(T,{text:g.match,token:this.terminals_[y]||y,line:g.yylineno,loc:_,expected:D})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+C+", token: "+y);switch(S[0]){case 1:n.push(y),r.push(g.yytext),o.push(g.yylloc),n.push(S[1]),y=null,w?(y=w,w=null):(c=g.yyleng,a=g.yytext,l=g.yylineno,_=g.yylloc,d>0&&d--);break;case 2:if(L=this.productions_[S[1]][1],E.$=r[r.length-L],E._$={first_line:o[o.length-(L||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(L||1)].first_column,last_column:o[o.length-1].last_column},b&&(E._$.range=[o[o.length-(L||1)].range[0],o[o.length-1].range[1]]),void 0!==(k=this.performAction.apply(E,[a,c,l,p.yy,S[1],r,o].concat(f))))return k;L&&(n=n.slice(0,-1*L*2),r=r.slice(0,-1*L),o=o.slice(0,-1*L)),n.push(this.productions_[S[1]][0]),r.push(E.$),o.push(E._$),M=s[n[n.length-2]][n[n.length-1]],n.push(M);break;case 3:return!0}}return!0}},E={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var o in r)this[o]=r[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),o=0;ot[0].length)){if(t=n,i=o,this.options.backtrack_lexer){if(!1!==(e=this.test_match(n,r[o])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,r[i]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(e,t,n,i){switch(n){case 0:return this.begin("open_directive"),58;case 1:return this.begin("type_directive"),59;case 2:return this.popState(),this.begin("arg_directive"),14;case 3:return this.popState(),this.popState(),61;case 4:return 60;case 5:return 5;case 6:case 7:case 8:case 9:case 10:break;case 11:return this.begin("ID"),16;case 12:return t.yytext=t.yytext.trim(),this.begin("ALIAS"),48;case 13:return this.popState(),this.popState(),this.begin("LINE"),18;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),27;case 16:return this.begin("LINE"),29;case 17:return this.begin("LINE"),30;case 18:return this.begin("LINE"),31;case 19:return this.begin("LINE"),36;case 20:return this.begin("LINE"),33;case 21:return this.begin("LINE"),35;case 22:return this.popState(),19;case 23:return 28;case 24:return 43;case 25:return 44;case 26:return 39;case 27:return 37;case 28:return this.begin("ID"),22;case 29:return this.begin("ID"),23;case 30:return 25;case 31:return 7;case 32:return 21;case 33:return 42;case 34:return 5;case 35:return t.yytext=t.yytext.trim(),48;case 36:return 51;case 37:return 52;case 38:return 49;case 39:return 50;case 40:return 53;case 41:return 54;case 42:return 55;case 43:return 56;case 44:return 57;case 45:return 46;case 46:return 47;case 47:return 5;case 48:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:participant\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{open_directive:{rules:[1,8],inclusive:!1},type_directive:{rules:[2,3,8],inclusive:!1},arg_directive:{rules:[3,4,8],inclusive:!1},ID:{rules:[7,8,12],inclusive:!1},ALIAS:{rules:[7,8,13,14],inclusive:!1},LINE:{rules:[7,8,22],inclusive:!1},INITIAL:{rules:[0,5,6,8,9,10,11,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],inclusive:!0}}};function T(){this.yy={}}return D.lexer=E,T.prototype=D,D.Parser=T,new T}();t.parser=r,t.Parser=r.Parser,t.parse=function(){return r.parse.apply(r,arguments)},t.main=function(i){i[1]||(console.log("Usage: "+i[0]+" FILE"),e.exit(1));var r=n(/*! fs */"./node_modules/node-libs-browser/mock/empty.js").readFileSync(n(/*! path */"./node_modules/path-browserify/index.js").normalize(i[1]),"utf8");return t.parser.parse(r)},n.c[n.s]===i&&t.main(e.argv.slice(1))}).call(this,n(/*! ./../../../../node_modules/process/browser.js */"./node_modules/process/browser.js"),n(/*! ./../../../../node_modules/webpack/buildin/module.js */"./node_modules/webpack/buildin/module.js")(e))},"./src/diagrams/sequence/sequenceDb.js": +/*!*********************************************!*\ + !*** ./src/diagrams/sequence/sequenceDb.js ***! + \*********************************************/ +/*! exports provided: parseDirective, addActor, addMessage, addSignal, getMessages, getActors, getActor, getActorKeys, getTitle, getTitleWrapped, enableSequenceNumbers, showSequenceNumbers, setWrap, autoWrap, clear, parseMessage, LINETYPE, ARROWTYPE, PLACEMENT, addNote, setTitle, apply, default */function(e,t,n){"use strict";n.r(t),n.d(t,"parseDirective",(function(){return g})),n.d(t,"addActor",(function(){return p})),n.d(t,"addMessage",(function(){return _})),n.d(t,"addSignal",(function(){return b})),n.d(t,"getMessages",(function(){return v})),n.d(t,"getActors",(function(){return y})),n.d(t,"getActor",(function(){return w})),n.d(t,"getActorKeys",(function(){return C})),n.d(t,"getTitle",(function(){return S})),n.d(t,"getTitleWrapped",(function(){return k})),n.d(t,"enableSequenceNumbers",(function(){return x})),n.d(t,"showSequenceNumbers",(function(){return L})),n.d(t,"setWrap",(function(){return M})),n.d(t,"autoWrap",(function(){return D})),n.d(t,"clear",(function(){return E})),n.d(t,"parseMessage",(function(){return T})),n.d(t,"LINETYPE",(function(){return O})),n.d(t,"ARROWTYPE",(function(){return N})),n.d(t,"PLACEMENT",(function(){return I})),n.d(t,"addNote",(function(){return A})),n.d(t,"setTitle",(function(){return R})),n.d(t,"apply",(function(){return P}));var i=n(/*! ../../mermaidAPI */"./src/mermaidAPI.js"),r=n(/*! ../../config */"./src/config.js"),o=n(/*! ../../logger */"./src/logger.js"),s=void 0,a={},l=[],c=[],d="",u=!1,h=!1,f=!1,g=function(e,t,n){i.default.parseDirective(this,e,t,n)},p=function(e,t,n){var i=a[e];i&&t===i.name&&null==n||(null!=n&&null!=n.text||(n={text:t,wrap:null}),a[e]={name:t,description:n.text,wrap:void 0===n.wrap&&D()||!!n.wrap,prevActor:s},s&&a[s]&&(a[s].nextActor=e),s=e)},m=function(e){var t,n=0;for(t=0;t2&&void 0!==arguments[2]?arguments[2]:{text:void 0,wrap:void 0},i=arguments.length>3?arguments[3]:void 0;if(i===O.ACTIVE_END){var r=m(e.actor);if(r<1){var o=new Error("Trying to inactivate an inactive participant ("+e.actor+")");throw o.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},o}}return l.push({from:e,to:t,message:n.text,wrap:void 0===n.wrap&&D()||!!n.wrap,type:i}),!0},v=function(){return l},y=function(){return a},w=function(e){return a[e]},C=function(){return Object.keys(a)},S=function(){return d},k=function(){return u},x=function(){h=!0},L=function(){return h},M=function(e){f=e},D=function(){return f},E=function(){a={},l=[]},T=function(e){var t=e.trim(),n={text:t.replace(/^[:]?(?:no)?wrap:/,"").trim(),wrap:null!==t.match(/^[:]?wrap:/)||null===t.match(/^[:]?nowrap:/)&&void 0};return o.log.debug("parseMessage:",n),n},O={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},N={FILLED:0,OPEN:1},I={LEFTOF:0,RIGHTOF:1,OVER:2},A=function(e,t,n){var i={actor:e,placement:t,message:n.text,wrap:void 0===n.wrap&&D()||!!n.wrap},r=[].concat(e,e);c.push(i),l.push({from:r[0],to:r[1],message:n.text,wrap:void 0===n.wrap&&D()||!!n.wrap,type:O.NOTE,placement:t})},R=function(e){d=e.text,u=void 0===e.wrap&&D()||!!e.wrap},P=function e(t){if(t instanceof Array)t.forEach((function(t){e(t)}));else switch(t.type){case"addActor":p(t.actor,t.actor,t.description);break;case"activeStart":case"activeEnd":b(t.actor,void 0,void 0,t.signalType);break;case"addNote":A(t.actor,t.placement,t.text);break;case"addMessage":b(t.from,t.to,t.msg,t.signalType);break;case"loopStart":b(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":b(void 0,void 0,void 0,t.signalType);break;case"rectStart":b(void 0,void 0,t.color,t.signalType);break;case"rectEnd":b(void 0,void 0,void 0,t.signalType);break;case"optStart":b(void 0,void 0,t.optText,t.signalType);break;case"optEnd":b(void 0,void 0,void 0,t.signalType);break;case"altStart":case"else":b(void 0,void 0,t.altText,t.signalType);break;case"altEnd":b(void 0,void 0,void 0,t.signalType);break;case"setTitle":R(t.text);break;case"parStart":case"and":b(void 0,void 0,t.parText,t.signalType);break;case"parEnd":b(void 0,void 0,void 0,t.signalType)}};t.default={addActor:p,addMessage:_,addSignal:b,autoWrap:D,setWrap:M,enableSequenceNumbers:x,showSequenceNumbers:L,getMessages:v,getActors:y,getActor:w,getActorKeys:C,getTitle:S,parseDirective:g,getConfig:function(){return r.getConfig().sequence},getTitleWrapped:k,clear:E,parseMessage:T,LINETYPE:O,ARROWTYPE:N,PLACEMENT:I,addNote:A,setTitle:R,apply:P}},"./src/diagrams/sequence/sequenceRenderer.js": +/*!***************************************************!*\ + !*** ./src/diagrams/sequence/sequenceRenderer.js ***! + \***************************************************/ +/*! exports provided: bounds, drawActors, setConf, draw, default */function(e,t,n){"use strict";n.r(t),n.d(t,"bounds",(function(){return h})),n.d(t,"drawActors",(function(){return m})),n.d(t,"setConf",(function(){return _})),n.d(t,"draw",(function(){return w}));var i=n(/*! d3 */"d3"),r=n(/*! ./svgDraw */"./src/diagrams/sequence/svgDraw.js"),o=n(/*! ../../logger */"./src/logger.js"),s=n(/*! ./parser/sequenceDiagram */"./src/diagrams/sequence/parser/sequenceDiagram.jison"),a=n(/*! ../common/common */"./src/diagrams/common/common.js"),l=n(/*! ./sequenceDb */"./src/diagrams/sequence/sequenceDb.js"),c=n(/*! ../../config */"./src/config.js"),d=n(/*! ../../utils */"./src/utils.js");s.parser.yy=l.default;var u={},h={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map((function(e){return e.height||0})))+(0===this.loops.length?0:this.loops.map((function(e){return e.height||0})).reduce((function(e,t){return e+t})))+(0===this.messages.length?0:this.messages.map((function(e){return e.height||0})).reduce((function(e,t){return e+t})))+(0===this.notes.length?0:this.notes.map((function(e){return e.height||0})).reduce((function(e,t){return e+t})))},clear:function(){this.actors=[],this.loops=[],this.messages=[],this.notes=[]},addActor:function(e){this.actors.push(e)},addLoop:function(e){this.loops.push(e)},addMessage:function(e){this.messages.push(e)},addNote:function(e){this.notes.push(e)},lastActor:function(){return this.actors[this.actors.length-1]},lastLoop:function(){return this.loops[this.loops.length-1]},lastMessage:function(){return this.messages[this.messages.length-1]},lastNote:function(){return this.notes[this.notes.length-1]},actors:[],loops:[],messages:[],notes:[]},init:function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,_(s.parser.yy.getConfig())},updateVal:function(e,t,n,i){void 0===e[t]?e[t]=n:e[t]=i(n,e[t])},updateBounds:function(e,t,n,i){var r=this,o=0;function s(s){return function(a){o++;var l=r.sequenceItems.length-o+1;r.updateVal(a,"starty",t-l*u.boxMargin,Math.min),r.updateVal(a,"stopy",i+l*u.boxMargin,Math.max),r.updateVal(h.data,"startx",e-l*u.boxMargin,Math.min),r.updateVal(h.data,"stopx",n+l*u.boxMargin,Math.max),"activation"!==s&&(r.updateVal(a,"startx",e-l*u.boxMargin,Math.min),r.updateVal(a,"stopx",n+l*u.boxMargin,Math.max),r.updateVal(h.data,"starty",t-l*u.boxMargin,Math.min),r.updateVal(h.data,"stopy",i+l*u.boxMargin,Math.max))}}this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},insert:function(e,t,n,i){var r=Math.min(e,n),o=Math.max(e,n),s=Math.min(t,i),a=Math.max(t,i);this.updateVal(h.data,"startx",r,Math.min),this.updateVal(h.data,"starty",s,Math.min),this.updateVal(h.data,"stopx",o,Math.max),this.updateVal(h.data,"stopy",a,Math.max),this.updateBounds(r,s,o,a)},newActivation:function(e,t,n){var i=n[e.from.actor],o=b(e.from.actor).length||0,s=i.x+i.width/2+(o-1)*u.activationWidth/2;this.activations.push({startx:s,starty:this.verticalPos+2,stopx:s+u.activationWidth,stopy:void 0,actor:e.from.actor,anchored:r.default.anchorElement(t)})},endActivation:function(e){var t=this.activations.map((function(e){return e.actor})).lastIndexOf(e.from.actor);return this.activations.splice(t,1)[0]},createLoop:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{message:void 0,wrap:!1,width:void 0},t=arguments.length>1?arguments[1]:void 0;return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},newLoop:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{message:void 0,wrap:!1,width:void 0},t=arguments.length>1?arguments[1]:void 0;this.sequenceItems.push(this.createLoop(e,t))},endLoop:function(){return this.sequenceItems.pop()},addSectionToLoop:function(e){var t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:h.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},bumpVerticalPos:function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return{bounds:this.data,models:this.models}}},f=function(e){return{fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}},g=function(e){return{fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}},p=function(e){return{fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}},m=function(e,t,n,i){for(var o=0,s=0,a=0;at&&(i.starty=t-6,t+=12),r.default.drawActivation(n,i,t,u,b(e.from.actor).length),h.insert(i.startx,t-10,i.stopx,t)}(e,h.getVerticalPos());break;case s.parser.yy.LINETYPE.LOOP_START:y(x,e,u.boxMargin,u.boxMargin+u.boxTextMargin,(function(e){return h.newLoop(e)}));break;case s.parser.yy.LINETYPE.LOOP_END:t=h.endLoop(),r.default.drawLoop(n,t,"loop",u),h.bumpVerticalPos(t.stopy-h.getVerticalPos()),h.models.addLoop(t);break;case s.parser.yy.LINETYPE.RECT_START:y(x,e,u.boxMargin,u.boxMargin,(function(e){return h.newLoop(void 0,e.message)}));break;case s.parser.yy.LINETYPE.RECT_END:t=h.endLoop(),r.default.drawBackgroundRect(n,t),h.models.addLoop(t),h.bumpVerticalPos(t.stopy-h.getVerticalPos());break;case s.parser.yy.LINETYPE.OPT_START:y(x,e,u.boxMargin,u.boxMargin+u.boxTextMargin,(function(e){return h.newLoop(e)}));break;case s.parser.yy.LINETYPE.OPT_END:t=h.endLoop(),r.default.drawLoop(n,t,"opt",u),h.bumpVerticalPos(t.stopy-h.getVerticalPos()),h.models.addLoop(t);break;case s.parser.yy.LINETYPE.ALT_START:y(x,e,u.boxMargin,u.boxMargin+u.boxTextMargin,(function(e){return h.newLoop(e)}));break;case s.parser.yy.LINETYPE.ALT_ELSE:y(x,e,u.boxMargin+u.boxTextMargin,u.boxMargin,(function(e){return h.addSectionToLoop(e)}));break;case s.parser.yy.LINETYPE.ALT_END:t=h.endLoop(),r.default.drawLoop(n,t,"alt",u),h.bumpVerticalPos(t.stopy-h.getVerticalPos()),h.models.addLoop(t);break;case s.parser.yy.LINETYPE.PAR_START:y(x,e,u.boxMargin,u.boxMargin+u.boxTextMargin,(function(e){return h.newLoop(e)}));break;case s.parser.yy.LINETYPE.PAR_AND:y(x,e,u.boxMargin+u.boxTextMargin,u.boxMargin,(function(e){return h.addSectionToLoop(e)}));break;case s.parser.yy.LINETYPE.PAR_END:t=h.endLoop(),r.default.drawLoop(n,t,"par",u),h.bumpVerticalPos(t.stopy-h.getVerticalPos()),h.models.addLoop(t);break;default:try{(c=e.msgModel).starty=h.getVerticalPos(),c.sequenceIndex=L,function(e,t){h.bumpVerticalPos(10);var n=t.startx,i=t.stopx,o=t.starty,c=t.message,g=t.type,p=t.sequenceIndex,m=a.default.splitBreaks(c).length,_=d.default.calculateTextDimensions(c,f(u)),b=_.height/m;t.height+=b,h.bumpVerticalPos(b);var v=r.default.getTextObj();v.x=n,v.y=o+10,v.width=i-n,v.class="messageText",v.dy="1em",v.text=c,v.fontFamily=u.messageFontFamily,v.fontSize=u.messageFontSize,v.fontWeight=u.messageFontWeight,v.anchor=u.messageAlign,v.valign=u.messageAlign,v.textMargin=u.wrapPadding,v.tspan=!1,Object(r.drawText)(e,v);var y,w,C=_.height-10,S=_.width;if(n===i){w=h.getVerticalPos()+C,u.rightAngles?y=e.append("path").attr("d","M ".concat(n,",").concat(w," H ").concat(n+Math.max(u.width/2,S/2)," V ").concat(w+25," H ").concat(n)):(C+=u.boxMargin,w=h.getVerticalPos()+C,y=e.append("path").attr("d","M "+n+","+w+" C "+(n+60)+","+(w-10)+" "+(n+60)+","+(w+30)+" "+n+","+(w+20))),C+=30;var k=Math.max(S/2,u.width/2);h.insert(n-k,h.getVerticalPos()-10+C,i+k,h.getVerticalPos()+30+C)}else C+=u.boxMargin,w=h.getVerticalPos()+C,(y=e.append("line")).attr("x1",n),y.attr("y1",w),y.attr("x2",i),y.attr("y2",w),h.insert(n,w-10,i,w);g===s.parser.yy.LINETYPE.DOTTED||g===s.parser.yy.LINETYPE.DOTTED_CROSS||g===s.parser.yy.LINETYPE.DOTTED_POINT||g===s.parser.yy.LINETYPE.DOTTED_OPEN?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0");var x="";u.arrowMarkerAbsolute&&(x=(x=(x=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)")),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),g!==s.parser.yy.LINETYPE.SOLID&&g!==s.parser.yy.LINETYPE.DOTTED||y.attr("marker-end","url("+x+"#arrowhead)"),g!==s.parser.yy.LINETYPE.SOLID_POINT&&g!==s.parser.yy.LINETYPE.DOTTED_POINT||y.attr("marker-end","url("+x+"#filled-head)"),g!==s.parser.yy.LINETYPE.SOLID_CROSS&&g!==s.parser.yy.LINETYPE.DOTTED_CROSS||y.attr("marker-end","url("+x+"#crosshead)"),(l.default.showSequenceNumbers()||u.showSequenceNumbers)&&(y.attr("marker-start","url("+x+"#sequencenumber)"),e.append("text").attr("x",n).attr("y",w+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("textLength","16px").attr("class","sequenceNumber").text(p)),h.bumpVerticalPos(C),t.height+=C,t.stopy=t.starty+t.height,h.insert(t.fromBounds,t.starty,t.toBounds,t.stopy)}(n,c),h.models.addMessage(c)}catch(e){o.log.error("error while drawing message",e)}}[s.parser.yy.LINETYPE.SOLID_OPEN,s.parser.yy.LINETYPE.DOTTED_OPEN,s.parser.yy.LINETYPE.SOLID,s.parser.yy.LINETYPE.DOTTED,s.parser.yy.LINETYPE.SOLID_CROSS,s.parser.yy.LINETYPE.DOTTED_CROSS,s.parser.yy.LINETYPE.SOLID_POINT,s.parser.yy.LINETYPE.DOTTED_POINT].includes(e.type)&&L++})),u.mirrorActors&&(h.bumpVerticalPos(2*u.boxMargin),m(n,g,p,h.getVerticalPos()));var M=h.getBounds().bounds;o.log.debug("For line height fix Querying: #"+t+" .actor-line"),Object(i.selectAll)("#"+t+" .actor-line").attr("y2",M.stopy);var D=M.stopy-M.starty+2*u.diagramMarginY;u.mirrorActors&&(D=D-u.boxMargin+u.bottomMarginAdj);var E=M.stopx-M.startx+2*u.diagramMarginX;v&&n.append("text").text(v).attr("x",(M.stopx-M.startx)/2-2*u.diagramMarginX).attr("y",-25),Object(d.configureSvgSize)(n,D,E,u.useMaxWidth);var T=v?40:0;n.attr("viewBox",M.startx-u.diagramMarginX+" -"+(u.diagramMarginY+T)+" "+E+" "+(D+T)),o.log.debug("models:",h.models)},C=function(e,t){var n={};return t.forEach((function(t){if(e[t.to]&&e[t.from]){var i=e[t.to];if(t.placement===s.parser.yy.PLACEMENT.LEFTOF&&!i.prevActor)return;if(t.placement===s.parser.yy.PLACEMENT.RIGHTOF&&!i.nextActor)return;var r=void 0!==t.placement,o=!r,a=r?g(u):f(u),l=t.wrap?d.default.wrapLabel(t.message,u.width-2*u.wrapPadding,a):t.message,c=d.default.calculateTextDimensions(l,a).width+2*u.wrapPadding;o&&t.from===i.nextActor?n[t.to]=Math.max(n[t.to]||0,c):o&&t.from===i.prevActor?n[t.from]=Math.max(n[t.from]||0,c):o&&t.from===t.to?(n[t.from]=Math.max(n[t.from]||0,c/2),n[t.to]=Math.max(n[t.to]||0,c/2)):t.placement===s.parser.yy.PLACEMENT.RIGHTOF?n[t.from]=Math.max(n[t.from]||0,c):t.placement===s.parser.yy.PLACEMENT.LEFTOF?n[i.prevActor]=Math.max(n[i.prevActor]||0,c):t.placement===s.parser.yy.PLACEMENT.OVER&&(i.prevActor&&(n[i.prevActor]=Math.max(n[i.prevActor]||0,c/2)),i.nextActor&&(n[t.from]=Math.max(n[t.from]||0,c/2)))}})),o.log.debug("maxMessageWidthPerActor:",n),n},S=function(e,t){var n=0;for(var i in Object.keys(e).forEach((function(t){var i=e[t];i.wrap&&(i.description=d.default.wrapLabel(i.description,u.width-2*u.wrapPadding,p(u)));var r=d.default.calculateTextDimensions(i.description,p(u));i.width=i.wrap?u.width:Math.max(u.width,r.width+2*u.wrapPadding),i.height=i.wrap?Math.max(r.height,u.height):u.height,n=Math.max(n,i.height)})),t){var r=e[i];if(r){var o=e[r.nextActor];if(o){var s=t[i]+u.actorMargin-r.width/2-o.width/2;r.margin=Math.max(s,u.actorMargin)}}}return Math.max(n,u.height)},k=function(e,t){var n,i,r,a={},l=[];return e.forEach((function(e){switch(e.id=d.default.random({length:10}),e.type){case s.parser.yy.LINETYPE.LOOP_START:case s.parser.yy.LINETYPE.ALT_START:case s.parser.yy.LINETYPE.OPT_START:case s.parser.yy.LINETYPE.PAR_START:l.push({id:e.id,msg:e.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case s.parser.yy.LINETYPE.ALT_ELSE:case s.parser.yy.LINETYPE.PAR_AND:e.message&&(n=l.pop(),a[n.id]=n,a[e.id]=n,l.push(n));break;case s.parser.yy.LINETYPE.LOOP_END:case s.parser.yy.LINETYPE.ALT_END:case s.parser.yy.LINETYPE.OPT_END:case s.parser.yy.LINETYPE.PAR_END:n=l.pop(),a[n.id]=n;break;case s.parser.yy.LINETYPE.ACTIVE_START:var c=t[e.from?e.from.actor:e.to.actor],p=b(e.from?e.from.actor:e.to.actor).length,m=c.x+c.width/2+(p-1)*u.activationWidth/2,_={startx:m,stopx:m+u.activationWidth,actor:e.from.actor,enabled:!0};h.activations.push(_);break;case s.parser.yy.LINETYPE.ACTIVE_END:var y=h.activations.map((function(e){return e.actor})).lastIndexOf(e.from.actor);delete h.activations.splice(y,1)[0]}void 0!==e.placement?(i=function(e,t){var n=t[e.from].x,i=t[e.to].x,r=e.wrap&&e.message,a=d.default.calculateTextDimensions(r?d.default.wrapLabel(e.message,u.width,g(u)):e.message,g(u)),l={width:r?u.width:Math.max(u.width,a.width+2*u.noteMargin),height:0,startx:t[e.from].x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===s.parser.yy.PLACEMENT.RIGHTOF?(l.width=r?Math.max(u.width,a.width):Math.max(t[e.from].width/2+t[e.to].width/2,a.width+2*u.noteMargin),l.startx=n+(t[e.from].width+u.actorMargin)/2):e.placement===s.parser.yy.PLACEMENT.LEFTOF?(l.width=r?Math.max(u.width,a.width+2*u.noteMargin):Math.max(t[e.from].width/2+t[e.to].width/2,a.width+2*u.noteMargin),l.startx=n-l.width+(t[e.from].width-u.actorMargin)/2):e.to===e.from?(a=d.default.calculateTextDimensions(r?d.default.wrapLabel(e.message,Math.max(u.width,t[e.from].width),g(u)):e.message,g(u)),l.width=r?Math.max(u.width,t[e.from].width):Math.max(t[e.from].width,u.width,a.width+2*u.noteMargin),l.startx=n+(t[e.from].width-l.width)/2):(l.width=Math.abs(n+t[e.from].width/2-(i+t[e.to].width/2))+u.actorMargin,l.startx=n0&&l.forEach((function(i){if(n=i,r.startx===r.stopx){var o=t[e.from],s=t[e.to];n.from=Math.min(o.x-r.width/2,o.x-o.width/2,n.from),n.to=Math.max(s.x+r.width/2,s.x+o.width/2,n.to),n.width=Math.max(n.width,Math.abs(n.to-n.from))-u.labelBoxWidth}else n.from=Math.min(r.startx,n.from),n.to=Math.max(r.stopx,n.to),n.width=Math.max(n.width,r.width)-u.labelBoxWidth})))})),h.activations=[],o.log.debug("Loop type widths:",a),a};t.default={bounds:h,drawActors:m,setConf:_,draw:w}},"./src/diagrams/sequence/styles.js": /*!*****************************************!*\ - !*** ./node_modules/process/browser.js ***! + !*** ./src/diagrams/sequence/styles.js ***! \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), - -/***/ "./node_modules/regexparam/dist/regexparam.mjs": -/*!*****************************************************!*\ - !*** ./node_modules/regexparam/dist/regexparam.mjs ***! - \*****************************************************/ -/*! exports provided: default */ -/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony default export */ __webpack_exports__["default"] = (function (str, loose) { - if (str instanceof RegExp) return { keys:false, pattern:str }; - var c, o, tmp, ext, keys=[], pattern='', arr = str.split('/'); - arr[0] || arr.shift(); - - while (tmp = arr.shift()) { - c = tmp[0]; - if (c === '*') { - keys.push('wild'); - pattern += '/(.*)'; - } else if (c === ':') { - o = tmp.indexOf('?', 1); - ext = tmp.indexOf('.', 1); - keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) ); - pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)'; - if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext); - } else { - pattern += '/' + tmp; - } - } - - return { - keys: keys, - pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i') - }; -}); - - -/***/ }), - -/***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js": -/*!****************************************************************************!*\ - !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var isOldIE = function isOldIE() { - var memo; - return function memorize() { - if (typeof memo === 'undefined') { - // Test for IE <= 9 as proposed by Browserhacks - // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 - // Tests for existence of standard globals is to allow style-loader - // to operate correctly into non-standard environments - // @see https://github.com/webpack-contrib/style-loader/issues/177 - memo = Boolean(window && document && document.all && !window.atob); - } - - return memo; - }; -}(); - -var getTarget = function getTarget() { - var memo = {}; - return function memorize(target) { - if (typeof memo[target] === 'undefined') { - var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself - - if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { - try { - // This will throw an exception if access to iframe is blocked - // due to cross-origin restrictions - styleTarget = styleTarget.contentDocument.head; - } catch (e) { - // istanbul ignore next - styleTarget = null; - } - } - - memo[target] = styleTarget; - } - - return memo[target]; - }; -}(); - -var stylesInDom = []; - -function getIndexByIdentifier(identifier) { - var result = -1; - - for (var i = 0; i < stylesInDom.length; i++) { - if (stylesInDom[i].identifier === identifier) { - result = i; - break; - } - } - - return result; -} - -function modulesToDom(list, options) { - var idCountMap = {}; - var identifiers = []; - - for (var i = 0; i < list.length; i++) { - var item = list[i]; - var id = options.base ? item[0] + options.base : item[0]; - var count = idCountMap[id] || 0; - var identifier = "".concat(id, " ").concat(count); - idCountMap[id] = count + 1; - var index = getIndexByIdentifier(identifier); - var obj = { - css: item[1], - media: item[2], - sourceMap: item[3] - }; - - if (index !== -1) { - stylesInDom[index].references++; - stylesInDom[index].updater(obj); - } else { - stylesInDom.push({ - identifier: identifier, - updater: addStyle(obj, options), - references: 1 - }); - } - - identifiers.push(identifier); - } - - return identifiers; -} - -function insertStyleElement(options) { - var style = document.createElement('style'); - var attributes = options.attributes || {}; - - if (typeof attributes.nonce === 'undefined') { - var nonce = true ? __webpack_require__.nc : undefined; - - if (nonce) { - attributes.nonce = nonce; - } - } - - Object.keys(attributes).forEach(function (key) { - style.setAttribute(key, attributes[key]); - }); - - if (typeof options.insert === 'function') { - options.insert(style); - } else { - var target = getTarget(options.insert || 'head'); - - if (!target) { - throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); - } - - target.appendChild(style); - } - - return style; -} - -function removeStyleElement(style) { - // istanbul ignore if - if (style.parentNode === null) { - return false; - } - - style.parentNode.removeChild(style); -} -/* istanbul ignore next */ - - -var replaceText = function replaceText() { - var textStore = []; - return function replace(index, replacement) { - textStore[index] = replacement; - return textStore.filter(Boolean).join('\n'); - }; -}(); - -function applyToSingletonTag(style, index, remove, obj) { - var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE - - /* istanbul ignore if */ - - if (style.styleSheet) { - style.styleSheet.cssText = replaceText(index, css); - } else { - var cssNode = document.createTextNode(css); - var childNodes = style.childNodes; - - if (childNodes[index]) { - style.removeChild(childNodes[index]); - } - - if (childNodes.length) { - style.insertBefore(cssNode, childNodes[index]); - } else { - style.appendChild(cssNode); - } - } -} - -function applyToTag(style, options, obj) { - var css = obj.css; - var media = obj.media; - var sourceMap = obj.sourceMap; - - if (media) { - style.setAttribute('media', media); - } else { - style.removeAttribute('media'); - } - - if (sourceMap && typeof btoa !== 'undefined') { - css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */"); - } // For old IE - - /* istanbul ignore if */ - - - if (style.styleSheet) { - style.styleSheet.cssText = css; - } else { - while (style.firstChild) { - style.removeChild(style.firstChild); - } - - style.appendChild(document.createTextNode(css)); - } -} - -var singleton = null; -var singletonCounter = 0; - -function addStyle(obj, options) { - var style; - var update; - var remove; - - if (options.singleton) { - var styleIndex = singletonCounter++; - style = singleton || (singleton = insertStyleElement(options)); - update = applyToSingletonTag.bind(null, style, styleIndex, false); - remove = applyToSingletonTag.bind(null, style, styleIndex, true); - } else { - style = insertStyleElement(options); - update = applyToTag.bind(null, style, options); - - remove = function remove() { - removeStyleElement(style); - }; - } - - update(obj); - return function updateStyle(newObj) { - if (newObj) { - if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) { - return; - } - - update(obj = newObj); - } else { - remove(); - } - }; -} - -module.exports = function (list, options) { - options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of \n\t\t\t\t`,this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(G.a("slot"))):this.container.appendChild(this.view);const n=new _e.b;Or.BUBBLE_UP_EVENTS.forEach(e=>{n.add(G.n(this.container,e,e=>{this.onDOMEvent(e,!1)}))}),Or.BUBBLE_DOWN_EVENTS.forEach(e=>{n.add(G.n(this.container,e,e=>{this.onDOMEvent(e,!0)},!0))}),this.toDisposeOnSetContainer=n}}show(e){this.isVisible()&&this.hide(),G.s(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2500",this.view.style.position=this.useFixedPosition?"fixed":"absolute",G.Z(this.view),this.toDisposeOnClean=e.render(this.view)||_e.a.None,this.delegate=e,this.doLayout(),this.delegate.focus&&this.delegate.focus()}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||ve.c&&Er.a.pointerEvents?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;let e,t=this.delegate.getAnchor();if(G.M(t)){let n=G.C(t);e={top:n.top,left:n.left,width:n.width,height:n.height}}else e={top:t.y,left:t.x,width:t.width||1,height:t.height||2};const n=G.H(this.view),i=G.G(this.view),r=this.delegate.anchorPosition||0,o=this.delegate.anchorAlignment||0,s={offset:e.top-window.pageYOffset,size:e.height,position:0===r?0:1};let a;a=0===o?{offset:e.left,size:0,position:0}:{offset:e.left+e.width,size:0,position:1};const l=Tr(window.innerHeight,i,s)+window.pageYOffset;Dr.a.intersects({start:l,end:l+i},{start:s.offset,end:s.offset+s.size})&&(a.size=e.width,1===o&&(a.offset=e.left));const c=Tr(window.innerWidth,n,a);G.R(this.view,"top","bottom","left","right"),G.e(this.view,0===r?"bottom":"top"),G.e(this.view,0===o?"left":"right"),G.ab(this.view,"fixed",this.useFixedPosition);const d=G.C(this.container);this.view.style.top=`${l-(this.useFixedPosition?G.C(this.view).top:d.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?G.C(this.view).left:d.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null==t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),G.K(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!G.L(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}Or.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],Or.BUBBLE_DOWN_EVENTS=["click"];let Nr='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t@font-face {\n\t\tfont-family: "codicon";\n\t\tsrc: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }\n';var Ir=n(16),Ar=n(112),Rr=n(30),Pr=n(59);const jr=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Fr=/(&)?(&)([^\s&])/g,Br=Object(Ir.e)("menu-selection",Ir.a.check),Wr=Object(Ir.e)("menu-submenu",Ir.a.chevronRight);var Hr;!function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"}(Hr||(Hr={}));class Yr extends Lr.a{constructor(e,t,n={}){Object(G.e)(e,"monaco-menu-container"),e.setAttribute("role","presentation");const i=document.createElement("div");Object(G.e)(i,"monaco-menu"),i.setAttribute("role","presentation"),super(i,{orientation:2,actionViewItemProvider:e=>this.doGetActionViewItem(e,n,r),context:n.context,actionRunner:n.actionRunner,ariaLabel:n.ariaLabel,triggerKeys:{keys:[3,...ve.f||ve.d?[10]:[]],keyDown:!0}}),this.menuElement=i,this.actionsList.setAttribute("role","menu"),this.actionsList.tabIndex=0,this.menuDisposables=this._register(new _e.b),this.initializeStyleSheet(e),Object(G.i)(i,G.c.KEY_DOWN,e=>{new Gt.a(e).equals(2)&&e.preventDefault()}),n.enableMnemonics&&this.menuDisposables.add(Object(G.i)(i,G.c.KEY_DOWN,e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){G.b.stop(e,!0);const n=this.mnemonics.get(t);if(1===n.length&&(n[0]instanceof zr&&n[0].container&&this.focusItemByElement(n[0].container),n[0].onClick(e)),n.length>1){const e=n.shift();e&&e.container&&(this.focusItemByElement(e.container),n.push(e)),this.mnemonics.set(t,n)}}})),ve.d&&this._register(Object(G.i)(i,G.c.KEY_DOWN,e=>{const t=new Gt.a(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),G.b.stop(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),G.b.stop(e,!0))})),this._register(Object(G.i)(this.domNode,G.c.MOUSE_OUT,e=>{let t=e.relatedTarget;Object(G.L)(t,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())})),this._register(Object(G.i)(this.actionsList,G.c.MOUSE_OVER,e=>{let t=e.target;if(t&&Object(G.L)(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(Object(G.I)(t,"action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}));let r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new Mr.a(i,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const o=this.scrollableElement.getDomNode();o.style.position="",this._register(Object(G.i)(o,G.c.MOUSE_UP,e=>{e.preventDefault()})),i.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(e=>{var t;return null===(t=n.submenuIds)||void 0===t||!t.has(e.id)||(console.warn(`Found submenu cycle: ${e.id}`),!1)}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(e=>!(e instanceof Ur)).forEach((e,t,n)=>{e.updatePositionInSet(t+1,n.length)})}initializeStyleSheet(e){Object(G.O)(e)?(this.styleSheet=Object(G.v)(e),this.styleSheet.innerHTML=$r):(Yr.globalStyleSheet||(Yr.globalStyleSheet=Object(G.v)(),Yr.globalStyleSheet.innerHTML=$r),this.styleSheet=Yr.globalStyleSheet)}style(e){const t=this.getContainer(),n=e.foregroundColor?`${e.foregroundColor}`:"",i=e.backgroundColor?`${e.backgroundColor}`:"",r=e.borderColor?`1px solid ${e.borderColor}`:"",o=e.shadowColor?`0 2px 4px ${e.shadowColor}`:"";t.style.border=r,this.domNode.style.color=n,this.domNode.style.backgroundColor=i,t.style.boxShadow=o,this.viewItems&&this.viewItems.forEach(t=>{(t instanceof Vr||t instanceof Ur)&&t.style(e)})}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(Object(G.i)(this.element,G.c.MOUSE_UP,e=>{if(G.b.stop(e,!0),Rr.h){if(new Pr.a(e).rightButton)return;this.onClick(e)}setTimeout(()=>{this.onClick(e)},0)})),this._register(Object(G.i)(this.element,G.c.CONTEXT_MENU,e=>{G.b.stop(e,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Object(G.p)(this.element,Object(G.a)("a.action-menu-item")),this._action.id===xr.c.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Object(G.p)(this.item,Object(G.a)("span.menu-item-check"+Br.cssSelector)),this.check.setAttribute("role","none"),this.label=Object(G.p)(this.item,Object(G.a)("span.action-label")),this.options.label&&this.options.keybinding&&(Object(G.p)(this.item,Object(G.a)("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item&&this.item.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){Object(G.s)(this.label);let e=Object(Ir.h)(this.getAction().label);if(e){const t=function(e){const t=jr,n=t.exec(e);if(!n)return e;const i=!n[1];return e.replace(t,i?"$2$3":"").trim()}(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const n=jr.exec(e);if(n){e=Fe.u(e),Fr.lastIndex=0;let t=Fr.exec(e);for(;t&&t[1];)t=Fr.exec(e);const i=e=>e.replace(/&&/g,"&");t?this.label.append(Fe.K(i(e.substr(0,t.index))," "),Object(G.a)("u",{"aria-hidden":"true"},t[3]),Fe.Q(i(e.substr(t.index+t[0].length))," ")):this.label.innerText=i(e).trim(),this.item&&this.item.setAttribute("aria-keyshortcuts",(n[1]?n[1]:n[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=dn.a({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&this.item&&(this.item.title=e)}updateClass(){this.cssClass&&this.item&&Object(G.R)(this.item,this.cssClass),this.options.icon&&this.label?(this.cssClass=this.getAction().class||"",Object(G.e)(this.label,"icon"),this.cssClass&&Object(G.f)(this.label,this.cssClass),this.updateEnabled()):this.label&&Object(G.Q)(this.label,"icon")}updateEnabled(){this.getAction().enabled?(this.element&&Object(G.Q)(this.element,"disabled"),this.item&&(Object(G.Q)(this.item,"disabled"),this.item.tabIndex=0)):(this.element&&Object(G.e)(this.element,"disabled"),this.item&&(Object(G.e)(this.item,"disabled"),Object(G.T)(this.item)))}updateChecked(){this.item&&(this.getAction().checked?(Object(G.e)(this.item,"checked"),this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked","true")):(Object(G.Q)(this.item,"checked"),this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked","false")))}getMnemonic(){return this.mnemonic}applyStyle(){if(!this.menuStyle)return;const e=this.element&&Object(G.I)(this.element,"focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,n=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,i=e&&this.menuStyle.selectionBorderColor?`thin solid ${this.menuStyle.selectionBorderColor}`:"";this.item&&(this.item.style.color=t?t.toString():"",this.item.style.backgroundColor=n?n.toString():""),this.check&&(this.check.style.color=t?t.toString():""),this.container&&(this.container.style.border=i)}style(e){this.menuStyle=e,this.applyStyle()}}class zr extends Vr{constructor(e,t,n,i){super(e,e,i),this.submenuActions=t,this.parentData=n,this.submenuOptions=i,this.mysubmenu=null,this.submenuDisposables=this._register(new _e.b),this.mouseOver=!1,this.expandDirection=i&&void 0!==i.expandDirection?i.expandDirection:Hr.Right,this.showScheduler=new me.d(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new me.d(()=>{this.element&&!Object(G.L)(Object(G.x)(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(Object(G.e)(this.item,"monaco-submenu-item"),this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=Object(G.p)(this.item,Object(G.a)("span.submenu-indicator"+Wr.cssSelector)),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(Object(G.i)(this.element,G.c.KEY_UP,e=>{let t=new Gt.a(e);(t.equals(17)||t.equals(3))&&(G.b.stop(e,!0),this.createSubmenu(!0))})),this._register(Object(G.i)(this.element,G.c.KEY_DOWN,e=>{let t=new Gt.a(e);Object(G.x)()===this.item&&(t.equals(17)||t.equals(3))&&G.b.stop(e,!0)})),this._register(Object(G.i)(this.element,G.c.MOUSE_OVER,e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(Object(G.i)(this.element,G.c.MOUSE_LEAVE,e=>{this.mouseOver=!1})),this._register(Object(G.i)(this.element,G.c.FOCUS_OUT,e=>{this.element&&!Object(G.L)(Object(G.x)(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!1)})))}onClick(e){G.b.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch(e){}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,n,i){const r={top:0,left:0};return r.left=Tr(e.width,t.width,{position:i===Hr.Right?0:1,offset:n.left,size:n.width}),r.left>=n.left&&r.left{new Gt.a(e).equals(15)&&(G.b.stop(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(Object(G.i)(this.submenuContainer,G.c.KEY_DOWN,e=>{new Gt.a(e).equals(15)&&G.b.stop(e,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&(null===(t=this.item)||void 0===t||t.setAttribute("aria-expanded",e))}applyStyle(){if(super.applyStyle(),!this.menuStyle)return;const e=this.element&&Object(G.I)(this.element,"focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=e?`${e}`:""),this.parentData.submenu&&this.parentData.submenu.style(this.menuStyle)}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Ur extends Ar.a{style(e){this.label&&(this.label.style.borderBottomColor=e.separatorColor?`${e.separatorColor}`:"")}}let $r=`\n.monaco-menu {\n\tfont-size: 13px;\n\n}\n\n${Object(tr.b)(Br)}\n${Object(tr.b)(Wr)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\topacity: 0.4;\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid #bbb;\n\tpadding-top: 1px;\n\tmargin-left: .8em;\n\tmargin-right: .8em;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tpadding: 0.5em 0 0 0;\n\tmargin-bottom: 0.5em;\n\twidth: 100%;\n\theight: 0px !important;\n\tmargin-left: .8em !important;\n\tmargin-right: .8em !important;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tborder: thin solid transparent; /* prevents jumping behaviour on hover or focus */\n}\n\n\n/* High Contrast Theming */\n:host-context(.hc-black) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: .5em 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 1.8em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tpadding: 0.2em 0 0 0;\n\tmargin-bottom: 0.2em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}\n\n/* Arrows */\n.monaco-scrollable-element > .scrollbar > .scra {\n\tcursor: pointer;\n\tfont-size: 11px !important;\n}\n\n.monaco-scrollable-element > .visible {\n\topacity: 1;\n\n\t/* Background rule added for IE9 - to allow clicks on dom node */\n\tbackground:rgba(0,0,0,0);\n\n\ttransition: opacity 100ms linear;\n}\n.monaco-scrollable-element > .invisible {\n\topacity: 0;\n\tpointer-events: none;\n}\n.monaco-scrollable-element > .invisible.fade {\n\ttransition: opacity 800ms linear;\n}\n\n/* Scrollable Content Inset Shadow */\n.monaco-scrollable-element > .shadow {\n\tposition: absolute;\n\tdisplay: none;\n}\n.monaco-scrollable-element > .shadow.top {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 3px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: #DDD 0 6px 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.left {\n\tdisplay: block;\n\ttop: 3px;\n\tleft: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbox-shadow: #DDD 6px 0 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.top-left-corner {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 0;\n\theight: 3px;\n\twidth: 3px;\n}\n.monaco-scrollable-element > .shadow.top.left {\n\tbox-shadow: #DDD 6px 6px 6px -6px inset;\n}\n\n/* ---------- Default Style ---------- */\n\n:host-context(.vs) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(100, 100, 100, .4);\n}\n:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(121, 121, 121, .4);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(111, 195, 223, .6);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: rgba(100, 100, 100, .7);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: rgba(111, 195, 223, .8);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(0, 0, 0, .6);\n}\n:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(191, 191, 191, .4);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(111, 195, 223, 1);\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.top {\n\tbox-shadow: none;\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.left {\n\tbox-shadow: #000 6px 0 6px -6px inset;\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.top.left {\n\tbox-shadow: #000 6px 6px 6px -6px inset;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.top {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.left {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.top.left {\n\tbox-shadow: none;\n}\n`;var Kr=n(82),qr=n(34);class Gr{constructor(e,t,n,i,r){this.contextViewService=e,this.telemetryService=t,this.notificationService=n,this.keybindingService=i,this.themeService=r,this.focusToReturn=null,this.block=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;let n;this.focusToReturn=document.activeElement;let i=Object(G.M)(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,render:i=>{let r=e.getMenuClassName?e.getMenuClassName():"";r&&(i.className+=" "+r),this.options.blockMouse&&(this.block=i.appendChild(Object(G.a)(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",Object(qr.a)(this.block,G.c.MOUSE_DOWN)(e=>e.stopPropagation()));const o=new _e.b,s=e.actionRunner||new xr.b;return s.onDidBeforeRun(this.onActionRun,this,o),s.onDidRun(this.onDidActionRun,this,o),n=new Yr(i,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:s,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)}),o.add(Object(Kr.c)(n,this.themeService)),n.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,o),n.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,o),Object(qr.a)(window,G.c.BLUR)(()=>{this.contextViewService.hideContextView(!0)},null,o),Object(qr.a)(window,G.c.MOUSE_DOWN)(e=>{if(e.defaultPrevented)return;let t=new Pr.a(e),n=t.target;if(!t.rightButton){for(;n;){if(n===i)return;n=n.parentElement}this.contextViewService.hideContextView(!0)}},null,o),Object(_e.e)(o,n)},focus:()=>{n&&n.focus(!!e.autoSelectFirstItem)},onHide:t=>{e.onHide&&e.onHide(!!t),this.block&&(Object(G.S)(this.block),this.block=null),this.focusToReturn&&this.focusToReturn.focus()}},i,!!i)}onActionRun(e){this.telemetryService&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&&this.focusToReturn.focus()}onDidActionRun(e){e.error&&this.notificationService&&this.notificationService.error(e.error)}}var Zr=n(108),Jr=function(e,t){return function(n,i){t(n,i,e)}};let Xr=class extends _e.a{constructor(e,t,n,i,r){super(),this._onDidContextMenu=this._register(new F.a),this.onDidContextMenu=this._onDidContextMenu.event,this.contextMenuHandler=new Gr(n,e,t,i,r)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){this.contextMenuHandler.showContextMenu(e),this._onDidContextMenu.fire()}};Xr=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}([Jr(0,Zr.a),Jr(1,Sn.a),Jr(2,Qn.b),Jr(3,ti.a),Jr(4,ni.c)],Xr);const Qr=Object(ei.c)("layoutService");let eo=class extends _e.a{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=_e.a.None,this.container=e.container,this.contextView=this._register(new Or(this.container,1)),this.layout(),this._register(e.onLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,n){t?t!==this.container&&(this.container=t,this.setContainer(t,n?3:2)):this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.contextView.show(e);const i=Object(_e.h)(()=>{this.currentViewDisposable===i&&this.hideContextView()});return this.currentViewDisposable=i,i}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};eo=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}([function(e,t){return function(n,i){t(n,i,e)}}(0,Qr)],eo);var to=n(204);class no{constructor(e){this.incoming=new Map,this.outgoing=new Map,this.data=e}}class io{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(let t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){const n=this.lookupOrInsertNode(e),i=this.lookupOrInsertNode(t);n.outgoing.set(this._hashFn(t),i),i.incoming.set(this._hashFn(e),n)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(let e of this._nodes.values())e.outgoing.delete(t),e.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let n=this._nodes.get(t);return n||(n=new no(e),this._nodes.set(t,n)),n}isEmpty(){return 0===this._nodes.size}toString(){let e=[];for(let[t,n]of this._nodes)e.push(`${t}, (incoming)[${[...n.incoming.keys()].join(", ")}], (outgoing)[${[...n.outgoing.keys()].join(",")}]`);return e.join("\n")}}var ro=n(176),oo=n(153);const so=!1;class ao extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.toString()}}class lo{constructor(e=new oo.a,t=!1,n){this._services=e,this._strict=t,this._parent=n,this._services.set(ei.a,this)}createChild(e){return new lo(e,this._strict,this)}invokeFunction(e,...t){let n=co.traceInvocation(e),i=!1;try{return e({get:(e,t)=>{if(i)throw Object(be.c)("service accessor is only valid during the invocation of its target method");const r=this._getOrCreateServiceInstance(e,n);if(!r&&t!==ei.d)throw new Error(`[invokeFunction] unknown service '${e}'`);return r}},...t)}finally{i=!0,n.stop()}}createInstance(e,...t){let n,i;return e instanceof ro.a?(n=co.traceCreation(e.ctor),i=this._createInstance(e.ctor,e.staticArguments.concat(t),n)):(n=co.traceCreation(e),i=this._createInstance(e,t,n)),n.stop(),i}_createInstance(e,t=[],n){let i=ei.b.getServiceDependencies(e).sort((e,t)=>e.index-t.index),r=[];for(const t of i){let i=this._getOrCreateServiceInstance(t.id,n);if(!i&&this._strict&&!t.optional)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);r.push(i)}let o=i.length>0?i[0].index:t.length;if(t.length!==o){console.warn(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);let n=o-t.length;t=n>0?t.concat(new Array(n)):t.slice(0,o)}return new e(...[...t,...r])}_setServiceInstance(e,t){if(this._services.get(e)instanceof ro.a)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){let n=this._getServiceInstanceOrDescriptor(e);return n instanceof ro.a?this._createAndCacheServiceInstance(e,n,t.branch(e,!0)):(t.branch(e,!1),n)}_createAndCacheServiceInstance(e,t,n){const i=new io(e=>e.id.toString());let r=0;const o=[{id:e,desc:t,_trace:n}];for(;o.length;){const t=o.pop();if(i.lookupOrInsertNode(t),r++>1e3)throw new ao(i);for(let n of ei.b.getServiceDependencies(t.desc.ctor)){let r=this._getServiceInstanceOrDescriptor(n.id);if(r||n.optional||console.warn(`[createInstance] ${e} depends on ${n.id} which is NOT registered.`),r instanceof ro.a){const e={id:n.id,desc:r,_trace:t._trace.branch(n.id,!0)};i.insertEdge(t,e),o.push(e)}}}for(;;){const e=i.roots();if(0===e.length){if(!i.isEmpty())throw new ao(i);break}for(const{data:t}of e){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e),i.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,n=[],i,r){if(this._services.get(e)instanceof ro.a)return this._createServiceInstance(t,n,i,r);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,n,i,r);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t=[],n,i){if(n){const n=new me.b(()=>this._createInstance(e,t,i));return new Proxy(Object.create(null),{get(e,t){if(t in e)return e[t];let i=n.value,r=i[t];return"function"!=typeof r?r:(r=r.bind(i),e[t]=r,r)},set:(e,t,i)=>(n.value[t]=i,!0)})}return this._createInstance(e,t,i)}}class co{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return so?new co(1,e.name||e.toString().substring(0,42).replace(/\n/g,"")):co._None}static traceCreation(e){return so?new co(0,e.name):co._None}branch(e,t){let n=new co(2,e.toString());return this._dep.push([e,t,n]),n}stop(){let e=Date.now()-this._start;co._totals+=e;let t=!1;let n=[`${0===this.type?"CREATE":"CALL"} ${this.name}`,`${function e(n,i){let r=[],o=new Array(n+1).join("\t");for(const[s,a,l]of i._dep)if(a&&l){t=!0,r.push(`${o}CREATES -> ${s}`);let i=e(n+1,l);i&&r.push(i)}else r.push(`${o}uses -> ${s}`);return r.join("\n")}(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${co._totals.toFixed(2)}ms)`];(e>2||t)&&console.log(n.join("\n"))}}co._None=new class extends co{constructor(){super(-1,null)}stop(){}branch(){return this}},co._totals=0;var uo=n(169),ho=n(129),fo=n(52),go=n(38);class po{constructor(){this._byResource=new nn.b,this._byOwner=new Map}set(e,t,n){let i=this._byResource.get(e);i||(i=new Map,this._byResource.set(e,i)),i.set(t,n);let r=this._byOwner.get(t);r||(r=new nn.b,this._byOwner.set(t,r)),r.set(e,n)}get(e,t){let n=this._byResource.get(e);return null==n?void 0:n.get(t)}delete(e,t){let n=!1,i=!1,r=this._byResource.get(e);r&&(n=r.delete(t));let o=this._byOwner.get(t);if(o&&(i=o.delete(e)),n!==i)throw new Error("illegal state");return n&&i}values(e){var t,n,i,r;return"string"==typeof e?null!==(n=null===(t=this._byOwner.get(e))||void 0===t?void 0:t.values())&&void 0!==n?n:go.a.empty():W.a.isUri(e)?null!==(r=null===(i=this._byResource.get(e))||void 0===i?void 0:i.values())&&void 0!==r?r:go.a.empty():go.a.map(go.a.concat(...this._byOwner.values()),e=>e[1])}}class mo{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new nn.b,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(e.scheme===X.b.inMemory||e.scheme===X.b.walkThrough||e.scheme===X.b.walkThroughSnippet)return t;for(const{severity:n}of this._service.read({resource:e}))n===fo.c.Error?t.errors+=1:n===fo.c.Warning?t.warnings+=1:n===fo.c.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class _o{constructor(){this._onMarkerChanged=new F.a,this.onMarkerChanged=F.b.debounce(this._onMarkerChanged.event,_o._debouncer,0),this._data=new po,this._stats=new mo(this)}dispose(){this._stats.dispose()}remove(e,t){for(const n of t||[])this.changeOne(e,n,[])}changeOne(e,t,n){if(Object(Ee.n)(n)){this._data.delete(t,e)&&this._onMarkerChanged.fire([t])}else{const i=[];for(const r of n){const n=_o._toMarker(e,t,r);n&&i.push(n)}this._data.set(t,e,i),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,n){let{code:i,severity:r,message:o,source:s,startLineNumber:a,startColumn:l,endLineNumber:c,endColumn:d,relatedInformation:u,tags:h}=n;if(o)return{resource:t,owner:e,code:i,severity:r,message:o,source:s,startLineNumber:a=a>0?a:1,startColumn:l=l>0?l:1,endLineNumber:c=c>=a?c:a,endColumn:d=d>0?d:l,relatedInformation:u,tags:h}}read(e=Object.create(null)){let{owner:t,resource:n,severities:i,take:r}=e;if((!r||r<0)&&(r=-1),t&&n){const e=this._data.get(n,t);if(e){const t=[];for(const n of e)if(_o._accept(n,i)){const e=t.push(n);if(r>0&&e===r)break}return t}return[]}if(t||n){const e=this._data.values(null!=n?n:t),o=[];for(const t of e)for(const e of t)if(_o._accept(e,i)){const t=o.push(e);if(r>0&&t===r)return o}return o}{const e=[];for(let t of this._data.values())for(let n of t)if(_o._accept(n,i)){const t=e.push(n);if(r>0&&t===r)return e}return e}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _debouncer(e,t){e||(_o._dedupeMap=new nn.b,e=[]);for(const n of t)_o._dedupeMap.has(n)||(_o._dedupeMap.set(n,!0),e.push(n));return e}}var bo=n(87),vo=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},yo=function(e,t){return function(n,i){t(n,i,e)}};let wo=class{constructor(e){this._commandService=e}createMenu(e,t){return new Co(e,this._commandService,t,this)}};wo=vo([yo(0,ee.b)],wo);let Co=class e{constructor(e,t,n,i){this._id=e,this._commandService=t,this._contextKeyService=n,this._menuService=i,this._onDidChange=new F.a,this._dispoables=new _e.b,this._menuGroups=[],this._contextKeys=new Set,this._build(),this._dispoables.add(F.b.debounce(F.b.filter(Jn.d.onDidChangeMenu,e=>e.has(this._id)),()=>{},50)(this._build,this)),this._dispoables.add(F.b.debounce(this._contextKeyService.onDidChangeContext,(e,t)=>e||t.affectsSome(this._contextKeys),50)(e=>e&&this._onDidChange.fire(void 0),this))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}_build(){this._menuGroups.length=0,this._contextKeys.clear();const t=Jn.d.getMenuItems(this._id);let n;t.sort(e._compareMenuItems);for(let i of t){const t=i.group||"";if(n&&n[0]===t||(n=[t,[]],this._menuGroups.push(n)),n[1].push(i),e._fillInKbExprKeys(i.when,this._contextKeys),Object(Jn.f)(i)&&i.command.precondition&&e._fillInKbExprKeys(i.command.precondition,this._contextKeys),Object(Jn.f)(i)&&i.command.toggled){const t=i.command.toggled.condition||i.command.toggled;e._fillInKbExprKeys(t,this._contextKeys)}}this._onDidChange.fire(this)}get onDidChange(){return this._onDidChange.event}getActions(e){const t=[];for(let n of this._menuGroups){const[i,r]=n,o=[];for(const t of r)if(this._contextKeyService.contextMatchesRules(t.when)){const n=Object(Jn.f)(t)?new Jn.c(t.command,t.alt,e,this._contextKeyService,this._commandService):new Jn.e(t,this._menuService,this._contextKeyService,e);o.push(n)}o.length>0&&t.push([i,o])}return t}static _fillInKbExprKeys(e,t){if(e)for(let n of e.keys())t.add(n)}static _compareMenuItems(t,n){let i=t.group,r=n.group;if(i!==r){if(!i)return 1;if(!r)return-1;if("navigation"===i)return-1;if("navigation"===r)return 1;let e=i.localeCompare(r);if(0!==e)return e}let o=t.order||0,s=n.order||0;return os?1:e._compareTitles(Object(Jn.f)(t)?t.command.title:t.title,Object(Jn.f)(n)?n.command.title:n.title)}static _compareTitles(e,t){const n="string"==typeof e?e:e.value,i="string"==typeof t?t:t.value;return n.localeCompare(i)}};Co=vo([yo(1,ee.b),yo(2,Xn.b),yo(3,Jn.a)],Co);var So=n(273),ko=function(e,t){return function(n,i){t(n,i,e)}};function xo(e){return e.toString()}class Lo extends _e.a{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(Object(_e.h)(()=>{this.model.deltaDecorations([...this._markersData.keys()],[]),this._markersData.clear()}))}update(e,t){const n=[...this._markersData.keys()];this._markersData.clear();const i=this.model.deltaDecorations(n,t);for(let t=0;tthis._onModelAdded(e)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const n=this._markerDecorations.get(xo(e.uri));return n&&n.getMarker(t)||null}_handleMarkerChange(e){e.forEach(e=>{const t=this._markerDecorations.get(xo(e));t&&this._updateDecorations(t)})}_onModelAdded(e){const t=new Lo(e);this._markerDecorations.set(xo(e.uri),t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(xo(e.uri));t&&(t.dispose(),this._markerDecorations.delete(xo(e.uri))),e.uri.scheme!==X.b.inMemory&&e.uri.scheme!==X.b.internal&&e.uri.scheme!==X.b.vscode||this._markerService&&this._markerService.read({resource:e.uri}).map(e=>e.owner).forEach(t=>this._markerService.remove(t,[e.uri]))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});let n=t.map(t=>({range:this._createDecorationRange(e.model,t),options:this._createDecorationOption(t)}));e.update(t,n)&&this._onDidChangeMarker.fire(e.model)}_createDecorationRange(e,t){let n=Y.a.lift(t);if(t.severity!==fo.c.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(n=n.setEndPosition(n.startLineNumber,n.startColumn+2)),(n=e.validateRange(n)).isEmpty()){let t=e.getWordAtPosition(n.getStartPosition());if(t)n=new Y.a(n.startLineNumber,t.startColumn,n.endLineNumber,t.endColumn);else{let t=e.getLineLastNonWhitespaceColumn(n.startLineNumber)||e.getLineMaxColumn(n.startLineNumber);1===t||(n=n.endColumn>=t?new Y.a(n.startLineNumber,t-1,n.endLineNumber,t):new Y.a(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn+1))}}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&n.startLineNumber===n.endLineNumber){let i=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);i=0}};Mo=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}([ko(0,lt.a),ko(1,fo.b)],Mo);var Do=n(103),Eo=function(e,t){return function(n,i){t(n,i,e)}};let To=class extends _e.a{constructor(e,t){super(),this._contextKeyService=e,this._configurationService=t,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new F.a,this._accessibilityModeEnabledContext=ii.a.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire())})),n(),this.onDidChangeScreenReaderOptimized(()=>n())}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}getAccessibilitySupport(){return this._accessibilitySupport}};To=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}([Eo(0,Xn.b),Eo(1,tn.a)],To);var Oo=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};class No{constructor(){this.mapTextToType=new Map,this.findText=""}writeText(e,t){return Oo(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);try{return yield navigator.clipboard.writeText(e)}catch(e){console.error(e)}const n=document.activeElement,i=document.body.appendChild(Object(G.a)("textarea",{"aria-hidden":!0}));i.style.height="1px",i.style.width="1px",i.style.position="absolute",i.value=e,i.focus(),i.select(),document.execCommand("copy"),n instanceof HTMLElement&&n.focus(),document.body.removeChild(i)}))}readText(e){return Oo(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(e){return console.error(e),""}}))}readFindText(){return Oo(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return Oo(this,void 0,void 0,(function*(){this.findText=e}))}}var Io=n(154),Ao=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Ro=function(e,t){return function(n,i){t(n,i,e)}},Po=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function jo(e){return e.scheme===X.b.file?e.fsPath:e.path}let Fo=0;class Bo{constructor(e,t,n){this.id=++Fo,this.type=0,this.actual=e,this.label=e.label,this.resourceLabel=t,this.strResource=n,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[${this.id}] [${this.isValid?"VALID":"INVALID"}] ${this.actual}`}}class Wo{constructor(e,t){this.resourceLabel=e,this.reason=t}}class Ho{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements){(0===n.reason?e:t).push(n.resourceLabel)}let n=[];return e.length>0&&n.push(dn.a({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&n.push(dn.a({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),n.join("\n")}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class Yo{constructor(e,t,n){this.id=++Fo,this.type=1,this.actual=e,this.label=e.label,this.resourceLabels=t,this.strResources=n,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,n){this.removedResources||(this.removedResources=new Ho),this.removedResources.has(t)||this.removedResources.set(t,new Wo(e,n))}setValid(e,t,n){n?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new Ho),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new Wo(e,0)))}toString(){return`[${this.id}] [${this.invalidatedResources?"INVALID":"VALID"}] ${this.actual}`}}class Vo{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){let e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const n of this._past)t(n.actual)&&this._setElementValidFlag(n,e);for(const n of this._future)t(n.actual)&&this._setElementValidFlag(n,e)}pushElement(e){for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,1);if(this._future=[],this._past.length>0){const e=this._past[this._past.length-1];0!==e.type||e.isValid||(this._past=[])}this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let e=0,n=this._past.length;e=0;e--)t.push(this._future[e].id);return new Io.b(e,t)}restoreSnapshot(e){const t=e.elements.length;let n=!0,i=0,r=-1;for(let o=0,s=this._past.length;o=t||s.id!==e.elements[i])&&(n=!1,r=0),n||1!==s.type||s.removeResource(this.resourceLabel,this.strResource,0)}let o=-1;for(let r=this._future.length-1;r>=0;r--,i++){const s=this._future[r];n&&(i>=t||s.id!==e.elements[i])&&(n=!1,o=r),n||1!==s.type||s.removeResource(this.resourceLabel,this.strResource,0)}-1!==r&&(this._past=this._past.slice(0,r)),-1!==o&&(this._future=this._future.slice(o+1)),this.versionId++}getElements(){const e=[],t=[];for(const t of this._past)e.push(t.actual);for(const e of this._future)t.push(e.actual);return{past:e,future:t}}getClosestPastElement(){return 0===this._past.length?null:this._past[this._past.length-1]}getClosestFutureElement(){return 0===this._future.length?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let n=this._past.length-1;n>=0;n--)if(this._past[n]===e){t.has(this.strResource)?this._past[n]=t.get(this.strResource):this._past.splice(n,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let n=this._future.length-1;n>=0;n--)if(this._future[n]===e){t.has(this.strResource)?this._future[n]=t.get(this.strResource):this._future.splice(n,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class zo{constructor(e){this.editStacks=e,this._versionIds=[];for(let e=0,t=this.editStacks.length;e{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,n,i=_e.a.None){const r=this._acquireLocks(n);let o;try{o=t()}catch(t){return r(),i.dispose(),this._onError(t,e)}if(o)return o.then(()=>{r(),i.dispose()},t=>(r(),i.dispose(),this._onError(t,e)));r(),i.dispose()}_invokeWorkspacePrepare(e){return Po(this,void 0,void 0,(function*(){if(void 0===e.actual.prepareUndoRedo)return _e.a.None;const t=e.actual.prepareUndoRedo();return void 0===t?_e.a.None:t}))}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return void t(_e.a.None);const n=e.actual.prepareUndoRedo();if(n){if(!Object(_e.g)(n))return n.then(e=>{t(e)});t(n)}else t(_e.a.None)}_getAffectedEditStacks(e){const t=[];for(const n of e.strResources)t.push(this._editStacks.get(n)||Uo);return new zo(t)}_tryToSplitAndUndo(e,t,n,i){if(t.canSplit())return this._splitPastWorkspaceElement(t,n),this._notificationService.info(i),new Ko(this.undo(e));for(const e of t.strResources)this.removeElements(e);return this._notificationService.info(i),new Ko}_checkWorkspaceUndo(e,t,n,i){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,dn.a({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(i&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,dn.a({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const r=[];for(const e of n.editStacks)e.getClosestPastElement()!==t&&r.push(e.resourceLabel);if(r.length>0)return this._tryToSplitAndUndo(e,t,null,dn.a({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,r.join(", ")));const o=[];for(const e of n.editStacks)e.locked&&o.push(e.resourceLabel);return o.length>0?this._tryToSplitAndUndo(e,t,null,dn.a({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,o.join(", "))):n.isValid()?null:this._tryToSplitAndUndo(e,t,null,dn.a({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t){const n=this._getAffectedEditStacks(t),i=this._checkWorkspaceUndo(e,t,n,!1);return i?i.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n)}_confirmAndExecuteWorkspaceUndo(e,t,n){return Po(this,void 0,void 0,(function*(){if(t.canSplit()){const i=yield this._dialogService.show(Zt.a.Info,dn.a("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),[dn.a({key:"ok",comment:["{0} denotes a number that is > 1"]},"Undo in {0} Files",n.editStacks.length),dn.a("nok","Undo this File"),dn.a("cancel","Cancel")],{cancelId:2});if(2===i.choice)return;if(1===i.choice)return this._splitPastWorkspaceElement(t,null),this.undo(e);const r=this._checkWorkspaceUndo(e,t,n,!1);if(r)return r.returnValue}let i;try{i=yield this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const r=this._checkWorkspaceUndo(e,t,n,!0);if(r)return i.dispose(),r.returnValue;for(const e of n.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),n,i)}))}_resourceUndo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new zo([e]),n)));{const e=dn.a({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.info(e)}}else e.flushAllElements()}undo(e){const t="string"==typeof e?e:this.getUriComparisonKey(e);if(!this._editStacks.has(t))return;const n=this._editStacks.get(t),i=n.getClosestPastElement();if(i)try{return 1===i.type?this._workspaceUndo(t,i):this._resourceUndo(n,i)}finally{0}}canRedo(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).hasFutureElements()}return!1}_tryToSplitAndRedo(e,t,n,i){if(t.canSplit())return this._splitFutureWorkspaceElement(t,n),this._notificationService.info(i),new Ko(this.redo(e));for(const e of t.strResources)this.removeElements(e);return this._notificationService.info(i),new Ko}_checkWorkspaceRedo(e,t,n,i){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,dn.a({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(i&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,dn.a({key:"cannotWorkspaceRedo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const r=[];for(const e of n.editStacks)e.getClosestFutureElement()!==t&&r.push(e.resourceLabel);if(r.length>0)return this._tryToSplitAndRedo(e,t,null,dn.a({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,r.join(", ")));const o=[];for(const e of n.editStacks)e.locked&&o.push(e.resourceLabel);return o.length>0?this._tryToSplitAndRedo(e,t,null,dn.a({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,o.join(", "))):n.isValid()?null:this._tryToSplitAndRedo(e,t,null,dn.a({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const n=this._getAffectedEditStacks(t),i=this._checkWorkspaceRedo(e,t,n,!1);return i?i.returnValue:this._executeWorkspaceRedo(e,t,n)}_executeWorkspaceRedo(e,t,n){return Po(this,void 0,void 0,(function*(){let i;try{i=yield this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const r=this._checkWorkspaceRedo(e,t,n,!0);if(r)return i.dispose(),r.returnValue;for(const e of n.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),n,i)}))}_resourceRedo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,n=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new zo([e]),n)));{const e=dn.a({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.info(e)}}else e.flushAllElements()}redo(e){const t="string"==typeof e?e:this.getUriComparisonKey(e);if(!this._editStacks.has(t))return;const n=this._editStacks.get(t),i=n.getClosestFutureElement();if(i)try{return 1===i.type?this._workspaceRedo(t,i):this._resourceRedo(n,i)}finally{0}}};$o=Ao([Ro(0,to.a),Ro(1,Sn.a)],$o);class Ko{constructor(e){this.returnValue=e}}Object(Do.b)(Io.a,$o);n(635);var qo=n(4),Go=(n(239),n(139)),Zo=n(155);const Jo=new me.b(()=>{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}});function Xo(e,t,n){const i=e.toLowerCase(),r=t.toLowerCase(),o=function(e,t,n){const i=e.toLowerCase(),r=t.toLowerCase(),o=i.startsWith(n),s=r.startsWith(n);if(o!==s)return o?-1:1;if(o&&s){if(i.lengthr.length)return 1}return 0}(e,t,n);if(o)return o;const s=i.endsWith(n);if(s!==r.endsWith(n))return s?-1:1;const a=function(e,t,n=!1){const i=e||"",r=t||"",o=Jo.value.collator.compare(i,r);return Jo.value.collatorIsNumeric&&0===o&&i!==r?i=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};const cs=G.a;class ds{constructor(e){this.hidden=!1,this._onChecked=new F.a,this.onChecked=this._onChecked.event,Object(rn.a)(this,e)}get checked(){return!!this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire(e))}dispose(){this._onChecked.dispose()}}class us{get templateId(){return us.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=G.p(e,cs(".quick-input-list-entry"));const n=G.p(t.entry,cs("label.quick-input-list-label"));t.toDisposeTemplate.push(G.n(n,G.c.CLICK,e=>{t.checkbox.offsetParent||e.preventDefault()})),t.checkbox=G.p(n,cs("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(G.n(t.checkbox,G.c.CHANGE,e=>{t.element.checked=t.checkbox.checked}));const i=G.p(n,cs(".quick-input-list-rows")),r=G.p(i,cs(".quick-input-list-row")),o=G.p(i,cs(".quick-input-list-row"));t.label=new Qo.a(r,{supportHighlights:!0,supportDescriptionHighlights:!0,supportCodicons:!0});const s=G.p(r,cs(".quick-input-list-entry-keybinding"));t.keybinding=new as(s,ve.a);const a=G.p(o,cs(".quick-input-list-label-meta"));return t.detail=new es.a(a,!0),t.separator=G.p(t.entry,cs(".quick-input-list-separator")),t.actionBar=new Lr.a(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,n){n.toDisposeElement=Object(_e.f)(n.toDisposeElement),n.element=e,n.checkbox.checked=e.checked,n.toDisposeElement.push(e.onChecked(e=>n.checkbox.checked=e));const{labelHighlights:i,descriptionHighlights:r,detailHighlights:o}=e,s=Object.create(null);s.matches=i||[],s.descriptionTitle=e.saneDescription,s.descriptionMatches=r||[],s.extraClasses=e.item.iconClasses,s.italic=e.item.italic,s.strikethrough=e.item.strikethrough,n.label.setLabel(e.saneLabel,e.saneDescription,s),n.keybinding.set(e.item.keybinding),n.detail.set(e.saneDetail,o),e.separator&&e.separator.label?(n.separator.textContent=e.separator.label,n.separator.style.display=""):n.separator.style.display="none",e.separator?G.e(n.entry,"quick-input-list-separator-border"):G.Q(n.entry,"quick-input-list-separator-border"),n.actionBar.clear();const a=e.item.buttons;a&&a.length?(n.actionBar.push(a.map((t,n)=>{let i=t.iconClass||(t.iconPath?os(t.iconPath):void 0);t.alwaysVisible&&(i=i?`${i} always-visible`:"always-visible");const r=new xr.a(`id-${n}`,"",i,!0,()=>(e.fireButtonTriggered({button:t,item:e.item}),Promise.resolve()));return r.tooltip=t.tooltip||"",r}),{icon:!0,label:!1}),G.e(n.entry,"has-actions")):G.Q(n.entry,"has-actions")}disposeElement(e,t,n){n.toDisposeElement=Object(_e.f)(n.toDisposeElement)}disposeTemplate(e){e.toDisposeElement=Object(_e.f)(e.toDisposeElement),e.toDisposeTemplate=Object(_e.f)(e.toDisposeTemplate)}}us.ID="listelement";class hs{getHeight(e){return e.saneDetail?44:22}getTemplateId(e){return us.ID}}var fs;!function(e){e[e.First=1]="First",e[e.Second=2]="Second",e[e.Last=3]="Last",e[e.Next=4]="Next",e[e.Previous=5]="Previous",e[e.NextPage=6]="NextPage",e[e.PreviousPage=7]="PreviousPage"}(fs||(fs={}));class gs{constructor(e,t,n){this.parent=e,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.sortByLabel=!0,this._onChangedAllVisibleChecked=new F.a,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new F.a,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new F.a,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new F.a,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new F.a,this.onButtonTriggered=this._onButtonTriggered.event,this._onKeyDown=new F.a,this.onKeyDown=this._onKeyDown.event,this._onLeave=new F.a,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=G.p(this.parent,cs(".quick-input-list"));const i=new hs,r=new ps;this.list=n.createList("QuickInput",this.container,i,[new us],{identityProvider:{getId:e=>e.saneLabel},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:r}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(e=>{const t=new Gt.a(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(ve.f?e.metaKey:e.ctrlKey)&&this.list.setFocus(Object(Ee.s)(this.list.length));break;case 16:const t=this.list.getFocus();1===t.length&&0===t[0]&&this._onLeave.fire();break;case 18:const n=this.list.getFocus();1===n.length&&n[0]===this.list.length-1&&this._onLeave.fire()}this._onKeyDown.fire(t)})),this.disposables.push(this.list.onMouseDown(e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()})),this.disposables.push(G.i(this.container,G.c.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(e=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(e=>{"number"==typeof e.index&&(e.browserEvent.preventDefault(),this.list.setSelection([e.index]))})),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return F.b.map(this.list.onDidChangeFocus,e=>e.elements.map(e=>e.item))}get onDidChangeSelection(){return F.b.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(e=>e.item),event:e.browserEvent}))}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let n=0,i=e.length;n{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=Object(_e.f)(this.elementDisposables);const t=e=>this.fireButtonTriggered(e);this.inputElements=e,this.elements=e.reduce((n,i,r)=>{var o,s,a;if("separator"!==i.type){const l=r&&e[r-1],c=i.label&&i.label.replace(/\r?\n/g," "),d=i.description&&i.description.replace(/\r?\n/g," "),u=i.detail&&i.detail.replace(/\r?\n/g," "),h=i.ariaLabel||[c,d,u].map(e=>e&&Object(Zo.c)(e).text).filter(e=>!!e).join(", ");n.push(new ds({index:r,item:i,saneLabel:c,saneAriaLabel:h,saneDescription:d,saneDetail:u,labelHighlights:null===(o=i.highlights)||void 0===o?void 0:o.label,descriptionHighlights:null===(s=i.highlights)||void 0===s?void 0:s.description,detailHighlights:null===(a=i.highlights)||void 0===a?void 0:a.detail,checked:!1,separator:l&&"separator"===l.type?l:void 0,fireButtonTriggered:t}))}return n},[]),this.elementDisposables.push(...this.elements),this.elementDisposables.push(...this.elements.map(e=>e.onChecked(()=>this.fireCheckedEvents()))),this.elementsToIndexes=this.elements.reduce((e,t,n)=>(e.set(t.item,n),e),new Map),this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(e=>this.elementsToIndexes.has(e)).map(e=>this.elementsToIndexes.get(e))),e.length>0){const e=this.list.getFocus()[0];"number"==typeof e&&this.list.reveal(e)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(e=>this.elementsToIndexes.has(e)).map(e=>this.elementsToIndexes.get(e)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const n of e)t.add(n);for(const e of this.elements)e.checked=t.has(e.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===fs.Next&&this.list.getFocus()[0]===this.list.length-1&&(e=fs.First),e===fs.Previous&&0===this.list.getFocus()[0]&&(e=fs.Last),e===fs.Second&&this.list.length<2&&(e=fs.First),e){case fs.First:this.list.focusFirst();break;case fs.Second:this.list.focusNth(1);break;case fs.Last:this.list.focusLast();break;case fs.Next:this.list.focusNext();break;case fs.Previous:this.list.focusPrevious();break;case fs.NextPage:this.list.focusNextPage();break;case fs.PreviousPage:this.list.focusPreviousPage()}const t=this.list.getFocus()[0];"number"==typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}layout(e){this.list.getHTMLElement().style.maxHeight=e?`calc(${44*Math.floor(e/44)}px)`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;(e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)?this.elements.forEach(t=>{const n=this.matchOnLabel?Object(ye.n)(Object(Zo.b)(e,Object(Zo.c)(t.saneLabel))):void 0,i=this.matchOnDescription?Object(ye.n)(Object(Zo.b)(e,Object(Zo.c)(t.saneDescription||""))):void 0,r=this.matchOnDetail?Object(ye.n)(Object(Zo.b)(e,Object(Zo.c)(t.saneDetail||""))):void 0;n||i||r?(t.labelHighlights=n,t.descriptionHighlights=i,t.detailHighlights=r,t.hidden=!1):(t.labelHighlights=void 0,t.descriptionHighlights=void 0,t.detailHighlights=void 0,t.hidden=!t.item.alwaysShow),t.separator=void 0}):this.elements.forEach(e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this.inputElements[e.index-1];e.separator=t&&"separator"===t.type?t:void 0});const t=this.elements.filter(e=>!e.hidden);if(this.sortByLabel&&e){const n=e.toLowerCase();t.sort((e,t)=>(function(e,t,n){const i=e.labelHighlights||[],r=t.labelHighlights||[];if(i.length&&!r.length)return-1;if(!i.length&&r.length)return 1;if(0===i.length&&0===r.length)return 0;return Xo(e.saneLabel,t.saneLabel,n)})(e,t,n))}return this.elementsToIndexes=t.reduce((e,t,n)=>(e.set(t.item,n),e),new Map),this.list.splice(0,this.list.length,t),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(t.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const n of e)n.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return"none"!==this.container.style.display}dispose(){this.elementDisposables=Object(_e.f)(this.elementDisposables),this.disposables=Object(_e.f)(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}style(e){this.list.style(e)}}ls([ts.a],gs.prototype,"onDidChangeFocus",null),ls([ts.a],gs.prototype,"onDidChangeSelection",null);class ps{getWidgetAriaLabel(){return Object(dn.a)("quickInput","Quick Input")}getAriaLabel(e){return e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(){return"option"}}var ms=n(205);const _s=G.a;class bs extends _e.a{constructor(e){super(),this.parent=e,this.onKeyDown=e=>G.i(this.inputBox.inputElement,G.c.KEY_DOWN,t=>{e(new Gt.a(t))}),this.onMouseDown=e=>G.i(this.inputBox.inputElement,G.c.MOUSE_DOWN,t=>{e(new Pr.a(t))}),this.onDidChange=e=>this.inputBox.onDidChange(e),this.container=G.p(this.parent,_s(".quick-input-box")),this.inputBox=this._register(new ms.b(this.container,void 0))}get value(){return this.inputBox.value}set value(e){this.inputBox.value=e}select(e=null){this.inputBox.select(e)}isSelectionAtEnd(){return this.inputBox.isSelectionAtEnd()}get placeholder(){return this.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.inputBox.setPlaceHolder(e)}get ariaLabel(){return this.inputBox.getAriaLabel()}set ariaLabel(e){this.inputBox.setAriaLabel(e)}get password(){return"password"===this.inputBox.inputElement.type}set password(e){this.inputBox.inputElement.type=e?"password":"text"}setAttribute(e,t){this.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===Zt.a.Ignore?this.inputBox.hideMessage():this.inputBox.showMessage({type:e===Zt.a.Info?1:e===Zt.a.Warning?2:3,content:""})}stylesForType(e){return this.inputBox.stylesForType(e===Zt.a.Info?1:e===Zt.a.Warning?2:3)}setFocus(){this.inputBox.focus()}layout(){this.inputBox.layout()}style(e){this.inputBox.style(e)}}var vs=n(232);n(637);const ys="done",ws="active",Cs="infinite",Ss="discrete",ks="monaco-progress-container",xs="progress-bit",Ls={progressBarBackground:Yi.a.fromHex("#0E70C0")};class Ms extends _e.a{constructor(e,t){super(),this.options=t||Object.create(null),Object(rn.g)(this.options,Ls,!1),this.workedVal=0,this.progressBarBackground=this.options.progressBarBackground,this._register(this.showDelayedScheduler=new me.d(()=>Object(G.Z)(this.element),0)),this.create(e)}create(e){this.element=document.createElement("div"),Object(G.e)(this.element,ks),e.appendChild(this.element),this.bit=document.createElement("div"),Object(G.e)(this.bit,xs),this.element.appendChild(this.bit),this.applyStyles()}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",Object(G.R)(this.element,ws,Cs,Ss),this.workedVal=0,this.totalWork=void 0}stop(){return this.doDone(!1)}doDone(e){return Object(G.e)(this.element,ys),Object(G.I)(this.element,Cs)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",Object(G.R)(this.element,Ss,ys),Object(G.f)(this.element,ws,Cs),this}getContainer(){return this.element}style(e){this.progressBarBackground=e.progressBarBackground,this.applyStyles()}applyStyles(){if(this.bit){const e=this.progressBarBackground?this.progressBarBackground.toString():"";this.bit.style.backgroundColor=e}}}n(638);var Ds=n(50);const Es={buttonBackground:Yi.a.fromHex("#0E639C"),buttonHoverBackground:Yi.a.fromHex("#006BB3"),buttonForeground:Yi.a.white};class Ts extends _e.a{constructor(e,t){super(),this._onDidClick=this._register(new F.a),this.options=t||Object.create(null),Object(rn.g)(this.options,Es,!1),this.buttonForeground=this.options.buttonForeground,this.buttonBackground=this.options.buttonBackground,this.buttonHoverBackground=this.options.buttonHoverBackground,this.buttonSecondaryForeground=this.options.buttonSecondaryForeground,this.buttonSecondaryBackground=this.options.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=this.options.buttonSecondaryHoverBackground,this.buttonBorder=this.options.buttonBorder,this._element=document.createElement("a"),G.e(this._element,"monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),e.appendChild(this._element),this._register(Ds.b.addTarget(this._element)),[G.c.CLICK,Ds.a.Tap].forEach(e=>{this._register(G.i(this._element,e,e=>{this.enabled?this._onDidClick.fire(e):G.b.stop(e)}))}),this._register(G.i(this._element,G.c.KEY_DOWN,e=>{const t=new Gt.a(e);let n=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),n=!0):t.equals(9)&&(this._element.blur(),n=!0),n&&G.b.stop(t,!0)})),this._register(G.i(this._element,G.c.MOUSE_OVER,e=>{G.I(this._element,"disabled")||this.setHoverBackground()})),this._register(G.i(this._element,G.c.MOUSE_OUT,e=>{this.applyStyles()})),this.focusTracker=this._register(G.bb(this._element)),this._register(this.focusTracker.onDidFocus(()=>this.setHoverBackground())),this._register(this.focusTracker.onDidBlur(()=>this.applyStyles())),this.applyStyles()}get onDidClick(){return this._onDidClick.event}setHoverBackground(){let e;(e=this.options.secondary?this.buttonSecondaryHoverBackground?this.buttonSecondaryHoverBackground.toString():null:this.buttonHoverBackground?this.buttonHoverBackground.toString():null)&&(this._element.style.backgroundColor=e)}style(e){this.buttonForeground=e.buttonForeground,this.buttonBackground=e.buttonBackground,this.buttonHoverBackground=e.buttonHoverBackground,this.buttonSecondaryForeground=e.buttonSecondaryForeground,this.buttonSecondaryBackground=e.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=e.buttonSecondaryHoverBackground,this.buttonBorder=e.buttonBorder,this.applyStyles()}applyStyles(){if(this._element){let e,t;this.options.secondary?(t=this.buttonSecondaryForeground?this.buttonSecondaryForeground.toString():"",e=this.buttonSecondaryBackground?this.buttonSecondaryBackground.toString():""):(t=this.buttonForeground?this.buttonForeground.toString():"",e=this.buttonBackground?this.buttonBackground.toString():"");const n=this.buttonBorder?this.buttonBorder.toString():"";this._element.style.color=t,this._element.style.backgroundColor=e,this._element.style.borderWidth=n?"1px":"",this._element.style.borderStyle=n?"solid":"",this._element.style.borderColor=n}}get element(){return this._element}set label(e){G.I(this._element,"monaco-text-button")||G.e(this._element,"monaco-text-button"),this.options.supportCodicons?G.U(this._element,...function(e){const t=new Array;let n,i=0,r=0;for(;null!==(n=Ir.g.exec(e));){r=n.index||0,t.push(e.substring(i,r)),i=(n.index||0)+n[0].length;const[,o,s,a,l]=n;t.push(o?`$(${s})`:G.a(`span.codicon.codicon-${a}${l?`.codicon-animation-${l}`:""}`))}return i{-1!==this.buttons.indexOf(e)&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this.update())}hide(){this.visible&&this.ui.hide()}didHide(){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire()}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:e||" "===this.ui.title.innerHTML||(this.ui.title.innerText=" ;");const t=this.getDescription();if(this.ui.description.textContent!==t&&(this.ui.description.textContent=t),this.busy&&!this.busyDelay&&(this.busyDelay=new me.e,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const e=this.buttons.filter(e=>e===Is);this.ui.leftActionBar.push(e.map((e,t)=>{const n=new xr.a(`id-${t}`,"",e.iconClass||os(e.iconPath),!0,()=>Os(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)})));return n.tooltip=e.tooltip||"",n}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter(e=>e!==Is);this.ui.rightActionBar.push(t.map((e,t)=>{const n=new xr.a(`id-${t}`,"",e.iconClass||os(e.iconPath),!0,()=>Os(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)})));return n.tooltip=e.tooltip||"",n}),{icon:!0,label:!1})}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey)}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?Object(dn.a)("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e===Zt.a.Error){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.paddingBottom="4px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.paddingBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}class Rs extends As{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new F.a),this.onDidAcceptEmitter=this._register(new F.a),this.onDidCustomEmitter=this._register(new F.a),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._sortByLabel=!0,this._autoFocusOnList=!0,this._itemActivation=this.ui.isScreenReaderOptimized()?Go.a.NONE:Go.a.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new F.a),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new F.a),this.onDidTriggerItemButtonEmitter=this._register(new F.a),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this._value=e||"",this.update()}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?Go.b:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(fs.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{if(e===this.value)return;this._value=e,this.ui.list.filter(this.filterValue(this.ui.inputBox.value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(e)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(fs.Next),this.canSelectMany&&this.ui.list.domFocus(),G.b.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(fs.Previous):this.ui.list.focus(fs.Last),this.canSelectMany&&this.ui.list.domFocus(),G.b.stop(e,!0);break;case 12:this.ui.list.focus(fs.NextPage),this.canSelectMany&&this.ui.list.domFocus(),G.b.stop(e,!0);break;case 11:this.ui.list.focus(fs.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),G.b.stop(e,!0);break;case 17:if(!this._canAcceptInBackground)return;if(!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.onDidAcceptEmitter.fire({inBackground:!0}));break;case 14:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(fs.First),G.b.stop(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(fs.Last),G.b.stop(e,!0))}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{!this.canSelectMany&&this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.onDidAcceptEmitter.fire({inBackground:!1})})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Object(Ee.g)(e,this._activeItems,(e,t)=>e===t)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{this.canSelectMany?e.length&&this.ui.list.setSelectedElements([]):this.selectedItemsToConfirm!==this._selectedItems&&Object(Ee.g)(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.onDidAcceptEmitter.fire({inBackground:t instanceof MouseEvent&&1===t.button}))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Object(Ee.g)(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}registerQuickNavigation(){return G.i(this.ui.container,G.c.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Gt.a(e),n=t.keyCode;this._quickNavigate.keybindings.some(e=>{const[i,r]=e.getParts();return!r&&(i.shiftKey&&4===n?!(t.ctrlKey||t.altKey||t.metaKey):!(!i.altKey||6!==n)||(!(!i.ctrlKey||5!==n)||!(!i.metaKey||57!==n)))})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.onDidAcceptEmitter.fire({inBackground:!1})),this._quickNavigate=void 0)})}update(){if(!this.visible)return;let e=!1,t=!1;this._hideInput&&this._items.length>0&&(this.ui.isScreenReaderOptimized()?t=!0:e=!0),G.ab(this.ui.container,"hidden-input",e);const n={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description,checkAll:this.canSelectMany,inputBox:!e,progressBar:!e,visibleCount:!0,count:this.canSelectMany,ok:"default"===this.ok?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};if(this.ui.setVisibilities(n),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),t)this.ui.inputBox.ariaLabel="";else{const e=this.ariaLabel||this.placeholder||Rs.DEFAULT_ARIA_LABEL;this.ui.inputBox.ariaLabel!==e&&(this.ui.inputBox.ariaLabel=e)}if(this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case Go.a.NONE:this._itemActivation=Go.a.FIRST;break;case Go.a.SECOND:this.ui.list.focus(fs.Second),this._itemActivation=Go.a.FIRST;break;case Go.a.LAST:this.ui.list.focus(fs.Last),this._itemActivation=Go.a.FIRST;break;default:this.trySelectFirst()}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.validationMessage?(this.ui.message.textContent=this.validationMessage,this.showMessageDecoration(Zt.a.Error)):(this.ui.message.textContent=null,this.showMessageDecoration(Zt.a.Ignore)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",this.ui.setComboboxAccessibility(!0),n.inputBox||this.ui.list.domFocus()}}Rs.DEFAULT_ARIA_LABEL=Object(dn.a)("quickInputBox.ariaLabel","Type to narrow down results.");class Ps extends _e.a{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,this.enabled=!0,this.onDidAcceptEmitter=this._register(new F.a),this.onDidCustomEmitter=this._register(new F.a),this.onDidTriggerButtonEmitter=this._register(new F.a),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new F.a),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new F.a),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};this._register(G.i(window,G.c.KEY_DOWN,e,!0)),this._register(G.i(window,G.c.KEY_UP,e,!0)),this._register(G.i(window,G.c.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=G.p(this.parentElement,Ns(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=G.v(e),n=G.p(e,Ns(".quick-input-titlebar")),i=this._register(new Lr.a(n));i.domNode.classList.add("quick-input-left-action-bar");const r=G.p(n,Ns(".quick-input-title")),o=this._register(new Lr.a(n));o.domNode.classList.add("quick-input-right-action-bar");const s=G.p(e,Ns(".quick-input-description")),a=G.p(e,Ns(".quick-input-header")),l=G.p(a,Ns("input.quick-input-check-all"));l.type="checkbox",this._register(G.n(l,G.c.CHANGE,e=>{const t=l.checked;C.setAllVisibleChecked(t)})),this._register(G.i(l,G.c.CLICK,e=>{(e.x||e.y)&&u.setFocus()}));const c=G.p(a,Ns(".quick-input-and-message")),d=G.p(c,Ns(".quick-input-filter")),u=this._register(new bs(d));u.setAttribute("aria-describedby",`${this.idPrefix}message`);const h=G.p(d,Ns(".quick-input-visible-count"));h.setAttribute("aria-live","polite"),h.setAttribute("aria-atomic","true");const f=new vs.a(h,{countFormat:Object(dn.a)({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")}),g=G.p(d,Ns(".quick-input-count"));g.setAttribute("aria-live","polite");const p=new vs.a(g,{countFormat:Object(dn.a)({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")}),m=G.p(a,Ns(".quick-input-action")),_=new Ts(m);_.label=Object(dn.a)("ok","OK"),this._register(_.onDidClick(e=>{this.onDidAcceptEmitter.fire()}));const b=G.p(a,Ns(".quick-input-action")),v=new Ts(b);v.label=Object(dn.a)("custom","Custom"),this._register(v.onDidClick(e=>{this.onDidCustomEmitter.fire()}));const y=G.p(c,Ns(`#${this.idPrefix}message.quick-input-message`)),w=new Ms(e);G.e(w.getContainer(),"quick-input-progress");const C=this._register(new gs(e,this.idPrefix+"list",this.options));this._register(C.onChangedAllVisibleChecked(e=>{l.checked=e})),this._register(C.onChangedVisibleCount(e=>{f.setCount(e)})),this._register(C.onChangedCheckedCount(e=>{p.setCount(e)})),this._register(C.onLeave(()=>{setTimeout(()=>{u.setFocus(),this.controller instanceof Rs&&this.controller.canSelectMany&&C.clearFocus()},0)})),this._register(C.onDidChangeFocus(()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")}));const S=G.bb(e);return this._register(S),this._register(G.i(e,G.c.FOCUS,e=>{this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0},!0)),this._register(S.onDidBlur(()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(),this.previousFocusElement=void 0})),this._register(G.i(e,G.c.FOCUS,e=>{u.setFocus()})),this._register(G.i(e,G.c.KEY_DOWN,t=>{const n=new Gt.a(t);switch(n.keyCode){case 3:G.b.stop(t,!0),this.onDidAcceptEmitter.fire();break;case 9:G.b.stop(t,!0),this.hide();break;case 2:if(!n.altKey&&!n.ctrlKey&&!n.metaKey){const i=[".action-label.codicon"];e.classList.contains("show-checkboxes")?i.push("input"):i.push("input[type=text]"),this.getUI().list.isDisplayed()&&i.push(".monaco-list");const r=e.querySelectorAll(i.join(", "));n.shiftKey&&n.target===r[0]?(G.b.stop(t,!0),r[r.length-1].focus()):n.shiftKey||n.target!==r[r.length-1]||(G.b.stop(t,!0),r[0].focus())}}})),this.ui={container:e,styleSheet:t,leftActionBar:i,titleBar:n,title:r,description:s,rightActionBar:o,checkAll:l,filterContainer:d,inputBox:u,visibleCountContainer:h,visibleCount:f,countContainer:g,count:p,okContainer:m,ok:_,message:y,customButtonContainer:b,customButton:v,progressBar:w,list:C,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,isScreenReaderOptimized:()=>this.options.isScreenReaderOptimized(),show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setComboboxAccessibility:e=>this.setComboboxAccessibility(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e)},this.updateStyles(),this.ui}pick(e,t={},n=j.a.None){return new Promise((i,r)=>{let o=e=>{o=i,t.onKeyMods&&t.onKeyMods(s.keyMods),i(e)};if(n.isCancellationRequested)return void o(void 0);const s=this.createQuickPick();let a;const l=[s,s.onDidAccept(()=>{if(s.canSelectMany)o(s.selectedItems.slice()),s.hide();else{const e=s.activeItems[0];e&&(o(e),s.hide())}}),s.onDidChangeActive(e=>{const n=e[0];n&&t.onDidFocus&&t.onDidFocus(n)}),s.onDidChangeSelection(e=>{if(!s.canSelectMany){const t=e[0];t&&(o(t),s.hide())}}),s.onDidTriggerItemButton(e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},e),{removeItem:()=>{const t=s.items.indexOf(e.item);if(-1!==t){const e=s.items.slice();e.splice(t,1),s.items=e}}}))),s.onDidChangeValue(e=>{!a||e||1===s.activeItems.length&&s.activeItems[0]===a||(s.activeItems=[a])}),n.onCancellationRequested(()=>{s.hide()}),s.onDidHide(()=>{Object(_e.f)(l),o(void 0)})];s.canSelectMany=!!t.canPickMany,s.placeholder=t.placeHolder,s.ignoreFocusOut=!!t.ignoreFocusLost,s.matchOnDescription=!!t.matchOnDescription,s.matchOnDetail=!!t.matchOnDetail,s.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,s.autoFocusOnList=void 0===t.autoFocusOnList||t.autoFocusOnList,s.quickNavigate=t.quickNavigate,s.contextKey=t.contextKey,s.busy=!0,Promise.all([e,t.activeItem]).then(([e,t])=>{a=t,s.busy=!1,s.items=e,s.canSelectMany&&(s.selectedItems=e.filter(e=>"separator"!==e.type&&e.picked)),a&&(s.activeItems=[a])}),s.show(),Promise.resolve(e).then(void 0,e=>{r(e),s.hide()})})}createQuickPick(){const e=this.getUI();return new Rs(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const n=this.controller;this.controller=e,n&&n.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description.textContent="",t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Zt.a.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),t.message.textContent="",t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,this.setComboboxAccessibility(!1),t.inputBox.ariaLabel="";const i=this.options.backKeybindingLabel();Is.tooltip=i?Object(dn.a)("quickInput.backWithKeybinding","Back ({0})",i):Object(dn.a)("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description.style.display=e.description?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList[e.checkAll?"add":"remove"]("show-checkboxes"),this.updateLayout()}setComboboxAccessibility(e){if(e!==this.comboboxAccessibility){const t=this.getUI();this.comboboxAccessibility=e,this.comboboxAccessibility?(t.inputBox.setAttribute("role","combobox"),t.inputBox.setAttribute("aria-haspopup","true"),t.inputBox.setAttribute("aria-autocomplete","list"),t.inputBox.setAttribute("aria-activedescendant",t.list.getActiveDescendant()||"")):(t.inputBox.removeAttribute("role"),t.inputBox.removeAttribute("aria-haspopup"),t.inputBox.removeAttribute("aria-autocomplete"),t.inputBox.removeAttribute("aria-activedescendant"))}}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.getAction().enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.getAction().enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(){var e;const t=this.controller;if(t){const n=!(null===(e=this.ui)||void 0===e?void 0:e.container.contains(document.activeElement));this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",n||(this.previousFocusElement&&this.previousFocusElement.offsetParent?(this.previousFocusElement.focus(),this.previousFocusElement=void 0):this.options.returnFocus()),t.didHide()}}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,Ps.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:n,contrastBorder:i,widgetShadow:r}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e?e.toString():"",this.ui.container.style.backgroundColor=t?t.toString():"",this.ui.container.style.color=n?n.toString():"",this.ui.container.style.border=i?`1px solid ${i}`:"",this.ui.container.style.boxShadow=r?`0 5px 8px ${r}`:"",this.ui.inputBox.style(this.styles.inputBox),this.ui.count.style(this.styles.countBadge),this.ui.ok.style(this.styles.button),this.ui.customButton.style(this.styles.button),this.ui.progressBar.style(this.styles.progressBar),this.ui.list.style(this.styles.list);const o=[];this.styles.list.listInactiveFocusForeground&&(o.push(`.monaco-list .monaco-list-row.focused { color: ${this.styles.list.listInactiveFocusForeground}; }`),o.push(`.monaco-list .monaco-list-row.focused:hover { color: ${this.styles.list.listInactiveFocusForeground}; }`)),this.styles.list.pickerGroupBorder&&o.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.list.pickerGroupBorder}; }`),this.styles.list.pickerGroupForeground&&o.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.list.pickerGroupForeground}; }`);const s=o.join("\n");s!==this.ui.styleSheet.innerHTML&&(this.ui.styleSheet.innerHTML=s)}}}Ps.MAX_WIDTH=600;var js=n(97),Fs=n(127),Bs=n(126),Ws=function(e,t){return function(n,i){t(n,i,e)}};let Hs=class extends _e.a{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Li.a.as(Fs.b.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){var n;const[i,r]=this.getOrInstantiateProvider(e),o=this.visibleQuickAccess,s=null==o?void 0:o.descriptor;if(o&&r&&s===r)return e===r.prefix||(null==t?void 0:t.preserveValue)||(o.picker.value=e),void this.adjustValueSelection(o.picker,r,t);if(r&&!(null==t?void 0:t.preserveValue)){let t=void 0;if(o&&s&&s!==r){const e=o.value.substr(s.prefix.length);e&&(t=`${r.prefix}${e}`)}if(!t){const e=null==i?void 0:i.defaultFilterValue;e===Fs.a.LAST?t=this.lastAcceptedPickerValues.get(r):"string"==typeof e&&(t=`${r.prefix}${e}`)}"string"==typeof t&&(e=t)}const a=new _e.b,l=a.add(this.quickInputService.createQuickPick());l.value=e,this.adjustValueSelection(l,r,t),l.placeholder=null==r?void 0:r.placeholder,l.quickNavigate=null==t?void 0:t.quickNavigateConfiguration,l.hideInput=!!l.quickNavigate&&!o,("number"==typeof(null==t?void 0:t.itemActivation)||(null==t?void 0:t.quickNavigateConfiguration))&&(l.itemActivation=null!==(n=null==t?void 0:t.itemActivation)&&void 0!==n?n:js.b.SECOND),l.contextKey=null==r?void 0:r.contextKey,l.filterValue=e=>e.substring(r?r.prefix.length:0),(null==r?void 0:r.placeholder)&&(l.ariaLabel=null==r?void 0:r.placeholder);const c=this.registerPickerListeners(l,i,r,e,a);i&&a.add(i.provide(l,c)),l.show()}adjustValueSelection(e,t,n){var i;let r;r=(null==n?void 0:n.preserveValue)?[e.value.length,e.value.length]:[null!==(i=null==t?void 0:t.prefix.length)&&void 0!==i?i:0,e.value.length],e.valueSelection=r}registerPickerListeners(e,t,n,i,r){const o=this.visibleQuickAccess={picker:e,descriptor:n,value:i};r.add(Object(_e.h)(()=>{o===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(e=>{const[n]=this.getOrInstantiateProvider(e);n!==t?this.show(e,{preserveValue:!0}):o.value=e})),n&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(n,e.value)}));const s=r.add(new j.b);return Object(Bs.a)(e.onDidHide)(()=>{0===e.selectedItems.length&&s.cancel(),r.dispose()}),s.token}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let n=this.mapProviderToDescriptor.get(t);return n||(n=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,n)),[n,t]}};Hs=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}([Ws(0,js.a),Ws(1,ei.a)],Hs);var Ys=function(e,t){return function(n,i){t(n,i,e)}};let Vs=class extends ni.d{constructor(e,t,n,i,r){super(n),this.instantiationService=e,this.contextKeyService=t,this.accessibilityService=i,this.layoutService=r,this.contexts=new Map}get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(Hs))),this._quickAccess}createController(e=this.layoutService,t){var n,i;const r={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,isScreenReaderOptimized:()=>this.accessibilityService.isScreenReaderOptimized(),backKeybindingLabel:()=>void 0,setContextKey:e=>this.setContextKey(e),returnFocus:()=>e.focus(),createList:(e,t,n,i,r)=>this.instantiationService.createInstance(ho.d,e,t,n,i,r),styles:this.computeStyles()},o=this._register(new Ps(Object.assign(Object.assign({},r),t)));return o.layout(e.dimension,null!==(i=null===(n=e.offset)||void 0===n?void 0:n.top)&&void 0!==i?i:0),this._register(e.onLayout(t=>{var n,i;return o.layout(t,null!==(i=null===(n=e.offset)||void 0===n?void 0:n.top)&&void 0!==i?i:0)})),this._register(o.onShow(()=>this.resetContextKeys())),this._register(o.onHide(()=>this.resetContextKeys())),o}setContextKey(e){let t;e&&((t=this.contexts.get(e))||(t=new Xn.c(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),t&&t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},n=j.a.None){return this.controller.pick(e,t,n)}createQuickPick(){return this.controller.createQuickPick()}updateStyles(){this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:Object.assign({},Object(Kr.d)(this.theme,{quickInputBackground:Ji.dc,quickInputForeground:Ji.ec,quickInputTitleBackground:Ji.fc,contrastBorder:Ji.h,widgetShadow:Ji.uc})),inputBox:Object(Kr.d)(this.theme,{inputForeground:Ji.hb,inputBackground:Ji.fb,inputBorder:Ji.gb,inputValidationInfoBackground:Ji.lb,inputValidationInfoForeground:Ji.nb,inputValidationInfoBorder:Ji.mb,inputValidationWarningBackground:Ji.ob,inputValidationWarningForeground:Ji.qb,inputValidationWarningBorder:Ji.pb,inputValidationErrorBackground:Ji.ib,inputValidationErrorForeground:Ji.kb,inputValidationErrorBorder:Ji.jb}),countBadge:Object(Kr.d)(this.theme,{badgeBackground:Ji.c,badgeForeground:Ji.d,badgeBorder:Ji.h}),button:Object(Kr.d)(this.theme,{buttonForeground:Ji.f,buttonBackground:Ji.e,buttonHoverBackground:Ji.g,buttonBorder:Ji.h}),progressBar:Object(Kr.d)(this.theme,{progressBarBackground:Ji.cc}),list:Object(Kr.d)(this.theme,{listBackground:Ji.dc,listInactiveFocusForeground:Ji.yb,listInactiveFocusBackground:Ji.xb,listFocusOutline:Ji.b,listInactiveFocusOutline:Ji.b,pickerGroupBorder:Ji.Xb,pickerGroupForeground:Ji.Yb})}}};Vs=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}([Ys(0,ei.a),Ys(1,Xn.b),Ys(2,ni.c),Ys(3,ii.b),Ys(4,Qr)],Vs);var zs=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Us=function(e,t){return function(n,i){t(n,i,e)}};let $s=class extends Vs{constructor(e,t,n,i,r,o){super(t,n,i,r,o),this.host=void 0;const s=qs.get(e);this.host={_serviceBrand:void 0,get container(){return s.widget.getDomNode()},get dimension(){return e.getLayoutInfo()},get onLayout(){return e.onDidLayoutChange},focus:()=>e.focus()}}createController(){return super.createController(this.host)}};$s=zs([Us(1,ei.a),Us(2,Xn.b),Us(3,ni.c),Us(4,ii.b),Us(5,Qr)],$s);let Ks=class{constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const n=t=this.instantiationService.createInstance($s,e);this.mapEditorToService.set(e,t),Object(Bs.a)(e.onDidDispose)(()=>{n.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}pick(e,t={},n=j.a.None){return this.activeService.pick(e,t,n)}createQuickPick(){return this.activeService.createQuickPick()}};Ks=zs([Us(0,ei.a),Us(1,q.a)],Ks);class qs{constructor(e){this.editor=e,this.widget=new Gs(this.editor)}static get(e){return e.getContribution(qs.ID)}dispose(){this.widget.dispose()}}qs.ID="editor.controller.quickInput";class Gs{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Gs.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}Gs.ID="editor.contrib.quickInputWidget",Object(qo.m)(qs.ID,qs);var Zs,Js=n(185);!function(e){const t=new oo.a;class n{constructor(e,t){this._serviceId=e,this._factory=t,this._value=null}get id(){return this._serviceId}get(e){if(!this._value){if(e&&(this._value=e[this._serviceId.toString()]),this._value||(this._value=this._factory(e)),!this._value)throw new Error("Service "+this._serviceId+" is missing!");t.set(this._serviceId,this._value)}return this._value}}e.LazyStaticService=n;let i=[];function r(e,t){let r=new n(e,t);return i.push(r),r}e.init=function(e){let t=new oo.a;for(const[e,n]of Object(Do.a)())t.set(e,n);for(let n in e)e.hasOwnProperty(n)&&t.set(Object(ei.c)(n),e[n]);i.forEach(n=>t.set(n.id,n.get(e)));let n=new lo(t,!0);return t.set(ei.a,n),[t,n]},e.instantiationService=r(ei.a,()=>new lo(t,!0));const o=new jn;e.configurationService=r(tn.a,()=>o),e.resourceConfigurationService=r(ct.a,()=>new Fn(o)),e.resourcePropertiesService=r(ct.b,()=>new Bn(o)),e.contextService=r(kn.a,()=>new Hn),e.labelService=r(uo.a,()=>new zn),e.telemetryService=r(Zr.a,()=>new Wn),e.dialogService=r(to.a,()=>new Nn),e.notificationService=r(Sn.a,()=>new In),e.markerService=r(fo.b,()=>new _o),e.modeService=r(fi.a,e=>new Ti),e.standaloneThemeService=r(Zn.a,()=>new ur),e.logService=r(dt.b,()=>new dt.a),e.undoRedoService=r(Io.a,t=>new $o(e.dialogService.get(t),e.notificationService.get(t))),e.modelService=r(lt.a,t=>new Oi.a(e.configurationService.get(t),e.resourcePropertiesService.get(t),e.standaloneThemeService.get(t),e.logService.get(t),e.undoRedoService.get(t))),e.markerDecorationsService=r(So.a,t=>new Mo(e.modelService.get(t),e.markerService.get(t))),e.codeEditorService=r(q.a,t=>new Hi(e.standaloneThemeService.get(t))),e.editorProgressService=r(oi.a,()=>new On),e.storageService=r(bo.a,()=>new bo.b),e.storageSyncService=r(Js.a,()=>new Js.b),e.editorWorkerService=r(ge.a,t=>new _t(e.modelService.get(t),e.resourceConfigurationService.get(t),e.logService.get(t)))}(Zs||(Zs={}));class Xs extends _e.a{constructor(e,t){super();const[n,i]=Zs.init(t);this._serviceCollection=n,this._instantiationService=i;const r=this.get(tn.a),o=this.get(Sn.a),s=this.get(Zr.a),a=this.get(ni.c),l=this.get(dt.b);let c=(e,n)=>{let i=null;return t&&(i=t[e.toString()]),i||(i=n()),this._serviceCollection.set(e,i),i},d=c(Xn.b,()=>this._register(new Sr(r)));c(ii.b,()=>new To(d,r)),c(ho.a,()=>new ho.b(a));let u=c(ee.b,()=>new An(this._instantiationService)),h=c(ti.a,()=>this._register(new Rn(d,u,s,o,l,e))),f=c(Qr,()=>new Un(Zs.codeEditorService.get(q.a),e));c(js.a,()=>new Ks(i,Zs.codeEditorService.get(q.a)));let g=c(Qn.b,()=>this._register(new eo(f)));c(ri.a,()=>new No),c(Qn.a,()=>{const e=new Xr(s,o,g,h,a);return e.configure({blockMouse:!1}),this._register(e)}),c(Jn.a,()=>new wo(u)),c(Xt.a,()=>new Vn(Zs.modelService.get(lt.a)))}get(e){let t=this._serviceCollection.get(e);if(!t)throw new Error("Missing service "+e);return t}set(e,t){this._serviceCollection.set(e,t)}has(e){return this._serviceCollection.has(e)}}var Qs=n(77);function ea(e,t,n){let i=new Xs(e,t),r=null;i.has(pe.a)||(r=new Tn(Zs.modelService.get()),i.set(pe.a,r)),i.has(te.a)||i.set(te.a,new ae(i.get(q.a),i.get(ee.b)));let o=n(i);return r&&r.setEditor(o),o}function ta(e,t,n){return ea(e,n||{},n=>new ui(e,t,n,n.get(ei.a),n.get(q.a),n.get(ee.b),n.get(Xn.b),n.get(ti.a),n.get(Qn.b),n.get(Zn.a),n.get(Sn.a),n.get(tn.a),n.get(ii.b)))}function na(e){return Zs.codeEditorService.get().onCodeEditorAdd(t=>{e(t)})}function ia(e,t,n){return ea(e,n||{},n=>new hi(e,t,n,n.get(ei.a),n.get(Xn.b),n.get(ti.a),n.get(Qn.b),n.get(ge.a),n.get(q.a),n.get(Zn.a),n.get(Sn.a),n.get(tn.a),n.get(Qn.a),n.get(oi.a),n.get(ri.a)))}function ra(e,t){return new le.a(e,t)}function oa(e,t,n){return Zs.modelService.get().createModel(e,t,n)}function sa(e,t,n){if(e=e||"",!t){let t=e.indexOf("\n"),i=e;return-1!==t&&(i=e.substring(0,t)),oa(e,Zs.modeService.get().createByFilepathOrFirstLine(n||null,i),n)}return oa(e,Zs.modeService.get().create(t),n)}function aa(e,t){Zs.modelService.get().setMode(e,Zs.modeService.get().create(t))}function la(e,t,n){e&&Zs.markerService.get().changeOne(t,e.uri,n)}function ca(e){return Zs.markerService.get().read(e)}function da(e){return Zs.modelService.get().getModel(e)}function ua(){return Zs.modelService.get().getModels()}function ha(e){return Zs.modelService.get().onModelAdded(e)}function fa(e){return Zs.modelService.get().onModelRemoved(e)}function ga(e){return Zs.modelService.get().onModelModeChanged(t=>{e({model:t.model,oldLanguage:t.oldModeId})})}function pa(e){return function(e,t){return new kt(e,t)}(Zs.modelService.get(),e)}function ma(e,t){const n=Zs.standaloneThemeService.get();return n.registerEditorContainer(e),$t.colorizeElement(n,Zs.modeService.get(),e,t)}function _a(e,t,n){return Zs.standaloneThemeService.get().registerEditorContainer(document.body),$t.colorize(Zs.modeService.get(),e,t,n)}function ba(e,t,n=4){return Zs.standaloneThemeService.get().registerEditorContainer(document.body),$t.colorizeModelLine(e,t,n)}function va(e,t){Zs.modeService.get().triggerMode(t);let n=function(e){let t=he.C.get(e);return t||{getInitialState:()=>fe.c,tokenize:(t,n,i)=>Object(fe.d)(e,t,n,i)}}(t),i=e.split(/\r\n|\r|\n/),r=[],o=n.getInitialState();for(let e=0,t=i.length;e=0&&n<5;)n++,t=t.replace(/@(\w+)/g,(function(n,i){let r="";if("string"==typeof e[i])r=e[i];else{if(!(e[i]&&e[i]instanceof RegExp))throw void 0===e[i]?At(e,"language definition does not contain attribute '"+i+"', used at: "+t):At(e,"attribute reference '"+i+"' must be a string, used at: "+t);r=e[i].source}return Ot(r)?"":"(?:"+r+")"}));let i=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,i)}function Ma(e,t,n,i){let r=-1,o=n,s=n.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);s&&(s[3]&&(r=parseInt(s[3]),s[2]&&(r+=100)),o=s[4]);let a,l="~",c=o;if(o&&0!==o.length?/^\w*$/.test(c)?l="==":(s=o.match(/^(@|!@|~|!~|==|!=)(.*)$/))&&(l=s[1],c=s[2]):(l="!=",c=""),"~"!==l&&"!~"!==l||!/^(\w|\|)*$/.test(c))if("@"===l||"!@"===l){let n=e[c];if(!n)throw At(e,"the @ match target '"+c+"' is not defined, in rule: "+t);if(!function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const n of t)if(!e(n))return!1;return!0}((function(e){return"string"==typeof e}),n))throw At(e,"the @ match target '"+c+"' must be an array of strings, in rule: "+t);let i=xa(n,e.ignoreCase);a=function(e){return"@"===l?i(e):!i(e)}}else if("~"===l||"!~"===l)if(c.indexOf("$")<0){let t=La(e,"^"+c+"$");a=function(e){return"~"===l?t.test(e):!t.test(e)}}else a=function(t,n,i,r){return La(e,"^"+Rt(e,c,n,i,r)+"$").test(t)};else if(c.indexOf("$")<0){let t=Nt(e,c);a=function(e){return"=="===l?e===t:e!==t}}else{let t=Nt(e,c);a=function(n,i,r,o,s){let a=Rt(e,t,i,r,o);return"=="===l?n===a:n!==a}}else{let t=xa(c.split("|"),e.ignoreCase);a=function(e){return"~"===l?t(e):!t(e)}}return-1===r?{name:n,value:i,test:function(e,t,n,i){return a(e,e,t,n,i)}}:{name:n,value:i,test:function(e,t,n,i){let o=function(e,t,n,i){if(i<0)return e;if(i=100){i-=100;let e=n.split(".");if(e.unshift(n),i0&&"^"===n[0],this.name=this.name+": "+n,this.regex=La(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")}setAction(e,t){this.action=function e(t,n,i){if(i){if("string"==typeof i)return i;if(i.token||""===i.token){if("string"!=typeof i.token)throw At(t,"a 'token' attribute must be of type string, in rule: "+n);{let e={token:i.token};if(i.token.indexOf("$")>=0&&(e.tokenSubst=!0),"string"==typeof i.bracket)if("@open"===i.bracket)e.bracket=1;else{if("@close"!==i.bracket)throw At(t,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+n);e.bracket=-1}if(i.next){if("string"!=typeof i.next)throw At(t,"the next state must be a string value in rule: "+n);{let r=i.next;if(!/^(@pop|@push|@popall)$/.test(r)&&("@"===r[0]&&(r=r.substr(1)),r.indexOf("$")<0&&!function(e,t){let n=t;for(;n&&n.length>0;){if(e.stateNames[n])return!0;const t=n.lastIndexOf(".");n=t<0?null:n.substr(0,t)}return!1}(t,Rt(t,r,"",[],""))))throw At(t,"the next state '"+i.next+"' is not defined in rule: "+n);e.next=r}}return"number"==typeof i.goBack&&(e.goBack=i.goBack),"string"==typeof i.switchTo&&(e.switchTo=i.switchTo),"string"==typeof i.log&&(e.log=i.log),"string"==typeof i.nextEmbedded&&(e.nextEmbedded=i.nextEmbedded,t.usesEmbedded=!0),e}}if(Array.isArray(i)){let r=[];for(let o=0,s=i.length;o{i.getId()===e&&(n.dispose(),t())});return n}function Ia(e,t){let n=Zs.modeService.get().getLanguageIdentifier(e);if(!n)throw new Error(`Cannot set configuration for unknown language ${e}`);return De.a.register(n,t)}class Aa{constructor(e){this._actual=e}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,n){throw new Error("Not supported!")}tokenize2(e,t){let n=this._actual.tokenizeEncoded(e,t);return new z.c(n.tokens,n.endState)}}class Ra{constructor(e,t,n){this._standaloneThemeService=e,this._languageIdentifier=t,this._actual=n}getInitialState(){return this._actual.getInitialState()}_toClassicTokens(e,t,n){let i=[],r=0;for(let o=0,s=e.length;o0&&r[o-1]===c)continue;let d=l.startIndex;0===a?d=0:d(function(e){return"tokenizeEncoded"in e})(e)?new Aa(e):new Ra(Zs.standaloneThemeService.get(),n,e);return Pa(t)?he.C.registerPromise(e,t.then(e=>i(e))):he.C.register(e,i(t))}function Fa(e,t){const n=t=>(function(e,t,n,i){return new zt(e,t,n,i)})(Zs.modeService.get(),Zs.standaloneThemeService.get(),e,function(e,t){if(!t||"object"!=typeof t)throw new Error("Monarch: expecting a language definition object");let n={};n.languageId=e,n.noThrow=!1,n.maxStack=100,n.start="string"==typeof t.start?t.start:null,n.ignoreCase=Sa(t.ignoreCase,!1),n.unicode=Sa(t.unicode,!1),n.tokenPostfix=ka(t.tokenPostfix,"."+n.languageId),n.defaultToken=ka(t.defaultToken,"source"),n.usesEmbedded=!1;let i=t;function r(e,o,s){for(const a of s){let s=a.include;if(s){if("string"!=typeof s)throw At(n,"an 'include' attribute must be a string at: "+e);if("@"===s[0]&&(s=s.substr(1)),!t.tokenizer[s])throw At(n,"include target '"+s+"' is not defined at: "+e);r(e+"."+s,o,t.tokenizer[s])}else{const t=new Da(e);if(Array.isArray(a)&&a.length>=1&&a.length<=3)if(t.setRegex(i,a[0]),a.length>=3)if("string"==typeof a[1])t.setAction(i,{token:a[1],next:a[2]});else{if("object"!=typeof a[1])throw At(n,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+e);{const e=a[1];e.next=a[2],t.setAction(i,e)}}else t.setAction(i,a[1]);else{if(!a.regex)throw At(n,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);a.name&&"string"==typeof a.name&&(t.name=a.name),a.matchOnlyAtStart&&(t.matchOnlyAtLineStart=Sa(a.matchOnlyAtLineStart,!1)),t.setRegex(i,a.regex),t.setAction(i,a.action)}o.push(t)}}}if(i.languageId=e,i.ignoreCase=n.ignoreCase,i.unicode=n.unicode,i.noThrow=n.noThrow,i.usesEmbedded=n.usesEmbedded,i.stateNames=t.tokenizer,i.defaultToken=n.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw At(n,"a language definition must define the 'tokenizer' attribute as an object");n.tokenizer=[];for(let e in t.tokenizer)if(t.tokenizer.hasOwnProperty(e)){n.start||(n.start=e);const i=t.tokenizer[e];n.tokenizer[e]=new Array,r("tokenizer."+e,n.tokenizer[e],i)}if(n.usesEmbedded=i.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw At(n,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];let o=[];for(let e of t.brackets){let t=e;if(t&&Array.isArray(t)&&3===t.length&&(t={token:t[2],open:t[0],close:t[1]}),t.open===t.close)throw At(n,"open and close brackets in a 'brackets' attribute must be different: "+t.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof t.open||"string"!=typeof t.token||"string"!=typeof t.close)throw At(n,"every element in the 'brackets' array must be a '{open,close,token}' object or array");o.push({token:t.token+n.tokenPostfix,open:Nt(n,t.open),close:Nt(n,t.close)})}return n.brackets=o,n.noThrow=!0,n}(e,t));return Pa(t)?he.C.registerPromise(e,t.then(e=>n(e))):he.C.register(e,n(t))}function Ba(e,t){return he.v.register(e,t)}function Wa(e,t){return he.w.register(e,t)}function Ha(e,t){return he.y.register(e,t)}function Ya(e,t){return he.p.register(e,{provideHover:(e,n,i)=>{let r=e.getWordAtPosition(n);return Promise.resolve(t.provideHover(e,n,i)).then(e=>{if(e)return!e.range&&r&&(e.range=new Y.a(n.lineNumber,r.startColumn,n.lineNumber,r.endColumn)),e.range||(e.range=new Y.a(n.lineNumber,n.column,n.lineNumber,n.column)),e})}})}function Va(e,t){return he.m.register(e,t)}function za(e,t){return he.i.register(e,t)}function Ua(e,t){return he.u.register(e,t)}function $a(e,t){return he.f.register(e,t)}function Ka(e,t){return he.q.register(e,t)}function qa(e,t){return he.D.register(e,t)}function Ga(e,t){return he.b.register(e,t)}function Za(e,t){return he.a.register(e,{provideCodeActions:(e,n,i,r)=>{let o=Zs.markerService.get().read({resource:e.uri}).filter(e=>Y.a.areIntersectingOrTouching(e,n));return t.provideCodeActions(e,n,{markers:o,only:i.only},r)}})}function Ja(e,t){return he.g.register(e,t)}function Xa(e,t){return he.j.register(e,t)}function Qa(e,t){return he.t.register(e,t)}function el(e,t){return he.s.register(e,t)}function tl(e,t){return he.d.register(e,t)}function nl(e,t){return he.c.register(e,t)}function il(e,t){return he.o.register(e,t)}function rl(e,t){return he.e.register(e,t)}function ol(e,t){return he.x.register(e,t)}function sl(e,t){return he.l.register(e,t)}function al(e,t){return he.k.register(e,t)}n.d(t,"CancellationTokenSource",(function(){return dl})),n.d(t,"Emitter",(function(){return ul})),n.d(t,"KeyCode",(function(){return hl})),n.d(t,"KeyMod",(function(){return fl})),n.d(t,"Position",(function(){return gl})),n.d(t,"Range",(function(){return pl})),n.d(t,"Selection",(function(){return ml})),n.d(t,"SelectionDirection",(function(){return _l})),n.d(t,"MarkerSeverity",(function(){return bl})),n.d(t,"MarkerTag",(function(){return vl})),n.d(t,"Uri",(function(){return yl})),n.d(t,"Token",(function(){return wl})),n.d(t,"editor",(function(){return Cl})),n.d(t,"languages",(function(){return Sl}));const ll=self;P.g.wrappingIndent.defaultValue=0,P.g.glyphMargin.defaultValue=!1,P.g.autoIndent.defaultValue=3,P.g.overviewRulerLanes.defaultValue=2;const cl=$();cl.editor={create:ta,onDidCreateEditor:na,createDiffEditor:ia,createDiffNavigator:ra,createModel:sa,setModelLanguage:aa,setModelMarkers:la,getModelMarkers:ca,getModels:ua,getModel:da,onDidCreateModel:ha,onWillDisposeModel:fa,onDidChangeModelLanguage:ga,createWebWorker:pa,colorizeElement:ma,colorize:_a,colorizeModelLine:ba,tokenize:va,defineTheme:ya,setTheme:wa,remeasureFonts:Ca,AccessibilitySupport:i,ContentWidgetPositionPreference:l,CursorChangeReason:c,DefaultEndOfLine:d,EditorAutoIndentStrategy:h,EditorOption:f,EndOfLinePreference:g,EndOfLineSequence:p,MinimapPosition:y,MouseTargetType:w,OverlayWidgetPositionPreference:C,OverviewRulerLane:S,RenderLineNumbersType:k,RenderMinimap:x,ScrollbarVisibility:M,ScrollType:L,TextEditorCursorBlinkingStyle:N,TextEditorCursorStyle:I,TrackedRangeStickiness:A,WrappingIndent:R,ConfigurationChangedEvent:P.b,BareFontInfo:ce.a,FontInfo:ce.b,TextModelResolvedOptions:ue.e,FindMatch:ue.b,EditorType:de.a,EditorOptions:P.g},cl.languages={register:Ea,getLanguages:Ta,onLanguage:Na,getEncodedLanguageId:Oa,setLanguageConfiguration:Ia,setTokensProvider:ja,setMonarchTokensProvider:Fa,registerReferenceProvider:Ba,registerRenameProvider:Wa,registerCompletionItemProvider:tl,registerSignatureHelpProvider:Ha,registerHoverProvider:Ya,registerDocumentSymbolProvider:Va,registerDocumentHighlightProvider:za,registerOnTypeRenameProvider:Ua,registerDefinitionProvider:$a,registerImplementationProvider:Ka,registerTypeDefinitionProvider:qa,registerCodeLensProvider:Ga,registerCodeActionProvider:Za,registerDocumentFormattingEditProvider:Ja,registerDocumentRangeFormattingEditProvider:Xa,registerOnTypeFormattingEditProvider:Qa,registerLinkProvider:el,registerColorProvider:nl,registerFoldingRangeProvider:il,registerDeclarationProvider:rl,registerSelectionRangeProvider:ol,registerDocumentSemanticTokensProvider:sl,registerDocumentRangeSemanticTokensProvider:al,DocumentHighlightKind:u,CompletionItemKind:o,CompletionItemTag:s,CompletionItemInsertTextRule:r,SymbolKind:T,SymbolTag:O,IndentAction:m,CompletionTriggerKind:a,SignatureHelpTriggerKind:E,FoldingRangeKind:he.n};const dl=cl.CancellationTokenSource,ul=cl.Emitter,hl=cl.KeyCode,fl=cl.KeyMod,gl=cl.Position,pl=cl.Range,ml=cl.Selection,_l=cl.SelectionDirection,bl=cl.MarkerSeverity,vl=cl.MarkerTag,yl=cl.Uri,wl=cl.Token,Cl=cl.editor,Sl=cl.languages;ll.monaco=cl,void 0!==ll.require&&"function"==typeof ll.require.config&&ll.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]})},function(e,t,n){"use strict";n(86);var i=n(212),r={},o={},s=function(){function e(e){var t=this;this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((function(e,n){t._lazyLoadPromiseResolve=e,t._lazyLoadPromiseReject=n}))}return e.getOrCreate=function(t){return o[t]||(o[t]=new e(t)),o[t]},e.prototype.whenLoaded=function(){return this._lazyLoadPromise},e.prototype.load=function(){var e=this;return this._loadingTriggered||(this._loadingTriggered=!0,r[this._languageId].loader().then((function(t){return e._lazyLoadPromiseResolve(t)}),(function(t){return e._lazyLoadPromiseReject(t)}))),this._lazyLoadPromise},e}();function a(e){var t=e.id;r[t]=e,i.languages.register(e);var n=s.getOrCreate(t);i.languages.setMonarchTokensProvider(t,n.whenLoaded().then((function(e){return e.language}))),i.languages.onLanguage(t,(function(){n.load().then((function(e){i.languages.setLanguageConfiguration(t,e.conf)}))}))}a({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:function(){return n.e(7).then(n.bind(null,911))}}),a({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:function(){return n.e(8).then(n.bind(null,912))}}),a({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:function(){return n.e(9).then(n.bind(null,913))}}),a({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:function(){return n.e(10).then(n.bind(null,914))}}),a({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:function(){return n.e(11).then(n.bind(null,915))}}),a({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:function(){return n.e(12).then(n.bind(null,916))}}),a({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:function(){return n.e(13).then(n.bind(null,917))}}),a({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:function(){return n.e(0).then(n.bind(null,918))}}),a({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:function(){return n.e(0).then(n.bind(null,918))}}),a({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:function(){return n.e(14).then(n.bind(null,919))}}),a({id:"csp",extensions:[],aliases:["CSP","csp"],loader:function(){return n.e(15).then(n.bind(null,920))}}),a({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:function(){return n.e(16).then(n.bind(null,921))}}),a({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:function(){return n.e(17).then(n.bind(null,922))}}),a({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:function(){return n.e(18).then(n.bind(null,923))}}),a({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:function(){return n.e(19).then(n.bind(null,924))}}),a({id:"go",extensions:[".go"],aliases:["Go"],loader:function(){return n.e(20).then(n.bind(null,925))}}),a({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:function(){return n.e(21).then(n.bind(null,926))}}),a({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars"],mimetypes:["text/x-handlebars-template"],loader:function(){return n.e(22).then(n.bind(null,927))}}),a({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:function(){return n.e(23).then(n.bind(null,928))}}),a({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:function(){return n.e(24).then(n.bind(null,929))}}),a({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:function(){return n.e(25).then(n.bind(null,930))}}),a({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:function(){return n.e(26).then(n.bind(null,931))}}),a({id:"javascript",extensions:[".js",".es6",".jsx",".mjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:function(){return n.e(3).then(n.bind(null,932))}}),a({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:function(){return n.e(27).then(n.bind(null,933))}}),a({id:"kotlin",extensions:[".kt"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:function(){return n.e(28).then(n.bind(null,934))}}),a({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:function(){return n.e(29).then(n.bind(null,935))}}),a({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:function(){return n.e(30).then(n.bind(null,936))}}),a({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:function(){return n.e(31).then(n.bind(null,937))}}),a({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:function(){return n.e(32).then(n.bind(null,938))}}),a({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:function(){return n.e(33).then(n.bind(null,939))}}),a({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:function(){return n.e(34).then(n.bind(null,940))}}),a({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:function(){return n.e(35).then(n.bind(null,941))}}),a({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:function(){return n.e(36).then(n.bind(null,942))}}),a({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:function(){return n.e(37).then(n.bind(null,943))}}),a({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:function(){return n.e(38).then(n.bind(null,944))}}),a({id:"perl",extensions:[".pl"],aliases:["Perl","pl"],loader:function(){return n.e(39).then(n.bind(null,945))}}),a({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:function(){return n.e(40).then(n.bind(null,946))}}),a({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:function(){return n.e(41).then(n.bind(null,947))}}),a({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:function(){return n.e(42).then(n.bind(null,948))}}),a({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:function(){return n.e(43).then(n.bind(null,949))}}),a({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:function(){return n.e(44).then(n.bind(null,950))}}),a({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:function(){return n.e(45).then(n.bind(null,951))}}),a({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:function(){return n.e(46).then(n.bind(null,952))}}),a({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:function(){return n.e(47).then(n.bind(null,953))}}),a({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:function(){return n.e(48).then(n.bind(null,954))}}),a({id:"redis",extensions:[".redis"],aliases:["redis"],loader:function(){return n.e(49).then(n.bind(null,955))}}),a({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:function(){return n.e(50).then(n.bind(null,956))}}),a({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:function(){return n.e(51).then(n.bind(null,957))}}),a({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:function(){return n.e(52).then(n.bind(null,958))}}),a({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:function(){return n.e(53).then(n.bind(null,959))}}),a({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:function(){return n.e(54).then(n.bind(null,960))}}),a({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:function(){return n.e(55).then(n.bind(null,961))}}),a({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:function(){return n.e(56).then(n.bind(null,962))}}),a({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:function(){return n.e(57).then(n.bind(null,963))}}),a({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:function(){return n.e(58).then(n.bind(null,964))}}),a({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:function(){return n.e(59).then(n.bind(null,965))}}),a({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:function(){return n.e(60).then(n.bind(null,966))}}),a({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:function(){return n.e(61).then(n.bind(null,967))}}),a({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib"],aliases:["StructuredText","scl","stl"],loader:function(){return n.e(62).then(n.bind(null,968))}}),a({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:function(){return n.e(63).then(n.bind(null,969))}}),a({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:function(){return n.e(1).then(n.bind(null,970))}}),a({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:function(){return n.e(1).then(n.bind(null,970))}}),a({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:function(){return n.e(64).then(n.bind(null,971))}}),a({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:function(){return n.e(65).then(n.bind(null,972))}}),a({id:"typescript",extensions:[".ts",".tsx"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:function(){return n.e(66).then(n.bind(null,908))}}),a({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:function(){return n.e(67).then(n.bind(null,973))}}),a({id:"xml",extensions:[".xml",".dtd",".ascx",".csproj",".config",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xsl"],firstLine:"(\\<\\?xml.*)|(\\n.unsubscribe():n}function d(e){let t;return c(e,e=>t=e)(),t}function u(e,t,n,i){if(e){const r=h(e,t,n,i);return e[0](r)}}function h(e,t,n,i){return e[1]&&i?function(e,t){for(const n in t)e[n]=t[n];return e}(n.ctx.slice(),e[1](i(t))):n.ctx}function f(e,t,n,i){return e[2]&&i?t.dirty|e[2](i(n)):t.dirty}function g(e){return null==e?"":e}new Set;function p(e,t){e.appendChild(t)}function m(e,t,n){e.insertBefore(t,n||null)}function _(e){e.parentNode.removeChild(e)}function b(e,t){for(let n=0;ne.removeEventListener(t,n,i)}function k(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function x(e){return""===e?void 0:+e}function L(e,t){t=""+t,e.data!==t&&(e.data=t)}function M(e,t){(null!=t||e.value)&&(e.value=t)}function D(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}let E;function T(e){E=e}function O(){if(!E)throw new Error("Function called outside component initialization");return E}function N(e){O().$$.on_mount.push(e)}const I=[],A=[],R=[],P=[],j=Promise.resolve();let F=!1;function B(){F||(F=!0,j.then(H))}function W(e){R.push(e)}function H(){const e=new Set;do{for(;I.length;){const e=I.shift();T(e),Y(e.$$)}for(;A.length;)A.pop()();for(let t=0;t{V.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}}"undefined"!=typeof window?window:global;new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]);let G;function Z(e){e&&e.c()}function J(e,t,n){const{fragment:i,on_mount:o,on_destroy:l,after_update:c}=e.$$;i&&i.m(t,n),W(()=>{const t=o.map(r).filter(a);l?l.push(...t):s(t),e.$$.on_mount=[]}),c.forEach(W)}function X(e,t){const n=e.$$;null!==n.fragment&&(s(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Q(e,t,n,r,a,l,c=[-1]){const d=E;T(e);const u=t.props||{},h=e.$$={fragment:null,ctx:null,props:l,update:i,not_equal:a,bound:o(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:[]),callbacks:o(),dirty:c};let f=!1;var g;h.ctx=n?n(e,u,(t,n,i=n)=>(h.ctx&&a(h.ctx[t],h.ctx[t]=i)&&(h.bound[t]&&h.bound[t](i),f&&function(e,t){-1===e.$$.dirty[0]&&(I.push(e),B(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(){}});class ee{$destroy(){X(this,1),this.$destroy=i}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(){}}const te=[];function ne(e,t){return{subscribe:ie(e,t).subscribe}}function ie(e,t=i){let n;const r=[];function o(t){if(l(e,t)&&(e=t,n)){const t=!te.length;for(let t=0;t{const e=r.indexOf(l);-1!==e&&r.splice(e,1),0===r.length&&(n(),n=null)}}}}function re(e,t,n){const r=!Array.isArray(e),o=r?[e]:e,l=t.length<2;return ne(n,e=>{let n=!1;const c=[];let d=0,u=i;const h=()=>{if(d)return;u();const n=t(r?c[0]:c,e);l?e(n):u=a(n)?n:i},f=o.map((e,t)=>e.subscribe(e=>{c[t]=e,d&=~(1<{d|=1<{X(e,1)}),$()}i?(Z((o=new i(r(e))).$$.fragment),K(o.$$.fragment,1),J(o,t.parentNode,t)):o=null}else i&&o.$set(s)},i(e){n||(o&&K(o.$$.fragment,e),n=!0)},o(e){o&&q(o.$$.fragment,e),n=!1},d(e){e&&_(t),o&&X(o,e)}}}function ae(){const e=window.location.href.indexOf("#/");let t=e>-1?window.location.href.substr(e+1):"/";const n=t.indexOf("?");let i="";return n>-1&&(i=t.substr(n+1),t=t.substr(0,n)),{location:t,querystring:i}}const le=ne(ae(),(function(e){const t=()=>{e(ae())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}})),ce=re(le,e=>e.location);re(le,e=>e.querystring);function de(e,t,n){let r,o=i;!function(e,t,n){e.$$.on_destroy.push(c(t,n))}(e,le,e=>n(3,r=e)),e.$$.on_destroy.push(()=>o());let{routes:s={}}=t;class a{constructor(e,t){if(!t||"function"!=typeof t&&("object"!=typeof t||!0!==t._sveltesparouter))throw Error("Invalid component object");if(!e||"string"==typeof e&&(e.length<1||"/"!=e.charAt(0)&&"*"!=e.charAt(0))||"object"==typeof e&&!(e instanceof RegExp))throw Error('Invalid value for "path" argument');const{pattern:n,keys:i}=oe(e);this.path=e,"object"==typeof t&&!0===t._sveltesparouter?(this.component=t.route,this.conditions=t.conditions||[]):(this.component=t,this.conditions=[]),this._pattern=n,this._keys=i}match(e){const t=this._pattern.exec(e);if(null===t)return null;if(!1===this._keys)return t;const n={};let i=0;for(;i{const i=e.$$.callbacks[t];if(i){const r=D(t,n);i.slice().forEach(t=>{t.call(e,r)})}}}(),g=(e,t)=>{setTimeout(()=>{f(e,t)},0)};return e.$set=e=>{"routes"in e&&n(2,s=e.routes)},e.$$.update=()=>{if(9&e.$$.dirty){n(0,u=null);let e=0;for(;!u&&e{let t;try{const n=he.Base64.decode(e);console.log("state from url",n),t=JSON.parse(n)}catch(e){console.error("Init error",e),t=fe}ge.set({...t,updateEditor:!0})},me=e=>{ge.set(e)},_e=(e,t)=>{const n=d(ge);ge.set({...n,code:e,updateEditor:t})},be=(e,t)=>{const n=d(ge);ge.set({...n,mermaid:e,updateEditor:t})},ve=(ge.subscribe(e=>{!function(e){if(!e||e.length<1||"/"!=e.charAt(0)&&0!==e.indexOf("#/"))throw Error("Invalid parameter location");setTimeout(()=>{const t=("#"==e.charAt(0)?"":"#")+e;history.replaceState(void 0,void 0,t),window.dispatchEvent(new Event("hashchange"))},0)}(`/${d(ce).split("/")[1]||"edit"}/`+he.Base64.encodeURI(JSON.stringify(e)))}),ie(void 0)),ye=ie(void 0);var we=n(210),Ce=n.n(we);n(568);function Se(e){let t,n,i;return{c(){t=v("div"),n=y(e[1]),k(t,"id","error"),k(t,"class",i=g(e[0])+" svelte-104hor5")},m(e,i){m(e,t,i),p(t,n)},p(e,r){2&r&&L(n,e[1]),1&r&&i!==(i=g(e[0])+" svelte-104hor5")&&k(t,"class",i)},d(e){e&&_(t)}}}function ke(e){let t,n=e[1]&&Se(e);return{c(){n&&n.c(),t=C()},m(e,i){n&&n.m(e,i),m(e,t,i)},p(e,[i]){e[1]?n?n.p(e,i):((n=Se(e)).c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},i:i,o:i,d(e){n&&n.d(e),e&&_(t)}}}function xe(e,t,n){let i,{classes:r=""}=t,{errorStore:o}=t;return o.subscribe(e=>{n(1,i=!!e&&e.toString())}),e.$set=e=>{"classes"in e&&n(0,r=e.classes),"errorStore"in e&&n(2,o=e.errorStore)},[r,i,o]}var Le=class extends ee{constructor(e){super(),Q(this,e,xe,ke,l,{classes:0,errorStore:2})}};const Me=e=>{e.languages.register({id:"mermaid"}),e.languages.setMonarchTokensProvider("mermaid",{typeKeywords:["graph","stateDiagram","sequenceDiagram","classDiagram","pie","flowchart","gantt"],keywords:["patricipant","as"],arrows:["---","===","--\x3e","==>"],tokenizer:{root:[[/[{}]/,"delimiter.bracket"],[/[a-z_$][\w$]*/,{cases:{"@typeKeywords":"keyword","@keywords":"keyword"}}],[/[-=>ox]+/,{cases:{"@arrows":"transition"}}],[/[\[\{\(}]+.+?[\)\]\}]+/,"string"],[/\".*\"/,"string"]]},whitespace:[[/[ \t\r\n]+/,"white"],[/\%\%.*$/,"comment"]]}),e.editor.defineTheme("myCoolTheme",{base:"vs",inherit:!1,rules:[{token:"keyword",foreground:"880000",fontStyle:"bold"},{token:"custom-error",foreground:"ff0000",fontStyle:"bold"},{token:"string",foreground:"AA8500"},{token:"transition",foreground:"008800",fontStyle:"bold"},{token:"delimiter.bracket",foreground:"000000",fontStyle:"bold"}]}),e.languages.registerCompletionItemProvider("mermaid",{provideCompletionItems:()=>{return{suggestions:[{label:"simpleText",kind:e.languages.CompletionItemKind.Text,insertText:"simpleText"},{label:"testing",kind:e.languages.CompletionItemKind.Keyword,insertText:"testing(${1:condition})",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"ifelse",kind:e.languages.CompletionItemKind.Snippet,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"If-Else Statement"}]}}})},De=e=>t=>e&&e.layout();var Ee=n(237),Te=n(565),Oe=n.n(Te)()({strategy:"scroll"});function Ne(e,t){Oe.listenTo(e,t);var n=t;return{update:function(t){Oe.removeListener(e,n),Oe.listenTo(e,t),n=t},destroy:function(){Oe.removeListener(e,n)}}}n(890);function Ie(e){let t,n,i,r,o;const s=new Le({props:{errorStore:ve}});return{c(){t=v("div"),n=v("div"),r=w(),Z(s.$$.fragment),k(n,"id","editor"),k(n,"class","svelte-129q4vv"),k(t,"id","editor-container")},m(a,l){m(a,t,l),p(t,n),i=Ne.call(null,n,e[0])||{},p(t,r),J(s,t,null),o=!0},p(e,[t]){a(i.update)&&1&t&&i.update.call(null,e[0])},i(e){o||(K(s.$$.fragment,e),o=!0)},o(e){q(s.$$.fragment,e),o=!1},d(e){e&&_(t),i&&a(i.destroy)&&i.destroy(),X(s)}}}function Ae(e,t,n){let i;const r=[];let o=null,s=()=>{};const a=(e,t)=>{try{Ce.a.parse(e),i&&(t&&i.setValue(e),r.forEach(e=>{i.deltaDecorations(e,[])})),_e(e,!1),ve.set(void 0)}catch(e){ve.set("Syntax Error"),console.log("Error in parsed",e.hash);e.hash.line;r.push(i.deltaDecorations([],[{range:new Ee.Range(e.hash.loc.first_line,e.hash.loc.last_line,e.hash.loc.first_column,e.hash.loc.last_column),options:{inlineClassName:"myInlineDecoration"}}]))}};ge.subscribe(e=>{e.updateEditor&&a(e.code,!0)});return N(async()=>{Me(Ee),o=document.getElementById("editor"),i=Ee.editor.create(o,{value:"",theme:"myCoolTheme",language:"mermaid"}),n(0,s=De(i)),i.onDidChangeModelContent((function(e){a(i.getValue(),!1)})),Me(Ee)}),[s]}var Re=class extends ee{constructor(e){super(),Q(this,e,Ae,Ie,l,{})}},Pe=n(86);n(891);function je(e){let t,n,i,r,o;const s=new Le({props:{errorStore:ye}});return{c(){t=v("div"),n=v("div"),r=w(),Z(s.$$.fragment),k(n,"id","editor-conf"),k(n,"class","svelte-e1y9ss"),k(t,"id","editor-container")},m(a,l){m(a,t,l),p(t,n),i=Ne.call(null,n,e[0])||{},p(t,r),J(s,t,null),o=!0},p(e,[t]){a(i.update)&&1&t&&i.update.call(null,e[0])},i(e){o||(K(s.$$.fragment,e),o=!0)},o(e){q(s.$$.fragment,e),o=!1},d(e){e&&_(t),i&&a(i.destroy)&&i.destroy(),X(s)}}}function Fe(e,t,n){let i,r=()=>{};const o=(e,t)=>{console.log(e),t&&i&&i.setValue(JSON.stringify(e,null,2)),be(e,!1),ye.set(void 0)};ge.subscribe(e=>{console.log(e.mermaid,e.updateEditor),e.updateEditor&&o(e.mermaid,!0)});return N(async()=>{console.log("Mounting config");const e=document.getElementById("editor-conf");i=Pe.editor.create(e,{value:"",theme:"myCoolTheme",language:"json"}),n(0,r=De(i)),i.onDidChangeModelContent((function(e){try{const e=JSON.parse(i.getValue());o(e,!1)}catch(e){console.log("Error in parsed",e),ye.set(e)}})),Me(Pe)}),[r]}var Be=class extends ee{constructor(e){super(),Q(this,e,Fe,je,l,{})}};n(892);function We(e){let t,n,r;return{c(){t=v("div"),k(n=v("div"),"id","container"),k(n,"class","svelte-adxv1m"),k(t,"id","view"),k(t,"class",r=e[1]+" "+e[0]+" svelte-adxv1m")},m(i,r){m(i,t,r),p(t,n),e[8](n)},p(e,[n]){3&n&&r!==(r=e[1]+" "+e[0]+" svelte-adxv1m")&&k(t,"class",r)},i:i,o:i,d(n){n&&_(t),e[8](null)}}}function He(e,t,n){const i=e=>(e=e.replace(/^\s*%%.*\n/g,"\n"),console.debug("Detecting diagram type based on the text "+e),e.match(/^\s*sequenceDiagram/)?"sequence":e.match(/^\s*gantt/)?"gantt":e.match(/^\s*classDiagram/)?"class":e.match(/^\s*stateDiagram/)?"state":e.match(/^\s*gitGraph/)?"git":e.match(/^\s*flowchart/)?"flowchart":e.match(/^\s*info/)?"info":e.match(/^\s*pie/)?"pie":"flowchart");let r;const o=e=>{clearTimeout(r),r=setTimeout((function(){console.log("ga:","send","event","render",e,e),ga("send","event",e,"render","render")}),5e3)};let s,{code:a=""}=t,{configClasses:l=""}=t,{codeClasses:c=""}=t;N(async()=>{ge.subscribe(e=>{try{s&&e&&(n(3,a=e.code.replace(//g,">")),n(2,s.innerHTML=a,s),o(i(a)),delete s.dataset.processed,Ce.a.initialize(Object.assign({},e.mermaid)),Ce.a.init(void 0,s),a&&Ce.a.render("graph-div",a,d))}catch(e){console.log("view fail",e)}}),ve.subscribe(e=>{void 0===e?n(1,c=""):(n(1,c="error"),console.log("code error: ",e))}),ye.subscribe(e=>{void 0===e?n(0,l=""):(n(0,l="error"),console.log("conf error: ",e))})});let d=function(e,t){};return e.$set=e=>{"code"in e&&n(3,a=e.code),"configClasses"in e&&n(0,l=e.configClasses),"codeClasses"in e&&n(1,c=e.codeClasses)},[l,c,s,a,r,i,o,d,function(e){A[e?"unshift":"push"](()=>{n(2,s=e)})}]}var Ye=class extends ee{constructor(e){super(),Q(this,e,He,We,l,{code:3,configClasses:0,codeClasses:1})}};n(893);function Ve(e){let t,n,i,r,o,s,a;const l=e[4].default,c=u(l,e,e[3],null);return{c(){t=v("div"),n=v("div"),i=y(e[0]),r=w(),o=v("div"),c&&c.c(),k(n,"id","title"),k(n,"class","padding svelte-m2i2uf"),k(o,"id","content"),k(o,"class",s=g(e[1])+" svelte-m2i2uf"),k(t,"id","card"),k(t,"class","svelte-m2i2uf")},m(e,s){m(e,t,s),p(t,n),p(n,i),p(t,r),p(t,o),c&&c.m(o,null),a=!0},p(e,[t]){(!a||1&t)&&L(i,e[0]),c&&c.p&&8&t&&c.p(h(l,e,e[3],null),f(l,e[3],t,null)),(!a||2&t&&s!==(s=g(e[1])+" svelte-m2i2uf"))&&k(o,"class",s)},i(e){a||(K(c,e),a=!0)},o(e){q(c,e),a=!1},d(e){e&&_(t),c&&c.d(e)}}}function ze(e,t,n){let{title:i=""}=t,{noPadding:r=!1}=t,o="padding";r&&n(1,o="");let{$$slots:s={},$$scope:a}=t;return e.$set=e=>{"title"in e&&n(0,i=e.title),"noPadding"in e&&n(2,r=e.noPadding),"$$scope"in e&&n(3,a=e.$$scope)},[i,o,r,a,s]}var Ue=class extends ee{constructor(e){super(),Q(this,e,ze,Ve,l,{title:0,noPadding:2})}};n(894);function $e(e){let t,n;const i=e[1].default,r=u(i,e,e[0],null);return{c(){t=v("div"),r&&r.c(),k(t,"id","tag"),k(t,"class","svelte-1nm8e4l")},m(e,i){m(e,t,i),r&&r.m(t,null),n=!0},p(e,[t]){r&&r.p&&1&t&&r.p(h(i,e,e[0],null),f(i,e[0],t,null))},i(e){n||(K(r,e),n=!0)},o(e){q(r,e),n=!1},d(e){e&&_(t),r&&r.d(e)}}}function Ke(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$set=e=>{"$$scope"in e&&n(0,r=e.$$scope)},[r,i]}var qe=class extends ee{constructor(e){super(),Q(this,e,Ke,$e,l,{})}},Ge=n(21),Ze=n.n(Ge);n(896);function Je(e){let t,n,r,o,a,l,c,d,u,h,f,g,b,C,x,L,D,E,T,O,N,I,A,R,P,j,F,B,W,H,Y,V,z,U,$,K,q,G,Z,J,X,Q,ee,te,ne,ie,re,oe,se,ae,le,ce,de,ue,he,fe=e[7](),ge=!1,pe=!1,me=fe&&function(e){let t,n,i,r;return{c(){t=v("button"),n=v("a"),i=y("Copy Image"),k(n,"class","link-style svelte-187ys3m"),k(n,"href",e[0]),k(n,"download",""),k(t,"class","button-style svelte-187ys3m"),r=S(n,"click",e[8])},m(e,r){m(e,t,r),p(t,n),p(n,i)},p(e,t){1&t&&k(n,"href",e[0])},d(e){e&&_(t),r()}}}(e);function _e(){ge=!0,e[21].call(te)}function be(){pe=!0,e[23].call(ce)}return{c(){t=v("div"),me&&me.c(),n=w(),r=v("button"),o=v("a"),a=y("Download PNG"),l=w(),c=v("button"),d=v("a"),u=y("Link to view"),h=w(),f=v("button"),g=v("a"),b=y("Download SVG"),C=w(),x=v("button"),L=v("a"),D=y("Link to Image"),E=w(),T=v("button"),O=v("a"),N=y("Link to SVG"),I=y("\n (markdown is base64 encoded for these urls)"),A=w(),R=v("div"),(P=v("label")).textContent="Copy Markdown",j=w(),F=v("br"),B=w(),W=v("input"),H=w(),Y=v("p"),(V=v("label")).textContent="PNG size:",z=v("br"),U=w(),$=v("input"),K=w(),(q=v("label")).textContent="auto",G=v("br"),Z=w(),J=v("input"),X=w(),(Q=v("label")).textContent="width",ee=w(),te=v("input"),ie=v("br"),re=w(),oe=v("input"),se=w(),(ae=v("label")).textContent="height",le=w(),ce=v("input"),ue=v("br"),k(o,"class","link-style svelte-187ys3m"),k(o,"href",e[0]),k(o,"download",""),k(r,"class","button-style svelte-187ys3m"),k(d,"class","link-style svelte-187ys3m"),k(d,"href",e[0]),k(c,"class","button-style svelte-187ys3m"),k(g,"class","link-style svelte-187ys3m"),k(g,"href",e[0]),k(g,"download",""),k(f,"class","button-style svelte-187ys3m"),k(L,"class","link-style svelte-187ys3m"),k(L,"href",e[1]),k(x,"class","button-style svelte-187ys3m"),k(O,"class","link-style svelte-187ys3m"),k(O,"href",e[2]),k(T,"class","button-style svelte-187ys3m"),k(t,"id","links"),k(t,"class","svelte-187ys3m"),k(P,"for","markdown"),k(P,"class","button-style svelte-187ys3m"),k(W,"id","markdown"),k(W,"type","text"),W.value=e[3],k(W,"class","svelte-187ys3m"),k(R,"id","copy-section"),k(R,"class","svelte-187ys3m"),k($,"type","radio"),$.__value="auto",$.value=$.__value,k($,"id","autosize"),e[19][0].push($),k(q,"for","autosize"),k(J,"type","radio"),J.__value="width",J.value=J.__value,k(J,"id","width-active"),e[19][0].push(J),k(Q,"for","width"),k(te,"id","width"),k(te,"type","number"),k(te,"min","3"),k(te,"max","10000"),te.disabled=ne="width"!==e[4],k(oe,"type","radio"),oe.__value="height",oe.value=oe.__value,k(oe,"id","height-active"),e[19][0].push(oe),k(ae,"for","height"),k(ce,"id","height"),k(ce,"type","number"),k(ce,"min","3"),k(ce,"max","10000"),ce.disabled=de="height"!==e[4],he=[S(o,"click",e[9]),S(g,"click",e[10]),S(W,"click",e[11]),S($,"change",e[18]),S(J,"change",e[20]),S(te,"input",_e),S(oe,"change",e[22]),S(ce,"input",be)]},m(i,s){m(i,t,s),me&&me.m(t,null),p(t,n),p(t,r),p(r,o),p(o,a),p(t,l),p(t,c),p(c,d),p(d,u),p(t,h),p(t,f),p(f,g),p(g,b),p(t,C),p(t,x),p(x,L),p(L,D),p(t,E),p(t,T),p(T,O),p(O,N),p(t,I),m(i,A,s),m(i,R,s),p(R,P),p(R,j),p(R,F),p(R,B),p(R,W),m(i,H,s),m(i,Y,s),p(Y,V),p(Y,z),p(Y,U),p(Y,$),$.checked=$.__value===e[4],p(Y,K),p(Y,q),p(Y,G),p(Y,Z),p(Y,J),J.checked=J.__value===e[4],p(Y,X),p(Y,Q),p(Y,ee),p(Y,te),M(te,e[5]),p(Y,ie),p(Y,re),p(Y,oe),oe.checked=oe.__value===e[4],p(Y,se),p(Y,ae),p(Y,le),p(Y,ce),M(ce,e[6]),p(Y,ue)},p(e,[t]){fe&&me.p(e,t),1&t&&k(o,"href",e[0]),1&t&&k(d,"href",e[0]),1&t&&k(g,"href",e[0]),2&t&&k(L,"href",e[1]),4&t&&k(O,"href",e[2]),8&t&&(W.value=e[3]),16&t&&($.checked=$.__value===e[4]),16&t&&(J.checked=J.__value===e[4]),16&t&&ne!==(ne="width"!==e[4])&&(te.disabled=ne),!ge&&32&t&&M(te,e[5]),ge=!1,16&t&&(oe.checked=oe.__value===e[4]),16&t&&de!==(de="height"!==e[4])&&(ce.disabled=de),!pe&&64&t&&M(ce,e[6]),pe=!1},i:i,o:i,d(n){n&&_(t),me&&me.d(),n&&_(A),n&&_(R),n&&_(H),n&&_(Y),e[19][0].splice(e[19][0].indexOf($),1),e[19][0].splice(e[19][0].indexOf(J),1),e[19][0].splice(e[19][0].indexOf(oe),1),s(he)}}}function Xe(e,t,n){const i=()=>{const e=document.getElementById("container").innerHTML.replaceAll("
    ","
    ");return he.Base64.encode(e)},r=(e,t)=>{const n=document.createElement("canvas"),r=document.querySelector("#container svg").getBoundingClientRect();if(n.width=r.width,n.height=r.height,"width"===h){const e=r.height/r.width;n.width=f,n.height=f*e}else if("height"===h){const e=r.width/r.height;n.width=g*e,n.height=g}const o=n.getContext("2d");o.fillStyle="white",o.fillRect(0,0,n.width,n.height);const s=new Image;s.onload=t(n,o,s),console.log("SVG",i()),s.src=`data:image/svg+xml;base64,${i()}`,e.stopPropagation(),e.preventDefault()},o=(e,t,n)=>()=>{t.drawImage(n,0,0,e.width,e.height);const i=document.createElement("a");i.download=`mermaid-diagram-${Ze()().format("YYYYMMDDHHmmss")}.png`,i.href=e.toDataURL("image/png").replace("image/png","image/octet-stream"),i.click()},s=(e,t,n)=>()=>{t.drawImage(n,0,0,e.width,e.height),e.toBlob(e=>{try{navigator.clipboard.write([new ClipboardItem({[e.type]:e})])}catch(e){console.error(e)}})};let a,l,c,d,u,h="auto",f=1920,g=1080;const p=ge.subscribe(e=>{l=he.Base64.encodeURI(JSON.stringify(e)),n(0,a=`${window.location.pathname.split("#")[0]}#/view/${l}`),n(1,c=`https://mermaid.ink/img/${l}`),n(2,d=`https://mermaid.ink/svg/${l}`),n(3,u=`[![](${c})](${window.location.protocol}//${window.location.host}${window.location.pathname}#/edit/${l})`)});return[a,c,d,u,h,f,g,()=>window.hasOwnProperty("ClipboardItem"),e=>{r(e,s)},e=>{r(e,o)},e=>{console.log("event",e.target),e.target.href=`data:image/svg+xml;base64,${i()}`,e.target.download=`mermaid-diagram-${Ze()().format("YYYYMMDDHHmmss")}.svg`,console.log("event",e)},e=>{e.target.select(),document.execCommand("Copy")},l,i,r,o,s,p,function(){h=this.__value,n(4,h)},[[]],function(){h=this.__value,n(4,h)},function(){f=x(this.value),n(5,f)},function(){h=this.__value,n(4,h)},function(){g=x(this.value),n(6,g)}]}var Qe=class extends ee{constructor(e){super(),Q(this,e,Xe,Je,l,{})}},et=n(566);n(897);function tt(e,t,n){const i=e.slice();return i[7]=t[n],i[9]=n,i}function nt(e,t,n){const i=e.slice();return i[10]=t[n],i[9]=n,i}function it(e){let t,n,i,r,o=e[10]+"";function s(...t){return e[5](e[10],...t)}return{c(){t=v("button"),n=y(o),i=w(),k(t,"class","button-style svelte-mx8k4g"),r=S(t,"click",s)},m(e,r){m(e,t,r),p(t,n),p(t,i)},p(t,n){e=t},d(e){e&&_(t),r()}}}function rt(e){let t;const n=new Re({props:{data:e[1].data}});return{c(){Z(n.$$.fragment)},m(e,i){J(n,e,i),t=!0},p(e,t){const i={};2&t&&(i.data=e[1].data),n.$set(i)},i(e){t||(K(n.$$.fragment,e),t=!0)},o(e){q(n.$$.fragment,e),t=!1},d(e){X(n,e)}}}function ot(e){let t;const n=new Be({});return{c(){Z(n.$$.fragment)},m(e,i){J(n,e,i),t=!0},i(e){t||(K(n.$$.fragment,e),t=!0)},o(e){q(n.$$.fragment,e),t=!1},d(e){X(n,e)}}}function st(e){let t;const n=new Ye({});return{c(){Z(n.$$.fragment)},m(e,i){J(n,e,i),t=!0},i(e){t||(K(n.$$.fragment,e),t=!0)},o(e){q(n.$$.fragment,e),t=!1},d(e){X(n,e)}}}function at(e){let t;return{c(){t=y("No records.")},m(e,n){m(e,t,n)},p:i,d(e){e&&_(t)}}}function lt(e){let t,n=e[2],i=[];for(let t=0;t0?lt:at}let a=s(e),l=a(e);return{c(){(t=v("span")).textContent="Automatically saves once every\n minute, up to 10 records.",n=w(),i=v("br"),r=w(),o=v("div"),l.c(),k(t,"id","historyLoaderSubTitle"),k(t,"class","svelte-mx8k4g"),k(o,"id","historyList"),k(o,"class","button-container svelte-mx8k4g")},m(e,s){m(e,t,s),m(e,n,s),m(e,i,s),m(e,r,s),m(e,o,s),l.m(o,null)},p(e,t){a===(a=s(e))&&l?l.p(e,t):(l.d(1),(l=a(e))&&(l.c(),l.m(o,null)))},d(e){e&&_(t),e&&_(n),e&&_(i),e&&_(r),e&&_(o),l.d()}}}function ut(e){let t;return{c(){(t=v("div")).innerHTML=' \n \n \n ',k(t,"class","button-container svelte-mx8k4g")},m(e,n){m(e,t,n)},d(e){e&&_(t)}}}function ht(e){let t;const n=new Qe({});return{c(){Z(n.$$.fragment)},m(e,i){J(n,e,i),t=!0},i(e){t||(K(n.$$.fragment,e),t=!0)},o(e){q(n.$$.fragment,e),t=!1},d(e){X(n,e)}}}function ft(e){let t;return{c(){t=y(e[0])},m(e,n){m(e,t,n)},p(e,n){1&n&&L(t,e[0])},d(e){e&&_(t)}}}function gt(e){let t,n,i,r,o,s,a,l,c,d,u,h,f,g,C,S,x,L,M,D,E,T,O,N=Object.keys(e[3]),I=[];for(let t=0;tMermaid Live Editor',i=w(),r=v("div"),o=v("div"),(s=v("span")).innerHTML="Diagram presets:",a=w();for(let e=0;e{ga("send","pageview"),ga("send","event","version",i,i);n(2,r=JSON.parse(localStorage.getItem("_mermaid_history_")||"[]"));let e=r.length>0?r[r.length-1]:null;o.data?pe(o.data):e?me({code:e.code,mermaid:{},updateEditor:!0}):a("Flow Chart");let t=null;ge.subscribe(e=>{t=e&&e.code||t}),setInterval(()=>{t!=e&&(r.unshift({time:(new Date).toISOString(),code:e=t}),r.length>10&&r.pop(),localStorage.setItem("_mermaid_history_",JSON.stringify(r))),n(2,r)},6e4)});let{params:o={}}=t;const s={"Flow Chart":"graph TD\n A[Christmas] --\x3e|Get money| B(Go shopping)\n B --\x3e C{Let me think}\n C --\x3e|One| D[Laptop]\n C --\x3e|Two| E[iPhone]\n C --\x3e|Three| F[fa:fa-car Car]","Sequence Diagram":"sequenceDiagram\n Alice->>+John: Hello John, how are you?\n Alice->>+John: John, can you hear me?\n John--\x3e>-Alice: Hi Alice, I can hear you!\n John--\x3e>-Alice: I feel great!\n ","Class Diagram":"classDiagram\n Animal <|-- Duck\n Animal <|-- Fish\n Animal <|-- Zebra\n Animal : +int age\n Animal : +String gender\n Animal: +isMammal()\n Animal: +mate()\n class Duck{\n +String beakColor\n +swim()\n +quack()\n }\n class Fish{\n -int sizeInFeet\n -canEat()\n }\n class Zebra{\n +bool is_wild\n +run()\n }\n ","State Diagram":"stateDiagram-v2\n [*] --\x3e Still\n Still --\x3e [*]\n Still --\x3e Moving\n Moving --\x3e Still\n Moving --\x3e Crash\n Crash --\x3e [*]\n ","Gantt Chart":"gantt\n title A Gantt Diagram\n dateFormat YYYY-MM-DD\n section Section\n A task :a1, 2014-01-01, 30d\n Another task :after a1 , 20d\n section Another\n Task in sec :2014-01-12 , 12d\n another task : 24d\n ","Pie Chart":'pie title Pets adopted by volunteers\n "Dogs" : 386\n "Cats" : 85\n "Rats" : 15\n ',"ER Diagram":'erDiagram\n CUSTOMER }|..|{ DELIVERY-ADDRESS : has\n CUSTOMER ||--o{ ORDER : places\n CUSTOMER ||--o{ INVOICE : "liable for"\n DELIVERY-ADDRESS ||--o{ ORDER : receives\n INVOICE ||--|{ ORDER : covers\n ORDER ||--|{ ORDER-ITEM : includes\n PRODUCT-CATEGORY ||--|{ PRODUCT : contains\n PRODUCT ||--o{ ORDER-ITEM : "ordered in"\n '};function a(e){pt(s[e])}return e.$set=e=>{"mermaidVersion"in e&&n(0,i=e.mermaidVersion),"params"in e&&n(1,o=e.params)},[i,o,r,s,a,(e,t)=>a(e),(e,t)=>pt(e.code)]}var bt=class extends ee{constructor(e){super(),Q(this,e,_t,gt,l,{mermaidVersion:0,params:1})}};n(898);function vt(e){let t,n;const r=new Ye({});return{c(){t=v("div"),Z(r.$$.fragment),k(t,"id","view-page"),k(t,"class","svelte-clxwlp")},m(e,i){m(e,t,i),J(r,t,null),n=!0},p:i,i(e){n||(K(r.$$.fragment,e),n=!0)},o(e){q(r.$$.fragment,e),n=!1},d(e){e&&_(t),X(r)}}}function yt(e){return N(async()=>{ga("send","pageview")}),[]}var wt=class extends ee{constructor(e){super(),Q(this,e,yt,vt,l,{})}};function Ct(e){let t,n,r;const o=new ue({props:{routes:e[0]}});return{c(){t=v("link"),n=w(),Z(o.$$.fragment),k(t,"href","https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"),k(t,"rel","stylesheet")},m(e,i){p(document.head,t),m(e,n,i),J(o,e,i),r=!0},p:i,i(e){r||(K(o.$$.fragment,e),r=!0)},o(e){q(o.$$.fragment,e),r=!1},d(e){_(t),e&&_(n),X(o,e)}}}function St(e){return[{"/":bt,"/edit/:data":bt,"/view/:data":wt,"*":bt}]}const kt=new class extends ee{constructor(e){super(),Q(this,e,St,Ct,l,{})}}({target:document.body,props:{}});window.app=kt;t.default=kt},function(e,t,n){"use strict";n(90),n(182),n(341),n(340),n(276),n(277),n(332),n(289),n(278),n(279),n(327),n(222),n(330),n(280),n(281),n(333),n(183),n(324),n(282),n(328);var i=n(24),r=n(3),o=n(54),s=n(26),a=n(110),l=n(209),c=n(28),d=n(20),u=n(38),h=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function f(e,t,n){return h(this,void 0,void 0,(function*(){const i=yield l.b.create(e,n),r=[];for(const e of i.children.values())e instanceof l.a?r.push(e.symbol):r.push(...u.a.map(e.children.values(),e=>e.symbol));let o=[];return n.isCancellationRequested?o:(t?function e(t,n,i){for(let r of n)t.push({kind:r.kind,tags:r.tags,name:r.name,detail:r.detail,containerName:r.containerName||i,range:r.range,selectionRange:r.selectionRange,children:void 0}),r.children&&e(t,r.children,r.name)}(o,r,""):o=r,o.sort(g))}))}function g(e,t){return r.a.compareRangesUsingStarts(e.range,t.range)}c.a.registerCommand("_executeDocumentSymbolProvider",(function(e,...t){return h(this,void 0,void 0,(function*(){const[n]=t;Object(d.b)(i.a.isUri(n));const r=e.get(o.a).getModel(n);if(r)return f(r,!1,s.a.None);const l=yield e.get(a.a).createModelReference(n);try{return yield f(l.object.textEditorModel,!1,s.a.None)}finally{l.dispose()}}))}));n(225),n(223),n(200),n(323),n(284),n(335),n(325),n(336),n(286),n(329),n(287),n(338),n(339),n(150),n(322);var p=n(0),m=n(4),_=n(167);class b extends m.b{constructor(){super({id:"editor.action.forceRetokenize",label:p.a("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const n=t.getModel();n.resetTokenization();const i=new _.a(!0);n.forceTokenization(n.getLineCount()),i.stop(),console.log(`tokenization took ${i.elapsed()}`)}}Object(m.k)(b);n(196),n(290),n(291),n(292),n(170),n(293),n(44),n(162)},function(e,t,n){"use strict";n(86);var i,r,o,s,a,l=n(197);!function(e){e[e.None=0]="None",e[e.CommonJS=1]="CommonJS",e[e.AMD=2]="AMD",e[e.UMD=3]="UMD",e[e.System=4]="System",e[e.ES2015=5]="ES2015",e[e.ESNext=99]="ESNext"}(i||(i={})),function(e){e[e.None=0]="None",e[e.Preserve=1]="Preserve",e[e.React=2]="React",e[e.ReactNative=3]="ReactNative"}(r||(r={})),function(e){e[e.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",e[e.LineFeed=1]="LineFeed"}(o||(o={})),function(e){e[e.ES3=0]="ES3",e[e.ES5=1]="ES5",e[e.ES2015=2]="ES2015",e[e.ES2016=3]="ES2016",e[e.ES2017=4]="ES2017",e[e.ES2018=5]="ES2018",e[e.ES2019=6]="ES2019",e[e.ES2020=7]="ES2020",e[e.ESNext=99]="ESNext",e[e.JSON=100]="JSON",e[e.Latest=99]="Latest"}(s||(s={})),function(e){e[e.Classic=1]="Classic",e[e.NodeJs=2]="NodeJs"}(a||(a={}));var c=function(){function e(e,t,n){this._onDidChange=new l.Emitter,this._onDidExtraLibsChange=new l.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(e),this.setDiagnosticsOptions(t),this.setWorkerOptions(n),this._onDidExtraLibsChangeTimeout=-1}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDidExtraLibsChange",{get:function(){return this._onDidExtraLibsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"workerOptions",{get:function(){return this._workerOptions},enumerable:!1,configurable:!0}),e.prototype.getExtraLibs=function(){return this._extraLibs},e.prototype.addExtraLib=function(e,t){var n,i=this;if(n=void 0===t?"ts:extralib-"+Math.random().toString(36).substring(2,15):t,this._extraLibs[n]&&this._extraLibs[n].content===e)return{dispose:function(){}};var r=1;return this._removedExtraLibs[n]&&(r=this._removedExtraLibs[n]+1),this._extraLibs[n]&&(r=this._extraLibs[n].version+1),this._extraLibs[n]={content:e,version:r},this._fireOnDidExtraLibsChangeSoon(),{dispose:function(){var e=i._extraLibs[n];e&&e.version===r&&(delete i._extraLibs[n],i._removedExtraLibs[n]=r,i._fireOnDidExtraLibsChangeSoon())}}},e.prototype.setExtraLibs=function(e){for(var t in this._extraLibs)this._removedExtraLibs[t]=this._extraLibs[t].version;if(this._extraLibs=Object.create(null),e&&e.length>0)for(var n=0,i=e;n a === b) { - if (one === other) { - return true; - } - if (!one || !other) { - return false; - } - if (one.length !== other.length) { - return false; - } - for (let i = 0, len = one.length; i < len; i++) { - if (!itemEquals(one[i], other[i])) { - return false; - } - } - return true; -} -function binarySearch(array, key, comparator) { - let low = 0, high = array.length - 1; - while (low <= high) { - const mid = ((low + high) / 2) | 0; - const comp = comparator(array[mid], key); - if (comp < 0) { - low = mid + 1; - } - else if (comp > 0) { - high = mid - 1; - } - else { - return mid; - } - } - return -(low + 1); -} -/** - * Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false - * are located before all elements where p(x) is true. - * @returns the least x for which p(x) is true or array.length if no element fullfills the given function. - */ -function findFirstInSorted(array, p) { - let low = 0, high = array.length; - if (high === 0) { - return 0; // no children - } - while (low < high) { - const mid = Math.floor((low + high) / 2); - if (p(array[mid])) { - high = mid; - } - else { - low = mid + 1; - } - } - return low; -} -/** - * Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort` - * so only use this when actually needing stable sort. - */ -function mergeSort(data, compare) { - _sort(data, compare, 0, data.length - 1, []); - return data; -} -function _merge(a, compare, lo, mid, hi, aux) { - let leftIdx = lo, rightIdx = mid + 1; - for (let i = lo; i <= hi; i++) { - aux[i] = a[i]; - } - for (let i = lo; i <= hi; i++) { - if (leftIdx > mid) { - // left side consumed - a[i] = aux[rightIdx++]; - } - else if (rightIdx > hi) { - // right side consumed - a[i] = aux[leftIdx++]; - } - else if (compare(aux[rightIdx], aux[leftIdx]) < 0) { - // right element is less -> comes first - a[i] = aux[rightIdx++]; - } - else { - // left element comes first (less or equal) - a[i] = aux[leftIdx++]; - } - } -} -function _sort(a, compare, lo, hi, aux) { - if (hi <= lo) { - return; - } - const mid = lo + ((hi - lo) / 2) | 0; - _sort(a, compare, lo, mid, aux); - _sort(a, compare, mid + 1, hi, aux); - if (compare(a[mid], a[mid + 1]) <= 0) { - // left and right are sorted and if the last-left element is less - // or equals than the first-right element there is nothing else - // to do - return; - } - _merge(a, compare, lo, mid, hi, aux); -} -function groupBy(data, compare) { - const result = []; - let currentGroup = undefined; - for (const element of mergeSort(data.slice(0), compare)) { - if (!currentGroup || compare(currentGroup[0], element) !== 0) { - currentGroup = [element]; - result.push(currentGroup); - } - else { - currentGroup.push(element); - } - } - return result; -} -/** - * @returns New array with all falsy values removed. The original array IS NOT modified. - */ -function coalesce(array) { - return array.filter(e => !!e); -} -/** - * @returns false if the provided object is an array and not empty. - */ -function isFalsyOrEmpty(obj) { - return !Array.isArray(obj) || obj.length === 0; -} -function isNonEmptyArray(obj) { - return Array.isArray(obj) && obj.length > 0; -} -/** - * Removes duplicates from the given array. The optional keyFn allows to specify - * how elements are checked for equalness by returning a unique string for each. - */ -function distinct(array, keyFn) { - if (!keyFn) { - return array.filter((element, position) => { - return array.indexOf(element) === position; - }); - } - const seen = Object.create(null); - return array.filter((elem) => { - const key = keyFn(elem); - if (seen[key]) { - return false; - } - seen[key] = true; - return true; - }); -} -function distinctES6(array) { - const seen = new Set(); - return array.filter(element => { - if (seen.has(element)) { - return false; - } - seen.add(element); - return true; - }); -} -/** - * @deprecated ES6: use `Array.findIndex` - */ -function firstIndex(array, fn) { - for (let i = 0; i < array.length; i++) { - const element = array[i]; - if (fn(element)) { - return i; - } - } - return -1; -} -function first(array, fn, notFoundValue = undefined) { - const index = firstIndex(array, fn); - return index < 0 ? notFoundValue : array[index]; -} -function firstOrDefault(array, notFoundValue) { - return array.length > 0 ? array[0] : notFoundValue; -} -function flatten(arr) { - return [].concat(...arr); -} -function range(arg, to) { - let from = typeof to === 'number' ? arg : 0; - if (typeof to === 'number') { - from = arg; - } - else { - from = 0; - to = arg; - } - const result = []; - if (from <= to) { - for (let i = from; i < to; i++) { - result.push(i); - } - } - else { - for (let i = from; i > to; i--) { - result.push(i); - } - } - return result; -} -/** - * Insert `insertArr` inside `target` at `insertIndex`. - * Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array - */ -function arrayInsert(target, insertIndex, insertArr) { - const before = target.slice(0, insertIndex); - const after = target.slice(insertIndex); - return before.concat(insertArr, after); -} -/** - * Pushes an element to the start of the array, if found. - */ -function pushToStart(arr, value) { - const index = arr.indexOf(value); - if (index > -1) { - arr.splice(index, 1); - arr.unshift(value); - } -} -/** - * Pushes an element to the end of the array, if found. - */ -function pushToEnd(arr, value) { - const index = arr.indexOf(value); - if (index > -1) { - arr.splice(index, 1); - arr.push(value); - } -} -function asArray(x) { - return Array.isArray(x) ? x : [x]; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js ***! - \***********************************************************************/ -/*! exports provided: CancellationToken, CancellationTokenSource */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationToken", function() { return CancellationToken; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationTokenSource", function() { return CancellationTokenSource; }); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const shortcutEvent = Object.freeze(function (callback, context) { - const handle = setTimeout(callback.bind(context), 0); - return { dispose() { clearTimeout(handle); } }; -}); -var CancellationToken; -(function (CancellationToken) { - function isCancellationToken(thing) { - if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { - return true; - } - if (thing instanceof MutableToken) { - return true; - } - if (!thing || typeof thing !== 'object') { - return false; - } - return typeof thing.isCancellationRequested === 'boolean' - && typeof thing.onCancellationRequested === 'function'; - } - CancellationToken.isCancellationToken = isCancellationToken; - CancellationToken.None = Object.freeze({ - isCancellationRequested: false, - onCancellationRequested: _event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].None - }); - CancellationToken.Cancelled = Object.freeze({ - isCancellationRequested: true, - onCancellationRequested: shortcutEvent - }); -})(CancellationToken || (CancellationToken = {})); -class MutableToken { - constructor() { - this._isCancelled = false; - this._emitter = null; - } - cancel() { - if (!this._isCancelled) { - this._isCancelled = true; - if (this._emitter) { - this._emitter.fire(undefined); - this.dispose(); - } - } - } - get isCancellationRequested() { - return this._isCancelled; - } - get onCancellationRequested() { - if (this._isCancelled) { - return shortcutEvent; - } - if (!this._emitter) { - this._emitter = new _event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - } - return this._emitter.event; - } - dispose() { - if (this._emitter) { - this._emitter.dispose(); - this._emitter = null; - } - } -} -class CancellationTokenSource { - constructor(parent) { - this._token = undefined; - this._parentListener = undefined; - this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); - } - get token() { - if (!this._token) { - // be lazy and create the token only when - // actually needed - this._token = new MutableToken(); - } - return this._token; - } - cancel() { - if (!this._token) { - // save an object by returning the default - // cancelled token when cancellation happens - // before someone asks for the token - this._token = CancellationToken.Cancelled; - } - else if (this._token instanceof MutableToken) { - // actually cancel - this._token.cancel(); - } - } - dispose(cancel = false) { - if (cancel) { - this.cancel(); - } - if (this._parentListener) { - this._parentListener.dispose(); - } - if (!this._token) { - // ensure to initialize with an empty token if we had none - this._token = CancellationToken.None; - } - else if (this._token instanceof MutableToken) { - // actually dispose - this._token.dispose(); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js ***! - \********************************************************************/ -/*! exports provided: StringDiffSequence, stringDiff, Debug, MyArray, LcsDiff */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringDiffSequence", function() { return StringDiffSequence; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringDiff", function() { return stringDiff; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Debug", function() { return Debug; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MyArray", function() { return MyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LcsDiff", function() { return LcsDiff; }); -/* harmony import */ var _diffChange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diffChange.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js"); -/* harmony import */ var _hash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../hash.js */ "./node_modules/monaco-editor/esm/vs/base/common/hash.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class StringDiffSequence { - constructor(source) { - this.source = source; - } - getElements() { - const source = this.source; - const characters = new Int32Array(source.length); - for (let i = 0, len = source.length; i < len; i++) { - characters[i] = source.charCodeAt(i); - } - return characters; - } -} -function stringDiff(original, modified, pretty) { - return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes; -} -// -// The code below has been ported from a C# implementation in VS -// -class Debug { - static Assert(condition, message) { - if (!condition) { - throw new Error(message); - } - } -} -class MyArray { - /** - * Copies a range of elements from an Array starting at the specified source index and pastes - * them to another Array starting at the specified destination index. The length and the indexes - * are specified as 64-bit integers. - * sourceArray: - * The Array that contains the data to copy. - * sourceIndex: - * A 64-bit integer that represents the index in the sourceArray at which copying begins. - * destinationArray: - * The Array that receives the data. - * destinationIndex: - * A 64-bit integer that represents the index in the destinationArray at which storing begins. - * length: - * A 64-bit integer that represents the number of elements to copy. - */ - static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) { - for (let i = 0; i < length; i++) { - destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; - } - } - static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) { - for (let i = 0; i < length; i++) { - destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; - } - } -} -/** - * A utility class which helps to create the set of DiffChanges from - * a difference operation. This class accepts original DiffElements and - * modified DiffElements that are involved in a particular change. The - * MarktNextChange() method can be called to mark the separation between - * distinct changes. At the end, the Changes property can be called to retrieve - * the constructed changes. - */ -class DiffChangeHelper { - /** - * Constructs a new DiffChangeHelper for the given DiffSequences. - */ - constructor() { - this.m_changes = []; - this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - this.m_originalCount = 0; - this.m_modifiedCount = 0; - } - /** - * Marks the beginning of the next change in the set of differences. - */ - MarkNextChange() { - // Only add to the list if there is something to add - if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { - // Add the new change to our list - this.m_changes.push(new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); - } - // Reset for the next change - this.m_originalCount = 0; - this.m_modifiedCount = 0; - this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - } - /** - * Adds the original element at the given position to the elements - * affected by the current change. The modified index gives context - * to the change position with respect to the original sequence. - * @param originalIndex The index of the original element to add. - * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence. - */ - AddOriginalElement(originalIndex, modifiedIndex) { - // The 'true' start index is the smallest of the ones we've seen - this.m_originalStart = Math.min(this.m_originalStart, originalIndex); - this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex); - this.m_originalCount++; - } - /** - * Adds the modified element at the given position to the elements - * affected by the current change. The original index gives context - * to the change position with respect to the modified sequence. - * @param originalIndex The index of the original element that provides corresponding position in the original sequence. - * @param modifiedIndex The index of the modified element to add. - */ - AddModifiedElement(originalIndex, modifiedIndex) { - // The 'true' start index is the smallest of the ones we've seen - this.m_originalStart = Math.min(this.m_originalStart, originalIndex); - this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex); - this.m_modifiedCount++; - } - /** - * Retrieves all of the changes marked by the class. - */ - getChanges() { - if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { - // Finish up on whatever is left - this.MarkNextChange(); - } - return this.m_changes; - } - /** - * Retrieves all of the changes marked by the class in the reverse order - */ - getReverseChanges() { - if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { - // Finish up on whatever is left - this.MarkNextChange(); - } - this.m_changes.reverse(); - return this.m_changes; - } -} -/** - * An implementation of the difference algorithm described in - * "An O(ND) Difference Algorithm and its variations" by Eugene W. Myers - */ -class LcsDiff { - /** - * Constructs the DiffFinder - */ - constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) { - this.ContinueProcessingPredicate = continueProcessingPredicate; - const [originalStringElements, originalElementsOrHash, originalHasStrings] = LcsDiff._getElements(originalSequence); - const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = LcsDiff._getElements(modifiedSequence); - this._hasStrings = (originalHasStrings && modifiedHasStrings); - this._originalStringElements = originalStringElements; - this._originalElementsOrHash = originalElementsOrHash; - this._modifiedStringElements = modifiedStringElements; - this._modifiedElementsOrHash = modifiedElementsOrHash; - this.m_forwardHistory = []; - this.m_reverseHistory = []; - } - static _isStringArray(arr) { - return (arr.length > 0 && typeof arr[0] === 'string'); - } - static _getElements(sequence) { - const elements = sequence.getElements(); - if (LcsDiff._isStringArray(elements)) { - const hashes = new Int32Array(elements.length); - for (let i = 0, len = elements.length; i < len; i++) { - hashes[i] = Object(_hash_js__WEBPACK_IMPORTED_MODULE_1__["stringHash"])(elements[i], 0); - } - return [elements, hashes, true]; - } - if (elements instanceof Int32Array) { - return [[], elements, false]; - } - return [[], new Int32Array(elements), false]; - } - ElementsAreEqual(originalIndex, newIndex) { - if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) { - return false; - } - return (this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true); - } - OriginalElementsAreEqual(index1, index2) { - if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) { - return false; - } - return (this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true); - } - ModifiedElementsAreEqual(index1, index2) { - if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) { - return false; - } - return (this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true); - } - ComputeDiff(pretty) { - return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty); - } - /** - * Computes the differences between the original and modified input - * sequences on the bounded range. - * @returns An array of the differences between the two input sequences. - */ - _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) { - const quitEarlyArr = [false]; - let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr); - if (pretty) { - // We have to clean up the computed diff to be more intuitive - // but it turns out this cannot be done correctly until the entire set - // of diffs have been computed - changes = this.PrettifyChanges(changes); - } - return { - quitEarly: quitEarlyArr[0], - changes: changes - }; - } - /** - * Private helper method which computes the differences on the bounded range - * recursively. - * @returns An array of the differences between the two input sequences. - */ - ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) { - quitEarlyArr[0] = false; - // Find the start of the differences - while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) { - originalStart++; - modifiedStart++; - } - // Find the end of the differences - while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) { - originalEnd--; - modifiedEnd--; - } - // In the special case where we either have all insertions or all deletions or the sequences are identical - if (originalStart > originalEnd || modifiedStart > modifiedEnd) { - let changes; - if (modifiedStart <= modifiedEnd) { - Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); - // All insertions - changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) - ]; - } - else if (originalStart <= originalEnd) { - Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); - // All deletions - changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, 0) - ]; - } - else { - Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); - Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); - // Identical sequences - No differences - changes = []; - } - return changes; - } - // This problem can be solved using the Divide-And-Conquer technique. - const midOriginalArr = [0]; - const midModifiedArr = [0]; - const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr); - const midOriginal = midOriginalArr[0]; - const midModified = midModifiedArr[0]; - if (result !== null) { - // Result is not-null when there was enough memory to compute the changes while - // searching for the recursion point - return result; - } - else if (!quitEarlyArr[0]) { - // We can break the problem down recursively by finding the changes in the - // First Half: (originalStart, modifiedStart) to (midOriginal, midModified) - // Second Half: (midOriginal + 1, minModified + 1) to (originalEnd, modifiedEnd) - // NOTE: ComputeDiff() is inclusive, therefore the second range starts on the next point - const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr); - let rightChanges = []; - if (!quitEarlyArr[0]) { - rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr); - } - else { - // We did't have time to finish the first half, so we don't have time to compute this half. - // Consider the entire rest of the sequence different. - rightChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) - ]; - } - return this.ConcatenateChanges(leftChanges, rightChanges); - } - // If we hit here, we quit early, and so can't return anything meaningful - return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) - ]; - } - WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) { - let forwardChanges = null; - let reverseChanges = null; - // First, walk backward through the forward diagonals history - let changeHelper = new DiffChangeHelper(); - let diagonalMin = diagonalForwardStart; - let diagonalMax = diagonalForwardEnd; - let diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset; - let lastOriginalIndex = -1073741824 /* MIN_SAFE_SMALL_INTEGER */; - let historyIndex = this.m_forwardHistory.length - 1; - do { - // Get the diagonal index from the relative diagonal number - const diagonal = diagonalRelative + diagonalForwardBase; - // Figure out where we came from - if (diagonal === diagonalMin || (diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) { - // Vertical line (the element is an insert) - originalIndex = forwardPoints[diagonal + 1]; - modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset; - if (originalIndex < lastOriginalIndex) { - changeHelper.MarkNextChange(); - } - lastOriginalIndex = originalIndex; - changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex); - diagonalRelative = (diagonal + 1) - diagonalForwardBase; //Setup for the next iteration - } - else { - // Horizontal line (the element is a deletion) - originalIndex = forwardPoints[diagonal - 1] + 1; - modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset; - if (originalIndex < lastOriginalIndex) { - changeHelper.MarkNextChange(); - } - lastOriginalIndex = originalIndex - 1; - changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1); - diagonalRelative = (diagonal - 1) - diagonalForwardBase; //Setup for the next iteration - } - if (historyIndex >= 0) { - forwardPoints = this.m_forwardHistory[historyIndex]; - diagonalForwardBase = forwardPoints[0]; //We stored this in the first spot - diagonalMin = 1; - diagonalMax = forwardPoints.length - 1; - } - } while (--historyIndex >= -1); - // Ironically, we get the forward changes as the reverse of the - // order we added them since we technically added them backwards - forwardChanges = changeHelper.getReverseChanges(); - if (quitEarlyArr[0]) { - // TODO: Calculate a partial from the reverse diagonals. - // For now, just assume everything after the midOriginal/midModified point is a diff - let originalStartPoint = midOriginalArr[0] + 1; - let modifiedStartPoint = midModifiedArr[0] + 1; - if (forwardChanges !== null && forwardChanges.length > 0) { - const lastForwardChange = forwardChanges[forwardChanges.length - 1]; - originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd()); - modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd()); - } - reverseChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) - ]; - } - else { - // Now walk backward through the reverse diagonals history - changeHelper = new DiffChangeHelper(); - diagonalMin = diagonalReverseStart; - diagonalMax = diagonalReverseEnd; - diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset; - lastOriginalIndex = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - historyIndex = (deltaIsEven) ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2; - do { - // Get the diagonal index from the relative diagonal number - const diagonal = diagonalRelative + diagonalReverseBase; - // Figure out where we came from - if (diagonal === diagonalMin || (diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) { - // Horizontal line (the element is a deletion)) - originalIndex = reversePoints[diagonal + 1] - 1; - modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset; - if (originalIndex > lastOriginalIndex) { - changeHelper.MarkNextChange(); - } - lastOriginalIndex = originalIndex + 1; - changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1); - diagonalRelative = (diagonal + 1) - diagonalReverseBase; //Setup for the next iteration - } - else { - // Vertical line (the element is an insertion) - originalIndex = reversePoints[diagonal - 1]; - modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset; - if (originalIndex > lastOriginalIndex) { - changeHelper.MarkNextChange(); - } - lastOriginalIndex = originalIndex; - changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1); - diagonalRelative = (diagonal - 1) - diagonalReverseBase; //Setup for the next iteration - } - if (historyIndex >= 0) { - reversePoints = this.m_reverseHistory[historyIndex]; - diagonalReverseBase = reversePoints[0]; //We stored this in the first spot - diagonalMin = 1; - diagonalMax = reversePoints.length - 1; - } - } while (--historyIndex >= -1); - // There are cases where the reverse history will find diffs that - // are correct, but not intuitive, so we need shift them. - reverseChanges = changeHelper.getChanges(); - } - return this.ConcatenateChanges(forwardChanges, reverseChanges); - } - /** - * Given the range to compute the diff on, this method finds the point: - * (midOriginal, midModified) - * that exists in the middle of the LCS of the two sequences and - * is the point at which the LCS problem may be broken down recursively. - * This method will try to keep the LCS trace in memory. If the LCS recursion - * point is calculated and the full trace is available in memory, then this method - * will return the change list. - * @param originalStart The start bound of the original sequence range - * @param originalEnd The end bound of the original sequence range - * @param modifiedStart The start bound of the modified sequence range - * @param modifiedEnd The end bound of the modified sequence range - * @param midOriginal The middle point of the original sequence range - * @param midModified The middle point of the modified sequence range - * @returns The diff changes, if available, otherwise null - */ - ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) { - let originalIndex = 0, modifiedIndex = 0; - let diagonalForwardStart = 0, diagonalForwardEnd = 0; - let diagonalReverseStart = 0, diagonalReverseEnd = 0; - // To traverse the edit graph and produce the proper LCS, our actual - // start position is just outside the given boundary - originalStart--; - modifiedStart--; - // We set these up to make the compiler happy, but they will - // be replaced before we return with the actual recursion point - midOriginalArr[0] = 0; - midModifiedArr[0] = 0; - // Clear out the history - this.m_forwardHistory = []; - this.m_reverseHistory = []; - // Each cell in the two arrays corresponds to a diagonal in the edit graph. - // The integer value in the cell represents the originalIndex of the furthest - // reaching point found so far that ends in that diagonal. - // The modifiedIndex can be computed mathematically from the originalIndex and the diagonal number. - const maxDifferences = (originalEnd - originalStart) + (modifiedEnd - modifiedStart); - const numDiagonals = maxDifferences + 1; - const forwardPoints = new Int32Array(numDiagonals); - const reversePoints = new Int32Array(numDiagonals); - // diagonalForwardBase: Index into forwardPoints of the diagonal which passes through (originalStart, modifiedStart) - // diagonalReverseBase: Index into reversePoints of the diagonal which passes through (originalEnd, modifiedEnd) - const diagonalForwardBase = (modifiedEnd - modifiedStart); - const diagonalReverseBase = (originalEnd - originalStart); - // diagonalForwardOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the - // diagonal number (relative to diagonalForwardBase) - // diagonalReverseOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the - // diagonal number (relative to diagonalReverseBase) - const diagonalForwardOffset = (originalStart - modifiedStart); - const diagonalReverseOffset = (originalEnd - modifiedEnd); - // delta: The difference between the end diagonal and the start diagonal. This is used to relate diagonal numbers - // relative to the start diagonal with diagonal numbers relative to the end diagonal. - // The Even/Oddn-ness of this delta is important for determining when we should check for overlap - const delta = diagonalReverseBase - diagonalForwardBase; - const deltaIsEven = (delta % 2 === 0); - // Here we set up the start and end points as the furthest points found so far - // in both the forward and reverse directions, respectively - forwardPoints[diagonalForwardBase] = originalStart; - reversePoints[diagonalReverseBase] = originalEnd; - // Remember if we quit early, and thus need to do a best-effort result instead of a real result. - quitEarlyArr[0] = false; - // A couple of points: - // --With this method, we iterate on the number of differences between the two sequences. - // The more differences there actually are, the longer this will take. - // --Also, as the number of differences increases, we have to search on diagonals further - // away from the reference diagonal (which is diagonalForwardBase for forward, diagonalReverseBase for reverse). - // --We extend on even diagonals (relative to the reference diagonal) only when numDifferences - // is even and odd diagonals only when numDifferences is odd. - for (let numDifferences = 1; numDifferences <= (maxDifferences / 2) + 1; numDifferences++) { - let furthestOriginalIndex = 0; - let furthestModifiedIndex = 0; - // Run the algorithm in the forward direction - diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals); - diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals); - for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) { - // STEP 1: We extend the furthest reaching point in the present diagonal - // by looking at the diagonals above and below and picking the one whose point - // is further away from the start point (originalStart, modifiedStart) - if (diagonal === diagonalForwardStart || (diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) { - originalIndex = forwardPoints[diagonal + 1]; - } - else { - originalIndex = forwardPoints[diagonal - 1] + 1; - } - modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset; - // Save the current originalIndex so we can test for false overlap in step 3 - const tempOriginalIndex = originalIndex; - // STEP 2: We can continue to extend the furthest reaching point in the present diagonal - // so long as the elements are equal. - while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) { - originalIndex++; - modifiedIndex++; - } - forwardPoints[diagonal] = originalIndex; - if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) { - furthestOriginalIndex = originalIndex; - furthestModifiedIndex = modifiedIndex; - } - // STEP 3: If delta is odd (overlap first happens on forward when delta is odd) - // and diagonal is in the range of reverse diagonals computed for numDifferences-1 - // (the previous iteration; we haven't computed reverse diagonals for numDifferences yet) - // then check for overlap. - if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= (numDifferences - 1)) { - if (originalIndex >= reversePoints[diagonal]) { - midOriginalArr[0] = originalIndex; - midModifiedArr[0] = modifiedIndex; - if (tempOriginalIndex <= reversePoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) { - // BINGO! We overlapped, and we have the full trace in memory! - return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); - } - else { - // Either false overlap, or we didn't have enough memory for the full trace - // Just return the recursion point - return null; - } - } - } - } - // Check to see if we should be quitting early, before moving on to the next iteration. - const matchLengthOfLongest = ((furthestOriginalIndex - originalStart) + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2; - if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) { - // We can't finish, so skip ahead to generating a result from what we have. - quitEarlyArr[0] = true; - // Use the furthest distance we got in the forward direction. - midOriginalArr[0] = furthestOriginalIndex; - midModifiedArr[0] = furthestModifiedIndex; - if (matchLengthOfLongest > 0 && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) { - // Enough of the history is in memory to walk it backwards - return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); - } - else { - // We didn't actually remember enough of the history. - //Since we are quiting the diff early, we need to shift back the originalStart and modified start - //back into the boundary limits since we decremented their value above beyond the boundary limit. - originalStart++; - modifiedStart++; - return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) - ]; - } - } - // Run the algorithm in the reverse direction - diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals); - diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals); - for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) { - // STEP 1: We extend the furthest reaching point in the present diagonal - // by looking at the diagonals above and below and picking the one whose point - // is further away from the start point (originalEnd, modifiedEnd) - if (diagonal === diagonalReverseStart || (diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) { - originalIndex = reversePoints[diagonal + 1] - 1; - } - else { - originalIndex = reversePoints[diagonal - 1]; - } - modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset; - // Save the current originalIndex so we can test for false overlap - const tempOriginalIndex = originalIndex; - // STEP 2: We can continue to extend the furthest reaching point in the present diagonal - // as long as the elements are equal. - while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) { - originalIndex--; - modifiedIndex--; - } - reversePoints[diagonal] = originalIndex; - // STEP 4: If delta is even (overlap first happens on reverse when delta is even) - // and diagonal is in the range of forward diagonals computed for numDifferences - // then check for overlap. - if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) { - if (originalIndex <= forwardPoints[diagonal]) { - midOriginalArr[0] = originalIndex; - midModifiedArr[0] = modifiedIndex; - if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) { - // BINGO! We overlapped, and we have the full trace in memory! - return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); - } - else { - // Either false overlap, or we didn't have enough memory for the full trace - // Just return the recursion point - return null; - } - } - } - } - // Save current vectors to history before the next iteration - if (numDifferences <= 1447 /* MaxDifferencesHistory */) { - // We are allocating space for one extra int, which we fill with - // the index of the diagonal base index - let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2); - temp[0] = diagonalForwardBase - diagonalForwardStart + 1; - MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1); - this.m_forwardHistory.push(temp); - temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2); - temp[0] = diagonalReverseBase - diagonalReverseStart + 1; - MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1); - this.m_reverseHistory.push(temp); - } - } - // If we got here, then we have the full trace in history. We just have to convert it to a change list - // NOTE: This part is a bit messy - return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); - } - /** - * Shifts the given changes to provide a more intuitive diff. - * While the first element in a diff matches the first element after the diff, - * we shift the diff down. - * - * @param changes The list of changes to shift - * @returns The shifted changes - */ - PrettifyChanges(changes) { - // Shift all the changes down first - for (let i = 0; i < changes.length; i++) { - const change = changes[i]; - const originalStop = (i < changes.length - 1) ? changes[i + 1].originalStart : this._originalElementsOrHash.length; - const modifiedStop = (i < changes.length - 1) ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length; - const checkOriginal = change.originalLength > 0; - const checkModified = change.modifiedLength > 0; - while (change.originalStart + change.originalLength < originalStop && - change.modifiedStart + change.modifiedLength < modifiedStop && - (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) && - (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) { - change.originalStart++; - change.modifiedStart++; - } - let mergedChangeArr = [null]; - if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) { - changes[i] = mergedChangeArr[0]; - changes.splice(i + 1, 1); - i--; - continue; - } - } - // Shift changes back up until we hit empty or whitespace-only lines - for (let i = changes.length - 1; i >= 0; i--) { - const change = changes[i]; - let originalStop = 0; - let modifiedStop = 0; - if (i > 0) { - const prevChange = changes[i - 1]; - if (prevChange.originalLength > 0) { - originalStop = prevChange.originalStart + prevChange.originalLength; - } - if (prevChange.modifiedLength > 0) { - modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength; - } - } - const checkOriginal = change.originalLength > 0; - const checkModified = change.modifiedLength > 0; - let bestDelta = 0; - let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength); - for (let delta = 1;; delta++) { - const originalStart = change.originalStart - delta; - const modifiedStart = change.modifiedStart - delta; - if (originalStart < originalStop || modifiedStart < modifiedStop) { - break; - } - if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) { - break; - } - if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) { - break; - } - const score = this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength); - if (score > bestScore) { - bestScore = score; - bestDelta = delta; - } - } - change.originalStart -= bestDelta; - change.modifiedStart -= bestDelta; - } - return changes; - } - _OriginalIsBoundary(index) { - if (index <= 0 || index >= this._originalElementsOrHash.length - 1) { - return true; - } - return (this._hasStrings && /^\s*$/.test(this._originalStringElements[index])); - } - _OriginalRegionIsBoundary(originalStart, originalLength) { - if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) { - return true; - } - if (originalLength > 0) { - const originalEnd = originalStart + originalLength; - if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) { - return true; - } - } - return false; - } - _ModifiedIsBoundary(index) { - if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) { - return true; - } - return (this._hasStrings && /^\s*$/.test(this._modifiedStringElements[index])); - } - _ModifiedRegionIsBoundary(modifiedStart, modifiedLength) { - if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) { - return true; - } - if (modifiedLength > 0) { - const modifiedEnd = modifiedStart + modifiedLength; - if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) { - return true; - } - } - return false; - } - _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) { - const originalScore = (this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0); - const modifiedScore = (this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0); - return (originalScore + modifiedScore); - } - /** - * Concatenates the two input DiffChange lists and returns the resulting - * list. - * @param The left changes - * @param The right changes - * @returns The concatenated list - */ - ConcatenateChanges(left, right) { - let mergedChangeArr = []; - if (left.length === 0 || right.length === 0) { - return (right.length > 0) ? right : left; - } - else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) { - // Since we break the problem down recursively, it is possible that we - // might recurse in the middle of a change thereby splitting it into - // two changes. Here in the combining stage, we detect and fuse those - // changes back together - const result = new Array(left.length + right.length - 1); - MyArray.Copy(left, 0, result, 0, left.length - 1); - result[left.length - 1] = mergedChangeArr[0]; - MyArray.Copy(right, 1, result, left.length, right.length - 1); - return result; - } - else { - const result = new Array(left.length + right.length); - MyArray.Copy(left, 0, result, 0, left.length); - MyArray.Copy(right, 0, result, left.length, right.length); - return result; - } - } - /** - * Returns true if the two changes overlap and can be merged into a single - * change - * @param left The left change - * @param right The right change - * @param mergedChange The merged change if the two overlap, null otherwise - * @returns True if the two changes overlap - */ - ChangesOverlap(left, right, mergedChangeArr) { - Debug.Assert(left.originalStart <= right.originalStart, 'Left change is not less than or equal to right change'); - Debug.Assert(left.modifiedStart <= right.modifiedStart, 'Left change is not less than or equal to right change'); - if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) { - const originalStart = left.originalStart; - let originalLength = left.originalLength; - const modifiedStart = left.modifiedStart; - let modifiedLength = left.modifiedLength; - if (left.originalStart + left.originalLength >= right.originalStart) { - originalLength = right.originalStart + right.originalLength - left.originalStart; - } - if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) { - modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart; - } - mergedChangeArr[0] = new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalLength, modifiedStart, modifiedLength); - return true; - } - else { - mergedChangeArr[0] = null; - return false; - } - } - /** - * Helper method used to clip a diagonal index to the range of valid - * diagonals. This also decides whether or not the diagonal index, - * if it exceeds the boundary, should be clipped to the boundary or clipped - * one inside the boundary depending on the Even/Odd status of the boundary - * and numDifferences. - * @param diagonal The index of the diagonal to clip. - * @param numDifferences The current number of differences being iterated upon. - * @param diagonalBaseIndex The base reference diagonal. - * @param numDiagonals The total number of diagonals. - * @returns The clipped diagonal index. - */ - ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) { - if (diagonal >= 0 && diagonal < numDiagonals) { - // Nothing to clip, its in range - return diagonal; - } - // diagonalsBelow: The number of diagonals below the reference diagonal - // diagonalsAbove: The number of diagonals above the reference diagonal - const diagonalsBelow = diagonalBaseIndex; - const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1; - const diffEven = (numDifferences % 2 === 0); - if (diagonal < 0) { - const lowerBoundEven = (diagonalsBelow % 2 === 0); - return (diffEven === lowerBoundEven) ? 0 : 1; - } - else { - const upperBoundEven = (diagonalsAbove % 2 === 0); - return (diffEven === upperBoundEven) ? numDiagonals - 1 : numDiagonals - 2; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js ***! - \**************************************************************************/ -/*! exports provided: DiffChange */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffChange", function() { return DiffChange; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * Represents information about a specific difference between two sequences. - */ -class DiffChange { - /** - * Constructs a new DiffChange with the given sequence information - * and content. - */ - constructor(originalStart, originalLength, modifiedStart, modifiedLength) { - //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); - this.originalStart = originalStart; - this.originalLength = originalLength; - this.modifiedStart = modifiedStart; - this.modifiedLength = modifiedLength; - } - /** - * The end point (exclusive) of the change in the original sequence. - */ - getOriginalEnd() { - return this.originalStart + this.originalLength; - } - /** - * The end point (exclusive) of the change in the modified sequence. - */ - getModifiedEnd() { - return this.modifiedStart + this.modifiedLength; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/errors.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/errors.js ***! - \*****************************************************************/ -/*! exports provided: ErrorHandler, errorHandler, onUnexpectedError, onUnexpectedExternalError, transformErrorForSerialization, isPromiseCanceledError, canceled, illegalArgument, illegalState */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "errorHandler", function() { return errorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedError", function() { return onUnexpectedError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedExternalError", function() { return onUnexpectedExternalError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformErrorForSerialization", function() { return transformErrorForSerialization; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromiseCanceledError", function() { return isPromiseCanceledError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canceled", function() { return canceled; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalArgument", function() { return illegalArgument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalState", function() { return illegalState; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// Avoid circular dependency on EventEmitter by implementing a subset of the interface. -class ErrorHandler { - constructor() { - this.listeners = []; - this.unexpectedErrorHandler = function (e) { - setTimeout(() => { - if (e.stack) { - throw new Error(e.message + '\n\n' + e.stack); - } - throw e; - }, 0); - }; - } - emit(e) { - this.listeners.forEach((listener) => { - listener(e); - }); - } - onUnexpectedError(e) { - this.unexpectedErrorHandler(e); - this.emit(e); - } - // For external errors, we don't want the listeners to be called - onUnexpectedExternalError(e) { - this.unexpectedErrorHandler(e); - } -} -const errorHandler = new ErrorHandler(); -function onUnexpectedError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedError(e); - } - return undefined; -} -function onUnexpectedExternalError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedExternalError(e); - } - return undefined; -} -function transformErrorForSerialization(error) { - if (error instanceof Error) { - let { name, message } = error; - const stack = error.stacktrace || error.stack; - return { - $isError: true, - name, - message, - stack - }; - } - // return as is - return error; -} -const canceledName = 'Canceled'; -/** - * Checks if the given error is a promise in canceled state - */ -function isPromiseCanceledError(error) { - return error instanceof Error && error.name === canceledName && error.message === canceledName; -} -/** - * Returns an error that signals cancellation. - */ -function canceled() { - const error = new Error(canceledName); - error.name = error.message; - return error; -} -function illegalArgument(name) { - if (name) { - return new Error(`Illegal argument: ${name}`); - } - else { - return new Error('Illegal argument'); - } -} -function illegalState(name) { - if (name) { - return new Error(`Illegal state: ${name}`); - } - else { - return new Error('Illegal state'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/event.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/event.js ***! - \****************************************************************/ -/*! exports provided: Event, Emitter, PauseableEmitter, EventBufferer, Relay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return Event; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Emitter", function() { return Emitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PauseableEmitter", function() { return PauseableEmitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventBufferer", function() { return EventBufferer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Relay", function() { return Relay; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _linkedList_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -var Event; -(function (Event) { - Event.None = () => _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - /** - * Given an event, returns another event which only fires once. - */ - function once(event) { - return (listener, thisArgs = null, disposables) => { - // we need this, in case the event fires during the listener call - let didFire = false; - let result; - result = event(e => { - if (didFire) { - return; - } - else if (result) { - result.dispose(); - } - else { - didFire = true; - } - return listener.call(thisArgs, e); - }, null, disposables); - if (didFire) { - result.dispose(); - } - return result; - }; - } - Event.once = once; - /** - * Given an event and a `map` function, returns another event which maps each element - * through the mapping function. - */ - function map(event, map) { - return snapshot((listener, thisArgs = null, disposables) => event(i => listener.call(thisArgs, map(i)), null, disposables)); - } - Event.map = map; - /** - * Given an event and an `each` function, returns another identical event and calls - * the `each` function per each element. - */ - function forEach(event, each) { - return snapshot((listener, thisArgs = null, disposables) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables)); - } - Event.forEach = forEach; - function filter(event, filter) { - return snapshot((listener, thisArgs = null, disposables) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables)); - } - Event.filter = filter; - /** - * Given an event, returns the same event but typed as `Event`. - */ - function signal(event) { - return event; - } - Event.signal = signal; - function any(...events) { - return (listener, thisArgs = null, disposables) => Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["combinedDisposable"])(...events.map(event => event(e => listener.call(thisArgs, e), null, disposables))); - } - Event.any = any; - /** - * Given an event and a `merge` function, returns another event which maps each element - * and the cumulative result through the `merge` function. Similar to `map`, but with memory. - */ - function reduce(event, merge, initial) { - let output = initial; - return map(event, e => { - output = merge(output, e); - return output; - }); - } - Event.reduce = reduce; - /** - * Given a chain of event processing functions (filter, map, etc), each - * function will be invoked per event & per listener. Snapshotting an event - * chain allows each function to be invoked just once per event. - */ - function snapshot(event) { - let listener; - const emitter = new Emitter({ - onFirstListenerAdd() { - listener = event(emitter.fire, emitter); - }, - onLastListenerRemove() { - listener.dispose(); - } - }); - return emitter.event; - } - Event.snapshot = snapshot; - function debounce(event, merge, delay = 100, leading = false, leakWarningThreshold) { - let subscription; - let output = undefined; - let handle = undefined; - let numDebouncedCalls = 0; - const emitter = new Emitter({ - leakWarningThreshold, - onFirstListenerAdd() { - subscription = event(cur => { - numDebouncedCalls++; - output = merge(output, cur); - if (leading && !handle) { - emitter.fire(output); - output = undefined; - } - clearTimeout(handle); - handle = setTimeout(() => { - const _output = output; - output = undefined; - handle = undefined; - if (!leading || numDebouncedCalls > 1) { - emitter.fire(_output); - } - numDebouncedCalls = 0; - }, delay); - }); - }, - onLastListenerRemove() { - subscription.dispose(); - } - }); - return emitter.event; - } - Event.debounce = debounce; - /** - * Given an event, it returns another event which fires only once and as soon as - * the input event emits. The event data is the number of millis it took for the - * event to fire. - */ - function stopwatch(event) { - const start = new Date().getTime(); - return map(once(event), _ => new Date().getTime() - start); - } - Event.stopwatch = stopwatch; - /** - * Given an event, it returns another event which fires only when the event - * element changes. - */ - function latch(event) { - let firstCall = true; - let cache; - return filter(event, value => { - const shouldEmit = firstCall || value !== cache; - firstCall = false; - cache = value; - return shouldEmit; - }); - } - Event.latch = latch; - /** - * Buffers the provided event until a first listener comes - * along, at which point fire all the events at once and - * pipe the event from then on. - * - * ```typescript - * const emitter = new Emitter(); - * const event = emitter.event; - * const bufferedEvent = buffer(event); - * - * emitter.fire(1); - * emitter.fire(2); - * emitter.fire(3); - * // nothing... - * - * const listener = bufferedEvent(num => console.log(num)); - * // 1, 2, 3 - * - * emitter.fire(4); - * // 4 - * ``` - */ - function buffer(event, nextTick = false, _buffer = []) { - let buffer = _buffer.slice(); - let listener = event(e => { - if (buffer) { - buffer.push(e); - } - else { - emitter.fire(e); - } - }); - const flush = () => { - if (buffer) { - buffer.forEach(e => emitter.fire(e)); - } - buffer = null; - }; - const emitter = new Emitter({ - onFirstListenerAdd() { - if (!listener) { - listener = event(e => emitter.fire(e)); - } - }, - onFirstListenerDidAdd() { - if (buffer) { - if (nextTick) { - setTimeout(flush); - } - else { - flush(); - } - } - }, - onLastListenerRemove() { - if (listener) { - listener.dispose(); - } - listener = null; - } - }); - return emitter.event; - } - Event.buffer = buffer; - class ChainableEvent { - constructor(event) { - this.event = event; - } - map(fn) { - return new ChainableEvent(map(this.event, fn)); - } - forEach(fn) { - return new ChainableEvent(forEach(this.event, fn)); - } - filter(fn) { - return new ChainableEvent(filter(this.event, fn)); - } - reduce(merge, initial) { - return new ChainableEvent(reduce(this.event, merge, initial)); - } - latch() { - return new ChainableEvent(latch(this.event)); - } - debounce(merge, delay = 100, leading = false, leakWarningThreshold) { - return new ChainableEvent(debounce(this.event, merge, delay, leading, leakWarningThreshold)); - } - on(listener, thisArgs, disposables) { - return this.event(listener, thisArgs, disposables); - } - once(listener, thisArgs, disposables) { - return once(this.event)(listener, thisArgs, disposables); - } - } - function chain(event) { - return new ChainableEvent(event); - } - Event.chain = chain; - function fromNodeEventEmitter(emitter, eventName, map = id => id) { - const fn = (...args) => result.fire(map(...args)); - const onFirstListenerAdd = () => emitter.on(eventName, fn); - const onLastListenerRemove = () => emitter.removeListener(eventName, fn); - const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove }); - return result.event; - } - Event.fromNodeEventEmitter = fromNodeEventEmitter; - function fromDOMEventEmitter(emitter, eventName, map = id => id) { - const fn = (...args) => result.fire(map(...args)); - const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn); - const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn); - const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove }); - return result.event; - } - Event.fromDOMEventEmitter = fromDOMEventEmitter; - function fromPromise(promise) { - const emitter = new Emitter(); - let shouldEmit = false; - promise - .then(undefined, () => null) - .then(() => { - if (!shouldEmit) { - setTimeout(() => emitter.fire(undefined), 0); - } - else { - emitter.fire(undefined); - } - }); - shouldEmit = true; - return emitter.event; - } - Event.fromPromise = fromPromise; - function toPromise(event) { - return new Promise(c => once(event)(c)); - } - Event.toPromise = toPromise; -})(Event || (Event = {})); -let _globalLeakWarningThreshold = -1; -class LeakageMonitor { - constructor(customThreshold, name = Math.random().toString(18).slice(2, 5)) { - this.customThreshold = customThreshold; - this.name = name; - this._warnCountdown = 0; - } - dispose() { - if (this._stacks) { - this._stacks.clear(); - } - } - check(listenerCount) { - let threshold = _globalLeakWarningThreshold; - if (typeof this.customThreshold === 'number') { - threshold = this.customThreshold; - } - if (threshold <= 0 || listenerCount < threshold) { - return undefined; - } - if (!this._stacks) { - this._stacks = new Map(); - } - const stack = new Error().stack.split('\n').slice(3).join('\n'); - const count = (this._stacks.get(stack) || 0); - this._stacks.set(stack, count + 1); - this._warnCountdown -= 1; - if (this._warnCountdown <= 0) { - // only warn on first exceed and then every time the limit - // is exceeded by 50% again - this._warnCountdown = threshold * 0.5; - // find most frequent listener and print warning - let topStack; - let topCount = 0; - for (const [stack, count] of this._stacks) { - if (!topStack || topCount < count) { - topStack = stack; - topCount = count; - } - } - console.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`); - console.warn(topStack); - } - return () => { - const count = (this._stacks.get(stack) || 0); - this._stacks.set(stack, count - 1); - }; - } -} -/** - * The Emitter can be used to expose an Event to the public - * to fire it from the insides. - * Sample: - class Document { - - private readonly _onDidChange = new Emitter<(value:string)=>any>(); - - public onDidChange = this._onDidChange.event; - - // getter-style - // get onDidChange(): Event<(value:string)=>any> { - // return this._onDidChange.event; - // } - - private _doIt() { - //... - this._onDidChange.fire(value); - } - } - */ -class Emitter { - constructor(options) { - this._disposed = false; - this._options = options; - this._leakageMon = _globalLeakWarningThreshold > 0 - ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) - : undefined; - } - /** - * For the public to allow to subscribe - * to events from this Emitter - */ - get event() { - if (!this._event) { - this._event = (listener, thisArgs, disposables) => { - if (!this._listeners) { - this._listeners = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__["LinkedList"](); - } - const firstListener = this._listeners.isEmpty(); - if (firstListener && this._options && this._options.onFirstListenerAdd) { - this._options.onFirstListenerAdd(this); - } - const remove = this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); - if (firstListener && this._options && this._options.onFirstListenerDidAdd) { - this._options.onFirstListenerDidAdd(this); - } - if (this._options && this._options.onListenerDidAdd) { - this._options.onListenerDidAdd(this, listener, thisArgs); - } - // check and record this emitter for potential leakage - let removeMonitor; - if (this._leakageMon) { - removeMonitor = this._leakageMon.check(this._listeners.size); - } - let result; - result = { - dispose: () => { - if (removeMonitor) { - removeMonitor(); - } - result.dispose = Emitter._noop; - if (!this._disposed) { - remove(); - if (this._options && this._options.onLastListenerRemove) { - const hasListeners = (this._listeners && !this._listeners.isEmpty()); - if (!hasListeners) { - this._options.onLastListenerRemove(this); - } - } - } - } - }; - if (disposables instanceof _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"]) { - disposables.add(result); - } - else if (Array.isArray(disposables)) { - disposables.push(result); - } - return result; - }; - } - return this._event; - } - /** - * To be kept private to fire an event to - * subscribers - */ - fire(event) { - if (this._listeners) { - // put all [listener,event]-pairs into delivery queue - // then emit all event. an inner/nested event might be - // the driver of this - if (!this._deliveryQueue) { - this._deliveryQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__["LinkedList"](); - } - for (let listener of this._listeners) { - this._deliveryQueue.push([listener, event]); - } - while (this._deliveryQueue.size > 0) { - const [listener, event] = this._deliveryQueue.shift(); - try { - if (typeof listener === 'function') { - listener.call(undefined, event); - } - else { - listener[0].call(listener[1], event); - } - } - catch (e) { - Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - } - } - } - } - dispose() { - if (this._listeners) { - this._listeners.clear(); - } - if (this._deliveryQueue) { - this._deliveryQueue.clear(); - } - if (this._leakageMon) { - this._leakageMon.dispose(); - } - this._disposed = true; - } -} -Emitter._noop = function () { }; -class PauseableEmitter extends Emitter { - constructor(options) { - super(options); - this._isPaused = 0; - this._eventQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__["LinkedList"](); - this._mergeFn = options && options.merge; - } - pause() { - this._isPaused++; - } - resume() { - if (this._isPaused !== 0 && --this._isPaused === 0) { - if (this._mergeFn) { - // use the merge function to create a single composite - // event. make a copy in case firing pauses this emitter - const events = this._eventQueue.toArray(); - this._eventQueue.clear(); - super.fire(this._mergeFn(events)); - } - else { - // no merging, fire each event individually and test - // that this emitter isn't paused halfway through - while (!this._isPaused && this._eventQueue.size !== 0) { - super.fire(this._eventQueue.shift()); - } - } - } - } - fire(event) { - if (this._listeners) { - if (this._isPaused !== 0) { - this._eventQueue.push(event); - } - else { - super.fire(event); - } - } - } -} -/** - * The EventBufferer is useful in situations in which you want - * to delay firing your events during some code. - * You can wrap that code and be sure that the event will not - * be fired during that wrap. - * - * ``` - * const emitter: Emitter; - * const delayer = new EventDelayer(); - * const delayedEvent = delayer.wrapEvent(emitter.event); - * - * delayedEvent(console.log); - * - * delayer.bufferEvents(() => { - * emitter.fire(); // event will not be fired yet - * }); - * - * // event will only be fired at this point - * ``` - */ -class EventBufferer { - constructor() { - this.buffers = []; - } - wrapEvent(event) { - return (listener, thisArgs, disposables) => { - return event(i => { - const buffer = this.buffers[this.buffers.length - 1]; - if (buffer) { - buffer.push(() => listener.call(thisArgs, i)); - } - else { - listener.call(thisArgs, i); - } - }, undefined, disposables); - }; - } - bufferEvents(fn) { - const buffer = []; - this.buffers.push(buffer); - const r = fn(); - this.buffers.pop(); - buffer.forEach(flush => flush()); - return r; - } -} -/** - * A Relay is an event forwarder which functions as a replugabble event pipe. - * Once created, you can connect an input event to it and it will simply forward - * events from that input event through its own `event` property. The `input` - * can be changed at any point in time. - */ -class Relay { - constructor() { - this.listening = false; - this.inputEvent = Event.None; - this.inputEventListener = _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - this.emitter = new Emitter({ - onFirstListenerDidAdd: () => { - this.listening = true; - this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter); - }, - onLastListenerRemove: () => { - this.listening = false; - this.inputEventListener.dispose(); - } - }); - this.event = this.emitter.event; - } - set input(event) { - this.inputEvent = event; - if (this.listening) { - this.inputEventListener.dispose(); - this.inputEventListener = event(this.emitter.fire, this.emitter); - } - } - dispose() { - this.inputEventListener.dispose(); - this.emitter.dispose(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/hash.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/hash.js ***! - \***************************************************************/ -/*! exports provided: hash, doHash, stringHash, StringSHA1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hash", function() { return hash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doHash", function() { return doHash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringHash", function() { return stringHash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringSHA1", function() { return StringSHA1; }); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * Return a hash value for an object. - */ -function hash(obj) { - return doHash(obj, 0); -} -function doHash(obj, hashVal) { - switch (typeof obj) { - case 'object': - if (obj === null) { - return numberHash(349, hashVal); - } - else if (Array.isArray(obj)) { - return arrayHash(obj, hashVal); - } - return objectHash(obj, hashVal); - case 'string': - return stringHash(obj, hashVal); - case 'boolean': - return booleanHash(obj, hashVal); - case 'number': - return numberHash(obj, hashVal); - case 'undefined': - return numberHash(937, hashVal); - default: - return numberHash(617, hashVal); - } -} -function numberHash(val, initialHashVal) { - return (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32 -} -function booleanHash(b, initialHashVal) { - return numberHash(b ? 433 : 863, initialHashVal); -} -function stringHash(s, hashVal) { - hashVal = numberHash(149417, hashVal); - for (let i = 0, length = s.length; i < length; i++) { - hashVal = numberHash(s.charCodeAt(i), hashVal); - } - return hashVal; -} -function arrayHash(arr, initialHashVal) { - initialHashVal = numberHash(104579, initialHashVal); - return arr.reduce((hashVal, item) => doHash(item, hashVal), initialHashVal); -} -function objectHash(obj, initialHashVal) { - initialHashVal = numberHash(181387, initialHashVal); - return Object.keys(obj).sort().reduce((hashVal, key) => { - hashVal = stringHash(key, hashVal); - return doHash(obj[key], hashVal); - }, initialHashVal); -} -function leftRotate(value, bits, totalBits = 32) { - // delta + bits = totalBits - const delta = totalBits - bits; - // All ones, expect `delta` zeros aligned to the right - const mask = ~((1 << delta) - 1); - // Join (value left-shifted `bits` bits) with (masked value right-shifted `delta` bits) - return ((value << bits) | ((mask & value) >>> delta)) >>> 0; -} -function fill(dest, index = 0, count = dest.byteLength, value = 0) { - for (let i = 0; i < count; i++) { - dest[index + i] = value; - } -} -function leftPad(value, length, char = '0') { - while (value.length < length) { - value = char + value; - } - return value; -} -function toHexString(value, bitsize = 32) { - return leftPad((value >>> 0).toString(16), bitsize / 4); -} -/** - * A SHA1 implementation that works with strings and does not allocate. - */ -class StringSHA1 { - constructor() { - this._h0 = 0x67452301; - this._h1 = 0xEFCDAB89; - this._h2 = 0x98BADCFE; - this._h3 = 0x10325476; - this._h4 = 0xC3D2E1F0; - this._buff = new Uint8Array(64 /* BLOCK_SIZE */ + 3 /* to fit any utf-8 */); - this._buffDV = new DataView(this._buff.buffer); - this._buffLen = 0; - this._totalLen = 0; - this._leftoverHighSurrogate = 0; - this._finished = false; - } - update(str) { - const strLen = str.length; - if (strLen === 0) { - return; - } - const buff = this._buff; - let buffLen = this._buffLen; - let leftoverHighSurrogate = this._leftoverHighSurrogate; - let charCode; - let offset; - if (leftoverHighSurrogate !== 0) { - charCode = leftoverHighSurrogate; - offset = -1; - leftoverHighSurrogate = 0; - } - else { - charCode = str.charCodeAt(0); - offset = 0; - } - while (true) { - let codePoint = charCode; - if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["isHighSurrogate"](charCode)) { - if (offset + 1 < strLen) { - const nextCharCode = str.charCodeAt(offset + 1); - if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["isLowSurrogate"](nextCharCode)) { - offset++; - codePoint = _strings_js__WEBPACK_IMPORTED_MODULE_0__["computeCodePoint"](charCode, nextCharCode); - } - else { - // illegal => unicode replacement character - codePoint = 65533 /* UNICODE_REPLACEMENT */; - } - } - else { - // last character is a surrogate pair - leftoverHighSurrogate = charCode; - break; - } - } - else if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["isLowSurrogate"](charCode)) { - // illegal => unicode replacement character - codePoint = 65533 /* UNICODE_REPLACEMENT */; - } - buffLen = this._push(buff, buffLen, codePoint); - offset++; - if (offset < strLen) { - charCode = str.charCodeAt(offset); - } - else { - break; - } - } - this._buffLen = buffLen; - this._leftoverHighSurrogate = leftoverHighSurrogate; - } - _push(buff, buffLen, codePoint) { - if (codePoint < 0x0080) { - buff[buffLen++] = codePoint; - } - else if (codePoint < 0x0800) { - buff[buffLen++] = 0b11000000 | ((codePoint & 0b00000000000000000000011111000000) >>> 6); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0); - } - else if (codePoint < 0x10000) { - buff[buffLen++] = 0b11100000 | ((codePoint & 0b00000000000000001111000000000000) >>> 12); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0); - } - else { - buff[buffLen++] = 0b11110000 | ((codePoint & 0b00000000000111000000000000000000) >>> 18); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000111111000000000000) >>> 12); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0); - } - if (buffLen >= 64 /* BLOCK_SIZE */) { - this._step(); - buffLen -= 64 /* BLOCK_SIZE */; - this._totalLen += 64 /* BLOCK_SIZE */; - // take last 3 in case of UTF8 overflow - buff[0] = buff[64 /* BLOCK_SIZE */ + 0]; - buff[1] = buff[64 /* BLOCK_SIZE */ + 1]; - buff[2] = buff[64 /* BLOCK_SIZE */ + 2]; - } - return buffLen; - } - digest() { - if (!this._finished) { - this._finished = true; - if (this._leftoverHighSurrogate) { - // illegal => unicode replacement character - this._leftoverHighSurrogate = 0; - this._buffLen = this._push(this._buff, this._buffLen, 65533 /* UNICODE_REPLACEMENT */); - } - this._totalLen += this._buffLen; - this._wrapUp(); - } - return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4); - } - _wrapUp() { - this._buff[this._buffLen++] = 0x80; - fill(this._buff, this._buffLen); - if (this._buffLen > 56) { - this._step(); - fill(this._buff); - } - // this will fit because the mantissa can cover up to 52 bits - const ml = 8 * this._totalLen; - this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false); - this._buffDV.setUint32(60, ml % 4294967296, false); - this._step(); - } - _step() { - const bigBlock32 = StringSHA1._bigBlock32; - const data = this._buffDV; - for (let j = 0; j < 64 /* 16*4 */; j += 4) { - bigBlock32.setUint32(j, data.getUint32(j, false), false); - } - for (let j = 64; j < 320 /* 80*4 */; j += 4) { - bigBlock32.setUint32(j, leftRotate((bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false)), 1), false); - } - let a = this._h0; - let b = this._h1; - let c = this._h2; - let d = this._h3; - let e = this._h4; - let f, k; - let temp; - for (let j = 0; j < 80; j++) { - if (j < 20) { - f = (b & c) | ((~b) & d); - k = 0x5A827999; - } - else if (j < 40) { - f = b ^ c ^ d; - k = 0x6ED9EBA1; - } - else if (j < 60) { - f = (b & c) | (b & d) | (c & d); - k = 0x8F1BBCDC; - } - else { - f = b ^ c ^ d; - k = 0xCA62C1D6; - } - temp = (leftRotate(a, 5) + f + e + k + bigBlock32.getUint32(j * 4, false)) & 0xffffffff; - e = d; - d = c; - c = leftRotate(b, 30); - b = a; - a = temp; - } - this._h0 = (this._h0 + a) & 0xffffffff; - this._h1 = (this._h1 + b) & 0xffffffff; - this._h2 = (this._h2 + c) & 0xffffffff; - this._h3 = (this._h3 + d) & 0xffffffff; - this._h4 = (this._h4 + e) & 0xffffffff; - } -} -StringSHA1._bigBlock32 = new DataView(new ArrayBuffer(320)); // 80 * 4 = 320 - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/iterator.js ***! - \*******************************************************************/ -/*! exports provided: Iterable */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Iterable", function() { return Iterable; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Iterable; -(function (Iterable) { - function is(thing) { - return thing && typeof thing === 'object' && typeof thing[Symbol.iterator] === 'function'; - } - Iterable.is = is; - const _empty = Object.freeze([]); - function empty() { - return _empty; - } - Iterable.empty = empty; - function* single(element) { - yield element; - } - Iterable.single = single; - function from(iterable) { - return iterable || _empty; - } - Iterable.from = from; - function first(iterable) { - return iterable[Symbol.iterator]().next().value; - } - Iterable.first = first; - function some(iterable, predicate) { - for (const element of iterable) { - if (predicate(element)) { - return true; - } - } - return false; - } - Iterable.some = some; - function* filter(iterable, predicate) { - for (const element of iterable) { - if (predicate(element)) { - yield element; - } - } - } - Iterable.filter = filter; - function* map(iterable, fn) { - for (const element of iterable) { - yield fn(element); - } - } - Iterable.map = map; - function* concat(...iterables) { - for (const iterable of iterables) { - for (const element of iterable) { - yield element; - } - } - } - Iterable.concat = concat; - /** - * Consumes `atMost` elements from iterable and returns the consumed elements, - * and an iterable for the rest of the elements. - */ - function consume(iterable, atMost = Number.POSITIVE_INFINITY) { - const consumed = []; - if (atMost === 0) { - return [consumed, iterable]; - } - const iterator = iterable[Symbol.iterator](); - for (let i = 0; i < atMost; i++) { - const next = iterator.next(); - if (next.done) { - return [consumed, Iterable.empty()]; - } - consumed.push(next.value); - } - return [consumed, { [Symbol.iterator]() { return iterator; } }]; - } - Iterable.consume = consume; -})(Iterable || (Iterable = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js ***! - \*******************************************************************/ -/*! exports provided: KeyCodeUtils, KeyChord, createKeybinding, createSimpleKeybinding, SimpleKeybinding, ChordKeybinding, ResolvedKeybindingPart, ResolvedKeybinding */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCodeUtils", function() { return KeyCodeUtils; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyChord", function() { return KeyChord; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createKeybinding", function() { return createKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleKeybinding", function() { return createSimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleKeybinding", function() { return SimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChordKeybinding", function() { return ChordKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybindingPart", function() { return ResolvedKeybindingPart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybinding", function() { return ResolvedKeybinding; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class KeyCodeStrMap { - constructor() { - this._keyCodeToStr = []; - this._strToKeyCode = Object.create(null); - } - define(keyCode, str) { - this._keyCodeToStr[keyCode] = str; - this._strToKeyCode[str.toLowerCase()] = keyCode; - } - keyCodeToStr(keyCode) { - return this._keyCodeToStr[keyCode]; - } - strToKeyCode(str) { - return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; - } -} -const uiMap = new KeyCodeStrMap(); -const userSettingsUSMap = new KeyCodeStrMap(); -const userSettingsGeneralMap = new KeyCodeStrMap(); -(function () { - function define(keyCode, uiLabel, usUserSettingsLabel = uiLabel, generalUserSettingsLabel = usUserSettingsLabel) { - uiMap.define(keyCode, uiLabel); - userSettingsUSMap.define(keyCode, usUserSettingsLabel); - userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); - } - define(0 /* Unknown */, 'unknown'); - define(1 /* Backspace */, 'Backspace'); - define(2 /* Tab */, 'Tab'); - define(3 /* Enter */, 'Enter'); - define(4 /* Shift */, 'Shift'); - define(5 /* Ctrl */, 'Ctrl'); - define(6 /* Alt */, 'Alt'); - define(7 /* PauseBreak */, 'PauseBreak'); - define(8 /* CapsLock */, 'CapsLock'); - define(9 /* Escape */, 'Escape'); - define(10 /* Space */, 'Space'); - define(11 /* PageUp */, 'PageUp'); - define(12 /* PageDown */, 'PageDown'); - define(13 /* End */, 'End'); - define(14 /* Home */, 'Home'); - define(15 /* LeftArrow */, 'LeftArrow', 'Left'); - define(16 /* UpArrow */, 'UpArrow', 'Up'); - define(17 /* RightArrow */, 'RightArrow', 'Right'); - define(18 /* DownArrow */, 'DownArrow', 'Down'); - define(19 /* Insert */, 'Insert'); - define(20 /* Delete */, 'Delete'); - define(21 /* KEY_0 */, '0'); - define(22 /* KEY_1 */, '1'); - define(23 /* KEY_2 */, '2'); - define(24 /* KEY_3 */, '3'); - define(25 /* KEY_4 */, '4'); - define(26 /* KEY_5 */, '5'); - define(27 /* KEY_6 */, '6'); - define(28 /* KEY_7 */, '7'); - define(29 /* KEY_8 */, '8'); - define(30 /* KEY_9 */, '9'); - define(31 /* KEY_A */, 'A'); - define(32 /* KEY_B */, 'B'); - define(33 /* KEY_C */, 'C'); - define(34 /* KEY_D */, 'D'); - define(35 /* KEY_E */, 'E'); - define(36 /* KEY_F */, 'F'); - define(37 /* KEY_G */, 'G'); - define(38 /* KEY_H */, 'H'); - define(39 /* KEY_I */, 'I'); - define(40 /* KEY_J */, 'J'); - define(41 /* KEY_K */, 'K'); - define(42 /* KEY_L */, 'L'); - define(43 /* KEY_M */, 'M'); - define(44 /* KEY_N */, 'N'); - define(45 /* KEY_O */, 'O'); - define(46 /* KEY_P */, 'P'); - define(47 /* KEY_Q */, 'Q'); - define(48 /* KEY_R */, 'R'); - define(49 /* KEY_S */, 'S'); - define(50 /* KEY_T */, 'T'); - define(51 /* KEY_U */, 'U'); - define(52 /* KEY_V */, 'V'); - define(53 /* KEY_W */, 'W'); - define(54 /* KEY_X */, 'X'); - define(55 /* KEY_Y */, 'Y'); - define(56 /* KEY_Z */, 'Z'); - define(57 /* Meta */, 'Meta'); - define(58 /* ContextMenu */, 'ContextMenu'); - define(59 /* F1 */, 'F1'); - define(60 /* F2 */, 'F2'); - define(61 /* F3 */, 'F3'); - define(62 /* F4 */, 'F4'); - define(63 /* F5 */, 'F5'); - define(64 /* F6 */, 'F6'); - define(65 /* F7 */, 'F7'); - define(66 /* F8 */, 'F8'); - define(67 /* F9 */, 'F9'); - define(68 /* F10 */, 'F10'); - define(69 /* F11 */, 'F11'); - define(70 /* F12 */, 'F12'); - define(71 /* F13 */, 'F13'); - define(72 /* F14 */, 'F14'); - define(73 /* F15 */, 'F15'); - define(74 /* F16 */, 'F16'); - define(75 /* F17 */, 'F17'); - define(76 /* F18 */, 'F18'); - define(77 /* F19 */, 'F19'); - define(78 /* NumLock */, 'NumLock'); - define(79 /* ScrollLock */, 'ScrollLock'); - define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); - define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); - define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); - define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); - define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); - define(85 /* US_SLASH */, '/', '/', 'OEM_2'); - define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); - define(110 /* ABNT_C1 */, 'ABNT_C1'); - define(111 /* ABNT_C2 */, 'ABNT_C2'); - define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); - define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); - define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); - define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); - define(91 /* OEM_8 */, 'OEM_8'); - define(92 /* OEM_102 */, 'OEM_102'); - define(93 /* NUMPAD_0 */, 'NumPad0'); - define(94 /* NUMPAD_1 */, 'NumPad1'); - define(95 /* NUMPAD_2 */, 'NumPad2'); - define(96 /* NUMPAD_3 */, 'NumPad3'); - define(97 /* NUMPAD_4 */, 'NumPad4'); - define(98 /* NUMPAD_5 */, 'NumPad5'); - define(99 /* NUMPAD_6 */, 'NumPad6'); - define(100 /* NUMPAD_7 */, 'NumPad7'); - define(101 /* NUMPAD_8 */, 'NumPad8'); - define(102 /* NUMPAD_9 */, 'NumPad9'); - define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); - define(104 /* NUMPAD_ADD */, 'NumPad_Add'); - define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); - define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); - define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); - define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); -})(); -var KeyCodeUtils; -(function (KeyCodeUtils) { - function toString(keyCode) { - return uiMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toString = toString; - function fromString(key) { - return uiMap.strToKeyCode(key); - } - KeyCodeUtils.fromString = fromString; - function toUserSettingsUS(keyCode) { - return userSettingsUSMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; - function toUserSettingsGeneral(keyCode) { - return userSettingsGeneralMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; - function fromUserSettings(key) { - return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); - } - KeyCodeUtils.fromUserSettings = fromUserSettings; -})(KeyCodeUtils || (KeyCodeUtils = {})); -function KeyChord(firstPart, secondPart) { - const chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; - return (firstPart | chordPart) >>> 0; -} -function createKeybinding(keybinding, OS) { - if (keybinding === 0) { - return null; - } - const firstPart = (keybinding & 0x0000FFFF) >>> 0; - const chordPart = (keybinding & 0xFFFF0000) >>> 16; - if (chordPart !== 0) { - return new ChordKeybinding([ - createSimpleKeybinding(firstPart, OS), - createSimpleKeybinding(chordPart, OS) - ]); - } - return new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); -} -function createSimpleKeybinding(keybinding, OS) { - const ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); - const winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); - const ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); - const shiftKey = (keybinding & 1024 /* Shift */ ? true : false); - const altKey = (keybinding & 512 /* Alt */ ? true : false); - const metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); - const keyCode = (keybinding & 255 /* KeyCode */); - return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); -} -class SimpleKeybinding { - constructor(ctrlKey, shiftKey, altKey, metaKey, keyCode) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyCode = keyCode; - } - equals(other) { - return (this.ctrlKey === other.ctrlKey - && this.shiftKey === other.shiftKey - && this.altKey === other.altKey - && this.metaKey === other.metaKey - && this.keyCode === other.keyCode); - } - isModifierKey() { - return (this.keyCode === 0 /* Unknown */ - || this.keyCode === 5 /* Ctrl */ - || this.keyCode === 57 /* Meta */ - || this.keyCode === 6 /* Alt */ - || this.keyCode === 4 /* Shift */); - } - toChord() { - return new ChordKeybinding([this]); - } - /** - * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? - */ - isDuplicateModifierCase() { - return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) - || (this.shiftKey && this.keyCode === 4 /* Shift */) - || (this.altKey && this.keyCode === 6 /* Alt */) - || (this.metaKey && this.keyCode === 57 /* Meta */)); - } -} -class ChordKeybinding { - constructor(parts) { - if (parts.length === 0) { - throw Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["illegalArgument"])(`parts`); - } - this.parts = parts; - } -} -class ResolvedKeybindingPart { - constructor(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyLabel = kbLabel; - this.keyAriaLabel = kbAriaLabel; - } -} -/** - * A resolved keybinding. Can be a simple keybinding or a chord keybinding. - */ -class ResolvedKeybinding { -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js ***! - \********************************************************************/ -/*! exports provided: MultiDisposeError, isDisposable, dispose, combinedDisposable, toDisposable, DisposableStore, Disposable, MutableDisposable, ImmortalReference */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiDisposeError", function() { return MultiDisposeError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDisposable", function() { return isDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispose", function() { return dispose; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combinedDisposable", function() { return combinedDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDisposable", function() { return toDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DisposableStore", function() { return DisposableStore; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Disposable", function() { return Disposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MutableDisposable", function() { return MutableDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImmortalReference", function() { return ImmortalReference; }); -/* harmony import */ var _iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); - -/** - * Enables logging of potentially leaked disposables. - * - * A disposable is considered leaked if it is not disposed or not registered as the child of - * another disposable. This tracking is very simple an only works for classes that either - * extend Disposable or use a DisposableStore. This means there are a lot of false positives. - */ -const TRACK_DISPOSABLES = false; -const __is_disposable_tracked__ = '__is_disposable_tracked__'; -function markTracked(x) { - if (!TRACK_DISPOSABLES) { - return; - } - if (x && x !== Disposable.None) { - try { - x[__is_disposable_tracked__] = true; - } - catch (_a) { - // noop - } - } -} -function trackDisposable(x) { - if (!TRACK_DISPOSABLES) { - return x; - } - const stack = new Error('Potentially leaked disposable').stack; - setTimeout(() => { - if (!x[__is_disposable_tracked__]) { - console.log(stack); - } - }, 3000); - return x; -} -class MultiDisposeError extends Error { - constructor(errors) { - super(`Encounter errors while disposing of store. Errors: [${errors.join(', ')}]`); - this.errors = errors; - } -} -function isDisposable(thing) { - return typeof thing.dispose === 'function' && thing.dispose.length === 0; -} -function dispose(arg) { - if (_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].is(arg)) { - let errors = []; - for (const d of arg) { - if (d) { - markTracked(d); - try { - d.dispose(); - } - catch (e) { - errors.push(e); - } - } - } - if (errors.length === 1) { - throw errors[0]; - } - else if (errors.length > 1) { - throw new MultiDisposeError(errors); - } - return Array.isArray(arg) ? [] : arg; - } - else if (arg) { - markTracked(arg); - arg.dispose(); - return arg; - } -} -function combinedDisposable(...disposables) { - disposables.forEach(markTracked); - return trackDisposable({ dispose: () => dispose(disposables) }); -} -function toDisposable(fn) { - const self = trackDisposable({ - dispose: () => { - markTracked(self); - fn(); - } - }); - return self; -} -class DisposableStore { - constructor() { - this._toDispose = new Set(); - this._isDisposed = false; - } - /** - * Dispose of all registered disposables and mark this object as disposed. - * - * Any future disposables added to this object will be disposed of on `add`. - */ - dispose() { - if (this._isDisposed) { - return; - } - markTracked(this); - this._isDisposed = true; - this.clear(); - } - /** - * Dispose of all registered disposables but do not mark this object as disposed. - */ - clear() { - try { - dispose(this._toDispose.values()); - } - finally { - this._toDispose.clear(); - } - } - add(t) { - if (!t) { - return t; - } - if (t === this) { - throw new Error('Cannot register a disposable on itself!'); - } - markTracked(t); - if (this._isDisposed) { - if (!DisposableStore.DISABLE_DISPOSED_WARNING) { - console.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack); - } - } - else { - this._toDispose.add(t); - } - return t; - } -} -DisposableStore.DISABLE_DISPOSED_WARNING = false; -class Disposable { - constructor() { - this._store = new DisposableStore(); - trackDisposable(this); - } - dispose() { - markTracked(this); - this._store.dispose(); - } - _register(t) { - if (t === this) { - throw new Error('Cannot register a disposable on itself!'); - } - return this._store.add(t); - } -} -Disposable.None = Object.freeze({ dispose() { } }); -/** - * Manages the lifecycle of a disposable value that may be changed. - * - * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can - * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up. - */ -class MutableDisposable { - constructor() { - this._isDisposed = false; - trackDisposable(this); - } - get value() { - return this._isDisposed ? undefined : this._value; - } - set value(value) { - if (this._isDisposed || value === this._value) { - return; - } - if (this._value) { - this._value.dispose(); - } - if (value) { - markTracked(value); - } - this._value = value; - } - clear() { - this.value = undefined; - } - dispose() { - this._isDisposed = true; - markTracked(this); - if (this._value) { - this._value.dispose(); - } - this._value = undefined; - } -} -class ImmortalReference { - constructor(object) { - this.object = object; - } - dispose() { } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js ***! - \*********************************************************************/ -/*! exports provided: LinkedList */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedList", function() { return LinkedList; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class Node { - constructor(element) { - this.element = element; - this.next = Node.Undefined; - this.prev = Node.Undefined; - } -} -Node.Undefined = new Node(undefined); -class LinkedList { - constructor() { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - } - get size() { - return this._size; - } - isEmpty() { - return this._first === Node.Undefined; - } - clear() { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - } - unshift(element) { - return this._insert(element, false); - } - push(element) { - return this._insert(element, true); - } - _insert(element, atTheEnd) { - const newNode = new Node(element); - if (this._first === Node.Undefined) { - this._first = newNode; - this._last = newNode; - } - else if (atTheEnd) { - // push - const oldLast = this._last; - this._last = newNode; - newNode.prev = oldLast; - oldLast.next = newNode; - } - else { - // unshift - const oldFirst = this._first; - this._first = newNode; - newNode.next = oldFirst; - oldFirst.prev = newNode; - } - this._size += 1; - let didRemove = false; - return () => { - if (!didRemove) { - didRemove = true; - this._remove(newNode); - } - }; - } - shift() { - if (this._first === Node.Undefined) { - return undefined; - } - else { - const res = this._first.element; - this._remove(this._first); - return res; - } - } - pop() { - if (this._last === Node.Undefined) { - return undefined; - } - else { - const res = this._last.element; - this._remove(this._last); - return res; - } - } - _remove(node) { - if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { - // middle - const anchor = node.prev; - anchor.next = node.next; - node.next.prev = anchor; - } - else if (node.prev === Node.Undefined && node.next === Node.Undefined) { - // only node - this._first = Node.Undefined; - this._last = Node.Undefined; - } - else if (node.next === Node.Undefined) { - // last - this._last = this._last.prev; - this._last.next = Node.Undefined; - } - else if (node.prev === Node.Undefined) { - // first - this._first = this._first.next; - this._first.prev = Node.Undefined; - } - // done - this._size -= 1; - } - *[Symbol.iterator]() { - let node = this._first; - while (node !== Node.Undefined) { - yield node.element; - node = node.next; - } - } - toArray() { - const result = []; - for (let node = this._first; node !== Node.Undefined; node = node.next) { - result.push(node.element); - } - return result; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/path.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/path.js ***! - \***************************************************************/ -/*! exports provided: win32, posix, normalize, resolve, relative, dirname, basename, extname, sep */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "win32", function() { return win32; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "posix", function() { return posix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolve", function() { return resolve; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relative", function() { return relative; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return dirname; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basename", function() { return basename; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extname", function() { return extname; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sep", function() { return sep; }); -/* harmony import */ var _process_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./process.js */ "./node_modules/monaco-editor/esm/vs/base/common/process.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// NOTE: VSCode's copy of nodejs path library to be usable in common (non-node) namespace -// Copied from: https://github.com/nodejs/node/blob/v12.8.1/lib/path.js -/** - * Copyright Joyent, Inc. and other Node contributors. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to permit - * persons to whom the Software is furnished to do so, subject to the - * following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -const CHAR_UPPERCASE_A = 65; /* A */ -const CHAR_LOWERCASE_A = 97; /* a */ -const CHAR_UPPERCASE_Z = 90; /* Z */ -const CHAR_LOWERCASE_Z = 122; /* z */ -const CHAR_DOT = 46; /* . */ -const CHAR_FORWARD_SLASH = 47; /* / */ -const CHAR_BACKWARD_SLASH = 92; /* \ */ -const CHAR_COLON = 58; /* : */ -const CHAR_QUESTION_MARK = 63; /* ? */ -class ErrorInvalidArgType extends Error { - constructor(name, expected, actual) { - // determiner: 'must be' or 'must not be' - let determiner; - if (typeof expected === 'string' && expected.indexOf('not ') === 0) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } - else { - determiner = 'must be'; - } - const type = name.indexOf('.') !== -1 ? 'property' : 'argument'; - let msg = `The "${name}" ${type} ${determiner} of type ${expected}`; - msg += `. Received type ${typeof actual}`; - super(msg); - this.code = 'ERR_INVALID_ARG_TYPE'; - } -} -function validateString(value, name) { - if (typeof value !== 'string') { - throw new ErrorInvalidArgType(name, 'string', value); - } -} -function isPathSeparator(code) { - return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; -} -function isPosixPathSeparator(code) { - return code === CHAR_FORWARD_SLASH; -} -function isWindowsDeviceRoot(code) { - return code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z || - code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z; -} -// Resolves . and .. elements in a path with directory names -function normalizeString(path, allowAboveRoot, separator, isPathSeparator) { - let res = ''; - let lastSegmentLength = 0; - let lastSlash = -1; - let dots = 0; - let code = 0; - for (let i = 0; i <= path.length; ++i) { - if (i < path.length) { - code = path.charCodeAt(i); - } - else if (isPathSeparator(code)) { - break; - } - else { - code = CHAR_FORWARD_SLASH; - } - if (isPathSeparator(code)) { - if (lastSlash === i - 1 || dots === 1) { - // NOOP - } - else if (dots === 2) { - if (res.length < 2 || lastSegmentLength !== 2 || - res.charCodeAt(res.length - 1) !== CHAR_DOT || - res.charCodeAt(res.length - 2) !== CHAR_DOT) { - if (res.length > 2) { - const lastSlashIndex = res.lastIndexOf(separator); - if (lastSlashIndex === -1) { - res = ''; - lastSegmentLength = 0; - } - else { - res = res.slice(0, lastSlashIndex); - lastSegmentLength = res.length - 1 - res.lastIndexOf(separator); - } - lastSlash = i; - dots = 0; - continue; - } - else if (res.length !== 0) { - res = ''; - lastSegmentLength = 0; - lastSlash = i; - dots = 0; - continue; - } - } - if (allowAboveRoot) { - res += res.length > 0 ? `${separator}..` : '..'; - lastSegmentLength = 2; - } - } - else { - if (res.length > 0) { - res += `${separator}${path.slice(lastSlash + 1, i)}`; - } - else { - res = path.slice(lastSlash + 1, i); - } - lastSegmentLength = i - lastSlash - 1; - } - lastSlash = i; - dots = 0; - } - else if (code === CHAR_DOT && dots !== -1) { - ++dots; - } - else { - dots = -1; - } - } - return res; -} -function _format(sep, pathObject) { - if (pathObject === null || typeof pathObject !== 'object') { - throw new ErrorInvalidArgType('pathObject', 'Object', pathObject); - } - const dir = pathObject.dir || pathObject.root; - const base = pathObject.base || - `${pathObject.name || ''}${pathObject.ext || ''}`; - if (!dir) { - return base; - } - return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep}${base}`; -} -const win32 = { - // path.resolve([from ...], to) - resolve(...pathSegments) { - let resolvedDevice = ''; - let resolvedTail = ''; - let resolvedAbsolute = false; - for (let i = pathSegments.length - 1; i >= -1; i--) { - let path; - if (i >= 0) { - path = pathSegments[i]; - validateString(path, 'path'); - // Skip empty entries - if (path.length === 0) { - continue; - } - } - else if (resolvedDevice.length === 0) { - path = _process_js__WEBPACK_IMPORTED_MODULE_0__["cwd"](); - } - else { - // Windows has the concept of drive-specific current working - // directories. If we've resolved a drive letter but not yet an - // absolute path, get cwd for that drive, or the process cwd if - // the drive cwd is not available. We're sure the device is not - // a UNC path at this points, because UNC paths are always absolute. - path = _process_js__WEBPACK_IMPORTED_MODULE_0__["env"][`=${resolvedDevice}`] || _process_js__WEBPACK_IMPORTED_MODULE_0__["cwd"](); - // Verify that a cwd was found and that it actually points - // to our drive. If not, default to the drive's root. - if (path === undefined || - path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() && - path.charCodeAt(2) === CHAR_BACKWARD_SLASH) { - path = `${resolvedDevice}\\`; - } - } - const len = path.length; - let rootEnd = 0; - let device = ''; - let isAbsolute = false; - const code = path.charCodeAt(0); - // Try to match a root - if (len === 1) { - if (isPathSeparator(code)) { - // `path` contains just a path separator - rootEnd = 1; - isAbsolute = true; - } - } - else if (isPathSeparator(code)) { - // Possible UNC root - // If we started with a separator, we know we at least have an - // absolute path of some kind (UNC or otherwise) - isAbsolute = true; - if (isPathSeparator(path.charCodeAt(1))) { - // Matched double path separator at beginning - let j = 2; - let last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - const firstPart = path.slice(last, j); - // Matched! - last = j; - // Match 1 or more path separators - while (j < len && isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j === len || j !== last) { - // We matched a UNC root - device = `\\\\${firstPart}\\${path.slice(last, j)}`; - rootEnd = j; - } - } - } - } - else { - rootEnd = 1; - } - } - else if (isWindowsDeviceRoot(code) && - path.charCodeAt(1) === CHAR_COLON) { - // Possible device root - device = path.slice(0, 2); - rootEnd = 2; - if (len > 2 && isPathSeparator(path.charCodeAt(2))) { - // Treat separator following drive name as an absolute path - // indicator - isAbsolute = true; - rootEnd = 3; - } - } - if (device.length > 0) { - if (resolvedDevice.length > 0) { - if (device.toLowerCase() !== resolvedDevice.toLowerCase()) { - // This path points to another device so it is not applicable - continue; - } - } - else { - resolvedDevice = device; - } - } - if (resolvedAbsolute) { - if (resolvedDevice.length > 0) { - break; - } - } - else { - resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`; - resolvedAbsolute = isAbsolute; - if (isAbsolute && resolvedDevice.length > 0) { - break; - } - } - } - // At this point the path should be resolved to a full absolute path, - // but handle relative paths to be safe (might happen when process.cwd() - // fails) - // Normalize the tail path - resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparator); - return resolvedAbsolute ? - `${resolvedDevice}\\${resolvedTail}` : - `${resolvedDevice}${resolvedTail}` || '.'; - }, - normalize(path) { - validateString(path, 'path'); - const len = path.length; - if (len === 0) { - return '.'; - } - let rootEnd = 0; - let device; - let isAbsolute = false; - const code = path.charCodeAt(0); - // Try to match a root - if (len === 1) { - // `path` contains just a single char, exit early to avoid - // unnecessary work - return isPosixPathSeparator(code) ? '\\' : path; - } - if (isPathSeparator(code)) { - // Possible UNC root - // If we started with a separator, we know we at least have an absolute - // path of some kind (UNC or otherwise) - isAbsolute = true; - if (isPathSeparator(path.charCodeAt(1))) { - // Matched double path separator at beginning - let j = 2; - let last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - const firstPart = path.slice(last, j); - // Matched! - last = j; - // Match 1 or more path separators - while (j < len && isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j === len) { - // We matched a UNC root only - // Return the normalized version of the UNC root since there - // is nothing left to process - return `\\\\${firstPart}\\${path.slice(last)}\\`; - } - if (j !== last) { - // We matched a UNC root with leftovers - device = `\\\\${firstPart}\\${path.slice(last, j)}`; - rootEnd = j; - } - } - } - } - else { - rootEnd = 1; - } - } - else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { - // Possible device root - device = path.slice(0, 2); - rootEnd = 2; - if (len > 2 && isPathSeparator(path.charCodeAt(2))) { - // Treat separator following drive name as an absolute path - // indicator - isAbsolute = true; - rootEnd = 3; - } - } - let tail = rootEnd < len ? - normalizeString(path.slice(rootEnd), !isAbsolute, '\\', isPathSeparator) : - ''; - if (tail.length === 0 && !isAbsolute) { - tail = '.'; - } - if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) { - tail += '\\'; - } - if (device === undefined) { - return isAbsolute ? `\\${tail}` : tail; - } - return isAbsolute ? `${device}\\${tail}` : `${device}${tail}`; - }, - isAbsolute(path) { - validateString(path, 'path'); - const len = path.length; - if (len === 0) { - return false; - } - const code = path.charCodeAt(0); - return isPathSeparator(code) || - // Possible device root - len > 2 && - isWindowsDeviceRoot(code) && - path.charCodeAt(1) === CHAR_COLON && - isPathSeparator(path.charCodeAt(2)); - }, - join(...paths) { - if (paths.length === 0) { - return '.'; - } - let joined; - let firstPart; - for (let i = 0; i < paths.length; ++i) { - const arg = paths[i]; - validateString(arg, 'path'); - if (arg.length > 0) { - if (joined === undefined) { - joined = firstPart = arg; - } - else { - joined += `\\${arg}`; - } - } - } - if (joined === undefined) { - return '.'; - } - // Make sure that the joined path doesn't start with two slashes, because - // normalize() will mistake it for an UNC path then. - // - // This step is skipped when it is very clear that the user actually - // intended to point at an UNC path. This is assumed when the first - // non-empty string arguments starts with exactly two slashes followed by - // at least one more non-slash character. - // - // Note that for normalize() to treat a path as an UNC path it needs to - // have at least 2 components, so we don't filter for that here. - // This means that the user can use join to construct UNC paths from - // a server name and a share name; for example: - // path.join('//server', 'share') -> '\\\\server\\share\\') - let needsReplace = true; - let slashCount = 0; - if (typeof firstPart === 'string' && isPathSeparator(firstPart.charCodeAt(0))) { - ++slashCount; - const firstLen = firstPart.length; - if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) { - ++slashCount; - if (firstLen > 2) { - if (isPathSeparator(firstPart.charCodeAt(2))) { - ++slashCount; - } - else { - // We matched a UNC path in the first part - needsReplace = false; - } - } - } - } - if (needsReplace) { - // Find any more consecutive slashes we need to replace - while (slashCount < joined.length && - isPathSeparator(joined.charCodeAt(slashCount))) { - slashCount++; - } - // Replace the slashes if needed - if (slashCount >= 2) { - joined = `\\${joined.slice(slashCount)}`; - } - } - return win32.normalize(joined); - }, - // It will solve the relative path from `from` to `to`, for instance: - // from = 'C:\\orandea\\test\\aaa' - // to = 'C:\\orandea\\impl\\bbb' - // The output of the function should be: '..\\..\\impl\\bbb' - relative(from, to) { - validateString(from, 'from'); - validateString(to, 'to'); - if (from === to) { - return ''; - } - const fromOrig = win32.resolve(from); - const toOrig = win32.resolve(to); - if (fromOrig === toOrig) { - return ''; - } - from = fromOrig.toLowerCase(); - to = toOrig.toLowerCase(); - if (from === to) { - return ''; - } - // Trim any leading backslashes - let fromStart = 0; - while (fromStart < from.length && - from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) { - fromStart++; - } - // Trim trailing backslashes (applicable to UNC paths only) - let fromEnd = from.length; - while (fromEnd - 1 > fromStart && - from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) { - fromEnd--; - } - const fromLen = fromEnd - fromStart; - // Trim any leading backslashes - let toStart = 0; - while (toStart < to.length && - to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) { - toStart++; - } - // Trim trailing backslashes (applicable to UNC paths only) - let toEnd = to.length; - while (toEnd - 1 > toStart && - to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) { - toEnd--; - } - const toLen = toEnd - toStart; - // Compare paths to find the longest common path from root - const length = fromLen < toLen ? fromLen : toLen; - let lastCommonSep = -1; - let i = 0; - for (; i < length; i++) { - const fromCode = from.charCodeAt(fromStart + i); - if (fromCode !== to.charCodeAt(toStart + i)) { - break; - } - else if (fromCode === CHAR_BACKWARD_SLASH) { - lastCommonSep = i; - } - } - // We found a mismatch before the first common path separator was seen, so - // return the original `to`. - if (i !== length) { - if (lastCommonSep === -1) { - return toOrig; - } - } - else { - if (toLen > length) { - if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) { - // We get here if `from` is the exact base path for `to`. - // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz' - return toOrig.slice(toStart + i + 1); - } - if (i === 2) { - // We get here if `from` is the device root. - // For example: from='C:\\'; to='C:\\foo' - return toOrig.slice(toStart + i); - } - } - if (fromLen > length) { - if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) { - // We get here if `to` is the exact base path for `from`. - // For example: from='C:\\foo\\bar'; to='C:\\foo' - lastCommonSep = i; - } - else if (i === 2) { - // We get here if `to` is the device root. - // For example: from='C:\\foo\\bar'; to='C:\\' - lastCommonSep = 3; - } - } - if (lastCommonSep === -1) { - lastCommonSep = 0; - } - } - let out = ''; - // Generate the relative path based on the path difference between `to` and - // `from` - for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { - if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) { - out += out.length === 0 ? '..' : '\\..'; - } - } - toStart += lastCommonSep; - // Lastly, append the rest of the destination (`to`) path that comes after - // the common path parts - if (out.length > 0) { - return `${out}${toOrig.slice(toStart, toEnd)}`; - } - if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) { - ++toStart; - } - return toOrig.slice(toStart, toEnd); - }, - toNamespacedPath(path) { - // Note: this will *probably* throw somewhere. - if (typeof path !== 'string') { - return path; - } - if (path.length === 0) { - return ''; - } - const resolvedPath = win32.resolve(path); - if (resolvedPath.length <= 2) { - return path; - } - if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) { - // Possible UNC root - if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) { - const code = resolvedPath.charCodeAt(2); - if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) { - // Matched non-long UNC root, convert the path to a long UNC path - return `\\\\?\\UNC\\${resolvedPath.slice(2)}`; - } - } - } - else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) && - resolvedPath.charCodeAt(1) === CHAR_COLON && - resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) { - // Matched device root, convert the path to a long UNC path - return `\\\\?\\${resolvedPath}`; - } - return path; - }, - dirname(path) { - validateString(path, 'path'); - const len = path.length; - if (len === 0) { - return '.'; - } - let rootEnd = -1; - let offset = 0; - const code = path.charCodeAt(0); - if (len === 1) { - // `path` contains just a path separator, exit early to avoid - // unnecessary work or a dot. - return isPathSeparator(code) ? path : '.'; - } - // Try to match a root - if (isPathSeparator(code)) { - // Possible UNC root - rootEnd = offset = 1; - if (isPathSeparator(path.charCodeAt(1))) { - // Matched double path separator at beginning - let j = 2; - let last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more path separators - while (j < len && isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j === len) { - // We matched a UNC root only - return path; - } - if (j !== last) { - // We matched a UNC root with leftovers - // Offset by 1 to include the separator after the UNC root to - // treat it as a "normal root" on top of a (UNC) root - rootEnd = offset = j + 1; - } - } - } - } - // Possible device root - } - else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { - rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2; - offset = rootEnd; - } - let end = -1; - let matchedSlash = true; - for (let i = len - 1; i >= offset; --i) { - if (isPathSeparator(path.charCodeAt(i))) { - if (!matchedSlash) { - end = i; - break; - } - } - else { - // We saw the first non-path separator - matchedSlash = false; - } - } - if (end === -1) { - if (rootEnd === -1) { - return '.'; - } - end = rootEnd; - } - return path.slice(0, end); - }, - basename(path, ext) { - if (ext !== undefined) { - validateString(ext, 'ext'); - } - validateString(path, 'path'); - let start = 0; - let end = -1; - let matchedSlash = true; - let i; - // Check for a drive letter prefix so as not to mistake the following - // path separator as an extra separator at the end of the path that can be - // disregarded - if (path.length >= 2 && - isWindowsDeviceRoot(path.charCodeAt(0)) && - path.charCodeAt(1) === CHAR_COLON) { - start = 2; - } - if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { - if (ext === path) { - return ''; - } - let extIdx = ext.length - 1; - let firstNonSlashEnd = -1; - for (i = path.length - 1; i >= start; --i) { - const code = path.charCodeAt(i); - if (isPathSeparator(code)) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } - else { - if (firstNonSlashEnd === -1) { - // We saw the first non-path separator, remember this index in case - // we need it if the extension ends up not matching - matchedSlash = false; - firstNonSlashEnd = i + 1; - } - if (extIdx >= 0) { - // Try to match the explicit extension - if (code === ext.charCodeAt(extIdx)) { - if (--extIdx === -1) { - // We matched the extension, so mark this as the end of our path - // component - end = i; - } - } - else { - // Extension does not match, so our result is the entire path - // component - extIdx = -1; - end = firstNonSlashEnd; - } - } - } - } - if (start === end) { - end = firstNonSlashEnd; - } - else if (end === -1) { - end = path.length; - } - return path.slice(start, end); - } - for (i = path.length - 1; i >= start; --i) { - if (isPathSeparator(path.charCodeAt(i))) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } - else if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // path component - matchedSlash = false; - end = i + 1; - } - } - if (end === -1) { - return ''; - } - return path.slice(start, end); - }, - extname(path) { - validateString(path, 'path'); - let start = 0; - let startDot = -1; - let startPart = 0; - let end = -1; - let matchedSlash = true; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - let preDotState = 0; - // Check for a drive letter prefix so as not to mistake the following - // path separator as an extra separator at the end of the path that can be - // disregarded - if (path.length >= 2 && - path.charCodeAt(1) === CHAR_COLON && - isWindowsDeviceRoot(path.charCodeAt(0))) { - start = startPart = 2; - } - for (let i = path.length - 1; i >= start; --i) { - const code = path.charCodeAt(i); - if (isPathSeparator(code)) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === CHAR_DOT) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) { - startDot = i; - } - else if (preDotState !== 1) { - preDotState = 1; - } - } - else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if (startDot === -1 || - end === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1)) { - return ''; - } - return path.slice(startDot, end); - }, - format: _format.bind(null, '\\'), - parse(path) { - validateString(path, 'path'); - const ret = { root: '', dir: '', base: '', ext: '', name: '' }; - if (path.length === 0) { - return ret; - } - const len = path.length; - let rootEnd = 0; - let code = path.charCodeAt(0); - if (len === 1) { - if (isPathSeparator(code)) { - // `path` contains just a path separator, exit early to avoid - // unnecessary work - ret.root = ret.dir = path; - return ret; - } - ret.base = ret.name = path; - return ret; - } - // Try to match a root - if (isPathSeparator(code)) { - // Possible UNC root - rootEnd = 1; - if (isPathSeparator(path.charCodeAt(1))) { - // Matched double path separator at beginning - let j = 2; - let last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more path separators - while (j < len && isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j === len) { - // We matched a UNC root only - rootEnd = j; - } - else if (j !== last) { - // We matched a UNC root with leftovers - rootEnd = j + 1; - } - } - } - } - } - else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { - // Possible device root - if (len <= 2) { - // `path` contains just a drive root, exit early to avoid - // unnecessary work - ret.root = ret.dir = path; - return ret; - } - rootEnd = 2; - if (isPathSeparator(path.charCodeAt(2))) { - if (len === 3) { - // `path` contains just a drive root, exit early to avoid - // unnecessary work - ret.root = ret.dir = path; - return ret; - } - rootEnd = 3; - } - } - if (rootEnd > 0) { - ret.root = path.slice(0, rootEnd); - } - let startDot = -1; - let startPart = rootEnd; - let end = -1; - let matchedSlash = true; - let i = path.length - 1; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - let preDotState = 0; - // Get non-dir info - for (; i >= rootEnd; --i) { - code = path.charCodeAt(i); - if (isPathSeparator(code)) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === CHAR_DOT) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) { - startDot = i; - } - else if (preDotState !== 1) { - preDotState = 1; - } - } - else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if (end !== -1) { - if (startDot === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1)) { - ret.base = ret.name = path.slice(startPart, end); - } - else { - ret.name = path.slice(startPart, startDot); - ret.base = path.slice(startPart, end); - ret.ext = path.slice(startDot, end); - } - } - // If the directory is the root, use the entire root as the `dir` including - // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the - // trailing slash (`C:\abc\def` -> `C:\abc`). - if (startPart > 0 && startPart !== rootEnd) { - ret.dir = path.slice(0, startPart - 1); - } - else { - ret.dir = ret.root; - } - return ret; - }, - sep: '\\', - delimiter: ';', - win32: null, - posix: null -}; -const posix = { - // path.resolve([from ...], to) - resolve(...pathSegments) { - let resolvedPath = ''; - let resolvedAbsolute = false; - for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - const path = i >= 0 ? pathSegments[i] : _process_js__WEBPACK_IMPORTED_MODULE_0__["cwd"](); - validateString(path, 'path'); - // Skip empty entries - if (path.length === 0) { - continue; - } - resolvedPath = `${path}/${resolvedPath}`; - resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; - } - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - // Normalize the path - resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, '/', isPosixPathSeparator); - if (resolvedAbsolute) { - return `/${resolvedPath}`; - } - return resolvedPath.length > 0 ? resolvedPath : '.'; - }, - normalize(path) { - validateString(path, 'path'); - if (path.length === 0) { - return '.'; - } - const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; - const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH; - // Normalize the path - path = normalizeString(path, !isAbsolute, '/', isPosixPathSeparator); - if (path.length === 0) { - if (isAbsolute) { - return '/'; - } - return trailingSeparator ? './' : '.'; - } - if (trailingSeparator) { - path += '/'; - } - return isAbsolute ? `/${path}` : path; - }, - isAbsolute(path) { - validateString(path, 'path'); - return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH; - }, - join(...paths) { - if (paths.length === 0) { - return '.'; - } - let joined; - for (let i = 0; i < paths.length; ++i) { - const arg = paths[i]; - validateString(arg, 'path'); - if (arg.length > 0) { - if (joined === undefined) { - joined = arg; - } - else { - joined += `/${arg}`; - } - } - } - if (joined === undefined) { - return '.'; - } - return posix.normalize(joined); - }, - relative(from, to) { - validateString(from, 'from'); - validateString(to, 'to'); - if (from === to) { - return ''; - } - // Trim leading forward slashes. - from = posix.resolve(from); - to = posix.resolve(to); - if (from === to) { - return ''; - } - const fromStart = 1; - const fromEnd = from.length; - const fromLen = fromEnd - fromStart; - const toStart = 1; - const toLen = to.length - toStart; - // Compare paths to find the longest common path from root - const length = (fromLen < toLen ? fromLen : toLen); - let lastCommonSep = -1; - let i = 0; - for (; i < length; i++) { - const fromCode = from.charCodeAt(fromStart + i); - if (fromCode !== to.charCodeAt(toStart + i)) { - break; - } - else if (fromCode === CHAR_FORWARD_SLASH) { - lastCommonSep = i; - } - } - if (i === length) { - if (toLen > length) { - if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) { - // We get here if `from` is the exact base path for `to`. - // For example: from='/foo/bar'; to='/foo/bar/baz' - return to.slice(toStart + i + 1); - } - if (i === 0) { - // We get here if `from` is the root - // For example: from='/'; to='/foo' - return to.slice(toStart + i); - } - } - else if (fromLen > length) { - if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) { - // We get here if `to` is the exact base path for `from`. - // For example: from='/foo/bar/baz'; to='/foo/bar' - lastCommonSep = i; - } - else if (i === 0) { - // We get here if `to` is the root. - // For example: from='/foo/bar'; to='/' - lastCommonSep = 0; - } - } - } - let out = ''; - // Generate the relative path based on the path difference between `to` - // and `from`. - for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { - if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) { - out += out.length === 0 ? '..' : '/..'; - } - } - // Lastly, append the rest of the destination (`to`) path that comes after - // the common path parts. - return `${out}${to.slice(toStart + lastCommonSep)}`; - }, - toNamespacedPath(path) { - // Non-op on posix systems - return path; - }, - dirname(path) { - validateString(path, 'path'); - if (path.length === 0) { - return '.'; - } - const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH; - let end = -1; - let matchedSlash = true; - for (let i = path.length - 1; i >= 1; --i) { - if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { - if (!matchedSlash) { - end = i; - break; - } - } - else { - // We saw the first non-path separator - matchedSlash = false; - } - } - if (end === -1) { - return hasRoot ? '/' : '.'; - } - if (hasRoot && end === 1) { - return '//'; - } - return path.slice(0, end); - }, - basename(path, ext) { - if (ext !== undefined) { - validateString(ext, 'ext'); - } - validateString(path, 'path'); - let start = 0; - let end = -1; - let matchedSlash = true; - let i; - if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { - if (ext === path) { - return ''; - } - let extIdx = ext.length - 1; - let firstNonSlashEnd = -1; - for (i = path.length - 1; i >= 0; --i) { - const code = path.charCodeAt(i); - if (code === CHAR_FORWARD_SLASH) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } - else { - if (firstNonSlashEnd === -1) { - // We saw the first non-path separator, remember this index in case - // we need it if the extension ends up not matching - matchedSlash = false; - firstNonSlashEnd = i + 1; - } - if (extIdx >= 0) { - // Try to match the explicit extension - if (code === ext.charCodeAt(extIdx)) { - if (--extIdx === -1) { - // We matched the extension, so mark this as the end of our path - // component - end = i; - } - } - else { - // Extension does not match, so our result is the entire path - // component - extIdx = -1; - end = firstNonSlashEnd; - } - } - } - } - if (start === end) { - end = firstNonSlashEnd; - } - else if (end === -1) { - end = path.length; - } - return path.slice(start, end); - } - for (i = path.length - 1; i >= 0; --i) { - if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } - else if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // path component - matchedSlash = false; - end = i + 1; - } - } - if (end === -1) { - return ''; - } - return path.slice(start, end); - }, - extname(path) { - validateString(path, 'path'); - let startDot = -1; - let startPart = 0; - let end = -1; - let matchedSlash = true; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - let preDotState = 0; - for (let i = path.length - 1; i >= 0; --i) { - const code = path.charCodeAt(i); - if (code === CHAR_FORWARD_SLASH) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === CHAR_DOT) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) { - startDot = i; - } - else if (preDotState !== 1) { - preDotState = 1; - } - } - else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if (startDot === -1 || - end === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1)) { - return ''; - } - return path.slice(startDot, end); - }, - format: _format.bind(null, '/'), - parse(path) { - validateString(path, 'path'); - const ret = { root: '', dir: '', base: '', ext: '', name: '' }; - if (path.length === 0) { - return ret; - } - const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; - let start; - if (isAbsolute) { - ret.root = '/'; - start = 1; - } - else { - start = 0; - } - let startDot = -1; - let startPart = 0; - let end = -1; - let matchedSlash = true; - let i = path.length - 1; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - let preDotState = 0; - // Get non-dir info - for (; i >= start; --i) { - const code = path.charCodeAt(i); - if (code === CHAR_FORWARD_SLASH) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === CHAR_DOT) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) { - startDot = i; - } - else if (preDotState !== 1) { - preDotState = 1; - } - } - else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if (end !== -1) { - const start = startPart === 0 && isAbsolute ? 1 : startPart; - if (startDot === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1)) { - ret.base = ret.name = path.slice(start, end); - } - else { - ret.name = path.slice(start, startDot); - ret.base = path.slice(start, end); - ret.ext = path.slice(startDot, end); - } - } - if (startPart > 0) { - ret.dir = path.slice(0, startPart - 1); - } - else if (isAbsolute) { - ret.dir = '/'; - } - return ret; - }, - sep: '/', - delimiter: ':', - win32: null, - posix: null -}; -posix.win32 = win32.win32 = win32; -posix.posix = win32.posix = posix; -const normalize = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.normalize : posix.normalize); -const resolve = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.resolve : posix.resolve); -const relative = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.relative : posix.relative); -const dirname = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.dirname : posix.dirname); -const basename = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.basename : posix.basename); -const extname = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.extname : posix.extname); -const sep = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.sep : posix.sep); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/platform.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/platform.js ***! - \*******************************************************************/ -/*! exports provided: isWindows, isMacintosh, isLinux, isNative, isWeb, isIOS, globals, setImmediate, OS, isLittleEndian */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(process, global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWindows", function() { return isWindows; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMacintosh", function() { return isMacintosh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinux", function() { return isLinux; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return isNative; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWeb", function() { return isWeb; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIOS", function() { return isIOS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "globals", function() { return globals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setImmediate", function() { return setImmediate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OS", function() { return OS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLittleEndian", function() { return isLittleEndian; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -const LANGUAGE_DEFAULT = 'en'; -let _isWindows = false; -let _isMacintosh = false; -let _isLinux = false; -let _isNative = false; -let _isWeb = false; -let _isIOS = false; -let _locale = undefined; -let _language = LANGUAGE_DEFAULT; -let _translationsConfigFile = undefined; -let _userAgent = undefined; -const isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); -// OS detection -if (typeof navigator === 'object' && !isElectronRenderer) { - _userAgent = navigator.userAgent; - _isWindows = _userAgent.indexOf('Windows') >= 0; - _isMacintosh = _userAgent.indexOf('Macintosh') >= 0; - _isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0; - _isLinux = _userAgent.indexOf('Linux') >= 0; - _isWeb = true; - _locale = navigator.language; - _language = _locale; -} -else if (typeof process === 'object') { - _isWindows = (process.platform === 'win32'); - _isMacintosh = (process.platform === 'darwin'); - _isLinux = (process.platform === 'linux'); - _locale = LANGUAGE_DEFAULT; - _language = LANGUAGE_DEFAULT; - const rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; - if (rawNlsConfig) { - try { - const nlsConfig = JSON.parse(rawNlsConfig); - const resolved = nlsConfig.availableLanguages['*']; - _locale = nlsConfig.locale; - // VSCode's default language is 'en' - _language = resolved ? resolved : LANGUAGE_DEFAULT; - _translationsConfigFile = nlsConfig._translationsConfigFile; - } - catch (e) { - } - } - _isNative = true; -} -let _platform = 0 /* Web */; -if (_isMacintosh) { - _platform = 1 /* Mac */; -} -else if (_isWindows) { - _platform = 3 /* Windows */; -} -else if (_isLinux) { - _platform = 2 /* Linux */; -} -const isWindows = _isWindows; -const isMacintosh = _isMacintosh; -const isLinux = _isLinux; -const isNative = _isNative; -const isWeb = _isWeb; -const isIOS = _isIOS; -const _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); -const globals = _globals; -const setImmediate = (function defineSetImmediate() { - if (globals.setImmediate) { - return globals.setImmediate.bind(globals); - } - if (typeof globals.postMessage === 'function' && !globals.importScripts) { - let pending = []; - globals.addEventListener('message', (e) => { - if (e.data && e.data.vscodeSetImmediateId) { - for (let i = 0, len = pending.length; i < len; i++) { - const candidate = pending[i]; - if (candidate.id === e.data.vscodeSetImmediateId) { - pending.splice(i, 1); - candidate.callback(); - return; - } - } - } - }); - let lastId = 0; - return (callback) => { - const myId = ++lastId; - pending.push({ - id: myId, - callback: callback - }); - globals.postMessage({ vscodeSetImmediateId: myId }, '*'); - }; - } - if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { - return process.nextTick.bind(process); - } - const _promise = Promise.resolve(); - return (callback) => _promise.then(callback); -})(); -const OS = (_isMacintosh || _isIOS ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); -let _isLittleEndian = true; -let _isLittleEndianComputed = false; -function isLittleEndian() { - if (!_isLittleEndianComputed) { - _isLittleEndianComputed = true; - const test = new Uint8Array(2); - test[0] = 1; - test[1] = 2; - const view = new Uint16Array(test.buffer); - _isLittleEndian = (view[0] === (2 << 8) + 1); - } - return _isLittleEndian; -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/process.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/process.js ***! - \******************************************************************/ -/*! exports provided: cwd, env, platform */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cwd", function() { return cwd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "env", function() { return env; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "platform", function() { return platform; }); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const safeProcess = (typeof process === 'undefined') ? { - cwd() { return '/'; }, - env: Object.create(null), - get platform() { return _platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"] ? 'win32' : _platform_js__WEBPACK_IMPORTED_MODULE_0__["isMacintosh"] ? 'darwin' : 'linux'; }, - nextTick(callback) { return Object(_platform_js__WEBPACK_IMPORTED_MODULE_0__["setImmediate"])(callback); } -} : process; -const cwd = safeProcess.cwd; -const env = safeProcess.env; -const platform = safeProcess.platform; - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "./node_modules/process/browser.js"))) - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/strings.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/strings.js ***! - \******************************************************************/ -/*! exports provided: isFalsyOrWhitespace, pad, format, escape, escapeRegExpCharacters, trim, ltrim, rtrim, convertSimple2RegExpPattern, stripWildcards, startsWith, endsWith, createRegExp, regExpLeadsToEndlessLoop, regExpFlags, firstNonWhitespaceIndex, getLeadingWhitespace, lastNonWhitespaceIndex, compare, compareSubstring, compareIgnoreCase, compareSubstringIgnoreCase, isLowerAsciiLetter, isUpperAsciiLetter, equalsIgnoreCase, startsWithIgnoreCase, commonPrefixLength, commonSuffixLength, isHighSurrogate, isLowSurrogate, computeCodePoint, getNextCodePoint, nextCharLength, prevCharLength, decodeUTF8, containsRTL, containsEmoji, isBasicASCII, UNUSUAL_LINE_TERMINATORS, containsUnusualLineTerminators, containsFullWidthCharacter, isFullWidthCharacter, isEmojiImprecise, UTF8_BOM_CHARACTER, startsWithUTF8BOM, containsUppercaseCharacter, singleLetterHash, getGraphemeBreakType, breakBetweenGraphemeBreakType */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrWhitespace", function() { return isFalsyOrWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return pad; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return escape; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeRegExpCharacters", function() { return escapeRegExpCharacters; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return trim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ltrim", function() { return ltrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtrim", function() { return rtrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSimple2RegExpPattern", function() { return convertSimple2RegExpPattern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripWildcards", function() { return stripWildcards; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRegExp", function() { return createRegExp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpLeadsToEndlessLoop", function() { return regExpLeadsToEndlessLoop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpFlags", function() { return regExpFlags; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstNonWhitespaceIndex", function() { return firstNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLeadingWhitespace", function() { return getLeadingWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastNonWhitespaceIndex", function() { return lastNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compare", function() { return compare; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareSubstring", function() { return compareSubstring; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareIgnoreCase", function() { return compareIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareSubstringIgnoreCase", function() { return compareSubstringIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowerAsciiLetter", function() { return isLowerAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUpperAsciiLetter", function() { return isUpperAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equalsIgnoreCase", function() { return equalsIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithIgnoreCase", function() { return startsWithIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonPrefixLength", function() { return commonPrefixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonSuffixLength", function() { return commonSuffixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogate", function() { return isHighSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogate", function() { return isLowSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeCodePoint", function() { return computeCodePoint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNextCodePoint", function() { return getNextCodePoint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nextCharLength", function() { return nextCharLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prevCharLength", function() { return prevCharLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeUTF8", function() { return decodeUTF8; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsRTL", function() { return containsRTL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsEmoji", function() { return containsEmoji; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBasicASCII", function() { return isBasicASCII; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNUSUAL_LINE_TERMINATORS", function() { return UNUSUAL_LINE_TERMINATORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsUnusualLineTerminators", function() { return containsUnusualLineTerminators; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsFullWidthCharacter", function() { return containsFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFullWidthCharacter", function() { return isFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmojiImprecise", function() { return isEmojiImprecise; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UTF8_BOM_CHARACTER", function() { return UTF8_BOM_CHARACTER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithUTF8BOM", function() { return startsWithUTF8BOM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsUppercaseCharacter", function() { return containsUppercaseCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "singleLetterHash", function() { return singleLetterHash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGraphemeBreakType", function() { return getGraphemeBreakType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "breakBetweenGraphemeBreakType", function() { return breakBetweenGraphemeBreakType; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function isFalsyOrWhitespace(str) { - if (!str || typeof str !== 'string') { - return true; - } - return str.trim().length === 0; -} -/** - * @deprecated ES6: use `String.padStart` - */ -function pad(n, l, char = '0') { - const str = '' + n; - const r = [str]; - for (let i = str.length; i < l; i++) { - r.push(char); - } - return r.reverse().join(''); -} -const _formatRegexp = /{(\d+)}/g; -/** - * Helper to produce a string with a variable number of arguments. Insert variable segments - * into the string using the {n} notation where N is the index of the argument following the string. - * @param value string to which formatting is applied - * @param args replacements for {n}-entries - */ -function format(value, ...args) { - if (args.length === 0) { - return value; - } - return value.replace(_formatRegexp, function (match, group) { - const idx = parseInt(group, 10); - return isNaN(idx) || idx < 0 || idx >= args.length ? - match : - args[idx]; - }); -} -/** - * Converts HTML characters inside the string to use entities instead. Makes the string safe from - * being used e.g. in HTMLElement.innerHTML. - */ -function escape(html) { - return html.replace(/[<>&]/g, function (match) { - switch (match) { - case '<': return '<'; - case '>': return '>'; - case '&': return '&'; - default: return match; - } - }); -} -/** - * Escapes regular expression characters in a given string - */ -function escapeRegExpCharacters(value) { - return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, '\\$&'); -} -/** - * Removes all occurrences of needle from the beginning and end of haystack. - * @param haystack string to trim - * @param needle the thing to trim (default is a blank) - */ -function trim(haystack, needle = ' ') { - const trimmed = ltrim(haystack, needle); - return rtrim(trimmed, needle); -} -/** - * Removes all occurrences of needle from the beginning of haystack. - * @param haystack string to trim - * @param needle the thing to trim - */ -function ltrim(haystack, needle) { - if (!haystack || !needle) { - return haystack; - } - const needleLen = needle.length; - if (needleLen === 0 || haystack.length === 0) { - return haystack; - } - let offset = 0; - while (haystack.indexOf(needle, offset) === offset) { - offset = offset + needleLen; - } - return haystack.substring(offset); -} -/** - * Removes all occurrences of needle from the end of haystack. - * @param haystack string to trim - * @param needle the thing to trim - */ -function rtrim(haystack, needle) { - if (!haystack || !needle) { - return haystack; - } - const needleLen = needle.length, haystackLen = haystack.length; - if (needleLen === 0 || haystackLen === 0) { - return haystack; - } - let offset = haystackLen, idx = -1; - while (true) { - idx = haystack.lastIndexOf(needle, offset - 1); - if (idx === -1 || idx + needleLen !== offset) { - break; - } - if (idx === 0) { - return ''; - } - offset = idx; - } - return haystack.substring(0, offset); -} -function convertSimple2RegExpPattern(pattern) { - return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*'); -} -function stripWildcards(pattern) { - return pattern.replace(/\*/g, ''); -} -/** - * @deprecated ES6: use `String.startsWith` - */ -function startsWith(haystack, needle) { - if (haystack.length < needle.length) { - return false; - } - if (haystack === needle) { - return true; - } - for (let i = 0; i < needle.length; i++) { - if (haystack[i] !== needle[i]) { - return false; - } - } - return true; -} -/** - * @deprecated ES6: use `String.endsWith` - */ -function endsWith(haystack, needle) { - const diff = haystack.length - needle.length; - if (diff > 0) { - return haystack.indexOf(needle, diff) === diff; - } - else if (diff === 0) { - return haystack === needle; - } - else { - return false; - } -} -function createRegExp(searchString, isRegex, options = {}) { - if (!searchString) { - throw new Error('Cannot create regex from empty string'); - } - if (!isRegex) { - searchString = escapeRegExpCharacters(searchString); - } - if (options.wholeWord) { - if (!/\B/.test(searchString.charAt(0))) { - searchString = '\\b' + searchString; - } - if (!/\B/.test(searchString.charAt(searchString.length - 1))) { - searchString = searchString + '\\b'; - } - } - let modifiers = ''; - if (options.global) { - modifiers += 'g'; - } - if (!options.matchCase) { - modifiers += 'i'; - } - if (options.multiline) { - modifiers += 'm'; - } - if (options.unicode) { - modifiers += 'u'; - } - return new RegExp(searchString, modifiers); -} -function regExpLeadsToEndlessLoop(regexp) { - // Exit early if it's one of these special cases which are meant to match - // against an empty string - if (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\s*$') { - return false; - } - // We check against an empty string. If the regular expression doesn't advance - // (e.g. ends in an endless loop) it will match an empty string. - const match = regexp.exec(''); - return !!(match && regexp.lastIndex === 0); -} -function regExpFlags(regexp) { - return (regexp.global ? 'g' : '') - + (regexp.ignoreCase ? 'i' : '') - + (regexp.multiline ? 'm' : '') - + (regexp /* standalone editor compilation */.unicode ? 'u' : ''); -} -/** - * Returns first index of the string that is not whitespace. - * If string is empty or contains only whitespaces, returns -1 - */ -function firstNonWhitespaceIndex(str) { - for (let i = 0, len = str.length; i < len; i++) { - const chCode = str.charCodeAt(i); - if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) { - return i; - } - } - return -1; -} -/** - * Returns the leading whitespace of the string. - * If the string contains only whitespaces, returns entire string - */ -function getLeadingWhitespace(str, start = 0, end = str.length) { - for (let i = start; i < end; i++) { - const chCode = str.charCodeAt(i); - if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) { - return str.substring(start, i); - } - } - return str.substring(start, end); -} -/** - * Returns last index of the string that is not whitespace. - * If string is empty or contains only whitespaces, returns -1 - */ -function lastNonWhitespaceIndex(str, startIndex = str.length - 1) { - for (let i = startIndex; i >= 0; i--) { - const chCode = str.charCodeAt(i); - if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) { - return i; - } - } - return -1; -} -function compare(a, b) { - if (a < b) { - return -1; - } - else if (a > b) { - return 1; - } - else { - return 0; - } -} -function compareSubstring(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) { - for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) { - let codeA = a.charCodeAt(aStart); - let codeB = b.charCodeAt(bStart); - if (codeA < codeB) { - return -1; - } - else if (codeA > codeB) { - return 1; - } - } - const aLen = aEnd - aStart; - const bLen = bEnd - bStart; - if (aLen < bLen) { - return -1; - } - else if (aLen > bLen) { - return 1; - } - return 0; -} -function compareIgnoreCase(a, b) { - return compareSubstringIgnoreCase(a, b, 0, a.length, 0, b.length); -} -function compareSubstringIgnoreCase(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) { - for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) { - let codeA = a.charCodeAt(aStart); - let codeB = b.charCodeAt(bStart); - if (codeA === codeB) { - // equal - continue; - } - const diff = codeA - codeB; - if (diff === 32 && isUpperAsciiLetter(codeB)) { //codeB =[65-90] && codeA =[97-122] - continue; - } - else if (diff === -32 && isUpperAsciiLetter(codeA)) { //codeB =[97-122] && codeA =[65-90] - continue; - } - if (isLowerAsciiLetter(codeA) && isLowerAsciiLetter(codeB)) { - // - return diff; - } - else { - return compareSubstring(a.toLowerCase(), b.toLowerCase(), aStart, aEnd, bStart, bEnd); - } - } - const aLen = aEnd - aStart; - const bLen = bEnd - bStart; - if (aLen < bLen) { - return -1; - } - else if (aLen > bLen) { - return 1; - } - return 0; -} -function isLowerAsciiLetter(code) { - return code >= 97 /* a */ && code <= 122 /* z */; -} -function isUpperAsciiLetter(code) { - return code >= 65 /* A */ && code <= 90 /* Z */; -} -function isAsciiLetter(code) { - return isLowerAsciiLetter(code) || isUpperAsciiLetter(code); -} -function equalsIgnoreCase(a, b) { - return a.length === b.length && doEqualsIgnoreCase(a, b); -} -function doEqualsIgnoreCase(a, b, stopAt = a.length) { - for (let i = 0; i < stopAt; i++) { - const codeA = a.charCodeAt(i); - const codeB = b.charCodeAt(i); - if (codeA === codeB) { - continue; - } - // a-z A-Z - if (isAsciiLetter(codeA) && isAsciiLetter(codeB)) { - const diff = Math.abs(codeA - codeB); - if (diff !== 0 && diff !== 32) { - return false; - } - } - // Any other charcode - else { - if (String.fromCharCode(codeA).toLowerCase() !== String.fromCharCode(codeB).toLowerCase()) { - return false; - } - } - } - return true; -} -function startsWithIgnoreCase(str, candidate) { - const candidateLength = candidate.length; - if (candidate.length > str.length) { - return false; - } - return doEqualsIgnoreCase(str, candidate, candidateLength); -} -/** - * @returns the length of the common prefix of the two strings. - */ -function commonPrefixLength(a, b) { - let i, len = Math.min(a.length, b.length); - for (i = 0; i < len; i++) { - if (a.charCodeAt(i) !== b.charCodeAt(i)) { - return i; - } - } - return len; -} -/** - * @returns the length of the common suffix of the two strings. - */ -function commonSuffixLength(a, b) { - let i, len = Math.min(a.length, b.length); - const aLastIndex = a.length - 1; - const bLastIndex = b.length - 1; - for (i = 0; i < len; i++) { - if (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) { - return i; - } - } - return len; -} -/** - * See http://en.wikipedia.org/wiki/Surrogate_pair - */ -function isHighSurrogate(charCode) { - return (0xD800 <= charCode && charCode <= 0xDBFF); -} -/** - * See http://en.wikipedia.org/wiki/Surrogate_pair - */ -function isLowSurrogate(charCode) { - return (0xDC00 <= charCode && charCode <= 0xDFFF); -} -/** - * See http://en.wikipedia.org/wiki/Surrogate_pair - */ -function computeCodePoint(highSurrogate, lowSurrogate) { - return ((highSurrogate - 0xD800) << 10) + (lowSurrogate - 0xDC00) + 0x10000; -} -/** - * get the code point that begins at offset `offset` - */ -function getNextCodePoint(str, len, offset) { - const charCode = str.charCodeAt(offset); - if (isHighSurrogate(charCode) && offset + 1 < len) { - const nextCharCode = str.charCodeAt(offset + 1); - if (isLowSurrogate(nextCharCode)) { - return computeCodePoint(charCode, nextCharCode); - } - } - return charCode; -} -/** - * get the code point that ends right before offset `offset` - */ -function getPrevCodePoint(str, offset) { - const charCode = str.charCodeAt(offset - 1); - if (isLowSurrogate(charCode) && offset > 1) { - const prevCharCode = str.charCodeAt(offset - 2); - if (isHighSurrogate(prevCharCode)) { - return computeCodePoint(prevCharCode, charCode); - } - } - return charCode; -} -function nextCharLength(str, offset) { - const graphemeBreakTree = GraphemeBreakTree.getInstance(); - const initialOffset = offset; - const len = str.length; - const initialCodePoint = getNextCodePoint(str, len, offset); - offset += (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint); - while (offset < len) { - const nextCodePoint = getNextCodePoint(str, len, offset); - const nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(nextCodePoint); - if (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) { - break; - } - offset += (nextCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - graphemeBreakType = nextGraphemeBreakType; - } - return (offset - initialOffset); -} -function prevCharLength(str, offset) { - const graphemeBreakTree = GraphemeBreakTree.getInstance(); - const initialOffset = offset; - const initialCodePoint = getPrevCodePoint(str, offset); - offset -= (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint); - while (offset > 0) { - const prevCodePoint = getPrevCodePoint(str, offset); - const prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(prevCodePoint); - if (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)) { - break; - } - offset -= (prevCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - graphemeBreakType = prevGraphemeBreakType; - } - return (initialOffset - offset); -} -/** - * A manual decoding of a UTF8 string. - * Use only in environments which do not offer native conversion methods! - */ -function decodeUTF8(buffer) { - // https://en.wikipedia.org/wiki/UTF-8 - const len = buffer.byteLength; - const result = []; - let offset = 0; - while (offset < len) { - const v0 = buffer[offset]; - let codePoint; - if (v0 >= 0b11110000 && offset + 3 < len) { - // 4 bytes - codePoint = ((((buffer[offset++] & 0b00000111) << 18) >>> 0) - | (((buffer[offset++] & 0b00111111) << 12) >>> 0) - | (((buffer[offset++] & 0b00111111) << 6) >>> 0) - | (((buffer[offset++] & 0b00111111) << 0) >>> 0)); - } - else if (v0 >= 0b11100000 && offset + 2 < len) { - // 3 bytes - codePoint = ((((buffer[offset++] & 0b00001111) << 12) >>> 0) - | (((buffer[offset++] & 0b00111111) << 6) >>> 0) - | (((buffer[offset++] & 0b00111111) << 0) >>> 0)); - } - else if (v0 >= 0b11000000 && offset + 1 < len) { - // 2 bytes - codePoint = ((((buffer[offset++] & 0b00011111) << 6) >>> 0) - | (((buffer[offset++] & 0b00111111) << 0) >>> 0)); - } - else { - // 1 byte - codePoint = buffer[offset++]; - } - if ((codePoint >= 0 && codePoint <= 0xD7FF) || (codePoint >= 0xE000 && codePoint <= 0xFFFF)) { - // Basic Multilingual Plane - result.push(String.fromCharCode(codePoint)); - } - else if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) { - // Supplementary Planes - const uPrime = codePoint - 0x10000; - const w1 = 0xD800 + ((uPrime & 0b11111111110000000000) >>> 10); - const w2 = 0xDC00 + ((uPrime & 0b00000000001111111111) >>> 0); - result.push(String.fromCharCode(w1)); - result.push(String.fromCharCode(w2)); - } - else { - // illegal code point - result.push(String.fromCharCode(0xFFFD)); - } - } - return result.join(''); -} -/** - * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-rtl-test.js - */ -const CONTAINS_RTL = /(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/; -/** - * Returns true if `str` contains any Unicode character that is classified as "R" or "AL". - */ -function containsRTL(str) { - return CONTAINS_RTL.test(str); -} -/** - * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js - */ -const CONTAINS_EMOJI = /(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/; -function containsEmoji(str) { - return CONTAINS_EMOJI.test(str); -} -const IS_BASIC_ASCII = /^[\t\n\r\x20-\x7E]*$/; -/** - * Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \n, \r, \t - */ -function isBasicASCII(str) { - return IS_BASIC_ASCII.test(str); -} -const UNUSUAL_LINE_TERMINATORS = /[\u2028\u2029]/; // LINE SEPARATOR (LS) or PARAGRAPH SEPARATOR (PS) -/** - * Returns true if `str` contains unusual line terminators, like LS or PS - */ -function containsUnusualLineTerminators(str) { - return UNUSUAL_LINE_TERMINATORS.test(str); -} -function containsFullWidthCharacter(str) { - for (let i = 0, len = str.length; i < len; i++) { - if (isFullWidthCharacter(str.charCodeAt(i))) { - return true; - } - } - return false; -} -function isFullWidthCharacter(charCode) { - // Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns - // http://jrgraphix.net/research/unicode_blocks.php - // 2E80 — 2EFF CJK Radicals Supplement - // 2F00 — 2FDF Kangxi Radicals - // 2FF0 — 2FFF Ideographic Description Characters - // 3000 — 303F CJK Symbols and Punctuation - // 3040 — 309F Hiragana - // 30A0 — 30FF Katakana - // 3100 — 312F Bopomofo - // 3130 — 318F Hangul Compatibility Jamo - // 3190 — 319F Kanbun - // 31A0 — 31BF Bopomofo Extended - // 31F0 — 31FF Katakana Phonetic Extensions - // 3200 — 32FF Enclosed CJK Letters and Months - // 3300 — 33FF CJK Compatibility - // 3400 — 4DBF CJK Unified Ideographs Extension A - // 4DC0 — 4DFF Yijing Hexagram Symbols - // 4E00 — 9FFF CJK Unified Ideographs - // A000 — A48F Yi Syllables - // A490 — A4CF Yi Radicals - // AC00 — D7AF Hangul Syllables - // [IGNORE] D800 — DB7F High Surrogates - // [IGNORE] DB80 — DBFF High Private Use Surrogates - // [IGNORE] DC00 — DFFF Low Surrogates - // [IGNORE] E000 — F8FF Private Use Area - // F900 — FAFF CJK Compatibility Ideographs - // [IGNORE] FB00 — FB4F Alphabetic Presentation Forms - // [IGNORE] FB50 — FDFF Arabic Presentation Forms-A - // [IGNORE] FE00 — FE0F Variation Selectors - // [IGNORE] FE20 — FE2F Combining Half Marks - // [IGNORE] FE30 — FE4F CJK Compatibility Forms - // [IGNORE] FE50 — FE6F Small Form Variants - // [IGNORE] FE70 — FEFF Arabic Presentation Forms-B - // FF00 — FFEF Halfwidth and Fullwidth Forms - // [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms] - // of which FF01 - FF5E fullwidth ASCII of 21 to 7E - // [IGNORE] and FF65 - FFDC halfwidth of Katakana and Hangul - // [IGNORE] FFF0 — FFFF Specials - charCode = +charCode; // @perf - return ((charCode >= 0x2E80 && charCode <= 0xD7AF) - || (charCode >= 0xF900 && charCode <= 0xFAFF) - || (charCode >= 0xFF01 && charCode <= 0xFF5E)); -} -/** - * A fast function (therefore imprecise) to check if code points are emojis. - * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js - */ -function isEmojiImprecise(x) { - return ((x >= 0x1F1E6 && x <= 0x1F1FF) || (x >= 9728 && x <= 10175) || (x >= 127744 && x <= 128591) - || (x >= 128640 && x <= 128764) || (x >= 128992 && x <= 129003) || (x >= 129280 && x <= 129535) - || (x >= 129648 && x <= 129651) || (x >= 129656 && x <= 129666) || (x >= 129680 && x <= 129685)); -} -// -- UTF-8 BOM -const UTF8_BOM_CHARACTER = String.fromCharCode(65279 /* UTF8_BOM */); -function startsWithUTF8BOM(str) { - return !!(str && str.length > 0 && str.charCodeAt(0) === 65279 /* UTF8_BOM */); -} -function containsUppercaseCharacter(target, ignoreEscapedChars = false) { - if (!target) { - return false; - } - if (ignoreEscapedChars) { - target = target.replace(/\\./g, ''); - } - return target.toLowerCase() !== target; -} -/** - * Produces 'a'-'z', followed by 'A'-'Z'... followed by 'a'-'z', etc. - */ -function singleLetterHash(n) { - const LETTERS_CNT = (90 /* Z */ - 65 /* A */ + 1); - n = n % (2 * LETTERS_CNT); - if (n < LETTERS_CNT) { - return String.fromCharCode(97 /* a */ + n); - } - return String.fromCharCode(65 /* A */ + n - LETTERS_CNT); -} -//#region Unicode Grapheme Break -function getGraphemeBreakType(codePoint) { - const graphemeBreakTree = GraphemeBreakTree.getInstance(); - return graphemeBreakTree.getGraphemeBreakType(codePoint); -} -function breakBetweenGraphemeBreakType(breakTypeA, breakTypeB) { - // http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules - // !!! Let's make the common case a bit faster - if (breakTypeA === 0 /* Other */) { - // see https://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakTest-13.0.0d10.html#table - return (breakTypeB !== 5 /* Extend */ && breakTypeB !== 7 /* SpacingMark */); - } - // Do not break between a CR and LF. Otherwise, break before and after controls. - // GB3 CR × LF - // GB4 (Control | CR | LF) ÷ - // GB5 ÷ (Control | CR | LF) - if (breakTypeA === 2 /* CR */) { - if (breakTypeB === 3 /* LF */) { - return false; // GB3 - } - } - if (breakTypeA === 4 /* Control */ || breakTypeA === 2 /* CR */ || breakTypeA === 3 /* LF */) { - return true; // GB4 - } - if (breakTypeB === 4 /* Control */ || breakTypeB === 2 /* CR */ || breakTypeB === 3 /* LF */) { - return true; // GB5 - } - // Do not break Hangul syllable sequences. - // GB6 L × (L | V | LV | LVT) - // GB7 (LV | V) × (V | T) - // GB8 (LVT | T) × T - if (breakTypeA === 8 /* L */) { - if (breakTypeB === 8 /* L */ || breakTypeB === 9 /* V */ || breakTypeB === 11 /* LV */ || breakTypeB === 12 /* LVT */) { - return false; // GB6 - } - } - if (breakTypeA === 11 /* LV */ || breakTypeA === 9 /* V */) { - if (breakTypeB === 9 /* V */ || breakTypeB === 10 /* T */) { - return false; // GB7 - } - } - if (breakTypeA === 12 /* LVT */ || breakTypeA === 10 /* T */) { - if (breakTypeB === 10 /* T */) { - return false; // GB8 - } - } - // Do not break before extending characters or ZWJ. - // GB9 × (Extend | ZWJ) - if (breakTypeB === 5 /* Extend */ || breakTypeB === 13 /* ZWJ */) { - return false; // GB9 - } - // The GB9a and GB9b rules only apply to extended grapheme clusters: - // Do not break before SpacingMarks, or after Prepend characters. - // GB9a × SpacingMark - // GB9b Prepend × - if (breakTypeB === 7 /* SpacingMark */) { - return false; // GB9a - } - if (breakTypeA === 1 /* Prepend */) { - return false; // GB9b - } - // Do not break within emoji modifier sequences or emoji zwj sequences. - // GB11 \p{Extended_Pictographic} Extend* ZWJ × \p{Extended_Pictographic} - if (breakTypeA === 13 /* ZWJ */ && breakTypeB === 14 /* Extended_Pictographic */) { - // Note: we are not implementing the rule entirely here to avoid introducing states - return false; // GB11 - } - // GB12 sot (RI RI)* RI × RI - // GB13 [^RI] (RI RI)* RI × RI - if (breakTypeA === 6 /* Regional_Indicator */ && breakTypeB === 6 /* Regional_Indicator */) { - // Note: we are not implementing the rule entirely here to avoid introducing states - return false; // GB12 & GB13 - } - // GB999 Any ÷ Any - return true; -} -class GraphemeBreakTree { - constructor() { - this._data = getGraphemeBreakRawData(); - } - static getInstance() { - if (!GraphemeBreakTree._INSTANCE) { - GraphemeBreakTree._INSTANCE = new GraphemeBreakTree(); - } - return GraphemeBreakTree._INSTANCE; - } - getGraphemeBreakType(codePoint) { - // !!! Let's make 7bit ASCII a bit faster: 0..31 - if (codePoint < 32) { - if (codePoint === 10 /* LineFeed */) { - return 3 /* LF */; - } - if (codePoint === 13 /* CarriageReturn */) { - return 2 /* CR */; - } - return 4 /* Control */; - } - // !!! Let's make 7bit ASCII a bit faster: 32..126 - if (codePoint < 127) { - return 0 /* Other */; - } - const data = this._data; - const nodeCount = data.length / 3; - let nodeIndex = 1; - while (nodeIndex <= nodeCount) { - if (codePoint < data[3 * nodeIndex]) { - // go left - nodeIndex = 2 * nodeIndex; - } - else if (codePoint > data[3 * nodeIndex + 1]) { - // go right - nodeIndex = 2 * nodeIndex + 1; - } - else { - // hit - return data[3 * nodeIndex + 2]; - } - } - return 0 /* Other */; - } -} -GraphemeBreakTree._INSTANCE = null; -function getGraphemeBreakRawData() { - // generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-grapheme-break.js - return JSON.parse('[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]'); -} -//#endregion - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/types.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/types.js ***! - \****************************************************************/ -/*! exports provided: isArray, isString, isObject, isNumber, isBoolean, isUndefined, isUndefinedOrNull, assertType, assertIsDefined, isFunction, validateConstraints, validateConstraint, getAllPropertyNames, getAllMethodNames, createProxyObject, withNullAsUndefined */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return isNumber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return isBoolean; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return isUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefinedOrNull", function() { return isUndefinedOrNull; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assertType", function() { return assertType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assertIsDefined", function() { return assertIsDefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraints", function() { return validateConstraints; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraint", function() { return validateConstraint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllPropertyNames", function() { return getAllPropertyNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllMethodNames", function() { return getAllMethodNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createProxyObject", function() { return createProxyObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withNullAsUndefined", function() { return withNullAsUndefined; }); -/** - * @returns whether the provided parameter is a JavaScript Array or not. - */ -function isArray(array) { - return Array.isArray(array); -} -/** - * @returns whether the provided parameter is a JavaScript String or not. - */ -function isString(str) { - return (typeof str === 'string'); -} -/** - * - * @returns whether the provided parameter is of type `object` but **not** - * `null`, an `array`, a `regexp`, nor a `date`. - */ -function isObject(obj) { - // The method can't do a type cast since there are type (like strings) which - // are subclasses of any put not positvely matched by the function. Hence type - // narrowing results in wrong results. - return typeof obj === 'object' - && obj !== null - && !Array.isArray(obj) - && !(obj instanceof RegExp) - && !(obj instanceof Date); -} -/** - * In **contrast** to just checking `typeof` this will return `false` for `NaN`. - * @returns whether the provided parameter is a JavaScript Number or not. - */ -function isNumber(obj) { - return (typeof obj === 'number' && !isNaN(obj)); -} -/** - * @returns whether the provided parameter is a JavaScript Boolean or not. - */ -function isBoolean(obj) { - return (obj === true || obj === false); -} -/** - * @returns whether the provided parameter is undefined. - */ -function isUndefined(obj) { - return (typeof obj === 'undefined'); -} -/** - * @returns whether the provided parameter is undefined or null. - */ -function isUndefinedOrNull(obj) { - return (isUndefined(obj) || obj === null); -} -function assertType(condition, type) { - if (!condition) { - throw new Error(type ? `Unexpected type, expected '${type}'` : 'Unexpected type'); - } -} -/** - * Asserts that the argument passed in is neither undefined nor null. - */ -function assertIsDefined(arg) { - if (isUndefinedOrNull(arg)) { - throw new Error('Assertion Failed: argument is undefined or null'); - } - return arg; -} -/** - * @returns whether the provided parameter is a JavaScript Function or not. - */ -function isFunction(obj) { - return (typeof obj === 'function'); -} -function validateConstraints(args, constraints) { - const len = Math.min(args.length, constraints.length); - for (let i = 0; i < len; i++) { - validateConstraint(args[i], constraints[i]); - } -} -function validateConstraint(arg, constraint) { - if (isString(constraint)) { - if (typeof arg !== constraint) { - throw new Error(`argument does not match constraint: typeof ${constraint}`); - } - } - else if (isFunction(constraint)) { - try { - if (arg instanceof constraint) { - return; - } - } - catch (_a) { - // ignore - } - if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { - return; - } - if (constraint.length === 1 && constraint.call(undefined, arg) === true) { - return; - } - throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`); - } -} -function getAllPropertyNames(obj) { - let res = []; - let proto = Object.getPrototypeOf(obj); - while (Object.prototype !== proto) { - res = res.concat(Object.getOwnPropertyNames(proto)); - proto = Object.getPrototypeOf(proto); - } - return res; -} -function getAllMethodNames(obj) { - const methods = []; - for (const prop of getAllPropertyNames(obj)) { - if (typeof obj[prop] === 'function') { - methods.push(prop); - } - } - return methods; -} -function createProxyObject(methodNames, invoke) { - const createProxyMethod = (method) => { - return function () { - const args = Array.prototype.slice.call(arguments, 0); - return invoke(method, args); - }; - }; - let result = {}; - for (const methodName of methodNames) { - result[methodName] = createProxyMethod(methodName); - } - return result; -} -/** - * Converts null to undefined, passes all other values through. - */ -function withNullAsUndefined(x) { - return x === null ? undefined : x; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/uint.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/uint.js ***! - \***************************************************************/ -/*! exports provided: toUint8, toUint32 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint8", function() { return toUint8; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32", function() { return toUint32; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function toUint8(v) { - if (v < 0) { - return 0; - } - if (v > 255 /* MAX_UINT_8 */) { - return 255 /* MAX_UINT_8 */; - } - return v | 0; -} -function toUint32(v) { - if (v < 0) { - return 0; - } - if (v > 4294967295 /* MAX_UINT_32 */) { - return 4294967295 /* MAX_UINT_32 */; - } - return v | 0; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/uri.js": -/*!**************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/uri.js ***! - \**************************************************************/ -/*! exports provided: URI, uriToFsPath */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "URI", function() { return URI; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uriToFsPath", function() { return uriToFsPath; }); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./path.js */ "./node_modules/monaco-editor/esm/vs/base/common/path.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -const _schemePattern = /^\w[\w\d+.-]*$/; -const _singleSlashStart = /^\//; -const _doubleSlashStart = /^\/\//; -function _validateUri(ret, _strict) { - // scheme, must be set - if (!ret.scheme && _strict) { - throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${ret.authority}", path: "${ret.path}", query: "${ret.query}", fragment: "${ret.fragment}"}`); - } - // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 - // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - if (ret.scheme && !_schemePattern.test(ret.scheme)) { - throw new Error('[UriError]: Scheme contains illegal characters.'); - } - // path, http://tools.ietf.org/html/rfc3986#section-3.3 - // If a URI contains an authority component, then the path component - // must either be empty or begin with a slash ("/") character. If a URI - // does not contain an authority component, then the path cannot begin - // with two slash characters ("//"). - if (ret.path) { - if (ret.authority) { - if (!_singleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); - } - } - else { - if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } - } - } -} -// for a while we allowed uris *without* schemes and this is the migration -// for them, e.g. an uri without scheme and without strict-mode warns and falls -// back to the file-scheme. that should cause the least carnage and still be a -// clear warning -function _schemeFix(scheme, _strict) { - if (!scheme && !_strict) { - return 'file'; - } - return scheme; -} -// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 -function _referenceResolution(scheme, path) { - // the slash-character is our 'default base' as we don't - // support constructing URIs relative to other URIs. This - // also means that we alter and potentially break paths. - // see https://tools.ietf.org/html/rfc3986#section-5.1.4 - switch (scheme) { - case 'https': - case 'http': - case 'file': - if (!path) { - path = _slash; - } - else if (path[0] !== _slash) { - path = _slash + path; - } - break; - } - return path; -} -const _empty = ''; -const _slash = '/'; -const _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; -/** - * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. - * This class is a simple parser which creates the basic component parts - * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation - * and encoding. - * - * ```txt - * foo://example.com:8042/over/there?name=ferret#nose - * \_/ \______________/\_________/ \_________/ \__/ - * | | | | | - * scheme authority path query fragment - * | _____________________|__ - * / \ / \ - * urn:example:animal:ferret:nose - * ``` - */ -class URI { - /** - * @internal - */ - constructor(schemeOrData, authority, path, query, fragment, _strict = false) { - if (typeof schemeOrData === 'object') { - this.scheme = schemeOrData.scheme || _empty; - this.authority = schemeOrData.authority || _empty; - this.path = schemeOrData.path || _empty; - this.query = schemeOrData.query || _empty; - this.fragment = schemeOrData.fragment || _empty; - // no validation because it's this URI - // that creates uri components. - // _validateUri(this); - } - else { - this.scheme = _schemeFix(schemeOrData, _strict); - this.authority = authority || _empty; - this.path = _referenceResolution(this.scheme, path || _empty); - this.query = query || _empty; - this.fragment = fragment || _empty; - _validateUri(this, _strict); - } - } - static isUri(thing) { - if (thing instanceof URI) { - return true; - } - if (!thing) { - return false; - } - return typeof thing.authority === 'string' - && typeof thing.fragment === 'string' - && typeof thing.path === 'string' - && typeof thing.query === 'string' - && typeof thing.scheme === 'string' - && typeof thing.fsPath === 'function' - && typeof thing.with === 'function' - && typeof thing.toString === 'function'; - } - // ---- filesystem path ----------------------- - /** - * Returns a string representing the corresponding file system path of this URI. - * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the - * platform specific path separator. - * - * * Will *not* validate the path for invalid characters and semantics. - * * Will *not* look at the scheme of this URI. - * * The result shall *not* be used for display purposes but for accessing a file on disk. - * - * - * The *difference* to `URI#path` is the use of the platform specific separator and the handling - * of UNC paths. See the below sample of a file-uri with an authority (UNC path). - * - * ```ts - const u = URI.parse('file://server/c$/folder/file.txt') - u.authority === 'server' - u.path === '/shares/c$/file.txt' - u.fsPath === '\\server\c$\folder\file.txt' - ``` - * - * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, - * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working - * with URIs that represent files on disk (`file` scheme). - */ - get fsPath() { - // if (this.scheme !== 'file') { - // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); - // } - return uriToFsPath(this, false); - } - // ---- modify to new ------------------------- - with(change) { - if (!change) { - return this; - } - let { scheme, authority, path, query, fragment } = change; - if (scheme === undefined) { - scheme = this.scheme; - } - else if (scheme === null) { - scheme = _empty; - } - if (authority === undefined) { - authority = this.authority; - } - else if (authority === null) { - authority = _empty; - } - if (path === undefined) { - path = this.path; - } - else if (path === null) { - path = _empty; - } - if (query === undefined) { - query = this.query; - } - else if (query === null) { - query = _empty; - } - if (fragment === undefined) { - fragment = this.fragment; - } - else if (fragment === null) { - fragment = _empty; - } - if (scheme === this.scheme - && authority === this.authority - && path === this.path - && query === this.query - && fragment === this.fragment) { - return this; - } - return new Uri(scheme, authority, path, query, fragment); - } - // ---- parse & validate ------------------------ - /** - * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, - * `file:///usr/home`, or `scheme:with/path`. - * - * @param value A string which represents an URI (see `URI#toString`). - */ - static parse(value, _strict = false) { - const match = _regexp.exec(value); - if (!match) { - return new Uri(_empty, _empty, _empty, _empty, _empty); - } - return new Uri(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict); - } - /** - * Creates a new URI from a file system path, e.g. `c:\my\files`, - * `/usr/home`, or `\\server\share\some\path`. - * - * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument - * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** - * `URI.parse('file://' + path)` because the path might contain characters that are - * interpreted (# and ?). See the following sample: - * ```ts - const good = URI.file('/coding/c#/project1'); - good.scheme === 'file'; - good.path === '/coding/c#/project1'; - good.fragment === ''; - const bad = URI.parse('file://' + '/coding/c#/project1'); - bad.scheme === 'file'; - bad.path === '/coding/c'; // path is now broken - bad.fragment === '/project1'; - ``` - * - * @param path A file system path (see `URI#fsPath`) - */ - static file(path) { - let authority = _empty; - // normalize to fwd-slashes on windows, - // on other systems bwd-slashes are valid - // filename character, eg /f\oo/ba\r.txt - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - path = path.replace(/\\/g, _slash); - } - // check for authority as used in UNC shares - // or use the path as given - if (path[0] === _slash && path[1] === _slash) { - const idx = path.indexOf(_slash, 2); - if (idx === -1) { - authority = path.substring(2); - path = _slash; - } - else { - authority = path.substring(2, idx); - path = path.substring(idx) || _slash; - } - } - return new Uri('file', authority, path, _empty, _empty); - } - static from(components) { - return new Uri(components.scheme, components.authority, components.path, components.query, components.fragment); - } - /** - * Join a URI path with path fragments and normalizes the resulting path. - * - * @param uri The input URI. - * @param pathFragment The path fragment to add to the URI path. - * @returns The resulting URI. - */ - static joinPath(uri, ...pathFragment) { - if (!uri.path) { - throw new Error(`[UriError]: cannot call joinPaths on URI without path`); - } - let newPath; - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"] && uri.scheme === 'file') { - newPath = URI.file(_path_js__WEBPACK_IMPORTED_MODULE_1__["win32"].join(uriToFsPath(uri, true), ...pathFragment)).path; - } - else { - newPath = _path_js__WEBPACK_IMPORTED_MODULE_1__["posix"].join(uri.path, ...pathFragment); - } - return uri.with({ path: newPath }); - } - // ---- printing/externalize --------------------------- - /** - * Creates a string representation for this URI. It's guaranteed that calling - * `URI.parse` with the result of this function creates an URI which is equal - * to this URI. - * - * * The result shall *not* be used for display purposes but for externalization or transport. - * * The result will be encoded using the percentage encoding and encoding happens mostly - * ignore the scheme-specific encoding rules. - * - * @param skipEncoding Do not encode the result, default is `false` - */ - toString(skipEncoding = false) { - return _asFormatted(this, skipEncoding); - } - toJSON() { - return this; - } - static revive(data) { - if (!data) { - return data; - } - else if (data instanceof URI) { - return data; - } - else { - const result = new Uri(data); - result._formatted = data.external; - result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null; - return result; - } - } -} -const _pathSepMarker = _platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"] ? 1 : undefined; -// This class exists so that URI is compatibile with vscode.Uri (API). -class Uri extends URI { - constructor() { - super(...arguments); - this._formatted = null; - this._fsPath = null; - } - get fsPath() { - if (!this._fsPath) { - this._fsPath = uriToFsPath(this, false); - } - return this._fsPath; - } - toString(skipEncoding = false) { - if (!skipEncoding) { - if (!this._formatted) { - this._formatted = _asFormatted(this, false); - } - return this._formatted; - } - else { - // we don't cache that - return _asFormatted(this, true); - } - } - toJSON() { - const res = { - $mid: 1 - }; - // cached state - if (this._fsPath) { - res.fsPath = this._fsPath; - res._sep = _pathSepMarker; - } - if (this._formatted) { - res.external = this._formatted; - } - // uri components - if (this.path) { - res.path = this.path; - } - if (this.scheme) { - res.scheme = this.scheme; - } - if (this.authority) { - res.authority = this.authority; - } - if (this.query) { - res.query = this.query; - } - if (this.fragment) { - res.fragment = this.fragment; - } - return res; - } -} -// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 -const encodeTable = { - [58 /* Colon */]: '%3A', - [47 /* Slash */]: '%2F', - [63 /* QuestionMark */]: '%3F', - [35 /* Hash */]: '%23', - [91 /* OpenSquareBracket */]: '%5B', - [93 /* CloseSquareBracket */]: '%5D', - [64 /* AtSign */]: '%40', - [33 /* ExclamationMark */]: '%21', - [36 /* DollarSign */]: '%24', - [38 /* Ampersand */]: '%26', - [39 /* SingleQuote */]: '%27', - [40 /* OpenParen */]: '%28', - [41 /* CloseParen */]: '%29', - [42 /* Asterisk */]: '%2A', - [43 /* Plus */]: '%2B', - [44 /* Comma */]: '%2C', - [59 /* Semicolon */]: '%3B', - [61 /* Equals */]: '%3D', - [32 /* Space */]: '%20', -}; -function encodeURIComponentFast(uriComponent, allowSlash) { - let res = undefined; - let nativeEncodePos = -1; - for (let pos = 0; pos < uriComponent.length; pos++) { - const code = uriComponent.charCodeAt(pos); - // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 - if ((code >= 97 /* a */ && code <= 122 /* z */) - || (code >= 65 /* A */ && code <= 90 /* Z */) - || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) - || code === 45 /* Dash */ - || code === 46 /* Period */ - || code === 95 /* Underline */ - || code === 126 /* Tilde */ - || (allowSlash && code === 47 /* Slash */)) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // check if we write into a new string (by default we try to return the param) - if (res !== undefined) { - res += uriComponent.charAt(pos); - } - } - else { - // encoding needed, we need to allocate a new string - if (res === undefined) { - res = uriComponent.substr(0, pos); - } - // check with default table first - const escaped = encodeTable[code]; - if (escaped !== undefined) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // append escaped variant to result - res += escaped; - } - else if (nativeEncodePos === -1) { - // use native encode only when needed - nativeEncodePos = pos; - } - } - } - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); - } - return res !== undefined ? res : uriComponent; -} -function encodeURIComponentMinimal(path) { - let res = undefined; - for (let pos = 0; pos < path.length; pos++) { - const code = path.charCodeAt(pos); - if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { - if (res === undefined) { - res = path.substr(0, pos); - } - res += encodeTable[code]; - } - else { - if (res !== undefined) { - res += path[pos]; - } - } - } - return res !== undefined ? res : path; -} -/** - * Compute `fsPath` for the given uri - */ -function uriToFsPath(uri, keepDriveLetterCasing) { - let value; - if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { - // unc path: file://shares/c$/far/boo - value = `//${uri.authority}${uri.path}`; - } - else if (uri.path.charCodeAt(0) === 47 /* Slash */ - && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) - && uri.path.charCodeAt(2) === 58 /* Colon */) { - if (!keepDriveLetterCasing) { - // windows drive letter: file:///c:/far/boo - value = uri.path[1].toLowerCase() + uri.path.substr(2); - } - else { - value = uri.path.substr(1); - } - } - else { - // other path - value = uri.path; - } - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - value = value.replace(/\//g, '\\'); - } - return value; -} -/** - * Create the external version of a uri - */ -function _asFormatted(uri, skipEncoding) { - const encoder = !skipEncoding - ? encodeURIComponentFast - : encodeURIComponentMinimal; - let res = ''; - let { scheme, authority, path, query, fragment } = uri; - if (scheme) { - res += scheme; - res += ':'; - } - if (authority || scheme === 'file') { - res += _slash; - res += _slash; - } - if (authority) { - let idx = authority.indexOf('@'); - if (idx !== -1) { - // @ - const userinfo = authority.substr(0, idx); - authority = authority.substr(idx + 1); - idx = userinfo.indexOf(':'); - if (idx === -1) { - res += encoder(userinfo, false); - } - else { - // :@ - res += encoder(userinfo.substr(0, idx), false); - res += ':'; - res += encoder(userinfo.substr(idx + 1), false); - } - res += '@'; - } - authority = authority.toLowerCase(); - idx = authority.indexOf(':'); - if (idx === -1) { - res += encoder(authority, false); - } - else { - // : - res += encoder(authority.substr(0, idx), false); - res += authority.substr(idx); - } - } - if (path) { - // lower-case windows drive letters in /C:/fff or C:/fff - if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { - const code = path.charCodeAt(1); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`; // "/c:".length === 3 - } - } - else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { - const code = path.charCodeAt(0); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`; // "/c:".length === 3 - } - } - // encode the rest of the path - res += encoder(path, true); - } - if (query) { - res += '?'; - res += encoder(query, false); - } - if (fragment) { - res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; - } - return res; -} -// --- decode -function decodeURIComponentGraceful(str) { - try { - return decodeURIComponent(str); - } - catch (_a) { - if (str.length > 3) { - return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3)); - } - else { - return str; - } - } -} -const _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g; -function percentDecode(str) { - if (!str.match(_rEncodedAsHex)) { - return str; - } - return str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match)); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js ***! - \******************************************************************************/ -/*! exports provided: logOnceWebWorkerWarning, SimpleWorkerClient, SimpleWorkerServer, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logOnceWebWorkerWarning", function() { return logOnceWebWorkerWarning; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerClient", function() { return SimpleWorkerClient; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerServer", function() { return SimpleWorkerServer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -const INITIALIZE = '$initialize'; -let webWorkerWarningLogged = false; -function logOnceWebWorkerWarning(err) { - if (!_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWeb"]) { - // running tests - return; - } - if (!webWorkerWarningLogged) { - webWorkerWarningLogged = true; - console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); - } - console.warn(err.message); -} -class SimpleWorkerProtocol { - constructor(handler) { - this._workerId = -1; - this._handler = handler; - this._lastSentReq = 0; - this._pendingReplies = Object.create(null); - } - setWorkerId(workerId) { - this._workerId = workerId; - } - sendMessage(method, args) { - let req = String(++this._lastSentReq); - return new Promise((resolve, reject) => { - this._pendingReplies[req] = { - resolve: resolve, - reject: reject - }; - this._send({ - vsWorker: this._workerId, - req: req, - method: method, - args: args - }); - }); - } - handleMessage(message) { - if (!message || !message.vsWorker) { - return; - } - if (this._workerId !== -1 && message.vsWorker !== this._workerId) { - return; - } - this._handleMessage(message); - } - _handleMessage(msg) { - if (msg.seq) { - let replyMessage = msg; - if (!this._pendingReplies[replyMessage.seq]) { - console.warn('Got reply to unknown seq'); - return; - } - let reply = this._pendingReplies[replyMessage.seq]; - delete this._pendingReplies[replyMessage.seq]; - if (replyMessage.err) { - let err = replyMessage.err; - if (replyMessage.err.$isError) { - err = new Error(); - err.name = replyMessage.err.name; - err.message = replyMessage.err.message; - err.stack = replyMessage.err.stack; - } - reply.reject(err); - return; - } - reply.resolve(replyMessage.res); - return; - } - let requestMessage = msg; - let req = requestMessage.req; - let result = this._handler.handleMessage(requestMessage.method, requestMessage.args); - result.then((r) => { - this._send({ - vsWorker: this._workerId, - seq: req, - res: r, - err: undefined - }); - }, (e) => { - if (e.detail instanceof Error) { - // Loading errors have a detail property that points to the actual error - e.detail = Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e.detail); - } - this._send({ - vsWorker: this._workerId, - seq: req, - res: undefined, - err: Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e) - }); - }); - } - _send(msg) { - let transfer = []; - if (msg.req) { - const m = msg; - for (let i = 0; i < m.args.length; i++) { - if (m.args[i] instanceof ArrayBuffer) { - transfer.push(m.args[i]); - } - } - } - else { - const m = msg; - if (m.res instanceof ArrayBuffer) { - transfer.push(m.res); - } - } - this._handler.sendMessage(msg, transfer); - } -} -/** - * Main thread side - */ -class SimpleWorkerClient extends _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(workerFactory, moduleId, host) { - super(); - let lazyProxyReject = null; - this._worker = this._register(workerFactory.create('vs/base/common/worker/simpleWorker', (msg) => { - this._protocol.handleMessage(msg); - }, (err) => { - // in Firefox, web workers fail lazily :( - // we will reject the proxy - if (lazyProxyReject) { - lazyProxyReject(err); - } - })); - this._protocol = new SimpleWorkerProtocol({ - sendMessage: (msg, transfer) => { - this._worker.postMessage(msg, transfer); - }, - handleMessage: (method, args) => { - if (typeof host[method] !== 'function') { - return Promise.reject(new Error('Missing method ' + method + ' on main thread host.')); - } - try { - return Promise.resolve(host[method].apply(host, args)); - } - catch (e) { - return Promise.reject(e); - } - } - }); - this._protocol.setWorkerId(this._worker.getId()); - // Gather loader configuration - let loaderConfiguration = null; - if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { - // Get the configuration from the Monaco AMD Loader - loaderConfiguration = self.require.getConfig(); - } - else if (typeof self.requirejs !== 'undefined') { - // Get the configuration from requirejs - loaderConfiguration = self.requirejs.s.contexts._.config; - } - const hostMethods = _types_js__WEBPACK_IMPORTED_MODULE_3__["getAllMethodNames"](host); - // Send initialize message - this._onModuleLoaded = this._protocol.sendMessage(INITIALIZE, [ - this._worker.getId(), - JSON.parse(JSON.stringify(loaderConfiguration)), - moduleId, - hostMethods, - ]); - // Create proxy to loaded code - const proxyMethodRequest = (method, args) => { - return this._request(method, args); - }; - this._lazyProxy = new Promise((resolve, reject) => { - lazyProxyReject = reject; - this._onModuleLoaded.then((availableMethods) => { - resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__["createProxyObject"](availableMethods, proxyMethodRequest)); - }, (e) => { - reject(e); - this._onError('Worker failed to load ' + moduleId, e); - }); - }); - } - getProxyObject() { - return this._lazyProxy; - } - _request(method, args) { - return new Promise((resolve, reject) => { - this._onModuleLoaded.then(() => { - this._protocol.sendMessage(method, args).then(resolve, reject); - }, reject); - }); - } - _onError(message, error) { - console.error(message); - console.info(error); - } -} -/** - * Worker side - */ -class SimpleWorkerServer { - constructor(postMessage, requestHandlerFactory) { - this._requestHandlerFactory = requestHandlerFactory; - this._requestHandler = null; - this._protocol = new SimpleWorkerProtocol({ - sendMessage: (msg, transfer) => { - postMessage(msg, transfer); - }, - handleMessage: (method, args) => this._handleMessage(method, args) - }); - } - onmessage(msg) { - this._protocol.handleMessage(msg); - } - _handleMessage(method, args) { - if (method === INITIALIZE) { - return this.initialize(args[0], args[1], args[2], args[3]); - } - if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); - } - catch (e) { - return Promise.reject(e); - } - } - initialize(workerId, loaderConfig, moduleId, hostMethods) { - this._protocol.setWorkerId(workerId); - const proxyMethodRequest = (method, args) => { - return this._protocol.sendMessage(method, args); - }; - const hostProxy = _types_js__WEBPACK_IMPORTED_MODULE_3__["createProxyObject"](hostMethods, proxyMethodRequest); - if (this._requestHandlerFactory) { - // static request handler - this._requestHandler = this._requestHandlerFactory(hostProxy); - return Promise.resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllMethodNames"](this._requestHandler)); - } - if (loaderConfig) { - // Remove 'baseUrl', handling it is beyond scope for now - if (typeof loaderConfig.baseUrl !== 'undefined') { - delete loaderConfig['baseUrl']; - } - if (typeof loaderConfig.paths !== 'undefined') { - if (typeof loaderConfig.paths.vs !== 'undefined') { - delete loaderConfig.paths['vs']; - } - } - // Since this is in a web worker, enable catching errors - loaderConfig.catchError = true; - self.require.config(loaderConfig); - } - return new Promise((resolve, reject) => { - // Use the global require to be sure to get the global config - self.require([moduleId], (module) => { - this._requestHandler = module.create(hostProxy); - if (!this._requestHandler) { - reject(new Error(`No RequestHandler!`)); - return; - } - resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllMethodNames"](this._requestHandler)); - }, reject); - }); - } -} -/** - * Called on the worker side - */ -function create(postMessage) { - return new SimpleWorkerServer(postMessage, null); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js ***! - \*************************************************************************************/ -/*! exports provided: CharacterClassifier, CharacterSet */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterClassifier", function() { return CharacterClassifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterSet", function() { return CharacterSet; }); -/* harmony import */ var _base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uint.js */ "./node_modules/monaco-editor/esm/vs/base/common/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A fast character classifier that uses a compact array for ASCII values. - */ -class CharacterClassifier { - constructor(_defaultValue) { - let defaultValue = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_defaultValue); - this._defaultValue = defaultValue; - this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); - this._map = new Map(); - } - static _createAsciiMap(defaultValue) { - let asciiMap = new Uint8Array(256); - for (let i = 0; i < 256; i++) { - asciiMap[i] = defaultValue; - } - return asciiMap; - } - set(charCode, _value) { - let value = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_value); - if (charCode >= 0 && charCode < 256) { - this._asciiMap[charCode] = value; - } - else { - this._map.set(charCode, value); - } - } - get(charCode) { - if (charCode >= 0 && charCode < 256) { - return this._asciiMap[charCode]; - } - else { - return (this._map.get(charCode) || this._defaultValue); - } - } -} -class CharacterSet { - constructor() { - this._actual = new CharacterClassifier(0 /* False */); - } - add(charCode) { - this._actual.set(charCode, 1 /* True */); - } - has(charCode) { - return (this._actual.get(charCode) === 1 /* True */); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js ***! - \**************************************************************************/ -/*! exports provided: Position */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * A position in the editor. - */ -class Position { - constructor(lineNumber, column) { - this.lineNumber = lineNumber; - this.column = column; - } - /** - * Create a new position from this position. - * - * @param newLineNumber new line number - * @param newColumn new column - */ - with(newLineNumber = this.lineNumber, newColumn = this.column) { - if (newLineNumber === this.lineNumber && newColumn === this.column) { - return this; - } - else { - return new Position(newLineNumber, newColumn); - } - } - /** - * Derive a new position from this position. - * - * @param deltaLineNumber line number delta - * @param deltaColumn column delta - */ - delta(deltaLineNumber = 0, deltaColumn = 0) { - return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); - } - /** - * Test if this position equals other position - */ - equals(other) { - return Position.equals(this, other); - } - /** - * Test if position `a` equals position `b` - */ - static equals(a, b) { - if (!a && !b) { - return true; - } - return (!!a && - !!b && - a.lineNumber === b.lineNumber && - a.column === b.column); - } - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be false. - */ - isBefore(other) { - return Position.isBefore(this, other); - } - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be false. - */ - static isBefore(a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column < b.column; - } - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be true. - */ - isBeforeOrEqual(other) { - return Position.isBeforeOrEqual(this, other); - } - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be true. - */ - static isBeforeOrEqual(a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column <= b.column; - } - /** - * A function that compares positions, useful for sorting - */ - static compare(a, b) { - let aLineNumber = a.lineNumber | 0; - let bLineNumber = b.lineNumber | 0; - if (aLineNumber === bLineNumber) { - let aColumn = a.column | 0; - let bColumn = b.column | 0; - return aColumn - bColumn; - } - return aLineNumber - bLineNumber; - } - /** - * Clone this position. - */ - clone() { - return new Position(this.lineNumber, this.column); - } - /** - * Convert to a human-readable representation. - */ - toString() { - return '(' + this.lineNumber + ',' + this.column + ')'; - } - // --- - /** - * Create a `Position` from an `IPosition`. - */ - static lift(pos) { - return new Position(pos.lineNumber, pos.column); - } - /** - * Test if `obj` is an `IPosition`. - */ - static isIPosition(obj) { - return (obj - && (typeof obj.lineNumber === 'number') - && (typeof obj.column === 'number')); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js ***! - \***********************************************************************/ -/*! exports provided: Range */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) - */ -class Range { - constructor(startLineNumber, startColumn, endLineNumber, endColumn) { - if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { - this.startLineNumber = endLineNumber; - this.startColumn = endColumn; - this.endLineNumber = startLineNumber; - this.endColumn = startColumn; - } - else { - this.startLineNumber = startLineNumber; - this.startColumn = startColumn; - this.endLineNumber = endLineNumber; - this.endColumn = endColumn; - } - } - /** - * Test if this range is empty. - */ - isEmpty() { - return Range.isEmpty(this); - } - /** - * Test if `range` is empty. - */ - static isEmpty(range) { - return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); - } - /** - * Test if position is in this range. If the position is at the edges, will return true. - */ - containsPosition(position) { - return Range.containsPosition(this, position); - } - /** - * Test if `position` is in `range`. If the position is at the edges, will return true. - */ - static containsPosition(range, position) { - if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { - return false; - } - if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { - return false; - } - if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { - return false; - } - return true; - } - /** - * Test if range is in this range. If the range is equal to this range, will return true. - */ - containsRange(range) { - return Range.containsRange(this, range); - } - /** - * Test if `otherRange` is in `range`. If the ranges are equal, will return true. - */ - static containsRange(range, otherRange) { - if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { - return false; - } - if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { - return false; - } - if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { - return false; - } - if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { - return false; - } - return true; - } - /** - * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true. - */ - strictContainsRange(range) { - return Range.strictContainsRange(this, range); - } - /** - * Test if `otherRange` is strinctly in `range` (must start after, and end before). If the ranges are equal, will return false. - */ - static strictContainsRange(range, otherRange) { - if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { - return false; - } - if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { - return false; - } - if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) { - return false; - } - if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) { - return false; - } - return true; - } - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - plusRange(range) { - return Range.plusRange(this, range); - } - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - static plusRange(a, b) { - let startLineNumber; - let startColumn; - let endLineNumber; - let endColumn; - if (b.startLineNumber < a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = b.startColumn; - } - else if (b.startLineNumber === a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = Math.min(b.startColumn, a.startColumn); - } - else { - startLineNumber = a.startLineNumber; - startColumn = a.startColumn; - } - if (b.endLineNumber > a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = b.endColumn; - } - else if (b.endLineNumber === a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = Math.max(b.endColumn, a.endColumn); - } - else { - endLineNumber = a.endLineNumber; - endColumn = a.endColumn; - } - return new Range(startLineNumber, startColumn, endLineNumber, endColumn); - } - /** - * A intersection of the two ranges. - */ - intersectRanges(range) { - return Range.intersectRanges(this, range); - } - /** - * A intersection of the two ranges. - */ - static intersectRanges(a, b) { - let resultStartLineNumber = a.startLineNumber; - let resultStartColumn = a.startColumn; - let resultEndLineNumber = a.endLineNumber; - let resultEndColumn = a.endColumn; - let otherStartLineNumber = b.startLineNumber; - let otherStartColumn = b.startColumn; - let otherEndLineNumber = b.endLineNumber; - let otherEndColumn = b.endColumn; - if (resultStartLineNumber < otherStartLineNumber) { - resultStartLineNumber = otherStartLineNumber; - resultStartColumn = otherStartColumn; - } - else if (resultStartLineNumber === otherStartLineNumber) { - resultStartColumn = Math.max(resultStartColumn, otherStartColumn); - } - if (resultEndLineNumber > otherEndLineNumber) { - resultEndLineNumber = otherEndLineNumber; - resultEndColumn = otherEndColumn; - } - else if (resultEndLineNumber === otherEndLineNumber) { - resultEndColumn = Math.min(resultEndColumn, otherEndColumn); - } - // Check if selection is now empty - if (resultStartLineNumber > resultEndLineNumber) { - return null; - } - if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { - return null; - } - return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); - } - /** - * Test if this range equals other. - */ - equalsRange(other) { - return Range.equalsRange(this, other); - } - /** - * Test if range `a` equals `b`. - */ - static equalsRange(a, b) { - return (!!a && - !!b && - a.startLineNumber === b.startLineNumber && - a.startColumn === b.startColumn && - a.endLineNumber === b.endLineNumber && - a.endColumn === b.endColumn); - } - /** - * Return the end position (which will be after or equal to the start position) - */ - getEndPosition() { - return Range.getEndPosition(this); - } - /** - * Return the end position (which will be after or equal to the start position) - */ - static getEndPosition(range) { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](range.endLineNumber, range.endColumn); - } - /** - * Return the start position (which will be before or equal to the end position) - */ - getStartPosition() { - return Range.getStartPosition(this); - } - /** - * Return the start position (which will be before or equal to the end position) - */ - static getStartPosition(range) { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](range.startLineNumber, range.startColumn); - } - /** - * Transform to a user presentable string representation. - */ - toString() { - return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; - } - /** - * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. - */ - setEndPosition(endLineNumber, endColumn) { - return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - } - /** - * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. - */ - setStartPosition(startLineNumber, startColumn) { - return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - } - /** - * Create a new empty range using this range's start position. - */ - collapseToStart() { - return Range.collapseToStart(this); - } - /** - * Create a new empty range using this range's start position. - */ - static collapseToStart(range) { - return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); - } - // --- - static fromPositions(start, end = start) { - return new Range(start.lineNumber, start.column, end.lineNumber, end.column); - } - static lift(range) { - if (!range) { - return null; - } - return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); - } - /** - * Test if `obj` is an `IRange`. - */ - static isIRange(obj) { - return (obj - && (typeof obj.startLineNumber === 'number') - && (typeof obj.startColumn === 'number') - && (typeof obj.endLineNumber === 'number') - && (typeof obj.endColumn === 'number')); - } - /** - * Test if the two ranges are touching in any way. - */ - static areIntersectingOrTouching(a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - } - /** - * Test if the two ranges are intersecting. If the ranges are touching it returns true. - */ - static areIntersecting(a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - } - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the startPosition and then on the endPosition - */ - static compareRangesUsingStarts(a, b) { - if (a && b) { - const aStartLineNumber = a.startLineNumber | 0; - const bStartLineNumber = b.startLineNumber | 0; - if (aStartLineNumber === bStartLineNumber) { - const aStartColumn = a.startColumn | 0; - const bStartColumn = b.startColumn | 0; - if (aStartColumn === bStartColumn) { - const aEndLineNumber = a.endLineNumber | 0; - const bEndLineNumber = b.endLineNumber | 0; - if (aEndLineNumber === bEndLineNumber) { - const aEndColumn = a.endColumn | 0; - const bEndColumn = b.endColumn | 0; - return aEndColumn - bEndColumn; - } - return aEndLineNumber - bEndLineNumber; - } - return aStartColumn - bStartColumn; - } - return aStartLineNumber - bStartLineNumber; - } - const aExists = (a ? 1 : 0); - const bExists = (b ? 1 : 0); - return aExists - bExists; - } - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the endPosition and then on the startPosition - */ - static compareRangesUsingEnds(a, b) { - if (a.endLineNumber === b.endLineNumber) { - if (a.endColumn === b.endColumn) { - if (a.startLineNumber === b.startLineNumber) { - return a.startColumn - b.startColumn; - } - return a.startLineNumber - b.startLineNumber; - } - return a.endColumn - b.endColumn; - } - return a.endLineNumber - b.endLineNumber; - } - /** - * Test if the range spans multiple lines. - */ - static spansMultipleLines(range) { - return range.endLineNumber > range.startLineNumber; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js ***! - \***************************************************************************/ -/*! exports provided: Selection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return Selection; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -/** - * A selection in the editor. - * The selection is a range that has an orientation. - */ -class Selection extends _range_js__WEBPACK_IMPORTED_MODULE_1__["Range"] { - constructor(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { - super(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn); - this.selectionStartLineNumber = selectionStartLineNumber; - this.selectionStartColumn = selectionStartColumn; - this.positionLineNumber = positionLineNumber; - this.positionColumn = positionColumn; - } - /** - * Transform to a human-readable representation. - */ - toString() { - return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; - } - /** - * Test if equals other selection. - */ - equalsSelection(other) { - return (Selection.selectionsEqual(this, other)); - } - /** - * Test if the two selections are equal. - */ - static selectionsEqual(a, b) { - return (a.selectionStartLineNumber === b.selectionStartLineNumber && - a.selectionStartColumn === b.selectionStartColumn && - a.positionLineNumber === b.positionLineNumber && - a.positionColumn === b.positionColumn); - } - /** - * Get directions (LTR or RTL). - */ - getDirection() { - if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { - return 0 /* LTR */; - } - return 1 /* RTL */; - } - /** - * Create a new selection with a different `positionLineNumber` and `positionColumn`. - */ - setEndPosition(endLineNumber, endColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); - } - /** - * Get the position at `positionLineNumber` and `positionColumn`. - */ - getPosition() { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.positionLineNumber, this.positionColumn); - } - /** - * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. - */ - setStartPosition(startLineNumber, startColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - } - return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); - } - // ---- - /** - * Create a `Selection` from one or two positions - */ - static fromPositions(start, end = start) { - return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); - } - /** - * Create a `Selection` from an `ISelection`. - */ - static liftSelection(sel) { - return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); - } - /** - * `a` equals `b`. - */ - static selectionsArrEqual(a, b) { - if (a && !b || !a && b) { - return false; - } - if (!a && !b) { - return true; - } - if (a.length !== b.length) { - return false; - } - for (let i = 0, len = a.length; i < len; i++) { - if (!this.selectionsEqual(a[i], b[i])) { - return false; - } - } - return true; - } - /** - * Test if `obj` is an `ISelection`. - */ - static isISelection(obj) { - return (obj - && (typeof obj.selectionStartLineNumber === 'number') - && (typeof obj.selectionStartColumn === 'number') - && (typeof obj.positionLineNumber === 'number') - && (typeof obj.positionColumn === 'number')); - } - /** - * Create with a direction. - */ - static createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, direction) { - if (direction === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js ***! - \***********************************************************************/ -/*! exports provided: Token, TokenizationResult, TokenizationResult2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult", function() { return TokenizationResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult2", function() { return TokenizationResult2; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class Token { - constructor(offset, type, language) { - this.offset = offset | 0; // @perf - this.type = type; - this.language = language; - } - toString() { - return '(' + this.offset + ', ' + this.type + ')'; - } -} -class TokenizationResult { - constructor(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } -} -class TokenizationResult2 { - constructor(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js ***! - \******************************************************************************/ -/*! exports provided: DiffComputer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffComputer", function() { return DiffComputer; }); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -const MINIMUM_MATCHING_CHARACTER_LENGTH = 3; -function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) { - const diffAlgo = new _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__["LcsDiff"](originalSequence, modifiedSequence, continueProcessingPredicate); - return diffAlgo.ComputeDiff(pretty); -} -class LineSequence { - constructor(lines) { - const startColumns = []; - const endColumns = []; - for (let i = 0, length = lines.length; i < length; i++) { - startColumns[i] = getFirstNonBlankColumn(lines[i], 1); - endColumns[i] = getLastNonBlankColumn(lines[i], 1); - } - this.lines = lines; - this._startColumns = startColumns; - this._endColumns = endColumns; - } - getElements() { - const elements = []; - for (let i = 0, len = this.lines.length; i < len; i++) { - elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1); - } - return elements; - } - getStartLineNumber(i) { - return i + 1; - } - getEndLineNumber(i) { - return i + 1; - } - createCharSequence(shouldIgnoreTrimWhitespace, startIndex, endIndex) { - const charCodes = []; - const lineNumbers = []; - const columns = []; - let len = 0; - for (let index = startIndex; index <= endIndex; index++) { - const lineContent = this.lines[index]; - const startColumn = (shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1); - const endColumn = (shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1); - for (let col = startColumn; col < endColumn; col++) { - charCodes[len] = lineContent.charCodeAt(col - 1); - lineNumbers[len] = index + 1; - columns[len] = col; - len++; - } - } - return new CharSequence(charCodes, lineNumbers, columns); - } -} -class CharSequence { - constructor(charCodes, lineNumbers, columns) { - this._charCodes = charCodes; - this._lineNumbers = lineNumbers; - this._columns = columns; - } - getElements() { - return this._charCodes; - } - getStartLineNumber(i) { - return this._lineNumbers[i]; - } - getStartColumn(i) { - return this._columns[i]; - } - getEndLineNumber(i) { - return this._lineNumbers[i]; - } - getEndColumn(i) { - return this._columns[i] + 1; - } -} -class CharChange { - constructor(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) { - this.originalStartLineNumber = originalStartLineNumber; - this.originalStartColumn = originalStartColumn; - this.originalEndLineNumber = originalEndLineNumber; - this.originalEndColumn = originalEndColumn; - this.modifiedStartLineNumber = modifiedStartLineNumber; - this.modifiedStartColumn = modifiedStartColumn; - this.modifiedEndLineNumber = modifiedEndLineNumber; - this.modifiedEndColumn = modifiedEndColumn; - } - static createFromDiffChange(diffChange, originalCharSequence, modifiedCharSequence) { - let originalStartLineNumber; - let originalStartColumn; - let originalEndLineNumber; - let originalEndColumn; - let modifiedStartLineNumber; - let modifiedStartColumn; - let modifiedEndLineNumber; - let modifiedEndColumn; - if (diffChange.originalLength === 0) { - originalStartLineNumber = 0; - originalStartColumn = 0; - originalEndLineNumber = 0; - originalEndColumn = 0; - } - else { - originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart); - originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart); - originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1); - originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1); - } - if (diffChange.modifiedLength === 0) { - modifiedStartLineNumber = 0; - modifiedStartColumn = 0; - modifiedEndLineNumber = 0; - modifiedEndColumn = 0; - } - else { - modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart); - modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart); - modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1); - modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1); - } - return new CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn); - } -} -function postProcessCharChanges(rawChanges) { - if (rawChanges.length <= 1) { - return rawChanges; - } - const result = [rawChanges[0]]; - let prevChange = result[0]; - for (let i = 1, len = rawChanges.length; i < len; i++) { - const currChange = rawChanges[i]; - const originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength); - const modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength); - // Both of the above should be equal, but the continueProcessingPredicate may prevent this from being true - const matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength); - if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) { - // Merge the current change into the previous one - prevChange.originalLength = (currChange.originalStart + currChange.originalLength) - prevChange.originalStart; - prevChange.modifiedLength = (currChange.modifiedStart + currChange.modifiedLength) - prevChange.modifiedStart; - } - else { - // Add the current change - result.push(currChange); - prevChange = currChange; - } - } - return result; -} -class LineChange { - constructor(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges) { - this.originalStartLineNumber = originalStartLineNumber; - this.originalEndLineNumber = originalEndLineNumber; - this.modifiedStartLineNumber = modifiedStartLineNumber; - this.modifiedEndLineNumber = modifiedEndLineNumber; - this.charChanges = charChanges; - } - static createFromDiffResult(shouldIgnoreTrimWhitespace, diffChange, originalLineSequence, modifiedLineSequence, continueCharDiff, shouldComputeCharChanges, shouldPostProcessCharChanges) { - let originalStartLineNumber; - let originalEndLineNumber; - let modifiedStartLineNumber; - let modifiedEndLineNumber; - let charChanges = undefined; - if (diffChange.originalLength === 0) { - originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1; - originalEndLineNumber = 0; - } - else { - originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart); - originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1); - } - if (diffChange.modifiedLength === 0) { - modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1; - modifiedEndLineNumber = 0; - } - else { - modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart); - modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1); - } - if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) { - // Compute character changes for diff chunks of at most 20 lines... - const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1); - const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1); - let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes; - if (shouldPostProcessCharChanges) { - rawChanges = postProcessCharChanges(rawChanges); - } - charChanges = []; - for (let i = 0, length = rawChanges.length; i < length; i++) { - charChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence)); - } - } - return new LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges); - } -} -class DiffComputer { - constructor(originalLines, modifiedLines, opts) { - this.shouldComputeCharChanges = opts.shouldComputeCharChanges; - this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges; - this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace; - this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff; - this.originalLines = originalLines; - this.modifiedLines = modifiedLines; - this.original = new LineSequence(originalLines); - this.modified = new LineSequence(modifiedLines); - this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime); - this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5000)); // never run after 5s for character changes... - } - computeDiff() { - if (this.original.lines.length === 1 && this.original.lines[0].length === 0) { - // empty original => fast path - return { - quitEarly: false, - changes: [{ - originalStartLineNumber: 1, - originalEndLineNumber: 1, - modifiedStartLineNumber: 1, - modifiedEndLineNumber: this.modified.lines.length, - charChanges: [{ - modifiedEndColumn: 0, - modifiedEndLineNumber: 0, - modifiedStartColumn: 0, - modifiedStartLineNumber: 0, - originalEndColumn: 0, - originalEndLineNumber: 0, - originalStartColumn: 0, - originalStartLineNumber: 0 - }] - }] - }; - } - if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) { - // empty modified => fast path - return { - quitEarly: false, - changes: [{ - originalStartLineNumber: 1, - originalEndLineNumber: this.original.lines.length, - modifiedStartLineNumber: 1, - modifiedEndLineNumber: 1, - charChanges: [{ - modifiedEndColumn: 0, - modifiedEndLineNumber: 0, - modifiedStartColumn: 0, - modifiedStartLineNumber: 0, - originalEndColumn: 0, - originalEndLineNumber: 0, - originalStartColumn: 0, - originalStartLineNumber: 0 - }] - }] - }; - } - const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff); - const rawChanges = diffResult.changes; - const quitEarly = diffResult.quitEarly; - // The diff is always computed with ignoring trim whitespace - // This ensures we get the prettiest diff - if (this.shouldIgnoreTrimWhitespace) { - const lineChanges = []; - for (let i = 0, length = rawChanges.length; i < length; i++) { - lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)); - } - return { - quitEarly: quitEarly, - changes: lineChanges - }; - } - // Need to post-process and introduce changes where the trim whitespace is different - // Note that we are looping starting at -1 to also cover the lines before the first change - const result = []; - let originalLineIndex = 0; - let modifiedLineIndex = 0; - for (let i = -1 /* !!!! */, len = rawChanges.length; i < len; i++) { - const nextChange = (i + 1 < len ? rawChanges[i + 1] : null); - const originalStop = (nextChange ? nextChange.originalStart : this.originalLines.length); - const modifiedStop = (nextChange ? nextChange.modifiedStart : this.modifiedLines.length); - while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) { - const originalLine = this.originalLines[originalLineIndex]; - const modifiedLine = this.modifiedLines[modifiedLineIndex]; - if (originalLine !== modifiedLine) { - // These lines differ only in trim whitespace - // Check the leading whitespace - { - let originalStartColumn = getFirstNonBlankColumn(originalLine, 1); - let modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1); - while (originalStartColumn > 1 && modifiedStartColumn > 1) { - const originalChar = originalLine.charCodeAt(originalStartColumn - 2); - const modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2); - if (originalChar !== modifiedChar) { - break; - } - originalStartColumn--; - modifiedStartColumn--; - } - if (originalStartColumn > 1 || modifiedStartColumn > 1) { - this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, 1, originalStartColumn, modifiedLineIndex + 1, 1, modifiedStartColumn); - } - } - // Check the trailing whitespace - { - let originalEndColumn = getLastNonBlankColumn(originalLine, 1); - let modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1); - const originalMaxColumn = originalLine.length + 1; - const modifiedMaxColumn = modifiedLine.length + 1; - while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) { - const originalChar = originalLine.charCodeAt(originalEndColumn - 1); - const modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1); - if (originalChar !== modifiedChar) { - break; - } - originalEndColumn++; - modifiedEndColumn++; - } - if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) { - this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, originalEndColumn, originalMaxColumn, modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn); - } - } - } - originalLineIndex++; - modifiedLineIndex++; - } - if (nextChange) { - // Emit the actual change - result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)); - originalLineIndex += nextChange.originalLength; - modifiedLineIndex += nextChange.modifiedLength; - } - } - return { - quitEarly: quitEarly, - changes: result - }; - } - _pushTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) { - if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) { - // Merged into previous - return; - } - let charChanges = undefined; - if (this.shouldComputeCharChanges) { - charChanges = [new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)]; - } - result.push(new LineChange(originalLineNumber, originalLineNumber, modifiedLineNumber, modifiedLineNumber, charChanges)); - } - _mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) { - const len = result.length; - if (len === 0) { - return false; - } - const prevChange = result[len - 1]; - if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) { - // Don't merge with inserts/deletes - return false; - } - if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) { - prevChange.originalEndLineNumber = originalLineNumber; - prevChange.modifiedEndLineNumber = modifiedLineNumber; - if (this.shouldComputeCharChanges && prevChange.charChanges) { - prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)); - } - return true; - } - return false; - } -} -function getFirstNonBlankColumn(txt, defaultValue) { - const r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](txt); - if (r === -1) { - return defaultValue; - } - return r + 1; -} -function getLastNonBlankColumn(txt, defaultValue) { - const r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["lastNonWhitespaceIndex"](txt); - if (r === -1) { - return defaultValue; - } - return r + 2; -} -function createContinueProcessingPredicate(maximumRuntime) { - if (maximumRuntime === 0) { - return () => true; - } - const startTime = Date.now(); - return () => { - return Date.now() - startTime < maximumRuntime; - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js ***! - \**********************************************************************************/ -/*! exports provided: MirrorTextModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MirrorTextModel", function() { return MirrorTextModel; }); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewModel/prefixSumComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class MirrorTextModel { - constructor(uri, lines, eol, versionId) { - this._uri = uri; - this._lines = lines; - this._eol = eol; - this._versionId = versionId; - this._lineStarts = null; - this._cachedTextValue = null; - } - dispose() { - this._lines.length = 0; - } - getText() { - if (this._cachedTextValue === null) { - this._cachedTextValue = this._lines.join(this._eol); - } - return this._cachedTextValue; - } - onEvents(e) { - if (e.eol && e.eol !== this._eol) { - this._eol = e.eol; - this._lineStarts = null; - } - // Update my lines - const changes = e.changes; - for (const change of changes) { - this._acceptDeleteRange(change.range); - this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](change.range.startLineNumber, change.range.startColumn), change.text); - } - this._versionId = e.versionId; - this._cachedTextValue = null; - } - _ensureLineStarts() { - if (!this._lineStarts) { - const eolLength = this._eol.length; - const linesLength = this._lines.length; - const lineStartValues = new Uint32Array(linesLength); - for (let i = 0; i < linesLength; i++) { - lineStartValues[i] = this._lines[i].length + eolLength; - } - this._lineStarts = new _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__["PrefixSumComputer"](lineStartValues); - } - } - /** - * All changes to a line's text go through this method - */ - _setLineText(lineIndex, newValue) { - this._lines[lineIndex] = newValue; - if (this._lineStarts) { - // update prefix sum - this._lineStarts.changeValue(lineIndex, this._lines[lineIndex].length + this._eol.length); - } - } - _acceptDeleteRange(range) { - if (range.startLineNumber === range.endLineNumber) { - if (range.startColumn === range.endColumn) { - // Nothing to delete - return; - } - // Delete text on the affected line - this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) - + this._lines[range.startLineNumber - 1].substring(range.endColumn - 1)); - return; - } - // Take remaining text on last line and append it to remaining text on first line - this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) - + this._lines[range.endLineNumber - 1].substring(range.endColumn - 1)); - // Delete middle lines - this._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber); - if (this._lineStarts) { - // update prefix sum - this._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber); - } - } - _acceptInsertText(position, insertText) { - if (insertText.length === 0) { - // Nothing to insert - return; - } - let insertLines = insertText.split(/\r\n|\r|\n/); - if (insertLines.length === 1) { - // Inserting text on one line - this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) - + insertLines[0] - + this._lines[position.lineNumber - 1].substring(position.column - 1)); - return; - } - // Append overflowing text from first line to the end of text to insert - insertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1); - // Delete overflowing text from first line and insert text on first line - this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) - + insertLines[0]); - // Insert new lines & store lengths - let newLengths = new Uint32Array(insertLines.length - 1); - for (let i = 1; i < insertLines.length; i++) { - this._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]); - newLengths[i - 1] = insertLines[i].length + this._eol.length; - } - if (this._lineStarts) { - // update prefix sum - this._lineStarts.insertValues(position.lineNumber, newLengths); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js ***! - \*****************************************************************************/ -/*! exports provided: USUAL_WORD_SEPARATORS, DEFAULT_WORD_REGEXP, ensureValidWordDefinition, getWordAtText */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USUAL_WORD_SEPARATORS", function() { return USUAL_WORD_SEPARATORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_WORD_REGEXP", function() { return DEFAULT_WORD_REGEXP; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureValidWordDefinition", function() { return ensureValidWordDefinition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWordAtText", function() { return getWordAtText; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -const USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?'; -/** - * Create a word definition regular expression based on default word separators. - * Optionally provide allowed separators that should be included in words. - * - * The default would look like this: - * /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g - */ -function createWordRegExp(allowInWords = '') { - let source = '(-?\\d*\\.\\d\\w*)|([^'; - for (const sep of USUAL_WORD_SEPARATORS) { - if (allowInWords.indexOf(sep) >= 0) { - continue; - } - source += '\\' + sep; - } - source += '\\s]+)'; - return new RegExp(source, 'g'); -} -// catches numbers (including floating numbers) in the first group, and alphanum in the second -const DEFAULT_WORD_REGEXP = createWordRegExp(); -function ensureValidWordDefinition(wordDefinition) { - let result = DEFAULT_WORD_REGEXP; - if (wordDefinition && (wordDefinition instanceof RegExp)) { - if (!wordDefinition.global) { - let flags = 'g'; - if (wordDefinition.ignoreCase) { - flags += 'i'; - } - if (wordDefinition.multiline) { - flags += 'm'; - } - if (wordDefinition.unicode) { - flags += 'u'; - } - result = new RegExp(wordDefinition.source, flags); - } - else { - result = wordDefinition; - } - } - result.lastIndex = 0; - return result; -} -const _defaultConfig = { - maxLen: 1000, - windowSize: 15, - timeBudget: 150 -}; -function getWordAtText(column, wordDefinition, text, textOffset, config = _defaultConfig) { - if (text.length > config.maxLen) { - // don't throw strings that long at the regexp - // but use a sub-string in which a word must occur - let start = column - config.maxLen / 2; - if (start < 0) { - textOffset += column; - start = 0; - } - else { - textOffset += start; - } - text = text.substring(start, column + config.maxLen / 2); - return getWordAtText(column, wordDefinition, text, textOffset, config); - } - const t1 = Date.now(); - const pos = column - 1 - textOffset; - let prevRegexIndex = -1; - let match = null; - for (let i = 1;; i++) { - // check time budget - if (Date.now() - t1 >= config.timeBudget) { - // break; - } - // reset the index at which the regexp should start matching, also know where it - // should stop so that subsequent search don't repeat previous searches - const regexIndex = pos - config.windowSize * i; - wordDefinition.lastIndex = Math.max(0, regexIndex); - const thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text, pos, prevRegexIndex); - if (!thisMatch && match) { - // stop: we have something - break; - } - match = thisMatch; - // stop: searched at start - if (regexIndex <= 0) { - break; - } - prevRegexIndex = regexIndex; - } - if (match) { - let result = { - word: match[0], - startColumn: textOffset + 1 + match.index, - endColumn: textOffset + 1 + match.index + match[0].length - }; - wordDefinition.lastIndex = 0; - return result; - } - return null; -} -function _findRegexMatchEnclosingPosition(wordDefinition, text, pos, stopPos) { - let match; - while (match = wordDefinition.exec(text)) { - const matchIndex = match.index || 0; - if (matchIndex <= pos && wordDefinition.lastIndex >= pos) { - return match; - } - else if (stopPos > 0 && matchIndex > stopPos) { - return null; - } - } - return null; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js ***! - \*******************************************************************************/ -/*! exports provided: Uint8Matrix, StateMachine, LinkComputer, computeLinks */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8Matrix", function() { return Uint8Matrix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StateMachine", function() { return StateMachine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkComputer", function() { return LinkComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeLinks", function() { return computeLinks; }); -/* harmony import */ var _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class Uint8Matrix { - constructor(rows, cols, defaultValue) { - const data = new Uint8Array(rows * cols); - for (let i = 0, len = rows * cols; i < len; i++) { - data[i] = defaultValue; - } - this._data = data; - this.rows = rows; - this.cols = cols; - } - get(row, col) { - return this._data[row * this.cols + col]; - } - set(row, col, value) { - this._data[row * this.cols + col] = value; - } -} -class StateMachine { - constructor(edges) { - let maxCharCode = 0; - let maxState = 0 /* Invalid */; - for (let i = 0, len = edges.length; i < len; i++) { - let [from, chCode, to] = edges[i]; - if (chCode > maxCharCode) { - maxCharCode = chCode; - } - if (from > maxState) { - maxState = from; - } - if (to > maxState) { - maxState = to; - } - } - maxCharCode++; - maxState++; - let states = new Uint8Matrix(maxState, maxCharCode, 0 /* Invalid */); - for (let i = 0, len = edges.length; i < len; i++) { - let [from, chCode, to] = edges[i]; - states.set(from, chCode, to); - } - this._states = states; - this._maxCharCode = maxCharCode; - } - nextState(currentState, chCode) { - if (chCode < 0 || chCode >= this._maxCharCode) { - return 0 /* Invalid */; - } - return this._states.get(currentState, chCode); - } -} -// State machine for http:// or https:// or file:// -let _stateMachine = null; -function getStateMachine() { - if (_stateMachine === null) { - _stateMachine = new StateMachine([ - [1 /* Start */, 104 /* h */, 2 /* H */], - [1 /* Start */, 72 /* H */, 2 /* H */], - [1 /* Start */, 102 /* f */, 6 /* F */], - [1 /* Start */, 70 /* F */, 6 /* F */], - [2 /* H */, 116 /* t */, 3 /* HT */], - [2 /* H */, 84 /* T */, 3 /* HT */], - [3 /* HT */, 116 /* t */, 4 /* HTT */], - [3 /* HT */, 84 /* T */, 4 /* HTT */], - [4 /* HTT */, 112 /* p */, 5 /* HTTP */], - [4 /* HTT */, 80 /* P */, 5 /* HTTP */], - [5 /* HTTP */, 115 /* s */, 9 /* BeforeColon */], - [5 /* HTTP */, 83 /* S */, 9 /* BeforeColon */], - [5 /* HTTP */, 58 /* Colon */, 10 /* AfterColon */], - [6 /* F */, 105 /* i */, 7 /* FI */], - [6 /* F */, 73 /* I */, 7 /* FI */], - [7 /* FI */, 108 /* l */, 8 /* FIL */], - [7 /* FI */, 76 /* L */, 8 /* FIL */], - [8 /* FIL */, 101 /* e */, 9 /* BeforeColon */], - [8 /* FIL */, 69 /* E */, 9 /* BeforeColon */], - [9 /* BeforeColon */, 58 /* Colon */, 10 /* AfterColon */], - [10 /* AfterColon */, 47 /* Slash */, 11 /* AlmostThere */], - [11 /* AlmostThere */, 47 /* Slash */, 12 /* End */], - ]); - } - return _stateMachine; -} -let _classifier = null; -function getClassifier() { - if (_classifier === null) { - _classifier = new _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__["CharacterClassifier"](0 /* None */); - const FORCE_TERMINATION_CHARACTERS = ' \t<>\'\"、。。、,.:;‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…'; - for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) { - _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1 /* ForceTermination */); - } - const CANNOT_END_WITH_CHARACTERS = '.,;'; - for (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) { - _classifier.set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), 2 /* CannotEndIn */); - } - } - return _classifier; -} -class LinkComputer { - static _createLink(classifier, line, lineNumber, linkBeginIndex, linkEndIndex) { - // Do not allow to end link in certain characters... - let lastIncludedCharIndex = linkEndIndex - 1; - do { - const chCode = line.charCodeAt(lastIncludedCharIndex); - const chClass = classifier.get(chCode); - if (chClass !== 2 /* CannotEndIn */) { - break; - } - lastIncludedCharIndex--; - } while (lastIncludedCharIndex > linkBeginIndex); - // Handle links enclosed in parens, square brackets and curlys. - if (linkBeginIndex > 0) { - const charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1); - const lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex); - if ((charCodeBeforeLink === 40 /* OpenParen */ && lastCharCodeInLink === 41 /* CloseParen */) - || (charCodeBeforeLink === 91 /* OpenSquareBracket */ && lastCharCodeInLink === 93 /* CloseSquareBracket */) - || (charCodeBeforeLink === 123 /* OpenCurlyBrace */ && lastCharCodeInLink === 125 /* CloseCurlyBrace */)) { - // Do not end in ) if ( is before the link start - // Do not end in ] if [ is before the link start - // Do not end in } if { is before the link start - lastIncludedCharIndex--; - } - } - return { - range: { - startLineNumber: lineNumber, - startColumn: linkBeginIndex + 1, - endLineNumber: lineNumber, - endColumn: lastIncludedCharIndex + 2 - }, - url: line.substring(linkBeginIndex, lastIncludedCharIndex + 1) - }; - } - static computeLinks(model, stateMachine = getStateMachine()) { - const classifier = getClassifier(); - let result = []; - for (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) { - const line = model.getLineContent(i); - const len = line.length; - let j = 0; - let linkBeginIndex = 0; - let linkBeginChCode = 0; - let state = 1 /* Start */; - let hasOpenParens = false; - let hasOpenSquareBracket = false; - let inSquareBrackets = false; - let hasOpenCurlyBracket = false; - while (j < len) { - let resetStateMachine = false; - const chCode = line.charCodeAt(j); - if (state === 13 /* Accept */) { - let chClass; - switch (chCode) { - case 40 /* OpenParen */: - hasOpenParens = true; - chClass = 0 /* None */; - break; - case 41 /* CloseParen */: - chClass = (hasOpenParens ? 0 /* None */ : 1 /* ForceTermination */); - break; - case 91 /* OpenSquareBracket */: - inSquareBrackets = true; - hasOpenSquareBracket = true; - chClass = 0 /* None */; - break; - case 93 /* CloseSquareBracket */: - inSquareBrackets = false; - chClass = (hasOpenSquareBracket ? 0 /* None */ : 1 /* ForceTermination */); - break; - case 123 /* OpenCurlyBrace */: - hasOpenCurlyBracket = true; - chClass = 0 /* None */; - break; - case 125 /* CloseCurlyBrace */: - chClass = (hasOpenCurlyBracket ? 0 /* None */ : 1 /* ForceTermination */); - break; - /* The following three rules make it that ' or " or ` are allowed inside links if the link began with a different one */ - case 39 /* SingleQuote */: - chClass = (linkBeginChCode === 34 /* DoubleQuote */ || linkBeginChCode === 96 /* BackTick */) ? 0 /* None */ : 1 /* ForceTermination */; - break; - case 34 /* DoubleQuote */: - chClass = (linkBeginChCode === 39 /* SingleQuote */ || linkBeginChCode === 96 /* BackTick */) ? 0 /* None */ : 1 /* ForceTermination */; - break; - case 96 /* BackTick */: - chClass = (linkBeginChCode === 39 /* SingleQuote */ || linkBeginChCode === 34 /* DoubleQuote */) ? 0 /* None */ : 1 /* ForceTermination */; - break; - case 42 /* Asterisk */: - // `*` terminates a link if the link began with `*` - chClass = (linkBeginChCode === 42 /* Asterisk */) ? 1 /* ForceTermination */ : 0 /* None */; - break; - case 124 /* Pipe */: - // `|` terminates a link if the link began with `|` - chClass = (linkBeginChCode === 124 /* Pipe */) ? 1 /* ForceTermination */ : 0 /* None */; - break; - case 32 /* Space */: - // ` ` allow space in between [ and ] - chClass = (inSquareBrackets ? 0 /* None */ : 1 /* ForceTermination */); - break; - default: - chClass = classifier.get(chCode); - } - // Check if character terminates link - if (chClass === 1 /* ForceTermination */) { - result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, j)); - resetStateMachine = true; - } - } - else if (state === 12 /* End */) { - let chClass; - if (chCode === 91 /* OpenSquareBracket */) { - // Allow for the authority part to contain ipv6 addresses which contain [ and ] - hasOpenSquareBracket = true; - chClass = 0 /* None */; - } - else { - chClass = classifier.get(chCode); - } - // Check if character terminates link - if (chClass === 1 /* ForceTermination */) { - resetStateMachine = true; - } - else { - state = 13 /* Accept */; - } - } - else { - state = stateMachine.nextState(state, chCode); - if (state === 0 /* Invalid */) { - resetStateMachine = true; - } - } - if (resetStateMachine) { - state = 1 /* Start */; - hasOpenParens = false; - hasOpenSquareBracket = false; - hasOpenCurlyBracket = false; - // Record where the link started - linkBeginIndex = j + 1; - linkBeginChCode = chCode; - } - j++; - } - if (state === 13 /* Accept */) { - result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, len)); - } - } - return result; - } -} -/** - * Returns an array of all links contains in the provided - * document. *Note* that this operation is computational - * expensive and should not run in the UI thread. - */ -function computeLinks(model) { - if (!model || typeof model.getLineCount !== 'function' || typeof model.getLineContent !== 'function') { - // Unknown caller! - return []; - } - return LinkComputer.computeLinks(model); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js ***! - \*************************************************************************************************/ -/*! exports provided: BasicInplaceReplace */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasicInplaceReplace", function() { return BasicInplaceReplace; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class BasicInplaceReplace { - constructor() { - this._defaultValueSet = [ - ['true', 'false'], - ['True', 'False'], - ['Private', 'Public', 'Friend', 'ReadOnly', 'Partial', 'Protected', 'WriteOnly'], - ['public', 'protected', 'private'], - ]; - } - navigateValueSet(range1, text1, range2, text2, up) { - if (range1 && text1) { - let result = this.doNavigateValueSet(text1, up); - if (result) { - return { - range: range1, - value: result - }; - } - } - if (range2 && text2) { - let result = this.doNavigateValueSet(text2, up); - if (result) { - return { - range: range2, - value: result - }; - } - } - return null; - } - doNavigateValueSet(text, up) { - let numberResult = this.numberReplace(text, up); - if (numberResult !== null) { - return numberResult; - } - return this.textReplace(text, up); - } - numberReplace(value, up) { - let precision = Math.pow(10, value.length - (value.lastIndexOf('.') + 1)); - let n1 = Number(value); - let n2 = parseFloat(value); - if (!isNaN(n1) && !isNaN(n2) && n1 === n2) { - if (n1 === 0 && !up) { - return null; // don't do negative - // } else if(n1 === 9 && up) { - // return null; // don't insert 10 into a number - } - else { - n1 = Math.floor(n1 * precision); - n1 += up ? precision : -precision; - return String(n1 / precision); - } - } - return null; - } - textReplace(value, up) { - return this.valueSetsReplace(this._defaultValueSet, value, up); - } - valueSetsReplace(valueSets, value, up) { - let result = null; - for (let i = 0, len = valueSets.length; result === null && i < len; i++) { - result = this.valueSetReplace(valueSets[i], value, up); - } - return result; - } - valueSetReplace(valueSet, value, up) { - let idx = valueSet.indexOf(value); - if (idx >= 0) { - idx += up ? +1 : -1; - if (idx < 0) { - idx = valueSet.length - 1; - } - else { - idx %= valueSet.length; - } - return valueSet[idx]; - } - return null; - } -} -BasicInplaceReplace.INSTANCE = new BasicInplaceReplace(); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js ***! - \****************************************************************************************/ -/*! exports provided: EditorSimpleWorker, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorSimpleWorker", function() { return EditorSimpleWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../diff/diffComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js"); -/* harmony import */ var _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../model/mirrorTextModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js"); -/* harmony import */ var _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../model/wordHelper.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js"); -/* harmony import */ var _modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modes/linkComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js"); -/* harmony import */ var _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modes/supports/inplaceReplaceSupport.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js"); -/* harmony import */ var _standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../standalone/standaloneBase.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - -/** - * @internal - */ -class MirrorModel extends _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_7__["MirrorTextModel"] { - get uri() { - return this._uri; - } - get version() { - return this._versionId; - } - get eol() { - return this._eol; - } - getValue() { - return this.getText(); - } - getLinesContent() { - return this._lines.slice(0); - } - getLineCount() { - return this._lines.length; - } - getLineContent(lineNumber) { - return this._lines[lineNumber - 1]; - } - getWordAtPosition(position, wordDefinition) { - let wordAtText = Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_8__["getWordAtText"])(position.column, Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_8__["ensureValidWordDefinition"])(wordDefinition), this._lines[position.lineNumber - 1], 0); - if (wordAtText) { - return new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); - } - return null; - } - words(wordDefinition) { - const lines = this._lines; - const wordenize = this._wordenize.bind(this); - let lineNumber = 0; - let lineText = ''; - let wordRangesIdx = 0; - let wordRanges = []; - return { - *[Symbol.iterator]() { - while (true) { - if (wordRangesIdx < wordRanges.length) { - const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); - wordRangesIdx += 1; - yield value; - } - else { - if (lineNumber < lines.length) { - lineText = lines[lineNumber]; - wordRanges = wordenize(lineText, wordDefinition); - wordRangesIdx = 0; - lineNumber += 1; - } - else { - break; - } - } - } - } - }; - } - getLineWords(lineNumber, wordDefinition) { - let content = this._lines[lineNumber - 1]; - let ranges = this._wordenize(content, wordDefinition); - let words = []; - for (const range of ranges) { - words.push({ - word: content.substring(range.start, range.end), - startColumn: range.start + 1, - endColumn: range.end + 1 - }); - } - return words; - } - _wordenize(content, wordDefinition) { - const result = []; - let match; - wordDefinition.lastIndex = 0; // reset lastIndex just to be sure - while (match = wordDefinition.exec(content)) { - if (match[0].length === 0) { - // it did match the empty string - break; - } - result.push({ start: match.index, end: match.index + match[0].length }); - } - return result; - } - getValueInRange(range) { - range = this._validateRange(range); - if (range.startLineNumber === range.endLineNumber) { - return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); - } - let lineEnding = this._eol; - let startLineIndex = range.startLineNumber - 1; - let endLineIndex = range.endLineNumber - 1; - let resultLines = []; - resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); - for (let i = startLineIndex + 1; i < endLineIndex; i++) { - resultLines.push(this._lines[i]); - } - resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); - return resultLines.join(lineEnding); - } - offsetAt(position) { - position = this._validatePosition(position); - this._ensureLineStarts(); - return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); - } - positionAt(offset) { - offset = Math.floor(offset); - offset = Math.max(0, offset); - this._ensureLineStarts(); - let out = this._lineStarts.getIndexOf(offset); - let lineLength = this._lines[out.index].length; - // Ensure we return a valid position - return { - lineNumber: 1 + out.index, - column: 1 + Math.min(out.remainder, lineLength) - }; - } - _validateRange(range) { - const start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); - const end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); - if (start.lineNumber !== range.startLineNumber - || start.column !== range.startColumn - || end.lineNumber !== range.endLineNumber - || end.column !== range.endColumn) { - return { - startLineNumber: start.lineNumber, - startColumn: start.column, - endLineNumber: end.lineNumber, - endColumn: end.column - }; - } - return range; - } - _validatePosition(position) { - if (!_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"].isIPosition(position)) { - throw new Error('bad position'); - } - let { lineNumber, column } = position; - let hasChanged = false; - if (lineNumber < 1) { - lineNumber = 1; - column = 1; - hasChanged = true; - } - else if (lineNumber > this._lines.length) { - lineNumber = this._lines.length; - column = this._lines[lineNumber - 1].length + 1; - hasChanged = true; - } - else { - let maxCharacter = this._lines[lineNumber - 1].length + 1; - if (column < 1) { - column = 1; - hasChanged = true; - } - else if (column > maxCharacter) { - column = maxCharacter; - hasChanged = true; - } - } - if (!hasChanged) { - return position; - } - else { - return { lineNumber, column }; - } - } -} -/** - * @internal - */ -class EditorSimpleWorker { - constructor(host, foreignModuleFactory) { - this._host = host; - this._models = Object.create(null); - this._foreignModuleFactory = foreignModuleFactory; - this._foreignModule = null; - } - dispose() { - this._models = Object.create(null); - } - _getModel(uri) { - return this._models[uri]; - } - _getModels() { - let all = []; - Object.keys(this._models).forEach((key) => all.push(this._models[key])); - return all; - } - acceptNewModel(data) { - this._models[data.url] = new MirrorModel(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"].parse(data.url), data.lines, data.EOL, data.versionId); - } - acceptModelChanged(strURL, e) { - if (!this._models[strURL]) { - return; - } - let model = this._models[strURL]; - model.onEvents(e); - } - acceptRemovedModel(strURL) { - if (!this._models[strURL]) { - return; - } - delete this._models[strURL]; - } - // ---- BEGIN diff -------------------------------------------------------------------------- - computeDiff(originalUrl, modifiedUrl, ignoreTrimWhitespace, maxComputationTime) { - return __awaiter(this, void 0, void 0, function* () { - const original = this._getModel(originalUrl); - const modified = this._getModel(modifiedUrl); - if (!original || !modified) { - return null; - } - const originalLines = original.getLinesContent(); - const modifiedLines = modified.getLinesContent(); - const diffComputer = new _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_6__["DiffComputer"](originalLines, modifiedLines, { - shouldComputeCharChanges: true, - shouldPostProcessCharChanges: true, - shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, - shouldMakePrettyDiff: true, - maxComputationTime: maxComputationTime - }); - const diffResult = diffComputer.computeDiff(); - const identical = (diffResult.changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); - return { - quitEarly: diffResult.quitEarly, - identical: identical, - changes: diffResult.changes - }; - }); - } - _modelsAreIdentical(original, modified) { - const originalLineCount = original.getLineCount(); - const modifiedLineCount = modified.getLineCount(); - if (originalLineCount !== modifiedLineCount) { - return false; - } - for (let line = 1; line <= originalLineCount; line++) { - const originalLine = original.getLineContent(line); - const modifiedLine = modified.getLineContent(line); - if (originalLine !== modifiedLine) { - return false; - } - } - return true; - } - computeMoreMinimalEdits(modelUrl, edits) { - return __awaiter(this, void 0, void 0, function* () { - const model = this._getModel(modelUrl); - if (!model) { - return edits; - } - const result = []; - let lastEol = undefined; - edits = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["mergeSort"])(edits, (a, b) => { - if (a.range && b.range) { - return _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].compareRangesUsingStarts(a.range, b.range); - } - // eol only changes should go to the end - let aRng = a.range ? 0 : 1; - let bRng = b.range ? 0 : 1; - return aRng - bRng; - }); - for (let { range, text, eol } of edits) { - if (typeof eol === 'number') { - lastEol = eol; - } - if (_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].isEmpty(range) && !text) { - // empty change - continue; - } - const original = model.getValueInRange(range); - text = text.replace(/\r\n|\n|\r/g, model.eol); - if (original === text) { - // noop - continue; - } - // make sure diff won't take too long - if (Math.max(text.length, original.length) > EditorSimpleWorker._diffLimit) { - result.push({ range, text }); - continue; - } - // compute diff between original and edit.text - const changes = Object(_base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__["stringDiff"])(original, text, false); - const editOffset = model.offsetAt(_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].lift(range).getStartPosition()); - for (const change of changes) { - const start = model.positionAt(editOffset + change.originalStart); - const end = model.positionAt(editOffset + change.originalStart + change.originalLength); - const newEdit = { - text: text.substr(change.modifiedStart, change.modifiedLength), - range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } - }; - if (model.getValueInRange(newEdit.range) !== newEdit.text) { - result.push(newEdit); - } - } - } - if (typeof lastEol === 'number') { - result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); - } - return result; - }); - } - // ---- END minimal edits --------------------------------------------------------------- - computeLinks(modelUrl) { - return __awaiter(this, void 0, void 0, function* () { - let model = this._getModel(modelUrl); - if (!model) { - return null; - } - return Object(_modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_9__["computeLinks"])(model); - }); - } - textualSuggest(modelUrl, position, wordDef, wordDefFlags) { - return __awaiter(this, void 0, void 0, function* () { - const model = this._getModel(modelUrl); - if (!model) { - return null; - } - const words = []; - const seen = new Set(); - const wordDefRegExp = new RegExp(wordDef, wordDefFlags); - const wordAt = model.getWordAtPosition(position, wordDefRegExp); - if (wordAt) { - seen.add(model.getValueInRange(wordAt)); - } - for (let word of model.words(wordDefRegExp)) { - if (seen.has(word)) { - continue; - } - seen.add(word); - if (!isNaN(Number(word))) { - continue; - } - words.push(word); - if (seen.size > EditorSimpleWorker._suggestionsLimit) { - break; - } - } - return words; - }); - } - // ---- END suggest -------------------------------------------------------------------------- - //#region -- word ranges -- - computeWordRanges(modelUrl, range, wordDef, wordDefFlags) { - return __awaiter(this, void 0, void 0, function* () { - let model = this._getModel(modelUrl); - if (!model) { - return Object.create(null); - } - const wordDefRegExp = new RegExp(wordDef, wordDefFlags); - const result = Object.create(null); - for (let line = range.startLineNumber; line < range.endLineNumber; line++) { - let words = model.getLineWords(line, wordDefRegExp); - for (const word of words) { - if (!isNaN(Number(word.word))) { - continue; - } - let array = result[word.word]; - if (!array) { - array = []; - result[word.word] = array; - } - array.push({ - startLineNumber: line, - startColumn: word.startColumn, - endLineNumber: line, - endColumn: word.endColumn - }); - } - } - return result; - }); - } - //#endregion - navigateValueSet(modelUrl, range, up, wordDef, wordDefFlags) { - return __awaiter(this, void 0, void 0, function* () { - let model = this._getModel(modelUrl); - if (!model) { - return null; - } - let wordDefRegExp = new RegExp(wordDef, wordDefFlags); - if (range.startColumn === range.endColumn) { - range = { - startLineNumber: range.startLineNumber, - startColumn: range.startColumn, - endLineNumber: range.endLineNumber, - endColumn: range.endColumn + 1 - }; - } - let selectionText = model.getValueInRange(range); - let wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); - if (!wordRange) { - return null; - } - let word = model.getValueInRange(wordRange); - let result = _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_10__["BasicInplaceReplace"].INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); - return result; - }); - } - // ---- BEGIN foreign module support -------------------------------------------------------------------------- - loadForeignModule(moduleId, createData, foreignHostMethods) { - const proxyMethodRequest = (method, args) => { - return this._host.fhr(method, args); - }; - const foreignHost = _base_common_types_js__WEBPACK_IMPORTED_MODULE_12__["createProxyObject"](foreignHostMethods, proxyMethodRequest); - let ctx = { - host: foreignHost, - getMirrorModels: () => { - return this._getModels(); - } - }; - if (this._foreignModuleFactory) { - this._foreignModule = this._foreignModuleFactory(ctx, createData); - // static foreing module - return Promise.resolve(_base_common_types_js__WEBPACK_IMPORTED_MODULE_12__["getAllMethodNames"](this._foreignModule)); - } - // ESM-comment-begin - // return new Promise((resolve, reject) => { - // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { - // this._foreignModule = foreignModule.create(ctx, createData); - // - // resolve(types.getAllMethodNames(this._foreignModule)); - // - // }, reject); - // }); - // ESM-comment-end - // ESM-uncomment-begin - return Promise.reject(new Error(`Unexpected usage`)); - // ESM-uncomment-end - } - // foreign method request - fmr(method, args) { - if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); - } - catch (e) { - return Promise.reject(e); - } - } -} -// ---- END diff -------------------------------------------------------------------------- -// ---- BEGIN minimal edits --------------------------------------------------------------- -EditorSimpleWorker._diffLimit = 100000; -// ---- BEGIN suggest -------------------------------------------------------------------------- -EditorSimpleWorker._suggestionsLimit = 10000; -/** - * Called on the worker side - * @internal - */ -function create(host) { - return new EditorSimpleWorker(host, null); -} -if (typeof importScripts === 'function') { - // Running in a web worker - _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["globals"].monaco = Object(_standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_11__["createMonacoBaseAPI"])(); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js ***! - \**************************************************************************************/ -/*! exports provided: KeyMod, createMonacoBaseAPI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyMod", function() { return KeyMod; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMonacoBaseAPI", function() { return createMonacoBaseAPI; }); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _core_token_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/token.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js"); -/* harmony import */ var _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./standaloneEnums.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -class KeyMod { - static chord(firstPart, secondPart) { - return Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__["KeyChord"])(firstPart, secondPart); - } -} -KeyMod.CtrlCmd = 2048 /* CtrlCmd */; -KeyMod.Shift = 1024 /* Shift */; -KeyMod.Alt = 512 /* Alt */; -KeyMod.WinCtrl = 256 /* WinCtrl */; -function createMonacoBaseAPI() { - return { - editor: undefined, - languages: undefined, - CancellationTokenSource: _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationTokenSource"], - Emitter: _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"], - KeyCode: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__["KeyCode"], - KeyMod: KeyMod, - Position: _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"], - Range: _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"], - Selection: _core_selection_js__WEBPACK_IMPORTED_MODULE_6__["Selection"], - SelectionDirection: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__["SelectionDirection"], - MarkerSeverity: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__["MarkerSeverity"], - MarkerTag: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__["MarkerTag"], - Uri: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"], - Token: _core_token_js__WEBPACK_IMPORTED_MODULE_7__["Token"] - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js ***! - \***************************************************************************************/ -/*! exports provided: AccessibilitySupport, CompletionItemInsertTextRule, CompletionItemKind, CompletionItemTag, CompletionTriggerKind, ContentWidgetPositionPreference, CursorChangeReason, DefaultEndOfLine, DocumentHighlightKind, EditorAutoIndentStrategy, EditorOption, EndOfLinePreference, EndOfLineSequence, IndentAction, KeyCode, MarkerSeverity, MarkerTag, MinimapPosition, MouseTargetType, OverlayWidgetPositionPreference, OverviewRulerLane, RenderLineNumbersType, RenderMinimap, ScrollType, ScrollbarVisibility, SelectionDirection, SignatureHelpTriggerKind, SymbolKind, SymbolTag, TextEditorCursorBlinkingStyle, TextEditorCursorStyle, TrackedRangeStickiness, WrappingIndent */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccessibilitySupport", function() { return AccessibilitySupport; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemInsertTextRule", function() { return CompletionItemInsertTextRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemTag", function() { return CompletionItemTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionTriggerKind", function() { return CompletionTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentWidgetPositionPreference", function() { return ContentWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorChangeReason", function() { return CursorChangeReason; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultEndOfLine", function() { return DefaultEndOfLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorAutoIndentStrategy", function() { return EditorAutoIndentStrategy; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorOption", function() { return EditorOption; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLinePreference", function() { return EndOfLinePreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLineSequence", function() { return EndOfLineSequence; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentAction", function() { return IndentAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCode", function() { return KeyCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerSeverity", function() { return MarkerSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerTag", function() { return MarkerTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinimapPosition", function() { return MinimapPosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseTargetType", function() { return MouseTargetType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayWidgetPositionPreference", function() { return OverlayWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewRulerLane", function() { return OverviewRulerLane; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderLineNumbersType", function() { return RenderLineNumbersType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderMinimap", function() { return RenderMinimap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollType", function() { return ScrollType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollbarVisibility", function() { return ScrollbarVisibility; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionDirection", function() { return SelectionDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureHelpTriggerKind", function() { return SignatureHelpTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolTag", function() { return SymbolTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorBlinkingStyle", function() { return TextEditorCursorBlinkingStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorStyle", function() { return TextEditorCursorStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackedRangeStickiness", function() { return TrackedRangeStickiness; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrappingIndent", function() { return WrappingIndent; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. -var AccessibilitySupport; -(function (AccessibilitySupport) { - /** - * This should be the browser case where it is not known if a screen reader is attached or no. - */ - AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown"; - AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled"; - AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled"; -})(AccessibilitySupport || (AccessibilitySupport = {})); -var CompletionItemInsertTextRule; -(function (CompletionItemInsertTextRule) { - /** - * Adjust whitespace/indentation of multiline insert texts to - * match the current line indentation. - */ - CompletionItemInsertTextRule[CompletionItemInsertTextRule["KeepWhitespace"] = 1] = "KeepWhitespace"; - /** - * `insertText` is a snippet. - */ - CompletionItemInsertTextRule[CompletionItemInsertTextRule["InsertAsSnippet"] = 4] = "InsertAsSnippet"; -})(CompletionItemInsertTextRule || (CompletionItemInsertTextRule = {})); -var CompletionItemKind; -(function (CompletionItemKind) { - CompletionItemKind[CompletionItemKind["Method"] = 0] = "Method"; - CompletionItemKind[CompletionItemKind["Function"] = 1] = "Function"; - CompletionItemKind[CompletionItemKind["Constructor"] = 2] = "Constructor"; - CompletionItemKind[CompletionItemKind["Field"] = 3] = "Field"; - CompletionItemKind[CompletionItemKind["Variable"] = 4] = "Variable"; - CompletionItemKind[CompletionItemKind["Class"] = 5] = "Class"; - CompletionItemKind[CompletionItemKind["Struct"] = 6] = "Struct"; - CompletionItemKind[CompletionItemKind["Interface"] = 7] = "Interface"; - CompletionItemKind[CompletionItemKind["Module"] = 8] = "Module"; - CompletionItemKind[CompletionItemKind["Property"] = 9] = "Property"; - CompletionItemKind[CompletionItemKind["Event"] = 10] = "Event"; - CompletionItemKind[CompletionItemKind["Operator"] = 11] = "Operator"; - CompletionItemKind[CompletionItemKind["Unit"] = 12] = "Unit"; - CompletionItemKind[CompletionItemKind["Value"] = 13] = "Value"; - CompletionItemKind[CompletionItemKind["Constant"] = 14] = "Constant"; - CompletionItemKind[CompletionItemKind["Enum"] = 15] = "Enum"; - CompletionItemKind[CompletionItemKind["EnumMember"] = 16] = "EnumMember"; - CompletionItemKind[CompletionItemKind["Keyword"] = 17] = "Keyword"; - CompletionItemKind[CompletionItemKind["Text"] = 18] = "Text"; - CompletionItemKind[CompletionItemKind["Color"] = 19] = "Color"; - CompletionItemKind[CompletionItemKind["File"] = 20] = "File"; - CompletionItemKind[CompletionItemKind["Reference"] = 21] = "Reference"; - CompletionItemKind[CompletionItemKind["Customcolor"] = 22] = "Customcolor"; - CompletionItemKind[CompletionItemKind["Folder"] = 23] = "Folder"; - CompletionItemKind[CompletionItemKind["TypeParameter"] = 24] = "TypeParameter"; - CompletionItemKind[CompletionItemKind["User"] = 25] = "User"; - CompletionItemKind[CompletionItemKind["Issue"] = 26] = "Issue"; - CompletionItemKind[CompletionItemKind["Snippet"] = 27] = "Snippet"; -})(CompletionItemKind || (CompletionItemKind = {})); -var CompletionItemTag; -(function (CompletionItemTag) { - CompletionItemTag[CompletionItemTag["Deprecated"] = 1] = "Deprecated"; -})(CompletionItemTag || (CompletionItemTag = {})); -/** - * How a suggest provider was triggered. - */ -var CompletionTriggerKind; -(function (CompletionTriggerKind) { - CompletionTriggerKind[CompletionTriggerKind["Invoke"] = 0] = "Invoke"; - CompletionTriggerKind[CompletionTriggerKind["TriggerCharacter"] = 1] = "TriggerCharacter"; - CompletionTriggerKind[CompletionTriggerKind["TriggerForIncompleteCompletions"] = 2] = "TriggerForIncompleteCompletions"; -})(CompletionTriggerKind || (CompletionTriggerKind = {})); -/** - * A positioning preference for rendering content widgets. - */ -var ContentWidgetPositionPreference; -(function (ContentWidgetPositionPreference) { - /** - * Place the content widget exactly at a position - */ - ContentWidgetPositionPreference[ContentWidgetPositionPreference["EXACT"] = 0] = "EXACT"; - /** - * Place the content widget above a position - */ - ContentWidgetPositionPreference[ContentWidgetPositionPreference["ABOVE"] = 1] = "ABOVE"; - /** - * Place the content widget below a position - */ - ContentWidgetPositionPreference[ContentWidgetPositionPreference["BELOW"] = 2] = "BELOW"; -})(ContentWidgetPositionPreference || (ContentWidgetPositionPreference = {})); -/** - * Describes the reason the cursor has changed its position. - */ -var CursorChangeReason; -(function (CursorChangeReason) { - /** - * Unknown or not set. - */ - CursorChangeReason[CursorChangeReason["NotSet"] = 0] = "NotSet"; - /** - * A `model.setValue()` was called. - */ - CursorChangeReason[CursorChangeReason["ContentFlush"] = 1] = "ContentFlush"; - /** - * The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers. - */ - CursorChangeReason[CursorChangeReason["RecoverFromMarkers"] = 2] = "RecoverFromMarkers"; - /** - * There was an explicit user gesture. - */ - CursorChangeReason[CursorChangeReason["Explicit"] = 3] = "Explicit"; - /** - * There was a Paste. - */ - CursorChangeReason[CursorChangeReason["Paste"] = 4] = "Paste"; - /** - * There was an Undo. - */ - CursorChangeReason[CursorChangeReason["Undo"] = 5] = "Undo"; - /** - * There was a Redo. - */ - CursorChangeReason[CursorChangeReason["Redo"] = 6] = "Redo"; -})(CursorChangeReason || (CursorChangeReason = {})); -/** - * The default end of line to use when instantiating models. - */ -var DefaultEndOfLine; -(function (DefaultEndOfLine) { - /** - * Use line feed (\n) as the end of line character. - */ - DefaultEndOfLine[DefaultEndOfLine["LF"] = 1] = "LF"; - /** - * Use carriage return and line feed (\r\n) as the end of line character. - */ - DefaultEndOfLine[DefaultEndOfLine["CRLF"] = 2] = "CRLF"; -})(DefaultEndOfLine || (DefaultEndOfLine = {})); -/** - * A document highlight kind. - */ -var DocumentHighlightKind; -(function (DocumentHighlightKind) { - /** - * A textual occurrence. - */ - DocumentHighlightKind[DocumentHighlightKind["Text"] = 0] = "Text"; - /** - * Read-access of a symbol, like reading a variable. - */ - DocumentHighlightKind[DocumentHighlightKind["Read"] = 1] = "Read"; - /** - * Write-access of a symbol, like writing to a variable. - */ - DocumentHighlightKind[DocumentHighlightKind["Write"] = 2] = "Write"; -})(DocumentHighlightKind || (DocumentHighlightKind = {})); -/** - * Configuration options for auto indentation in the editor - */ -var EditorAutoIndentStrategy; -(function (EditorAutoIndentStrategy) { - EditorAutoIndentStrategy[EditorAutoIndentStrategy["None"] = 0] = "None"; - EditorAutoIndentStrategy[EditorAutoIndentStrategy["Keep"] = 1] = "Keep"; - EditorAutoIndentStrategy[EditorAutoIndentStrategy["Brackets"] = 2] = "Brackets"; - EditorAutoIndentStrategy[EditorAutoIndentStrategy["Advanced"] = 3] = "Advanced"; - EditorAutoIndentStrategy[EditorAutoIndentStrategy["Full"] = 4] = "Full"; -})(EditorAutoIndentStrategy || (EditorAutoIndentStrategy = {})); -var EditorOption; -(function (EditorOption) { - EditorOption[EditorOption["acceptSuggestionOnCommitCharacter"] = 0] = "acceptSuggestionOnCommitCharacter"; - EditorOption[EditorOption["acceptSuggestionOnEnter"] = 1] = "acceptSuggestionOnEnter"; - EditorOption[EditorOption["accessibilitySupport"] = 2] = "accessibilitySupport"; - EditorOption[EditorOption["accessibilityPageSize"] = 3] = "accessibilityPageSize"; - EditorOption[EditorOption["ariaLabel"] = 4] = "ariaLabel"; - EditorOption[EditorOption["autoClosingBrackets"] = 5] = "autoClosingBrackets"; - EditorOption[EditorOption["autoClosingOvertype"] = 6] = "autoClosingOvertype"; - EditorOption[EditorOption["autoClosingQuotes"] = 7] = "autoClosingQuotes"; - EditorOption[EditorOption["autoIndent"] = 8] = "autoIndent"; - EditorOption[EditorOption["automaticLayout"] = 9] = "automaticLayout"; - EditorOption[EditorOption["autoSurround"] = 10] = "autoSurround"; - EditorOption[EditorOption["codeLens"] = 11] = "codeLens"; - EditorOption[EditorOption["colorDecorators"] = 12] = "colorDecorators"; - EditorOption[EditorOption["columnSelection"] = 13] = "columnSelection"; - EditorOption[EditorOption["comments"] = 14] = "comments"; - EditorOption[EditorOption["contextmenu"] = 15] = "contextmenu"; - EditorOption[EditorOption["copyWithSyntaxHighlighting"] = 16] = "copyWithSyntaxHighlighting"; - EditorOption[EditorOption["cursorBlinking"] = 17] = "cursorBlinking"; - EditorOption[EditorOption["cursorSmoothCaretAnimation"] = 18] = "cursorSmoothCaretAnimation"; - EditorOption[EditorOption["cursorStyle"] = 19] = "cursorStyle"; - EditorOption[EditorOption["cursorSurroundingLines"] = 20] = "cursorSurroundingLines"; - EditorOption[EditorOption["cursorSurroundingLinesStyle"] = 21] = "cursorSurroundingLinesStyle"; - EditorOption[EditorOption["cursorWidth"] = 22] = "cursorWidth"; - EditorOption[EditorOption["disableLayerHinting"] = 23] = "disableLayerHinting"; - EditorOption[EditorOption["disableMonospaceOptimizations"] = 24] = "disableMonospaceOptimizations"; - EditorOption[EditorOption["dragAndDrop"] = 25] = "dragAndDrop"; - EditorOption[EditorOption["emptySelectionClipboard"] = 26] = "emptySelectionClipboard"; - EditorOption[EditorOption["extraEditorClassName"] = 27] = "extraEditorClassName"; - EditorOption[EditorOption["fastScrollSensitivity"] = 28] = "fastScrollSensitivity"; - EditorOption[EditorOption["find"] = 29] = "find"; - EditorOption[EditorOption["fixedOverflowWidgets"] = 30] = "fixedOverflowWidgets"; - EditorOption[EditorOption["folding"] = 31] = "folding"; - EditorOption[EditorOption["foldingStrategy"] = 32] = "foldingStrategy"; - EditorOption[EditorOption["foldingHighlight"] = 33] = "foldingHighlight"; - EditorOption[EditorOption["unfoldOnClickAfterEndOfLine"] = 34] = "unfoldOnClickAfterEndOfLine"; - EditorOption[EditorOption["fontFamily"] = 35] = "fontFamily"; - EditorOption[EditorOption["fontInfo"] = 36] = "fontInfo"; - EditorOption[EditorOption["fontLigatures"] = 37] = "fontLigatures"; - EditorOption[EditorOption["fontSize"] = 38] = "fontSize"; - EditorOption[EditorOption["fontWeight"] = 39] = "fontWeight"; - EditorOption[EditorOption["formatOnPaste"] = 40] = "formatOnPaste"; - EditorOption[EditorOption["formatOnType"] = 41] = "formatOnType"; - EditorOption[EditorOption["glyphMargin"] = 42] = "glyphMargin"; - EditorOption[EditorOption["gotoLocation"] = 43] = "gotoLocation"; - EditorOption[EditorOption["hideCursorInOverviewRuler"] = 44] = "hideCursorInOverviewRuler"; - EditorOption[EditorOption["highlightActiveIndentGuide"] = 45] = "highlightActiveIndentGuide"; - EditorOption[EditorOption["hover"] = 46] = "hover"; - EditorOption[EditorOption["inDiffEditor"] = 47] = "inDiffEditor"; - EditorOption[EditorOption["letterSpacing"] = 48] = "letterSpacing"; - EditorOption[EditorOption["lightbulb"] = 49] = "lightbulb"; - EditorOption[EditorOption["lineDecorationsWidth"] = 50] = "lineDecorationsWidth"; - EditorOption[EditorOption["lineHeight"] = 51] = "lineHeight"; - EditorOption[EditorOption["lineNumbers"] = 52] = "lineNumbers"; - EditorOption[EditorOption["lineNumbersMinChars"] = 53] = "lineNumbersMinChars"; - EditorOption[EditorOption["links"] = 54] = "links"; - EditorOption[EditorOption["matchBrackets"] = 55] = "matchBrackets"; - EditorOption[EditorOption["minimap"] = 56] = "minimap"; - EditorOption[EditorOption["mouseStyle"] = 57] = "mouseStyle"; - EditorOption[EditorOption["mouseWheelScrollSensitivity"] = 58] = "mouseWheelScrollSensitivity"; - EditorOption[EditorOption["mouseWheelZoom"] = 59] = "mouseWheelZoom"; - EditorOption[EditorOption["multiCursorMergeOverlapping"] = 60] = "multiCursorMergeOverlapping"; - EditorOption[EditorOption["multiCursorModifier"] = 61] = "multiCursorModifier"; - EditorOption[EditorOption["multiCursorPaste"] = 62] = "multiCursorPaste"; - EditorOption[EditorOption["occurrencesHighlight"] = 63] = "occurrencesHighlight"; - EditorOption[EditorOption["overviewRulerBorder"] = 64] = "overviewRulerBorder"; - EditorOption[EditorOption["overviewRulerLanes"] = 65] = "overviewRulerLanes"; - EditorOption[EditorOption["padding"] = 66] = "padding"; - EditorOption[EditorOption["parameterHints"] = 67] = "parameterHints"; - EditorOption[EditorOption["peekWidgetDefaultFocus"] = 68] = "peekWidgetDefaultFocus"; - EditorOption[EditorOption["definitionLinkOpensInPeek"] = 69] = "definitionLinkOpensInPeek"; - EditorOption[EditorOption["quickSuggestions"] = 70] = "quickSuggestions"; - EditorOption[EditorOption["quickSuggestionsDelay"] = 71] = "quickSuggestionsDelay"; - EditorOption[EditorOption["readOnly"] = 72] = "readOnly"; - EditorOption[EditorOption["renameOnType"] = 73] = "renameOnType"; - EditorOption[EditorOption["renderControlCharacters"] = 74] = "renderControlCharacters"; - EditorOption[EditorOption["renderIndentGuides"] = 75] = "renderIndentGuides"; - EditorOption[EditorOption["renderFinalNewline"] = 76] = "renderFinalNewline"; - EditorOption[EditorOption["renderLineHighlight"] = 77] = "renderLineHighlight"; - EditorOption[EditorOption["renderLineHighlightOnlyWhenFocus"] = 78] = "renderLineHighlightOnlyWhenFocus"; - EditorOption[EditorOption["renderValidationDecorations"] = 79] = "renderValidationDecorations"; - EditorOption[EditorOption["renderWhitespace"] = 80] = "renderWhitespace"; - EditorOption[EditorOption["revealHorizontalRightPadding"] = 81] = "revealHorizontalRightPadding"; - EditorOption[EditorOption["roundedSelection"] = 82] = "roundedSelection"; - EditorOption[EditorOption["rulers"] = 83] = "rulers"; - EditorOption[EditorOption["scrollbar"] = 84] = "scrollbar"; - EditorOption[EditorOption["scrollBeyondLastColumn"] = 85] = "scrollBeyondLastColumn"; - EditorOption[EditorOption["scrollBeyondLastLine"] = 86] = "scrollBeyondLastLine"; - EditorOption[EditorOption["scrollPredominantAxis"] = 87] = "scrollPredominantAxis"; - EditorOption[EditorOption["selectionClipboard"] = 88] = "selectionClipboard"; - EditorOption[EditorOption["selectionHighlight"] = 89] = "selectionHighlight"; - EditorOption[EditorOption["selectOnLineNumbers"] = 90] = "selectOnLineNumbers"; - EditorOption[EditorOption["showFoldingControls"] = 91] = "showFoldingControls"; - EditorOption[EditorOption["showUnused"] = 92] = "showUnused"; - EditorOption[EditorOption["snippetSuggestions"] = 93] = "snippetSuggestions"; - EditorOption[EditorOption["smoothScrolling"] = 94] = "smoothScrolling"; - EditorOption[EditorOption["stopRenderingLineAfter"] = 95] = "stopRenderingLineAfter"; - EditorOption[EditorOption["suggest"] = 96] = "suggest"; - EditorOption[EditorOption["suggestFontSize"] = 97] = "suggestFontSize"; - EditorOption[EditorOption["suggestLineHeight"] = 98] = "suggestLineHeight"; - EditorOption[EditorOption["suggestOnTriggerCharacters"] = 99] = "suggestOnTriggerCharacters"; - EditorOption[EditorOption["suggestSelection"] = 100] = "suggestSelection"; - EditorOption[EditorOption["tabCompletion"] = 101] = "tabCompletion"; - EditorOption[EditorOption["tabIndex"] = 102] = "tabIndex"; - EditorOption[EditorOption["unusualLineTerminators"] = 103] = "unusualLineTerminators"; - EditorOption[EditorOption["useTabStops"] = 104] = "useTabStops"; - EditorOption[EditorOption["wordSeparators"] = 105] = "wordSeparators"; - EditorOption[EditorOption["wordWrap"] = 106] = "wordWrap"; - EditorOption[EditorOption["wordWrapBreakAfterCharacters"] = 107] = "wordWrapBreakAfterCharacters"; - EditorOption[EditorOption["wordWrapBreakBeforeCharacters"] = 108] = "wordWrapBreakBeforeCharacters"; - EditorOption[EditorOption["wordWrapColumn"] = 109] = "wordWrapColumn"; - EditorOption[EditorOption["wordWrapMinified"] = 110] = "wordWrapMinified"; - EditorOption[EditorOption["wrappingIndent"] = 111] = "wrappingIndent"; - EditorOption[EditorOption["wrappingStrategy"] = 112] = "wrappingStrategy"; - EditorOption[EditorOption["showDeprecated"] = 113] = "showDeprecated"; - EditorOption[EditorOption["editorClassName"] = 114] = "editorClassName"; - EditorOption[EditorOption["pixelRatio"] = 115] = "pixelRatio"; - EditorOption[EditorOption["tabFocusMode"] = 116] = "tabFocusMode"; - EditorOption[EditorOption["layoutInfo"] = 117] = "layoutInfo"; - EditorOption[EditorOption["wrappingInfo"] = 118] = "wrappingInfo"; -})(EditorOption || (EditorOption = {})); -/** - * End of line character preference. - */ -var EndOfLinePreference; -(function (EndOfLinePreference) { - /** - * Use the end of line character identified in the text buffer. - */ - EndOfLinePreference[EndOfLinePreference["TextDefined"] = 0] = "TextDefined"; - /** - * Use line feed (\n) as the end of line character. - */ - EndOfLinePreference[EndOfLinePreference["LF"] = 1] = "LF"; - /** - * Use carriage return and line feed (\r\n) as the end of line character. - */ - EndOfLinePreference[EndOfLinePreference["CRLF"] = 2] = "CRLF"; -})(EndOfLinePreference || (EndOfLinePreference = {})); -/** - * End of line character preference. - */ -var EndOfLineSequence; -(function (EndOfLineSequence) { - /** - * Use line feed (\n) as the end of line character. - */ - EndOfLineSequence[EndOfLineSequence["LF"] = 0] = "LF"; - /** - * Use carriage return and line feed (\r\n) as the end of line character. - */ - EndOfLineSequence[EndOfLineSequence["CRLF"] = 1] = "CRLF"; -})(EndOfLineSequence || (EndOfLineSequence = {})); -/** - * Describes what to do with the indentation when pressing Enter. - */ -var IndentAction; -(function (IndentAction) { - /** - * Insert new line and copy the previous line's indentation. - */ - IndentAction[IndentAction["None"] = 0] = "None"; - /** - * Insert new line and indent once (relative to the previous line's indentation). - */ - IndentAction[IndentAction["Indent"] = 1] = "Indent"; - /** - * Insert two new lines: - * - the first one indented which will hold the cursor - * - the second one at the same indentation level - */ - IndentAction[IndentAction["IndentOutdent"] = 2] = "IndentOutdent"; - /** - * Insert new line and outdent once (relative to the previous line's indentation). - */ - IndentAction[IndentAction["Outdent"] = 3] = "Outdent"; -})(IndentAction || (IndentAction = {})); -/** - * Virtual Key Codes, the value does not hold any inherent meaning. - * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx - * But these are "more general", as they should work across browsers & OS`s. - */ -var KeyCode; -(function (KeyCode) { - /** - * Placed first to cover the 0 value of the enum. - */ - KeyCode[KeyCode["Unknown"] = 0] = "Unknown"; - KeyCode[KeyCode["Backspace"] = 1] = "Backspace"; - KeyCode[KeyCode["Tab"] = 2] = "Tab"; - KeyCode[KeyCode["Enter"] = 3] = "Enter"; - KeyCode[KeyCode["Shift"] = 4] = "Shift"; - KeyCode[KeyCode["Ctrl"] = 5] = "Ctrl"; - KeyCode[KeyCode["Alt"] = 6] = "Alt"; - KeyCode[KeyCode["PauseBreak"] = 7] = "PauseBreak"; - KeyCode[KeyCode["CapsLock"] = 8] = "CapsLock"; - KeyCode[KeyCode["Escape"] = 9] = "Escape"; - KeyCode[KeyCode["Space"] = 10] = "Space"; - KeyCode[KeyCode["PageUp"] = 11] = "PageUp"; - KeyCode[KeyCode["PageDown"] = 12] = "PageDown"; - KeyCode[KeyCode["End"] = 13] = "End"; - KeyCode[KeyCode["Home"] = 14] = "Home"; - KeyCode[KeyCode["LeftArrow"] = 15] = "LeftArrow"; - KeyCode[KeyCode["UpArrow"] = 16] = "UpArrow"; - KeyCode[KeyCode["RightArrow"] = 17] = "RightArrow"; - KeyCode[KeyCode["DownArrow"] = 18] = "DownArrow"; - KeyCode[KeyCode["Insert"] = 19] = "Insert"; - KeyCode[KeyCode["Delete"] = 20] = "Delete"; - KeyCode[KeyCode["KEY_0"] = 21] = "KEY_0"; - KeyCode[KeyCode["KEY_1"] = 22] = "KEY_1"; - KeyCode[KeyCode["KEY_2"] = 23] = "KEY_2"; - KeyCode[KeyCode["KEY_3"] = 24] = "KEY_3"; - KeyCode[KeyCode["KEY_4"] = 25] = "KEY_4"; - KeyCode[KeyCode["KEY_5"] = 26] = "KEY_5"; - KeyCode[KeyCode["KEY_6"] = 27] = "KEY_6"; - KeyCode[KeyCode["KEY_7"] = 28] = "KEY_7"; - KeyCode[KeyCode["KEY_8"] = 29] = "KEY_8"; - KeyCode[KeyCode["KEY_9"] = 30] = "KEY_9"; - KeyCode[KeyCode["KEY_A"] = 31] = "KEY_A"; - KeyCode[KeyCode["KEY_B"] = 32] = "KEY_B"; - KeyCode[KeyCode["KEY_C"] = 33] = "KEY_C"; - KeyCode[KeyCode["KEY_D"] = 34] = "KEY_D"; - KeyCode[KeyCode["KEY_E"] = 35] = "KEY_E"; - KeyCode[KeyCode["KEY_F"] = 36] = "KEY_F"; - KeyCode[KeyCode["KEY_G"] = 37] = "KEY_G"; - KeyCode[KeyCode["KEY_H"] = 38] = "KEY_H"; - KeyCode[KeyCode["KEY_I"] = 39] = "KEY_I"; - KeyCode[KeyCode["KEY_J"] = 40] = "KEY_J"; - KeyCode[KeyCode["KEY_K"] = 41] = "KEY_K"; - KeyCode[KeyCode["KEY_L"] = 42] = "KEY_L"; - KeyCode[KeyCode["KEY_M"] = 43] = "KEY_M"; - KeyCode[KeyCode["KEY_N"] = 44] = "KEY_N"; - KeyCode[KeyCode["KEY_O"] = 45] = "KEY_O"; - KeyCode[KeyCode["KEY_P"] = 46] = "KEY_P"; - KeyCode[KeyCode["KEY_Q"] = 47] = "KEY_Q"; - KeyCode[KeyCode["KEY_R"] = 48] = "KEY_R"; - KeyCode[KeyCode["KEY_S"] = 49] = "KEY_S"; - KeyCode[KeyCode["KEY_T"] = 50] = "KEY_T"; - KeyCode[KeyCode["KEY_U"] = 51] = "KEY_U"; - KeyCode[KeyCode["KEY_V"] = 52] = "KEY_V"; - KeyCode[KeyCode["KEY_W"] = 53] = "KEY_W"; - KeyCode[KeyCode["KEY_X"] = 54] = "KEY_X"; - KeyCode[KeyCode["KEY_Y"] = 55] = "KEY_Y"; - KeyCode[KeyCode["KEY_Z"] = 56] = "KEY_Z"; - KeyCode[KeyCode["Meta"] = 57] = "Meta"; - KeyCode[KeyCode["ContextMenu"] = 58] = "ContextMenu"; - KeyCode[KeyCode["F1"] = 59] = "F1"; - KeyCode[KeyCode["F2"] = 60] = "F2"; - KeyCode[KeyCode["F3"] = 61] = "F3"; - KeyCode[KeyCode["F4"] = 62] = "F4"; - KeyCode[KeyCode["F5"] = 63] = "F5"; - KeyCode[KeyCode["F6"] = 64] = "F6"; - KeyCode[KeyCode["F7"] = 65] = "F7"; - KeyCode[KeyCode["F8"] = 66] = "F8"; - KeyCode[KeyCode["F9"] = 67] = "F9"; - KeyCode[KeyCode["F10"] = 68] = "F10"; - KeyCode[KeyCode["F11"] = 69] = "F11"; - KeyCode[KeyCode["F12"] = 70] = "F12"; - KeyCode[KeyCode["F13"] = 71] = "F13"; - KeyCode[KeyCode["F14"] = 72] = "F14"; - KeyCode[KeyCode["F15"] = 73] = "F15"; - KeyCode[KeyCode["F16"] = 74] = "F16"; - KeyCode[KeyCode["F17"] = 75] = "F17"; - KeyCode[KeyCode["F18"] = 76] = "F18"; - KeyCode[KeyCode["F19"] = 77] = "F19"; - KeyCode[KeyCode["NumLock"] = 78] = "NumLock"; - KeyCode[KeyCode["ScrollLock"] = 79] = "ScrollLock"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the ';:' key - */ - KeyCode[KeyCode["US_SEMICOLON"] = 80] = "US_SEMICOLON"; - /** - * For any country/region, the '+' key - * For the US standard keyboard, the '=+' key - */ - KeyCode[KeyCode["US_EQUAL"] = 81] = "US_EQUAL"; - /** - * For any country/region, the ',' key - * For the US standard keyboard, the ',<' key - */ - KeyCode[KeyCode["US_COMMA"] = 82] = "US_COMMA"; - /** - * For any country/region, the '-' key - * For the US standard keyboard, the '-_' key - */ - KeyCode[KeyCode["US_MINUS"] = 83] = "US_MINUS"; - /** - * For any country/region, the '.' key - * For the US standard keyboard, the '.>' key - */ - KeyCode[KeyCode["US_DOT"] = 84] = "US_DOT"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the '/?' key - */ - KeyCode[KeyCode["US_SLASH"] = 85] = "US_SLASH"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the '`~' key - */ - KeyCode[KeyCode["US_BACKTICK"] = 86] = "US_BACKTICK"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the '[{' key - */ - KeyCode[KeyCode["US_OPEN_SQUARE_BRACKET"] = 87] = "US_OPEN_SQUARE_BRACKET"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the '\|' key - */ - KeyCode[KeyCode["US_BACKSLASH"] = 88] = "US_BACKSLASH"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the ']}' key - */ - KeyCode[KeyCode["US_CLOSE_SQUARE_BRACKET"] = 89] = "US_CLOSE_SQUARE_BRACKET"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the ''"' key - */ - KeyCode[KeyCode["US_QUOTE"] = 90] = "US_QUOTE"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - */ - KeyCode[KeyCode["OEM_8"] = 91] = "OEM_8"; - /** - * Either the angle bracket key or the backslash key on the RT 102-key keyboard. - */ - KeyCode[KeyCode["OEM_102"] = 92] = "OEM_102"; - KeyCode[KeyCode["NUMPAD_0"] = 93] = "NUMPAD_0"; - KeyCode[KeyCode["NUMPAD_1"] = 94] = "NUMPAD_1"; - KeyCode[KeyCode["NUMPAD_2"] = 95] = "NUMPAD_2"; - KeyCode[KeyCode["NUMPAD_3"] = 96] = "NUMPAD_3"; - KeyCode[KeyCode["NUMPAD_4"] = 97] = "NUMPAD_4"; - KeyCode[KeyCode["NUMPAD_5"] = 98] = "NUMPAD_5"; - KeyCode[KeyCode["NUMPAD_6"] = 99] = "NUMPAD_6"; - KeyCode[KeyCode["NUMPAD_7"] = 100] = "NUMPAD_7"; - KeyCode[KeyCode["NUMPAD_8"] = 101] = "NUMPAD_8"; - KeyCode[KeyCode["NUMPAD_9"] = 102] = "NUMPAD_9"; - KeyCode[KeyCode["NUMPAD_MULTIPLY"] = 103] = "NUMPAD_MULTIPLY"; - KeyCode[KeyCode["NUMPAD_ADD"] = 104] = "NUMPAD_ADD"; - KeyCode[KeyCode["NUMPAD_SEPARATOR"] = 105] = "NUMPAD_SEPARATOR"; - KeyCode[KeyCode["NUMPAD_SUBTRACT"] = 106] = "NUMPAD_SUBTRACT"; - KeyCode[KeyCode["NUMPAD_DECIMAL"] = 107] = "NUMPAD_DECIMAL"; - KeyCode[KeyCode["NUMPAD_DIVIDE"] = 108] = "NUMPAD_DIVIDE"; - /** - * Cover all key codes when IME is processing input. - */ - KeyCode[KeyCode["KEY_IN_COMPOSITION"] = 109] = "KEY_IN_COMPOSITION"; - KeyCode[KeyCode["ABNT_C1"] = 110] = "ABNT_C1"; - KeyCode[KeyCode["ABNT_C2"] = 111] = "ABNT_C2"; - /** - * Placed last to cover the length of the enum. - * Please do not depend on this value! - */ - KeyCode[KeyCode["MAX_VALUE"] = 112] = "MAX_VALUE"; -})(KeyCode || (KeyCode = {})); -var MarkerSeverity; -(function (MarkerSeverity) { - MarkerSeverity[MarkerSeverity["Hint"] = 1] = "Hint"; - MarkerSeverity[MarkerSeverity["Info"] = 2] = "Info"; - MarkerSeverity[MarkerSeverity["Warning"] = 4] = "Warning"; - MarkerSeverity[MarkerSeverity["Error"] = 8] = "Error"; -})(MarkerSeverity || (MarkerSeverity = {})); -var MarkerTag; -(function (MarkerTag) { - MarkerTag[MarkerTag["Unnecessary"] = 1] = "Unnecessary"; - MarkerTag[MarkerTag["Deprecated"] = 2] = "Deprecated"; -})(MarkerTag || (MarkerTag = {})); -/** - * Position in the minimap to render the decoration. - */ -var MinimapPosition; -(function (MinimapPosition) { - MinimapPosition[MinimapPosition["Inline"] = 1] = "Inline"; - MinimapPosition[MinimapPosition["Gutter"] = 2] = "Gutter"; -})(MinimapPosition || (MinimapPosition = {})); -/** - * Type of hit element with the mouse in the editor. - */ -var MouseTargetType; -(function (MouseTargetType) { - /** - * Mouse is on top of an unknown element. - */ - MouseTargetType[MouseTargetType["UNKNOWN"] = 0] = "UNKNOWN"; - /** - * Mouse is on top of the textarea used for input. - */ - MouseTargetType[MouseTargetType["TEXTAREA"] = 1] = "TEXTAREA"; - /** - * Mouse is on top of the glyph margin - */ - MouseTargetType[MouseTargetType["GUTTER_GLYPH_MARGIN"] = 2] = "GUTTER_GLYPH_MARGIN"; - /** - * Mouse is on top of the line numbers - */ - MouseTargetType[MouseTargetType["GUTTER_LINE_NUMBERS"] = 3] = "GUTTER_LINE_NUMBERS"; - /** - * Mouse is on top of the line decorations - */ - MouseTargetType[MouseTargetType["GUTTER_LINE_DECORATIONS"] = 4] = "GUTTER_LINE_DECORATIONS"; - /** - * Mouse is on top of the whitespace left in the gutter by a view zone. - */ - MouseTargetType[MouseTargetType["GUTTER_VIEW_ZONE"] = 5] = "GUTTER_VIEW_ZONE"; - /** - * Mouse is on top of text in the content. - */ - MouseTargetType[MouseTargetType["CONTENT_TEXT"] = 6] = "CONTENT_TEXT"; - /** - * Mouse is on top of empty space in the content (e.g. after line text or below last line) - */ - MouseTargetType[MouseTargetType["CONTENT_EMPTY"] = 7] = "CONTENT_EMPTY"; - /** - * Mouse is on top of a view zone in the content. - */ - MouseTargetType[MouseTargetType["CONTENT_VIEW_ZONE"] = 8] = "CONTENT_VIEW_ZONE"; - /** - * Mouse is on top of a content widget. - */ - MouseTargetType[MouseTargetType["CONTENT_WIDGET"] = 9] = "CONTENT_WIDGET"; - /** - * Mouse is on top of the decorations overview ruler. - */ - MouseTargetType[MouseTargetType["OVERVIEW_RULER"] = 10] = "OVERVIEW_RULER"; - /** - * Mouse is on top of a scrollbar. - */ - MouseTargetType[MouseTargetType["SCROLLBAR"] = 11] = "SCROLLBAR"; - /** - * Mouse is on top of an overlay widget. - */ - MouseTargetType[MouseTargetType["OVERLAY_WIDGET"] = 12] = "OVERLAY_WIDGET"; - /** - * Mouse is outside of the editor. - */ - MouseTargetType[MouseTargetType["OUTSIDE_EDITOR"] = 13] = "OUTSIDE_EDITOR"; -})(MouseTargetType || (MouseTargetType = {})); -/** - * A positioning preference for rendering overlay widgets. - */ -var OverlayWidgetPositionPreference; -(function (OverlayWidgetPositionPreference) { - /** - * Position the overlay widget in the top right corner - */ - OverlayWidgetPositionPreference[OverlayWidgetPositionPreference["TOP_RIGHT_CORNER"] = 0] = "TOP_RIGHT_CORNER"; - /** - * Position the overlay widget in the bottom right corner - */ - OverlayWidgetPositionPreference[OverlayWidgetPositionPreference["BOTTOM_RIGHT_CORNER"] = 1] = "BOTTOM_RIGHT_CORNER"; - /** - * Position the overlay widget in the top center - */ - OverlayWidgetPositionPreference[OverlayWidgetPositionPreference["TOP_CENTER"] = 2] = "TOP_CENTER"; -})(OverlayWidgetPositionPreference || (OverlayWidgetPositionPreference = {})); -/** - * Vertical Lane in the overview ruler of the editor. - */ -var OverviewRulerLane; -(function (OverviewRulerLane) { - OverviewRulerLane[OverviewRulerLane["Left"] = 1] = "Left"; - OverviewRulerLane[OverviewRulerLane["Center"] = 2] = "Center"; - OverviewRulerLane[OverviewRulerLane["Right"] = 4] = "Right"; - OverviewRulerLane[OverviewRulerLane["Full"] = 7] = "Full"; -})(OverviewRulerLane || (OverviewRulerLane = {})); -var RenderLineNumbersType; -(function (RenderLineNumbersType) { - RenderLineNumbersType[RenderLineNumbersType["Off"] = 0] = "Off"; - RenderLineNumbersType[RenderLineNumbersType["On"] = 1] = "On"; - RenderLineNumbersType[RenderLineNumbersType["Relative"] = 2] = "Relative"; - RenderLineNumbersType[RenderLineNumbersType["Interval"] = 3] = "Interval"; - RenderLineNumbersType[RenderLineNumbersType["Custom"] = 4] = "Custom"; -})(RenderLineNumbersType || (RenderLineNumbersType = {})); -var RenderMinimap; -(function (RenderMinimap) { - RenderMinimap[RenderMinimap["None"] = 0] = "None"; - RenderMinimap[RenderMinimap["Text"] = 1] = "Text"; - RenderMinimap[RenderMinimap["Blocks"] = 2] = "Blocks"; -})(RenderMinimap || (RenderMinimap = {})); -var ScrollType; -(function (ScrollType) { - ScrollType[ScrollType["Smooth"] = 0] = "Smooth"; - ScrollType[ScrollType["Immediate"] = 1] = "Immediate"; -})(ScrollType || (ScrollType = {})); -var ScrollbarVisibility; -(function (ScrollbarVisibility) { - ScrollbarVisibility[ScrollbarVisibility["Auto"] = 1] = "Auto"; - ScrollbarVisibility[ScrollbarVisibility["Hidden"] = 2] = "Hidden"; - ScrollbarVisibility[ScrollbarVisibility["Visible"] = 3] = "Visible"; -})(ScrollbarVisibility || (ScrollbarVisibility = {})); -/** - * The direction of a selection. - */ -var SelectionDirection; -(function (SelectionDirection) { - /** - * The selection starts above where it ends. - */ - SelectionDirection[SelectionDirection["LTR"] = 0] = "LTR"; - /** - * The selection starts below where it ends. - */ - SelectionDirection[SelectionDirection["RTL"] = 1] = "RTL"; -})(SelectionDirection || (SelectionDirection = {})); -var SignatureHelpTriggerKind; -(function (SignatureHelpTriggerKind) { - SignatureHelpTriggerKind[SignatureHelpTriggerKind["Invoke"] = 1] = "Invoke"; - SignatureHelpTriggerKind[SignatureHelpTriggerKind["TriggerCharacter"] = 2] = "TriggerCharacter"; - SignatureHelpTriggerKind[SignatureHelpTriggerKind["ContentChange"] = 3] = "ContentChange"; -})(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {})); -/** - * A symbol kind. - */ -var SymbolKind; -(function (SymbolKind) { - SymbolKind[SymbolKind["File"] = 0] = "File"; - SymbolKind[SymbolKind["Module"] = 1] = "Module"; - SymbolKind[SymbolKind["Namespace"] = 2] = "Namespace"; - SymbolKind[SymbolKind["Package"] = 3] = "Package"; - SymbolKind[SymbolKind["Class"] = 4] = "Class"; - SymbolKind[SymbolKind["Method"] = 5] = "Method"; - SymbolKind[SymbolKind["Property"] = 6] = "Property"; - SymbolKind[SymbolKind["Field"] = 7] = "Field"; - SymbolKind[SymbolKind["Constructor"] = 8] = "Constructor"; - SymbolKind[SymbolKind["Enum"] = 9] = "Enum"; - SymbolKind[SymbolKind["Interface"] = 10] = "Interface"; - SymbolKind[SymbolKind["Function"] = 11] = "Function"; - SymbolKind[SymbolKind["Variable"] = 12] = "Variable"; - SymbolKind[SymbolKind["Constant"] = 13] = "Constant"; - SymbolKind[SymbolKind["String"] = 14] = "String"; - SymbolKind[SymbolKind["Number"] = 15] = "Number"; - SymbolKind[SymbolKind["Boolean"] = 16] = "Boolean"; - SymbolKind[SymbolKind["Array"] = 17] = "Array"; - SymbolKind[SymbolKind["Object"] = 18] = "Object"; - SymbolKind[SymbolKind["Key"] = 19] = "Key"; - SymbolKind[SymbolKind["Null"] = 20] = "Null"; - SymbolKind[SymbolKind["EnumMember"] = 21] = "EnumMember"; - SymbolKind[SymbolKind["Struct"] = 22] = "Struct"; - SymbolKind[SymbolKind["Event"] = 23] = "Event"; - SymbolKind[SymbolKind["Operator"] = 24] = "Operator"; - SymbolKind[SymbolKind["TypeParameter"] = 25] = "TypeParameter"; -})(SymbolKind || (SymbolKind = {})); -var SymbolTag; -(function (SymbolTag) { - SymbolTag[SymbolTag["Deprecated"] = 1] = "Deprecated"; -})(SymbolTag || (SymbolTag = {})); -/** - * The kind of animation in which the editor's cursor should be rendered. - */ -var TextEditorCursorBlinkingStyle; -(function (TextEditorCursorBlinkingStyle) { - /** - * Hidden - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Hidden"] = 0] = "Hidden"; - /** - * Blinking - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Blink"] = 1] = "Blink"; - /** - * Blinking with smooth fading - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Smooth"] = 2] = "Smooth"; - /** - * Blinking with prolonged filled state and smooth fading - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Phase"] = 3] = "Phase"; - /** - * Expand collapse animation on the y axis - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Expand"] = 4] = "Expand"; - /** - * No-Blinking - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Solid"] = 5] = "Solid"; -})(TextEditorCursorBlinkingStyle || (TextEditorCursorBlinkingStyle = {})); -/** - * The style in which the editor's cursor should be rendered. - */ -var TextEditorCursorStyle; -(function (TextEditorCursorStyle) { - /** - * As a vertical line (sitting between two characters). - */ - TextEditorCursorStyle[TextEditorCursorStyle["Line"] = 1] = "Line"; - /** - * As a block (sitting on top of a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["Block"] = 2] = "Block"; - /** - * As a horizontal line (sitting under a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["Underline"] = 3] = "Underline"; - /** - * As a thin vertical line (sitting between two characters). - */ - TextEditorCursorStyle[TextEditorCursorStyle["LineThin"] = 4] = "LineThin"; - /** - * As an outlined block (sitting on top of a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["BlockOutline"] = 5] = "BlockOutline"; - /** - * As a thin horizontal line (sitting under a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["UnderlineThin"] = 6] = "UnderlineThin"; -})(TextEditorCursorStyle || (TextEditorCursorStyle = {})); -/** - * Describes the behavior of decorations when typing/editing near their edges. - * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior` - */ -var TrackedRangeStickiness; -(function (TrackedRangeStickiness) { - TrackedRangeStickiness[TrackedRangeStickiness["AlwaysGrowsWhenTypingAtEdges"] = 0] = "AlwaysGrowsWhenTypingAtEdges"; - TrackedRangeStickiness[TrackedRangeStickiness["NeverGrowsWhenTypingAtEdges"] = 1] = "NeverGrowsWhenTypingAtEdges"; - TrackedRangeStickiness[TrackedRangeStickiness["GrowsOnlyWhenTypingBefore"] = 2] = "GrowsOnlyWhenTypingBefore"; - TrackedRangeStickiness[TrackedRangeStickiness["GrowsOnlyWhenTypingAfter"] = 3] = "GrowsOnlyWhenTypingAfter"; -})(TrackedRangeStickiness || (TrackedRangeStickiness = {})); -/** - * Describes how to indent wrapped lines. - */ -var WrappingIndent; -(function (WrappingIndent) { - /** - * No indentation => wrapped lines begin at column 1. - */ - WrappingIndent[WrappingIndent["None"] = 0] = "None"; - /** - * Same => wrapped lines get the same indentation as the parent. - */ - WrappingIndent[WrappingIndent["Same"] = 1] = "Same"; - /** - * Indent => wrapped lines get +1 indentation toward the parent. - */ - WrappingIndent[WrappingIndent["Indent"] = 2] = "Indent"; - /** - * DeepIndent => wrapped lines get +2 indentation toward the parent. - */ - WrappingIndent[WrappingIndent["DeepIndent"] = 3] = "DeepIndent"; -})(WrappingIndent || (WrappingIndent = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js ***! - \****************************************************************************************/ -/*! exports provided: PrefixSumIndexOfResult, PrefixSumComputer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumIndexOfResult", function() { return PrefixSumIndexOfResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputer", function() { return PrefixSumComputer; }); -/* harmony import */ var _base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uint.js */ "./node_modules/monaco-editor/esm/vs/base/common/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class PrefixSumIndexOfResult { - constructor(index, remainder) { - this.index = index; - this.remainder = remainder; - } -} -class PrefixSumComputer { - constructor(values) { - this.values = values; - this.prefixSum = new Uint32Array(values.length); - this.prefixSumValidIndex = new Int32Array(1); - this.prefixSumValidIndex[0] = -1; - } - insertValues(insertIndex, insertValues) { - insertIndex = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(insertIndex); - const oldValues = this.values; - const oldPrefixSum = this.prefixSum; - const insertValuesLen = insertValues.length; - if (insertValuesLen === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length + insertValuesLen); - this.values.set(oldValues.subarray(0, insertIndex), 0); - this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); - this.values.set(insertValues, insertIndex); - if (insertIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = insertIndex - 1; - } - this.prefixSum = new Uint32Array(this.values.length); - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; - } - changeValue(index, value) { - index = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - value = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(value); - if (this.values[index] === value) { - return false; - } - this.values[index] = value; - if (index - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = index - 1; - } - return true; - } - removeValues(startIndex, cnt) { - startIndex = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(startIndex); - cnt = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(cnt); - const oldValues = this.values; - const oldPrefixSum = this.prefixSum; - if (startIndex >= oldValues.length) { - return false; - } - let maxCnt = oldValues.length - startIndex; - if (cnt >= maxCnt) { - cnt = maxCnt; - } - if (cnt === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length - cnt); - this.values.set(oldValues.subarray(0, startIndex), 0); - this.values.set(oldValues.subarray(startIndex + cnt), startIndex); - this.prefixSum = new Uint32Array(this.values.length); - if (startIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = startIndex - 1; - } - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; - } - getTotalValue() { - if (this.values.length === 0) { - return 0; - } - return this._getAccumulatedValue(this.values.length - 1); - } - getAccumulatedValue(index) { - if (index < 0) { - return 0; - } - index = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - return this._getAccumulatedValue(index); - } - _getAccumulatedValue(index) { - if (index <= this.prefixSumValidIndex[0]) { - return this.prefixSum[index]; - } - let startIndex = this.prefixSumValidIndex[0] + 1; - if (startIndex === 0) { - this.prefixSum[0] = this.values[0]; - startIndex++; - } - if (index >= this.values.length) { - index = this.values.length - 1; - } - for (let i = startIndex; i <= index; i++) { - this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; - } - this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); - return this.prefixSum[index]; - } - getIndexOf(accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - // Compute all sums (to get a fully valid prefixSum) - this.getTotalValue(); - let low = 0; - let high = this.values.length - 1; - let mid = 0; - let midStop = 0; - let midStart = 0; - while (low <= high) { - mid = low + ((high - low) / 2) | 0; - midStop = this.prefixSum[mid]; - midStart = midStop - this.values[mid]; - if (accumulatedValue < midStart) { - high = mid - 1; - } - else if (accumulatedValue >= midStop) { - low = mid + 1; - } - else { - break; - } - } - return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js ***! - \*******************************************************************/ -/*! exports provided: initialize */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialize", function() { return initialize; }); -/* harmony import */ var _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/common/worker/simpleWorker.js */ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js"); -/* harmony import */ var _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/services/editorSimpleWorker.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -let initialized = false; -function initialize(foreignModule) { - if (initialized) { - return; - } - initialized = true; - const simpleWorker = new _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__["SimpleWorkerServer"]((msg) => { - self.postMessage(msg); - }, (host) => new _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__["EditorSimpleWorker"](host, foreignModule)); - self.onmessage = (e) => { - simpleWorker.onmessage(e.data); - }; -} -self.onmessage = (e) => { - // Ignore first message in this case and initialize if not yet initialized - if (!initialized) { - initialize(null); - } -}; - - -/***/ }), - -/***/ "./node_modules/process/browser.js": -/*!*****************************************!*\ - !*** ./node_modules/process/browser.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), - -/***/ "./node_modules/webpack/buildin/global.js": -/*!***********************************!*\ - !*** (webpack)/buildin/global.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || new Function("return this")(); -} catch (e) { - // This works if the window reference is available - if (typeof window === "object") g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }) - -/******/ }); -//# sourceMappingURL=editor.worker.js.map \ No newline at end of file +!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";(function(e,i){n.d(t,"d",(function(){return _})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return C})),n.d(t,"a",(function(){return b})),n.d(t,"e",(function(){return L}));let r=!1,s=!1,o=!1,a=!1,l=!1,u=!1,h=void 0,c="en",d=void 0,f=void 0;const m=void 0!==e&&void 0!==e.versions&&void 0!==e.versions.electron&&"renderer"===e.type;if("object"!=typeof navigator||m){if("object"==typeof e){r="win32"===e.platform,s="darwin"===e.platform,o="linux"===e.platform,h="en",c="en";const t=e.env.VSCODE_NLS_CONFIG;if(t)try{const e=JSON.parse(t),n=e.availableLanguages["*"];h=e.locale,c=n||"en",d=e._translationsConfigFile}catch(e){}a=!0}}else r=(f=navigator.userAgent).indexOf("Windows")>=0,s=f.indexOf("Macintosh")>=0,u=(f.indexOf("Macintosh")>=0||f.indexOf("iPad")>=0||f.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,o=f.indexOf("Linux")>=0,l=!0,c=h=navigator.language;let g=0;s?g=1:r?g=3:o&&(g=2);const _=r,p=s,C=l,b="object"==typeof self?self:"object"==typeof i?i:{},L=function(){if(b.setImmediate)return b.setImmediate.bind(b);if("function"==typeof b.postMessage&&!b.importScripts){let e=[];b.addEventListener("message",t=>{if(t.data&&t.data.vscodeSetImmediateId)for(let n=0,i=e.length;n{const i=++t;e.push({id:i,callback:n}),b.postMessage({vscodeSetImmediateId:i},"*")}}if(void 0!==e&&"function"==typeof e.nextTick)return e.nextTick.bind(e);const t=Promise.resolve();return e=>t.then(e)}()}).call(this,n(2),n(3))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a}));var i=n(0);const r=void 0===e?{cwd:()=>"/",env:Object.create(null),get platform(){return i.d?"win32":i.b?"darwin":"linux"},nextTick:e=>Object(i.e)(e)}:e,s=r.cwd,o=r.env,a=r.platform}).call(this,n(2))},function(e,t){var n,i,r=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var l,u=[],h=!1,c=-1;function d(){h&&l&&(h=!1,l.length?u=l.concat(u):c=-1,u.length&&f())}function f(){if(!h){var e=a(d);h=!0;for(var t=u.length;t;){for(l=u,u=[];++c1)for(var n=1;n{if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function r(e){a(e)||i.onUnexpectedError(e)}function s(e){if(e instanceof Error){let{name:t,message:n}=e;return{$isError:!0,name:t,message:n,stack:e.stacktrace||e.stack}}return e}const o="Canceled";function a(e){return e instanceof Error&&e.name===o&&e.message===o}var l;!function(e){e.is=function(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]};const t=Object.freeze([]);e.empty=function(){return t},e.single=function*(e){yield e},e.from=function(e){return e||t},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const n of e)if(t(n))return!0;return!1},e.filter=function*(e,t){for(const n of e)t(n)&&(yield n)},e.map=function*(e,t){for(const n of e)yield t(n)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.consume=function(t,n=Number.POSITIVE_INFINITY){const i=[];if(0===n)return[i,t];const r=t[Symbol.iterator]();for(let t=0;tr}]}}(l||(l={}));const u=!1,h="__is_disposable_tracked__";function c(e){if(u&&e&&e!==_.None)try{e[h]=!0}catch(e){}}function d(e){if(!u)return e;const t=new Error("Potentially leaked disposable").stack;return setTimeout(()=>{e[h]||console.log(t)},3e3),e}class f extends Error{constructor(e){super(`Encounter errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function m(e){if(l.is(e)){let t=[];for(const n of e)if(n){c(n);try{n.dispose()}catch(e){t.push(e)}}if(1===t.length)throw t[0];if(t.length>1)throw new f(t);return Array.isArray(e)?[]:e}if(e)return c(e),e.dispose(),e}class g{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(c(this),this._isDisposed=!0,this.clear())}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return c(e),this._isDisposed?g.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}}g.DISABLE_DISPOSED_WARNING=!1;class _{constructor(){this._store=new g,d(this)}dispose(){c(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}_.None=Object.freeze({dispose(){}});var p=n(0);function C(e){const t=[];for(const n of function(e){let t=[],n=Object.getPrototypeOf(e);for(;Object.prototype!==n;)t=t.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return t}(e))"function"==typeof e[n]&&t.push(n);return t}function b(e,t){const n=e=>(function(){const n=Array.prototype.slice.call(arguments,0);return t(e,n)});let i={};for(const t of e)i[t]=n(t);return i}const L="$initialize";class S{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null)}setWorkerId(e){this._workerId=e}sendMessage(e,t){let n=String(++this._lastSentReq);return new Promise((i,r)=>{this._pendingReplies[n]={resolve:i,reject:r},this._send({vsWorker:this._workerId,req:n,method:e,args:t})})}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}_handleMessage(e){if(e.seq){let t=e;if(!this._pendingReplies[t.seq])return void console.warn("Got reply to unknown seq");let n=this._pendingReplies[t.seq];if(delete this._pendingReplies[t.seq],t.err){let e=t.err;return t.err.$isError&&((e=new Error).name=t.err.name,e.message=t.err.message,e.stack=t.err.stack),void n.reject(e)}return void n.resolve(t.res)}let t=e,n=t.req;this._handler.handleMessage(t.method,t.args).then(e=>{this._send({vsWorker:this._workerId,seq:n,res:e,err:void 0})},e=>{e.detail instanceof Error&&(e.detail=s(e.detail)),this._send({vsWorker:this._workerId,seq:n,res:void 0,err:s(e)})})}_send(e){let t=[];if(e.req){const n=e;for(let e=0;e{e(t,n)},handleMessage:(e,t)=>this._handleMessage(e,t)})}onmessage(e){this._protocol.handleMessage(e)}_handleMessage(e,t){if(e===L)return this.initialize(t[0],t[1],t[2],t[3]);if(!this._requestHandler||"function"!=typeof this._requestHandler[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._requestHandler[e].apply(this._requestHandler,t))}catch(e){return Promise.reject(e)}}initialize(e,t,n,i){this._protocol.setWorkerId(e);const r=b(i,(e,t)=>this._protocol.sendMessage(e,t));return this._requestHandlerFactory?(this._requestHandler=this._requestHandlerFactory(r),Promise.resolve(C(this._requestHandler))):(t&&(void 0!==t.baseUrl&&delete t.baseUrl,void 0!==t.paths&&void 0!==t.paths.vs&&delete t.paths.vs,t.catchError=!0,self.require.config(t)),new Promise((e,t)=>{self.require([n],n=>{this._requestHandler=n.create(r),this._requestHandler?e(C(this._requestHandler)):t(new Error("No RequestHandler!"))},t)}))}}function E(e,t){return function e(t,n,i,r,s){if(r<=i)return;const o=i+(r-i)/2|0;if(e(t,n,i,o,s),e(t,n,o+1,r,s),n(t[o],t[o+1])<=0)return;!function(e,t,n,i,r,s){let o=n,a=i+1;for(let t=n;t<=r;t++)s[t]=e[t];for(let l=n;l<=r;l++)o>i?e[l]=s[a++]:a>r?e[l]=s[o++]:t(s[a],s[o])<0?e[l]=s[a++]:e[l]=s[o++]}(t,n,i,o,r,s)}(e,t,0,e.length-1,[]),e}class A{constructor(e,t,n,i){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=i}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function y(e){return 55296<=e&&e<=56319}function w(e){return 56320<=e&&e<=57343}function v(e,t){return t-56320+(e-55296<<10)+65536}String.fromCharCode(65279);class T{constructor(){this._data=JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}static getInstance(){return T._INSTANCE||(T._INSTANCE=new T),T._INSTANCE}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let i=1;for(;i<=n;)if(et[3*i+1]))return t[3*i+2];i=2*i+1}return 0}}function O(e,t){return(t<<5)-t+e|0}function M(e,t){t=O(149417,t);for(let n=0,i=e.length;n>>i)>>>0}function I(e,t=0,n=e.byteLength,i=0){for(let r=0;r>>0).toString(16),t/4)}T._INSTANCE=null;class R{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const n=this._buff;let i,r,s=this._buffLen,o=this._leftoverHighSurrogate;for(0!==o?(i=o,r=-1,o=0):(i=e.charCodeAt(0),r=0);;){let a=i;if(y(i)){if(!(r+1>>6,e[t++]=128|(63&n)>>>0):n<65536?(e[t++]=224|(61440&n)>>>12,e[t++]=128|(4032&n)>>>6,e[t++]=128|(63&n)>>>0):(e[t++]=240|(1835008&n)>>>18,e[t++]=128|(258048&n)>>>12,e[t++]=128|(4032&n)>>>6,e[t++]=128|(63&n)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),P(this._h0)+P(this._h1)+P(this._h2)+P(this._h3)+P(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,I(this._buff,this._buffLen),this._buffLen>56&&(this._step(),I(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=R._bigBlock32,t=this._buffDV;for(let n=0;n<64;n+=4)e.setUint32(n,t.getUint32(n,!1),!1);for(let t=64;t<320;t+=4)e.setUint32(t,x(e.getUint32(t-12,!1)^e.getUint32(t-32,!1)^e.getUint32(t-56,!1)^e.getUint32(t-64,!1),1),!1);let n,i,r,s=this._h0,o=this._h1,a=this._h2,l=this._h3,u=this._h4;for(let t=0;t<80;t++)t<20?(n=o&a|~o&l,i=1518500249):t<40?(n=o^a^l,i=1859775393):t<60?(n=o&a|o&l|a&l,i=2400959708):(n=o^a^l,i=3395469782),r=x(s,5)+n+u+i+e.getUint32(4*t,!1)&4294967295,u=l,l=a,a=x(o,30),o=s,s=r;this._h0=this._h0+s&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+u&4294967295}}R._bigBlock32=new DataView(new ArrayBuffer(320));class k{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,i=e.length;n0||this.m_modifiedCount>0)&&this.m_changes.push(new A(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class B{constructor(e,t,n=null){this.ContinueProcessingPredicate=n;const[i,r,s]=B._getElements(e),[o,a,l]=B._getElements(t);this._hasStrings=s&&l,this._originalStringElements=i,this._originalElementsOrHash=r,this._modifiedStringElements=o,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(B._isStringArray(t)){const e=new Int32Array(t.length);for(let n=0,i=t.length;n=e&&i>=n&&this.ElementsAreEqual(t,i);)t--,i--;if(e>t||n>i){let r;return n<=i?(D.Assert(e===t+1,"originalStart should only be one more than originalEnd"),r=[new A(e,0,n,i-n+1)]):e<=t?(D.Assert(n===i+1,"modifiedStart should only be one more than modifiedEnd"),r=[new A(e,t-e+1,n,0)]):(D.Assert(e===t+1,"originalStart should only be one more than originalEnd"),D.Assert(n===i+1,"modifiedStart should only be one more than modifiedEnd"),r=[]),r}const s=[0],o=[0],a=this.ComputeRecursionPoint(e,t,n,i,s,o,r),l=s[0],u=o[0];if(null!==a)return a;if(!r[0]){const s=this.ComputeDiffRecursive(e,l,n,u,r);let o=[];return o=r[0]?[new A(l+1,t-(l+1)+1,u+1,i-(u+1)+1)]:this.ComputeDiffRecursive(l+1,t,u+1,i,r),this.ConcatenateChanges(s,o)}return[new A(e,t-e+1,n,i-n+1)]}WALKTRACE(e,t,n,i,r,s,o,a,l,u,h,c,d,f,m,g,_,p){let C=null,b=null,L=new K,S=t,N=n,E=d[0]-g[0]-i,y=-1073741824,w=this.m_forwardHistory.length-1;do{const t=E+e;t===S||t=0&&(e=(l=this.m_forwardHistory[w])[0],S=1,N=l.length-1)}while(--w>=-1);if(C=L.getReverseChanges(),p[0]){let e=d[0]+1,t=g[0]+1;if(null!==C&&C.length>0){const n=C[C.length-1];e=Math.max(e,n.getOriginalEnd()),t=Math.max(t,n.getModifiedEnd())}b=[new A(e,c-e+1,t,m-t+1)]}else{L=new K,S=s,N=o,E=d[0]-g[0]-a,y=1073741824,w=_?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=E+r;e===S||e=u[e+1]?(f=(h=u[e+1]-1)-E-a,h>y&&L.MarkNextChange(),y=h+1,L.AddOriginalElement(h+1,f+1),E=e+1-r):(f=(h=u[e-1])-E-a,h>y&&L.MarkNextChange(),y=h,L.AddModifiedElement(h+1,f+1),E=e-1-r),w>=0&&(r=(u=this.m_reverseHistory[w])[0],S=1,N=u.length-1)}while(--w>=-1);b=L.getChanges()}return this.ConcatenateChanges(C,b)}ComputeRecursionPoint(e,t,n,i,r,s,o){let a=0,l=0,u=0,h=0,c=0,d=0;e--,n--,r[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const f=t-e+(i-n),m=f+1,g=new Int32Array(m),_=new Int32Array(m),p=i-n,C=t-e,b=e-n,L=t-i,S=(C-p)%2==0;g[p]=e,_[C]=t,o[0]=!1;for(let N=1;N<=f/2+1;N++){let f=0,E=0;u=this.ClipDiagonalBound(p-N,N,p,m),h=this.ClipDiagonalBound(p+N,N,p,m);for(let e=u;e<=h;e+=2){l=(a=e===u||ef+E&&(f=a,E=l),!S&&Math.abs(e-C)<=N-1&&a>=_[e])return r[0]=a,s[0]=l,n<=_[e]&&N<=1448?this.WALKTRACE(p,u,h,b,C,c,d,L,g,_,a,t,r,l,i,s,S,o):null}const y=(f-e+(E-n)-N)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(f,y))return o[0]=!0,r[0]=f,s[0]=E,y>0&&N<=1448?this.WALKTRACE(p,u,h,b,C,c,d,L,g,_,a,t,r,l,i,s,S,o):(e++,n++,[new A(e,t-e+1,n,i-n+1)]);c=this.ClipDiagonalBound(C-N,N,C,m),d=this.ClipDiagonalBound(C+N,N,C,m);for(let f=c;f<=d;f+=2){l=(a=f===c||f=_[f+1]?_[f+1]-1:_[f-1])-(f-C)-L;const m=a;for(;a>e&&l>n&&this.ElementsAreEqual(a,l);)a--,l--;if(_[f]=a,S&&Math.abs(f-p)<=N&&a<=g[f])return r[0]=a,s[0]=l,m>=g[f]&&N<=1448?this.WALKTRACE(p,u,h,b,C,c,d,L,g,_,a,t,r,l,i,s,S,o):null}if(N<=1447){let e=new Int32Array(h-u+2);e[0]=p-u+1,F.Copy2(g,u,e,1,h-u+1),this.m_forwardHistory.push(e),(e=new Int32Array(d-c+2))[0]=C-c+1,F.Copy2(_,c,e,1,d-c+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(p,u,h,b,C,c,d,L,g,_,a,t,r,l,i,s,S,o)}PrettifyChanges(e){for(let t=0;t0,o=n.modifiedLength>0;for(;n.originalStart+n.originalLength=0;t--){const n=e[t];let i=0,r=0;if(t>0){const n=e[t-1];n.originalLength>0&&(i=n.originalStart+n.originalLength),n.modifiedLength>0&&(r=n.modifiedStart+n.modifiedLength)}const s=n.originalLength>0,o=n.modifiedLength>0;let a=0,l=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let e=1;;e++){const t=n.originalStart-e,u=n.modifiedStart-e;if(tl&&(l=h,a=e)}n.originalStart-=a,n.modifiedStart-=a}return e}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,i){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(n,i)?1:0)}ConcatenateChanges(e,t){let n=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){const i=new Array(e.length+t.length-1);return F.Copy(e,0,i,0,e.length-1),i[e.length-1]=n[0],F.Copy(t,1,i,e.length,t.length-1),i}{const n=new Array(e.length+t.length);return F.Copy(e,0,n,0,e.length),F.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,n){if(D.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),D.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const i=e.originalStart;let r=e.originalLength;const s=e.modifiedStart;let o=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(r=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(o=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new A(i,r,s,o),!0}return n[0]=null,!1}ClipDiagonalBound(e,t,n,i){if(e>=0&&e=q&&e<=V||e>=H&&e<=Y}function ee(e,t,n,i){let r="",s=0,o=-1,a=0,l=0;for(let u=0;u<=e.length;++u){if(u2){const e=r.lastIndexOf(n);-1===e?(r="",s=0):s=(r=r.slice(0,e)).length-1-r.lastIndexOf(n),o=u,a=0;continue}if(0!==r.length){r="",s=0,o=u,a=0;continue}}t&&(r+=r.length>0?`${n}..`:"..",s=2)}else r.length>0?r+=`${n}${e.slice(o+1,u)}`:r=e.slice(o+1,u),s=u-o-1;o=u,a=0}else l===$&&-1!==a?++a:a=-1}return r}function te(e,t){if(null===t||"object"!=typeof t)throw new z("pathObject","Object",t);const n=t.dir||t.root,i=t.base||`${t.name||""}${t.ext||""}`;return n?n===t.root?`${n}${i}`:`${n}${e}${i}`:i}const ne={resolve(...e){let t="",n="",i=!1;for(let r=e.length-1;r>=-1;r--){let s;if(r>=0){if(Q(s=e[r],"path"),0===s.length)continue}else 0===t.length?s=W.a():(void 0===(s=W.b[`=${t}`]||W.a())||s.slice(0,2).toLowerCase()!==t.toLowerCase()&&s.charCodeAt(2)===G)&&(s=`${t}\\`);const o=s.length;let a=0,l="",u=!1;const h=s.charCodeAt(0);if(1===o)X(h)&&(a=1,u=!0);else if(X(h))if(u=!0,X(s.charCodeAt(1))){let e=2,t=e;for(;e2&&X(s.charCodeAt(2))&&(u=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(i){if(t.length>0)break}else if(n=`${s.slice(a)}\\${n}`,i=u,u&&t.length>0)break}return n=ee(n,!i,"\\",X),i?`${t}\\${n}`:`${t}${n}`||"."},normalize(e){Q(e,"path");const t=e.length;if(0===t)return".";let n,i=0,r=!1;const s=e.charCodeAt(0);if(1===t)return Z(s)?"\\":e;if(X(s))if(r=!0,X(e.charCodeAt(1))){let r=2,s=r;for(;r2&&X(e.charCodeAt(2))&&(r=!0,i=3));let o=i0&&X(e.charCodeAt(t-1))&&(o+="\\"),void 0===n?r?`\\${o}`:o:r?`${n}\\${o}`:`${n}${o}`},isAbsolute(e){Q(e,"path");const t=e.length;if(0===t)return!1;const n=e.charCodeAt(0);return X(n)||t>2&&J(n)&&58===e.charCodeAt(1)&&X(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,n;for(let i=0;i0&&(void 0===t?t=n=r:t+=`\\${r}`)}if(void 0===t)return".";let i=!0,r=0;if("string"==typeof n&&X(n.charCodeAt(0))){++r;const e=n.length;e>1&&X(n.charCodeAt(1))&&(++r,e>2&&(X(n.charCodeAt(2))?++r:i=!1))}if(i){for(;r=2&&(t=`\\${t.slice(r)}`)}return ne.normalize(t)},relative(e,t){if(Q(e,"from"),Q(t,"to"),e===t)return"";const n=ne.resolve(e),i=ne.resolve(t);if(n===i)return"";if((e=n.toLowerCase())===(t=i.toLowerCase()))return"";let r=0;for(;rr&&e.charCodeAt(s-1)===G;)s--;const o=s-r;let a=0;for(;aa&&t.charCodeAt(l-1)===G;)l--;const u=l-a,h=oh){if(t.charCodeAt(a+d)===G)return i.slice(a+d+1);if(2===d)return i.slice(a+d)}o>h&&(e.charCodeAt(r+d)===G?c=d:2===d&&(c=3)),-1===c&&(c=0)}let f="";for(d=r+c+1;d<=s;++d)d!==s&&e.charCodeAt(d)!==G||(f+=0===f.length?"..":"\\..");return a+=c,f.length>0?`${f}${i.slice(a,l)}`:(i.charCodeAt(a)===G&&++a,i.slice(a,l))},toNamespacedPath(e){if("string"!=typeof e)return e;if(0===e.length)return"";const t=ne.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===G){if(t.charCodeAt(1)===G){const e=t.charCodeAt(2);if(63!==e&&e!==$)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(J(t.charCodeAt(0))&&58===t.charCodeAt(1)&&t.charCodeAt(2)===G)return`\\\\?\\${t}`;return e},dirname(e){Q(e,"path");const t=e.length;if(0===t)return".";let n=-1,i=0;const r=e.charCodeAt(0);if(1===t)return X(r)?e:".";if(X(r)){if(n=i=1,X(e.charCodeAt(1))){let r=2,s=r;for(;r2&&X(e.charCodeAt(2))?3:2);let s=-1,o=!0;for(let n=t-1;n>=i;--n)if(X(e.charCodeAt(n))){if(!o){s=n;break}}else o=!1;if(-1===s){if(-1===n)return".";s=n}return e.slice(0,s)},basename(e,t){void 0!==t&&Q(t,"ext"),Q(e,"path");let n,i=0,r=-1,s=!0;if(e.length>=2&&J(e.charCodeAt(0))&&58===e.charCodeAt(1)&&(i=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let o=t.length-1,a=-1;for(n=e.length-1;n>=i;--n){const l=e.charCodeAt(n);if(X(l)){if(!s){i=n+1;break}}else-1===a&&(s=!1,a=n+1),o>=0&&(l===t.charCodeAt(o)?-1==--o&&(r=n):(o=-1,r=a))}return i===r?r=a:-1===r&&(r=e.length),e.slice(i,r)}for(n=e.length-1;n>=i;--n)if(X(e.charCodeAt(n))){if(!s){i=n+1;break}}else-1===r&&(s=!1,r=n+1);return-1===r?"":e.slice(i,r)},extname(e){Q(e,"path");let t=0,n=-1,i=0,r=-1,s=!0,o=0;e.length>=2&&58===e.charCodeAt(1)&&J(e.charCodeAt(0))&&(t=i=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(X(t)){if(!s){i=a+1;break}}else-1===r&&(s=!1,r=a+1),t===$?-1===n?n=a:1!==o&&(o=1):-1!==n&&(o=-1)}return-1===n||-1===r||0===o||1===o&&n===r-1&&n===i+1?"":e.slice(n,r)},format:te.bind(null,"\\"),parse(e){Q(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const n=e.length;let i=0,r=e.charCodeAt(0);if(1===n)return X(r)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(X(r)){if(i=1,X(e.charCodeAt(1))){let t=2,r=t;for(;t0&&(t.root=e.slice(0,i));let s=-1,o=i,a=-1,l=!0,u=e.length-1,h=0;for(;u>=i;--u)if(X(r=e.charCodeAt(u))){if(!l){o=u+1;break}}else-1===a&&(l=!1,a=u+1),r===$?-1===s?s=u:1!==h&&(h=1):-1!==s&&(h=-1);return-1!==a&&(-1===s||0===h||1===h&&s===a-1&&s===o+1?t.base=t.name=e.slice(o,a):(t.name=e.slice(o,s),t.base=e.slice(o,a),t.ext=e.slice(s,a))),t.dir=o>0&&o!==i?e.slice(0,o-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},ie={resolve(...e){let t="",n=!1;for(let i=e.length-1;i>=-1&&!n;i--){const r=i>=0?e[i]:W.a();Q(r,"path"),0!==r.length&&(t=`${r}/${t}`,n=r.charCodeAt(0)===j)}return t=ee(t,!n,"/",Z),n?`/${t}`:t.length>0?t:"."},normalize(e){if(Q(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===j,n=e.charCodeAt(e.length-1)===j;return 0===(e=ee(e,!t,"/",Z)).length?t?"/":n?"./":".":(n&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(Q(e,"path"),e.length>0&&e.charCodeAt(0)===j),join(...e){if(0===e.length)return".";let t;for(let n=0;n0&&(void 0===t?t=i:t+=`/${i}`)}return void 0===t?".":ie.normalize(t)},relative(e,t){if(Q(e,"from"),Q(t,"to"),e===t)return"";if((e=ie.resolve(e))===(t=ie.resolve(t)))return"";const n=e.length,i=n-1,r=t.length-1,s=is){if(t.charCodeAt(1+a)===j)return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else i>s&&(e.charCodeAt(1+a)===j?o=a:0===a&&(o=0));let l="";for(a=1+o+1;a<=n;++a)a!==n&&e.charCodeAt(a)!==j||(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+o)}`},toNamespacedPath:e=>e,dirname(e){if(Q(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===j;let n=-1,i=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===j){if(!i){n=t;break}}else i=!1;return-1===n?t?"/":".":t&&1===n?"//":e.slice(0,n)},basename(e,t){void 0!==t&&Q(t,"ext"),Q(e,"path");let n,i=0,r=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let o=t.length-1,a=-1;for(n=e.length-1;n>=0;--n){const l=e.charCodeAt(n);if(l===j){if(!s){i=n+1;break}}else-1===a&&(s=!1,a=n+1),o>=0&&(l===t.charCodeAt(o)?-1==--o&&(r=n):(o=-1,r=a))}return i===r?r=a:-1===r&&(r=e.length),e.slice(i,r)}for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===j){if(!s){i=n+1;break}}else-1===r&&(s=!1,r=n+1);return-1===r?"":e.slice(i,r)},extname(e){Q(e,"path");let t=-1,n=0,i=-1,r=!0,s=0;for(let o=e.length-1;o>=0;--o){const a=e.charCodeAt(o);if(a!==j)-1===i&&(r=!1,i=o+1),a===$?-1===t?t=o:1!==s&&(s=1):-1!==t&&(s=-1);else if(!r){n=o+1;break}}return-1===t||-1===i||0===s||1===s&&t===i-1&&t===n+1?"":e.slice(t,i)},format:te.bind(null,"/"),parse(e){Q(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const n=e.charCodeAt(0)===j;let i;n?(t.root="/",i=1):i=0;let r=-1,s=0,o=-1,a=!0,l=e.length-1,u=0;for(;l>=i;--l){const t=e.charCodeAt(l);if(t!==j)-1===o&&(a=!1,o=l+1),t===$?-1===r?r=l:1!==u&&(u=1):-1!==r&&(u=-1);else if(!a){s=l+1;break}}if(-1!==o){const i=0===s&&n?1:s;-1===r||0===u||1===u&&r===o-1&&r===s+1?t.base=t.name=e.slice(i,o):(t.name=e.slice(i,r),t.base=e.slice(i,o),t.ext=e.slice(r,o))}return s>0?t.dir=e.slice(0,s-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};ie.win32=ne.win32=ne,ie.posix=ne.posix=ie;"win32"===W.c?ne.normalize:ie.normalize,"win32"===W.c?ne.resolve:ie.resolve,"win32"===W.c?ne.relative:ie.relative,"win32"===W.c?ne.dirname:ie.dirname,"win32"===W.c?ne.basename:ie.basename,"win32"===W.c?ne.extname:ie.extname,"win32"===W.c?ne.sep:ie.sep;const re=/^\w[\w\d+.-]*$/,se=/^\//,oe=/^\/\//;const ae="",le="/",ue=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class he{constructor(e,t,n,i,r,s=!1){"object"==typeof e?(this.scheme=e.scheme||ae,this.authority=e.authority||ae,this.path=e.path||ae,this.query=e.query||ae,this.fragment=e.fragment||ae):(this.scheme=function(e,t){return e||t?e:"file"}(e,s),this.authority=t||ae,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==le&&(t=le+t):t=le}return t}(this.scheme,n||ae),this.query=i||ae,this.fragment=r||ae,function(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!re.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!se.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(oe.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,s))}static isUri(e){return e instanceof he||!!e&&("string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"function"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString)}get fsPath(){return _e(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:i,query:r,fragment:s}=e;return void 0===t?t=this.scheme:null===t&&(t=ae),void 0===n?n=this.authority:null===n&&(n=ae),void 0===i?i=this.path:null===i&&(i=ae),void 0===r?r=this.query:null===r&&(r=ae),void 0===s?s=this.fragment:null===s&&(s=ae),t===this.scheme&&n===this.authority&&i===this.path&&r===this.query&&s===this.fragment?this:new de(t,n,i,r,s)}static parse(e,t=!1){const n=ue.exec(e);return n?new de(n[2]||ae,be(n[4]||ae),be(n[5]||ae),be(n[7]||ae),be(n[9]||ae),t):new de(ae,ae,ae,ae,ae)}static file(e){let t=ae;if(p.d&&(e=e.replace(/\\/g,le)),e[0]===le&&e[1]===le){const n=e.indexOf(le,2);-1===n?(t=e.substring(2),e=le):(t=e.substring(2,n),e=e.substring(n)||le)}return new de("file",t,e,ae,ae)}static from(e){return new de(e.scheme,e.authority,e.path,e.query,e.fragment)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPaths on URI without path");let n;return n=p.d&&"file"===e.scheme?he.file(ne.join(_e(e,!0),...t)).path:ie.join(e.path,...t),e.with({path:n})}toString(e=!1){return pe(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof he)return e;{const t=new de(e);return t._formatted=e.external,t._fsPath=e._sep===ce?e.fsPath:null,t}}return e}}const ce=p.d?1:void 0;class de extends he{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=_e(this,!1)),this._fsPath}toString(e=!1){return e?pe(this,!0):(this._formatted||(this._formatted=pe(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=ce),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const fe={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function me(e,t){let n=void 0,i=-1;for(let r=0;r=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||t&&47===s)-1!==i&&(n+=encodeURIComponent(e.substring(i,r)),i=-1),void 0!==n&&(n+=e.charAt(r));else{void 0===n&&(n=e.substr(0,r));const t=fe[s];void 0!==t?(-1!==i&&(n+=encodeURIComponent(e.substring(i,r)),i=-1),n+=t):-1===i&&(i=r)}}return-1!==i&&(n+=encodeURIComponent(e.substring(i))),void 0!==n?n:e}function ge(e){let t=void 0;for(let n=0;n1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,p.d&&(n=n.replace(/\//g,"\\")),n}function pe(e,t){const n=t?ge:me;let i="",{scheme:r,authority:s,path:o,query:a,fragment:l}=e;if(r&&(i+=r,i+=":"),(s||"file"===r)&&(i+=le,i+=le),s){let e=s.indexOf("@");if(-1!==e){const t=s.substr(0,e);s=s.substr(e+1),-1===(e=t.indexOf(":"))?i+=n(t,!1):(i+=n(t.substr(0,e),!1),i+=":",i+=n(t.substr(e+1),!1)),i+="@"}-1===(e=(s=s.toLowerCase()).indexOf(":"))?i+=n(s,!1):(i+=n(s.substr(0,e),!1),i+=s.substr(e))}if(o){if(o.length>=3&&47===o.charCodeAt(0)&&58===o.charCodeAt(2)){const e=o.charCodeAt(1);e>=65&&e<=90&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&58===o.charCodeAt(1)){const e=o.charCodeAt(0);e>=65&&e<=90&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}i+=n(o,!0)}return a&&(i+="?",i+=n(a,!1)),l&&(i+="#",i+=t?l:me(l,!1)),i}const Ce=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function be(e){return e.match(Ce)?e.replace(Ce,e=>(function e(t){try{return decodeURIComponent(t)}catch(n){return t.length>3?t.substr(0,3)+e(t.substr(3)):t}})(e)):e}class Le{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new Le(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Le.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Le.isBefore(this,e)}static isBefore(e,t){return e.lineNumbern||e===n&&t>i?(this.startLineNumber=n,this.startColumn=i,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=i)}isEmpty(){return Se.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Se.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.columne.endColumn))}containsRange(e){return Se.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)))}strictContainsRange(e){return Se.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)))}plusRange(e){return Se.plusRange(this,e)}static plusRange(e,t){let n,i,r,s;return t.startLineNumbere.endLineNumber?(r=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(r=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(r=e.endLineNumber,s=e.endColumn),new Se(n,i,r,s)}intersectRanges(e){return Se.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,i=e.startColumn,r=e.endLineNumber,s=e.endColumn,o=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,u=t.endColumn;return nl?(r=l,s=u):r===l&&(s=Math.min(s,u)),n>r?null:n===r&&i>s?null:new Se(n,i,r,s)}equalsRange(e){return Se.equalsRange(this,e)}static equalsRange(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Se.getEndPosition(this)}static getEndPosition(e){return new Le(e.endLineNumber,e.endColumn)}getStartPosition(){return Se.getStartPosition(this)}static getStartPosition(e){return new Le(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Se(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Se(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Se.collapseToStart(this)}static collapseToStart(e){return new Se(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}static fromPositions(e,t=e){return new Se(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Se(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}}const Ne=3;function Ee(e,t,n,i){return new B(e,t,n).ComputeDiff(i)}class Ae{constructor(e){const t=[],n=[];for(let i=0,r=e.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&r()){const s=n.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=i.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);let l=Ee(s,a,r,!0).changes;o&&(l=function(e){if(e.length<=1)return e;const t=[e[0]];let n=t[0];for(let i=1,r=e.length;i1&&o>1;){if(e.charCodeAt(n-2)!==t.charCodeAt(o-2))break;n--,o--}(n>1||o>1)&&this._pushTrimWhitespaceCharChange(i,r+1,1,n,s+1,1,o)}{let n=Me(e,1),o=Me(t,1);const a=e.length+1,l=t.length+1;for(;n=0;n--){const t=e.charCodeAt(n);if(32!==t&&9!==t)return n}return-1}(e);return-1===n?t:n+2}function xe(e){if(0===e)return()=>!0;const t=Date.now();return()=>Date.now()-t255?255:0|e}function Pe(e){return e<0?0:e>4294967295?4294967295:0|e}class Re{constructor(e,t){this.index=e,this.remainder=t}}class ke{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=Pe(e);const n=this.values,i=this.prefixSum,r=t.length;return 0!==r&&(this.values=new Uint32Array(n.length+r),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+r),this.values.set(t,e),e-1=0&&this.prefixSum.set(i.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}changeValue(e,t){return e=Pe(e),t=Pe(t),this.values[e]!==t&&(this.values[e]=t,e-1=n.length)return!1;let r=n.length-e;return t>=r&&(t=r),0!==t&&(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(i.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalValue(){return 0===this.values.length?0:this._getAccumulatedValue(this.values.length-1)}getAccumulatedValue(e){return e<0?0:(e=Pe(e),this._getAccumulatedValue(e))}_getAccumulatedValue(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalValue();let t=0,n=this.values.length-1,i=0,r=0,s=0;for(;t<=n;)if(i=t+(n-t)/2|0,e<(s=(r=this.prefixSum[i])-this.values[i]))n=i-1;else{if(!(e>=r))break;t=i+1}return new Re(i,e-s)}}class Ue{constructor(e,t,n,i){this._uri=e,this._lines=t,this._eol=n,this._versionId=i,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const e of t)this._acceptDeleteRange(e.range),this._acceptInsertText(new Le(e.range.startLineNumber,e.range.startColumn),e.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,n=new Uint32Array(t);for(let i=0;i/?";const Fe=function(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const n of De)e.indexOf(n)>=0||(t+="\\"+n);return t+="\\s]+)",new RegExp(t,"g")}();const Ke={maxLen:1e3,windowSize:15,timeBudget:150};function Be(e,t,n,i){let r;for(;r=e.exec(t);){const t=r.index||0;if(t<=n&&e.lastIndex>=n)return r;if(i>0&&t>i)return null}return null}class We{constructor(e){let t=Ie(e);this._defaultValue=t,this._asciiMap=We._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);for(let n=0;n<256;n++)t[n]=e;return t}set(e,t){let n=Ie(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}}class qe{constructor(e,t,n){const i=new Uint8Array(e*t);for(let r=0,s=e*t;rt&&(t=s),r>n&&(n=r),o>n&&(n=o)}t++,n++;let i=new qe(n,t,0);for(let t=0,n=e.length;t=this._maxCharCode?0:this._states.get(e,t)}}let Ve=null;let Ye=null;class $e{static _createLink(e,t,n,i,r){let s=r-1;do{const n=t.charCodeAt(s);if(2!==e.get(n))break;s--}while(s>i);if(i>0){const e=t.charCodeAt(i-1),n=t.charCodeAt(s);(40===e&&41===n||91===e&&93===n||123===e&&125===n)&&s--}return{range:{startLineNumber:n,startColumn:i+1,endLineNumber:n,endColumn:s+2},url:t.substring(i,s+1)}}static computeLinks(e,t=(null===Ve&&(Ve=new He([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),Ve)){const n=function(){if(null===Ye){Ye=new We(0);const e=" \t<>'\"、。。、,.:;‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…";for(let t=0;t=0?((i+=n?1:-1)<0?i=e.length-1:i%=e.length,e[i]):null}}je.INSTANCE=new je;class Ge{constructor(e){this.element=e,this.next=Ge.Undefined,this.prev=Ge.Undefined}}Ge.Undefined=new Ge(void 0);class ze{constructor(){this._first=Ge.Undefined,this._last=Ge.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ge.Undefined}clear(){this._first=Ge.Undefined,this._last=Ge.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new Ge(e);if(this._first===Ge.Undefined)this._first=n,this._last=n;else if(t){const e=this._last;this._last=n,n.prev=e,e.next=n}else{const e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(n))}}shift(){if(this._first!==Ge.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ge.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ge.Undefined&&e.next!==Ge.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ge.Undefined&&e.next===Ge.Undefined?(this._first=Ge.Undefined,this._last=Ge.Undefined):e.next===Ge.Undefined?(this._last=this._last.prev,this._last.next=Ge.Undefined):e.prev===Ge.Undefined&&(this._first=this._first.next,this._first.prev=Ge.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ge.Undefined;)yield e.element,e=e.next}toArray(){const e=[];for(let t=this._first;t!==Ge.Undefined;t=t.next)e.push(t.element);return e}}var Qe;!function(e){function t(e){return(t,n=null,i)=>{let r,s=!1;return r=e(e=>{if(!s)return r?r.dispose():s=!0,t.call(n,e)},null,i),s&&r.dispose(),r}}function n(e,t){return o((n,i=null,r)=>e(e=>n.call(i,t(e)),null,r))}function i(e,t){return o((n,i=null,r)=>e(e=>{t(e),n.call(i,e)},null,r))}function r(e,t){return o((n,i=null,r)=>e(e=>t(e)&&n.call(i,e),null,r))}function s(e,t,i){let r=i;return n(e,e=>r=t(r,e))}function o(e){let t;const n=new Je({onFirstListenerAdd(){t=e(n.fire,n)},onLastListenerRemove(){t.dispose()}});return n.event}function a(e,t,n=100,i=!1,r){let s,o=void 0,a=void 0,l=0;const u=new Je({leakWarningThreshold:r,onFirstListenerAdd(){s=e(e=>{l++,o=t(o,e),i&&!a&&(u.fire(o),o=void 0),clearTimeout(a),a=setTimeout(()=>{const e=o;o=void 0,a=void 0,(!i||l>1)&&u.fire(e),l=0},n)})},onLastListenerRemove(){s.dispose()}});return u.event}function l(e){let t,n=!0;return r(e,e=>{const i=n||e!==t;return n=!1,t=e,i})}e.None=()=>_.None,e.once=t,e.map=n,e.forEach=i,e.filter=r,e.signal=function(e){return e},e.any=function(...e){return(t,n=null,i)=>(function(...e){return e.forEach(c),d({dispose:()=>m(e)})})(...e.map(e=>e(e=>t.call(n,e),null,i)))},e.reduce=s,e.snapshot=o,e.debounce=a,e.stopwatch=function(e){const i=(new Date).getTime();return n(t(e),e=>(new Date).getTime()-i)},e.latch=l,e.buffer=function(e,t=!1,n=[]){let i=n.slice(),r=e(e=>{i?i.push(e):o.fire(e)});const s=()=>{i&&i.forEach(e=>o.fire(e)),i=null},o=new Je({onFirstListenerAdd(){r||(r=e(e=>o.fire(e)))},onFirstListenerDidAdd(){i&&(t?setTimeout(s):s())},onLastListenerRemove(){r&&r.dispose(),r=null}});return o.event};class u{constructor(e){this.event=e}map(e){return new u(n(this.event,e))}forEach(e){return new u(i(this.event,e))}filter(e){return new u(r(this.event,e))}reduce(e,t){return new u(s(this.event,e,t))}latch(){return new u(l(this.event))}debounce(e,t=100,n=!1,i){return new u(a(this.event,e,t,n,i))}on(e,t,n){return this.event(e,t,n)}once(e,n,i){return t(this.event)(e,n,i)}}e.chain=function(e){return new u(e)},e.fromNodeEventEmitter=function(e,t,n=(e=>e)){const i=(...e)=>r.fire(n(...e)),r=new Je({onFirstListenerAdd:()=>e.on(t,i),onLastListenerRemove:()=>e.removeListener(t,i)});return r.event},e.fromDOMEventEmitter=function(e,t,n=(e=>e)){const i=(...e)=>r.fire(n(...e)),r=new Je({onFirstListenerAdd:()=>e.addEventListener(t,i),onLastListenerRemove:()=>e.removeEventListener(t,i)});return r.event},e.fromPromise=function(e){const t=new Je;let n=!1;return e.then(void 0,()=>null).then(()=>{n?t.fire(void 0):setTimeout(()=>t.fire(void 0),0)}),n=!0,t.event},e.toPromise=function(e){return new Promise(n=>t(e)(n))}}(Qe||(Qe={}));let Xe=-1;class Ze{constructor(e,t=Math.random().toString(18).slice(2,5)){this.customThreshold=e,this.name=t,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(e){let t=Xe;if("number"==typeof this.customThreshold&&(t=this.customThreshold),t<=0||e{const e=this._stacks.get(n)||0;this._stacks.set(n,e-1)}}}class Je{constructor(e){this._disposed=!1,this._options=e,this._leakageMon=Xe>0?new Ze(this._options&&this._options.leakWarningThreshold):void 0}get event(){return this._event||(this._event=(e,t,n)=>{this._listeners||(this._listeners=new ze);const i=this._listeners.isEmpty();i&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const r=this._listeners.push(t?[e,t]:e);let s,o;return i&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t),this._leakageMon&&(s=this._leakageMon.check(this._listeners.size)),o={dispose:()=>{if(s&&s(),o.dispose=Je._noop,!this._disposed&&(r(),this._options&&this._options.onLastListenerRemove)){this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)}}},n instanceof g?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}fire(e){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new ze);for(let t of this._listeners)this._deliveryQueue.push([t,e]);for(;this._deliveryQueue.size>0;){const[e,t]=this._deliveryQueue.shift();try{"function"==typeof e?e.call(void 0,t):e[0].call(e[1],t)}catch(e){r(e)}}}}dispose(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0}}Je._noop=function(){};const et=Object.freeze((function(e,t){const n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}));var tt,nt;(nt=tt||(tt={})).isCancellationToken=function(e){return e===nt.None||e===nt.Cancelled||e instanceof it||!(!e||"object"!=typeof e)&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},nt.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Qe.None}),nt.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:et});class it{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?et:(this._emitter||(this._emitter=new Je),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class rt{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new it),this._token}cancel(){this._token?this._token instanceof it&&this._token.cancel():this._token=tt.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof it&&this._token.dispose():this._token=tt.None}}class st{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const ot=new st,at=new st,lt=new st;var ut,ht,ct,dt,ft,mt,gt,_t,pt,Ct,bt,Lt,St,Nt,Et,At,yt,wt,vt,Tt,Ot,Mt,xt,It,Pt,Rt,kt,Ut,Dt,Ft,Kt,Bt,Wt,qt;!function(){function e(e,t,n=t,i=n){ot.define(e,t),at.define(e,n),lt.define(e,i)}e(0,"unknown"),e(1,"Backspace"),e(2,"Tab"),e(3,"Enter"),e(4,"Shift"),e(5,"Ctrl"),e(6,"Alt"),e(7,"PauseBreak"),e(8,"CapsLock"),e(9,"Escape"),e(10,"Space"),e(11,"PageUp"),e(12,"PageDown"),e(13,"End"),e(14,"Home"),e(15,"LeftArrow","Left"),e(16,"UpArrow","Up"),e(17,"RightArrow","Right"),e(18,"DownArrow","Down"),e(19,"Insert"),e(20,"Delete"),e(21,"0"),e(22,"1"),e(23,"2"),e(24,"3"),e(25,"4"),e(26,"5"),e(27,"6"),e(28,"7"),e(29,"8"),e(30,"9"),e(31,"A"),e(32,"B"),e(33,"C"),e(34,"D"),e(35,"E"),e(36,"F"),e(37,"G"),e(38,"H"),e(39,"I"),e(40,"J"),e(41,"K"),e(42,"L"),e(43,"M"),e(44,"N"),e(45,"O"),e(46,"P"),e(47,"Q"),e(48,"R"),e(49,"S"),e(50,"T"),e(51,"U"),e(52,"V"),e(53,"W"),e(54,"X"),e(55,"Y"),e(56,"Z"),e(57,"Meta"),e(58,"ContextMenu"),e(59,"F1"),e(60,"F2"),e(61,"F3"),e(62,"F4"),e(63,"F5"),e(64,"F6"),e(65,"F7"),e(66,"F8"),e(67,"F9"),e(68,"F10"),e(69,"F11"),e(70,"F12"),e(71,"F13"),e(72,"F14"),e(73,"F15"),e(74,"F16"),e(75,"F17"),e(76,"F18"),e(77,"F19"),e(78,"NumLock"),e(79,"ScrollLock"),e(80,";",";","OEM_1"),e(81,"=","=","OEM_PLUS"),e(82,",",",","OEM_COMMA"),e(83,"-","-","OEM_MINUS"),e(84,".",".","OEM_PERIOD"),e(85,"/","/","OEM_2"),e(86,"`","`","OEM_3"),e(110,"ABNT_C1"),e(111,"ABNT_C2"),e(87,"[","[","OEM_4"),e(88,"\\","\\","OEM_5"),e(89,"]","]","OEM_6"),e(90,"'","'","OEM_7"),e(91,"OEM_8"),e(92,"OEM_102"),e(93,"NumPad0"),e(94,"NumPad1"),e(95,"NumPad2"),e(96,"NumPad3"),e(97,"NumPad4"),e(98,"NumPad5"),e(99,"NumPad6"),e(100,"NumPad7"),e(101,"NumPad8"),e(102,"NumPad9"),e(103,"NumPad_Multiply"),e(104,"NumPad_Add"),e(105,"NumPad_Separator"),e(106,"NumPad_Subtract"),e(107,"NumPad_Decimal"),e(108,"NumPad_Divide")}(),function(e){e.toString=function(e){return ot.keyCodeToStr(e)},e.fromString=function(e){return ot.strToKeyCode(e)},e.toUserSettingsUS=function(e){return at.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return lt.keyCodeToStr(e)},e.fromUserSettings=function(e){return at.strToKeyCode(e)||lt.strToKeyCode(e)}}(ut||(ut={}));class Ht extends Se{constructor(e,t,n,i){super(e,t,n,i),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=i}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Ht.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return 0===this.getDirection()?new Ht(this.startLineNumber,this.startColumn,e,t):new Ht(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Le(this.positionLineNumber,this.positionColumn)}setStartPosition(e,t){return 0===this.getDirection()?new Ht(e,t,this.endLineNumber,this.endColumn):new Ht(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Ht(e.lineNumber,e.column,t.lineNumber,t.column)}static liftSelection(e){return new Ht(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let n=0,i=e.length;n>>0)>>>0}(e,t)}}Yt.CtrlCmd=2048,Yt.Shift=1024,Yt.Alt=512,Yt.WinCtrl=256;var $t=function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))};class jt extends Ue{get uri(){return this._uri}get version(){return this._versionId}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){let n=function e(t,n,i,r,s=Ke){if(i.length>s.maxLen){let o=t-s.maxLen/2;return o<0?(r+=t,o=0):r+=o,e(t,n,i=i.substring(o,t+s.maxLen/2),r,s)}Date.now();const o=t-1-r;let a=-1,l=null;for(let e=1;;e++){Date.now(),s.timeBudget;const t=o-s.windowSize*e;n.lastIndex=Math.max(0,t);const r=Be(n,i,o,a);if(!r&&l)break;if(l=r,t<=0)break;a=t}if(l){let e={word:l[0],startColumn:r+1+l.index,endColumn:r+1+l.index+l[0].length};return n.lastIndex=0,e}return null}(e.column,function(e){let t=Fe;if(e&&e instanceof RegExp)if(e.global)t=e;else{let n="g";e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.unicode&&(n+="u"),t=new RegExp(e.source,n)}return t.lastIndex=0,t}(t),this._lines[e.lineNumber-1],0);return n?new Se(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn):null}words(e){const t=this._lines,n=this._wordenize.bind(this);let i=0,r="",s=0,o=[];return{*[Symbol.iterator](){for(;;)if(sthis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,i=!0;else{let e=this._lines[t-1].length+1;n<1?(n=1,i=!0):n>e&&(n=e,i=!0)}return i?{lineNumber:t,column:n}:e}}class Gt{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){let e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new jt(he.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeDiff(e,t,n,i){return $t(this,void 0,void 0,(function*(){const r=this._getModel(e),s=this._getModel(t);if(!r||!s)return null;const o=r.getLinesContent(),a=s.getLinesContent(),l=new Te(o,a,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0,maxComputationTime:i}).computeDiff(),u=!(l.changes.length>0)&&this._modelsAreIdentical(r,s);return{quitEarly:l.quitEarly,identical:u,changes:l.changes}}))}_modelsAreIdentical(e,t){const n=e.getLineCount();if(n!==t.getLineCount())return!1;for(let i=1;i<=n;i++){if(e.getLineContent(i)!==t.getLineContent(i))return!1}return!0}computeMoreMinimalEdits(e,t){return $t(this,void 0,void 0,(function*(){const n=this._getModel(e);if(!n)return t;const i=[];let r=void 0;t=E(t,(e,t)=>{if(e.range&&t.range)return Se.compareRangesUsingStarts(e.range,t.range);return(e.range?0:1)-(t.range?0:1)});for(let{range:e,text:s,eol:o}of t){if("number"==typeof o&&(r=o),Se.isEmpty(e)&&!s)continue;const t=n.getValueInRange(e);if(t===(s=s.replace(/\r\n|\n|\r/g,n.eol)))continue;if(Math.max(s.length,t.length)>Gt._diffLimit){i.push({range:e,text:s});continue}const a=U(t,s,!1),l=n.offsetAt(Se.lift(e).getStartPosition());for(const e of a){const t=n.positionAt(l+e.originalStart),r=n.positionAt(l+e.originalStart+e.originalLength),o={text:s.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:r.lineNumber,endColumn:r.column}};n.getValueInRange(o.range)!==o.text&&i.push(o)}}return"number"==typeof r&&i.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),i}))}computeLinks(e){return $t(this,void 0,void 0,(function*(){let t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getLineCount&&"function"==typeof e.getLineContent?$e.computeLinks(e):[]}(t):null}))}textualSuggest(e,t,n,i){return $t(this,void 0,void 0,(function*(){const r=this._getModel(e);if(!r)return null;const s=[],o=new Set,a=new RegExp(n,i),l=r.getWordAtPosition(t,a);l&&o.add(r.getValueInRange(l));for(let e of r.words(a))if(!o.has(e)&&(o.add(e),isNaN(Number(e))&&(s.push(e),o.size>Gt._suggestionsLimit)))break;return s}))}computeWordRanges(e,t,n,i){return $t(this,void 0,void 0,(function*(){let r=this._getModel(e);if(!r)return Object.create(null);const s=new RegExp(n,i),o=Object.create(null);for(let e=t.startLineNumber;ethis._host.fhr(e,t)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(i,t),Promise.resolve(C(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(e){return Promise.reject(e)}}}Gt._diffLimit=1e5,Gt._suggestionsLimit=1e4,"function"==typeof importScripts&&(p.a.monaco={editor:void 0,languages:void 0,CancellationTokenSource:rt,Emitter:Je,KeyCode:At,KeyMod:Yt,Position:Le,Range:Se,Selection:Ht,SelectionDirection:kt,MarkerSeverity:yt,MarkerTag:wt,Uri:he,Token:Vt}),n.d(t,"initialize",(function(){return Qt}));let zt=!1;function Qt(e){if(zt)return;zt=!0;const t=new N(e=>{self.postMessage(e)},t=>new Gt(t,e));self.onmessage=e=>{t.onmessage(e.data)}}self.onmessage=e=>{zt||Qt(null)}}]); \ No newline at end of file diff --git a/docs/json.worker.js b/docs/json.worker.js index 999d3babc..b1d05912d 100644 --- a/docs/json.worker.js +++ b/docs/json.worker.js @@ -1,19425 +1 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./node_modules/monaco-editor/esm/vs/language/json/json.worker.js"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/arrays.js ***! - \*****************************************************************/ -/*! exports provided: tail, tail2, equals, binarySearch, findFirstInSorted, mergeSort, groupBy, coalesce, isFalsyOrEmpty, isNonEmptyArray, distinct, distinctES6, firstIndex, first, firstOrDefault, flatten, range, arrayInsert, pushToStart, pushToEnd, asArray */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return tail; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail2", function() { return tail2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "binarySearch", function() { return binarySearch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findFirstInSorted", function() { return findFirstInSorted; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeSort", function() { return mergeSort; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coalesce", function() { return coalesce; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrEmpty", function() { return isFalsyOrEmpty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonEmptyArray", function() { return isNonEmptyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctES6", function() { return distinctES6; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstIndex", function() { return firstIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstOrDefault", function() { return firstOrDefault; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return flatten; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayInsert", function() { return arrayInsert; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToStart", function() { return pushToStart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToEnd", function() { return pushToEnd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asArray", function() { return asArray; }); -/** - * Returns the last element of an array. - * @param array The array. - * @param n Which element from the end (default is zero). - */ -function tail(array, n = 0) { - return array[array.length - (1 + n)]; -} -function tail2(arr) { - if (arr.length === 0) { - throw new Error('Invalid tail call'); - } - return [arr.slice(0, arr.length - 1), arr[arr.length - 1]]; -} -function equals(one, other, itemEquals = (a, b) => a === b) { - if (one === other) { - return true; - } - if (!one || !other) { - return false; - } - if (one.length !== other.length) { - return false; - } - for (let i = 0, len = one.length; i < len; i++) { - if (!itemEquals(one[i], other[i])) { - return false; - } - } - return true; -} -function binarySearch(array, key, comparator) { - let low = 0, high = array.length - 1; - while (low <= high) { - const mid = ((low + high) / 2) | 0; - const comp = comparator(array[mid], key); - if (comp < 0) { - low = mid + 1; - } - else if (comp > 0) { - high = mid - 1; - } - else { - return mid; - } - } - return -(low + 1); -} -/** - * Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false - * are located before all elements where p(x) is true. - * @returns the least x for which p(x) is true or array.length if no element fullfills the given function. - */ -function findFirstInSorted(array, p) { - let low = 0, high = array.length; - if (high === 0) { - return 0; // no children - } - while (low < high) { - const mid = Math.floor((low + high) / 2); - if (p(array[mid])) { - high = mid; - } - else { - low = mid + 1; - } - } - return low; -} -/** - * Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort` - * so only use this when actually needing stable sort. - */ -function mergeSort(data, compare) { - _sort(data, compare, 0, data.length - 1, []); - return data; -} -function _merge(a, compare, lo, mid, hi, aux) { - let leftIdx = lo, rightIdx = mid + 1; - for (let i = lo; i <= hi; i++) { - aux[i] = a[i]; - } - for (let i = lo; i <= hi; i++) { - if (leftIdx > mid) { - // left side consumed - a[i] = aux[rightIdx++]; - } - else if (rightIdx > hi) { - // right side consumed - a[i] = aux[leftIdx++]; - } - else if (compare(aux[rightIdx], aux[leftIdx]) < 0) { - // right element is less -> comes first - a[i] = aux[rightIdx++]; - } - else { - // left element comes first (less or equal) - a[i] = aux[leftIdx++]; - } - } -} -function _sort(a, compare, lo, hi, aux) { - if (hi <= lo) { - return; - } - const mid = lo + ((hi - lo) / 2) | 0; - _sort(a, compare, lo, mid, aux); - _sort(a, compare, mid + 1, hi, aux); - if (compare(a[mid], a[mid + 1]) <= 0) { - // left and right are sorted and if the last-left element is less - // or equals than the first-right element there is nothing else - // to do - return; - } - _merge(a, compare, lo, mid, hi, aux); -} -function groupBy(data, compare) { - const result = []; - let currentGroup = undefined; - for (const element of mergeSort(data.slice(0), compare)) { - if (!currentGroup || compare(currentGroup[0], element) !== 0) { - currentGroup = [element]; - result.push(currentGroup); - } - else { - currentGroup.push(element); - } - } - return result; -} -/** - * @returns New array with all falsy values removed. The original array IS NOT modified. - */ -function coalesce(array) { - return array.filter(e => !!e); -} -/** - * @returns false if the provided object is an array and not empty. - */ -function isFalsyOrEmpty(obj) { - return !Array.isArray(obj) || obj.length === 0; -} -function isNonEmptyArray(obj) { - return Array.isArray(obj) && obj.length > 0; -} -/** - * Removes duplicates from the given array. The optional keyFn allows to specify - * how elements are checked for equalness by returning a unique string for each. - */ -function distinct(array, keyFn) { - if (!keyFn) { - return array.filter((element, position) => { - return array.indexOf(element) === position; - }); - } - const seen = Object.create(null); - return array.filter((elem) => { - const key = keyFn(elem); - if (seen[key]) { - return false; - } - seen[key] = true; - return true; - }); -} -function distinctES6(array) { - const seen = new Set(); - return array.filter(element => { - if (seen.has(element)) { - return false; - } - seen.add(element); - return true; - }); -} -/** - * @deprecated ES6: use `Array.findIndex` - */ -function firstIndex(array, fn) { - for (let i = 0; i < array.length; i++) { - const element = array[i]; - if (fn(element)) { - return i; - } - } - return -1; -} -function first(array, fn, notFoundValue = undefined) { - const index = firstIndex(array, fn); - return index < 0 ? notFoundValue : array[index]; -} -function firstOrDefault(array, notFoundValue) { - return array.length > 0 ? array[0] : notFoundValue; -} -function flatten(arr) { - return [].concat(...arr); -} -function range(arg, to) { - let from = typeof to === 'number' ? arg : 0; - if (typeof to === 'number') { - from = arg; - } - else { - from = 0; - to = arg; - } - const result = []; - if (from <= to) { - for (let i = from; i < to; i++) { - result.push(i); - } - } - else { - for (let i = from; i > to; i--) { - result.push(i); - } - } - return result; -} -/** - * Insert `insertArr` inside `target` at `insertIndex`. - * Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array - */ -function arrayInsert(target, insertIndex, insertArr) { - const before = target.slice(0, insertIndex); - const after = target.slice(insertIndex); - return before.concat(insertArr, after); -} -/** - * Pushes an element to the start of the array, if found. - */ -function pushToStart(arr, value) { - const index = arr.indexOf(value); - if (index > -1) { - arr.splice(index, 1); - arr.unshift(value); - } -} -/** - * Pushes an element to the end of the array, if found. - */ -function pushToEnd(arr, value) { - const index = arr.indexOf(value); - if (index > -1) { - arr.splice(index, 1); - arr.push(value); - } -} -function asArray(x) { - return Array.isArray(x) ? x : [x]; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js ***! - \***********************************************************************/ -/*! exports provided: CancellationToken, CancellationTokenSource */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationToken", function() { return CancellationToken; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationTokenSource", function() { return CancellationTokenSource; }); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const shortcutEvent = Object.freeze(function (callback, context) { - const handle = setTimeout(callback.bind(context), 0); - return { dispose() { clearTimeout(handle); } }; -}); -var CancellationToken; -(function (CancellationToken) { - function isCancellationToken(thing) { - if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { - return true; - } - if (thing instanceof MutableToken) { - return true; - } - if (!thing || typeof thing !== 'object') { - return false; - } - return typeof thing.isCancellationRequested === 'boolean' - && typeof thing.onCancellationRequested === 'function'; - } - CancellationToken.isCancellationToken = isCancellationToken; - CancellationToken.None = Object.freeze({ - isCancellationRequested: false, - onCancellationRequested: _event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].None - }); - CancellationToken.Cancelled = Object.freeze({ - isCancellationRequested: true, - onCancellationRequested: shortcutEvent - }); -})(CancellationToken || (CancellationToken = {})); -class MutableToken { - constructor() { - this._isCancelled = false; - this._emitter = null; - } - cancel() { - if (!this._isCancelled) { - this._isCancelled = true; - if (this._emitter) { - this._emitter.fire(undefined); - this.dispose(); - } - } - } - get isCancellationRequested() { - return this._isCancelled; - } - get onCancellationRequested() { - if (this._isCancelled) { - return shortcutEvent; - } - if (!this._emitter) { - this._emitter = new _event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - } - return this._emitter.event; - } - dispose() { - if (this._emitter) { - this._emitter.dispose(); - this._emitter = null; - } - } -} -class CancellationTokenSource { - constructor(parent) { - this._token = undefined; - this._parentListener = undefined; - this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); - } - get token() { - if (!this._token) { - // be lazy and create the token only when - // actually needed - this._token = new MutableToken(); - } - return this._token; - } - cancel() { - if (!this._token) { - // save an object by returning the default - // cancelled token when cancellation happens - // before someone asks for the token - this._token = CancellationToken.Cancelled; - } - else if (this._token instanceof MutableToken) { - // actually cancel - this._token.cancel(); - } - } - dispose(cancel = false) { - if (cancel) { - this.cancel(); - } - if (this._parentListener) { - this._parentListener.dispose(); - } - if (!this._token) { - // ensure to initialize with an empty token if we had none - this._token = CancellationToken.None; - } - else if (this._token instanceof MutableToken) { - // actually dispose - this._token.dispose(); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js ***! - \********************************************************************/ -/*! exports provided: StringDiffSequence, stringDiff, Debug, MyArray, LcsDiff */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringDiffSequence", function() { return StringDiffSequence; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringDiff", function() { return stringDiff; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Debug", function() { return Debug; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MyArray", function() { return MyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LcsDiff", function() { return LcsDiff; }); -/* harmony import */ var _diffChange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diffChange.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js"); -/* harmony import */ var _hash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../hash.js */ "./node_modules/monaco-editor/esm/vs/base/common/hash.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class StringDiffSequence { - constructor(source) { - this.source = source; - } - getElements() { - const source = this.source; - const characters = new Int32Array(source.length); - for (let i = 0, len = source.length; i < len; i++) { - characters[i] = source.charCodeAt(i); - } - return characters; - } -} -function stringDiff(original, modified, pretty) { - return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes; -} -// -// The code below has been ported from a C# implementation in VS -// -class Debug { - static Assert(condition, message) { - if (!condition) { - throw new Error(message); - } - } -} -class MyArray { - /** - * Copies a range of elements from an Array starting at the specified source index and pastes - * them to another Array starting at the specified destination index. The length and the indexes - * are specified as 64-bit integers. - * sourceArray: - * The Array that contains the data to copy. - * sourceIndex: - * A 64-bit integer that represents the index in the sourceArray at which copying begins. - * destinationArray: - * The Array that receives the data. - * destinationIndex: - * A 64-bit integer that represents the index in the destinationArray at which storing begins. - * length: - * A 64-bit integer that represents the number of elements to copy. - */ - static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) { - for (let i = 0; i < length; i++) { - destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; - } - } - static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) { - for (let i = 0; i < length; i++) { - destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; - } - } -} -/** - * A utility class which helps to create the set of DiffChanges from - * a difference operation. This class accepts original DiffElements and - * modified DiffElements that are involved in a particular change. The - * MarktNextChange() method can be called to mark the separation between - * distinct changes. At the end, the Changes property can be called to retrieve - * the constructed changes. - */ -class DiffChangeHelper { - /** - * Constructs a new DiffChangeHelper for the given DiffSequences. - */ - constructor() { - this.m_changes = []; - this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - this.m_originalCount = 0; - this.m_modifiedCount = 0; - } - /** - * Marks the beginning of the next change in the set of differences. - */ - MarkNextChange() { - // Only add to the list if there is something to add - if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { - // Add the new change to our list - this.m_changes.push(new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); - } - // Reset for the next change - this.m_originalCount = 0; - this.m_modifiedCount = 0; - this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - } - /** - * Adds the original element at the given position to the elements - * affected by the current change. The modified index gives context - * to the change position with respect to the original sequence. - * @param originalIndex The index of the original element to add. - * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence. - */ - AddOriginalElement(originalIndex, modifiedIndex) { - // The 'true' start index is the smallest of the ones we've seen - this.m_originalStart = Math.min(this.m_originalStart, originalIndex); - this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex); - this.m_originalCount++; - } - /** - * Adds the modified element at the given position to the elements - * affected by the current change. The original index gives context - * to the change position with respect to the modified sequence. - * @param originalIndex The index of the original element that provides corresponding position in the original sequence. - * @param modifiedIndex The index of the modified element to add. - */ - AddModifiedElement(originalIndex, modifiedIndex) { - // The 'true' start index is the smallest of the ones we've seen - this.m_originalStart = Math.min(this.m_originalStart, originalIndex); - this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex); - this.m_modifiedCount++; - } - /** - * Retrieves all of the changes marked by the class. - */ - getChanges() { - if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { - // Finish up on whatever is left - this.MarkNextChange(); - } - return this.m_changes; - } - /** - * Retrieves all of the changes marked by the class in the reverse order - */ - getReverseChanges() { - if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { - // Finish up on whatever is left - this.MarkNextChange(); - } - this.m_changes.reverse(); - return this.m_changes; - } -} -/** - * An implementation of the difference algorithm described in - * "An O(ND) Difference Algorithm and its variations" by Eugene W. Myers - */ -class LcsDiff { - /** - * Constructs the DiffFinder - */ - constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) { - this.ContinueProcessingPredicate = continueProcessingPredicate; - const [originalStringElements, originalElementsOrHash, originalHasStrings] = LcsDiff._getElements(originalSequence); - const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = LcsDiff._getElements(modifiedSequence); - this._hasStrings = (originalHasStrings && modifiedHasStrings); - this._originalStringElements = originalStringElements; - this._originalElementsOrHash = originalElementsOrHash; - this._modifiedStringElements = modifiedStringElements; - this._modifiedElementsOrHash = modifiedElementsOrHash; - this.m_forwardHistory = []; - this.m_reverseHistory = []; - } - static _isStringArray(arr) { - return (arr.length > 0 && typeof arr[0] === 'string'); - } - static _getElements(sequence) { - const elements = sequence.getElements(); - if (LcsDiff._isStringArray(elements)) { - const hashes = new Int32Array(elements.length); - for (let i = 0, len = elements.length; i < len; i++) { - hashes[i] = Object(_hash_js__WEBPACK_IMPORTED_MODULE_1__["stringHash"])(elements[i], 0); - } - return [elements, hashes, true]; - } - if (elements instanceof Int32Array) { - return [[], elements, false]; - } - return [[], new Int32Array(elements), false]; - } - ElementsAreEqual(originalIndex, newIndex) { - if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) { - return false; - } - return (this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true); - } - OriginalElementsAreEqual(index1, index2) { - if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) { - return false; - } - return (this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true); - } - ModifiedElementsAreEqual(index1, index2) { - if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) { - return false; - } - return (this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true); - } - ComputeDiff(pretty) { - return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty); - } - /** - * Computes the differences between the original and modified input - * sequences on the bounded range. - * @returns An array of the differences between the two input sequences. - */ - _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) { - const quitEarlyArr = [false]; - let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr); - if (pretty) { - // We have to clean up the computed diff to be more intuitive - // but it turns out this cannot be done correctly until the entire set - // of diffs have been computed - changes = this.PrettifyChanges(changes); - } - return { - quitEarly: quitEarlyArr[0], - changes: changes - }; - } - /** - * Private helper method which computes the differences on the bounded range - * recursively. - * @returns An array of the differences between the two input sequences. - */ - ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) { - quitEarlyArr[0] = false; - // Find the start of the differences - while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) { - originalStart++; - modifiedStart++; - } - // Find the end of the differences - while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) { - originalEnd--; - modifiedEnd--; - } - // In the special case where we either have all insertions or all deletions or the sequences are identical - if (originalStart > originalEnd || modifiedStart > modifiedEnd) { - let changes; - if (modifiedStart <= modifiedEnd) { - Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); - // All insertions - changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) - ]; - } - else if (originalStart <= originalEnd) { - Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); - // All deletions - changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, 0) - ]; - } - else { - Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); - Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); - // Identical sequences - No differences - changes = []; - } - return changes; - } - // This problem can be solved using the Divide-And-Conquer technique. - const midOriginalArr = [0]; - const midModifiedArr = [0]; - const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr); - const midOriginal = midOriginalArr[0]; - const midModified = midModifiedArr[0]; - if (result !== null) { - // Result is not-null when there was enough memory to compute the changes while - // searching for the recursion point - return result; - } - else if (!quitEarlyArr[0]) { - // We can break the problem down recursively by finding the changes in the - // First Half: (originalStart, modifiedStart) to (midOriginal, midModified) - // Second Half: (midOriginal + 1, minModified + 1) to (originalEnd, modifiedEnd) - // NOTE: ComputeDiff() is inclusive, therefore the second range starts on the next point - const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr); - let rightChanges = []; - if (!quitEarlyArr[0]) { - rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr); - } - else { - // We did't have time to finish the first half, so we don't have time to compute this half. - // Consider the entire rest of the sequence different. - rightChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) - ]; - } - return this.ConcatenateChanges(leftChanges, rightChanges); - } - // If we hit here, we quit early, and so can't return anything meaningful - return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) - ]; - } - WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) { - let forwardChanges = null; - let reverseChanges = null; - // First, walk backward through the forward diagonals history - let changeHelper = new DiffChangeHelper(); - let diagonalMin = diagonalForwardStart; - let diagonalMax = diagonalForwardEnd; - let diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset; - let lastOriginalIndex = -1073741824 /* MIN_SAFE_SMALL_INTEGER */; - let historyIndex = this.m_forwardHistory.length - 1; - do { - // Get the diagonal index from the relative diagonal number - const diagonal = diagonalRelative + diagonalForwardBase; - // Figure out where we came from - if (diagonal === diagonalMin || (diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) { - // Vertical line (the element is an insert) - originalIndex = forwardPoints[diagonal + 1]; - modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset; - if (originalIndex < lastOriginalIndex) { - changeHelper.MarkNextChange(); - } - lastOriginalIndex = originalIndex; - changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex); - diagonalRelative = (diagonal + 1) - diagonalForwardBase; //Setup for the next iteration - } - else { - // Horizontal line (the element is a deletion) - originalIndex = forwardPoints[diagonal - 1] + 1; - modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset; - if (originalIndex < lastOriginalIndex) { - changeHelper.MarkNextChange(); - } - lastOriginalIndex = originalIndex - 1; - changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1); - diagonalRelative = (diagonal - 1) - diagonalForwardBase; //Setup for the next iteration - } - if (historyIndex >= 0) { - forwardPoints = this.m_forwardHistory[historyIndex]; - diagonalForwardBase = forwardPoints[0]; //We stored this in the first spot - diagonalMin = 1; - diagonalMax = forwardPoints.length - 1; - } - } while (--historyIndex >= -1); - // Ironically, we get the forward changes as the reverse of the - // order we added them since we technically added them backwards - forwardChanges = changeHelper.getReverseChanges(); - if (quitEarlyArr[0]) { - // TODO: Calculate a partial from the reverse diagonals. - // For now, just assume everything after the midOriginal/midModified point is a diff - let originalStartPoint = midOriginalArr[0] + 1; - let modifiedStartPoint = midModifiedArr[0] + 1; - if (forwardChanges !== null && forwardChanges.length > 0) { - const lastForwardChange = forwardChanges[forwardChanges.length - 1]; - originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd()); - modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd()); - } - reverseChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) - ]; - } - else { - // Now walk backward through the reverse diagonals history - changeHelper = new DiffChangeHelper(); - diagonalMin = diagonalReverseStart; - diagonalMax = diagonalReverseEnd; - diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset; - lastOriginalIndex = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; - historyIndex = (deltaIsEven) ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2; - do { - // Get the diagonal index from the relative diagonal number - const diagonal = diagonalRelative + diagonalReverseBase; - // Figure out where we came from - if (diagonal === diagonalMin || (diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) { - // Horizontal line (the element is a deletion)) - originalIndex = reversePoints[diagonal + 1] - 1; - modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset; - if (originalIndex > lastOriginalIndex) { - changeHelper.MarkNextChange(); - } - lastOriginalIndex = originalIndex + 1; - changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1); - diagonalRelative = (diagonal + 1) - diagonalReverseBase; //Setup for the next iteration - } - else { - // Vertical line (the element is an insertion) - originalIndex = reversePoints[diagonal - 1]; - modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset; - if (originalIndex > lastOriginalIndex) { - changeHelper.MarkNextChange(); - } - lastOriginalIndex = originalIndex; - changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1); - diagonalRelative = (diagonal - 1) - diagonalReverseBase; //Setup for the next iteration - } - if (historyIndex >= 0) { - reversePoints = this.m_reverseHistory[historyIndex]; - diagonalReverseBase = reversePoints[0]; //We stored this in the first spot - diagonalMin = 1; - diagonalMax = reversePoints.length - 1; - } - } while (--historyIndex >= -1); - // There are cases where the reverse history will find diffs that - // are correct, but not intuitive, so we need shift them. - reverseChanges = changeHelper.getChanges(); - } - return this.ConcatenateChanges(forwardChanges, reverseChanges); - } - /** - * Given the range to compute the diff on, this method finds the point: - * (midOriginal, midModified) - * that exists in the middle of the LCS of the two sequences and - * is the point at which the LCS problem may be broken down recursively. - * This method will try to keep the LCS trace in memory. If the LCS recursion - * point is calculated and the full trace is available in memory, then this method - * will return the change list. - * @param originalStart The start bound of the original sequence range - * @param originalEnd The end bound of the original sequence range - * @param modifiedStart The start bound of the modified sequence range - * @param modifiedEnd The end bound of the modified sequence range - * @param midOriginal The middle point of the original sequence range - * @param midModified The middle point of the modified sequence range - * @returns The diff changes, if available, otherwise null - */ - ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) { - let originalIndex = 0, modifiedIndex = 0; - let diagonalForwardStart = 0, diagonalForwardEnd = 0; - let diagonalReverseStart = 0, diagonalReverseEnd = 0; - // To traverse the edit graph and produce the proper LCS, our actual - // start position is just outside the given boundary - originalStart--; - modifiedStart--; - // We set these up to make the compiler happy, but they will - // be replaced before we return with the actual recursion point - midOriginalArr[0] = 0; - midModifiedArr[0] = 0; - // Clear out the history - this.m_forwardHistory = []; - this.m_reverseHistory = []; - // Each cell in the two arrays corresponds to a diagonal in the edit graph. - // The integer value in the cell represents the originalIndex of the furthest - // reaching point found so far that ends in that diagonal. - // The modifiedIndex can be computed mathematically from the originalIndex and the diagonal number. - const maxDifferences = (originalEnd - originalStart) + (modifiedEnd - modifiedStart); - const numDiagonals = maxDifferences + 1; - const forwardPoints = new Int32Array(numDiagonals); - const reversePoints = new Int32Array(numDiagonals); - // diagonalForwardBase: Index into forwardPoints of the diagonal which passes through (originalStart, modifiedStart) - // diagonalReverseBase: Index into reversePoints of the diagonal which passes through (originalEnd, modifiedEnd) - const diagonalForwardBase = (modifiedEnd - modifiedStart); - const diagonalReverseBase = (originalEnd - originalStart); - // diagonalForwardOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the - // diagonal number (relative to diagonalForwardBase) - // diagonalReverseOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the - // diagonal number (relative to diagonalReverseBase) - const diagonalForwardOffset = (originalStart - modifiedStart); - const diagonalReverseOffset = (originalEnd - modifiedEnd); - // delta: The difference between the end diagonal and the start diagonal. This is used to relate diagonal numbers - // relative to the start diagonal with diagonal numbers relative to the end diagonal. - // The Even/Oddn-ness of this delta is important for determining when we should check for overlap - const delta = diagonalReverseBase - diagonalForwardBase; - const deltaIsEven = (delta % 2 === 0); - // Here we set up the start and end points as the furthest points found so far - // in both the forward and reverse directions, respectively - forwardPoints[diagonalForwardBase] = originalStart; - reversePoints[diagonalReverseBase] = originalEnd; - // Remember if we quit early, and thus need to do a best-effort result instead of a real result. - quitEarlyArr[0] = false; - // A couple of points: - // --With this method, we iterate on the number of differences between the two sequences. - // The more differences there actually are, the longer this will take. - // --Also, as the number of differences increases, we have to search on diagonals further - // away from the reference diagonal (which is diagonalForwardBase for forward, diagonalReverseBase for reverse). - // --We extend on even diagonals (relative to the reference diagonal) only when numDifferences - // is even and odd diagonals only when numDifferences is odd. - for (let numDifferences = 1; numDifferences <= (maxDifferences / 2) + 1; numDifferences++) { - let furthestOriginalIndex = 0; - let furthestModifiedIndex = 0; - // Run the algorithm in the forward direction - diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals); - diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals); - for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) { - // STEP 1: We extend the furthest reaching point in the present diagonal - // by looking at the diagonals above and below and picking the one whose point - // is further away from the start point (originalStart, modifiedStart) - if (diagonal === diagonalForwardStart || (diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) { - originalIndex = forwardPoints[diagonal + 1]; - } - else { - originalIndex = forwardPoints[diagonal - 1] + 1; - } - modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset; - // Save the current originalIndex so we can test for false overlap in step 3 - const tempOriginalIndex = originalIndex; - // STEP 2: We can continue to extend the furthest reaching point in the present diagonal - // so long as the elements are equal. - while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) { - originalIndex++; - modifiedIndex++; - } - forwardPoints[diagonal] = originalIndex; - if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) { - furthestOriginalIndex = originalIndex; - furthestModifiedIndex = modifiedIndex; - } - // STEP 3: If delta is odd (overlap first happens on forward when delta is odd) - // and diagonal is in the range of reverse diagonals computed for numDifferences-1 - // (the previous iteration; we haven't computed reverse diagonals for numDifferences yet) - // then check for overlap. - if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= (numDifferences - 1)) { - if (originalIndex >= reversePoints[diagonal]) { - midOriginalArr[0] = originalIndex; - midModifiedArr[0] = modifiedIndex; - if (tempOriginalIndex <= reversePoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) { - // BINGO! We overlapped, and we have the full trace in memory! - return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); - } - else { - // Either false overlap, or we didn't have enough memory for the full trace - // Just return the recursion point - return null; - } - } - } - } - // Check to see if we should be quitting early, before moving on to the next iteration. - const matchLengthOfLongest = ((furthestOriginalIndex - originalStart) + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2; - if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) { - // We can't finish, so skip ahead to generating a result from what we have. - quitEarlyArr[0] = true; - // Use the furthest distance we got in the forward direction. - midOriginalArr[0] = furthestOriginalIndex; - midModifiedArr[0] = furthestModifiedIndex; - if (matchLengthOfLongest > 0 && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) { - // Enough of the history is in memory to walk it backwards - return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); - } - else { - // We didn't actually remember enough of the history. - //Since we are quiting the diff early, we need to shift back the originalStart and modified start - //back into the boundary limits since we decremented their value above beyond the boundary limit. - originalStart++; - modifiedStart++; - return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) - ]; - } - } - // Run the algorithm in the reverse direction - diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals); - diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals); - for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) { - // STEP 1: We extend the furthest reaching point in the present diagonal - // by looking at the diagonals above and below and picking the one whose point - // is further away from the start point (originalEnd, modifiedEnd) - if (diagonal === diagonalReverseStart || (diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) { - originalIndex = reversePoints[diagonal + 1] - 1; - } - else { - originalIndex = reversePoints[diagonal - 1]; - } - modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset; - // Save the current originalIndex so we can test for false overlap - const tempOriginalIndex = originalIndex; - // STEP 2: We can continue to extend the furthest reaching point in the present diagonal - // as long as the elements are equal. - while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) { - originalIndex--; - modifiedIndex--; - } - reversePoints[diagonal] = originalIndex; - // STEP 4: If delta is even (overlap first happens on reverse when delta is even) - // and diagonal is in the range of forward diagonals computed for numDifferences - // then check for overlap. - if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) { - if (originalIndex <= forwardPoints[diagonal]) { - midOriginalArr[0] = originalIndex; - midModifiedArr[0] = modifiedIndex; - if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) { - // BINGO! We overlapped, and we have the full trace in memory! - return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); - } - else { - // Either false overlap, or we didn't have enough memory for the full trace - // Just return the recursion point - return null; - } - } - } - } - // Save current vectors to history before the next iteration - if (numDifferences <= 1447 /* MaxDifferencesHistory */) { - // We are allocating space for one extra int, which we fill with - // the index of the diagonal base index - let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2); - temp[0] = diagonalForwardBase - diagonalForwardStart + 1; - MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1); - this.m_forwardHistory.push(temp); - temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2); - temp[0] = diagonalReverseBase - diagonalReverseStart + 1; - MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1); - this.m_reverseHistory.push(temp); - } - } - // If we got here, then we have the full trace in history. We just have to convert it to a change list - // NOTE: This part is a bit messy - return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); - } - /** - * Shifts the given changes to provide a more intuitive diff. - * While the first element in a diff matches the first element after the diff, - * we shift the diff down. - * - * @param changes The list of changes to shift - * @returns The shifted changes - */ - PrettifyChanges(changes) { - // Shift all the changes down first - for (let i = 0; i < changes.length; i++) { - const change = changes[i]; - const originalStop = (i < changes.length - 1) ? changes[i + 1].originalStart : this._originalElementsOrHash.length; - const modifiedStop = (i < changes.length - 1) ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length; - const checkOriginal = change.originalLength > 0; - const checkModified = change.modifiedLength > 0; - while (change.originalStart + change.originalLength < originalStop && - change.modifiedStart + change.modifiedLength < modifiedStop && - (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) && - (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) { - change.originalStart++; - change.modifiedStart++; - } - let mergedChangeArr = [null]; - if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) { - changes[i] = mergedChangeArr[0]; - changes.splice(i + 1, 1); - i--; - continue; - } - } - // Shift changes back up until we hit empty or whitespace-only lines - for (let i = changes.length - 1; i >= 0; i--) { - const change = changes[i]; - let originalStop = 0; - let modifiedStop = 0; - if (i > 0) { - const prevChange = changes[i - 1]; - if (prevChange.originalLength > 0) { - originalStop = prevChange.originalStart + prevChange.originalLength; - } - if (prevChange.modifiedLength > 0) { - modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength; - } - } - const checkOriginal = change.originalLength > 0; - const checkModified = change.modifiedLength > 0; - let bestDelta = 0; - let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength); - for (let delta = 1;; delta++) { - const originalStart = change.originalStart - delta; - const modifiedStart = change.modifiedStart - delta; - if (originalStart < originalStop || modifiedStart < modifiedStop) { - break; - } - if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) { - break; - } - if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) { - break; - } - const score = this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength); - if (score > bestScore) { - bestScore = score; - bestDelta = delta; - } - } - change.originalStart -= bestDelta; - change.modifiedStart -= bestDelta; - } - return changes; - } - _OriginalIsBoundary(index) { - if (index <= 0 || index >= this._originalElementsOrHash.length - 1) { - return true; - } - return (this._hasStrings && /^\s*$/.test(this._originalStringElements[index])); - } - _OriginalRegionIsBoundary(originalStart, originalLength) { - if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) { - return true; - } - if (originalLength > 0) { - const originalEnd = originalStart + originalLength; - if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) { - return true; - } - } - return false; - } - _ModifiedIsBoundary(index) { - if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) { - return true; - } - return (this._hasStrings && /^\s*$/.test(this._modifiedStringElements[index])); - } - _ModifiedRegionIsBoundary(modifiedStart, modifiedLength) { - if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) { - return true; - } - if (modifiedLength > 0) { - const modifiedEnd = modifiedStart + modifiedLength; - if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) { - return true; - } - } - return false; - } - _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) { - const originalScore = (this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0); - const modifiedScore = (this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0); - return (originalScore + modifiedScore); - } - /** - * Concatenates the two input DiffChange lists and returns the resulting - * list. - * @param The left changes - * @param The right changes - * @returns The concatenated list - */ - ConcatenateChanges(left, right) { - let mergedChangeArr = []; - if (left.length === 0 || right.length === 0) { - return (right.length > 0) ? right : left; - } - else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) { - // Since we break the problem down recursively, it is possible that we - // might recurse in the middle of a change thereby splitting it into - // two changes. Here in the combining stage, we detect and fuse those - // changes back together - const result = new Array(left.length + right.length - 1); - MyArray.Copy(left, 0, result, 0, left.length - 1); - result[left.length - 1] = mergedChangeArr[0]; - MyArray.Copy(right, 1, result, left.length, right.length - 1); - return result; - } - else { - const result = new Array(left.length + right.length); - MyArray.Copy(left, 0, result, 0, left.length); - MyArray.Copy(right, 0, result, left.length, right.length); - return result; - } - } - /** - * Returns true if the two changes overlap and can be merged into a single - * change - * @param left The left change - * @param right The right change - * @param mergedChange The merged change if the two overlap, null otherwise - * @returns True if the two changes overlap - */ - ChangesOverlap(left, right, mergedChangeArr) { - Debug.Assert(left.originalStart <= right.originalStart, 'Left change is not less than or equal to right change'); - Debug.Assert(left.modifiedStart <= right.modifiedStart, 'Left change is not less than or equal to right change'); - if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) { - const originalStart = left.originalStart; - let originalLength = left.originalLength; - const modifiedStart = left.modifiedStart; - let modifiedLength = left.modifiedLength; - if (left.originalStart + left.originalLength >= right.originalStart) { - originalLength = right.originalStart + right.originalLength - left.originalStart; - } - if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) { - modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart; - } - mergedChangeArr[0] = new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalLength, modifiedStart, modifiedLength); - return true; - } - else { - mergedChangeArr[0] = null; - return false; - } - } - /** - * Helper method used to clip a diagonal index to the range of valid - * diagonals. This also decides whether or not the diagonal index, - * if it exceeds the boundary, should be clipped to the boundary or clipped - * one inside the boundary depending on the Even/Odd status of the boundary - * and numDifferences. - * @param diagonal The index of the diagonal to clip. - * @param numDifferences The current number of differences being iterated upon. - * @param diagonalBaseIndex The base reference diagonal. - * @param numDiagonals The total number of diagonals. - * @returns The clipped diagonal index. - */ - ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) { - if (diagonal >= 0 && diagonal < numDiagonals) { - // Nothing to clip, its in range - return diagonal; - } - // diagonalsBelow: The number of diagonals below the reference diagonal - // diagonalsAbove: The number of diagonals above the reference diagonal - const diagonalsBelow = diagonalBaseIndex; - const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1; - const diffEven = (numDifferences % 2 === 0); - if (diagonal < 0) { - const lowerBoundEven = (diagonalsBelow % 2 === 0); - return (diffEven === lowerBoundEven) ? 0 : 1; - } - else { - const upperBoundEven = (diagonalsAbove % 2 === 0); - return (diffEven === upperBoundEven) ? numDiagonals - 1 : numDiagonals - 2; - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js ***! - \**************************************************************************/ -/*! exports provided: DiffChange */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffChange", function() { return DiffChange; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * Represents information about a specific difference between two sequences. - */ -class DiffChange { - /** - * Constructs a new DiffChange with the given sequence information - * and content. - */ - constructor(originalStart, originalLength, modifiedStart, modifiedLength) { - //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); - this.originalStart = originalStart; - this.originalLength = originalLength; - this.modifiedStart = modifiedStart; - this.modifiedLength = modifiedLength; - } - /** - * The end point (exclusive) of the change in the original sequence. - */ - getOriginalEnd() { - return this.originalStart + this.originalLength; - } - /** - * The end point (exclusive) of the change in the modified sequence. - */ - getModifiedEnd() { - return this.modifiedStart + this.modifiedLength; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/errors.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/errors.js ***! - \*****************************************************************/ -/*! exports provided: ErrorHandler, errorHandler, onUnexpectedError, onUnexpectedExternalError, transformErrorForSerialization, isPromiseCanceledError, canceled, illegalArgument, illegalState */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "errorHandler", function() { return errorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedError", function() { return onUnexpectedError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedExternalError", function() { return onUnexpectedExternalError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformErrorForSerialization", function() { return transformErrorForSerialization; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromiseCanceledError", function() { return isPromiseCanceledError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canceled", function() { return canceled; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalArgument", function() { return illegalArgument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalState", function() { return illegalState; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// Avoid circular dependency on EventEmitter by implementing a subset of the interface. -class ErrorHandler { - constructor() { - this.listeners = []; - this.unexpectedErrorHandler = function (e) { - setTimeout(() => { - if (e.stack) { - throw new Error(e.message + '\n\n' + e.stack); - } - throw e; - }, 0); - }; - } - emit(e) { - this.listeners.forEach((listener) => { - listener(e); - }); - } - onUnexpectedError(e) { - this.unexpectedErrorHandler(e); - this.emit(e); - } - // For external errors, we don't want the listeners to be called - onUnexpectedExternalError(e) { - this.unexpectedErrorHandler(e); - } -} -const errorHandler = new ErrorHandler(); -function onUnexpectedError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedError(e); - } - return undefined; -} -function onUnexpectedExternalError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedExternalError(e); - } - return undefined; -} -function transformErrorForSerialization(error) { - if (error instanceof Error) { - let { name, message } = error; - const stack = error.stacktrace || error.stack; - return { - $isError: true, - name, - message, - stack - }; - } - // return as is - return error; -} -const canceledName = 'Canceled'; -/** - * Checks if the given error is a promise in canceled state - */ -function isPromiseCanceledError(error) { - return error instanceof Error && error.name === canceledName && error.message === canceledName; -} -/** - * Returns an error that signals cancellation. - */ -function canceled() { - const error = new Error(canceledName); - error.name = error.message; - return error; -} -function illegalArgument(name) { - if (name) { - return new Error(`Illegal argument: ${name}`); - } - else { - return new Error('Illegal argument'); - } -} -function illegalState(name) { - if (name) { - return new Error(`Illegal state: ${name}`); - } - else { - return new Error('Illegal state'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/event.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/event.js ***! - \****************************************************************/ -/*! exports provided: Event, Emitter, PauseableEmitter, EventBufferer, Relay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return Event; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Emitter", function() { return Emitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PauseableEmitter", function() { return PauseableEmitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventBufferer", function() { return EventBufferer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Relay", function() { return Relay; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _linkedList_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -var Event; -(function (Event) { - Event.None = () => _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - /** - * Given an event, returns another event which only fires once. - */ - function once(event) { - return (listener, thisArgs = null, disposables) => { - // we need this, in case the event fires during the listener call - let didFire = false; - let result; - result = event(e => { - if (didFire) { - return; - } - else if (result) { - result.dispose(); - } - else { - didFire = true; - } - return listener.call(thisArgs, e); - }, null, disposables); - if (didFire) { - result.dispose(); - } - return result; - }; - } - Event.once = once; - /** - * Given an event and a `map` function, returns another event which maps each element - * through the mapping function. - */ - function map(event, map) { - return snapshot((listener, thisArgs = null, disposables) => event(i => listener.call(thisArgs, map(i)), null, disposables)); - } - Event.map = map; - /** - * Given an event and an `each` function, returns another identical event and calls - * the `each` function per each element. - */ - function forEach(event, each) { - return snapshot((listener, thisArgs = null, disposables) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables)); - } - Event.forEach = forEach; - function filter(event, filter) { - return snapshot((listener, thisArgs = null, disposables) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables)); - } - Event.filter = filter; - /** - * Given an event, returns the same event but typed as `Event`. - */ - function signal(event) { - return event; - } - Event.signal = signal; - function any(...events) { - return (listener, thisArgs = null, disposables) => Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["combinedDisposable"])(...events.map(event => event(e => listener.call(thisArgs, e), null, disposables))); - } - Event.any = any; - /** - * Given an event and a `merge` function, returns another event which maps each element - * and the cumulative result through the `merge` function. Similar to `map`, but with memory. - */ - function reduce(event, merge, initial) { - let output = initial; - return map(event, e => { - output = merge(output, e); - return output; - }); - } - Event.reduce = reduce; - /** - * Given a chain of event processing functions (filter, map, etc), each - * function will be invoked per event & per listener. Snapshotting an event - * chain allows each function to be invoked just once per event. - */ - function snapshot(event) { - let listener; - const emitter = new Emitter({ - onFirstListenerAdd() { - listener = event(emitter.fire, emitter); - }, - onLastListenerRemove() { - listener.dispose(); - } - }); - return emitter.event; - } - Event.snapshot = snapshot; - function debounce(event, merge, delay = 100, leading = false, leakWarningThreshold) { - let subscription; - let output = undefined; - let handle = undefined; - let numDebouncedCalls = 0; - const emitter = new Emitter({ - leakWarningThreshold, - onFirstListenerAdd() { - subscription = event(cur => { - numDebouncedCalls++; - output = merge(output, cur); - if (leading && !handle) { - emitter.fire(output); - output = undefined; - } - clearTimeout(handle); - handle = setTimeout(() => { - const _output = output; - output = undefined; - handle = undefined; - if (!leading || numDebouncedCalls > 1) { - emitter.fire(_output); - } - numDebouncedCalls = 0; - }, delay); - }); - }, - onLastListenerRemove() { - subscription.dispose(); - } - }); - return emitter.event; - } - Event.debounce = debounce; - /** - * Given an event, it returns another event which fires only once and as soon as - * the input event emits. The event data is the number of millis it took for the - * event to fire. - */ - function stopwatch(event) { - const start = new Date().getTime(); - return map(once(event), _ => new Date().getTime() - start); - } - Event.stopwatch = stopwatch; - /** - * Given an event, it returns another event which fires only when the event - * element changes. - */ - function latch(event) { - let firstCall = true; - let cache; - return filter(event, value => { - const shouldEmit = firstCall || value !== cache; - firstCall = false; - cache = value; - return shouldEmit; - }); - } - Event.latch = latch; - /** - * Buffers the provided event until a first listener comes - * along, at which point fire all the events at once and - * pipe the event from then on. - * - * ```typescript - * const emitter = new Emitter(); - * const event = emitter.event; - * const bufferedEvent = buffer(event); - * - * emitter.fire(1); - * emitter.fire(2); - * emitter.fire(3); - * // nothing... - * - * const listener = bufferedEvent(num => console.log(num)); - * // 1, 2, 3 - * - * emitter.fire(4); - * // 4 - * ``` - */ - function buffer(event, nextTick = false, _buffer = []) { - let buffer = _buffer.slice(); - let listener = event(e => { - if (buffer) { - buffer.push(e); - } - else { - emitter.fire(e); - } - }); - const flush = () => { - if (buffer) { - buffer.forEach(e => emitter.fire(e)); - } - buffer = null; - }; - const emitter = new Emitter({ - onFirstListenerAdd() { - if (!listener) { - listener = event(e => emitter.fire(e)); - } - }, - onFirstListenerDidAdd() { - if (buffer) { - if (nextTick) { - setTimeout(flush); - } - else { - flush(); - } - } - }, - onLastListenerRemove() { - if (listener) { - listener.dispose(); - } - listener = null; - } - }); - return emitter.event; - } - Event.buffer = buffer; - class ChainableEvent { - constructor(event) { - this.event = event; - } - map(fn) { - return new ChainableEvent(map(this.event, fn)); - } - forEach(fn) { - return new ChainableEvent(forEach(this.event, fn)); - } - filter(fn) { - return new ChainableEvent(filter(this.event, fn)); - } - reduce(merge, initial) { - return new ChainableEvent(reduce(this.event, merge, initial)); - } - latch() { - return new ChainableEvent(latch(this.event)); - } - debounce(merge, delay = 100, leading = false, leakWarningThreshold) { - return new ChainableEvent(debounce(this.event, merge, delay, leading, leakWarningThreshold)); - } - on(listener, thisArgs, disposables) { - return this.event(listener, thisArgs, disposables); - } - once(listener, thisArgs, disposables) { - return once(this.event)(listener, thisArgs, disposables); - } - } - function chain(event) { - return new ChainableEvent(event); - } - Event.chain = chain; - function fromNodeEventEmitter(emitter, eventName, map = id => id) { - const fn = (...args) => result.fire(map(...args)); - const onFirstListenerAdd = () => emitter.on(eventName, fn); - const onLastListenerRemove = () => emitter.removeListener(eventName, fn); - const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove }); - return result.event; - } - Event.fromNodeEventEmitter = fromNodeEventEmitter; - function fromDOMEventEmitter(emitter, eventName, map = id => id) { - const fn = (...args) => result.fire(map(...args)); - const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn); - const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn); - const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove }); - return result.event; - } - Event.fromDOMEventEmitter = fromDOMEventEmitter; - function fromPromise(promise) { - const emitter = new Emitter(); - let shouldEmit = false; - promise - .then(undefined, () => null) - .then(() => { - if (!shouldEmit) { - setTimeout(() => emitter.fire(undefined), 0); - } - else { - emitter.fire(undefined); - } - }); - shouldEmit = true; - return emitter.event; - } - Event.fromPromise = fromPromise; - function toPromise(event) { - return new Promise(c => once(event)(c)); - } - Event.toPromise = toPromise; -})(Event || (Event = {})); -let _globalLeakWarningThreshold = -1; -class LeakageMonitor { - constructor(customThreshold, name = Math.random().toString(18).slice(2, 5)) { - this.customThreshold = customThreshold; - this.name = name; - this._warnCountdown = 0; - } - dispose() { - if (this._stacks) { - this._stacks.clear(); - } - } - check(listenerCount) { - let threshold = _globalLeakWarningThreshold; - if (typeof this.customThreshold === 'number') { - threshold = this.customThreshold; - } - if (threshold <= 0 || listenerCount < threshold) { - return undefined; - } - if (!this._stacks) { - this._stacks = new Map(); - } - const stack = new Error().stack.split('\n').slice(3).join('\n'); - const count = (this._stacks.get(stack) || 0); - this._stacks.set(stack, count + 1); - this._warnCountdown -= 1; - if (this._warnCountdown <= 0) { - // only warn on first exceed and then every time the limit - // is exceeded by 50% again - this._warnCountdown = threshold * 0.5; - // find most frequent listener and print warning - let topStack; - let topCount = 0; - for (const [stack, count] of this._stacks) { - if (!topStack || topCount < count) { - topStack = stack; - topCount = count; - } - } - console.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`); - console.warn(topStack); - } - return () => { - const count = (this._stacks.get(stack) || 0); - this._stacks.set(stack, count - 1); - }; - } -} -/** - * The Emitter can be used to expose an Event to the public - * to fire it from the insides. - * Sample: - class Document { - - private readonly _onDidChange = new Emitter<(value:string)=>any>(); - - public onDidChange = this._onDidChange.event; - - // getter-style - // get onDidChange(): Event<(value:string)=>any> { - // return this._onDidChange.event; - // } - - private _doIt() { - //... - this._onDidChange.fire(value); - } - } - */ -class Emitter { - constructor(options) { - this._disposed = false; - this._options = options; - this._leakageMon = _globalLeakWarningThreshold > 0 - ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) - : undefined; - } - /** - * For the public to allow to subscribe - * to events from this Emitter - */ - get event() { - if (!this._event) { - this._event = (listener, thisArgs, disposables) => { - if (!this._listeners) { - this._listeners = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__["LinkedList"](); - } - const firstListener = this._listeners.isEmpty(); - if (firstListener && this._options && this._options.onFirstListenerAdd) { - this._options.onFirstListenerAdd(this); - } - const remove = this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); - if (firstListener && this._options && this._options.onFirstListenerDidAdd) { - this._options.onFirstListenerDidAdd(this); - } - if (this._options && this._options.onListenerDidAdd) { - this._options.onListenerDidAdd(this, listener, thisArgs); - } - // check and record this emitter for potential leakage - let removeMonitor; - if (this._leakageMon) { - removeMonitor = this._leakageMon.check(this._listeners.size); - } - let result; - result = { - dispose: () => { - if (removeMonitor) { - removeMonitor(); - } - result.dispose = Emitter._noop; - if (!this._disposed) { - remove(); - if (this._options && this._options.onLastListenerRemove) { - const hasListeners = (this._listeners && !this._listeners.isEmpty()); - if (!hasListeners) { - this._options.onLastListenerRemove(this); - } - } - } - } - }; - if (disposables instanceof _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["DisposableStore"]) { - disposables.add(result); - } - else if (Array.isArray(disposables)) { - disposables.push(result); - } - return result; - }; - } - return this._event; - } - /** - * To be kept private to fire an event to - * subscribers - */ - fire(event) { - if (this._listeners) { - // put all [listener,event]-pairs into delivery queue - // then emit all event. an inner/nested event might be - // the driver of this - if (!this._deliveryQueue) { - this._deliveryQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__["LinkedList"](); - } - for (let listener of this._listeners) { - this._deliveryQueue.push([listener, event]); - } - while (this._deliveryQueue.size > 0) { - const [listener, event] = this._deliveryQueue.shift(); - try { - if (typeof listener === 'function') { - listener.call(undefined, event); - } - else { - listener[0].call(listener[1], event); - } - } - catch (e) { - Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - } - } - } - } - dispose() { - if (this._listeners) { - this._listeners.clear(); - } - if (this._deliveryQueue) { - this._deliveryQueue.clear(); - } - if (this._leakageMon) { - this._leakageMon.dispose(); - } - this._disposed = true; - } -} -Emitter._noop = function () { }; -class PauseableEmitter extends Emitter { - constructor(options) { - super(options); - this._isPaused = 0; - this._eventQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__["LinkedList"](); - this._mergeFn = options && options.merge; - } - pause() { - this._isPaused++; - } - resume() { - if (this._isPaused !== 0 && --this._isPaused === 0) { - if (this._mergeFn) { - // use the merge function to create a single composite - // event. make a copy in case firing pauses this emitter - const events = this._eventQueue.toArray(); - this._eventQueue.clear(); - super.fire(this._mergeFn(events)); - } - else { - // no merging, fire each event individually and test - // that this emitter isn't paused halfway through - while (!this._isPaused && this._eventQueue.size !== 0) { - super.fire(this._eventQueue.shift()); - } - } - } - } - fire(event) { - if (this._listeners) { - if (this._isPaused !== 0) { - this._eventQueue.push(event); - } - else { - super.fire(event); - } - } - } -} -/** - * The EventBufferer is useful in situations in which you want - * to delay firing your events during some code. - * You can wrap that code and be sure that the event will not - * be fired during that wrap. - * - * ``` - * const emitter: Emitter; - * const delayer = new EventDelayer(); - * const delayedEvent = delayer.wrapEvent(emitter.event); - * - * delayedEvent(console.log); - * - * delayer.bufferEvents(() => { - * emitter.fire(); // event will not be fired yet - * }); - * - * // event will only be fired at this point - * ``` - */ -class EventBufferer { - constructor() { - this.buffers = []; - } - wrapEvent(event) { - return (listener, thisArgs, disposables) => { - return event(i => { - const buffer = this.buffers[this.buffers.length - 1]; - if (buffer) { - buffer.push(() => listener.call(thisArgs, i)); - } - else { - listener.call(thisArgs, i); - } - }, undefined, disposables); - }; - } - bufferEvents(fn) { - const buffer = []; - this.buffers.push(buffer); - const r = fn(); - this.buffers.pop(); - buffer.forEach(flush => flush()); - return r; - } -} -/** - * A Relay is an event forwarder which functions as a replugabble event pipe. - * Once created, you can connect an input event to it and it will simply forward - * events from that input event through its own `event` property. The `input` - * can be changed at any point in time. - */ -class Relay { - constructor() { - this.listening = false; - this.inputEvent = Event.None; - this.inputEventListener = _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"].None; - this.emitter = new Emitter({ - onFirstListenerDidAdd: () => { - this.listening = true; - this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter); - }, - onLastListenerRemove: () => { - this.listening = false; - this.inputEventListener.dispose(); - } - }); - this.event = this.emitter.event; - } - set input(event) { - this.inputEvent = event; - if (this.listening) { - this.inputEventListener.dispose(); - this.inputEventListener = event(this.emitter.fire, this.emitter); - } - } - dispose() { - this.inputEventListener.dispose(); - this.emitter.dispose(); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/hash.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/hash.js ***! - \***************************************************************/ -/*! exports provided: hash, doHash, stringHash, StringSHA1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hash", function() { return hash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doHash", function() { return doHash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringHash", function() { return stringHash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringSHA1", function() { return StringSHA1; }); -/* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * Return a hash value for an object. - */ -function hash(obj) { - return doHash(obj, 0); -} -function doHash(obj, hashVal) { - switch (typeof obj) { - case 'object': - if (obj === null) { - return numberHash(349, hashVal); - } - else if (Array.isArray(obj)) { - return arrayHash(obj, hashVal); - } - return objectHash(obj, hashVal); - case 'string': - return stringHash(obj, hashVal); - case 'boolean': - return booleanHash(obj, hashVal); - case 'number': - return numberHash(obj, hashVal); - case 'undefined': - return numberHash(937, hashVal); - default: - return numberHash(617, hashVal); - } -} -function numberHash(val, initialHashVal) { - return (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32 -} -function booleanHash(b, initialHashVal) { - return numberHash(b ? 433 : 863, initialHashVal); -} -function stringHash(s, hashVal) { - hashVal = numberHash(149417, hashVal); - for (let i = 0, length = s.length; i < length; i++) { - hashVal = numberHash(s.charCodeAt(i), hashVal); - } - return hashVal; -} -function arrayHash(arr, initialHashVal) { - initialHashVal = numberHash(104579, initialHashVal); - return arr.reduce((hashVal, item) => doHash(item, hashVal), initialHashVal); -} -function objectHash(obj, initialHashVal) { - initialHashVal = numberHash(181387, initialHashVal); - return Object.keys(obj).sort().reduce((hashVal, key) => { - hashVal = stringHash(key, hashVal); - return doHash(obj[key], hashVal); - }, initialHashVal); -} -function leftRotate(value, bits, totalBits = 32) { - // delta + bits = totalBits - const delta = totalBits - bits; - // All ones, expect `delta` zeros aligned to the right - const mask = ~((1 << delta) - 1); - // Join (value left-shifted `bits` bits) with (masked value right-shifted `delta` bits) - return ((value << bits) | ((mask & value) >>> delta)) >>> 0; -} -function fill(dest, index = 0, count = dest.byteLength, value = 0) { - for (let i = 0; i < count; i++) { - dest[index + i] = value; - } -} -function leftPad(value, length, char = '0') { - while (value.length < length) { - value = char + value; - } - return value; -} -function toHexString(value, bitsize = 32) { - return leftPad((value >>> 0).toString(16), bitsize / 4); -} -/** - * A SHA1 implementation that works with strings and does not allocate. - */ -class StringSHA1 { - constructor() { - this._h0 = 0x67452301; - this._h1 = 0xEFCDAB89; - this._h2 = 0x98BADCFE; - this._h3 = 0x10325476; - this._h4 = 0xC3D2E1F0; - this._buff = new Uint8Array(64 /* BLOCK_SIZE */ + 3 /* to fit any utf-8 */); - this._buffDV = new DataView(this._buff.buffer); - this._buffLen = 0; - this._totalLen = 0; - this._leftoverHighSurrogate = 0; - this._finished = false; - } - update(str) { - const strLen = str.length; - if (strLen === 0) { - return; - } - const buff = this._buff; - let buffLen = this._buffLen; - let leftoverHighSurrogate = this._leftoverHighSurrogate; - let charCode; - let offset; - if (leftoverHighSurrogate !== 0) { - charCode = leftoverHighSurrogate; - offset = -1; - leftoverHighSurrogate = 0; - } - else { - charCode = str.charCodeAt(0); - offset = 0; - } - while (true) { - let codePoint = charCode; - if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["isHighSurrogate"](charCode)) { - if (offset + 1 < strLen) { - const nextCharCode = str.charCodeAt(offset + 1); - if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["isLowSurrogate"](nextCharCode)) { - offset++; - codePoint = _strings_js__WEBPACK_IMPORTED_MODULE_0__["computeCodePoint"](charCode, nextCharCode); - } - else { - // illegal => unicode replacement character - codePoint = 65533 /* UNICODE_REPLACEMENT */; - } - } - else { - // last character is a surrogate pair - leftoverHighSurrogate = charCode; - break; - } - } - else if (_strings_js__WEBPACK_IMPORTED_MODULE_0__["isLowSurrogate"](charCode)) { - // illegal => unicode replacement character - codePoint = 65533 /* UNICODE_REPLACEMENT */; - } - buffLen = this._push(buff, buffLen, codePoint); - offset++; - if (offset < strLen) { - charCode = str.charCodeAt(offset); - } - else { - break; - } - } - this._buffLen = buffLen; - this._leftoverHighSurrogate = leftoverHighSurrogate; - } - _push(buff, buffLen, codePoint) { - if (codePoint < 0x0080) { - buff[buffLen++] = codePoint; - } - else if (codePoint < 0x0800) { - buff[buffLen++] = 0b11000000 | ((codePoint & 0b00000000000000000000011111000000) >>> 6); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0); - } - else if (codePoint < 0x10000) { - buff[buffLen++] = 0b11100000 | ((codePoint & 0b00000000000000001111000000000000) >>> 12); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0); - } - else { - buff[buffLen++] = 0b11110000 | ((codePoint & 0b00000000000111000000000000000000) >>> 18); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000111111000000000000) >>> 12); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6); - buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0); - } - if (buffLen >= 64 /* BLOCK_SIZE */) { - this._step(); - buffLen -= 64 /* BLOCK_SIZE */; - this._totalLen += 64 /* BLOCK_SIZE */; - // take last 3 in case of UTF8 overflow - buff[0] = buff[64 /* BLOCK_SIZE */ + 0]; - buff[1] = buff[64 /* BLOCK_SIZE */ + 1]; - buff[2] = buff[64 /* BLOCK_SIZE */ + 2]; - } - return buffLen; - } - digest() { - if (!this._finished) { - this._finished = true; - if (this._leftoverHighSurrogate) { - // illegal => unicode replacement character - this._leftoverHighSurrogate = 0; - this._buffLen = this._push(this._buff, this._buffLen, 65533 /* UNICODE_REPLACEMENT */); - } - this._totalLen += this._buffLen; - this._wrapUp(); - } - return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4); - } - _wrapUp() { - this._buff[this._buffLen++] = 0x80; - fill(this._buff, this._buffLen); - if (this._buffLen > 56) { - this._step(); - fill(this._buff); - } - // this will fit because the mantissa can cover up to 52 bits - const ml = 8 * this._totalLen; - this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false); - this._buffDV.setUint32(60, ml % 4294967296, false); - this._step(); - } - _step() { - const bigBlock32 = StringSHA1._bigBlock32; - const data = this._buffDV; - for (let j = 0; j < 64 /* 16*4 */; j += 4) { - bigBlock32.setUint32(j, data.getUint32(j, false), false); - } - for (let j = 64; j < 320 /* 80*4 */; j += 4) { - bigBlock32.setUint32(j, leftRotate((bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false)), 1), false); - } - let a = this._h0; - let b = this._h1; - let c = this._h2; - let d = this._h3; - let e = this._h4; - let f, k; - let temp; - for (let j = 0; j < 80; j++) { - if (j < 20) { - f = (b & c) | ((~b) & d); - k = 0x5A827999; - } - else if (j < 40) { - f = b ^ c ^ d; - k = 0x6ED9EBA1; - } - else if (j < 60) { - f = (b & c) | (b & d) | (c & d); - k = 0x8F1BBCDC; - } - else { - f = b ^ c ^ d; - k = 0xCA62C1D6; - } - temp = (leftRotate(a, 5) + f + e + k + bigBlock32.getUint32(j * 4, false)) & 0xffffffff; - e = d; - d = c; - c = leftRotate(b, 30); - b = a; - a = temp; - } - this._h0 = (this._h0 + a) & 0xffffffff; - this._h1 = (this._h1 + b) & 0xffffffff; - this._h2 = (this._h2 + c) & 0xffffffff; - this._h3 = (this._h3 + d) & 0xffffffff; - this._h4 = (this._h4 + e) & 0xffffffff; - } -} -StringSHA1._bigBlock32 = new DataView(new ArrayBuffer(320)); // 80 * 4 = 320 - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/iterator.js ***! - \*******************************************************************/ -/*! exports provided: Iterable */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Iterable", function() { return Iterable; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Iterable; -(function (Iterable) { - function is(thing) { - return thing && typeof thing === 'object' && typeof thing[Symbol.iterator] === 'function'; - } - Iterable.is = is; - const _empty = Object.freeze([]); - function empty() { - return _empty; - } - Iterable.empty = empty; - function* single(element) { - yield element; - } - Iterable.single = single; - function from(iterable) { - return iterable || _empty; - } - Iterable.from = from; - function first(iterable) { - return iterable[Symbol.iterator]().next().value; - } - Iterable.first = first; - function some(iterable, predicate) { - for (const element of iterable) { - if (predicate(element)) { - return true; - } - } - return false; - } - Iterable.some = some; - function* filter(iterable, predicate) { - for (const element of iterable) { - if (predicate(element)) { - yield element; - } - } - } - Iterable.filter = filter; - function* map(iterable, fn) { - for (const element of iterable) { - yield fn(element); - } - } - Iterable.map = map; - function* concat(...iterables) { - for (const iterable of iterables) { - for (const element of iterable) { - yield element; - } - } - } - Iterable.concat = concat; - /** - * Consumes `atMost` elements from iterable and returns the consumed elements, - * and an iterable for the rest of the elements. - */ - function consume(iterable, atMost = Number.POSITIVE_INFINITY) { - const consumed = []; - if (atMost === 0) { - return [consumed, iterable]; - } - const iterator = iterable[Symbol.iterator](); - for (let i = 0; i < atMost; i++) { - const next = iterator.next(); - if (next.done) { - return [consumed, Iterable.empty()]; - } - consumed.push(next.value); - } - return [consumed, { [Symbol.iterator]() { return iterator; } }]; - } - Iterable.consume = consume; -})(Iterable || (Iterable = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js ***! - \*******************************************************************/ -/*! exports provided: KeyCodeUtils, KeyChord, createKeybinding, createSimpleKeybinding, SimpleKeybinding, ChordKeybinding, ResolvedKeybindingPart, ResolvedKeybinding */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCodeUtils", function() { return KeyCodeUtils; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyChord", function() { return KeyChord; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createKeybinding", function() { return createKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleKeybinding", function() { return createSimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleKeybinding", function() { return SimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChordKeybinding", function() { return ChordKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybindingPart", function() { return ResolvedKeybindingPart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybinding", function() { return ResolvedKeybinding; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class KeyCodeStrMap { - constructor() { - this._keyCodeToStr = []; - this._strToKeyCode = Object.create(null); - } - define(keyCode, str) { - this._keyCodeToStr[keyCode] = str; - this._strToKeyCode[str.toLowerCase()] = keyCode; - } - keyCodeToStr(keyCode) { - return this._keyCodeToStr[keyCode]; - } - strToKeyCode(str) { - return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; - } -} -const uiMap = new KeyCodeStrMap(); -const userSettingsUSMap = new KeyCodeStrMap(); -const userSettingsGeneralMap = new KeyCodeStrMap(); -(function () { - function define(keyCode, uiLabel, usUserSettingsLabel = uiLabel, generalUserSettingsLabel = usUserSettingsLabel) { - uiMap.define(keyCode, uiLabel); - userSettingsUSMap.define(keyCode, usUserSettingsLabel); - userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); - } - define(0 /* Unknown */, 'unknown'); - define(1 /* Backspace */, 'Backspace'); - define(2 /* Tab */, 'Tab'); - define(3 /* Enter */, 'Enter'); - define(4 /* Shift */, 'Shift'); - define(5 /* Ctrl */, 'Ctrl'); - define(6 /* Alt */, 'Alt'); - define(7 /* PauseBreak */, 'PauseBreak'); - define(8 /* CapsLock */, 'CapsLock'); - define(9 /* Escape */, 'Escape'); - define(10 /* Space */, 'Space'); - define(11 /* PageUp */, 'PageUp'); - define(12 /* PageDown */, 'PageDown'); - define(13 /* End */, 'End'); - define(14 /* Home */, 'Home'); - define(15 /* LeftArrow */, 'LeftArrow', 'Left'); - define(16 /* UpArrow */, 'UpArrow', 'Up'); - define(17 /* RightArrow */, 'RightArrow', 'Right'); - define(18 /* DownArrow */, 'DownArrow', 'Down'); - define(19 /* Insert */, 'Insert'); - define(20 /* Delete */, 'Delete'); - define(21 /* KEY_0 */, '0'); - define(22 /* KEY_1 */, '1'); - define(23 /* KEY_2 */, '2'); - define(24 /* KEY_3 */, '3'); - define(25 /* KEY_4 */, '4'); - define(26 /* KEY_5 */, '5'); - define(27 /* KEY_6 */, '6'); - define(28 /* KEY_7 */, '7'); - define(29 /* KEY_8 */, '8'); - define(30 /* KEY_9 */, '9'); - define(31 /* KEY_A */, 'A'); - define(32 /* KEY_B */, 'B'); - define(33 /* KEY_C */, 'C'); - define(34 /* KEY_D */, 'D'); - define(35 /* KEY_E */, 'E'); - define(36 /* KEY_F */, 'F'); - define(37 /* KEY_G */, 'G'); - define(38 /* KEY_H */, 'H'); - define(39 /* KEY_I */, 'I'); - define(40 /* KEY_J */, 'J'); - define(41 /* KEY_K */, 'K'); - define(42 /* KEY_L */, 'L'); - define(43 /* KEY_M */, 'M'); - define(44 /* KEY_N */, 'N'); - define(45 /* KEY_O */, 'O'); - define(46 /* KEY_P */, 'P'); - define(47 /* KEY_Q */, 'Q'); - define(48 /* KEY_R */, 'R'); - define(49 /* KEY_S */, 'S'); - define(50 /* KEY_T */, 'T'); - define(51 /* KEY_U */, 'U'); - define(52 /* KEY_V */, 'V'); - define(53 /* KEY_W */, 'W'); - define(54 /* KEY_X */, 'X'); - define(55 /* KEY_Y */, 'Y'); - define(56 /* KEY_Z */, 'Z'); - define(57 /* Meta */, 'Meta'); - define(58 /* ContextMenu */, 'ContextMenu'); - define(59 /* F1 */, 'F1'); - define(60 /* F2 */, 'F2'); - define(61 /* F3 */, 'F3'); - define(62 /* F4 */, 'F4'); - define(63 /* F5 */, 'F5'); - define(64 /* F6 */, 'F6'); - define(65 /* F7 */, 'F7'); - define(66 /* F8 */, 'F8'); - define(67 /* F9 */, 'F9'); - define(68 /* F10 */, 'F10'); - define(69 /* F11 */, 'F11'); - define(70 /* F12 */, 'F12'); - define(71 /* F13 */, 'F13'); - define(72 /* F14 */, 'F14'); - define(73 /* F15 */, 'F15'); - define(74 /* F16 */, 'F16'); - define(75 /* F17 */, 'F17'); - define(76 /* F18 */, 'F18'); - define(77 /* F19 */, 'F19'); - define(78 /* NumLock */, 'NumLock'); - define(79 /* ScrollLock */, 'ScrollLock'); - define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); - define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); - define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); - define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); - define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); - define(85 /* US_SLASH */, '/', '/', 'OEM_2'); - define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); - define(110 /* ABNT_C1 */, 'ABNT_C1'); - define(111 /* ABNT_C2 */, 'ABNT_C2'); - define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); - define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); - define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); - define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); - define(91 /* OEM_8 */, 'OEM_8'); - define(92 /* OEM_102 */, 'OEM_102'); - define(93 /* NUMPAD_0 */, 'NumPad0'); - define(94 /* NUMPAD_1 */, 'NumPad1'); - define(95 /* NUMPAD_2 */, 'NumPad2'); - define(96 /* NUMPAD_3 */, 'NumPad3'); - define(97 /* NUMPAD_4 */, 'NumPad4'); - define(98 /* NUMPAD_5 */, 'NumPad5'); - define(99 /* NUMPAD_6 */, 'NumPad6'); - define(100 /* NUMPAD_7 */, 'NumPad7'); - define(101 /* NUMPAD_8 */, 'NumPad8'); - define(102 /* NUMPAD_9 */, 'NumPad9'); - define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); - define(104 /* NUMPAD_ADD */, 'NumPad_Add'); - define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); - define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); - define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); - define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); -})(); -var KeyCodeUtils; -(function (KeyCodeUtils) { - function toString(keyCode) { - return uiMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toString = toString; - function fromString(key) { - return uiMap.strToKeyCode(key); - } - KeyCodeUtils.fromString = fromString; - function toUserSettingsUS(keyCode) { - return userSettingsUSMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; - function toUserSettingsGeneral(keyCode) { - return userSettingsGeneralMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; - function fromUserSettings(key) { - return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); - } - KeyCodeUtils.fromUserSettings = fromUserSettings; -})(KeyCodeUtils || (KeyCodeUtils = {})); -function KeyChord(firstPart, secondPart) { - const chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; - return (firstPart | chordPart) >>> 0; -} -function createKeybinding(keybinding, OS) { - if (keybinding === 0) { - return null; - } - const firstPart = (keybinding & 0x0000FFFF) >>> 0; - const chordPart = (keybinding & 0xFFFF0000) >>> 16; - if (chordPart !== 0) { - return new ChordKeybinding([ - createSimpleKeybinding(firstPart, OS), - createSimpleKeybinding(chordPart, OS) - ]); - } - return new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); -} -function createSimpleKeybinding(keybinding, OS) { - const ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); - const winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); - const ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); - const shiftKey = (keybinding & 1024 /* Shift */ ? true : false); - const altKey = (keybinding & 512 /* Alt */ ? true : false); - const metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); - const keyCode = (keybinding & 255 /* KeyCode */); - return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); -} -class SimpleKeybinding { - constructor(ctrlKey, shiftKey, altKey, metaKey, keyCode) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyCode = keyCode; - } - equals(other) { - return (this.ctrlKey === other.ctrlKey - && this.shiftKey === other.shiftKey - && this.altKey === other.altKey - && this.metaKey === other.metaKey - && this.keyCode === other.keyCode); - } - isModifierKey() { - return (this.keyCode === 0 /* Unknown */ - || this.keyCode === 5 /* Ctrl */ - || this.keyCode === 57 /* Meta */ - || this.keyCode === 6 /* Alt */ - || this.keyCode === 4 /* Shift */); - } - toChord() { - return new ChordKeybinding([this]); - } - /** - * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? - */ - isDuplicateModifierCase() { - return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) - || (this.shiftKey && this.keyCode === 4 /* Shift */) - || (this.altKey && this.keyCode === 6 /* Alt */) - || (this.metaKey && this.keyCode === 57 /* Meta */)); - } -} -class ChordKeybinding { - constructor(parts) { - if (parts.length === 0) { - throw Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["illegalArgument"])(`parts`); - } - this.parts = parts; - } -} -class ResolvedKeybindingPart { - constructor(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyLabel = kbLabel; - this.keyAriaLabel = kbAriaLabel; - } -} -/** - * A resolved keybinding. Can be a simple keybinding or a chord keybinding. - */ -class ResolvedKeybinding { -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js ***! - \********************************************************************/ -/*! exports provided: MultiDisposeError, isDisposable, dispose, combinedDisposable, toDisposable, DisposableStore, Disposable, MutableDisposable, ImmortalReference */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiDisposeError", function() { return MultiDisposeError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDisposable", function() { return isDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispose", function() { return dispose; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combinedDisposable", function() { return combinedDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDisposable", function() { return toDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DisposableStore", function() { return DisposableStore; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Disposable", function() { return Disposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MutableDisposable", function() { return MutableDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImmortalReference", function() { return ImmortalReference; }); -/* harmony import */ var _iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); - -/** - * Enables logging of potentially leaked disposables. - * - * A disposable is considered leaked if it is not disposed or not registered as the child of - * another disposable. This tracking is very simple an only works for classes that either - * extend Disposable or use a DisposableStore. This means there are a lot of false positives. - */ -const TRACK_DISPOSABLES = false; -const __is_disposable_tracked__ = '__is_disposable_tracked__'; -function markTracked(x) { - if (!TRACK_DISPOSABLES) { - return; - } - if (x && x !== Disposable.None) { - try { - x[__is_disposable_tracked__] = true; - } - catch (_a) { - // noop - } - } -} -function trackDisposable(x) { - if (!TRACK_DISPOSABLES) { - return x; - } - const stack = new Error('Potentially leaked disposable').stack; - setTimeout(() => { - if (!x[__is_disposable_tracked__]) { - console.log(stack); - } - }, 3000); - return x; -} -class MultiDisposeError extends Error { - constructor(errors) { - super(`Encounter errors while disposing of store. Errors: [${errors.join(', ')}]`); - this.errors = errors; - } -} -function isDisposable(thing) { - return typeof thing.dispose === 'function' && thing.dispose.length === 0; -} -function dispose(arg) { - if (_iterator_js__WEBPACK_IMPORTED_MODULE_0__["Iterable"].is(arg)) { - let errors = []; - for (const d of arg) { - if (d) { - markTracked(d); - try { - d.dispose(); - } - catch (e) { - errors.push(e); - } - } - } - if (errors.length === 1) { - throw errors[0]; - } - else if (errors.length > 1) { - throw new MultiDisposeError(errors); - } - return Array.isArray(arg) ? [] : arg; - } - else if (arg) { - markTracked(arg); - arg.dispose(); - return arg; - } -} -function combinedDisposable(...disposables) { - disposables.forEach(markTracked); - return trackDisposable({ dispose: () => dispose(disposables) }); -} -function toDisposable(fn) { - const self = trackDisposable({ - dispose: () => { - markTracked(self); - fn(); - } - }); - return self; -} -class DisposableStore { - constructor() { - this._toDispose = new Set(); - this._isDisposed = false; - } - /** - * Dispose of all registered disposables and mark this object as disposed. - * - * Any future disposables added to this object will be disposed of on `add`. - */ - dispose() { - if (this._isDisposed) { - return; - } - markTracked(this); - this._isDisposed = true; - this.clear(); - } - /** - * Dispose of all registered disposables but do not mark this object as disposed. - */ - clear() { - try { - dispose(this._toDispose.values()); - } - finally { - this._toDispose.clear(); - } - } - add(t) { - if (!t) { - return t; - } - if (t === this) { - throw new Error('Cannot register a disposable on itself!'); - } - markTracked(t); - if (this._isDisposed) { - if (!DisposableStore.DISABLE_DISPOSED_WARNING) { - console.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack); - } - } - else { - this._toDispose.add(t); - } - return t; - } -} -DisposableStore.DISABLE_DISPOSED_WARNING = false; -class Disposable { - constructor() { - this._store = new DisposableStore(); - trackDisposable(this); - } - dispose() { - markTracked(this); - this._store.dispose(); - } - _register(t) { - if (t === this) { - throw new Error('Cannot register a disposable on itself!'); - } - return this._store.add(t); - } -} -Disposable.None = Object.freeze({ dispose() { } }); -/** - * Manages the lifecycle of a disposable value that may be changed. - * - * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can - * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up. - */ -class MutableDisposable { - constructor() { - this._isDisposed = false; - trackDisposable(this); - } - get value() { - return this._isDisposed ? undefined : this._value; - } - set value(value) { - if (this._isDisposed || value === this._value) { - return; - } - if (this._value) { - this._value.dispose(); - } - if (value) { - markTracked(value); - } - this._value = value; - } - clear() { - this.value = undefined; - } - dispose() { - this._isDisposed = true; - markTracked(this); - if (this._value) { - this._value.dispose(); - } - this._value = undefined; - } -} -class ImmortalReference { - constructor(object) { - this.object = object; - } - dispose() { } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js ***! - \*********************************************************************/ -/*! exports provided: LinkedList */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedList", function() { return LinkedList; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class Node { - constructor(element) { - this.element = element; - this.next = Node.Undefined; - this.prev = Node.Undefined; - } -} -Node.Undefined = new Node(undefined); -class LinkedList { - constructor() { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - } - get size() { - return this._size; - } - isEmpty() { - return this._first === Node.Undefined; - } - clear() { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - } - unshift(element) { - return this._insert(element, false); - } - push(element) { - return this._insert(element, true); - } - _insert(element, atTheEnd) { - const newNode = new Node(element); - if (this._first === Node.Undefined) { - this._first = newNode; - this._last = newNode; - } - else if (atTheEnd) { - // push - const oldLast = this._last; - this._last = newNode; - newNode.prev = oldLast; - oldLast.next = newNode; - } - else { - // unshift - const oldFirst = this._first; - this._first = newNode; - newNode.next = oldFirst; - oldFirst.prev = newNode; - } - this._size += 1; - let didRemove = false; - return () => { - if (!didRemove) { - didRemove = true; - this._remove(newNode); - } - }; - } - shift() { - if (this._first === Node.Undefined) { - return undefined; - } - else { - const res = this._first.element; - this._remove(this._first); - return res; - } - } - pop() { - if (this._last === Node.Undefined) { - return undefined; - } - else { - const res = this._last.element; - this._remove(this._last); - return res; - } - } - _remove(node) { - if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { - // middle - const anchor = node.prev; - anchor.next = node.next; - node.next.prev = anchor; - } - else if (node.prev === Node.Undefined && node.next === Node.Undefined) { - // only node - this._first = Node.Undefined; - this._last = Node.Undefined; - } - else if (node.next === Node.Undefined) { - // last - this._last = this._last.prev; - this._last.next = Node.Undefined; - } - else if (node.prev === Node.Undefined) { - // first - this._first = this._first.next; - this._first.prev = Node.Undefined; - } - // done - this._size -= 1; - } - *[Symbol.iterator]() { - let node = this._first; - while (node !== Node.Undefined) { - yield node.element; - node = node.next; - } - } - toArray() { - const result = []; - for (let node = this._first; node !== Node.Undefined; node = node.next) { - result.push(node.element); - } - return result; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/path.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/path.js ***! - \***************************************************************/ -/*! exports provided: win32, posix, normalize, resolve, relative, dirname, basename, extname, sep */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "win32", function() { return win32; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "posix", function() { return posix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalize", function() { return normalize; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resolve", function() { return resolve; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relative", function() { return relative; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dirname", function() { return dirname; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basename", function() { return basename; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extname", function() { return extname; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sep", function() { return sep; }); -/* harmony import */ var _process_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./process.js */ "./node_modules/monaco-editor/esm/vs/base/common/process.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// NOTE: VSCode's copy of nodejs path library to be usable in common (non-node) namespace -// Copied from: https://github.com/nodejs/node/blob/v12.8.1/lib/path.js -/** - * Copyright Joyent, Inc. and other Node contributors. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to permit - * persons to whom the Software is furnished to do so, subject to the - * following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -const CHAR_UPPERCASE_A = 65; /* A */ -const CHAR_LOWERCASE_A = 97; /* a */ -const CHAR_UPPERCASE_Z = 90; /* Z */ -const CHAR_LOWERCASE_Z = 122; /* z */ -const CHAR_DOT = 46; /* . */ -const CHAR_FORWARD_SLASH = 47; /* / */ -const CHAR_BACKWARD_SLASH = 92; /* \ */ -const CHAR_COLON = 58; /* : */ -const CHAR_QUESTION_MARK = 63; /* ? */ -class ErrorInvalidArgType extends Error { - constructor(name, expected, actual) { - // determiner: 'must be' or 'must not be' - let determiner; - if (typeof expected === 'string' && expected.indexOf('not ') === 0) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } - else { - determiner = 'must be'; - } - const type = name.indexOf('.') !== -1 ? 'property' : 'argument'; - let msg = `The "${name}" ${type} ${determiner} of type ${expected}`; - msg += `. Received type ${typeof actual}`; - super(msg); - this.code = 'ERR_INVALID_ARG_TYPE'; - } -} -function validateString(value, name) { - if (typeof value !== 'string') { - throw new ErrorInvalidArgType(name, 'string', value); - } -} -function isPathSeparator(code) { - return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; -} -function isPosixPathSeparator(code) { - return code === CHAR_FORWARD_SLASH; -} -function isWindowsDeviceRoot(code) { - return code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z || - code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z; -} -// Resolves . and .. elements in a path with directory names -function normalizeString(path, allowAboveRoot, separator, isPathSeparator) { - let res = ''; - let lastSegmentLength = 0; - let lastSlash = -1; - let dots = 0; - let code = 0; - for (let i = 0; i <= path.length; ++i) { - if (i < path.length) { - code = path.charCodeAt(i); - } - else if (isPathSeparator(code)) { - break; - } - else { - code = CHAR_FORWARD_SLASH; - } - if (isPathSeparator(code)) { - if (lastSlash === i - 1 || dots === 1) { - // NOOP - } - else if (dots === 2) { - if (res.length < 2 || lastSegmentLength !== 2 || - res.charCodeAt(res.length - 1) !== CHAR_DOT || - res.charCodeAt(res.length - 2) !== CHAR_DOT) { - if (res.length > 2) { - const lastSlashIndex = res.lastIndexOf(separator); - if (lastSlashIndex === -1) { - res = ''; - lastSegmentLength = 0; - } - else { - res = res.slice(0, lastSlashIndex); - lastSegmentLength = res.length - 1 - res.lastIndexOf(separator); - } - lastSlash = i; - dots = 0; - continue; - } - else if (res.length !== 0) { - res = ''; - lastSegmentLength = 0; - lastSlash = i; - dots = 0; - continue; - } - } - if (allowAboveRoot) { - res += res.length > 0 ? `${separator}..` : '..'; - lastSegmentLength = 2; - } - } - else { - if (res.length > 0) { - res += `${separator}${path.slice(lastSlash + 1, i)}`; - } - else { - res = path.slice(lastSlash + 1, i); - } - lastSegmentLength = i - lastSlash - 1; - } - lastSlash = i; - dots = 0; - } - else if (code === CHAR_DOT && dots !== -1) { - ++dots; - } - else { - dots = -1; - } - } - return res; -} -function _format(sep, pathObject) { - if (pathObject === null || typeof pathObject !== 'object') { - throw new ErrorInvalidArgType('pathObject', 'Object', pathObject); - } - const dir = pathObject.dir || pathObject.root; - const base = pathObject.base || - `${pathObject.name || ''}${pathObject.ext || ''}`; - if (!dir) { - return base; - } - return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep}${base}`; -} -const win32 = { - // path.resolve([from ...], to) - resolve(...pathSegments) { - let resolvedDevice = ''; - let resolvedTail = ''; - let resolvedAbsolute = false; - for (let i = pathSegments.length - 1; i >= -1; i--) { - let path; - if (i >= 0) { - path = pathSegments[i]; - validateString(path, 'path'); - // Skip empty entries - if (path.length === 0) { - continue; - } - } - else if (resolvedDevice.length === 0) { - path = _process_js__WEBPACK_IMPORTED_MODULE_0__["cwd"](); - } - else { - // Windows has the concept of drive-specific current working - // directories. If we've resolved a drive letter but not yet an - // absolute path, get cwd for that drive, or the process cwd if - // the drive cwd is not available. We're sure the device is not - // a UNC path at this points, because UNC paths are always absolute. - path = _process_js__WEBPACK_IMPORTED_MODULE_0__["env"][`=${resolvedDevice}`] || _process_js__WEBPACK_IMPORTED_MODULE_0__["cwd"](); - // Verify that a cwd was found and that it actually points - // to our drive. If not, default to the drive's root. - if (path === undefined || - path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() && - path.charCodeAt(2) === CHAR_BACKWARD_SLASH) { - path = `${resolvedDevice}\\`; - } - } - const len = path.length; - let rootEnd = 0; - let device = ''; - let isAbsolute = false; - const code = path.charCodeAt(0); - // Try to match a root - if (len === 1) { - if (isPathSeparator(code)) { - // `path` contains just a path separator - rootEnd = 1; - isAbsolute = true; - } - } - else if (isPathSeparator(code)) { - // Possible UNC root - // If we started with a separator, we know we at least have an - // absolute path of some kind (UNC or otherwise) - isAbsolute = true; - if (isPathSeparator(path.charCodeAt(1))) { - // Matched double path separator at beginning - let j = 2; - let last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - const firstPart = path.slice(last, j); - // Matched! - last = j; - // Match 1 or more path separators - while (j < len && isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j === len || j !== last) { - // We matched a UNC root - device = `\\\\${firstPart}\\${path.slice(last, j)}`; - rootEnd = j; - } - } - } - } - else { - rootEnd = 1; - } - } - else if (isWindowsDeviceRoot(code) && - path.charCodeAt(1) === CHAR_COLON) { - // Possible device root - device = path.slice(0, 2); - rootEnd = 2; - if (len > 2 && isPathSeparator(path.charCodeAt(2))) { - // Treat separator following drive name as an absolute path - // indicator - isAbsolute = true; - rootEnd = 3; - } - } - if (device.length > 0) { - if (resolvedDevice.length > 0) { - if (device.toLowerCase() !== resolvedDevice.toLowerCase()) { - // This path points to another device so it is not applicable - continue; - } - } - else { - resolvedDevice = device; - } - } - if (resolvedAbsolute) { - if (resolvedDevice.length > 0) { - break; - } - } - else { - resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`; - resolvedAbsolute = isAbsolute; - if (isAbsolute && resolvedDevice.length > 0) { - break; - } - } - } - // At this point the path should be resolved to a full absolute path, - // but handle relative paths to be safe (might happen when process.cwd() - // fails) - // Normalize the tail path - resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparator); - return resolvedAbsolute ? - `${resolvedDevice}\\${resolvedTail}` : - `${resolvedDevice}${resolvedTail}` || '.'; - }, - normalize(path) { - validateString(path, 'path'); - const len = path.length; - if (len === 0) { - return '.'; - } - let rootEnd = 0; - let device; - let isAbsolute = false; - const code = path.charCodeAt(0); - // Try to match a root - if (len === 1) { - // `path` contains just a single char, exit early to avoid - // unnecessary work - return isPosixPathSeparator(code) ? '\\' : path; - } - if (isPathSeparator(code)) { - // Possible UNC root - // If we started with a separator, we know we at least have an absolute - // path of some kind (UNC or otherwise) - isAbsolute = true; - if (isPathSeparator(path.charCodeAt(1))) { - // Matched double path separator at beginning - let j = 2; - let last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - const firstPart = path.slice(last, j); - // Matched! - last = j; - // Match 1 or more path separators - while (j < len && isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j === len) { - // We matched a UNC root only - // Return the normalized version of the UNC root since there - // is nothing left to process - return `\\\\${firstPart}\\${path.slice(last)}\\`; - } - if (j !== last) { - // We matched a UNC root with leftovers - device = `\\\\${firstPart}\\${path.slice(last, j)}`; - rootEnd = j; - } - } - } - } - else { - rootEnd = 1; - } - } - else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { - // Possible device root - device = path.slice(0, 2); - rootEnd = 2; - if (len > 2 && isPathSeparator(path.charCodeAt(2))) { - // Treat separator following drive name as an absolute path - // indicator - isAbsolute = true; - rootEnd = 3; - } - } - let tail = rootEnd < len ? - normalizeString(path.slice(rootEnd), !isAbsolute, '\\', isPathSeparator) : - ''; - if (tail.length === 0 && !isAbsolute) { - tail = '.'; - } - if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) { - tail += '\\'; - } - if (device === undefined) { - return isAbsolute ? `\\${tail}` : tail; - } - return isAbsolute ? `${device}\\${tail}` : `${device}${tail}`; - }, - isAbsolute(path) { - validateString(path, 'path'); - const len = path.length; - if (len === 0) { - return false; - } - const code = path.charCodeAt(0); - return isPathSeparator(code) || - // Possible device root - len > 2 && - isWindowsDeviceRoot(code) && - path.charCodeAt(1) === CHAR_COLON && - isPathSeparator(path.charCodeAt(2)); - }, - join(...paths) { - if (paths.length === 0) { - return '.'; - } - let joined; - let firstPart; - for (let i = 0; i < paths.length; ++i) { - const arg = paths[i]; - validateString(arg, 'path'); - if (arg.length > 0) { - if (joined === undefined) { - joined = firstPart = arg; - } - else { - joined += `\\${arg}`; - } - } - } - if (joined === undefined) { - return '.'; - } - // Make sure that the joined path doesn't start with two slashes, because - // normalize() will mistake it for an UNC path then. - // - // This step is skipped when it is very clear that the user actually - // intended to point at an UNC path. This is assumed when the first - // non-empty string arguments starts with exactly two slashes followed by - // at least one more non-slash character. - // - // Note that for normalize() to treat a path as an UNC path it needs to - // have at least 2 components, so we don't filter for that here. - // This means that the user can use join to construct UNC paths from - // a server name and a share name; for example: - // path.join('//server', 'share') -> '\\\\server\\share\\') - let needsReplace = true; - let slashCount = 0; - if (typeof firstPart === 'string' && isPathSeparator(firstPart.charCodeAt(0))) { - ++slashCount; - const firstLen = firstPart.length; - if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) { - ++slashCount; - if (firstLen > 2) { - if (isPathSeparator(firstPart.charCodeAt(2))) { - ++slashCount; - } - else { - // We matched a UNC path in the first part - needsReplace = false; - } - } - } - } - if (needsReplace) { - // Find any more consecutive slashes we need to replace - while (slashCount < joined.length && - isPathSeparator(joined.charCodeAt(slashCount))) { - slashCount++; - } - // Replace the slashes if needed - if (slashCount >= 2) { - joined = `\\${joined.slice(slashCount)}`; - } - } - return win32.normalize(joined); - }, - // It will solve the relative path from `from` to `to`, for instance: - // from = 'C:\\orandea\\test\\aaa' - // to = 'C:\\orandea\\impl\\bbb' - // The output of the function should be: '..\\..\\impl\\bbb' - relative(from, to) { - validateString(from, 'from'); - validateString(to, 'to'); - if (from === to) { - return ''; - } - const fromOrig = win32.resolve(from); - const toOrig = win32.resolve(to); - if (fromOrig === toOrig) { - return ''; - } - from = fromOrig.toLowerCase(); - to = toOrig.toLowerCase(); - if (from === to) { - return ''; - } - // Trim any leading backslashes - let fromStart = 0; - while (fromStart < from.length && - from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) { - fromStart++; - } - // Trim trailing backslashes (applicable to UNC paths only) - let fromEnd = from.length; - while (fromEnd - 1 > fromStart && - from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) { - fromEnd--; - } - const fromLen = fromEnd - fromStart; - // Trim any leading backslashes - let toStart = 0; - while (toStart < to.length && - to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) { - toStart++; - } - // Trim trailing backslashes (applicable to UNC paths only) - let toEnd = to.length; - while (toEnd - 1 > toStart && - to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) { - toEnd--; - } - const toLen = toEnd - toStart; - // Compare paths to find the longest common path from root - const length = fromLen < toLen ? fromLen : toLen; - let lastCommonSep = -1; - let i = 0; - for (; i < length; i++) { - const fromCode = from.charCodeAt(fromStart + i); - if (fromCode !== to.charCodeAt(toStart + i)) { - break; - } - else if (fromCode === CHAR_BACKWARD_SLASH) { - lastCommonSep = i; - } - } - // We found a mismatch before the first common path separator was seen, so - // return the original `to`. - if (i !== length) { - if (lastCommonSep === -1) { - return toOrig; - } - } - else { - if (toLen > length) { - if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) { - // We get here if `from` is the exact base path for `to`. - // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz' - return toOrig.slice(toStart + i + 1); - } - if (i === 2) { - // We get here if `from` is the device root. - // For example: from='C:\\'; to='C:\\foo' - return toOrig.slice(toStart + i); - } - } - if (fromLen > length) { - if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) { - // We get here if `to` is the exact base path for `from`. - // For example: from='C:\\foo\\bar'; to='C:\\foo' - lastCommonSep = i; - } - else if (i === 2) { - // We get here if `to` is the device root. - // For example: from='C:\\foo\\bar'; to='C:\\' - lastCommonSep = 3; - } - } - if (lastCommonSep === -1) { - lastCommonSep = 0; - } - } - let out = ''; - // Generate the relative path based on the path difference between `to` and - // `from` - for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { - if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) { - out += out.length === 0 ? '..' : '\\..'; - } - } - toStart += lastCommonSep; - // Lastly, append the rest of the destination (`to`) path that comes after - // the common path parts - if (out.length > 0) { - return `${out}${toOrig.slice(toStart, toEnd)}`; - } - if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) { - ++toStart; - } - return toOrig.slice(toStart, toEnd); - }, - toNamespacedPath(path) { - // Note: this will *probably* throw somewhere. - if (typeof path !== 'string') { - return path; - } - if (path.length === 0) { - return ''; - } - const resolvedPath = win32.resolve(path); - if (resolvedPath.length <= 2) { - return path; - } - if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) { - // Possible UNC root - if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) { - const code = resolvedPath.charCodeAt(2); - if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) { - // Matched non-long UNC root, convert the path to a long UNC path - return `\\\\?\\UNC\\${resolvedPath.slice(2)}`; - } - } - } - else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) && - resolvedPath.charCodeAt(1) === CHAR_COLON && - resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) { - // Matched device root, convert the path to a long UNC path - return `\\\\?\\${resolvedPath}`; - } - return path; - }, - dirname(path) { - validateString(path, 'path'); - const len = path.length; - if (len === 0) { - return '.'; - } - let rootEnd = -1; - let offset = 0; - const code = path.charCodeAt(0); - if (len === 1) { - // `path` contains just a path separator, exit early to avoid - // unnecessary work or a dot. - return isPathSeparator(code) ? path : '.'; - } - // Try to match a root - if (isPathSeparator(code)) { - // Possible UNC root - rootEnd = offset = 1; - if (isPathSeparator(path.charCodeAt(1))) { - // Matched double path separator at beginning - let j = 2; - let last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more path separators - while (j < len && isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j === len) { - // We matched a UNC root only - return path; - } - if (j !== last) { - // We matched a UNC root with leftovers - // Offset by 1 to include the separator after the UNC root to - // treat it as a "normal root" on top of a (UNC) root - rootEnd = offset = j + 1; - } - } - } - } - // Possible device root - } - else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { - rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2; - offset = rootEnd; - } - let end = -1; - let matchedSlash = true; - for (let i = len - 1; i >= offset; --i) { - if (isPathSeparator(path.charCodeAt(i))) { - if (!matchedSlash) { - end = i; - break; - } - } - else { - // We saw the first non-path separator - matchedSlash = false; - } - } - if (end === -1) { - if (rootEnd === -1) { - return '.'; - } - end = rootEnd; - } - return path.slice(0, end); - }, - basename(path, ext) { - if (ext !== undefined) { - validateString(ext, 'ext'); - } - validateString(path, 'path'); - let start = 0; - let end = -1; - let matchedSlash = true; - let i; - // Check for a drive letter prefix so as not to mistake the following - // path separator as an extra separator at the end of the path that can be - // disregarded - if (path.length >= 2 && - isWindowsDeviceRoot(path.charCodeAt(0)) && - path.charCodeAt(1) === CHAR_COLON) { - start = 2; - } - if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { - if (ext === path) { - return ''; - } - let extIdx = ext.length - 1; - let firstNonSlashEnd = -1; - for (i = path.length - 1; i >= start; --i) { - const code = path.charCodeAt(i); - if (isPathSeparator(code)) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } - else { - if (firstNonSlashEnd === -1) { - // We saw the first non-path separator, remember this index in case - // we need it if the extension ends up not matching - matchedSlash = false; - firstNonSlashEnd = i + 1; - } - if (extIdx >= 0) { - // Try to match the explicit extension - if (code === ext.charCodeAt(extIdx)) { - if (--extIdx === -1) { - // We matched the extension, so mark this as the end of our path - // component - end = i; - } - } - else { - // Extension does not match, so our result is the entire path - // component - extIdx = -1; - end = firstNonSlashEnd; - } - } - } - } - if (start === end) { - end = firstNonSlashEnd; - } - else if (end === -1) { - end = path.length; - } - return path.slice(start, end); - } - for (i = path.length - 1; i >= start; --i) { - if (isPathSeparator(path.charCodeAt(i))) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } - else if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // path component - matchedSlash = false; - end = i + 1; - } - } - if (end === -1) { - return ''; - } - return path.slice(start, end); - }, - extname(path) { - validateString(path, 'path'); - let start = 0; - let startDot = -1; - let startPart = 0; - let end = -1; - let matchedSlash = true; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - let preDotState = 0; - // Check for a drive letter prefix so as not to mistake the following - // path separator as an extra separator at the end of the path that can be - // disregarded - if (path.length >= 2 && - path.charCodeAt(1) === CHAR_COLON && - isWindowsDeviceRoot(path.charCodeAt(0))) { - start = startPart = 2; - } - for (let i = path.length - 1; i >= start; --i) { - const code = path.charCodeAt(i); - if (isPathSeparator(code)) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === CHAR_DOT) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) { - startDot = i; - } - else if (preDotState !== 1) { - preDotState = 1; - } - } - else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if (startDot === -1 || - end === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1)) { - return ''; - } - return path.slice(startDot, end); - }, - format: _format.bind(null, '\\'), - parse(path) { - validateString(path, 'path'); - const ret = { root: '', dir: '', base: '', ext: '', name: '' }; - if (path.length === 0) { - return ret; - } - const len = path.length; - let rootEnd = 0; - let code = path.charCodeAt(0); - if (len === 1) { - if (isPathSeparator(code)) { - // `path` contains just a path separator, exit early to avoid - // unnecessary work - ret.root = ret.dir = path; - return ret; - } - ret.base = ret.name = path; - return ret; - } - // Try to match a root - if (isPathSeparator(code)) { - // Possible UNC root - rootEnd = 1; - if (isPathSeparator(path.charCodeAt(1))) { - // Matched double path separator at beginning - let j = 2; - let last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more path separators - while (j < len && isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j < len && j !== last) { - // Matched! - last = j; - // Match 1 or more non-path separators - while (j < len && !isPathSeparator(path.charCodeAt(j))) { - j++; - } - if (j === len) { - // We matched a UNC root only - rootEnd = j; - } - else if (j !== last) { - // We matched a UNC root with leftovers - rootEnd = j + 1; - } - } - } - } - } - else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { - // Possible device root - if (len <= 2) { - // `path` contains just a drive root, exit early to avoid - // unnecessary work - ret.root = ret.dir = path; - return ret; - } - rootEnd = 2; - if (isPathSeparator(path.charCodeAt(2))) { - if (len === 3) { - // `path` contains just a drive root, exit early to avoid - // unnecessary work - ret.root = ret.dir = path; - return ret; - } - rootEnd = 3; - } - } - if (rootEnd > 0) { - ret.root = path.slice(0, rootEnd); - } - let startDot = -1; - let startPart = rootEnd; - let end = -1; - let matchedSlash = true; - let i = path.length - 1; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - let preDotState = 0; - // Get non-dir info - for (; i >= rootEnd; --i) { - code = path.charCodeAt(i); - if (isPathSeparator(code)) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === CHAR_DOT) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) { - startDot = i; - } - else if (preDotState !== 1) { - preDotState = 1; - } - } - else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if (end !== -1) { - if (startDot === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1)) { - ret.base = ret.name = path.slice(startPart, end); - } - else { - ret.name = path.slice(startPart, startDot); - ret.base = path.slice(startPart, end); - ret.ext = path.slice(startDot, end); - } - } - // If the directory is the root, use the entire root as the `dir` including - // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the - // trailing slash (`C:\abc\def` -> `C:\abc`). - if (startPart > 0 && startPart !== rootEnd) { - ret.dir = path.slice(0, startPart - 1); - } - else { - ret.dir = ret.root; - } - return ret; - }, - sep: '\\', - delimiter: ';', - win32: null, - posix: null -}; -const posix = { - // path.resolve([from ...], to) - resolve(...pathSegments) { - let resolvedPath = ''; - let resolvedAbsolute = false; - for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - const path = i >= 0 ? pathSegments[i] : _process_js__WEBPACK_IMPORTED_MODULE_0__["cwd"](); - validateString(path, 'path'); - // Skip empty entries - if (path.length === 0) { - continue; - } - resolvedPath = `${path}/${resolvedPath}`; - resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; - } - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - // Normalize the path - resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, '/', isPosixPathSeparator); - if (resolvedAbsolute) { - return `/${resolvedPath}`; - } - return resolvedPath.length > 0 ? resolvedPath : '.'; - }, - normalize(path) { - validateString(path, 'path'); - if (path.length === 0) { - return '.'; - } - const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; - const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH; - // Normalize the path - path = normalizeString(path, !isAbsolute, '/', isPosixPathSeparator); - if (path.length === 0) { - if (isAbsolute) { - return '/'; - } - return trailingSeparator ? './' : '.'; - } - if (trailingSeparator) { - path += '/'; - } - return isAbsolute ? `/${path}` : path; - }, - isAbsolute(path) { - validateString(path, 'path'); - return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH; - }, - join(...paths) { - if (paths.length === 0) { - return '.'; - } - let joined; - for (let i = 0; i < paths.length; ++i) { - const arg = paths[i]; - validateString(arg, 'path'); - if (arg.length > 0) { - if (joined === undefined) { - joined = arg; - } - else { - joined += `/${arg}`; - } - } - } - if (joined === undefined) { - return '.'; - } - return posix.normalize(joined); - }, - relative(from, to) { - validateString(from, 'from'); - validateString(to, 'to'); - if (from === to) { - return ''; - } - // Trim leading forward slashes. - from = posix.resolve(from); - to = posix.resolve(to); - if (from === to) { - return ''; - } - const fromStart = 1; - const fromEnd = from.length; - const fromLen = fromEnd - fromStart; - const toStart = 1; - const toLen = to.length - toStart; - // Compare paths to find the longest common path from root - const length = (fromLen < toLen ? fromLen : toLen); - let lastCommonSep = -1; - let i = 0; - for (; i < length; i++) { - const fromCode = from.charCodeAt(fromStart + i); - if (fromCode !== to.charCodeAt(toStart + i)) { - break; - } - else if (fromCode === CHAR_FORWARD_SLASH) { - lastCommonSep = i; - } - } - if (i === length) { - if (toLen > length) { - if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) { - // We get here if `from` is the exact base path for `to`. - // For example: from='/foo/bar'; to='/foo/bar/baz' - return to.slice(toStart + i + 1); - } - if (i === 0) { - // We get here if `from` is the root - // For example: from='/'; to='/foo' - return to.slice(toStart + i); - } - } - else if (fromLen > length) { - if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) { - // We get here if `to` is the exact base path for `from`. - // For example: from='/foo/bar/baz'; to='/foo/bar' - lastCommonSep = i; - } - else if (i === 0) { - // We get here if `to` is the root. - // For example: from='/foo/bar'; to='/' - lastCommonSep = 0; - } - } - } - let out = ''; - // Generate the relative path based on the path difference between `to` - // and `from`. - for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { - if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) { - out += out.length === 0 ? '..' : '/..'; - } - } - // Lastly, append the rest of the destination (`to`) path that comes after - // the common path parts. - return `${out}${to.slice(toStart + lastCommonSep)}`; - }, - toNamespacedPath(path) { - // Non-op on posix systems - return path; - }, - dirname(path) { - validateString(path, 'path'); - if (path.length === 0) { - return '.'; - } - const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH; - let end = -1; - let matchedSlash = true; - for (let i = path.length - 1; i >= 1; --i) { - if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { - if (!matchedSlash) { - end = i; - break; - } - } - else { - // We saw the first non-path separator - matchedSlash = false; - } - } - if (end === -1) { - return hasRoot ? '/' : '.'; - } - if (hasRoot && end === 1) { - return '//'; - } - return path.slice(0, end); - }, - basename(path, ext) { - if (ext !== undefined) { - validateString(ext, 'ext'); - } - validateString(path, 'path'); - let start = 0; - let end = -1; - let matchedSlash = true; - let i; - if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { - if (ext === path) { - return ''; - } - let extIdx = ext.length - 1; - let firstNonSlashEnd = -1; - for (i = path.length - 1; i >= 0; --i) { - const code = path.charCodeAt(i); - if (code === CHAR_FORWARD_SLASH) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } - else { - if (firstNonSlashEnd === -1) { - // We saw the first non-path separator, remember this index in case - // we need it if the extension ends up not matching - matchedSlash = false; - firstNonSlashEnd = i + 1; - } - if (extIdx >= 0) { - // Try to match the explicit extension - if (code === ext.charCodeAt(extIdx)) { - if (--extIdx === -1) { - // We matched the extension, so mark this as the end of our path - // component - end = i; - } - } - else { - // Extension does not match, so our result is the entire path - // component - extIdx = -1; - end = firstNonSlashEnd; - } - } - } - } - if (start === end) { - end = firstNonSlashEnd; - } - else if (end === -1) { - end = path.length; - } - return path.slice(start, end); - } - for (i = path.length - 1; i >= 0; --i) { - if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1; - break; - } - } - else if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // path component - matchedSlash = false; - end = i + 1; - } - } - if (end === -1) { - return ''; - } - return path.slice(start, end); - }, - extname(path) { - validateString(path, 'path'); - let startDot = -1; - let startPart = 0; - let end = -1; - let matchedSlash = true; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - let preDotState = 0; - for (let i = path.length - 1; i >= 0; --i) { - const code = path.charCodeAt(i); - if (code === CHAR_FORWARD_SLASH) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === CHAR_DOT) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) { - startDot = i; - } - else if (preDotState !== 1) { - preDotState = 1; - } - } - else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if (startDot === -1 || - end === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1)) { - return ''; - } - return path.slice(startDot, end); - }, - format: _format.bind(null, '/'), - parse(path) { - validateString(path, 'path'); - const ret = { root: '', dir: '', base: '', ext: '', name: '' }; - if (path.length === 0) { - return ret; - } - const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; - let start; - if (isAbsolute) { - ret.root = '/'; - start = 1; - } - else { - start = 0; - } - let startDot = -1; - let startPart = 0; - let end = -1; - let matchedSlash = true; - let i = path.length - 1; - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - let preDotState = 0; - // Get non-dir info - for (; i >= start; --i) { - const code = path.charCodeAt(i); - if (code === CHAR_FORWARD_SLASH) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1; - break; - } - continue; - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false; - end = i + 1; - } - if (code === CHAR_DOT) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) { - startDot = i; - } - else if (preDotState !== 1) { - preDotState = 1; - } - } - else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1; - } - } - if (end !== -1) { - const start = startPart === 0 && isAbsolute ? 1 : startPart; - if (startDot === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && - startDot === end - 1 && - startDot === startPart + 1)) { - ret.base = ret.name = path.slice(start, end); - } - else { - ret.name = path.slice(start, startDot); - ret.base = path.slice(start, end); - ret.ext = path.slice(startDot, end); - } - } - if (startPart > 0) { - ret.dir = path.slice(0, startPart - 1); - } - else if (isAbsolute) { - ret.dir = '/'; - } - return ret; - }, - sep: '/', - delimiter: ':', - win32: null, - posix: null -}; -posix.win32 = win32.win32 = win32; -posix.posix = win32.posix = posix; -const normalize = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.normalize : posix.normalize); -const resolve = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.resolve : posix.resolve); -const relative = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.relative : posix.relative); -const dirname = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.dirname : posix.dirname); -const basename = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.basename : posix.basename); -const extname = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.extname : posix.extname); -const sep = (_process_js__WEBPACK_IMPORTED_MODULE_0__["platform"] === 'win32' ? win32.sep : posix.sep); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/platform.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/platform.js ***! - \*******************************************************************/ -/*! exports provided: isWindows, isMacintosh, isLinux, isNative, isWeb, isIOS, globals, setImmediate, OS, isLittleEndian */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(process, global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWindows", function() { return isWindows; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMacintosh", function() { return isMacintosh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinux", function() { return isLinux; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return isNative; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWeb", function() { return isWeb; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIOS", function() { return isIOS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "globals", function() { return globals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setImmediate", function() { return setImmediate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OS", function() { return OS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLittleEndian", function() { return isLittleEndian; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -const LANGUAGE_DEFAULT = 'en'; -let _isWindows = false; -let _isMacintosh = false; -let _isLinux = false; -let _isNative = false; -let _isWeb = false; -let _isIOS = false; -let _locale = undefined; -let _language = LANGUAGE_DEFAULT; -let _translationsConfigFile = undefined; -let _userAgent = undefined; -const isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); -// OS detection -if (typeof navigator === 'object' && !isElectronRenderer) { - _userAgent = navigator.userAgent; - _isWindows = _userAgent.indexOf('Windows') >= 0; - _isMacintosh = _userAgent.indexOf('Macintosh') >= 0; - _isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0; - _isLinux = _userAgent.indexOf('Linux') >= 0; - _isWeb = true; - _locale = navigator.language; - _language = _locale; -} -else if (typeof process === 'object') { - _isWindows = (process.platform === 'win32'); - _isMacintosh = (process.platform === 'darwin'); - _isLinux = (process.platform === 'linux'); - _locale = LANGUAGE_DEFAULT; - _language = LANGUAGE_DEFAULT; - const rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; - if (rawNlsConfig) { - try { - const nlsConfig = JSON.parse(rawNlsConfig); - const resolved = nlsConfig.availableLanguages['*']; - _locale = nlsConfig.locale; - // VSCode's default language is 'en' - _language = resolved ? resolved : LANGUAGE_DEFAULT; - _translationsConfigFile = nlsConfig._translationsConfigFile; - } - catch (e) { - } - } - _isNative = true; -} -let _platform = 0 /* Web */; -if (_isMacintosh) { - _platform = 1 /* Mac */; -} -else if (_isWindows) { - _platform = 3 /* Windows */; -} -else if (_isLinux) { - _platform = 2 /* Linux */; -} -const isWindows = _isWindows; -const isMacintosh = _isMacintosh; -const isLinux = _isLinux; -const isNative = _isNative; -const isWeb = _isWeb; -const isIOS = _isIOS; -const _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); -const globals = _globals; -const setImmediate = (function defineSetImmediate() { - if (globals.setImmediate) { - return globals.setImmediate.bind(globals); - } - if (typeof globals.postMessage === 'function' && !globals.importScripts) { - let pending = []; - globals.addEventListener('message', (e) => { - if (e.data && e.data.vscodeSetImmediateId) { - for (let i = 0, len = pending.length; i < len; i++) { - const candidate = pending[i]; - if (candidate.id === e.data.vscodeSetImmediateId) { - pending.splice(i, 1); - candidate.callback(); - return; - } - } - } - }); - let lastId = 0; - return (callback) => { - const myId = ++lastId; - pending.push({ - id: myId, - callback: callback - }); - globals.postMessage({ vscodeSetImmediateId: myId }, '*'); - }; - } - if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { - return process.nextTick.bind(process); - } - const _promise = Promise.resolve(); - return (callback) => _promise.then(callback); -})(); -const OS = (_isMacintosh || _isIOS ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); -let _isLittleEndian = true; -let _isLittleEndianComputed = false; -function isLittleEndian() { - if (!_isLittleEndianComputed) { - _isLittleEndianComputed = true; - const test = new Uint8Array(2); - test[0] = 1; - test[1] = 2; - const view = new Uint16Array(test.buffer); - _isLittleEndian = (view[0] === (2 << 8) + 1); - } - return _isLittleEndian; -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/process.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/process.js ***! - \******************************************************************/ -/*! exports provided: cwd, env, platform */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cwd", function() { return cwd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "env", function() { return env; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "platform", function() { return platform; }); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const safeProcess = (typeof process === 'undefined') ? { - cwd() { return '/'; }, - env: Object.create(null), - get platform() { return _platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"] ? 'win32' : _platform_js__WEBPACK_IMPORTED_MODULE_0__["isMacintosh"] ? 'darwin' : 'linux'; }, - nextTick(callback) { return Object(_platform_js__WEBPACK_IMPORTED_MODULE_0__["setImmediate"])(callback); } -} : process; -const cwd = safeProcess.cwd; -const env = safeProcess.env; -const platform = safeProcess.platform; - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "./node_modules/process/browser.js"))) - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/strings.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/strings.js ***! - \******************************************************************/ -/*! exports provided: isFalsyOrWhitespace, pad, format, escape, escapeRegExpCharacters, trim, ltrim, rtrim, convertSimple2RegExpPattern, stripWildcards, startsWith, endsWith, createRegExp, regExpLeadsToEndlessLoop, regExpFlags, firstNonWhitespaceIndex, getLeadingWhitespace, lastNonWhitespaceIndex, compare, compareSubstring, compareIgnoreCase, compareSubstringIgnoreCase, isLowerAsciiLetter, isUpperAsciiLetter, equalsIgnoreCase, startsWithIgnoreCase, commonPrefixLength, commonSuffixLength, isHighSurrogate, isLowSurrogate, computeCodePoint, getNextCodePoint, nextCharLength, prevCharLength, decodeUTF8, containsRTL, containsEmoji, isBasicASCII, UNUSUAL_LINE_TERMINATORS, containsUnusualLineTerminators, containsFullWidthCharacter, isFullWidthCharacter, isEmojiImprecise, UTF8_BOM_CHARACTER, startsWithUTF8BOM, containsUppercaseCharacter, singleLetterHash, getGraphemeBreakType, breakBetweenGraphemeBreakType */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrWhitespace", function() { return isFalsyOrWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return pad; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return escape; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeRegExpCharacters", function() { return escapeRegExpCharacters; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return trim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ltrim", function() { return ltrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtrim", function() { return rtrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSimple2RegExpPattern", function() { return convertSimple2RegExpPattern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripWildcards", function() { return stripWildcards; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRegExp", function() { return createRegExp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpLeadsToEndlessLoop", function() { return regExpLeadsToEndlessLoop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpFlags", function() { return regExpFlags; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstNonWhitespaceIndex", function() { return firstNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLeadingWhitespace", function() { return getLeadingWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastNonWhitespaceIndex", function() { return lastNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compare", function() { return compare; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareSubstring", function() { return compareSubstring; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareIgnoreCase", function() { return compareIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareSubstringIgnoreCase", function() { return compareSubstringIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowerAsciiLetter", function() { return isLowerAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUpperAsciiLetter", function() { return isUpperAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equalsIgnoreCase", function() { return equalsIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithIgnoreCase", function() { return startsWithIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonPrefixLength", function() { return commonPrefixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonSuffixLength", function() { return commonSuffixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogate", function() { return isHighSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogate", function() { return isLowSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeCodePoint", function() { return computeCodePoint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNextCodePoint", function() { return getNextCodePoint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nextCharLength", function() { return nextCharLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prevCharLength", function() { return prevCharLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeUTF8", function() { return decodeUTF8; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsRTL", function() { return containsRTL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsEmoji", function() { return containsEmoji; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBasicASCII", function() { return isBasicASCII; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNUSUAL_LINE_TERMINATORS", function() { return UNUSUAL_LINE_TERMINATORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsUnusualLineTerminators", function() { return containsUnusualLineTerminators; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsFullWidthCharacter", function() { return containsFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFullWidthCharacter", function() { return isFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmojiImprecise", function() { return isEmojiImprecise; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UTF8_BOM_CHARACTER", function() { return UTF8_BOM_CHARACTER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithUTF8BOM", function() { return startsWithUTF8BOM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsUppercaseCharacter", function() { return containsUppercaseCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "singleLetterHash", function() { return singleLetterHash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGraphemeBreakType", function() { return getGraphemeBreakType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "breakBetweenGraphemeBreakType", function() { return breakBetweenGraphemeBreakType; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function isFalsyOrWhitespace(str) { - if (!str || typeof str !== 'string') { - return true; - } - return str.trim().length === 0; -} -/** - * @deprecated ES6: use `String.padStart` - */ -function pad(n, l, char = '0') { - const str = '' + n; - const r = [str]; - for (let i = str.length; i < l; i++) { - r.push(char); - } - return r.reverse().join(''); -} -const _formatRegexp = /{(\d+)}/g; -/** - * Helper to produce a string with a variable number of arguments. Insert variable segments - * into the string using the {n} notation where N is the index of the argument following the string. - * @param value string to which formatting is applied - * @param args replacements for {n}-entries - */ -function format(value, ...args) { - if (args.length === 0) { - return value; - } - return value.replace(_formatRegexp, function (match, group) { - const idx = parseInt(group, 10); - return isNaN(idx) || idx < 0 || idx >= args.length ? - match : - args[idx]; - }); -} -/** - * Converts HTML characters inside the string to use entities instead. Makes the string safe from - * being used e.g. in HTMLElement.innerHTML. - */ -function escape(html) { - return html.replace(/[<>&]/g, function (match) { - switch (match) { - case '<': return '<'; - case '>': return '>'; - case '&': return '&'; - default: return match; - } - }); -} -/** - * Escapes regular expression characters in a given string - */ -function escapeRegExpCharacters(value) { - return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, '\\$&'); -} -/** - * Removes all occurrences of needle from the beginning and end of haystack. - * @param haystack string to trim - * @param needle the thing to trim (default is a blank) - */ -function trim(haystack, needle = ' ') { - const trimmed = ltrim(haystack, needle); - return rtrim(trimmed, needle); -} -/** - * Removes all occurrences of needle from the beginning of haystack. - * @param haystack string to trim - * @param needle the thing to trim - */ -function ltrim(haystack, needle) { - if (!haystack || !needle) { - return haystack; - } - const needleLen = needle.length; - if (needleLen === 0 || haystack.length === 0) { - return haystack; - } - let offset = 0; - while (haystack.indexOf(needle, offset) === offset) { - offset = offset + needleLen; - } - return haystack.substring(offset); -} -/** - * Removes all occurrences of needle from the end of haystack. - * @param haystack string to trim - * @param needle the thing to trim - */ -function rtrim(haystack, needle) { - if (!haystack || !needle) { - return haystack; - } - const needleLen = needle.length, haystackLen = haystack.length; - if (needleLen === 0 || haystackLen === 0) { - return haystack; - } - let offset = haystackLen, idx = -1; - while (true) { - idx = haystack.lastIndexOf(needle, offset - 1); - if (idx === -1 || idx + needleLen !== offset) { - break; - } - if (idx === 0) { - return ''; - } - offset = idx; - } - return haystack.substring(0, offset); -} -function convertSimple2RegExpPattern(pattern) { - return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*'); -} -function stripWildcards(pattern) { - return pattern.replace(/\*/g, ''); -} -/** - * @deprecated ES6: use `String.startsWith` - */ -function startsWith(haystack, needle) { - if (haystack.length < needle.length) { - return false; - } - if (haystack === needle) { - return true; - } - for (let i = 0; i < needle.length; i++) { - if (haystack[i] !== needle[i]) { - return false; - } - } - return true; -} -/** - * @deprecated ES6: use `String.endsWith` - */ -function endsWith(haystack, needle) { - const diff = haystack.length - needle.length; - if (diff > 0) { - return haystack.indexOf(needle, diff) === diff; - } - else if (diff === 0) { - return haystack === needle; - } - else { - return false; - } -} -function createRegExp(searchString, isRegex, options = {}) { - if (!searchString) { - throw new Error('Cannot create regex from empty string'); - } - if (!isRegex) { - searchString = escapeRegExpCharacters(searchString); - } - if (options.wholeWord) { - if (!/\B/.test(searchString.charAt(0))) { - searchString = '\\b' + searchString; - } - if (!/\B/.test(searchString.charAt(searchString.length - 1))) { - searchString = searchString + '\\b'; - } - } - let modifiers = ''; - if (options.global) { - modifiers += 'g'; - } - if (!options.matchCase) { - modifiers += 'i'; - } - if (options.multiline) { - modifiers += 'm'; - } - if (options.unicode) { - modifiers += 'u'; - } - return new RegExp(searchString, modifiers); -} -function regExpLeadsToEndlessLoop(regexp) { - // Exit early if it's one of these special cases which are meant to match - // against an empty string - if (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\s*$') { - return false; - } - // We check against an empty string. If the regular expression doesn't advance - // (e.g. ends in an endless loop) it will match an empty string. - const match = regexp.exec(''); - return !!(match && regexp.lastIndex === 0); -} -function regExpFlags(regexp) { - return (regexp.global ? 'g' : '') - + (regexp.ignoreCase ? 'i' : '') - + (regexp.multiline ? 'm' : '') - + (regexp /* standalone editor compilation */.unicode ? 'u' : ''); -} -/** - * Returns first index of the string that is not whitespace. - * If string is empty or contains only whitespaces, returns -1 - */ -function firstNonWhitespaceIndex(str) { - for (let i = 0, len = str.length; i < len; i++) { - const chCode = str.charCodeAt(i); - if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) { - return i; - } - } - return -1; -} -/** - * Returns the leading whitespace of the string. - * If the string contains only whitespaces, returns entire string - */ -function getLeadingWhitespace(str, start = 0, end = str.length) { - for (let i = start; i < end; i++) { - const chCode = str.charCodeAt(i); - if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) { - return str.substring(start, i); - } - } - return str.substring(start, end); -} -/** - * Returns last index of the string that is not whitespace. - * If string is empty or contains only whitespaces, returns -1 - */ -function lastNonWhitespaceIndex(str, startIndex = str.length - 1) { - for (let i = startIndex; i >= 0; i--) { - const chCode = str.charCodeAt(i); - if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) { - return i; - } - } - return -1; -} -function compare(a, b) { - if (a < b) { - return -1; - } - else if (a > b) { - return 1; - } - else { - return 0; - } -} -function compareSubstring(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) { - for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) { - let codeA = a.charCodeAt(aStart); - let codeB = b.charCodeAt(bStart); - if (codeA < codeB) { - return -1; - } - else if (codeA > codeB) { - return 1; - } - } - const aLen = aEnd - aStart; - const bLen = bEnd - bStart; - if (aLen < bLen) { - return -1; - } - else if (aLen > bLen) { - return 1; - } - return 0; -} -function compareIgnoreCase(a, b) { - return compareSubstringIgnoreCase(a, b, 0, a.length, 0, b.length); -} -function compareSubstringIgnoreCase(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) { - for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) { - let codeA = a.charCodeAt(aStart); - let codeB = b.charCodeAt(bStart); - if (codeA === codeB) { - // equal - continue; - } - const diff = codeA - codeB; - if (diff === 32 && isUpperAsciiLetter(codeB)) { //codeB =[65-90] && codeA =[97-122] - continue; - } - else if (diff === -32 && isUpperAsciiLetter(codeA)) { //codeB =[97-122] && codeA =[65-90] - continue; - } - if (isLowerAsciiLetter(codeA) && isLowerAsciiLetter(codeB)) { - // - return diff; - } - else { - return compareSubstring(a.toLowerCase(), b.toLowerCase(), aStart, aEnd, bStart, bEnd); - } - } - const aLen = aEnd - aStart; - const bLen = bEnd - bStart; - if (aLen < bLen) { - return -1; - } - else if (aLen > bLen) { - return 1; - } - return 0; -} -function isLowerAsciiLetter(code) { - return code >= 97 /* a */ && code <= 122 /* z */; -} -function isUpperAsciiLetter(code) { - return code >= 65 /* A */ && code <= 90 /* Z */; -} -function isAsciiLetter(code) { - return isLowerAsciiLetter(code) || isUpperAsciiLetter(code); -} -function equalsIgnoreCase(a, b) { - return a.length === b.length && doEqualsIgnoreCase(a, b); -} -function doEqualsIgnoreCase(a, b, stopAt = a.length) { - for (let i = 0; i < stopAt; i++) { - const codeA = a.charCodeAt(i); - const codeB = b.charCodeAt(i); - if (codeA === codeB) { - continue; - } - // a-z A-Z - if (isAsciiLetter(codeA) && isAsciiLetter(codeB)) { - const diff = Math.abs(codeA - codeB); - if (diff !== 0 && diff !== 32) { - return false; - } - } - // Any other charcode - else { - if (String.fromCharCode(codeA).toLowerCase() !== String.fromCharCode(codeB).toLowerCase()) { - return false; - } - } - } - return true; -} -function startsWithIgnoreCase(str, candidate) { - const candidateLength = candidate.length; - if (candidate.length > str.length) { - return false; - } - return doEqualsIgnoreCase(str, candidate, candidateLength); -} -/** - * @returns the length of the common prefix of the two strings. - */ -function commonPrefixLength(a, b) { - let i, len = Math.min(a.length, b.length); - for (i = 0; i < len; i++) { - if (a.charCodeAt(i) !== b.charCodeAt(i)) { - return i; - } - } - return len; -} -/** - * @returns the length of the common suffix of the two strings. - */ -function commonSuffixLength(a, b) { - let i, len = Math.min(a.length, b.length); - const aLastIndex = a.length - 1; - const bLastIndex = b.length - 1; - for (i = 0; i < len; i++) { - if (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) { - return i; - } - } - return len; -} -/** - * See http://en.wikipedia.org/wiki/Surrogate_pair - */ -function isHighSurrogate(charCode) { - return (0xD800 <= charCode && charCode <= 0xDBFF); -} -/** - * See http://en.wikipedia.org/wiki/Surrogate_pair - */ -function isLowSurrogate(charCode) { - return (0xDC00 <= charCode && charCode <= 0xDFFF); -} -/** - * See http://en.wikipedia.org/wiki/Surrogate_pair - */ -function computeCodePoint(highSurrogate, lowSurrogate) { - return ((highSurrogate - 0xD800) << 10) + (lowSurrogate - 0xDC00) + 0x10000; -} -/** - * get the code point that begins at offset `offset` - */ -function getNextCodePoint(str, len, offset) { - const charCode = str.charCodeAt(offset); - if (isHighSurrogate(charCode) && offset + 1 < len) { - const nextCharCode = str.charCodeAt(offset + 1); - if (isLowSurrogate(nextCharCode)) { - return computeCodePoint(charCode, nextCharCode); - } - } - return charCode; -} -/** - * get the code point that ends right before offset `offset` - */ -function getPrevCodePoint(str, offset) { - const charCode = str.charCodeAt(offset - 1); - if (isLowSurrogate(charCode) && offset > 1) { - const prevCharCode = str.charCodeAt(offset - 2); - if (isHighSurrogate(prevCharCode)) { - return computeCodePoint(prevCharCode, charCode); - } - } - return charCode; -} -function nextCharLength(str, offset) { - const graphemeBreakTree = GraphemeBreakTree.getInstance(); - const initialOffset = offset; - const len = str.length; - const initialCodePoint = getNextCodePoint(str, len, offset); - offset += (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint); - while (offset < len) { - const nextCodePoint = getNextCodePoint(str, len, offset); - const nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(nextCodePoint); - if (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) { - break; - } - offset += (nextCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - graphemeBreakType = nextGraphemeBreakType; - } - return (offset - initialOffset); -} -function prevCharLength(str, offset) { - const graphemeBreakTree = GraphemeBreakTree.getInstance(); - const initialOffset = offset; - const initialCodePoint = getPrevCodePoint(str, offset); - offset -= (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint); - while (offset > 0) { - const prevCodePoint = getPrevCodePoint(str, offset); - const prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(prevCodePoint); - if (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)) { - break; - } - offset -= (prevCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1); - graphemeBreakType = prevGraphemeBreakType; - } - return (initialOffset - offset); -} -/** - * A manual decoding of a UTF8 string. - * Use only in environments which do not offer native conversion methods! - */ -function decodeUTF8(buffer) { - // https://en.wikipedia.org/wiki/UTF-8 - const len = buffer.byteLength; - const result = []; - let offset = 0; - while (offset < len) { - const v0 = buffer[offset]; - let codePoint; - if (v0 >= 0b11110000 && offset + 3 < len) { - // 4 bytes - codePoint = ((((buffer[offset++] & 0b00000111) << 18) >>> 0) - | (((buffer[offset++] & 0b00111111) << 12) >>> 0) - | (((buffer[offset++] & 0b00111111) << 6) >>> 0) - | (((buffer[offset++] & 0b00111111) << 0) >>> 0)); - } - else if (v0 >= 0b11100000 && offset + 2 < len) { - // 3 bytes - codePoint = ((((buffer[offset++] & 0b00001111) << 12) >>> 0) - | (((buffer[offset++] & 0b00111111) << 6) >>> 0) - | (((buffer[offset++] & 0b00111111) << 0) >>> 0)); - } - else if (v0 >= 0b11000000 && offset + 1 < len) { - // 2 bytes - codePoint = ((((buffer[offset++] & 0b00011111) << 6) >>> 0) - | (((buffer[offset++] & 0b00111111) << 0) >>> 0)); - } - else { - // 1 byte - codePoint = buffer[offset++]; - } - if ((codePoint >= 0 && codePoint <= 0xD7FF) || (codePoint >= 0xE000 && codePoint <= 0xFFFF)) { - // Basic Multilingual Plane - result.push(String.fromCharCode(codePoint)); - } - else if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) { - // Supplementary Planes - const uPrime = codePoint - 0x10000; - const w1 = 0xD800 + ((uPrime & 0b11111111110000000000) >>> 10); - const w2 = 0xDC00 + ((uPrime & 0b00000000001111111111) >>> 0); - result.push(String.fromCharCode(w1)); - result.push(String.fromCharCode(w2)); - } - else { - // illegal code point - result.push(String.fromCharCode(0xFFFD)); - } - } - return result.join(''); -} -/** - * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-rtl-test.js - */ -const CONTAINS_RTL = /(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/; -/** - * Returns true if `str` contains any Unicode character that is classified as "R" or "AL". - */ -function containsRTL(str) { - return CONTAINS_RTL.test(str); -} -/** - * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js - */ -const CONTAINS_EMOJI = /(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/; -function containsEmoji(str) { - return CONTAINS_EMOJI.test(str); -} -const IS_BASIC_ASCII = /^[\t\n\r\x20-\x7E]*$/; -/** - * Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \n, \r, \t - */ -function isBasicASCII(str) { - return IS_BASIC_ASCII.test(str); -} -const UNUSUAL_LINE_TERMINATORS = /[\u2028\u2029]/; // LINE SEPARATOR (LS) or PARAGRAPH SEPARATOR (PS) -/** - * Returns true if `str` contains unusual line terminators, like LS or PS - */ -function containsUnusualLineTerminators(str) { - return UNUSUAL_LINE_TERMINATORS.test(str); -} -function containsFullWidthCharacter(str) { - for (let i = 0, len = str.length; i < len; i++) { - if (isFullWidthCharacter(str.charCodeAt(i))) { - return true; - } - } - return false; -} -function isFullWidthCharacter(charCode) { - // Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns - // http://jrgraphix.net/research/unicode_blocks.php - // 2E80 — 2EFF CJK Radicals Supplement - // 2F00 — 2FDF Kangxi Radicals - // 2FF0 — 2FFF Ideographic Description Characters - // 3000 — 303F CJK Symbols and Punctuation - // 3040 — 309F Hiragana - // 30A0 — 30FF Katakana - // 3100 — 312F Bopomofo - // 3130 — 318F Hangul Compatibility Jamo - // 3190 — 319F Kanbun - // 31A0 — 31BF Bopomofo Extended - // 31F0 — 31FF Katakana Phonetic Extensions - // 3200 — 32FF Enclosed CJK Letters and Months - // 3300 — 33FF CJK Compatibility - // 3400 — 4DBF CJK Unified Ideographs Extension A - // 4DC0 — 4DFF Yijing Hexagram Symbols - // 4E00 — 9FFF CJK Unified Ideographs - // A000 — A48F Yi Syllables - // A490 — A4CF Yi Radicals - // AC00 — D7AF Hangul Syllables - // [IGNORE] D800 — DB7F High Surrogates - // [IGNORE] DB80 — DBFF High Private Use Surrogates - // [IGNORE] DC00 — DFFF Low Surrogates - // [IGNORE] E000 — F8FF Private Use Area - // F900 — FAFF CJK Compatibility Ideographs - // [IGNORE] FB00 — FB4F Alphabetic Presentation Forms - // [IGNORE] FB50 — FDFF Arabic Presentation Forms-A - // [IGNORE] FE00 — FE0F Variation Selectors - // [IGNORE] FE20 — FE2F Combining Half Marks - // [IGNORE] FE30 — FE4F CJK Compatibility Forms - // [IGNORE] FE50 — FE6F Small Form Variants - // [IGNORE] FE70 — FEFF Arabic Presentation Forms-B - // FF00 — FFEF Halfwidth and Fullwidth Forms - // [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms] - // of which FF01 - FF5E fullwidth ASCII of 21 to 7E - // [IGNORE] and FF65 - FFDC halfwidth of Katakana and Hangul - // [IGNORE] FFF0 — FFFF Specials - charCode = +charCode; // @perf - return ((charCode >= 0x2E80 && charCode <= 0xD7AF) - || (charCode >= 0xF900 && charCode <= 0xFAFF) - || (charCode >= 0xFF01 && charCode <= 0xFF5E)); -} -/** - * A fast function (therefore imprecise) to check if code points are emojis. - * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js - */ -function isEmojiImprecise(x) { - return ((x >= 0x1F1E6 && x <= 0x1F1FF) || (x >= 9728 && x <= 10175) || (x >= 127744 && x <= 128591) - || (x >= 128640 && x <= 128764) || (x >= 128992 && x <= 129003) || (x >= 129280 && x <= 129535) - || (x >= 129648 && x <= 129651) || (x >= 129656 && x <= 129666) || (x >= 129680 && x <= 129685)); -} -// -- UTF-8 BOM -const UTF8_BOM_CHARACTER = String.fromCharCode(65279 /* UTF8_BOM */); -function startsWithUTF8BOM(str) { - return !!(str && str.length > 0 && str.charCodeAt(0) === 65279 /* UTF8_BOM */); -} -function containsUppercaseCharacter(target, ignoreEscapedChars = false) { - if (!target) { - return false; - } - if (ignoreEscapedChars) { - target = target.replace(/\\./g, ''); - } - return target.toLowerCase() !== target; -} -/** - * Produces 'a'-'z', followed by 'A'-'Z'... followed by 'a'-'z', etc. - */ -function singleLetterHash(n) { - const LETTERS_CNT = (90 /* Z */ - 65 /* A */ + 1); - n = n % (2 * LETTERS_CNT); - if (n < LETTERS_CNT) { - return String.fromCharCode(97 /* a */ + n); - } - return String.fromCharCode(65 /* A */ + n - LETTERS_CNT); -} -//#region Unicode Grapheme Break -function getGraphemeBreakType(codePoint) { - const graphemeBreakTree = GraphemeBreakTree.getInstance(); - return graphemeBreakTree.getGraphemeBreakType(codePoint); -} -function breakBetweenGraphemeBreakType(breakTypeA, breakTypeB) { - // http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules - // !!! Let's make the common case a bit faster - if (breakTypeA === 0 /* Other */) { - // see https://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakTest-13.0.0d10.html#table - return (breakTypeB !== 5 /* Extend */ && breakTypeB !== 7 /* SpacingMark */); - } - // Do not break between a CR and LF. Otherwise, break before and after controls. - // GB3 CR × LF - // GB4 (Control | CR | LF) ÷ - // GB5 ÷ (Control | CR | LF) - if (breakTypeA === 2 /* CR */) { - if (breakTypeB === 3 /* LF */) { - return false; // GB3 - } - } - if (breakTypeA === 4 /* Control */ || breakTypeA === 2 /* CR */ || breakTypeA === 3 /* LF */) { - return true; // GB4 - } - if (breakTypeB === 4 /* Control */ || breakTypeB === 2 /* CR */ || breakTypeB === 3 /* LF */) { - return true; // GB5 - } - // Do not break Hangul syllable sequences. - // GB6 L × (L | V | LV | LVT) - // GB7 (LV | V) × (V | T) - // GB8 (LVT | T) × T - if (breakTypeA === 8 /* L */) { - if (breakTypeB === 8 /* L */ || breakTypeB === 9 /* V */ || breakTypeB === 11 /* LV */ || breakTypeB === 12 /* LVT */) { - return false; // GB6 - } - } - if (breakTypeA === 11 /* LV */ || breakTypeA === 9 /* V */) { - if (breakTypeB === 9 /* V */ || breakTypeB === 10 /* T */) { - return false; // GB7 - } - } - if (breakTypeA === 12 /* LVT */ || breakTypeA === 10 /* T */) { - if (breakTypeB === 10 /* T */) { - return false; // GB8 - } - } - // Do not break before extending characters or ZWJ. - // GB9 × (Extend | ZWJ) - if (breakTypeB === 5 /* Extend */ || breakTypeB === 13 /* ZWJ */) { - return false; // GB9 - } - // The GB9a and GB9b rules only apply to extended grapheme clusters: - // Do not break before SpacingMarks, or after Prepend characters. - // GB9a × SpacingMark - // GB9b Prepend × - if (breakTypeB === 7 /* SpacingMark */) { - return false; // GB9a - } - if (breakTypeA === 1 /* Prepend */) { - return false; // GB9b - } - // Do not break within emoji modifier sequences or emoji zwj sequences. - // GB11 \p{Extended_Pictographic} Extend* ZWJ × \p{Extended_Pictographic} - if (breakTypeA === 13 /* ZWJ */ && breakTypeB === 14 /* Extended_Pictographic */) { - // Note: we are not implementing the rule entirely here to avoid introducing states - return false; // GB11 - } - // GB12 sot (RI RI)* RI × RI - // GB13 [^RI] (RI RI)* RI × RI - if (breakTypeA === 6 /* Regional_Indicator */ && breakTypeB === 6 /* Regional_Indicator */) { - // Note: we are not implementing the rule entirely here to avoid introducing states - return false; // GB12 & GB13 - } - // GB999 Any ÷ Any - return true; -} -class GraphemeBreakTree { - constructor() { - this._data = getGraphemeBreakRawData(); - } - static getInstance() { - if (!GraphemeBreakTree._INSTANCE) { - GraphemeBreakTree._INSTANCE = new GraphemeBreakTree(); - } - return GraphemeBreakTree._INSTANCE; - } - getGraphemeBreakType(codePoint) { - // !!! Let's make 7bit ASCII a bit faster: 0..31 - if (codePoint < 32) { - if (codePoint === 10 /* LineFeed */) { - return 3 /* LF */; - } - if (codePoint === 13 /* CarriageReturn */) { - return 2 /* CR */; - } - return 4 /* Control */; - } - // !!! Let's make 7bit ASCII a bit faster: 32..126 - if (codePoint < 127) { - return 0 /* Other */; - } - const data = this._data; - const nodeCount = data.length / 3; - let nodeIndex = 1; - while (nodeIndex <= nodeCount) { - if (codePoint < data[3 * nodeIndex]) { - // go left - nodeIndex = 2 * nodeIndex; - } - else if (codePoint > data[3 * nodeIndex + 1]) { - // go right - nodeIndex = 2 * nodeIndex + 1; - } - else { - // hit - return data[3 * nodeIndex + 2]; - } - } - return 0 /* Other */; - } -} -GraphemeBreakTree._INSTANCE = null; -function getGraphemeBreakRawData() { - // generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-grapheme-break.js - return JSON.parse('[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]'); -} -//#endregion - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/types.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/types.js ***! - \****************************************************************/ -/*! exports provided: isArray, isString, isObject, isNumber, isBoolean, isUndefined, isUndefinedOrNull, assertType, assertIsDefined, isFunction, validateConstraints, validateConstraint, getAllPropertyNames, getAllMethodNames, createProxyObject, withNullAsUndefined */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return isNumber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return isBoolean; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return isUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefinedOrNull", function() { return isUndefinedOrNull; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assertType", function() { return assertType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assertIsDefined", function() { return assertIsDefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraints", function() { return validateConstraints; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraint", function() { return validateConstraint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllPropertyNames", function() { return getAllPropertyNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllMethodNames", function() { return getAllMethodNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createProxyObject", function() { return createProxyObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withNullAsUndefined", function() { return withNullAsUndefined; }); -/** - * @returns whether the provided parameter is a JavaScript Array or not. - */ -function isArray(array) { - return Array.isArray(array); -} -/** - * @returns whether the provided parameter is a JavaScript String or not. - */ -function isString(str) { - return (typeof str === 'string'); -} -/** - * - * @returns whether the provided parameter is of type `object` but **not** - * `null`, an `array`, a `regexp`, nor a `date`. - */ -function isObject(obj) { - // The method can't do a type cast since there are type (like strings) which - // are subclasses of any put not positvely matched by the function. Hence type - // narrowing results in wrong results. - return typeof obj === 'object' - && obj !== null - && !Array.isArray(obj) - && !(obj instanceof RegExp) - && !(obj instanceof Date); -} -/** - * In **contrast** to just checking `typeof` this will return `false` for `NaN`. - * @returns whether the provided parameter is a JavaScript Number or not. - */ -function isNumber(obj) { - return (typeof obj === 'number' && !isNaN(obj)); -} -/** - * @returns whether the provided parameter is a JavaScript Boolean or not. - */ -function isBoolean(obj) { - return (obj === true || obj === false); -} -/** - * @returns whether the provided parameter is undefined. - */ -function isUndefined(obj) { - return (typeof obj === 'undefined'); -} -/** - * @returns whether the provided parameter is undefined or null. - */ -function isUndefinedOrNull(obj) { - return (isUndefined(obj) || obj === null); -} -function assertType(condition, type) { - if (!condition) { - throw new Error(type ? `Unexpected type, expected '${type}'` : 'Unexpected type'); - } -} -/** - * Asserts that the argument passed in is neither undefined nor null. - */ -function assertIsDefined(arg) { - if (isUndefinedOrNull(arg)) { - throw new Error('Assertion Failed: argument is undefined or null'); - } - return arg; -} -/** - * @returns whether the provided parameter is a JavaScript Function or not. - */ -function isFunction(obj) { - return (typeof obj === 'function'); -} -function validateConstraints(args, constraints) { - const len = Math.min(args.length, constraints.length); - for (let i = 0; i < len; i++) { - validateConstraint(args[i], constraints[i]); - } -} -function validateConstraint(arg, constraint) { - if (isString(constraint)) { - if (typeof arg !== constraint) { - throw new Error(`argument does not match constraint: typeof ${constraint}`); - } - } - else if (isFunction(constraint)) { - try { - if (arg instanceof constraint) { - return; - } - } - catch (_a) { - // ignore - } - if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { - return; - } - if (constraint.length === 1 && constraint.call(undefined, arg) === true) { - return; - } - throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`); - } -} -function getAllPropertyNames(obj) { - let res = []; - let proto = Object.getPrototypeOf(obj); - while (Object.prototype !== proto) { - res = res.concat(Object.getOwnPropertyNames(proto)); - proto = Object.getPrototypeOf(proto); - } - return res; -} -function getAllMethodNames(obj) { - const methods = []; - for (const prop of getAllPropertyNames(obj)) { - if (typeof obj[prop] === 'function') { - methods.push(prop); - } - } - return methods; -} -function createProxyObject(methodNames, invoke) { - const createProxyMethod = (method) => { - return function () { - const args = Array.prototype.slice.call(arguments, 0); - return invoke(method, args); - }; - }; - let result = {}; - for (const methodName of methodNames) { - result[methodName] = createProxyMethod(methodName); - } - return result; -} -/** - * Converts null to undefined, passes all other values through. - */ -function withNullAsUndefined(x) { - return x === null ? undefined : x; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/uint.js": -/*!***************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/uint.js ***! - \***************************************************************/ -/*! exports provided: toUint8, toUint32 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint8", function() { return toUint8; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32", function() { return toUint32; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function toUint8(v) { - if (v < 0) { - return 0; - } - if (v > 255 /* MAX_UINT_8 */) { - return 255 /* MAX_UINT_8 */; - } - return v | 0; -} -function toUint32(v) { - if (v < 0) { - return 0; - } - if (v > 4294967295 /* MAX_UINT_32 */) { - return 4294967295 /* MAX_UINT_32 */; - } - return v | 0; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/uri.js": -/*!**************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/uri.js ***! - \**************************************************************/ -/*! exports provided: URI, uriToFsPath */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "URI", function() { return URI; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uriToFsPath", function() { return uriToFsPath; }); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./path.js */ "./node_modules/monaco-editor/esm/vs/base/common/path.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -const _schemePattern = /^\w[\w\d+.-]*$/; -const _singleSlashStart = /^\//; -const _doubleSlashStart = /^\/\//; -function _validateUri(ret, _strict) { - // scheme, must be set - if (!ret.scheme && _strict) { - throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${ret.authority}", path: "${ret.path}", query: "${ret.query}", fragment: "${ret.fragment}"}`); - } - // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 - // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - if (ret.scheme && !_schemePattern.test(ret.scheme)) { - throw new Error('[UriError]: Scheme contains illegal characters.'); - } - // path, http://tools.ietf.org/html/rfc3986#section-3.3 - // If a URI contains an authority component, then the path component - // must either be empty or begin with a slash ("/") character. If a URI - // does not contain an authority component, then the path cannot begin - // with two slash characters ("//"). - if (ret.path) { - if (ret.authority) { - if (!_singleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); - } - } - else { - if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } - } - } -} -// for a while we allowed uris *without* schemes and this is the migration -// for them, e.g. an uri without scheme and without strict-mode warns and falls -// back to the file-scheme. that should cause the least carnage and still be a -// clear warning -function _schemeFix(scheme, _strict) { - if (!scheme && !_strict) { - return 'file'; - } - return scheme; -} -// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 -function _referenceResolution(scheme, path) { - // the slash-character is our 'default base' as we don't - // support constructing URIs relative to other URIs. This - // also means that we alter and potentially break paths. - // see https://tools.ietf.org/html/rfc3986#section-5.1.4 - switch (scheme) { - case 'https': - case 'http': - case 'file': - if (!path) { - path = _slash; - } - else if (path[0] !== _slash) { - path = _slash + path; - } - break; - } - return path; -} -const _empty = ''; -const _slash = '/'; -const _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; -/** - * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. - * This class is a simple parser which creates the basic component parts - * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation - * and encoding. - * - * ```txt - * foo://example.com:8042/over/there?name=ferret#nose - * \_/ \______________/\_________/ \_________/ \__/ - * | | | | | - * scheme authority path query fragment - * | _____________________|__ - * / \ / \ - * urn:example:animal:ferret:nose - * ``` - */ -class URI { - /** - * @internal - */ - constructor(schemeOrData, authority, path, query, fragment, _strict = false) { - if (typeof schemeOrData === 'object') { - this.scheme = schemeOrData.scheme || _empty; - this.authority = schemeOrData.authority || _empty; - this.path = schemeOrData.path || _empty; - this.query = schemeOrData.query || _empty; - this.fragment = schemeOrData.fragment || _empty; - // no validation because it's this URI - // that creates uri components. - // _validateUri(this); - } - else { - this.scheme = _schemeFix(schemeOrData, _strict); - this.authority = authority || _empty; - this.path = _referenceResolution(this.scheme, path || _empty); - this.query = query || _empty; - this.fragment = fragment || _empty; - _validateUri(this, _strict); - } - } - static isUri(thing) { - if (thing instanceof URI) { - return true; - } - if (!thing) { - return false; - } - return typeof thing.authority === 'string' - && typeof thing.fragment === 'string' - && typeof thing.path === 'string' - && typeof thing.query === 'string' - && typeof thing.scheme === 'string' - && typeof thing.fsPath === 'function' - && typeof thing.with === 'function' - && typeof thing.toString === 'function'; - } - // ---- filesystem path ----------------------- - /** - * Returns a string representing the corresponding file system path of this URI. - * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the - * platform specific path separator. - * - * * Will *not* validate the path for invalid characters and semantics. - * * Will *not* look at the scheme of this URI. - * * The result shall *not* be used for display purposes but for accessing a file on disk. - * - * - * The *difference* to `URI#path` is the use of the platform specific separator and the handling - * of UNC paths. See the below sample of a file-uri with an authority (UNC path). - * - * ```ts - const u = URI.parse('file://server/c$/folder/file.txt') - u.authority === 'server' - u.path === '/shares/c$/file.txt' - u.fsPath === '\\server\c$\folder\file.txt' - ``` - * - * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, - * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working - * with URIs that represent files on disk (`file` scheme). - */ - get fsPath() { - // if (this.scheme !== 'file') { - // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); - // } - return uriToFsPath(this, false); - } - // ---- modify to new ------------------------- - with(change) { - if (!change) { - return this; - } - let { scheme, authority, path, query, fragment } = change; - if (scheme === undefined) { - scheme = this.scheme; - } - else if (scheme === null) { - scheme = _empty; - } - if (authority === undefined) { - authority = this.authority; - } - else if (authority === null) { - authority = _empty; - } - if (path === undefined) { - path = this.path; - } - else if (path === null) { - path = _empty; - } - if (query === undefined) { - query = this.query; - } - else if (query === null) { - query = _empty; - } - if (fragment === undefined) { - fragment = this.fragment; - } - else if (fragment === null) { - fragment = _empty; - } - if (scheme === this.scheme - && authority === this.authority - && path === this.path - && query === this.query - && fragment === this.fragment) { - return this; - } - return new Uri(scheme, authority, path, query, fragment); - } - // ---- parse & validate ------------------------ - /** - * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, - * `file:///usr/home`, or `scheme:with/path`. - * - * @param value A string which represents an URI (see `URI#toString`). - */ - static parse(value, _strict = false) { - const match = _regexp.exec(value); - if (!match) { - return new Uri(_empty, _empty, _empty, _empty, _empty); - } - return new Uri(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict); - } - /** - * Creates a new URI from a file system path, e.g. `c:\my\files`, - * `/usr/home`, or `\\server\share\some\path`. - * - * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument - * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** - * `URI.parse('file://' + path)` because the path might contain characters that are - * interpreted (# and ?). See the following sample: - * ```ts - const good = URI.file('/coding/c#/project1'); - good.scheme === 'file'; - good.path === '/coding/c#/project1'; - good.fragment === ''; - const bad = URI.parse('file://' + '/coding/c#/project1'); - bad.scheme === 'file'; - bad.path === '/coding/c'; // path is now broken - bad.fragment === '/project1'; - ``` - * - * @param path A file system path (see `URI#fsPath`) - */ - static file(path) { - let authority = _empty; - // normalize to fwd-slashes on windows, - // on other systems bwd-slashes are valid - // filename character, eg /f\oo/ba\r.txt - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - path = path.replace(/\\/g, _slash); - } - // check for authority as used in UNC shares - // or use the path as given - if (path[0] === _slash && path[1] === _slash) { - const idx = path.indexOf(_slash, 2); - if (idx === -1) { - authority = path.substring(2); - path = _slash; - } - else { - authority = path.substring(2, idx); - path = path.substring(idx) || _slash; - } - } - return new Uri('file', authority, path, _empty, _empty); - } - static from(components) { - return new Uri(components.scheme, components.authority, components.path, components.query, components.fragment); - } - /** - * Join a URI path with path fragments and normalizes the resulting path. - * - * @param uri The input URI. - * @param pathFragment The path fragment to add to the URI path. - * @returns The resulting URI. - */ - static joinPath(uri, ...pathFragment) { - if (!uri.path) { - throw new Error(`[UriError]: cannot call joinPaths on URI without path`); - } - let newPath; - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"] && uri.scheme === 'file') { - newPath = URI.file(_path_js__WEBPACK_IMPORTED_MODULE_1__["win32"].join(uriToFsPath(uri, true), ...pathFragment)).path; - } - else { - newPath = _path_js__WEBPACK_IMPORTED_MODULE_1__["posix"].join(uri.path, ...pathFragment); - } - return uri.with({ path: newPath }); - } - // ---- printing/externalize --------------------------- - /** - * Creates a string representation for this URI. It's guaranteed that calling - * `URI.parse` with the result of this function creates an URI which is equal - * to this URI. - * - * * The result shall *not* be used for display purposes but for externalization or transport. - * * The result will be encoded using the percentage encoding and encoding happens mostly - * ignore the scheme-specific encoding rules. - * - * @param skipEncoding Do not encode the result, default is `false` - */ - toString(skipEncoding = false) { - return _asFormatted(this, skipEncoding); - } - toJSON() { - return this; - } - static revive(data) { - if (!data) { - return data; - } - else if (data instanceof URI) { - return data; - } - else { - const result = new Uri(data); - result._formatted = data.external; - result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null; - return result; - } - } -} -const _pathSepMarker = _platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"] ? 1 : undefined; -// This class exists so that URI is compatibile with vscode.Uri (API). -class Uri extends URI { - constructor() { - super(...arguments); - this._formatted = null; - this._fsPath = null; - } - get fsPath() { - if (!this._fsPath) { - this._fsPath = uriToFsPath(this, false); - } - return this._fsPath; - } - toString(skipEncoding = false) { - if (!skipEncoding) { - if (!this._formatted) { - this._formatted = _asFormatted(this, false); - } - return this._formatted; - } - else { - // we don't cache that - return _asFormatted(this, true); - } - } - toJSON() { - const res = { - $mid: 1 - }; - // cached state - if (this._fsPath) { - res.fsPath = this._fsPath; - res._sep = _pathSepMarker; - } - if (this._formatted) { - res.external = this._formatted; - } - // uri components - if (this.path) { - res.path = this.path; - } - if (this.scheme) { - res.scheme = this.scheme; - } - if (this.authority) { - res.authority = this.authority; - } - if (this.query) { - res.query = this.query; - } - if (this.fragment) { - res.fragment = this.fragment; - } - return res; - } -} -// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 -const encodeTable = { - [58 /* Colon */]: '%3A', - [47 /* Slash */]: '%2F', - [63 /* QuestionMark */]: '%3F', - [35 /* Hash */]: '%23', - [91 /* OpenSquareBracket */]: '%5B', - [93 /* CloseSquareBracket */]: '%5D', - [64 /* AtSign */]: '%40', - [33 /* ExclamationMark */]: '%21', - [36 /* DollarSign */]: '%24', - [38 /* Ampersand */]: '%26', - [39 /* SingleQuote */]: '%27', - [40 /* OpenParen */]: '%28', - [41 /* CloseParen */]: '%29', - [42 /* Asterisk */]: '%2A', - [43 /* Plus */]: '%2B', - [44 /* Comma */]: '%2C', - [59 /* Semicolon */]: '%3B', - [61 /* Equals */]: '%3D', - [32 /* Space */]: '%20', -}; -function encodeURIComponentFast(uriComponent, allowSlash) { - let res = undefined; - let nativeEncodePos = -1; - for (let pos = 0; pos < uriComponent.length; pos++) { - const code = uriComponent.charCodeAt(pos); - // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 - if ((code >= 97 /* a */ && code <= 122 /* z */) - || (code >= 65 /* A */ && code <= 90 /* Z */) - || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) - || code === 45 /* Dash */ - || code === 46 /* Period */ - || code === 95 /* Underline */ - || code === 126 /* Tilde */ - || (allowSlash && code === 47 /* Slash */)) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // check if we write into a new string (by default we try to return the param) - if (res !== undefined) { - res += uriComponent.charAt(pos); - } - } - else { - // encoding needed, we need to allocate a new string - if (res === undefined) { - res = uriComponent.substr(0, pos); - } - // check with default table first - const escaped = encodeTable[code]; - if (escaped !== undefined) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // append escaped variant to result - res += escaped; - } - else if (nativeEncodePos === -1) { - // use native encode only when needed - nativeEncodePos = pos; - } - } - } - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); - } - return res !== undefined ? res : uriComponent; -} -function encodeURIComponentMinimal(path) { - let res = undefined; - for (let pos = 0; pos < path.length; pos++) { - const code = path.charCodeAt(pos); - if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { - if (res === undefined) { - res = path.substr(0, pos); - } - res += encodeTable[code]; - } - else { - if (res !== undefined) { - res += path[pos]; - } - } - } - return res !== undefined ? res : path; -} -/** - * Compute `fsPath` for the given uri - */ -function uriToFsPath(uri, keepDriveLetterCasing) { - let value; - if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { - // unc path: file://shares/c$/far/boo - value = `//${uri.authority}${uri.path}`; - } - else if (uri.path.charCodeAt(0) === 47 /* Slash */ - && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) - && uri.path.charCodeAt(2) === 58 /* Colon */) { - if (!keepDriveLetterCasing) { - // windows drive letter: file:///c:/far/boo - value = uri.path[1].toLowerCase() + uri.path.substr(2); - } - else { - value = uri.path.substr(1); - } - } - else { - // other path - value = uri.path; - } - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - value = value.replace(/\//g, '\\'); - } - return value; -} -/** - * Create the external version of a uri - */ -function _asFormatted(uri, skipEncoding) { - const encoder = !skipEncoding - ? encodeURIComponentFast - : encodeURIComponentMinimal; - let res = ''; - let { scheme, authority, path, query, fragment } = uri; - if (scheme) { - res += scheme; - res += ':'; - } - if (authority || scheme === 'file') { - res += _slash; - res += _slash; - } - if (authority) { - let idx = authority.indexOf('@'); - if (idx !== -1) { - // @ - const userinfo = authority.substr(0, idx); - authority = authority.substr(idx + 1); - idx = userinfo.indexOf(':'); - if (idx === -1) { - res += encoder(userinfo, false); - } - else { - // :@ - res += encoder(userinfo.substr(0, idx), false); - res += ':'; - res += encoder(userinfo.substr(idx + 1), false); - } - res += '@'; - } - authority = authority.toLowerCase(); - idx = authority.indexOf(':'); - if (idx === -1) { - res += encoder(authority, false); - } - else { - // : - res += encoder(authority.substr(0, idx), false); - res += authority.substr(idx); - } - } - if (path) { - // lower-case windows drive letters in /C:/fff or C:/fff - if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { - const code = path.charCodeAt(1); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`; // "/c:".length === 3 - } - } - else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { - const code = path.charCodeAt(0); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`; // "/c:".length === 3 - } - } - // encode the rest of the path - res += encoder(path, true); - } - if (query) { - res += '?'; - res += encoder(query, false); - } - if (fragment) { - res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; - } - return res; -} -// --- decode -function decodeURIComponentGraceful(str) { - try { - return decodeURIComponent(str); - } - catch (_a) { - if (str.length > 3) { - return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3)); - } - else { - return str; - } - } -} -const _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g; -function percentDecode(str) { - if (!str.match(_rEncodedAsHex)) { - return str; - } - return str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match)); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js ***! - \******************************************************************************/ -/*! exports provided: logOnceWebWorkerWarning, SimpleWorkerClient, SimpleWorkerServer, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logOnceWebWorkerWarning", function() { return logOnceWebWorkerWarning; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerClient", function() { return SimpleWorkerClient; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerServer", function() { return SimpleWorkerServer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -const INITIALIZE = '$initialize'; -let webWorkerWarningLogged = false; -function logOnceWebWorkerWarning(err) { - if (!_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWeb"]) { - // running tests - return; - } - if (!webWorkerWarningLogged) { - webWorkerWarningLogged = true; - console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); - } - console.warn(err.message); -} -class SimpleWorkerProtocol { - constructor(handler) { - this._workerId = -1; - this._handler = handler; - this._lastSentReq = 0; - this._pendingReplies = Object.create(null); - } - setWorkerId(workerId) { - this._workerId = workerId; - } - sendMessage(method, args) { - let req = String(++this._lastSentReq); - return new Promise((resolve, reject) => { - this._pendingReplies[req] = { - resolve: resolve, - reject: reject - }; - this._send({ - vsWorker: this._workerId, - req: req, - method: method, - args: args - }); - }); - } - handleMessage(message) { - if (!message || !message.vsWorker) { - return; - } - if (this._workerId !== -1 && message.vsWorker !== this._workerId) { - return; - } - this._handleMessage(message); - } - _handleMessage(msg) { - if (msg.seq) { - let replyMessage = msg; - if (!this._pendingReplies[replyMessage.seq]) { - console.warn('Got reply to unknown seq'); - return; - } - let reply = this._pendingReplies[replyMessage.seq]; - delete this._pendingReplies[replyMessage.seq]; - if (replyMessage.err) { - let err = replyMessage.err; - if (replyMessage.err.$isError) { - err = new Error(); - err.name = replyMessage.err.name; - err.message = replyMessage.err.message; - err.stack = replyMessage.err.stack; - } - reply.reject(err); - return; - } - reply.resolve(replyMessage.res); - return; - } - let requestMessage = msg; - let req = requestMessage.req; - let result = this._handler.handleMessage(requestMessage.method, requestMessage.args); - result.then((r) => { - this._send({ - vsWorker: this._workerId, - seq: req, - res: r, - err: undefined - }); - }, (e) => { - if (e.detail instanceof Error) { - // Loading errors have a detail property that points to the actual error - e.detail = Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e.detail); - } - this._send({ - vsWorker: this._workerId, - seq: req, - res: undefined, - err: Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e) - }); - }); - } - _send(msg) { - let transfer = []; - if (msg.req) { - const m = msg; - for (let i = 0; i < m.args.length; i++) { - if (m.args[i] instanceof ArrayBuffer) { - transfer.push(m.args[i]); - } - } - } - else { - const m = msg; - if (m.res instanceof ArrayBuffer) { - transfer.push(m.res); - } - } - this._handler.sendMessage(msg, transfer); - } -} -/** - * Main thread side - */ -class SimpleWorkerClient extends _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"] { - constructor(workerFactory, moduleId, host) { - super(); - let lazyProxyReject = null; - this._worker = this._register(workerFactory.create('vs/base/common/worker/simpleWorker', (msg) => { - this._protocol.handleMessage(msg); - }, (err) => { - // in Firefox, web workers fail lazily :( - // we will reject the proxy - if (lazyProxyReject) { - lazyProxyReject(err); - } - })); - this._protocol = new SimpleWorkerProtocol({ - sendMessage: (msg, transfer) => { - this._worker.postMessage(msg, transfer); - }, - handleMessage: (method, args) => { - if (typeof host[method] !== 'function') { - return Promise.reject(new Error('Missing method ' + method + ' on main thread host.')); - } - try { - return Promise.resolve(host[method].apply(host, args)); - } - catch (e) { - return Promise.reject(e); - } - } - }); - this._protocol.setWorkerId(this._worker.getId()); - // Gather loader configuration - let loaderConfiguration = null; - if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { - // Get the configuration from the Monaco AMD Loader - loaderConfiguration = self.require.getConfig(); - } - else if (typeof self.requirejs !== 'undefined') { - // Get the configuration from requirejs - loaderConfiguration = self.requirejs.s.contexts._.config; - } - const hostMethods = _types_js__WEBPACK_IMPORTED_MODULE_3__["getAllMethodNames"](host); - // Send initialize message - this._onModuleLoaded = this._protocol.sendMessage(INITIALIZE, [ - this._worker.getId(), - JSON.parse(JSON.stringify(loaderConfiguration)), - moduleId, - hostMethods, - ]); - // Create proxy to loaded code - const proxyMethodRequest = (method, args) => { - return this._request(method, args); - }; - this._lazyProxy = new Promise((resolve, reject) => { - lazyProxyReject = reject; - this._onModuleLoaded.then((availableMethods) => { - resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__["createProxyObject"](availableMethods, proxyMethodRequest)); - }, (e) => { - reject(e); - this._onError('Worker failed to load ' + moduleId, e); - }); - }); - } - getProxyObject() { - return this._lazyProxy; - } - _request(method, args) { - return new Promise((resolve, reject) => { - this._onModuleLoaded.then(() => { - this._protocol.sendMessage(method, args).then(resolve, reject); - }, reject); - }); - } - _onError(message, error) { - console.error(message); - console.info(error); - } -} -/** - * Worker side - */ -class SimpleWorkerServer { - constructor(postMessage, requestHandlerFactory) { - this._requestHandlerFactory = requestHandlerFactory; - this._requestHandler = null; - this._protocol = new SimpleWorkerProtocol({ - sendMessage: (msg, transfer) => { - postMessage(msg, transfer); - }, - handleMessage: (method, args) => this._handleMessage(method, args) - }); - } - onmessage(msg) { - this._protocol.handleMessage(msg); - } - _handleMessage(method, args) { - if (method === INITIALIZE) { - return this.initialize(args[0], args[1], args[2], args[3]); - } - if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); - } - catch (e) { - return Promise.reject(e); - } - } - initialize(workerId, loaderConfig, moduleId, hostMethods) { - this._protocol.setWorkerId(workerId); - const proxyMethodRequest = (method, args) => { - return this._protocol.sendMessage(method, args); - }; - const hostProxy = _types_js__WEBPACK_IMPORTED_MODULE_3__["createProxyObject"](hostMethods, proxyMethodRequest); - if (this._requestHandlerFactory) { - // static request handler - this._requestHandler = this._requestHandlerFactory(hostProxy); - return Promise.resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllMethodNames"](this._requestHandler)); - } - if (loaderConfig) { - // Remove 'baseUrl', handling it is beyond scope for now - if (typeof loaderConfig.baseUrl !== 'undefined') { - delete loaderConfig['baseUrl']; - } - if (typeof loaderConfig.paths !== 'undefined') { - if (typeof loaderConfig.paths.vs !== 'undefined') { - delete loaderConfig.paths['vs']; - } - } - // Since this is in a web worker, enable catching errors - loaderConfig.catchError = true; - self.require.config(loaderConfig); - } - return new Promise((resolve, reject) => { - // Use the global require to be sure to get the global config - self.require([moduleId], (module) => { - this._requestHandler = module.create(hostProxy); - if (!this._requestHandler) { - reject(new Error(`No RequestHandler!`)); - return; - } - resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllMethodNames"](this._requestHandler)); - }, reject); - }); - } -} -/** - * Called on the worker side - */ -function create(postMessage) { - return new SimpleWorkerServer(postMessage, null); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js ***! - \*************************************************************************************/ -/*! exports provided: CharacterClassifier, CharacterSet */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterClassifier", function() { return CharacterClassifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterSet", function() { return CharacterSet; }); -/* harmony import */ var _base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uint.js */ "./node_modules/monaco-editor/esm/vs/base/common/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A fast character classifier that uses a compact array for ASCII values. - */ -class CharacterClassifier { - constructor(_defaultValue) { - let defaultValue = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_defaultValue); - this._defaultValue = defaultValue; - this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); - this._map = new Map(); - } - static _createAsciiMap(defaultValue) { - let asciiMap = new Uint8Array(256); - for (let i = 0; i < 256; i++) { - asciiMap[i] = defaultValue; - } - return asciiMap; - } - set(charCode, _value) { - let value = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_value); - if (charCode >= 0 && charCode < 256) { - this._asciiMap[charCode] = value; - } - else { - this._map.set(charCode, value); - } - } - get(charCode) { - if (charCode >= 0 && charCode < 256) { - return this._asciiMap[charCode]; - } - else { - return (this._map.get(charCode) || this._defaultValue); - } - } -} -class CharacterSet { - constructor() { - this._actual = new CharacterClassifier(0 /* False */); - } - add(charCode) { - this._actual.set(charCode, 1 /* True */); - } - has(charCode) { - return (this._actual.get(charCode) === 1 /* True */); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js ***! - \**************************************************************************/ -/*! exports provided: Position */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * A position in the editor. - */ -class Position { - constructor(lineNumber, column) { - this.lineNumber = lineNumber; - this.column = column; - } - /** - * Create a new position from this position. - * - * @param newLineNumber new line number - * @param newColumn new column - */ - with(newLineNumber = this.lineNumber, newColumn = this.column) { - if (newLineNumber === this.lineNumber && newColumn === this.column) { - return this; - } - else { - return new Position(newLineNumber, newColumn); - } - } - /** - * Derive a new position from this position. - * - * @param deltaLineNumber line number delta - * @param deltaColumn column delta - */ - delta(deltaLineNumber = 0, deltaColumn = 0) { - return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); - } - /** - * Test if this position equals other position - */ - equals(other) { - return Position.equals(this, other); - } - /** - * Test if position `a` equals position `b` - */ - static equals(a, b) { - if (!a && !b) { - return true; - } - return (!!a && - !!b && - a.lineNumber === b.lineNumber && - a.column === b.column); - } - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be false. - */ - isBefore(other) { - return Position.isBefore(this, other); - } - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be false. - */ - static isBefore(a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column < b.column; - } - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be true. - */ - isBeforeOrEqual(other) { - return Position.isBeforeOrEqual(this, other); - } - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be true. - */ - static isBeforeOrEqual(a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column <= b.column; - } - /** - * A function that compares positions, useful for sorting - */ - static compare(a, b) { - let aLineNumber = a.lineNumber | 0; - let bLineNumber = b.lineNumber | 0; - if (aLineNumber === bLineNumber) { - let aColumn = a.column | 0; - let bColumn = b.column | 0; - return aColumn - bColumn; - } - return aLineNumber - bLineNumber; - } - /** - * Clone this position. - */ - clone() { - return new Position(this.lineNumber, this.column); - } - /** - * Convert to a human-readable representation. - */ - toString() { - return '(' + this.lineNumber + ',' + this.column + ')'; - } - // --- - /** - * Create a `Position` from an `IPosition`. - */ - static lift(pos) { - return new Position(pos.lineNumber, pos.column); - } - /** - * Test if `obj` is an `IPosition`. - */ - static isIPosition(obj) { - return (obj - && (typeof obj.lineNumber === 'number') - && (typeof obj.column === 'number')); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js ***! - \***********************************************************************/ -/*! exports provided: Range */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) - */ -class Range { - constructor(startLineNumber, startColumn, endLineNumber, endColumn) { - if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { - this.startLineNumber = endLineNumber; - this.startColumn = endColumn; - this.endLineNumber = startLineNumber; - this.endColumn = startColumn; - } - else { - this.startLineNumber = startLineNumber; - this.startColumn = startColumn; - this.endLineNumber = endLineNumber; - this.endColumn = endColumn; - } - } - /** - * Test if this range is empty. - */ - isEmpty() { - return Range.isEmpty(this); - } - /** - * Test if `range` is empty. - */ - static isEmpty(range) { - return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); - } - /** - * Test if position is in this range. If the position is at the edges, will return true. - */ - containsPosition(position) { - return Range.containsPosition(this, position); - } - /** - * Test if `position` is in `range`. If the position is at the edges, will return true. - */ - static containsPosition(range, position) { - if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { - return false; - } - if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { - return false; - } - if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { - return false; - } - return true; - } - /** - * Test if range is in this range. If the range is equal to this range, will return true. - */ - containsRange(range) { - return Range.containsRange(this, range); - } - /** - * Test if `otherRange` is in `range`. If the ranges are equal, will return true. - */ - static containsRange(range, otherRange) { - if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { - return false; - } - if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { - return false; - } - if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { - return false; - } - if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { - return false; - } - return true; - } - /** - * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true. - */ - strictContainsRange(range) { - return Range.strictContainsRange(this, range); - } - /** - * Test if `otherRange` is strinctly in `range` (must start after, and end before). If the ranges are equal, will return false. - */ - static strictContainsRange(range, otherRange) { - if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { - return false; - } - if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { - return false; - } - if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) { - return false; - } - if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) { - return false; - } - return true; - } - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - plusRange(range) { - return Range.plusRange(this, range); - } - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - static plusRange(a, b) { - let startLineNumber; - let startColumn; - let endLineNumber; - let endColumn; - if (b.startLineNumber < a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = b.startColumn; - } - else if (b.startLineNumber === a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = Math.min(b.startColumn, a.startColumn); - } - else { - startLineNumber = a.startLineNumber; - startColumn = a.startColumn; - } - if (b.endLineNumber > a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = b.endColumn; - } - else if (b.endLineNumber === a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = Math.max(b.endColumn, a.endColumn); - } - else { - endLineNumber = a.endLineNumber; - endColumn = a.endColumn; - } - return new Range(startLineNumber, startColumn, endLineNumber, endColumn); - } - /** - * A intersection of the two ranges. - */ - intersectRanges(range) { - return Range.intersectRanges(this, range); - } - /** - * A intersection of the two ranges. - */ - static intersectRanges(a, b) { - let resultStartLineNumber = a.startLineNumber; - let resultStartColumn = a.startColumn; - let resultEndLineNumber = a.endLineNumber; - let resultEndColumn = a.endColumn; - let otherStartLineNumber = b.startLineNumber; - let otherStartColumn = b.startColumn; - let otherEndLineNumber = b.endLineNumber; - let otherEndColumn = b.endColumn; - if (resultStartLineNumber < otherStartLineNumber) { - resultStartLineNumber = otherStartLineNumber; - resultStartColumn = otherStartColumn; - } - else if (resultStartLineNumber === otherStartLineNumber) { - resultStartColumn = Math.max(resultStartColumn, otherStartColumn); - } - if (resultEndLineNumber > otherEndLineNumber) { - resultEndLineNumber = otherEndLineNumber; - resultEndColumn = otherEndColumn; - } - else if (resultEndLineNumber === otherEndLineNumber) { - resultEndColumn = Math.min(resultEndColumn, otherEndColumn); - } - // Check if selection is now empty - if (resultStartLineNumber > resultEndLineNumber) { - return null; - } - if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { - return null; - } - return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); - } - /** - * Test if this range equals other. - */ - equalsRange(other) { - return Range.equalsRange(this, other); - } - /** - * Test if range `a` equals `b`. - */ - static equalsRange(a, b) { - return (!!a && - !!b && - a.startLineNumber === b.startLineNumber && - a.startColumn === b.startColumn && - a.endLineNumber === b.endLineNumber && - a.endColumn === b.endColumn); - } - /** - * Return the end position (which will be after or equal to the start position) - */ - getEndPosition() { - return Range.getEndPosition(this); - } - /** - * Return the end position (which will be after or equal to the start position) - */ - static getEndPosition(range) { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](range.endLineNumber, range.endColumn); - } - /** - * Return the start position (which will be before or equal to the end position) - */ - getStartPosition() { - return Range.getStartPosition(this); - } - /** - * Return the start position (which will be before or equal to the end position) - */ - static getStartPosition(range) { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](range.startLineNumber, range.startColumn); - } - /** - * Transform to a user presentable string representation. - */ - toString() { - return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; - } - /** - * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. - */ - setEndPosition(endLineNumber, endColumn) { - return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - } - /** - * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. - */ - setStartPosition(startLineNumber, startColumn) { - return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - } - /** - * Create a new empty range using this range's start position. - */ - collapseToStart() { - return Range.collapseToStart(this); - } - /** - * Create a new empty range using this range's start position. - */ - static collapseToStart(range) { - return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); - } - // --- - static fromPositions(start, end = start) { - return new Range(start.lineNumber, start.column, end.lineNumber, end.column); - } - static lift(range) { - if (!range) { - return null; - } - return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); - } - /** - * Test if `obj` is an `IRange`. - */ - static isIRange(obj) { - return (obj - && (typeof obj.startLineNumber === 'number') - && (typeof obj.startColumn === 'number') - && (typeof obj.endLineNumber === 'number') - && (typeof obj.endColumn === 'number')); - } - /** - * Test if the two ranges are touching in any way. - */ - static areIntersectingOrTouching(a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - } - /** - * Test if the two ranges are intersecting. If the ranges are touching it returns true. - */ - static areIntersecting(a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - } - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the startPosition and then on the endPosition - */ - static compareRangesUsingStarts(a, b) { - if (a && b) { - const aStartLineNumber = a.startLineNumber | 0; - const bStartLineNumber = b.startLineNumber | 0; - if (aStartLineNumber === bStartLineNumber) { - const aStartColumn = a.startColumn | 0; - const bStartColumn = b.startColumn | 0; - if (aStartColumn === bStartColumn) { - const aEndLineNumber = a.endLineNumber | 0; - const bEndLineNumber = b.endLineNumber | 0; - if (aEndLineNumber === bEndLineNumber) { - const aEndColumn = a.endColumn | 0; - const bEndColumn = b.endColumn | 0; - return aEndColumn - bEndColumn; - } - return aEndLineNumber - bEndLineNumber; - } - return aStartColumn - bStartColumn; - } - return aStartLineNumber - bStartLineNumber; - } - const aExists = (a ? 1 : 0); - const bExists = (b ? 1 : 0); - return aExists - bExists; - } - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the endPosition and then on the startPosition - */ - static compareRangesUsingEnds(a, b) { - if (a.endLineNumber === b.endLineNumber) { - if (a.endColumn === b.endColumn) { - if (a.startLineNumber === b.startLineNumber) { - return a.startColumn - b.startColumn; - } - return a.startLineNumber - b.startLineNumber; - } - return a.endColumn - b.endColumn; - } - return a.endLineNumber - b.endLineNumber; - } - /** - * Test if the range spans multiple lines. - */ - static spansMultipleLines(range) { - return range.endLineNumber > range.startLineNumber; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js ***! - \***************************************************************************/ -/*! exports provided: Selection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return Selection; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -/** - * A selection in the editor. - * The selection is a range that has an orientation. - */ -class Selection extends _range_js__WEBPACK_IMPORTED_MODULE_1__["Range"] { - constructor(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { - super(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn); - this.selectionStartLineNumber = selectionStartLineNumber; - this.selectionStartColumn = selectionStartColumn; - this.positionLineNumber = positionLineNumber; - this.positionColumn = positionColumn; - } - /** - * Transform to a human-readable representation. - */ - toString() { - return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; - } - /** - * Test if equals other selection. - */ - equalsSelection(other) { - return (Selection.selectionsEqual(this, other)); - } - /** - * Test if the two selections are equal. - */ - static selectionsEqual(a, b) { - return (a.selectionStartLineNumber === b.selectionStartLineNumber && - a.selectionStartColumn === b.selectionStartColumn && - a.positionLineNumber === b.positionLineNumber && - a.positionColumn === b.positionColumn); - } - /** - * Get directions (LTR or RTL). - */ - getDirection() { - if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { - return 0 /* LTR */; - } - return 1 /* RTL */; - } - /** - * Create a new selection with a different `positionLineNumber` and `positionColumn`. - */ - setEndPosition(endLineNumber, endColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); - } - /** - * Get the position at `positionLineNumber` and `positionColumn`. - */ - getPosition() { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.positionLineNumber, this.positionColumn); - } - /** - * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. - */ - setStartPosition(startLineNumber, startColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - } - return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); - } - // ---- - /** - * Create a `Selection` from one or two positions - */ - static fromPositions(start, end = start) { - return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); - } - /** - * Create a `Selection` from an `ISelection`. - */ - static liftSelection(sel) { - return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); - } - /** - * `a` equals `b`. - */ - static selectionsArrEqual(a, b) { - if (a && !b || !a && b) { - return false; - } - if (!a && !b) { - return true; - } - if (a.length !== b.length) { - return false; - } - for (let i = 0, len = a.length; i < len; i++) { - if (!this.selectionsEqual(a[i], b[i])) { - return false; - } - } - return true; - } - /** - * Test if `obj` is an `ISelection`. - */ - static isISelection(obj) { - return (obj - && (typeof obj.selectionStartLineNumber === 'number') - && (typeof obj.selectionStartColumn === 'number') - && (typeof obj.positionLineNumber === 'number') - && (typeof obj.positionColumn === 'number')); - } - /** - * Create with a direction. - */ - static createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, direction) { - if (direction === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js ***! - \***********************************************************************/ -/*! exports provided: Token, TokenizationResult, TokenizationResult2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult", function() { return TokenizationResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult2", function() { return TokenizationResult2; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class Token { - constructor(offset, type, language) { - this.offset = offset | 0; // @perf - this.type = type; - this.language = language; - } - toString() { - return '(' + this.offset + ', ' + this.type + ')'; - } -} -class TokenizationResult { - constructor(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } -} -class TokenizationResult2 { - constructor(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js ***! - \******************************************************************************/ -/*! exports provided: DiffComputer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffComputer", function() { return DiffComputer; }); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -const MINIMUM_MATCHING_CHARACTER_LENGTH = 3; -function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) { - const diffAlgo = new _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__["LcsDiff"](originalSequence, modifiedSequence, continueProcessingPredicate); - return diffAlgo.ComputeDiff(pretty); -} -class LineSequence { - constructor(lines) { - const startColumns = []; - const endColumns = []; - for (let i = 0, length = lines.length; i < length; i++) { - startColumns[i] = getFirstNonBlankColumn(lines[i], 1); - endColumns[i] = getLastNonBlankColumn(lines[i], 1); - } - this.lines = lines; - this._startColumns = startColumns; - this._endColumns = endColumns; - } - getElements() { - const elements = []; - for (let i = 0, len = this.lines.length; i < len; i++) { - elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1); - } - return elements; - } - getStartLineNumber(i) { - return i + 1; - } - getEndLineNumber(i) { - return i + 1; - } - createCharSequence(shouldIgnoreTrimWhitespace, startIndex, endIndex) { - const charCodes = []; - const lineNumbers = []; - const columns = []; - let len = 0; - for (let index = startIndex; index <= endIndex; index++) { - const lineContent = this.lines[index]; - const startColumn = (shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1); - const endColumn = (shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1); - for (let col = startColumn; col < endColumn; col++) { - charCodes[len] = lineContent.charCodeAt(col - 1); - lineNumbers[len] = index + 1; - columns[len] = col; - len++; - } - } - return new CharSequence(charCodes, lineNumbers, columns); - } -} -class CharSequence { - constructor(charCodes, lineNumbers, columns) { - this._charCodes = charCodes; - this._lineNumbers = lineNumbers; - this._columns = columns; - } - getElements() { - return this._charCodes; - } - getStartLineNumber(i) { - return this._lineNumbers[i]; - } - getStartColumn(i) { - return this._columns[i]; - } - getEndLineNumber(i) { - return this._lineNumbers[i]; - } - getEndColumn(i) { - return this._columns[i] + 1; - } -} -class CharChange { - constructor(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) { - this.originalStartLineNumber = originalStartLineNumber; - this.originalStartColumn = originalStartColumn; - this.originalEndLineNumber = originalEndLineNumber; - this.originalEndColumn = originalEndColumn; - this.modifiedStartLineNumber = modifiedStartLineNumber; - this.modifiedStartColumn = modifiedStartColumn; - this.modifiedEndLineNumber = modifiedEndLineNumber; - this.modifiedEndColumn = modifiedEndColumn; - } - static createFromDiffChange(diffChange, originalCharSequence, modifiedCharSequence) { - let originalStartLineNumber; - let originalStartColumn; - let originalEndLineNumber; - let originalEndColumn; - let modifiedStartLineNumber; - let modifiedStartColumn; - let modifiedEndLineNumber; - let modifiedEndColumn; - if (diffChange.originalLength === 0) { - originalStartLineNumber = 0; - originalStartColumn = 0; - originalEndLineNumber = 0; - originalEndColumn = 0; - } - else { - originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart); - originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart); - originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1); - originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1); - } - if (diffChange.modifiedLength === 0) { - modifiedStartLineNumber = 0; - modifiedStartColumn = 0; - modifiedEndLineNumber = 0; - modifiedEndColumn = 0; - } - else { - modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart); - modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart); - modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1); - modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1); - } - return new CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn); - } -} -function postProcessCharChanges(rawChanges) { - if (rawChanges.length <= 1) { - return rawChanges; - } - const result = [rawChanges[0]]; - let prevChange = result[0]; - for (let i = 1, len = rawChanges.length; i < len; i++) { - const currChange = rawChanges[i]; - const originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength); - const modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength); - // Both of the above should be equal, but the continueProcessingPredicate may prevent this from being true - const matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength); - if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) { - // Merge the current change into the previous one - prevChange.originalLength = (currChange.originalStart + currChange.originalLength) - prevChange.originalStart; - prevChange.modifiedLength = (currChange.modifiedStart + currChange.modifiedLength) - prevChange.modifiedStart; - } - else { - // Add the current change - result.push(currChange); - prevChange = currChange; - } - } - return result; -} -class LineChange { - constructor(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges) { - this.originalStartLineNumber = originalStartLineNumber; - this.originalEndLineNumber = originalEndLineNumber; - this.modifiedStartLineNumber = modifiedStartLineNumber; - this.modifiedEndLineNumber = modifiedEndLineNumber; - this.charChanges = charChanges; - } - static createFromDiffResult(shouldIgnoreTrimWhitespace, diffChange, originalLineSequence, modifiedLineSequence, continueCharDiff, shouldComputeCharChanges, shouldPostProcessCharChanges) { - let originalStartLineNumber; - let originalEndLineNumber; - let modifiedStartLineNumber; - let modifiedEndLineNumber; - let charChanges = undefined; - if (diffChange.originalLength === 0) { - originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1; - originalEndLineNumber = 0; - } - else { - originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart); - originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1); - } - if (diffChange.modifiedLength === 0) { - modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1; - modifiedEndLineNumber = 0; - } - else { - modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart); - modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1); - } - if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) { - // Compute character changes for diff chunks of at most 20 lines... - const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1); - const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1); - let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes; - if (shouldPostProcessCharChanges) { - rawChanges = postProcessCharChanges(rawChanges); - } - charChanges = []; - for (let i = 0, length = rawChanges.length; i < length; i++) { - charChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence)); - } - } - return new LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges); - } -} -class DiffComputer { - constructor(originalLines, modifiedLines, opts) { - this.shouldComputeCharChanges = opts.shouldComputeCharChanges; - this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges; - this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace; - this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff; - this.originalLines = originalLines; - this.modifiedLines = modifiedLines; - this.original = new LineSequence(originalLines); - this.modified = new LineSequence(modifiedLines); - this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime); - this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5000)); // never run after 5s for character changes... - } - computeDiff() { - if (this.original.lines.length === 1 && this.original.lines[0].length === 0) { - // empty original => fast path - return { - quitEarly: false, - changes: [{ - originalStartLineNumber: 1, - originalEndLineNumber: 1, - modifiedStartLineNumber: 1, - modifiedEndLineNumber: this.modified.lines.length, - charChanges: [{ - modifiedEndColumn: 0, - modifiedEndLineNumber: 0, - modifiedStartColumn: 0, - modifiedStartLineNumber: 0, - originalEndColumn: 0, - originalEndLineNumber: 0, - originalStartColumn: 0, - originalStartLineNumber: 0 - }] - }] - }; - } - if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) { - // empty modified => fast path - return { - quitEarly: false, - changes: [{ - originalStartLineNumber: 1, - originalEndLineNumber: this.original.lines.length, - modifiedStartLineNumber: 1, - modifiedEndLineNumber: 1, - charChanges: [{ - modifiedEndColumn: 0, - modifiedEndLineNumber: 0, - modifiedStartColumn: 0, - modifiedStartLineNumber: 0, - originalEndColumn: 0, - originalEndLineNumber: 0, - originalStartColumn: 0, - originalStartLineNumber: 0 - }] - }] - }; - } - const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff); - const rawChanges = diffResult.changes; - const quitEarly = diffResult.quitEarly; - // The diff is always computed with ignoring trim whitespace - // This ensures we get the prettiest diff - if (this.shouldIgnoreTrimWhitespace) { - const lineChanges = []; - for (let i = 0, length = rawChanges.length; i < length; i++) { - lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)); - } - return { - quitEarly: quitEarly, - changes: lineChanges - }; - } - // Need to post-process and introduce changes where the trim whitespace is different - // Note that we are looping starting at -1 to also cover the lines before the first change - const result = []; - let originalLineIndex = 0; - let modifiedLineIndex = 0; - for (let i = -1 /* !!!! */, len = rawChanges.length; i < len; i++) { - const nextChange = (i + 1 < len ? rawChanges[i + 1] : null); - const originalStop = (nextChange ? nextChange.originalStart : this.originalLines.length); - const modifiedStop = (nextChange ? nextChange.modifiedStart : this.modifiedLines.length); - while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) { - const originalLine = this.originalLines[originalLineIndex]; - const modifiedLine = this.modifiedLines[modifiedLineIndex]; - if (originalLine !== modifiedLine) { - // These lines differ only in trim whitespace - // Check the leading whitespace - { - let originalStartColumn = getFirstNonBlankColumn(originalLine, 1); - let modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1); - while (originalStartColumn > 1 && modifiedStartColumn > 1) { - const originalChar = originalLine.charCodeAt(originalStartColumn - 2); - const modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2); - if (originalChar !== modifiedChar) { - break; - } - originalStartColumn--; - modifiedStartColumn--; - } - if (originalStartColumn > 1 || modifiedStartColumn > 1) { - this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, 1, originalStartColumn, modifiedLineIndex + 1, 1, modifiedStartColumn); - } - } - // Check the trailing whitespace - { - let originalEndColumn = getLastNonBlankColumn(originalLine, 1); - let modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1); - const originalMaxColumn = originalLine.length + 1; - const modifiedMaxColumn = modifiedLine.length + 1; - while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) { - const originalChar = originalLine.charCodeAt(originalEndColumn - 1); - const modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1); - if (originalChar !== modifiedChar) { - break; - } - originalEndColumn++; - modifiedEndColumn++; - } - if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) { - this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, originalEndColumn, originalMaxColumn, modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn); - } - } - } - originalLineIndex++; - modifiedLineIndex++; - } - if (nextChange) { - // Emit the actual change - result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)); - originalLineIndex += nextChange.originalLength; - modifiedLineIndex += nextChange.modifiedLength; - } - } - return { - quitEarly: quitEarly, - changes: result - }; - } - _pushTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) { - if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) { - // Merged into previous - return; - } - let charChanges = undefined; - if (this.shouldComputeCharChanges) { - charChanges = [new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)]; - } - result.push(new LineChange(originalLineNumber, originalLineNumber, modifiedLineNumber, modifiedLineNumber, charChanges)); - } - _mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) { - const len = result.length; - if (len === 0) { - return false; - } - const prevChange = result[len - 1]; - if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) { - // Don't merge with inserts/deletes - return false; - } - if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) { - prevChange.originalEndLineNumber = originalLineNumber; - prevChange.modifiedEndLineNumber = modifiedLineNumber; - if (this.shouldComputeCharChanges && prevChange.charChanges) { - prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)); - } - return true; - } - return false; - } -} -function getFirstNonBlankColumn(txt, defaultValue) { - const r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](txt); - if (r === -1) { - return defaultValue; - } - return r + 1; -} -function getLastNonBlankColumn(txt, defaultValue) { - const r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["lastNonWhitespaceIndex"](txt); - if (r === -1) { - return defaultValue; - } - return r + 2; -} -function createContinueProcessingPredicate(maximumRuntime) { - if (maximumRuntime === 0) { - return () => true; - } - const startTime = Date.now(); - return () => { - return Date.now() - startTime < maximumRuntime; - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js ***! - \**********************************************************************************/ -/*! exports provided: MirrorTextModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MirrorTextModel", function() { return MirrorTextModel; }); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewModel/prefixSumComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -class MirrorTextModel { - constructor(uri, lines, eol, versionId) { - this._uri = uri; - this._lines = lines; - this._eol = eol; - this._versionId = versionId; - this._lineStarts = null; - this._cachedTextValue = null; - } - dispose() { - this._lines.length = 0; - } - getText() { - if (this._cachedTextValue === null) { - this._cachedTextValue = this._lines.join(this._eol); - } - return this._cachedTextValue; - } - onEvents(e) { - if (e.eol && e.eol !== this._eol) { - this._eol = e.eol; - this._lineStarts = null; - } - // Update my lines - const changes = e.changes; - for (const change of changes) { - this._acceptDeleteRange(change.range); - this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](change.range.startLineNumber, change.range.startColumn), change.text); - } - this._versionId = e.versionId; - this._cachedTextValue = null; - } - _ensureLineStarts() { - if (!this._lineStarts) { - const eolLength = this._eol.length; - const linesLength = this._lines.length; - const lineStartValues = new Uint32Array(linesLength); - for (let i = 0; i < linesLength; i++) { - lineStartValues[i] = this._lines[i].length + eolLength; - } - this._lineStarts = new _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__["PrefixSumComputer"](lineStartValues); - } - } - /** - * All changes to a line's text go through this method - */ - _setLineText(lineIndex, newValue) { - this._lines[lineIndex] = newValue; - if (this._lineStarts) { - // update prefix sum - this._lineStarts.changeValue(lineIndex, this._lines[lineIndex].length + this._eol.length); - } - } - _acceptDeleteRange(range) { - if (range.startLineNumber === range.endLineNumber) { - if (range.startColumn === range.endColumn) { - // Nothing to delete - return; - } - // Delete text on the affected line - this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) - + this._lines[range.startLineNumber - 1].substring(range.endColumn - 1)); - return; - } - // Take remaining text on last line and append it to remaining text on first line - this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) - + this._lines[range.endLineNumber - 1].substring(range.endColumn - 1)); - // Delete middle lines - this._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber); - if (this._lineStarts) { - // update prefix sum - this._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber); - } - } - _acceptInsertText(position, insertText) { - if (insertText.length === 0) { - // Nothing to insert - return; - } - let insertLines = insertText.split(/\r\n|\r|\n/); - if (insertLines.length === 1) { - // Inserting text on one line - this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) - + insertLines[0] - + this._lines[position.lineNumber - 1].substring(position.column - 1)); - return; - } - // Append overflowing text from first line to the end of text to insert - insertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1); - // Delete overflowing text from first line and insert text on first line - this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) - + insertLines[0]); - // Insert new lines & store lengths - let newLengths = new Uint32Array(insertLines.length - 1); - for (let i = 1; i < insertLines.length; i++) { - this._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]); - newLengths[i - 1] = insertLines[i].length + this._eol.length; - } - if (this._lineStarts) { - // update prefix sum - this._lineStarts.insertValues(position.lineNumber, newLengths); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js ***! - \*****************************************************************************/ -/*! exports provided: USUAL_WORD_SEPARATORS, DEFAULT_WORD_REGEXP, ensureValidWordDefinition, getWordAtText */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USUAL_WORD_SEPARATORS", function() { return USUAL_WORD_SEPARATORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_WORD_REGEXP", function() { return DEFAULT_WORD_REGEXP; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureValidWordDefinition", function() { return ensureValidWordDefinition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWordAtText", function() { return getWordAtText; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -const USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?'; -/** - * Create a word definition regular expression based on default word separators. - * Optionally provide allowed separators that should be included in words. - * - * The default would look like this: - * /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g - */ -function createWordRegExp(allowInWords = '') { - let source = '(-?\\d*\\.\\d\\w*)|([^'; - for (const sep of USUAL_WORD_SEPARATORS) { - if (allowInWords.indexOf(sep) >= 0) { - continue; - } - source += '\\' + sep; - } - source += '\\s]+)'; - return new RegExp(source, 'g'); -} -// catches numbers (including floating numbers) in the first group, and alphanum in the second -const DEFAULT_WORD_REGEXP = createWordRegExp(); -function ensureValidWordDefinition(wordDefinition) { - let result = DEFAULT_WORD_REGEXP; - if (wordDefinition && (wordDefinition instanceof RegExp)) { - if (!wordDefinition.global) { - let flags = 'g'; - if (wordDefinition.ignoreCase) { - flags += 'i'; - } - if (wordDefinition.multiline) { - flags += 'm'; - } - if (wordDefinition.unicode) { - flags += 'u'; - } - result = new RegExp(wordDefinition.source, flags); - } - else { - result = wordDefinition; - } - } - result.lastIndex = 0; - return result; -} -const _defaultConfig = { - maxLen: 1000, - windowSize: 15, - timeBudget: 150 -}; -function getWordAtText(column, wordDefinition, text, textOffset, config = _defaultConfig) { - if (text.length > config.maxLen) { - // don't throw strings that long at the regexp - // but use a sub-string in which a word must occur - let start = column - config.maxLen / 2; - if (start < 0) { - textOffset += column; - start = 0; - } - else { - textOffset += start; - } - text = text.substring(start, column + config.maxLen / 2); - return getWordAtText(column, wordDefinition, text, textOffset, config); - } - const t1 = Date.now(); - const pos = column - 1 - textOffset; - let prevRegexIndex = -1; - let match = null; - for (let i = 1;; i++) { - // check time budget - if (Date.now() - t1 >= config.timeBudget) { - // break; - } - // reset the index at which the regexp should start matching, also know where it - // should stop so that subsequent search don't repeat previous searches - const regexIndex = pos - config.windowSize * i; - wordDefinition.lastIndex = Math.max(0, regexIndex); - const thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text, pos, prevRegexIndex); - if (!thisMatch && match) { - // stop: we have something - break; - } - match = thisMatch; - // stop: searched at start - if (regexIndex <= 0) { - break; - } - prevRegexIndex = regexIndex; - } - if (match) { - let result = { - word: match[0], - startColumn: textOffset + 1 + match.index, - endColumn: textOffset + 1 + match.index + match[0].length - }; - wordDefinition.lastIndex = 0; - return result; - } - return null; -} -function _findRegexMatchEnclosingPosition(wordDefinition, text, pos, stopPos) { - let match; - while (match = wordDefinition.exec(text)) { - const matchIndex = match.index || 0; - if (matchIndex <= pos && wordDefinition.lastIndex >= pos) { - return match; - } - else if (stopPos > 0 && matchIndex > stopPos) { - return null; - } - } - return null; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js ***! - \*******************************************************************************/ -/*! exports provided: Uint8Matrix, StateMachine, LinkComputer, computeLinks */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8Matrix", function() { return Uint8Matrix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StateMachine", function() { return StateMachine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkComputer", function() { return LinkComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeLinks", function() { return computeLinks; }); -/* harmony import */ var _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class Uint8Matrix { - constructor(rows, cols, defaultValue) { - const data = new Uint8Array(rows * cols); - for (let i = 0, len = rows * cols; i < len; i++) { - data[i] = defaultValue; - } - this._data = data; - this.rows = rows; - this.cols = cols; - } - get(row, col) { - return this._data[row * this.cols + col]; - } - set(row, col, value) { - this._data[row * this.cols + col] = value; - } -} -class StateMachine { - constructor(edges) { - let maxCharCode = 0; - let maxState = 0 /* Invalid */; - for (let i = 0, len = edges.length; i < len; i++) { - let [from, chCode, to] = edges[i]; - if (chCode > maxCharCode) { - maxCharCode = chCode; - } - if (from > maxState) { - maxState = from; - } - if (to > maxState) { - maxState = to; - } - } - maxCharCode++; - maxState++; - let states = new Uint8Matrix(maxState, maxCharCode, 0 /* Invalid */); - for (let i = 0, len = edges.length; i < len; i++) { - let [from, chCode, to] = edges[i]; - states.set(from, chCode, to); - } - this._states = states; - this._maxCharCode = maxCharCode; - } - nextState(currentState, chCode) { - if (chCode < 0 || chCode >= this._maxCharCode) { - return 0 /* Invalid */; - } - return this._states.get(currentState, chCode); - } -} -// State machine for http:// or https:// or file:// -let _stateMachine = null; -function getStateMachine() { - if (_stateMachine === null) { - _stateMachine = new StateMachine([ - [1 /* Start */, 104 /* h */, 2 /* H */], - [1 /* Start */, 72 /* H */, 2 /* H */], - [1 /* Start */, 102 /* f */, 6 /* F */], - [1 /* Start */, 70 /* F */, 6 /* F */], - [2 /* H */, 116 /* t */, 3 /* HT */], - [2 /* H */, 84 /* T */, 3 /* HT */], - [3 /* HT */, 116 /* t */, 4 /* HTT */], - [3 /* HT */, 84 /* T */, 4 /* HTT */], - [4 /* HTT */, 112 /* p */, 5 /* HTTP */], - [4 /* HTT */, 80 /* P */, 5 /* HTTP */], - [5 /* HTTP */, 115 /* s */, 9 /* BeforeColon */], - [5 /* HTTP */, 83 /* S */, 9 /* BeforeColon */], - [5 /* HTTP */, 58 /* Colon */, 10 /* AfterColon */], - [6 /* F */, 105 /* i */, 7 /* FI */], - [6 /* F */, 73 /* I */, 7 /* FI */], - [7 /* FI */, 108 /* l */, 8 /* FIL */], - [7 /* FI */, 76 /* L */, 8 /* FIL */], - [8 /* FIL */, 101 /* e */, 9 /* BeforeColon */], - [8 /* FIL */, 69 /* E */, 9 /* BeforeColon */], - [9 /* BeforeColon */, 58 /* Colon */, 10 /* AfterColon */], - [10 /* AfterColon */, 47 /* Slash */, 11 /* AlmostThere */], - [11 /* AlmostThere */, 47 /* Slash */, 12 /* End */], - ]); - } - return _stateMachine; -} -let _classifier = null; -function getClassifier() { - if (_classifier === null) { - _classifier = new _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__["CharacterClassifier"](0 /* None */); - const FORCE_TERMINATION_CHARACTERS = ' \t<>\'\"、。。、,.:;‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…'; - for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) { - _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1 /* ForceTermination */); - } - const CANNOT_END_WITH_CHARACTERS = '.,;'; - for (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) { - _classifier.set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), 2 /* CannotEndIn */); - } - } - return _classifier; -} -class LinkComputer { - static _createLink(classifier, line, lineNumber, linkBeginIndex, linkEndIndex) { - // Do not allow to end link in certain characters... - let lastIncludedCharIndex = linkEndIndex - 1; - do { - const chCode = line.charCodeAt(lastIncludedCharIndex); - const chClass = classifier.get(chCode); - if (chClass !== 2 /* CannotEndIn */) { - break; - } - lastIncludedCharIndex--; - } while (lastIncludedCharIndex > linkBeginIndex); - // Handle links enclosed in parens, square brackets and curlys. - if (linkBeginIndex > 0) { - const charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1); - const lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex); - if ((charCodeBeforeLink === 40 /* OpenParen */ && lastCharCodeInLink === 41 /* CloseParen */) - || (charCodeBeforeLink === 91 /* OpenSquareBracket */ && lastCharCodeInLink === 93 /* CloseSquareBracket */) - || (charCodeBeforeLink === 123 /* OpenCurlyBrace */ && lastCharCodeInLink === 125 /* CloseCurlyBrace */)) { - // Do not end in ) if ( is before the link start - // Do not end in ] if [ is before the link start - // Do not end in } if { is before the link start - lastIncludedCharIndex--; - } - } - return { - range: { - startLineNumber: lineNumber, - startColumn: linkBeginIndex + 1, - endLineNumber: lineNumber, - endColumn: lastIncludedCharIndex + 2 - }, - url: line.substring(linkBeginIndex, lastIncludedCharIndex + 1) - }; - } - static computeLinks(model, stateMachine = getStateMachine()) { - const classifier = getClassifier(); - let result = []; - for (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) { - const line = model.getLineContent(i); - const len = line.length; - let j = 0; - let linkBeginIndex = 0; - let linkBeginChCode = 0; - let state = 1 /* Start */; - let hasOpenParens = false; - let hasOpenSquareBracket = false; - let inSquareBrackets = false; - let hasOpenCurlyBracket = false; - while (j < len) { - let resetStateMachine = false; - const chCode = line.charCodeAt(j); - if (state === 13 /* Accept */) { - let chClass; - switch (chCode) { - case 40 /* OpenParen */: - hasOpenParens = true; - chClass = 0 /* None */; - break; - case 41 /* CloseParen */: - chClass = (hasOpenParens ? 0 /* None */ : 1 /* ForceTermination */); - break; - case 91 /* OpenSquareBracket */: - inSquareBrackets = true; - hasOpenSquareBracket = true; - chClass = 0 /* None */; - break; - case 93 /* CloseSquareBracket */: - inSquareBrackets = false; - chClass = (hasOpenSquareBracket ? 0 /* None */ : 1 /* ForceTermination */); - break; - case 123 /* OpenCurlyBrace */: - hasOpenCurlyBracket = true; - chClass = 0 /* None */; - break; - case 125 /* CloseCurlyBrace */: - chClass = (hasOpenCurlyBracket ? 0 /* None */ : 1 /* ForceTermination */); - break; - /* The following three rules make it that ' or " or ` are allowed inside links if the link began with a different one */ - case 39 /* SingleQuote */: - chClass = (linkBeginChCode === 34 /* DoubleQuote */ || linkBeginChCode === 96 /* BackTick */) ? 0 /* None */ : 1 /* ForceTermination */; - break; - case 34 /* DoubleQuote */: - chClass = (linkBeginChCode === 39 /* SingleQuote */ || linkBeginChCode === 96 /* BackTick */) ? 0 /* None */ : 1 /* ForceTermination */; - break; - case 96 /* BackTick */: - chClass = (linkBeginChCode === 39 /* SingleQuote */ || linkBeginChCode === 34 /* DoubleQuote */) ? 0 /* None */ : 1 /* ForceTermination */; - break; - case 42 /* Asterisk */: - // `*` terminates a link if the link began with `*` - chClass = (linkBeginChCode === 42 /* Asterisk */) ? 1 /* ForceTermination */ : 0 /* None */; - break; - case 124 /* Pipe */: - // `|` terminates a link if the link began with `|` - chClass = (linkBeginChCode === 124 /* Pipe */) ? 1 /* ForceTermination */ : 0 /* None */; - break; - case 32 /* Space */: - // ` ` allow space in between [ and ] - chClass = (inSquareBrackets ? 0 /* None */ : 1 /* ForceTermination */); - break; - default: - chClass = classifier.get(chCode); - } - // Check if character terminates link - if (chClass === 1 /* ForceTermination */) { - result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, j)); - resetStateMachine = true; - } - } - else if (state === 12 /* End */) { - let chClass; - if (chCode === 91 /* OpenSquareBracket */) { - // Allow for the authority part to contain ipv6 addresses which contain [ and ] - hasOpenSquareBracket = true; - chClass = 0 /* None */; - } - else { - chClass = classifier.get(chCode); - } - // Check if character terminates link - if (chClass === 1 /* ForceTermination */) { - resetStateMachine = true; - } - else { - state = 13 /* Accept */; - } - } - else { - state = stateMachine.nextState(state, chCode); - if (state === 0 /* Invalid */) { - resetStateMachine = true; - } - } - if (resetStateMachine) { - state = 1 /* Start */; - hasOpenParens = false; - hasOpenSquareBracket = false; - hasOpenCurlyBracket = false; - // Record where the link started - linkBeginIndex = j + 1; - linkBeginChCode = chCode; - } - j++; - } - if (state === 13 /* Accept */) { - result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, len)); - } - } - return result; - } -} -/** - * Returns an array of all links contains in the provided - * document. *Note* that this operation is computational - * expensive and should not run in the UI thread. - */ -function computeLinks(model) { - if (!model || typeof model.getLineCount !== 'function' || typeof model.getLineContent !== 'function') { - // Unknown caller! - return []; - } - return LinkComputer.computeLinks(model); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js ***! - \*************************************************************************************************/ -/*! exports provided: BasicInplaceReplace */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasicInplaceReplace", function() { return BasicInplaceReplace; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -class BasicInplaceReplace { - constructor() { - this._defaultValueSet = [ - ['true', 'false'], - ['True', 'False'], - ['Private', 'Public', 'Friend', 'ReadOnly', 'Partial', 'Protected', 'WriteOnly'], - ['public', 'protected', 'private'], - ]; - } - navigateValueSet(range1, text1, range2, text2, up) { - if (range1 && text1) { - let result = this.doNavigateValueSet(text1, up); - if (result) { - return { - range: range1, - value: result - }; - } - } - if (range2 && text2) { - let result = this.doNavigateValueSet(text2, up); - if (result) { - return { - range: range2, - value: result - }; - } - } - return null; - } - doNavigateValueSet(text, up) { - let numberResult = this.numberReplace(text, up); - if (numberResult !== null) { - return numberResult; - } - return this.textReplace(text, up); - } - numberReplace(value, up) { - let precision = Math.pow(10, value.length - (value.lastIndexOf('.') + 1)); - let n1 = Number(value); - let n2 = parseFloat(value); - if (!isNaN(n1) && !isNaN(n2) && n1 === n2) { - if (n1 === 0 && !up) { - return null; // don't do negative - // } else if(n1 === 9 && up) { - // return null; // don't insert 10 into a number - } - else { - n1 = Math.floor(n1 * precision); - n1 += up ? precision : -precision; - return String(n1 / precision); - } - } - return null; - } - textReplace(value, up) { - return this.valueSetsReplace(this._defaultValueSet, value, up); - } - valueSetsReplace(valueSets, value, up) { - let result = null; - for (let i = 0, len = valueSets.length; result === null && i < len; i++) { - result = this.valueSetReplace(valueSets[i], value, up); - } - return result; - } - valueSetReplace(valueSet, value, up) { - let idx = valueSet.indexOf(value); - if (idx >= 0) { - idx += up ? +1 : -1; - if (idx < 0) { - idx = valueSet.length - 1; - } - else { - idx %= valueSet.length; - } - return valueSet[idx]; - } - return null; - } -} -BasicInplaceReplace.INSTANCE = new BasicInplaceReplace(); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js ***! - \****************************************************************************************/ -/*! exports provided: EditorSimpleWorker, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorSimpleWorker", function() { return EditorSimpleWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../diff/diffComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js"); -/* harmony import */ var _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../model/mirrorTextModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js"); -/* harmony import */ var _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../model/wordHelper.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js"); -/* harmony import */ var _modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modes/linkComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js"); -/* harmony import */ var _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modes/supports/inplaceReplaceSupport.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js"); -/* harmony import */ var _standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../standalone/standaloneBase.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; - - - - - - - - - - - - - -/** - * @internal - */ -class MirrorModel extends _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_7__["MirrorTextModel"] { - get uri() { - return this._uri; - } - get version() { - return this._versionId; - } - get eol() { - return this._eol; - } - getValue() { - return this.getText(); - } - getLinesContent() { - return this._lines.slice(0); - } - getLineCount() { - return this._lines.length; - } - getLineContent(lineNumber) { - return this._lines[lineNumber - 1]; - } - getWordAtPosition(position, wordDefinition) { - let wordAtText = Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_8__["getWordAtText"])(position.column, Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_8__["ensureValidWordDefinition"])(wordDefinition), this._lines[position.lineNumber - 1], 0); - if (wordAtText) { - return new _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"](position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); - } - return null; - } - words(wordDefinition) { - const lines = this._lines; - const wordenize = this._wordenize.bind(this); - let lineNumber = 0; - let lineText = ''; - let wordRangesIdx = 0; - let wordRanges = []; - return { - *[Symbol.iterator]() { - while (true) { - if (wordRangesIdx < wordRanges.length) { - const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); - wordRangesIdx += 1; - yield value; - } - else { - if (lineNumber < lines.length) { - lineText = lines[lineNumber]; - wordRanges = wordenize(lineText, wordDefinition); - wordRangesIdx = 0; - lineNumber += 1; - } - else { - break; - } - } - } - } - }; - } - getLineWords(lineNumber, wordDefinition) { - let content = this._lines[lineNumber - 1]; - let ranges = this._wordenize(content, wordDefinition); - let words = []; - for (const range of ranges) { - words.push({ - word: content.substring(range.start, range.end), - startColumn: range.start + 1, - endColumn: range.end + 1 - }); - } - return words; - } - _wordenize(content, wordDefinition) { - const result = []; - let match; - wordDefinition.lastIndex = 0; // reset lastIndex just to be sure - while (match = wordDefinition.exec(content)) { - if (match[0].length === 0) { - // it did match the empty string - break; - } - result.push({ start: match.index, end: match.index + match[0].length }); - } - return result; - } - getValueInRange(range) { - range = this._validateRange(range); - if (range.startLineNumber === range.endLineNumber) { - return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); - } - let lineEnding = this._eol; - let startLineIndex = range.startLineNumber - 1; - let endLineIndex = range.endLineNumber - 1; - let resultLines = []; - resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); - for (let i = startLineIndex + 1; i < endLineIndex; i++) { - resultLines.push(this._lines[i]); - } - resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); - return resultLines.join(lineEnding); - } - offsetAt(position) { - position = this._validatePosition(position); - this._ensureLineStarts(); - return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); - } - positionAt(offset) { - offset = Math.floor(offset); - offset = Math.max(0, offset); - this._ensureLineStarts(); - let out = this._lineStarts.getIndexOf(offset); - let lineLength = this._lines[out.index].length; - // Ensure we return a valid position - return { - lineNumber: 1 + out.index, - column: 1 + Math.min(out.remainder, lineLength) - }; - } - _validateRange(range) { - const start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); - const end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); - if (start.lineNumber !== range.startLineNumber - || start.column !== range.startColumn - || end.lineNumber !== range.endLineNumber - || end.column !== range.endColumn) { - return { - startLineNumber: start.lineNumber, - startColumn: start.column, - endLineNumber: end.lineNumber, - endColumn: end.column - }; - } - return range; - } - _validatePosition(position) { - if (!_core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"].isIPosition(position)) { - throw new Error('bad position'); - } - let { lineNumber, column } = position; - let hasChanged = false; - if (lineNumber < 1) { - lineNumber = 1; - column = 1; - hasChanged = true; - } - else if (lineNumber > this._lines.length) { - lineNumber = this._lines.length; - column = this._lines[lineNumber - 1].length + 1; - hasChanged = true; - } - else { - let maxCharacter = this._lines[lineNumber - 1].length + 1; - if (column < 1) { - column = 1; - hasChanged = true; - } - else if (column > maxCharacter) { - column = maxCharacter; - hasChanged = true; - } - } - if (!hasChanged) { - return position; - } - else { - return { lineNumber, column }; - } - } -} -/** - * @internal - */ -class EditorSimpleWorker { - constructor(host, foreignModuleFactory) { - this._host = host; - this._models = Object.create(null); - this._foreignModuleFactory = foreignModuleFactory; - this._foreignModule = null; - } - dispose() { - this._models = Object.create(null); - } - _getModel(uri) { - return this._models[uri]; - } - _getModels() { - let all = []; - Object.keys(this._models).forEach((key) => all.push(this._models[key])); - return all; - } - acceptNewModel(data) { - this._models[data.url] = new MirrorModel(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"].parse(data.url), data.lines, data.EOL, data.versionId); - } - acceptModelChanged(strURL, e) { - if (!this._models[strURL]) { - return; - } - let model = this._models[strURL]; - model.onEvents(e); - } - acceptRemovedModel(strURL) { - if (!this._models[strURL]) { - return; - } - delete this._models[strURL]; - } - // ---- BEGIN diff -------------------------------------------------------------------------- - computeDiff(originalUrl, modifiedUrl, ignoreTrimWhitespace, maxComputationTime) { - return __awaiter(this, void 0, void 0, function* () { - const original = this._getModel(originalUrl); - const modified = this._getModel(modifiedUrl); - if (!original || !modified) { - return null; - } - const originalLines = original.getLinesContent(); - const modifiedLines = modified.getLinesContent(); - const diffComputer = new _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_6__["DiffComputer"](originalLines, modifiedLines, { - shouldComputeCharChanges: true, - shouldPostProcessCharChanges: true, - shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, - shouldMakePrettyDiff: true, - maxComputationTime: maxComputationTime - }); - const diffResult = diffComputer.computeDiff(); - const identical = (diffResult.changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); - return { - quitEarly: diffResult.quitEarly, - identical: identical, - changes: diffResult.changes - }; - }); - } - _modelsAreIdentical(original, modified) { - const originalLineCount = original.getLineCount(); - const modifiedLineCount = modified.getLineCount(); - if (originalLineCount !== modifiedLineCount) { - return false; - } - for (let line = 1; line <= originalLineCount; line++) { - const originalLine = original.getLineContent(line); - const modifiedLine = modified.getLineContent(line); - if (originalLine !== modifiedLine) { - return false; - } - } - return true; - } - computeMoreMinimalEdits(modelUrl, edits) { - return __awaiter(this, void 0, void 0, function* () { - const model = this._getModel(modelUrl); - if (!model) { - return edits; - } - const result = []; - let lastEol = undefined; - edits = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["mergeSort"])(edits, (a, b) => { - if (a.range && b.range) { - return _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].compareRangesUsingStarts(a.range, b.range); - } - // eol only changes should go to the end - let aRng = a.range ? 0 : 1; - let bRng = b.range ? 0 : 1; - return aRng - bRng; - }); - for (let { range, text, eol } of edits) { - if (typeof eol === 'number') { - lastEol = eol; - } - if (_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].isEmpty(range) && !text) { - // empty change - continue; - } - const original = model.getValueInRange(range); - text = text.replace(/\r\n|\n|\r/g, model.eol); - if (original === text) { - // noop - continue; - } - // make sure diff won't take too long - if (Math.max(text.length, original.length) > EditorSimpleWorker._diffLimit) { - result.push({ range, text }); - continue; - } - // compute diff between original and edit.text - const changes = Object(_base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__["stringDiff"])(original, text, false); - const editOffset = model.offsetAt(_core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"].lift(range).getStartPosition()); - for (const change of changes) { - const start = model.positionAt(editOffset + change.originalStart); - const end = model.positionAt(editOffset + change.originalStart + change.originalLength); - const newEdit = { - text: text.substr(change.modifiedStart, change.modifiedLength), - range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } - }; - if (model.getValueInRange(newEdit.range) !== newEdit.text) { - result.push(newEdit); - } - } - } - if (typeof lastEol === 'number') { - result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); - } - return result; - }); - } - // ---- END minimal edits --------------------------------------------------------------- - computeLinks(modelUrl) { - return __awaiter(this, void 0, void 0, function* () { - let model = this._getModel(modelUrl); - if (!model) { - return null; - } - return Object(_modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_9__["computeLinks"])(model); - }); - } - textualSuggest(modelUrl, position, wordDef, wordDefFlags) { - return __awaiter(this, void 0, void 0, function* () { - const model = this._getModel(modelUrl); - if (!model) { - return null; - } - const words = []; - const seen = new Set(); - const wordDefRegExp = new RegExp(wordDef, wordDefFlags); - const wordAt = model.getWordAtPosition(position, wordDefRegExp); - if (wordAt) { - seen.add(model.getValueInRange(wordAt)); - } - for (let word of model.words(wordDefRegExp)) { - if (seen.has(word)) { - continue; - } - seen.add(word); - if (!isNaN(Number(word))) { - continue; - } - words.push(word); - if (seen.size > EditorSimpleWorker._suggestionsLimit) { - break; - } - } - return words; - }); - } - // ---- END suggest -------------------------------------------------------------------------- - //#region -- word ranges -- - computeWordRanges(modelUrl, range, wordDef, wordDefFlags) { - return __awaiter(this, void 0, void 0, function* () { - let model = this._getModel(modelUrl); - if (!model) { - return Object.create(null); - } - const wordDefRegExp = new RegExp(wordDef, wordDefFlags); - const result = Object.create(null); - for (let line = range.startLineNumber; line < range.endLineNumber; line++) { - let words = model.getLineWords(line, wordDefRegExp); - for (const word of words) { - if (!isNaN(Number(word.word))) { - continue; - } - let array = result[word.word]; - if (!array) { - array = []; - result[word.word] = array; - } - array.push({ - startLineNumber: line, - startColumn: word.startColumn, - endLineNumber: line, - endColumn: word.endColumn - }); - } - } - return result; - }); - } - //#endregion - navigateValueSet(modelUrl, range, up, wordDef, wordDefFlags) { - return __awaiter(this, void 0, void 0, function* () { - let model = this._getModel(modelUrl); - if (!model) { - return null; - } - let wordDefRegExp = new RegExp(wordDef, wordDefFlags); - if (range.startColumn === range.endColumn) { - range = { - startLineNumber: range.startLineNumber, - startColumn: range.startColumn, - endLineNumber: range.endLineNumber, - endColumn: range.endColumn + 1 - }; - } - let selectionText = model.getValueInRange(range); - let wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); - if (!wordRange) { - return null; - } - let word = model.getValueInRange(wordRange); - let result = _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_10__["BasicInplaceReplace"].INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); - return result; - }); - } - // ---- BEGIN foreign module support -------------------------------------------------------------------------- - loadForeignModule(moduleId, createData, foreignHostMethods) { - const proxyMethodRequest = (method, args) => { - return this._host.fhr(method, args); - }; - const foreignHost = _base_common_types_js__WEBPACK_IMPORTED_MODULE_12__["createProxyObject"](foreignHostMethods, proxyMethodRequest); - let ctx = { - host: foreignHost, - getMirrorModels: () => { - return this._getModels(); - } - }; - if (this._foreignModuleFactory) { - this._foreignModule = this._foreignModuleFactory(ctx, createData); - // static foreing module - return Promise.resolve(_base_common_types_js__WEBPACK_IMPORTED_MODULE_12__["getAllMethodNames"](this._foreignModule)); - } - // ESM-comment-begin - // return new Promise((resolve, reject) => { - // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { - // this._foreignModule = foreignModule.create(ctx, createData); - // - // resolve(types.getAllMethodNames(this._foreignModule)); - // - // }, reject); - // }); - // ESM-comment-end - // ESM-uncomment-begin - return Promise.reject(new Error(`Unexpected usage`)); - // ESM-uncomment-end - } - // foreign method request - fmr(method, args) { - if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); - } - catch (e) { - return Promise.reject(e); - } - } -} -// ---- END diff -------------------------------------------------------------------------- -// ---- BEGIN minimal edits --------------------------------------------------------------- -EditorSimpleWorker._diffLimit = 100000; -// ---- BEGIN suggest -------------------------------------------------------------------------- -EditorSimpleWorker._suggestionsLimit = 10000; -/** - * Called on the worker side - * @internal - */ -function create(host) { - return new EditorSimpleWorker(host, null); -} -if (typeof importScripts === 'function') { - // Running in a web worker - _base_common_platform_js__WEBPACK_IMPORTED_MODULE_2__["globals"].monaco = Object(_standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_11__["createMonacoBaseAPI"])(); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js ***! - \**************************************************************************************/ -/*! exports provided: KeyMod, createMonacoBaseAPI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyMod", function() { return KeyMod; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMonacoBaseAPI", function() { return createMonacoBaseAPI; }); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _core_token_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/token.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js"); -/* harmony import */ var _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./standaloneEnums.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -class KeyMod { - static chord(firstPart, secondPart) { - return Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_2__["KeyChord"])(firstPart, secondPart); - } -} -KeyMod.CtrlCmd = 2048 /* CtrlCmd */; -KeyMod.Shift = 1024 /* Shift */; -KeyMod.Alt = 512 /* Alt */; -KeyMod.WinCtrl = 256 /* WinCtrl */; -function createMonacoBaseAPI() { - return { - editor: undefined, - languages: undefined, - CancellationTokenSource: _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_0__["CancellationTokenSource"], - Emitter: _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__["Emitter"], - KeyCode: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__["KeyCode"], - KeyMod: KeyMod, - Position: _core_position_js__WEBPACK_IMPORTED_MODULE_4__["Position"], - Range: _core_range_js__WEBPACK_IMPORTED_MODULE_5__["Range"], - Selection: _core_selection_js__WEBPACK_IMPORTED_MODULE_6__["Selection"], - SelectionDirection: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__["SelectionDirection"], - MarkerSeverity: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__["MarkerSeverity"], - MarkerTag: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_8__["MarkerTag"], - Uri: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_3__["URI"], - Token: _core_token_js__WEBPACK_IMPORTED_MODULE_7__["Token"] - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js ***! - \***************************************************************************************/ -/*! exports provided: AccessibilitySupport, CompletionItemInsertTextRule, CompletionItemKind, CompletionItemTag, CompletionTriggerKind, ContentWidgetPositionPreference, CursorChangeReason, DefaultEndOfLine, DocumentHighlightKind, EditorAutoIndentStrategy, EditorOption, EndOfLinePreference, EndOfLineSequence, IndentAction, KeyCode, MarkerSeverity, MarkerTag, MinimapPosition, MouseTargetType, OverlayWidgetPositionPreference, OverviewRulerLane, RenderLineNumbersType, RenderMinimap, ScrollType, ScrollbarVisibility, SelectionDirection, SignatureHelpTriggerKind, SymbolKind, SymbolTag, TextEditorCursorBlinkingStyle, TextEditorCursorStyle, TrackedRangeStickiness, WrappingIndent */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccessibilitySupport", function() { return AccessibilitySupport; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemInsertTextRule", function() { return CompletionItemInsertTextRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemTag", function() { return CompletionItemTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionTriggerKind", function() { return CompletionTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentWidgetPositionPreference", function() { return ContentWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorChangeReason", function() { return CursorChangeReason; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultEndOfLine", function() { return DefaultEndOfLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorAutoIndentStrategy", function() { return EditorAutoIndentStrategy; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorOption", function() { return EditorOption; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLinePreference", function() { return EndOfLinePreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLineSequence", function() { return EndOfLineSequence; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentAction", function() { return IndentAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCode", function() { return KeyCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerSeverity", function() { return MarkerSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerTag", function() { return MarkerTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinimapPosition", function() { return MinimapPosition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseTargetType", function() { return MouseTargetType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayWidgetPositionPreference", function() { return OverlayWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewRulerLane", function() { return OverviewRulerLane; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderLineNumbersType", function() { return RenderLineNumbersType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderMinimap", function() { return RenderMinimap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollType", function() { return ScrollType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollbarVisibility", function() { return ScrollbarVisibility; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionDirection", function() { return SelectionDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureHelpTriggerKind", function() { return SignatureHelpTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolTag", function() { return SymbolTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorBlinkingStyle", function() { return TextEditorCursorBlinkingStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorStyle", function() { return TextEditorCursorStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackedRangeStickiness", function() { return TrackedRangeStickiness; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrappingIndent", function() { return WrappingIndent; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. -var AccessibilitySupport; -(function (AccessibilitySupport) { - /** - * This should be the browser case where it is not known if a screen reader is attached or no. - */ - AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown"; - AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled"; - AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled"; -})(AccessibilitySupport || (AccessibilitySupport = {})); -var CompletionItemInsertTextRule; -(function (CompletionItemInsertTextRule) { - /** - * Adjust whitespace/indentation of multiline insert texts to - * match the current line indentation. - */ - CompletionItemInsertTextRule[CompletionItemInsertTextRule["KeepWhitespace"] = 1] = "KeepWhitespace"; - /** - * `insertText` is a snippet. - */ - CompletionItemInsertTextRule[CompletionItemInsertTextRule["InsertAsSnippet"] = 4] = "InsertAsSnippet"; -})(CompletionItemInsertTextRule || (CompletionItemInsertTextRule = {})); -var CompletionItemKind; -(function (CompletionItemKind) { - CompletionItemKind[CompletionItemKind["Method"] = 0] = "Method"; - CompletionItemKind[CompletionItemKind["Function"] = 1] = "Function"; - CompletionItemKind[CompletionItemKind["Constructor"] = 2] = "Constructor"; - CompletionItemKind[CompletionItemKind["Field"] = 3] = "Field"; - CompletionItemKind[CompletionItemKind["Variable"] = 4] = "Variable"; - CompletionItemKind[CompletionItemKind["Class"] = 5] = "Class"; - CompletionItemKind[CompletionItemKind["Struct"] = 6] = "Struct"; - CompletionItemKind[CompletionItemKind["Interface"] = 7] = "Interface"; - CompletionItemKind[CompletionItemKind["Module"] = 8] = "Module"; - CompletionItemKind[CompletionItemKind["Property"] = 9] = "Property"; - CompletionItemKind[CompletionItemKind["Event"] = 10] = "Event"; - CompletionItemKind[CompletionItemKind["Operator"] = 11] = "Operator"; - CompletionItemKind[CompletionItemKind["Unit"] = 12] = "Unit"; - CompletionItemKind[CompletionItemKind["Value"] = 13] = "Value"; - CompletionItemKind[CompletionItemKind["Constant"] = 14] = "Constant"; - CompletionItemKind[CompletionItemKind["Enum"] = 15] = "Enum"; - CompletionItemKind[CompletionItemKind["EnumMember"] = 16] = "EnumMember"; - CompletionItemKind[CompletionItemKind["Keyword"] = 17] = "Keyword"; - CompletionItemKind[CompletionItemKind["Text"] = 18] = "Text"; - CompletionItemKind[CompletionItemKind["Color"] = 19] = "Color"; - CompletionItemKind[CompletionItemKind["File"] = 20] = "File"; - CompletionItemKind[CompletionItemKind["Reference"] = 21] = "Reference"; - CompletionItemKind[CompletionItemKind["Customcolor"] = 22] = "Customcolor"; - CompletionItemKind[CompletionItemKind["Folder"] = 23] = "Folder"; - CompletionItemKind[CompletionItemKind["TypeParameter"] = 24] = "TypeParameter"; - CompletionItemKind[CompletionItemKind["User"] = 25] = "User"; - CompletionItemKind[CompletionItemKind["Issue"] = 26] = "Issue"; - CompletionItemKind[CompletionItemKind["Snippet"] = 27] = "Snippet"; -})(CompletionItemKind || (CompletionItemKind = {})); -var CompletionItemTag; -(function (CompletionItemTag) { - CompletionItemTag[CompletionItemTag["Deprecated"] = 1] = "Deprecated"; -})(CompletionItemTag || (CompletionItemTag = {})); -/** - * How a suggest provider was triggered. - */ -var CompletionTriggerKind; -(function (CompletionTriggerKind) { - CompletionTriggerKind[CompletionTriggerKind["Invoke"] = 0] = "Invoke"; - CompletionTriggerKind[CompletionTriggerKind["TriggerCharacter"] = 1] = "TriggerCharacter"; - CompletionTriggerKind[CompletionTriggerKind["TriggerForIncompleteCompletions"] = 2] = "TriggerForIncompleteCompletions"; -})(CompletionTriggerKind || (CompletionTriggerKind = {})); -/** - * A positioning preference for rendering content widgets. - */ -var ContentWidgetPositionPreference; -(function (ContentWidgetPositionPreference) { - /** - * Place the content widget exactly at a position - */ - ContentWidgetPositionPreference[ContentWidgetPositionPreference["EXACT"] = 0] = "EXACT"; - /** - * Place the content widget above a position - */ - ContentWidgetPositionPreference[ContentWidgetPositionPreference["ABOVE"] = 1] = "ABOVE"; - /** - * Place the content widget below a position - */ - ContentWidgetPositionPreference[ContentWidgetPositionPreference["BELOW"] = 2] = "BELOW"; -})(ContentWidgetPositionPreference || (ContentWidgetPositionPreference = {})); -/** - * Describes the reason the cursor has changed its position. - */ -var CursorChangeReason; -(function (CursorChangeReason) { - /** - * Unknown or not set. - */ - CursorChangeReason[CursorChangeReason["NotSet"] = 0] = "NotSet"; - /** - * A `model.setValue()` was called. - */ - CursorChangeReason[CursorChangeReason["ContentFlush"] = 1] = "ContentFlush"; - /** - * The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers. - */ - CursorChangeReason[CursorChangeReason["RecoverFromMarkers"] = 2] = "RecoverFromMarkers"; - /** - * There was an explicit user gesture. - */ - CursorChangeReason[CursorChangeReason["Explicit"] = 3] = "Explicit"; - /** - * There was a Paste. - */ - CursorChangeReason[CursorChangeReason["Paste"] = 4] = "Paste"; - /** - * There was an Undo. - */ - CursorChangeReason[CursorChangeReason["Undo"] = 5] = "Undo"; - /** - * There was a Redo. - */ - CursorChangeReason[CursorChangeReason["Redo"] = 6] = "Redo"; -})(CursorChangeReason || (CursorChangeReason = {})); -/** - * The default end of line to use when instantiating models. - */ -var DefaultEndOfLine; -(function (DefaultEndOfLine) { - /** - * Use line feed (\n) as the end of line character. - */ - DefaultEndOfLine[DefaultEndOfLine["LF"] = 1] = "LF"; - /** - * Use carriage return and line feed (\r\n) as the end of line character. - */ - DefaultEndOfLine[DefaultEndOfLine["CRLF"] = 2] = "CRLF"; -})(DefaultEndOfLine || (DefaultEndOfLine = {})); -/** - * A document highlight kind. - */ -var DocumentHighlightKind; -(function (DocumentHighlightKind) { - /** - * A textual occurrence. - */ - DocumentHighlightKind[DocumentHighlightKind["Text"] = 0] = "Text"; - /** - * Read-access of a symbol, like reading a variable. - */ - DocumentHighlightKind[DocumentHighlightKind["Read"] = 1] = "Read"; - /** - * Write-access of a symbol, like writing to a variable. - */ - DocumentHighlightKind[DocumentHighlightKind["Write"] = 2] = "Write"; -})(DocumentHighlightKind || (DocumentHighlightKind = {})); -/** - * Configuration options for auto indentation in the editor - */ -var EditorAutoIndentStrategy; -(function (EditorAutoIndentStrategy) { - EditorAutoIndentStrategy[EditorAutoIndentStrategy["None"] = 0] = "None"; - EditorAutoIndentStrategy[EditorAutoIndentStrategy["Keep"] = 1] = "Keep"; - EditorAutoIndentStrategy[EditorAutoIndentStrategy["Brackets"] = 2] = "Brackets"; - EditorAutoIndentStrategy[EditorAutoIndentStrategy["Advanced"] = 3] = "Advanced"; - EditorAutoIndentStrategy[EditorAutoIndentStrategy["Full"] = 4] = "Full"; -})(EditorAutoIndentStrategy || (EditorAutoIndentStrategy = {})); -var EditorOption; -(function (EditorOption) { - EditorOption[EditorOption["acceptSuggestionOnCommitCharacter"] = 0] = "acceptSuggestionOnCommitCharacter"; - EditorOption[EditorOption["acceptSuggestionOnEnter"] = 1] = "acceptSuggestionOnEnter"; - EditorOption[EditorOption["accessibilitySupport"] = 2] = "accessibilitySupport"; - EditorOption[EditorOption["accessibilityPageSize"] = 3] = "accessibilityPageSize"; - EditorOption[EditorOption["ariaLabel"] = 4] = "ariaLabel"; - EditorOption[EditorOption["autoClosingBrackets"] = 5] = "autoClosingBrackets"; - EditorOption[EditorOption["autoClosingOvertype"] = 6] = "autoClosingOvertype"; - EditorOption[EditorOption["autoClosingQuotes"] = 7] = "autoClosingQuotes"; - EditorOption[EditorOption["autoIndent"] = 8] = "autoIndent"; - EditorOption[EditorOption["automaticLayout"] = 9] = "automaticLayout"; - EditorOption[EditorOption["autoSurround"] = 10] = "autoSurround"; - EditorOption[EditorOption["codeLens"] = 11] = "codeLens"; - EditorOption[EditorOption["colorDecorators"] = 12] = "colorDecorators"; - EditorOption[EditorOption["columnSelection"] = 13] = "columnSelection"; - EditorOption[EditorOption["comments"] = 14] = "comments"; - EditorOption[EditorOption["contextmenu"] = 15] = "contextmenu"; - EditorOption[EditorOption["copyWithSyntaxHighlighting"] = 16] = "copyWithSyntaxHighlighting"; - EditorOption[EditorOption["cursorBlinking"] = 17] = "cursorBlinking"; - EditorOption[EditorOption["cursorSmoothCaretAnimation"] = 18] = "cursorSmoothCaretAnimation"; - EditorOption[EditorOption["cursorStyle"] = 19] = "cursorStyle"; - EditorOption[EditorOption["cursorSurroundingLines"] = 20] = "cursorSurroundingLines"; - EditorOption[EditorOption["cursorSurroundingLinesStyle"] = 21] = "cursorSurroundingLinesStyle"; - EditorOption[EditorOption["cursorWidth"] = 22] = "cursorWidth"; - EditorOption[EditorOption["disableLayerHinting"] = 23] = "disableLayerHinting"; - EditorOption[EditorOption["disableMonospaceOptimizations"] = 24] = "disableMonospaceOptimizations"; - EditorOption[EditorOption["dragAndDrop"] = 25] = "dragAndDrop"; - EditorOption[EditorOption["emptySelectionClipboard"] = 26] = "emptySelectionClipboard"; - EditorOption[EditorOption["extraEditorClassName"] = 27] = "extraEditorClassName"; - EditorOption[EditorOption["fastScrollSensitivity"] = 28] = "fastScrollSensitivity"; - EditorOption[EditorOption["find"] = 29] = "find"; - EditorOption[EditorOption["fixedOverflowWidgets"] = 30] = "fixedOverflowWidgets"; - EditorOption[EditorOption["folding"] = 31] = "folding"; - EditorOption[EditorOption["foldingStrategy"] = 32] = "foldingStrategy"; - EditorOption[EditorOption["foldingHighlight"] = 33] = "foldingHighlight"; - EditorOption[EditorOption["unfoldOnClickAfterEndOfLine"] = 34] = "unfoldOnClickAfterEndOfLine"; - EditorOption[EditorOption["fontFamily"] = 35] = "fontFamily"; - EditorOption[EditorOption["fontInfo"] = 36] = "fontInfo"; - EditorOption[EditorOption["fontLigatures"] = 37] = "fontLigatures"; - EditorOption[EditorOption["fontSize"] = 38] = "fontSize"; - EditorOption[EditorOption["fontWeight"] = 39] = "fontWeight"; - EditorOption[EditorOption["formatOnPaste"] = 40] = "formatOnPaste"; - EditorOption[EditorOption["formatOnType"] = 41] = "formatOnType"; - EditorOption[EditorOption["glyphMargin"] = 42] = "glyphMargin"; - EditorOption[EditorOption["gotoLocation"] = 43] = "gotoLocation"; - EditorOption[EditorOption["hideCursorInOverviewRuler"] = 44] = "hideCursorInOverviewRuler"; - EditorOption[EditorOption["highlightActiveIndentGuide"] = 45] = "highlightActiveIndentGuide"; - EditorOption[EditorOption["hover"] = 46] = "hover"; - EditorOption[EditorOption["inDiffEditor"] = 47] = "inDiffEditor"; - EditorOption[EditorOption["letterSpacing"] = 48] = "letterSpacing"; - EditorOption[EditorOption["lightbulb"] = 49] = "lightbulb"; - EditorOption[EditorOption["lineDecorationsWidth"] = 50] = "lineDecorationsWidth"; - EditorOption[EditorOption["lineHeight"] = 51] = "lineHeight"; - EditorOption[EditorOption["lineNumbers"] = 52] = "lineNumbers"; - EditorOption[EditorOption["lineNumbersMinChars"] = 53] = "lineNumbersMinChars"; - EditorOption[EditorOption["links"] = 54] = "links"; - EditorOption[EditorOption["matchBrackets"] = 55] = "matchBrackets"; - EditorOption[EditorOption["minimap"] = 56] = "minimap"; - EditorOption[EditorOption["mouseStyle"] = 57] = "mouseStyle"; - EditorOption[EditorOption["mouseWheelScrollSensitivity"] = 58] = "mouseWheelScrollSensitivity"; - EditorOption[EditorOption["mouseWheelZoom"] = 59] = "mouseWheelZoom"; - EditorOption[EditorOption["multiCursorMergeOverlapping"] = 60] = "multiCursorMergeOverlapping"; - EditorOption[EditorOption["multiCursorModifier"] = 61] = "multiCursorModifier"; - EditorOption[EditorOption["multiCursorPaste"] = 62] = "multiCursorPaste"; - EditorOption[EditorOption["occurrencesHighlight"] = 63] = "occurrencesHighlight"; - EditorOption[EditorOption["overviewRulerBorder"] = 64] = "overviewRulerBorder"; - EditorOption[EditorOption["overviewRulerLanes"] = 65] = "overviewRulerLanes"; - EditorOption[EditorOption["padding"] = 66] = "padding"; - EditorOption[EditorOption["parameterHints"] = 67] = "parameterHints"; - EditorOption[EditorOption["peekWidgetDefaultFocus"] = 68] = "peekWidgetDefaultFocus"; - EditorOption[EditorOption["definitionLinkOpensInPeek"] = 69] = "definitionLinkOpensInPeek"; - EditorOption[EditorOption["quickSuggestions"] = 70] = "quickSuggestions"; - EditorOption[EditorOption["quickSuggestionsDelay"] = 71] = "quickSuggestionsDelay"; - EditorOption[EditorOption["readOnly"] = 72] = "readOnly"; - EditorOption[EditorOption["renameOnType"] = 73] = "renameOnType"; - EditorOption[EditorOption["renderControlCharacters"] = 74] = "renderControlCharacters"; - EditorOption[EditorOption["renderIndentGuides"] = 75] = "renderIndentGuides"; - EditorOption[EditorOption["renderFinalNewline"] = 76] = "renderFinalNewline"; - EditorOption[EditorOption["renderLineHighlight"] = 77] = "renderLineHighlight"; - EditorOption[EditorOption["renderLineHighlightOnlyWhenFocus"] = 78] = "renderLineHighlightOnlyWhenFocus"; - EditorOption[EditorOption["renderValidationDecorations"] = 79] = "renderValidationDecorations"; - EditorOption[EditorOption["renderWhitespace"] = 80] = "renderWhitespace"; - EditorOption[EditorOption["revealHorizontalRightPadding"] = 81] = "revealHorizontalRightPadding"; - EditorOption[EditorOption["roundedSelection"] = 82] = "roundedSelection"; - EditorOption[EditorOption["rulers"] = 83] = "rulers"; - EditorOption[EditorOption["scrollbar"] = 84] = "scrollbar"; - EditorOption[EditorOption["scrollBeyondLastColumn"] = 85] = "scrollBeyondLastColumn"; - EditorOption[EditorOption["scrollBeyondLastLine"] = 86] = "scrollBeyondLastLine"; - EditorOption[EditorOption["scrollPredominantAxis"] = 87] = "scrollPredominantAxis"; - EditorOption[EditorOption["selectionClipboard"] = 88] = "selectionClipboard"; - EditorOption[EditorOption["selectionHighlight"] = 89] = "selectionHighlight"; - EditorOption[EditorOption["selectOnLineNumbers"] = 90] = "selectOnLineNumbers"; - EditorOption[EditorOption["showFoldingControls"] = 91] = "showFoldingControls"; - EditorOption[EditorOption["showUnused"] = 92] = "showUnused"; - EditorOption[EditorOption["snippetSuggestions"] = 93] = "snippetSuggestions"; - EditorOption[EditorOption["smoothScrolling"] = 94] = "smoothScrolling"; - EditorOption[EditorOption["stopRenderingLineAfter"] = 95] = "stopRenderingLineAfter"; - EditorOption[EditorOption["suggest"] = 96] = "suggest"; - EditorOption[EditorOption["suggestFontSize"] = 97] = "suggestFontSize"; - EditorOption[EditorOption["suggestLineHeight"] = 98] = "suggestLineHeight"; - EditorOption[EditorOption["suggestOnTriggerCharacters"] = 99] = "suggestOnTriggerCharacters"; - EditorOption[EditorOption["suggestSelection"] = 100] = "suggestSelection"; - EditorOption[EditorOption["tabCompletion"] = 101] = "tabCompletion"; - EditorOption[EditorOption["tabIndex"] = 102] = "tabIndex"; - EditorOption[EditorOption["unusualLineTerminators"] = 103] = "unusualLineTerminators"; - EditorOption[EditorOption["useTabStops"] = 104] = "useTabStops"; - EditorOption[EditorOption["wordSeparators"] = 105] = "wordSeparators"; - EditorOption[EditorOption["wordWrap"] = 106] = "wordWrap"; - EditorOption[EditorOption["wordWrapBreakAfterCharacters"] = 107] = "wordWrapBreakAfterCharacters"; - EditorOption[EditorOption["wordWrapBreakBeforeCharacters"] = 108] = "wordWrapBreakBeforeCharacters"; - EditorOption[EditorOption["wordWrapColumn"] = 109] = "wordWrapColumn"; - EditorOption[EditorOption["wordWrapMinified"] = 110] = "wordWrapMinified"; - EditorOption[EditorOption["wrappingIndent"] = 111] = "wrappingIndent"; - EditorOption[EditorOption["wrappingStrategy"] = 112] = "wrappingStrategy"; - EditorOption[EditorOption["showDeprecated"] = 113] = "showDeprecated"; - EditorOption[EditorOption["editorClassName"] = 114] = "editorClassName"; - EditorOption[EditorOption["pixelRatio"] = 115] = "pixelRatio"; - EditorOption[EditorOption["tabFocusMode"] = 116] = "tabFocusMode"; - EditorOption[EditorOption["layoutInfo"] = 117] = "layoutInfo"; - EditorOption[EditorOption["wrappingInfo"] = 118] = "wrappingInfo"; -})(EditorOption || (EditorOption = {})); -/** - * End of line character preference. - */ -var EndOfLinePreference; -(function (EndOfLinePreference) { - /** - * Use the end of line character identified in the text buffer. - */ - EndOfLinePreference[EndOfLinePreference["TextDefined"] = 0] = "TextDefined"; - /** - * Use line feed (\n) as the end of line character. - */ - EndOfLinePreference[EndOfLinePreference["LF"] = 1] = "LF"; - /** - * Use carriage return and line feed (\r\n) as the end of line character. - */ - EndOfLinePreference[EndOfLinePreference["CRLF"] = 2] = "CRLF"; -})(EndOfLinePreference || (EndOfLinePreference = {})); -/** - * End of line character preference. - */ -var EndOfLineSequence; -(function (EndOfLineSequence) { - /** - * Use line feed (\n) as the end of line character. - */ - EndOfLineSequence[EndOfLineSequence["LF"] = 0] = "LF"; - /** - * Use carriage return and line feed (\r\n) as the end of line character. - */ - EndOfLineSequence[EndOfLineSequence["CRLF"] = 1] = "CRLF"; -})(EndOfLineSequence || (EndOfLineSequence = {})); -/** - * Describes what to do with the indentation when pressing Enter. - */ -var IndentAction; -(function (IndentAction) { - /** - * Insert new line and copy the previous line's indentation. - */ - IndentAction[IndentAction["None"] = 0] = "None"; - /** - * Insert new line and indent once (relative to the previous line's indentation). - */ - IndentAction[IndentAction["Indent"] = 1] = "Indent"; - /** - * Insert two new lines: - * - the first one indented which will hold the cursor - * - the second one at the same indentation level - */ - IndentAction[IndentAction["IndentOutdent"] = 2] = "IndentOutdent"; - /** - * Insert new line and outdent once (relative to the previous line's indentation). - */ - IndentAction[IndentAction["Outdent"] = 3] = "Outdent"; -})(IndentAction || (IndentAction = {})); -/** - * Virtual Key Codes, the value does not hold any inherent meaning. - * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx - * But these are "more general", as they should work across browsers & OS`s. - */ -var KeyCode; -(function (KeyCode) { - /** - * Placed first to cover the 0 value of the enum. - */ - KeyCode[KeyCode["Unknown"] = 0] = "Unknown"; - KeyCode[KeyCode["Backspace"] = 1] = "Backspace"; - KeyCode[KeyCode["Tab"] = 2] = "Tab"; - KeyCode[KeyCode["Enter"] = 3] = "Enter"; - KeyCode[KeyCode["Shift"] = 4] = "Shift"; - KeyCode[KeyCode["Ctrl"] = 5] = "Ctrl"; - KeyCode[KeyCode["Alt"] = 6] = "Alt"; - KeyCode[KeyCode["PauseBreak"] = 7] = "PauseBreak"; - KeyCode[KeyCode["CapsLock"] = 8] = "CapsLock"; - KeyCode[KeyCode["Escape"] = 9] = "Escape"; - KeyCode[KeyCode["Space"] = 10] = "Space"; - KeyCode[KeyCode["PageUp"] = 11] = "PageUp"; - KeyCode[KeyCode["PageDown"] = 12] = "PageDown"; - KeyCode[KeyCode["End"] = 13] = "End"; - KeyCode[KeyCode["Home"] = 14] = "Home"; - KeyCode[KeyCode["LeftArrow"] = 15] = "LeftArrow"; - KeyCode[KeyCode["UpArrow"] = 16] = "UpArrow"; - KeyCode[KeyCode["RightArrow"] = 17] = "RightArrow"; - KeyCode[KeyCode["DownArrow"] = 18] = "DownArrow"; - KeyCode[KeyCode["Insert"] = 19] = "Insert"; - KeyCode[KeyCode["Delete"] = 20] = "Delete"; - KeyCode[KeyCode["KEY_0"] = 21] = "KEY_0"; - KeyCode[KeyCode["KEY_1"] = 22] = "KEY_1"; - KeyCode[KeyCode["KEY_2"] = 23] = "KEY_2"; - KeyCode[KeyCode["KEY_3"] = 24] = "KEY_3"; - KeyCode[KeyCode["KEY_4"] = 25] = "KEY_4"; - KeyCode[KeyCode["KEY_5"] = 26] = "KEY_5"; - KeyCode[KeyCode["KEY_6"] = 27] = "KEY_6"; - KeyCode[KeyCode["KEY_7"] = 28] = "KEY_7"; - KeyCode[KeyCode["KEY_8"] = 29] = "KEY_8"; - KeyCode[KeyCode["KEY_9"] = 30] = "KEY_9"; - KeyCode[KeyCode["KEY_A"] = 31] = "KEY_A"; - KeyCode[KeyCode["KEY_B"] = 32] = "KEY_B"; - KeyCode[KeyCode["KEY_C"] = 33] = "KEY_C"; - KeyCode[KeyCode["KEY_D"] = 34] = "KEY_D"; - KeyCode[KeyCode["KEY_E"] = 35] = "KEY_E"; - KeyCode[KeyCode["KEY_F"] = 36] = "KEY_F"; - KeyCode[KeyCode["KEY_G"] = 37] = "KEY_G"; - KeyCode[KeyCode["KEY_H"] = 38] = "KEY_H"; - KeyCode[KeyCode["KEY_I"] = 39] = "KEY_I"; - KeyCode[KeyCode["KEY_J"] = 40] = "KEY_J"; - KeyCode[KeyCode["KEY_K"] = 41] = "KEY_K"; - KeyCode[KeyCode["KEY_L"] = 42] = "KEY_L"; - KeyCode[KeyCode["KEY_M"] = 43] = "KEY_M"; - KeyCode[KeyCode["KEY_N"] = 44] = "KEY_N"; - KeyCode[KeyCode["KEY_O"] = 45] = "KEY_O"; - KeyCode[KeyCode["KEY_P"] = 46] = "KEY_P"; - KeyCode[KeyCode["KEY_Q"] = 47] = "KEY_Q"; - KeyCode[KeyCode["KEY_R"] = 48] = "KEY_R"; - KeyCode[KeyCode["KEY_S"] = 49] = "KEY_S"; - KeyCode[KeyCode["KEY_T"] = 50] = "KEY_T"; - KeyCode[KeyCode["KEY_U"] = 51] = "KEY_U"; - KeyCode[KeyCode["KEY_V"] = 52] = "KEY_V"; - KeyCode[KeyCode["KEY_W"] = 53] = "KEY_W"; - KeyCode[KeyCode["KEY_X"] = 54] = "KEY_X"; - KeyCode[KeyCode["KEY_Y"] = 55] = "KEY_Y"; - KeyCode[KeyCode["KEY_Z"] = 56] = "KEY_Z"; - KeyCode[KeyCode["Meta"] = 57] = "Meta"; - KeyCode[KeyCode["ContextMenu"] = 58] = "ContextMenu"; - KeyCode[KeyCode["F1"] = 59] = "F1"; - KeyCode[KeyCode["F2"] = 60] = "F2"; - KeyCode[KeyCode["F3"] = 61] = "F3"; - KeyCode[KeyCode["F4"] = 62] = "F4"; - KeyCode[KeyCode["F5"] = 63] = "F5"; - KeyCode[KeyCode["F6"] = 64] = "F6"; - KeyCode[KeyCode["F7"] = 65] = "F7"; - KeyCode[KeyCode["F8"] = 66] = "F8"; - KeyCode[KeyCode["F9"] = 67] = "F9"; - KeyCode[KeyCode["F10"] = 68] = "F10"; - KeyCode[KeyCode["F11"] = 69] = "F11"; - KeyCode[KeyCode["F12"] = 70] = "F12"; - KeyCode[KeyCode["F13"] = 71] = "F13"; - KeyCode[KeyCode["F14"] = 72] = "F14"; - KeyCode[KeyCode["F15"] = 73] = "F15"; - KeyCode[KeyCode["F16"] = 74] = "F16"; - KeyCode[KeyCode["F17"] = 75] = "F17"; - KeyCode[KeyCode["F18"] = 76] = "F18"; - KeyCode[KeyCode["F19"] = 77] = "F19"; - KeyCode[KeyCode["NumLock"] = 78] = "NumLock"; - KeyCode[KeyCode["ScrollLock"] = 79] = "ScrollLock"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the ';:' key - */ - KeyCode[KeyCode["US_SEMICOLON"] = 80] = "US_SEMICOLON"; - /** - * For any country/region, the '+' key - * For the US standard keyboard, the '=+' key - */ - KeyCode[KeyCode["US_EQUAL"] = 81] = "US_EQUAL"; - /** - * For any country/region, the ',' key - * For the US standard keyboard, the ',<' key - */ - KeyCode[KeyCode["US_COMMA"] = 82] = "US_COMMA"; - /** - * For any country/region, the '-' key - * For the US standard keyboard, the '-_' key - */ - KeyCode[KeyCode["US_MINUS"] = 83] = "US_MINUS"; - /** - * For any country/region, the '.' key - * For the US standard keyboard, the '.>' key - */ - KeyCode[KeyCode["US_DOT"] = 84] = "US_DOT"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the '/?' key - */ - KeyCode[KeyCode["US_SLASH"] = 85] = "US_SLASH"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the '`~' key - */ - KeyCode[KeyCode["US_BACKTICK"] = 86] = "US_BACKTICK"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the '[{' key - */ - KeyCode[KeyCode["US_OPEN_SQUARE_BRACKET"] = 87] = "US_OPEN_SQUARE_BRACKET"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the '\|' key - */ - KeyCode[KeyCode["US_BACKSLASH"] = 88] = "US_BACKSLASH"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the ']}' key - */ - KeyCode[KeyCode["US_CLOSE_SQUARE_BRACKET"] = 89] = "US_CLOSE_SQUARE_BRACKET"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - * For the US standard keyboard, the ''"' key - */ - KeyCode[KeyCode["US_QUOTE"] = 90] = "US_QUOTE"; - /** - * Used for miscellaneous characters; it can vary by keyboard. - */ - KeyCode[KeyCode["OEM_8"] = 91] = "OEM_8"; - /** - * Either the angle bracket key or the backslash key on the RT 102-key keyboard. - */ - KeyCode[KeyCode["OEM_102"] = 92] = "OEM_102"; - KeyCode[KeyCode["NUMPAD_0"] = 93] = "NUMPAD_0"; - KeyCode[KeyCode["NUMPAD_1"] = 94] = "NUMPAD_1"; - KeyCode[KeyCode["NUMPAD_2"] = 95] = "NUMPAD_2"; - KeyCode[KeyCode["NUMPAD_3"] = 96] = "NUMPAD_3"; - KeyCode[KeyCode["NUMPAD_4"] = 97] = "NUMPAD_4"; - KeyCode[KeyCode["NUMPAD_5"] = 98] = "NUMPAD_5"; - KeyCode[KeyCode["NUMPAD_6"] = 99] = "NUMPAD_6"; - KeyCode[KeyCode["NUMPAD_7"] = 100] = "NUMPAD_7"; - KeyCode[KeyCode["NUMPAD_8"] = 101] = "NUMPAD_8"; - KeyCode[KeyCode["NUMPAD_9"] = 102] = "NUMPAD_9"; - KeyCode[KeyCode["NUMPAD_MULTIPLY"] = 103] = "NUMPAD_MULTIPLY"; - KeyCode[KeyCode["NUMPAD_ADD"] = 104] = "NUMPAD_ADD"; - KeyCode[KeyCode["NUMPAD_SEPARATOR"] = 105] = "NUMPAD_SEPARATOR"; - KeyCode[KeyCode["NUMPAD_SUBTRACT"] = 106] = "NUMPAD_SUBTRACT"; - KeyCode[KeyCode["NUMPAD_DECIMAL"] = 107] = "NUMPAD_DECIMAL"; - KeyCode[KeyCode["NUMPAD_DIVIDE"] = 108] = "NUMPAD_DIVIDE"; - /** - * Cover all key codes when IME is processing input. - */ - KeyCode[KeyCode["KEY_IN_COMPOSITION"] = 109] = "KEY_IN_COMPOSITION"; - KeyCode[KeyCode["ABNT_C1"] = 110] = "ABNT_C1"; - KeyCode[KeyCode["ABNT_C2"] = 111] = "ABNT_C2"; - /** - * Placed last to cover the length of the enum. - * Please do not depend on this value! - */ - KeyCode[KeyCode["MAX_VALUE"] = 112] = "MAX_VALUE"; -})(KeyCode || (KeyCode = {})); -var MarkerSeverity; -(function (MarkerSeverity) { - MarkerSeverity[MarkerSeverity["Hint"] = 1] = "Hint"; - MarkerSeverity[MarkerSeverity["Info"] = 2] = "Info"; - MarkerSeverity[MarkerSeverity["Warning"] = 4] = "Warning"; - MarkerSeverity[MarkerSeverity["Error"] = 8] = "Error"; -})(MarkerSeverity || (MarkerSeverity = {})); -var MarkerTag; -(function (MarkerTag) { - MarkerTag[MarkerTag["Unnecessary"] = 1] = "Unnecessary"; - MarkerTag[MarkerTag["Deprecated"] = 2] = "Deprecated"; -})(MarkerTag || (MarkerTag = {})); -/** - * Position in the minimap to render the decoration. - */ -var MinimapPosition; -(function (MinimapPosition) { - MinimapPosition[MinimapPosition["Inline"] = 1] = "Inline"; - MinimapPosition[MinimapPosition["Gutter"] = 2] = "Gutter"; -})(MinimapPosition || (MinimapPosition = {})); -/** - * Type of hit element with the mouse in the editor. - */ -var MouseTargetType; -(function (MouseTargetType) { - /** - * Mouse is on top of an unknown element. - */ - MouseTargetType[MouseTargetType["UNKNOWN"] = 0] = "UNKNOWN"; - /** - * Mouse is on top of the textarea used for input. - */ - MouseTargetType[MouseTargetType["TEXTAREA"] = 1] = "TEXTAREA"; - /** - * Mouse is on top of the glyph margin - */ - MouseTargetType[MouseTargetType["GUTTER_GLYPH_MARGIN"] = 2] = "GUTTER_GLYPH_MARGIN"; - /** - * Mouse is on top of the line numbers - */ - MouseTargetType[MouseTargetType["GUTTER_LINE_NUMBERS"] = 3] = "GUTTER_LINE_NUMBERS"; - /** - * Mouse is on top of the line decorations - */ - MouseTargetType[MouseTargetType["GUTTER_LINE_DECORATIONS"] = 4] = "GUTTER_LINE_DECORATIONS"; - /** - * Mouse is on top of the whitespace left in the gutter by a view zone. - */ - MouseTargetType[MouseTargetType["GUTTER_VIEW_ZONE"] = 5] = "GUTTER_VIEW_ZONE"; - /** - * Mouse is on top of text in the content. - */ - MouseTargetType[MouseTargetType["CONTENT_TEXT"] = 6] = "CONTENT_TEXT"; - /** - * Mouse is on top of empty space in the content (e.g. after line text or below last line) - */ - MouseTargetType[MouseTargetType["CONTENT_EMPTY"] = 7] = "CONTENT_EMPTY"; - /** - * Mouse is on top of a view zone in the content. - */ - MouseTargetType[MouseTargetType["CONTENT_VIEW_ZONE"] = 8] = "CONTENT_VIEW_ZONE"; - /** - * Mouse is on top of a content widget. - */ - MouseTargetType[MouseTargetType["CONTENT_WIDGET"] = 9] = "CONTENT_WIDGET"; - /** - * Mouse is on top of the decorations overview ruler. - */ - MouseTargetType[MouseTargetType["OVERVIEW_RULER"] = 10] = "OVERVIEW_RULER"; - /** - * Mouse is on top of a scrollbar. - */ - MouseTargetType[MouseTargetType["SCROLLBAR"] = 11] = "SCROLLBAR"; - /** - * Mouse is on top of an overlay widget. - */ - MouseTargetType[MouseTargetType["OVERLAY_WIDGET"] = 12] = "OVERLAY_WIDGET"; - /** - * Mouse is outside of the editor. - */ - MouseTargetType[MouseTargetType["OUTSIDE_EDITOR"] = 13] = "OUTSIDE_EDITOR"; -})(MouseTargetType || (MouseTargetType = {})); -/** - * A positioning preference for rendering overlay widgets. - */ -var OverlayWidgetPositionPreference; -(function (OverlayWidgetPositionPreference) { - /** - * Position the overlay widget in the top right corner - */ - OverlayWidgetPositionPreference[OverlayWidgetPositionPreference["TOP_RIGHT_CORNER"] = 0] = "TOP_RIGHT_CORNER"; - /** - * Position the overlay widget in the bottom right corner - */ - OverlayWidgetPositionPreference[OverlayWidgetPositionPreference["BOTTOM_RIGHT_CORNER"] = 1] = "BOTTOM_RIGHT_CORNER"; - /** - * Position the overlay widget in the top center - */ - OverlayWidgetPositionPreference[OverlayWidgetPositionPreference["TOP_CENTER"] = 2] = "TOP_CENTER"; -})(OverlayWidgetPositionPreference || (OverlayWidgetPositionPreference = {})); -/** - * Vertical Lane in the overview ruler of the editor. - */ -var OverviewRulerLane; -(function (OverviewRulerLane) { - OverviewRulerLane[OverviewRulerLane["Left"] = 1] = "Left"; - OverviewRulerLane[OverviewRulerLane["Center"] = 2] = "Center"; - OverviewRulerLane[OverviewRulerLane["Right"] = 4] = "Right"; - OverviewRulerLane[OverviewRulerLane["Full"] = 7] = "Full"; -})(OverviewRulerLane || (OverviewRulerLane = {})); -var RenderLineNumbersType; -(function (RenderLineNumbersType) { - RenderLineNumbersType[RenderLineNumbersType["Off"] = 0] = "Off"; - RenderLineNumbersType[RenderLineNumbersType["On"] = 1] = "On"; - RenderLineNumbersType[RenderLineNumbersType["Relative"] = 2] = "Relative"; - RenderLineNumbersType[RenderLineNumbersType["Interval"] = 3] = "Interval"; - RenderLineNumbersType[RenderLineNumbersType["Custom"] = 4] = "Custom"; -})(RenderLineNumbersType || (RenderLineNumbersType = {})); -var RenderMinimap; -(function (RenderMinimap) { - RenderMinimap[RenderMinimap["None"] = 0] = "None"; - RenderMinimap[RenderMinimap["Text"] = 1] = "Text"; - RenderMinimap[RenderMinimap["Blocks"] = 2] = "Blocks"; -})(RenderMinimap || (RenderMinimap = {})); -var ScrollType; -(function (ScrollType) { - ScrollType[ScrollType["Smooth"] = 0] = "Smooth"; - ScrollType[ScrollType["Immediate"] = 1] = "Immediate"; -})(ScrollType || (ScrollType = {})); -var ScrollbarVisibility; -(function (ScrollbarVisibility) { - ScrollbarVisibility[ScrollbarVisibility["Auto"] = 1] = "Auto"; - ScrollbarVisibility[ScrollbarVisibility["Hidden"] = 2] = "Hidden"; - ScrollbarVisibility[ScrollbarVisibility["Visible"] = 3] = "Visible"; -})(ScrollbarVisibility || (ScrollbarVisibility = {})); -/** - * The direction of a selection. - */ -var SelectionDirection; -(function (SelectionDirection) { - /** - * The selection starts above where it ends. - */ - SelectionDirection[SelectionDirection["LTR"] = 0] = "LTR"; - /** - * The selection starts below where it ends. - */ - SelectionDirection[SelectionDirection["RTL"] = 1] = "RTL"; -})(SelectionDirection || (SelectionDirection = {})); -var SignatureHelpTriggerKind; -(function (SignatureHelpTriggerKind) { - SignatureHelpTriggerKind[SignatureHelpTriggerKind["Invoke"] = 1] = "Invoke"; - SignatureHelpTriggerKind[SignatureHelpTriggerKind["TriggerCharacter"] = 2] = "TriggerCharacter"; - SignatureHelpTriggerKind[SignatureHelpTriggerKind["ContentChange"] = 3] = "ContentChange"; -})(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {})); -/** - * A symbol kind. - */ -var SymbolKind; -(function (SymbolKind) { - SymbolKind[SymbolKind["File"] = 0] = "File"; - SymbolKind[SymbolKind["Module"] = 1] = "Module"; - SymbolKind[SymbolKind["Namespace"] = 2] = "Namespace"; - SymbolKind[SymbolKind["Package"] = 3] = "Package"; - SymbolKind[SymbolKind["Class"] = 4] = "Class"; - SymbolKind[SymbolKind["Method"] = 5] = "Method"; - SymbolKind[SymbolKind["Property"] = 6] = "Property"; - SymbolKind[SymbolKind["Field"] = 7] = "Field"; - SymbolKind[SymbolKind["Constructor"] = 8] = "Constructor"; - SymbolKind[SymbolKind["Enum"] = 9] = "Enum"; - SymbolKind[SymbolKind["Interface"] = 10] = "Interface"; - SymbolKind[SymbolKind["Function"] = 11] = "Function"; - SymbolKind[SymbolKind["Variable"] = 12] = "Variable"; - SymbolKind[SymbolKind["Constant"] = 13] = "Constant"; - SymbolKind[SymbolKind["String"] = 14] = "String"; - SymbolKind[SymbolKind["Number"] = 15] = "Number"; - SymbolKind[SymbolKind["Boolean"] = 16] = "Boolean"; - SymbolKind[SymbolKind["Array"] = 17] = "Array"; - SymbolKind[SymbolKind["Object"] = 18] = "Object"; - SymbolKind[SymbolKind["Key"] = 19] = "Key"; - SymbolKind[SymbolKind["Null"] = 20] = "Null"; - SymbolKind[SymbolKind["EnumMember"] = 21] = "EnumMember"; - SymbolKind[SymbolKind["Struct"] = 22] = "Struct"; - SymbolKind[SymbolKind["Event"] = 23] = "Event"; - SymbolKind[SymbolKind["Operator"] = 24] = "Operator"; - SymbolKind[SymbolKind["TypeParameter"] = 25] = "TypeParameter"; -})(SymbolKind || (SymbolKind = {})); -var SymbolTag; -(function (SymbolTag) { - SymbolTag[SymbolTag["Deprecated"] = 1] = "Deprecated"; -})(SymbolTag || (SymbolTag = {})); -/** - * The kind of animation in which the editor's cursor should be rendered. - */ -var TextEditorCursorBlinkingStyle; -(function (TextEditorCursorBlinkingStyle) { - /** - * Hidden - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Hidden"] = 0] = "Hidden"; - /** - * Blinking - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Blink"] = 1] = "Blink"; - /** - * Blinking with smooth fading - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Smooth"] = 2] = "Smooth"; - /** - * Blinking with prolonged filled state and smooth fading - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Phase"] = 3] = "Phase"; - /** - * Expand collapse animation on the y axis - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Expand"] = 4] = "Expand"; - /** - * No-Blinking - */ - TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Solid"] = 5] = "Solid"; -})(TextEditorCursorBlinkingStyle || (TextEditorCursorBlinkingStyle = {})); -/** - * The style in which the editor's cursor should be rendered. - */ -var TextEditorCursorStyle; -(function (TextEditorCursorStyle) { - /** - * As a vertical line (sitting between two characters). - */ - TextEditorCursorStyle[TextEditorCursorStyle["Line"] = 1] = "Line"; - /** - * As a block (sitting on top of a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["Block"] = 2] = "Block"; - /** - * As a horizontal line (sitting under a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["Underline"] = 3] = "Underline"; - /** - * As a thin vertical line (sitting between two characters). - */ - TextEditorCursorStyle[TextEditorCursorStyle["LineThin"] = 4] = "LineThin"; - /** - * As an outlined block (sitting on top of a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["BlockOutline"] = 5] = "BlockOutline"; - /** - * As a thin horizontal line (sitting under a character). - */ - TextEditorCursorStyle[TextEditorCursorStyle["UnderlineThin"] = 6] = "UnderlineThin"; -})(TextEditorCursorStyle || (TextEditorCursorStyle = {})); -/** - * Describes the behavior of decorations when typing/editing near their edges. - * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior` - */ -var TrackedRangeStickiness; -(function (TrackedRangeStickiness) { - TrackedRangeStickiness[TrackedRangeStickiness["AlwaysGrowsWhenTypingAtEdges"] = 0] = "AlwaysGrowsWhenTypingAtEdges"; - TrackedRangeStickiness[TrackedRangeStickiness["NeverGrowsWhenTypingAtEdges"] = 1] = "NeverGrowsWhenTypingAtEdges"; - TrackedRangeStickiness[TrackedRangeStickiness["GrowsOnlyWhenTypingBefore"] = 2] = "GrowsOnlyWhenTypingBefore"; - TrackedRangeStickiness[TrackedRangeStickiness["GrowsOnlyWhenTypingAfter"] = 3] = "GrowsOnlyWhenTypingAfter"; -})(TrackedRangeStickiness || (TrackedRangeStickiness = {})); -/** - * Describes how to indent wrapped lines. - */ -var WrappingIndent; -(function (WrappingIndent) { - /** - * No indentation => wrapped lines begin at column 1. - */ - WrappingIndent[WrappingIndent["None"] = 0] = "None"; - /** - * Same => wrapped lines get the same indentation as the parent. - */ - WrappingIndent[WrappingIndent["Same"] = 1] = "Same"; - /** - * Indent => wrapped lines get +1 indentation toward the parent. - */ - WrappingIndent[WrappingIndent["Indent"] = 2] = "Indent"; - /** - * DeepIndent => wrapped lines get +2 indentation toward the parent. - */ - WrappingIndent[WrappingIndent["DeepIndent"] = 3] = "DeepIndent"; -})(WrappingIndent || (WrappingIndent = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js ***! - \****************************************************************************************/ -/*! exports provided: PrefixSumIndexOfResult, PrefixSumComputer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumIndexOfResult", function() { return PrefixSumIndexOfResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputer", function() { return PrefixSumComputer; }); -/* harmony import */ var _base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uint.js */ "./node_modules/monaco-editor/esm/vs/base/common/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -class PrefixSumIndexOfResult { - constructor(index, remainder) { - this.index = index; - this.remainder = remainder; - } -} -class PrefixSumComputer { - constructor(values) { - this.values = values; - this.prefixSum = new Uint32Array(values.length); - this.prefixSumValidIndex = new Int32Array(1); - this.prefixSumValidIndex[0] = -1; - } - insertValues(insertIndex, insertValues) { - insertIndex = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(insertIndex); - const oldValues = this.values; - const oldPrefixSum = this.prefixSum; - const insertValuesLen = insertValues.length; - if (insertValuesLen === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length + insertValuesLen); - this.values.set(oldValues.subarray(0, insertIndex), 0); - this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); - this.values.set(insertValues, insertIndex); - if (insertIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = insertIndex - 1; - } - this.prefixSum = new Uint32Array(this.values.length); - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; - } - changeValue(index, value) { - index = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - value = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(value); - if (this.values[index] === value) { - return false; - } - this.values[index] = value; - if (index - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = index - 1; - } - return true; - } - removeValues(startIndex, cnt) { - startIndex = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(startIndex); - cnt = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(cnt); - const oldValues = this.values; - const oldPrefixSum = this.prefixSum; - if (startIndex >= oldValues.length) { - return false; - } - let maxCnt = oldValues.length - startIndex; - if (cnt >= maxCnt) { - cnt = maxCnt; - } - if (cnt === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length - cnt); - this.values.set(oldValues.subarray(0, startIndex), 0); - this.values.set(oldValues.subarray(startIndex + cnt), startIndex); - this.prefixSum = new Uint32Array(this.values.length); - if (startIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = startIndex - 1; - } - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; - } - getTotalValue() { - if (this.values.length === 0) { - return 0; - } - return this._getAccumulatedValue(this.values.length - 1); - } - getAccumulatedValue(index) { - if (index < 0) { - return 0; - } - index = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - return this._getAccumulatedValue(index); - } - _getAccumulatedValue(index) { - if (index <= this.prefixSumValidIndex[0]) { - return this.prefixSum[index]; - } - let startIndex = this.prefixSumValidIndex[0] + 1; - if (startIndex === 0) { - this.prefixSum[0] = this.values[0]; - startIndex++; - } - if (index >= this.values.length) { - index = this.values.length - 1; - } - for (let i = startIndex; i <= index; i++) { - this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; - } - this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); - return this.prefixSum[index]; - } - getIndexOf(accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - // Compute all sums (to get a fully valid prefixSum) - this.getTotalValue(); - let low = 0; - let high = this.values.length - 1; - let mid = 0; - let midStop = 0; - let midStart = 0; - while (low <= high) { - mid = low + ((high - low) / 2) | 0; - midStop = this.prefixSum[mid]; - midStart = midStop - this.values[mid]; - if (accumulatedValue < midStart) { - high = mid - 1; - } - else if (accumulatedValue >= midStop) { - low = mid + 1; - } - else { - break; - } - } - return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js ***! - \*******************************************************************/ -/*! exports provided: initialize */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialize", function() { return initialize; }); -/* harmony import */ var _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/common/worker/simpleWorker.js */ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js"); -/* harmony import */ var _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/services/editorSimpleWorker.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -let initialized = false; -function initialize(foreignModule) { - if (initialized) { - return; - } - initialized = true; - const simpleWorker = new _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__["SimpleWorkerServer"]((msg) => { - self.postMessage(msg); - }, (host) => new _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__["EditorSimpleWorker"](host, foreignModule)); - self.onmessage = (e) => { - simpleWorker.onmessage(e.data); - }; -} -self.onmessage = (e) => { - // Ignore first message in this case and initialize if not yet initialized - if (!initialized) { - initialize(null); - } -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/edit.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/edit.js ***! - \*****************************************************************************************/ -/*! exports provided: removeProperty, setProperty, applyEdit, isWS */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeProperty", function() { return removeProperty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setProperty", function() { return setProperty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyEdit", function() { return applyEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWS", function() { return isWS; }); -/* harmony import */ var _format_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./format.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/format.js"); -/* harmony import */ var _parser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/parser.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -function removeProperty(text, path, options) { - return setProperty(text, path, void 0, options); -} -function setProperty(text, originalPath, value, options) { - var _a; - var path = originalPath.slice(); - var errors = []; - var root = Object(_parser_js__WEBPACK_IMPORTED_MODULE_1__["parseTree"])(text, errors); - var parent = void 0; - var lastSegment = void 0; - while (path.length > 0) { - lastSegment = path.pop(); - parent = Object(_parser_js__WEBPACK_IMPORTED_MODULE_1__["findNodeAtLocation"])(root, path); - if (parent === void 0 && value !== void 0) { - if (typeof lastSegment === 'string') { - value = (_a = {}, _a[lastSegment] = value, _a); - } - else { - value = [value]; - } - } - else { - break; - } - } - if (!parent) { - // empty document - if (value === void 0) { // delete - throw new Error('Can not delete in empty document'); - } - return withFormatting(text, { offset: root ? root.offset : 0, length: root ? root.length : 0, content: JSON.stringify(value) }, options); - } - else if (parent.type === 'object' && typeof lastSegment === 'string' && Array.isArray(parent.children)) { - var existing = Object(_parser_js__WEBPACK_IMPORTED_MODULE_1__["findNodeAtLocation"])(parent, [lastSegment]); - if (existing !== void 0) { - if (value === void 0) { // delete - if (!existing.parent) { - throw new Error('Malformed AST'); - } - var propertyIndex = parent.children.indexOf(existing.parent); - var removeBegin = void 0; - var removeEnd = existing.parent.offset + existing.parent.length; - if (propertyIndex > 0) { - // remove the comma of the previous node - var previous = parent.children[propertyIndex - 1]; - removeBegin = previous.offset + previous.length; - } - else { - removeBegin = parent.offset + 1; - if (parent.children.length > 1) { - // remove the comma of the next node - var next = parent.children[1]; - removeEnd = next.offset; - } - } - return withFormatting(text, { offset: removeBegin, length: removeEnd - removeBegin, content: '' }, options); - } - else { - // set value of existing property - return withFormatting(text, { offset: existing.offset, length: existing.length, content: JSON.stringify(value) }, options); - } - } - else { - if (value === void 0) { // delete - return []; // property does not exist, nothing to do - } - var newProperty = JSON.stringify(lastSegment) + ": " + JSON.stringify(value); - var index = options.getInsertionIndex ? options.getInsertionIndex(parent.children.map(function (p) { return p.children[0].value; })) : parent.children.length; - var edit = void 0; - if (index > 0) { - var previous = parent.children[index - 1]; - edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty }; - } - else if (parent.children.length === 0) { - edit = { offset: parent.offset + 1, length: 0, content: newProperty }; - } - else { - edit = { offset: parent.offset + 1, length: 0, content: newProperty + ',' }; - } - return withFormatting(text, edit, options); - } - } - else if (parent.type === 'array' && typeof lastSegment === 'number' && Array.isArray(parent.children)) { - var insertIndex = lastSegment; - if (insertIndex === -1) { - // Insert - var newProperty = "" + JSON.stringify(value); - var edit = void 0; - if (parent.children.length === 0) { - edit = { offset: parent.offset + 1, length: 0, content: newProperty }; - } - else { - var previous = parent.children[parent.children.length - 1]; - edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty }; - } - return withFormatting(text, edit, options); - } - else if (value === void 0 && parent.children.length >= 0) { - // Removal - var removalIndex = lastSegment; - var toRemove = parent.children[removalIndex]; - var edit = void 0; - if (parent.children.length === 1) { - // only item - edit = { offset: parent.offset + 1, length: parent.length - 2, content: '' }; - } - else if (parent.children.length - 1 === removalIndex) { - // last item - var previous = parent.children[removalIndex - 1]; - var offset = previous.offset + previous.length; - var parentEndOffset = parent.offset + parent.length; - edit = { offset: offset, length: parentEndOffset - 2 - offset, content: '' }; - } - else { - edit = { offset: toRemove.offset, length: parent.children[removalIndex + 1].offset - toRemove.offset, content: '' }; - } - return withFormatting(text, edit, options); - } - else if (value !== void 0) { - var edit = void 0; - var newProperty = "" + JSON.stringify(value); - if (!options.isArrayInsertion && parent.children.length > lastSegment) { - var toModify = parent.children[lastSegment]; - edit = { offset: toModify.offset, length: toModify.length, content: newProperty }; - } - else if (parent.children.length === 0 || lastSegment === 0) { - edit = { offset: parent.offset + 1, length: 0, content: parent.children.length === 0 ? newProperty : newProperty + ',' }; - } - else { - var index = lastSegment > parent.children.length ? parent.children.length : lastSegment; - var previous = parent.children[index - 1]; - edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty }; - } - return withFormatting(text, edit, options); - } - else { - throw new Error("Can not " + (value === void 0 ? 'remove' : (options.isArrayInsertion ? 'insert' : 'modify')) + " Array index " + insertIndex + " as length is not sufficient"); - } - } - else { - throw new Error("Can not add " + (typeof lastSegment !== 'number' ? 'index' : 'property') + " to parent of type " + parent.type); - } -} -function withFormatting(text, edit, options) { - if (!options.formattingOptions) { - return [edit]; - } - // apply the edit - var newText = applyEdit(text, edit); - // format the new text - var begin = edit.offset; - var end = edit.offset + edit.content.length; - if (edit.length === 0 || edit.content.length === 0) { // insert or remove - while (begin > 0 && !Object(_format_js__WEBPACK_IMPORTED_MODULE_0__["isEOL"])(newText, begin - 1)) { - begin--; - } - while (end < newText.length && !Object(_format_js__WEBPACK_IMPORTED_MODULE_0__["isEOL"])(newText, end)) { - end++; - } - } - var edits = Object(_format_js__WEBPACK_IMPORTED_MODULE_0__["format"])(newText, { offset: begin, length: end - begin }, options.formattingOptions); - // apply the formatting edits and track the begin and end offsets of the changes - for (var i = edits.length - 1; i >= 0; i--) { - var edit_1 = edits[i]; - newText = applyEdit(newText, edit_1); - begin = Math.min(begin, edit_1.offset); - end = Math.max(end, edit_1.offset + edit_1.length); - end += edit_1.content.length - edit_1.length; - } - // create a single edit with all changes - var editLength = text.length - (newText.length - end) - begin; - return [{ offset: begin, length: editLength, content: newText.substring(begin, end) }]; -} -function applyEdit(text, edit) { - return text.substring(0, edit.offset) + edit.content + text.substring(edit.offset + edit.length); -} -function isWS(text, offset) { - return '\r\n \t'.indexOf(text.charAt(offset)) !== -1; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/format.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/format.js ***! - \*******************************************************************************************/ -/*! exports provided: format, isEOL */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEOL", function() { return isEOL; }); -/* harmony import */ var _scanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scanner.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -function format(documentText, range, options) { - var initialIndentLevel; - var formatText; - var formatTextStart; - var rangeStart; - var rangeEnd; - if (range) { - rangeStart = range.offset; - rangeEnd = rangeStart + range.length; - formatTextStart = rangeStart; - while (formatTextStart > 0 && !isEOL(documentText, formatTextStart - 1)) { - formatTextStart--; - } - var endOffset = rangeEnd; - while (endOffset < documentText.length && !isEOL(documentText, endOffset)) { - endOffset++; - } - formatText = documentText.substring(formatTextStart, endOffset); - initialIndentLevel = computeIndentLevel(formatText, options); - } - else { - formatText = documentText; - initialIndentLevel = 0; - formatTextStart = 0; - rangeStart = 0; - rangeEnd = documentText.length; - } - var eol = getEOL(options, documentText); - var lineBreak = false; - var indentLevel = 0; - var indentValue; - if (options.insertSpaces) { - indentValue = repeat(' ', options.tabSize || 4); - } - else { - indentValue = '\t'; - } - var scanner = Object(_scanner_js__WEBPACK_IMPORTED_MODULE_0__["createScanner"])(formatText, false); - var hasError = false; - function newLineAndIndent() { - return eol + repeat(indentValue, initialIndentLevel + indentLevel); - } - function scanNext() { - var token = scanner.scan(); - lineBreak = false; - while (token === 15 /* Trivia */ || token === 14 /* LineBreakTrivia */) { - lineBreak = lineBreak || (token === 14 /* LineBreakTrivia */); - token = scanner.scan(); - } - hasError = token === 16 /* Unknown */ || scanner.getTokenError() !== 0 /* None */; - return token; - } - var editOperations = []; - function addEdit(text, startOffset, endOffset) { - if (!hasError && startOffset < rangeEnd && endOffset > rangeStart && documentText.substring(startOffset, endOffset) !== text) { - editOperations.push({ offset: startOffset, length: endOffset - startOffset, content: text }); - } - } - var firstToken = scanNext(); - if (firstToken !== 17 /* EOF */) { - var firstTokenStart = scanner.getTokenOffset() + formatTextStart; - var initialIndent = repeat(indentValue, initialIndentLevel); - addEdit(initialIndent, formatTextStart, firstTokenStart); - } - while (firstToken !== 17 /* EOF */) { - var firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart; - var secondToken = scanNext(); - var replaceContent = ''; - while (!lineBreak && (secondToken === 12 /* LineCommentTrivia */ || secondToken === 13 /* BlockCommentTrivia */)) { - // comments on the same line: keep them on the same line, but ignore them otherwise - var commentTokenStart = scanner.getTokenOffset() + formatTextStart; - addEdit(' ', firstTokenEnd, commentTokenStart); - firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart; - replaceContent = secondToken === 12 /* LineCommentTrivia */ ? newLineAndIndent() : ''; - secondToken = scanNext(); - } - if (secondToken === 2 /* CloseBraceToken */) { - if (firstToken !== 1 /* OpenBraceToken */) { - indentLevel--; - replaceContent = newLineAndIndent(); - } - } - else if (secondToken === 4 /* CloseBracketToken */) { - if (firstToken !== 3 /* OpenBracketToken */) { - indentLevel--; - replaceContent = newLineAndIndent(); - } - } - else { - switch (firstToken) { - case 3 /* OpenBracketToken */: - case 1 /* OpenBraceToken */: - indentLevel++; - replaceContent = newLineAndIndent(); - break; - case 5 /* CommaToken */: - case 12 /* LineCommentTrivia */: - replaceContent = newLineAndIndent(); - break; - case 13 /* BlockCommentTrivia */: - if (lineBreak) { - replaceContent = newLineAndIndent(); - } - else { - // symbol following comment on the same line: keep on same line, separate with ' ' - replaceContent = ' '; - } - break; - case 6 /* ColonToken */: - replaceContent = ' '; - break; - case 10 /* StringLiteral */: - if (secondToken === 6 /* ColonToken */) { - replaceContent = ''; - break; - } - // fall through - case 7 /* NullKeyword */: - case 8 /* TrueKeyword */: - case 9 /* FalseKeyword */: - case 11 /* NumericLiteral */: - case 2 /* CloseBraceToken */: - case 4 /* CloseBracketToken */: - if (secondToken === 12 /* LineCommentTrivia */ || secondToken === 13 /* BlockCommentTrivia */) { - replaceContent = ' '; - } - else if (secondToken !== 5 /* CommaToken */ && secondToken !== 17 /* EOF */) { - hasError = true; - } - break; - case 16 /* Unknown */: - hasError = true; - break; - } - if (lineBreak && (secondToken === 12 /* LineCommentTrivia */ || secondToken === 13 /* BlockCommentTrivia */)) { - replaceContent = newLineAndIndent(); - } - } - var secondTokenStart = scanner.getTokenOffset() + formatTextStart; - addEdit(replaceContent, firstTokenEnd, secondTokenStart); - firstToken = secondToken; - } - return editOperations; -} -function repeat(s, count) { - var result = ''; - for (var i = 0; i < count; i++) { - result += s; - } - return result; -} -function computeIndentLevel(content, options) { - var i = 0; - var nChars = 0; - var tabSize = options.tabSize || 4; - while (i < content.length) { - var ch = content.charAt(i); - if (ch === ' ') { - nChars++; - } - else if (ch === '\t') { - nChars += tabSize; - } - else { - break; - } - i++; - } - return Math.floor(nChars / tabSize); -} -function getEOL(options, text) { - for (var i = 0; i < text.length; i++) { - var ch = text.charAt(i); - if (ch === '\r') { - if (i + 1 < text.length && text.charAt(i + 1) === '\n') { - return '\r\n'; - } - return '\r'; - } - else if (ch === '\n') { - return '\n'; - } - } - return (options && options.eol) || '\n'; -} -function isEOL(text, offset) { - return '\r\n'.indexOf(text.charAt(offset)) !== -1; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/parser.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/parser.js ***! - \*******************************************************************************************/ -/*! exports provided: getLocation, parse, parseTree, findNodeAtLocation, getNodePath, getNodeValue, contains, findNodeAtOffset, visit, stripComments, getNodeType */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocation", function() { return getLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseTree", function() { return parseTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNodeAtLocation", function() { return findNodeAtLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodePath", function() { return getNodePath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeValue", function() { return getNodeValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return contains; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNodeAtOffset", function() { return findNodeAtOffset; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "visit", function() { return visit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripComments", function() { return stripComments; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeType", function() { return getNodeType; }); -/* harmony import */ var _scanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scanner.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -var ParseOptions; -(function (ParseOptions) { - ParseOptions.DEFAULT = { - allowTrailingComma: false - }; -})(ParseOptions || (ParseOptions = {})); -/** - * For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index. - */ -function getLocation(text, position) { - var segments = []; // strings or numbers - var earlyReturnException = new Object(); - var previousNode = undefined; - var previousNodeInst = { - value: {}, - offset: 0, - length: 0, - type: 'object', - parent: undefined - }; - var isAtPropertyKey = false; - function setPreviousNode(value, offset, length, type) { - previousNodeInst.value = value; - previousNodeInst.offset = offset; - previousNodeInst.length = length; - previousNodeInst.type = type; - previousNodeInst.colonOffset = undefined; - previousNode = previousNodeInst; - } - try { - visit(text, { - onObjectBegin: function (offset, length) { - if (position <= offset) { - throw earlyReturnException; - } - previousNode = undefined; - isAtPropertyKey = position > offset; - segments.push(''); // push a placeholder (will be replaced) - }, - onObjectProperty: function (name, offset, length) { - if (position < offset) { - throw earlyReturnException; - } - setPreviousNode(name, offset, length, 'property'); - segments[segments.length - 1] = name; - if (position <= offset + length) { - throw earlyReturnException; - } - }, - onObjectEnd: function (offset, length) { - if (position <= offset) { - throw earlyReturnException; - } - previousNode = undefined; - segments.pop(); - }, - onArrayBegin: function (offset, length) { - if (position <= offset) { - throw earlyReturnException; - } - previousNode = undefined; - segments.push(0); - }, - onArrayEnd: function (offset, length) { - if (position <= offset) { - throw earlyReturnException; - } - previousNode = undefined; - segments.pop(); - }, - onLiteralValue: function (value, offset, length) { - if (position < offset) { - throw earlyReturnException; - } - setPreviousNode(value, offset, length, getNodeType(value)); - if (position <= offset + length) { - throw earlyReturnException; - } - }, - onSeparator: function (sep, offset, length) { - if (position <= offset) { - throw earlyReturnException; - } - if (sep === ':' && previousNode && previousNode.type === 'property') { - previousNode.colonOffset = offset; - isAtPropertyKey = false; - previousNode = undefined; - } - else if (sep === ',') { - var last = segments[segments.length - 1]; - if (typeof last === 'number') { - segments[segments.length - 1] = last + 1; - } - else { - isAtPropertyKey = true; - segments[segments.length - 1] = ''; - } - previousNode = undefined; - } - } - }); - } - catch (e) { - if (e !== earlyReturnException) { - throw e; - } - } - return { - path: segments, - previousNode: previousNode, - isAtPropertyKey: isAtPropertyKey, - matches: function (pattern) { - var k = 0; - for (var i = 0; k < pattern.length && i < segments.length; i++) { - if (pattern[k] === segments[i] || pattern[k] === '*') { - k++; - } - else if (pattern[k] !== '**') { - return false; - } - } - return k === pattern.length; - } - }; -} -/** - * Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result. - * Therefore always check the errors list to find out if the input was valid. - */ -function parse(text, errors, options) { - if (errors === void 0) { errors = []; } - if (options === void 0) { options = ParseOptions.DEFAULT; } - var currentProperty = null; - var currentParent = []; - var previousParents = []; - function onValue(value) { - if (Array.isArray(currentParent)) { - currentParent.push(value); - } - else if (currentProperty !== null) { - currentParent[currentProperty] = value; - } - } - var visitor = { - onObjectBegin: function () { - var object = {}; - onValue(object); - previousParents.push(currentParent); - currentParent = object; - currentProperty = null; - }, - onObjectProperty: function (name) { - currentProperty = name; - }, - onObjectEnd: function () { - currentParent = previousParents.pop(); - }, - onArrayBegin: function () { - var array = []; - onValue(array); - previousParents.push(currentParent); - currentParent = array; - currentProperty = null; - }, - onArrayEnd: function () { - currentParent = previousParents.pop(); - }, - onLiteralValue: onValue, - onError: function (error, offset, length) { - errors.push({ error: error, offset: offset, length: length }); - } - }; - visit(text, visitor, options); - return currentParent[0]; -} -/** - * Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result. - */ -function parseTree(text, errors, options) { - if (errors === void 0) { errors = []; } - if (options === void 0) { options = ParseOptions.DEFAULT; } - var currentParent = { type: 'array', offset: -1, length: -1, children: [], parent: undefined }; // artificial root - function ensurePropertyComplete(endOffset) { - if (currentParent.type === 'property') { - currentParent.length = endOffset - currentParent.offset; - currentParent = currentParent.parent; - } - } - function onValue(valueNode) { - currentParent.children.push(valueNode); - return valueNode; - } - var visitor = { - onObjectBegin: function (offset) { - currentParent = onValue({ type: 'object', offset: offset, length: -1, parent: currentParent, children: [] }); - }, - onObjectProperty: function (name, offset, length) { - currentParent = onValue({ type: 'property', offset: offset, length: -1, parent: currentParent, children: [] }); - currentParent.children.push({ type: 'string', value: name, offset: offset, length: length, parent: currentParent }); - }, - onObjectEnd: function (offset, length) { - ensurePropertyComplete(offset + length); // in case of a missing value for a property: make sure property is complete - currentParent.length = offset + length - currentParent.offset; - currentParent = currentParent.parent; - ensurePropertyComplete(offset + length); - }, - onArrayBegin: function (offset, length) { - currentParent = onValue({ type: 'array', offset: offset, length: -1, parent: currentParent, children: [] }); - }, - onArrayEnd: function (offset, length) { - currentParent.length = offset + length - currentParent.offset; - currentParent = currentParent.parent; - ensurePropertyComplete(offset + length); - }, - onLiteralValue: function (value, offset, length) { - onValue({ type: getNodeType(value), offset: offset, length: length, parent: currentParent, value: value }); - ensurePropertyComplete(offset + length); - }, - onSeparator: function (sep, offset, length) { - if (currentParent.type === 'property') { - if (sep === ':') { - currentParent.colonOffset = offset; - } - else if (sep === ',') { - ensurePropertyComplete(offset); - } - } - }, - onError: function (error, offset, length) { - errors.push({ error: error, offset: offset, length: length }); - } - }; - visit(text, visitor, options); - var result = currentParent.children[0]; - if (result) { - delete result.parent; - } - return result; -} -/** - * Finds the node at the given path in a JSON DOM. - */ -function findNodeAtLocation(root, path) { - if (!root) { - return undefined; - } - var node = root; - for (var _i = 0, path_1 = path; _i < path_1.length; _i++) { - var segment = path_1[_i]; - if (typeof segment === 'string') { - if (node.type !== 'object' || !Array.isArray(node.children)) { - return undefined; - } - var found = false; - for (var _a = 0, _b = node.children; _a < _b.length; _a++) { - var propertyNode = _b[_a]; - if (Array.isArray(propertyNode.children) && propertyNode.children[0].value === segment) { - node = propertyNode.children[1]; - found = true; - break; - } - } - if (!found) { - return undefined; - } - } - else { - var index = segment; - if (node.type !== 'array' || index < 0 || !Array.isArray(node.children) || index >= node.children.length) { - return undefined; - } - node = node.children[index]; - } - } - return node; -} -/** - * Gets the JSON path of the given JSON DOM node - */ -function getNodePath(node) { - if (!node.parent || !node.parent.children) { - return []; - } - var path = getNodePath(node.parent); - if (node.parent.type === 'property') { - var key = node.parent.children[0].value; - path.push(key); - } - else if (node.parent.type === 'array') { - var index = node.parent.children.indexOf(node); - if (index !== -1) { - path.push(index); - } - } - return path; -} -/** - * Evaluates the JavaScript object of the given JSON DOM node - */ -function getNodeValue(node) { - switch (node.type) { - case 'array': - return node.children.map(getNodeValue); - case 'object': - var obj = Object.create(null); - for (var _i = 0, _a = node.children; _i < _a.length; _i++) { - var prop = _a[_i]; - var valueNode = prop.children[1]; - if (valueNode) { - obj[prop.children[0].value] = getNodeValue(valueNode); - } - } - return obj; - case 'null': - case 'string': - case 'number': - case 'boolean': - return node.value; - default: - return undefined; - } -} -function contains(node, offset, includeRightBound) { - if (includeRightBound === void 0) { includeRightBound = false; } - return (offset >= node.offset && offset < (node.offset + node.length)) || includeRightBound && (offset === (node.offset + node.length)); -} -/** - * Finds the most inner node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset. - */ -function findNodeAtOffset(node, offset, includeRightBound) { - if (includeRightBound === void 0) { includeRightBound = false; } - if (contains(node, offset, includeRightBound)) { - var children = node.children; - if (Array.isArray(children)) { - for (var i = 0; i < children.length && children[i].offset <= offset; i++) { - var item = findNodeAtOffset(children[i], offset, includeRightBound); - if (item) { - return item; - } - } - } - return node; - } - return undefined; -} -/** - * Parses the given text and invokes the visitor functions for each object, array and literal reached. - */ -function visit(text, visitor, options) { - if (options === void 0) { options = ParseOptions.DEFAULT; } - var _scanner = Object(_scanner_js__WEBPACK_IMPORTED_MODULE_0__["createScanner"])(text, false); - function toNoArgVisit(visitFunction) { - return visitFunction ? function () { return visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()); } : function () { return true; }; - } - function toOneArgVisit(visitFunction) { - return visitFunction ? function (arg) { return visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()); } : function () { return true; }; - } - var onObjectBegin = toNoArgVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisit(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisit(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisit(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError); - var disallowComments = options && options.disallowComments; - var allowTrailingComma = options && options.allowTrailingComma; - function scanNext() { - while (true) { - var token = _scanner.scan(); - switch (_scanner.getTokenError()) { - case 4 /* InvalidUnicode */: - handleError(14 /* InvalidUnicode */); - break; - case 5 /* InvalidEscapeCharacter */: - handleError(15 /* InvalidEscapeCharacter */); - break; - case 3 /* UnexpectedEndOfNumber */: - handleError(13 /* UnexpectedEndOfNumber */); - break; - case 1 /* UnexpectedEndOfComment */: - if (!disallowComments) { - handleError(11 /* UnexpectedEndOfComment */); - } - break; - case 2 /* UnexpectedEndOfString */: - handleError(12 /* UnexpectedEndOfString */); - break; - case 6 /* InvalidCharacter */: - handleError(16 /* InvalidCharacter */); - break; - } - switch (token) { - case 12 /* LineCommentTrivia */: - case 13 /* BlockCommentTrivia */: - if (disallowComments) { - handleError(10 /* InvalidCommentToken */); - } - else { - onComment(); - } - break; - case 16 /* Unknown */: - handleError(1 /* InvalidSymbol */); - break; - case 15 /* Trivia */: - case 14 /* LineBreakTrivia */: - break; - default: - return token; - } - } - } - function handleError(error, skipUntilAfter, skipUntil) { - if (skipUntilAfter === void 0) { skipUntilAfter = []; } - if (skipUntil === void 0) { skipUntil = []; } - onError(error); - if (skipUntilAfter.length + skipUntil.length > 0) { - var token = _scanner.getToken(); - while (token !== 17 /* EOF */) { - if (skipUntilAfter.indexOf(token) !== -1) { - scanNext(); - break; - } - else if (skipUntil.indexOf(token) !== -1) { - break; - } - token = scanNext(); - } - } - } - function parseString(isValue) { - var value = _scanner.getTokenValue(); - if (isValue) { - onLiteralValue(value); - } - else { - onObjectProperty(value); - } - scanNext(); - return true; - } - function parseLiteral() { - switch (_scanner.getToken()) { - case 11 /* NumericLiteral */: - var value = 0; - try { - value = JSON.parse(_scanner.getTokenValue()); - if (typeof value !== 'number') { - handleError(2 /* InvalidNumberFormat */); - value = 0; - } - } - catch (e) { - handleError(2 /* InvalidNumberFormat */); - } - onLiteralValue(value); - break; - case 7 /* NullKeyword */: - onLiteralValue(null); - break; - case 8 /* TrueKeyword */: - onLiteralValue(true); - break; - case 9 /* FalseKeyword */: - onLiteralValue(false); - break; - default: - return false; - } - scanNext(); - return true; - } - function parseProperty() { - if (_scanner.getToken() !== 10 /* StringLiteral */) { - handleError(3 /* PropertyNameExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]); - return false; - } - parseString(false); - if (_scanner.getToken() === 6 /* ColonToken */) { - onSeparator(':'); - scanNext(); // consume colon - if (!parseValue()) { - handleError(4 /* ValueExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]); - } - } - else { - handleError(5 /* ColonExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]); - } - return true; - } - function parseObject() { - onObjectBegin(); - scanNext(); // consume open brace - var needsComma = false; - while (_scanner.getToken() !== 2 /* CloseBraceToken */ && _scanner.getToken() !== 17 /* EOF */) { - if (_scanner.getToken() === 5 /* CommaToken */) { - if (!needsComma) { - handleError(4 /* ValueExpected */, [], []); - } - onSeparator(','); - scanNext(); // consume comma - if (_scanner.getToken() === 2 /* CloseBraceToken */ && allowTrailingComma) { - break; - } - } - else if (needsComma) { - handleError(6 /* CommaExpected */, [], []); - } - if (!parseProperty()) { - handleError(4 /* ValueExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]); - } - needsComma = true; - } - onObjectEnd(); - if (_scanner.getToken() !== 2 /* CloseBraceToken */) { - handleError(7 /* CloseBraceExpected */, [2 /* CloseBraceToken */], []); - } - else { - scanNext(); // consume close brace - } - return true; - } - function parseArray() { - onArrayBegin(); - scanNext(); // consume open bracket - var needsComma = false; - while (_scanner.getToken() !== 4 /* CloseBracketToken */ && _scanner.getToken() !== 17 /* EOF */) { - if (_scanner.getToken() === 5 /* CommaToken */) { - if (!needsComma) { - handleError(4 /* ValueExpected */, [], []); - } - onSeparator(','); - scanNext(); // consume comma - if (_scanner.getToken() === 4 /* CloseBracketToken */ && allowTrailingComma) { - break; - } - } - else if (needsComma) { - handleError(6 /* CommaExpected */, [], []); - } - if (!parseValue()) { - handleError(4 /* ValueExpected */, [], [4 /* CloseBracketToken */, 5 /* CommaToken */]); - } - needsComma = true; - } - onArrayEnd(); - if (_scanner.getToken() !== 4 /* CloseBracketToken */) { - handleError(8 /* CloseBracketExpected */, [4 /* CloseBracketToken */], []); - } - else { - scanNext(); // consume close bracket - } - return true; - } - function parseValue() { - switch (_scanner.getToken()) { - case 3 /* OpenBracketToken */: - return parseArray(); - case 1 /* OpenBraceToken */: - return parseObject(); - case 10 /* StringLiteral */: - return parseString(true); - default: - return parseLiteral(); - } - } - scanNext(); - if (_scanner.getToken() === 17 /* EOF */) { - if (options.allowEmptyContent) { - return true; - } - handleError(4 /* ValueExpected */, [], []); - return false; - } - if (!parseValue()) { - handleError(4 /* ValueExpected */, [], []); - return false; - } - if (_scanner.getToken() !== 17 /* EOF */) { - handleError(9 /* EndOfFileExpected */, [], []); - } - return true; -} -/** - * Takes JSON with JavaScript-style comments and remove - * them. Optionally replaces every none-newline character - * of comments with a replaceCharacter - */ -function stripComments(text, replaceCh) { - var _scanner = Object(_scanner_js__WEBPACK_IMPORTED_MODULE_0__["createScanner"])(text), parts = [], kind, offset = 0, pos; - do { - pos = _scanner.getPosition(); - kind = _scanner.scan(); - switch (kind) { - case 12 /* LineCommentTrivia */: - case 13 /* BlockCommentTrivia */: - case 17 /* EOF */: - if (offset !== pos) { - parts.push(text.substring(offset, pos)); - } - if (replaceCh !== undefined) { - parts.push(_scanner.getTokenValue().replace(/[^\r\n]/g, replaceCh)); - } - offset = _scanner.getPosition(); - break; - } - } while (kind !== 17 /* EOF */); - return parts.join(''); -} -function getNodeType(value) { - switch (typeof value) { - case 'boolean': return 'boolean'; - case 'number': return 'number'; - case 'string': return 'string'; - case 'object': { - if (!value) { - return 'null'; - } - else if (Array.isArray(value)) { - return 'array'; - } - return 'object'; - } - default: return 'null'; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js ***! - \********************************************************************************************/ -/*! exports provided: createScanner */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createScanner", function() { return createScanner; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * Creates a JSON scanner on the given text. - * If ignoreTrivia is set, whitespaces or comments are ignored. - */ -function createScanner(text, ignoreTrivia) { - if (ignoreTrivia === void 0) { ignoreTrivia = false; } - var len = text.length; - var pos = 0, value = '', tokenOffset = 0, token = 16 /* Unknown */, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0 /* None */; - function scanHexDigits(count, exact) { - var digits = 0; - var value = 0; - while (digits < count || !exact) { - var ch = text.charCodeAt(pos); - if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { - value = value * 16 + ch - 48 /* _0 */; - } - else if (ch >= 65 /* A */ && ch <= 70 /* F */) { - value = value * 16 + ch - 65 /* A */ + 10; - } - else if (ch >= 97 /* a */ && ch <= 102 /* f */) { - value = value * 16 + ch - 97 /* a */ + 10; - } - else { - break; - } - pos++; - digits++; - } - if (digits < count) { - value = -1; - } - return value; - } - function setPosition(newPosition) { - pos = newPosition; - value = ''; - tokenOffset = 0; - token = 16 /* Unknown */; - scanError = 0 /* None */; - } - function scanNumber() { - var start = pos; - if (text.charCodeAt(pos) === 48 /* _0 */) { - pos++; - } - else { - pos++; - while (pos < text.length && isDigit(text.charCodeAt(pos))) { - pos++; - } - } - if (pos < text.length && text.charCodeAt(pos) === 46 /* dot */) { - pos++; - if (pos < text.length && isDigit(text.charCodeAt(pos))) { - pos++; - while (pos < text.length && isDigit(text.charCodeAt(pos))) { - pos++; - } - } - else { - scanError = 3 /* UnexpectedEndOfNumber */; - return text.substring(start, pos); - } - } - var end = pos; - if (pos < text.length && (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */)) { - pos++; - if (pos < text.length && text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) { - pos++; - } - if (pos < text.length && isDigit(text.charCodeAt(pos))) { - pos++; - while (pos < text.length && isDigit(text.charCodeAt(pos))) { - pos++; - } - end = pos; - } - else { - scanError = 3 /* UnexpectedEndOfNumber */; - } - } - return text.substring(start, end); - } - function scanString() { - var result = '', start = pos; - while (true) { - if (pos >= len) { - result += text.substring(start, pos); - scanError = 2 /* UnexpectedEndOfString */; - break; - } - var ch = text.charCodeAt(pos); - if (ch === 34 /* doubleQuote */) { - result += text.substring(start, pos); - pos++; - break; - } - if (ch === 92 /* backslash */) { - result += text.substring(start, pos); - pos++; - if (pos >= len) { - scanError = 2 /* UnexpectedEndOfString */; - break; - } - var ch2 = text.charCodeAt(pos++); - switch (ch2) { - case 34 /* doubleQuote */: - result += '\"'; - break; - case 92 /* backslash */: - result += '\\'; - break; - case 47 /* slash */: - result += '/'; - break; - case 98 /* b */: - result += '\b'; - break; - case 102 /* f */: - result += '\f'; - break; - case 110 /* n */: - result += '\n'; - break; - case 114 /* r */: - result += '\r'; - break; - case 116 /* t */: - result += '\t'; - break; - case 117 /* u */: - var ch3 = scanHexDigits(4, true); - if (ch3 >= 0) { - result += String.fromCharCode(ch3); - } - else { - scanError = 4 /* InvalidUnicode */; - } - break; - default: - scanError = 5 /* InvalidEscapeCharacter */; - } - start = pos; - continue; - } - if (ch >= 0 && ch <= 0x1f) { - if (isLineBreak(ch)) { - result += text.substring(start, pos); - scanError = 2 /* UnexpectedEndOfString */; - break; - } - else { - scanError = 6 /* InvalidCharacter */; - // mark as error but continue with string - } - } - pos++; - } - return result; - } - function scanNext() { - value = ''; - scanError = 0 /* None */; - tokenOffset = pos; - lineStartOffset = lineNumber; - prevTokenLineStartOffset = tokenLineStartOffset; - if (pos >= len) { - // at the end - tokenOffset = len; - return token = 17 /* EOF */; - } - var code = text.charCodeAt(pos); - // trivia: whitespace - if (isWhiteSpace(code)) { - do { - pos++; - value += String.fromCharCode(code); - code = text.charCodeAt(pos); - } while (isWhiteSpace(code)); - return token = 15 /* Trivia */; - } - // trivia: newlines - if (isLineBreak(code)) { - pos++; - value += String.fromCharCode(code); - if (code === 13 /* carriageReturn */ && text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - value += '\n'; - } - lineNumber++; - tokenLineStartOffset = pos; - return token = 14 /* LineBreakTrivia */; - } - switch (code) { - // tokens: []{}:, - case 123 /* openBrace */: - pos++; - return token = 1 /* OpenBraceToken */; - case 125 /* closeBrace */: - pos++; - return token = 2 /* CloseBraceToken */; - case 91 /* openBracket */: - pos++; - return token = 3 /* OpenBracketToken */; - case 93 /* closeBracket */: - pos++; - return token = 4 /* CloseBracketToken */; - case 58 /* colon */: - pos++; - return token = 6 /* ColonToken */; - case 44 /* comma */: - pos++; - return token = 5 /* CommaToken */; - // strings - case 34 /* doubleQuote */: - pos++; - value = scanString(); - return token = 10 /* StringLiteral */; - // comments - case 47 /* slash */: - var start = pos - 1; - // Single-line comment - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < len) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - value = text.substring(start, pos); - return token = 12 /* LineCommentTrivia */; - } - // Multi-line comment - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - var safeLength = len - 1; // For lookahead. - var commentClosed = false; - while (pos < safeLength) { - var ch = text.charCodeAt(pos); - if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - commentClosed = true; - break; - } - pos++; - if (isLineBreak(ch)) { - if (ch === 13 /* carriageReturn */ && text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - lineNumber++; - tokenLineStartOffset = pos; - } - } - if (!commentClosed) { - pos++; - scanError = 1 /* UnexpectedEndOfComment */; - } - value = text.substring(start, pos); - return token = 13 /* BlockCommentTrivia */; - } - // just a single slash - value += String.fromCharCode(code); - pos++; - return token = 16 /* Unknown */; - // numbers - case 45 /* minus */: - value += String.fromCharCode(code); - pos++; - if (pos === len || !isDigit(text.charCodeAt(pos))) { - return token = 16 /* Unknown */; - } - // found a minus, followed by a number so - // we fall through to proceed with scanning - // numbers - case 48 /* _0 */: - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - case 56 /* _8 */: - case 57 /* _9 */: - value += scanNumber(); - return token = 11 /* NumericLiteral */; - // literals and unknown symbols - default: - // is a literal? Read the full word. - while (pos < len && isUnknownContentCharacter(code)) { - pos++; - code = text.charCodeAt(pos); - } - if (tokenOffset !== pos) { - value = text.substring(tokenOffset, pos); - // keywords: true, false, null - switch (value) { - case 'true': return token = 8 /* TrueKeyword */; - case 'false': return token = 9 /* FalseKeyword */; - case 'null': return token = 7 /* NullKeyword */; - } - return token = 16 /* Unknown */; - } - // some - value += String.fromCharCode(code); - pos++; - return token = 16 /* Unknown */; - } - } - function isUnknownContentCharacter(code) { - if (isWhiteSpace(code) || isLineBreak(code)) { - return false; - } - switch (code) { - case 125 /* closeBrace */: - case 93 /* closeBracket */: - case 123 /* openBrace */: - case 91 /* openBracket */: - case 34 /* doubleQuote */: - case 58 /* colon */: - case 44 /* comma */: - case 47 /* slash */: - return false; - } - return true; - } - function scanNextNonTrivia() { - var result; - do { - result = scanNext(); - } while (result >= 12 /* LineCommentTrivia */ && result <= 15 /* Trivia */); - return result; - } - return { - setPosition: setPosition, - getPosition: function () { return pos; }, - scan: ignoreTrivia ? scanNextNonTrivia : scanNext, - getToken: function () { return token; }, - getTokenValue: function () { return value; }, - getTokenOffset: function () { return tokenOffset; }, - getTokenLength: function () { return pos - tokenOffset; }, - getTokenStartLine: function () { return lineStartOffset; }, - getTokenStartCharacter: function () { return tokenOffset - prevTokenLineStartOffset; }, - getTokenError: function () { return scanError; }, - }; -} -function isWhiteSpace(ch) { - return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || - ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || - ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; -} -function isLineBreak(ch) { - return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */; -} -function isDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js ***! - \************************************************************************************/ -/*! exports provided: createScanner, getLocation, parse, parseTree, findNodeAtLocation, findNodeAtOffset, getNodePath, getNodeValue, visit, stripComments, printParseErrorCode, format, modify, applyEdits */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createScanner", function() { return createScanner; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocation", function() { return getLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseTree", function() { return parseTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNodeAtLocation", function() { return findNodeAtLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNodeAtOffset", function() { return findNodeAtOffset; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodePath", function() { return getNodePath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeValue", function() { return getNodeValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "visit", function() { return visit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripComments", function() { return stripComments; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "printParseErrorCode", function() { return printParseErrorCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modify", function() { return modify; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyEdits", function() { return applyEdits; }); -/* harmony import */ var _impl_format_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./impl/format.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/format.js"); -/* harmony import */ var _impl_edit_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./impl/edit.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/edit.js"); -/* harmony import */ var _impl_scanner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./impl/scanner.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js"); -/* harmony import */ var _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./impl/parser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/parser.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -/** - * Creates a JSON scanner on the given text. - * If ignoreTrivia is set, whitespaces or comments are ignored. - */ -var createScanner = _impl_scanner_js__WEBPACK_IMPORTED_MODULE_2__["createScanner"]; -/** - * For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index. - */ -var getLocation = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["getLocation"]; -/** - * Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result. - * Therefore, always check the errors list to find out if the input was valid. - */ -var parse = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["parse"]; -/** - * Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result. - */ -var parseTree = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["parseTree"]; -/** - * Finds the node at the given path in a JSON DOM. - */ -var findNodeAtLocation = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["findNodeAtLocation"]; -/** - * Finds the innermost node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset. - */ -var findNodeAtOffset = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["findNodeAtOffset"]; -/** - * Gets the JSON path of the given JSON DOM node - */ -var getNodePath = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["getNodePath"]; -/** - * Evaluates the JavaScript object of the given JSON DOM node - */ -var getNodeValue = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["getNodeValue"]; -/** - * Parses the given text and invokes the visitor functions for each object, array and literal reached. - */ -var visit = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["visit"]; -/** - * Takes JSON with JavaScript-style comments and remove - * them. Optionally replaces every none-newline character - * of comments with a replaceCharacter - */ -var stripComments = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["stripComments"]; -function printParseErrorCode(code) { - switch (code) { - case 1 /* InvalidSymbol */: return 'InvalidSymbol'; - case 2 /* InvalidNumberFormat */: return 'InvalidNumberFormat'; - case 3 /* PropertyNameExpected */: return 'PropertyNameExpected'; - case 4 /* ValueExpected */: return 'ValueExpected'; - case 5 /* ColonExpected */: return 'ColonExpected'; - case 6 /* CommaExpected */: return 'CommaExpected'; - case 7 /* CloseBraceExpected */: return 'CloseBraceExpected'; - case 8 /* CloseBracketExpected */: return 'CloseBracketExpected'; - case 9 /* EndOfFileExpected */: return 'EndOfFileExpected'; - case 10 /* InvalidCommentToken */: return 'InvalidCommentToken'; - case 11 /* UnexpectedEndOfComment */: return 'UnexpectedEndOfComment'; - case 12 /* UnexpectedEndOfString */: return 'UnexpectedEndOfString'; - case 13 /* UnexpectedEndOfNumber */: return 'UnexpectedEndOfNumber'; - case 14 /* InvalidUnicode */: return 'InvalidUnicode'; - case 15 /* InvalidEscapeCharacter */: return 'InvalidEscapeCharacter'; - case 16 /* InvalidCharacter */: return 'InvalidCharacter'; - } - return ''; -} -/** - * Computes the edits needed to format a JSON document. - * - * @param documentText The input text - * @param range The range to format or `undefined` to format the full content - * @param options The formatting options - * @returns A list of edit operations describing the formatting changes to the original document. Edits can be either inserts, replacements or - * removals of text segments. All offsets refer to the original state of the document. No two edits must change or remove the same range of - * text in the original document. However, multiple edits can have - * the same offset, for example multiple inserts, or an insert followed by a remove or replace. The order in the array defines which edit is applied first. - * To apply edits to an input, you can use `applyEdits`. - */ -function format(documentText, range, options) { - return _impl_format_js__WEBPACK_IMPORTED_MODULE_0__["format"](documentText, range, options); -} -/** - * Computes the edits needed to modify a value in the JSON document. - * - * @param documentText The input text - * @param path The path of the value to change. The path represents either to the document root, a property or an array item. - * If the path points to an non-existing property or item, it will be created. - * @param value The new value for the specified property or item. If the value is undefined, - * the property or item will be removed. - * @param options Options - * @returns A list of edit operations describing the formatting changes to the original document. Edits can be either inserts, replacements or - * removals of text segments. All offsets refer to the original state of the document. No two edits must change or remove the same range of - * text in the original document. However, multiple edits can have - * the same offset, for example multiple inserts, or an insert followed by a remove or replace. The order in the array defines which edit is applied first. - * To apply edits to an input, you can use `applyEdits`. - */ -function modify(text, path, value, options) { - return _impl_edit_js__WEBPACK_IMPORTED_MODULE_1__["setProperty"](text, path, value, options); -} -/** - * Applies edits to a input string. - */ -function applyEdits(text, edits) { - for (var i = edits.length - 1; i >= 0; i--) { - text = _impl_edit_js__WEBPACK_IMPORTED_MODULE_1__["applyEdit"](text, edits[i]); - } - return text; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageService.js": -/*!******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageService.js ***! - \******************************************************************************************************************/ -/*! exports provided: getLanguageService, TextDocument, Range, TextEdit, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, SelectionRange, Diagnostic, DiagnosticSeverity, CompletionItem, CompletionItemKind, CompletionList, Position, InsertTextFormat, MarkupContent, MarkupKind, SymbolInformation, SymbolKind, DocumentSymbol, Location, Hover, MarkedString, FormattingOptions, ErrorCode, ClientCapabilities */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLanguageService", function() { return getLanguageService; }); -/* harmony import */ var _services_jsonCompletion_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./services/jsonCompletion.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonCompletion.js"); -/* harmony import */ var _services_jsonHover_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./services/jsonHover.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonHover.js"); -/* harmony import */ var _services_jsonValidation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/jsonValidation.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonValidation.js"); -/* harmony import */ var _services_jsonDocumentSymbols_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/jsonDocumentSymbols.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDocumentSymbols.js"); -/* harmony import */ var _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./parser/jsonParser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js"); -/* harmony import */ var _services_configuration_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./services/configuration.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/configuration.js"); -/* harmony import */ var _services_jsonSchemaService_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./services/jsonSchemaService.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSchemaService.js"); -/* harmony import */ var _services_jsonFolding_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./services/jsonFolding.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonFolding.js"); -/* harmony import */ var _services_jsonSelectionRanges_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./services/jsonSelectionRanges.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSelectionRanges.js"); -/* harmony import */ var _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../jsonc-parser/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js"); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); -/* harmony import */ var _services_jsonDefinition_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./services/jsonDefinition.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDefinition.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["TextDocument"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["Range"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["TextEdit"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["Color"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["ColorInformation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["ColorPresentation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["FoldingRange"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["FoldingRangeKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectionRange", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["SelectionRange"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["Diagnostic"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["DiagnosticSeverity"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["CompletionItem"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["CompletionItemKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["CompletionList"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["Position"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["InsertTextFormat"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["MarkupContent"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["MarkupKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["SymbolInformation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["SymbolKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["DocumentSymbol"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["Location"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["Hover"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["MarkedString"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["FormattingOptions"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ErrorCode", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["ErrorCode"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClientCapabilities", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["ClientCapabilities"]; }); - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - -function getLanguageService(params) { - var promise = params.promiseConstructor || Promise; - var jsonSchemaService = new _services_jsonSchemaService_js__WEBPACK_IMPORTED_MODULE_6__["JSONSchemaService"](params.schemaRequestService, params.workspaceContext, promise); - jsonSchemaService.setSchemaContributions(_services_configuration_js__WEBPACK_IMPORTED_MODULE_5__["schemaContributions"]); - var jsonCompletion = new _services_jsonCompletion_js__WEBPACK_IMPORTED_MODULE_0__["JSONCompletion"](jsonSchemaService, params.contributions, promise, params.clientCapabilities); - var jsonHover = new _services_jsonHover_js__WEBPACK_IMPORTED_MODULE_1__["JSONHover"](jsonSchemaService, params.contributions, promise); - var jsonDocumentSymbols = new _services_jsonDocumentSymbols_js__WEBPACK_IMPORTED_MODULE_3__["JSONDocumentSymbols"](jsonSchemaService); - var jsonValidation = new _services_jsonValidation_js__WEBPACK_IMPORTED_MODULE_2__["JSONValidation"](jsonSchemaService, promise); - return { - configure: function (settings) { - jsonSchemaService.clearExternalSchemas(); - if (settings.schemas) { - settings.schemas.forEach(function (settings) { - jsonSchemaService.registerExternalSchema(settings.uri, settings.fileMatch, settings.schema); - }); - } - jsonValidation.configure(settings); - }, - resetSchema: function (uri) { return jsonSchemaService.onResourceChange(uri); }, - doValidation: jsonValidation.doValidation.bind(jsonValidation), - parseJSONDocument: function (document) { return Object(_parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_4__["parse"])(document, { collectComments: true }); }, - newJSONDocument: function (root, diagnostics) { return Object(_parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_4__["newJSONDocument"])(root, diagnostics); }, - getMatchingSchemas: jsonSchemaService.getMatchingSchemas.bind(jsonSchemaService), - doResolve: jsonCompletion.doResolve.bind(jsonCompletion), - doComplete: jsonCompletion.doComplete.bind(jsonCompletion), - findDocumentSymbols: jsonDocumentSymbols.findDocumentSymbols.bind(jsonDocumentSymbols), - findDocumentSymbols2: jsonDocumentSymbols.findDocumentSymbols2.bind(jsonDocumentSymbols), - findColorSymbols: function (d, s) { return jsonDocumentSymbols.findDocumentColors(d, s).then(function (s) { return s.map(function (s) { return s.range; }); }); }, - findDocumentColors: jsonDocumentSymbols.findDocumentColors.bind(jsonDocumentSymbols), - getColorPresentations: jsonDocumentSymbols.getColorPresentations.bind(jsonDocumentSymbols), - doHover: jsonHover.doHover.bind(jsonHover), - getFoldingRanges: _services_jsonFolding_js__WEBPACK_IMPORTED_MODULE_7__["getFoldingRanges"], - getSelectionRanges: _services_jsonSelectionRanges_js__WEBPACK_IMPORTED_MODULE_8__["getSelectionRanges"], - findDefinition: _services_jsonDefinition_js__WEBPACK_IMPORTED_MODULE_11__["findDefinition"], - format: function (d, r, o) { - var range = undefined; - if (r) { - var offset = d.offsetAt(r.start); - var length = d.offsetAt(r.end) - offset; - range = { offset: offset, length: length }; - } - var options = { tabSize: o ? o.tabSize : 4, insertSpaces: o ? o.insertSpaces : true, eol: '\n' }; - return Object(_jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_9__["format"])(d.getText(), range, options).map(function (e) { - return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["TextEdit"].replace(_jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_10__["Range"].create(d.positionAt(e.offset), d.positionAt(e.offset + e.length)), e.content); - }); - } - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js": -/*!****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js ***! - \****************************************************************************************************************/ -/*! exports provided: TextDocument, Range, TextEdit, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, SelectionRange, Diagnostic, DiagnosticSeverity, CompletionItem, CompletionItemKind, CompletionList, Position, InsertTextFormat, MarkupContent, MarkupKind, SymbolInformation, SymbolKind, DocumentSymbol, Location, Hover, MarkedString, FormattingOptions, ErrorCode, ClientCapabilities */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorCode", function() { return ErrorCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClientCapabilities", function() { return ClientCapabilities; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Color"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["ColorInformation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["ColorPresentation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["FoldingRange"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["FoldingRangeKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectionRange", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["SelectionRange"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Diagnostic"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["DiagnosticSeverity"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionItem"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionItemKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionList"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Position"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["InsertTextFormat"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["MarkupContent"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["MarkupKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["SymbolInformation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["SymbolKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["DocumentSymbol"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Location"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Hover"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["MarkedString"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["FormattingOptions"]; }); - -/* harmony import */ var _vscode_languageserver_textdocument_lib_esm_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../vscode-languageserver-textdocument/lib/esm/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-textdocument/lib/esm/main.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return _vscode_languageserver_textdocument_lib_esm_main_js__WEBPACK_IMPORTED_MODULE_1__["TextDocument"]; }); - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -/** - * Error codes used by diagnostics - */ -var ErrorCode; -(function (ErrorCode) { - ErrorCode[ErrorCode["Undefined"] = 0] = "Undefined"; - ErrorCode[ErrorCode["EnumValueMismatch"] = 1] = "EnumValueMismatch"; - ErrorCode[ErrorCode["UnexpectedEndOfComment"] = 257] = "UnexpectedEndOfComment"; - ErrorCode[ErrorCode["UnexpectedEndOfString"] = 258] = "UnexpectedEndOfString"; - ErrorCode[ErrorCode["UnexpectedEndOfNumber"] = 259] = "UnexpectedEndOfNumber"; - ErrorCode[ErrorCode["InvalidUnicode"] = 260] = "InvalidUnicode"; - ErrorCode[ErrorCode["InvalidEscapeCharacter"] = 261] = "InvalidEscapeCharacter"; - ErrorCode[ErrorCode["InvalidCharacter"] = 262] = "InvalidCharacter"; - ErrorCode[ErrorCode["PropertyExpected"] = 513] = "PropertyExpected"; - ErrorCode[ErrorCode["CommaExpected"] = 514] = "CommaExpected"; - ErrorCode[ErrorCode["ColonExpected"] = 515] = "ColonExpected"; - ErrorCode[ErrorCode["ValueExpected"] = 516] = "ValueExpected"; - ErrorCode[ErrorCode["CommaOrCloseBacketExpected"] = 517] = "CommaOrCloseBacketExpected"; - ErrorCode[ErrorCode["CommaOrCloseBraceExpected"] = 518] = "CommaOrCloseBraceExpected"; - ErrorCode[ErrorCode["TrailingComma"] = 519] = "TrailingComma"; - ErrorCode[ErrorCode["DuplicateKey"] = 520] = "DuplicateKey"; - ErrorCode[ErrorCode["CommentNotPermitted"] = 521] = "CommentNotPermitted"; - ErrorCode[ErrorCode["SchemaResolveError"] = 768] = "SchemaResolveError"; -})(ErrorCode || (ErrorCode = {})); -var ClientCapabilities; -(function (ClientCapabilities) { - ClientCapabilities.LATEST = { - textDocument: { - completion: { - completionItem: { - documentationFormat: [_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["MarkupKind"].Markdown, _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["MarkupKind"].PlainText], - commitCharactersSupport: true - } - } - } - }; -})(ClientCapabilities || (ClientCapabilities = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js": -/*!****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js ***! - \****************************************************************************************************************/ -/*! exports provided: ASTNodeImpl, NullASTNodeImpl, BooleanASTNodeImpl, ArrayASTNodeImpl, NumberASTNodeImpl, StringASTNodeImpl, PropertyASTNodeImpl, ObjectASTNodeImpl, asSchema, EnumMatch, ValidationResult, newJSONDocument, getNodeValue, getNodePath, contains, JSONDocument, parse */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ASTNodeImpl", function() { return ASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NullASTNodeImpl", function() { return NullASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BooleanASTNodeImpl", function() { return BooleanASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayASTNodeImpl", function() { return ArrayASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberASTNodeImpl", function() { return NumberASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringASTNodeImpl", function() { return StringASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyASTNodeImpl", function() { return PropertyASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectASTNodeImpl", function() { return ObjectASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asSchema", function() { return asSchema; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EnumMatch", function() { return EnumMatch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValidationResult", function() { return ValidationResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "newJSONDocument", function() { return newJSONDocument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeValue", function() { return getNodeValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodePath", function() { return getNodePath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return contains; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONDocument", function() { return JSONDocument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; }); -/* harmony import */ var _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jsonc-parser/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js"); -/* harmony import */ var _utils_objects_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/objects.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/objects.js"); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_3__["loadMessageBundle"](); -var formats = { - 'color-hex': { errorMessage: localize('colorHexFormatWarning', 'Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.'), pattern: /^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/ }, - 'date-time': { errorMessage: localize('dateTimeFormatWarning', 'String is not a RFC3339 date-time.'), pattern: /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i }, - 'date': { errorMessage: localize('dateFormatWarning', 'String is not a RFC3339 date.'), pattern: /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i }, - 'time': { errorMessage: localize('timeFormatWarning', 'String is not a RFC3339 time.'), pattern: /^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i }, - 'email': { errorMessage: localize('emailFormatWarning', 'String is not an e-mail address.'), pattern: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ } -}; -var ASTNodeImpl = /** @class */ (function () { - function ASTNodeImpl(parent, offset, length) { - if (length === void 0) { length = 0; } - this.offset = offset; - this.length = length; - this.parent = parent; - } - Object.defineProperty(ASTNodeImpl.prototype, "children", { - get: function () { - return []; - }, - enumerable: false, - configurable: true - }); - ASTNodeImpl.prototype.toString = function () { - return 'type: ' + this.type + ' (' + this.offset + '/' + this.length + ')' + (this.parent ? ' parent: {' + this.parent.toString() + '}' : ''); - }; - return ASTNodeImpl; -}()); - -var NullASTNodeImpl = /** @class */ (function (_super) { - __extends(NullASTNodeImpl, _super); - function NullASTNodeImpl(parent, offset) { - var _this = _super.call(this, parent, offset) || this; - _this.type = 'null'; - _this.value = null; - return _this; - } - return NullASTNodeImpl; -}(ASTNodeImpl)); - -var BooleanASTNodeImpl = /** @class */ (function (_super) { - __extends(BooleanASTNodeImpl, _super); - function BooleanASTNodeImpl(parent, boolValue, offset) { - var _this = _super.call(this, parent, offset) || this; - _this.type = 'boolean'; - _this.value = boolValue; - return _this; - } - return BooleanASTNodeImpl; -}(ASTNodeImpl)); - -var ArrayASTNodeImpl = /** @class */ (function (_super) { - __extends(ArrayASTNodeImpl, _super); - function ArrayASTNodeImpl(parent, offset) { - var _this = _super.call(this, parent, offset) || this; - _this.type = 'array'; - _this.items = []; - return _this; - } - Object.defineProperty(ArrayASTNodeImpl.prototype, "children", { - get: function () { - return this.items; - }, - enumerable: false, - configurable: true - }); - return ArrayASTNodeImpl; -}(ASTNodeImpl)); - -var NumberASTNodeImpl = /** @class */ (function (_super) { - __extends(NumberASTNodeImpl, _super); - function NumberASTNodeImpl(parent, offset) { - var _this = _super.call(this, parent, offset) || this; - _this.type = 'number'; - _this.isInteger = true; - _this.value = Number.NaN; - return _this; - } - return NumberASTNodeImpl; -}(ASTNodeImpl)); - -var StringASTNodeImpl = /** @class */ (function (_super) { - __extends(StringASTNodeImpl, _super); - function StringASTNodeImpl(parent, offset, length) { - var _this = _super.call(this, parent, offset, length) || this; - _this.type = 'string'; - _this.value = ''; - return _this; - } - return StringASTNodeImpl; -}(ASTNodeImpl)); - -var PropertyASTNodeImpl = /** @class */ (function (_super) { - __extends(PropertyASTNodeImpl, _super); - function PropertyASTNodeImpl(parent, offset, keyNode) { - var _this = _super.call(this, parent, offset) || this; - _this.type = 'property'; - _this.colonOffset = -1; - _this.keyNode = keyNode; - return _this; - } - Object.defineProperty(PropertyASTNodeImpl.prototype, "children", { - get: function () { - return this.valueNode ? [this.keyNode, this.valueNode] : [this.keyNode]; - }, - enumerable: false, - configurable: true - }); - return PropertyASTNodeImpl; -}(ASTNodeImpl)); - -var ObjectASTNodeImpl = /** @class */ (function (_super) { - __extends(ObjectASTNodeImpl, _super); - function ObjectASTNodeImpl(parent, offset) { - var _this = _super.call(this, parent, offset) || this; - _this.type = 'object'; - _this.properties = []; - return _this; - } - Object.defineProperty(ObjectASTNodeImpl.prototype, "children", { - get: function () { - return this.properties; - }, - enumerable: false, - configurable: true - }); - return ObjectASTNodeImpl; -}(ASTNodeImpl)); - -function asSchema(schema) { - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isBoolean"])(schema)) { - return schema ? {} : { "not": {} }; - } - return schema; -} -var EnumMatch; -(function (EnumMatch) { - EnumMatch[EnumMatch["Key"] = 0] = "Key"; - EnumMatch[EnumMatch["Enum"] = 1] = "Enum"; -})(EnumMatch || (EnumMatch = {})); -var SchemaCollector = /** @class */ (function () { - function SchemaCollector(focusOffset, exclude) { - if (focusOffset === void 0) { focusOffset = -1; } - this.focusOffset = focusOffset; - this.exclude = exclude; - this.schemas = []; - } - SchemaCollector.prototype.add = function (schema) { - this.schemas.push(schema); - }; - SchemaCollector.prototype.merge = function (other) { - Array.prototype.push.apply(this.schemas, other.schemas); - }; - SchemaCollector.prototype.include = function (node) { - return (this.focusOffset === -1 || contains(node, this.focusOffset)) && (node !== this.exclude); - }; - SchemaCollector.prototype.newSub = function () { - return new SchemaCollector(-1, this.exclude); - }; - return SchemaCollector; -}()); -var NoOpSchemaCollector = /** @class */ (function () { - function NoOpSchemaCollector() { - } - Object.defineProperty(NoOpSchemaCollector.prototype, "schemas", { - get: function () { return []; }, - enumerable: false, - configurable: true - }); - NoOpSchemaCollector.prototype.add = function (schema) { }; - NoOpSchemaCollector.prototype.merge = function (other) { }; - NoOpSchemaCollector.prototype.include = function (node) { return true; }; - NoOpSchemaCollector.prototype.newSub = function () { return this; }; - NoOpSchemaCollector.instance = new NoOpSchemaCollector(); - return NoOpSchemaCollector; -}()); -var ValidationResult = /** @class */ (function () { - function ValidationResult() { - this.problems = []; - this.propertiesMatches = 0; - this.propertiesValueMatches = 0; - this.primaryValueMatches = 0; - this.enumValueMatch = false; - this.enumValues = undefined; - } - ValidationResult.prototype.hasProblems = function () { - return !!this.problems.length; - }; - ValidationResult.prototype.mergeAll = function (validationResults) { - for (var _i = 0, validationResults_1 = validationResults; _i < validationResults_1.length; _i++) { - var validationResult = validationResults_1[_i]; - this.merge(validationResult); - } - }; - ValidationResult.prototype.merge = function (validationResult) { - this.problems = this.problems.concat(validationResult.problems); - }; - ValidationResult.prototype.mergeEnumValues = function (validationResult) { - if (!this.enumValueMatch && !validationResult.enumValueMatch && this.enumValues && validationResult.enumValues) { - this.enumValues = this.enumValues.concat(validationResult.enumValues); - for (var _i = 0, _a = this.problems; _i < _a.length; _i++) { - var error = _a[_i]; - if (error.code === _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].EnumValueMismatch) { - error.message = localize('enumWarning', 'Value is not accepted. Valid values: {0}.', this.enumValues.map(function (v) { return JSON.stringify(v); }).join(', ')); - } - } - } - }; - ValidationResult.prototype.mergePropertyMatch = function (propertyValidationResult) { - this.merge(propertyValidationResult); - this.propertiesMatches++; - if (propertyValidationResult.enumValueMatch || !propertyValidationResult.hasProblems() && propertyValidationResult.propertiesMatches) { - this.propertiesValueMatches++; - } - if (propertyValidationResult.enumValueMatch && propertyValidationResult.enumValues && propertyValidationResult.enumValues.length === 1) { - this.primaryValueMatches++; - } - }; - ValidationResult.prototype.compare = function (other) { - var hasProblems = this.hasProblems(); - if (hasProblems !== other.hasProblems()) { - return hasProblems ? -1 : 1; - } - if (this.enumValueMatch !== other.enumValueMatch) { - return other.enumValueMatch ? -1 : 1; - } - if (this.primaryValueMatches !== other.primaryValueMatches) { - return this.primaryValueMatches - other.primaryValueMatches; - } - if (this.propertiesValueMatches !== other.propertiesValueMatches) { - return this.propertiesValueMatches - other.propertiesValueMatches; - } - return this.propertiesMatches - other.propertiesMatches; - }; - return ValidationResult; -}()); - -function newJSONDocument(root, diagnostics) { - if (diagnostics === void 0) { diagnostics = []; } - return new JSONDocument(root, diagnostics, []); -} -function getNodeValue(node) { - return _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__["getNodeValue"](node); -} -function getNodePath(node) { - return _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__["getNodePath"](node); -} -function contains(node, offset, includeRightBound) { - if (includeRightBound === void 0) { includeRightBound = false; } - return offset >= node.offset && offset < (node.offset + node.length) || includeRightBound && offset === (node.offset + node.length); -} -var JSONDocument = /** @class */ (function () { - function JSONDocument(root, syntaxErrors, comments) { - if (syntaxErrors === void 0) { syntaxErrors = []; } - if (comments === void 0) { comments = []; } - this.root = root; - this.syntaxErrors = syntaxErrors; - this.comments = comments; - } - JSONDocument.prototype.getNodeFromOffset = function (offset, includeRightBound) { - if (includeRightBound === void 0) { includeRightBound = false; } - if (this.root) { - return _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__["findNodeAtOffset"](this.root, offset, includeRightBound); - } - return undefined; - }; - JSONDocument.prototype.visit = function (visitor) { - if (this.root) { - var doVisit_1 = function (node) { - var ctn = visitor(node); - var children = node.children; - if (Array.isArray(children)) { - for (var i = 0; i < children.length && ctn; i++) { - ctn = doVisit_1(children[i]); - } - } - return ctn; - }; - doVisit_1(this.root); - } - }; - JSONDocument.prototype.validate = function (textDocument, schema) { - if (this.root && schema) { - var validationResult = new ValidationResult(); - validate(this.root, schema, validationResult, NoOpSchemaCollector.instance); - return validationResult.problems.map(function (p) { - var range = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["Range"].create(textDocument.positionAt(p.location.offset), textDocument.positionAt(p.location.offset + p.location.length)); - return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["Diagnostic"].create(range, p.message, p.severity, p.code); - }); - } - return undefined; - }; - JSONDocument.prototype.getMatchingSchemas = function (schema, focusOffset, exclude) { - if (focusOffset === void 0) { focusOffset = -1; } - var matchingSchemas = new SchemaCollector(focusOffset, exclude); - if (this.root && schema) { - validate(this.root, schema, new ValidationResult(), matchingSchemas); - } - return matchingSchemas.schemas; - }; - return JSONDocument; -}()); - -function validate(n, schema, validationResult, matchingSchemas) { - if (!n || !matchingSchemas.include(n)) { - return; - } - var node = n; - switch (node.type) { - case 'object': - _validateObjectNode(node, schema, validationResult, matchingSchemas); - break; - case 'array': - _validateArrayNode(node, schema, validationResult, matchingSchemas); - break; - case 'string': - _validateStringNode(node, schema, validationResult, matchingSchemas); - break; - case 'number': - _validateNumberNode(node, schema, validationResult, matchingSchemas); - break; - case 'property': - return validate(node.valueNode, schema, validationResult, matchingSchemas); - } - _validateNode(); - matchingSchemas.add({ node: node, schema: schema }); - function _validateNode() { - function matchesType(type) { - return node.type === type || (type === 'integer' && node.type === 'number' && node.isInteger); - } - if (Array.isArray(schema.type)) { - if (!schema.type.some(matchesType)) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: schema.errorMessage || localize('typeArrayMismatchWarning', 'Incorrect type. Expected one of {0}.', schema.type.join(', ')) - }); - } - } - else if (schema.type) { - if (!matchesType(schema.type)) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: schema.errorMessage || localize('typeMismatchWarning', 'Incorrect type. Expected "{0}".', schema.type) - }); - } - } - if (Array.isArray(schema.allOf)) { - for (var _i = 0, _a = schema.allOf; _i < _a.length; _i++) { - var subSchemaRef = _a[_i]; - validate(node, asSchema(subSchemaRef), validationResult, matchingSchemas); - } - } - var notSchema = asSchema(schema.not); - if (notSchema) { - var subValidationResult = new ValidationResult(); - var subMatchingSchemas = matchingSchemas.newSub(); - validate(node, notSchema, subValidationResult, subMatchingSchemas); - if (!subValidationResult.hasProblems()) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('notSchemaWarning', "Matches a schema that is not allowed.") - }); - } - for (var _b = 0, _c = subMatchingSchemas.schemas; _b < _c.length; _b++) { - var ms = _c[_b]; - ms.inverted = !ms.inverted; - matchingSchemas.add(ms); - } - } - var testAlternatives = function (alternatives, maxOneMatch) { - var matches = []; - // remember the best match that is used for error messages - var bestMatch = undefined; - for (var _i = 0, alternatives_1 = alternatives; _i < alternatives_1.length; _i++) { - var subSchemaRef = alternatives_1[_i]; - var subSchema = asSchema(subSchemaRef); - var subValidationResult = new ValidationResult(); - var subMatchingSchemas = matchingSchemas.newSub(); - validate(node, subSchema, subValidationResult, subMatchingSchemas); - if (!subValidationResult.hasProblems()) { - matches.push(subSchema); - } - if (!bestMatch) { - bestMatch = { schema: subSchema, validationResult: subValidationResult, matchingSchemas: subMatchingSchemas }; - } - else { - if (!maxOneMatch && !subValidationResult.hasProblems() && !bestMatch.validationResult.hasProblems()) { - // no errors, both are equally good matches - bestMatch.matchingSchemas.merge(subMatchingSchemas); - bestMatch.validationResult.propertiesMatches += subValidationResult.propertiesMatches; - bestMatch.validationResult.propertiesValueMatches += subValidationResult.propertiesValueMatches; - } - else { - var compareResult = subValidationResult.compare(bestMatch.validationResult); - if (compareResult > 0) { - // our node is the best matching so far - bestMatch = { schema: subSchema, validationResult: subValidationResult, matchingSchemas: subMatchingSchemas }; - } - else if (compareResult === 0) { - // there's already a best matching but we are as good - bestMatch.matchingSchemas.merge(subMatchingSchemas); - bestMatch.validationResult.mergeEnumValues(subValidationResult); - } - } - } - } - if (matches.length > 1 && maxOneMatch) { - validationResult.problems.push({ - location: { offset: node.offset, length: 1 }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('oneOfWarning', "Matches multiple schemas when only one must validate.") - }); - } - if (bestMatch) { - validationResult.merge(bestMatch.validationResult); - validationResult.propertiesMatches += bestMatch.validationResult.propertiesMatches; - validationResult.propertiesValueMatches += bestMatch.validationResult.propertiesValueMatches; - matchingSchemas.merge(bestMatch.matchingSchemas); - } - return matches.length; - }; - if (Array.isArray(schema.anyOf)) { - testAlternatives(schema.anyOf, false); - } - if (Array.isArray(schema.oneOf)) { - testAlternatives(schema.oneOf, true); - } - var testBranch = function (schema) { - var subValidationResult = new ValidationResult(); - var subMatchingSchemas = matchingSchemas.newSub(); - validate(node, asSchema(schema), subValidationResult, subMatchingSchemas); - validationResult.merge(subValidationResult); - validationResult.propertiesMatches += subValidationResult.propertiesMatches; - validationResult.propertiesValueMatches += subValidationResult.propertiesValueMatches; - matchingSchemas.merge(subMatchingSchemas); - }; - var testCondition = function (ifSchema, thenSchema, elseSchema) { - var subSchema = asSchema(ifSchema); - var subValidationResult = new ValidationResult(); - var subMatchingSchemas = matchingSchemas.newSub(); - validate(node, subSchema, subValidationResult, subMatchingSchemas); - matchingSchemas.merge(subMatchingSchemas); - if (!subValidationResult.hasProblems()) { - if (thenSchema) { - testBranch(thenSchema); - } - } - else if (elseSchema) { - testBranch(elseSchema); - } - }; - var ifSchema = asSchema(schema.if); - if (ifSchema) { - testCondition(ifSchema, asSchema(schema.then), asSchema(schema.else)); - } - if (Array.isArray(schema.enum)) { - var val = getNodeValue(node); - var enumValueMatch = false; - for (var _d = 0, _e = schema.enum; _d < _e.length; _d++) { - var e = _e[_d]; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["equals"])(val, e)) { - enumValueMatch = true; - break; - } - } - validationResult.enumValues = schema.enum; - validationResult.enumValueMatch = enumValueMatch; - if (!enumValueMatch) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - code: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].EnumValueMismatch, - message: schema.errorMessage || localize('enumWarning', 'Value is not accepted. Valid values: {0}.', schema.enum.map(function (v) { return JSON.stringify(v); }).join(', ')) - }); - } - } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isDefined"])(schema.const)) { - var val = getNodeValue(node); - if (!Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["equals"])(val, schema.const)) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - code: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].EnumValueMismatch, - message: schema.errorMessage || localize('constWarning', 'Value must be {0}.', JSON.stringify(schema.const)) - }); - validationResult.enumValueMatch = false; - } - else { - validationResult.enumValueMatch = true; - } - validationResult.enumValues = [schema.const]; - } - if (schema.deprecationMessage && node.parent) { - validationResult.problems.push({ - location: { offset: node.parent.offset, length: node.parent.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: schema.deprecationMessage - }); - } - } - function _validateNumberNode(node, schema, validationResult, matchingSchemas) { - var val = node.value; - function normalizeFloats(float) { - var _a; - var parts = /^(-?\d+)(?:\.(\d+))?(?:e([-+]\d+))?$/.exec(float.toString()); - return parts && { - value: Number(parts[1] + (parts[2] || '')), - multiplier: (((_a = parts[2]) === null || _a === void 0 ? void 0 : _a.length) || 0) - (parseInt(parts[3]) || 0) - }; - } - ; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.multipleOf)) { - var remainder = -1; - if (Number.isInteger(schema.multipleOf)) { - remainder = val % schema.multipleOf; - } - else { - var normMultipleOf = normalizeFloats(schema.multipleOf); - var normValue = normalizeFloats(val); - if (normMultipleOf && normValue) { - var multiplier = Math.pow(10, Math.abs(normValue.multiplier - normMultipleOf.multiplier)); - if (normValue.multiplier < normMultipleOf.multiplier) { - normValue.value *= multiplier; - } - else { - normMultipleOf.value *= multiplier; - } - remainder = normValue.value % normMultipleOf.value; - } - } - if (remainder !== 0) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('multipleOfWarning', 'Value is not divisible by {0}.', schema.multipleOf) - }); - } - } - function getExclusiveLimit(limit, exclusive) { - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(exclusive)) { - return exclusive; - } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isBoolean"])(exclusive) && exclusive) { - return limit; - } - return undefined; - } - function getLimit(limit, exclusive) { - if (!Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isBoolean"])(exclusive) || !exclusive) { - return limit; - } - return undefined; - } - var exclusiveMinimum = getExclusiveLimit(schema.minimum, schema.exclusiveMinimum); - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(exclusiveMinimum) && val <= exclusiveMinimum) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('exclusiveMinimumWarning', 'Value is below the exclusive minimum of {0}.', exclusiveMinimum) - }); - } - var exclusiveMaximum = getExclusiveLimit(schema.maximum, schema.exclusiveMaximum); - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(exclusiveMaximum) && val >= exclusiveMaximum) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('exclusiveMaximumWarning', 'Value is above the exclusive maximum of {0}.', exclusiveMaximum) - }); - } - var minimum = getLimit(schema.minimum, schema.exclusiveMinimum); - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(minimum) && val < minimum) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('minimumWarning', 'Value is below the minimum of {0}.', minimum) - }); - } - var maximum = getLimit(schema.maximum, schema.exclusiveMaximum); - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(maximum) && val > maximum) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('maximumWarning', 'Value is above the maximum of {0}.', maximum) - }); - } - } - function _validateStringNode(node, schema, validationResult, matchingSchemas) { - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.minLength) && node.value.length < schema.minLength) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('minLengthWarning', 'String is shorter than the minimum length of {0}.', schema.minLength) - }); - } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.maxLength) && node.value.length > schema.maxLength) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('maxLengthWarning', 'String is longer than the maximum length of {0}.', schema.maxLength) - }); - } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isString"])(schema.pattern)) { - var regex = new RegExp(schema.pattern); - if (!regex.test(node.value)) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: schema.patternErrorMessage || schema.errorMessage || localize('patternWarning', 'String does not match the pattern of "{0}".', schema.pattern) - }); - } - } - if (schema.format) { - switch (schema.format) { - case 'uri': - case 'uri-reference': - { - var errorMessage = void 0; - if (!node.value) { - errorMessage = localize('uriEmpty', 'URI expected.'); - } - else { - var match = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(node.value); - if (!match) { - errorMessage = localize('uriMissing', 'URI is expected.'); - } - else if (!match[2] && schema.format === 'uri') { - errorMessage = localize('uriSchemeMissing', 'URI with a scheme is expected.'); - } - } - if (errorMessage) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: schema.patternErrorMessage || schema.errorMessage || localize('uriFormatWarning', 'String is not a URI: {0}', errorMessage) - }); - } - } - break; - case 'color-hex': - case 'date-time': - case 'date': - case 'time': - case 'email': - var format = formats[schema.format]; - if (!node.value || !format.pattern.exec(node.value)) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: schema.patternErrorMessage || schema.errorMessage || format.errorMessage - }); - } - default: - } - } - } - function _validateArrayNode(node, schema, validationResult, matchingSchemas) { - if (Array.isArray(schema.items)) { - var subSchemas = schema.items; - for (var index = 0; index < subSchemas.length; index++) { - var subSchemaRef = subSchemas[index]; - var subSchema = asSchema(subSchemaRef); - var itemValidationResult = new ValidationResult(); - var item = node.items[index]; - if (item) { - validate(item, subSchema, itemValidationResult, matchingSchemas); - validationResult.mergePropertyMatch(itemValidationResult); - } - else if (node.items.length >= subSchemas.length) { - validationResult.propertiesValueMatches++; - } - } - if (node.items.length > subSchemas.length) { - if (typeof schema.additionalItems === 'object') { - for (var i = subSchemas.length; i < node.items.length; i++) { - var itemValidationResult = new ValidationResult(); - validate(node.items[i], schema.additionalItems, itemValidationResult, matchingSchemas); - validationResult.mergePropertyMatch(itemValidationResult); - } - } - else if (schema.additionalItems === false) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('additionalItemsWarning', 'Array has too many items according to schema. Expected {0} or fewer.', subSchemas.length) - }); - } - } - } - else { - var itemSchema = asSchema(schema.items); - if (itemSchema) { - for (var _i = 0, _a = node.items; _i < _a.length; _i++) { - var item = _a[_i]; - var itemValidationResult = new ValidationResult(); - validate(item, itemSchema, itemValidationResult, matchingSchemas); - validationResult.mergePropertyMatch(itemValidationResult); - } - } - } - var containsSchema = asSchema(schema.contains); - if (containsSchema) { - var doesContain = node.items.some(function (item) { - var itemValidationResult = new ValidationResult(); - validate(item, containsSchema, itemValidationResult, NoOpSchemaCollector.instance); - return !itemValidationResult.hasProblems(); - }); - if (!doesContain) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: schema.errorMessage || localize('requiredItemMissingWarning', 'Array does not contain required item.') - }); - } - } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.minItems) && node.items.length < schema.minItems) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('minItemsWarning', 'Array has too few items. Expected {0} or more.', schema.minItems) - }); - } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.maxItems) && node.items.length > schema.maxItems) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('maxItemsWarning', 'Array has too many items. Expected {0} or fewer.', schema.maxItems) - }); - } - if (schema.uniqueItems === true) { - var values_1 = getNodeValue(node); - var duplicates = values_1.some(function (value, index) { - return index !== values_1.lastIndexOf(value); - }); - if (duplicates) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('uniqueItemsWarning', 'Array has duplicate items.') - }); - } - } - } - function _validateObjectNode(node, schema, validationResult, matchingSchemas) { - var seenKeys = Object.create(null); - var unprocessedProperties = []; - for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { - var propertyNode = _a[_i]; - var key = propertyNode.keyNode.value; - seenKeys[key] = propertyNode.valueNode; - unprocessedProperties.push(key); - } - if (Array.isArray(schema.required)) { - for (var _b = 0, _c = schema.required; _b < _c.length; _b++) { - var propertyName = _c[_b]; - if (!seenKeys[propertyName]) { - var keyNode = node.parent && node.parent.type === 'property' && node.parent.keyNode; - var location = keyNode ? { offset: keyNode.offset, length: keyNode.length } : { offset: node.offset, length: 1 }; - validationResult.problems.push({ - location: location, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('MissingRequiredPropWarning', 'Missing property "{0}".', propertyName) - }); - } - } - } - var propertyProcessed = function (prop) { - var index = unprocessedProperties.indexOf(prop); - while (index >= 0) { - unprocessedProperties.splice(index, 1); - index = unprocessedProperties.indexOf(prop); - } - }; - if (schema.properties) { - for (var _d = 0, _e = Object.keys(schema.properties); _d < _e.length; _d++) { - var propertyName = _e[_d]; - propertyProcessed(propertyName); - var propertySchema = schema.properties[propertyName]; - var child = seenKeys[propertyName]; - if (child) { - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isBoolean"])(propertySchema)) { - if (!propertySchema) { - var propertyNode = child.parent; - validationResult.problems.push({ - location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName) - }); - } - else { - validationResult.propertiesMatches++; - validationResult.propertiesValueMatches++; - } - } - else { - var propertyValidationResult = new ValidationResult(); - validate(child, propertySchema, propertyValidationResult, matchingSchemas); - validationResult.mergePropertyMatch(propertyValidationResult); - } - } - } - } - if (schema.patternProperties) { - for (var _f = 0, _g = Object.keys(schema.patternProperties); _f < _g.length; _f++) { - var propertyPattern = _g[_f]; - var regex = new RegExp(propertyPattern); - for (var _h = 0, _j = unprocessedProperties.slice(0); _h < _j.length; _h++) { - var propertyName = _j[_h]; - if (regex.test(propertyName)) { - propertyProcessed(propertyName); - var child = seenKeys[propertyName]; - if (child) { - var propertySchema = schema.patternProperties[propertyPattern]; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isBoolean"])(propertySchema)) { - if (!propertySchema) { - var propertyNode = child.parent; - validationResult.problems.push({ - location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName) - }); - } - else { - validationResult.propertiesMatches++; - validationResult.propertiesValueMatches++; - } - } - else { - var propertyValidationResult = new ValidationResult(); - validate(child, propertySchema, propertyValidationResult, matchingSchemas); - validationResult.mergePropertyMatch(propertyValidationResult); - } - } - } - } - } - } - if (typeof schema.additionalProperties === 'object') { - for (var _k = 0, unprocessedProperties_1 = unprocessedProperties; _k < unprocessedProperties_1.length; _k++) { - var propertyName = unprocessedProperties_1[_k]; - var child = seenKeys[propertyName]; - if (child) { - var propertyValidationResult = new ValidationResult(); - validate(child, schema.additionalProperties, propertyValidationResult, matchingSchemas); - validationResult.mergePropertyMatch(propertyValidationResult); - } - } - } - else if (schema.additionalProperties === false) { - if (unprocessedProperties.length > 0) { - for (var _l = 0, unprocessedProperties_2 = unprocessedProperties; _l < unprocessedProperties_2.length; _l++) { - var propertyName = unprocessedProperties_2[_l]; - var child = seenKeys[propertyName]; - if (child) { - var propertyNode = child.parent; - validationResult.problems.push({ - location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName) - }); - } - } - } - } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.maxProperties)) { - if (node.properties.length > schema.maxProperties) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('MaxPropWarning', 'Object has more properties than limit of {0}.', schema.maxProperties) - }); - } - } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.minProperties)) { - if (node.properties.length < schema.minProperties) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('MinPropWarning', 'Object has fewer properties than the required number of {0}', schema.minProperties) - }); - } - } - if (schema.dependencies) { - for (var _m = 0, _o = Object.keys(schema.dependencies); _m < _o.length; _m++) { - var key = _o[_m]; - var prop = seenKeys[key]; - if (prop) { - var propertyDep = schema.dependencies[key]; - if (Array.isArray(propertyDep)) { - for (var _p = 0, propertyDep_1 = propertyDep; _p < propertyDep_1.length; _p++) { - var requiredProp = propertyDep_1[_p]; - if (!seenKeys[requiredProp]) { - validationResult.problems.push({ - location: { offset: node.offset, length: node.length }, - severity: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning, - message: localize('RequiredDependentPropWarning', 'Object is missing property {0} required by property {1}.', requiredProp, key) - }); - } - else { - validationResult.propertiesValueMatches++; - } - } - } - else { - var propertySchema = asSchema(propertyDep); - if (propertySchema) { - var propertyValidationResult = new ValidationResult(); - validate(node, propertySchema, propertyValidationResult, matchingSchemas); - validationResult.mergePropertyMatch(propertyValidationResult); - } - } - } - } - } - var propertyNames = asSchema(schema.propertyNames); - if (propertyNames) { - for (var _q = 0, _r = node.properties; _q < _r.length; _q++) { - var f = _r[_q]; - var key = f.keyNode; - if (key) { - validate(key, propertyNames, validationResult, NoOpSchemaCollector.instance); - } - } - } - } -} -function parse(textDocument, config) { - var problems = []; - var lastProblemOffset = -1; - var text = textDocument.getText(); - var scanner = _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__["createScanner"](text, false); - var commentRanges = config && config.collectComments ? [] : undefined; - function _scanNext() { - while (true) { - var token_1 = scanner.scan(); - _checkScanError(); - switch (token_1) { - case 12 /* LineCommentTrivia */: - case 13 /* BlockCommentTrivia */: - if (Array.isArray(commentRanges)) { - commentRanges.push(_jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["Range"].create(textDocument.positionAt(scanner.getTokenOffset()), textDocument.positionAt(scanner.getTokenOffset() + scanner.getTokenLength()))); - } - break; - case 15 /* Trivia */: - case 14 /* LineBreakTrivia */: - break; - default: - return token_1; - } - } - } - function _accept(token) { - if (scanner.getToken() === token) { - _scanNext(); - return true; - } - return false; - } - function _errorAtRange(message, code, startOffset, endOffset, severity) { - if (severity === void 0) { severity = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Error; } - if (problems.length === 0 || startOffset !== lastProblemOffset) { - var range = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["Range"].create(textDocument.positionAt(startOffset), textDocument.positionAt(endOffset)); - problems.push(_jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["Diagnostic"].create(range, message, severity, code, textDocument.languageId)); - lastProblemOffset = startOffset; - } - } - function _error(message, code, node, skipUntilAfter, skipUntil) { - if (node === void 0) { node = undefined; } - if (skipUntilAfter === void 0) { skipUntilAfter = []; } - if (skipUntil === void 0) { skipUntil = []; } - var start = scanner.getTokenOffset(); - var end = scanner.getTokenOffset() + scanner.getTokenLength(); - if (start === end && start > 0) { - start--; - while (start > 0 && /\s/.test(text.charAt(start))) { - start--; - } - end = start + 1; - } - _errorAtRange(message, code, start, end); - if (node) { - _finalize(node, false); - } - if (skipUntilAfter.length + skipUntil.length > 0) { - var token_2 = scanner.getToken(); - while (token_2 !== 17 /* EOF */) { - if (skipUntilAfter.indexOf(token_2) !== -1) { - _scanNext(); - break; - } - else if (skipUntil.indexOf(token_2) !== -1) { - break; - } - token_2 = _scanNext(); - } - } - return node; - } - function _checkScanError() { - switch (scanner.getTokenError()) { - case 4 /* InvalidUnicode */: - _error(localize('InvalidUnicode', 'Invalid unicode sequence in string.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].InvalidUnicode); - return true; - case 5 /* InvalidEscapeCharacter */: - _error(localize('InvalidEscapeCharacter', 'Invalid escape character in string.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].InvalidEscapeCharacter); - return true; - case 3 /* UnexpectedEndOfNumber */: - _error(localize('UnexpectedEndOfNumber', 'Unexpected end of number.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].UnexpectedEndOfNumber); - return true; - case 1 /* UnexpectedEndOfComment */: - _error(localize('UnexpectedEndOfComment', 'Unexpected end of comment.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].UnexpectedEndOfComment); - return true; - case 2 /* UnexpectedEndOfString */: - _error(localize('UnexpectedEndOfString', 'Unexpected end of string.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].UnexpectedEndOfString); - return true; - case 6 /* InvalidCharacter */: - _error(localize('InvalidCharacter', 'Invalid characters in string. Control characters must be escaped.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].InvalidCharacter); - return true; - } - return false; - } - function _finalize(node, scanNext) { - node.length = scanner.getTokenOffset() + scanner.getTokenLength() - node.offset; - if (scanNext) { - _scanNext(); - } - return node; - } - function _parseArray(parent) { - if (scanner.getToken() !== 3 /* OpenBracketToken */) { - return undefined; - } - var node = new ArrayASTNodeImpl(parent, scanner.getTokenOffset()); - _scanNext(); // consume OpenBracketToken - var count = 0; - var needsComma = false; - while (scanner.getToken() !== 4 /* CloseBracketToken */ && scanner.getToken() !== 17 /* EOF */) { - if (scanner.getToken() === 5 /* CommaToken */) { - if (!needsComma) { - _error(localize('ValueExpected', 'Value expected'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].ValueExpected); - } - var commaOffset = scanner.getTokenOffset(); - _scanNext(); // consume comma - if (scanner.getToken() === 4 /* CloseBracketToken */) { - if (needsComma) { - _errorAtRange(localize('TrailingComma', 'Trailing comma'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].TrailingComma, commaOffset, commaOffset + 1); - } - continue; - } - } - else if (needsComma) { - _error(localize('ExpectedComma', 'Expected comma'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].CommaExpected); - } - var item = _parseValue(node); - if (!item) { - _error(localize('PropertyExpected', 'Value expected'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].ValueExpected, undefined, [], [4 /* CloseBracketToken */, 5 /* CommaToken */]); - } - else { - node.items.push(item); - } - needsComma = true; - } - if (scanner.getToken() !== 4 /* CloseBracketToken */) { - return _error(localize('ExpectedCloseBracket', 'Expected comma or closing bracket'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].CommaOrCloseBacketExpected, node); - } - return _finalize(node, true); - } - var keyPlaceholder = new StringASTNodeImpl(undefined, 0, 0); - function _parseProperty(parent, keysSeen) { - var node = new PropertyASTNodeImpl(parent, scanner.getTokenOffset(), keyPlaceholder); - var key = _parseString(node); - if (!key) { - if (scanner.getToken() === 16 /* Unknown */) { - // give a more helpful error message - _error(localize('DoubleQuotesExpected', 'Property keys must be doublequoted'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].Undefined); - var keyNode = new StringASTNodeImpl(node, scanner.getTokenOffset(), scanner.getTokenLength()); - keyNode.value = scanner.getTokenValue(); - key = keyNode; - _scanNext(); // consume Unknown - } - else { - return undefined; - } - } - node.keyNode = key; - var seen = keysSeen[key.value]; - if (seen) { - _errorAtRange(localize('DuplicateKeyWarning', "Duplicate object key"), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].DuplicateKey, node.keyNode.offset, node.keyNode.offset + node.keyNode.length, _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning); - if (typeof seen === 'object') { - _errorAtRange(localize('DuplicateKeyWarning', "Duplicate object key"), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].DuplicateKey, seen.keyNode.offset, seen.keyNode.offset + seen.keyNode.length, _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["DiagnosticSeverity"].Warning); - } - keysSeen[key.value] = true; // if the same key is duplicate again, avoid duplicate error reporting - } - else { - keysSeen[key.value] = node; - } - if (scanner.getToken() === 6 /* ColonToken */) { - node.colonOffset = scanner.getTokenOffset(); - _scanNext(); // consume ColonToken - } - else { - _error(localize('ColonExpected', 'Colon expected'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].ColonExpected); - if (scanner.getToken() === 10 /* StringLiteral */ && textDocument.positionAt(key.offset + key.length).line < textDocument.positionAt(scanner.getTokenOffset()).line) { - node.length = key.length; - return node; - } - } - var value = _parseValue(node); - if (!value) { - return _error(localize('ValueExpected', 'Value expected'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].ValueExpected, node, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]); - } - node.valueNode = value; - node.length = value.offset + value.length - node.offset; - return node; - } - function _parseObject(parent) { - if (scanner.getToken() !== 1 /* OpenBraceToken */) { - return undefined; - } - var node = new ObjectASTNodeImpl(parent, scanner.getTokenOffset()); - var keysSeen = Object.create(null); - _scanNext(); // consume OpenBraceToken - var needsComma = false; - while (scanner.getToken() !== 2 /* CloseBraceToken */ && scanner.getToken() !== 17 /* EOF */) { - if (scanner.getToken() === 5 /* CommaToken */) { - if (!needsComma) { - _error(localize('PropertyExpected', 'Property expected'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].PropertyExpected); - } - var commaOffset = scanner.getTokenOffset(); - _scanNext(); // consume comma - if (scanner.getToken() === 2 /* CloseBraceToken */) { - if (needsComma) { - _errorAtRange(localize('TrailingComma', 'Trailing comma'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].TrailingComma, commaOffset, commaOffset + 1); - } - continue; - } - } - else if (needsComma) { - _error(localize('ExpectedComma', 'Expected comma'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].CommaExpected); - } - var property = _parseProperty(node, keysSeen); - if (!property) { - _error(localize('PropertyExpected', 'Property expected'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].PropertyExpected, undefined, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]); - } - else { - node.properties.push(property); - } - needsComma = true; - } - if (scanner.getToken() !== 2 /* CloseBraceToken */) { - return _error(localize('ExpectedCloseBrace', 'Expected comma or closing brace'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].CommaOrCloseBraceExpected, node); - } - return _finalize(node, true); - } - function _parseString(parent) { - if (scanner.getToken() !== 10 /* StringLiteral */) { - return undefined; - } - var node = new StringASTNodeImpl(parent, scanner.getTokenOffset()); - node.value = scanner.getTokenValue(); - return _finalize(node, true); - } - function _parseNumber(parent) { - if (scanner.getToken() !== 11 /* NumericLiteral */) { - return undefined; - } - var node = new NumberASTNodeImpl(parent, scanner.getTokenOffset()); - if (scanner.getTokenError() === 0 /* None */) { - var tokenValue = scanner.getTokenValue(); - try { - var numberValue = JSON.parse(tokenValue); - if (!Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(numberValue)) { - return _error(localize('InvalidNumberFormat', 'Invalid number format.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].Undefined, node); - } - node.value = numberValue; - } - catch (e) { - return _error(localize('InvalidNumberFormat', 'Invalid number format.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].Undefined, node); - } - node.isInteger = tokenValue.indexOf('.') === -1; - } - return _finalize(node, true); - } - function _parseLiteral(parent) { - var node; - switch (scanner.getToken()) { - case 7 /* NullKeyword */: - return _finalize(new NullASTNodeImpl(parent, scanner.getTokenOffset()), true); - case 8 /* TrueKeyword */: - return _finalize(new BooleanASTNodeImpl(parent, true, scanner.getTokenOffset()), true); - case 9 /* FalseKeyword */: - return _finalize(new BooleanASTNodeImpl(parent, false, scanner.getTokenOffset()), true); - default: - return undefined; - } - } - function _parseValue(parent) { - return _parseArray(parent) || _parseObject(parent) || _parseString(parent) || _parseNumber(parent) || _parseLiteral(parent); - } - var _root = undefined; - var token = _scanNext(); - if (token !== 17 /* EOF */) { - _root = _parseValue(_root); - if (!_root) { - _error(localize('Invalid symbol', 'Expected a JSON object, array or literal.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].Undefined); - } - else if (scanner.getToken() !== 17 /* EOF */) { - _error(localize('End of file expected', 'End of file expected.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].Undefined); - } - } - return new JSONDocument(_root, problems, commentRanges); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/configuration.js": -/*!*********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/configuration.js ***! - \*********************************************************************************************************************/ -/*! exports provided: schemaContributions */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "schemaContributions", function() { return schemaContributions; }); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_0__["loadMessageBundle"](); -var schemaContributions = { - schemaAssociations: [], - schemas: { - // refer to the latest schema - 'http://json-schema.org/schema#': { - $ref: 'http://json-schema.org/draft-07/schema#' - }, - // bundle the schema-schema to include (localized) descriptions - 'http://json-schema.org/draft-04/schema#': { - 'title': localize('schema.json', 'Describes a JSON file using a schema. See json-schema.org for more info.'), - '$schema': 'http://json-schema.org/draft-04/schema#', - 'definitions': { - 'schemaArray': { - 'type': 'array', - 'minItems': 1, - 'items': { - '$ref': '#' - } - }, - 'positiveInteger': { - 'type': 'integer', - 'minimum': 0 - }, - 'positiveIntegerDefault0': { - 'allOf': [ - { - '$ref': '#/definitions/positiveInteger' - }, - { - 'default': 0 - } - ] - }, - 'simpleTypes': { - 'type': 'string', - 'enum': [ - 'array', - 'boolean', - 'integer', - 'null', - 'number', - 'object', - 'string' - ] - }, - 'stringArray': { - 'type': 'array', - 'items': { - 'type': 'string' - }, - 'minItems': 1, - 'uniqueItems': true - } - }, - 'type': 'object', - 'properties': { - 'id': { - 'type': 'string', - 'format': 'uri' - }, - '$schema': { - 'type': 'string', - 'format': 'uri' - }, - 'title': { - 'type': 'string' - }, - 'description': { - 'type': 'string' - }, - 'default': {}, - 'multipleOf': { - 'type': 'number', - 'minimum': 0, - 'exclusiveMinimum': true - }, - 'maximum': { - 'type': 'number' - }, - 'exclusiveMaximum': { - 'type': 'boolean', - 'default': false - }, - 'minimum': { - 'type': 'number' - }, - 'exclusiveMinimum': { - 'type': 'boolean', - 'default': false - }, - 'maxLength': { - 'allOf': [ - { - '$ref': '#/definitions/positiveInteger' - } - ] - }, - 'minLength': { - 'allOf': [ - { - '$ref': '#/definitions/positiveIntegerDefault0' - } - ] - }, - 'pattern': { - 'type': 'string', - 'format': 'regex' - }, - 'additionalItems': { - 'anyOf': [ - { - 'type': 'boolean' - }, - { - '$ref': '#' - } - ], - 'default': {} - }, - 'items': { - 'anyOf': [ - { - '$ref': '#' - }, - { - '$ref': '#/definitions/schemaArray' - } - ], - 'default': {} - }, - 'maxItems': { - 'allOf': [ - { - '$ref': '#/definitions/positiveInteger' - } - ] - }, - 'minItems': { - 'allOf': [ - { - '$ref': '#/definitions/positiveIntegerDefault0' - } - ] - }, - 'uniqueItems': { - 'type': 'boolean', - 'default': false - }, - 'maxProperties': { - 'allOf': [ - { - '$ref': '#/definitions/positiveInteger' - } - ] - }, - 'minProperties': { - 'allOf': [ - { - '$ref': '#/definitions/positiveIntegerDefault0' - } - ] - }, - 'required': { - 'allOf': [ - { - '$ref': '#/definitions/stringArray' - } - ] - }, - 'additionalProperties': { - 'anyOf': [ - { - 'type': 'boolean' - }, - { - '$ref': '#' - } - ], - 'default': {} - }, - 'definitions': { - 'type': 'object', - 'additionalProperties': { - '$ref': '#' - }, - 'default': {} - }, - 'properties': { - 'type': 'object', - 'additionalProperties': { - '$ref': '#' - }, - 'default': {} - }, - 'patternProperties': { - 'type': 'object', - 'additionalProperties': { - '$ref': '#' - }, - 'default': {} - }, - 'dependencies': { - 'type': 'object', - 'additionalProperties': { - 'anyOf': [ - { - '$ref': '#' - }, - { - '$ref': '#/definitions/stringArray' - } - ] - } - }, - 'enum': { - 'type': 'array', - 'minItems': 1, - 'uniqueItems': true - }, - 'type': { - 'anyOf': [ - { - '$ref': '#/definitions/simpleTypes' - }, - { - 'type': 'array', - 'items': { - '$ref': '#/definitions/simpleTypes' - }, - 'minItems': 1, - 'uniqueItems': true - } - ] - }, - 'format': { - 'anyOf': [ - { - 'type': 'string', - 'enum': [ - 'date-time', - 'uri', - 'email', - 'hostname', - 'ipv4', - 'ipv6', - 'regex' - ] - }, - { - 'type': 'string' - } - ] - }, - 'allOf': { - 'allOf': [ - { - '$ref': '#/definitions/schemaArray' - } - ] - }, - 'anyOf': { - 'allOf': [ - { - '$ref': '#/definitions/schemaArray' - } - ] - }, - 'oneOf': { - 'allOf': [ - { - '$ref': '#/definitions/schemaArray' - } - ] - }, - 'not': { - 'allOf': [ - { - '$ref': '#' - } - ] - } - }, - 'dependencies': { - 'exclusiveMaximum': [ - 'maximum' - ], - 'exclusiveMinimum': [ - 'minimum' - ] - }, - 'default': {} - }, - 'http://json-schema.org/draft-07/schema#': { - 'title': localize('schema.json', 'Describes a JSON file using a schema. See json-schema.org for more info.'), - 'definitions': { - 'schemaArray': { - 'type': 'array', - 'minItems': 1, - 'items': { '$ref': '#' } - }, - 'nonNegativeInteger': { - 'type': 'integer', - 'minimum': 0 - }, - 'nonNegativeIntegerDefault0': { - 'allOf': [ - { '$ref': '#/definitions/nonNegativeInteger' }, - { 'default': 0 } - ] - }, - 'simpleTypes': { - 'enum': [ - 'array', - 'boolean', - 'integer', - 'null', - 'number', - 'object', - 'string' - ] - }, - 'stringArray': { - 'type': 'array', - 'items': { 'type': 'string' }, - 'uniqueItems': true, - 'default': [] - } - }, - 'type': ['object', 'boolean'], - 'properties': { - '$id': { - 'type': 'string', - 'format': 'uri-reference' - }, - '$schema': { - 'type': 'string', - 'format': 'uri' - }, - '$ref': { - 'type': 'string', - 'format': 'uri-reference' - }, - '$comment': { - 'type': 'string' - }, - 'title': { - 'type': 'string' - }, - 'description': { - 'type': 'string' - }, - 'default': true, - 'readOnly': { - 'type': 'boolean', - 'default': false - }, - 'examples': { - 'type': 'array', - 'items': true - }, - 'multipleOf': { - 'type': 'number', - 'exclusiveMinimum': 0 - }, - 'maximum': { - 'type': 'number' - }, - 'exclusiveMaximum': { - 'type': 'number' - }, - 'minimum': { - 'type': 'number' - }, - 'exclusiveMinimum': { - 'type': 'number' - }, - 'maxLength': { '$ref': '#/definitions/nonNegativeInteger' }, - 'minLength': { '$ref': '#/definitions/nonNegativeIntegerDefault0' }, - 'pattern': { - 'type': 'string', - 'format': 'regex' - }, - 'additionalItems': { '$ref': '#' }, - 'items': { - 'anyOf': [ - { '$ref': '#' }, - { '$ref': '#/definitions/schemaArray' } - ], - 'default': true - }, - 'maxItems': { '$ref': '#/definitions/nonNegativeInteger' }, - 'minItems': { '$ref': '#/definitions/nonNegativeIntegerDefault0' }, - 'uniqueItems': { - 'type': 'boolean', - 'default': false - }, - 'contains': { '$ref': '#' }, - 'maxProperties': { '$ref': '#/definitions/nonNegativeInteger' }, - 'minProperties': { '$ref': '#/definitions/nonNegativeIntegerDefault0' }, - 'required': { '$ref': '#/definitions/stringArray' }, - 'additionalProperties': { '$ref': '#' }, - 'definitions': { - 'type': 'object', - 'additionalProperties': { '$ref': '#' }, - 'default': {} - }, - 'properties': { - 'type': 'object', - 'additionalProperties': { '$ref': '#' }, - 'default': {} - }, - 'patternProperties': { - 'type': 'object', - 'additionalProperties': { '$ref': '#' }, - 'propertyNames': { 'format': 'regex' }, - 'default': {} - }, - 'dependencies': { - 'type': 'object', - 'additionalProperties': { - 'anyOf': [ - { '$ref': '#' }, - { '$ref': '#/definitions/stringArray' } - ] - } - }, - 'propertyNames': { '$ref': '#' }, - 'const': true, - 'enum': { - 'type': 'array', - 'items': true, - 'minItems': 1, - 'uniqueItems': true - }, - 'type': { - 'anyOf': [ - { '$ref': '#/definitions/simpleTypes' }, - { - 'type': 'array', - 'items': { '$ref': '#/definitions/simpleTypes' }, - 'minItems': 1, - 'uniqueItems': true - } - ] - }, - 'format': { 'type': 'string' }, - 'contentMediaType': { 'type': 'string' }, - 'contentEncoding': { 'type': 'string' }, - 'if': { '$ref': '#' }, - 'then': { '$ref': '#' }, - 'else': { '$ref': '#' }, - 'allOf': { '$ref': '#/definitions/schemaArray' }, - 'anyOf': { '$ref': '#/definitions/schemaArray' }, - 'oneOf': { '$ref': '#/definitions/schemaArray' }, - 'not': { '$ref': '#' } - }, - 'default': true - } - } -}; -var descriptions = { - id: localize('schema.json.id', "A unique identifier for the schema."), - $schema: localize('schema.json.$schema', "The schema to verify this document against."), - title: localize('schema.json.title', "A descriptive title of the element."), - description: localize('schema.json.description', "A long description of the element. Used in hover menus and suggestions."), - default: localize('schema.json.default', "A default value. Used by suggestions."), - multipleOf: localize('schema.json.multipleOf', "A number that should cleanly divide the current value (i.e. have no remainder)."), - maximum: localize('schema.json.maximum', "The maximum numerical value, inclusive by default."), - exclusiveMaximum: localize('schema.json.exclusiveMaximum', "Makes the maximum property exclusive."), - minimum: localize('schema.json.minimum', "The minimum numerical value, inclusive by default."), - exclusiveMinimum: localize('schema.json.exclusiveMininum', "Makes the minimum property exclusive."), - maxLength: localize('schema.json.maxLength', "The maximum length of a string."), - minLength: localize('schema.json.minLength', "The minimum length of a string."), - pattern: localize('schema.json.pattern', "A regular expression to match the string against. It is not implicitly anchored."), - additionalItems: localize('schema.json.additionalItems', "For arrays, only when items is set as an array. If it is a schema, then this schema validates items after the ones specified by the items array. If it is false, then additional items will cause validation to fail."), - items: localize('schema.json.items', "For arrays. Can either be a schema to validate every element against or an array of schemas to validate each item against in order (the first schema will validate the first element, the second schema will validate the second element, and so on."), - maxItems: localize('schema.json.maxItems', "The maximum number of items that can be inside an array. Inclusive."), - minItems: localize('schema.json.minItems', "The minimum number of items that can be inside an array. Inclusive."), - uniqueItems: localize('schema.json.uniqueItems', "If all of the items in the array must be unique. Defaults to false."), - maxProperties: localize('schema.json.maxProperties', "The maximum number of properties an object can have. Inclusive."), - minProperties: localize('schema.json.minProperties', "The minimum number of properties an object can have. Inclusive."), - required: localize('schema.json.required', "An array of strings that lists the names of all properties required on this object."), - additionalProperties: localize('schema.json.additionalProperties', "Either a schema or a boolean. If a schema, then used to validate all properties not matched by 'properties' or 'patternProperties'. If false, then any properties not matched by either will cause this schema to fail."), - definitions: localize('schema.json.definitions', "Not used for validation. Place subschemas here that you wish to reference inline with $ref."), - properties: localize('schema.json.properties', "A map of property names to schemas for each property."), - patternProperties: localize('schema.json.patternProperties', "A map of regular expressions on property names to schemas for matching properties."), - dependencies: localize('schema.json.dependencies', "A map of property names to either an array of property names or a schema. An array of property names means the property named in the key depends on the properties in the array being present in the object in order to be valid. If the value is a schema, then the schema is only applied to the object if the property in the key exists on the object."), - enum: localize('schema.json.enum', "The set of literal values that are valid."), - type: localize('schema.json.type', "Either a string of one of the basic schema types (number, integer, null, array, object, boolean, string) or an array of strings specifying a subset of those types."), - format: localize('schema.json.format', "Describes the format expected for the value."), - allOf: localize('schema.json.allOf', "An array of schemas, all of which must match."), - anyOf: localize('schema.json.anyOf', "An array of schemas, where at least one must match."), - oneOf: localize('schema.json.oneOf', "An array of schemas, exactly one of which must match."), - not: localize('schema.json.not', "A schema which must not match."), - $id: localize('schema.json.$id', "A unique identifier for the schema."), - $ref: localize('schema.json.$ref', "Reference a definition hosted on any location."), - $comment: localize('schema.json.$comment', "Comments from schema authors to readers or maintainers of the schema."), - readOnly: localize('schema.json.readOnly', "Indicates that the value of the instance is managed exclusively by the owning authority."), - examples: localize('schema.json.examples', "Sample JSON values associated with a particular schema, for the purpose of illustrating usage."), - contains: localize('schema.json.contains', "An array instance is valid against \"contains\" if at least one of its elements is valid against the given schema."), - propertyNames: localize('schema.json.propertyNames', "If the instance is an object, this keyword validates if every property name in the instance validates against the provided schema."), - const: localize('schema.json.const', "An instance validates successfully against this keyword if its value is equal to the value of the keyword."), - contentMediaType: localize('schema.json.contentMediaType', "Describes the media type of a string property."), - contentEncoding: localize('schema.json.contentEncoding', "Describes the content encoding of a string property."), - if: localize('schema.json.if', "The validation outcome of the \"if\" subschema controls which of the \"then\" or \"else\" keywords are evaluated."), - then: localize('schema.json.then', "The \"if\" subschema is used for validation when the \"if\" subschema succeeds."), - else: localize('schema.json.else', "The \"else\" subschema is used for validation when the \"if\" subschema fails.") -}; -for (var schemaName in schemaContributions.schemas) { - var schema = schemaContributions.schemas[schemaName]; - for (var property in schema.properties) { - var propertyObject = schema.properties[property]; - if (typeof propertyObject === 'boolean') { - propertyObject = schema.properties[property] = {}; - } - var description = descriptions[property]; - if (description) { - propertyObject['description'] = description; - } - else { - console.log(property + ": localize('schema.json." + property + "', \"\")"); - } - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonCompletion.js": -/*!**********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonCompletion.js ***! - \**********************************************************************************************************************/ -/*! exports provided: JSONCompletion */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONCompletion", function() { return JSONCompletion; }); -/* harmony import */ var _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/jsonParser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js"); -/* harmony import */ var _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jsonc-parser/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js"); -/* harmony import */ var _utils_json_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/json.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/json.js"); -/* harmony import */ var _utils_strings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/strings.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js"); -/* harmony import */ var _utils_objects_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/objects.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/objects.js"); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_6__["loadMessageBundle"](); -var valueCommitCharacters = [',', '}', ']']; -var propertyCommitCharacters = [':']; -var JSONCompletion = /** @class */ (function () { - function JSONCompletion(schemaService, contributions, promiseConstructor, clientCapabilities) { - if (contributions === void 0) { contributions = []; } - if (promiseConstructor === void 0) { promiseConstructor = Promise; } - if (clientCapabilities === void 0) { clientCapabilities = {}; } - this.schemaService = schemaService; - this.contributions = contributions; - this.promiseConstructor = promiseConstructor; - this.clientCapabilities = clientCapabilities; - } - JSONCompletion.prototype.doResolve = function (item) { - for (var i = this.contributions.length - 1; i >= 0; i--) { - var resolveCompletion = this.contributions[i].resolveCompletion; - if (resolveCompletion) { - var resolver = resolveCompletion(item); - if (resolver) { - return resolver; - } - } - } - return this.promiseConstructor.resolve(item); - }; - JSONCompletion.prototype.doComplete = function (document, position, doc) { - var _this = this; - var result = { - items: [], - isIncomplete: false - }; - var text = document.getText(); - var offset = document.offsetAt(position); - var node = doc.getNodeFromOffset(offset, true); - if (this.isInComment(document, node ? node.offset : 0, offset)) { - return Promise.resolve(result); - } - if (node && (offset === node.offset + node.length) && offset > 0) { - var ch = text[offset - 1]; - if (node.type === 'object' && ch === '}' || node.type === 'array' && ch === ']') { - // after ] or } - node = node.parent; - } - } - var currentWord = this.getCurrentWord(document, offset); - var overwriteRange; - if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { - overwriteRange = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["Range"].create(document.positionAt(node.offset), document.positionAt(node.offset + node.length)); - } - else { - var overwriteStart = offset - currentWord.length; - if (overwriteStart > 0 && text[overwriteStart - 1] === '"') { - overwriteStart--; - } - overwriteRange = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["Range"].create(document.positionAt(overwriteStart), position); - } - var supportsCommitCharacters = false; //this.doesSupportsCommitCharacters(); disabled for now, waiting for new API: https://github.com/microsoft/vscode/issues/42544 - var proposed = {}; - var collector = { - add: function (suggestion) { - var label = suggestion.label; - var existing = proposed[label]; - if (!existing) { - label = label.replace(/[\n]/g, '↵'); - if (label.length > 60) { - var shortendedLabel = label.substr(0, 57).trim() + '...'; - if (!proposed[shortendedLabel]) { - label = shortendedLabel; - } - } - if (overwriteRange && suggestion.insertText !== undefined) { - suggestion.textEdit = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["TextEdit"].replace(overwriteRange, suggestion.insertText); - } - if (supportsCommitCharacters) { - suggestion.commitCharacters = suggestion.kind === _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Property ? propertyCommitCharacters : valueCommitCharacters; - } - suggestion.label = label; - proposed[label] = suggestion; - result.items.push(suggestion); - } - else if (!existing.documentation) { - existing.documentation = suggestion.documentation; - } - }, - setAsIncomplete: function () { - result.isIncomplete = true; - }, - error: function (message) { - console.error(message); - }, - log: function (message) { - console.log(message); - }, - getNumberOfProposals: function () { - return result.items.length; - } - }; - return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) { - var collectionPromises = []; - var addValue = true; - var currentKey = ''; - var currentProperty = undefined; - if (node) { - if (node.type === 'string') { - var parent = node.parent; - if (parent && parent.type === 'property' && parent.keyNode === node) { - addValue = !parent.valueNode; - currentProperty = parent; - currentKey = text.substr(node.offset + 1, node.length - 2); - if (parent) { - node = parent.parent; - } - } - } - } - // proposals for properties - if (node && node.type === 'object') { - // don't suggest keys when the cursor is just before the opening curly brace - if (node.offset === offset) { - return result; - } - // don't suggest properties that are already present - var properties = node.properties; - properties.forEach(function (p) { - if (!currentProperty || currentProperty !== p) { - proposed[p.keyNode.value] = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItem"].create('__'); - } - }); - var separatorAfter_1 = ''; - if (addValue) { - separatorAfter_1 = _this.evaluateSeparatorAfter(document, document.offsetAt(overwriteRange.end)); - } - if (schema) { - // property proposals with schema - _this.getPropertyCompletions(schema, doc, node, addValue, separatorAfter_1, collector); - } - else { - // property proposals without schema - _this.getSchemaLessPropertyCompletions(doc, node, currentKey, collector); - } - var location_1 = _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodePath"](node); - _this.contributions.forEach(function (contribution) { - var collectPromise = contribution.collectPropertyCompletions(document.uri, location_1, currentWord, addValue, separatorAfter_1 === '', collector); - if (collectPromise) { - collectionPromises.push(collectPromise); - } - }); - if ((!schema && currentWord.length > 0 && text.charAt(offset - currentWord.length - 1) !== '"')) { - collector.add({ - kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Property, - label: _this.getLabelForValue(currentWord), - insertText: _this.getInsertTextForProperty(currentWord, undefined, false, separatorAfter_1), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, documentation: '', - }); - collector.setAsIncomplete(); - } - } - // proposals for values - var types = {}; - if (schema) { - // value proposals with schema - _this.getValueCompletions(schema, doc, node, offset, document, collector, types); - } - else { - // value proposals without schema - _this.getSchemaLessValueCompletions(doc, node, offset, document, collector); - } - if (_this.contributions.length > 0) { - _this.getContributedValueCompletions(doc, node, offset, document, collector, collectionPromises); - } - return _this.promiseConstructor.all(collectionPromises).then(function () { - if (collector.getNumberOfProposals() === 0) { - var offsetForSeparator = offset; - if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { - offsetForSeparator = node.offset + node.length; - } - var separatorAfter = _this.evaluateSeparatorAfter(document, offsetForSeparator); - _this.addFillerValueCompletions(types, separatorAfter, collector); - } - return result; - }); - }); - }; - JSONCompletion.prototype.getPropertyCompletions = function (schema, doc, node, addValue, separatorAfter, collector) { - var _this = this; - var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset); - matchingSchemas.forEach(function (s) { - if (s.node === node && !s.inverted) { - var schemaProperties_1 = s.schema.properties; - if (schemaProperties_1) { - Object.keys(schemaProperties_1).forEach(function (key) { - var propertySchema = schemaProperties_1[key]; - if (typeof propertySchema === 'object' && !propertySchema.deprecationMessage && !propertySchema.doNotSuggest) { - var proposal = { - kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Property, - label: key, - insertText: _this.getInsertTextForProperty(key, propertySchema, addValue, separatorAfter), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - filterText: _this.getFilterTextForValue(key), - documentation: _this.fromMarkup(propertySchema.markdownDescription) || propertySchema.description || '', - }; - if (propertySchema.suggestSortText !== undefined) { - proposal.sortText = propertySchema.suggestSortText; - } - if (proposal.insertText && Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_3__["endsWith"])(proposal.insertText, "$1" + separatorAfter)) { - proposal.command = { - title: 'Suggest', - command: 'editor.action.triggerSuggest' - }; - } - collector.add(proposal); - } - }); - } - var schemaPropertyNames_1 = s.schema.propertyNames; - if (typeof schemaPropertyNames_1 === 'object' && !schemaPropertyNames_1.deprecationMessage && !schemaPropertyNames_1.doNotSuggest) { - var propertyNameCompletionItem = function (name, enumDescription) { - if (enumDescription === void 0) { enumDescription = undefined; } - var proposal = { - kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Property, - label: name, - insertText: _this.getInsertTextForProperty(name, undefined, addValue, separatorAfter), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - filterText: _this.getFilterTextForValue(name), - documentation: enumDescription || _this.fromMarkup(schemaPropertyNames_1.markdownDescription) || schemaPropertyNames_1.description || '', - }; - if (schemaPropertyNames_1.suggestSortText !== undefined) { - proposal.sortText = schemaPropertyNames_1.suggestSortText; - } - if (proposal.insertText && Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_3__["endsWith"])(proposal.insertText, "$1" + separatorAfter)) { - proposal.command = { - title: 'Suggest', - command: 'editor.action.triggerSuggest' - }; - } - collector.add(proposal); - }; - if (schemaPropertyNames_1.enum) { - for (var i = 0; i < schemaPropertyNames_1.enum.length; i++) { - var enumDescription = undefined; - if (schemaPropertyNames_1.markdownEnumDescriptions && i < schemaPropertyNames_1.markdownEnumDescriptions.length) { - enumDescription = _this.fromMarkup(schemaPropertyNames_1.markdownEnumDescriptions[i]); - } - else if (schemaPropertyNames_1.enumDescriptions && i < schemaPropertyNames_1.enumDescriptions.length) { - enumDescription = schemaPropertyNames_1.enumDescriptions[i]; - } - propertyNameCompletionItem(schemaPropertyNames_1.enum[i], enumDescription); - } - } - if (schemaPropertyNames_1.const) { - propertyNameCompletionItem(schemaPropertyNames_1.const); - } - } - } - }); - }; - JSONCompletion.prototype.getSchemaLessPropertyCompletions = function (doc, node, currentKey, collector) { - var _this = this; - var collectCompletionsForSimilarObject = function (obj) { - obj.properties.forEach(function (p) { - var key = p.keyNode.value; - collector.add({ - kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Property, - label: key, - insertText: _this.getInsertTextForValue(key, ''), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - filterText: _this.getFilterTextForValue(key), - documentation: '' - }); - }); - }; - if (node.parent) { - if (node.parent.type === 'property') { - // if the object is a property value, check the tree for other objects that hang under a property of the same name - var parentKey_1 = node.parent.keyNode.value; - doc.visit(function (n) { - if (n.type === 'property' && n !== node.parent && n.keyNode.value === parentKey_1 && n.valueNode && n.valueNode.type === 'object') { - collectCompletionsForSimilarObject(n.valueNode); - } - return true; - }); - } - else if (node.parent.type === 'array') { - // if the object is in an array, use all other array elements as similar objects - node.parent.items.forEach(function (n) { - if (n.type === 'object' && n !== node) { - collectCompletionsForSimilarObject(n); - } - }); - } - } - else if (node.type === 'object') { - collector.add({ - kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Property, - label: '$schema', - insertText: this.getInsertTextForProperty('$schema', undefined, true, ''), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, documentation: '', - filterText: this.getFilterTextForValue("$schema") - }); - } - }; - JSONCompletion.prototype.getSchemaLessValueCompletions = function (doc, node, offset, document, collector) { - var _this = this; - var offsetForSeparator = offset; - if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { - offsetForSeparator = node.offset + node.length; - node = node.parent; - } - if (!node) { - collector.add({ - kind: this.getSuggestionKind('object'), - label: 'Empty object', - insertText: this.getInsertTextForValue({}, ''), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - documentation: '' - }); - collector.add({ - kind: this.getSuggestionKind('array'), - label: 'Empty array', - insertText: this.getInsertTextForValue([], ''), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - documentation: '' - }); - return; - } - var separatorAfter = this.evaluateSeparatorAfter(document, offsetForSeparator); - var collectSuggestionsForValues = function (value) { - if (value.parent && !_parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["contains"](value.parent, offset, true)) { - collector.add({ - kind: _this.getSuggestionKind(value.type), - label: _this.getLabelTextForMatchingNode(value, document), - insertText: _this.getInsertTextForMatchingNode(value, document, separatorAfter), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, documentation: '' - }); - } - if (value.type === 'boolean') { - _this.addBooleanValueCompletion(!value.value, separatorAfter, collector); - } - }; - if (node.type === 'property') { - if (offset > (node.colonOffset || 0)) { - var valueNode = node.valueNode; - if (valueNode && (offset > (valueNode.offset + valueNode.length) || valueNode.type === 'object' || valueNode.type === 'array')) { - return; - } - // suggest values at the same key - var parentKey_2 = node.keyNode.value; - doc.visit(function (n) { - if (n.type === 'property' && n.keyNode.value === parentKey_2 && n.valueNode) { - collectSuggestionsForValues(n.valueNode); - } - return true; - }); - if (parentKey_2 === '$schema' && node.parent && !node.parent.parent) { - this.addDollarSchemaCompletions(separatorAfter, collector); - } - } - } - if (node.type === 'array') { - if (node.parent && node.parent.type === 'property') { - // suggest items of an array at the same key - var parentKey_3 = node.parent.keyNode.value; - doc.visit(function (n) { - if (n.type === 'property' && n.keyNode.value === parentKey_3 && n.valueNode && n.valueNode.type === 'array') { - n.valueNode.items.forEach(collectSuggestionsForValues); - } - return true; - }); - } - else { - // suggest items in the same array - node.items.forEach(collectSuggestionsForValues); - } - } - }; - JSONCompletion.prototype.getValueCompletions = function (schema, doc, node, offset, document, collector, types) { - var offsetForSeparator = offset; - var parentKey = undefined; - var valueNode = undefined; - if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { - offsetForSeparator = node.offset + node.length; - valueNode = node; - node = node.parent; - } - if (!node) { - this.addSchemaValueCompletions(schema.schema, '', collector, types); - return; - } - if ((node.type === 'property') && offset > (node.colonOffset || 0)) { - var valueNode_1 = node.valueNode; - if (valueNode_1 && offset > (valueNode_1.offset + valueNode_1.length)) { - return; // we are past the value node - } - parentKey = node.keyNode.value; - node = node.parent; - } - if (node && (parentKey !== undefined || node.type === 'array')) { - var separatorAfter = this.evaluateSeparatorAfter(document, offsetForSeparator); - var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset, valueNode); - for (var _i = 0, matchingSchemas_1 = matchingSchemas; _i < matchingSchemas_1.length; _i++) { - var s = matchingSchemas_1[_i]; - if (s.node === node && !s.inverted && s.schema) { - if (node.type === 'array' && s.schema.items) { - if (Array.isArray(s.schema.items)) { - var index = this.findItemAtOffset(node, document, offset); - if (index < s.schema.items.length) { - this.addSchemaValueCompletions(s.schema.items[index], separatorAfter, collector, types); - } - } - else { - this.addSchemaValueCompletions(s.schema.items, separatorAfter, collector, types); - } - } - if (parentKey !== undefined) { - var propertyMatched = false; - if (s.schema.properties) { - var propertySchema = s.schema.properties[parentKey]; - if (propertySchema) { - propertyMatched = true; - this.addSchemaValueCompletions(propertySchema, separatorAfter, collector, types); - } - } - if (s.schema.patternProperties && !propertyMatched) { - for (var _a = 0, _b = Object.keys(s.schema.patternProperties); _a < _b.length; _a++) { - var pattern = _b[_a]; - var regex = new RegExp(pattern); - if (regex.test(parentKey)) { - propertyMatched = true; - var propertySchema = s.schema.patternProperties[pattern]; - this.addSchemaValueCompletions(propertySchema, separatorAfter, collector, types); - } - } - } - if (s.schema.additionalProperties && !propertyMatched) { - var propertySchema = s.schema.additionalProperties; - this.addSchemaValueCompletions(propertySchema, separatorAfter, collector, types); - } - } - } - } - if (parentKey === '$schema' && !node.parent) { - this.addDollarSchemaCompletions(separatorAfter, collector); - } - if (types['boolean']) { - this.addBooleanValueCompletion(true, separatorAfter, collector); - this.addBooleanValueCompletion(false, separatorAfter, collector); - } - if (types['null']) { - this.addNullValueCompletion(separatorAfter, collector); - } - } - }; - JSONCompletion.prototype.getContributedValueCompletions = function (doc, node, offset, document, collector, collectionPromises) { - if (!node) { - this.contributions.forEach(function (contribution) { - var collectPromise = contribution.collectDefaultCompletions(document.uri, collector); - if (collectPromise) { - collectionPromises.push(collectPromise); - } - }); - } - else { - if (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null') { - node = node.parent; - } - if (node && (node.type === 'property') && offset > (node.colonOffset || 0)) { - var parentKey_4 = node.keyNode.value; - var valueNode = node.valueNode; - if ((!valueNode || offset <= (valueNode.offset + valueNode.length)) && node.parent) { - var location_2 = _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodePath"](node.parent); - this.contributions.forEach(function (contribution) { - var collectPromise = contribution.collectValueCompletions(document.uri, location_2, parentKey_4, collector); - if (collectPromise) { - collectionPromises.push(collectPromise); - } - }); - } - } - } - }; - JSONCompletion.prototype.addSchemaValueCompletions = function (schema, separatorAfter, collector, types) { - var _this = this; - if (typeof schema === 'object') { - this.addEnumValueCompletions(schema, separatorAfter, collector); - this.addDefaultValueCompletions(schema, separatorAfter, collector); - this.collectTypes(schema, types); - if (Array.isArray(schema.allOf)) { - schema.allOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); }); - } - if (Array.isArray(schema.anyOf)) { - schema.anyOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); }); - } - if (Array.isArray(schema.oneOf)) { - schema.oneOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); }); - } - } - }; - JSONCompletion.prototype.addDefaultValueCompletions = function (schema, separatorAfter, collector, arrayDepth) { - var _this = this; - if (arrayDepth === void 0) { arrayDepth = 0; } - var hasProposals = false; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(schema.default)) { - var type = schema.type; - var value = schema.default; - for (var i = arrayDepth; i > 0; i--) { - value = [value]; - type = 'array'; - } - collector.add({ - kind: this.getSuggestionKind(type), - label: this.getLabelForValue(value), - insertText: this.getInsertTextForValue(value, separatorAfter), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - detail: localize('json.suggest.default', 'Default value') - }); - hasProposals = true; - } - if (Array.isArray(schema.examples)) { - schema.examples.forEach(function (example) { - var type = schema.type; - var value = example; - for (var i = arrayDepth; i > 0; i--) { - value = [value]; - type = 'array'; - } - collector.add({ - kind: _this.getSuggestionKind(type), - label: _this.getLabelForValue(value), - insertText: _this.getInsertTextForValue(value, separatorAfter), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet - }); - hasProposals = true; - }); - } - if (Array.isArray(schema.defaultSnippets)) { - schema.defaultSnippets.forEach(function (s) { - var type = schema.type; - var value = s.body; - var label = s.label; - var insertText; - var filterText; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(value)) { - var type_1 = schema.type; - for (var i = arrayDepth; i > 0; i--) { - value = [value]; - type_1 = 'array'; - } - insertText = _this.getInsertTextForSnippetValue(value, separatorAfter); - filterText = _this.getFilterTextForSnippetValue(value); - label = label || _this.getLabelForSnippetValue(value); - } - else if (typeof s.bodyText === 'string') { - var prefix = '', suffix = '', indent = ''; - for (var i = arrayDepth; i > 0; i--) { - prefix = prefix + indent + '[\n'; - suffix = suffix + '\n' + indent + ']'; - indent += '\t'; - type = 'array'; - } - insertText = prefix + indent + s.bodyText.split('\n').join('\n' + indent) + suffix + separatorAfter; - label = label || insertText, - filterText = insertText.replace(/[\n]/g, ''); // remove new lines - } - else { - return; - } - collector.add({ - kind: _this.getSuggestionKind(type), - label: label, - documentation: _this.fromMarkup(s.markdownDescription) || s.description, - insertText: insertText, - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - filterText: filterText - }); - hasProposals = true; - }); - } - if (!hasProposals && typeof schema.items === 'object' && !Array.isArray(schema.items) && arrayDepth < 5 /* beware of recursion */) { - this.addDefaultValueCompletions(schema.items, separatorAfter, collector, arrayDepth + 1); - } - }; - JSONCompletion.prototype.addEnumValueCompletions = function (schema, separatorAfter, collector) { - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(schema.const)) { - collector.add({ - kind: this.getSuggestionKind(schema.type), - label: this.getLabelForValue(schema.const), - insertText: this.getInsertTextForValue(schema.const, separatorAfter), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - documentation: this.fromMarkup(schema.markdownDescription) || schema.description - }); - } - if (Array.isArray(schema.enum)) { - for (var i = 0, length = schema.enum.length; i < length; i++) { - var enm = schema.enum[i]; - var documentation = this.fromMarkup(schema.markdownDescription) || schema.description; - if (schema.markdownEnumDescriptions && i < schema.markdownEnumDescriptions.length && this.doesSupportMarkdown()) { - documentation = this.fromMarkup(schema.markdownEnumDescriptions[i]); - } - else if (schema.enumDescriptions && i < schema.enumDescriptions.length) { - documentation = schema.enumDescriptions[i]; - } - collector.add({ - kind: this.getSuggestionKind(schema.type), - label: this.getLabelForValue(enm), - insertText: this.getInsertTextForValue(enm, separatorAfter), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - documentation: documentation - }); - } - } - }; - JSONCompletion.prototype.collectTypes = function (schema, types) { - if (Array.isArray(schema.enum) || Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(schema.const)) { - return; - } - var type = schema.type; - if (Array.isArray(type)) { - type.forEach(function (t) { return types[t] = true; }); - } - else if (type) { - types[type] = true; - } - }; - JSONCompletion.prototype.addFillerValueCompletions = function (types, separatorAfter, collector) { - if (types['object']) { - collector.add({ - kind: this.getSuggestionKind('object'), - label: '{}', - insertText: this.getInsertTextForGuessedValue({}, separatorAfter), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - detail: localize('defaults.object', 'New object'), - documentation: '' - }); - } - if (types['array']) { - collector.add({ - kind: this.getSuggestionKind('array'), - label: '[]', - insertText: this.getInsertTextForGuessedValue([], separatorAfter), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - detail: localize('defaults.array', 'New array'), - documentation: '' - }); - } - }; - JSONCompletion.prototype.addBooleanValueCompletion = function (value, separatorAfter, collector) { - collector.add({ - kind: this.getSuggestionKind('boolean'), - label: value ? 'true' : 'false', - insertText: this.getInsertTextForValue(value, separatorAfter), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - documentation: '' - }); - }; - JSONCompletion.prototype.addNullValueCompletion = function (separatorAfter, collector) { - collector.add({ - kind: this.getSuggestionKind('null'), - label: 'null', - insertText: 'null' + separatorAfter, - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - documentation: '' - }); - }; - JSONCompletion.prototype.addDollarSchemaCompletions = function (separatorAfter, collector) { - var _this = this; - var schemaIds = this.schemaService.getRegisteredSchemaIds(function (schema) { return schema === 'http' || schema === 'https'; }); - schemaIds.forEach(function (schemaId) { return collector.add({ - kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Module, - label: _this.getLabelForValue(schemaId), - filterText: _this.getFilterTextForValue(schemaId), - insertText: _this.getInsertTextForValue(schemaId, separatorAfter), - insertTextFormat: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, documentation: '' - }); }); - }; - JSONCompletion.prototype.getLabelForValue = function (value) { - return JSON.stringify(value); - }; - JSONCompletion.prototype.getFilterTextForValue = function (value) { - return JSON.stringify(value); - }; - JSONCompletion.prototype.getFilterTextForSnippetValue = function (value) { - return JSON.stringify(value).replace(/\$\{\d+:([^}]+)\}|\$\d+/g, '$1'); - }; - JSONCompletion.prototype.getLabelForSnippetValue = function (value) { - var label = JSON.stringify(value); - return label.replace(/\$\{\d+:([^}]+)\}|\$\d+/g, '$1'); - }; - JSONCompletion.prototype.getInsertTextForPlainText = function (text) { - return text.replace(/[\\\$\}]/g, '\\$&'); // escape $, \ and } - }; - JSONCompletion.prototype.getInsertTextForValue = function (value, separatorAfter) { - var text = JSON.stringify(value, null, '\t'); - if (text === '{}') { - return '{$1}' + separatorAfter; - } - else if (text === '[]') { - return '[$1]' + separatorAfter; - } - return this.getInsertTextForPlainText(text + separatorAfter); - }; - JSONCompletion.prototype.getInsertTextForSnippetValue = function (value, separatorAfter) { - var replacer = function (value) { - if (typeof value === 'string') { - if (value[0] === '^') { - return value.substr(1); - } - } - return JSON.stringify(value); - }; - return Object(_utils_json_js__WEBPACK_IMPORTED_MODULE_2__["stringifyObject"])(value, '', replacer) + separatorAfter; - }; - JSONCompletion.prototype.getInsertTextForGuessedValue = function (value, separatorAfter) { - switch (typeof value) { - case 'object': - if (value === null) { - return '${1:null}' + separatorAfter; - } - return this.getInsertTextForValue(value, separatorAfter); - case 'string': - var snippetValue = JSON.stringify(value); - snippetValue = snippetValue.substr(1, snippetValue.length - 2); // remove quotes - snippetValue = this.getInsertTextForPlainText(snippetValue); // escape \ and } - return '"${1:' + snippetValue + '}"' + separatorAfter; - case 'number': - case 'boolean': - return '${1:' + JSON.stringify(value) + '}' + separatorAfter; - } - return this.getInsertTextForValue(value, separatorAfter); - }; - JSONCompletion.prototype.getSuggestionKind = function (type) { - if (Array.isArray(type)) { - var array = type; - type = array.length > 0 ? array[0] : undefined; - } - if (!type) { - return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Value; - } - switch (type) { - case 'string': return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Value; - case 'object': return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Module; - case 'property': return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Property; - default: return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Value; - } - }; - JSONCompletion.prototype.getLabelTextForMatchingNode = function (node, document) { - switch (node.type) { - case 'array': - return '[]'; - case 'object': - return '{}'; - default: - var content = document.getText().substr(node.offset, node.length); - return content; - } - }; - JSONCompletion.prototype.getInsertTextForMatchingNode = function (node, document, separatorAfter) { - switch (node.type) { - case 'array': - return this.getInsertTextForValue([], separatorAfter); - case 'object': - return this.getInsertTextForValue({}, separatorAfter); - default: - var content = document.getText().substr(node.offset, node.length) + separatorAfter; - return this.getInsertTextForPlainText(content); - } - }; - JSONCompletion.prototype.getInsertTextForProperty = function (key, propertySchema, addValue, separatorAfter) { - var propertyText = this.getInsertTextForValue(key, ''); - if (!addValue) { - return propertyText; - } - var resultText = propertyText + ': '; - var value; - var nValueProposals = 0; - if (propertySchema) { - if (Array.isArray(propertySchema.defaultSnippets)) { - if (propertySchema.defaultSnippets.length === 1) { - var body = propertySchema.defaultSnippets[0].body; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(body)) { - value = this.getInsertTextForSnippetValue(body, ''); - } - } - nValueProposals += propertySchema.defaultSnippets.length; - } - if (propertySchema.enum) { - if (!value && propertySchema.enum.length === 1) { - value = this.getInsertTextForGuessedValue(propertySchema.enum[0], ''); - } - nValueProposals += propertySchema.enum.length; - } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(propertySchema.default)) { - if (!value) { - value = this.getInsertTextForGuessedValue(propertySchema.default, ''); - } - nValueProposals++; - } - if (Array.isArray(propertySchema.examples) && propertySchema.examples.length) { - if (!value) { - value = this.getInsertTextForGuessedValue(propertySchema.examples[0], ''); - } - nValueProposals += propertySchema.examples.length; - } - if (nValueProposals === 0) { - var type = Array.isArray(propertySchema.type) ? propertySchema.type[0] : propertySchema.type; - if (!type) { - if (propertySchema.properties) { - type = 'object'; - } - else if (propertySchema.items) { - type = 'array'; - } - } - switch (type) { - case 'boolean': - value = '$1'; - break; - case 'string': - value = '"$1"'; - break; - case 'object': - value = '{$1}'; - break; - case 'array': - value = '[$1]'; - break; - case 'number': - case 'integer': - value = '${1:0}'; - break; - case 'null': - value = '${1:null}'; - break; - default: - return propertyText; - } - } - } - if (!value || nValueProposals > 1) { - value = '$1'; - } - return resultText + value + separatorAfter; - }; - JSONCompletion.prototype.getCurrentWord = function (document, offset) { - var i = offset - 1; - var text = document.getText(); - while (i >= 0 && ' \t\n\r\v":{[,]}'.indexOf(text.charAt(i)) === -1) { - i--; - } - return text.substring(i + 1, offset); - }; - JSONCompletion.prototype.evaluateSeparatorAfter = function (document, offset) { - var scanner = _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"](document.getText(), true); - scanner.setPosition(offset); - var token = scanner.scan(); - switch (token) { - case 5 /* CommaToken */: - case 2 /* CloseBraceToken */: - case 4 /* CloseBracketToken */: - case 17 /* EOF */: - return ''; - default: - return ','; - } - }; - JSONCompletion.prototype.findItemAtOffset = function (node, document, offset) { - var scanner = _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"](document.getText(), true); - var children = node.items; - for (var i = children.length - 1; i >= 0; i--) { - var child = children[i]; - if (offset > child.offset + child.length) { - scanner.setPosition(child.offset + child.length); - var token = scanner.scan(); - if (token === 5 /* CommaToken */ && offset >= scanner.getTokenOffset() + scanner.getTokenLength()) { - return i + 1; - } - return i; - } - else if (offset >= child.offset) { - return i; - } - } - return 0; - }; - JSONCompletion.prototype.isInComment = function (document, start, offset) { - var scanner = _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"](document.getText(), false); - scanner.setPosition(start); - var token = scanner.scan(); - while (token !== 17 /* EOF */ && (scanner.getTokenOffset() + scanner.getTokenLength() < offset)) { - token = scanner.scan(); - } - return (token === 12 /* LineCommentTrivia */ || token === 13 /* BlockCommentTrivia */) && scanner.getTokenOffset() <= offset; - }; - JSONCompletion.prototype.fromMarkup = function (markupString) { - if (markupString && this.doesSupportMarkdown()) { - return { - kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["MarkupKind"].Markdown, - value: markupString - }; - } - return undefined; - }; - JSONCompletion.prototype.doesSupportMarkdown = function () { - if (!Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(this.supportsMarkdown)) { - var completion = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.completion; - this.supportsMarkdown = completion && completion.completionItem && Array.isArray(completion.completionItem.documentationFormat) && completion.completionItem.documentationFormat.indexOf(_jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_5__["MarkupKind"].Markdown) !== -1; - } - return this.supportsMarkdown; - }; - JSONCompletion.prototype.doesSupportsCommitCharacters = function () { - if (!Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(this.supportsCommitCharacters)) { - var completion = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.completion; - this.supportsCommitCharacters = completion && completion.completionItem && !!completion.completionItem.commitCharactersSupport; - } - return this.supportsCommitCharacters; - }; - return JSONCompletion; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDefinition.js": -/*!**********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDefinition.js ***! - \**********************************************************************************************************************/ -/*! exports provided: findDefinition */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findDefinition", function() { return findDefinition; }); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -function findDefinition(document, position, doc) { - var offset = document.offsetAt(position); - var node = doc.getNodeFromOffset(offset, true); - if (!node || !isRef(node)) { - return Promise.resolve([]); - } - var propertyNode = node.parent; - var valueNode = propertyNode.valueNode; - var path = valueNode.value; - var targetNode = findTargetNode(doc, path); - if (!targetNode) { - return Promise.resolve([]); - } - var definition = { - targetUri: document.uri, - originSelectionRange: createRange(document, valueNode), - targetRange: createRange(document, targetNode), - targetSelectionRange: createRange(document, targetNode) - }; - return Promise.resolve([definition]); -} -function createRange(document, node) { - return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(document.positionAt(node.offset), document.positionAt(node.offset + node.length)); -} -function isRef(node) { - return node.type === 'string' && - node.parent && - node.parent.type === 'property' && - node.parent.valueNode === node && - node.parent.keyNode.value === "$ref" || - false; -} -function findTargetNode(doc, path) { - var tokens = parseJSONPointer(path); - if (!tokens) { - return null; - } - return findNode(tokens, doc.root); -} -function findNode(pointer, node) { - if (!node) { - return null; - } - if (pointer.length === 0) { - return node; - } - var token = pointer.shift(); - if (node && node.type === 'object') { - var propertyNode = node.properties.find(function (propertyNode) { return propertyNode.keyNode.value === token; }); - if (!propertyNode) { - return null; - } - return findNode(pointer, propertyNode.valueNode); - } - else if (node && node.type === 'array') { - if (token.match(/^(0|[1-9][0-9]*)$/)) { - var index = Number.parseInt(token); - var arrayItem = node.items[index]; - if (!arrayItem) { - return null; - } - return findNode(pointer, arrayItem); - } - } - return null; -} -function parseJSONPointer(path) { - if (path === "#") { - return []; - } - if (path[0] !== '#' || path[1] !== '/') { - return null; - } - return path.substring(2).split(/\//).map(unescape); -} -function unescape(str) { - return str.replace(/~1/g, '/').replace(/~0/g, '~'); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDocumentSymbols.js": -/*!***************************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDocumentSymbols.js ***! - \***************************************************************************************************************************/ -/*! exports provided: JSONDocumentSymbols */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONDocumentSymbols", function() { return JSONDocumentSymbols; }); -/* harmony import */ var _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/jsonParser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js"); -/* harmony import */ var _utils_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/strings.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js"); -/* harmony import */ var _utils_colors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/colors.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/colors.js"); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -var JSONDocumentSymbols = /** @class */ (function () { - function JSONDocumentSymbols(schemaService) { - this.schemaService = schemaService; - } - JSONDocumentSymbols.prototype.findDocumentSymbols = function (document, doc, context) { - var _this = this; - if (context === void 0) { context = { resultLimit: Number.MAX_VALUE }; } - var root = doc.root; - if (!root) { - return []; - } - var limit = context.resultLimit || Number.MAX_VALUE; - // special handling for key bindings - var resourceString = document.uri; - if ((resourceString === 'vscode://defaultsettings/keybindings.json') || _utils_strings_js__WEBPACK_IMPORTED_MODULE_1__["endsWith"](resourceString.toLowerCase(), '/user/keybindings.json')) { - if (root.type === 'array') { - var result_1 = []; - for (var _i = 0, _a = root.items; _i < _a.length; _i++) { - var item = _a[_i]; - if (item.type === 'object') { - for (var _b = 0, _c = item.properties; _b < _c.length; _b++) { - var property = _c[_b]; - if (property.keyNode.value === 'key' && property.valueNode) { - var location = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["Location"].create(document.uri, getRange(document, item)); - result_1.push({ name: _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodeValue"](property.valueNode), kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Function, location: location }); - limit--; - if (limit <= 0) { - if (context && context.onResultLimitExceeded) { - context.onResultLimitExceeded(resourceString); - } - return result_1; - } - } - } - } - } - return result_1; - } - } - var toVisit = [ - { node: root, containerName: '' } - ]; - var nextToVisit = 0; - var limitExceeded = false; - var result = []; - var collectOutlineEntries = function (node, containerName) { - if (node.type === 'array') { - node.items.forEach(function (node) { - if (node) { - toVisit.push({ node: node, containerName: containerName }); - } - }); - } - else if (node.type === 'object') { - node.properties.forEach(function (property) { - var valueNode = property.valueNode; - if (valueNode) { - if (limit > 0) { - limit--; - var location = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["Location"].create(document.uri, getRange(document, property)); - var childContainerName = containerName ? containerName + '.' + property.keyNode.value : property.keyNode.value; - result.push({ name: _this.getKeyLabel(property), kind: _this.getSymbolKind(valueNode.type), location: location, containerName: containerName }); - toVisit.push({ node: valueNode, containerName: childContainerName }); - } - else { - limitExceeded = true; - } - } - }); - } - }; - // breath first traversal - while (nextToVisit < toVisit.length) { - var next = toVisit[nextToVisit++]; - collectOutlineEntries(next.node, next.containerName); - } - if (limitExceeded && context && context.onResultLimitExceeded) { - context.onResultLimitExceeded(resourceString); - } - return result; - }; - JSONDocumentSymbols.prototype.findDocumentSymbols2 = function (document, doc, context) { - var _this = this; - if (context === void 0) { context = { resultLimit: Number.MAX_VALUE }; } - var root = doc.root; - if (!root) { - return []; - } - var limit = context.resultLimit || Number.MAX_VALUE; - // special handling for key bindings - var resourceString = document.uri; - if ((resourceString === 'vscode://defaultsettings/keybindings.json') || _utils_strings_js__WEBPACK_IMPORTED_MODULE_1__["endsWith"](resourceString.toLowerCase(), '/user/keybindings.json')) { - if (root.type === 'array') { - var result_2 = []; - for (var _i = 0, _a = root.items; _i < _a.length; _i++) { - var item = _a[_i]; - if (item.type === 'object') { - for (var _b = 0, _c = item.properties; _b < _c.length; _b++) { - var property = _c[_b]; - if (property.keyNode.value === 'key' && property.valueNode) { - var range = getRange(document, item); - var selectionRange = getRange(document, property.keyNode); - result_2.push({ name: _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodeValue"](property.valueNode), kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Function, range: range, selectionRange: selectionRange }); - limit--; - if (limit <= 0) { - if (context && context.onResultLimitExceeded) { - context.onResultLimitExceeded(resourceString); - } - return result_2; - } - } - } - } - } - return result_2; - } - } - var result = []; - var toVisit = [ - { node: root, result: result } - ]; - var nextToVisit = 0; - var limitExceeded = false; - var collectOutlineEntries = function (node, result) { - if (node.type === 'array') { - node.items.forEach(function (node, index) { - if (node) { - if (limit > 0) { - limit--; - var range = getRange(document, node); - var selectionRange = range; - var name = String(index); - var symbol = { name: name, kind: _this.getSymbolKind(node.type), range: range, selectionRange: selectionRange, children: [] }; - result.push(symbol); - toVisit.push({ result: symbol.children, node: node }); - } - else { - limitExceeded = true; - } - } - }); - } - else if (node.type === 'object') { - node.properties.forEach(function (property) { - var valueNode = property.valueNode; - if (valueNode) { - if (limit > 0) { - limit--; - var range = getRange(document, property); - var selectionRange = getRange(document, property.keyNode); - var symbol = { name: _this.getKeyLabel(property), kind: _this.getSymbolKind(valueNode.type), range: range, selectionRange: selectionRange, children: [] }; - result.push(symbol); - toVisit.push({ result: symbol.children, node: valueNode }); - } - else { - limitExceeded = true; - } - } - }); - } - }; - // breath first traversal - while (nextToVisit < toVisit.length) { - var next = toVisit[nextToVisit++]; - collectOutlineEntries(next.node, next.result); - } - if (limitExceeded && context && context.onResultLimitExceeded) { - context.onResultLimitExceeded(resourceString); - } - return result; - }; - JSONDocumentSymbols.prototype.getSymbolKind = function (nodeType) { - switch (nodeType) { - case 'object': - return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Module; - case 'string': - return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].String; - case 'number': - return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Number; - case 'array': - return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Array; - case 'boolean': - return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Boolean; - default: // 'null' - return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Variable; - } - }; - JSONDocumentSymbols.prototype.getKeyLabel = function (property) { - var name = property.keyNode.value; - if (name) { - name = name.replace(/[\n]/g, '↵'); - } - if (name && name.trim()) { - return name; - } - return "\"" + name + "\""; - }; - JSONDocumentSymbols.prototype.findDocumentColors = function (document, doc, context) { - return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) { - var result = []; - if (schema) { - var limit = context && typeof context.resultLimit === 'number' ? context.resultLimit : Number.MAX_VALUE; - var matchingSchemas = doc.getMatchingSchemas(schema.schema); - var visitedNode = {}; - for (var _i = 0, matchingSchemas_1 = matchingSchemas; _i < matchingSchemas_1.length; _i++) { - var s = matchingSchemas_1[_i]; - if (!s.inverted && s.schema && (s.schema.format === 'color' || s.schema.format === 'color-hex') && s.node && s.node.type === 'string') { - var nodeId = String(s.node.offset); - if (!visitedNode[nodeId]) { - var color = Object(_utils_colors_js__WEBPACK_IMPORTED_MODULE_2__["colorFromHex"])(_parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodeValue"](s.node)); - if (color) { - var range = getRange(document, s.node); - result.push({ color: color, range: range }); - } - visitedNode[nodeId] = true; - limit--; - if (limit <= 0) { - if (context && context.onResultLimitExceeded) { - context.onResultLimitExceeded(document.uri); - } - return result; - } - } - } - } - } - return result; - }); - }; - JSONDocumentSymbols.prototype.getColorPresentations = function (document, doc, color, range) { - var result = []; - var red256 = Math.round(color.red * 255), green256 = Math.round(color.green * 255), blue256 = Math.round(color.blue * 255); - function toTwoDigitHex(n) { - var r = n.toString(16); - return r.length !== 2 ? '0' + r : r; - } - var label; - if (color.alpha === 1) { - label = "#" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256); - } - else { - label = "#" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256) + toTwoDigitHex(Math.round(color.alpha * 255)); - } - result.push({ label: label, textEdit: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["TextEdit"].replace(range, JSON.stringify(label)) }); - return result; - }; - return JSONDocumentSymbols; -}()); - -function getRange(document, node) { - return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["Range"].create(document.positionAt(node.offset), document.positionAt(node.offset + node.length)); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonFolding.js": -/*!*******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonFolding.js ***! - \*******************************************************************************************************************/ -/*! exports provided: getFoldingRanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFoldingRanges", function() { return getFoldingRanges; }); -/* harmony import */ var _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jsonc-parser/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js"); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -function getFoldingRanges(document, context) { - var ranges = []; - var nestingLevels = []; - var stack = []; - var prevStart = -1; - var scanner = Object(_jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__["createScanner"])(document.getText(), false); - var token = scanner.scan(); - function addRange(range) { - ranges.push(range); - nestingLevels.push(stack.length); - } - while (token !== 17 /* EOF */) { - switch (token) { - case 1 /* OpenBraceToken */: - case 3 /* OpenBracketToken */: { - var startLine = document.positionAt(scanner.getTokenOffset()).line; - var range = { startLine: startLine, endLine: startLine, kind: token === 1 /* OpenBraceToken */ ? 'object' : 'array' }; - stack.push(range); - break; - } - case 2 /* CloseBraceToken */: - case 4 /* CloseBracketToken */: { - var kind = token === 2 /* CloseBraceToken */ ? 'object' : 'array'; - if (stack.length > 0 && stack[stack.length - 1].kind === kind) { - var range = stack.pop(); - var line = document.positionAt(scanner.getTokenOffset()).line; - if (range && line > range.startLine + 1 && prevStart !== range.startLine) { - range.endLine = line - 1; - addRange(range); - prevStart = range.startLine; - } - } - break; - } - case 13 /* BlockCommentTrivia */: { - var startLine = document.positionAt(scanner.getTokenOffset()).line; - var endLine = document.positionAt(scanner.getTokenOffset() + scanner.getTokenLength()).line; - if (scanner.getTokenError() === 1 /* UnexpectedEndOfComment */ && startLine + 1 < document.lineCount) { - scanner.setPosition(document.offsetAt(_jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["Position"].create(startLine + 1, 0))); - } - else { - if (startLine < endLine) { - addRange({ startLine: startLine, endLine: endLine, kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["FoldingRangeKind"].Comment }); - prevStart = startLine; - } - } - break; - } - case 12 /* LineCommentTrivia */: { - var text = document.getText().substr(scanner.getTokenOffset(), scanner.getTokenLength()); - var m = text.match(/^\/\/\s*#(region\b)|(endregion\b)/); - if (m) { - var line = document.positionAt(scanner.getTokenOffset()).line; - if (m[1]) { // start pattern match - var range = { startLine: line, endLine: line, kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["FoldingRangeKind"].Region }; - stack.push(range); - } - else { - var i = stack.length - 1; - while (i >= 0 && stack[i].kind !== _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["FoldingRangeKind"].Region) { - i--; - } - if (i >= 0) { - var range = stack[i]; - stack.length = i; - if (line > range.startLine && prevStart !== range.startLine) { - range.endLine = line; - addRange(range); - prevStart = range.startLine; - } - } - } - } - break; - } - } - token = scanner.scan(); - } - var rangeLimit = context && context.rangeLimit; - if (typeof rangeLimit !== 'number' || ranges.length <= rangeLimit) { - return ranges; - } - if (context && context.onRangeLimitExceeded) { - context.onRangeLimitExceeded(document.uri); - } - var counts = []; - for (var _i = 0, nestingLevels_1 = nestingLevels; _i < nestingLevels_1.length; _i++) { - var level = nestingLevels_1[_i]; - if (level < 30) { - counts[level] = (counts[level] || 0) + 1; - } - } - var entries = 0; - var maxLevel = 0; - for (var i = 0; i < counts.length; i++) { - var n = counts[i]; - if (n) { - if (n + entries > rangeLimit) { - maxLevel = i; - break; - } - entries += n; - } - } - var result = []; - for (var i = 0; i < ranges.length; i++) { - var level = nestingLevels[i]; - if (typeof level === 'number') { - if (level < maxLevel || (level === maxLevel && entries++ < rangeLimit)) { - result.push(ranges[i]); - } - } - } - return result; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonHover.js": -/*!*****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonHover.js ***! - \*****************************************************************************************************************/ -/*! exports provided: JSONHover */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONHover", function() { return JSONHover; }); -/* harmony import */ var _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/jsonParser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js"); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -var JSONHover = /** @class */ (function () { - function JSONHover(schemaService, contributions, promiseConstructor) { - if (contributions === void 0) { contributions = []; } - this.schemaService = schemaService; - this.contributions = contributions; - this.promise = promiseConstructor || Promise; - } - JSONHover.prototype.doHover = function (document, position, doc) { - var offset = document.offsetAt(position); - var node = doc.getNodeFromOffset(offset); - if (!node || (node.type === 'object' || node.type === 'array') && offset > node.offset + 1 && offset < node.offset + node.length - 1) { - return this.promise.resolve(null); - } - var hoverRangeNode = node; - // use the property description when hovering over an object key - if (node.type === 'string') { - var parent = node.parent; - if (parent && parent.type === 'property' && parent.keyNode === node) { - node = parent.valueNode; - if (!node) { - return this.promise.resolve(null); - } - } - } - var hoverRange = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["Range"].create(document.positionAt(hoverRangeNode.offset), document.positionAt(hoverRangeNode.offset + hoverRangeNode.length)); - var createHover = function (contents) { - var result = { - contents: contents, - range: hoverRange - }; - return result; - }; - var location = _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodePath"](node); - for (var i = this.contributions.length - 1; i >= 0; i--) { - var contribution = this.contributions[i]; - var promise = contribution.getInfoContribution(document.uri, location); - if (promise) { - return promise.then(function (htmlContent) { return createHover(htmlContent); }); - } - } - return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) { - if (schema && node) { - var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset); - var title_1 = undefined; - var markdownDescription_1 = undefined; - var markdownEnumValueDescription_1 = undefined, enumValue_1 = undefined; - matchingSchemas.every(function (s) { - if (s.node === node && !s.inverted && s.schema) { - title_1 = title_1 || s.schema.title; - markdownDescription_1 = markdownDescription_1 || s.schema.markdownDescription || toMarkdown(s.schema.description); - if (s.schema.enum) { - var idx = s.schema.enum.indexOf(_parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodeValue"](node)); - if (s.schema.markdownEnumDescriptions) { - markdownEnumValueDescription_1 = s.schema.markdownEnumDescriptions[idx]; - } - else if (s.schema.enumDescriptions) { - markdownEnumValueDescription_1 = toMarkdown(s.schema.enumDescriptions[idx]); - } - if (markdownEnumValueDescription_1) { - enumValue_1 = s.schema.enum[idx]; - if (typeof enumValue_1 !== 'string') { - enumValue_1 = JSON.stringify(enumValue_1); - } - } - } - } - return true; - }); - var result = ''; - if (title_1) { - result = toMarkdown(title_1); - } - if (markdownDescription_1) { - if (result.length > 0) { - result += "\n\n"; - } - result += markdownDescription_1; - } - if (markdownEnumValueDescription_1) { - if (result.length > 0) { - result += "\n\n"; - } - result += "`" + toMarkdownCodeBlock(enumValue_1) + "`: " + markdownEnumValueDescription_1; - } - return createHover([result]); - } - return null; - }); - }; - return JSONHover; -}()); - -function toMarkdown(plain) { - if (plain) { - var res = plain.replace(/([^\n\r])(\r?\n)([^\n\r])/gm, '$1\n\n$3'); // single new lines to \n\n (Markdown paragraph) - return res.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&"); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash - } - return undefined; -} -function toMarkdownCodeBlock(content) { - // see https://daringfireball.net/projects/markdown/syntax#precode - if (content.indexOf('`') !== -1) { - return '`` ' + content + ' ``'; - } - return content; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSchemaService.js": -/*!*************************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSchemaService.js ***! - \*************************************************************************************************************************/ -/*! exports provided: UnresolvedSchema, ResolvedSchema, JSONSchemaService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnresolvedSchema", function() { return UnresolvedSchema; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedSchema", function() { return ResolvedSchema; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONSchemaService", function() { return JSONSchemaService; }); -/* harmony import */ var _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jsonc-parser/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js"); -/* harmony import */ var _vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../vscode-uri/index.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-uri/index.js"); -/* harmony import */ var _utils_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/strings.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js"); -/* harmony import */ var _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../parser/jsonParser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_4__["loadMessageBundle"](); -var FilePatternAssociation = /** @class */ (function () { - function FilePatternAssociation(pattern, uris) { - this.patternRegExps = []; - this.isInclude = []; - try { - for (var _i = 0, pattern_1 = pattern; _i < pattern_1.length; _i++) { - var p = pattern_1[_i]; - var include = p[0] !== '!'; - if (!include) { - p = p.substring(1); - } - this.patternRegExps.push(new RegExp(_utils_strings_js__WEBPACK_IMPORTED_MODULE_2__["convertSimple2RegExpPattern"](p) + '$')); - this.isInclude.push(include); - } - this.uris = uris; - } - catch (e) { - // invalid pattern - this.patternRegExps.length = 0; - this.isInclude.length = 0; - this.uris = []; - } - } - FilePatternAssociation.prototype.matchesPattern = function (fileName) { - var match = false; - for (var i = 0; i < this.patternRegExps.length; i++) { - var regExp = this.patternRegExps[i]; - if (regExp.test(fileName)) { - match = this.isInclude[i]; - } - } - return match; - }; - FilePatternAssociation.prototype.getURIs = function () { - return this.uris; - }; - return FilePatternAssociation; -}()); -var SchemaHandle = /** @class */ (function () { - function SchemaHandle(service, url, unresolvedSchemaContent) { - this.service = service; - this.url = url; - this.dependencies = {}; - if (unresolvedSchemaContent) { - this.unresolvedSchema = this.service.promise.resolve(new UnresolvedSchema(unresolvedSchemaContent)); - } - } - SchemaHandle.prototype.getUnresolvedSchema = function () { - if (!this.unresolvedSchema) { - this.unresolvedSchema = this.service.loadSchema(this.url); - } - return this.unresolvedSchema; - }; - SchemaHandle.prototype.getResolvedSchema = function () { - var _this = this; - if (!this.resolvedSchema) { - this.resolvedSchema = this.getUnresolvedSchema().then(function (unresolved) { - return _this.service.resolveSchemaContent(unresolved, _this.url, _this.dependencies); - }); - } - return this.resolvedSchema; - }; - SchemaHandle.prototype.clearSchema = function () { - this.resolvedSchema = undefined; - this.unresolvedSchema = undefined; - this.dependencies = {}; - }; - return SchemaHandle; -}()); -var UnresolvedSchema = /** @class */ (function () { - function UnresolvedSchema(schema, errors) { - if (errors === void 0) { errors = []; } - this.schema = schema; - this.errors = errors; - } - return UnresolvedSchema; -}()); - -var ResolvedSchema = /** @class */ (function () { - function ResolvedSchema(schema, errors) { - if (errors === void 0) { errors = []; } - this.schema = schema; - this.errors = errors; - } - ResolvedSchema.prototype.getSection = function (path) { - var schemaRef = this.getSectionRecursive(path, this.schema); - if (schemaRef) { - return _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_3__["asSchema"](schemaRef); - } - return undefined; - }; - ResolvedSchema.prototype.getSectionRecursive = function (path, schema) { - if (!schema || typeof schema === 'boolean' || path.length === 0) { - return schema; - } - var next = path.shift(); - if (schema.properties && typeof schema.properties[next]) { - return this.getSectionRecursive(path, schema.properties[next]); - } - else if (schema.patternProperties) { - for (var _i = 0, _a = Object.keys(schema.patternProperties); _i < _a.length; _i++) { - var pattern = _a[_i]; - var regex = new RegExp(pattern); - if (regex.test(next)) { - return this.getSectionRecursive(path, schema.patternProperties[pattern]); - } - } - } - else if (typeof schema.additionalProperties === 'object') { - return this.getSectionRecursive(path, schema.additionalProperties); - } - else if (next.match('[0-9]+')) { - if (Array.isArray(schema.items)) { - var index = parseInt(next, 10); - if (!isNaN(index) && schema.items[index]) { - return this.getSectionRecursive(path, schema.items[index]); - } - } - else if (schema.items) { - return this.getSectionRecursive(path, schema.items); - } - } - return undefined; - }; - return ResolvedSchema; -}()); - -var JSONSchemaService = /** @class */ (function () { - function JSONSchemaService(requestService, contextService, promiseConstructor) { - this.contextService = contextService; - this.requestService = requestService; - this.promiseConstructor = promiseConstructor || Promise; - this.callOnDispose = []; - this.contributionSchemas = {}; - this.contributionAssociations = []; - this.schemasById = {}; - this.filePatternAssociations = []; - this.registeredSchemasIds = {}; - } - JSONSchemaService.prototype.getRegisteredSchemaIds = function (filter) { - return Object.keys(this.registeredSchemasIds).filter(function (id) { - var scheme = _vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_1__["URI"].parse(id).scheme; - return scheme !== 'schemaservice' && (!filter || filter(scheme)); - }); - }; - Object.defineProperty(JSONSchemaService.prototype, "promise", { - get: function () { - return this.promiseConstructor; - }, - enumerable: false, - configurable: true - }); - JSONSchemaService.prototype.dispose = function () { - while (this.callOnDispose.length > 0) { - this.callOnDispose.pop()(); - } - }; - JSONSchemaService.prototype.onResourceChange = function (uri) { - var _this = this; - var hasChanges = false; - uri = normalizeId(uri); - var toWalk = [uri]; - var all = Object.keys(this.schemasById).map(function (key) { return _this.schemasById[key]; }); - while (toWalk.length) { - var curr = toWalk.pop(); - for (var i = 0; i < all.length; i++) { - var handle = all[i]; - if (handle && (handle.url === curr || handle.dependencies[curr])) { - if (handle.url !== curr) { - toWalk.push(handle.url); - } - handle.clearSchema(); - all[i] = undefined; - hasChanges = true; - } - } - } - return hasChanges; - }; - JSONSchemaService.prototype.setSchemaContributions = function (schemaContributions) { - if (schemaContributions.schemas) { - var schemas = schemaContributions.schemas; - for (var id in schemas) { - var normalizedId = normalizeId(id); - this.contributionSchemas[normalizedId] = this.addSchemaHandle(normalizedId, schemas[id]); - } - } - if (Array.isArray(schemaContributions.schemaAssociations)) { - var schemaAssociations = schemaContributions.schemaAssociations; - for (var _i = 0, schemaAssociations_1 = schemaAssociations; _i < schemaAssociations_1.length; _i++) { - var schemaAssociation = schemaAssociations_1[_i]; - var uris = schemaAssociation.uris.map(normalizeId); - var association = this.addFilePatternAssociation(schemaAssociation.pattern, uris); - this.contributionAssociations.push(association); - } - } - }; - JSONSchemaService.prototype.addSchemaHandle = function (id, unresolvedSchemaContent) { - var schemaHandle = new SchemaHandle(this, id, unresolvedSchemaContent); - this.schemasById[id] = schemaHandle; - return schemaHandle; - }; - JSONSchemaService.prototype.getOrAddSchemaHandle = function (id, unresolvedSchemaContent) { - return this.schemasById[id] || this.addSchemaHandle(id, unresolvedSchemaContent); - }; - JSONSchemaService.prototype.addFilePatternAssociation = function (pattern, uris) { - var fpa = new FilePatternAssociation(pattern, uris); - this.filePatternAssociations.push(fpa); - return fpa; - }; - JSONSchemaService.prototype.registerExternalSchema = function (uri, filePatterns, unresolvedSchemaContent) { - var id = normalizeId(uri); - this.registeredSchemasIds[id] = true; - this.cachedSchemaForResource = undefined; - if (filePatterns) { - this.addFilePatternAssociation(filePatterns, [uri]); - } - return unresolvedSchemaContent ? this.addSchemaHandle(id, unresolvedSchemaContent) : this.getOrAddSchemaHandle(id); - }; - JSONSchemaService.prototype.clearExternalSchemas = function () { - this.schemasById = {}; - this.filePatternAssociations = []; - this.registeredSchemasIds = {}; - this.cachedSchemaForResource = undefined; - for (var id in this.contributionSchemas) { - this.schemasById[id] = this.contributionSchemas[id]; - this.registeredSchemasIds[id] = true; - } - for (var _i = 0, _a = this.contributionAssociations; _i < _a.length; _i++) { - var contributionAssociation = _a[_i]; - this.filePatternAssociations.push(contributionAssociation); - } - }; - JSONSchemaService.prototype.getResolvedSchema = function (schemaId) { - var id = normalizeId(schemaId); - var schemaHandle = this.schemasById[id]; - if (schemaHandle) { - return schemaHandle.getResolvedSchema(); - } - return this.promise.resolve(undefined); - }; - JSONSchemaService.prototype.loadSchema = function (url) { - if (!this.requestService) { - var errorMessage = localize('json.schema.norequestservice', 'Unable to load schema from \'{0}\'. No schema request service available', toDisplayString(url)); - return this.promise.resolve(new UnresolvedSchema({}, [errorMessage])); - } - return this.requestService(url).then(function (content) { - if (!content) { - var errorMessage = localize('json.schema.nocontent', 'Unable to load schema from \'{0}\': No content.', toDisplayString(url)); - return new UnresolvedSchema({}, [errorMessage]); - } - var schemaContent = {}; - var jsonErrors = []; - schemaContent = _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__["parse"](content, jsonErrors); - var errors = jsonErrors.length ? [localize('json.schema.invalidFormat', 'Unable to parse content from \'{0}\': Parse error at offset {1}.', toDisplayString(url), jsonErrors[0].offset)] : []; - return new UnresolvedSchema(schemaContent, errors); - }, function (error) { - var errorMessage = error.toString(); - var errorSplit = error.toString().split('Error: '); - if (errorSplit.length > 1) { - // more concise error message, URL and context are attached by caller anyways - errorMessage = errorSplit[1]; - } - if (_utils_strings_js__WEBPACK_IMPORTED_MODULE_2__["endsWith"](errorMessage, '.')) { - errorMessage = errorMessage.substr(0, errorMessage.length - 1); - } - return new UnresolvedSchema({}, [localize('json.schema.nocontent', 'Unable to load schema from \'{0}\': {1}.', toDisplayString(url), errorMessage)]); - }); - }; - JSONSchemaService.prototype.resolveSchemaContent = function (schemaToResolve, schemaURL, dependencies) { - var _this = this; - var resolveErrors = schemaToResolve.errors.slice(0); - var schema = schemaToResolve.schema; - if (schema.$schema) { - var id = normalizeId(schema.$schema); - if (id === 'http://json-schema.org/draft-03/schema') { - return this.promise.resolve(new ResolvedSchema({}, [localize('json.schema.draft03.notsupported', "Draft-03 schemas are not supported.")])); - } - else if (id === 'https://json-schema.org/draft/2019-09/schema') { - resolveErrors.push(localize('json.schema.draft201909.notsupported', "Draft 2019-09 schemas are not yet fully supported.")); - } - } - var contextService = this.contextService; - var findSection = function (schema, path) { - if (!path) { - return schema; - } - var current = schema; - if (path[0] === '/') { - path = path.substr(1); - } - path.split('/').some(function (part) { - current = current[part]; - return !current; - }); - return current; - }; - var merge = function (target, sourceRoot, sourceURI, refSegment) { - var path = refSegment ? decodeURIComponent(refSegment) : undefined; - var section = findSection(sourceRoot, path); - if (section) { - for (var key in section) { - if (section.hasOwnProperty(key) && !target.hasOwnProperty(key)) { - target[key] = section[key]; - } - } - } - else { - resolveErrors.push(localize('json.schema.invalidref', '$ref \'{0}\' in \'{1}\' can not be resolved.', path, sourceURI)); - } - }; - var resolveExternalLink = function (node, uri, refSegment, parentSchemaURL, parentSchemaDependencies) { - if (contextService && !/^\w+:\/\/.*/.test(uri)) { - uri = contextService.resolveRelativePath(uri, parentSchemaURL); - } - uri = normalizeId(uri); - var referencedHandle = _this.getOrAddSchemaHandle(uri); - return referencedHandle.getUnresolvedSchema().then(function (unresolvedSchema) { - parentSchemaDependencies[uri] = true; - if (unresolvedSchema.errors.length) { - var loc = refSegment ? uri + '#' + refSegment : uri; - resolveErrors.push(localize('json.schema.problemloadingref', 'Problems loading reference \'{0}\': {1}', loc, unresolvedSchema.errors[0])); - } - merge(node, unresolvedSchema.schema, uri, refSegment); - return resolveRefs(node, unresolvedSchema.schema, uri, referencedHandle.dependencies); - }); - }; - var resolveRefs = function (node, parentSchema, parentSchemaURL, parentSchemaDependencies) { - if (!node || typeof node !== 'object') { - return Promise.resolve(null); - } - var toWalk = [node]; - var seen = []; - var openPromises = []; - var collectEntries = function () { - var entries = []; - for (var _i = 0; _i < arguments.length; _i++) { - entries[_i] = arguments[_i]; - } - for (var _a = 0, entries_1 = entries; _a < entries_1.length; _a++) { - var entry = entries_1[_a]; - if (typeof entry === 'object') { - toWalk.push(entry); - } - } - }; - var collectMapEntries = function () { - var maps = []; - for (var _i = 0; _i < arguments.length; _i++) { - maps[_i] = arguments[_i]; - } - for (var _a = 0, maps_1 = maps; _a < maps_1.length; _a++) { - var map = maps_1[_a]; - if (typeof map === 'object') { - for (var k in map) { - var key = k; - var entry = map[key]; - if (typeof entry === 'object') { - toWalk.push(entry); - } - } - } - } - }; - var collectArrayEntries = function () { - var arrays = []; - for (var _i = 0; _i < arguments.length; _i++) { - arrays[_i] = arguments[_i]; - } - for (var _a = 0, arrays_1 = arrays; _a < arrays_1.length; _a++) { - var array = arrays_1[_a]; - if (Array.isArray(array)) { - for (var _b = 0, array_1 = array; _b < array_1.length; _b++) { - var entry = array_1[_b]; - if (typeof entry === 'object') { - toWalk.push(entry); - } - } - } - } - }; - var handleRef = function (next) { - var seenRefs = []; - while (next.$ref) { - var ref = next.$ref; - var segments = ref.split('#', 2); - delete next.$ref; - if (segments[0].length > 0) { - openPromises.push(resolveExternalLink(next, segments[0], segments[1], parentSchemaURL, parentSchemaDependencies)); - return; - } - else { - if (seenRefs.indexOf(ref) === -1) { - merge(next, parentSchema, parentSchemaURL, segments[1]); // can set next.$ref again, use seenRefs to avoid circle - seenRefs.push(ref); - } - } - } - collectEntries(next.items, next.additionalItems, next.additionalProperties, next.not, next.contains, next.propertyNames, next.if, next.then, next.else); - collectMapEntries(next.definitions, next.properties, next.patternProperties, next.dependencies); - collectArrayEntries(next.anyOf, next.allOf, next.oneOf, next.items); - }; - while (toWalk.length) { - var next = toWalk.pop(); - if (seen.indexOf(next) >= 0) { - continue; - } - seen.push(next); - handleRef(next); - } - return _this.promise.all(openPromises); - }; - return resolveRefs(schema, schema, schemaURL, dependencies).then(function (_) { return new ResolvedSchema(schema, resolveErrors); }); - }; - JSONSchemaService.prototype.getSchemaForResource = function (resource, document) { - // first use $schema if present - if (document && document.root && document.root.type === 'object') { - var schemaProperties = document.root.properties.filter(function (p) { return (p.keyNode.value === '$schema') && p.valueNode && p.valueNode.type === 'string'; }); - if (schemaProperties.length > 0) { - var valueNode = schemaProperties[0].valueNode; - if (valueNode && valueNode.type === 'string') { - var schemeId = _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_3__["getNodeValue"](valueNode); - if (schemeId && _utils_strings_js__WEBPACK_IMPORTED_MODULE_2__["startsWith"](schemeId, '.') && this.contextService) { - schemeId = this.contextService.resolveRelativePath(schemeId, resource); - } - if (schemeId) { - var id = normalizeId(schemeId); - return this.getOrAddSchemaHandle(id).getResolvedSchema(); - } - } - } - } - if (this.cachedSchemaForResource && this.cachedSchemaForResource.resource === resource) { - return this.cachedSchemaForResource.resolvedSchema; - } - var seen = Object.create(null); - var schemas = []; - for (var _i = 0, _a = this.filePatternAssociations; _i < _a.length; _i++) { - var entry = _a[_i]; - if (entry.matchesPattern(resource)) { - for (var _b = 0, _c = entry.getURIs(); _b < _c.length; _b++) { - var schemaId = _c[_b]; - if (!seen[schemaId]) { - schemas.push(schemaId); - seen[schemaId] = true; - } - } - } - } - var resolvedSchema = schemas.length > 0 ? this.createCombinedSchema(resource, schemas).getResolvedSchema() : this.promise.resolve(undefined); - this.cachedSchemaForResource = { resource: resource, resolvedSchema: resolvedSchema }; - return resolvedSchema; - }; - JSONSchemaService.prototype.createCombinedSchema = function (resource, schemaIds) { - if (schemaIds.length === 1) { - return this.getOrAddSchemaHandle(schemaIds[0]); - } - else { - var combinedSchemaId = 'schemaservice://combinedSchema/' + encodeURIComponent(resource); - var combinedSchema = { - allOf: schemaIds.map(function (schemaId) { return ({ $ref: schemaId }); }) - }; - return this.addSchemaHandle(combinedSchemaId, combinedSchema); - } - }; - JSONSchemaService.prototype.getMatchingSchemas = function (document, jsonDocument, schema) { - if (schema) { - var id = schema.id || ('schemaservice://untitled/matchingSchemas/' + idCounter++); - return this.resolveSchemaContent(new UnresolvedSchema(schema), id, {}).then(function (resolvedSchema) { - return jsonDocument.getMatchingSchemas(resolvedSchema.schema).filter(function (s) { return !s.inverted; }); - }); - } - return this.getSchemaForResource(document.uri, jsonDocument).then(function (schema) { - if (schema) { - return jsonDocument.getMatchingSchemas(schema.schema).filter(function (s) { return !s.inverted; }); - } - return []; - }); - }; - return JSONSchemaService; -}()); - -var idCounter = 0; -function normalizeId(id) { - // remove trailing '#', normalize drive capitalization - try { - return _vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_1__["URI"].parse(id).toString(); - } - catch (e) { - return id; - } -} -function toDisplayString(url) { - try { - var uri = _vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_1__["URI"].parse(url); - if (uri.scheme === 'file') { - return uri.fsPath; - } - } - catch (e) { - // ignore - } - return url; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSelectionRanges.js": -/*!***************************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSelectionRanges.js ***! - \***************************************************************************************************************************/ -/*! exports provided: getSelectionRanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectionRanges", function() { return getSelectionRanges; }); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); -/* harmony import */ var _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jsonc-parser/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -function getSelectionRanges(document, positions, doc) { - function getSelectionRange(position) { - var offset = document.offsetAt(position); - var node = doc.getNodeFromOffset(offset, true); - var result = []; - while (node) { - switch (node.type) { - case 'string': - case 'object': - case 'array': - // range without ", [ or { - var cStart = node.offset + 1, cEnd = node.offset + node.length - 1; - if (cStart < cEnd && offset >= cStart && offset <= cEnd) { - result.push(newRange(cStart, cEnd)); - } - result.push(newRange(node.offset, node.offset + node.length)); - break; - case 'number': - case 'boolean': - case 'null': - case 'property': - result.push(newRange(node.offset, node.offset + node.length)); - break; - } - if (node.type === 'property' || node.parent && node.parent.type === 'array') { - var afterCommaOffset = getOffsetAfterNextToken(node.offset + node.length, 5 /* CommaToken */); - if (afterCommaOffset !== -1) { - result.push(newRange(node.offset, afterCommaOffset)); - } - } - node = node.parent; - } - var current = undefined; - for (var index = result.length - 1; index >= 0; index--) { - current = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_0__["SelectionRange"].create(result[index], current); - } - if (!current) { - current = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_0__["SelectionRange"].create(_jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(position, position)); - } - return current; - } - function newRange(start, end) { - return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(document.positionAt(start), document.positionAt(end)); - } - var scanner = Object(_jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"])(document.getText(), true); - function getOffsetAfterNextToken(offset, expectedToken) { - scanner.setPosition(offset); - var token = scanner.scan(); - if (token === expectedToken) { - return scanner.getTokenOffset() + scanner.getTokenLength(); - } - return -1; - } - return positions.map(getSelectionRange); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonValidation.js": -/*!**********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonValidation.js ***! - \**********************************************************************************************************************/ -/*! exports provided: JSONValidation */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONValidation", function() { return JSONValidation; }); -/* harmony import */ var _jsonSchemaService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsonSchemaService.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSchemaService.js"); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js"); -/* harmony import */ var _utils_objects_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/objects.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/objects.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_2__["loadMessageBundle"](); -var JSONValidation = /** @class */ (function () { - function JSONValidation(jsonSchemaService, promiseConstructor) { - this.jsonSchemaService = jsonSchemaService; - this.promise = promiseConstructor; - this.validationEnabled = true; - } - JSONValidation.prototype.configure = function (raw) { - if (raw) { - this.validationEnabled = raw.validate; - this.commentSeverity = raw.allowComments ? undefined : _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Error; - } - }; - JSONValidation.prototype.doValidation = function (textDocument, jsonDocument, documentSettings, schema) { - var _this = this; - if (!this.validationEnabled) { - return this.promise.resolve([]); - } - var diagnostics = []; - var added = {}; - var addProblem = function (problem) { - // remove duplicated messages - var signature = problem.range.start.line + ' ' + problem.range.start.character + ' ' + problem.message; - if (!added[signature]) { - added[signature] = true; - diagnostics.push(problem); - } - }; - var getDiagnostics = function (schema) { - var trailingCommaSeverity = documentSettings ? toDiagnosticSeverity(documentSettings.trailingCommas) : _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Error; - var commentSeverity = documentSettings ? toDiagnosticSeverity(documentSettings.comments) : _this.commentSeverity; - if (schema) { - if (schema.errors.length && jsonDocument.root) { - var astRoot = jsonDocument.root; - var property = astRoot.type === 'object' ? astRoot.properties[0] : undefined; - if (property && property.keyNode.value === '$schema') { - var node = property.valueNode || property; - var range = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["Range"].create(textDocument.positionAt(node.offset), textDocument.positionAt(node.offset + node.length)); - addProblem(_jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["Diagnostic"].create(range, schema.errors[0], _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Warning, _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["ErrorCode"].SchemaResolveError)); - } - else { - var range = _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["Range"].create(textDocument.positionAt(astRoot.offset), textDocument.positionAt(astRoot.offset + 1)); - addProblem(_jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["Diagnostic"].create(range, schema.errors[0], _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Warning, _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["ErrorCode"].SchemaResolveError)); - } - } - else { - var semanticErrors = jsonDocument.validate(textDocument, schema.schema); - if (semanticErrors) { - semanticErrors.forEach(addProblem); - } - } - if (schemaAllowsComments(schema.schema)) { - commentSeverity = undefined; - } - if (schemaAllowsTrailingCommas(schema.schema)) { - trailingCommaSeverity = undefined; - } - } - for (var _i = 0, _a = jsonDocument.syntaxErrors; _i < _a.length; _i++) { - var p = _a[_i]; - if (p.code === _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["ErrorCode"].TrailingComma) { - if (typeof trailingCommaSeverity !== 'number') { - continue; - } - p.severity = trailingCommaSeverity; - } - addProblem(p); - } - if (typeof commentSeverity === 'number') { - var message_1 = localize('InvalidCommentToken', 'Comments are not permitted in JSON.'); - jsonDocument.comments.forEach(function (c) { - addProblem(_jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["Diagnostic"].create(c, message_1, commentSeverity, _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["ErrorCode"].CommentNotPermitted)); - }); - } - return diagnostics; - }; - if (schema) { - var id = schema.id || ('schemaservice://untitled/' + idCounter++); - return this.jsonSchemaService.resolveSchemaContent(new _jsonSchemaService_js__WEBPACK_IMPORTED_MODULE_0__["UnresolvedSchema"](schema), id, {}).then(function (resolvedSchema) { - return getDiagnostics(resolvedSchema); - }); - } - return this.jsonSchemaService.getSchemaForResource(textDocument.uri, jsonDocument).then(function (schema) { - return getDiagnostics(schema); - }); - }; - return JSONValidation; -}()); - -var idCounter = 0; -function schemaAllowsComments(schemaRef) { - if (schemaRef && typeof schemaRef === 'object') { - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_3__["isBoolean"])(schemaRef.allowComments)) { - return schemaRef.allowComments; - } - if (schemaRef.allOf) { - for (var _i = 0, _a = schemaRef.allOf; _i < _a.length; _i++) { - var schema = _a[_i]; - var allow = schemaAllowsComments(schema); - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_3__["isBoolean"])(allow)) { - return allow; - } - } - } - } - return undefined; -} -function schemaAllowsTrailingCommas(schemaRef) { - if (schemaRef && typeof schemaRef === 'object') { - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_3__["isBoolean"])(schemaRef.allowTrailingCommas)) { - return schemaRef.allowTrailingCommas; - } - var deprSchemaRef = schemaRef; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_3__["isBoolean"])(deprSchemaRef['allowsTrailingCommas'])) { // deprecated - return deprSchemaRef['allowsTrailingCommas']; - } - if (schemaRef.allOf) { - for (var _i = 0, _a = schemaRef.allOf; _i < _a.length; _i++) { - var schema = _a[_i]; - var allow = schemaAllowsTrailingCommas(schema); - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_3__["isBoolean"])(allow)) { - return allow; - } - } - } - } - return undefined; -} -function toDiagnosticSeverity(severityLevel) { - switch (severityLevel) { - case 'error': return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Error; - case 'warning': return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Warning; - case 'ignore': return undefined; - } - return undefined; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/colors.js": -/*!***********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/colors.js ***! - \***********************************************************************************************************/ -/*! exports provided: hexDigit, colorFromHex, colorFrom256RGB */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hexDigit", function() { return hexDigit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorFromHex", function() { return colorFromHex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorFrom256RGB", function() { return colorFrom256RGB; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Digit0 = 48; -var Digit9 = 57; -var A = 65; -var a = 97; -var f = 102; -function hexDigit(charCode) { - if (charCode < Digit0) { - return 0; - } - if (charCode <= Digit9) { - return charCode - Digit0; - } - if (charCode < a) { - charCode += (a - A); - } - if (charCode >= a && charCode <= f) { - return charCode - a + 10; - } - return 0; -} -function colorFromHex(text) { - if (text[0] !== '#') { - return undefined; - } - switch (text.length) { - case 4: - return { - red: (hexDigit(text.charCodeAt(1)) * 0x11) / 255.0, - green: (hexDigit(text.charCodeAt(2)) * 0x11) / 255.0, - blue: (hexDigit(text.charCodeAt(3)) * 0x11) / 255.0, - alpha: 1 - }; - case 5: - return { - red: (hexDigit(text.charCodeAt(1)) * 0x11) / 255.0, - green: (hexDigit(text.charCodeAt(2)) * 0x11) / 255.0, - blue: (hexDigit(text.charCodeAt(3)) * 0x11) / 255.0, - alpha: (hexDigit(text.charCodeAt(4)) * 0x11) / 255.0, - }; - case 7: - return { - red: (hexDigit(text.charCodeAt(1)) * 0x10 + hexDigit(text.charCodeAt(2))) / 255.0, - green: (hexDigit(text.charCodeAt(3)) * 0x10 + hexDigit(text.charCodeAt(4))) / 255.0, - blue: (hexDigit(text.charCodeAt(5)) * 0x10 + hexDigit(text.charCodeAt(6))) / 255.0, - alpha: 1 - }; - case 9: - return { - red: (hexDigit(text.charCodeAt(1)) * 0x10 + hexDigit(text.charCodeAt(2))) / 255.0, - green: (hexDigit(text.charCodeAt(3)) * 0x10 + hexDigit(text.charCodeAt(4))) / 255.0, - blue: (hexDigit(text.charCodeAt(5)) * 0x10 + hexDigit(text.charCodeAt(6))) / 255.0, - alpha: (hexDigit(text.charCodeAt(7)) * 0x10 + hexDigit(text.charCodeAt(8))) / 255.0 - }; - } - return undefined; -} -function colorFrom256RGB(red, green, blue, alpha) { - if (alpha === void 0) { alpha = 1.0; } - return { - red: red / 255.0, - green: green / 255.0, - blue: blue / 255.0, - alpha: alpha - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/json.js": -/*!*********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/json.js ***! - \*********************************************************************************************************/ -/*! exports provided: stringifyObject */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringifyObject", function() { return stringifyObject; }); -/*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the MIT License. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ -function stringifyObject(obj, indent, stringifyLiteral) { - if (obj !== null && typeof obj === 'object') { - var newIndent = indent + '\t'; - if (Array.isArray(obj)) { - if (obj.length === 0) { - return '[]'; - } - var result = '[\n'; - for (var i = 0; i < obj.length; i++) { - result += newIndent + stringifyObject(obj[i], newIndent, stringifyLiteral); - if (i < obj.length - 1) { - result += ','; - } - result += '\n'; - } - result += indent + ']'; - return result; - } - else { - var keys = Object.keys(obj); - if (keys.length === 0) { - return '{}'; - } - var result = '{\n'; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - result += newIndent + JSON.stringify(key) + ': ' + stringifyObject(obj[key], newIndent, stringifyLiteral); - if (i < keys.length - 1) { - result += ','; - } - result += '\n'; - } - result += indent + '}'; - return result; - } - } - return stringifyLiteral(obj); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/objects.js": -/*!************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/objects.js ***! - \************************************************************************************************************/ -/*! exports provided: equals, isNumber, isDefined, isBoolean, isString */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return isNumber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDefined", function() { return isDefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return isBoolean; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); -/*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the MIT License. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ -function equals(one, other) { - if (one === other) { - return true; - } - if (one === null || one === undefined || other === null || other === undefined) { - return false; - } - if (typeof one !== typeof other) { - return false; - } - if (typeof one !== 'object') { - return false; - } - if ((Array.isArray(one)) !== (Array.isArray(other))) { - return false; - } - var i, key; - if (Array.isArray(one)) { - if (one.length !== other.length) { - return false; - } - for (i = 0; i < one.length; i++) { - if (!equals(one[i], other[i])) { - return false; - } - } - } - else { - var oneKeys = []; - for (key in one) { - oneKeys.push(key); - } - oneKeys.sort(); - var otherKeys = []; - for (key in other) { - otherKeys.push(key); - } - otherKeys.sort(); - if (!equals(oneKeys, otherKeys)) { - return false; - } - for (i = 0; i < oneKeys.length; i++) { - if (!equals(one[oneKeys[i]], other[oneKeys[i]])) { - return false; - } - } - } - return true; -} -function isNumber(val) { - return typeof val === 'number'; -} -function isDefined(val) { - return typeof val !== 'undefined'; -} -function isBoolean(val) { - return typeof val === 'boolean'; -} -function isString(val) { - return typeof val === 'string'; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js": -/*!************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js ***! - \************************************************************************************************************/ -/*! exports provided: startsWith, endsWith, convertSimple2RegExpPattern, repeat */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSimple2RegExpPattern", function() { return convertSimple2RegExpPattern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; }); -/*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the MIT License. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ -function startsWith(haystack, needle) { - if (haystack.length < needle.length) { - return false; - } - for (var i = 0; i < needle.length; i++) { - if (haystack[i] !== needle[i]) { - return false; - } - } - return true; -} -/** - * Determines if haystack ends with needle. - */ -function endsWith(haystack, needle) { - var diff = haystack.length - needle.length; - if (diff > 0) { - return haystack.lastIndexOf(needle) === diff; - } - else if (diff === 0) { - return haystack === needle; - } - else { - return false; - } -} -function convertSimple2RegExpPattern(pattern) { - return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*'); -} -function repeat(value, count) { - var s = ''; - while (count > 0) { - if ((count & 1) === 1) { - s += value; - } - value += value; - count = count >>> 1; - } - return s; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-textdocument/lib/esm/main.js": -/*!******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-textdocument/lib/esm/main.js ***! - \******************************************************************************************************************/ -/*! exports provided: TextDocument */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; }); -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -var FullTextDocument = /** @class */ (function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = undefined; - } - Object.defineProperty(FullTextDocument.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.prototype.getText = function (range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument.prototype.update = function (changes, version) { - for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { - var change = changes_1[_i]; - if (FullTextDocument.isIncremental(change)) { - // makes sure start is before end - var range = getWellformedRange(change.range); - // update content - var startOffset = this.offsetAt(range.start); - var endOffset = this.offsetAt(range.end); - this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); - // update the offsets - var startLine = Math.max(range.start.line, 0); - var endLine = Math.max(range.end.line, 0); - var lineOffsets = this._lineOffsets; - var addedLineOffsets = computeLineOffsets(change.text, false, startOffset); - if (endLine - startLine === addedLineOffsets.length) { - for (var i = 0, len = addedLineOffsets.length; i < len; i++) { - lineOffsets[i + startLine + 1] = addedLineOffsets[i]; - } - } - else { - if (addedLineOffsets.length < 10000) { - lineOffsets.splice.apply(lineOffsets, [startLine + 1, endLine - startLine].concat(addedLineOffsets)); - } - else { // avoid too many arguments for splice - this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); - } - } - var diff = change.text.length - (endOffset - startOffset); - if (diff !== 0) { - for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { - lineOffsets[i] = lineOffsets[i] + diff; - } - } - } - else if (FullTextDocument.isFull(change)) { - this._content = change.text; - this._lineOffsets = undefined; - } - else { - throw new Error('Unknown change event received'); - } - } - this._version = version; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === undefined) { - this._lineOffsets = computeLineOffsets(this._content, true); - } - return this._lineOffsets; - }; - FullTextDocument.prototype.positionAt = function (offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, high = lineOffsets.length; - if (high === 0) { - return { line: 0, character: offset }; - } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } - else { - low = mid + 1; - } - } - // low is the least x for which the line offset is larger than the current offset - // or array.length if no line offset is larger than the current offset - var line = low - 1; - return { line: line, character: offset - lineOffsets[line] }; - }; - FullTextDocument.prototype.offsetAt = function (position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } - else if (position.line < 0) { - return 0; - } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument.prototype, "lineCount", { - get: function () { - return this.getLineOffsets().length; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.isIncremental = function (event) { - var candidate = event; - return candidate !== undefined && candidate !== null && - typeof candidate.text === 'string' && candidate.range !== undefined && - (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number'); - }; - FullTextDocument.isFull = function (event) { - var candidate = event; - return candidate !== undefined && candidate !== null && - typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined; - }; - return FullTextDocument; -}()); -var TextDocument; -(function (TextDocument) { - /** - * Creates a new text document. - * - * @param uri The document's uri. - * @param languageId The document's language Id. - * @param version The document's initial version number. - * @param content The document's content. - */ - function create(uri, languageId, version, content) { - return new FullTextDocument(uri, languageId, version, content); - } - TextDocument.create = create; - /** - * Updates a TextDocument by modifing its content. - * - * @param document the document to update. Only documents created by TextDocument.create are valid inputs. - * @param changes the changes to apply to the document. - * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter. - * - */ - function update(document, changes, version) { - if (document instanceof FullTextDocument) { - document.update(changes, version); - return document; - } - else { - throw new Error('TextDocument.update: document must be created by TextDocument.create'); - } - } - TextDocument.update = update; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits.map(getWellformedEdit), function (a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; - } - return diff; - }); - var lastModifiedOffset = 0; - var spans = []; - for (var _i = 0, sortedEdits_1 = sortedEdits; _i < sortedEdits_1.length; _i++) { - var e = sortedEdits_1[_i]; - var startOffset = document.offsetAt(e.range.start); - if (startOffset < lastModifiedOffset) { - throw new Error('Overlapping edit'); - } - else if (startOffset > lastModifiedOffset) { - spans.push(text.substring(lastModifiedOffset, startOffset)); - } - if (e.newText.length) { - spans.push(e.newText); - } - lastModifiedOffset = document.offsetAt(e.range.end); - } - spans.push(text.substr(lastModifiedOffset)); - return spans.join(''); - } - TextDocument.applyEdits = applyEdits; -})(TextDocument || (TextDocument = {})); -function mergeSort(data, compare) { - if (data.length <= 1) { - // sorted - return data; - } - var p = (data.length / 2) | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare); - mergeSort(right, compare); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - // smaller_equal -> take left to preserve order - data[i++] = left[leftIdx++]; - } - else { - // greater -> take right - data[i++] = right[rightIdx++]; - } - } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; - } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; -} -function computeLineOffsets(text, isAtLineStart, textOffset) { - if (textOffset === void 0) { textOffset = 0; } - var result = isAtLineStart ? [textOffset] : []; - for (var i = 0; i < text.length; i++) { - var ch = text.charCodeAt(i); - if (ch === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */) { - if (ch === 13 /* CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* LineFeed */) { - i++; - } - result.push(textOffset + i + 1); - } - } - return result; -} -function getWellformedRange(range) { - var start = range.start; - var end = range.end; - if (start.line > end.line || (start.line === end.line && start.character > end.character)) { - return { start: end, end: start }; - } - return range; -} -function getWellformedEdit(textEdit) { - var range = getWellformedRange(textEdit.range); - if (range !== textEdit.range) { - return { newText: textEdit.newText, range: range }; - } - return textEdit; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js ***! - \***************************************************************************************************/ -/*! exports provided: Position, Range, Location, LocationLink, Color, ColorInformation, ColorPresentation, FoldingRangeKind, FoldingRange, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag, Diagnostic, Command, TextEdit, TextDocumentEdit, CreateFile, RenameFile, DeleteFile, WorkspaceEdit, WorkspaceChange, TextDocumentIdentifier, VersionedTextDocumentIdentifier, TextDocumentItem, MarkupKind, MarkupContent, CompletionItemKind, InsertTextFormat, CompletionItemTag, CompletionItem, CompletionList, MarkedString, Hover, ParameterInformation, SignatureInformation, DocumentHighlightKind, DocumentHighlight, SymbolKind, SymbolTag, SymbolInformation, DocumentSymbol, CodeActionKind, CodeActionContext, CodeAction, CodeLens, FormattingOptions, DocumentLink, SelectionRange, EOL, TextDocument */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocationLink", function() { return LocationLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return ColorInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return ColorPresentation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return FoldingRangeKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return FoldingRange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticRelatedInformation", function() { return DiagnosticRelatedInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return DiagnosticSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticTag", function() { return DiagnosticTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return Diagnostic; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return TextEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentEdit", function() { return TextDocumentEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CreateFile", function() { return CreateFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenameFile", function() { return RenameFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteFile", function() { return DeleteFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceEdit", function() { return WorkspaceEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceChange", function() { return WorkspaceChange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentIdentifier", function() { return TextDocumentIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VersionedTextDocumentIdentifier", function() { return VersionedTextDocumentIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentItem", function() { return TextDocumentItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return MarkupKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return MarkupContent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return InsertTextFormat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemTag", function() { return CompletionItemTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return CompletionItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return CompletionList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return MarkedString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return Hover; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParameterInformation", function() { return ParameterInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureInformation", function() { return SignatureInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlight", function() { return DocumentHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolTag", function() { return SymbolTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return SymbolInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return DocumentSymbol; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return CodeActionKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionContext", function() { return CodeActionContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeAction", function() { return CodeAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLens", function() { return CodeLens; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return FormattingOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentLink", function() { return DocumentLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionRange", function() { return SelectionRange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EOL", function() { return EOL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; }); -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -/** - * The Position namespace provides helper functions to work with - * [Position](#Position) literals. - */ -var Position; -(function (Position) { - /** - * Creates a new Position literal from the given line and character. - * @param line The position's line. - * @param character The position's character. - */ - function create(line, character) { - return { line: line, character: character }; - } - Position.create = create; - /** - * Checks whether the given liternal conforms to the [Position](#Position) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character); - } - Position.is = is; -})(Position || (Position = {})); -/** - * The Range namespace provides helper functions to work with - * [Range](#Range) literals. - */ -var Range; -(function (Range) { - function create(one, two, three, four) { - if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) { - return { start: Position.create(one, two), end: Position.create(three, four) }; - } - else if (Position.is(one) && Position.is(two)) { - return { start: one, end: two }; - } - else { - throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]"); - } - } - Range.create = create; - /** - * Checks whether the given literal conforms to the [Range](#Range) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); - } - Range.is = is; -})(Range || (Range = {})); -/** - * The Location namespace provides helper functions to work with - * [Location](#Location) literals. - */ -var Location; -(function (Location) { - /** - * Creates a Location literal. - * @param uri The location's uri. - * @param range The location's range. - */ - function create(uri, range) { - return { uri: uri, range: range }; - } - Location.create = create; - /** - * Checks whether the given literal conforms to the [Location](#Location) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); - } - Location.is = is; -})(Location || (Location = {})); -/** - * The LocationLink namespace provides helper functions to work with - * [LocationLink](#LocationLink) literals. - */ -var LocationLink; -(function (LocationLink) { - /** - * Creates a LocationLink literal. - * @param targetUri The definition's uri. - * @param targetRange The full range of the definition. - * @param targetSelectionRange The span of the symbol definition at the target. - * @param originSelectionRange The span of the symbol being defined in the originating source file. - */ - function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { - return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange }; - } - LocationLink.create = create; - /** - * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) - && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) - && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); - } - LocationLink.is = is; -})(LocationLink || (LocationLink = {})); -/** - * The Color namespace provides helper functions to work with - * [Color](#Color) literals. - */ -var Color; -(function (Color) { - /** - * Creates a new Color literal. - */ - function create(red, green, blue, alpha) { - return { - red: red, - green: green, - blue: blue, - alpha: alpha, - }; - } - Color.create = create; - /** - * Checks whether the given literal conforms to the [Color](#Color) interface. - */ - function is(value) { - var candidate = value; - return Is.number(candidate.red) - && Is.number(candidate.green) - && Is.number(candidate.blue) - && Is.number(candidate.alpha); - } - Color.is = is; -})(Color || (Color = {})); -/** - * The ColorInformation namespace provides helper functions to work with - * [ColorInformation](#ColorInformation) literals. - */ -var ColorInformation; -(function (ColorInformation) { - /** - * Creates a new ColorInformation literal. - */ - function create(range, color) { - return { - range: range, - color: color, - }; - } - ColorInformation.create = create; - /** - * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. - */ - function is(value) { - var candidate = value; - return Range.is(candidate.range) && Color.is(candidate.color); - } - ColorInformation.is = is; -})(ColorInformation || (ColorInformation = {})); -/** - * The Color namespace provides helper functions to work with - * [ColorPresentation](#ColorPresentation) literals. - */ -var ColorPresentation; -(function (ColorPresentation) { - /** - * Creates a new ColorInformation literal. - */ - function create(label, textEdit, additionalTextEdits) { - return { - label: label, - textEdit: textEdit, - additionalTextEdits: additionalTextEdits, - }; - } - ColorPresentation.create = create; - /** - * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. - */ - function is(value) { - var candidate = value; - return Is.string(candidate.label) - && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) - && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); - } - ColorPresentation.is = is; -})(ColorPresentation || (ColorPresentation = {})); -/** - * Enum of known range kinds - */ -var FoldingRangeKind; -(function (FoldingRangeKind) { - /** - * Folding range for a comment - */ - FoldingRangeKind["Comment"] = "comment"; - /** - * Folding range for a imports or includes - */ - FoldingRangeKind["Imports"] = "imports"; - /** - * Folding range for a region (e.g. `#region`) - */ - FoldingRangeKind["Region"] = "region"; -})(FoldingRangeKind || (FoldingRangeKind = {})); -/** - * The folding range namespace provides helper functions to work with - * [FoldingRange](#FoldingRange) literals. - */ -var FoldingRange; -(function (FoldingRange) { - /** - * Creates a new FoldingRange literal. - */ - function create(startLine, endLine, startCharacter, endCharacter, kind) { - var result = { - startLine: startLine, - endLine: endLine - }; - if (Is.defined(startCharacter)) { - result.startCharacter = startCharacter; - } - if (Is.defined(endCharacter)) { - result.endCharacter = endCharacter; - } - if (Is.defined(kind)) { - result.kind = kind; - } - return result; - } - FoldingRange.create = create; - /** - * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface. - */ - function is(value) { - var candidate = value; - return Is.number(candidate.startLine) && Is.number(candidate.startLine) - && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter)) - && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter)) - && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); - } - FoldingRange.is = is; -})(FoldingRange || (FoldingRange = {})); -/** - * The DiagnosticRelatedInformation namespace provides helper functions to work with - * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals. - */ -var DiagnosticRelatedInformation; -(function (DiagnosticRelatedInformation) { - /** - * Creates a new DiagnosticRelatedInformation literal. - */ - function create(location, message) { - return { - location: location, - message: message - }; - } - DiagnosticRelatedInformation.create = create; - /** - * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); - } - DiagnosticRelatedInformation.is = is; -})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); -/** - * The diagnostic's severity. - */ -var DiagnosticSeverity; -(function (DiagnosticSeverity) { - /** - * Reports an error. - */ - DiagnosticSeverity.Error = 1; - /** - * Reports a warning. - */ - DiagnosticSeverity.Warning = 2; - /** - * Reports an information. - */ - DiagnosticSeverity.Information = 3; - /** - * Reports a hint. - */ - DiagnosticSeverity.Hint = 4; -})(DiagnosticSeverity || (DiagnosticSeverity = {})); -/** - * The diagnostic tags. - * - * @since 3.15.0 - */ -var DiagnosticTag; -(function (DiagnosticTag) { - /** - * Unused or unnecessary code. - * - * Clients are allowed to render diagnostics with this tag faded out instead of having - * an error squiggle. - */ - DiagnosticTag.Unnecessary = 1; - /** - * Deprecated or obsolete code. - * - * Clients are allowed to rendered diagnostics with this tag strike through. - */ - DiagnosticTag.Deprecated = 2; -})(DiagnosticTag || (DiagnosticTag = {})); -/** - * The Diagnostic namespace provides helper functions to work with - * [Diagnostic](#Diagnostic) literals. - */ -var Diagnostic; -(function (Diagnostic) { - /** - * Creates a new Diagnostic literal. - */ - function create(range, message, severity, code, source, relatedInformation) { - var result = { range: range, message: message }; - if (Is.defined(severity)) { - result.severity = severity; - } - if (Is.defined(code)) { - result.code = code; - } - if (Is.defined(source)) { - result.source = source; - } - if (Is.defined(relatedInformation)) { - result.relatedInformation = relatedInformation; - } - return result; - } - Diagnostic.create = create; - /** - * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) - && Range.is(candidate.range) - && Is.string(candidate.message) - && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) - && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) - && (Is.string(candidate.source) || Is.undefined(candidate.source)) - && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); - } - Diagnostic.is = is; -})(Diagnostic || (Diagnostic = {})); -/** - * The Command namespace provides helper functions to work with - * [Command](#Command) literals. - */ -var Command; -(function (Command) { - /** - * Creates a new Command literal. - */ - function create(title, command) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - var result = { title: title, command: command }; - if (Is.defined(args) && args.length > 0) { - result.arguments = args; - } - return result; - } - Command.create = create; - /** - * Checks whether the given literal conforms to the [Command](#Command) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); - } - Command.is = is; -})(Command || (Command = {})); -/** - * The TextEdit namespace provides helper function to create replace, - * insert and delete edits more easily. - */ -var TextEdit; -(function (TextEdit) { - /** - * Creates a replace text edit. - * @param range The range of text to be replaced. - * @param newText The new text. - */ - function replace(range, newText) { - return { range: range, newText: newText }; - } - TextEdit.replace = replace; - /** - * Creates a insert text edit. - * @param position The position to insert the text at. - * @param newText The text to be inserted. - */ - function insert(position, newText) { - return { range: { start: position, end: position }, newText: newText }; - } - TextEdit.insert = insert; - /** - * Creates a delete text edit. - * @param range The range of text to be deleted. - */ - function del(range) { - return { range: range, newText: '' }; - } - TextEdit.del = del; - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) - && Is.string(candidate.newText) - && Range.is(candidate.range); - } - TextEdit.is = is; -})(TextEdit || (TextEdit = {})); -/** - * The TextDocumentEdit namespace provides helper function to create - * an edit that manipulates a text document. - */ -var TextDocumentEdit; -(function (TextDocumentEdit) { - /** - * Creates a new `TextDocumentEdit` - */ - function create(textDocument, edits) { - return { textDocument: textDocument, edits: edits }; - } - TextDocumentEdit.create = create; - function is(value) { - var candidate = value; - return Is.defined(candidate) - && VersionedTextDocumentIdentifier.is(candidate.textDocument) - && Array.isArray(candidate.edits); - } - TextDocumentEdit.is = is; -})(TextDocumentEdit || (TextDocumentEdit = {})); -var CreateFile; -(function (CreateFile) { - function create(uri, options) { - var result = { - kind: 'create', - uri: uri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - return result; - } - CreateFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && - (candidate.options === void 0 || - ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); - } - CreateFile.is = is; -})(CreateFile || (CreateFile = {})); -var RenameFile; -(function (RenameFile) { - function create(oldUri, newUri, options) { - var result = { - kind: 'rename', - oldUri: oldUri, - newUri: newUri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - return result; - } - RenameFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && - (candidate.options === void 0 || - ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); - } - RenameFile.is = is; -})(RenameFile || (RenameFile = {})); -var DeleteFile; -(function (DeleteFile) { - function create(uri, options) { - var result = { - kind: 'delete', - uri: uri - }; - if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { - result.options = options; - } - return result; - } - DeleteFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && - (candidate.options === void 0 || - ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists)))); - } - DeleteFile.is = is; -})(DeleteFile || (DeleteFile = {})); -var WorkspaceEdit; -(function (WorkspaceEdit) { - function is(value) { - var candidate = value; - return candidate && - (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && - (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) { - if (Is.string(change.kind)) { - return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); - } - else { - return TextDocumentEdit.is(change); - } - })); - } - WorkspaceEdit.is = is; -})(WorkspaceEdit || (WorkspaceEdit = {})); -var TextEditChangeImpl = /** @class */ (function () { - function TextEditChangeImpl(edits) { - this.edits = edits; - } - TextEditChangeImpl.prototype.insert = function (position, newText) { - this.edits.push(TextEdit.insert(position, newText)); - }; - TextEditChangeImpl.prototype.replace = function (range, newText) { - this.edits.push(TextEdit.replace(range, newText)); - }; - TextEditChangeImpl.prototype.delete = function (range) { - this.edits.push(TextEdit.del(range)); - }; - TextEditChangeImpl.prototype.add = function (edit) { - this.edits.push(edit); - }; - TextEditChangeImpl.prototype.all = function () { - return this.edits; - }; - TextEditChangeImpl.prototype.clear = function () { - this.edits.splice(0, this.edits.length); - }; - return TextEditChangeImpl; -}()); -/** - * A workspace change helps constructing changes to a workspace. - */ -var WorkspaceChange = /** @class */ (function () { - function WorkspaceChange(workspaceEdit) { - var _this = this; - this._textEditChanges = Object.create(null); - if (workspaceEdit) { - this._workspaceEdit = workspaceEdit; - if (workspaceEdit.documentChanges) { - workspaceEdit.documentChanges.forEach(function (change) { - if (TextDocumentEdit.is(change)) { - var textEditChange = new TextEditChangeImpl(change.edits); - _this._textEditChanges[change.textDocument.uri] = textEditChange; - } - }); - } - else if (workspaceEdit.changes) { - Object.keys(workspaceEdit.changes).forEach(function (key) { - var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); - _this._textEditChanges[key] = textEditChange; - }); - } - } - } - Object.defineProperty(WorkspaceChange.prototype, "edit", { - /** - * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal - * use to be returned from a workspace edit operation like rename. - */ - get: function () { - return this._workspaceEdit; - }, - enumerable: true, - configurable: true - }); - WorkspaceChange.prototype.getTextEditChange = function (key) { - if (VersionedTextDocumentIdentifier.is(key)) { - if (!this._workspaceEdit) { - this._workspaceEdit = { - documentChanges: [] - }; - } - if (!this._workspaceEdit.documentChanges) { - throw new Error('Workspace edit is not configured for document changes.'); - } - var textDocument = key; - var result = this._textEditChanges[textDocument.uri]; - if (!result) { - var edits = []; - var textDocumentEdit = { - textDocument: textDocument, - edits: edits - }; - this._workspaceEdit.documentChanges.push(textDocumentEdit); - result = new TextEditChangeImpl(edits); - this._textEditChanges[textDocument.uri] = result; - } - return result; - } - else { - if (!this._workspaceEdit) { - this._workspaceEdit = { - changes: Object.create(null) - }; - } - if (!this._workspaceEdit.changes) { - throw new Error('Workspace edit is not configured for normal text edit changes.'); - } - var result = this._textEditChanges[key]; - if (!result) { - var edits = []; - this._workspaceEdit.changes[key] = edits; - result = new TextEditChangeImpl(edits); - this._textEditChanges[key] = result; - } - return result; - } - }; - WorkspaceChange.prototype.createFile = function (uri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options)); - }; - WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options)); - }; - WorkspaceChange.prototype.deleteFile = function (uri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options)); - }; - WorkspaceChange.prototype.checkDocumentChanges = function () { - if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) { - throw new Error('Workspace edit is not configured for document changes.'); - } - }; - return WorkspaceChange; -}()); - -/** - * The TextDocumentIdentifier namespace provides helper functions to work with - * [TextDocumentIdentifier](#TextDocumentIdentifier) literals. - */ -var TextDocumentIdentifier; -(function (TextDocumentIdentifier) { - /** - * Creates a new TextDocumentIdentifier literal. - * @param uri The document's uri. - */ - function create(uri) { - return { uri: uri }; - } - TextDocumentIdentifier.create = create; - /** - * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri); - } - TextDocumentIdentifier.is = is; -})(TextDocumentIdentifier || (TextDocumentIdentifier = {})); -/** - * The VersionedTextDocumentIdentifier namespace provides helper functions to work with - * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals. - */ -var VersionedTextDocumentIdentifier; -(function (VersionedTextDocumentIdentifier) { - /** - * Creates a new VersionedTextDocumentIdentifier literal. - * @param uri The document's uri. - * @param uri The document's text. - */ - function create(uri, version) { - return { uri: uri, version: version }; - } - VersionedTextDocumentIdentifier.create = create; - /** - * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version)); - } - VersionedTextDocumentIdentifier.is = is; -})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); -/** - * The TextDocumentItem namespace provides helper functions to work with - * [TextDocumentItem](#TextDocumentItem) literals. - */ -var TextDocumentItem; -(function (TextDocumentItem) { - /** - * Creates a new TextDocumentItem literal. - * @param uri The document's uri. - * @param languageId The document's language identifier. - * @param version The document's version number. - * @param text The document's text. - */ - function create(uri, languageId, version, text) { - return { uri: uri, languageId: languageId, version: version, text: text }; - } - TextDocumentItem.create = create; - /** - * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text); - } - TextDocumentItem.is = is; -})(TextDocumentItem || (TextDocumentItem = {})); -/** - * Describes the content type that a client supports in various - * result literals like `Hover`, `ParameterInfo` or `CompletionItem`. - * - * Please note that `MarkupKinds` must not start with a `$`. This kinds - * are reserved for internal usage. - */ -var MarkupKind; -(function (MarkupKind) { - /** - * Plain text is supported as a content format - */ - MarkupKind.PlainText = 'plaintext'; - /** - * Markdown is supported as a content format - */ - MarkupKind.Markdown = 'markdown'; -})(MarkupKind || (MarkupKind = {})); -(function (MarkupKind) { - /** - * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. - */ - function is(value) { - var candidate = value; - return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; - } - MarkupKind.is = is; -})(MarkupKind || (MarkupKind = {})); -var MarkupContent; -(function (MarkupContent) { - /** - * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); - } - MarkupContent.is = is; -})(MarkupContent || (MarkupContent = {})); -/** - * The kind of a completion entry. - */ -var CompletionItemKind; -(function (CompletionItemKind) { - CompletionItemKind.Text = 1; - CompletionItemKind.Method = 2; - CompletionItemKind.Function = 3; - CompletionItemKind.Constructor = 4; - CompletionItemKind.Field = 5; - CompletionItemKind.Variable = 6; - CompletionItemKind.Class = 7; - CompletionItemKind.Interface = 8; - CompletionItemKind.Module = 9; - CompletionItemKind.Property = 10; - CompletionItemKind.Unit = 11; - CompletionItemKind.Value = 12; - CompletionItemKind.Enum = 13; - CompletionItemKind.Keyword = 14; - CompletionItemKind.Snippet = 15; - CompletionItemKind.Color = 16; - CompletionItemKind.File = 17; - CompletionItemKind.Reference = 18; - CompletionItemKind.Folder = 19; - CompletionItemKind.EnumMember = 20; - CompletionItemKind.Constant = 21; - CompletionItemKind.Struct = 22; - CompletionItemKind.Event = 23; - CompletionItemKind.Operator = 24; - CompletionItemKind.TypeParameter = 25; -})(CompletionItemKind || (CompletionItemKind = {})); -/** - * Defines whether the insert text in a completion item should be interpreted as - * plain text or a snippet. - */ -var InsertTextFormat; -(function (InsertTextFormat) { - /** - * The primary text to be inserted is treated as a plain string. - */ - InsertTextFormat.PlainText = 1; - /** - * The primary text to be inserted is treated as a snippet. - * - * A snippet can define tab stops and placeholders with `$1`, `$2` - * and `${3:foo}`. `$0` defines the final tab stop, it defaults to - * the end of the snippet. Placeholders with equal identifiers are linked, - * that is typing in one will update others too. - * - * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md - */ - InsertTextFormat.Snippet = 2; -})(InsertTextFormat || (InsertTextFormat = {})); -/** - * Completion item tags are extra annotations that tweak the rendering of a completion - * item. - * - * @since 3.15.0 - */ -var CompletionItemTag; -(function (CompletionItemTag) { - /** - * Render a completion as obsolete, usually using a strike-out. - */ - CompletionItemTag.Deprecated = 1; -})(CompletionItemTag || (CompletionItemTag = {})); -/** - * The CompletionItem namespace provides functions to deal with - * completion items. - */ -var CompletionItem; -(function (CompletionItem) { - /** - * Create a completion item and seed it with a label. - * @param label The completion item's label - */ - function create(label) { - return { label: label }; - } - CompletionItem.create = create; -})(CompletionItem || (CompletionItem = {})); -/** - * The CompletionList namespace provides functions to deal with - * completion lists. - */ -var CompletionList; -(function (CompletionList) { - /** - * Creates a new completion list. - * - * @param items The completion items. - * @param isIncomplete The list is not complete. - */ - function create(items, isIncomplete) { - return { items: items ? items : [], isIncomplete: !!isIncomplete }; - } - CompletionList.create = create; -})(CompletionList || (CompletionList = {})); -var MarkedString; -(function (MarkedString) { - /** - * Creates a marked string from plain text. - * - * @param plainText The plain text. - */ - function fromPlainText(plainText) { - return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash - } - MarkedString.fromPlainText = fromPlainText; - /** - * Checks whether the given value conforms to the [MarkedString](#MarkedString) type. - */ - function is(value) { - var candidate = value; - return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value)); - } - MarkedString.is = is; -})(MarkedString || (MarkedString = {})); -var Hover; -(function (Hover) { - /** - * Checks whether the given value conforms to the [Hover](#Hover) interface. - */ - function is(value) { - var candidate = value; - return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || - MarkedString.is(candidate.contents) || - Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); - } - Hover.is = is; -})(Hover || (Hover = {})); -/** - * The ParameterInformation namespace provides helper functions to work with - * [ParameterInformation](#ParameterInformation) literals. - */ -var ParameterInformation; -(function (ParameterInformation) { - /** - * Creates a new parameter information literal. - * - * @param label A label string. - * @param documentation A doc string. - */ - function create(label, documentation) { - return documentation ? { label: label, documentation: documentation } : { label: label }; - } - ParameterInformation.create = create; -})(ParameterInformation || (ParameterInformation = {})); -/** - * The SignatureInformation namespace provides helper functions to work with - * [SignatureInformation](#SignatureInformation) literals. - */ -var SignatureInformation; -(function (SignatureInformation) { - function create(label, documentation) { - var parameters = []; - for (var _i = 2; _i < arguments.length; _i++) { - parameters[_i - 2] = arguments[_i]; - } - var result = { label: label }; - if (Is.defined(documentation)) { - result.documentation = documentation; - } - if (Is.defined(parameters)) { - result.parameters = parameters; - } - else { - result.parameters = []; - } - return result; - } - SignatureInformation.create = create; -})(SignatureInformation || (SignatureInformation = {})); -/** - * A document highlight kind. - */ -var DocumentHighlightKind; -(function (DocumentHighlightKind) { - /** - * A textual occurrence. - */ - DocumentHighlightKind.Text = 1; - /** - * Read-access of a symbol, like reading a variable. - */ - DocumentHighlightKind.Read = 2; - /** - * Write-access of a symbol, like writing to a variable. - */ - DocumentHighlightKind.Write = 3; -})(DocumentHighlightKind || (DocumentHighlightKind = {})); -/** - * DocumentHighlight namespace to provide helper functions to work with - * [DocumentHighlight](#DocumentHighlight) literals. - */ -var DocumentHighlight; -(function (DocumentHighlight) { - /** - * Create a DocumentHighlight object. - * @param range The range the highlight applies to. - */ - function create(range, kind) { - var result = { range: range }; - if (Is.number(kind)) { - result.kind = kind; - } - return result; - } - DocumentHighlight.create = create; -})(DocumentHighlight || (DocumentHighlight = {})); -/** - * A symbol kind. - */ -var SymbolKind; -(function (SymbolKind) { - SymbolKind.File = 1; - SymbolKind.Module = 2; - SymbolKind.Namespace = 3; - SymbolKind.Package = 4; - SymbolKind.Class = 5; - SymbolKind.Method = 6; - SymbolKind.Property = 7; - SymbolKind.Field = 8; - SymbolKind.Constructor = 9; - SymbolKind.Enum = 10; - SymbolKind.Interface = 11; - SymbolKind.Function = 12; - SymbolKind.Variable = 13; - SymbolKind.Constant = 14; - SymbolKind.String = 15; - SymbolKind.Number = 16; - SymbolKind.Boolean = 17; - SymbolKind.Array = 18; - SymbolKind.Object = 19; - SymbolKind.Key = 20; - SymbolKind.Null = 21; - SymbolKind.EnumMember = 22; - SymbolKind.Struct = 23; - SymbolKind.Event = 24; - SymbolKind.Operator = 25; - SymbolKind.TypeParameter = 26; -})(SymbolKind || (SymbolKind = {})); -/** - * Symbol tags are extra annotations that tweak the rendering of a symbol. - * @since 3.15 - */ -var SymbolTag; -(function (SymbolTag) { - /** - * Render a symbol as obsolete, usually using a strike-out. - */ - SymbolTag.Deprecated = 1; -})(SymbolTag || (SymbolTag = {})); -var SymbolInformation; -(function (SymbolInformation) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the location of the symbol. - * @param uri The resource of the location of symbol, defaults to the current document. - * @param containerName The name of the symbol containing the symbol. - */ - function create(name, kind, range, uri, containerName) { - var result = { - name: name, - kind: kind, - location: { uri: uri, range: range } - }; - if (containerName) { - result.containerName = containerName; - } - return result; - } - SymbolInformation.create = create; -})(SymbolInformation || (SymbolInformation = {})); -var DocumentSymbol; -(function (DocumentSymbol) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param detail The detail of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the symbol. - * @param selectionRange The selectionRange of the symbol. - * @param children Children of the symbol. - */ - function create(name, detail, kind, range, selectionRange, children) { - var result = { - name: name, - detail: detail, - kind: kind, - range: range, - selectionRange: selectionRange - }; - if (children !== void 0) { - result.children = children; - } - return result; - } - DocumentSymbol.create = create; - /** - * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface. - */ - function is(value) { - var candidate = value; - return candidate && - Is.string(candidate.name) && Is.number(candidate.kind) && - Range.is(candidate.range) && Range.is(candidate.selectionRange) && - (candidate.detail === void 0 || Is.string(candidate.detail)) && - (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && - (candidate.children === void 0 || Array.isArray(candidate.children)); - } - DocumentSymbol.is = is; -})(DocumentSymbol || (DocumentSymbol = {})); -/** - * A set of predefined code action kinds - */ -var CodeActionKind; -(function (CodeActionKind) { - /** - * Empty kind. - */ - CodeActionKind.Empty = ''; - /** - * Base kind for quickfix actions: 'quickfix' - */ - CodeActionKind.QuickFix = 'quickfix'; - /** - * Base kind for refactoring actions: 'refactor' - */ - CodeActionKind.Refactor = 'refactor'; - /** - * Base kind for refactoring extraction actions: 'refactor.extract' - * - * Example extract actions: - * - * - Extract method - * - Extract function - * - Extract variable - * - Extract interface from class - * - ... - */ - CodeActionKind.RefactorExtract = 'refactor.extract'; - /** - * Base kind for refactoring inline actions: 'refactor.inline' - * - * Example inline actions: - * - * - Inline function - * - Inline variable - * - Inline constant - * - ... - */ - CodeActionKind.RefactorInline = 'refactor.inline'; - /** - * Base kind for refactoring rewrite actions: 'refactor.rewrite' - * - * Example rewrite actions: - * - * - Convert JavaScript function to class - * - Add or remove parameter - * - Encapsulate field - * - Make method static - * - Move method to base class - * - ... - */ - CodeActionKind.RefactorRewrite = 'refactor.rewrite'; - /** - * Base kind for source actions: `source` - * - * Source code actions apply to the entire file. - */ - CodeActionKind.Source = 'source'; - /** - * Base kind for an organize imports source action: `source.organizeImports` - */ - CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; - /** - * Base kind for auto-fix source actions: `source.fixAll`. - * - * Fix all actions automatically fix errors that have a clear fix that do not require user input. - * They should not suppress errors or perform unsafe fixes such as generating new types or classes. - * - * @since 3.15.0 - */ - CodeActionKind.SourceFixAll = 'source.fixAll'; -})(CodeActionKind || (CodeActionKind = {})); -/** - * The CodeActionContext namespace provides helper functions to work with - * [CodeActionContext](#CodeActionContext) literals. - */ -var CodeActionContext; -(function (CodeActionContext) { - /** - * Creates a new CodeActionContext literal. - */ - function create(diagnostics, only) { - var result = { diagnostics: diagnostics }; - if (only !== void 0 && only !== null) { - result.only = only; - } - return result; - } - CodeActionContext.create = create; - /** - * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)); - } - CodeActionContext.is = is; -})(CodeActionContext || (CodeActionContext = {})); -var CodeAction; -(function (CodeAction) { - function create(title, commandOrEdit, kind) { - var result = { title: title }; - if (Command.is(commandOrEdit)) { - result.command = commandOrEdit; - } - else { - result.edit = commandOrEdit; - } - if (kind !== void 0) { - result.kind = kind; - } - return result; - } - CodeAction.create = create; - function is(value) { - var candidate = value; - return candidate && Is.string(candidate.title) && - (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && - (candidate.kind === void 0 || Is.string(candidate.kind)) && - (candidate.edit !== void 0 || candidate.command !== void 0) && - (candidate.command === void 0 || Command.is(candidate.command)) && - (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && - (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); - } - CodeAction.is = is; -})(CodeAction || (CodeAction = {})); -/** - * The CodeLens namespace provides helper functions to work with - * [CodeLens](#CodeLens) literals. - */ -var CodeLens; -(function (CodeLens) { - /** - * Creates a new CodeLens literal. - */ - function create(range, data) { - var result = { range: range }; - if (Is.defined(data)) { - result.data = data; - } - return result; - } - CodeLens.create = create; - /** - * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); - } - CodeLens.is = is; -})(CodeLens || (CodeLens = {})); -/** - * The FormattingOptions namespace provides helper functions to work with - * [FormattingOptions](#FormattingOptions) literals. - */ -var FormattingOptions; -(function (FormattingOptions) { - /** - * Creates a new FormattingOptions literal. - */ - function create(tabSize, insertSpaces) { - return { tabSize: tabSize, insertSpaces: insertSpaces }; - } - FormattingOptions.create = create; - /** - * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces); - } - FormattingOptions.is = is; -})(FormattingOptions || (FormattingOptions = {})); -/** - * The DocumentLink namespace provides helper functions to work with - * [DocumentLink](#DocumentLink) literals. - */ -var DocumentLink; -(function (DocumentLink) { - /** - * Creates a new DocumentLink literal. - */ - function create(range, target, data) { - return { range: range, target: target, data: data }; - } - DocumentLink.create = create; - /** - * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); - } - DocumentLink.is = is; -})(DocumentLink || (DocumentLink = {})); -/** - * The SelectionRange namespace provides helper function to work with - * SelectionRange literals. - */ -var SelectionRange; -(function (SelectionRange) { - /** - * Creates a new SelectionRange - * @param range the range. - * @param parent an optional parent. - */ - function create(range, parent) { - return { range: range, parent: parent }; - } - SelectionRange.create = create; - function is(value) { - var candidate = value; - return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent)); - } - SelectionRange.is = is; -})(SelectionRange || (SelectionRange = {})); -var EOL = ['\n', '\r\n', '\r']; -/** - * @deprecated Use the text document from the new vscode-languageserver-textdocument package. - */ -var TextDocument; -(function (TextDocument) { - /** - * Creates a new ITextDocument literal from the given uri and content. - * @param uri The document's uri. - * @param languageId The document's language Id. - * @param content The document's content. - */ - function create(uri, languageId, version, content) { - return new FullTextDocument(uri, languageId, version, content); - } - TextDocument.create = create; - /** - * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) - && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; - } - TextDocument.is = is; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits, function (a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; - } - return diff; - }); - var lastModifiedOffset = text.length; - for (var i = sortedEdits.length - 1; i >= 0; i--) { - var e = sortedEdits[i]; - var startOffset = document.offsetAt(e.range.start); - var endOffset = document.offsetAt(e.range.end); - if (endOffset <= lastModifiedOffset) { - text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); - } - else { - throw new Error('Overlapping edit'); - } - lastModifiedOffset = startOffset; - } - return text; - } - TextDocument.applyEdits = applyEdits; - function mergeSort(data, compare) { - if (data.length <= 1) { - // sorted - return data; - } - var p = (data.length / 2) | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare); - mergeSort(right, compare); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - // smaller_equal -> take left to preserve order - data[i++] = left[leftIdx++]; - } - else { - // greater -> take right - data[i++] = right[rightIdx++]; - } - } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; - } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; - } -})(TextDocument || (TextDocument = {})); -var FullTextDocument = /** @class */ (function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = undefined; - } - Object.defineProperty(FullTextDocument.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.prototype.getText = function (range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument.prototype.update = function (event, version) { - this._content = event.text; - this._version = version; - this._lineOffsets = undefined; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === undefined) { - var lineOffsets = []; - var text = this._content; - var isLineStart = true; - for (var i = 0; i < text.length; i++) { - if (isLineStart) { - lineOffsets.push(i); - isLineStart = false; - } - var ch = text.charAt(i); - isLineStart = (ch === '\r' || ch === '\n'); - if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { - i++; - } - } - if (isLineStart && text.length > 0) { - lineOffsets.push(text.length); - } - this._lineOffsets = lineOffsets; - } - return this._lineOffsets; - }; - FullTextDocument.prototype.positionAt = function (offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, high = lineOffsets.length; - if (high === 0) { - return Position.create(0, offset); - } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } - else { - low = mid + 1; - } - } - // low is the least x for which the line offset is larger than the current offset - // or array.length if no line offset is larger than the current offset - var line = low - 1; - return Position.create(line, offset - lineOffsets[line]); - }; - FullTextDocument.prototype.offsetAt = function (position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } - else if (position.line < 0) { - return 0; - } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument.prototype, "lineCount", { - get: function () { - return this.getLineOffsets().length; - }, - enumerable: true, - configurable: true - }); - return FullTextDocument; -}()); -var Is; -(function (Is) { - var toString = Object.prototype.toString; - function defined(value) { - return typeof value !== 'undefined'; - } - Is.defined = defined; - function undefined(value) { - return typeof value === 'undefined'; - } - Is.undefined = undefined; - function boolean(value) { - return value === true || value === false; - } - Is.boolean = boolean; - function string(value) { - return toString.call(value) === '[object String]'; - } - Is.string = string; - function number(value) { - return toString.call(value) === '[object Number]'; - } - Is.number = number; - function func(value) { - return toString.call(value) === '[object Function]'; - } - Is.func = func; - function objectLiteral(value) { - // Strictly speaking class instances pass this check as well. Since the LSP - // doesn't use classes we ignore this for now. If we do we need to add something - // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` - return value !== null && typeof value === 'object'; - } - Is.objectLiteral = objectLiteral; - function typedArray(value, check) { - return Array.isArray(value) && value.every(check); - } - Is.typedArray = typedArray; -})(Is || (Is = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-uri/index.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-uri/index.js ***! - \***********************************************************************************/ -/*! exports provided: URI, uriToFsPath */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "URI", function() { return URI; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uriToFsPath", function() { return uriToFsPath; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var _a; -var isWindows; -if (typeof process === 'object') { - isWindows = process.platform === 'win32'; -} -else if (typeof navigator === 'object') { - var userAgent = navigator.userAgent; - isWindows = userAgent.indexOf('Windows') >= 0; -} -function isHighSurrogate(charCode) { - return (0xD800 <= charCode && charCode <= 0xDBFF); -} -function isLowSurrogate(charCode) { - return (0xDC00 <= charCode && charCode <= 0xDFFF); -} -function isLowerAsciiHex(code) { - return code >= 97 /* a */ && code <= 102 /* f */; -} -function isLowerAsciiLetter(code) { - return code >= 97 /* a */ && code <= 122 /* z */; -} -function isUpperAsciiLetter(code) { - return code >= 65 /* A */ && code <= 90 /* Z */; -} -function isAsciiLetter(code) { - return isLowerAsciiLetter(code) || isUpperAsciiLetter(code); -} -//#endregion -var _schemePattern = /^\w[\w\d+.-]*$/; -var _singleSlashStart = /^\//; -var _doubleSlashStart = /^\/\//; -function _validateUri(ret, _strict) { - // scheme, must be set - if (!ret.scheme && _strict) { - throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); - } - // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 - // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - if (ret.scheme && !_schemePattern.test(ret.scheme)) { - throw new Error('[UriError]: Scheme contains illegal characters.'); - } - // path, http://tools.ietf.org/html/rfc3986#section-3.3 - // If a URI contains an authority component, then the path component - // must either be empty or begin with a slash ("/") character. If a URI - // does not contain an authority component, then the path cannot begin - // with two slash characters ("//"). - if (ret.path) { - if (ret.authority) { - if (!_singleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); - } - } - else { - if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } - } - } -} -// for a while we allowed uris *without* schemes and this is the migration -// for them, e.g. an uri without scheme and without strict-mode warns and falls -// back to the file-scheme. that should cause the least carnage and still be a -// clear warning -function _schemeFix(scheme, _strict) { - if (!scheme && !_strict) { - return 'file'; - } - return scheme; -} -// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 -function _referenceResolution(scheme, path) { - // the slash-character is our 'default base' as we don't - // support constructing URIs relative to other URIs. This - // also means that we alter and potentially break paths. - // see https://tools.ietf.org/html/rfc3986#section-5.1.4 - switch (scheme) { - case 'https': - case 'http': - case 'file': - if (!path) { - path = _slash; - } - else if (path[0] !== _slash) { - path = _slash + path; - } - break; - } - return path; -} -var _empty = ''; -var _slash = '/'; -var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; -/** - * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. - * This class is a simple parser which creates the basic component parts - * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation - * and encoding. - * - * ```txt - * foo://example.com:8042/over/there?name=ferret#nose - * \_/ \______________/\_________/ \_________/ \__/ - * | | | | | - * scheme authority path query fragment - * | _____________________|__ - * / \ / \ - * urn:example:animal:ferret:nose - * ``` - */ -var URI = /** @class */ (function () { - /** - * @internal - */ - function URI(schemeOrData, authority, path, query, fragment, _strict) { - if (_strict === void 0) { _strict = false; } - if (typeof schemeOrData === 'object') { - this.scheme = schemeOrData.scheme || _empty; - this.authority = schemeOrData.authority || _empty; - this.path = schemeOrData.path || _empty; - this.query = schemeOrData.query || _empty; - this.fragment = schemeOrData.fragment || _empty; - // no validation because it's this URI - // that creates uri components. - // _validateUri(this); - } - else { - this.scheme = _schemeFix(schemeOrData, _strict); - this.authority = authority || _empty; - this.path = _referenceResolution(this.scheme, path || _empty); - this.query = query || _empty; - this.fragment = fragment || _empty; - _validateUri(this, _strict); - } - } - URI.isUri = function (thing) { - if (thing instanceof URI) { - return true; - } - if (!thing) { - return false; - } - return typeof thing.authority === 'string' - && typeof thing.fragment === 'string' - && typeof thing.path === 'string' - && typeof thing.query === 'string' - && typeof thing.scheme === 'string' - && typeof thing.fsPath === 'function' - && typeof thing.with === 'function' - && typeof thing.toString === 'function'; - }; - Object.defineProperty(URI.prototype, "fsPath", { - // ---- filesystem path ----------------------- - /** - * Returns a string representing the corresponding file system path of this URI. - * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the - * platform specific path separator. - * - * * Will *not* validate the path for invalid characters and semantics. - * * Will *not* look at the scheme of this URI. - * * The result shall *not* be used for display purposes but for accessing a file on disk. - * - * - * The *difference* to `URI#path` is the use of the platform specific separator and the handling - * of UNC paths. See the below sample of a file-uri with an authority (UNC path). - * - * ```ts - const u = URI.parse('file://server/c$/folder/file.txt') - u.authority === 'server' - u.path === '/shares/c$/file.txt' - u.fsPath === '\\server\c$\folder\file.txt' - ``` - * - * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, - * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working - * with URIs that represent files on disk (`file` scheme). - */ - get: function () { - // if (this.scheme !== 'file') { - // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); - // } - return uriToFsPath(this, false); - }, - enumerable: true, - configurable: true - }); - // ---- modify to new ------------------------- - URI.prototype.with = function (change) { - if (!change) { - return this; - } - var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; - if (scheme === undefined) { - scheme = this.scheme; - } - else if (scheme === null) { - scheme = _empty; - } - if (authority === undefined) { - authority = this.authority; - } - else if (authority === null) { - authority = _empty; - } - if (path === undefined) { - path = this.path; - } - else if (path === null) { - path = _empty; - } - if (query === undefined) { - query = this.query; - } - else if (query === null) { - query = _empty; - } - if (fragment === undefined) { - fragment = this.fragment; - } - else if (fragment === null) { - fragment = _empty; - } - if (scheme === this.scheme - && authority === this.authority - && path === this.path - && query === this.query - && fragment === this.fragment) { - return this; - } - return new _URI(scheme, authority, path, query, fragment); - }; - // ---- parse & validate ------------------------ - /** - * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, - * `file:///usr/home`, or `scheme:with/path`. - * - * @param value A string which represents an URI (see `URI#toString`). - */ - URI.parse = function (value, _strict) { - if (_strict === void 0) { _strict = false; } - var match = _regexp.exec(value); - if (!match) { - return new _URI(_empty, _empty, _empty, _empty, _empty); - } - return new _URI(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict); - }; - /** - * Creates a new URI from a file system path, e.g. `c:\my\files`, - * `/usr/home`, or `\\server\share\some\path`. - * - * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument - * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** - * `URI.parse('file://' + path)` because the path might contain characters that are - * interpreted (# and ?). See the following sample: - * ```ts - const good = URI.file('/coding/c#/project1'); - good.scheme === 'file'; - good.path === '/coding/c#/project1'; - good.fragment === ''; - const bad = URI.parse('file://' + '/coding/c#/project1'); - bad.scheme === 'file'; - bad.path === '/coding/c'; // path is now broken - bad.fragment === '/project1'; - ``` - * - * @param path A file system path (see `URI#fsPath`) - */ - URI.file = function (path) { - var authority = _empty; - // normalize to fwd-slashes on windows, - // on other systems bwd-slashes are valid - // filename character, eg /f\oo/ba\r.txt - if (isWindows) { - path = path.replace(/\\/g, _slash); - } - // check for authority as used in UNC shares - // or use the path as given - if (path[0] === _slash && path[1] === _slash) { - var idx = path.indexOf(_slash, 2); - if (idx === -1) { - authority = path.substring(2); - path = _slash; - } - else { - authority = path.substring(2, idx); - path = path.substring(idx) || _slash; - } - } - return new _URI('file', authority, path, _empty, _empty); - }; - URI.from = function (components) { - return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); - }; - // /** - // * Join a URI path with path fragments and normalizes the resulting path. - // * - // * @param uri The input URI. - // * @param pathFragment The path fragment to add to the URI path. - // * @returns The resulting URI. - // */ - // static joinPath(uri: URI, ...pathFragment: string[]): URI { - // if (!uri.path) { - // throw new Error(`[UriError]: cannot call joinPaths on URI without path`); - // } - // let newPath: string; - // if (isWindows && uri.scheme === 'file') { - // newPath = URI.file(paths.win32.join(uriToFsPath(uri, true), ...pathFragment)).path; - // } else { - // newPath = paths.posix.join(uri.path, ...pathFragment); - // } - // return uri.with({ path: newPath }); - // } - // ---- printing/externalize --------------------------- - /** - * Creates a string representation for this URI. It's guaranteed that calling - * `URI.parse` with the result of this function creates an URI which is equal - * to this URI. - * - * * The result shall *not* be used for display purposes but for externalization or transport. - * * The result will be encoded using the percentage encoding and encoding happens mostly - * ignore the scheme-specific encoding rules. - * - * @param skipEncoding Do not encode the result, default is `false` - */ - URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - return _asFormatted(this, skipEncoding); - }; - URI.prototype.toJSON = function () { - return this; - }; - URI.revive = function (data) { - if (!data) { - return data; - } - else if (data instanceof URI) { - return data; - } - else { - var result = new _URI(data); - result._formatted = data.external; - result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null; - return result; - } - }; - return URI; -}()); - -var _pathSepMarker = isWindows ? 1 : undefined; -// eslint-disable-next-line @typescript-eslint/class-name-casing -var _URI = /** @class */ (function (_super) { - __extends(_URI, _super); - function _URI() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._formatted = null; - _this._fsPath = null; - return _this; - } - Object.defineProperty(_URI.prototype, "fsPath", { - get: function () { - if (!this._fsPath) { - this._fsPath = uriToFsPath(this, false); - } - return this._fsPath; - }, - enumerable: true, - configurable: true - }); - _URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - if (!skipEncoding) { - if (!this._formatted) { - this._formatted = _asFormatted(this, false); - } - return this._formatted; - } - else { - // we don't cache that - return _asFormatted(this, true); - } - }; - _URI.prototype.toJSON = function () { - var res = { - $mid: 1 - }; - // cached state - if (this._fsPath) { - res.fsPath = this._fsPath; - res._sep = _pathSepMarker; - } - if (this._formatted) { - res.external = this._formatted; - } - // uri components - if (this.path) { - res.path = this.path; - } - if (this.scheme) { - res.scheme = this.scheme; - } - if (this.authority) { - res.authority = this.authority; - } - if (this.query) { - res.query = this.query; - } - if (this.fragment) { - res.fragment = this.fragment; - } - return res; - }; - return _URI; -}(URI)); -// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 -var encodeTable = (_a = {}, - _a[58 /* Colon */] = '%3A', - _a[47 /* Slash */] = '%2F', - _a[63 /* QuestionMark */] = '%3F', - _a[35 /* Hash */] = '%23', - _a[91 /* OpenSquareBracket */] = '%5B', - _a[93 /* CloseSquareBracket */] = '%5D', - _a[64 /* AtSign */] = '%40', - _a[33 /* ExclamationMark */] = '%21', - _a[36 /* DollarSign */] = '%24', - _a[38 /* Ampersand */] = '%26', - _a[39 /* SingleQuote */] = '%27', - _a[40 /* OpenParen */] = '%28', - _a[41 /* CloseParen */] = '%29', - _a[42 /* Asterisk */] = '%2A', - _a[43 /* Plus */] = '%2B', - _a[44 /* Comma */] = '%2C', - _a[59 /* Semicolon */] = '%3B', - _a[61 /* Equals */] = '%3D', - _a[32 /* Space */] = '%20', - _a); -function encodeURIComponentFast(uriComponent, allowSlash) { - var res = undefined; - var nativeEncodePos = -1; - for (var pos = 0; pos < uriComponent.length; pos++) { - var code = uriComponent.charCodeAt(pos); - // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 - if ((code >= 97 /* a */ && code <= 122 /* z */) - || (code >= 65 /* A */ && code <= 90 /* Z */) - || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) - || code === 45 /* Dash */ - || code === 46 /* Period */ - || code === 95 /* Underline */ - || code === 126 /* Tilde */ - || (allowSlash && code === 47 /* Slash */)) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // check if we write into a new string (by default we try to return the param) - if (res !== undefined) { - res += uriComponent.charAt(pos); - } - } - else { - // encoding needed, we need to allocate a new string - if (res === undefined) { - res = uriComponent.substr(0, pos); - } - // check with default table first - var escaped = encodeTable[code]; - if (escaped !== undefined) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // append escaped variant to result - res += escaped; - } - else if (nativeEncodePos === -1) { - // use native encode only when needed - nativeEncodePos = pos; - } - } - } - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); - } - return res !== undefined ? res : uriComponent; -} -function encodeURIComponentMinimal(path) { - var res = undefined; - for (var pos = 0; pos < path.length; pos++) { - var code = path.charCodeAt(pos); - if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { - if (res === undefined) { - res = path.substr(0, pos); - } - res += encodeTable[code]; - } - else { - if (res !== undefined) { - res += path[pos]; - } - } - } - return res !== undefined ? res : path; -} -/** - * Compute `fsPath` for the given uri - */ -function uriToFsPath(uri, keepDriveLetterCasing) { - var value; - if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { - // unc path: file://shares/c$/far/boo - value = "//" + uri.authority + uri.path; - } - else if (uri.path.charCodeAt(0) === 47 /* Slash */ - && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) - && uri.path.charCodeAt(2) === 58 /* Colon */) { - if (!keepDriveLetterCasing) { - // windows drive letter: file:///c:/far/boo - value = uri.path[1].toLowerCase() + uri.path.substr(2); - } - else { - value = uri.path.substr(1); - } - } - else { - // other path - value = uri.path; - } - if (isWindows) { - value = value.replace(/\//g, '\\'); - } - return value; -} -/** - * Create the external version of a uri - */ -function _asFormatted(uri, skipEncoding) { - var encoder = !skipEncoding - ? encodeURIComponentFast - : encodeURIComponentMinimal; - var res = ''; - var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; - if (scheme) { - res += scheme; - res += ':'; - } - if (authority || scheme === 'file') { - res += _slash; - res += _slash; - } - if (authority) { - var idx = authority.indexOf('@'); - if (idx !== -1) { - // @ - var userinfo = authority.substr(0, idx); - authority = authority.substr(idx + 1); - idx = userinfo.indexOf(':'); - if (idx === -1) { - res += encoder(userinfo, false); - } - else { - // :@ - res += encoder(userinfo.substr(0, idx), false); - res += ':'; - res += encoder(userinfo.substr(idx + 1), false); - } - res += '@'; - } - authority = authority.toLowerCase(); - idx = authority.indexOf(':'); - if (idx === -1) { - res += encoder(authority, false); - } - else { - // : - res += encoder(authority.substr(0, idx), false); - res += authority.substr(idx); - } - } - if (path) { - // lower-case windows drive letters in /C:/fff or C:/fff - if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { - var code = path.charCodeAt(1); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 - } - } - else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { - var code = path.charCodeAt(0); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 - } - } - // encode the rest of the path - res += encoder(path, true); - } - if (query) { - res += '?'; - res += encoder(query, false); - } - if (fragment) { - res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; - } - return res; -} -// --- decode -function decodeURIComponentGraceful(str) { - try { - return decodeURIComponent(str); - } - catch (_a) { - if (str.length > 3) { - return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3)); - } - else { - return str; - } - } -} -var _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g; -function percentDecode(str) { - if (!str.match(_rEncodedAsHex)) { - return str; - } - return str.replace(_rEncodedAsHex, function (match) { return decodeURIComponentGraceful(match); }); -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../process/browser.js */ "./node_modules/process/browser.js"))) - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js ***! - \*******************************************************************************/ -/*! exports provided: loadMessageBundle, config */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadMessageBundle", function() { return loadMessageBundle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return config; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function format(message, args) { - var result; - if (args.length === 0) { - result = message; - } - else { - result = message.replace(/\{(\d+)\}/g, function (match, rest) { - var index = rest[0]; - return typeof args[index] !== 'undefined' ? args[index] : match; - }); - } - return result; -} -function localize(key, message) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - return format(message, args); -} -function loadMessageBundle(file) { - return localize; -} -function config(opt) { - return loadMessageBundle; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/json.worker.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/json.worker.js ***! - \************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _editor_editor_worker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.worker.js */ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js"); -/* harmony import */ var _jsonWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonWorker.js */ "./node_modules/monaco-editor/esm/vs/language/json/jsonWorker.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -self.onmessage = function () { - // ignore the first message - _editor_editor_worker_js__WEBPACK_IMPORTED_MODULE_0__["initialize"](function (ctx, createData) { - return new _jsonWorker_js__WEBPACK_IMPORTED_MODULE_1__["JSONWorker"](ctx, createData); - }); -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/jsonWorker.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/jsonWorker.js ***! - \***********************************************************************/ -/*! exports provided: JSONWorker, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONWorker", function() { return JSONWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _deps_vscode_json_languageservice_jsonLanguageService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_deps/vscode-json-languageservice/jsonLanguageService.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageService.js"); -/* harmony import */ var _deps_vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_deps/vscode-uri/index.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-uri/index.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (undefined && undefined.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; - - -var defaultSchemaRequestService; -if (typeof fetch !== 'undefined') { - defaultSchemaRequestService = function (url) { - return fetch(url).then(function (response) { return response.text(); }); - }; -} -var JSONWorker = /** @class */ (function () { - function JSONWorker(ctx, createData) { - this._ctx = ctx; - this._languageSettings = createData.languageSettings; - this._languageId = createData.languageId; - this._languageService = _deps_vscode_json_languageservice_jsonLanguageService_js__WEBPACK_IMPORTED_MODULE_0__["getLanguageService"]({ - workspaceContext: { - resolveRelativePath: function (relativePath, resource) { - var base = resource.substr(0, resource.lastIndexOf('/') + 1); - return resolvePath(base, relativePath); - } - }, - schemaRequestService: createData.enableSchemaRequest && defaultSchemaRequestService - }); - this._languageService.configure(this._languageSettings); - } - JSONWorker.prototype.doValidation = function (uri) { - return __awaiter(this, void 0, void 0, function () { - var document, jsonDocument; - return __generator(this, function (_a) { - document = this._getTextDocument(uri); - if (document) { - jsonDocument = this._languageService.parseJSONDocument(document); - return [2 /*return*/, this._languageService.doValidation(document, jsonDocument)]; - } - return [2 /*return*/, Promise.resolve([])]; - }); - }); - }; - JSONWorker.prototype.doComplete = function (uri, position) { - return __awaiter(this, void 0, void 0, function () { - var document, jsonDocument; - return __generator(this, function (_a) { - document = this._getTextDocument(uri); - jsonDocument = this._languageService.parseJSONDocument(document); - return [2 /*return*/, this._languageService.doComplete(document, position, jsonDocument)]; - }); - }); - }; - JSONWorker.prototype.doResolve = function (item) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this._languageService.doResolve(item)]; - }); - }); - }; - JSONWorker.prototype.doHover = function (uri, position) { - return __awaiter(this, void 0, void 0, function () { - var document, jsonDocument; - return __generator(this, function (_a) { - document = this._getTextDocument(uri); - jsonDocument = this._languageService.parseJSONDocument(document); - return [2 /*return*/, this._languageService.doHover(document, position, jsonDocument)]; - }); - }); - }; - JSONWorker.prototype.format = function (uri, range, options) { - return __awaiter(this, void 0, void 0, function () { - var document, textEdits; - return __generator(this, function (_a) { - document = this._getTextDocument(uri); - textEdits = this._languageService.format(document, range, options); - return [2 /*return*/, Promise.resolve(textEdits)]; - }); - }); - }; - JSONWorker.prototype.resetSchema = function (uri) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, Promise.resolve(this._languageService.resetSchema(uri))]; - }); - }); - }; - JSONWorker.prototype.findDocumentSymbols = function (uri) { - return __awaiter(this, void 0, void 0, function () { - var document, jsonDocument, symbols; - return __generator(this, function (_a) { - document = this._getTextDocument(uri); - jsonDocument = this._languageService.parseJSONDocument(document); - symbols = this._languageService.findDocumentSymbols(document, jsonDocument); - return [2 /*return*/, Promise.resolve(symbols)]; - }); - }); - }; - JSONWorker.prototype.findDocumentColors = function (uri) { - return __awaiter(this, void 0, void 0, function () { - var document, jsonDocument, colorSymbols; - return __generator(this, function (_a) { - document = this._getTextDocument(uri); - jsonDocument = this._languageService.parseJSONDocument(document); - colorSymbols = this._languageService.findDocumentColors(document, jsonDocument); - return [2 /*return*/, Promise.resolve(colorSymbols)]; - }); - }); - }; - JSONWorker.prototype.getColorPresentations = function (uri, color, range) { - return __awaiter(this, void 0, void 0, function () { - var document, jsonDocument, colorPresentations; - return __generator(this, function (_a) { - document = this._getTextDocument(uri); - jsonDocument = this._languageService.parseJSONDocument(document); - colorPresentations = this._languageService.getColorPresentations(document, jsonDocument, color, range); - return [2 /*return*/, Promise.resolve(colorPresentations)]; - }); - }); - }; - JSONWorker.prototype.getFoldingRanges = function (uri, context) { - return __awaiter(this, void 0, void 0, function () { - var document, ranges; - return __generator(this, function (_a) { - document = this._getTextDocument(uri); - ranges = this._languageService.getFoldingRanges(document, context); - return [2 /*return*/, Promise.resolve(ranges)]; - }); - }); - }; - JSONWorker.prototype.getSelectionRanges = function (uri, positions) { - return __awaiter(this, void 0, void 0, function () { - var document, jsonDocument, ranges; - return __generator(this, function (_a) { - document = this._getTextDocument(uri); - jsonDocument = this._languageService.parseJSONDocument(document); - ranges = this._languageService.getSelectionRanges(document, positions, jsonDocument); - return [2 /*return*/, Promise.resolve(ranges)]; - }); - }); - }; - JSONWorker.prototype._getTextDocument = function (uri) { - var models = this._ctx.getMirrorModels(); - for (var _i = 0, models_1 = models; _i < models_1.length; _i++) { - var model = models_1[_i]; - if (model.uri.toString() === uri) { - return _deps_vscode_json_languageservice_jsonLanguageService_js__WEBPACK_IMPORTED_MODULE_0__["TextDocument"].create(uri, this._languageId, model.version, model.getValue()); - } - } - return null; - }; - return JSONWorker; -}()); - -// URI path utilities, will (hopefully) move to vscode-uri -var Slash = '/'.charCodeAt(0); -var Dot = '.'.charCodeAt(0); -function isAbsolutePath(path) { - return path.charCodeAt(0) === Slash; -} -function resolvePath(uriString, path) { - if (isAbsolutePath(path)) { - var uri = _deps_vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_1__["URI"].parse(uriString); - var parts = path.split('/'); - return uri.with({ path: normalizePath(parts) }).toString(); - } - return joinPath(uriString, path); -} -function normalizePath(parts) { - var newParts = []; - for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) { - var part = parts_1[_i]; - if (part.length === 0 || (part.length === 1 && part.charCodeAt(0) === Dot)) { - // ignore - } - else if (part.length === 2 && part.charCodeAt(0) === Dot && part.charCodeAt(1) === Dot) { - newParts.pop(); - } - else { - newParts.push(part); - } - } - if (parts.length > 1 && parts[parts.length - 1].length === 0) { - newParts.push(''); - } - var res = newParts.join('/'); - if (parts[0].length === 0) { - res = '/' + res; - } - return res; -} -function joinPath(uriString) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - var uri = _deps_vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_1__["URI"].parse(uriString); - var parts = uri.path.split('/'); - for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { - var path = paths_1[_a]; - parts.push.apply(parts, path.split('/')); - } - return uri.with({ path: normalizePath(parts) }).toString(); -} -function create(ctx, createData) { - return new JSONWorker(ctx, createData); -} - - -/***/ }), - -/***/ "./node_modules/process/browser.js": -/*!*****************************************!*\ - !*** ./node_modules/process/browser.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), - -/***/ "./node_modules/webpack/buildin/global.js": -/*!***********************************!*\ - !*** (webpack)/buildin/global.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || new Function("return this")(); -} catch (e) { - // This works if the window reference is available - if (typeof window === "object") g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }) - -/******/ }); -//# sourceMappingURL=json.worker.js.map \ No newline at end of file +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";(function(e,r){n.d(t,"d",(function(){return p})),n.d(t,"b",(function(){return v})),n.d(t,"c",(function(){return y})),n.d(t,"a",(function(){return b})),n.d(t,"e",(function(){return C}));let i=!1,o=!1,s=!1,a=!1,u=!1,l=!1,c=void 0,h="en",f=void 0,d=void 0;const m=void 0!==e&&void 0!==e.versions&&void 0!==e.versions.electron&&"renderer"===e.type;if("object"!=typeof navigator||m){if("object"==typeof e){i="win32"===e.platform,o="darwin"===e.platform,s="linux"===e.platform,c="en",h="en";const t=e.env.VSCODE_NLS_CONFIG;if(t)try{const e=JSON.parse(t),n=e.availableLanguages["*"];c=e.locale,h=n||"en",f=e._translationsConfigFile}catch(e){}a=!0}}else i=(d=navigator.userAgent).indexOf("Windows")>=0,o=d.indexOf("Macintosh")>=0,l=(d.indexOf("Macintosh")>=0||d.indexOf("iPad")>=0||d.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,s=d.indexOf("Linux")>=0,u=!0,h=c=navigator.language;let g=0;o?g=1:i?g=3:s&&(g=2);const p=i,v=o,y=u,b="object"==typeof self?self:"object"==typeof r?r:{},C=function(){if(b.setImmediate)return b.setImmediate.bind(b);if("function"==typeof b.postMessage&&!b.importScripts){let e=[];b.addEventListener("message",t=>{if(t.data&&t.data.vscodeSetImmediateId)for(let n=0,r=e.length;n{const r=++t;e.push({id:r,callback:n}),b.postMessage({vscodeSetImmediateId:r},"*")}}if(void 0!==e&&"function"==typeof e.nextTick)return e.nextTick.bind(e);const t=Promise.resolve();return e=>t.then(e)}()}).call(this,n(3),n(4))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return a}));var r=n(0);const i=void 0===e?{cwd:()=>"/",env:Object.create(null),get platform(){return r.d?"win32":r.b?"darwin":"linux"},nextTick:e=>Object(r.e)(e)}:e,o=i.cwd,s=i.env,a=i.platform}).call(this,n(3))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return m}));var r,i,o,s=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});if("object"==typeof e)o="win32"===e.platform;else if("object"==typeof navigator){var a=navigator.userAgent;o=a.indexOf("Windows")>=0}var u=/^\w[\w\d+.-]*$/,l=/^\//,c=/^\/\//;var h="",f="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,m=function(){function e(e,t,n,r,i,o){void 0===o&&(o=!1),"object"==typeof e?(this.scheme=e.scheme||h,this.authority=e.authority||h,this.path=e.path||h,this.query=e.query||h,this.fragment=e.fragment||h):(this.scheme=function(e,t){return e||t?e:"file"}(e,o),this.authority=t||h,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==f&&(t=f+t):t=f}return t}(this.scheme,n||h),this.query=r||h,this.fragment=i||h,function(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');if(e.scheme&&!u.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!l.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(c.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,o))}return e.isUri=function(t){return t instanceof e||!!t&&("string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"function"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString)},Object.defineProperty(e.prototype,"fsPath",{get:function(){return C(this,!1)},enumerable:!0,configurable:!0}),e.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,i=e.query,o=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=h),void 0===n?n=this.authority:null===n&&(n=h),void 0===r?r=this.path:null===r&&(r=h),void 0===i?i=this.query:null===i&&(i=h),void 0===o?o=this.fragment:null===o&&(o=h),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new p(t,n,r,i,o)},e.parse=function(e,t){void 0===t&&(t=!1);var n=d.exec(e);return n?new p(n[2]||h,E(n[4]||h),E(n[5]||h),E(n[7]||h),E(n[9]||h),t):new p(h,h,h,h,h)},e.file=function(e){var t=h;if(o&&(e=e.replace(/\\/g,f)),e[0]===f&&e[1]===f){var n=e.indexOf(f,2);-1===n?(t=e.substring(2),e=f):(t=e.substring(2,n),e=e.substring(n)||f)}return new p("file",t,e,h,h)},e.from=function(e){return new p(e.scheme,e.authority,e.path,e.query,e.fragment)},e.prototype.toString=function(e){return void 0===e&&(e=!1),_(this,e)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var n=new p(t);return n._formatted=t.external,n._fsPath=t._sep===g?t.fsPath:null,n}return t},e}(),g=o?1:void 0,p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return s(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=C(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?_(this,!0):(this._formatted||(this._formatted=_(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=g),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(m),v=((i={})[58]="%3A",i[47]="%2F",i[63]="%3F",i[35]="%23",i[91]="%5B",i[93]="%5D",i[64]="%40",i[33]="%21",i[36]="%24",i[38]="%26",i[39]="%27",i[40]="%28",i[41]="%29",i[42]="%2A",i[43]="%2B",i[44]="%2C",i[59]="%3B",i[61]="%3D",i[32]="%20",i);function y(e,t){for(var n=void 0,r=-1,i=0;i=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o)-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),void 0!==n&&(n+=e.charAt(i));else{void 0===n&&(n=e.substr(0,i));var s=v[o];void 0!==s?(-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),n+=s):-1===r&&(r=i)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function b(e){for(var t=void 0,n=0;n1&&"file"===e.scheme?"//"+e.authority+e.path:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,o&&(n=n.replace(/\//g,"\\")),n}function _(e,t){var n=t?b:y,r="",i=e.scheme,o=e.authority,s=e.path,a=e.query,u=e.fragment;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=f,r+=f),o){var l=o.indexOf("@");if(-1!==l){var c=o.substr(0,l);o=o.substr(l+1),-1===(l=c.indexOf(":"))?r+=n(c,!1):(r+=n(c.substr(0,l),!1),r+=":",r+=n(c.substr(l+1),!1)),r+="@"}-1===(l=(o=o.toLowerCase()).indexOf(":"))?r+=n(o,!1):(r+=n(o.substr(0,l),!1),r+=o.substr(l))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(h=s.charCodeAt(1))>=65&&h<=90&&(s="/"+String.fromCharCode(h+32)+":"+s.substr(3));else if(s.length>=2&&58===s.charCodeAt(1)){var h;(h=s.charCodeAt(0))>=65&&h<=90&&(s=String.fromCharCode(h+32)+":"+s.substr(2))}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),u&&(r+="#",r+=t?u:y(u,!1)),r}var S=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function E(e){return e.match(S)?e.replace(S,(function(e){return function e(t){try{return decodeURIComponent(t)}catch(n){return t.length>3?t.substr(0,3)+e(t.substr(3)):t}}(e)})):e}}).call(this,n(3))},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var u,l=[],c=!1,h=-1;function f(){c&&u&&(c=!1,u.length?l=u.concat(l):h=-1,l.length&&d())}function d(){if(!c){var e=a(f);c=!0;for(var t=l.length;t;){for(u=l,l=[];++h1)for(var n=1;n{if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function i(e){a(e)||r.onUnexpectedError(e)}function o(e){if(e instanceof Error){let{name:t,message:n}=e;return{$isError:!0,name:t,message:n,stack:e.stacktrace||e.stack}}return e}const s="Canceled";function a(e){return e instanceof Error&&e.name===s&&e.message===s}var u;!function(e){e.is=function(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]};const t=Object.freeze([]);e.empty=function(){return t},e.single=function*(e){yield e},e.from=function(e){return e||t},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const n of e)if(t(n))return!0;return!1},e.filter=function*(e,t){for(const n of e)t(n)&&(yield n)},e.map=function*(e,t){for(const n of e)yield t(n)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.consume=function(t,n=Number.POSITIVE_INFINITY){const r=[];if(0===n)return[r,t];const i=t[Symbol.iterator]();for(let t=0;ti}]}}(u||(u={}));const l=!1,c="__is_disposable_tracked__";function h(e){if(l&&e&&e!==p.None)try{e[c]=!0}catch(e){}}function f(e){if(!l)return e;const t=new Error("Potentially leaked disposable").stack;return setTimeout(()=>{e[c]||console.log(t)},3e3),e}class d extends Error{constructor(e){super(`Encounter errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function m(e){if(u.is(e)){let t=[];for(const n of e)if(n){h(n);try{n.dispose()}catch(e){t.push(e)}}if(1===t.length)throw t[0];if(t.length>1)throw new d(t);return Array.isArray(e)?[]:e}if(e)return h(e),e.dispose(),e}class g{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(h(this),this._isDisposed=!0,this.clear())}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return h(e),this._isDisposed?g.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}}g.DISABLE_DISPOSED_WARNING=!1;class p{constructor(){this._store=new g,f(this)}dispose(){h(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}p.None=Object.freeze({dispose(){}});var v=n(0);function y(e){const t=[];for(const n of function(e){let t=[],n=Object.getPrototypeOf(e);for(;Object.prototype!==n;)t=t.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return t}(e))"function"==typeof e[n]&&t.push(n);return t}function b(e,t){const n=e=>(function(){const n=Array.prototype.slice.call(arguments,0);return t(e,n)});let r={};for(const t of e)r[t]=n(t);return r}const C="$initialize";class _{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null)}setWorkerId(e){this._workerId=e}sendMessage(e,t){let n=String(++this._lastSentReq);return new Promise((r,i)=>{this._pendingReplies[n]={resolve:r,reject:i},this._send({vsWorker:this._workerId,req:n,method:e,args:t})})}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}_handleMessage(e){if(e.seq){let t=e;if(!this._pendingReplies[t.seq])return void console.warn("Got reply to unknown seq");let n=this._pendingReplies[t.seq];if(delete this._pendingReplies[t.seq],t.err){let e=t.err;return t.err.$isError&&((e=new Error).name=t.err.name,e.message=t.err.message,e.stack=t.err.stack),void n.reject(e)}return void n.resolve(t.res)}let t=e,n=t.req;this._handler.handleMessage(t.method,t.args).then(e=>{this._send({vsWorker:this._workerId,seq:n,res:e,err:void 0})},e=>{e.detail instanceof Error&&(e.detail=o(e.detail)),this._send({vsWorker:this._workerId,seq:n,res:void 0,err:o(e)})})}_send(e){let t=[];if(e.req){const n=e;for(let e=0;e{e(t,n)},handleMessage:(e,t)=>this._handleMessage(e,t)})}onmessage(e){this._protocol.handleMessage(e)}_handleMessage(e,t){if(e===C)return this.initialize(t[0],t[1],t[2],t[3]);if(!this._requestHandler||"function"!=typeof this._requestHandler[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._requestHandler[e].apply(this._requestHandler,t))}catch(e){return Promise.reject(e)}}initialize(e,t,n,r){this._protocol.setWorkerId(e);const i=b(r,(e,t)=>this._protocol.sendMessage(e,t));return this._requestHandlerFactory?(this._requestHandler=this._requestHandlerFactory(i),Promise.resolve(y(this._requestHandler))):(t&&(void 0!==t.baseUrl&&delete t.baseUrl,void 0!==t.paths&&void 0!==t.paths.vs&&delete t.paths.vs,t.catchError=!0,self.require.config(t)),new Promise((e,t)=>{self.require([n],n=>{this._requestHandler=n.create(i),this._requestHandler?e(y(this._requestHandler)):t(new Error("No RequestHandler!"))},t)}))}}function E(e,t){return function e(t,n,r,i,o){if(i<=r)return;const s=r+(i-r)/2|0;if(e(t,n,r,s,o),e(t,n,s+1,i,o),n(t[s],t[s+1])<=0)return;!function(e,t,n,r,i,o){let s=n,a=r+1;for(let t=n;t<=i;t++)o[t]=e[t];for(let u=n;u<=i;u++)s>r?e[u]=o[a++]:a>i?e[u]=o[s++]:t(o[a],o[s])<0?e[u]=o[a++]:e[u]=o[s++]}(t,n,r,s,i,o)}(e,t,0,e.length-1,[]),e}class A{constructor(e,t,n,r){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function x(e){return 55296<=e&&e<=56319}function N(e){return 56320<=e&&e<=57343}function w(e,t){return t-56320+(e-55296<<10)+65536}String.fromCharCode(65279);class L{constructor(){this._data=JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}static getInstance(){return L._INSTANCE||(L._INSTANCE=new L),L._INSTANCE}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let r=1;for(;r<=n;)if(et[3*r+1]))return t[3*r+2];r=2*r+1}return 0}}function T(e,t){return(t<<5)-t+e|0}function k(e,t){t=T(149417,t);for(let n=0,r=e.length;n>>r)>>>0}function I(e,t=0,n=e.byteLength,r=0){for(let i=0;i>>0).toString(16),t/4)}L._INSTANCE=null;class P{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const n=this._buff;let r,i,o=this._buffLen,s=this._leftoverHighSurrogate;for(0!==s?(r=s,i=-1,s=0):(r=e.charCodeAt(0),i=0);;){let a=r;if(x(r)){if(!(i+1>>6,e[t++]=128|(63&n)>>>0):n<65536?(e[t++]=224|(61440&n)>>>12,e[t++]=128|(4032&n)>>>6,e[t++]=128|(63&n)>>>0):(e[t++]=240|(1835008&n)>>>18,e[t++]=128|(258048&n)>>>12,e[t++]=128|(4032&n)>>>6,e[t++]=128|(63&n)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),M(this._h0)+M(this._h1)+M(this._h2)+M(this._h3)+M(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,I(this._buff,this._buffLen),this._buffLen>56&&(this._step(),I(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=P._bigBlock32,t=this._buffDV;for(let n=0;n<64;n+=4)e.setUint32(n,t.getUint32(n,!1),!1);for(let t=64;t<320;t+=4)e.setUint32(t,O(e.getUint32(t-12,!1)^e.getUint32(t-32,!1)^e.getUint32(t-56,!1)^e.getUint32(t-64,!1),1),!1);let n,r,i,o=this._h0,s=this._h1,a=this._h2,u=this._h3,l=this._h4;for(let t=0;t<80;t++)t<20?(n=s&a|~s&u,r=1518500249):t<40?(n=s^a^u,r=1859775393):t<60?(n=s&a|s&u|a&u,r=2400959708):(n=s^a^u,r=3395469782),i=O(o,5)+n+l+r+e.getUint32(4*t,!1)&4294967295,l=u,u=a,a=O(s,30),s=o,o=i;this._h0=this._h0+o&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+u&4294967295,this._h4=this._h4+l&4294967295}}P._bigBlock32=new DataView(new ArrayBuffer(320));class R{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,r=e.length;n0||this.m_modifiedCount>0)&&this.m_changes.push(new A(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class V{constructor(e,t,n=null){this.ContinueProcessingPredicate=n;const[r,i,o]=V._getElements(e),[s,a,u]=V._getElements(t);this._hasStrings=o&&u,this._originalStringElements=r,this._originalElementsOrHash=i,this._modifiedStringElements=s,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(V._isStringArray(t)){const e=new Int32Array(t.length);for(let n=0,r=t.length;n=e&&r>=n&&this.ElementsAreEqual(t,r);)t--,r--;if(e>t||n>r){let i;return n<=r?(F.Assert(e===t+1,"originalStart should only be one more than originalEnd"),i=[new A(e,0,n,r-n+1)]):e<=t?(F.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),i=[new A(e,t-e+1,n,0)]):(F.Assert(e===t+1,"originalStart should only be one more than originalEnd"),F.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),i=[]),i}const o=[0],s=[0],a=this.ComputeRecursionPoint(e,t,n,r,o,s,i),u=o[0],l=s[0];if(null!==a)return a;if(!i[0]){const o=this.ComputeDiffRecursive(e,u,n,l,i);let s=[];return s=i[0]?[new A(u+1,t-(u+1)+1,l+1,r-(l+1)+1)]:this.ComputeDiffRecursive(u+1,t,l+1,r,i),this.ConcatenateChanges(o,s)}return[new A(e,t-e+1,n,r-n+1)]}WALKTRACE(e,t,n,r,i,o,s,a,u,l,c,h,f,d,m,g,p,v){let y=null,b=null,C=new U,_=t,S=n,E=f[0]-g[0]-r,x=-1073741824,N=this.m_forwardHistory.length-1;do{const t=E+e;t===_||t=0&&(e=(u=this.m_forwardHistory[N])[0],_=1,S=u.length-1)}while(--N>=-1);if(y=C.getReverseChanges(),v[0]){let e=f[0]+1,t=g[0]+1;if(null!==y&&y.length>0){const n=y[y.length-1];e=Math.max(e,n.getOriginalEnd()),t=Math.max(t,n.getModifiedEnd())}b=[new A(e,h-e+1,t,m-t+1)]}else{C=new U,_=o,S=s,E=f[0]-g[0]-a,x=1073741824,N=p?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=E+i;e===_||e=l[e+1]?(d=(c=l[e+1]-1)-E-a,c>x&&C.MarkNextChange(),x=c+1,C.AddOriginalElement(c+1,d+1),E=e+1-i):(d=(c=l[e-1])-E-a,c>x&&C.MarkNextChange(),x=c,C.AddModifiedElement(c+1,d+1),E=e-1-i),N>=0&&(i=(l=this.m_reverseHistory[N])[0],_=1,S=l.length-1)}while(--N>=-1);b=C.getChanges()}return this.ConcatenateChanges(y,b)}ComputeRecursionPoint(e,t,n,r,i,o,s){let a=0,u=0,l=0,c=0,h=0,f=0;e--,n--,i[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const d=t-e+(r-n),m=d+1,g=new Int32Array(m),p=new Int32Array(m),v=r-n,y=t-e,b=e-n,C=t-r,_=(y-v)%2==0;g[v]=e,p[y]=t,s[0]=!1;for(let S=1;S<=d/2+1;S++){let d=0,E=0;l=this.ClipDiagonalBound(v-S,S,v,m),c=this.ClipDiagonalBound(v+S,S,v,m);for(let e=l;e<=c;e+=2){u=(a=e===l||ed+E&&(d=a,E=u),!_&&Math.abs(e-y)<=S-1&&a>=p[e])return i[0]=a,o[0]=u,n<=p[e]&&S<=1448?this.WALKTRACE(v,l,c,b,y,h,f,C,g,p,a,t,i,u,r,o,_,s):null}const x=(d-e+(E-n)-S)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(d,x))return s[0]=!0,i[0]=d,o[0]=E,x>0&&S<=1448?this.WALKTRACE(v,l,c,b,y,h,f,C,g,p,a,t,i,u,r,o,_,s):(e++,n++,[new A(e,t-e+1,n,r-n+1)]);h=this.ClipDiagonalBound(y-S,S,y,m),f=this.ClipDiagonalBound(y+S,S,y,m);for(let d=h;d<=f;d+=2){u=(a=d===h||d=p[d+1]?p[d+1]-1:p[d-1])-(d-y)-C;const m=a;for(;a>e&&u>n&&this.ElementsAreEqual(a,u);)a--,u--;if(p[d]=a,_&&Math.abs(d-v)<=S&&a<=g[d])return i[0]=a,o[0]=u,m>=g[d]&&S<=1448?this.WALKTRACE(v,l,c,b,y,h,f,C,g,p,a,t,i,u,r,o,_,s):null}if(S<=1447){let e=new Int32Array(c-l+2);e[0]=v-l+1,j.Copy2(g,l,e,1,c-l+1),this.m_forwardHistory.push(e),(e=new Int32Array(f-h+2))[0]=y-h+1,j.Copy2(p,h,e,1,f-h+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(v,l,c,b,y,h,f,C,g,p,a,t,i,u,r,o,_,s)}PrettifyChanges(e){for(let t=0;t0,s=n.modifiedLength>0;for(;n.originalStart+n.originalLength=0;t--){const n=e[t];let r=0,i=0;if(t>0){const n=e[t-1];n.originalLength>0&&(r=n.originalStart+n.originalLength),n.modifiedLength>0&&(i=n.modifiedStart+n.modifiedLength)}const o=n.originalLength>0,s=n.modifiedLength>0;let a=0,u=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength);for(let e=1;;e++){const t=n.originalStart-e,l=n.modifiedStart-e;if(tu&&(u=c,a=e)}n.originalStart-=a,n.modifiedStart-=a}return e}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1}_boundaryScore(e,t,n,r){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(n,r)?1:0)}ConcatenateChanges(e,t){let n=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){const r=new Array(e.length+t.length-1);return j.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],j.Copy(t,1,r,e.length,t.length-1),r}{const n=new Array(e.length+t.length);return j.Copy(e,0,n,0,e.length),j.Copy(t,0,n,e.length,t.length),n}}ChangesOverlap(e,t,n){if(F.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),F.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const r=e.originalStart;let i=e.originalLength;const o=e.modifiedStart;let s=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(i=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(s=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new A(r,i,o,s),!0}return n[0]=null,!1}ClipDiagonalBound(e,t,n,r){if(e>=0&&e=W&&e<=K||e>=q&&e<=B}function ee(e,t,n,r){let i="",o=0,s=-1,a=0,u=0;for(let l=0;l<=e.length;++l){if(l2){const e=i.lastIndexOf(n);-1===e?(i="",o=0):o=(i=i.slice(0,e)).length-1-i.lastIndexOf(n),s=l,a=0;continue}if(0!==i.length){i="",o=0,s=l,a=0;continue}}t&&(i+=i.length>0?`${n}..`:"..",o=2)}else i.length>0?i+=`${n}${e.slice(s+1,l)}`:i=e.slice(s+1,l),o=l-s-1;s=l,a=0}else u===H&&-1!==a?++a:a=-1}return i}function te(e,t){if(null===t||"object"!=typeof t)throw new z("pathObject","Object",t);const n=t.dir||t.root,r=t.base||`${t.name||""}${t.ext||""}`;return n?n===t.root?`${n}${r}`:`${n}${e}${r}`:r}const ne={resolve(...e){let t="",n="",r=!1;for(let i=e.length-1;i>=-1;i--){let o;if(i>=0){if(J(o=e[i],"path"),0===o.length)continue}else 0===t.length?o=$.a():(void 0===(o=$.b[`=${t}`]||$.a())||o.slice(0,2).toLowerCase()!==t.toLowerCase()&&o.charCodeAt(2)===G)&&(o=`${t}\\`);const s=o.length;let a=0,u="",l=!1;const c=o.charCodeAt(0);if(1===s)Q(c)&&(a=1,l=!0);else if(Q(c))if(l=!0,Q(o.charCodeAt(1))){let e=2,t=e;for(;e2&&Q(o.charCodeAt(2))&&(l=!0,a=3));if(u.length>0)if(t.length>0){if(u.toLowerCase()!==t.toLowerCase())continue}else t=u;if(r){if(t.length>0)break}else if(n=`${o.slice(a)}\\${n}`,r=l,l&&t.length>0)break}return n=ee(n,!r,"\\",Q),r?`${t}\\${n}`:`${t}${n}`||"."},normalize(e){J(e,"path");const t=e.length;if(0===t)return".";let n,r=0,i=!1;const o=e.charCodeAt(0);if(1===t)return Z(o)?"\\":e;if(Q(o))if(i=!0,Q(e.charCodeAt(1))){let i=2,o=i;for(;i2&&Q(e.charCodeAt(2))&&(i=!0,r=3));let s=r0&&Q(e.charCodeAt(t-1))&&(s+="\\"),void 0===n?i?`\\${s}`:s:i?`${n}\\${s}`:`${n}${s}`},isAbsolute(e){J(e,"path");const t=e.length;if(0===t)return!1;const n=e.charCodeAt(0);return Q(n)||t>2&&X(n)&&58===e.charCodeAt(1)&&Q(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,n;for(let r=0;r0&&(void 0===t?t=n=i:t+=`\\${i}`)}if(void 0===t)return".";let r=!0,i=0;if("string"==typeof n&&Q(n.charCodeAt(0))){++i;const e=n.length;e>1&&Q(n.charCodeAt(1))&&(++i,e>2&&(Q(n.charCodeAt(2))?++i:r=!1))}if(r){for(;i=2&&(t=`\\${t.slice(i)}`)}return ne.normalize(t)},relative(e,t){if(J(e,"from"),J(t,"to"),e===t)return"";const n=ne.resolve(e),r=ne.resolve(t);if(n===r)return"";if((e=n.toLowerCase())===(t=r.toLowerCase()))return"";let i=0;for(;ii&&e.charCodeAt(o-1)===G;)o--;const s=o-i;let a=0;for(;aa&&t.charCodeAt(u-1)===G;)u--;const l=u-a,c=sc){if(t.charCodeAt(a+f)===G)return r.slice(a+f+1);if(2===f)return r.slice(a+f)}s>c&&(e.charCodeAt(i+f)===G?h=f:2===f&&(h=3)),-1===h&&(h=0)}let d="";for(f=i+h+1;f<=o;++f)f!==o&&e.charCodeAt(f)!==G||(d+=0===d.length?"..":"\\..");return a+=h,d.length>0?`${d}${r.slice(a,u)}`:(r.charCodeAt(a)===G&&++a,r.slice(a,u))},toNamespacedPath(e){if("string"!=typeof e)return e;if(0===e.length)return"";const t=ne.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===G){if(t.charCodeAt(1)===G){const e=t.charCodeAt(2);if(63!==e&&e!==H)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(X(t.charCodeAt(0))&&58===t.charCodeAt(1)&&t.charCodeAt(2)===G)return`\\\\?\\${t}`;return e},dirname(e){J(e,"path");const t=e.length;if(0===t)return".";let n=-1,r=0;const i=e.charCodeAt(0);if(1===t)return Q(i)?e:".";if(Q(i)){if(n=r=1,Q(e.charCodeAt(1))){let i=2,o=i;for(;i2&&Q(e.charCodeAt(2))?3:2);let o=-1,s=!0;for(let n=t-1;n>=r;--n)if(Q(e.charCodeAt(n))){if(!s){o=n;break}}else s=!1;if(-1===o){if(-1===n)return".";o=n}return e.slice(0,o)},basename(e,t){void 0!==t&&J(t,"ext"),J(e,"path");let n,r=0,i=-1,o=!0;if(e.length>=2&&X(e.charCodeAt(0))&&58===e.charCodeAt(1)&&(r=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let s=t.length-1,a=-1;for(n=e.length-1;n>=r;--n){const u=e.charCodeAt(n);if(Q(u)){if(!o){r=n+1;break}}else-1===a&&(o=!1,a=n+1),s>=0&&(u===t.charCodeAt(s)?-1==--s&&(i=n):(s=-1,i=a))}return r===i?i=a:-1===i&&(i=e.length),e.slice(r,i)}for(n=e.length-1;n>=r;--n)if(Q(e.charCodeAt(n))){if(!o){r=n+1;break}}else-1===i&&(o=!1,i=n+1);return-1===i?"":e.slice(r,i)},extname(e){J(e,"path");let t=0,n=-1,r=0,i=-1,o=!0,s=0;e.length>=2&&58===e.charCodeAt(1)&&X(e.charCodeAt(0))&&(t=r=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(Q(t)){if(!o){r=a+1;break}}else-1===i&&(o=!1,i=a+1),t===H?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1)}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:te.bind(null,"\\"),parse(e){J(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const n=e.length;let r=0,i=e.charCodeAt(0);if(1===n)return Q(i)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(Q(i)){if(r=1,Q(e.charCodeAt(1))){let t=2,i=t;for(;t0&&(t.root=e.slice(0,r));let o=-1,s=r,a=-1,u=!0,l=e.length-1,c=0;for(;l>=r;--l)if(Q(i=e.charCodeAt(l))){if(!u){s=l+1;break}}else-1===a&&(u=!1,a=l+1),i===H?-1===o?o=l:1!==c&&(c=1):-1!==o&&(c=-1);return-1!==a&&(-1===o||0===c||1===c&&o===a-1&&o===s+1?t.base=t.name=e.slice(s,a):(t.name=e.slice(s,o),t.base=e.slice(s,a),t.ext=e.slice(o,a))),t.dir=s>0&&s!==r?e.slice(0,s-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},re={resolve(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){const i=r>=0?e[r]:$.a();J(i,"path"),0!==i.length&&(t=`${i}/${t}`,n=i.charCodeAt(0)===Y)}return t=ee(t,!n,"/",Z),n?`/${t}`:t.length>0?t:"."},normalize(e){if(J(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Y,n=e.charCodeAt(e.length-1)===Y;return 0===(e=ee(e,!t,"/",Z)).length?t?"/":n?"./":".":(n&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(J(e,"path"),e.length>0&&e.charCodeAt(0)===Y),join(...e){if(0===e.length)return".";let t;for(let n=0;n0&&(void 0===t?t=r:t+=`/${r}`)}return void 0===t?".":re.normalize(t)},relative(e,t){if(J(e,"from"),J(t,"to"),e===t)return"";if((e=re.resolve(e))===(t=re.resolve(t)))return"";const n=e.length,r=n-1,i=t.length-1,o=ro){if(t.charCodeAt(1+a)===Y)return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else r>o&&(e.charCodeAt(1+a)===Y?s=a:0===a&&(s=0));let u="";for(a=1+s+1;a<=n;++a)a!==n&&e.charCodeAt(a)!==Y||(u+=0===u.length?"..":"/..");return`${u}${t.slice(1+s)}`},toNamespacedPath:e=>e,dirname(e){if(J(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Y;let n=-1,r=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===Y){if(!r){n=t;break}}else r=!1;return-1===n?t?"/":".":t&&1===n?"//":e.slice(0,n)},basename(e,t){void 0!==t&&J(t,"ext"),J(e,"path");let n,r=0,i=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let s=t.length-1,a=-1;for(n=e.length-1;n>=0;--n){const u=e.charCodeAt(n);if(u===Y){if(!o){r=n+1;break}}else-1===a&&(o=!1,a=n+1),s>=0&&(u===t.charCodeAt(s)?-1==--s&&(i=n):(s=-1,i=a))}return r===i?i=a:-1===i&&(i=e.length),e.slice(r,i)}for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===Y){if(!o){r=n+1;break}}else-1===i&&(o=!1,i=n+1);return-1===i?"":e.slice(r,i)},extname(e){J(e,"path");let t=-1,n=0,r=-1,i=!0,o=0;for(let s=e.length-1;s>=0;--s){const a=e.charCodeAt(s);if(a!==Y)-1===r&&(i=!1,r=s+1),a===H?-1===t?t=s:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){n=s+1;break}}return-1===t||-1===r||0===o||1===o&&t===r-1&&t===n+1?"":e.slice(t,r)},format:te.bind(null,"/"),parse(e){J(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const n=e.charCodeAt(0)===Y;let r;n?(t.root="/",r=1):r=0;let i=-1,o=0,s=-1,a=!0,u=e.length-1,l=0;for(;u>=r;--u){const t=e.charCodeAt(u);if(t!==Y)-1===s&&(a=!1,s=u+1),t===H?-1===i?i=u:1!==l&&(l=1):-1!==i&&(l=-1);else if(!a){o=u+1;break}}if(-1!==s){const r=0===o&&n?1:o;-1===i||0===l||1===l&&i===s-1&&i===o+1?t.base=t.name=e.slice(r,s):(t.name=e.slice(r,i),t.base=e.slice(r,s),t.ext=e.slice(i,s))}return o>0?t.dir=e.slice(0,o-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};re.win32=ne.win32=ne,re.posix=ne.posix=re;"win32"===$.c?ne.normalize:re.normalize,"win32"===$.c?ne.resolve:re.resolve,"win32"===$.c?ne.relative:re.relative,"win32"===$.c?ne.dirname:re.dirname,"win32"===$.c?ne.basename:re.basename,"win32"===$.c?ne.extname:re.extname,"win32"===$.c?ne.sep:re.sep;const ie=/^\w[\w\d+.-]*$/,oe=/^\//,se=/^\/\//;const ae="",ue="/",le=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class ce{constructor(e,t,n,r,i,o=!1){"object"==typeof e?(this.scheme=e.scheme||ae,this.authority=e.authority||ae,this.path=e.path||ae,this.query=e.query||ae,this.fragment=e.fragment||ae):(this.scheme=function(e,t){return e||t?e:"file"}(e,o),this.authority=t||ae,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==ue&&(t=ue+t):t=ue}return t}(this.scheme,n||ae),this.query=r||ae,this.fragment=i||ae,function(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!ie.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!oe.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(se.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,o))}static isUri(e){return e instanceof ce||!!e&&("string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"function"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString)}get fsPath(){return pe(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:o}=e;return void 0===t?t=this.scheme:null===t&&(t=ae),void 0===n?n=this.authority:null===n&&(n=ae),void 0===r?r=this.path:null===r&&(r=ae),void 0===i?i=this.query:null===i&&(i=ae),void 0===o?o=this.fragment:null===o&&(o=ae),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new fe(t,n,r,i,o)}static parse(e,t=!1){const n=le.exec(e);return n?new fe(n[2]||ae,be(n[4]||ae),be(n[5]||ae),be(n[7]||ae),be(n[9]||ae),t):new fe(ae,ae,ae,ae,ae)}static file(e){let t=ae;if(v.d&&(e=e.replace(/\\/g,ue)),e[0]===ue&&e[1]===ue){const n=e.indexOf(ue,2);-1===n?(t=e.substring(2),e=ue):(t=e.substring(2,n),e=e.substring(n)||ue)}return new fe("file",t,e,ae,ae)}static from(e){return new fe(e.scheme,e.authority,e.path,e.query,e.fragment)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPaths on URI without path");let n;return n=v.d&&"file"===e.scheme?ce.file(ne.join(pe(e,!0),...t)).path:re.join(e.path,...t),e.with({path:n})}toString(e=!1){return ve(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof ce)return e;{const t=new fe(e);return t._formatted=e.external,t._fsPath=e._sep===he?e.fsPath:null,t}}return e}}const he=v.d?1:void 0;class fe extends ce{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=pe(this,!1)),this._fsPath}toString(e=!1){return e?ve(this,!0):(this._formatted||(this._formatted=ve(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=he),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const de={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function me(e,t){let n=void 0,r=-1;for(let i=0;i=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o)-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),void 0!==n&&(n+=e.charAt(i));else{void 0===n&&(n=e.substr(0,i));const t=de[o];void 0!==t?(-1!==r&&(n+=encodeURIComponent(e.substring(r,i)),r=-1),n+=t):-1===r&&(r=i)}}return-1!==r&&(n+=encodeURIComponent(e.substring(r))),void 0!==n?n:e}function ge(e){let t=void 0;for(let n=0;n1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,v.d&&(n=n.replace(/\//g,"\\")),n}function ve(e,t){const n=t?ge:me;let r="",{scheme:i,authority:o,path:s,query:a,fragment:u}=e;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=ue,r+=ue),o){let e=o.indexOf("@");if(-1!==e){const t=o.substr(0,e);o=o.substr(e+1),-1===(e=t.indexOf(":"))?r+=n(t,!1):(r+=n(t.substr(0,e),!1),r+=":",r+=n(t.substr(e+1),!1)),r+="@"}-1===(e=(o=o.toLowerCase()).indexOf(":"))?r+=n(o,!1):(r+=n(o.substr(0,e),!1),r+=o.substr(e))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){const e=s.charCodeAt(1);e>=65&&e<=90&&(s=`/${String.fromCharCode(e+32)}:${s.substr(3)}`)}else if(s.length>=2&&58===s.charCodeAt(1)){const e=s.charCodeAt(0);e>=65&&e<=90&&(s=`${String.fromCharCode(e+32)}:${s.substr(2)}`)}r+=n(s,!0)}return a&&(r+="?",r+=n(a,!1)),u&&(r+="#",r+=t?u:me(u,!1)),r}const ye=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function be(e){return e.match(ye)?e.replace(ye,e=>(function e(t){try{return decodeURIComponent(t)}catch(n){return t.length>3?t.substr(0,3)+e(t.substr(3)):t}})(e)):e}class Ce{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new Ce(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Ce.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Ce.isBefore(this,e)}static isBefore(e,t){return e.lineNumbern||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}isEmpty(){return _e.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return _e.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.columne.endColumn))}containsRange(e){return _e.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)))}strictContainsRange(e){return _e.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)))}plusRange(e){return _e.plusRange(this,e)}static plusRange(e,t){let n,r,i,o;return t.startLineNumbere.endLineNumber?(i=t.endLineNumber,o=t.endColumn):t.endLineNumber===e.endLineNumber?(i=t.endLineNumber,o=Math.max(t.endColumn,e.endColumn)):(i=e.endLineNumber,o=e.endColumn),new _e(n,r,i,o)}intersectRanges(e){return _e.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,r=e.startColumn,i=e.endLineNumber,o=e.endColumn,s=t.startLineNumber,a=t.startColumn,u=t.endLineNumber,l=t.endColumn;return nu?(i=u,o=l):i===u&&(o=Math.min(o,l)),n>i?null:n===i&&r>o?null:new _e(n,r,i,o)}equalsRange(e){return _e.equalsRange(this,e)}static equalsRange(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return _e.getEndPosition(this)}static getEndPosition(e){return new Ce(e.endLineNumber,e.endColumn)}getStartPosition(){return _e.getStartPosition(this)}static getStartPosition(e){return new Ce(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new _e(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new _e(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return _e.collapseToStart(this)}static collapseToStart(e){return new _e(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}static fromPositions(e,t=e){return new _e(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new _e(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}}const Se=3;function Ee(e,t,n,r){return new V(e,t,n).ComputeDiff(r)}class Ae{constructor(e){const t=[],n=[];for(let r=0,i=e.length;r0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&i()){const o=n.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=r.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);let u=Ee(o,a,i,!0).changes;s&&(u=function(e){if(e.length<=1)return e;const t=[e[0]];let n=t[0];for(let r=1,i=e.length;r1&&s>1;){if(e.charCodeAt(n-2)!==t.charCodeAt(s-2))break;n--,s--}(n>1||s>1)&&this._pushTrimWhitespaceCharChange(r,i+1,1,n,o+1,1,s)}{let n=ke(e,1),s=ke(t,1);const a=e.length+1,u=t.length+1;for(;n=0;n--){const t=e.charCodeAt(n);if(32!==t&&9!==t)return n}return-1}(e);return-1===n?t:n+2}function Oe(e){if(0===e)return()=>!0;const t=Date.now();return()=>Date.now()-t255?255:0|e}function Me(e){return e<0?0:e>4294967295?4294967295:0|e}class Pe{constructor(e,t){this.index=e,this.remainder=t}}class Re{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=Me(e);const n=this.values,r=this.prefixSum,i=t.length;return 0!==i&&(this.values=new Uint32Array(n.length+i),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+i),this.values.set(t,e),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}changeValue(e,t){return e=Me(e),t=Me(t),this.values[e]!==t&&(this.values[e]=t,e-1=n.length)return!1;let i=n.length-e;return t>=i&&(t=i),0!==t&&(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalValue(){return 0===this.values.length?0:this._getAccumulatedValue(this.values.length-1)}getAccumulatedValue(e){return e<0?0:(e=Me(e),this._getAccumulatedValue(e))}_getAccumulatedValue(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalValue();let t=0,n=this.values.length-1,r=0,i=0,o=0;for(;t<=n;)if(r=t+(n-t)/2|0,e<(o=(i=this.prefixSum[r])-this.values[r]))n=r-1;else{if(!(e>=i))break;t=r+1}return new Pe(r,e-o)}}class De{constructor(e,t,n,r){this._uri=e,this._lines=t,this._eol=n,this._versionId=r,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const e of t)this._acceptDeleteRange(e.range),this._acceptInsertText(new Ce(e.range.startLineNumber,e.range.startColumn),e.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,n=new Uint32Array(t);for(let r=0;r/?";const je=function(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const n of Fe)e.indexOf(n)>=0||(t+="\\"+n);return t+="\\s]+)",new RegExp(t,"g")}();const Ue={maxLen:1e3,windowSize:15,timeBudget:150};function Ve(e,t,n,r){let i;for(;i=e.exec(t);){const t=i.index||0;if(t<=n&&e.lastIndex>=n)return i;if(r>0&&t>r)return null}return null}class $e{constructor(e){let t=Ie(e);this._defaultValue=t,this._asciiMap=$e._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);for(let n=0;n<256;n++)t[n]=e;return t}set(e,t){let n=Ie(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}}class We{constructor(e,t,n){const r=new Uint8Array(e*t);for(let i=0,o=e*t;it&&(t=o),i>n&&(n=i),s>n&&(n=s)}t++,n++;let r=new We(n,t,0);for(let t=0,n=e.length;t=this._maxCharCode?0:this._states.get(e,t)}}let Ke=null;let Be=null;class He{static _createLink(e,t,n,r,i){let o=i-1;do{const n=t.charCodeAt(o);if(2!==e.get(n))break;o--}while(o>r);if(r>0){const e=t.charCodeAt(r-1),n=t.charCodeAt(o);(40===e&&41===n||91===e&&93===n||123===e&&125===n)&&o--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:o+2},url:t.substring(r,o+1)}}static computeLinks(e,t=(null===Ke&&(Ke=new qe([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),Ke)){const n=function(){if(null===Be){Be=new $e(0);const e=" \t<>'\"、。。、,.:;‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…";for(let t=0;t=0?((r+=n?1:-1)<0?r=e.length-1:r%=e.length,e[r]):null}}Ye.INSTANCE=new Ye;class Ge{constructor(e){this.element=e,this.next=Ge.Undefined,this.prev=Ge.Undefined}}Ge.Undefined=new Ge(void 0);class ze{constructor(){this._first=Ge.Undefined,this._last=Ge.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ge.Undefined}clear(){this._first=Ge.Undefined,this._last=Ge.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new Ge(e);if(this._first===Ge.Undefined)this._first=n,this._last=n;else if(t){const e=this._last;this._last=n,n.prev=e,e.next=n}else{const e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==Ge.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ge.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ge.Undefined&&e.next!==Ge.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ge.Undefined&&e.next===Ge.Undefined?(this._first=Ge.Undefined,this._last=Ge.Undefined):e.next===Ge.Undefined?(this._last=this._last.prev,this._last.next=Ge.Undefined):e.prev===Ge.Undefined&&(this._first=this._first.next,this._first.prev=Ge.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ge.Undefined;)yield e.element,e=e.next}toArray(){const e=[];for(let t=this._first;t!==Ge.Undefined;t=t.next)e.push(t.element);return e}}var Je;!function(e){function t(e){return(t,n=null,r)=>{let i,o=!1;return i=e(e=>{if(!o)return i?i.dispose():o=!0,t.call(n,e)},null,r),o&&i.dispose(),i}}function n(e,t){return s((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i))}function r(e,t){return s((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i))}function i(e,t){return s((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i))}function o(e,t,r){let i=r;return n(e,e=>i=t(i,e))}function s(e){let t;const n=new Xe({onFirstListenerAdd(){t=e(n.fire,n)},onLastListenerRemove(){t.dispose()}});return n.event}function a(e,t,n=100,r=!1,i){let o,s=void 0,a=void 0,u=0;const l=new Xe({leakWarningThreshold:i,onFirstListenerAdd(){o=e(e=>{u++,s=t(s,e),r&&!a&&(l.fire(s),s=void 0),clearTimeout(a),a=setTimeout(()=>{const e=s;s=void 0,a=void 0,(!r||u>1)&&l.fire(e),u=0},n)})},onLastListenerRemove(){o.dispose()}});return l.event}function u(e){let t,n=!0;return i(e,e=>{const r=n||e!==t;return n=!1,t=e,r})}e.None=()=>p.None,e.once=t,e.map=n,e.forEach=r,e.filter=i,e.signal=function(e){return e},e.any=function(...e){return(t,n=null,r)=>(function(...e){return e.forEach(h),f({dispose:()=>m(e)})})(...e.map(e=>e(e=>t.call(n,e),null,r)))},e.reduce=o,e.snapshot=s,e.debounce=a,e.stopwatch=function(e){const r=(new Date).getTime();return n(t(e),e=>(new Date).getTime()-r)},e.latch=u,e.buffer=function(e,t=!1,n=[]){let r=n.slice(),i=e(e=>{r?r.push(e):s.fire(e)});const o=()=>{r&&r.forEach(e=>s.fire(e)),r=null},s=new Xe({onFirstListenerAdd(){i||(i=e(e=>s.fire(e)))},onFirstListenerDidAdd(){r&&(t?setTimeout(o):o())},onLastListenerRemove(){i&&i.dispose(),i=null}});return s.event};class l{constructor(e){this.event=e}map(e){return new l(n(this.event,e))}forEach(e){return new l(r(this.event,e))}filter(e){return new l(i(this.event,e))}reduce(e,t){return new l(o(this.event,e,t))}latch(){return new l(u(this.event))}debounce(e,t=100,n=!1,r){return new l(a(this.event,e,t,n,r))}on(e,t,n){return this.event(e,t,n)}once(e,n,r){return t(this.event)(e,n,r)}}e.chain=function(e){return new l(e)},e.fromNodeEventEmitter=function(e,t,n=(e=>e)){const r=(...e)=>i.fire(n(...e)),i=new Xe({onFirstListenerAdd:()=>e.on(t,r),onLastListenerRemove:()=>e.removeListener(t,r)});return i.event},e.fromDOMEventEmitter=function(e,t,n=(e=>e)){const r=(...e)=>i.fire(n(...e)),i=new Xe({onFirstListenerAdd:()=>e.addEventListener(t,r),onLastListenerRemove:()=>e.removeEventListener(t,r)});return i.event},e.fromPromise=function(e){const t=new Xe;let n=!1;return e.then(void 0,()=>null).then(()=>{n?t.fire(void 0):setTimeout(()=>t.fire(void 0),0)}),n=!0,t.event},e.toPromise=function(e){return new Promise(n=>t(e)(n))}}(Je||(Je={}));let Qe=-1;class Ze{constructor(e,t=Math.random().toString(18).slice(2,5)){this.customThreshold=e,this.name=t,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(e){let t=Qe;if("number"==typeof this.customThreshold&&(t=this.customThreshold),t<=0||e{const e=this._stacks.get(n)||0;this._stacks.set(n,e-1)}}}class Xe{constructor(e){this._disposed=!1,this._options=e,this._leakageMon=Qe>0?new Ze(this._options&&this._options.leakWarningThreshold):void 0}get event(){return this._event||(this._event=(e,t,n)=>{this._listeners||(this._listeners=new ze);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(t?[e,t]:e);let o,s;return r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t),this._leakageMon&&(o=this._leakageMon.check(this._listeners.size)),s={dispose:()=>{if(o&&o(),s.dispose=Xe._noop,!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)}}},n instanceof g?n.add(s):Array.isArray(n)&&n.push(s),s}),this._event}fire(e){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new ze);for(let t of this._listeners)this._deliveryQueue.push([t,e]);for(;this._deliveryQueue.size>0;){const[e,t]=this._deliveryQueue.shift();try{"function"==typeof e?e.call(void 0,t):e[0].call(e[1],t)}catch(e){i(e)}}}}dispose(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0}}Xe._noop=function(){};const et=Object.freeze((function(e,t){const n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}));var tt,nt;(nt=tt||(tt={})).isCancellationToken=function(e){return e===nt.None||e===nt.Cancelled||e instanceof rt||!(!e||"object"!=typeof e)&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},nt.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Je.None}),nt.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:et});class rt{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?et:(this._emitter||(this._emitter=new Xe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class it{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new rt),this._token}cancel(){this._token?this._token instanceof rt&&this._token.cancel():this._token=tt.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof rt&&this._token.dispose():this._token=tt.None}}class ot{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const st=new ot,at=new ot,ut=new ot;var lt,ct,ht,ft,dt,mt,gt,pt,vt,yt,bt,Ct,_t,St,Et,At,xt,Nt,wt,Lt,Tt,kt,Ot,It,Mt,Pt,Rt,Dt,Ft,jt,Ut,Vt,$t,Wt;!function(){function e(e,t,n=t,r=n){st.define(e,t),at.define(e,n),ut.define(e,r)}e(0,"unknown"),e(1,"Backspace"),e(2,"Tab"),e(3,"Enter"),e(4,"Shift"),e(5,"Ctrl"),e(6,"Alt"),e(7,"PauseBreak"),e(8,"CapsLock"),e(9,"Escape"),e(10,"Space"),e(11,"PageUp"),e(12,"PageDown"),e(13,"End"),e(14,"Home"),e(15,"LeftArrow","Left"),e(16,"UpArrow","Up"),e(17,"RightArrow","Right"),e(18,"DownArrow","Down"),e(19,"Insert"),e(20,"Delete"),e(21,"0"),e(22,"1"),e(23,"2"),e(24,"3"),e(25,"4"),e(26,"5"),e(27,"6"),e(28,"7"),e(29,"8"),e(30,"9"),e(31,"A"),e(32,"B"),e(33,"C"),e(34,"D"),e(35,"E"),e(36,"F"),e(37,"G"),e(38,"H"),e(39,"I"),e(40,"J"),e(41,"K"),e(42,"L"),e(43,"M"),e(44,"N"),e(45,"O"),e(46,"P"),e(47,"Q"),e(48,"R"),e(49,"S"),e(50,"T"),e(51,"U"),e(52,"V"),e(53,"W"),e(54,"X"),e(55,"Y"),e(56,"Z"),e(57,"Meta"),e(58,"ContextMenu"),e(59,"F1"),e(60,"F2"),e(61,"F3"),e(62,"F4"),e(63,"F5"),e(64,"F6"),e(65,"F7"),e(66,"F8"),e(67,"F9"),e(68,"F10"),e(69,"F11"),e(70,"F12"),e(71,"F13"),e(72,"F14"),e(73,"F15"),e(74,"F16"),e(75,"F17"),e(76,"F18"),e(77,"F19"),e(78,"NumLock"),e(79,"ScrollLock"),e(80,";",";","OEM_1"),e(81,"=","=","OEM_PLUS"),e(82,",",",","OEM_COMMA"),e(83,"-","-","OEM_MINUS"),e(84,".",".","OEM_PERIOD"),e(85,"/","/","OEM_2"),e(86,"`","`","OEM_3"),e(110,"ABNT_C1"),e(111,"ABNT_C2"),e(87,"[","[","OEM_4"),e(88,"\\","\\","OEM_5"),e(89,"]","]","OEM_6"),e(90,"'","'","OEM_7"),e(91,"OEM_8"),e(92,"OEM_102"),e(93,"NumPad0"),e(94,"NumPad1"),e(95,"NumPad2"),e(96,"NumPad3"),e(97,"NumPad4"),e(98,"NumPad5"),e(99,"NumPad6"),e(100,"NumPad7"),e(101,"NumPad8"),e(102,"NumPad9"),e(103,"NumPad_Multiply"),e(104,"NumPad_Add"),e(105,"NumPad_Separator"),e(106,"NumPad_Subtract"),e(107,"NumPad_Decimal"),e(108,"NumPad_Divide")}(),function(e){e.toString=function(e){return st.keyCodeToStr(e)},e.fromString=function(e){return st.strToKeyCode(e)},e.toUserSettingsUS=function(e){return at.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return ut.keyCodeToStr(e)},e.fromUserSettings=function(e){return at.strToKeyCode(e)||ut.strToKeyCode(e)}}(lt||(lt={}));class qt extends _e{constructor(e,t,n,r){super(e,t,n,r),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=r}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return qt.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return 0===this.getDirection()?new qt(this.startLineNumber,this.startColumn,e,t):new qt(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Ce(this.positionLineNumber,this.positionColumn)}setStartPosition(e,t){return 0===this.getDirection()?new qt(e,t,this.endLineNumber,this.endColumn):new qt(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new qt(e.lineNumber,e.column,t.lineNumber,t.column)}static liftSelection(e){return new qt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n>>0)>>>0}(e,t)}}Bt.CtrlCmd=2048,Bt.Shift=1024,Bt.Alt=512,Bt.WinCtrl=256;var Ht=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))};class Yt extends De{get uri(){return this._uri}get version(){return this._versionId}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){let n=function e(t,n,r,i,o=Ue){if(r.length>o.maxLen){let s=t-o.maxLen/2;return s<0?(i+=t,s=0):i+=s,e(t,n,r=r.substring(s,t+o.maxLen/2),i,o)}Date.now();const s=t-1-i;let a=-1,u=null;for(let e=1;;e++){Date.now(),o.timeBudget;const t=s-o.windowSize*e;n.lastIndex=Math.max(0,t);const i=Ve(n,r,s,a);if(!i&&u)break;if(u=i,t<=0)break;a=t}if(u){let e={word:u[0],startColumn:i+1+u.index,endColumn:i+1+u.index+u[0].length};return n.lastIndex=0,e}return null}(e.column,function(e){let t=je;if(e&&e instanceof RegExp)if(e.global)t=e;else{let n="g";e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.unicode&&(n+="u"),t=new RegExp(e.source,n)}return t.lastIndex=0,t}(t),this._lines[e.lineNumber-1],0);return n?new _e(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn):null}words(e){const t=this._lines,n=this._wordenize.bind(this);let r=0,i="",o=0,s=[];return{*[Symbol.iterator](){for(;;)if(othis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,r=!0;else{let e=this._lines[t-1].length+1;n<1?(n=1,r=!0):n>e&&(n=e,r=!0)}return r?{lineNumber:t,column:n}:e}}class Gt{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){let e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new Yt(ce.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeDiff(e,t,n,r){return Ht(this,void 0,void 0,(function*(){const i=this._getModel(e),o=this._getModel(t);if(!i||!o)return null;const s=i.getLinesContent(),a=o.getLinesContent(),u=new Le(s,a,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0,maxComputationTime:r}).computeDiff(),l=!(u.changes.length>0)&&this._modelsAreIdentical(i,o);return{quitEarly:u.quitEarly,identical:l,changes:u.changes}}))}_modelsAreIdentical(e,t){const n=e.getLineCount();if(n!==t.getLineCount())return!1;for(let r=1;r<=n;r++){if(e.getLineContent(r)!==t.getLineContent(r))return!1}return!0}computeMoreMinimalEdits(e,t){return Ht(this,void 0,void 0,(function*(){const n=this._getModel(e);if(!n)return t;const r=[];let i=void 0;t=E(t,(e,t)=>{if(e.range&&t.range)return _e.compareRangesUsingStarts(e.range,t.range);return(e.range?0:1)-(t.range?0:1)});for(let{range:e,text:o,eol:s}of t){if("number"==typeof s&&(i=s),_e.isEmpty(e)&&!o)continue;const t=n.getValueInRange(e);if(t===(o=o.replace(/\r\n|\n|\r/g,n.eol)))continue;if(Math.max(o.length,t.length)>Gt._diffLimit){r.push({range:e,text:o});continue}const a=D(t,o,!1),u=n.offsetAt(_e.lift(e).getStartPosition());for(const e of a){const t=n.positionAt(u+e.originalStart),i=n.positionAt(u+e.originalStart+e.originalLength),s={text:o.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}};n.getValueInRange(s.range)!==s.text&&r.push(s)}}return"number"==typeof i&&r.push({eol:i,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r}))}computeLinks(e){return Ht(this,void 0,void 0,(function*(){let t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getLineCount&&"function"==typeof e.getLineContent?He.computeLinks(e):[]}(t):null}))}textualSuggest(e,t,n,r){return Ht(this,void 0,void 0,(function*(){const i=this._getModel(e);if(!i)return null;const o=[],s=new Set,a=new RegExp(n,r),u=i.getWordAtPosition(t,a);u&&s.add(i.getValueInRange(u));for(let e of i.words(a))if(!s.has(e)&&(s.add(e),isNaN(Number(e))&&(o.push(e),s.size>Gt._suggestionsLimit)))break;return o}))}computeWordRanges(e,t,n,r){return Ht(this,void 0,void 0,(function*(){let i=this._getModel(e);if(!i)return Object.create(null);const o=new RegExp(n,r),s=Object.create(null);for(let e=t.startLineNumber;ethis._host.fhr(e,t)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(y(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(e){return Promise.reject(e)}}}Gt._diffLimit=1e5,Gt._suggestionsLimit=1e4,"function"==typeof importScripts&&(v.a.monaco={editor:void 0,languages:void 0,CancellationTokenSource:it,Emitter:Xe,KeyCode:At,KeyMod:Bt,Position:Ce,Range:_e,Selection:qt,SelectionDirection:Rt,MarkerSeverity:xt,MarkerTag:Nt,Uri:ce,Token:Kt});let zt=!1;function Jt(e){if(zt)return;zt=!0;const t=new S(e=>{self.postMessage(e)},t=>new Gt(t,e));self.onmessage=e=>{t.onmessage(e.data)}}function Qt(e,t){void 0===t&&(t=!1);var n=e.length,r=0,i="",o=0,s=16,a=0,u=0,l=0,c=0,h=0;function f(t,n){for(var i=0,o=0;i=48&&s<=57)o=16*o+s-48;else if(s>=65&&s<=70)o=16*o+s-65+10;else{if(!(s>=97&&s<=102))break;o=16*o+s-97+10}r++,i++}return i=n)return o=n,s=17;var t=e.charCodeAt(r);if(Zt(t)){do{r++,i+=String.fromCharCode(t),t=e.charCodeAt(r)}while(Zt(t));return s=15}if(Xt(t))return r++,i+=String.fromCharCode(t),13===t&&10===e.charCodeAt(r)&&(r++,i+="\n"),a++,l=r,s=14;switch(t){case 123:return r++,s=1;case 125:return r++,s=2;case 91:return r++,s=3;case 93:return r++,s=4;case 58:return r++,s=6;case 44:return r++,s=5;case 34:return r++,i=function(){for(var t="",i=r;;){if(r>=n){t+=e.substring(i,r),h=2;break}var o=e.charCodeAt(r);if(34===o){t+=e.substring(i,r),r++;break}if(92!==o){if(o>=0&&o<=31){if(Xt(o)){t+=e.substring(i,r),h=2;break}h=6}r++}else{if(t+=e.substring(i,r),++r>=n){h=2;break}switch(e.charCodeAt(r++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:var s=f(4,!0);s>=0?t+=String.fromCharCode(s):h=4;break;default:h=5}i=r}}return t}(),s=10;case 47:var d=r-1;if(47===e.charCodeAt(r+1)){for(r+=2;r=12&&e<=15);return e}:d,getToken:function(){return s},getTokenValue:function(){return i},getTokenOffset:function(){return o},getTokenLength:function(){return r-o},getTokenStartLine:function(){return u},getTokenStartCharacter:function(){return o-c},getTokenError:function(){return h}}}function Zt(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function Xt(e){return 10===e||13===e||8232===e||8233===e}function en(e){return e>=48&&e<=57}function tn(e,t,n){var r,i,o,s,a;if(t){for(s=t.offset,a=s+t.length,o=s;o>0&&!rn(e,o-1);)o--;for(var u=a;us&&e.substring(n,r)!==t&&v.push({offset:n,length:r-n,content:t})}var b=p();if(17!==b){var C=d.getTokenOffset()+o;y(nn(l,r),o,C)}for(;17!==b;){for(var _=d.getTokenOffset()+d.getTokenLength()+o,S=p(),E="";!h&&(12===S||13===S);){y(" ",_,d.getTokenOffset()+o),_=d.getTokenOffset()+d.getTokenLength()+o,E=12===S?g():"",S=p()}if(2===S)1!==b&&(f--,E=g());else if(4===S)3!==b&&(f--,E=g());else{switch(b){case 3:case 1:f++,E=g();break;case 5:case 12:E=g();break;case 13:E=h?g():" ";break;case 6:E=" ";break;case 10:if(6===S){E="";break}case 7:case 8:case 9:case 11:case 2:case 4:12===S||13===S?E=" ":5!==S&&17!==S&&(m=!0);break;case 16:m=!0}!h||12!==S&&13!==S||(E=g())}y(E,_,d.getTokenOffset()+o),b=S}return v}function nn(e,t){for(var n="",r=0;r0)for(var i=r.getToken();17!==i;){if(-1!==t.indexOf(i)){v();break}if(-1!==n.indexOf(i))break;i=v()}}function b(e){var t=r.getTokenValue();return e?h(t):a(t),v(),!0}function C(){switch(r.getToken()){case 3:return function(){l(),v();for(var e=!1;4!==r.getToken()&&17!==r.getToken();){if(5===r.getToken()){if(e||y(4,[],[]),f(","),v(),4===r.getToken()&&p)break}else e&&y(6,[],[]);C()||y(4,[],[4,5]),e=!0}return c(),4!==r.getToken()?y(8,[4],[]):v(),!0}();case 1:return function(){s(),v();for(var e=!1;2!==r.getToken()&&17!==r.getToken();){if(5===r.getToken()){if(e||y(4,[],[]),f(","),v(),2===r.getToken()&&p)break}else e&&y(6,[],[]);(10!==r.getToken()?(y(3,[],[2,5]),0):(b(!1),6===r.getToken()?(f(":"),v(),C()||y(4,[],[2,5])):y(5,[],[2,5]),1))||y(4,[],[2,5]),e=!0}return u(),2!==r.getToken()?y(7,[2],[]):v(),!0}();case 10:return b(!0);default:return function(){switch(r.getToken()){case 11:var e=0;try{"number"!=typeof(e=JSON.parse(r.getTokenValue()))&&(y(2),e=0)}catch(e){y(2)}h(e);break;case 7:h(null);break;case 8:h(!0);break;case 9:h(!1);break;default:return!1}return v(),!0}()}}return v(),17===r.getToken()?!!n.allowEmptyContent||(y(4,[],[]),!1):C()?(17!==r.getToken()&&y(9,[],[]),!0):(y(4,[],[]),!1)}self.onmessage=e=>{zt||Jt(null)},function(e){e.DEFAULT={allowTrailingComma:!1}}(on||(on={}));var an,un,ln,cn,hn,fn,dn,mn,gn,pn,vn,yn,bn,Cn,_n,Sn,En,An,xn,Nn,wn,Ln=Qt,Tn=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=on.DEFAULT);var r=null,i=[],o=[];function s(e){Array.isArray(i)?i.push(e):null!==r&&(i[r]=e)}return sn(e,{onObjectBegin:function(){var e={};s(e),o.push(i),i=e,r=null},onObjectProperty:function(e){r=e},onObjectEnd:function(){i=o.pop()},onArrayBegin:function(){var e=[];s(e),o.push(i),i=e,r=null},onArrayEnd:function(){i=o.pop()},onLiteralValue:s,onError:function(e,n,r){t.push({error:e,offset:n,length:r})}},n),i[0]},kn=function e(t,n,r){if(void 0===r&&(r=!1),function(e,t,n){return void 0===n&&(n=!1),t>=e.offset&&t0&&(i.arguments=n),i},e.is=function(e){var t=e;return fr.defined(t)&&fr.string(t.title)&&fr.string(t.command)}}(_n||(_n={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return fr.objectLiteral(t)&&fr.string(t.newText)&&un.is(t.range)}}(Sn||(Sn={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return fr.defined(t)&&jn.is(t.textDocument)&&Array.isArray(t.edits)}}(En||(En={})),function(e){e.create=function(e,t){var n={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(n.options=t),n},e.is=function(e){var t=e;return t&&"create"===t.kind&&fr.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||fr.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||fr.boolean(t.options.ignoreIfExists)))}}(An||(An={})),function(e){e.create=function(e,t,n){var r={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(r.options=n),r},e.is=function(e){var t=e;return t&&"rename"===t.kind&&fr.string(t.oldUri)&&fr.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||fr.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||fr.boolean(t.options.ignoreIfExists)))}}(xn||(xn={})),function(e){e.create=function(e,t){var n={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(n.options=t),n},e.is=function(e){var t=e;return t&&"delete"===t.kind&&fr.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||fr.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||fr.boolean(t.options.ignoreIfNotExists)))}}(Nn||(Nn={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return fr.string(e.kind)?An.is(e)||xn.is(e)||Nn.is(e):En.is(e)})))}}(wn||(wn={}));var Fn,jn,Un,Vn,$n,Wn,qn,Kn,Bn,Hn,Yn,Gn,zn,Jn,Qn,Zn,Xn,er,tr,nr,rr,ir,or,sr,ar,ur,lr,cr=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(Sn.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(Sn.replace(e,t))},e.prototype.delete=function(e){this.edits.push(Sn.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}();!function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach((function(e){if(En.is(e)){var n=new cr(e.edits);t._textEditChanges[e.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new cr(e.changes[n]);t._textEditChanges[n]=r})))}Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(jn.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t=e;if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new cr(i),this._textEditChanges[t.uri]=r}return r}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new cr(i),this._textEditChanges[e]=r}return r},e.prototype.createFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(An.create(e,t))},e.prototype.renameFile=function(e,t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(xn.create(e,t,n))},e.prototype.deleteFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(Nn.create(e,t))},e.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")}}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return fr.defined(t)&&fr.string(t.uri)}}(Fn||(Fn={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return fr.defined(t)&&fr.string(t.uri)&&(null===t.version||fr.number(t.version))}}(jn||(jn={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return fr.defined(t)&&fr.string(t.uri)&&fr.string(t.languageId)&&fr.number(t.version)&&fr.string(t.text)}}(Un||(Un={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(Vn||(Vn={})),function(e){e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(Vn||(Vn={})),function(e){e.is=function(e){var t=e;return fr.objectLiteral(e)&&Vn.is(t.kind)&&fr.string(t.value)}}($n||($n={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(Wn||(Wn={})),function(e){e.PlainText=1,e.Snippet=2}(qn||(qn={})),function(e){e.Deprecated=1}(Kn||(Kn={})),function(e){e.create=function(e){return{label:e}}}(Bn||(Bn={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(Hn||(Hn={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return fr.string(t)||fr.objectLiteral(t)&&fr.string(t.language)&&fr.string(t.value)}}(Yn||(Yn={})),function(e){e.is=function(e){var t=e;return!!t&&fr.objectLiteral(t)&&($n.is(t.contents)||Yn.is(t.contents)||fr.typedArray(t.contents,Yn.is))&&(void 0===e.range||un.is(e.range))}}(Gn||(Gn={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(zn||(zn={})),function(e){e.create=function(e,t){for(var n=[],r=2;r=0;o--){var s=r[o],a=e.offsetAt(s.range.start),u=e.offsetAt(s.range.end);if(!(u<=i))throw new Error("Overlapping edit");n=n.substring(0,a)+s.newText+n.substring(u,n.length),i=a}return n}}(hr||(hr={}));var fr,dr=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return an.create(0,e);for(;ne?r=i:n=i+1}var o=n-1;return an.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1e?r=i:n=i+1}var o=n-1;return{line:o,character:e-t[o]}},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function Cr(e){var t=br(e.range);return t!==e.range?{newText:e.newText,range:t}:e}function _r(e,t){for(var n=[],r=2;rr&&i.push(n.substring(r,u)),a.newText.length&&i.push(a.newText),r=e.offsetAt(a.range.end)}return i.push(n.substr(r)),i.join("")}}(mr||(mr={})),function(e){e[e.Undefined=0]="Undefined",e[e.EnumValueMismatch=1]="EnumValueMismatch",e[e.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=258]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",e[e.InvalidUnicode=260]="InvalidUnicode",e[e.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",e[e.InvalidCharacter=262]="InvalidCharacter",e[e.PropertyExpected=513]="PropertyExpected",e[e.CommaExpected=514]="CommaExpected",e[e.ColonExpected=515]="ColonExpected",e[e.ValueExpected=516]="ValueExpected",e[e.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",e[e.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",e[e.TrailingComma=519]="TrailingComma",e[e.DuplicateKey=520]="DuplicateKey",e[e.CommentNotPermitted=521]="CommentNotPermitted",e[e.SchemaResolveError=768]="SchemaResolveError"}(gr||(gr={})),(pr||(pr={})).LATEST={textDocument:{completion:{completionItem:{documentationFormat:[Vn.Markdown,Vn.PlainText],commitCharactersSupport:!0}}}};var Er,Ar,xr=(Er=function(e,t){return(Er=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}Er(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Nr=Sr(),wr={"color-hex":{errorMessage:Nr("colorHexFormatWarning","Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA."),pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:Nr("dateTimeFormatWarning","String is not a RFC3339 date-time."),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:Nr("dateFormatWarning","String is not a RFC3339 date."),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:Nr("timeFormatWarning","String is not a RFC3339 time."),pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:Nr("emailFormatWarning","String is not an e-mail address."),pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},Lr=function(){function e(e,t,n){void 0===n&&(n=0),this.offset=t,this.length=n,this.parent=e}return Object.defineProperty(e.prototype,"children",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},e}(),Tr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="null",r.value=null,r}return xr(t,e),t}(Lr),kr=function(e){function t(t,n,r){var i=e.call(this,t,r)||this;return i.type="boolean",i.value=n,i}return xr(t,e),t}(Lr),Or=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="array",r.items=[],r}return xr(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.items},enumerable:!1,configurable:!0}),t}(Lr),Ir=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="number",r.isInteger=!0,r.value=Number.NaN,r}return xr(t,e),t}(Lr),Mr=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.type="string",i.value="",i}return xr(t,e),t}(Lr),Pr=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.type="property",i.colonOffset=-1,i.keyNode=r,i}return xr(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!1,configurable:!0}),t}(Lr),Rr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="object",r.properties=[],r}return xr(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.properties},enumerable:!1,configurable:!0}),t}(Lr);function Dr(e){return Dn(e)?e?{}:{not:{}}:e}!function(e){e[e.Key=0]="Key",e[e.Enum=1]="Enum"}(Ar||(Ar={}));var Fr=function(){function e(e,t){void 0===e&&(e=-1),this.focusOffset=e,this.exclude=t,this.schemas=[]}return e.prototype.add=function(e){this.schemas.push(e)},e.prototype.merge=function(e){Array.prototype.push.apply(this.schemas,e.schemas)},e.prototype.include=function(e){return(-1===this.focusOffset||Wr(e,this.focusOffset))&&e!==this.exclude},e.prototype.newSub=function(){return new e(-1,this.exclude)},e}(),jr=function(){function e(){}return Object.defineProperty(e.prototype,"schemas",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.add=function(e){},e.prototype.merge=function(e){},e.prototype.include=function(e){return!0},e.prototype.newSub=function(){return this},e.instance=new e,e}(),Ur=function(){function e(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=void 0}return e.prototype.hasProblems=function(){return!!this.problems.length},e.prototype.mergeAll=function(e){for(var t=0,n=e;t=e.offset&&t=0;)o.splice(t,1),t=o.indexOf(e)};if(t.properties)for(var g=0,p=Object.keys(t.properties);g0)for(var L=0,T=o;Lt.maxProperties&&n.problems.push({location:{offset:e.offset,length:e.length},severity:yn.Warning,message:Nr("MaxPropWarning","Object has more properties than limit of {0}.",t.maxProperties)});Pn(t.minProperties)&&e.properties.length=i.length&&n.propertiesValueMatches++}if(e.items.length>i.length)if("object"==typeof t.additionalItems)for(var u=i.length;ut.maxItems&&n.problems.push({location:{offset:e.offset,length:e.length},severity:yn.Warning,message:Nr("maxItemsWarning","Array has too many items. Expected {0} or fewer.",t.maxItems)});if(!0===t.uniqueItems){var m=Vr(e);m.some((function(e,t){return t!==m.lastIndexOf(e)}))&&n.problems.push({location:{offset:e.offset,length:e.length},severity:yn.Warning,message:Nr("uniqueItemsWarning","Array has duplicate items.")})}}(i,t,n,r);break;case"string":!function(e,t,n,r){Pn(t.minLength)&&e.value.lengtht.maxLength&&n.problems.push({location:{offset:e.offset,length:e.length},severity:yn.Warning,message:Nr("maxLengthWarning","String is longer than the maximum length of {0}.",t.maxLength)});if(i=t.pattern,"string"==typeof i){new RegExp(t.pattern).test(e.value)||n.problems.push({location:{offset:e.offset,length:e.length},severity:yn.Warning,message:t.patternErrorMessage||t.errorMessage||Nr("patternWarning",'String does not match the pattern of "{0}".',t.pattern)})}var i;if(t.format)switch(t.format){case"uri":case"uri-reference":var o=void 0;if(e.value){var s=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(e.value);s?s[2]||"uri"!==t.format||(o=Nr("uriSchemeMissing","URI with a scheme is expected.")):o=Nr("uriMissing","URI is expected.")}else o=Nr("uriEmpty","URI expected.");o&&n.problems.push({location:{offset:e.offset,length:e.length},severity:yn.Warning,message:t.patternErrorMessage||t.errorMessage||Nr("uriFormatWarning","String is not a URI: {0}",o)});break;case"color-hex":case"date-time":case"date":case"time":case"email":var a=wr[t.format];e.value&&a.pattern.exec(e.value)||n.problems.push({location:{offset:e.offset,length:e.length},severity:yn.Warning,message:t.patternErrorMessage||t.errorMessage||a.errorMessage})}}(i,t,n);break;case"number":!function(e,t,n,r){var i=e.value;function o(e){var t,n=/^(-?\d+)(?:\.(\d+))?(?:e([-+]\d+))?$/.exec(e.toString());return n&&{value:Number(n[1]+(n[2]||"")),multiplier:((null===(t=n[2])||void 0===t?void 0:t.length)||0)-(parseInt(n[3])||0)}}if(Pn(t.multipleOf)){var s=-1;if(Number.isInteger(t.multipleOf))s=i%t.multipleOf;else{var a=o(t.multipleOf),u=o(i);if(a&&u){var l=Math.pow(10,Math.abs(u.multiplier-a.multiplier));u.multiplier=d&&n.problems.push({location:{offset:e.offset,length:e.length},severity:yn.Warning,message:Nr("exclusiveMaximumWarning","Value is above the exclusive maximum of {0}.",d)});var m=h(t.minimum,t.exclusiveMinimum);Pn(m)&&ig&&n.problems.push({location:{offset:e.offset,length:e.length},severity:yn.Warning,message:Nr("maximumWarning","Value is above the maximum of {0}.",g)})}(i,t,n);break;case"property":return Kr(i.valueNode,t,n,r)}!function(){function e(e){return i.type===e||"integer"===e&&"number"===i.type&&i.isInteger}Array.isArray(t.type)?t.type.some(e)||n.problems.push({location:{offset:i.offset,length:i.length},severity:yn.Warning,message:t.errorMessage||Nr("typeArrayMismatchWarning","Incorrect type. Expected one of {0}.",t.type.join(", "))}):t.type&&(e(t.type)||n.problems.push({location:{offset:i.offset,length:i.length},severity:yn.Warning,message:t.errorMessage||Nr("typeMismatchWarning",'Incorrect type. Expected "{0}".',t.type)}));if(Array.isArray(t.allOf))for(var o=0,s=t.allOf;o0?s={schema:l,validationResult:c,matchingSchemas:h}:0===f&&(s.matchingSchemas.merge(h),s.validationResult.mergeEnumValues(c))}else s.matchingSchemas.merge(h),s.validationResult.propertiesMatches+=c.propertiesMatches,s.validationResult.propertiesValueMatches+=c.propertiesValueMatches;else s={schema:l,validationResult:c,matchingSchemas:h}}return o.length>1&&t&&n.problems.push({location:{offset:i.offset,length:1},severity:yn.Warning,message:Nr("oneOfWarning","Matches multiple schemas when only one must validate.")}),s&&(n.merge(s.validationResult),n.propertiesMatches+=s.validationResult.propertiesMatches,n.propertiesValueMatches+=s.validationResult.propertiesValueMatches,r.merge(s.matchingSchemas)),o.length};Array.isArray(t.anyOf)&&m(t.anyOf,!1);Array.isArray(t.oneOf)&&m(t.oneOf,!0);var g=function(e){var t=new Ur,o=r.newSub();Kr(i,Dr(e),t,o),n.merge(t),n.propertiesMatches+=t.propertiesMatches,n.propertiesValueMatches+=t.propertiesValueMatches,r.merge(o)},p=Dr(t.if);p&&function(e,t,n){var o=Dr(e),s=new Ur,a=r.newSub();Kr(i,o,s,a),r.merge(a),s.hasProblems()?n&&g(n):t&&g(t)}(p,Dr(t.then),Dr(t.else));if(Array.isArray(t.enum)){for(var v=Vr(i),y=!1,b=0,C=t.enum;b0){for(l--;l>0&&/\s/.test(i.charAt(l));)l--;c=l+1}if(u(e,t,l,c),n&&h(n,!1),r.length+s.length>0)for(var f=o.getToken();17!==f;){if(-1!==r.indexOf(f)){a();break}if(-1!==s.indexOf(f))break;f=a()}return n}function c(){switch(o.getTokenError()){case 4:return l(Nr("InvalidUnicode","Invalid unicode sequence in string."),gr.InvalidUnicode),!0;case 5:return l(Nr("InvalidEscapeCharacter","Invalid escape character in string."),gr.InvalidEscapeCharacter),!0;case 3:return l(Nr("UnexpectedEndOfNumber","Unexpected end of number."),gr.UnexpectedEndOfNumber),!0;case 1:return l(Nr("UnexpectedEndOfComment","Unexpected end of comment."),gr.UnexpectedEndOfComment),!0;case 2:return l(Nr("UnexpectedEndOfString","Unexpected end of string."),gr.UnexpectedEndOfString),!0;case 6:return l(Nr("InvalidCharacter","Invalid characters in string. Control characters must be escaped."),gr.InvalidCharacter),!0}return!1}function h(e,t){return e.length=o.getTokenOffset()+o.getTokenLength()-e.offset,t&&a(),e}var f=new Mr(void 0,0,0);function d(t,n){var r=new Pr(t,o.getTokenOffset(),f),i=m(r);if(!i){if(16!==o.getToken())return;l(Nr("DoubleQuotesExpected","Property keys must be doublequoted"),gr.Undefined);var s=new Mr(r,o.getTokenOffset(),o.getTokenLength());s.value=o.getTokenValue(),i=s,a()}r.keyNode=i;var c=n[i.value];if(c?(u(Nr("DuplicateKeyWarning","Duplicate object key"),gr.DuplicateKey,r.keyNode.offset,r.keyNode.offset+r.keyNode.length,yn.Warning),"object"==typeof c&&u(Nr("DuplicateKeyWarning","Duplicate object key"),gr.DuplicateKey,c.keyNode.offset,c.keyNode.offset+c.keyNode.length,yn.Warning),n[i.value]=!0):n[i.value]=r,6===o.getToken())r.colonOffset=o.getTokenOffset(),a();else if(l(Nr("ColonExpected","Colon expected"),gr.ColonExpected),10===o.getToken()&&e.positionAt(i.offset+i.length).line0?e.lastIndexOf(t)===n:0===n&&e===t}function Yr(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}var Gr=Sr(),zr=function(){function e(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=Promise),void 0===r&&(r={}),this.schemaService=e,this.contributions=t,this.promiseConstructor=n,this.clientCapabilities=r}return e.prototype.doResolve=function(e){for(var t=this.contributions.length-1;t>=0;t--){var n=this.contributions[t].resolveCompletion;if(n){var r=n(e);if(r)return r}}return this.promiseConstructor.resolve(e)},e.prototype.doComplete=function(e,t,n){var r=this,i={items:[],isIncomplete:!1},o=e.getText(),s=e.offsetAt(t),a=n.getNodeFromOffset(s,!0);if(this.isInComment(e,a?a.offset:0,s))return Promise.resolve(i);if(a&&s===a.offset+a.length&&s>0){var u=o[s-1];("object"===a.type&&"}"===u||"array"===a.type&&"]"===u)&&(a=a.parent)}var l,c=this.getCurrentWord(e,s);if(!a||"string"!==a.type&&"number"!==a.type&&"boolean"!==a.type&&"null"!==a.type){var h=s-c.length;h>0&&'"'===o[h-1]&&h--,l=un.create(e.positionAt(h),t)}else l=un.create(e.positionAt(a.offset),e.positionAt(a.offset+a.length));var f={},d={add:function(e){var t=e.label,n=f[t];if(n)n.documentation||(n.documentation=e.documentation);else{if((t=t.replace(/[\n]/g,"↵")).length>60){var r=t.substr(0,57).trim()+"...";f[r]||(t=r)}l&&void 0!==e.insertText&&(e.textEdit=Sn.replace(l,e.insertText)),e.label=t,f[t]=e,i.items.push(e)}},setAsIncomplete:function(){i.isIncomplete=!0},error:function(e){console.error(e)},log:function(e){console.log(e)},getNumberOfProposals:function(){return i.items.length}};return this.schemaService.getSchemaForResource(e.uri,n).then((function(t){var u=[],h=!0,m="",g=void 0;if(a&&"string"===a.type){var p=a.parent;p&&"property"===p.type&&p.keyNode===a&&(h=!p.valueNode,g=p,m=o.substr(a.offset+1,a.length-2),p&&(a=p.parent))}if(a&&"object"===a.type){if(a.offset===s)return i;a.properties.forEach((function(e){g&&g===e||(f[e.keyNode.value]=Bn.create("__"))}));var v="";h&&(v=r.evaluateSeparatorAfter(e,e.offsetAt(l.end))),t?r.getPropertyCompletions(t,n,a,h,v,d):r.getSchemaLessPropertyCompletions(n,a,m,d);var y=$r(a);r.contributions.forEach((function(t){var n=t.collectPropertyCompletions(e.uri,y,c,h,""===v,d);n&&u.push(n)})),!t&&c.length>0&&'"'!==o.charAt(s-c.length-1)&&(d.add({kind:Wn.Property,label:r.getLabelForValue(c),insertText:r.getInsertTextForProperty(c,void 0,!1,v),insertTextFormat:qn.Snippet,documentation:""}),d.setAsIncomplete())}var b={};return t?r.getValueCompletions(t,n,a,s,e,d,b):r.getSchemaLessValueCompletions(n,a,s,e,d),r.contributions.length>0&&r.getContributedValueCompletions(n,a,s,e,d,u),r.promiseConstructor.all(u).then((function(){if(0===d.getNumberOfProposals()){var t=s;!a||"string"!==a.type&&"number"!==a.type&&"boolean"!==a.type&&"null"!==a.type||(t=a.offset+a.length);var n=r.evaluateSeparatorAfter(e,t);r.addFillerValueCompletions(b,n,d)}return i}))}))},e.prototype.getPropertyCompletions=function(e,t,n,r,i,o){var s=this;t.getMatchingSchemas(e.schema,n.offset).forEach((function(e){if(e.node===n&&!e.inverted){var t=e.schema.properties;t&&Object.keys(t).forEach((function(e){var n=t[e];if("object"==typeof n&&!n.deprecationMessage&&!n.doNotSuggest){var a={kind:Wn.Property,label:e,insertText:s.getInsertTextForProperty(e,n,r,i),insertTextFormat:qn.Snippet,filterText:s.getFilterTextForValue(e),documentation:s.fromMarkup(n.markdownDescription)||n.description||""};void 0!==n.suggestSortText&&(a.sortText=n.suggestSortText),a.insertText&&Hr(a.insertText,"$1"+i)&&(a.command={title:"Suggest",command:"editor.action.triggerSuggest"}),o.add(a)}}));var a=e.schema.propertyNames;if("object"==typeof a&&!a.deprecationMessage&&!a.doNotSuggest){var u=function(e,t){void 0===t&&(t=void 0);var n={kind:Wn.Property,label:e,insertText:s.getInsertTextForProperty(e,void 0,r,i),insertTextFormat:qn.Snippet,filterText:s.getFilterTextForValue(e),documentation:t||s.fromMarkup(a.markdownDescription)||a.description||""};void 0!==a.suggestSortText&&(n.sortText=a.suggestSortText),n.insertText&&Hr(n.insertText,"$1"+i)&&(n.command={title:"Suggest",command:"editor.action.triggerSuggest"}),o.add(n)};if(a.enum)for(var l=0;l(t.colonOffset||0)){var l=t.valueNode;if(l&&(n>l.offset+l.length||"object"===l.type||"array"===l.type))return;var c=t.keyNode.value;e.visit((function(e){return"property"===e.type&&e.keyNode.value===c&&e.valueNode&&u(e.valueNode),!0})),"$schema"===c&&t.parent&&!t.parent.parent&&this.addDollarSchemaCompletions(a,i)}if("array"===t.type)if(t.parent&&"property"===t.parent.type){var h=t.parent.keyNode.value;e.visit((function(e){return"property"===e.type&&e.keyNode.value===h&&e.valueNode&&"array"===e.valueNode.type&&e.valueNode.items.forEach(u),!0}))}else t.items.forEach(u)},e.prototype.getValueCompletions=function(e,t,n,r,i,o,s){var a=r,u=void 0,l=void 0;if(!n||"string"!==n.type&&"number"!==n.type&&"boolean"!==n.type&&"null"!==n.type||(a=n.offset+n.length,l=n,n=n.parent),n){if("property"===n.type&&r>(n.colonOffset||0)){var c=n.valueNode;if(c&&r>c.offset+c.length)return;u=n.keyNode.value,n=n.parent}if(n&&(void 0!==u||"array"===n.type)){for(var h=this.evaluateSeparatorAfter(i,a),f=0,d=t.getMatchingSchemas(e.schema,n.offset,l);f(t.colonOffset||0)){var s=t.keyNode.value,a=t.valueNode;if((!a||n<=a.offset+a.length)&&t.parent){var u=$r(t.parent);this.contributions.forEach((function(e){var t=e.collectValueCompletions(r.uri,u,s,i);t&&o.push(t)}))}}}else this.contributions.forEach((function(e){var t=e.collectDefaultCompletions(r.uri,i);t&&o.push(t)}))},e.prototype.addSchemaValueCompletions=function(e,t,n,r){var i=this;"object"==typeof e&&(this.addEnumValueCompletions(e,t,n),this.addDefaultValueCompletions(e,t,n),this.collectTypes(e,r),Array.isArray(e.allOf)&&e.allOf.forEach((function(e){return i.addSchemaValueCompletions(e,t,n,r)})),Array.isArray(e.anyOf)&&e.anyOf.forEach((function(e){return i.addSchemaValueCompletions(e,t,n,r)})),Array.isArray(e.oneOf)&&e.oneOf.forEach((function(e){return i.addSchemaValueCompletions(e,t,n,r)})))},e.prototype.addDefaultValueCompletions=function(e,t,n,r){var i=this;void 0===r&&(r=0);var o=!1;if(Rn(e.default)){for(var s=e.type,a=e.default,u=r;u>0;u--)a=[a],s="array";n.add({kind:this.getSuggestionKind(s),label:this.getLabelForValue(a),insertText:this.getInsertTextForValue(a,t),insertTextFormat:qn.Snippet,detail:Gr("json.suggest.default","Default value")}),o=!0}Array.isArray(e.examples)&&e.examples.forEach((function(s){for(var a=e.type,u=s,l=r;l>0;l--)u=[u],a="array";n.add({kind:i.getSuggestionKind(a),label:i.getLabelForValue(u),insertText:i.getInsertTextForValue(u,t),insertTextFormat:qn.Snippet}),o=!0})),Array.isArray(e.defaultSnippets)&&e.defaultSnippets.forEach((function(s){var a,u,l=e.type,c=s.body,h=s.label;if(Rn(c)){e.type;for(var f=r;f>0;f--)c=[c],"array";a=i.getInsertTextForSnippetValue(c,t),u=i.getFilterTextForSnippetValue(c),h=h||i.getLabelForSnippetValue(c)}else{if("string"!=typeof s.bodyText)return;var d="",m="",g="";for(f=r;f>0;f--)d=d+g+"[\n",m=m+"\n"+g+"]",g+="\t",l="array";a=d+g+s.bodyText.split("\n").join("\n"+g)+m+t,h=h||a,u=a.replace(/[\n]/g,"")}n.add({kind:i.getSuggestionKind(l),label:h,documentation:i.fromMarkup(s.markdownDescription)||s.description,insertText:a,insertTextFormat:qn.Snippet,filterText:u}),o=!0})),!o&&"object"==typeof e.items&&!Array.isArray(e.items)&&r<5&&this.addDefaultValueCompletions(e.items,t,n,r+1)},e.prototype.addEnumValueCompletions=function(e,t,n){if(Rn(e.const)&&n.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(e.const),insertText:this.getInsertTextForValue(e.const,t),insertTextFormat:qn.Snippet,documentation:this.fromMarkup(e.markdownDescription)||e.description}),Array.isArray(e.enum))for(var r=0,i=e.enum.length;r0?t[0]:void 0}if(!e)return Wn.Value;switch(e){case"string":return Wn.Value;case"object":return Wn.Module;case"property":return Wn.Property;default:return Wn.Value}},e.prototype.getLabelTextForMatchingNode=function(e,t){switch(e.type){case"array":return"[]";case"object":return"{}";default:return t.getText().substr(e.offset,e.length)}},e.prototype.getInsertTextForMatchingNode=function(e,t,n){switch(e.type){case"array":return this.getInsertTextForValue([],n);case"object":return this.getInsertTextForValue({},n);default:var r=t.getText().substr(e.offset,e.length)+n;return this.getInsertTextForPlainText(r)}},e.prototype.getInsertTextForProperty=function(e,t,n,r){var i=this.getInsertTextForValue(e,"");if(!n)return i;var o,s=i+": ",a=0;if(t){if(Array.isArray(t.defaultSnippets)){if(1===t.defaultSnippets.length){var u=t.defaultSnippets[0].body;Rn(u)&&(o=this.getInsertTextForSnippetValue(u,""))}a+=t.defaultSnippets.length}if(t.enum&&(o||1!==t.enum.length||(o=this.getInsertTextForGuessedValue(t.enum[0],"")),a+=t.enum.length),Rn(t.default)&&(o||(o=this.getInsertTextForGuessedValue(t.default,"")),a++),Array.isArray(t.examples)&&t.examples.length&&(o||(o=this.getInsertTextForGuessedValue(t.examples[0],"")),a+=t.examples.length),0===a){var l=Array.isArray(t.type)?t.type[0]:t.type;switch(l||(t.properties?l="object":t.items&&(l="array")),l){case"boolean":o="$1";break;case"string":o='"$1"';break;case"object":o="{$1}";break;case"array":o="[$1]";break;case"number":case"integer":o="${1:0}";break;case"null":o="${1:null}";break;default:return i}}}return(!o||a>1)&&(o="$1"),s+o+r},e.prototype.getCurrentWord=function(e,t){for(var n=t-1,r=e.getText();n>=0&&-1===' \t\n\r\v":{[,]}'.indexOf(r.charAt(n));)n--;return r.substring(n+1,t)},e.prototype.evaluateSeparatorAfter=function(e,t){var n=Ln(e.getText(),!0);switch(n.setPosition(t),n.scan()){case 5:case 2:case 4:case 17:return"";default:return","}},e.prototype.findItemAtOffset=function(e,t,n){for(var r=Ln(t.getText(),!0),i=e.items,o=i.length-1;o>=0;o--){var s=i[o];if(n>s.offset+s.length)return r.setPosition(s.offset+s.length),5===r.scan()&&n>=r.getTokenOffset()+r.getTokenLength()?o+1:o;if(n>=s.offset)return o}return 0},e.prototype.isInComment=function(e,t,n){var r=Ln(e.getText(),!1);r.setPosition(t);for(var i=r.scan();17!==i&&r.getTokenOffset()+r.getTokenLength()i.offset+1&&r=0;c--){var h=this.contributions[c].getInfoContribution(e.uri,l);if(h)return h.then((function(e){return u(e)}))}return this.schemaService.getSchemaForResource(e.uri,n).then((function(e){if(e&&i){var t=n.getMatchingSchemas(e.schema,i.offset),r=void 0,o=void 0,s=void 0,a=void 0;t.every((function(e){if(e.node===i&&!e.inverted&&e.schema&&(r=r||e.schema.title,o=o||e.schema.markdownDescription||Qr(e.schema.description),e.schema.enum)){var t=e.schema.enum.indexOf(Vr(i));e.schema.markdownEnumDescriptions?s=e.schema.markdownEnumDescriptions[t]:e.schema.enumDescriptions&&(s=Qr(e.schema.enumDescriptions[t])),s&&"string"!=typeof(a=e.schema.enum[t])&&(a=JSON.stringify(a))}return!0}));var l="";return r&&(l=Qr(r)),o&&(l.length>0&&(l+="\n\n"),l+=o),s&&(l.length>0&&(l+="\n\n"),l+="`"+function(e){if(-1!==e.indexOf("`"))return"`` "+e+" ``";return e}(a)+"`: "+s),u([l])}return null}))},e}();function Qr(e){if(e)return e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,"$1\n\n$3").replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}var Zr=n(2),Xr=Sr(),ei=function(){function e(e,t){this.patternRegExps=[],this.isInclude=[];try{for(var n=0,r=e;n0;)this.callOnDispose.pop()()},e.prototype.onResourceChange=function(e){for(var t=this,n=!1,r=[e=si(e)],i=Object.keys(this.schemasById).map((function(e){return t.schemasById[e]}));r.length;)for(var o=r.pop(),s=0;s1&&(n=r[1]),Hr(n,".")&&(n=n.substr(0,n.length-1)),new ni({},[Xr("json.schema.nocontent","Unable to load schema from '{0}': {1}.",ai(e),n)])}))},e.prototype.resolveSchemaContent=function(e,t,n){var r=this,i=e.errors.slice(0),o=e.schema;if(o.$schema){var s=si(o.$schema);if("http://json-schema.org/draft-03/schema"===s)return this.promise.resolve(new ri({},[Xr("json.schema.draft03.notsupported","Draft-03 schemas are not supported.")]));"https://json-schema.org/draft/2019-09/schema"===s&&i.push(Xr("json.schema.draft201909.notsupported","Draft 2019-09 schemas are not yet fully supported."))}var a=this.contextService,u=function(e,t,n,r){var o=r?decodeURIComponent(r):void 0,s=function(e,t){if(!t)return e;var n=e;return"/"===t[0]&&(t=t.substr(1)),t.split("/").some((function(e){return!(n=n[e])})),n}(t,o);if(s)for(var a in s)s.hasOwnProperty(a)&&!e.hasOwnProperty(a)&&(e[a]=s[a]);else i.push(Xr("json.schema.invalidref","$ref '{0}' in '{1}' can not be resolved.",o,n))},l=function(e,t,n,o,s){a&&!/^\w+:\/\/.*/.test(t)&&(t=a.resolveRelativePath(t,o)),t=si(t);var l=r.getOrAddSchemaHandle(t);return l.getUnresolvedSchema().then((function(r){if(s[t]=!0,r.errors.length){var o=n?t+"#"+n:t;i.push(Xr("json.schema.problemloadingref","Problems loading reference '{0}': {1}",o,r.errors[0]))}return u(e,r.schema,t,n),c(e,r.schema,t,l.dependencies)}))},c=function(e,t,n,i){if(!e||"object"!=typeof e)return Promise.resolve(null);for(var o=[e],s=[],a=[],c=function(e){for(var r=[];e.$ref;){var s=e.$ref,c=s.split("#",2);if(delete e.$ref,c[0].length>0)return void a.push(l(e,c[0],c[1],n,i));-1===r.indexOf(s)&&(u(e,t,n,c[1]),r.push(s))}!function(){for(var e=[],t=0;t=0||(s.push(h),c(h))}return r.promise.all(a)};return c(o,o,t,n).then((function(e){return new ri(o,i)}))},e.prototype.getSchemaForResource=function(e,t){if(t&&t.root&&"object"===t.root.type){var n=t.root.properties.filter((function(e){return"$schema"===e.keyNode.value&&e.valueNode&&"string"===e.valueNode.type}));if(n.length>0){var r=n[0].valueNode;if(r&&"string"===r.type){var i=Vr(r);if(i&&function(e,t){if(e.length0?this.createCombinedSchema(e,a).getResolvedSchema():this.promise.resolve(void 0);return this.cachedSchemaForResource={resource:e,resolvedSchema:m},m},e.prototype.createCombinedSchema=function(e,t){if(1===t.length)return this.getOrAddSchemaHandle(t[0]);var n="schemaservice://combinedSchema/"+encodeURIComponent(e),r={allOf:t.map((function(e){return{$ref:e}}))};return this.addSchemaHandle(n,r)},e.prototype.getMatchingSchemas=function(e,t,n){if(n){var r=n.id||"schemaservice://untitled/matchingSchemas/"+oi++;return this.resolveSchemaContent(new ni(n),r,{}).then((function(e){return t.getMatchingSchemas(e.schema).filter((function(e){return!e.inverted}))}))}return this.getSchemaForResource(e.uri,t).then((function(e){return e?t.getMatchingSchemas(e.schema).filter((function(e){return!e.inverted})):[]}))},e}(),oi=0;function si(e){try{return Zr.a.parse(e).toString()}catch(t){return e}}function ai(e){try{var t=Zr.a.parse(e);if("file"===t.scheme)return t.fsPath}catch(e){}return e}var ui=Sr(),li=function(){function e(e,t){this.jsonSchemaService=e,this.promise=t,this.validationEnabled=!0}return e.prototype.configure=function(e){e&&(this.validationEnabled=e.validate,this.commentSeverity=e.allowComments?void 0:yn.Error)},e.prototype.doValidation=function(e,t,n,r){var i=this;if(!this.validationEnabled)return this.promise.resolve([]);var o=[],s={},a=function(e){var t=e.range.start.line+" "+e.range.start.character+" "+e.message;s[t]||(s[t]=!0,o.push(e))},u=function(r){var s=n?hi(n.trailingCommas):yn.Error,u=n?hi(n.comments):i.commentSeverity;if(r){if(r.errors.length&&t.root){var l=t.root,c="object"===l.type?l.properties[0]:void 0;if(c&&"$schema"===c.keyNode.value){var h=c.valueNode||c,f=un.create(e.positionAt(h.offset),e.positionAt(h.offset+h.length));a(Cn.create(f,r.errors[0],yn.Warning,gr.SchemaResolveError))}else{f=un.create(e.positionAt(l.offset),e.positionAt(l.offset+1));a(Cn.create(f,r.errors[0],yn.Warning,gr.SchemaResolveError))}}else{var d=t.validate(e,r.schema);d&&d.forEach(a)}(function e(t){if(t&&"object"==typeof t){if(Dn(t.allowComments))return t.allowComments;if(t.allOf)for(var n=0,r=t.allOf;n=gi&&e<=pi?e-gi+10:0)}function yi(e){if("#"===e[0])switch(e.length){case 4:return{red:17*vi(e.charCodeAt(1))/255,green:17*vi(e.charCodeAt(2))/255,blue:17*vi(e.charCodeAt(3))/255,alpha:1};case 5:return{red:17*vi(e.charCodeAt(1))/255,green:17*vi(e.charCodeAt(2))/255,blue:17*vi(e.charCodeAt(3))/255,alpha:17*vi(e.charCodeAt(4))/255};case 7:return{red:(16*vi(e.charCodeAt(1))+vi(e.charCodeAt(2)))/255,green:(16*vi(e.charCodeAt(3))+vi(e.charCodeAt(4)))/255,blue:(16*vi(e.charCodeAt(5))+vi(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(16*vi(e.charCodeAt(1))+vi(e.charCodeAt(2)))/255,green:(16*vi(e.charCodeAt(3))+vi(e.charCodeAt(4)))/255,blue:(16*vi(e.charCodeAt(5))+vi(e.charCodeAt(6)))/255,alpha:(16*vi(e.charCodeAt(7))+vi(e.charCodeAt(8)))/255}}}var bi=function(){function e(e){this.schemaService=e}return e.prototype.findDocumentSymbols=function(e,t,n){var r=this;void 0===n&&(n={resultLimit:Number.MAX_VALUE});var i=t.root;if(!i)return[];var o=n.resultLimit||Number.MAX_VALUE,s=e.uri;if(("vscode://defaultsettings/keybindings.json"===s||Hr(s.toLowerCase(),"/user/keybindings.json"))&&"array"===i.type){for(var a=[],u=0,l=i.items;u0){o--;var s=cn.create(e.uri,Ci(e,t)),a=n?n+"."+t.keyNode.value:t.keyNode.value;y.push({name:r.getKeyLabel(t),kind:r.getSymbolKind(i.type),location:s,containerName:n}),g.push({node:i,containerName:a})}else v=!0}))};p0){o--;var s=Ci(e,t),a=s,u={name:String(i),kind:r.getSymbolKind(t.type),range:s,selectionRange:a,children:[]};n.push(u),v.push({result:u.children,node:t})}else b=!0})):"object"===t.type&&t.properties.forEach((function(t){var i=t.valueNode;if(i)if(o>0){o--;var s=Ci(e,t),a=Ci(e,t.keyNode),u={name:r.getKeyLabel(t),kind:r.getSymbolKind(i.type),range:s,selectionRange:a,children:[]};n.push(u),v.push({result:u.children,node:i})}else b=!0}))};y0&&i[i.length-1].kind===c){l=i.pop();var h=e.positionAt(s.getTokenOffset()).line;l&&h>l.startLine+1&&o!==l.startLine&&(l.endLine=h-1,u(l),o=l.startLine)}break;case 13:var f=e.positionAt(s.getTokenOffset()).line,d=e.positionAt(s.getTokenOffset()+s.getTokenLength()).line;1===s.getTokenError()&&f+1=0&&i[g].kind!==gn.Region;)g--;if(g>=0){l=i[g];i.length=g,h>l.startLine&&o!==l.startLine&&(l.endLine=h,u(l),o=l.startLine)}}}}a=s.scan()}var p=t&&t.rangeLimit;if("number"!=typeof p||n.length<=p)return n;t&&t.onRangeLimitExceeded&&t.onRangeLimitExceeded(e.uri);for(var v=[],y=0,b=r;yp){_=g;break}C+=S}}var E=[];for(g=0;g=u&&i<=l&&a.push(r(u,l)),a.push(r(s.offset,s.offset+s.length));break;case"number":case"boolean":case"null":case"property":a.push(r(s.offset,s.offset+s.length))}if("property"===s.type||s.parent&&"array"===s.parent.type){var c=o(s.offset+s.length,5);-1!==c&&a.push(r(s.offset,c))}s=s.parent}for(var h=void 0,f=a.length-1;f>=0;f--)h=lr.create(a[f],h);return h||(h=lr.create(un.create(t,t))),h}))}function Oi(e,t,n){var r=e.offsetAt(t),i=n.getNodeFromOffset(r,!0);if(!i||!function(e){return"string"===e.type&&e.parent&&"property"===e.parent.type&&e.parent.valueNode===e&&"$ref"===e.parent.keyNode.value||!1}(i))return Promise.resolve([]);var o=i.parent.valueNode,s=function(e,t){var n=function(e){if("#"===e)return[];if("#"!==e[0]||"/"!==e[1])return null;return e.substring(2).split(/\//).map(Mi)}(t);if(!n)return null;return function e(t,n){if(!n)return null;if(0===t.length)return n;var r=t.shift();if(n&&"object"===n.type){var i=n.properties.find((function(e){return e.keyNode.value===r}));return i?e(t,i.valueNode):null}if(n&&"array"===n.type&&r.match(/^(0|[1-9][0-9]*)$/)){var o=Number.parseInt(r),s=n.items[o];return s?e(t,s):null}return null}(n,e.root)}(n,o.value);if(!s)return Promise.resolve([]);var a={targetUri:e.uri,originSelectionRange:Ii(e,o),targetRange:Ii(e,s),targetSelectionRange:Ii(e,s)};return Promise.resolve([a])}function Ii(e,t){return un.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length))}function Mi(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Pi(e){var t=e.promiseConstructor||Promise,n=new ii(e.schemaRequestService,e.workspaceContext,t);n.setSchemaContributions(Si);var r=new zr(n,e.contributions,t,e.clientCapabilities),i=new Jr(n,e.contributions,t),o=new bi(n),s=new li(n,t);return{configure:function(e){n.clearExternalSchemas(),e.schemas&&e.schemas.forEach((function(e){n.registerExternalSchema(e.uri,e.fileMatch,e.schema)})),s.configure(e)},resetSchema:function(e){return n.onResourceChange(e)},doValidation:s.doValidation.bind(s),parseJSONDocument:function(e){return Br(e,{collectComments:!0})},newJSONDocument:function(e,t){return function(e,t){return void 0===t&&(t=[]),new qr(e,t,[])}(e,t)},getMatchingSchemas:n.getMatchingSchemas.bind(n),doResolve:r.doResolve.bind(r),doComplete:r.doComplete.bind(r),findDocumentSymbols:o.findDocumentSymbols.bind(o),findDocumentSymbols2:o.findDocumentSymbols2.bind(o),findColorSymbols:function(e,t){return o.findDocumentColors(e,t).then((function(e){return e.map((function(e){return e.range}))}))},findDocumentColors:o.findDocumentColors.bind(o),getColorPresentations:o.getColorPresentations.bind(o),doHover:i.doHover.bind(i),getFoldingRanges:Ti,getSelectionRanges:ki,findDefinition:Oi,format:function(e,t,n){var r=void 0;if(t){var i=e.offsetAt(t.start);r={offset:i,length:e.offsetAt(t.end)-i}}var o={tabSize:n?n.tabSize:4,insertSpaces:!n||n.insertSpaces,eol:"\n"};return function(e,t,n){return tn(e,t,n)}(e.getText(),r,o).map((function(t){return Sn.replace(un.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length)),t.content)}))}}}var Ri,Di=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},Fi=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&0===e[e.length-1].length&&t.push("");var o=t.join("/");return 0===e[0].length&&(o="/"+o),o}self.onmessage=function(){Jt((function(e,t){return new ji(e,t)}))}}]); \ No newline at end of file